/* The new NERV shell (UI-T3, UI-T4): the navy sidebar, the phone's bottom
   bar and More sheet, the page header, and the brand's type, colours and
   corners. Every rule here sits under html[data-shell="2"], which
   web/ui/shell.js sets only when LEDGER_CONFIG.shellV2 is on (or
   localStorage "nerv.shell" is "2"), so with the switch off this sheet
   changes nothing. scripts/test/shell-view.test.mjs checks that. */

/* ---------- brand type and colours ---------- */
html[data-shell="2"]{
  --display:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif; --body:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;
  --bg:var(--brand-ground); --surface-2:var(--brand-panel); --accent:var(--brand-blue); --ink:var(--brand-ink);
  --ink-2:#526575; --line:#D9E1E8; --live:var(--brand-blue);
  --side-w:232px; --bar-h:56px;
  --side-ink:#F2F5F8; --side-ink-2:#B9C7D4; --side-line:rgba(255,255,255,.12); --side-hover:rgba(255,255,255,.06);
  /* UI-T13: text colours that reach 4.5:1 on every light surface here
     (white, --brand-ground and --brand-panel) and on their own pill ground. */
  --muted:#5D6975; --good:#157A45; --warn:#8F5E00; --bad:#B53030; --neutral:#5B6672;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){html[data-shell="2"]:not([data-theme="light"]){
  --bg:var(--brand-ground); --surface:#122437; --surface-2:var(--brand-panel); --accent:var(--brand-blue); --accent-ink:#0B1B2B; --ink:#E6EDF3;
  --ink-2:#B0BFCD; --line:#223549; --line-2:#2E465E; --live:var(--brand-blue);
  --muted:#93A1AE; --bad:#EE7B7B; color-scheme:dark;
}}
html[data-shell="2"][data-theme="dark"]{
  --bg:var(--brand-ground); --surface:#122437; --surface-2:var(--brand-panel); --accent:var(--brand-blue); --accent-ink:#0B1B2B; --ink:#E6EDF3;
  --ink-2:#B0BFCD; --line:#223549; --line-2:#2E465E; --live:var(--brand-blue);
  --muted:#93A1AE; --bad:#EE7B7B; color-scheme:dark;
}

/* Square corners: 2 px on controls, 4 px on surfaces. */
html[data-shell="2"] .btn,html[data-shell="2"] .select,html[data-shell="2"] .field input,html[data-shell="2"] .field select,html[data-shell="2"] .field textarea{border-radius:var(--r-1)}
html[data-shell="2"] .card,html[data-shell="2"] .tile,html[data-shell="2"] .table-wrap,html[data-shell="2"] .state{border-radius:var(--r-2)}
html[data-shell="2"] .btn{font-weight:500}
html[data-shell="2"] .btn.primary{background:var(--brand-ink);border-color:var(--brand-ink);color:#fff}
html[data-shell="2"] .btn.primary:hover{background:var(--brand-deep);border-color:var(--brand-deep)}
@media (prefers-color-scheme: dark){html[data-shell="2"]:not([data-theme="light"]) .btn.primary{background:var(--brand-blue);border-color:var(--brand-blue);color:#0B1B2B}}
html[data-shell="2"][data-theme="dark"] .btn.primary{background:var(--brand-blue);border-color:var(--brand-blue);color:#0B1B2B}
html[data-shell="2"] h1,html[data-shell="2"] h2,html[data-shell="2"] h3{font-weight:700}

/* ---------- the old header and tab row step aside ---------- */
html[data-shell="2"] .wrap:has(> #app:not([hidden])) > header.top{display:none}
html[data-shell="2"] #app > nav.tabs{display:none}
html[data-shell="2"] #state{margin:0 0 var(--sp-3);padding:6px var(--sp-3);font-size:var(--fs-2)}
html[data-shell="2"] .sh-side [hidden],html[data-shell="2"] .sh-bar [hidden],html[data-shell="2"] .page-head [hidden],html[data-shell="2"] .sh-holder{display:none !important}

/* ---------- the sidebar ---------- */
html[data-shell="2"] .sh-side{background:var(--brand-ink);color:var(--side-ink);display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;z-index:17}
html[data-shell="2"] .sh-wash{position:relative;display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-4);border-bottom:1px solid var(--side-line)}
html[data-shell="2"] .sh-wash-mark{flex:none;width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--brand-gold);background:var(--brand-deep);color:#fff;font-family:var(--display);font-weight:700;font-size:var(--fs-3);letter-spacing:.04em}
html[data-shell="2"] .sh-wash-empty .sh-wash-mark{background:var(--brand-deep) url("mark.svg") center/28px no-repeat}
html[data-shell="2"] .sh-wash-text{display:flex;flex-direction:column;min-width:0}
html[data-shell="2"] .sh-wash-name{font-family:var(--display);font-weight:700;font-size:var(--fs-3);line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-shell="2"] .sh-wash-switch{font-size:var(--fs-1);color:var(--side-ink-2)}
html[data-shell="2"] .sh-wash-switch::after{content:" \25BE"}
html[data-shell="2"] .sh-wash #siteSelect{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;border:0;padding:0;margin:0;background:none;color:var(--ink)}
html[data-shell="2"] .sh-wash:not(.sh-wash-many) #siteSelect{display:none}
html[data-shell="2"] .sh-wash-many:hover{background:var(--side-hover)}
html[data-shell="2"] .sh-wash:has(#siteSelect:focus-visible){outline:2px solid var(--brand-gold);outline-offset:-2px}

html[data-shell="2"] .sh-nav{padding:var(--sp-2) 0}
html[data-shell="2"] .sh-group{margin-top:var(--sp-3)}
html[data-shell="2"] .sh-group-label{padding:0 var(--sp-4) var(--sp-1);font-size:var(--fs-1);font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--side-ink-2)}
html[data-shell="2"] .sh-side .tab{display:flex;align-items:center;gap:10px;width:100%;margin:0;padding:8px var(--sp-4);border:0;border-radius:0;background:none;box-shadow:none;color:var(--side-ink-2);font-family:var(--body);font-size:var(--fs-3);font-weight:500;text-align:left;white-space:nowrap;cursor:pointer}
html[data-shell="2"] .sh-side .tab:hover{color:#fff;background:var(--side-hover)}
html[data-shell="2"] .sh-side .tab[aria-selected="true"]{color:#fff;background:var(--brand-deep);box-shadow:inset 3px 0 0 var(--brand-gold)}
/* UI-T13: the focus ring on navy is gold (5.9:1 on the navy, 4.2:1 on the
   open page's lighter navy); inside the person menu, a light surface, it is
   blue like the rest of the page (web/ui/base.css). */
html[data-shell="2"] .sh-side :focus-visible,html[data-shell="2"] .sh-bar :focus-visible{outline:2px solid var(--brand-gold);outline-offset:-2px}
html[data-shell="2"] .sh-icon{flex:none;width:20px;height:20px}
html[data-shell="2"] .tab-label{overflow:hidden;text-overflow:ellipsis}

html[data-shell="2"] .sh-foot{position:relative;margin-top:auto;border-top:1px solid var(--side-line);padding:var(--sp-3) var(--sp-4) var(--sp-4)}
html[data-shell="2"] .sh-who-row{display:flex;align-items:center;gap:var(--sp-2)}
html[data-shell="2"] .sh-who{display:flex;flex-direction:column;min-width:0;flex:1}
html[data-shell="2"] .sh-who .hint{font-size:var(--fs-2);color:var(--side-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-shell="2"] .sh-who #whoRole{font-size:var(--fs-1);color:var(--side-ink-2)}
html[data-shell="2"] .sh-menu-btn{flex:none;width:32px;height:32px;border:1px solid var(--side-line);border-radius:var(--r-1);background:none;color:var(--side-ink);font-size:var(--fs-4);line-height:1;cursor:pointer}
html[data-shell="2"] .sh-menu-btn:hover,html[data-shell="2"] .sh-menu-btn[aria-expanded="true"]{background:var(--side-hover)}
html[data-shell="2"] .sh-menu{position:absolute;left:var(--sp-3);right:var(--sp-3);bottom:calc(100% - var(--sp-2));background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--r-2);box-shadow:var(--shadow);padding:var(--sp-2);display:flex;flex-direction:column;gap:2px;z-index:2}
html[data-shell="2"] .sh-menu-label{font-size:var(--fs-1);font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-2);padding:var(--sp-1) var(--sp-2)}
html[data-shell="2"] .sh-theme{padding-bottom:var(--sp-2);border-bottom:1px solid var(--line);margin-bottom:var(--sp-1)}
html[data-shell="2"] .sh-theme-row{display:flex;gap:2px;padding:0 var(--sp-2)}
html[data-shell="2"] .sh-theme-btn{flex:1;padding:5px 4px;border:1px solid var(--line-2);border-radius:var(--r-1);background:var(--surface);color:var(--ink);font-size:var(--fs-1);cursor:pointer}
html[data-shell="2"] .sh-theme-btn[aria-pressed="true"]{background:var(--brand-ink);border-color:var(--brand-ink);color:#fff}
/* UI-T13: in the dark theme the menu is navy too, so the pressed button is
   the light blue (5.2:1 against the menu) with dark words. */
@media (prefers-color-scheme: dark){html[data-shell="2"]:not([data-theme="light"]) .sh-theme-btn[aria-pressed="true"]{background:var(--brand-blue);border-color:var(--brand-blue);color:#0B1B2B}}
html[data-shell="2"][data-theme="dark"] .sh-theme-btn[aria-pressed="true"]{background:var(--brand-blue);border-color:var(--brand-blue);color:#0B1B2B}
/* UI-T12: "Open on", the page NERV opens on for this person */
html[data-shell="2"] .sh-open-on{display:flex;flex-direction:column;padding-bottom:var(--sp-2);border-bottom:1px solid var(--line);margin-bottom:var(--sp-1)}
html[data-shell="2"] .sh-open-select{margin:0 var(--sp-2);padding:5px 6px;border:1px solid var(--line-2);border-radius:var(--r-1);background:var(--surface);color:var(--ink);font:inherit;font-size:var(--fs-2)}
html[data-shell="2"] .sh-menu .sh-open-select:focus-visible{outline-offset:1px}
html[data-shell="2"] .sh-menu .sh-menu-link{display:block;width:100%;text-align:left;padding:7px var(--sp-2);border:0;border-radius:var(--r-1);background:none;color:var(--ink);font-size:var(--fs-3);text-decoration:none;cursor:pointer}
html[data-shell="2"] .sh-menu .sh-menu-link:hover{background:var(--surface-2)}
html[data-shell="2"] .sh-menu :focus-visible{outline:2px solid var(--brand-blue);outline-offset:-2px}
/* UI-T8: the wordmark fits one line at 232 px in all small caps; if a
   font draws it wider, it breaks into two even lines with the mark on the first. */
html[data-shell="2"] .sh-brand{display:flex;align-items:flex-start;gap:6px;margin-top:var(--sp-3);font-size:var(--fs-1);line-height:16px;font-variant:all-small-caps;letter-spacing:.02em;color:var(--side-ink-2)}
html[data-shell="2"] .sh-brand > span{min-width:0;text-wrap:balance}
html[data-shell="2"] .sh-brand-mark{width:16px;height:16px;flex:none}

/* ---------- the page header ---------- */
html[data-shell="2"] .page-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--sp-3) var(--sp-4);align-items:end;padding:var(--sp-2) 0 var(--sp-4);margin-bottom:var(--sp-2);border-bottom:1px solid var(--line)}
html[data-shell="2"] .page-eyebrow{font-size:var(--fs-1);font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--brand-blue)}
html[data-shell="2"] .page-title{margin-top:var(--sp-1);font-family:var(--display);font-weight:700;font-size:var(--fs-6);line-height:1.2;letter-spacing:-.01em}
html[data-shell="2"] .page-intro{margin:var(--sp-1) 0 0;color:var(--ink-2);font-size:var(--fs-3)}
html[data-shell="2"] .page-rule{width:32px;height:3px;margin-top:var(--sp-3);background:var(--brand-gold)}
html[data-shell="2"] .page-actions{display:flex;flex-wrap:wrap;gap:var(--sp-2);justify-content:flex-end;align-items:center}
html[data-shell="2"] .page-actions-own{display:contents}
html[data-shell="2"] .page-subnav-slot{grid-column:1 / -1}
html[data-shell="2"] .page-subnav-slot .page-subnav{margin:0}
html[data-shell="2"] .page-subnav-slot .chip{border-radius:var(--r-1)}

/* ---------- wide screens: the sidebar ---------- */
@media (min-width:900px){
  html[data-shell="2"] body:has(#app:not([hidden])){padding-left:var(--side-w)}
  html[data-shell="2"] .sh-side{position:fixed;top:0;left:0;bottom:0;width:var(--side-w)}
  html[data-shell="2"] .sh-bar,html[data-shell="2"] .sh-scrim{display:none}
}

/* ---------- phones: the bottom bar and the More sheet ---------- */
@media (max-width:899.98px){
  html[data-shell="2"] .wrap:has(> #app:not([hidden])){padding-bottom:calc(var(--bar-h) + 32px + env(safe-area-inset-bottom))}
  html[data-shell="2"] .sh-bar{position:fixed;left:0;right:0;bottom:0;z-index:18;display:flex;background:var(--brand-ink);border-top:1px solid var(--side-line);padding-bottom:env(safe-area-inset-bottom)}
  html[data-shell="2"] .sh-bar-list{display:flex;flex:4}
  html[data-shell="2"] .sh-bar-btn{flex:1;min-width:0;min-height:var(--bar-h);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 2px;border:0;background:none;color:var(--side-ink-2);font-size:var(--fs-1);font-weight:500;cursor:pointer}
  html[data-shell="2"] .sh-bar-btn .tab-label{max-width:100%;white-space:nowrap}
  html[data-shell="2"] .sh-bar-btn[aria-current="page"],html[data-shell="2"] .sh-more[aria-expanded="true"]{color:#fff;box-shadow:inset 0 3px 0 var(--brand-gold)}
  html[data-shell="2"] .sh-side{position:fixed;left:0;right:0;bottom:calc(var(--bar-h) + env(safe-area-inset-bottom));max-height:80vh;border-top:1px solid var(--side-line);transform:translateY(calc(100% + var(--bar-h) + 40px));visibility:hidden;transition:transform .2s ease,visibility 0s linear .2s}
  html[data-shell="2"].sh-sheet-open .sh-side{transform:none;visibility:visible;transition:transform .2s ease}
  html[data-shell="2"] .sh-side .tab.sh-in-bar,html[data-shell="2"] .sh-group.sh-all-in-bar{display:none}
  html[data-shell="2"] .sh-scrim{position:fixed;inset:0;z-index:16;background:rgba(10,15,20,.35);display:none}
  html[data-shell="2"].sh-sheet-open .sh-scrim{display:block}
  html[data-shell="2"] .page-head{grid-template-columns:minmax(0,1fr)}
  html[data-shell="2"] .page-actions{justify-content:flex-start}
  html[data-shell="2"] .toast{bottom:calc(var(--bar-h) + 16px + env(safe-area-inset-bottom))}
}
/* UI-T12: a device that asks for less motion gets none in the shell: the
   More sheet, the menu, the bar and the scrim appear without sliding or
   fading. base.css turns off every other transition and animation. */
@media (prefers-reduced-motion:reduce){
  html[data-shell="2"] .sh-side{transition:none}
  html[data-shell="2"].sh-sheet-open .sh-side{transition:none}
  html[data-shell="2"] .sh-side *,html[data-shell="2"] .sh-bar,html[data-shell="2"] .sh-bar *,html[data-shell="2"] .sh-scrim,html[data-shell="2"] .sh-menu,html[data-shell="2"] .page-head,html[data-shell="2"] .page-head *{transition:none !important;animation:none !important}
}

@media print{
  html[data-shell="2"] .sh-side,html[data-shell="2"] .sh-bar,html[data-shell="2"] .sh-scrim{display:none !important}
  html[data-shell="2"] body{padding-left:0 !important}
}
/* SHELL-T4: the wash's own logo in the switcher, when its settings have one. */
html[data-shell="2"] .sh-wash-mark.sh-wash-has-logo{background:#fff;padding:2px;overflow:hidden}
html[data-shell="2"] .sh-wash-logo{display:block;width:100%;height:100%;object-fit:contain}

/* SHELL-T6: the notification bell sits at the top right of the page header,
   on a phone and a wide screen alike; the title leaves room for it. */
html[data-shell="2"] .page-head{position:relative}
/* SHELL-T7: the bell shares that corner with "?", the Help panel's button. */
html[data-shell="2"] .page-head > .page-head-tools{position:absolute;top:var(--sp-1);right:0;display:flex;align-items:center;gap:2px}
html[data-shell="2"] .page-head .page-head-main{padding-right:52px}
html[data-shell="2"] .page-head:has(.bell:not([hidden])) .page-head-main{padding-right:100px}
html[data-shell="2"] .page-help-btn{min-width:44px;min-height:44px;padding:0 10px;font-weight:700;font-size:var(--fs-4)}
