:root {
    /* Palette aligned with the public site (www/css/styles.css) */
    --mm-bg:            #060606;
    --mm-bg-elevated:   #0b0b0b;
    --mm-ink-2:         #111;
    --mm-surface:       #141414;
    --mm-surface-hover: #1a1a1a;
    --mm-surface-alt:   #161616;
    --mm-surface-pressed:#222;
    --mm-border:        transparent;
    --mm-border-subtle: transparent;
    --mm-border-strong: transparent;
    --mm-gold-1:        #d4b45a;
    --mm-gold-2:        #e8a85c;
    --mm-accent:        #d4b45a;
    --mm-accent-hover:  #efc98a;
    --mm-accent-active: #c4a45e;
    --mm-accent-soft:   rgba(212,180,90,.12);
    --mm-accent-glow:   rgba(212,180,90,.2);
    --mm-primary:       #d4b45a;
    --mm-primary-soft:  rgba(212,180,90,.12);
    --mm-danger:        #e74c3c;
    --mm-danger-soft:   rgba(231,76,60,.1);
    --mm-danger-strong: rgba(231,76,60,.16);
    --mm-success:       #2ecc71;
    --mm-success-soft:  rgba(46,204,113,.1);
    --mm-warning:       #f39c12;
    --mm-warning-soft:  rgba(243,156,18,.1);
    --mm-info:          #3498db;
    --mm-info-soft:     rgba(52,152,219,.1);
    --mm-text:          #fff;
    --mm-text-secondary:hsla(0,0%,100%,.72);
    --mm-text-muted:    hsla(0,0%,100%,.52);
    --mm-text-subtle:   hsla(0,0%,100%,.34);
    --mm-radius:        8px;
    --mm-radius-lg:     8px;
    --mm-radius-xl:     8px;
    --mm-radius-pill:   8px;
    --mm-shadow:        none;
    --mm-shadow-lg:     none;
    --mm-shadow-modal:  0 16px 40px rgba(0,0,0,.55);
    --mm-ease:          cubic-bezier(0.22, 1, 0.36, 1);
    --mm-transition:    0.18s var(--mm-ease);
    --mm-press:         90ms ease-out;
    --mm-font:          "Sen", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --sidebar-width:    248px;
}

/* Bridge Bootstrap's dark theme onto the site palette so unstyled
   components (list groups, dropdowns, focus rings…) stay on brand. */
[data-bs-theme=dark] {
    --bs-body-bg: var(--mm-bg);
    --bs-body-color: var(--mm-text);
    --bs-body-font-family: var(--mm-font);
    --bs-border-color: transparent;
    --bs-border-color-translucent: var(--mm-border);
    --bs-secondary-color: var(--mm-text-muted);
    --bs-tertiary-bg: var(--mm-surface);
    --bs-emphasis-color: var(--mm-text);
    --bs-primary: var(--mm-gold-1);
    --bs-primary-rgb: 212, 180, 90;
    --bs-link-color: var(--mm-gold-1);
    --bs-link-color-rgb: 212, 180, 90;
    --bs-link-hover-color: var(--mm-accent-hover);
    --bs-focus-ring-color: var(--mm-accent-glow);
    --bs-btn-close-color: #fff;
}

.dropdown-menu {
    --bs-dropdown-bg: #121212;
    --bs-dropdown-border-color: transparent;
    --bs-dropdown-link-hover-bg: var(--mm-surface-pressed);
    --bs-dropdown-link-active-bg: var(--mm-accent-soft);
    --bs-dropdown-border-radius: var(--mm-radius);
}

*,.sidebar-logout-btn,:after,:before { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Sortable nudges scrollTop on a timer. Smooth scrolling turns each nudge
   into an animation, so the list lags behind the pointer near the edges. */
html.is-sorting,html.is-sorting .app-main,html.is-sorting .sidebar-nav {
    scroll-behavior: auto;
}

body {
    background: var(--mm-bg);
    background-color: var(--mm-bg);
    color: var(--mm-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: .9375rem;
    line-height: 1.5;
}

body,button,h1,h2,h3,input,textarea {
    font-family: var(--mm-font);
}

::selection {
    background: var(--mm-accent-glow);
    color: var(--mm-text);
}

a { color: var(--mm-text); text-decoration: none; transition: color var(--mm-transition); }
a:hover { color: var(--mm-accent-hover); }

.icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    vertical-align: -.15em;
    color: #fff;
    fill: currentColor;
}

.icon-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.1rem 1rem;
}

.sidebar-tree-badge {
    font-size: .68rem;
    padding: .15rem .45rem;
    min-width: 1.4rem;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--mm-text) !important;
    letter-spacing: -.01em;
    line-height: 1;
}

.sidebar-brand-link:hover { color: var(--mm-accent-hover) !important; }

.sidebar-brand-link .icon { font-size: 1.25rem; opacity: .85; }

.sidebar-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: opacity var(--mm-transition), transform var(--mm-transition);
}

.sidebar-brand-link:hover .sidebar-brand-logo {
    opacity: .9;
    transform: scale(1.04);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--mm-bg-elevated);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 1020;
    transition: transform .3s var(--mm-ease), opacity .2s var(--mm-ease);
}

.app-sidebar,.sidebar-inner {
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    flex: 1;
    min-height: 0;
    padding: .85rem 0 0;
}

.sidebar-nav {
    overflow-x: hidden;
    padding: 0 .35rem .5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--mm-border-strong) transparent;
}

.app-main,.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.app-main {
    min-width: 0;
    padding: 1.75rem 2.25rem 2.75rem;
    max-width: 100%;
    height: 100vh;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .45rem;
}

.sidebar-group {
    margin-top: 1.35rem;
}

.sidebar-group-label {
    padding: .35rem .9rem .55rem;
    margin: 0 .45rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mm-text-subtle);
}

.sidebar-home-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0 .55rem;
    padding: .65rem .75rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--mm-text-secondary);
    border-radius: var(--mm-radius);
    letter-spacing: .005em;
    border-left: none;
    transition:
        color var(--mm-transition),
        background var(--mm-transition),
        box-shadow var(--mm-transition);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-home-link:hover {
    color: var(--mm-text);
    background: var(--mm-surface-hover);
}

.sidebar-home-link:active,.sidebar-home-link:focus,.sidebar-tree-item:active,.sidebar-tree-item:focus {
    color: var(--mm-text);
    background: var(--mm-surface-pressed);
    outline: none;
    box-shadow: none;
    transform: none;
}

.sidebar-home-link.active {
    color: var(--mm-text);
    background: var(--mm-surface-hover);
    font-weight: 700;
}

.sidebar-home-link .icon {
    opacity: 1;
    font-size: 1.05rem;
    color: #fff;
}

.sidebar-home-link.active .icon {
    opacity: 1;
    color: #fff;
}

.sidebar-tree-header {
    display: flex;
    align-items: stretch;
    margin: 0 .55rem .4rem;
    padding: 0;
}

.sidebar-tree-header .sidebar-home-link {
    flex: 1;
    min-width: 0;
    margin: 0;
    min-height: 2.75rem;
}

.sidebar-tree-tab {
    gap: .55rem;
}

.sidebar-tree-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0 -.15rem 0 0;
    color: var(--mm-text-muted);
    cursor: pointer;
    transition: color var(--mm-transition);
}

.sidebar-tree-tab:hover .sidebar-tree-chevron {
    color: var(--mm-text);
}

.sidebar-tree-chevron .icon {
    width: .75rem;
    height: .75rem;
    transform-origin: center;
    transform: rotate(0deg);
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}

.sidebar-tree-tab.expanded .sidebar-tree-chevron .icon {
    transform: rotate(90deg);
}

.sidebar-tree-list {
    list-style: none;
    margin: 0 .55rem .65rem 1.85rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--mm-ease);
}

.sidebar-tree-list.show {
    max-height: 900px;
}

.sidebar-tree-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .55rem .7rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--mm-text-secondary);
    border-radius: var(--mm-radius);
    transition: color var(--mm-transition), background var(--mm-transition);
    border-left: none;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-tree-item.active,.sidebar-tree-item:hover {
    color: var(--mm-text);
    background: var(--mm-surface-hover);
}

.sidebar-tree-item.active {
    font-weight: 700;
}

.sidebar-tree-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-tree-badge {
    font-size: .65rem;
    background: var(--mm-surface-alt);
    color: var(--mm-text-muted);
    padding: .12rem .4rem;
    border-radius: var(--mm-radius);
    font-weight: 700;
    min-width: 1.25rem;
    text-align: center;
}

.sidebar-user-footer {
    margin-top: auto;
    display: flex;
    align-items: stretch;
    gap: .45rem;
    padding: .85rem .75rem 1rem !important;
    background: transparent;
}

.sidebar-account {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .55rem;
    margin: 0;
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
    text-decoration: none;
    transition: background var(--mm-transition);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-account,.sidebar-account:hover {
    color: var(--mm-text);
}

.sidebar-account.is-active,.sidebar-account:hover {
    background: var(--mm-surface-hover);
}

.sidebar-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    flex-shrink: 0;
    border-radius: var(--mm-radius);
    background: var(--mm-accent-soft);
    color: var(--mm-gold-1);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.sidebar-account-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.sidebar-account-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--mm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-label {
    font-size: .68rem;
    font-weight: 500;
    color: var(--mm-text-muted);
}

.sidebar-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    width: auto;
    aspect-ratio: 1;
    align-self: stretch;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
    color: #fff;
    cursor: pointer;
    transition: background var(--mm-transition), color var(--mm-transition);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-logout-btn .icon {
    width: 1.05rem;
    height: 1.05rem;
    color: #fff;
}

.sidebar-logout-btn:hover {
    background: var(--mm-surface-hover);
    color: #fff;
}

.sidebar-logout-btn:active,.sidebar-logout-btn:focus,.sidebar-logout-btn:focus-visible {
    background: var(--mm-surface-pressed);
    outline: none;
    box-shadow: none;
    color: #fff;
}

.table {
    color: var(--mm-text);
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.table>:not(caption)>*>* {
    padding: .75rem .85rem;
    border-color: var(--mm-border) !important;
    vertical-align: middle;
}

.table>thead {
    --bs-table-bg: var(--mm-surface-pressed);
    --bs-table-color: var(--mm-text-secondary);
}

.table>thead>tr>* {
    background-color: var(--mm-surface-pressed);
    box-shadow: none;
}

.table>thead th {
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--mm-text-secondary);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.mm-th-sort {
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.table>thead>tr>.mm-th-sort:focus-visible,.table>thead>tr>.mm-th-sort:hover {
    color: var(--mm-text) !important;
    outline: none;
    background-color: color-mix(in srgb, #fff 8%, var(--mm-surface-pressed));
}

.mm-th-sort-inner {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.mm-th-label {
    min-width: 0;
    line-height: 1.2;
}

.sort-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: .5rem;
    flex-shrink: 0;
    line-height: 0;
}

.sort-arrow {
    width: .5rem;
    height: .3125rem;
    color: hsla(0,0%,100%,.35);
    transition: color var(--mm-transition);
}

.sort-arrow.is-on {
    color: var(--mm-gold-1);
}

.mm-th-actions {
    width: 1%;
}

.mm-td-drag,.mm-th-drag {
    width: 2.5rem;
    padding-left: .35rem !important;
    padding-right: .15rem !important;
    vertical-align: middle;
}

.row-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--mm-radius);
    background: transparent;
    color: var(--mm-text-subtle);
    cursor: grab;
    transition: color var(--mm-transition), background var(--mm-transition);
}

.row-handle:hover {
    color: var(--mm-text);
    background: var(--mm-surface-alt);
}

.row-handle:active {
    cursor: grabbing;
}

.row-handle .icon {
    width: 1rem;
    height: 1rem;
}

.page-toolbar-hint {
    margin: .35rem 0 0;
    font-size: .78rem;
    color: var(--mm-text-muted);
}

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1rem;
    margin-bottom: 1rem;
}

.page-toolbar-actions {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

.page-toolbar-actions .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.page-toolbar-actions .btn .icon {
    width: .95rem;
    height: .95rem;
}

.page-toolbar:has(.source-switch) {
    flex-direction: column;
    align-items: stretch;
}

.page-toolbar:has(.source-switch) .page-toolbar-actions {
    width: 100%;
}

.source-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    border: none;
    border-radius: var(--mm-radius);
    overflow: hidden;
    background: var(--mm-surface);
}

.source-switch-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--mm-radius);
    background: var(--mm-surface-pressed);
    pointer-events: none;
    z-index: 0;
    transition: transform .32s var(--mm-ease), width .32s var(--mm-ease);
}

.source-switch-btn {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: .4rem .7rem;
    border: none;
    background: transparent;
    color: var(--mm-text-secondary);
    font-family: var(--mm-font);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: color .32s var(--mm-ease);
}

.source-switch-btn.is-active {
    color: var(--mm-text);
}

@media (prefers-reduced-motion: reduce) {
    .source-switch-thumb,
    .source-switch-btn {
        transition: none;
    }
}

#sync-btn .icon,#sync-btn .sync-icon,.btn-primary .icon,.btn-primary .icon-stroke,.page-toolbar-actions .btn-primary .icon,.page-toolbar-actions .btn-primary .icon-stroke {
    color: var(--mm-bg) !important;
    fill: none;
    stroke: currentColor;
}

#sync-btn.is-syncing .sync-icon {
    animation: mmSyncSpin .7s linear infinite;
}

@keyframes mmSyncSpin {
    to { transform: rotate(1turn); }
}

.table-shell {
    background: var(--mm-surface);
    border-radius: var(--mm-radius-lg);
    overflow: hidden;
}

.mm-data-table {
    margin: 0;
}

.mm-data-table tbody tr.is-row-inactive {
    opacity: .55;
}

.sidebar-tree-item.is-muted {
    color: var(--mm-text-subtle);
    font-size: .8rem;
}

.sidebar-tree-item.is-muted:hover {
    color: var(--mm-text-muted);
}

.sidebar-tree-btn-wrap {
    margin-top: .35rem;
    padding: 0 .15rem .15rem;
}

.sidebar-tree-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    margin: 0;
    padding: .2rem .15rem;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: color var(--mm-transition);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-tree-btn:hover,
.sidebar-tree-btn.active,
.sidebar-tree-btn:active {
    color: var(--mm-gold-1);
    background: transparent;
    border: none;
}

.sidebar-tree-btn:focus-visible {
    color: var(--mm-gold-1);
    background: transparent;
    outline: 2px solid var(--mm-gold-1);
    outline-offset: 3px;
}

.sidebar-tree-btn:active,.sidebar-tree-btn:focus {
    box-shadow: none;
}

.sidebar-tree-btn .sidebar-tree-item-name {
    flex: 0 1 auto;
    text-align: center;
}

.table>tbody>tr:nth-child(odd)>* {
    background-color: var(--mm-surface);
}

.table>tbody>tr:nth-child(2n)>* {
    background-color: color-mix(in srgb, var(--mm-surface) 55%, var(--mm-surface-pressed));
}

.table-hover>tbody>tr:hover>* {
    background-color: color-mix(in srgb, var(--mm-surface) 25%, var(--mm-surface-pressed)) !important;
}

.btn {
    font-family: var(--mm-font);
    font-size: .8125rem;
    font-weight: 700;
    border-radius: var(--mm-radius-pill);
    min-height: 2.75rem;
    padding: .55rem 1.25rem;
    transition:
        opacity var(--mm-transition),
        background var(--mm-transition),
        border-color var(--mm-transition),
        color var(--mm-transition),
        box-shadow var(--mm-transition),
        transform var(--mm-press);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: auto;
    margin-top: 0;
    border: none;
    background-image: none;
    background-size: unset;
    letter-spacing: .01em;
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn .icon { font-size: .9em; }

.btn.show,.btn:active,.btn:focus,.btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.btn:active {
    transform: scale(.97);
    opacity: .92;
}

.btn-primary {
    --bs-btn-color: var(--mm-bg);
    --bs-btn-bg: var(--mm-gold-1);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--mm-bg);
    --bs-btn-hover-bg: var(--mm-accent-hover);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 212, 180, 90;
    --bs-btn-active-color: var(--mm-bg);
    --bs-btn-active-bg: var(--mm-accent-active);
    --bs-btn-active-border-color: transparent;
    --bs-btn-active-shadow: none;
    --bs-btn-disabled-color: var(--mm-bg);
    --bs-btn-disabled-bg: var(--mm-gold-1);
    --bs-btn-disabled-border-color: transparent;
    background: var(--mm-gold-1) !important;
    background-color: var(--mm-gold-1) !important;
    border-color: transparent !important;
    color: var(--mm-bg) !important;
    font-weight: 700;
    box-shadow: none !important;
}

.btn-primary.active,.btn-primary.disabled,.btn-primary.show,.btn-primary:active,.btn-primary:disabled,.btn-primary:focus,.btn-primary:focus-visible,.btn-primary:hover {
    background: var(--mm-accent-hover) !important;
    background-color: var(--mm-accent-hover) !important;
    border-color: transparent !important;
    color: var(--mm-bg) !important;
    opacity: 1;
    box-shadow: none !important;
}

.btn-primary.disabled,.btn-primary:disabled {
    background: var(--mm-gold-1) !important;
    background-color: var(--mm-gold-1) !important;
    opacity: .65;
}

.btn-primary.active,.btn-primary:active {
    background: var(--mm-accent-active) !important;
    background-color: var(--mm-accent-active) !important;
}

.btn-outline-secondary {
    color: var(--mm-text-secondary);
    border-color: transparent;
    background: var(--mm-surface-hover);
}

.btn-outline-secondary:hover {
    background: var(--mm-surface-pressed);
    border-color: transparent;
    color: var(--mm-text);
}

.btn-danger {
    background: var(--mm-danger);
    border-color: var(--mm-danger);
    color: var(--mm-text);
}

.btn-danger:hover {
    background: #d64233;
    border-color: #d64233;
}

.btn.disabled,.btn:disabled {
    pointer-events: none;
    opacity: .4;
}

.btn-sm {
    min-height: 2.25rem;
    font-size: .6875rem;
    padding: .35rem .7rem;
}

.action-btn-group {
    gap: .35rem;
}

.action-btn,.action-btn-group {
    display: inline-flex;
    align-items: center;
}

.action-btn {
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    margin: 0;
    border-radius: var(--mm-radius);
    font-size: .85rem;
    transition: background var(--mm-transition), transform var(--mm-press), opacity var(--mm-transition);
    border: none;
    background: #2c2c2c;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
}

.action-btn .icon {
    width: 1rem;
    height: 1rem;
    color: #fff;
    pointer-events: none;
}

.action-btn:hover {
    background: #3a3a3a;
    color: #fff;
    transform: none;
    box-shadow: none;
}

.action-btn:active {
    transform: scale(.96);
}

.action-btn-delete,.action-btn-edit,.action-btn-unlock {
    color: #fff;
    background: #2c2c2c;
    border: none;
}

.action-btn-delete:hover,.action-btn-edit:hover,.action-btn-unlock:hover {
    background: #3a3a3a;
    color: #fff;
}

.sortable-ghost {
    opacity: .35;
}

.sortable-chosen {
    z-index: 5;
}

.sortable-drag,.sortable-fallback {
    opacity: 1 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.28);
    cursor: grabbing !important;
    background: var(--mm-surface-pressed) !important;
    border-radius: var(--mm-radius-lg);
    /* The fallback is translated on every pointer move. A transition here
       makes that translation ease over time, so the row trails the cursor. */
    transition: none !important;
    will-change: transform;
}

html.is-sorting .table-hover>tbody>tr {
    transition: none;
}

.mm-data-table tbody tr.sortable-ghost {
    opacity: .35;
}

/* The lifted row is appended to document.body. A bare tr there generates
   anonymous table boxes and lays out the page on every pointer move.
   Grid tracks are the original column widths, so actions stay on the right edge. */
tr.sortable-fallback {
    display: grid !important;
}

tr.sortable-fallback,tr.sortable-fallback>td {
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

tr.sortable-fallback>td {
    display: flex;
    min-width: 0;
    background: transparent !important;
}

.folder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    border-radius: var(--mm-radius-lg);
}

.folder-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .75rem .45rem .35rem;
    background: var(--mm-surface);
    border-radius: var(--mm-radius-lg);
    transition: background var(--mm-transition);
}

.folder-row:hover {
    background: var(--mm-surface-alt);
}

.folder-row .action-btn-group,
.folder-row .folder-chevron-link {
    flex-shrink: 0;
}

.folder-row .action-btn-group .mm-switch {
    margin-inline-end: 1rem;
}

.folder-row.is-inactive .folder-name,
.folder-row.is-inactive:hover .folder-name,
.folder-row.is-inactive .folder-open:hover .folder-name {
    color: var(--mm-text-muted);
}

.folder-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: none;
    border-radius: var(--mm-radius);
    background: transparent;
    color: var(--mm-text-subtle);
    cursor: grab;
    transition: color var(--mm-transition), background var(--mm-transition);
}

.folder-handle:hover {
    color: var(--mm-text);
    background: var(--mm-surface-alt);
}

.folder-handle:active {
    cursor: grabbing;
}

.folder-handle .icon {
    width: 1rem;
    height: 1rem;
}

.folder-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .35rem .5rem;
    border-radius: var(--mm-radius);
    color: var(--mm-text);
    text-decoration: none;
    background: transparent;
}

.folder-open:hover,
.folder-open:active,
.folder-open:focus,
.folder-open:focus-visible {
    color: var(--mm-text);
    background: transparent;
}

.folder-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.folder-name {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mm-text);
}

.folder-open:hover .folder-name,
.folder-row:hover .folder-name {
    color: var(--mm-text);
}

.folder-hint {
    font-size: .75rem;
    font-weight: 500;
    color: var(--mm-text-muted);
}

.folder-chevron,
.folder-chevron-link {
    display: inline-flex;
    align-items: center;
    color: var(--mm-text-subtle);
    transition: transform .2s var(--mm-ease), color var(--mm-transition);
}

.folder-chevron-link {
    padding: .35rem;
    border-radius: var(--mm-radius);
}

.folder-chevron-link:hover {
    color: var(--mm-gold-1);
}

.folder-chevron-link:hover .folder-chevron {
    transform: translateX(3px);
}

.folder-empty {
    padding: 1.25rem 1rem;
    background: var(--mm-surface);
    border-radius: var(--mm-radius-lg);
}

.folder-back {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: .65rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mm-text-muted);
}

.folder-back:hover {
    color: var(--mm-gold-1);
}

.folder-back-chevron {
    transform: rotate(180deg);
    width: .85rem;
    height: .85rem;
}

.page-vis-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.page-vis-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--mm-surface);
    border-radius: var(--mm-radius-lg);
}

.page-vis-row.is-inactive .folder-name {
    color: var(--mm-text-muted);
}

.page-vis-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

/* Custom switch — dark track, white thumb, gold when on. No blue. */
.mm-switch {
    --mm-switch-w: 1.85rem;
    --mm-switch-h: 1.05rem;
    --mm-switch-pad: 0.12rem;
    --mm-switch-thumb: 0.8rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    width: var(--mm-switch-w);
    height: var(--mm-switch-h);
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-shadow: none;
    transition: transform .12s ease-out;
}

.mm-switch:active:not(:disabled) {
    transform: scale(.96);
}

.mm-switch:active,.mm-switch:focus,.mm-switch:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.mm-switch:focus-visible .mm-switch-track {
    box-shadow: 0 0 0 2px var(--mm-bg), 0 0 0 4px var(--mm-gold-1);
}

.mm-switch-track {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #1c1c1c;
    box-shadow: inset 0 0 0 1px hsla(0,0%,100%,.12);
    transition: background .28s var(--mm-ease), box-shadow .28s var(--mm-ease);
}

.mm-switch[aria-checked=true] .mm-switch-track {
    background: var(--mm-gold-1);
    box-shadow: none;
}

.mm-switch-thumb {
    position: absolute;
    top: 50%;
    left: var(--mm-switch-pad);
    width: var(--mm-switch-thumb);
    height: var(--mm-switch-thumb);
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
    transition: transform .32s cubic-bezier(.22, 1.2, .36, 1);
    z-index: 1;
}

.mm-switch[aria-checked=true] .mm-switch-thumb {
    transform: translate3d(calc(var(--mm-switch-w) - var(--mm-switch-thumb) - var(--mm-switch-pad) * 2), -50%, 0);
}

.mm-switch:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Kill Bootstrap blue on native switches / checkboxes / buttons */

.btn:active,.btn:focus,.btn:focus-visible,.form-control:active,a:active {
    box-shadow: none !important;
    outline-color: var(--mm-gold-1);
}

.btn-primary.active,.btn-primary:active,.btn-primary:focus {
    background: var(--mm-accent-active) !important;
    border-color: transparent !important;
    color: var(--mm-bg) !important;
    box-shadow: none !important;
}

.btn-outline-secondary:active,.btn-outline-secondary:focus {
    background: var(--mm-surface-pressed) !important;
    color: var(--mm-text) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.form-control,textarea {
    font-family: var(--mm-font);
    font-size: .9rem;
    font-weight: 500;
    background-color: var(--mm-surface-hover) !important;
    border: none !important;
    border-radius: var(--mm-radius);
    color: var(--mm-text) !important;
    min-height: 2.75rem;
    padding: .55rem .85rem;
    transition: background var(--mm-transition);
    letter-spacing: .01em;
    box-shadow: none !important;
    outline: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.form-control::placeholder,textarea::placeholder {
    color: var(--mm-text-muted) !important;
}

.form-control:focus,.form-control:focus-visible,textarea:focus,textarea:focus-visible {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    background-color: var(--mm-surface-pressed) !important;
}

.form-label {
    font-size: .8125rem;
    font-weight: 700;
    color: var(--mm-text-secondary);
    margin-bottom: .35rem;
    letter-spacing: .01em;
}

:focus-visible {
    outline: 2px solid var(--mm-gold-2);
    outline-offset: 3px;
}

.btn:focus-visible,.form-control:focus-visible,.mm-select-trigger:focus-visible,textarea:focus-visible {
    outline: none;
}

.form-text {
    font-size: .75rem;
    color: var(--mm-text-muted) !important;
}

.settings-form {
    max-width: 32rem;
}

.home-page {
    max-width: 1080px;
    animation: homeEnter .45s var(--mm-ease) both;
}

@keyframes homeEnter {
    0% { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 2.25rem;
    text-align: center;
}

.home-hero-logo {
    width: calc(clamp(88px, 14vw, 128px));
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.home-title {
    font-size: calc(clamp(1.85rem, 3.6vw, 2.6rem));
    font-weight: 700;
    color: var(--mm-text);
    margin: 0;
    letter-spacing: -.03em;
    line-height: 1.1;
    text-align: center;
    background: none;
    -webkit-text-fill-color: unset;
}

.home-hero:after {
    display: none;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--mm-surface);
    border: none;
    border-radius: var(--mm-radius-lg);
    padding: 1.25rem 1.1rem 1.15rem;
    text-align: left;
    box-shadow: none;
    transition: background var(--mm-transition), transform var(--mm-press);
    animation: cardRise .4s var(--mm-ease) both;
}

.stat-card:first-child { animation-delay: .04s; }
.stat-card:nth-child(2) { animation-delay: .09s; }
.stat-card:nth-child(3) { animation-delay: .14s; }
.stat-card:nth-child(4) { animation-delay: .19s; }

@keyframes cardRise {
    0% { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.stat-card:hover {
    background: var(--mm-surface-hover);
    transform: none;
    box-shadow: none;
}

.stat-card:active {
    transform: translateY(-1px) scale(.99);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: .75rem;
    border-radius: var(--mm-radius);
    font-size: .95rem;
}

.stat-icon,.stat-icon.text-boisson,.stat-icon.text-repas {
    color: #fff;
    background: var(--mm-surface-hover);
}

.stat-value {
    font-size: calc(clamp(1.75rem, 2.5vw, 2.15rem));
    font-weight: 700;
    color: var(--mm-text);
    line-height: 1;
    margin-bottom: .4rem;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: .8rem;
    color: var(--mm-text-muted);
    letter-spacing: .02em;
    font-weight: 500;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.browse-all-card {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--mm-surface);
    border: none;
    border-radius: var(--mm-radius-lg);
    padding: 1.2rem 1.25rem;
    box-shadow: none;
    transition: background var(--mm-transition), transform var(--mm-press);
    animation: cardRise .4s var(--mm-ease) both;
    animation-delay: .12s;
    cursor: pointer;
    color: var(--mm-text);
}

.browse-all-card:nth-child(2) { animation-delay: .3s; }

.browse-all-card:hover {
    background: var(--mm-surface-hover);
    color: var(--mm-text);
    transform: none;
    box-shadow: none;
}

.browse-all-card:active {
    transform: translateY(-1px) scale(.99);
}

.browse-all-inner {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.browse-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: var(--mm-radius);
    background: var(--mm-surface-hover);
    color: #fff;
    font-size: 1.15rem;
    transition: background var(--mm-transition);
}

.browse-all-card:hover .browse-all-icon {
    background: var(--mm-surface-pressed);
}

.browse-all-inner .icon:first-child {
    font-size: 1.25rem;
    color: #fff;
}

.browse-all-copy {
    flex: 1;
    min-width: 0;
}

.browse-all-copy strong,.browse-all-inner strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin-bottom: .15rem;
}

.browse-all-copy span,.browse-all-inner .text-muted {
    font-size: .82rem;
    color: var(--mm-text-muted);
}

.browse-all-chevron {
    color: #fff;
    font-size: 1.1rem;
    transition: transform var(--mm-transition), opacity var(--mm-transition);
    opacity: .55;
}

.browse-all-card:hover .browse-all-chevron {
    color: #fff;
    opacity: 1;
    transform: translateX(3px);
}

@media(max-width:767.98px) {
    .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-actions { grid-template-columns: 1fr; }
}

.alert {
    border-radius: var(--mm-radius);
    border: none !important;
    box-shadow: none;
    font-size: .875rem;
    font-weight: 500;
}

.alert-success {
    color: var(--mm-success);
    background: var(--mm-success-soft);
}

.alert-danger {
    color: var(--mm-danger);
    background: var(--mm-danger-soft);
}

.alert-warning {
    color: var(--mm-warning);
    background: var(--mm-warning-soft);
}

.mm-modal,body.mm-modal-open {
    overflow: hidden;
}

#app-modal-root:empty {
    display: none;
}

.mm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: rgba(0,0,0,.72);
    animation: mmModalFade .18s var(--mm-ease) both;
}

.mm-modal {
    width: min(100%, 520px);
    max-height: calc(min(92dvh, 840px));
    display: flex;
    flex-direction: column;
    background: var(--mm-surface);
    border-radius: var(--mm-radius-xl);
    box-shadow: var(--mm-shadow-modal);
    animation: mmModalRise .22s var(--mm-ease) both;
}

.mm-modal-wide {
    width: min(100%, 720px);
}

.mm-modal-confirm {
    width: min(100%, 400px);
}

.mm-modal-confirm .mm-modal-header {
    justify-content: flex-end;
    padding-bottom: 0;
}

.mm-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .85rem;
    padding: .35rem 1.35rem 1.35rem;
}

.mm-confirm-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--mm-radius-xl);
    background: var(--mm-warning-soft);
    color: var(--mm-warning);
    box-shadow: 0 0 0 1px rgba(243,156,18,.12);
}

.mm-confirm-glyph .icon {
    width: 2rem;
    height: 2rem;
}

.mm-confirm-heading {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--mm-text);
    text-transform: none;
}

.mm-confirm-message {
    margin: 0;
    max-width: 22rem;
    font-size: .92rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--mm-text-muted);
}

.mm-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    width: 100%;
    margin-top: .35rem;
}

.mm-confirm-actions .btn {
    width: 100%;
    justify-content: center;
}

.mm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem .85rem;
    flex-shrink: 0;
}

.mm-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--mm-text);
}

.mm-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--mm-radius);
    background: var(--mm-surface-hover);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mm-modal-close:hover {
    background: var(--mm-surface-pressed);
}

.mm-modal-close:active,.mm-modal-close:focus {
    outline: none;
    box-shadow: none;
    background: var(--mm-surface-pressed);
}

.mm-modal-close .icon {
    width: 1rem;
    height: 1rem;
}

.mm-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.mm-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: .25rem 1.25rem 1rem;
    scroll-behavior: smooth;
}

.mm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    padding: .85rem 1.25rem 1.15rem;
    flex-shrink: 0;
    background: var(--mm-surface);
}

.mm-field {
    margin-bottom: .95rem;
}

.mm-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
}

.mm-field-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .85rem;
    margin-bottom: 1.1rem;
    background: var(--mm-surface-hover);
    border-radius: var(--mm-radius);
}

.mm-section-label {
    margin: .35rem 0 .75rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mm-text-subtle);
}

.search-inline {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.search-inline-icon {
    position: absolute;
    left: .7rem;
    display: inline-flex;
    color: var(--mm-text-muted);
    pointer-events: none;
    z-index: 1;
}

.search-inline-icon .icon {
    width: .95rem;
    height: .95rem;
}

.search-inline .form-control {
    min-height: 2.35rem;
    padding-left: 2.15rem;
    width: 100%;
}

/* Flat custom select — chevron rotate */
.mm-select {
    position: relative;
    width: 100%;
}

.mm-select-trigger {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 2.75rem;
    padding: .55rem .75rem .55rem .85rem;
    border: none;
    border-radius: var(--mm-radius);
    background: var(--mm-surface-hover);
    color: var(--mm-text);
    font-family: var(--mm-font);
    font-size: .9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--mm-transition);
}

.mm-select-trigger:active,.mm-select-trigger:focus,.mm-select-trigger:hover,.mm-select.is-open .mm-select-trigger {
    background: var(--mm-surface-pressed);
}

.mm-select-trigger:active,.mm-select-trigger:focus {
    outline: none;
    box-shadow: none;
}

.mm-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-select-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--mm-text-muted);
    transform-origin: center;
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}

.mm-select.is-open .mm-select-chevron {
    transform: rotate(180deg);
    color: var(--mm-gold-1);
}

.mm-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + .35rem);
    z-index: 20;
    max-height: 14rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .4rem;
    background: var(--mm-ink-2);
    border: none;
    border-radius: var(--mm-radius);
    box-shadow: 0 12px 28px rgba(0,0,0,.45);
    scroll-behavior: smooth;
}

@keyframes mmModalFade {
    0% { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mmModalRise {
    0% { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media(max-width:640px) {
    .mm-field-row {
        grid-template-columns: 1fr;
    }

    .mm-modal,.mm-modal-wide {
        width: 100%;
        max-height: 94dvh;
    }
}

.form-text,.text-bg-secondary,.text-muted {
    color: var(--mm-text-muted) !important;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mm-border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--mm-text-muted); }

.badge {
    border-radius: var(--mm-radius);
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.text-bg-secondary {
    background-color: var(--mm-surface-alt) !important;
}
.text-danger { color: var(--mm-danger) !important; }

.app-main {
    animation: fadeIn .2s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1 {
    text-align: left;
    margin-bottom: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.01em;
    background: none;
    -webkit-text-fill-color: unset;
}

h2 {
    font-size: 1.1rem;
}

h2,h3 {
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--mm-text);
    margin-bottom: 0;
}

@media(max-width:991.98px) {
    .app-sidebar {
        width: 200px;
        min-width: 200px;
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none !important;
    }

    .app-main {
        padding: 1.15rem 1.1rem 2rem;
    }

    .home-hero-logo {
        width: 72px;
    }

    .folder-hint {
        display: none;
    }
}

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2.5rem 1.25rem;
    overflow: hidden;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2.25rem 2rem;
    background: var(--mm-surface);
    border: none;
    border-radius: var(--mm-radius-xl);
    box-shadow: none;
    text-align: center;
    animation: homeEnter .4s var(--mm-ease) both;
}

.login-logo-img {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.015em;
    text-align: center;
    color: var(--mm-text);
}

.login-lead {
    margin: .85rem 0 0;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--mm-text-muted);
    text-align: center;
}

.login-account {
    display: block;
    margin-top: .35rem;
    font-weight: 700;
    color: var(--mm-text);
    word-break: break-all;
}

.login-form {
    margin-top: 1.75rem;
    text-align: left;
}

.login-field+.login-field { margin-top: 1rem; }

.login-turnstile {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65px;
    width: 100%;
    margin-top: 1.25rem;
    padding: .35rem;
    overflow: hidden;
    border-radius: var(--mm-radius);
    background: var(--mm-surface-hover);
    line-height: 0;
}

.login-turnstile-status {
    display: block;
    width: 100%;
    padding: .85rem 1rem;
    font-size: .8rem;
    color: var(--mm-text-muted);
    text-align: center;
    line-height: 1.35;
}

/*
 * Clip Turnstile iframe chrome (overflow + negative margin).
 * Manager uses size=flexible, so the clip tracks the host width.
 */
.login-turnstile-clip {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.login-turnstile-clip>div:not(.login-turnstile-status) {
    margin: -2px !important;
    width: calc(100% + 4px) !important;
}

.login-turnstile-clip iframe {
    display: block;
    margin: -2px !important;
    max-width: none;
}

.login-form .form-control {
    min-height: 3rem;
    border-radius: var(--mm-radius);
}

.login-password { position: relative; }

.login-password .form-control { padding-right: 3rem; }

.login-password .form-control:hover:not(:focus) {
    background-color: var(--mm-surface-hover) !important;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: .4rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    min-height: 0;
    border: none;
    border-radius: var(--mm-radius);
    background: transparent;
    color: var(--mm-text-muted);
    cursor: pointer;
    transition: color var(--mm-transition), background-color var(--mm-transition), transform var(--mm-press);
}

.login-password-toggle .icon {
    width: 1.15rem;
    height: 1.15rem;
    color: currentColor;
}

.login-password-toggle:focus-visible,.login-password-toggle:hover {
    color: #fff;
    background: transparent;
    outline: none;
    box-shadow: none;
}

.login-password-toggle:active {
    transform: translateY(-50%) scale(.94);
}

.login-alert {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1.1rem 0 0;
    border: none;
    box-shadow: none;
}

.login-submit {
    width: 100%;
    min-height: 3rem;
    margin-top: 1.5rem;
    font-size: .95rem;
    background: var(--mm-gold-1) !important;
    background-color: var(--mm-gold-1) !important;
    color: var(--mm-bg) !important;
    border: none !important;
    box-shadow: none !important;
}

.login-submit.active,.login-submit.disabled,.login-submit:active,.login-submit:disabled,.login-submit:focus,.login-submit:focus-visible,.login-submit:hover {
    background: var(--mm-accent-hover) !important;
    background-color: var(--mm-accent-hover) !important;
    color: var(--mm-bg) !important;
    border: none !important;
    box-shadow: none !important;
}

.login-submit.disabled,.login-submit:disabled {
    background: var(--mm-gold-1) !important;
    background-color: var(--mm-gold-1) !important;
    opacity: .65;
}

.login-submit .spinner-border {
    width: .95rem;
    height: .95rem;
    border-width: .15em;
    color: var(--mm-bg);
    border-right-color: transparent;
    vertical-align: -.1em;
}

.login-submit:disabled { opacity: .65; }

.login-footnote {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--mm-border-subtle);
    font-size: .8rem;
    color: var(--mm-text-subtle);
}

.login-footnote a { color: var(--mm-text-muted); }
.login-footnote a:hover { color: var(--mm-accent-hover); }

@media(max-width:480px) {
    .login-card {
        padding: 2rem 1.4rem 1.75rem;
        border-radius: var(--mm-radius-lg);
    }
}

@media(prefers-reduced-motion:reduce) {
    *,:after,:before {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .browse-all-card:hover,.btn:active,.sidebar-home-link:active,.stat-card:hover {
        transform: none !important;
    }
}

/* Icons stay white even inside muted text containers */
.btn .icon,.handle.icon,.text-muted .icon {
    color: #fff !important;
}
