/* nyx-app/public/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0e14;
  --surface: #141820;
  --surface-raised: #191e28;
  --border: #1e2330;
  --border-subtle: #252c3a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #67cdf7;
  --danger: #f87171;
  --tab-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Radius scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

/* ── Global button feedback + focus (merged punch-list 7) ── */
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;   /* UI chrome isn't selectable */
  -webkit-touch-callout: none;                      /* no long-press callout on controls */
}
button:active:not(:disabled) { transform: scale(.97); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Native-feel: no accidental text selection on UI chrome ──
   Chrome = tab bar, headings, labels, chips, badges, buttons.
   Content the user may want to copy (messages, transcripts, briefs,
   email bodies) stays selectable — re-enabled below. */
.tab-bar, .pane-header, .pane-title, .pane-subtitle, .section-heading,
.today-time, .today-channel, .disposition-chip, .importance-badge,
.account-badge, .today-cat-chip, .filter-chip, .context-chip, .mode-btn,
.live-badge, .meeting-brief-title, .meeting-hint, .meeting-row-meta,
.meeting-row-status, .chat-empty-mark, .chat-empty-prompt {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* Copyable content — override the chrome rule */
.chat-bubble, .meeting-transcript, .transcript-pre, .meeting-brief-content,
.meeting-breakdown, .modal-body, .draft-body, .today-summary,
.context-snippet, .detail-meta {
  -webkit-user-select: text; user-select: text;
  -webkit-touch-callout: default;
}

/* ── Reusable state panel (empty / error) ── */
.state-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3);
  max-width: 300px; margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}
.state-panel svg { width: 40px; height: 40px; color: var(--muted); opacity: .85; }
.state-panel .state-title { font-size: 15px; font-weight: 600; color: var(--text); }
.state-panel .state-body  { font-size: 13px; line-height: 1.5; color: var(--muted); }
.state-panel .state-retry-btn {
  margin-top: var(--space-1);
  min-height: 44px; padding: 0 20px;
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  color: var(--accent); font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.state-panel .state-retry-btn:hover { border-color: var(--accent); }

/* ── Skeleton shimmer rows ── */
.skeleton-list { display: flex; flex-direction: column; gap: var(--space-3); }
.skeleton-row {
  height: 64px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden; position: relative;
}
.skeleton-row::after {
  content: ""; position: absolute; inset: 0;
  /* Higher-contrast sweep so the shimmer reads on the dark surface (round-1 flag) */
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,.09) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* ── Content-entry transition (new bubbles / cards / rows) ── */
@keyframes content-enter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.enter-anim { animation: content-enter 160ms ease-out; }

html, body {
  height: 100%;
  overflow: hidden;            /* app frame never moves — panes scroll internally */
  overscroll-behavior: none;   /* no iOS rubber-band on the document */
  /* NYX goddess art as the app theme — fixed so it doesn't scroll with content.
     --bg is the fallback / letterbox color. */
  background: var(--bg) url("/nyx-bg.jpg") center top / cover no-repeat fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
/* Readability scrim over the art — dims it to an ambient glow so text/cards
   stay legible; darker toward the bottom where the tab bar + dense content sit.
   Sits below the app content (z-index 0); .app is lifted to z-index 1. */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: linear-gradient(to bottom, rgba(11,14,20,.58), rgba(11,14,20,.84));
  z-index: 0; pointer-events: none;
}

/* ── Login overlay ── */
.login-overlay {
  position: fixed; inset: 0;
  /* transparent so the goddess art (body bg + scrim) shows on the login screen */
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-overlay[hidden] { display: none; }

.login-card {
  width: min(340px, 90vw);
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  /* More solid surface for legible dark-mode contrast (round-1 flag) */
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}

.login-title {
  font-size: 32px; font-weight: 700; letter-spacing: 5px;
  text-align: center; color: var(--accent);
}
.login-sub {
  text-align: center; color: var(--muted); font-size: 13px;
}
.login-input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text); font-size: 16px; /* >=16px: no iOS focus zoom */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.login-btn {
  width: 100%; height: 48px;
  background: var(--accent); color: #0b0e14;
  font-weight: 700; font-size: 15px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity .15s;
}
.login-btn:hover { opacity: .85; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-error {
  text-align: center; color: var(--danger); font-size: 13px; min-height: 18px;
}

/* ── Polish 9/28: app logo, PIN pad, per-app backgrounds ── */
.login-logo { width: 96px; height: 96px; border-radius: 22px; align-self: center; box-shadow: 0 8px 22px rgba(0,0,0,.45); object-fit: cover; }
.pin-pad { display: none; }
body[data-login="pin"] #login-form { display: none; }
body[data-login="pin"] .pin-pad { display: flex; flex-direction: column; align-items: center; gap: 22px; }
body[data-login="pin"] .login-card { background: transparent; border: none; box-shadow: none; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); display: block; transition: background .1s; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.shake { animation: pin-shake .35s; }
@keyframes pin-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.pin-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.pin-key { width: 72px; height: 72px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; font-weight: 400; cursor: pointer; }
.pin-key:active:not(:disabled) { background: rgba(255,255,255,.32); transform: none; }
.pin-key--back { background: none; font-size: 24px; }
body[data-user]:not([data-user="tyler"]) { background: linear-gradient(180deg, var(--theme, #141820), var(--bg)) fixed; }
body[data-user]:not([data-user="tyler"])::before { background: linear-gradient(to bottom, rgba(0,0,0,.10), rgba(0,0,0,.45)); }
.chat-empty-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 22px rgba(0,0,0,.4); object-fit: cover; }

/* ── App shell ── */
.app {
  height: 100vh;   /* fallback for browsers without dvh */
  height: 100dvh;  /* tracks iOS dynamic toolbars + keyboard (with resizes-content) */
  display: flex; flex-direction: column;
  position: relative;
  z-index: 1;      /* above the body::before art scrim */
}
.app[hidden] { display: none; }

/* ── Status-bar safe-area fill (installed PWA) ──
   With apple-mobile-web-app-status-bar-style=black-translucent the iOS
   status bar (clock/battery/notch) overlays the top of the app. Paint a
   fixed opaque fill across env(safe-area-inset-top) so content scrolling
   underneath never renders behind the clock and the status bar stays
   legible. Fades to transparent at the bottom edge for a native blend.
   Spans all 4 panes (they share .app) AND the login overlay. */
.app::before,
.login-overlay::before {
  content: "";
  position: fixed; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  z-index: 50;
  pointer-events: none;
}
/* Only needed when the status bar actually overlays (installed) — but the
   0px inset makes it a no-op in-browser, so it's safe to always apply. */

.pane-container {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 16px;
}

.pane { display: block; flex-shrink: 0; }
.pane[hidden] { display: none !important; }

/* ── Bottom tab bar (static flex child — never drifts from the frame) ── */
.tab-bar {
  flex-shrink: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
}

.tab-btn {
  position: relative;
  flex: 1; background: none; border: none;
  color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 0 8px;
  transition: color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
.tab-btn.active, .tab-btn[aria-selected="true"] {
  color: var(--accent);
  background: rgba(56,189,248,.06);
}
/* Inset top indicator — does NOT shift content (punch-list 9) */
.tab-btn.active::after, .tab-btn[aria-selected="true"]::after {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-btn:active { transform: none; }   /* labels don't need scale; keeps bar steady */
/* Any icon inside a tab visually centered + sized (round-1 flag) */
.tab-btn svg { width: 22px; height: 22px; display: block; }

/* Push notifications bell (v2) — small non-tab toggle at the end of the bar */
.push-bell-btn {
  flex: 0 0 auto; background: none; border: none;
  color: var(--muted); font-size: 15px; cursor: pointer;
  padding: 0 12px; opacity: .55;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, opacity .15s;
}
.push-bell-btn[aria-pressed="true"] { color: var(--accent); opacity: 1; }
.push-bell-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ══════════════════════════════════════════════
   Meeting pane (Task 5)
   ══════════════════════════════════════════════ */

.meeting-pane {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; padding-top: 16px;
}

/* Error banner */
.meeting-error {
  width: 100%; padding: 10px 14px;
  background: rgba(248,113,113,.12);
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: var(--danger); font-size: 13px; text-align: center;
}
.meeting-error[hidden] { display: none; }

/* Idle */
.meeting-idle {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 100%;
}

.meeting-label-input {
  width: 100%; max-width: 320px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 16px; /* >=16px: no iOS focus zoom */
  outline: none; text-align: center;
}
.meeting-label-input:focus { border-color: var(--accent); }
.meeting-label-input::placeholder { color: var(--muted); }

/* Big mic / stop button */
.mic-btn {
  width: 96px; height: 96px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent);
  color: #0b0e14;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .1s;
  flex-shrink: 0;
}
.mic-btn:hover  { opacity: .85; }
.mic-btn:active { transform: scale(.94); }
.mic-btn:disabled { opacity: .45; cursor: not-allowed; }

.mic-btn--stop {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(248,113,113,.14);
}

.mic-icon, .stop-icon { width: 40px; height: 40px; }

/* Recording */
.meeting-recording {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}

.meeting-status-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 8px 2px 7px; border-radius: 4px;
}
/* Small pulsing dot instead of whole-badge opacity flash (punch-list 16) */
.live-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .3; transform: scale(.75); }
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

.meeting-elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 24px; line-height: 1; font-weight: 600; color: var(--accent);
  min-width: 56px; text-align: center;
}

.meeting-chunk-label {
  color: var(--muted); font-size: 12px;
}

.meeting-hint {
  color: var(--muted); font-size: 13px; margin-top: 4px;
}

/* Live transcript panel */
.meeting-transcript {
  width: 100%;
  max-height: 280px; min-height: 80px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* momentum scroll */
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px; line-height: 1.6;
}

.transcript-empty {
  color: var(--muted); font-style: italic;
}

.transcript-pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 13px; line-height: 1.6;
}

/* Live brief card (M1) — style consistent with meeting-transcript */
.meeting-brief {
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* momentum scroll inside the card */
  overscroll-behavior: contain;        /* no rubber-band leak to the pane */
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px; line-height: 1.6;
  margin-top: 12px;
}
.meeting-brief[hidden] { display: none; }

.meeting-brief-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.meeting-brief-content { font-size: 14px; line-height: 1.5; }
.meeting-brief-content h1,
.meeting-brief-content h2 { font-size: 15px; font-weight: 600; margin: 8px 0 4px; color: var(--text); }
.meeting-brief-content h3 { font-size: 13px; font-weight: 600; margin: 6px 0 3px; color: var(--muted); }
.meeting-brief-content p  { margin-bottom: 4px; }
.meeting-brief-content li { margin-left: 16px; list-style: disc; margin-bottom: 3px; }
.meeting-brief-content strong { color: var(--text); font-weight: 600; }

/* Stopped / finalizing */
.meeting-stopped {
  display: flex; flex-direction: column; gap: 16px;
  width: 100%;
}

.meeting-finalizing-msg {
  text-align: center; color: var(--muted); font-size: 14px;
}
.meeting-finalizing-msg[hidden] { display: none; }

/* Breakdown (rendered markdown) */
.meeting-breakdown {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px; line-height: 1.7;
}
.meeting-breakdown[hidden] { display: none; }

.meeting-breakdown h1 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.meeting-breakdown h2 { font-size: 16px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
.meeting-breakdown h3 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; color: var(--muted); }
.meeting-breakdown p  { margin-bottom: 6px; }
.meeting-breakdown li { margin-left: 18px; list-style: disc; margin-bottom: 4px; }
.meeting-breakdown strong { color: var(--text); font-weight: 600; }

/* ══════════════════════════════════════════════
   Shared pane header (Task 6)
   ══════════════════════════════════════════════ */

.pane-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.pane-title {
  font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--text);
}

.pane-refresh-btn {
  background: none; border: 1px solid var(--border-subtle);
  color: var(--muted);
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.pane-refresh-btn svg { width: 18px; height: 18px; }
.pane-refresh-btn:hover { color: var(--accent); border-color: var(--accent); }
.pane-refresh-btn:disabled { opacity: .45; cursor: not-allowed; }
.pane-refresh-btn.spinning svg { animation: refresh-spin .8s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

.empty-state {
  color: var(--muted); font-size: 14px;
  text-align: center; padding: 32px 0;
}

.section-heading {
  font-size: 13px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
  margin: 20px 0 10px;
}

/* ══════════════════════════════════════════════
   Inbox pane (Task 6)
   ══════════════════════════════════════════════ */

.inbox-list {
  display: flex; flex-direction: column; gap: 12px;
}

.draft-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.draft-meta {
  display: flex; flex-direction: column; gap: 2px;
}

.draft-to {
  font-size: 13px; color: var(--muted);
}
.draft-to strong { color: var(--text); }

.draft-subject {
  font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.draft-body {
  font-size: 13px; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 180px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; line-height: 1.6;
}

.draft-actions {
  display: flex; gap: 8px;
}

.draft-send-btn {
  flex: 1; min-height: 44px; padding: 0 12px;
  background: var(--accent); color: #0b0e14;
  font-weight: 700; font-size: 14px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity .15s;
}
.draft-send-btn:hover { opacity: .85; }
.draft-send-btn:disabled { opacity: .45; cursor: not-allowed; }

.draft-skip-btn {
  min-height: 44px; padding: 0 16px;
  background: none; border: 1px solid var(--border-subtle);
  color: var(--muted); font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.draft-skip-btn:hover { color: var(--text); border-color: var(--muted); }
.draft-skip-btn:disabled { opacity: .45; cursor: not-allowed; }

.draft-error {
  font-size: 12px; color: var(--danger);
  padding: 6px 10px;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: 6px;
}

/* Original email context shown above the NYX draft (Inbox UX 2026-07-13) */
.draft-orig {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--muted);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.draft-orig-label {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.draft-orig-label strong { color: var(--text); text-transform: none; letter-spacing: 0; }
.draft-orig-summary {
  font-size: 13px; color: var(--text); line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.orig-cat-chip {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border-subtle); color: var(--muted);
}
.draft-reply-label {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   Today "Open reminders" strip (pester UX 2026-07-13)
   ══════════════════════════════════════════════ */

.today-reminders {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}
.reminders-heading {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.reminder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}
.reminder-row:first-of-type { border-top: none; }
.reminder-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.reminder-subject {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reminder-meta { font-size: 12px; color: var(--muted); }
.reminder-actions { display: flex; gap: 6px; flex-shrink: 0; }
.reminder-dismiss-btn, .reminder-snooze-btn {
  min-height: 36px; padding: 0 12px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity .15s, color .15s, border-color .15s;
}
.reminder-dismiss-btn {
  background: var(--accent); color: #0b0e14; border: none;
}
.reminder-dismiss-btn:hover { opacity: .85; }
.reminder-snooze-btn {
  background: none; border: 1px solid var(--border-subtle); color: var(--muted);
}
.reminder-snooze-btn:hover { color: var(--text); border-color: var(--muted); }
.reminder-dismiss-btn:disabled, .reminder-snooze-btn:disabled {
  opacity: .45; cursor: not-allowed;
}

/* ══════════════════════════════════════════════
   Send confirm modal (Task 6)
   ══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11,14,20,.82);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: var(--safe-bottom);
  animation: overlay-fade 180ms ease-out;
}
.modal-overlay[hidden] { display: none; }
@keyframes overlay-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: min(480px, 100vw);
  max-height: min(88dvh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 18px calc(24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 12px;
  /* Native bottom-sheet spring: rises further with a soft ease-out (round-1) */
  animation: sheet-rise 260ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
@keyframes sheet-rise {
  from { transform: translateY(40px); opacity: .6; }
  to   { transform: translateY(0); opacity: 1; }
}
/* Drag handle (punch-list 14) — a touch wider + brighter so it reads as grabbable */
.modal-card::before {
  content: ""; align-self: center;
  width: 40px; height: 5px; border-radius: 3px;
  background: var(--muted); opacity: .5;
  margin-bottom: 8px;
}

.modal-to-label {
  font-size: 13px; color: var(--muted);
}
.modal-to-label strong { color: var(--text); }

.modal-subject {
  font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.modal-body {
  font-size: 13px; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 220px; overflow-y: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  font-family: inherit; line-height: 1.6;
}

.modal-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 4px;
}

.modal-send-btn {
  width: 100%; min-height: 48px; padding: 0 12px;
  background: var(--accent); color: #0b0e14;
  font-weight: 700; font-size: 15px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity .15s;
}
.modal-send-btn:hover { opacity: .85; }
.modal-send-btn:disabled { opacity: .45; cursor: not-allowed; }

.modal-cancel-btn {
  width: 100%; min-height: 44px; padding: 0 12px;
  background: none; border: 1px solid var(--border-subtle);
  color: var(--muted); font-size: 15px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: color .15s;
}
.modal-cancel-btn:hover { color: var(--text); }

/* ══════════════════════════════════════════════
   Toast (Task 6)
   ══════════════════════════════════════════════ */

.toast {
  position: fixed; bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  background: #1e2330; border: 1px solid var(--border);
  color: var(--text); font-size: 13px;
  padding: 10px 18px; border-radius: 8px;
  z-index: 300;
  max-width: calc(100vw - 24px);
  white-space: normal; text-align: center;
  pointer-events: none;
  animation: toast-in .2s ease;
}
.toast[hidden] { display: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ══════════════════════════════════════════════
   Today pane (Task 6)
   ══════════════════════════════════════════════ */

.today-feed {
  display: flex; flex-direction: column; gap: 2px;
}

.today-row {
  display: grid;
  grid-template-columns: 42px 56px 1fr auto;
  align-items: start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* Trailing badge cluster (account + importance + disposition) share the
   final `auto` column. On a 390px screen three inline chips can crowd the
   1fr body — keep them on one line, right-aligned, no wrap breakage.
   The grid children after .today-body are the trailing chips; contain them. */
.today-row > .account-badge,
.today-row > .importance-badge,
.today-row > .disposition-chip { align-self: start; }
.today-row:last-child { border-bottom: none; }

.today-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  padding-top: 2px;
  white-space: nowrap;
}

.today-channel {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-body {
  display: flex; flex-direction: column; gap: 2px;
}

.today-party {
  font-weight: 600; color: var(--text); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.today-summary {
  color: var(--muted); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

.disposition-chip {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
  margin-top: 2px;
  align-self: start;
}

/* ── Today filter chips (v1.4 wave 4) ── */
.today-filters {
  display: flex; gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 10px;
}
.today-filters::-webkit-scrollbar { display: none; }
.today-filters:empty { display: none; }

.filter-chip {
  flex: 0 0 auto;
  min-height: 44px;               /* mobile tap target */
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56,189,248,.08);
}

/* ── Screener category filters + badges (v1.4 wave 5) ── */
.today-screen-filters { padding-top: 0; }
.today-screen-filters:empty { display: none; }
.filter-chip--screen { font-size: 12px; min-height: 40px; }

/* Importance badge on each email row (high = accent, med = neutral, low = dim) */
.importance-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
  align-self: start;
  margin-top: 2px;
}
.importance-badge--high {
  color: #0b0e14; background: var(--accent); border: 1px solid var(--accent);
}
.importance-badge--medium {
  color: var(--muted); border: 1px solid var(--border); background: transparent;
}
.importance-badge--low {
  color: var(--muted); border: 1px solid transparent; background: transparent;
  opacity: .55;
}

/* Category chip under the summary */
.today-cat-chip {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 7px; border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-top: 3px;
}
.today-cat-chip--cadiz_ops  { color: #34d399; border-color: #34d39955; }
.today-cat-chip--commercial { color: #fbbf24; border-color: #fbbf2455; }
.today-cat-chip--team       { color: #60a5fa; border-color: #60a5fa55; }
.today-cat-chip--personal   { color: #f472b6; border-color: #f472b655; }
.today-cat-chip--atlas_system,
.today-cat-chip--junk       { color: var(--muted); opacity: .7; }

/* ── Source account badge (multi-mailbox, 2026-07-12) ──
   One-letter badge (T/K/G) so Tyler always knows which inbox an email is from,
   and — on a draft card — which inbox the reply sends FROM. Distinct colors.
   Reuses the importance-badge sizing pattern. */
.account-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  border-radius: 4px; border: 1px solid transparent;
  align-self: start; margin-top: 2px;
  vertical-align: middle;
}
.account-badge--timironmp { color: #0b0e14; background: #60a5fa; border-color: #60a5fa; } /* T = blue  */
.account-badge--kolassus  { color: #0b0e14; background: #a78bfa; border-color: #a78bfa; } /* K = purple*/
.account-badge--gmail     { color: #0b0e14; background: #f87171; border-color: #f87171; } /* G = red   */
.account-badge--nyx       { color: #0b0e14; background: #34d399; border-color: #34d399; } /* N = green */

/* Collapse bar for buried system/junk rows */
.today-collapse-bar {
  display: block; width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 0 6px;
  background: transparent;
  border: none;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.today-collapse-bar:hover { color: var(--text); }
.today-collapse-bar[aria-expanded="true"] { color: var(--accent); }

/* Dimmed buried rows when expanded */
.today-row--dim { opacity: .5; }
.today-row--dim:hover { opacity: .8; }

/* ── Tappable feed rows (punch-list 5) ── */
.today-row--tappable {
  cursor: pointer;
  margin-inline: -8px;
  padding: 12px 8px;
  border-radius: 8px;
  transition: background .15s, transform .1s;
}
.today-row--tappable:hover,
.today-row--tappable:focus-visible { background: rgba(255,255,255,.035); }
.today-row--tappable:active { transform: scale(.99); }
.today-row--tappable:hover .today-party,
.today-row--tappable:focus-visible .today-party { color: var(--accent); }

/* ── Detail sheet (reuses modal-overlay / modal-card) ── */
.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.detail-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.detail-rec { display: flex; flex-direction: column; gap: 6px; }
.detail-rec-label {
  color: var(--accent); font-size: 12px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
}

.detail-meta { display: flex; flex-direction: column; gap: 4px; }
.detail-meta-line {
  font-size: 12px; color: var(--text);
  display: flex; gap: 8px;
}
.detail-meta-line span {
  color: var(--muted); min-width: 96px; flex: 0 0 auto;
}

/* ══════════════════════════════════════════════
   Chat pane (Task 9)
   ══════════════════════════════════════════════ */

:root {
  --chat-input-h: 56px;
}

/* On chat tab, the messages list is the scroller — lock the container */
.chat-active .pane-container {
  overflow: hidden;
}

#pane-chat {
  flex: 1; min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  flex: 1; min-height: 0;
}

/* Message list — the only scroller on the chat tab */
.chat-messages {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

/* Bubble base */
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere; word-break: break-word;
  animation: content-enter 160ms ease-out;
}

/* User bubble — right, accent */
.chat-bubble--user {
  align-self: flex-end;
  background: var(--accent);
  color: #0b0e14;
  border-bottom-right-radius: 4px;
}

/* NYX bubble — left, dark surface */
.chat-bubble--nyx {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Typing indicator bubble */
.chat-bubble--typing {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-bottom-left-radius: 4px;
  font-style: italic;
  font-size: 13px;
}

/* Error bubble */
.chat-bubble--error {
  align-self: flex-start;
  background: rgba(248,113,113,.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-bottom-left-radius: 4px;
  font-size: 13px;
}

.chat-bubble--error .chat-retry-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 6px;
  min-height: 44px; padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  background: none;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity .15s;
}
.chat-bubble--error .chat-retry-btn:hover { opacity: .75; }

/* Markdown rendered inside NYX bubble */
.chat-bubble--nyx h1 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.chat-bubble--nyx h2 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.chat-bubble--nyx h3 { font-size: 13px; font-weight: 600; margin: 8px 0 3px; color: var(--muted); }
.chat-bubble--nyx p  { margin-bottom: 4px; }
.chat-bubble--nyx li { margin-left: 16px; list-style: disc; margin-bottom: 3px; }
.chat-bubble--nyx br { display: block; content: ""; margin: 2px 0; }

/* ── Chat input bar (static flex child between content and tab bar) ── */
/* ── Model-picker chip row ── */
.chat-model-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 4px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-model-bar::-webkit-scrollbar { display: none; }
.chat-model-bar[hidden] { display: none; }

.model-chip {
  flex-shrink: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.model-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.model-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0e14;
}

.chat-input-bar {
  flex-shrink: 0;
  height: var(--chat-input-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  z-index: 9;
  position: relative; /* anchor for the conversation-mode pill */
}
.chat-input-bar[hidden] { display: none; }

.chat-text-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 16px; /* >=16px: no iOS focus zoom */
  padding: 8px 14px;
  outline: none;
  min-width: 0;
}
.chat-text-input:focus { border-color: var(--accent); }
.chat-text-input::placeholder { color: var(--muted); }

.chat-send-btn,
.chat-mic-btn {
  flex-shrink: 0;
  width: 44px; height: 44px; /* min tap target */
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .08s;
}

.chat-send-btn {
  background: var(--accent);
  color: #0b0e14;
}
.chat-send-btn:hover  { opacity: .85; }
.chat-send-btn:disabled { opacity: .4; cursor: not-allowed; }

.chat-mic-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chat-mic-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-mic-btn.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: pulse-badge 1s ease-in-out infinite;
}

.chat-speaker-btn {
  flex-shrink: 0;
  width: 44px; height: 44px; /* min tap target */
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.chat-speaker-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-speaker-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56,189,248,.1);
}

/* ── Conversation mode (hands-free voice) ── */
.chat-convo-btn {
  flex-shrink: 0;
  width: 44px; height: 44px; /* min tap target */
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.chat-convo-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-convo-btn.convo-active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56,189,248,.12);
  animation: convo-pulse 1.6s ease-in-out infinite;
}
@keyframes convo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,.55); }
  50%      { box-shadow: 0 0 0 8px rgba(56,189,248,0); }
}

.convo-pill {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 30;
  pointer-events: none;
}
.convo-pill[hidden] { display: none; }

/* ── Meetings archive in Today pane ── */

.today-meetings {
  display: flex; flex-direction: column; gap: 2px;
}

.meeting-row {
  display: flex; align-items: center; gap: 10px;
  margin-inline: -8px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.meeting-row:last-child { border-bottom: none; }
.meeting-row:hover, .meeting-row:focus-visible { background: rgba(255,255,255,.035); }
.meeting-row:active { transform: scale(.99); }
.meeting-row:hover .meeting-row-label { color: var(--accent); }

.meeting-row-label {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .15s;
}

.meeting-row-meta {
  font-size: 12px; color: var(--muted); white-space: nowrap;
}

.meeting-row-status {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}

.pane-subtitle { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 2px 0 10px; }

.chat-cam-btn {
  background: none; border: none; font-size: 1.3rem; cursor: pointer;
  flex-shrink: 0;
  min-width: 44px; min-height: 44px; /* min tap target */
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

/* ── Meeting Context chips (M2 research sidebar) ── */
.meeting-research {
  width: 100%;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
}
.meeting-research[hidden] { display: none; }

.context-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-entity { display: flex; flex-direction: column; }

.context-chip {
  align-self: flex-start;
  min-height: 44px;               /* mobile tap target */
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.context-chip:hover { color: var(--text); }
.context-chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56,189,248,.08);
}

.context-detail {
  margin: 6px 0 2px 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.context-detail[hidden] { display: none; }

.context-item {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; line-height: 1.45; color: var(--text);
}
.context-source {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  border: 1px solid currentColor;
  color: var(--muted);
  white-space: nowrap;
}
.context-snippet { overflow-wrap: anywhere; }

/* ── Artifact mode selector + Email-me button (M3) ─────────────── */
.meeting-mode {
  display: flex; gap: 0;
  width: 100%; max-width: 320px;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.mode-btn {
  flex: 1;
  min-height: 44px; padding: 0 4px;
  font-size: 13px;
  background: transparent; color: var(--muted);
  border: none; border-right: 1px solid var(--border);
  cursor: pointer;
}
.mode-btn:last-child { border-right: none; }
.mode-btn.active {
  background: var(--accent); color: #0b0e14; font-weight: 600;
}
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.artifact-email-btn {
  display: block; width: 100%;
  min-height: 44px; margin-top: 10px; padding: 0 12px;
  font-size: 14px; font-weight: 600;
  background: var(--accent); color: #0b0e14;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
}
.artifact-email-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════
   Chat empty state (punch-list 10)
   ══════════════════════════════════════════════ */
.chat-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4);
  text-align: center;
  padding: 40px 24px;
  animation: content-enter 200ms ease-out;
}
.chat-empty-mark {
  font-size: 34px; font-weight: 700; letter-spacing: 5px;
  color: var(--accent);
}
.chat-empty-prompt {
  font-size: 16px; font-weight: 600; color: var(--text);
}
.chat-empty-chips {
  display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center;
  max-width: 320px;
}
.chat-empty-chip {
  min-height: 44px; padding: 0 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.chat-empty-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════════
   Standalone (installed PWA) — native-only spacing
   ══════════════════════════════════════════════ */
/* Slightly more top breathing room below the status bar when installed,
   and a firmer tab-bar top border so it reads as a native tab bar.
   In-browser (no body.standalone) nothing changes. */
body.standalone .pane-container {
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
}
body.standalone .tab-bar {
  border-top-color: var(--border-subtle);
}

/* ══════════════════════════════════════════════
   Reduced motion — kill all shimmer/pulse/transform/transition
   ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  button:active:not(:disabled),
  .today-row--tappable:active,
  .meeting-row:active,
  .mic-btn:active { transform: none !important; }
}

/* ── Home landing pane ─────────────────────────────────────────── */
.home-generated-line {
  padding: 0 16px 4px;
  font-size: 12px;
  color: var(--muted);
}
.home-degraded,
.home-block { margin: 0 16px; }
.home-degraded {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  background: rgba(248, 113, 113, 0.08);
}
.home-action-pending:empty { display: none; }
.home-action-pending { margin: 0 16px 12px; }
.home-block { margin-bottom: 20px; }

.home-agenda-group,
.home-life-group { margin-bottom: 12px; }
.home-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 8px 0 6px;
}

.home-agenda-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
}
.home-agenda-time {
  flex: 0 0 auto;
  min-width: 92px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}
.home-agenda-body { display: flex; flex-direction: column; min-width: 0; }
.home-agenda-title { color: var(--text); font-size: 14px; }
.home-agenda-loc { color: var(--muted); font-size: 12px; }

.home-source-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #04121c;
  background: var(--accent);
}
.home-source-badge--gmail { background: #ea4335; color: #fff; }
.home-source-badge--both  { background: #a855f7; color: #fff; }

.home-life-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
}
.home-life-body { display: flex; flex-direction: column; min-width: 0; }
.home-life-party { color: var(--text); font-size: 14px; font-weight: 600; }
.home-life-summary { color: var(--muted); font-size: 13px; }
.home-life-chips { display: flex; gap: 6px; flex: 0 0 auto; }
.home-chip {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.home-chip--cat { background: var(--surface-raised); color: var(--muted); }
.home-chip--imp-high   { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.home-chip--imp-medium { background: var(--surface-raised); color: var(--muted); }
.home-chip--imp-low    { background: var(--surface-raised); color: var(--muted); }

.home-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
  cursor: pointer;
}
.home-summary-line:active { background: var(--surface-raised); }
.home-summary-text { color: var(--text); font-size: 14px; font-weight: 600; }
.home-summary-arrow { color: var(--muted); font-size: 16px; flex: 0 0 auto; }

.home-quickbrief { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 16px; }
.home-brief-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.home-brief-btn:active { transform: scale(0.98); }
.home-empty { color: var(--muted); font-size: 13px; padding: 6px 10px; }

/* ── Bridge pane — Tyler->Claude handoff queue ─────────────────── */
.bridge-composer { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 10px; }
.bridge-input {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px;
}
.bridge-input:focus { outline: none; border-color: var(--accent); }
.bridge-add-btn {
  align-self: flex-end; background: var(--accent); color: #04121c;
  border: none; border-radius: 10px; padding: 9px 16px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.bridge-add-btn:hover { background: var(--accent-hover); }
.bridge-add-btn:disabled { opacity: .5; cursor: not-allowed; }
.bridge-composer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.bridge-attach-btn {
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.bridge-attach-btn:hover { border-color: var(--accent); }
.bridge-attach-btn:disabled { opacity: .5; cursor: not-allowed; }
.bridge-item-thumb {
  max-width: 100%; max-height: 220px; border-radius: 8px;
  display: block; cursor: pointer; background: var(--surface-raised);
}
.bridge-item-vbadge { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.bridge-error { color: var(--danger); font-size: 13px; padding: 0 12px 8px; }
.bridge-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 16px; }
.bridge-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.bridge-item-icon { font-size: 18px; line-height: 1.4; flex: none; }
.bridge-item-body { flex: 1; min-width: 0; }
.bridge-item-content { word-break: break-word; }
.bridge-item-content a { color: var(--accent); text-decoration: none; }
.bridge-item-content a:hover { text-decoration: underline; }
.bridge-item-note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bridge-item-del {
  flex: none; background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.bridge-item-del:hover { color: var(--danger); background: var(--surface-raised); }

/* ── Money pane (C-MONARCH) ──────────────────────────────────────────────── */
.money-body { padding: 0 16px 24px; }
.money-hero { display: flex; gap: 12px; margin: 4px 0 20px; }
.money-tile {
  flex: 1; padding: 14px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
}
.money-tile-value { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; }
.money-tile-label { margin-top: 2px; font-size: 0.78rem; opacity: 0.65; }
.money-section { margin-bottom: 22px; }
.money-section-title {
  margin: 0 0 8px; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55;
}
.money-row {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.money-row-label { font-size: 0.95rem; }
.money-row-value { font-variant-numeric: tabular-nums; font-weight: 550; }
.money-row-sub { grid-column: 1 / -1; font-size: 0.75rem; opacity: 0.5; }
.money-cat { padding: 8px 0; }
.money-cat-top { display: flex; justify-content: space-between; font-size: 0.9rem; }
.money-cat-value { font-variant-numeric: tabular-nums; opacity: 0.85; }
.money-cat-bar {
  margin-top: 6px; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.money-cat-fill { height: 100%; border-radius: 3px; background: currentColor; opacity: 0.55; }
.money-day {
  margin: 14px 0 4px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.45;
}
.money-stale { color: #f0b429; }

/* ── Budget pane bills (C-MONARCH) ───────────────────────────────────────── */
.bill-row { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.bill-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bill-name { font-size: 0.95rem; }
.bill-meta { margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.75rem; }
.bill-due { opacity: 0.6; }
.bill-note { opacity: 0.55; font-style: italic; }
.bill-row.soon .bill-due { color: #f0b429; opacity: 0.95; }
.bill-row.late .bill-due { color: #e5484d; opacity: 1; font-weight: 600; }
.bill-section-hint { margin: 0 0 8px; font-size: 0.78rem; opacity: 0.55; }
.money-cat-fill.over { background: #e5484d; opacity: 0.8; }

/* ── Safe to spend banner (C-MONARCH) ────────────────────────────────────── */
.sts { margin: 4px 0 18px; padding: 16px; border-radius: 16px; border: 1px solid; }
.sts-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.8; }
.sts-amount { font-size: 2.1rem; font-weight: 680; letter-spacing: -0.03em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.sts-sub { font-size: 0.8rem; opacity: 0.75; line-height: 1.35; }
.sts-ok { background: rgba(48,164,108,0.12); border-color: rgba(48,164,108,0.35); }
.sts-ok .sts-amount { color: #30a46c; }
.sts-tight { background: rgba(240,180,41,0.12); border-color: rgba(240,180,41,0.4); }
.sts-tight .sts-amount { color: #f0b429; }
.sts-overdraft { background: rgba(229,72,77,0.14); border-color: rgba(229,72,77,0.45); }
.sts-overdraft .sts-amount { color: #e5484d; }
.sts-collision { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: rgba(0,0,0,0.18); font-size: 0.76rem; line-height: 1.35; }
.sts-details { margin-top: 10px; font-size: 0.78rem; }
.sts-details summary { cursor: pointer; opacity: 0.75; }
.sts-row { padding: 4px 0; opacity: 0.8; font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(255,255,255,0.05); }
.shutoff-box { margin-bottom: 18px; }
.shutoff-row { margin-top: 7px; padding: 7px 9px; border-radius: 8px; background: rgba(0,0,0,0.2); font-size: 0.82rem; line-height: 1.3; }
.shutoff-row.critical { font-weight: 600; }

/* C261: honest brain label on every assistant bubble */
.brain-tag { display:inline-block; font-size:10px; letter-spacing:.08em; font-weight:700; opacity:.55; margin-bottom:4px; }
/* LIVE (GPT realtime voice front) */
.live-chip { margin-left: auto; font-weight: 800; letter-spacing: .04em; }
.live-chip.convo-active { color: #0b0e14; background: var(--accent); border-color: var(--accent); }
.model-chip[hidden] { display: none !important; }

/* One Talk button (9/28): tap = conversation, hold = one message */
.chat-talk-btn {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0b0e14;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  transition: transform .08s, background .15s;
}
.chat-talk-btn:active { transform: scale(.94); }
.chat-talk-btn.convo-active { animation: convo-pulse 1.6s ease-in-out infinite; }
.chat-talk-btn.recording {
  background: var(--danger);
  color: #fff;
  animation: pulse-badge 1s ease-in-out infinite;
}
.live-pill { border-color: var(--accent); }

/* LEGGIT (user=rob): hidden tab buttons must not render even if a rule sets display */
.tab-btn[hidden] { display: none !important; }

/* ── Grades (9/28) ── */
.grades-summary { margin: 0 var(--space-4) var(--space-3); color: var(--muted); font-size: 14px; }
.grades-list { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--space-4) var(--space-6); }
.grade-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.grade-main { flex: 1; min-width: 0; }
.grade-course { font-weight: 700; font-size: 16px; }
.grade-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.grade-note { color: #f2c14e; font-size: 12px; margin-top: 4px; }
.grade-pill { flex-shrink: 0; min-width: 76px; text-align: center; padding: 8px 10px; border-radius: 12px; font-weight: 800; font-size: 16px; }
.grade-a { background: #1f7a45; color: #fff; }
.grade-b { background: #2b6cb0; color: #fff; }
.grade-c { background: #b7791f; color: #fff; }
.grade-low { background: #b3261e; color: #fff; }
.grade-none { background: rgba(255,255,255,.12); color: var(--muted); }
.grades-empty { color: var(--muted); text-align: center; padding: 40px 16px; }

/* ── Sub-tabs for Mail / Money / More (9/28) ── */
.subnav { display: flex; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 8px) var(--space-4) 6px; position: relative; z-index: 2; }
.subnav[hidden] { display: none; }
.subnav-btn { flex: 1; height: 34px; border-radius: 17px; border: 1px solid var(--border-subtle); background: rgba(255,255,255,.06); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.subnav-btn.active { background: var(--accent); border-color: var(--accent); color: #0b0e14; }

/* ── Family (9/28) ── */
.family-kids { display: flex; gap: 8px; padding: 0 var(--space-4) var(--space-3); }
.family-kid { flex: 1; height: 36px; border-radius: 18px; border: 1px solid var(--border-subtle); background: rgba(255,255,255,.06); color: var(--text); font-weight: 700; cursor: pointer; }
.family-kid.active { background: var(--accent); color: #0b0e14; border-color: var(--accent); }
.family-overview { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--space-4) var(--space-4); }
.fam-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: var(--text); text-align: left; cursor: pointer; }
.fam-card.active { border-color: var(--accent); }
.fam-name { font-weight: 800; min-width: 64px; }
.fam-sum { flex: 1; color: var(--muted); font-size: 13px; }
.fam-flag { font-size: 12px; font-weight: 700; color: #fff; background: #b7791f; padding: 3px 8px; border-radius: 10px; }
.fam-ok { font-size: 12px; font-weight: 700; color: #fff; background: #1f7a45; padding: 3px 8px; border-radius: 10px; }
/* When the switcher is showing it owns the notch padding, so the screen below doesn't double it. */
.subnav:not([hidden]) + .pane-container,
body.standalone .subnav:not([hidden]) + .pane-container { padding-top: 8px; }
body.standalone .subnav { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ── School tab: Grades / Assignments / Teachers (9/28) ── */
.school-seg { display: flex; gap: 6px; padding: 0 var(--space-4) var(--space-3); }
.school-seg-btn { flex: 1; height: 34px; border-radius: 17px; border: 1px solid var(--border-subtle); background: rgba(255,255,255,.06); color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.school-seg-btn.active { background: var(--accent); border-color: var(--accent); color: #0b0e14; }
.school-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 8px 2px 2px; }
.msg-card { padding: 12px 14px; border-radius: var(--radius-md); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.msg-top { display: flex; justify-content: space-between; gap: 8px; }
.msg-from { font-weight: 700; }
.msg-when { color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.msg-label { color: var(--accent); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.msg-title { margin-top: 4px; }
.msg-snippet { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.cal-btn { margin: 0 var(--space-4) var(--space-3); height: 38px; border-radius: 19px; border: 1px dashed var(--accent); background: none; color: var(--accent); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.att-item { margin-top: 6px; font-size: 14px; }
.att-absent::before { content: "● "; color: #f87171; }
.att-partial::before { content: "● "; color: #fb923c; }
.att-tardy::before { content: "● "; color: #f2c14e; }
.att-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; }
.school-seg-btn { font-size: 12.5px; padding: 0 4px; }

/* ── Chores (9/28) ── */
.chore-btn { flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 20px; border: none; background: var(--accent); color: #0b0e14; font-weight: 800; font-size: 14px; cursor: pointer; }
.chore-cancel { background: rgba(255,255,255,.1); color: var(--muted); font-weight: 600; }
.chore-overdue { border-color: #f87171 !important; }
.chore-overdue .grade-meta { color: #f87171; }
.chore-done { opacity: .6; }
.chore-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-md); background: rgba(255,255,255,.05); border: 1px dashed var(--border-subtle); margin-bottom: 6px; }
.chore-row { display: flex; gap: 8px; }
.chore-row .chore-input:first-child { flex: 1; }
.chore-input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg); color: var(--text); font-size: 16px; }
.chore-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.chore-assign { align-self: flex-start; }

/* ── Daily lesson card (9/28) ── */
.lesson-wrap { padding: 0 var(--space-4) var(--space-3); }
.lesson-card { border-radius: var(--radius-md); padding: 12px 14px; background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.04)); border: 1px solid var(--accent); }
.lesson-card > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.lesson-card > summary::-webkit-details-marker { display: none; }
.lesson-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.lesson-topic { font-weight: 700; font-size: 16px; }
.lesson-card p { font-size: 14.5px; line-height: 1.5; margin-top: 8px; }
.lesson-why { color: var(--muted); }
.lesson-sub { font-weight: 800; font-size: 12px !important; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lesson-q { margin-top: 6px; font-size: 14.5px; }
.lesson-q summary { cursor: pointer; }
.lesson-link { display: block; margin-top: 10px; color: var(--accent); font-weight: 700; text-decoration: none; }
.lesson-did { margin-top: 12px; }
.lesson-done { border-color: #1f7a45; opacity: .85; }
