/* TAG Command Center design system (redesign/orb-agent). Reproduces David's
   executive Orb mockup: dark void, gold and cyan glass, Cinzel + Outfit +
   JetBrains Mono, compact top bar, left tool suite, grand orb. Hand-written
   and shipped as a static file (no Tailwind CDN, no icon CDN).

   Departures from the mockup, on purpose:
   - Body text is 16px and nothing is under 14px (mockup used 9 to 11px).
   - Muted text meets WCAG AA on the darkest surface (mockup's slate-500 did not).
   - Phones get a bottom navigation (mockup hid the sidebar with no replacement).
   - Every animation stops under prefers-reduced-motion or the Motion control. */

:root {
  /* Surfaces */
  --void: #03050a;
  --obsidian: #070b15;
  --surface-1: #0d1526;
  --surface-2: #131d33;
  --surface-3: #1a2641;
  --glass: rgba(13, 21, 38, 0.82);
  --line: rgba(255, 255, 255, 0.1);
  --line-gold: rgba(230, 195, 85, 0.28);

  /* Text. --text-2 is 9.4:1 and --text-3 is 6.3:1 on --surface-1. */
  --text: #eef2f8;
  --text-2: #c2cbdb;
  --text-3: #9dabc1;
  --heading: #ffffff;
  --on-gold: #14100a;

  /* Accents */
  --gold-c: #e6c355;
  --gold-bright: #ffd966;
  --gold-deep: #b38b22;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --crimson: #fb7185;
  --amber: #fbbf24;

  /* Type */
  --font-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;

  /* Shape and space */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --topbar-h: 58px;
  --bottomnav-h: 68px;
  --suite-w: 300px;
  --tap: 44px;

  /* Legacy names the tool modules and their CSS already use, remapped so
     every existing screen picks up the new look. */
  --navy: #0d1526;
  --navy-light: #1a2641;
  --gold: #e6c355;
  --gold-light: #ffe08a;
  --cream: #0a1120;
  --charcoal: #eef2f8;
  --border-soft: rgba(255, 255, 255, 0.13);
  --red: #b4324a;
  --green: #1f7a58;
  --danger-text: #fda4af;
  --good-text: #6ee7b7;
}

html { background: var(--void); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background-color: var(--void);
  background-image:
    radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.07) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.05) 0, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--heading); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
/* Form fields inside tools. Older tool styles set no field colors, so the
   browser's white default showed through. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), textarea, select {
  background-color: var(--surface-1); color: var(--text); border-color: var(--line);
}
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }

.tcc-score-note { margin: 10px 22px 4px; color: var(--text-2); font-size: var(--fs-sm); }
.case-actions .soli { color: var(--text-2); }
.apply-btn { border: 1px solid var(--line-gold); }
.job-card, .case-output, .case-header, .case-body, .quickscan-band-banner, [data-tcc-result] { scroll-margin-top: 84px; }

::selection { background: var(--gold-c); color: var(--on-gold); }
a { color: var(--gold-bright); }

.tcc-skip {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--gold-c); color: var(--on-gold); font-weight: 700;
  padding: 10px 14px; border-radius: var(--r-sm); text-decoration: none;
}
.tcc-skip:focus { top: 10px; }
.tcc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn-primary, .tcc-btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px; border: 0; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--gold-c), var(--gold-bright) 55%, #f5b82e);
  color: var(--on-gold); font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 700;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 0 22px rgba(230, 195, 85, 0.28);
  transition: box-shadow .2s ease, transform .2s ease, filter .2s ease;
}
.btn-primary:hover, .tcc-btn-gold:hover { box-shadow: 0 0 32px rgba(230, 195, 85, 0.5); filter: brightness(1.05); }
.btn-primary:disabled, .tcc-btn-gold:disabled { opacity: .6; cursor: default; box-shadow: none; }
.tcc-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.tcc-btn-ghost:hover { border-color: var(--gold-c); background: var(--surface-3); }
.tcc-btn-ghost[aria-pressed="true"] { border-color: var(--gold-c); color: var(--gold-bright); }
.tcc-btn-small { min-height: 40px; padding: 6px 12px; font-size: var(--fs-sm); }

/* ---------- Glass cards ---------- */
.tcc-glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line-gold); border-radius: var(--r-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.tcc-label {
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gold-c);
}

/* ---------- The Orb ---------- */
.tcc-orb {
  --orb-size: 220px;
  --orb-speed: 1;
  --orb-glow: rgba(230, 195, 85, .45);
  position: relative; flex: none; isolation: isolate;
  width: var(--orb-size); height: var(--orb-size);
  display: flex; align-items: center; justify-content: center;
  perspective: 1200px;
}
.tcc-orb canvas { position: absolute; inset: -15%; width: 130%; height: 130%; pointer-events: none; z-index: 0; }
.tcc-orb-field {
  position: absolute; inset: -6%; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(230, 195, 85, .22) 0, rgba(180, 130, 20, .08) 45%, transparent 70%);
  filter: blur(calc(var(--orb-size) * .08));
  animation: tccField 6s ease-in-out infinite alternate;
}
.tcc-orb-ring { position: absolute; border-radius: 50%; pointer-events: none; transform-style: preserve-3d; z-index: 1; }
.tcc-orb-ring.r1 { width: 73.5%; height: 73.5%; border: 1.5px solid rgba(230, 195, 85, .55); border-top-color: #fff; border-right-color: transparent; animation: tccGyro1 calc(16s / var(--orb-speed)) linear infinite; }
.tcc-orb-ring.r2 { width: 84%; height: 84%; border: 1.5px dashed rgba(245, 215, 110, .45); border-bottom-color: #fff; animation: tccGyro2 calc(22s / var(--orb-speed)) linear infinite reverse; }
.tcc-orb-ring.r3 { width: 63%; height: 63%; border: 1px dotted rgba(230, 195, 85, .35); animation: tccGyro3 calc(12s / var(--orb-speed)) linear infinite; }
.tcc-orb-ring.hud { width: 94%; height: 94%; border: 1px solid rgba(255, 255, 255, .08); border-left: 2px solid rgba(230, 195, 85, .7); border-right: 2px solid rgba(56, 189, 248, .5); animation: tccHud calc(35s / var(--orb-speed)) linear infinite; }
.tcc-orb-sat { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff6cc, 0 0 24px var(--gold-c); z-index: 1; }
.tcc-orb-sat.s1 { width: 2.4%; height: 2.4%; top: 4%; left: 13%; }
.tcc-orb-sat.s2 { width: 3%; height: 3%; bottom: 10%; right: 12%; }
.tcc-orb-sat.s3 { width: 1.8%; height: 1.8%; top: 25%; right: 6%; }
.tcc-orb-core {
  position: relative; z-index: 2; width: 50%; height: 50%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none;
  background: radial-gradient(circle at 35% 25%, #fff 0, #fff2b2 15%, #e6c355 35%, #b38b22 65%, #423005 100%);
  box-shadow:
    inset 0 calc(var(--orb-size) * -.05) calc(var(--orb-size) * .09) rgba(0, 0, 0, .9),
    inset 0 calc(var(--orb-size) * .024) calc(var(--orb-size) * .05) rgba(255, 255, 255, .95),
    0 0 calc(var(--orb-size) * .18) var(--orb-glow),
    0 0 calc(var(--orb-size) * .32) rgba(230, 195, 85, .2);
  transition: box-shadow .4s ease, filter .4s ease;
  animation: tccBreathe 5s ease-in-out infinite;
}
.tcc-orb-core::before {
  content: ""; position: absolute; top: 10%; left: 18%; width: 28%; height: 14%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 75%);
  transform: rotate(-35deg); pointer-events: none;
}
.tcc-orb-core b { position: relative; font-family: var(--font-display); font-weight: 900; font-size: calc(var(--orb-size) * .088); letter-spacing: .1em; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .9); line-height: 1; }
.tcc-orb-core small { position: relative; margin-top: 4px; font-family: var(--font-sans); font-size: max(11px, calc(var(--orb-size) * .034)); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); line-height: 1.1; text-align: center; }

.tcc-orb[data-state="listening"] { --orb-glow: rgba(56, 189, 248, .55); --orb-speed: 1.4; }
.tcc-orb[data-state="listening"] .tcc-orb-ring.r1 { border-color: rgba(56, 189, 248, .75); border-right-color: transparent; }
.tcc-orb[data-state="thinking"] { --orb-speed: 3; --orb-glow: rgba(230, 195, 85, .8); }
.tcc-orb[data-state="working"] { --orb-speed: 4; --orb-glow: rgba(245, 158, 11, .8); }
.tcc-orb[data-state="thinking"] .tcc-orb-core, .tcc-orb[data-state="working"] .tcc-orb-core { animation-duration: 1.8s; }
.tcc-orb[data-state="needs-you"] { --orb-glow: rgba(251, 191, 36, .9); --orb-speed: .6; }
.tcc-orb[data-state="needs-you"] .tcc-orb-core { animation: tccNudge 1.6s ease-in-out infinite; }
.tcc-orb[data-state="done"] { --orb-glow: rgba(52, 211, 153, .8); --orb-speed: .7; }
.tcc-orb[data-state="done"] .tcc-orb-core { animation: tccDeliver .9s ease-out 1; }
.tcc-orb[data-state="error"] { --orb-glow: rgba(251, 113, 133, .8); --orb-speed: .4; }
.tcc-orb[data-state="error"] .tcc-orb-core { filter: saturate(.55) brightness(.85); animation: none; }

@keyframes tccField { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.15); opacity: .95; } }
@keyframes tccGyro1 { from { transform: rotateX(65deg) rotateY(25deg) rotateZ(0); } to { transform: rotateX(65deg) rotateY(25deg) rotateZ(360deg); } }
@keyframes tccGyro2 { from { transform: rotateX(-55deg) rotateY(40deg) rotateZ(0); } to { transform: rotateX(-55deg) rotateY(40deg) rotateZ(360deg); } }
@keyframes tccGyro3 { from { transform: rotateX(35deg) rotateY(-65deg) rotateZ(0); } to { transform: rotateX(35deg) rotateY(-65deg) rotateZ(360deg); } }
@keyframes tccHud { to { transform: rotate(360deg); } }
@keyframes tccBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes tccNudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes tccDeliver { 0% { transform: scale(1); filter: brightness(1); } 35% { transform: scale(1.12); filter: brightness(1.45); } 100% { transform: scale(1); filter: brightness(1); } }

/* ---------- App shell ---------- */
.tcc-topbar {
  position: sticky; top: 0; z-index: 60; min-height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 20px;
  background: rgba(7, 11, 21, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-gold);
}
.tcc-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); min-width: 0; }
.tcc-brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(45deg, var(--gold-deep), var(--gold-c) 55%, #fff);
  box-shadow: 0 0 12px rgba(230, 195, 85, .4);
  font-family: var(--font-display); font-weight: 900; font-size: 13px; color: #000; letter-spacing: -.02em;
}
.tcc-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .03em; white-space: nowrap; }
.tcc-brand-sub { display: block; font-family: var(--font-sans); font-size: 14px; color: var(--text-2); font-weight: 400; letter-spacing: 0; }
.tcc-topbar-right { display: flex; align-items: center; gap: 8px; }
.tcc-agent-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px; border-radius: 999px;
  background: rgba(230, 195, 85, .08); border: 1px solid var(--line-gold); color: var(--gold-bright);
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; max-width: 340px;
}
.tcc-agent-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcc-agent-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--emerald); }
.tcc-agent-pill[data-state="working"] .tcc-agent-dot, .tcc-agent-pill[data-state="thinking"] .tcc-agent-dot { background: var(--gold-bright); animation: tccBlink 1.1s ease-in-out infinite; }
.tcc-agent-pill[data-state="needs-you"] .tcc-agent-dot { background: var(--amber); }
.tcc-agent-pill[data-state="error"] .tcc-agent-dot { background: var(--crimson); }
@keyframes tccBlink { 50% { opacity: .3; } }

.app-shell { display: flex; flex: 1; min-height: 0; align-items: stretch; background: transparent; }
.tcc-suite {
  width: var(--suite-w); flex: none; position: sticky; top: var(--topbar-h); align-self: flex-start;
  height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column;
  background: rgba(7, 11, 22, .95); border-right: 1px solid var(--line); z-index: 40; color: var(--text);
}
.tcc-suite-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tcc-suite-search { width: 100%; margin-top: 8px; min-height: var(--tap); padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--line); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-base); }
.tcc-suite-search::placeholder { color: var(--text-3); }
.tcc-suite-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.tcc-suite-group { margin-bottom: 16px; }
.tcc-suite-group-title { padding: 4px 10px; font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.tcc-suite-link {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-size: var(--fs-base); line-height: 1.25;
}
.tcc-suite-link:hover { background: var(--surface-2); color: #fff; }
.tcc-suite-link[aria-current="page"] { background: rgba(230, 195, 85, .12); color: var(--gold-bright); font-weight: 600; }
.tcc-suite-link .ico { width: 20px; height: 20px; flex: none; color: var(--gold-c); }
.tcc-suite-link .ico svg { width: 100%; height: 100%; display: block; }
.tcc-suite-link .name { flex: 1; min-width: 0; }
.tcc-suite-link .lock { font-size: var(--fs-sm); color: var(--text-3); }
.tcc-suite-foot { padding: 12px 14px; border-top: 1px solid var(--line); background: #060a14; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tcc-suite-who { min-width: 0; font-size: var(--fs-sm); }
.tcc-suite-who a { display: block; color: var(--gold-bright); text-decoration: none; }
.tcc-suite-who span { display: block; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { flex: 1; min-width: 0; padding: 20px 28px 40px; background: transparent; color: var(--text); }

/* Phone bottom navigation */
.tcc-bottomnav { display: none; }
.tcc-sheet-close { display: none; }
.tcc-scrim { display: none; }

/* ---------- Tool page Orb strip ---------- */
.tcc-tool-strip {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 0 18px;
  border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-gold);
}
.tcc-tool-strip p { margin: 0; color: var(--text); font-size: var(--fs-base); }

/* ---------- Dashboard ---------- */
.tcc-dash { display: flex; flex-direction: column; gap: 18px; max-width: 1120px; margin: 0 auto; }
.tcc-directive { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.tcc-directive h2 { margin: 4px 0 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.3; }
.tcc-stage { position: relative; overflow: hidden; padding: 22px 20px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tcc-stage-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; background: #0a1122; border: 1px solid var(--line-gold); color: var(--gold-bright); font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; }
.tcc-stage-orb { margin: 10px 0 6px; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.tcc-stage h1 { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; margin: 6px 0 4px; letter-spacing: .01em; }
.tcc-stage-say { margin: 0; max-width: 620px; color: var(--text-2); min-height: 24px; }
.tcc-ai-note { margin: 6px 0 0; max-width: 620px; font-size: var(--fs-sm); color: var(--text-3); }
.tcc-prompt { width: 100%; max-width: 640px; margin-top: 16px; display: flex; gap: 8px; }
.tcc-prompt input {
  flex: 1; min-width: 0; min-height: 50px; padding: 10px 16px; border-radius: var(--r-md);
  background: #0a1122; border: 1px solid var(--line-gold); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-base);
}
.tcc-prompt input::placeholder { color: var(--text-3); }
.tcc-prompt input:focus { border-color: var(--gold-c); outline: none; box-shadow: 0 0 0 3px rgba(56, 189, 248, .35); }
.tcc-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.tcc-pill { min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-sm); cursor: pointer; }
.tcc-pill:hover { border-color: var(--gold-c); }
.tcc-stage-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

.tcc-deck { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; }
.tcc-deck-card { padding: 16px; min-width: 0; border-color: var(--line); }
.tcc-deck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.tcc-deck-head h2 { margin: 0; font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.tcc-deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tcc-deck-row { display: block; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: var(--tap); }
.tcc-deck-row:hover { border-color: var(--gold-c); }
.tcc-deck-row strong { display: block; font-weight: 600; font-size: var(--fs-base); }
.tcc-deck-row span { display: block; font-size: var(--fs-sm); color: var(--text-2); }
.tcc-activity-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 8px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.tcc-activity-item:hover { border-color: var(--gold-c); }
.tcc-activity-item span:last-child { flex: none; color: var(--text-2); font-family: var(--font-mono); }
.tcc-empty { color: var(--text-2); font-size: var(--fs-base); padding: 8px 2px; }

/* ---------- Agent run panel ("TAG engine at work") ---------- */
.tcc-run { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow-y: auto; }
.tcc-run[hidden] { display: none; }
.tcc-run-card {
  position: relative; width: 100%; max-width: 540px; margin: auto; padding: 24px 24px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #090f1d; border: 1px solid rgba(230, 195, 85, .4); border-radius: 24px;
  box-shadow: 0 0 80px rgba(230, 195, 85, .2);
}
.tcc-run-eyebrow { padding: 3px 10px; border-radius: 999px; background: rgba(230, 195, 85, .1); border: 1px solid var(--line-gold); color: var(--gold-bright); font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; }
.tcc-run h2 { margin: 10px 0 2px; font-size: var(--fs-lg); line-height: 1.25; }
.tcc-run-now { margin: 4px 0 0; color: var(--text); font-size: var(--fs-base); min-height: 24px; }
.tcc-run-bar { width: 100%; height: 8px; margin-top: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tcc-run-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #d97706, var(--gold-c), #fff8db); transition: width .5s ease; }
.tcc-run-bar.is-open i { width: 34%; animation: tccSlide 1.8s ease-in-out infinite; }
@keyframes tccSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
.tcc-run-steps { list-style: none; width: 100%; margin: 14px 0 0; padding: 0; text-align: left; }
.tcc-run-steps li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--text-3); font-size: var(--fs-base); line-height: 1.3; }
.tcc-run-steps li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid #4a5874; box-sizing: border-box; }
.tcc-run-steps li.now { color: #fff; font-weight: 600; }
.tcc-run-steps li.now::before { border-color: var(--gold-bright); border-top-color: transparent; animation: tccHud .9s linear infinite; }
.tcc-run-steps li.done { color: var(--text-2); }
.tcc-run-steps li.done::before { border: 0; background: var(--gold-c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%2314100a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.tcc-run-steps li .state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tcc-run-meta { width: 100%; margin-top: 12px; font-size: var(--fs-sm); color: var(--text-2); }
.tcc-run-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tcc-run-actions > * { flex: 1 1 150px; }
.tcc-run-live { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; max-height: 130px; overflow: hidden; margin: 10px 0 2px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.tcc-run-detail { width: 100%; margin-top: 10px; text-align: left; font-size: var(--fs-sm); color: var(--text-2); }
.tcc-run-note { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-3); }

/* Docked mini-Orb */
.tcc-dock { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; gap: 10px; }
.tcc-dock[hidden] { display: none; }
.tcc-dock-btn { display: flex; align-items: center; gap: 10px; max-width: min(320px, calc(100vw - 40px)); padding: 6px 16px 6px 6px; border-radius: 999px; background: #0a1122; border: 1px solid var(--line-gold); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; box-shadow: 0 8px 26px rgba(0, 0, 0, .55); text-align: left; }
.tcc-dock-btn span:last-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Toast */
.tcc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; max-width: min(460px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--r-md); background: #0b1222; border: 1px solid var(--line-gold); color: var(--text); font-size: var(--fs-base); box-shadow: 0 15px 40px rgba(0, 0, 0, .8); }
.tcc-toast[hidden] { display: none; }

/* ---------- Landing ---------- */
.tcc-landing-hero { max-width: 980px; margin: 0 auto; padding: 36px 20px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tcc-landing-hero h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 6px 0 12px; }
.tcc-landing-hero p { color: var(--text-2); font-size: var(--fs-md); max-width: 680px; margin: 0 0 22px; }
.tcc-google-slot { min-height: 44px; display: flex; justify-content: center; margin-bottom: 14px; }
.tcc-login-or { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: var(--fs-sm); margin: 4px 0 14px; }
.tcc-login-or::before, .tcc-login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-code-toggle { display: inline-block; margin-top: 14px; color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 860px) {
  /* Above the bottom bar, below the Tools sheet and its scrim. */
  .tcc-dock { z-index: 72; }
  .tcc-run-live { max-height: 100px; }
  .case-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .case-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .case-actions > div button { flex: 1 1 140px; }
  .tcc-toast { bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  /* The agent comes first on a phone, so the prompt box is on the first screen. */
  .tcc-directive-slot { order: 1; }
  .tcc-deck { order: 2; }
  body { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); }
  .tcc-topbar { padding: 6px 12px; min-height: 52px; }
  .tcc-brand-sub { display: none; }
  .tcc-brand-name { font-size: 15px; }
  .tcc-topbar .tcc-agent-pill { display: none; }
  .main-content { padding: 14px 16px 24px; }
  .tcc-deck { grid-template-columns: 1fr; }

  .tcc-bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #070b15; border-top: 1px solid var(--line-gold);
  }
  .tcc-bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; min-width: 0; background: none; border: 0; color: var(--text-2); font-family: var(--font-sans); font-size: 14px; text-decoration: none; cursor: pointer; }
  .tcc-bn-item svg { width: 24px; height: 24px; }
  .tcc-bn-item[aria-current="page"] { color: var(--gold-bright); font-weight: 600; }
  .tcc-bn-orb { position: relative; }
  .tcc-bn-orb .tcc-orb { margin-top: -22px; }

  .tcc-suite {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80; width: 100%;
    height: min(82vh, 640px); border-right: 0; border-top: 1px solid var(--line-gold);
    border-radius: 20px 20px 0 0; transform: translateY(105%); visibility: hidden;
    transition: transform .28s ease, visibility .28s;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tcc-suite.is-open { transform: none; visibility: visible; }
  .tcc-sheet-close { display: inline-flex; }
  .tcc-suite-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .tcc-suite-search { flex: 1 1 100%; margin-top: 0; }
  .tcc-scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, .6); }
  .tcc-scrim[hidden] { display: none; }

  .tcc-dock { right: 12px; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 10px); }
  .tcc-toast { bottom: calc(var(--bottomnav-h) + 14px); }
  .tcc-run { padding: 10px; }
  .tcc-run-card { padding: 16px 16px 14px; border-radius: 20px; }
  .tcc-tool-strip { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .tcc-deck-grid { grid-template-columns: 1fr; }
  .tcc-prompt { flex-direction: column; }
  .tcc-prompt .tcc-btn-gold { width: 100%; }
  .tcc-directive .tcc-btn-gold { width: 100%; }
  .tcc-brand-name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tcc-orb *, .tcc-orb *::before, .tcc-agent-dot, .tcc-run-steps li.now::before, .tcc-run-bar.is-open i { animation: none !important; }
  .tcc-run-bar.is-open i { width: 100%; opacity: .5; }
  .tcc-suite, .btn-primary, .tcc-btn-gold { transition: none; }
}
html[data-motion="off"] .tcc-orb *, html[data-motion="off"] .tcc-orb *::before, html[data-motion="off"] .tcc-agent-dot, html[data-motion="off"] .tcc-run-steps li.now::before, html[data-motion="off"] .tcc-run-bar.is-open i { animation: none !important; }
html[data-motion="off"] .tcc-run-bar.is-open i { width: 100%; opacity: .5; }
@media (forced-colors: active) { .tcc-orb-core { forced-color-adjust: none; } }
