/* =========================================================
   Sqipp v2 — Cofounder design tokens
   Drop-in for static/workspace/workspace.css

   PALETTE-CORRECTION 2026-05-25 evening: Claude Design's original
   forest-green primary was a brief-error on my part — the actual
   Sqipp brand is periwinkle/indigo #6C6CFF per
   webapp/static/agent/design-tokens.css. Values below now match
   the canonical Sqipp brand. The --forest-* variable names are
   kept as legacy aliases pointing at --primary-* so the 12 .jsx
   files render correctly without JSX edits. During JSX → Jinja
   translation in Phase 1 Section 7, rename forest-* → primary-*.

   Typography swap: Montserrat + Inter + JetBrains Mono (per
   webapp/static/agent/design-tokens.css), NOT Source Serif 4 +
   IBM Plex Sans + IBM Plex Mono.
   ========================================================= */

:root {
  /* Surfaces (parch family matches webapp --bg = #faf8f3) */
  --parch-50:  #FAF8F3;   /* page background — webapp canonical */
  --parch-100: #F3EFE3;   /* hover band */
  --parch-200: #E9E2CE;   /* divider on parch */
  --parch-border: #E5DDC9;
  --surface:   #FFFFFF;
  --surface-elev: #FDFCF8;

  /* Sqipp primary — inherited from _shared/design-tokens.css:
     --primary-900/700/500/300/100/50 all match the shared values exactly.
     Defined here in _shared; workspace.css does not repeat them. */

  /* Legacy aliases (forest-* names retained for JSX compatibility;
     rename to primary-* during JSX → Jinja translation pass) */
  --forest-900: var(--primary-900);
  --forest-700: var(--primary-700);
  --forest-500: var(--primary-500);
  --forest-300: var(--primary-300);
  --forest-100: var(--primary-100);
  --forest-50:  var(--primary-50);

  /* Ink */
  --ink-900: #1F1A0F;
  --ink-700: #3D362A;
  --ink-500: #6F6850;
  --ink-400: #8E876D;
  --ink-300: #B5AE94;

  /* Status (initiative/spec/cycle state colors) — inherited from
     _shared/design-tokens.css: --rust/-50, --slate/-50, --gold/-50,
     --mauve/-50 all hold the canonical workspace values there now.
     Distinct from agent.css --added/--removed/--warning/--review
     (diff-coloring tokens). */

  /* Type — Sqipp brand: Montserrat (headings) + Inter (body) + JetBrains Mono
     (per webapp/static/agent/design-tokens.css and sqipp-website brand).
     --mono inherited from _shared/design-tokens.css (exact match). */
  --serif: 'Montserrat', -apple-system, ui-sans-serif, system-ui, sans-serif;  /* slot name "serif" is legacy; value is Montserrat */
  --sans:  'Inter', -apple-system, ui-sans-serif, system-ui, sans-serif;

  /* Radius scale — inherited from _shared/design-tokens.css:
     --r-2/4/6/8/12/pill all match the shared values exactly. */

  /* Shadow */
  --shadow-card: 0 1px 0 rgba(31,26,15,.03), 0 0 0 1px var(--parch-border);
  --shadow-pop:  0 8px 28px -8px rgba(31,26,15,.18), 0 0 0 1px var(--parch-border);
  /* --shadow-focus: inherited from _shared/design-tokens.css (exact match) */

  /* Shared option-card / dialog token aliases. _shared/options.css (and the
     apply dialog) reference agent-surface token NAMES; /agent defines them in
     agent-aliases.css. Define them here with workspace values so the shared
     option cards + dialog render correctly on /workspace. workspace.css is
     never loaded on /agent, so these stay surface-scoped (no leak). */
  --bg-card: var(--surface);
  --bg-subtle: var(--surface-elev);
  --border: var(--parch-border);
  --font-heading: var(--serif);
  --primary: var(--primary-700);
  --primary-soft: var(--primary-50);
  --radius-md: var(--r-8);
  --text: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --text-soft: var(--ink-300);

  /* Agent component-CSS token gaps (auth.css etc.) consumed by migrated /agent
     surfaces; aliased to workspace values for the M1 chrome standardization. */
  --border-strong: var(--ink-300);
  --font-body: var(--sans);
  --primary-dark: var(--primary-900);
  --radius-sm: var(--r-6);
  --removed: var(--rust);
  --shadow-soft: var(--shadow-card);

  /* Diff/gauge tokens consumed by the shared _shared/gauges.css on the
     workspace replan result (M1 chunk 5a – output_view parity). Surface-scoped
     (workspace.css is never loaded on /agent, so zero leak). --added/--review
     mirror the agent diff palette so the gauge legend reads identically across
     surfaces; --radius-lg / --font-mono fill the last two gauge token gaps. */
  --added:  #22a06b;
  --review: #c7e3a1;
  --radius-lg: var(--r-8);
  --font-mono: var(--mono);
}

/* Generic workspace form/banner error primitive (used by migrated surfaces). */
.form-error, .banner-error {
  border-left: 2px solid var(--rust);
  background: var(--rust-50);
  color: var(--rust);
  padding: 12px 16px;
  border-radius: var(--r-6);
  font-size: 13px;
}

/* ---------------- Reset-ish ---------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--parch-50);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------------- Type ---------------- */
.t-display { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.08; }
.t-title   { font-family: var(--serif); font-weight: 500; letter-spacing: -0.012em; line-height: 1.15; }
.t-mono    { font-family: var(--mono); font-feature-settings: 'zero'; }
.t-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }
.t-meta    { color: var(--ink-500); font-size: 12.5px; }
.t-num     { font-family: var(--serif); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Team status band (home) — refined, lower-bulk cycle health. A periwinkle brand
   accent on the left rail replaces the full gradient slab; compact state columns
   with tabular numbers instead of oversized hero metrics. */
.team-status {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: var(--surface, #fff);
  overflow: hidden;
  margin-bottom: 28px;
}
.team-status__cycle {
  flex: 1 1 0;
  min-width: 0;
  padding: 13px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-right: 1px solid var(--parch-100);
}
.team-status__cycle-label { color: var(--primary); }
.team-status__cycle-name {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.15;
}
.team-status__cycle-meta { font-size: 12px; color: var(--ink-500); }
.team-status__state {
  flex: 1 1 0;
  min-width: 0;
  padding: 13px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-right: 1px solid var(--parch-100);
}
.team-status__state:last-child { border-right: 0; }
.team-status__num {
  font-family: var(--serif);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  line-height: 1;
  color: var(--ink-900);
}
.team-status__state.is-done .team-status__num { color: var(--ink-400); }
.team-status__risk {
  padding: 12px 16px;
  min-width: 184px;
  background: var(--rust-50);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.team-status__risk-text { font-size: 13px; color: var(--ink-900); }
@media (max-width: 720px) {
  .team-status__cycle { width: 100%; border-right: 0; border-bottom: 1px solid var(--parch-100); }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-6);
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn .icn { width: 14px; height: 14px; }

/* Primary button — softened (2026-06-14): standalone .btn-primary buttons (no
   .btn base) get the full pill box-model; combos like .btn.btn-sm.btn-primary
   keep their .btn sizing and just inherit the look below. */
.btn-primary:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(46, 46, 171, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
}
.btn-primary:hover {
  background: var(--primary-900);
  box-shadow: 0 3px 10px -2px rgba(46, 46, 171, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(46, 46, 171, 0.2); }
.btn-primary:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }
.btn-secondary { background: transparent; color: var(--primary-700); border-color: var(--primary-700); }
.btn-secondary:hover { background: var(--primary-50); }
.btn-outline { background: transparent; border-color: var(--parch-border); color: var(--ink-900); }
.btn-outline:hover { background: var(--surface); border-color: var(--ink-300); }
.btn-ghost { color: var(--ink-700); }
.btn-ghost:hover { background: var(--parch-100); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-4); }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }

/* ---------------- Pills / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 500;
  background: var(--parch-100); color: var(--ink-700);
  border: 1px solid transparent;
  font-family: var(--sans);
  letter-spacing: 0;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-inflight { background: var(--forest-100); color: var(--forest-700); }
.pill-blocked  { background: var(--rust-50); color: var(--rust); }
.pill-planned  { background: var(--slate-50); color: var(--slate); }
.pill-shipped  { background: var(--parch-100); color: var(--ink-500); }
.pill-parked   { background: var(--parch-100); color: var(--ink-400); }
.pill-draft    { background: var(--gold-50); color: var(--gold); }
.pill-missing  { background: var(--rust-50); color: var(--rust); }
.pill-live     { background: var(--forest-100); color: var(--forest-700); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--r-8);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.card-flat { background: var(--surface); border-radius: var(--r-8); border: 1px solid var(--parch-border); }
.card-tight { padding: 14px 16px; }
.card-hover { transition: box-shadow .15s ease, transform .15s ease; cursor: pointer; }
.card-hover:hover { box-shadow: 0 2px 0 rgba(31,26,15,.04), 0 0 0 1px var(--ink-300); }

/* ---------------- Layout helpers ---------------- */
.stack { display: flex; flex-direction: column; }
.row   { display: flex; }
.between { justify-content: space-between; }
.center  { align-items: center; }
.gap-2 { gap: 4px; }
.gap-3 { gap: 6px; }
.gap-4 { gap: 8px; }
.gap-6 { gap: 12px; }
.gap-8 { gap: 16px; }
.gap-10 { gap: 20px; }
.gap-12 { gap: 24px; }

/* ---------------- Inputs ---------------- */
.input, .textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--parch-border);
  border-radius: var(--r-6);
  font-size: 14px; color: var(--ink-900);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus { outline: 0; border-color: var(--forest-500); box-shadow: var(--shadow-focus); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.label { font-size: 12px; color: var(--ink-500); margin-bottom: 6px; display: block; font-weight: 500; }

/* ---------------- Decorative ---------------- */
.divider { height: 1px; background: var(--parch-border); }
.divider-v { width: 1px; background: var(--parch-border); align-self: stretch; }

/* dotted underline for hyperlinks in body */
.link { color: var(--forest-700); border-bottom: 1px dotted currentColor; }
.link:hover { color: var(--forest-900); }

/* dot separator */
.dot-sep::before { content: "·"; margin: 0 6px; color: var(--ink-400); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--parch-200); border-radius: 4px; border: 2px solid var(--parch-50); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- App shell ---------------- */
.app {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topnav {
  height: 52px;
  background: var(--parch-50);
  border-bottom: 1px solid var(--parch-border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 18px;
  position: sticky; top: 0; z-index: 30;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-weight: 600; font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--forest-700);
  display: inline-flex; align-items: center; justify-content: center;
  color: #F1F6F2; font-family: var(--serif); font-weight: 700; font-size: 13px;
}
/* Nav-link visual is owned by _topnav.html's inline <style> block (text +
   thin purple underline, mirroring the /agent topbar tab idiom). The
   workspace.css legacy rules used to chip the active link with a
   parch-100 background — Chris flagged that as a misalignment + chip
   leak post-redesign 2026-05-26. Don't re-introduce a background here. */

.proj-switcher {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 8px 0 6px;
  border-radius: var(--r-6);
  border: 1px solid var(--parch-border);
  background: var(--surface);
  font-size: 12.5px;
}
.proj-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--forest-500); color: #F1F6F2;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono);
}

.account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 10px 0 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--parch-border);
  background: var(--surface);
  font-size: 12px; color: var(--ink-700);
}
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--forest-100); color: var(--forest-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
  font-family: var(--mono);
}

/* ---------------- Page container ---------------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  width: 100%;
}

/* ---------------- Section header ---------------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.sec-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.sec-action {
  font-size: 12px; color: var(--ink-500);
  border-bottom: 1px dotted var(--ink-400);
}
.sec-action:hover { color: var(--ink-900); border-color: var(--ink-700); }

/* ---------------- Skeleton band ---------------- */
.placeholder-band {
  background: repeating-linear-gradient(
    45deg,
    rgba(229,221,201,.55) 0 6px,
    rgba(243,239,227,.55) 6px 12px
  );
  border-radius: var(--r-8);
  border: 1px dashed var(--parch-border);
  color: var(--ink-500);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------------- Tweaks panel branding override (subtle) ---------------- */
.tweaks-panel { font-family: var(--sans) !important; }

/* ---------------- Focus overlays ---------------- */
.overlay-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,26,15,.32);
  z-index: 80;
  backdrop-filter: blur(2px);
}
.overlay-sheet {
  position: fixed;
  z-index: 81;
  background: var(--parch-50);
  box-shadow: 0 24px 80px -20px rgba(31,26,15,.4);
}

/* ---------------- Tooltip mini ---------------- */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border: 1px solid var(--parch-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--surface);
  font-family: var(--mono); font-size: 10px; color: var(--ink-500);
}

/* ---------------- Custom checkbox ---------------- */
.check {
  width: 16px; height: 16px;
  border: 1.4px solid var(--ink-300);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.check.on { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--parch-border); }
.tab {
  padding: 10px 12px;
  font-size: 13px; color: var(--ink-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink-900); }
.tab.active { color: var(--ink-900); border-color: var(--forest-700); font-weight: 500; }

/* ---------------- Progress dots ---------------- */
.progress-dots { display: inline-flex; gap: 5px; }
.progress-dots .d { width: 6px; height: 6px; border-radius: 50%; background: var(--parch-200); }
.progress-dots .d.on { background: var(--forest-700); }
.progress-dots .d.cur { background: var(--forest-700); transform: scale(1.4); }

/* ---------------- Animations ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }
.fade-up { animation: fadeUp .25s ease both; }
@keyframes pulseDot { 0%,100% { opacity: .9; } 50% { opacity: .35; } }
.pulse-dot { animation: pulseDot 1.6s ease-in-out infinite; }

/* ============================================================
   Replan result page — cycle ribbon + diagnosis risk rails
   (2026-06-14). Top-of-page summary for /workspace/outputs.
   ============================================================ */

.cycle-ribbon {
  border: 1px solid var(--parch-border);
  border-radius: var(--r-8);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.cycle-ribbon__top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cycle-ribbon__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-400);
}
.cycle-ribbon__day {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}
.cycle-ribbon__bar {
  flex: 1 1 120px;
  min-width: 80px;
  height: 5px;
  background: var(--parch-100);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.cycle-ribbon__fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-pill);
}
.cycle-ribbon__pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-500);
  white-space: nowrap;
}
.cycle-ribbon__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--parch-200);
}
.cycle-metric {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-500);
}
.cycle-metric strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  margin-right: 3px;
}
.cycle-metric--soft {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-400);
}

/* Diagnosis rails — editorial changebar: mono label + colour-coded keyline.
   Full page width (matches the option cards below). */
.risk-rails {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 28px;
}
.risk-rail {
  padding-left: 14px;
  border-left: 2px solid var(--ink-300);
}
.risk-rail__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 4px;
}
.risk-rail__body {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-700);
}
.risk-rail--changed { border-left-color: var(--ink-400); }
.risk-rail--risk { border-left-color: var(--rust); }
.risk-rail--risk .risk-rail__label { color: var(--rust); }
.risk-rail--holding { border-left-color: var(--slate); }
.risk-rail--holding .risk-rail__label { color: var(--slate); }

/* ── Replan result header — quiet back link + situation title ──────────── */
.result-back {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-400);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color var(--motion-fast);
}
.result-back:hover,
.result-back:focus-visible { color: var(--ink-700); text-decoration: underline; outline: none; }

.result-head { margin-bottom: 24px; }
.result-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  margin-bottom: 9px;
}
.result-kicker__init { color: var(--primary); }
.result-kicker__sep { color: var(--ink-300); }
.result-title {
  font-size: 27px;
  line-height: 1.16;
  margin: 0;
  color: var(--ink-900);
}

/* ── Replan intake gate (locked to Linear, 2026-06-14) ─────────────────────
   Connect / no-active-cycle states + the two-step (cycle, trigger) form. */
.replan-gate {
  max-width: 540px;
  padding: 6px 0 4px;
}
.replan-gate__eyebrow { color: var(--ink-400); margin-bottom: 14px; }
.replan-gate__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink-900);
  margin: 0 0 12px;
}
.replan-gate__sub {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-700);
  margin: 0 0 22px;
}
.replan-gate__cta { display: inline-flex; align-items: center; gap: 8px; }
.replan-gate__foot {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-400);
  margin-top: 16px;
}

/* Two-step replan form: clear vertical rhythm between cycle + trigger. */
.replan-step { margin-bottom: 18px; }
.replan-step > .t-eyebrow { color: var(--ink-400); margin-bottom: 8px; }

/* ── New-replan composer modal (2026-06-14, restyled to the dashboard) ──────
   The form uses the workspace primitives (.input / .textarea / .label, all in
   workspace.css so they load on every page) — NOT the old /agent-form classes,
   which weren't loaded on the dashboard and rendered the controls unstyled. */
.replan-modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 15, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  padding: 6vh 24px 24px;
  overflow-y: auto;
}
.replan-modal[hidden] { display: none; }
.replan-modal__card {
  background: var(--surface);
  border: 1px solid var(--parch-border);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 440px;
  padding: 20px 22px 22px;
}
.replan-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.replan-modal__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 0;
}
.replan-modal__head { align-items: flex-start; }
.replan-modal__history-link {
  display: inline-block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--primary-700, #5b21b6);
  text-decoration: none;
}
.replan-modal__history-link:hover { text-decoration: underline; }

.replan-form .label { margin-bottom: 5px; }
.replan-form .textarea { min-height: 0; font-size: 13.5px; }
.replan-form .input { font-size: 13.5px; }

.replan-hint {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.5;
  margin: 0 0 8px;
}

/* Native-select chevron replaced with a quiet workspace one. */
.replan-select-wrap { position: relative; }
.replan-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
}
.replan-select-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-400);
  border-bottom: 1.5px solid var(--ink-400);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.replan-cycle-stats {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-500);
  margin: 8px 0 0;
}
.replan-cycle-stats span { color: var(--ink-300); margin: 0 1px; }

.replan-optional {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-400);
}

/* Repo picker — compact, scrollable when an installation can see many repos. */
.replan-repo-list {
  display: flex;
  flex-direction: column;
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--parch-border);
  border-radius: var(--r-8);
  background: var(--surface);
}
.replan-repo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  cursor: pointer;
  border-bottom: 1px solid var(--parch-100);
}
.replan-repo:last-child { border-bottom: 0; }
.replan-repo:hover { background: var(--parch-50); }
.replan-repo input[type="checkbox"] { flex: none; margin: 0; accent-color: var(--ink-700); }
.replan-repo__name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.replan-repo__badge {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-400);
  background: var(--parch-100);
  border-radius: var(--r-6);
  padding: 1px 6px;
  margin-left: auto;
  flex: none;
}

.replan-modal__actions {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--parch-200);
}

/* Replans-home empty state. */
.replan-empty {
  border: 1px dashed var(--parch-border);
  border-radius: var(--r-12);
  padding: 34px 24px;
  text-align: center;
}
.replan-empty__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-900);
  margin: 0 0 6px;
}
.replan-empty__sub {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-500);
  margin: 0 auto 18px;
  max-width: 380px;
}

/* ── Linear connection chip on the Replans home (no disconnect here) ─────── */
.linear-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px solid var(--parch-border);
  border-radius: var(--r-pill);
  padding: 5px 13px 5px 11px;
}
.linear-chip strong { color: var(--ink-900); font-weight: 600; }
.linear-chip a { color: var(--primary); text-decoration: none; }
.linear-chip a:hover { text-decoration: underline; }
.linear-chip__mark { color: var(--primary); font-size: 10px; line-height: 1; }
.linear-chip--off .linear-chip__mark { color: var(--ink-300); }
/* Text is a single inline span so the flex gap doesn't space out the name. */
.linear-chip__text { color: var(--ink-500); }
.linear-chip__manage {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 1px solid var(--parch-200);
  color: var(--ink-400);
}
.linear-chip__manage:hover { color: var(--primary); }

/* ── Unified connections bar (_connections_bar.html) ───────────────────────
   One pill, each integration shown separately, plus a gear → Settings. Used on
   the dashboard NOW band and the Replans page. Supersedes the per-page
   .linear-chip copies. */
.conn-bar {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--parch-border);
  border-radius: var(--r-pill);
  padding: 5px 12px;
}
.conn-bar__item { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.conn-bar__icon { display: inline-flex; align-items: center; color: var(--ink-700); }
.conn-bar__name { color: var(--ink-900); font-weight: 600; text-decoration: none; }
a.conn-bar__name:hover, a.conn-bar__name:focus-visible { text-decoration: underline; }
/* Not-connected: the whole segment is a muted Connect link. */
.conn-bar__item--off .conn-bar__icon { color: var(--ink-300); }
.conn-bar__item--off .conn-bar__name { color: var(--ink-400); font-weight: 500; }
.conn-bar__item--off:hover .conn-bar__icon { color: var(--primary); }
.conn-bar__item--off:hover .conn-bar__name { color: var(--primary); text-decoration: underline; }
.conn-bar__sep { color: var(--parch-200); user-select: none; }
.conn-bar__manage { display: inline-flex; align-items: center; color: var(--ink-400); }
.conn-bar__manage:hover { color: var(--primary); }

/* Visually-hidden accessible label (used by the composer's What-changed label).
   Must live in a globally-loaded sheet so it works on the dashboard too, not
   only on pages that load agent-base.css. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Connect prompt shown inside the composer modal when Linear isn't connected. */
.replan-modal__connect-sub {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-700);
  margin: 0 0 16px;
}

/* ── Replan history cards + status (2026-06-15) ─────────────────────────────
   Clean cards: situation title + a quiet team/cycle chip + date, an
   applied/not-actioned status pill, no chevron (hover lift signals clickable). */
.replan-list { display: flex; flex-direction: column; gap: 10px; }
.replan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--parch-border);
  border-radius: var(--r-8);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}
.replan-card:hover {
  border-color: var(--primary-300);
  box-shadow: 0 4px 14px -10px rgba(31, 26, 15, 0.3);
  transform: translateY(-1px);
}
.replan-card__main { min-width: 0; }
.replan-card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-900);
  line-height: 1.3;
}
.replan-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-400);
}
.replan-card__cycle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-500);
  background: var(--parch-100);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}
.replan-card__init { color: var(--primary); }

.replan-status {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.replan-status--applied { color: var(--primary-900); background: var(--primary-50); }
.replan-status--idle { color: var(--ink-400); background: var(--parch-100); }
.replan-status--reverted { color: var(--ink-500); background: var(--parch-200); }

/* Secondary (outline) button matching the softened primary's proportions. */
.btn-secondary-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--parch-border);
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, border-color .14s, color .14s;
}
.btn-secondary-soft:hover { background: var(--parch-100); border-color: var(--ink-300); color: var(--ink-900); }

/* Destructive confirm button — calm rust outline, used INSIDE the disconnect
   confirm dialog only (the page's own Disconnect stays neutral). */
.btn-danger-soft {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; border-radius: 10px;
  font-family: var(--sans); font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--rust); background: var(--surface); border: 1px solid var(--rust);
  cursor: pointer; text-decoration: none;
  transition: background .14s, color .14s;
}
.btn-danger-soft:hover { background: var(--rust-50); }

/* Settings → one bordered sub-panel per integration, so they read as distinct
   cards within the Integrations section rather than a flat, blendy list. */
.integration-panel {
  border: 1px solid var(--parch-border);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px 18px;
}
.integration-panel + .integration-panel { margin-top: 12px; }
.integration-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.integration-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--parch-100); color: var(--ink-900);
}
.integration-name { font-weight: 600; font-size: 15px; color: var(--ink-900); }

/* Link inside a status pill (the org/workspace name in "Connected to X") —
   inherits the pill's colour, reveals an underline on hover. */
.pill-link { color: inherit; text-decoration: none; font-weight: 700; }
.pill-link:hover, .pill-link:focus-visible { text-decoration: underline; }

/* Access-surface block (granted repos / teams) — collapsed by default, with an
   explicit (expand)/(collapse) affordance and a filled body when open. */
.access-block { margin-top: 14px; border-top: 1px solid var(--parch-200); padding-top: 12px; }
.access-block > summary {
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  cursor: pointer; list-style-position: inside;
}
.access-block > summary::after { content: " (expand)"; color: var(--ink-400); font-weight: 500; }
.access-block[open] > summary::after { content: " (collapse)"; }
/* Expanded body — a quiet parch inset so the list reads as a distinct block. */
.access-body {
  margin-top: 10px; padding: 12px 14px;
  background: var(--parch-100); border-radius: 8px;
}
.access-list { margin: 0; padding: 0; list-style: none;
  font-size: 13px; color: var(--ink-500); line-height: 1.75; }
.access-list li { padding: 1px 0; }
.access-note { margin-top: 10px; font-size: 12px; color: var(--ink-400); line-height: 1.5; }

/* Low-emphasis text link (e.g. "or connect a different org") — muted + italic,
   not a flashy primary link, but clearly clickable: underlines on hover/focus. */
.link-subtle {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-500);
  text-decoration: none;
  transition: color .14s;
}
.link-subtle:hover,
.link-subtle:focus-visible { color: var(--ink-700); text-decoration: underline; }

/* Inline link for connection org/workspace names + Settings actions (Edit,
   manage-installation, support email). Not italic/muted like .link-subtle — it
   sits inline with body text and only reveals its underline on hover/focus. */
.conn-org-link {
  color: var(--ink-700);
  font-weight: 600;
  text-decoration: none;
  transition: color .14s;
}
.conn-org-link:hover,
.conn-org-link:focus-visible { color: var(--ink-900); text-decoration: underline; }
