/* MyHub — app shell & layout. From the desktop frames (Inbox, Plan, Capture and Tasks, Money)
   and the iPhone frames (tab bar, large titles, sheets). Breakpoints: < 600 phone · 600–1024 tablet · > 1024 desktop. */
@layer layout {

  /* ── Shell (design update 6 · Component Sheet → "Navigation · used on every page") ── */
  .app { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
  .app > .side { grid-column: 1; grid-row: 1 / -1; }
  .app > .topbar, .app > .app__main { grid-column: 2 / -1; }
  .app__main { min-width: 0; display: flex; flex-direction: column; }
  /* Settings keeps its own list column beside the content. */
  .app--column { grid-template-columns: 232px 300px minmax(0, 1fr); }
  .app--column > .column { grid-column: 2; grid-row: 2; background: var(--as-surface-2); border-right: 1px solid var(--as-border); overflow-y: auto; }
  .app--column > .app__main { grid-column: 3; }

  /* Top bar: context switch, search / ask, page actions, bell, Capture (the logo lives in the sidebar). */
  .topbar {
    grid-row: 1; display: flex; align-items: center; gap: 12px; padding: 0 24px; min-width: 0;
    background: var(--as-surface); border-bottom: 1px solid var(--as-border);
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  }
  .topbar .search { flex: 1; max-width: 480px; font-size: 13.5px; }
  .topbar__end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
  .topbar__title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

  /* Sidebar, 232 px */
  .side {
    position: sticky; top: 0; height: 100dvh; align-self: start; min-width: 0; min-height: 0;
    display: flex; flex-direction: column; gap: 2px; padding: 14px 12px 12px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
    background: var(--as-surface-2); border-right: 1px solid var(--as-border); z-index: 21;
  }
  .side__brand { flex: none; display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
  .side__mark { position: relative; display: flex; flex: none; }
  .side__mark img { display: block; width: 30px; height: 30px; border-radius: 8px; }
  .side__live { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--as-pos); border: 2px solid var(--as-surface-2); }
  .side__live--warn { background: var(--as-warn); }
  .side__name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .side__name b { font-size: 15.5px; font-weight: 800; letter-spacing: -.015em; }
  .side__name span { font-size: 11.5px; color: var(--as-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side__collapse { width: 28px; height: 28px; flex: none; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--as-ink-3); }
  .side__collapse:hover { background: var(--as-surface-3); color: var(--as-ink); }
  .side__h { flex: none; font-size: 10.5px; font-weight: 800; color: var(--as-ink-3); letter-spacing: .08em; text-transform: uppercase; padding: 18px 10px 6px; }

  .side-item {
    flex: none; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: var(--as-ink-2);
  }
  .side-item:hover { background: var(--as-surface-3); color: var(--as-ink); }
  .side-item[aria-current="page"] { background: var(--as-ink); color: var(--as-surface); font-weight: 650; box-shadow: var(--as-shadow-md); }
  .side-item--sm { height: 34px; font-size: 13.5px; }
  .side-item__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-item__badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--as-surface-3);
  }
  .side-item[aria-current="page"] .side-item__badge { background: color-mix(in srgb, var(--as-ink-3) 45%, transparent); }
  .side-item__badge--brand, .side-item[aria-current="page"] .side-item__badge--brand { background: var(--as-brand); color: var(--as-on-badge); }
  .side-item__lock { margin-left: auto; opacity: .7; }

  /* Section links (rendered inside .side-sub; also Settings-style lists) */
  .sidebar__section { font-size: 11px; font-weight: 700; color: var(--as-ink-3); letter-spacing: .05em; text-transform: uppercase; padding: 16px 10px 8px; }
  .nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; color: var(--as-ink-2); }
  .nav-item[aria-current="page"], .nav-item.is-active { background: var(--as-surface); box-shadow: var(--as-shadow-sm); font-weight: 600; color: var(--as-ink); }
  .nav-item > as-icon { flex: none; }
  .nav-item__count { margin-left: auto; font-size: 12px; color: var(--as-ink-3); }
  .nav-item[aria-current="page"] .nav-item__count, .nav-item.is-active .nav-item__count { color: var(--as-ink); }
  .nav-item__count--warn { color: var(--as-warn); font-weight: 700; }
  .nav-item--sub { height: 30px; padding-left: 36px; font-size: 13px; }
  .nav-item--lg  { height: 36px; font-size: 14px; }

  /* Sub-navigation nests under the active item with a left rule (Inbox groups, Task views, Money sections, Goals / Topics). */
  .side-sub { flex: none; margin: 4px 0 6px 19px; padding-left: 9px; border-left: 1.5px solid var(--as-border-2); display: flex; flex-direction: column; gap: 1px; }
  .side-sub .sidebar__section { font-size: 10.5px; font-weight: 700; color: var(--as-ink-3); letter-spacing: .05em; text-transform: uppercase; padding: 8px 10px 2px; }
  .side-sub .sidebar__section:first-child { padding-top: 4px; }
  .side-sub .nav-item { height: 32px; gap: 9px; border-radius: 7px; font-size: 13px; }
  .side-sub .nav-item:hover { color: var(--as-ink); }
  .side-sub .nav-item > span:not(.nav-item__count) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-sub .nav-item__count { font-size: 11.5px; font-weight: 700; }

  .side__foot { flex: none; margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
  .side-sync { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--as-surface); border: 1px solid var(--as-border); font-size: 12px; color: var(--as-ink-2); }
  .side-sync__dots { display: flex; gap: 3px; }
  .side-sync__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--as-pos); }
  .side-sync__dots i.is-late { background: var(--as-warn); }
  .side-sync__text { flex: 1; white-space: nowrap; }
  .side-sync__late { min-width: 0; font-family: var(--as-mono); font-size: 11px; font-weight: 600; color: var(--as-warn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-owner { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 6px; }
  .side-owner__me { position: relative; flex: 1; min-width: 0; }
  .side-owner__me > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
  .side-owner__me > summary::-webkit-details-marker { display: none; }
  .side-owner__avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--cal-6-bg); color: var(--cal-6); }
  .side-owner__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .side-owner__who b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-owner__who span { font-size: 11.5px; color: var(--as-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-owner__menu { position: absolute; left: 0; bottom: calc(100% + 6px); padding: 6px; border-radius: 10px; background: var(--as-surface); border: 1px solid var(--as-border); box-shadow: var(--as-shadow-lg); z-index: 5; }
  .side-owner__gear { width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--as-ink-2); }
  .side-owner__gear:hover { background: var(--as-surface-3); color: var(--as-ink); }
  .side-owner__gear[aria-current="page"] { background: var(--as-ink); color: var(--as-surface); }

  /* Collapsed to icons (button, or tablet width) */
  .app--collapsed { grid-template-columns: 64px minmax(0, 1fr); }
  .app--collapsed.app--column { grid-template-columns: 64px 300px minmax(0, 1fr); }
  .app--collapsed .side { padding: 14px 8px 12px; align-items: center; }
  .app--collapsed .side__brand { flex-direction: column; padding: 2px 0 12px; }
  .app--collapsed .side__name, .app--collapsed .side-item__label, .app--collapsed .side-item__lock, .app--collapsed .side-sub,
  .app--collapsed .side__h, .app--collapsed .side-sync__text, .app--collapsed .side-sync__late, .app--collapsed .side-owner__who { display: none; }
  .app--collapsed .side-item { width: 44px; justify-content: center; padding: 0; position: relative; }
  .app--collapsed .side-item__badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
  .app--collapsed .side__h + .side-item { margin-top: 14px; }
  .app--collapsed .side-sync { padding: 8px; }
  .app--collapsed .side-sync__dots { flex-direction: column; }
  .app--collapsed .side-owner { flex-direction: column; padding: 0; }
  .app--collapsed .side-owner__menu { left: 0; }
  .app--collapsed .side__collapse { transform: scaleX(-1); }

  /* Panes (three-pane Inbox / Tasks) */
  .panes { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 0; }
  .pane { min-width: 0; display: flex; flex-direction: column; background: var(--as-surface); }
  .pane + .pane { border-left: 1px solid var(--as-border); }
  .pane--canvas { background: var(--as-canvas); }
  .pane__bar { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--as-border); background: var(--as-surface); }
  .pane__title { font-size: 15px; font-weight: 700; }
  .page { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
  .page__title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

  /* ── Phone ───────────────────────────────────────────────────────── */
  .large-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
  .nav-back { height: 44px; display: flex; align-items: center; padding: 0 8px; gap: 4px; font-size: 15px; font-weight: 600; }

  /* iPhone: floating glass capsule + separate brand-red Capture (never inside the tabs). */
  .tabbar {
    display: none; position: fixed; left: 14px; right: 88px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 30;
    height: 62px; border-radius: 31px; padding: 0 5px; gap: 2px; align-items: center;
    background: color-mix(in srgb, var(--as-surface) 82%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid var(--as-border); box-shadow: var(--as-shadow-lg);
  }
  .tabbar__item {
    position: relative; flex: 1; height: 52px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--as-ink-3); font-size: 10px; font-weight: 600;
  }
  .tabbar__item[aria-current="page"] { background: var(--as-ink); color: var(--as-surface); font-weight: 700; }
  .tabbar__badge {
    position: absolute; top: 3px; left: 55%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
    background: var(--as-brand); color: var(--as-on-badge); box-shadow: 0 0 0 2px var(--as-surface);
  }

  .fab {
    display: none; position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 31;
    width: 62px; height: 62px; border-radius: 31px; background: var(--as-brand); color: var(--as-on-brand);
    align-items: center; justify-content: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--as-brand) 40%, transparent), var(--as-shadow-md);
  }

  /* Grouped list (iPhone settings-style rows) */
  .list-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 50px; border-bottom: 1px solid var(--as-border); font-size: 15px; }
  .list-row:last-child { border-bottom: 0; }
  .list-row__label { flex: 1; font-weight: 600; }
  .list-row__count { font-size: 13px; color: var(--as-ink-3); font-weight: 600; }

  /* Bottom sheet / dialog */
  .scrim { position: fixed; inset: 0; background: var(--as-scrim); z-index: 40; }
  .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: calc(100dvh - 70px);
    background: var(--as-surface); border-radius: var(--as-r-xl) var(--as-r-xl) 0 0; box-shadow: var(--as-shadow-lg);
    display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: mh-sheet-in var(--as-dur-3) var(--as-ease);
  }
  .sheet__grabber { align-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--as-border-2); margin-top: 8px; }
  @keyframes mh-sheet-in { from { transform: translateY(24px); opacity: 0; } }

  /* Flow step (onboarding, payday plan) */
  .steps { display: flex; gap: 5px; }
  .steps > i { flex: 1; height: 4px; border-radius: 2px; background: var(--as-border-2); }
  .steps > i.is-done { background: var(--as-ink); }

  /* ── Responsive ──────────────────────────────────────────────────── */
  @media (min-width: 600px) and (max-width: 1024px) {
    /* Tablet: the sidebar collapses to icons (same rules as the collapse button). */
    .app { grid-template-columns: 64px minmax(0, 1fr); }
    .app.app--column { grid-template-columns: 64px 260px minmax(0, 1fr); }
    .app .side { padding: 14px 8px 12px; align-items: center; }
    .app .side__brand { flex-direction: column; padding: 2px 0 12px; }
    .app .side__name, .app .side-item__label, .app .side-item__lock, .app .side-sub, .app .side__h, .app .side-sync__text, .app .side-sync__late, .app .side-owner__who, .app .side__collapse { display: none; }
    .app .side-item { width: 44px; justify-content: center; padding: 0; position: relative; }
    .app .side-item__badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
    .app .side__h + .side-item { margin-top: 14px; }
    .app .side-sync { padding: 8px; }
    .app .side-sync__dots { flex-direction: column; }
    .app .side-owner { flex-direction: column; padding: 0; }
    .topbar { padding: 0 16px; }
    .panes { grid-template-columns: 320px minmax(0, 1fr); }
  }
  @media (max-width: 599px) {
    .app, .app.app--column, .app.app--collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .app > .topbar, .app > .app__main { grid-column: 1; }
    .app .side, .topbar, .app > .column { display: none; }
    .tabbar { display: flex; }
    .fab { display: flex; }
    .panes { grid-template-columns: minmax(0, 1fr); }
    .panes > .pane + .pane { display: none; }
    .page { padding: 12px 16px; gap: 12px; }
  }
}

@layer layout {
  /* Setup gate (docs/15 §7): while the wizard is required, one column — a slim bar with the mark, Back to setup and Sign out. */
  .app.app--gated, .app.app--gated.app--collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); padding-bottom: 0; }
  .app.app--gated.app--column { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); padding-bottom: 0; }
  .app.app--gated > .topbar { grid-column: 1 / -1; display: flex; }
  .app.app--gated > .column { grid-column: 1; }
  .app.app--gated > .app__main { grid-column: -2 / -1; }
  @media (max-width: 599px) { .app.app--gated.app--column { grid-template-columns: minmax(0, 1fr); } .app.app--gated > .column { display: none; } }
  .gate-bar__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--as-ink); }
  .gate-bar__brand img { border-radius: 8px; }
  .app--gated .topbar__end form { margin: 0; }
  .app--gated .app__main > .content, .app--gated .app__main > .page-head { width: 100%; max-width: 1040px; margin-inline: auto; }
}

@layer layout {
  /* Page header: phone shows the large title + context switch; desktop shows the page title. */
  .page-head { display: flex; align-items: baseline; gap: 10px; padding: 20px 28px 0; }
  .page-head__title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
  .page-head__meta { font-size: 13px; color: var(--as-ink-3); }
  .phone-head { display: none; }
  @media (max-width: 599px) {
    .phone-head { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) 20px 0; }
    .page-head { padding: 2px 20px 0; }
    .page-head__title { font-size: 32px; letter-spacing: -.02em; }
  }
  .content { padding: 20px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
  @media (max-width: 599px) { .content { padding: 12px 16px 24px; gap: 12px; } }
}

/* ── Sign-in pages (docs/design/Sign In Desktop.dc.html + Onboarding.dc.html) ──────────────
   One markup, three layouts:
     phone  < 600     the iPhone onboarding screen (full-bleed surface)
     tablet 600–1099  iPad: wordmark + 440 px card (radius 22, shadow-md) centred on the canvas
     desk   ≥ 1100    quiet brand panel (surface-2) + 400 px form column on surface
   [data-show="phone|tab|desk|wide"] shows a piece only in that layout (wide = tablet + desk). */
@layer layout {
  .auth { min-height: 100dvh; display: flex; background: var(--as-surface); color: var(--as-ink); }
  .auth__aside { display: none; }
  .auth__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .auth__col { width: 100%; display: flex; flex-direction: column; }
  .auth__card { display: flex; flex-direction: column; }

  /* Wordmark lock-ups */
  .auth__brand { display: flex; align-items: center; gap: 12px; }
  .auth__brand .wordmark { font-size: 26px; letter-spacing: -.03em; line-height: normal; }
  .auth__logo { display: flex; align-items: center; justify-content: center; gap: 12px; }
  .auth__logo .wordmark { font-size: 28px; letter-spacing: -.03em; line-height: normal; }

  /* Brand panel content */
  .auth__aside-body { margin-top: auto; }
  .auth__aside-foot { margin-top: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--as-ink-3); }
  .auth__aside-foot a:hover { color: var(--as-ink-2); }
  .auth__headline { font-size: 40px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; text-wrap: balance; }
  .auth__pitch { font-size: 17px; color: var(--as-ink-2); line-height: 1.5; margin-top: 14px; max-width: 440px; text-wrap: pretty; }
  .auth__features { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; font-size: 14px; color: var(--as-ink-2); }
  .auth__features li { display: flex; align-items: center; gap: 10px; }
  .auth__features as-icon, .auth__facts as-icon { color: var(--as-ink-3); }
  .auth__eyebrow { font-size: 13px; font-weight: 700; color: var(--as-ink-3); letter-spacing: .04em; text-transform: uppercase; }
  .auth__facts { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; font-size: 15px; color: var(--as-ink-2); line-height: 1.5; max-width: 440px; }
  .auth__facts--tight { gap: 14px; margin-top: 14px; }
  .auth__facts li { display: flex; gap: 12px; }
  .auth__facts as-icon { flex: none; margin-top: 2px; }
  .auth__prose { font-size: 15px; color: var(--as-ink-2); line-height: 1.55; margin-top: 12px; max-width: 440px; text-wrap: pretty; }
  .auth__lang { display: flex; border: 1px solid var(--as-border-2); border-radius: 8px; overflow: hidden; }
  .auth__lang > * { padding: 5px 10px; }
  .auth__lang [aria-current] { background: var(--as-surface); color: var(--as-ink); font-weight: 600; }

  /* Form column */
  .auth__back { align-self: flex-start; height: 36px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--as-ink-2); }
  .auth__title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: normal; }
  .auth__back + .auth__title { margin-top: 14px; }
  .auth__badge + .auth__title, .auth__state + .auth__title { margin-top: 18px; }
  .auth__sub { font-size: 15px; color: var(--as-ink-2); margin-top: 8px; line-height: 1.5; }
  .auth__sub .t-mono { font-size: 14px; }
  .auth__actions { display: flex; flex-direction: column; }
  .auth__hint { font-size: 13px; color: var(--as-ink-3); text-align: center; margin-top: 10px; line-height: 1.45; }
  .auth__error { font-size: 13px; color: var(--as-crit); text-align: center; }
  .auth__error:empty { display: none; }
  .auth__error:not(:empty) { margin-top: 12px; }
  .auth__option {
    margin-top: 20px; height: 56px; width: 100%; border-radius: 12px; border: 1px solid var(--as-border-2);
    display: flex; align-items: center; gap: 12px; padding: 0 16px; text-align: left;
  }
  .auth__option > as-icon:first-child { color: var(--as-ink-2); }
  .auth__option > as-icon:last-child { margin-left: auto; color: var(--as-ink-3); }
  .auth__option-text { display: flex; flex-direction: column; }
  .auth__option-title { font-size: 14.5px; font-weight: 600; }
  .auth__option-sub { font-size: 12.5px; color: var(--as-ink-3); }
  .auth__rule { height: 1px; background: var(--as-border); margin: 24px 0 8px; }
  .auth__row { height: 44px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--as-ink-2); }
  .auth__row as-icon { color: var(--as-ink-3); }
  .auth__quiet { height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--as-ink-3); margin-top: 12px; }
  .auth__label { font-size: 13px; font-weight: 600; color: var(--as-ink-2); margin-top: 28px; }
  .auth__label + * { margin-top: 8px; }
  .auth__field {
    height: 46px; width: 100%; border-radius: 10px; border: 1px solid var(--as-border-2); background: var(--as-surface);
    padding: 0 14px; font-size: 15px; color: var(--as-ink);
  }
  .auth__field:focus { border-color: var(--as-work); box-shadow: var(--as-focus); outline: none; }
  .auth__badge {
    align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--as-r-pill);
    background: var(--as-pos-bg); color: var(--as-pos); font-size: 12.5px; font-weight: 600;
  }
  .auth__state { width: 56px; height: 56px; border-radius: 16px; background: var(--as-surface-3); display: flex; align-items: center; justify-content: center; color: var(--as-ink-2); }
  .auth__note { font-size: 13px; color: var(--as-ink-3); line-height: 1.5; }

  /* List of devices / checks (Add a passkey, Offline) */
  .auth__list { margin-top: 8px; border: 1px solid var(--as-border); border-radius: 12px; display: flex; flex-direction: column; }
  .auth__list--checks { margin-top: 24px; }
  .auth__item { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px; }
  .auth__item + .auth__item { border-top: 1px solid var(--as-border); }
  .auth__list--checks .auth__item { min-height: 48px; }
  .auth__item > as-icon { color: var(--as-ink-3); }
  .auth__item-name { font-size: 14px; font-weight: 600; }
  .auth__item-meta { font-size: 12.5px; color: var(--as-ink-3); margin-left: auto; }
  .auth__list--checks .auth__item-meta { font-size: 13px; }
  .auth__item--new { margin: 6px; border: 1.5px dashed var(--as-ghost-border); border-radius: 8px; background: var(--as-ghost-bg); }
  .auth__item--new + .auth__item, .auth__item + .auth__item--new { border-top: 0; }
  .auth__item--new .auth__item-name { color: var(--as-ink-2); }
  .auth__item.is-pos > as-icon { color: var(--as-pos); }
  .auth__item.is-warn > as-icon { color: var(--as-warn); }

  /* Server line */
  .auth__server { margin-top: 36px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--as-ink-3); }
  .auth__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--as-pos); flex: none; }
  .auth__server.is-down .auth__dot { background: var(--as-crit); }
  .auth__last { font-size: 12.5px; color: var(--as-ink-3); margin-top: 6px; }

  /* Phone: Onboarding passkey screen */
  .auth__hero-mark { margin-top: 120px; border-radius: 18px; box-shadow: var(--as-shadow-md); }
  .auth__hero-name { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 28px; }
  .auth__hero-lead { font-size: 17px; color: var(--as-ink-2); line-height: 1.45; margin-top: 10px; text-wrap: pretty; }
  .auth__phone-server { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--as-ink-3); }
  .auth__ok { color: var(--as-pos); font-weight: 600; }
  .auth__phone-server.is-down .auth__ok { color: var(--as-crit); }

  @media (max-width: 599px) {
    .auth [data-show="tab"], .auth [data-show="desk"], .auth [data-show="wide"] { display: none; }
    .auth__main { justify-content: flex-start; align-items: stretch; }
    .auth__col { flex: 1; padding: calc(56px + env(safe-area-inset-top, 0px)) 24px calc(32px + env(safe-area-inset-bottom, 0px)); }
    .auth__card { flex: 1; }
    .auth--hero .auth__col { padding: env(safe-area-inset-top, 0px) 28px calc(48px + env(safe-area-inset-bottom, 0px)); }
    .auth--hero .auth__actions { margin-top: auto; gap: 12px; }
    .auth--hero .auth__actions > * { margin-top: 0; }
    .auth__title { font-size: 28px; }
    .auth__server { margin-top: 24px; justify-content: center; }
  }
  @media (min-width: 600px) and (max-width: 1099px) {
    .auth { background: var(--as-canvas); }
    .auth [data-show="phone"], .auth [data-show="desk"] { display: none; }
    .auth__main { padding: 40px 24px; }
    .auth__col { width: 440px; max-width: 100%; gap: 28px; align-items: center; }
    .auth__card { width: 100%; padding: 36px; border-radius: var(--as-r-xl); background: var(--as-surface); box-shadow: var(--as-shadow-md); }
    .auth__title { font-size: 28px; }
    .auth__back + .auth__title { margin-top: 12px; }
    .auth__label { margin-top: 24px; }
    .auth__state { width: 52px; height: 52px; border-radius: 15px; }
    .auth__list--checks { margin-top: 20px; }
    .auth__list--checks .auth__item { min-height: 46px; }
    .auth__server { margin-top: 0; }
    .auth__below { max-width: 440px; text-align: center; }
  }
  @media (min-width: 1100px) {
    .auth [data-show="phone"], .auth [data-show="tab"] { display: none; }
    .auth__aside {
      display: flex; flex-direction: column; flex: 0 0 clamp(460px, 42vw, 600px);
      padding: 56px 64px; background: var(--as-surface-2); border-right: 1px solid var(--as-border);
    }
    .auth__main { padding: 40px; }
    .auth__col { width: 400px; }
  }
}

@layer layout {
  .auth__note--below-btn { margin-top: 16px; }
  .auth__note--below-btn + .auth__quiet { margin-top: 8px; }
}
@layer layout {
  .auth__label--section { margin-top: 32px; }
}
@layer layout {
  .auth__server--tight { margin-top: 28px; }
  .auth__below-phone { margin-top: 24px; text-align: center; }
  @media (max-width: 599px) { .auth__server--tight { justify-content: flex-start; } }
}
@layer layout {
  .auth__note--checks { margin-top: 10px; }
}
@layer layout {
  .auth__title + .auth__facts { margin-top: 24px; }
  .auth__facts b { color: var(--as-ink); }
}
@layer layout {
  .auth__quiet--strong { color: var(--as-ink-2); }
  @media (max-width: 599px) {
    .auth--hero .auth__row { justify-content: center; }
    .auth--hero .auth__row as-icon { display: none; }
  }
}

@layer layout {
  /* Tasks: list + 420 px detail (design: Desktop · Tasks). */
  .tasks { display: grid; grid-template-columns: minmax(0, 1fr) 420px; min-height: 0; flex: 1; }
  .tasks__list { min-width: 0; display: flex; flex-direction: column; background: var(--as-surface); overflow-y: auto; }
  .tasks__head { padding: 20px 28px 12px; display: flex; align-items: baseline; gap: 12px; }
  .tasks__sync { align-self: center; }
  .tasks__views-phone { display: none; }
  .tasks__body { padding: 16px 28px 24px; display: flex; flex-direction: column; }
  @media (max-width: 1099px) {
    .tasks { grid-template-columns: minmax(0, 1fr); }
    .tasks.has-detail > .tasks__list { display: none; }
  }
  @media (max-width: 599px) {
    .tasks__head { padding: 8px 16px 8px; }
    .tasks__sync { display: none; }
    .tasks__views-phone { display: block; padding: 0 16px 10px; overflow-x: auto; }
    .quick-add { margin: 0 16px; }
    .tasks__body { padding: 12px 16px 24px; }
    .bulk-bar { margin: 12px 16px 0; bottom: 100px; }
    .board { grid-template-columns: repeat(4, 80vw); }
    .matrix { grid-template-columns: 1fr; }
  }
}

@layer layout {
  /* Plan: calendar + 300 px tray (docs/design/Plan.dc.html). */
  .plan { display: grid; grid-template-columns: minmax(0, 1fr) 300px; flex: 1; min-height: 0; }
  .plan__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--as-surface); }
  @media (max-width: 1099px) { .plan { grid-template-columns: minmax(0, 1fr); } }
}

/* ── Navigation: instant feedback (app.js adds .is-navigating on <html>) ─────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--as-dur-2); animation-timing-function: var(--as-ease); }
.nav-progress {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 2px; z-index: 1000; pointer-events: none;
  background: var(--as-brand); transform-origin: left center; transform: scaleX(0); opacity: 0;
}
.is-navigating .nav-progress { opacity: 1; animation: mh-nav-progress 3s var(--as-ease) forwards; }
@keyframes mh-nav-progress { 0% { transform: scaleX(0); } 20% { transform: scaleX(.45); } 100% { transform: scaleX(.92); } }
.page-skeleton { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }   /* shown by app.js (hidden attribute) */
.is-navigating-slow .app__main > :not(.page-skeleton):not(.phone-head) { display: none; }
@media (prefers-reduced-motion: reduce) {
  .is-navigating .nav-progress { animation: none; transform: scaleX(.6); }
}


/* 8.15g: "Email me a sign-in link" on the sign-in page */
@layer layout {
  .auth__mail summary { list-style: none; cursor: pointer; }
  .auth__mail summary::-webkit-details-marker { display: none; }
  .auth__mail[open] summary as-icon { transform: rotate(90deg); }
  .auth__mail-form { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
  .auth__mail-form .auth__label { margin-top: 4px; }
}
