/* ─────────────────────────────────────────────────────────────────────────────
   Blanks 2045: the agency APP SHELL (2026-11-20). Loaded right before future.css.
   One rounded window floating on the porcelain + aurora world; a Narwhal-style rail inside it;
   a floating glass pill bar on phones. Built only from the future.css tokens.
   Spec: notes/DESIGN-2045-2026-11-20.md (Hierarchy 1–2).
   Other pages: render into  main#main.sh-main  (inside .sh-window). Height budget for a
   full-height page: var(--sh-page-h). Everything here is prefixed .sh- so the older
   .shell/.rail/.tabbar rules in agency.css, canvas.css and today.css never touch it.
   ───────────────────────────────────────────────────────────────────────────── */

.sh {
  --sh-gap: 14px; --sh-rail: 232px; --sh-rail-c: 72px;
  --sh-page-h: calc(100dvh - 2 * var(--sh-gap));
  position: relative; z-index: 1; min-height: 100dvh; padding: var(--sh-gap);
  font-family: var(--fx-sans); color: var(--fx-ink);
}
.sh-window {
  display: grid; grid-template-columns: var(--sh-rail) minmax(0, 1fr); align-items: start;
  min-height: var(--sh-page-h);
  transition: grid-template-columns var(--fx-med) var(--fx-ease);
}
.sh[data-rail="collapsed"] .sh-window { grid-template-columns: var(--sh-rail-c) minmax(0, 1fr); }
.sh-main { min-width: 0; min-height: var(--sh-page-h); padding: 22px 6px 40px 0; outline: none; background: transparent; }

/* ── the rail ── */
.sh-rail {
  position: sticky; top: var(--sh-gap); height: var(--sh-page-h); z-index: 30;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 12px 12px;
  border-right: 1px solid var(--fx-line);
}
:where(.sh-rail, .sh-bar) button {
  all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sh-rail :focus-visible, .sh-bar :focus-visible { outline: 2px solid rgba(201, 100, 66, .45); outline-offset: 2px; }

.sh-top { display: flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 14px; }
.sh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 4px 6px; border-radius: var(--fx-r-inner); color: var(--fx-ink); text-decoration: none !important; }
.sh-brand .mark { width: 28px; height: 28px; border-radius: 9px; background: var(--fx-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 14px -8px rgba(18, 13, 11, .6); }
.sh-brand .mark i:first-child { top: 9px; left: 7px; width: 14px; }
.sh-brand .mark i:last-child { top: 15px; left: 7px; width: 8px; }
.sh-brand-text { display: grid; min-width: 0; line-height: 1.2; }
.sh-brand-text b { font: 600 14px/1.25 var(--fx-sans); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-brand-text small { font: 500 12px/1.2 var(--fx-sans); color: var(--fx-ink-4); }
.sh-collapse { display: grid; place-items: center; width: var(--fx-h-sm); height: var(--fx-h-sm); flex: none; border-radius: var(--fx-r-pill); color: var(--fx-ink-4); transition: background var(--fx-fast), color var(--fx-fast); }
.sh-collapse:hover { background: var(--fx-sunk); color: var(--fx-ink); }
.sh-collapse svg { width: 18px; height: 18px; }

.sh-nav { display: grid; gap: 2px; }
.sh-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 10px; border-radius: var(--fx-r-pill); text-align: left;
  font: 500 14px/1 var(--fx-sans); color: var(--fx-ink-2); text-decoration: none !important; white-space: nowrap;
  transition: background var(--fx-fast) var(--fx-ease), color var(--fx-fast);
}
.sh-item:hover { background: rgba(31, 30, 29, .045); color: var(--fx-ink); }
.sh-item.on { background: var(--fx-card); color: var(--fx-ink); box-shadow: 0 0 0 1px var(--fx-line), 0 2px 8px -4px rgba(31, 30, 29, .18); }
.sh-ico { display: grid; place-items: center; width: 20px; height: 20px; flex: none; color: var(--fx-ink-3); }
.sh-item.on .sh-ico, .sh-item:hover .sh-ico { color: var(--fx-ink); }
.sh-ico svg { width: 18px; height: 18px; }
.sh-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sh-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--fx-r-pill); display: grid; place-items: center;
  font: 600 12px/1 var(--fx-sans); font-variant-numeric: tabular-nums; color: #fff; background: var(--fx-cobalt);
}
.sh-item.sh-new .sh-ico { width: 22px; height: 22px; border-radius: 7px; background: var(--fx-ink); color: #fff; margin-left: -1px; }
.sh-item.sh-new .sh-ico svg { width: 16px; height: 16px; }
.sh-item.sh-new.on .sh-ico { background: var(--fx-cobalt); }
.sh-item .fx-kbd { margin-left: auto; padding: 3px 6px; border-radius: 6px; background: var(--fx-sunk); }
.sh-sep { height: 1px; margin: 8px 10px; background: var(--fx-line); }

.sh-foot { margin-top: auto; display: grid; gap: 10px; min-width: 0; }

/* agency row (opens the ⋯ menu) */
.sh-me {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-width: 0; padding: 8px; border-radius: var(--fx-r-inner);
  transition: background var(--fx-fast);
}
.sh-me:hover, .sh-me[aria-expanded="true"], .sh-me.on { background: rgba(31, 30, 29, .045); }
.sh-tile img, .sh-tile .mono {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; object-fit: contain; flex: none;
  background: var(--fx-ink); color: #fff; font: 600 12px/1 var(--fx-sans); box-shadow: 0 0 0 1px var(--fx-line);
}
.sh-tile img { background: var(--fx-card); }
.sh-tile { flex: none; display: grid; }
.sh-me-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; text-align: left; }
.sh-me-text b { font: 500 14px/1.25 var(--fx-sans); color: var(--fx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-me-text small { font: 400 12px/1.3 var(--fx-sans); color: var(--fx-ink-3); }
.sh-me-dots { display: grid; place-items: center; width: 24px; height: 24px; color: var(--fx-ink-4); flex: none; }
.sh-me-dots svg { width: 18px; height: 18px; }

/* ── the "Finish setup" card (agency-guide.js setupCard) ── */
.sh-foot .sh-setup { overflow: hidden; border-radius: var(--fx-r-card); }
.sh-setup .fx-illus { min-height: 78px; border-radius: var(--fx-r-card) var(--fx-r-card) 0 0; }
.sh-setup .fx-orbit-icon { width: 30px; height: 30px; border-radius: 9px; color: var(--fx-ink-2); }
.sh-setup .fx-orbit-icon .ico { width: 15px; height: 15px; }
.sh-setup .fx-orbit-icon.now { color: var(--fx-cobalt-deep); box-shadow: 0 0 0 1.5px rgba(201, 100, 66, .35), var(--fx-shadow-card); }
.sh-setup-body { padding: 12px 14px 12px; display: grid; gap: 4px; }
.sh-setup-eyebrow { display: flex; align-items: center; gap: 8px; font: 500 12px/1 var(--fx-sans); color: var(--fx-ink-3); }
.sh-setup-eyebrow span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.sh-setup-title { font: 600 14px/1.3 var(--fx-sans); letter-spacing: -.01em; color: var(--fx-ink); margin-top: 4px; }
.sh-setup-line { font: 400 13px/1.4 var(--fx-sans); color: var(--fx-ink-3); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-setup-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.sh-setup-actions .fx-btn.sm { padding: 0 12px; font-size: 13px; text-decoration: none; }
.sh-setup-actions .fx-btn.quiet { color: var(--fx-ink-3); }
.sh-ring { width: 18px; height: 18px; flex: none; transform: rotate(-90deg); }
.sh-ring circle { fill: none; stroke-width: 2.4; }
.sh-ring .track { stroke: var(--fx-sunk); }
.sh-ring .fill { stroke: var(--fx-ink); stroke-linecap: round; transition: stroke-dashoffset var(--fx-med) var(--fx-ease); }
/* the collapsed rail shows only the ring */
.sh-setup-mini { display: none !important; place-items: center; width: 44px; height: 44px; margin: 0 auto; border-radius: 14px; background: var(--fx-card); box-shadow: var(--fx-shadow-card); }
.sh-setup-mini .sh-ring { width: 22px; height: 22px; }
/* inline on Today (phones, where there is no rail) */
.sh-setup.inline { border-radius: var(--fx-r-card); }
.sh-setup.inline .fx-illus { border-radius: var(--fx-r-card) var(--fx-r-card) 0 0; }

/* ── collapsed rail: icons only ── */
.sh[data-rail="collapsed"] .sh-rail { padding-left: 10px; padding-right: 10px; align-items: stretch; }
.sh[data-rail="collapsed"] .sh-top { flex-direction: column; gap: 8px; }
.sh[data-rail="collapsed"] .sh-brand { flex: none; padding: 4px; }
.sh[data-rail="collapsed"] .sh-brand-text,
.sh[data-rail="collapsed"] .sh-label,
.sh[data-rail="collapsed"] .sh-item .fx-kbd,
.sh[data-rail="collapsed"] .sh-me-text,
.sh[data-rail="collapsed"] .sh-me-dots,
.sh[data-rail="collapsed"] .sh-setup { display: none; }
.sh[data-rail="collapsed"] .sh-setup-mini { display: grid !important; }
.sh[data-rail="collapsed"] .sh-item { justify-content: center; padding: 0; width: 44px; height: 40px; margin: 0 auto; }
.sh[data-rail="collapsed"] .sh-count { position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; box-shadow: 0 0 0 2px var(--fx-window); }
.sh[data-rail="collapsed"] .sh-me { justify-content: center; padding: 6px 0; }
.sh[data-rail="collapsed"] .sh-sep { margin: 8px 6px; }

/* ── the ⋯ menu (positioned from the button by agency.js on desktop) ── */
body.agency-body .me-menu.sh-menu {
  width: 240px; padding: 6px; border-radius: var(--fx-r-card); background: var(--fx-glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--fx-shadow-float);
  transition: opacity var(--fx-fast) var(--fx-ease), transform var(--fx-med) var(--fx-ease);
}
body.agency-body .sh-menu [role=menuitem] { border-radius: var(--fx-r-inner); font-family: var(--fx-sans); }
body.agency-body .sh-menu .me-head .mono, body.agency-body .sh-menu .me-head img { border-radius: 11px; }

/* ── phone bar (hidden on desktop) ── */
.sh-bar { display: none; }

/* ── setup: the window holds only the setup page ── */
body[data-view="setup"] .sh-rail, body[data-view="setup"] .sh-bar { display: none !important; }
body[data-view="setup"] .sh .sh-window { grid-template-columns: minmax(0, 1fr); }
body[data-view="setup"] .sh-main { padding: 0; }

/* ── phone (<760): full-bleed window, floating glass pill bar ── */
@media (max-width: 759px) {
  .sh { padding: 0; }
  .sh .sh-window, .sh[data-rail] .sh-window { grid-template-columns: minmax(0, 1fr); min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .sh-rail { display: none; }
  .sh-main { min-height: 100dvh; padding: 12px 0 calc(96px + env(safe-area-inset-bottom, 0px)); }
  .sh-bar {
    position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 2px; height: 60px; padding: 0 8px; width: min(360px, calc(100vw - 24px));
    border-radius: var(--fx-r-pill);
  }
  .sh-bar > a, .sh-bar > button {
    position: relative; flex: 1 1 0; display: grid; place-items: center; height: 46px; border-radius: var(--fx-r-pill);
    color: var(--fx-ink-3); text-decoration: none !important; transition: background var(--fx-fast), color var(--fx-fast);
  }
  .sh-bar > a.on { color: var(--fx-ink); background: var(--fx-card); box-shadow: 0 0 0 1px var(--fx-line); }
  .sh-bar .sh-ico { width: 22px; height: 22px; color: inherit; }
  .sh-bar .sh-ico svg { width: 20px; height: 20px; }
  .sh-bar .sh-new-dot { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--fx-ink); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 18px -8px rgba(18, 13, 11, .7); }
  .sh-bar a.on .sh-new-dot { background: var(--fx-cobalt); }
  .sh-bar > a.sh-bar-new.on { background: none; box-shadow: none; }
  .sh-bar .sh-count { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; box-shadow: 0 0 0 2px #fff; }
  .sh-bar .sh-tile img, .sh-bar .sh-tile .mono { width: 30px; height: 30px; border-radius: 10px; }
  body.agency-body .me-menu.sh-menu, body.agency-body .me-menu.sh-menu.from-bar { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important; transform-origin: 100% 100%; }
  body.presenting .sh-bar { display: none; }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ── sign in / sign up: an editorial headline + the form in a floating card on the aurora world ── */
.sh-auth {
  position: relative; z-index: 1; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
  align-items: center; gap: clamp(32px, 6vw, 96px); padding: clamp(24px, 5vw, 72px) clamp(20px, 6vw, 96px);
  font-family: var(--fx-sans); color: var(--fx-ink);
}
.sh-auth-brand { position: absolute; top: clamp(20px, 3vw, 32px); left: clamp(20px, 6vw, 96px); display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--fx-sans); letter-spacing: -.01em; }
.sh-auth-brand .mark { width: 28px; height: 28px; border-radius: 9px; background: var(--fx-ink); }
.sh-auth-brand .mark i:first-child { top: 9px; left: 7px; width: 14px; }
.sh-auth-brand .mark i:last-child { top: 15px; left: 7px; width: 8px; }
.sh-auth-copy { max-width: 620px; }
body.agency-body .sh-auth h1.fx-hero { font: 400 clamp(36px, 4.6vw, 64px)/1.04 var(--fx-sans); letter-spacing: -.04em; margin: 16px 0 0; }
body.agency-body .sh-auth h1.fx-hero .fx-accent { font-family: var(--fx-serif); font-style: italic; letter-spacing: -.02em; }
.sh-auth-lede { margin: 22px 0 0; max-width: 520px; font: 400 16px/1.55 var(--fx-sans); color: var(--fx-ink-3); }
.sh-auth-points { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sh-auth-points li { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: var(--fx-r-pill); background: var(--fx-glass); box-shadow: 0 0 0 1px var(--fx-line); font: 500 13px/1 var(--fx-sans); color: var(--fx-ink-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sh-auth-points li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--fx-cobalt); }
.sh-auth .sh-auth-card { padding: 30px 28px 26px; border-radius: var(--fx-r-window); }
.sh-auth-card h2 { font: 600 22px/1.2 var(--fx-sans); letter-spacing: -.02em; margin: 0; }
.sh-auth-card > p.sh-auth-sub { margin: 6px 0 8px; color: var(--fx-ink-3); font-size: 14px; }
.sh-auth-card label { color: var(--fx-ink-2); font-size: 13px; }
.sh-auth-card input { width: 100%; box-sizing: border-box; height: 44px; border-radius: var(--fx-r-inner); background: var(--fx-card); box-shadow: inset 0 0 0 1px var(--fx-line-2); padding: 0 14px; }
.sh-auth-card input:focus { box-shadow: inset 0 0 0 1px rgba(201, 100, 66, .6), 0 0 0 4px rgba(201, 100, 66, .1); outline: none; }
.sh-auth-card .fx-btn.sh-submit { width: 100%; justify-content: center; height: 46px; margin-top: 22px; font-size: 15px; }
.sh-auth-card .notice { margin-top: 14px; }
.sh-auth-card .auth-switch { margin: 18px 0 0; text-align: center; color: var(--fx-ink-3); font-size: 13px; }
.sh-auth-foot { position: absolute; bottom: 20px; left: clamp(20px, 6vw, 96px); font: 400 12px/1 var(--fx-sans); color: var(--fx-ink-4); }
@media (max-width: 899px) {
  .sh-auth { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 28px; padding: 84px 16px 48px; }
  .sh-auth-points, .sh-auth-foot { display: none; }
  .sh-auth .sh-auth-card { padding: 24px 20px 22px; border-radius: var(--fx-r-card); }
}

@media (prefers-reduced-motion: reduce) {
  .sh-window, .sh-item, .sh-me, .sh-collapse, .sh-ring .fill, body.agency-body .me-menu.sh-menu { transition: none !important; }
}

/* (2026-11-20) the rail's button reset is zero-specificity now, so .sh-item / .sh-me win without !important. */
