/*
   * One stylesheet, no framework, no build step. Apps Script serves these files as-is, so
   * anything that needs compiling cannot be here.
   *
   * The palette is near-black with a single indigo accent for interactive elements and
   * cyan reserved for live status. Cyan never appears on something that is not reporting
   * a current state, so a glance at the screen tells you where the moving parts are.
   */

  :root {
    --bg: #090d18;
    --surface: #111827;
    --surface-raised: #172033;
    --surface-soft: #1d2940;
    --border: #26334c;
    --border-strong: #394967;
    --text: #f1f4fb;
    --text-muted: #aeb8cc;
    --text-dim: #78859e;
    --accent: #7068e8;
    --accent-strong: #938df2;
    --live: #21d3ed;
    --danger: #f87171;
    --warn: #fbbf24;
    --ok: #4ade80;
    --radius: 10px;
    --gap: 16px;
    --font: "Aptos", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100%;
  }

  body {
    background:
      radial-gradient(circle at 75% -10%, rgb(82 71 225 / 0.14), transparent 30rem),
      var(--bg);
  }

  /* Focus is always visible. An operator who works by keyboard must never lose the caret. */
  :focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
  }

  a { color: var(--accent-strong); }
  a:hover { color: var(--live); }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #0b0c10;
    padding: 8px 12px;
    z-index: 100;
  }
  .skip-link:focus { left: 8px; top: 8px; }

  .app {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr) 330px;
    min-height: 100vh;
  }

  .sidebar {
    background: rgb(12 18 31 / 0.96);
    border-right: 1px solid var(--border);
    padding: 18px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .brand {
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 4px 8px 12px;
    font-size: 14px;
  }
  .brand span { display: block; color: var(--text-dim); font-weight: 400; font-size: 12px; }

  .nav-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 7px 10px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
  }
  .nav-button:hover { background: var(--surface-raised); color: var(--text); }
  .nav-button[aria-current="page"] {
    background: var(--surface-raised);
    color: var(--text);
    border-color: var(--border-strong);
  }
  .nav-button .count {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--live);
  }

  .nav-group {
    margin-top: 14px;
    padding: 0 10px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
  }

  .sidebar-footer { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--text-dim); }

  .main { padding: 0 30px 60px; min-width: 0; }

  h1 { font-size: 24px; margin: 0 0 5px; font-weight: 650; letter-spacing: -0.025em; }
  h2 { font-size: 16px; margin: 24px 0 8px; font-weight: 600; }
  h3 { font-size: 14px; margin: 16px 0 6px; font-weight: 600; color: var(--text-muted); }
  .lede { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: var(--gap);
  }

  .grid { display: grid; gap: var(--gap); }
  .grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--gap); }

  .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
  .stat .value { font-size: 24px; font-variant-numeric: tabular-nums; }
  .stat .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
  .stat.live .value { color: var(--live); }

  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
  th { color: var(--text-dim); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
  tbody tr:hover { background: var(--surface-raised); }
  td.numeric { font-variant-numeric: tabular-nums; text-align: right; }

  .table-wrap { overflow-x: auto; }

  button, .button {
    font: inherit;
    font-size: 14px;
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    min-height: 40px;
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  }
  button:hover:not(:disabled) { border-color: var(--accent); }
  button:active:not(:disabled) { transform: translateY(1px); }
  button:disabled { opacity: 0.45; cursor: not-allowed; }
  button.primary { background: var(--accent); border-color: var(--accent); color: #0b0c10; font-weight: 600; }
  button.primary:hover:not(:disabled) { background: var(--accent-strong); }
  button.danger { color: var(--danger); border-color: #58323a; }
  button.subtle { background: transparent; color: var(--text-muted); }

  .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

  input, textarea, select {
    font: inherit;
    font-size: 14px;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 8px 10px;
  }
  textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
  label { display: block; font-size: 13px; color: var(--text-muted); margin: 10px 0 4px; }
  fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; }
  legend { color: var(--text-muted); font-size: 13px; padding: 0 6px; }

  .checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
  .checkbox-row input { width: auto; margin-top: 3px; }

  .badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    white-space: nowrap;
  }
  .badge.tier-A { color: var(--ok); border-color: #2f5b3d; }
  .badge.tier-B { color: var(--accent-strong); border-color: #3c3f6b; }
  .badge.tier-C, .badge.tier-D { color: var(--text-dim); }
  .badge.live { color: var(--live); border-color: #1d5766; }
  .badge.warn { color: var(--warn); border-color: #5c4715; }
  .badge.danger { color: var(--danger); border-color: #58323a; }

  .notice {
    border: 1px solid var(--border-strong);
    border-left-width: 3px;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
    background: var(--surface);
  }
  .notice.warn { border-left-color: var(--warn); }
  .notice.danger { border-left-color: var(--danger); }
  .notice.info { border-left-color: var(--live); }
  .notice.ok { border-left-color: var(--ok); }

  .empty {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    color: var(--text-dim);
  }

  .email-preview {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px 16px;
    white-space: pre-wrap;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
  }

  .evidence {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface-raised);
  }
  .evidence blockquote {
    margin: 6px 0;
    padding-left: 10px;
    border-left: 2px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 13px;
  }
  .evidence .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); }

  .meta-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
  .meta-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
  .meta-list .key { color: var(--text-dim); }

  .toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 380px;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    z-index: 50;
  }
  .toast.error { border-left-color: var(--danger); }
  .toast.ok { border-left-color: var(--ok); }

  .login { min-height: 100vh; }

  .muted { color: var(--text-muted); }
  .dim { color: var(--text-dim); }
  .mono { font-family: var(--mono); font-size: 13px; }
  .small { font-size: 13px; }
  .nowrap { white-space: nowrap; }
  .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .spacer { flex: 1; }

  .loading { color: var(--text-dim); font-size: 14px; padding: 20px 0; }

  .brand-mark {
    position: relative;
    display: inline-flex;
    width: 28px;
    height: 24px;
    flex: 0 0 auto;
  }
  .brand-mark i {
    position: absolute;
    left: 2px;
    width: 24px;
    height: 8px;
    border-radius: 3px;
    background: var(--accent-strong);
    transform: skewY(-14deg);
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.12) inset;
  }
  .brand-mark i:nth-child(1) { top: 0; background: #21d3ed; }
  .brand-mark i:nth-child(2) { top: 5px; background: #7f8ef3; }
  .brand-mark i:nth-child(3) { top: 10px; background: #5247e1; }
  .brand-mark i:nth-child(4) { top: 15px; background: #312d84; }
  .brand-mark.compact { width: 26px; transform: scale(0.88); transform-origin: left center; }

  /* Public product showcase and team sign-in. */
  .showcase-nav {
    min-height: 72px;
    padding: 0 clamp(22px, 5vw, 74px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
  }
  .showcase-brand,
  .workspace-brand {
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 650;
    letter-spacing: -0.02em;
  }
  .showcase-brand { font-size: 18px; }
  .showcase-label {
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 0.03em;
  }
  .showcase-main {
    width: min(1440px, 100%);
    min-height: calc(100dvh - 72px);
    margin: 0 auto;
    padding: clamp(36px, 6vw, 82px) clamp(22px, 5vw, 74px);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
    gap: clamp(34px, 7vw, 110px);
    align-items: center;
  }
  .showcase-copy { max-width: 650px; }
  .eyebrow {
    margin: 0 0 17px;
    color: var(--live);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }
  .showcase-copy h1 {
    max-width: 20ch;
    font-size: clamp(44px, 5vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    margin-bottom: 24px;
  }
  .showcase-lede {
    max-width: 540px;
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.55;
  }
  .showcase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
  }
  .showcase-primary,
  .showcase-secondary {
    min-height: 48px;
    padding-inline: 20px;
    font-weight: 650;
  }
  .showcase-secondary { background: transparent; }
  .capability-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 38px;
    border-top: 1px solid var(--border);
  }
  .capability-strip span {
    padding: 12px 16px 12px 0;
    color: var(--text-dim);
    font-size: 13px;
    border-bottom: 1px solid var(--border);
  }
  .showcase-agent {
    position: relative;
    max-width: 630px;
    justify-self: end;
  }
  .showcase-portrait-wrap {
    position: relative;
    overflow: hidden;
    min-height: 580px;
    border: 1px solid rgb(147 141 242 / 0.28);
    border-radius: 22px;
    background: #0b1120;
    box-shadow: 0 34px 90px rgb(2 6 23 / 0.52);
  }
  .showcase-portrait {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 580px;
    object-fit: cover;
    object-position: center 28%;
  }
  .showcase-portrait-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(5 10 19 / 0.92), transparent 44%);
    pointer-events: none;
  }
  .agent-identity {
    position: absolute;
    left: 26px;
    bottom: 25px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
  }
  .agent-identity strong { font-size: 22px; letter-spacing: -0.02em; }
  .agent-identity > span:last-child {
    grid-column: 2;
    color: var(--text-muted);
    font-size: 13px;
  }
  .agent-presence {
    grid-row: 1 / 3;
    align-self: center;
    color: var(--live);
    border: 1px solid rgb(33 211 237 / 0.4);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }
  .showcase-brief {
    position: absolute;
    right: -28px;
    bottom: 30px;
    width: min(390px, 76%);
    padding: 20px;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 14px;
    background: rgb(13 20 34 / 0.94);
    box-shadow: 0 24px 54px rgb(3 7 18 / 0.5);
    backdrop-filter: blur(18px);
  }
  .brief-label {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--accent-strong);
    font-weight: 700;
  }
  .brief-copy {
    min-height: 66px;
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
  }
  .brief-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 14px;
  }
  .brief-step {
    min-height: 38px;
    padding: 7px 8px;
    background: transparent;
    border-color: var(--border);
    color: var(--text-dim);
    font-size: 12px;
    text-align: left;
  }
  .brief-step span { display: block; font-family: var(--mono); font-size: 10px; }
  .brief-step.active {
    background: var(--surface-soft);
    border-color: var(--accent);
    color: var(--text);
  }
  .signin-panel {
    width: min(1292px, calc(100% - 44px));
    margin: 0 auto 42px;
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
  }
  .signin-panel h2 { margin: 0 0 4px; font-size: 24px; }
  .signin-panel p { margin: 0; color: var(--text-muted); }
  .signin-panel .eyebrow { margin-bottom: 8px; }
  .signin-action { min-width: 320px; }
  .signin-action #login-message { margin: 8px 0 0; }
  .workspace-signin {
    width: 100%;
    min-height: 44px;
  }
  .showcase-footer {
    padding: 22px clamp(22px, 5vw, 74px) 34px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--text-dim);
    font-size: 12px;
  }
  .showcase-footer a { color: var(--text-muted); }
  .showcase-footer a {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
  }

  /* Internal workspace. */
  .workspace-brand {
    padding: 0 8px 17px;
    margin-bottom: 7px;
    border-bottom: 1px solid var(--border);
  }
  .workspace-brand > span:last-child { display: grid; }
  .workspace-brand strong { font-size: 16px; line-height: 1.2; }
  .workspace-brand small { color: var(--text-dim); font-size: 11px; font-weight: 500; }
  .workspace-label {
    margin: 12px 10px 5px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .nav-group { padding: 0; }
  .workspace-topbar {
    min-height: 72px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
  }
  .workspace-topbar > div:first-child { display: grid; }
  .workspace-kicker {
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  #workspace-context { font-size: 14px; font-weight: 600; }
  .topbar-status,
  .dock-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
  }
  .presence-indicator {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 3px rgb(33 211 237 / 0.12);
  }
  .agent-dock {
    min-width: 0;
    height: 100vh;
    padding: 18px;
    position: sticky;
    top: 0;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: rgb(12 18 31 / 0.88);
  }
  .dock-portrait {
    position: relative;
    height: 228px;
    overflow: hidden;
    border-radius: 14px;
    background: var(--surface);
  }
  .dock-portrait img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 23%;
  }
  .dock-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(5 10 19 / 0.88), transparent 52%);
    pointer-events: none;
  }
  .dock-status {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 1;
    color: var(--text);
  }
  .dock-body { padding: 17px 2px 0; }
  .dock-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .dock-heading h2 { margin: 0; font-size: 19px; }
  .dock-heading p { margin: 2px 0 0; color: var(--text-dim); font-size: 12px; }
  .agent-mode {
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .agent-message {
    min-height: 112px;
    margin: 16px 0;
    padding: 14px;
    border-left: 2px solid var(--accent);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
  }
  .agent-quick-actions {
    display: grid;
    gap: 7px;
  }
  .agent-quick-actions button {
    width: 100%;
    justify-content: flex-start;
    min-height: 42px;
    text-align: left;
    background: transparent;
    color: var(--text-muted);
  }
  .agent-command {
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
  }
  .agent-command label { margin-top: 0; }
  .agent-command > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .agent-command input { min-width: 0; }
  .agent-command-help { margin: 7px 0 0; color: var(--text-dim); font-size: 11px; }

  .briefing-hero {
    margin: 0 0 22px;
    padding: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
      linear-gradient(120deg, rgb(82 71 225 / 0.16), transparent 48%),
      var(--surface);
  }
  .briefing-hero h1 { max-width: 620px; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; }
  .briefing-hero p { max-width: 620px; margin: 10px 0 0; color: var(--text-muted); }
  .briefing-priority {
    min-width: 180px;
    padding-left: 22px;
    border-left: 1px solid var(--border-strong);
  }
  .briefing-priority span {
    display: block;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .briefing-priority strong { display: block; margin-top: 4px; font-size: 22px; }
  .metric-grid { margin-bottom: 20px; }
  .metric-grid .stat { min-height: 108px; }
  .stat .value { font-weight: 650; letter-spacing: -0.035em; }
  .today-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: var(--gap);
  }
  .today-lower .card h2 { margin-top: 0; }
  .next-action-list { display: grid; gap: 8px; }
  .next-action {
    width: 100%;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    background: var(--surface-raised);
  }
  .next-action span { display: grid; }
  .next-action small { margin-top: 2px; color: var(--text-dim); }
  .next-action b { color: var(--accent-strong); font-size: 12px; }

  /* One shift is four hours on a laptop. Layout has to survive a small window. */
  @media (max-width: 1220px) {
    .app { grid-template-columns: 220px minmax(0, 1fr); }
    .sidebar { grid-row: 1 / 3; }
    .agent-dock {
      grid-column: 2;
      height: auto;
      position: static;
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      gap: 18px;
      border-left: 0;
      border-top: 1px solid var(--border);
    }
    .dock-portrait { height: 240px; }
    .dock-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr); gap: 16px; }
    .agent-message { grid-column: 1; }
    .agent-quick-actions { grid-column: 2; grid-row: 1 / 3; align-content: start; padding-top: 38px; }
    .agent-command { grid-column: 1 / -1; }
  }

  @media (max-width: 880px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
      grid-row: auto;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      border-right: none;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      height: auto;
      padding: 12px;
      z-index: 20;
    }
    .workspace-brand {
      width: auto;
      margin: 0;
      padding: 0;
      border-bottom: 0;
    }
    .workspace-label, .nav-group { display: none; }
    #nav-operator {
      grid-column: 1 / -1;
      display: flex;
      gap: 4px;
      margin-top: 10px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    #nav-operator::-webkit-scrollbar { display: none; }
    #nav-owner { display: none; }
    .nav-button { width: auto; flex: 0 0 auto; }
    .sidebar-footer {
      width: auto;
      margin: 0;
      padding: 0;
      grid-column: 2;
      grid-row: 1;
    }
    .sidebar-footer #who { display: none; }
    .sidebar-footer .nav-button { border-color: var(--border); }
    .main { padding: 18px 16px 48px; }
    .workspace-topbar { min-height: 54px; margin-bottom: 18px; }
    .topbar-status { display: none; }
    .split { grid-template-columns: 1fr; }
    .briefing-hero { grid-template-columns: 1fr; }
    .briefing-priority { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border); }
    .today-lower { grid-template-columns: 1fr; }
    .agent-dock {
      grid-column: 1;
      grid-template-columns: 1fr;
      padding-bottom: 70px;
    }
    .dock-portrait { height: 300px; }
    .dock-body { display: block; }
    .agent-quick-actions { padding-top: 0; }

    .showcase-main {
      grid-template-columns: 1fr;
      min-height: auto;
      padding-top: 54px;
    }
    .showcase-agent { justify-self: stretch; max-width: none; }
    .showcase-portrait-wrap,
    .showcase-portrait { min-height: 520px; }
    .showcase-brief { right: 18px; }
    .signin-panel { grid-template-columns: 1fr; }
    .signin-action { min-width: 0; }
  }

  @media (max-width: 560px) {
    .showcase-label { display: none; }
    .showcase-copy h1 { font-size: 43px; }
    .showcase-main { padding-inline: 18px; }
    .showcase-portrait-wrap,
    .showcase-portrait { min-height: 440px; }
    .showcase-brief {
      position: relative;
      width: calc(100% - 24px);
      right: auto;
      bottom: auto;
      margin: -42px 12px 0;
    }
    .agent-identity { bottom: 55px; }
    .brief-progress { grid-template-columns: 1fr; }
    .brief-step span { display: inline; margin-right: 6px; }
    .capability-strip { grid-template-columns: 1fr; }
    .signin-panel { width: calc(100% - 36px); padding: 20px; }
    .showcase-footer { flex-direction: column; }
    .agent-command > div { grid-template-columns: 1fr; }
    .agent-command button { width: 100%; }
  }

  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
</style>

  /* First-run tour.
     Fixed rather than absolute so it survives the workspace scrolling underneath: the
     step text and the screen it describes need to be visible at the same time. */
  .tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    background: rgba(9, 13, 24, 0.55);
    backdrop-filter: blur(2px);
  }

  .tour-card {
    width: min(560px, 100%);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }

  .tour-card:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }

  .tour-progress {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .tour-title { margin: 6px 0 10px; font-size: 20px; line-height: 1.25; }
  .tour-body { margin: 0; color: var(--text-muted); line-height: 1.6; }

  .tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
  }

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

  @media (max-width: 620px) {
    .tour-overlay { padding: 12px; align-items: center; }
    .tour-actions { flex-direction: column-reverse; align-items: stretch; }
    .tour-actions-right { justify-content: flex-end; }
  }

  @media (prefers-reduced-motion: no-preference) {
    .tour-card { animation: tour-rise 180ms ease-out; }
    @keyframes tour-rise {
      from { transform: translateY(8px); opacity: 0; }
      to { transform: none; opacity: 1; }
    }
  }
