/* Mobile More sheet. Its rows deliberately share the Settings hub language. */
body.aim-r #more-menu {
    --more-paper: var(--aim-bg);
    --more-card: var(--aim-bg-card);
    --more-soft: var(--aim-bg-soft);
    --more-tint: var(--aim-tint);
    --more-ink: var(--aim-ink);
    --more-muted: var(--aim-ink-soft);
    --more-line: var(--aim-line);
    background: var(--more-paper);
    color: var(--more-ink);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--more-line);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    left: 0;
    right: 0;
    bottom: calc(var(--aim-mob-nav-h) + env(safe-area-inset-bottom, 0px));
    max-height: min(86dvh, calc(100dvh - var(--aim-mob-nav-h) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 12px));
    padding-bottom: 8px;
    overscroll-behavior: contain;
    box-shadow: 0 -16px 48px rgba(28, 43, 34, .16);
}

body.aim-r #more-menu .more-menu-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--more-paper);
    border: 0;
    padding: 25px 22px 13px;
}

body.aim-r #more-menu .more-menu-header::before {
    width: 32px;
    background: var(--more-line);
}

body.aim-r #more-menu .more-menu-title {
    color: var(--more-ink);
    font-family: var(--aim-serif);
    font-size: 30px;
    font-weight: 400;
}

body.aim-r #more-menu .more-menu-close {
    width: 44px;
    height: 44px;
    background: var(--more-soft);
    color: var(--more-ink);
}

body.aim-r #more-menu .more-menu-close:focus-visible,
body.aim-r #more-menu a:focus-visible,
body.aim-r #more-menu button:focus-visible,
body.aim-r #more-menu summary:focus-visible {
    outline: 2px solid var(--more-ink);
    outline-offset: 2px;
}

body.aim-r #more-menu .more-menu-links {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 5px 22px 28px;
    margin: 0;
}

body.aim-r #more-menu .more-menu-links > li { margin: 0; }

body.aim-r #more-menu .more-menu-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.aim-r #more-menu .more-menu-section-title {
    padding: 0 4px;
    color: var(--more-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

body.aim-r #more-menu .more-menu-card {
    overflow: hidden;
    background: var(--more-card);
    border: 1px solid var(--more-line);
    border-radius: 15px;
}

body.aim-r #more-menu .more-menu-card > a,
body.aim-r #more-menu .more-menu-card > button,
body.aim-r #more-menu .more-menu-card > form > button,
body.aim-r #more-menu .more-menu-card > details > summary,
body.aim-r #more-menu .more-menu-details-list > a,
body.aim-r #more-menu .more-menu-details-list > button {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 70px;
    padding: 13px 16px;
    color: var(--more-ink);
    background: var(--more-card);
    border: 0;
    border-bottom: 1px solid var(--more-line);
    border-radius: 0;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
}

body.aim-r #more-menu .more-menu-card > :last-child,
body.aim-r #more-menu .more-menu-card > form:last-child > button,
body.aim-r #more-menu .more-menu-card > details:last-child:not([open]) > summary,
body.aim-r #more-menu .more-menu-details-list > :last-child {
    border-bottom: 0;
}

body.aim-r #more-menu .more-menu-card a:hover,
body.aim-r #more-menu .more-menu-card button:hover,
body.aim-r #more-menu .more-menu-card summary:hover,
body.aim-r #more-menu .more-menu-card a.active {
    color: var(--more-ink);
    background: var(--more-soft);
}

body.aim-r #more-menu .more-menu-ico {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--more-muted);
    background: transparent;
    border-radius: 0;
}

body.aim-r #more-menu .more-menu-ico .icon {
    width: 22px;
    height: 22px;
}

body.aim-r #more-menu .more-menu-copy {
    flex: 1;
    min-width: 0;
}

body.aim-r #more-menu .more-menu-copy strong {
    display: block;
    color: inherit;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.3;
}

body.aim-r #more-menu .more-menu-copy small {
    display: block;
    margin-top: 3px;
    color: var(--more-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.aim-r #more-menu .more-menu-chevron {
    flex: 0 0 auto;
    color: var(--more-muted);
    font-family: var(--aim-sans);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    transition: transform .18s ease;
}

body.aim-r #more-menu summary {
    cursor: pointer;
    list-style: none;
}

body.aim-r #more-menu summary::-webkit-details-marker { display: none; }
body.aim-r #more-menu details[open] > summary .more-menu-chevron { transform: rotate(90deg); }

body.aim-r #more-menu .more-menu-details-list > a,
body.aim-r #more-menu .more-menu-details-list > button {
    min-height: 58px;
    padding-left: 24px;
    background: var(--more-soft);
}

body.aim-r #more-menu .more-menu-details-list .more-menu-copy strong {
    font-size: 13.5px;
}

body.aim-r #more-menu .more-menu-support .more-menu-discovery-label { display: none; }

/* Give the one-time support cue warmth without changing the shared row layout. */
body.aim-r:not(.aim-help-discovered) #more-menu .more-menu-support .more-menu-card {
    border-color: #d9a05b;
    box-shadow: 0 4px 18px rgba(217, 160, 91, .15);
}

body.aim-r:not(.aim-help-discovered) #more-menu .more-menu-support .more-menu-card > button:first-child {
    background: #f6e8d1;
}

body.aim-r:not(.aim-help-discovered) #more-menu .more-menu-support .more-menu-discovery-label {
    display: block;
    margin-top: 3px;
    color: #65705f;
    font-size: 10.5px;
    font-weight: 600;
}

body.aim-r:not(.aim-help-discovered) #more-menu .more-menu-support .more-menu-discovery-label:first-child {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

body.aim-r #more-menu .more-menu-admin-entry {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

body.aim-r #more-menu .more-menu-admin-entry > .more-menu-admin-toggle {
    min-height: 70px;
    padding: 13px 16px;
    color: var(--more-ink);
    background: var(--more-card);
    border: 1px solid var(--more-line);
    border-radius: 15px;
}

body.aim-r #more-menu .more-menu-admin-toggle .chev { margin-left: auto; }

body.aim-r #more-menu.more-admin-open .more-menu-links > li:not(.more-menu-admin-entry),
body.aim-r #more-menu.more-admin-open .more-menu-admin-entry > .more-menu-section-title,
body.aim-r #more-menu.more-admin-open .more-menu-admin-toggle { display: none; }

body.aim-r #more-menu .more-menu-admin-group {
    margin: 0;
    padding: 0;
    border: 0;
}

body.aim-r #more-menu .more-menu-admin-group > [data-more-back] {
    min-height: 48px;
    padding: 8px 4px;
    color: var(--more-muted);
    background: transparent;
    border-radius: 0;
}

body.aim-r #more-menu .more-menu-admin-group .more-menu-section {
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

body.aim-r #more-menu .more-menu-admin-group .more-menu-section > a {
    min-height: 54px;
    padding: 10px 14px;
    color: var(--more-ink);
    background: var(--more-card);
    border: 1px solid var(--more-line);
    border-bottom: 0;
    border-radius: 0;
}

body.aim-r #more-menu .more-menu-admin-group .more-menu-section > a:first-of-type {
    border-radius: 14px 14px 0 0;
}

body.aim-r #more-menu .more-menu-admin-group .more-menu-section > a:last-child {
    border-bottom: 1px solid var(--more-line);
    border-radius: 0 0 14px 14px;
}

body.aim-r #more-menu .more-menu-signout form { margin: 0; }
body.aim-r #more-menu .more-menu-link-danger,
body.aim-r #more-menu .more-menu-link-danger .more-menu-copy strong,
body.aim-r #more-menu .more-menu-link-danger .more-menu-ico { color: var(--aim-danger); }

@media (max-width: 359px) {
    body.aim-r #more-menu .more-menu-links { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    body.aim-r #more-menu,
    body.aim-r .more-menu-overlay,
    body.aim-r #more-menu .more-menu-chevron { transition: none; animation: none; }
}

/* ── Destination tiles ────────────────────────────────────────────────
   The sheet's rows used to borrow the Settings hub language wholesale,
   which left More and Profile looking like the same surface. Groups of
   pure destinations now render as a two-up grid instead: icon over label,
   no subtitle, no chevron. The chevron stays the Profile hub's tell —
   there it means "drill into a setting", here nothing drills.
   Support keeps its row shape on purpose: it is one wide action with real
   copy to read, so it should not look like the tiles above it. */
body.aim-r #more-menu .more-menu-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
}

body.aim-r #more-menu .more-menu-tiles > a,
body.aim-r #more-menu .more-menu-tiles > button {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 9px;
    min-height: 94px;
    padding: 13px 12px;
    border: 1px solid var(--more-line);
    border-radius: 13px;
}

/* The shared card rules strip the last child's border to fake a divided
   list; a grid has no dividers to fake, so every tile keeps all four sides. */
body.aim-r #more-menu .more-menu-tiles > :last-child {
    border-bottom: 1px solid var(--more-line);
}

/* Solid green chip, white glyph. The pale tint left the icons washed out
   against the card; a filled chip gives each tile one confident anchor and
   carries the brand green that the rest of the sheet only hints at. */
body.aim-r #more-menu .more-menu-tiles .more-menu-ico {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: var(--more-ink);
    border-radius: 11px;
}

/* The glyph has to be told directly. site.css paints `color` on the svg itself
   (.more-menu-links a svg), so currentColor resolves there — white set on the
   chip never reaches the stroke, and hover would swing it to the accent. */
body.aim-r #more-menu .more-menu-tiles .more-menu-ico .icon,
body.aim-r #more-menu .more-menu-tiles > a:hover .more-menu-ico .icon,
body.aim-r #more-menu .more-menu-tiles > button:hover .more-menu-ico .icon {
    color: var(--more-card);
}

/* An odd number of destinations would leave a gap in the last row; the
   straggler stretches across instead. */
body.aim-r #more-menu .more-menu-tiles > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 13px;
    min-height: 68px;
}

body.aim-r #more-menu .more-menu-tiles .more-menu-copy {
    flex: 0 1 auto;
}

body.aim-r #more-menu .more-menu-tiles .more-menu-copy strong {
    font-size: 13.5px;
    line-height: 1.25;
}

/* The one row left in the sheet that points at a setting rather than a place.
   Muted on purpose — it is a way out, not a destination to be drawn to. */
body.aim-r #more-menu .more-menu-account-link .more-menu-copy strong {
    font-weight: 400;
}

body.aim-r #more-menu .more-menu-account-link .more-menu-ico,
body.aim-r #more-menu .more-menu-account-link .more-menu-copy strong {
    color: var(--more-muted);
}

/* ── Leaving the sheet ────────────────────────────────────────────────
   The sheet is display:none when closed, so dropping .open used to kill the
   slide-out before it painted a single frame: the sheet blinked out and the
   next screen arrived from nowhere. .more-closing keeps both layers painted
   for the length of the exit so the transform and the backdrop can actually
   animate; the script strips it once the transition ends. */
body.aim-r .more-menu.more-closing,
body.aim-r .more-menu-overlay.more-closing {
    display: block;
}

body.aim-r .more-menu-overlay {
    opacity: 0;
    transition: opacity .24s ease;
}

body.aim-r .more-menu-overlay.open { opacity: 1; }
body.aim-r .more-menu-overlay.more-closing { opacity: 0; }

/* The other half of the handoff: the page you land on rises in instead of
   popping. Only navigations that started in the sheet get this — the script
   leaves a one-shot flag behind, so ordinary page loads are untouched. */
@media (prefers-reduced-motion: no-preference) {
    html.aim-sheet-enter .aim-main {
        animation: aim-sheet-enter .26s cubic-bezier(.2, .7, .3, 1) both;
    }
}

@keyframes aim-sheet-enter {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}
