/* Cerebro shared page shell (pilot 2026-11-27: Mail, Calendar, Notes).
   Taken from the Fitness and Games look. Pages keep their own CSS only for widgets unique to them.

   Pieces
     .shell-head  .shell-menu  .shell-back  h1  .shell-chat   top bar: ☰ pages, ‹ back, title, small Chat button
     .shell-tabs                        sticky pill tabs (button.on = active)
     .shell-main                        centered page body (860px; 1100px with .shell-wide)
     .shell-card  .shell-row            card and list row
     .shell-btn (.ok .danger .ghost)    buttons
     .shell-form / .shell-field         form controls
     .shell-bar (.shell-bar-sticky)     bottom action bar
     .shell-split                       two columns on desktop
     .cat-main .cat-av .cat-work .cat-shared   category color (--cat) for events, accounts, dots

   Standalone pages put class "shell" on <body>. Pages inside the main app get body.shell-page from app.js,
   which also picks the category: Personal (dashboard pages), Mustard Seed (body.on-side), JTech (body.on-jtech).
*/
:root {
  --cat-main: #4ec8ff;    /* Personal: the dashboard cyan */
  --cat-av: #f2b632;      /* Mustard Seed (id smith-av-work): mustard / Iron Man gold */
  --cat-work: #aab6c4;    /* JTech: slate */
  --cat-shared: #8fd19e;  /* Shared calendar */
}
body.shell, body.shell-page {
  --shell-bg: #07090e;
  --shell-card: #111723;
  --shell-ink: #e8eefc;
  --shell-muted: #8b97ad;
  --shell-line: #1e2633;
  --shell-chip: #1e2633;
  --shell-accent: #3b6fd8;   /* Fitness blue: pages outside the three categories */
  --shell-accent-ink: #fff;
  --shell-input: #0b101a;
  --shell-danger: #8a2f2f;
  --shell-link: #8fb4ff;
  --shell-pad: 14px;
}
body.shell-page { --shell-accent: var(--cat-main); --shell-accent-ink: #041018; --shell-link: var(--cat-main); }
body.shell-page.on-side {
  --shell-bg: #120e06; --shell-card: #1e1608; --shell-line: #3a2e14; --shell-chip: #2e2410; --shell-input: #161004;
  --shell-ink: #f8f0dc; --shell-muted: #b4a078;
  --shell-accent: var(--cat-av); --shell-accent-ink: #1a1200; --shell-link: #ffd056;
}
body.shell-page.on-jtech {
  --shell-bg: #14171c; --shell-card: #1c2128; --shell-line: #313942; --shell-chip: #2a313a; --shell-input: #111418;
  --shell-ink: #eef1f4; --shell-muted: #9aa3ad;
  --shell-accent: #d5dde6; --shell-accent-ink: #14171c; --shell-link: #d5dde6;
}
.cat-main { --cat: var(--cat-main); }
.cat-av { --cat: var(--cat-av); }
.cat-work { --cat: var(--cat-work); }
.cat-shared { --cat: var(--cat-shared); }

/* ---------- standalone page base ---------- */
body.shell {
  margin: 0;
  background: var(--shell-bg);
  color: var(--shell-ink);
  font: 15px/1.4 system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
}

/* ---------- chrome ---------- */
.shell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--shell-pad) 10px;
  border-bottom: 1px solid var(--shell-line);
  color: var(--shell-ink);
}
.shell-head h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 700 20px system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
  text-align: left;
  color: var(--shell-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-back { color: var(--shell-link); text-decoration: none; font-weight: 600; white-space: nowrap; }
.shell-menu {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--shell-chip); color: var(--shell-ink);
  border: 0; border-radius: 12px; font-size: 17px; cursor: pointer;
}
.shell-chat { padding: 7px 12px; font-size: 13px; flex-shrink: 0; }
.shell-chat[aria-pressed="true"] { background: var(--shell-accent); color: var(--shell-accent-ink); }
.shell-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px var(--shell-pad);
  margin: 0;
  background: var(--shell-bg);
  border-bottom: 1px solid var(--shell-line);
  scrollbar-width: none;
}
.shell-tabs::-webkit-scrollbar { display: none; }
.shell-tabs button {
  background: var(--shell-chip);
  color: var(--shell-ink);
  border: 0;
  border-radius: 12px;
  padding: 8px 14px;
  font: 600 14px system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.shell-tabs button.on { background: var(--shell-accent); color: var(--shell-accent-ink); }
.shell-badge { background: #e0a02a; color: #07090e; border-radius: 9px; padding: 0 6px; margin-left: 4px; font-size: 12px; }
.shell-main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px var(--shell-pad) 20px;
  color: var(--shell-ink);
  text-align: left;
  font: 15px/1.4 system-ui, -apple-system, sans-serif;
}
.shell-wide .shell-main { max-width: 1100px; }

/* ---------- content ---------- */
.shell-card { background: var(--shell-card); border-radius: 14px; padding: 12px; margin: 0 0 10px; min-width: 0; }
.shell-card > h3, .shell-card > h2 {
  margin: 0 0 8px; font: 650 16px system-ui, -apple-system, sans-serif; color: var(--shell-ink);
  text-align: center; letter-spacing: 0; display: flex; gap: 8px; align-items: center; justify-content: center;
}
.shell-card > h3 span, .shell-card > h2 span { flex: 1; }
.shell-muted { color: var(--shell-muted); font-size: 13px; line-height: 1.45; margin: 0 0 8px; text-align: left; }
.shell-empty { text-align: center; padding: 24px 12px; color: var(--shell-muted); }
.shell-empty b { display: block; color: var(--shell-ink); font-size: 17px; margin-bottom: 6px; }
.shell-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; margin: 0;
  border: 0; border-top: 1px solid var(--shell-line); border-radius: 0;
  background: none; color: inherit; width: 100%; min-width: 0;
  font: inherit; font-size: 14px; text-align: left;
}
.shell-row:first-child { border-top: 0; padding-top: 2px; }
.shell-row:last-child { padding-bottom: 2px; }
button.shell-row, .shell-row-body { cursor: pointer; }
.shell-row-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; text-align: left;
}
.shell-row-body strong { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-row .meta, .shell-row-body .meta { color: var(--shell-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-row .when { color: var(--shell-muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.shell-cat-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--cat, var(--shell-accent)); flex-shrink: 0; }
.shell-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--shell-accent)); display: inline-block; flex-shrink: 0; }
.shell-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--cat, var(--shell-muted)); background: color-mix(in srgb, var(--cat, #8b97ad) 14%, transparent);
  border-radius: 8px; padding: 2px 7px;
}
.shell-btn {
  background: var(--shell-chip); color: var(--shell-ink);
  border: 0; border-radius: 12px; padding: 9px 13px;
  font: 600 14px system-ui, -apple-system, sans-serif; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.shell-btn.ok { background: var(--shell-accent); color: var(--shell-accent-ink); }
.shell-btn.danger { background: var(--shell-danger); color: #fff; }
.shell-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--shell-line); }
.shell-btn.small { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.shell-btn:disabled { opacity: .45; cursor: default; }
.shell-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.shell-main input:not([type="checkbox"]):not([type="radio"]),
.shell-main select,
.shell-main textarea,
.shell-field {
  background: var(--shell-input); color: var(--shell-ink);
  border: 1px solid var(--shell-line); border-radius: 10px;
  padding: 9px 10px; font: 16px system-ui, -apple-system, sans-serif;
  width: 100%; min-width: 0; box-sizing: border-box; min-height: 0;
}
.shell-main input[type="checkbox"], .shell-main input[type="radio"], .shell-check {
  width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: var(--shell-accent);
}
.shell-filter { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 0 auto 10px; width: 100%; }
.shell-filter > * { flex: 1 1 0; min-width: 0; }
.shell-filter > .narrow { flex: 0 0 auto; width: auto; }
.shell-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shell-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--shell-muted); min-width: 0; }
.shell-form label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--shell-ink); }
.shell-form .wide { grid-column: 1 / -1; }
.shell-check-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }

/* ---------- bottom bar ---------- */
.shell-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--shell-bg) 88%, #1a2436);
  border-top: 1px solid var(--shell-line);
  padding: 8px var(--shell-pad) calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.shell-bar.shell-bar-sticky { position: sticky; bottom: 0; margin: 6px calc(-1 * var(--shell-pad)) -20px; }
.shell-bar-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; max-width: 860px; margin: 0 auto; }
.shell-bar-inner .shell-btn { flex: 1; padding: 12px 8px; }
.shell-bar .shell-confirm { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0 auto 8px; max-width: 860px; font-size: 14px; }
body.shell.shell-has-bar { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); }

@media (min-width: 900px) {
  .shell-head, .shell-tabs { padding-left: max(24px, calc((100% - 860px) / 2)); padding-right: max(24px, calc((100% - 860px) / 2)); }
  .shell-wide .shell-head, .shell-wide .shell-tabs { padding-left: max(24px, calc((100% - 1100px) / 2)); padding-right: max(24px, calc((100% - 1100px) / 2)); }
  .shell-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 14px; align-items: start; }
  .shell-split > * { min-width: 0; }
  .shell-wide .shell-bar-inner { max-width: 1100px; }
}

/* ---------- inside the main app (index.html): body.shell-page ---------- */
body.shell-page { background: var(--shell-bg); }
body.shell-page::before { display: none !important; }
body.shell-page .stage { padding: 0; }
body.shell-page .top,
body.shell-page:not(.shell-orb) .orb-band,
body.shell-page .chat-min-row { display: none !important; }
body.shell-page .board { padding: 0; min-height: 100%; display: flex; flex-direction: column; }
body.shell-page .board > .shell-main { flex: 1; }
body.shell-page .ask-stack,
body.shell-page .composer,
body.shell-page .local-folder { width: min(860px, calc(100% - 24px)); }
body.shell-page .composer { margin: 8px auto calc(env(safe-area-inset-bottom, 0px) + 10px); }
body.shell-page .ask-stack { margin: 8px auto 0; }
body.shell-page .hint { display: none; }

/* ---------- pilot pages inside the main app: older style.css rules reset here ---------- */
.shell-main [hidden] { display: none !important; }
.shell-main h2, .shell-main h3 { text-align: center; font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0; color: var(--shell-ink); }
.shell-main h2 { font-size: 17px; margin: 0 0 8px; }
.shell-main h3 { font-size: 15px; margin: 0 0 8px; }
.shell-main .board-note { width: auto; margin: 0 0 8px; text-align: center; color: var(--shell-muted); font-size: 13px; }
.shell-main .page-btn,
.shell-main .triage-pane button:not(.shell-btn) {
  background: var(--shell-chip); color: var(--shell-ink); border: 0; border-radius: 10px;
  padding: 7px 11px; font: 600 13px system-ui, -apple-system, sans-serif; cursor: pointer;
}
.shell-main .page-btn:disabled, .shell-main .triage-pane button:disabled { opacity: .45; }
.shell-error { color: #ff9a8a !important; }
.shell-main a { color: var(--shell-link); }

/* Mail */
.shell-main .mail-list, .shell-main .mail-read, .shell-main .connect-accounts { width: auto; margin: 0 0 10px; }
.shell-main .mail-list { border-left: 3px solid var(--cat, var(--shell-accent)); }
.shell-main .mail-row { border: 0; border-top: 1px solid var(--shell-line); border-radius: 0; margin: 0; padding: 10px 0; justify-content: flex-start; }
.shell-main .mail-row:first-child { border-top: 0; padding-top: 2px; }
.shell-main .mail-row:last-child { padding-bottom: 2px; }
.shell-main .mail-read { white-space: normal; text-align: left; }
.shell-main .mail-read-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.shell-main .mail-read-top { justify-content: flex-end; margin: 0 0 6px; }
.shell-main .triage-pane { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.shell-main .triage-pane article { background: var(--shell-input); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.shell-main .triage-pane article p { margin: 4px 0; }
.shell-main .triage-pane pre { white-space: pre-wrap; font: 13px/1.45 ui-monospace, monospace; }
.shell-main .account-card { display: block; border: 0; border-left: 3px solid var(--cat, var(--shell-accent)); margin: 0 0 10px; padding: 12px; }
.shell-main .account-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.shell-main .account-card .shell-muted { margin: 2px 0; }
.shell-main .account-card .shell-actions { margin-top: 8px; }
.shell-main .account-card .shell-actions:empty { display: none; }
.shell-main .account-add summary { cursor: pointer; font-weight: 650; color: var(--shell-link); }
.shell-main .account-add[open] summary { margin-bottom: 10px; }
.shell-main .connect-add { display: grid; }
.shell-main .apple-save, .shell-main .client-save { display: grid; gap: 8px; margin-top: 10px; }
.shell-main .calendar-account-settings .calendar-provider { background: var(--shell-card); border: 0; border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; }
.shell-main .calendar-account-settings .account-card { background: var(--shell-input); margin: 10px 0 0; }

/* Calendar */
.shell-main .calendar-toolbar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: nowrap; }
.shell-main .calendar-toolbar strong { flex: 1; text-align: center; font-size: 16px; }
.shell-main .calendar-grid, .shell-main .calendar-weekdays { border: 0; overflow: visible; padding: 0; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays.cal-month { margin: 0 0 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--shell-muted); }
.cal-cell {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--shell-input); color: var(--shell-ink); font: 600 13px system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.cal-cell.off { background: transparent; color: var(--shell-muted); }
.cal-cell.today { background: var(--shell-accent); color: var(--shell-accent-ink); }
.cal-dots { display: flex; gap: 2px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--cat); display: block; }
.cal-cell.today .cal-dots i { box-shadow: 0 0 0 1px var(--shell-accent-ink); }
.shell-main .calendar-event { display: flex; width: 100%; margin: 0; padding: 9px 0; font-size: 14px; overflow-wrap: normal; }
.shell-main .calendar-event:first-of-type { border-top: 0; }
.shell-main .calendar-day { min-height: 0; border: 0; padding: 12px; min-width: 0; }
.shell-main .calendar-day h3 { margin: 0 0 4px; }
.shell-main .calendar-date { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.shell-main .calendar-day.today .calendar-date { color: var(--shell-link); }
.shell-main .calendar-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; margin: 0 0 10px; padding: 12px; }
.shell-main .calendar-editor label { display: flex; }
.shell-main .calendar-editor textarea { min-height: 80px; }
.shell-main .calendar-providers { margin: 0 0 10px; }
.shell-main .calendar-providers .calendar-provider { border: 0; margin: 0; width: auto; }
.shell-main .calendar-providers .calendar-visibility { display: block; padding: 0; margin: 0; }
.shell-main .calendar-providers .calendar-visibility label { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.shell-main .calendar-visibility .shell-tag { margin-left: auto; }
.shell-main p[role="status"] { margin: 0 0 10px; }
@media (min-width: 900px) {
  .cal-cell { aspect-ratio: auto; height: 58px; }
}
@media (min-width: 1000px) {
  .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
  .cal-week .calendar-day { margin: 0; padding: 8px; }
  .cal-week .shell-row-body strong, .cal-week .shell-row .meta { white-space: normal; font-size: 13px; }
}

/* Notes */
.shell-main.note-app { width: 100%; margin: 0 auto; }
.shell-main .note-title { font-size: 17px; font-weight: 650; margin: 0 0 8px; }
.shell-main .note-pad { min-height: 300px; line-height: 1.45; resize: vertical; }
.shell-main .note-format, .shell-main .note-export { margin: 10px 0 0; }
.shell-main .note-rec { width: auto; margin: 0 0 10px; }
.shell-main .note-history { display: flex; margin: 0 0 10px; }
.shell-main .note-history .chat-item { color: var(--shell-ink); }
.shell-main .note-history .chat-item.on { background: color-mix(in srgb, var(--shell-accent) 18%, transparent); color: var(--shell-link); }
.shell-main .note-history .chat-item:hover { background: var(--shell-input); }

/* The folder picker belongs to chat: show it only while chat is open on shell pages. */
body.shell-page.ask-min .local-folder { display: none !important; }
.shell-main .account-card { text-align: left; border-left: 3px solid var(--cat, var(--shell-accent)) !important; }
.shell-main .account-card div.account-head { flex-direction: row; }
.shell-main .account-card div.shell-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.shell-main .account-card div.shell-muted { display: block; }

/* ---------- rollout (2026-11-27 night): every other page inside the main app ----------
   app.js puts the shell head in #shell-chrome and gives #board .shell-main.shell-legacy.
   The rules below restyle the older board markup (style.css) so those pages match the pilot pages. */
.shell-chrome[hidden] { display: none !important; }
body.shell-page .board.shell-legacy {
  display: block; width: 100%; max-width: 860px; margin: 0 auto; box-sizing: border-box;
  padding: 12px var(--shell-pad) 24px; text-align: left; min-height: 0;
}
.shell-legacy > .page-parent,
.shell-legacy > h2:first-child,
.shell-legacy > .page-parent + h2 { display: none; }
.shell-legacy .board-note, .shell-legacy .board-section {
  width: auto; margin-left: auto; margin-right: auto; text-align: center;
}
.shell-legacy p {
  width: auto; margin-left: 0; margin-right: 0; text-align: left;
}
.shell-legacy .board-note { color: var(--shell-muted); font-size: 14px; }
.shell-legacy h3 { font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0; text-align: center; color: var(--shell-ink); }
.shell-legacy .link-grid, .shell-legacy .account-connect {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 0 auto 12px; width: 100%;
}
.shell-legacy .link-grid a, .shell-legacy .link-grid button, .shell-legacy .account-connect button {
  display: flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box;
  flex: 0 1 160px; max-width: 240px;
  background: var(--shell-card); color: var(--shell-ink); border: 0; border-left: 3px solid var(--shell-accent);
  border-radius: 12px; padding: 10px 12px; text-decoration: none; text-align: center;
  font: 600 14px system-ui, -apple-system, sans-serif; letter-spacing: 0; text-transform: none; box-shadow: none; height: auto;
}
.shell-legacy .page-actions, .shell-legacy .practice-actions, .shell-legacy .history-tools, .shell-legacy .plan-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto 10px; width: auto;
}
.shell-legacy .page-btn, .shell-legacy button:not(.shell-btn):not(.shell-row):not([class*="remote"]) {
  min-height: 0;
}
.shell-legacy .page-body {
  background: var(--shell-card); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px;
  width: auto; max-width: none; text-align: left; color: var(--shell-ink); font: 15px/1.5 system-ui, -apple-system, sans-serif;
}
.shell-legacy .page-body:empty { display: none; }
.shell-legacy .page-body h2, .shell-legacy .page-body h3 { color: var(--shell-ink); text-align: left; font-size: 15px; margin: 12px 0 6px; }
.shell-legacy details, .shell-legacy .client-work, .shell-legacy .guide-part {
  background: var(--shell-card); border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; width: auto; text-align: left; border: 0;
}
.shell-legacy details > summary { cursor: pointer; font-weight: 650; color: var(--shell-ink); }
.shell-legacy details .page-body { background: transparent; padding: 8px 0 0; margin: 0; }
.shell-legacy input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .shell-legacy select, .shell-legacy textarea {
  background: var(--shell-input); color: var(--shell-ink); border: 1px solid var(--shell-line); border-radius: 10px;
  padding: 9px 10px; font: 16px system-ui, -apple-system, sans-serif; box-sizing: border-box; max-width: 100%;
}
.shell-legacy .page-form { display: grid; gap: 10px; width: auto; margin: 0; }
.shell-legacy .page-form label { display: grid; gap: 4px; font-size: 13px; color: var(--shell-muted); text-align: left; }
.shell-legacy .page-form textarea { min-height: 50vh; width: 100%; }
/* Chat history */
.shell-legacy .history-list { display: block; background: var(--shell-card); border-radius: 14px; padding: 4px 12px; width: auto; }
.shell-legacy .chat-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  background: none; border: 0; border-top: 1px solid var(--shell-line); border-radius: 0; padding: 10px 0; color: var(--shell-ink); text-align: left;
}
.shell-legacy .chat-item:first-child { border-top: 0; }
.shell-legacy .chat-item.on .chat-title { color: var(--shell-link); }
.shell-legacy .chat-title { font-weight: 650; font-size: 15px; }
.shell-legacy .chat-meta { color: var(--shell-muted); font-size: 12px; }
@media (min-width: 900px) {
  body.shell-page .board.shell-legacy { padding: 16px 24px 28px; }
}

/* ---------- standalone pages: ☰ page sheet, and tokens for pages that keep their own look (Holo) ---------- */
.shell-tokens {
  --shell-bg: #07090e; --shell-card: #111723; --shell-ink: #e8eefc; --shell-muted: #8b97ad; --shell-line: #1e2633;
  --shell-chip: #1e2633; --shell-accent: #3b6fd8; --shell-accent-ink: #fff; --shell-link: #8fb4ff;
}
.shell-sheet { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .45); }
.shell-sheet-panel {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 56px); left: 10px;
  width: min(280px, calc(100vw - 20px)); max-height: calc(100dvh - 80px); overflow-y: auto;
  background: var(--shell-card, #111723); border: 1px solid var(--shell-line, #1e2633); border-radius: 14px;
  padding: 6px; display: grid; gap: 2px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.shell-sheet-panel a {
  color: var(--shell-ink, #e8eefc); text-decoration: none; padding: 11px 12px; border-radius: 10px;
  font: 600 15px system-ui, -apple-system, sans-serif;
}
.shell-sheet-panel a:hover, .shell-sheet-panel a.on { background: var(--shell-chip, #1e2633); }
.shell-sheet-panel a.on { color: var(--shell-link, #8fb4ff); }
@media (min-width: 900px) { .shell-sheet-panel { left: max(24px, calc((100vw - 860px) / 2)); } }

/* Medium pages: Practice (Growth, Knowledge), Videos, Audio, House (Home automation, Controller, Music) */
.shell-legacy .practice-wrap, .shell-legacy .practice-card, .shell-legacy .practice-block,
.shell-legacy .video-jobs, .shell-legacy .video-sites, .shell-legacy .video-library,
.shell-legacy .house-flights, .shell-legacy .lan-devices, .shell-legacy .house-scenes, .shell-legacy .house-ask,
.shell-legacy .day-plan, .shell-legacy .controller-set, .shell-legacy .backup-card, .shell-legacy .backup-night {
  display: block; background: var(--shell-card); border: 0; border-radius: 14px; padding: 12px 14px; margin: 0 0 10px;
  width: auto; max-width: none; box-sizing: border-box; text-align: left; box-shadow: none; color: var(--shell-ink);
}
.shell-legacy .practice-card .practice-card, .shell-legacy .practice-wrap .practice-card { background: var(--shell-input); }
.shell-legacy .house-ask .house-one { background: var(--shell-input); border-radius: 12px; padding: 10px 12px; margin: 8px 0 0; }
.shell-legacy .practice-wrap > label, .shell-legacy .music-grid label, .shell-legacy .practice-time label, .shell-legacy .music-row label {
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--shell-muted); margin: 0 0 8px; text-align: left;
}
.shell-legacy .practice-wrap > label input, .shell-legacy .music-grid input { width: 100%; }
.shell-legacy .practice-time { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 10px; justify-content: flex-start; }
.shell-legacy .practice-time label { flex: 1 1 110px; margin: 0; }
.shell-legacy .practice-time input { width: 100%; }
.shell-legacy .practice-tab.on, .shell-legacy .practice-sub.on { background: var(--shell-accent); color: var(--shell-accent-ink); }
.shell-legacy .practice-subhead, .shell-legacy .practice-line { text-align: left; }
.shell-legacy .video-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--shell-line); }
.shell-legacy .video-row:first-of-type { border-top: 0; }
.shell-legacy .video-meta { color: var(--shell-muted); font-size: 12px; }
.shell-legacy .lan-list { display: block; margin: 0; padding: 0; }
.shell-legacy .lan-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--shell-line); }
.shell-legacy .lan-row:first-child { border-top: 0; }
.shell-legacy .lan-detail { color: var(--shell-muted); font-size: 12px; }
.shell-legacy .scene-form { display: grid; gap: 8px; margin: 8px 0 0; }
.shell-legacy .scene-form input, .shell-legacy .scene-form select { width: 100%; }
.shell-legacy .controller-set h3, .shell-legacy .house-flights h3, .shell-legacy .lan-devices h3, .shell-legacy .house-scenes h3, .shell-legacy .music-controls h3 {
  margin: 0 0 6px; font: 650 16px system-ui, -apple-system, sans-serif; letter-spacing: 0; text-transform: none;
}
.shell-legacy .music-controls h3 + .board-note { margin-top: 0; }
.shell-legacy .music-controls h3:not(:first-child) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--shell-line); }
.shell-legacy .music-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 8px; }
.shell-legacy .music-row > select, .shell-legacy .music-row > input { flex: 1 1 180px; width: auto; }
.shell-legacy .music-row > label { flex: 1 1 140px; margin: 0; }
.shell-legacy .music-controls > input { width: 100%; margin: 0 0 8px; }
.shell-legacy .music-keys .page-btn { flex: 1 1 0; min-width: 72px; }
.shell-legacy .music-grid { display: grid; gap: 0 10px; margin: 8px 0 0; }
.shell-legacy .music-setup { background: var(--shell-input); padding: 8px 12px; margin: 0 0 10px; }
.shell-legacy .hand-remote { margin: 8px 0 0; }
.shell-legacy .client-work summary, .shell-legacy details > summary { font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0; text-transform: none; }
.shell-legacy .client-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.shell-legacy .client-add input { flex: 1 1 140px; }
@media (min-width: 900px) {
  .shell-legacy .music-grid { grid-template-columns: 1fr 1fr; }
}

/* Mail review queue (inner markup rebuilt in the rollout) */
.shell-main .triage-pane > h2 { margin: 0 0 6px; }
.shell-main .triage-bar { margin: 4px 0 6px; }
.shell-main .triage-group { margin: 14px 0 0; }
.shell-main .triage-group > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.shell-main .triage-pane article.triage-card { background: var(--shell-input); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.shell-main .triage-pick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.shell-main .triage-pick > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shell-main .triage-pick strong { font-size: 15px; }
.shell-main .triage-decision { font-size: 12px; color: var(--shell-muted); }
.shell-main .triage-decision.done { color: var(--shell-link); }
.shell-main .triage-meta { display: flex; flex-direction: column; gap: 1px; margin: 6px 0 0 30px; font-size: 13px; color: var(--shell-muted); }
.shell-main .triage-meta strong { color: var(--shell-ink); font-weight: 600; }
.shell-main .triage-pane article p.triage-summary { margin: 6px 0 0 30px; white-space: pre-wrap; }
.shell-main .triage-pane article > .shell-actions, .shell-main .triage-pane article > p.shell-muted, .shell-main .triage-draft, .shell-main .triage-ids { margin: 6px 0 0 30px; }
.shell-main .triage-ids summary, .shell-main .triage-draft summary { cursor: pointer; font-size: 12px; color: var(--shell-muted); }
.shell-main .triage-pane .triage-ids p { margin: 4px 0 0; font-size: 12px; color: var(--shell-muted); overflow-wrap: anywhere; }
.shell-main .triage-pager { margin: 12px 0 0; }
/* Calendar account settings: shell type, no display face */
.shell-main .calendar-provider > summary { cursor: pointer; font: 650 15px system-ui, -apple-system, sans-serif; letter-spacing: 0; text-transform: none; color: var(--shell-ink); }
.shell-head .shell-back { max-width: 40%; overflow: hidden; text-overflow: ellipsis; }

/* Chat page in the shell: head on top, the model switch as a slim row under it, the thread centered. */
body.shell-page.on-chat .top {
  display: flex !important; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  width: min(860px, 100%); margin: 0 auto; box-sizing: border-box; padding: 6px var(--shell-pad); border: 0; background: none;
}
body.shell-page.on-chat .top .menu-btn { display: none; }
body.shell-page.on-chat .top .chips { margin-left: 0; justify-content: center; }
body.shell-page.on-chat .board-scroll { padding: 0; }
body.shell-page.on-chat #log { width: min(860px, 100%); margin: 0 auto; box-sizing: border-box; padding: 8px var(--shell-pad) 12px; }
body.shell-page.on-chat #actions, body.shell-page.on-chat .actions { width: min(860px, calc(100% - 24px)); margin: 0 auto; justify-content: center; }
body.shell-page.on-chat .shell-chrome .shell-head h1 { flex: 1; }


/* ---------- Home and Chat in the shell, with the orb kept (2026-11-28) ----------
   body.shell-orb is set by app.js on Home and Chat only. The head sits at the top of the stage; the orb band,
   its Start conversation / History / Dashboard buttons, its voice state and its reply text all stay and work
   as before, just fitted to the centered column. Other shell pages still hide the orb. */
body.shell-orb .stage { display: flex; flex-direction: column; padding: 0 0 8px; }
body.shell-orb .stage > * { flex: 0 0 auto; }
body.shell-orb .stage > .board-scroll { flex: 1 1 auto; min-height: 0; }
body.shell-orb.ask-min .orb-band { display: flex !important; }
body.shell-orb .orb-band { width: min(860px, 100%); box-sizing: border-box; margin: 0 auto; padding: 8px var(--shell-pad) 10px; gap: 8px; }
body.shell-orb .orb-row {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 10px; width: 100%;
}
body.shell-orb .orb-visual { width: min(188px, 48vw); justify-self: center; }
body.shell-orb .orb-controls {
  display: flex; flex-flow: row wrap; justify-content: center; align-items: center;
  width: min(420px, 100%); gap: 10px 12px;
}
body.shell-orb .orb-btn {
  background: var(--shell-chip); color: var(--shell-ink); border: 0; border-radius: 12px; box-shadow: none;
  padding: 10px 14px; font: 600 13px system-ui, -apple-system, sans-serif; letter-spacing: 0; text-transform: none;
  min-width: 132px; flex: 0 1 auto; width: auto; max-width: 100%;
}
body.shell-orb .orb-btn:hover { background: color-mix(in srgb, var(--shell-chip) 80%, var(--shell-accent)); color: var(--shell-ink); }
body.shell-orb .orb-btn#orb-call, body.shell-orb .orb-btn.on { background: var(--shell-accent); color: var(--shell-accent-ink); }
body.shell-orb .orb-btn#orb-home,
body.shell-orb .orb-btn#orb-games,
body.shell-orb .orb-btn#orb-library { display: none; }
body.shell-orb .orb-kicker { color: var(--shell-muted); }
body.shell-orb .orb-line { color: var(--shell-ink); font-size: 15px; }
body.shell-orb .orb-reply {
  width: 100%; box-sizing: border-box; text-align: left; margin: 8px 0 0; padding: 10px 14px;
  background: var(--shell-card); border-radius: 14px; font-size: 15px;
}
body.shell-orb .board-scroll { padding: 0; }
body.shell-orb .shell-chrome .shell-head h1 { flex: 1; }
@media (min-width: 900px) {
  body.shell-orb .orb-visual { width: 220px; }
  body.shell-orb .orb-controls { width: min(520px, 100%); gap: 12px 14px; }
  body.shell-orb .orb-btn { padding: 11px 16px; font-size: 14px; }
}
/* Home: the clock, weather and links, in the centered column with category colors */
body.shell-page .board.shell-home { padding: 4px var(--shell-pad) 20px; }
.shell-home .dash-top { max-width: 560px; margin: 0 auto 12px; }
.shell-home .link-grid a {
  border-left-color: var(--shell-accent);
}
.shell-home .link-grid a[href="#/smith-av-work"] { border-left-color: var(--cat-av); }
.shell-home .link-grid a[href="#/josh-jtech"] { border-left-color: var(--cat-work); }
.shell-home .link-grid a[href="#/how-to"] { border-left-color: var(--shell-line); }
.shell-home .dash-folder { background: var(--shell-card); }
body.shell-orb.on-chat .welcome { padding-top: 8px; }
body.shell-orb.on-chat .welcome h2 { font-size: 22px; margin-bottom: 6px; }


/* ---------- more centered shell, slimmer mobile orb (2026-11-28) ----------
   Headings, tab/pill rows and leftover cards sit in the middle, with even side margins.
   Mail bodies, review notes and other long reading text stay left-aligned inside those cards.
   On Chat and Home, Start/End conversation, History and 3D view sit centered under the orb at every width; Dashboard, Games and Library stay in the menu. */
.shell-main .mail-list h2, .shell-main .mail-list h3,
.shell-main .mail-read h2, .shell-main .mail-read h3,
.shell-main .triage-group > h3,
.shell-main .calendar-day h3,
.shell-main .page-body h2, .shell-main .page-body h3,
.shell-main .note-app h2, .shell-main .note-app h3,
.shell-main .mail-read, .shell-main .mail-read-body,
.shell-main .triage-pane, .shell-main .triage-summary,
.shell-legacy .page-body, .shell-legacy .page-body p,
.shell-legacy .page-form label { text-align: left; }
.shell-main .triage-group > h3, .shell-main .calendar-day h3 { justify-content: flex-start; }
.shell-main .page-empty, .shell-legacy .page-empty, .shell-legacy p.page-empty, .shell-legacy .page-body .page-empty,
.shell-legacy .page-body > p.page-empty { text-align: center; margin: 16px auto; color: var(--shell-muted); }
.shell-main .account-card .shell-actions { justify-content: flex-start; }
.shell-main .triage-pane article > .shell-actions { justify-content: flex-start; }
.shell-main .mail-read-top { justify-content: flex-end; }
body.shell-page .picture-bar, body.shell .picture-bar { justify-content: center; }
body.shell-page .local-folder, body.shell .local-folder { margin-left: auto; margin-right: auto; }
.shell-home .link-grid { width: 100%; margin: 0 auto 12px; }
.shell-home .link-grid a { text-align: center; }
.shell-home .dash-folder {
  width: min(720px, 100%); margin: 0 auto 20px; padding: 10px 16px 20px;
  box-sizing: border-box;
}
.shell-home .dash-folder > summary {
  color: var(--shell-ink); font: 650 16px system-ui, -apple-system, sans-serif;
  letter-spacing: 0; text-transform: none; text-align: center;
  padding: 14px 8px 14px; margin: 0;
}
.shell-home .dash-folder .link-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px; width: 100%; margin: 4px auto 0;
}
.shell-home .dash-folder .link-grid a {
  flex: 0 1 calc((100% - 14px) / 2);
  max-width: calc((100% - 14px) / 2);
  min-height: 56px; padding: 16px 14px; font-size: 15px;
  background: var(--shell-input);
  box-sizing: border-box;
}
@media (min-width: 900px) {
  .shell-home .dash-folder .link-grid { gap: 18px 20px; }
  .shell-home .dash-folder .link-grid a {
    flex: 0 1 calc((100% - 40px) / 3);
    max-width: calc((100% - 40px) / 3);
    min-height: 64px; padding: 18px 16px; font-size: 16px;
  }
}
