/* =============================================================
 *  TM·FIELD CONSOLE — PMCS Assistant
 *  Tactical field console aesthetic
 *  ============================================================= */

:root {
  --bg-base:        #080B0A;
  --bg-surface:     #0E1311;
  --bg-elevated:    #161D1A;
  --bg-input:       #0A0F0D;

  --border-faint:   #161E1A;
  --border-subtle:  #1F2A24;
  --border-default: #2D3A33;
  --border-bright:  #4A5C53;

  --text-primary:   #D6CFB4;
  --text-secondary: #8E8B7E;
  --text-dim:       #5A5A52;
  --text-faint:     #38382F;
  --text-invert:    #0A0F0D;

  --accent:         #9CB071;
  --accent-bright:  #B8CC8A;
  --accent-dim:     #6B7A4F;

  --status-deadline:        #E15554;
  --status-deadline-soft:   rgba(225, 85, 84, 0.10);
  --status-deadline-bright: #F47372;
  --status-capable:         #7FB069;
  --status-capable-soft:    rgba(127, 176, 105, 0.10);
  --status-caution:         #E5A04B;
  --status-caution-soft:    rgba(229, 160, 75, 0.10);
  --status-info:            #8FA0A6;
  --status-info-soft:       rgba(143, 160, 166, 0.08);

  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'IBM Plex Sans Condensed', ui-sans-serif, sans-serif;

  --container-max: 1240px;
  --chat-max:      880px;
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--text-invert); }

/* ===== Tactical scrollbars =============================================
 * Firefox + modern browsers via scrollbar-width / -color; WebKit (Chrome,
 * Safari, Edge) via pseudo-elements. Thin, sharp corners, olive thumb with
 * a transparent padding-box gutter so it reads as a "rail" not a slab.
 * ====================================================================== */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track {
  background: transparent;
  border-left: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 32px;
  min-width: 32px;
}
::-webkit-scrollbar-thumb:hover  { background: var(--accent);        background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent-bright); background-clip: padding-box; }
::-webkit-scrollbar-corner       { background: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Horizontal-overflow guard lives on <html> so it doesn't trap sticky
   children of <body> (some browsers treat overflow-x:hidden on the same
   element as the sticky's containing block, breaking sticky positioning). */
html { overflow-x: hidden; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(156,176,113,0.04), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(156,176,113,0.03), transparent 70%),
    var(--bg-base);
}

/* When the chat screen is active, lock the page to viewport height so the
   transcript scrolls inside chat__viewport — not the whole document.
   Falls back gracefully on browsers without :has() (the chat stays
   usable; you just get a single document scroll instead of the
   inner-scroll). */
body:has(#screen-chat:not([hidden])) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

button { font-family: inherit; }
kbd, code { font-family: var(--font-mono); }

.scanlines {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 2px,
    rgba(180, 200, 160, 0.013) 2px, rgba(180, 200, 160, 0.013) 3px
  );
}
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* CLASSIFICATION BANNER */
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  color: var(--text-invert);
  background: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
  user-select: none;
  z-index: 2;
  position: relative;
}
.banner--top    { border-bottom: 1px solid var(--accent-dim); }
.banner--bottom { border-top:    1px solid var(--accent-dim); }
.banner--beta {
  background: var(--status-caution);
  border-bottom: 1px solid #A87729;
  color: #1A0F02;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 100;
}
.banner--beta .banner__side { letter-spacing: 0.28em; }
.banner__title  { font-weight: 700; letter-spacing: 0.22em; }
.banner__full   { display: inline; }
.banner__short  { display: none; }
@media (max-width: 640px) {
  .banner { font-size: 9px; padding: 5px 10px; gap: 8px; }
  .banner__side { display: none; }
}
@media (max-width: 540px) {
  .banner__full  { display: none; }
  .banner__short { display: inline; }
  .banner { font-size: 9px; letter-spacing: 0; }
  .banner__title { letter-spacing: 0.18em; }
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.screen { flex: 1; display: flex; flex-direction: column; }
.screen[hidden] { display: none !important; }

/* =============================================================
 *  SETUP SCREEN
 *  ============================================================= */
.screen--setup {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 44px 32px 60px;
}
@media (max-width: 540px) {
  .screen--setup { padding: 28px 16px 44px; }
}
@media (max-width: 400px) {
  .screen--setup { padding: 22px 12px 36px; }
  .field__body   { padding: 18px 14px 22px; }
}

/* BRAND WORDMARK (setup screen) */
.brandmark {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 36px;
  user-select: none;
}
.brandmark__row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.brandmark__glyph {
  width: 5px;
  background: var(--accent);
  align-self: stretch;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(156, 176, 113, 0.35);
}
.brandmark__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: 0.04em;
  line-height: 1.0;
  color: var(--text-primary);
  text-transform: uppercase;
}
.brandmark__dot {
  color: var(--accent);
  margin: 0 0.04em;
}
.brandmark__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  text-transform: uppercase;
  padding-left: 19px;
}
@media (max-width: 540px) {
  .brandmark { margin-bottom: 28px; gap: 6px; }
  .brandmark__sub { font-size: 9px; letter-spacing: 0.22em; }
}

.setup__header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 32px;
  margin-bottom: 40px;
}

.setup__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 20px;
  text-transform: uppercase;
}
.meta__label { color: var(--text-faint); }
.meta__value { color: var(--text-secondary); font-weight: 500; }
.meta__sep   { color: var(--text-faint); }

.setup__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 6vw, 68px);
  line-height: 0.94;
  letter-spacing: 0.015em;
  margin: 0;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .setup__title { gap: 14px; font-size: 30px; }
  .setup__header { padding-bottom: 24px; margin-bottom: 28px; }
}
.setup__title-prefix {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  align-self: flex-start;
  padding-top: 10px;
}

.setup__desc {
  margin: 22px 0 0;
  max-width: 64ch;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.75;
}

.setup__grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.4fr);
  gap: 28px;
}
@media (max-width: 880px) {
  .setup__grid { grid-template-columns: 1fr; gap: 22px; }
}

/* FIELDSET FRAME WITH CORNER BRACKETS */
.field {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 0;
  margin: 0;
  position: relative;
  --bracket-color: var(--border-bright);
  --bracket-size: 12px;
}
.field::before,
.field::after,
.field > .field__body::before,
.field > .field__body::after {
  content: '';
  position: absolute;
  width: var(--bracket-size);
  height: var(--bracket-size);
  pointer-events: none;
}
.field::before { top: -1px; left: -1px;  border-top: 2px solid var(--bracket-color); border-left:  2px solid var(--bracket-color); }
.field::after  { top: -1px; right: -1px; border-top: 2px solid var(--bracket-color); border-right: 2px solid var(--bracket-color); }
.field > .field__body::before { bottom: -1px; left: -1px;  border-bottom: 2px solid var(--bracket-color); border-left:  2px solid var(--bracket-color); }
.field > .field__body::after  { bottom: -1px; right: -1px; border-bottom: 2px solid var(--bracket-color); border-right: 2px solid var(--bracket-color); }

.field__body {
  padding: 22px 22px 26px;
  position: relative;
}

.field__legend {
  display: table;
  padding: 0 10px;
  margin: 0 14px;
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field__hint {
  margin: 0 0 14px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 500;
  border-left: 2px solid var(--accent-dim);
  background: rgba(156, 176, 113, 0.04);
}
.field__hint strong { color: var(--accent-bright); font-weight: 700; }
.legend__index { color: var(--accent); margin-right: 8px; }
.legend__label { color: var(--text-primary); }

/* TM PICKER */
.tm-options {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.tm-option {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--border-subtle);
  background: transparent;
  position: relative;
  transition: background 0.12s, border-color 0.12s;
}
.tm-option + .tm-option { border-top: 0; }
.tm-option[data-pressed="true"] {
  border-color: var(--accent);
  background: rgba(156, 176, 113, 0.06);
  z-index: 1;
}
/* For any row other than the first, our collapse rule above removes the
   top border. When such a row is selected, restore the top edge in accent
   and pull the row up 1px so it overlaps the previous row's bottom border
   (otherwise both a gray line and an olive line would stack visually). */
.tm-option + .tm-option[data-pressed="true"] {
  border-top: 1px solid var(--accent);
  margin-top: -1px;
}
.tm-option[data-pressed="true"]::before {
  content: '▸';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 14px;
}
.tm-option__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tm-option__main:hover { background: var(--bg-elevated); }
.tm-option__main:focus-visible {
  outline: none;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.tm-option__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.tm-option__name {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  word-break: break-all;
}
.tm-option__equipment {
  font-size: 11.5px;
  color: var(--accent-bright);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tm-option__count {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}
.tm-option__index {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  flex-shrink: 0;
}
.tm-option[data-pressed="true"] .tm-option__index { color: var(--accent); }

.tm-option__preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tm-option__preview:hover {
  color: var(--accent-bright);
  background: rgba(156, 176, 113, 0.08);
  border-left-color: var(--border-default);
}
.tm-option__preview:focus-visible {
  outline: none;
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (max-width: 400px) {
  .tm-option__preview { padding: 0 10px; font-size: 9px; }
  .tm-option__preview-label { display: none; }
}

.tm-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  border: 1px dashed var(--border-default);
  letter-spacing: 0.05em;
}
.tm-empty code {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--accent-bright);
  border: 1px solid var(--border-default);
}
.tm-empty strong {
  display: block;
  color: var(--text-primary);
  letter-spacing: 0.22em;
  margin-bottom: 6px;
  font-size: 11px;
}

/* LOADING DOTS */
.loading-state {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 4px;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.loading-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  animation: blink 1.4s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
.loading-text { margin-left: 6px; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.45; }
  40% { opacity: 0.95; }
}

/* INTERVAL GRID */
.interval-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.interval-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 14px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  min-height: 96px;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
  user-select: none;
}
.interval-tile:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.interval-tile:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(156,176,113,0.25);
}
.interval-tile[aria-pressed="true"] {
  background: var(--accent);
  color: var(--text-invert);
  border-color: var(--accent);
}
.interval-tile[aria-pressed="true"] .tile__code,
.interval-tile[aria-pressed="true"] .tile__label,
.interval-tile[aria-pressed="true"] .tile__index { color: var(--text-invert); }

/* Intervals the selected TM doesn't cover — visible but visibly inert. */
.interval-tile--unavailable {
  opacity: 0.30;
  cursor: not-allowed;
  background: var(--bg-base) !important;
  border-color: var(--border-subtle) !important;
  border-style: dashed;
  color: var(--text-dim) !important;
  position: relative;
}
.interval-tile--unavailable:hover {
  background: var(--bg-base) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-dim) !important;
}
.interval-tile--unavailable .tile__code,
.interval-tile--unavailable .tile__label,
.interval-tile--unavailable .tile__index { color: var(--text-dim) !important; }
.interval-tile--unavailable::after {
  content: 'N/A';
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.tile__code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.tile__label {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}
.interval-tile:hover .tile__label { color: var(--text-primary); }
.tile__index {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}
@media (max-width: 540px) {
  .interval-grid { gap: 8px; }
  .interval-tile { min-height: 80px; padding: 12px 10px 10px; }
  .tile__code   { font-size: 22px; }
}
@media (max-width: 400px) {
  .interval-grid { gap: 6px; }
  .interval-tile { min-height: 70px; padding: 10px 8px 8px; gap: 4px; }
  .tile__code   { font-size: 19px; }
  .tile__label  { font-size: 9px; letter-spacing: 0.08em; }
  .tile__index  { font-size: 8px; top: 5px; right: 6px; }
}

/* SETUP FOOTER */
.setup__footer {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.setup__status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.status-pip {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-pip[data-state="ready"] {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(156, 176, 113, 0.18);
}

/* BUTTONS */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
  outline: none;
  user-select: none;
}
.btn:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.btn .bracket {
  position: absolute;
  width: 7px; height: 7px;
  border-color: currentColor;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.btn:hover:not(:disabled) .bracket,
.btn:focus-visible:not(:disabled) .bracket { opacity: 1; }
.bracket--tl { top: -2px;    left: -2px;  border-top:    1.5px solid; border-left:   1.5px solid; }
.bracket--tr { top: -2px;    right: -2px; border-top:    1.5px solid; border-right:  1.5px solid; }
.bracket--bl { bottom: -2px; left: -2px;  border-bottom: 1.5px solid; border-left:   1.5px solid; }
.bracket--br { bottom: -2px; right: -2px; border-bottom: 1.5px solid; border-right:  1.5px solid; }

.btn:disabled { opacity: 0.40; cursor: not-allowed; }
.btn__icon { font-size: 10px; line-height: 1; }

.btn--primary {
  background: var(--accent);
  color: var(--text-invert);
  border-color: var(--accent);
  font-weight: 700;
  padding: 14px 30px;
}
.btn--primary:hover:not(:disabled) { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn--primary:active:not(:disabled) { transform: translateY(1px); }
.btn--primary .bracket { opacity: 1; border-color: rgba(10, 15, 13, 0.55); }

/* =============================================================
 *  PROJECT TIMELINE
 *  ============================================================= */
.timeline-sec {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px dashed var(--border-subtle);
}
.timeline-sec__lede {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  max-width: 60ch;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* Vertical connector behind the bullets (110px col + 12px gap + half of
   the 22px bullet col ≈ 133px center). */
.timeline::before {
  content: '';
  position: absolute;
  left: 133px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--border-default);
  z-index: 0;
}
.timeline__row {
  display: grid;
  grid-template-columns: 110px 22px 1fr;
  align-items: baseline;
  column-gap: 12px;
  padding: 9px 0;
  position: relative;
}
.timeline__date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.20em;
  color: var(--text-secondary);
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}
.timeline__bullet {
  text-align: center;
  color: var(--accent-dim);
  font-size: 14px;
  line-height: 1;
  background: var(--bg-base);
  padding: 2px 0;
  z-index: 1;
  position: relative;
}
/* Inside the brief modal the parent surface is bg-surface, so the bullet
   needs a matching mask color to cleanly break the connector line. */
.brief-modal__body .timeline::before { background: var(--border-default); }
.brief-modal__body .timeline__bullet { background: var(--bg-surface); }
.brief-modal__body .timeline { margin-top: 6px; }

/* Roadmap divider — separates committed past from speculative future. */
.timeline-future-head {
  margin: 30px 0 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--border-default);
  border-bottom: 1px dashed var(--border-default);
  text-align: center;
}
.timeline-future-head__label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}
.timeline-future-lede {
  margin: 0 0 18px !important;
  color: var(--text-secondary) !important;
  font-size: 12.5px !important;
  font-style: italic;
}

/* Future items: dimmer to read as deliberately tentative. */
.timeline--future { margin-top: 0; }
.timeline--future .timeline__date {
  color: var(--text-faint);
  font-weight: 400;
  letter-spacing: 0.1em;
}
.timeline--future .timeline__bullet {
  color: var(--text-dim);
  font-size: 13px;
}
.timeline--future .timeline__text {
  color: var(--text-secondary);
}
.brief-modal__body .timeline--future::before { background: var(--border-subtle); }
.timeline__text {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
}
.timeline__row[data-tone="start"] .timeline__bullet,
.timeline__row[data-tone="end"]   .timeline__bullet {
  color: var(--accent-bright);
  font-size: 16px;
}
.timeline__row[data-tone="start"] .timeline__date,
.timeline__row[data-tone="end"]   .timeline__date {
  color: var(--accent-bright);
  font-weight: 700;
}
.timeline__row[data-tone="start"] .timeline__text,
.timeline__row[data-tone="end"]   .timeline__text {
  font-weight: 500;
}

@media (max-width: 640px) {
  .timeline-sec { margin-top: 40px; padding-top: 26px; }
  .timeline { padding-left: 18px; border-left: 2px solid var(--border-default); margin-left: 4px; }
  .timeline::before { display: none; }
  .timeline__row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }
  .timeline__date {
    text-align: left;
    color: var(--accent-bright);
    font-size: 10.5px;
  }
  .timeline__bullet {
    display: inline-block;
    position: absolute;
    left: -27px;
    top: 14px;
    width: 16px;
    height: 16px;
    background: var(--bg-base);
    font-size: 12px;
  }
  .timeline__row[data-tone="start"] .timeline__bullet,
  .timeline__row[data-tone="end"]   .timeline__bullet { font-size: 14px; }
}

/* =============================================================
 *  ABOUT / OPERATOR INTEL
 *  ============================================================= */
.about {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px dashed var(--border-subtle);
}
.about__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.about__index {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.about__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3.5vw, 32px);
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  gap: 32px;
  align-items: start;
}
@media (max-width: 760px) {
  .about__grid { grid-template-columns: 1fr; gap: 22px; }
}

.intel-card {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  position: relative;
}
.intel-card::before,
.intel-card::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  pointer-events: none;
  border-color: var(--border-bright);
}
.intel-card::before { top: -1px;    left: -1px;  border-top:    2px solid; border-left:   2px solid; }
.intel-card::after  { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right:  2px solid; }

.intel-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px dashed var(--border-subtle);
}
.intel-row:last-child { border-bottom: 0; }
.intel-row__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0;
}
.intel-row__val {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  word-break: break-word;
  line-height: 1.45;
}
@media (max-width: 400px) {
  .intel-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 14px; }
  .intel-row__key { font-size: 9px; }
}

.intel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.12s, border-color 0.12s;
  word-break: break-all;
}
.intel-link:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}
.intel-link:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 0 var(--accent);
}
.intel-link__ext {
  font-size: 11px;
  color: var(--accent);
  transition: transform 0.12s;
}
.intel-link:hover .intel-link__ext { transform: translate(2px, -2px); }

.about__body {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.about__body p { margin: 0; }
.about__body strong { color: var(--accent-bright); font-weight: 700; }
.about__cta {
  margin-top: 4px !important;
}
.about__cta--row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.about__cta .intel-link { font-weight: 600; }

/* CONCEPT BRIEF CTA — proper button, not just a link */
.brief-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s, transform 0.08s;
  outline: none;
  user-select: none;
}
.brief-cta:hover {
  background: var(--accent);
  color: var(--text-invert);
  border-color: var(--accent-bright);
}
.brief-cta:active { transform: translateY(1px); }
.brief-cta:focus-visible {
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(156, 176, 113, 0.25);
}
.brief-cta__icon { font-size: 13px; line-height: 1; }
.brief-cta__label { letter-spacing: 0.22em; }
.brief-cta__arrow {
  font-size: 11px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.brief-cta:hover .brief-cta__arrow { transform: translateX(4px); }
.brief-cta .bracket {
  position: absolute;
  width: 8px; height: 8px;
  border-color: var(--accent);
  pointer-events: none;
  opacity: 1;
}
.brief-cta:hover .bracket { border-color: var(--text-invert); }
@media (max-width: 540px) {
  .brief-cta { padding: 10px 16px; font-size: 10.5px; gap: 10px; }
}

/* CONCEPT BRIEF MODAL — document reader, calm typography */
.brief-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

/* Hard scroll-lock while modal is open. Locks both html and body since
   mobile Chrome on Android sometimes bypasses an overflow-hidden on
   just body and scrolls the document anyway. The modal's own body
   keeps touch-action: auto so the operator can still scroll inside it. */
html.has-modal,
body.has-modal {
  overflow: hidden !important;
  overscroll-behavior: contain;
}
.brief-modal__body { touch-action: pan-y; }
.brief-modal[hidden] { display: none !important; }
.brief-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 3, 0.78);
  cursor: pointer;
  animation: fade-bg 0.18s ease-out;
}
.brief-modal__panel {
  position: relative;
  width: 100%;
  max-width: 880px;
  /* Constrain to viewport so the body can scroll inside the panel
     instead of dragging the document. dvh handles mobile chrome. */
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
  animation: brief-in 0.22s ease-out;
  /* Both axes hidden — the inner body owns the y scroll. Without this,
     setting only overflow-x clips x and IMPLICITLY makes y `auto`,
     creating a phantom second scrollbar on top of the body's scroll. */
  overflow: hidden;
}
@keyframes brief-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
/* Subtle corner brackets — frame the panel without screaming. */
.brief-modal__panel::before,
.brief-modal__panel::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--border-bright);
  pointer-events: none;
}
.brief-modal__panel::before { top: -1px; left: -1px;  border-top: 2px solid; border-left:  2px solid; }
.brief-modal__panel::after  { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.brief-modal__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
  flex-shrink: 0;
}
.brief-modal__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brief-modal__label { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.brief-modal__sep   { color: var(--text-faint); }

.brief-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 28px 32px 36px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.78;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 540px) {
  .brief-modal__body { padding: 20px 18px 28px; font-size: 13px; }
  .brief-modal { padding: 16px 12px; }
}

.brief-modal__loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  justify-content: center;
  padding: 40px 0;
}

/* ===== Body typography — calm dark theme ===== */
.brief__h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 2.2vw, 22px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 28px 0 10px;
  padding-left: 14px;
  border-left: 2px solid var(--accent-dim);
  line-height: 1.25;
}
.brief__h:first-child { margin-top: 0; }
.brief__p {
  margin: 0 0 14px;
  color: var(--text-primary);
}
.brief__p a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-dim);
  transition: color 0.12s, border-color 0.12s;
}
.brief__p a:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}
.brief__list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.brief__list li {
  position: relative;
  padding: 4px 0 4px 22px;
  color: var(--text-primary);
}
.brief__list li::before {
  content: '·';
  position: absolute;
  left: 8px;
  top: 3px;
  color: var(--accent-dim);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

/* =============================================================
 *  CHAT SCREEN
 *  ============================================================= */
.screen--chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-base);
}

.chat__bar {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.bar__col { min-width: 0; }
.bar__label {
  font-size: 8.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1px;
  line-height: 1.2;
}
.bar__value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar__sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
  margin-top: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar__sub:empty { display: none; }
.session-pulse {
  width: 7px; height: 7px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(156, 176, 113, 0.15);
  flex-shrink: 0;
}
.bar__actions {
  display: inline-flex;
  gap: 6px;
}
.bar__btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.bar__btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: rgba(156, 176, 113, 0.06);
}
@media (max-width: 540px) {
  .bar__btn { padding: 8px 10px; font-size: 9px; letter-spacing: 0.18em; }
}
@media (max-width: 760px) {
  .chat__bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'tm interval' 'session actions';
    padding: 12px 14px;
    gap: 12px;
  }
  .bar__col--tm       { grid-area: tm; }
  .bar__col--interval { grid-area: interval; }
  .bar__col--session  { grid-area: session; }
  .bar__actions       { grid-area: actions; justify-self: end; align-self: end; }
}

.chat__viewport {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background:
    linear-gradient(180deg, var(--bg-base) 0%, var(--bg-base) 100%);
  transition: box-shadow 0.6s ease-out;
}
.chat__viewport.deadline-flash {
  box-shadow: inset 0 0 0 3px var(--status-deadline-soft);
}

.transcript {
  width: 100%;
  max-width: var(--chat-max);
  padding: 28px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
@media (max-width: 540px) {
  .transcript { padding: 18px 14px 80px; gap: 20px; }
}

/* BRIEFING */
.briefing {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.briefing__heading {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.briefing__heading .glyph { color: var(--accent-bright); }
.briefing__body { line-height: 1.75; }
.briefing__body strong { color: var(--text-primary); }

/* OPERATOR MESSAGE */
.msg-op {
  align-self: flex-end;
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.msg-op__meta {
  display: flex;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.msg-op__role { color: var(--accent); }
.msg-op__body {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-right: 3px solid var(--accent);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}

/* ASSISTANT MESSAGE — looks like a printed report */
.msg-as {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0;
  margin: 0;
}
.msg-as::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-bright);
}
.msg-as[data-status="deadline"]::before        { background: var(--status-deadline); }
.msg-as[data-status="not_deadline"]::before    { background: var(--status-capable); }
.msg-as[data-status="needs_attention"]::before { background: var(--status-caution); }
.msg-as[data-status="info"]::before            { background: var(--status-info); }

.msg-as__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px 14px;
  border-bottom: 1px dashed var(--border-subtle);
  flex-wrap: wrap;
}
.msg-as__meta {
  display: flex;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  align-items: center;
}
.msg-as__meta-label { color: var(--text-faint); }
.msg-as__meta-value { color: var(--text-secondary); }

/* STATUS CHIP — focal point of every report */
.status-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  background: var(--bg-base);
  border: 1.5px solid currentColor;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--status-info);
  user-select: none;
}
.status-chip::before,
.status-chip::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  border-color: currentColor;
}
.status-chip::before { top: -3px;    left: -3px;  border-top:    2px solid; border-left:   2px solid; }
.status-chip::after  { bottom: -3px; right: -3px; border-bottom: 2px solid; border-right:  2px solid; }
.status-chip__dot { width: 7px; height: 7px; background: currentColor; }
.status-chip[data-status="deadline"]        { color: var(--status-deadline); background: var(--status-deadline-soft); box-shadow: 0 0 0 2px rgba(225, 85, 84, 0.10); }
.status-chip[data-status="not_deadline"]    { color: var(--status-capable); background: var(--status-capable-soft); }
.status-chip[data-status="needs_attention"] { color: var(--status-caution); background: var(--status-caution-soft); }
.status-chip[data-status="info"]            { color: var(--status-info); background: var(--status-info-soft); }

/* ANSWER BODY */
.msg-as__body {
  padding: 22px 22px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-primary);
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-as__body strong          { font-weight: 700; color: var(--accent-bright); }
.msg-as__body .marker--warning { color: var(--status-deadline-bright); font-weight: 700; letter-spacing: 0.06em; }
.msg-as__body .marker--caution { color: var(--status-caution); font-weight: 700; letter-spacing: 0.06em; }
.msg-as__body .marker--note    { color: var(--accent-bright); font-weight: 700; letter-spacing: 0.06em; }

/* NMC CRITERION CALLOUT */
.nmc-callout {
  margin: 0 22px 18px;
  padding: 14px 16px 16px;
  background: var(--status-deadline-soft);
  border: 1px solid var(--status-deadline);
  border-left: 3px solid var(--status-deadline);
  position: relative;
}
.nmc-callout::before,
.nmc-callout::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border-color: var(--status-deadline);
}
.nmc-callout::before { top: -3px;    left: -3px;  border-top:    2px solid; border-left:   2px solid; }
.nmc-callout::after  { bottom: -3px; right: -3px; border-bottom: 2px solid; border-right:  2px solid; }
.nmc-callout__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--status-deadline);
  margin-bottom: 8px;
}
.nmc-callout__icon { font-size: 13px; }
.nmc-callout__text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
}

/* CITED CHIPS */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 22px 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.chip__key { color: var(--text-secondary); font-weight: 500; }
.chip__val { color: var(--text-primary); font-weight: 700; }

/* CHIP AS LINK — clickable, button-like */
a.chip {
  text-decoration: none;
  cursor: pointer;
  padding: 5px 12px;
  background: rgba(156, 176, 113, 0.08);
  border-color: rgba(156, 176, 113, 0.45);
  transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.08s;
  position: relative;
}
a.chip .chip__val { color: var(--accent-bright); }
a.chip:hover {
  border-color: var(--accent);
  background: rgba(156, 176, 113, 0.18);
}
a.chip:active { transform: translateY(1px); }
a.chip:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(156, 176, 113, 0.30);
}
.chip__ext {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-left: 4px;
  transition: color 0.12s, transform 0.12s;
}
a.chip:hover .chip__ext { color: var(--accent-bright); transform: translate(1px, -1px); }

/* FLAG-AS-INCORRECT BLOCK ============================================ */
.flag-block {
  border-top: 1px dashed var(--border-subtle);
  padding: 8px 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flag-block__trigger {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.flag-block__trigger:hover {
  color: var(--status-caution);
  border-color: var(--status-caution);
  background: var(--status-caution-soft);
}
.flag-block__glyph { font-size: 12px; color: var(--status-caution); }

.flag-block__label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--status-caution);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flag-block__input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  min-height: 56px;
  max-height: 180px;
  outline: none;
  transition: border-color 0.12s;
}
.flag-block__input:focus { border-color: var(--status-caution); background: var(--bg-base); }
.flag-block__input::placeholder { color: var(--text-dim); }
.flag-block__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.flag-block__submit,
.flag-block__cancel {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.flag-block__submit {
  background: var(--status-caution);
  color: var(--text-invert);
  border-color: var(--status-caution);
}
.flag-block__submit:hover:not(:disabled) {
  background: #F0AE5C;
  border-color: #F0AE5C;
}
.flag-block__submit:disabled { opacity: 0.6; cursor: not-allowed; }
.flag-block__cancel:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.flag-block__err {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--status-deadline);
  background: var(--status-deadline-soft);
  border: 1px solid var(--status-deadline);
  padding: 6px 10px;
}
.flag-block--flagged { padding-top: 6px; padding-bottom: 8px; }
.flag-block__done {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--status-caution);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* CITATIONS LIST (collapsible accordion) */
.citations {
  border-top: 1px dashed var(--border-subtle);
  background: rgba(0, 0, 0, 0.18);
}
.citations__heading {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.28em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 0.12s, background 0.12s;
}
.citations__heading::-webkit-details-marker,
.citations__heading::marker { display: none; }
.citations__heading:hover { color: var(--accent-bright); background: rgba(156, 176, 113, 0.04); }
.citations__heading:focus-visible {
  outline: none;
  color: var(--accent-bright);
  background: rgba(156, 176, 113, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.citations__chev {
  color: var(--accent);
  font-size: 10px;
  transition: transform 0.18s ease;
  display: inline-block;
  width: 10px;
}
.citations[open] .citations__chev { transform: rotate(90deg); }

.citations__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  margin-left: auto;
}

.citations__body {
  padding: 4px 22px 16px;
  animation: fade-up 0.18s ease-out;
}

.citations__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.citation {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: baseline;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.citation__idx {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}
.citation__text { word-break: break-word; }

/* CITATION AS LINK — visibly interactive at rest */
.citation__link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-dim);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  cursor: pointer;
  padding-bottom: 1px;
}
.citation__link:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
  border-bottom-style: solid;
}
.citation__link:focus-visible {
  outline: none;
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}
.citation__ext {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  transform: translateY(-1px);
  transition: color 0.12s, transform 0.12s;
}
.citation__link:hover .citation__ext { color: var(--accent-bright); transform: translate(2px, -3px); }

/* SYSTEM / ERROR MESSAGES */
.msg-sys {
  align-self: stretch;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-subtle);
  border-bottom: 1px dashed var(--border-subtle);
  padding: 12px 0;
}
.msg-sys--error {
  color: var(--status-deadline);
  border-color: var(--status-deadline);
  background: var(--status-deadline-soft);
}
.msg-sys__retry {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-left: 10px;
  font-weight: 700;
}
.msg-sys__retry:hover { color: var(--accent-bright); }

/* TRANSMITTING INDICATOR */
.msg-transmit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px dashed var(--border-default);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.transmit-dots { display: inline-flex; gap: 4px; }
.transmit-dots .dot {
  width: 5px; height: 5px;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}
.transmit-dots .dot:nth-child(2) { animation-delay: 0.25s; }
.transmit-dots .dot:nth-child(3) { animation-delay: 0.50s; }

/* COMPOSER */
.chat__compose {
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.compose__inner {
  max-width: var(--chat-max);
  margin: 0 auto;
  padding: 8px 22px 10px;
}

.compose__disclaimer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  line-height: 1.45;
  color: var(--text-secondary);
}
.compose__disclaimer-icon {
  color: var(--text-secondary);
  font-size: 11.5px;
  flex-shrink: 0;
  line-height: 1;
}
@media (max-width: 540px) {
  .compose__disclaimer { font-size: 10.5px; gap: 5px; }
}
.compose__label-index { color: var(--accent); font-weight: 700; }
.compose__textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  padding: 8px 12px;
  resize: vertical;
  min-height: 40px;
  max-height: 160px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.compose__textarea:focus {
  border-color: var(--accent);
  background: var(--bg-base);
}
.compose__textarea::placeholder { color: var(--text-dim); }

.compose__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.compose__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.compose__hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.btn--send {
  background: var(--accent);
  color: var(--text-invert);
  border-color: var(--accent);
  padding: 7px 18px;
  font-size: 11px;
  letter-spacing: 0.20em;
}
.btn--send:hover:not(:disabled)  { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn--send .bracket              { opacity: 1; border-color: rgba(10, 15, 13, 0.55); }
.btn--send[data-state="sending"] {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--send[data-state="sending"] .bracket { border-color: var(--accent); }

@media (max-width: 540px) {
  .compose__inner { padding: 12px 14px 14px; }
  .compose__textarea { font-size: 16px; }   /* avoid iOS zoom on focus */
  .compose__hint { display: none; }
}

/* ENTRANCE ANIMATIONS */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen--setup > *      { animation: fade-up 0.5s ease-out both; }
.screen--setup > *:nth-child(1) { animation-delay: 0.02s; }
.screen--setup > *:nth-child(2) { animation-delay: 0.12s; }
.screen--setup > *:nth-child(3) { animation-delay: 0.22s; }
.screen--setup > *:nth-child(4) { animation-delay: 0.32s; }
.screen--setup > *:nth-child(5) { animation-delay: 0.42s; }
.screen--enter           { animation: fade-up 0.35s ease-out both; }
.msg-op, .msg-as, .msg-sys, .msg-transmit, .briefing { animation: fade-up 0.32s ease-out both; }

/* =============================================================
 *  PDF REFERENCE DRAWER
 *  ============================================================= */
.pdf-drawer {
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.pdf-drawer[hidden] { display: none !important; }

.pdf-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 5, 0.62);
  cursor: pointer;
  animation: fade-bg 0.18s ease-out;
}
@keyframes fade-bg { from { opacity: 0; } to { opacity: 1; } }

.pdf-drawer__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: clamp(360px, 52vw, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-bright);
  box-shadow: -16px 0 32px rgba(0,0,0,0.45);
  animation: drawer-in 0.22s ease-out;
}
@keyframes drawer-in {
  from { transform: translateX(100%); opacity: 0.4; }
  to   { transform: translateX(0); opacity: 1; }
}

.pdf-drawer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-base);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pdf-drawer__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-drawer__label { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.pdf-drawer__sep   { color: var(--text-faint); }

.pdf-drawer__nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pdf-drawer__navbtn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.pdf-drawer__navbtn:hover:not(:disabled) {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: rgba(156, 176, 113, 0.06);
}
.pdf-drawer__navbtn:disabled { opacity: 0.35; cursor: not-allowed; }

.pdf-drawer__pageinfo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.pdf-drawer__pageinput {
  width: 4.5ch;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  padding: 4px 6px;
  outline: none;
  -moz-appearance: textfield;
}
.pdf-drawer__pageinput::-webkit-outer-spin-button,
.pdf-drawer__pageinput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdf-drawer__pageinput:focus { border-color: var(--accent); }
.pdf-drawer__pageslash { color: var(--text-faint); }
.pdf-drawer__pagetotal { color: var(--text-primary); font-weight: 600; }

.pdf-drawer__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.pdf-drawer__btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.pdf-drawer__btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: rgba(156, 176, 113, 0.06);
}
.pdf-drawer__close:hover {
  color: var(--status-deadline-bright);
  border-color: var(--status-deadline);
  background: var(--status-deadline-soft);
}
@media (max-width: 540px) {
  .pdf-drawer__btn-label { display: none; }
  .pdf-drawer__btn       { padding: 6px 9px; font-size: 14px; }
}

.pdf-drawer__imgwrap {
  flex: 1;
  width: 100%;
  background: #1a1d1c;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.pdf-drawer__img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}
.pdf-drawer__img:not([src]),
.pdf-drawer__img[src=""] { display: none; }

.pdf-drawer__loading,
.pdf-drawer__error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: rgba(14, 19, 17, 0.94);
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 24px;
  text-align: center;
}
.pdf-drawer__loading[hidden],
.pdf-drawer__error[hidden] { display: none; }
.pdf-drawer__loading .loading-dot { width: 7px; height: 7px; }
.pdf-drawer__error-title {
  color: var(--status-deadline);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: 12px;
}
.pdf-drawer__error-msg {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.18em;
  max-width: 40ch;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .pdf-drawer__panel { width: 100%; }
}

/* RESPECT REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
