/* ==========================================================================
   ConciergeOS One — shared design layer
   Source: Palma One UI Designer Package (executive, clean, premium, mobile-first;
   navy / white / pale-blue; AI command bar as the central interaction point).

   Load AFTER each surface's own stylesheet:
     Practice Portal  /static/practice-console/index.html
     Vendor Portal    /static/vendor-portal.html
     Backend          /static/index.html

   1. Tokens (--one-*)           shared across all three surfaces
   2. Legacy token bridges       remap each surface's existing variables so the
                                 whole UI shifts palette without JS changes
   3. Components (.one-*)        hero, command bar, glance tiles, list rows, drawer
   4. Z-depth system (.zs-*)     Z-scroll DSIA depth utilities (reduced-motion safe)
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --one-navy: #11285c;
  --one-navy-deep: #0b1d45;
  --one-ink: #111c35;
  --one-ink-soft: #4d5b75;
  --one-ink-faint: #505f77;
  --one-blue: #1b6fd8;
  --one-blue-bright: #2b82ec;
  --one-sky: #e6f1fd;
  --one-sky-deep: #cfe3fa;
  --one-bg: #f7f9fc;
  --one-bg-wash: #eef3fa;
  --one-panel: #ffffff;
  --one-line: #dde5f0;
  --one-line-strong: #c6d3e6;

  /* Glance tile tints (Today at a Glance) */
  --one-tint-blue: #e8f1fd;
  --one-tint-green: #e7f6ee;
  --one-tint-peach: #fdeee4;
  --one-tint-violet: #efeafc;

  --one-ok: #2f8a5b;
  --one-warn: #b87516;
  --one-danger: #c44757;

  --one-font-display: Georgia, "Times New Roman", serif;
  --one-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --one-radius-sm: 12px;
  --one-radius: 20px;
  --one-radius-lg: 28px;
  --one-pill: 999px;
  --one-shadow: 0 16px 44px rgba(17, 40, 92, .09);
  --one-shadow-lift: 0 30px 70px rgba(17, 40, 92, .20);
  --one-ease: cubic-bezier(.16, .84, .34, 1);

  /* Z-depth scale (px of translateZ) */
  --zs-perspective: 1200px;
  --zs-back: -90px;
  --zs-rest: 0px;
  --zs-lift: 48px;
}

/* 2. Legacy token bridges -------------------------------------------------- */

/* Practice Portal (practice-console/styles.css): teal accent -> Palma blue.
   html.dark in that sheet has higher specificity and keeps its dark palette. */
:root {
  --ink: var(--one-ink);
  --muted: #5d6b84;
  --faint: var(--one-ink-faint);
  --line: var(--one-line);
  --teal: var(--one-blue);
  --teal-soft: var(--one-sky);
  --violet: #6a5ad8;
  background: var(--one-bg-wash);
  font-family: var(--one-font-ui);
  --shadow: var(--one-shadow);
  --ease: var(--one-ease);
}
.app-shell { background: radial-gradient(900px 560px at 85% -12%, rgba(27, 111, 216, .10), transparent 62%), linear-gradient(180deg, #f7f9fc, #eef3fa); }
.brand-mark { background: linear-gradient(145deg, var(--one-navy), #1d3f86); color: #fff; }
.menu-staggered-btn, .command-primary { background: var(--one-navy); border-color: var(--one-navy); }
.workspace-head h1, .session-home h1, .auth-card h1 { font-family: var(--one-font-display); font-weight: 400; letter-spacing: -.03em; }

/* Backend (styles.css, "Keramos" stone/gold): -> navy / white / pale blue. */
:root {
  --bg-stone: #eef3fa;
  --bg-marble: #f7f9fc;
  --bg-panel: #ffffff;
  --bg-panel-alt: #fbfcfe;
  --bg-inset: #e9eff8;
  --bg-surface: #f3f6fb;
  --bg-input: #f1f5fb;
  --border-subtle: #e3e9f2;
  --border-medium: #d3dcea;
  --border-bright: #b9c7dc;
  --gold: var(--one-blue);
  --gold-bright: var(--one-blue-bright);
  --gold-dim: var(--one-navy);
  --gold-glow: rgba(27, 111, 216, .22);
  --gold-glow-strong: rgba(27, 111, 216, .38);
  --gold-bg: rgba(27, 111, 216, .09);
  --walnut: var(--one-navy);
  --walnut-light: #2a4a8a;
  --walnut-bg: rgba(17, 40, 92, .07);
  --text-primary: var(--one-ink);
  --text-secondary: var(--one-ink-soft);
  --text-dim: var(--one-ink-faint);
  --text-led: var(--one-blue);
  --font-display: var(--one-font-ui);
  --font-ui: var(--one-font-ui);
  --r-lg: 16px;
  --r-xl: 24px;
}
body.theme-dark {
  background-color: var(--bg-stone);
  background-image: radial-gradient(ellipse at 82% -10%, rgba(27, 111, 216, .09), transparent 55%);
  font-family: var(--one-font-ui);
}
body.theme-dark h1 { font-family: var(--one-font-display); font-weight: 400; letter-spacing: -.03em; }

/* Vendor Portal (inline :root in vendor-portal.html). */
body:has(.auth-layout) {
  background: var(--one-bg);
}
.auth-layout ~ *, .shell { --gold: var(--one-blue); --gold-soft: var(--one-sky); }
.shell h1 { font-family: var(--one-font-display); font-weight: 400; letter-spacing: -.03em; line-height: 1.04; }
.shell .button { background: var(--one-navy); border-radius: var(--one-pill); }
.shell input:focus { border-color: var(--one-blue); box-shadow: 0 0 0 3px rgba(27, 111, 216, .16); }
.shell .eyebrow { color: var(--one-ink-faint); }
.shell .mark { background: var(--one-sky); color: var(--one-navy); }
.shell .card { border-radius: var(--one-radius); }

/* 3. Components ------------------------------------------------------------ */

/* Greeting hero: date, serif greeting, one-line purpose, command bar beneath. */
.one-hero { position: relative; overflow: hidden; border-radius: var(--one-radius-lg); padding: clamp(20px, 4vw, 40px); color: var(--one-ink);
  background: linear-gradient(180deg, #eaf3ff 0%, #f7fafe 70%, #fff 100%); isolation: isolate; }
.one-hero.has-scene { color: #fff; background: var(--one-navy-deep); }
.one-hero-scene { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.one-hero-date { font-size: 13px; letter-spacing: .02em; color: var(--one-ink-soft); }
.one-hero h1 { margin: 8px 0 6px; font-family: var(--one-font-display); font-weight: 400; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.06; letter-spacing: -.035em; }
.one-hero-sub { max-width: 640px; color: var(--one-ink-soft); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.5; }

/* Command bar: the central interaction point. */
.one-command { display: flex; align-items: center; gap: 10px; padding: 8px 9px 8px 20px; border: 1px solid var(--one-line); border-radius: var(--one-pill);
  background: #fff; box-shadow: 0 0 0 5px rgba(27, 111, 216, .14), var(--one-shadow); }
.one-command input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 12px 6px; color: var(--one-ink); font: inherit; font-size: 16px; }
.one-command input::placeholder { color: var(--one-ink-faint); }
.one-command .one-command-go { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: var(--one-navy); cursor: pointer; }
.one-command .one-command-aux { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--one-ink-soft); background: transparent; cursor: pointer; }

/* Quick action row (Calendar / Clock / Alerts / Dashboards equivalents). */
.one-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.one-quick > * { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1px solid var(--one-line); border-radius: var(--one-radius-sm); background: rgba(255, 255, 255, .92); color: var(--one-navy); font: inherit; font-weight: 700; text-align: center; cursor: pointer; }
.one-quick small { color: var(--one-ink-soft); font-weight: 500; font-size: 12px; }

/* Glance tiles (Today at a Glance). Tint comes from a modifier. */
.one-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.one-glance-tile { display: grid; gap: 2px; padding: 16px 12px; border-radius: var(--one-radius-sm); background: var(--one-tint-blue); text-align: center; color: var(--one-ink); }
.one-glance-tile strong { font-family: var(--one-font-display); font-weight: 400; font-size: 34px; line-height: 1.1; color: var(--one-navy); }
.one-glance-tile span { font-size: 13px; font-weight: 600; }
.one-glance-tile small { color: var(--one-ink-soft); font-size: 12px; }
.one-glance-tile.is-green { background: var(--one-tint-green); }
.one-glance-tile.is-peach { background: var(--one-tint-peach); }
.one-glance-tile.is-violet { background: var(--one-tint-violet); }

/* Card + section head + list row (Upcoming). */
.one-card { padding: clamp(16px, 2.4vw, 24px); border: 1px solid var(--one-line); border-radius: var(--one-radius); background: var(--one-panel); box-shadow: var(--one-shadow); }
.one-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.one-section-head h2 { font-size: 20px; font-weight: 700; color: var(--one-navy); }
.one-section-head a, .one-section-head button { border: 0; background: none; color: var(--one-blue); font: inherit; font-weight: 600; cursor: pointer; }
.one-row { display: grid; grid-template-columns: 76px 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--one-line); color: var(--one-ink); }
.one-row:first-of-type { border-top: 0; }
.one-row time { font-size: 14px; color: var(--one-ink); }
.one-row time small { display: block; color: var(--one-ink-faint); font-size: 12px; }
.one-row-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--one-blue); }
.one-row-dot.is-violet { background: #a35fe0; }
.one-row-dot.is-green { background: #2fb573; }
.one-row strong { display: block; font-weight: 600; }
.one-row small { color: var(--one-ink-soft); }

/* Status pill (kept semantic: ok / warn / danger). */
.one-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--one-line); border-radius: var(--one-pill); background: #fff; color: var(--one-navy); font-size: 12px; font-weight: 700; }
.one-pill.is-ok { color: var(--one-ok); background: var(--one-tint-green); border-color: #cfe9da; }
.one-pill.is-warn { color: var(--one-warn); background: #fff5e3; border-color: #f0dcae; }
.one-pill.is-danger { color: var(--one-danger); background: #fdeef0; border-color: #f2c8cf; }

/* Department drawer (menu option C: clean left drawer; option A: right drawer). */
.one-drawer { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(420px, 92vw); display: flex; flex-direction: column; border-radius: 0 var(--one-radius-lg) var(--one-radius-lg) 0;
  background: rgba(250, 252, 255, .96); backdrop-filter: blur(18px); box-shadow: var(--one-shadow-lift); transform: translateX(-102%); transition: transform .34s var(--one-ease); overflow-y: auto; }
.one-drawer.is-right { left: auto; right: 0; border-radius: var(--one-radius-lg) 0 0 var(--one-radius-lg); transform: translateX(102%); }
.one-drawer.is-open { transform: none; }
.one-drawer-head { padding: 22px 22px 8px; }
.one-drawer-head h2 { margin-top: 18px; font-family: var(--one-font-display); font-weight: 400; font-size: 32px; color: var(--one-navy-deep); }
.one-drawer-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; align-items: center; gap: 14px; margin: 0 12px; padding: 12px 10px; border: 0; border-top: 1px solid var(--one-line); border-radius: 0; background: none; color: var(--one-ink); font: inherit; text-align: left; cursor: pointer; }
.one-drawer-item strong { display: block; font-weight: 600; }
.one-drawer-item small { color: var(--one-ink-soft); font-size: 13px; }
.one-drawer-item.is-active { border-radius: var(--one-radius-sm); border-top-color: transparent; background: var(--one-sky); }
.one-drawer-item svg { width: 26px; height: 26px; color: var(--one-navy); stroke: currentColor; fill: none; stroke-width: 1.7; }
.one-scrim { position: fixed; z-index: 55; inset: 0; background: rgba(11, 29, 69, .38); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.one-scrim.is-open { opacity: 1; pointer-events: auto; }

/* 4. Z-depth system (Z-scroll DSIA) ---------------------------------------- */
/* A stage establishes perspective; layers sit at named depths. The runtime (or a
   scroll-driven timeline) sets --zs-progress (0 = behind, 1 = in focus) on a layer. */
.zs-stage { perspective: var(--zs-perspective); perspective-origin: 50% 30%; transform-style: preserve-3d; }
.zs-layer { --zs-progress: 1; transform: translate3d(0, calc((1 - var(--zs-progress)) * 22px), calc((1 - var(--zs-progress)) * var(--zs-back)));
  opacity: calc(.35 + var(--zs-progress) * .65); filter: blur(calc((1 - var(--zs-progress)) * 3px));
  transition: transform .34s var(--one-ease), opacity .24s ease, filter .24s ease, box-shadow .3s ease; will-change: transform, opacity; }
.zs-layer.is-focus { z-index: 4; box-shadow: var(--one-shadow-lift); transform: translate3d(0, -3px, var(--zs-lift)); opacity: 1; filter: none; }
.zs-stage.has-focus > .zs-layer:not(.is-focus) { opacity: .4; filter: saturate(.55); transform: translate3d(0, 0, var(--zs-back)); }

@media (prefers-reduced-motion: reduce) {
  .zs-layer, .zs-layer.is-focus, .zs-stage.has-focus > .zs-layer:not(.is-focus), .one-drawer, .one-scrim { transition: none; transform: none; filter: none; }
  .zs-stage.has-focus > .zs-layer:not(.is-focus) { opacity: .55; }
  .one-drawer { transform: none; display: none; }
  .one-drawer.is-open { display: flex; }
}

@media (max-width: 640px) {
  .one-row { grid-template-columns: 64px 10px minmax(0, 1fr) auto; gap: 10px; }
  .one-command { padding-left: 14px; }
  .one-hero { border-radius: var(--one-radius); }
}

/* ==========================================================================
   5. Practice Portal — session home in the Palma One composition
   Centered serif greeting, a bounded signal scene, one persistent session
   composer, and a focused answer area. Desktop/tablet stay within the viewport;
   phone layouts flow vertically so controls remain reachable.
   ========================================================================== */

/* Top bar: one calm row. The duplicate left-hand Workspace button is hidden
   (the right-hand pill opens the same dialog). */
.app-shell.is-session-home .topbar { height: 72px; border-bottom: 1px solid var(--one-line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
@media (max-width: 760px) {
  .app-shell.is-session-home .topbar { height: 62px; }
}
.app-shell.is-session-home .session-workspace-button { display: inline-flex; align-items: center; gap: 8px; }
.app-shell.is-session-home .top-actions { gap: 8px; }
.app-shell.is-session-home .top-pill-btn { padding: 7px 14px; border-color: var(--one-line); background: #fff; color: var(--one-navy); font-size: 12px; font-weight: 700; }
.app-shell.is-session-home .top-pill-btn:hover { background: var(--one-sky); border-color: var(--one-sky-deep); color: var(--one-navy); }
.app-shell.is-session-home .top-pill-btn.user-pill { background: var(--one-tint-green); border-color: #cfe9da; color: #1f6b45; }
.app-shell.is-session-home .note-engine-trigger { background: var(--one-sky); border-color: var(--one-sky-deep); color: var(--one-navy); }
.app-shell.is-session-home .menu-staggered-btn { background: var(--one-navy); border-color: var(--one-navy); }
.app-shell.is-session-home .menu-staggered-btn:hover { background: var(--one-navy-deep); }

/* Phone layouts may flow vertically; wider canvases remain viewport-contained. */
.app-shell.is-session-home,
.app-shell.is-session-home .app-body,
.app-shell.is-session-home .workspace { background: linear-gradient(180deg, #fff 0, var(--one-bg) 420px); }
.app-shell.is-session-home .workspace { overflow: hidden; }
.app-shell.is-session-home .surface-grid { height: 100%; min-height: 0; overflow: hidden; }
.app-shell.is-session-home .session-dashboard,
.app-shell.is-session-home .session-dashboard.guided-workspace { height: 100%; min-height: 0; overflow: hidden; background: transparent; grid-template-rows: auto auto minmax(0, 1fr); gap: clamp(8px, 1.5vh, 18px); }
.app-shell.is-session-home .session-layout { height: 100%; min-height: 0; overflow: hidden; }
/* An answer owns the stage while it is active. Keeping the landing hero in
   the grid would compress the result and make its review controls collide. */
.app-shell.is-session-home .session-dashboard.has-focus-active { grid-template-rows: auto minmax(0, 1fr); }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-hero-stage { display: none; }

/* Masthead recedes: small orb + role on the left, date/refresh on the right. */
.app-shell.is-session-home .session-masthead { min-height: 0; padding-top: 4px; }

/* Greeting block. */
/* Greeting block: concise welcome that preserves the single-viewport hierarchy. */
.app-shell.is-session-home .session-hero-stage { max-width: 920px; margin: 0 auto; padding: 0; flex: 0 0 auto; }
.app-shell.is-session-home .session-hero-masthead { margin: 2px 0 6px; text-align: center; }
.app-shell.is-session-home .session-hero-greeting { margin: 0 0 2px; font-family: var(--one-font-display); font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; color: var(--one-navy-deep); }
.app-shell.is-session-home .session-hero-subtitle { max-width: 560px; margin: 0 auto; font-size: clamp(.8rem, 1.1vw, .92rem); line-height: 1.35; color: var(--one-ink-soft); }
.app-shell.is-session-home .session-prompt-meta-actions { margin-bottom: 6px; }
.app-shell.is-session-home .hero-note-engine-badge { padding: 4px 10px; border-color: var(--one-line); color: var(--one-navy); font-size: 11px; }
.app-shell.is-session-home .hero-note-engine-badge .badge-count { background: var(--one-sky); color: var(--one-navy); }
.app-shell.is-session-home .hero-visual-toggle-btn { border-color: var(--one-line); color: var(--one-ink-soft); padding: 4px 8px; }

/* Scene card: a concise flex column so the relaxing shader, signal text and controls remain bounded and visible. */
.app-shell.is-session-home .session-scene-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  height: clamp(110px, 16vh, 150px); min-height: 110px; max-height: 160px; margin-bottom: 6px; padding: 10px 16px 12px;
  border-radius: var(--one-radius); background: var(--one-navy-deep);
  box-shadow: 0 12px 32px -10px rgba(11, 29, 69, .35), 0 1px 3px rgba(11, 29, 69, .10);
  position: relative; overflow: hidden;
}
.app-shell.is-session-home .session-scene-card::after { background: linear-gradient(180deg, rgba(11, 29, 69, .04) 0%, rgba(11, 29, 69, .22) 45%, rgba(11, 29, 69, .82) 100%); }

/* Signal text sits in normal flow without clipping actionable controls. */
.app-shell.is-session-home .scene-card-overlay-info { position: relative; bottom: auto; left: auto; right: auto; z-index: 10; margin-top: auto; }
.app-shell.is-session-home .scene-tag { color: #8cc4ff; font-size: 9px; letter-spacing: .08em; }
.app-shell.is-session-home .scene-title { margin: 2px 0 4px; font-family: var(--one-font-display); font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 500; letter-spacing: -.02em; }
.app-shell.is-session-home .scene-desc { max-width: 620px; font-size: .82rem; line-height: 1.3; color: #d3dff0; margin: 0; }
.app-shell.is-session-home .scene-signal-position { color: rgba(226, 236, 250, .85); font-size: 10px; }
.app-shell.is-session-home .scene-signal-action { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .55); border-radius: var(--one-pill); background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; backdrop-filter: blur(6px); }
.app-shell.is-session-home .scene-signal-action:hover { background: rgba(255, 255, 255, .26); }

/* Carousel controls centered, in the navy/white pill language. */
.app-shell.is-session-home .scene-card-controls { margin: 2px auto 6px; }
.app-shell.is-session-home .scene-ctrl-btn { border-color: var(--one-line); color: var(--one-navy); }
.app-shell.is-session-home .session-foryou-shelf { text-align: center; margin-top: 4px; }
.app-shell.is-session-home .foryou-label { color: var(--one-ink-faint); letter-spacing: .14em; }
.app-shell.is-session-home .foryou-pills-row { justify-content: center; gap: 8px; }
.app-shell.is-session-home .foryou-pill { padding: 8px 14px; border-color: var(--one-line); background: #fff; color: var(--one-navy); font-size: 12px; font-weight: 600; }
.app-shell.is-session-home .foryou-pill:hover { border-color: var(--one-sky-deep); background: var(--one-sky); color: var(--one-navy); }
.app-shell.is-session-home .pill-dot.teal { background: var(--one-blue); }
.app-shell.is-session-home .foryou-pin:hover,
.app-shell.is-session-home .foryou-pin.is-pinned { border-color: var(--one-sky-deep); color: var(--one-blue); background: var(--one-sky); }
.app-shell.is-session-home .foryou-hint { color: var(--one-ink-faint); }

/* Session history rail + answer card pick up the One panel language. */
.app-shell.is-session-home .session-history-item { border-radius: var(--one-radius-sm); }
.app-shell.is-session-home .session-voice-glance { border-color: var(--one-sky-deep); background: var(--one-sky); }
.app-shell.is-session-home .session-voice-kicker { color: var(--one-ink-soft); }
.app-shell.is-session-home .session-answer { border-color: var(--one-line); border-radius: var(--one-radius-lg); box-shadow: var(--one-shadow); }
.app-shell.is-session-home .session-answer h2 { font-family: var(--one-font-display); font-weight: 400; color: var(--one-navy-deep); }
.app-shell.is-session-home .session-pulse-action,
.app-shell.is-session-home .session-open-action { color: var(--one-blue); }

@media (max-width: 640px) {
  .app-shell.is-session-home .topbar { height: auto; min-height: calc(62px + env(safe-area-inset-top, 0px)); padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); flex-wrap: nowrap; justify-content: space-between; align-items: center; box-sizing: border-box; }
  .app-shell.is-session-home .top-actions { flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 6px; }
  .app-shell.is-session-home .top-actions .top-pill-btn { display: none !important; }
  .app-shell.is-session-home .app-body { display: flex; flex: 1; min-height: 0; width: 100%; max-width: 100vw; overflow-x: hidden; }
  .app-shell.is-session-home .workspace { height: auto; min-height: 0; flex: 1; width: 100%; max-width: 100vw; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); padding-bottom: calc(48px + env(safe-area-inset-bottom, 24px)); }
  .app-shell.is-session-home .surface-grid { height: auto; min-height: 100%; overflow: visible; }
  .app-shell.is-session-home .session-dashboard,
  .app-shell.is-session-home .session-dashboard.guided-workspace { width: 100%; max-width: 100%; box-sizing: border-box; height: auto; min-height: 0; overflow-x: hidden; grid-template-rows: auto auto auto; }
  .app-shell.is-session-home .session-layout { height: auto; min-height: 0; overflow: visible; }
  .app-shell.is-session-home .session-composer { min-height: 58px; padding: 8px 10px 8px 16px; align-items: center; }
  .app-shell.is-session-home .session-composer textarea { min-height: 48px; padding: 8px 2px; font-size: 14px; line-height: 1.4; box-sizing: border-box; }
  .app-shell.is-session-home .session-scene-card { min-height: 300px; padding: 14px; gap: 16px; border-radius: var(--one-radius); }
  .app-shell.is-session-home .hero-prompt-input { font-size: 14px; }
  .app-shell.is-session-home .scene-signal-footer { flex-wrap: wrap; }
}

/* Narrow tablets use Palma's mobile reading flow: named destinations stay
   reachable in a horizontal rail and the workspace owns the vertical scroll. */
@media (min-width: 521px) and (max-width: 640px) {
  .app-shell.is-session-home .app-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .app-shell.is-session-home .rail {
    display: flex !important;
    flex: 0 0 56px;
    width: 100%;
    height: 56px;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    border-right: 0;
    border-bottom: 1px solid #eef1f4;
  }
  .app-shell.is-session-home .rail-label { display: none; }
  .app-shell.is-session-home .rail-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    justify-content: flex-start;
    gap: 7px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    white-space: nowrap;
  }
  .app-shell.is-session-home .rail-item span { font-size: 14px; }
  .app-shell.is-session-home .workspace {
    height: auto;
    min-height: 0;
    flex: 1;
    padding: 0 12px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell.is-session-home .surface-grid { height: auto; min-height: 100%; overflow: visible; }
  .app-shell.is-session-home .session-dashboard,
  .app-shell.is-session-home .session-dashboard.guided-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }
  .app-shell.is-session-home .session-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .app-shell.is-session-home .session-main { grid-row: 1; min-height: 0; }
  .app-shell.is-session-home .session-history { grid-row: 2; min-height: 0; }
}

/* Practice Session simplification: one assistant, one workspace handoff,
   and one quieter path to the full signal/history detail. */
.app-shell.is-session-home .topbar { gap: 16px; }
.app-shell.is-session-home .context-strip { display: none; }
.app-shell.is-session-home .session-workspace-button,
.app-shell.is-session-home .top-actions .user-pill,
.app-shell.is-session-home .top-actions .menu-staggered-btn,
.app-shell.is-session-home .top-actions .icon-button,
.app-shell.is-session-home .top-actions .avatar { display: none !important; }
.app-shell.is-session-home .top-actions { gap: 8px; }
.app-shell.is-session-home .session-hero-stage { width: min(100%, 1040px); max-width: 1040px; }
.app-shell.is-session-home .session-hero-masthead { margin: 4px 0 14px; }
.app-shell.is-session-home .session-hero-greeting { font-size: clamp(1.55rem, 2.8vw, 2.25rem); }
.app-shell.is-session-home .session-hero-subtitle { font-size: 14px; }
.app-shell.is-session-home:has(.has-focus-active) .surface-grid,
.app-shell.is-session-home .session-dashboard.has-focus-active,
.app-shell.is-session-home .session-dashboard.guided-workspace.has-focus-active { height: 100% !important; min-height: 0 !important; overflow: hidden !important; grid-template-rows: auto auto minmax(0, 1fr) !important; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-hero-stage { display: block; flex: 0 0 auto; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-layout { display: flex; flex-direction: column; height: 100%; min-height: 0; flex: 1; overflow: hidden; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-main { display: flex; flex-direction: column; height: 100%; min-height: 0; flex: 1; overflow: hidden; gap: 8px; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-chat-log { flex: 0 0 auto; max-height: 76px; overflow-y: auto; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-main .session-history,
.app-shell.is-session-home .session-dashboard.has-focus-active .session-main [data-session-panel="signals"],
.app-shell.is-session-home .session-dashboard.has-focus-active .session-main .session-question-area { display: none !important; }
.app-shell.is-session-home .session-dashboard.has-focus-active [data-session-panel="focus"] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: 100%; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-answer { flex: 1 1 auto; min-height: 0; height: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.app-shell.is-session-home .session-dashboard.has-focus-active .session-boundary { flex: 0 0 auto; }
@media (max-width: 820px) {
  .app-shell.is-session-home:has(.has-focus-active) .workspace { height: 100% !important; min-height: 0 !important; overflow: hidden !important; }
}
.app-shell.is-session-home .session-support { width: min(100%, 860px); gap: 8px; margin: 0 auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
.app-shell.is-session-home .session-support-heading { justify-content: flex-end; min-height: 26px; }
.app-shell.is-session-home .session-support-heading strong { margin-right: auto; color: var(--one-ink-faint); font-size: 10px; font-weight: 700; }
.app-shell.is-session-home .session-composer { min-height: 56px; gap: 10px; padding: 8px 10px 8px 18px; border-radius: var(--one-pill); box-shadow: 0 5px 18px rgba(20, 39, 68, .08); }
.app-shell.is-session-home .session-composer textarea { min-height: 36px; padding: 9px 2px; font-size: 15px; }
.app-shell.is-session-home .session-composer button { flex-basis: 38px; width: 38px; height: 38px; border-radius: 50%; }
.app-shell.is-session-home .session-chat-status,
.app-shell.is-session-home .session-support-boundary { text-align: center; font-size: 9px; }
.app-shell.is-session-home .session-quick-questions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.app-shell.is-session-home .session-quick-questions .session-followup-chip { padding: 7px 11px; border-color: var(--one-line); background: #fff; color: var(--one-ink-soft); font-size: 11px; }
.app-shell.is-session-home .session-chat-log { max-height: 150px; padding: 8px 12px; border: 1px solid var(--one-line); border-radius: 16px; background: #fff; }
.app-shell.is-session-home .session-history { gap: 14px; padding-top: 8px; }
.app-shell.is-session-home .session-history-details { border-bottom: 1px solid var(--one-line); padding-bottom: 10px; }
.app-shell.is-session-home .session-history-details > summary,
.app-shell.is-session-home .session-question-area > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; color: var(--one-ink-soft); font-size: 11px; font-weight: 700; }
.app-shell.is-session-home .session-history-details > summary::-webkit-details-marker,
.app-shell.is-session-home .session-question-area > summary::-webkit-details-marker { display: none; }
.app-shell.is-session-home .session-history-details > summary span,
.app-shell.is-session-home .session-question-area > summary span { color: var(--one-ink-faint); font-size: 10px; font-weight: 500; }
.app-shell.is-session-home .session-history-list { gap: 5px; margin-top: 9px; }
.app-shell.is-session-home .session-history-item { padding: 7px 8px; background: transparent; font-size: 10px; }
.app-shell.is-session-home .session-voice-glance { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; }
.app-shell.is-session-home .session-voice-glance > div { gap: 3px; }
.app-shell.is-session-home .session-voice-glance button { white-space: nowrap; }
.app-shell.is-session-home .session-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) .session-question-area { grid-row: 1; }
.app-shell.is-session-home .session-question-area { min-height: 0; overflow: auto; padding: 12px 14px; border: 1px solid var(--one-line); border-radius: var(--one-radius); background: rgba(255,255,255,.75); }
.app-shell.is-session-home .session-prompt-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.app-shell.is-session-home .session-prompt-row { display: block; min-width: 0; }
.app-shell.is-session-home .session-prompt { width: 100%; min-height: 48px; padding: 8px 10px; }
.app-shell.is-session-home .session-prompt-copy strong { font-size: 11px; }
.app-shell.is-session-home .session-prompt-arrow { flex: 0 0 auto; }
.app-shell.is-session-home .session-pulse { padding: 10px 12px; border-radius: var(--one-radius); box-shadow: none; }
.app-shell.is-session-home .session-pulse-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.app-shell.is-session-home .session-pulse-card { padding: 8px 10px; }
.app-shell.is-session-home .session-pulse-card .stage-owner,
.app-shell.is-session-home .session-pulse-card .stage-priority-reason { display: none; }
.app-shell.is-session-home .session-pulse-card p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 10px; line-height: 1.35; }
.app-shell.is-session-home .session-pulse-card h3 { margin: 4px 0; font-size: 12px; }
.app-shell.is-session-home .session-pulse-card .stage-provenance { gap: 4px; }
.app-shell.is-session-home .session-pulse-card .stage-pill { padding: 2px 5px; font-size: 8px; }
.app-shell.is-session-home .session-pulse .session-section-heading { margin-bottom: 7px; }
.app-shell.is-session-home .session-pulse .session-section-heading > small { font-size: 9px; }
.app-shell.is-session-home .session-boundary { font-size: 9px; }

@media (max-width: 820px) {
  .app-shell.is-session-home .session-support { margin: 0 auto; }
  .app-shell.is-session-home .session-layout { gap: 12px; }
  .app-shell.is-session-home .session-main { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
  .app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) { grid-template-rows: auto auto auto; }
  .app-shell.is-session-home .session-main > [data-session-panel="focus"]:not(:empty) { min-height: 180px; }
  .app-shell.is-session-home .session-pulse-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-shell.is-session-home .top-actions .top-pill-btn { padding: 6px 9px; font-size: 10px; }
  .app-shell.is-session-home .session-hero-stage { padding: 0; }
  .app-shell.is-session-home .session-support-heading { justify-content: space-between; }
  .app-shell.is-session-home .session-support-heading strong { margin-right: 0; }
  .app-shell.is-session-home .session-quick-questions { justify-content: flex-start; }
  .app-shell.is-session-home .session-prompt-list { grid-template-columns: 1fr; }
  .app-shell.is-session-home .session-voice-glance { grid-template-columns: 1fr; }
}

/* Quiet operational front door: stable canvas, compact live updates, no scenic
   asset dependency. Motion is reserved for deliberate user-driven transitions. */
.app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 1040px);
  padding: clamp(14px, 2.5vh, 28px) clamp(12px, 2vw, 24px) 18px;
}
.app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-stage::before {
  position: absolute;
  z-index: -1;
  inset: 0 3% 2px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(221, 241, 238, .52), rgba(255, 255, 255, 0) 66%),
    radial-gradient(ellipse at 12% 45%, rgba(231, 239, 250, .30), rgba(255, 255, 255, 0) 50%);
  content: "";
  pointer-events: none;
}
.app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-masthead { margin-bottom: 16px; }
.app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-greeting { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-subtitle { color: #3d4e66; }
.app-shell.is-session-home .session-layout { grid-template-columns: minmax(168px, 205px) minmax(0, 1fr); gap: clamp(16px, 2.2vw, 30px); }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 10px;
  overflow: hidden;
}
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) .session-question-area,
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty)>[data-session-panel="signals"] { overflow: visible; }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) .session-question-area { grid-row: 2; align-self: start; }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty)>[data-session-panel="signals"] { grid-row: 1; align-self: start; }
.app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) .session-boundary { grid-row: 3; }
.app-shell.is-session-home .session-pulse { align-self: start; padding: 12px 14px; background: rgba(255,255,255,.82); }
.app-shell.is-session-home .session-pulse .session-section-heading { margin-bottom: 9px; }
.app-shell.is-session-home .session-pulse .session-section-heading > span { color: #496d70; letter-spacing: .11em; }
.app-shell.is-session-home .session-pulse-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); align-items: stretch; gap: 8px; }
.app-shell.is-session-home .session-pulse-card { min-height: 106px; padding: 10px 11px; border-radius: 13px; background: #fff; }
.app-shell.is-session-home .session-pulse-card h3 { font-size: 13px; }
.app-shell.is-session-home .session-pulse-card p:not(.stage-owner):not(.stage-priority-reason) { font-size: 10px; }
.app-shell.is-session-home .session-pulse .session-read-status { display: block; flex: 0 0 auto; margin: 0; padding: 5px 8px; border: 1px solid #eee4d1; border-radius: 999px; color: #76654a; background: #fffdf8; font-size: 9px; line-height: 1.3; }
.app-shell.is-session-home .session-pulse .session-read-status summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.app-shell.is-session-home .session-pulse .session-read-status summary::-webkit-details-marker { display: none; }
.app-shell.is-session-home .session-pulse .session-read-status summary strong { font-size: 9px; font-weight: 700; }
.app-shell.is-session-home .session-pulse .session-read-status summary span { color: #8b7a5d; }
.app-shell.is-session-home .session-pulse .session-read-status ul { display: grid; gap: 3px; margin: 7px 0 0; padding-left: 18px; }
.app-shell.is-session-home .session-pulse .session-read-status small { display: block; margin-top: 5px; color: #8c7956; font-size: 8px; }
.app-shell.is-session-home .session-pulse-empty { padding: 8px 0 3px; }
.app-shell.is-session-home .session-question-area { background: rgba(255,255,255,.64); }
@media (min-width: 821px) {
  .app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) { overflow: hidden; }
}
@media (max-width: 820px) {
  .app-shell.is-session-home .session-layout { grid-template-columns: minmax(0, 1fr); }
  .app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) { grid-template-rows: auto auto auto; }
  .app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty)>[data-session-panel="signals"] { grid-row: 1; }
  .app-shell.is-session-home .session-main:has(>[data-session-panel="focus"]:empty) .session-question-area { grid-row: 2; }
}
@media (max-width: 640px) {
  .app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-stage { width: 100%; max-width: 100%; padding: 10px 0; box-sizing: border-box; }
  .app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-stage::before { inset: 0 0 2px; }
  .app-shell.is-session-home .session-support { width: 100%; max-width: 100%; box-sizing: border-box; }
  .app-shell.is-session-home .session-practice-areas { width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  .app-shell.is-session-home .session-area-grid { width: 100%; max-width: 100%; box-sizing: border-box; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell.is-session-home .session-dashboard:not(.has-focus-active) .session-hero-stage::before { animation: none; }
}
/* Focused workflows remain a natural reading surface on phones. The desktop
   focused canvas is intentionally viewport-bounded, but mobile users own page
   scroll and must not have to discover nested scroll traps. */
@media (max-width: 520px) {
  .app-shell.is-session-home:has(.has-focus-active) .workspace {
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell.is-session-home:has(.has-focus-active) .surface-grid,
  .app-shell.is-session-home .session-dashboard.has-focus-active,
  .app-shell.is-session-home .session-dashboard.guided-workspace.has-focus-active,
  .app-shell.is-session-home .session-dashboard.has-focus-active .session-layout,
  .app-shell.is-session-home .session-dashboard.has-focus-active .session-main {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    grid-template-rows: none !important;
  }
  .app-shell.is-session-home .session-dashboard.has-focus-active [data-session-panel="focus"],
  .app-shell.is-session-home .session-dashboard.has-focus-active .session-answer {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .app-shell.is-session-home .session-dashboard.has-focus-active .session-flow-canvas {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
