/* ============================================================
   Platform Tracker — Stravito brand × engineering-tool density
   Brand palette extracted from the Stravito reveal.js presentation skill:
     bg #FFFFFF · ink #5D0048 · accent #E91E8C / hover #F04682 / magenta #C2185B
   Display: Poppins. Mono: JetBrains Mono.
   ============================================================ */

:root {
  /* Stravito brand */
  --bg: #ffffff;
  --bg-2: #fbf6fa;
  --bg-3: #f4ecf2;
  --ink: #5d0048;
  --ink-2: #7c2c69;
  --ink-3: #a371a0;
  --ink-4: #c5a8c2;
  --rule: #ead7e6;
  --rule-strong: #d6b4cf;

  --pink: #e91e8c;
  --pink-hover: #f04682;
  --pink-soft: #fcd9eb;
  --pink-tint: #fce8f3;
  --magenta: #c2185b;
  --magenta-deep: #94114a;

  /* Wave / signature gradient */
  --wave-1: rgba(233, 30, 140, 0.55);
  --wave-2: rgba(255, 100, 150, 0.4);
  --wave-3: rgba(255, 150, 100, 0.2);

  /* Semantics, recoloured around the brand */
  --crimson: #b00020;
  --crimson-soft: #ffd9df;
  --moss: #2f6f3a;
  --moss-soft: #d9eddd;
  --steel: #2b4d7a;
  --steel-soft: #d8e1ef;

  --font-display: "Poppins", -apple-system, "Helvetica Neue", "Arial Nova", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  --pad: 28px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --tx: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #1a0e17;
  --bg-2: #221220;
  --bg-3: #2c1928;
  --ink: #ffd0ea;
  --ink-2: #e2a5c9;
  --ink-3: #a07a92;
  --ink-4: #715666;
  --rule: #3a1f33;
  --rule-strong: #4e2945;

  --pink: #ff58a8;
  --pink-hover: #ff7ab8;
  --pink-soft: #4a1632;
  --pink-tint: #2f0f22;
  --magenta: #ff5697;
  --magenta-deep: #ff7fb1;

  --wave-1: rgba(255, 91, 168, 0.4);
  --wave-2: rgba(255, 130, 170, 0.3);
  --wave-3: rgba(255, 180, 130, 0.15);

  --crimson: #ff8896;
  --crimson-soft: #401820;
  --moss: #8fc89b;
  --moss-soft: #1d2e22;
  --steel: #8eb0d6;
  --steel-soft: #1c2939;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* `hidden` attribute must always win over class-set display.
   Without this, `.auth-gate { display: grid }` beats `[hidden]` (specificity 0,1,0 vs 0,0,1)
   and the gate sits on top of the app even after authGate.hidden = true. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.45;
  font-feature-settings: "kern", "liga", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Stravito signature: soft pink → coral → orange wave glow anchored to the page bottom. */
body::before {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 240px;
  background: radial-gradient(
    ellipse 120% 100% at 50% 100%,
    var(--wave-1) 0%,
    var(--wave-2) 30%,
    var(--wave-3) 55%,
    transparent 75%
  );
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { color: inherit; }
::selection { background: var(--pink-tint); color: var(--ink); }

/* ============================================================
   Skip link
   ============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; top: 8px; z-index: 100; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 32px;
  padding: 26px 36px 14px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 92%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 8;
  backdrop-filter: saturate(140%) blur(8px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  font-family: var(--font-display);
}
.wordmark-mark {
  font-size: 14px;
  font-weight: 700;
  color: var(--pink);
  line-height: 1;
  align-self: end;
  transform: translateY(-3px);
}
.wordmark-stack {
  display: grid;
  gap: 0;
  align-items: baseline;
  line-height: 1;
}
.wordmark-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.wordmark-main {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 4px;
  align-self: end;
}
.tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 10px 16px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  letter-spacing: 0;
  transition: color var(--tx);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--pink);
  border-radius: 1px;
}
.tab-slash { color: var(--ink-4); margin-right: 4px; font-weight: 400; }
.tab[aria-selected="true"] .tab-slash { color: var(--pink); }

.meta-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.user-chip, .sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-dot, .sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.user-dot { background: var(--moss); box-shadow: 0 0 0 2px var(--moss-soft); }
.sync-dot {
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--pink-soft);
  animation: sync-pulse 3s ease-in-out infinite;
}
@keyframes sync-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--pink-soft); }
  50% { box-shadow: 0 0 0 4px var(--pink-soft); }
}
.sync-label { color: var(--ink-4); }
#sync-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-2);
  font-size: 14px;
  display: inline-grid;
  place-items: center;
  transition: border-color var(--tx), color var(--tx);
}
.theme-toggle:hover { border-color: var(--pink); color: var(--pink); }

.sign-out {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--tx);
}
.sign-out:hover { border-color: var(--pink); color: var(--pink); }

/* ============================================================
   Auth gate
   ============================================================ */
.auth-gate {
  min-height: 86vh;
  display: grid;
  place-items: center;
  padding: 48px;
}
.signin {
  text-align: left;
  max-width: 420px;
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 40px 44px 36px;
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 var(--rule), 0 24px 48px -28px rgba(93, 0, 72, 0.15);
}
.signin-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink);
  margin-bottom: 18px;
  box-shadow: 0 0 0 4px var(--pink-tint);
}
.signin-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.signin-body { color: var(--ink-2); margin: 0 0 24px; font-weight: 300; }
.signin-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--pink-tint);
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--ink);
}
.signin-button {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--magenta);
  color: #fff;
  border: 1px solid var(--magenta);
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--tx), border-color var(--tx), box-shadow var(--tx);
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 var(--magenta-deep), 0 6px 18px -8px rgba(194, 24, 91, 0.45);
}
.signin-button:hover {
  background: var(--magenta-deep);
  border-color: var(--magenta-deep);
}
:root[data-theme="dark"] .signin-button {
  background: var(--pink);
  border-color: var(--pink);
  color: #1a0e17;
  box-shadow: 0 1px 0 var(--magenta-deep), 0 6px 22px -10px rgba(255, 88, 168, 0.55);
}
:root[data-theme="dark"] .signin-button:hover {
  background: var(--pink-hover);
  border-color: var(--pink-hover);
}
.signin-button-glyph { font-weight: 600; transform: translateX(-2px); }
.signin-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--pink);
  margin-bottom: 12px;
}
.signin-footnote {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.link-button {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--pink);
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.signin-error {
  margin: 14px 0 0;
  color: var(--crimson);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============================================================
   View subtitle (sprint-only date strip)
   ============================================================ */
.view-subtitle {
  padding: 16px 36px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-subtitle-glyph { color: var(--pink); }
.view-subtitle time { color: var(--ink-2); }

/* ============================================================
   View pane states
   ============================================================ */
.view-pane { padding: 32px 36px 100px; }
.state {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.state-loading::before { content: "› "; color: var(--pink); }
.state-error {
  color: var(--crimson);
  border-left: 2px solid var(--crimson);
  padding-left: 12px;
}

/* ============================================================
   Kanban (Current Sprint)
   ============================================================ */
.kanban {
  display: grid;
  /* One column per Sprint status — kept in sync with STATUSES in app.js. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}
.column { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.column-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.column-glyph { font-size: 13px; line-height: 1; }
.column[data-status="New"]         .column-glyph { color: var(--pink-hover); }
.column[data-status="Backlog"]     .column-glyph { color: var(--ink-4); }
.column[data-status="Blocked"]     .column-glyph { color: var(--crimson); }
.column[data-status="In progress"] .column-glyph { color: var(--pink); }
.column[data-status="In review"]   .column-glyph { color: var(--ink-2); }
.column[data-status="Done"]        .column-glyph { color: var(--ink-3); }
.column-name {
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-weight: 600;
}
.column-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.column .cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 12px 14px 11px;
  display: grid;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  position: relative;
  border-radius: var(--radius-md);
  transition: border-color var(--tx), transform var(--tx), box-shadow var(--tx);
  /* Allow shrinking inside narrow Sprint kanban columns. */
  min-width: 0;
  overflow: hidden;
}
.card > * { min-width: 0; }
.card .card-title { overflow-wrap: anywhere; }
.card:hover {
  border-color: var(--pink);
  box-shadow: 0 1px 0 var(--pink-soft), 0 6px 24px -16px rgba(233, 30, 140, 0.4);
  transform: translateY(-1px);
}
.card-repo {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.card-repo .repo-num { color: var(--pink); font-weight: 500; }
.card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 2px;
}

/* ============================================================
   Badges / labels / assignees
   ============================================================ */
.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.6;
}
.badge--status-new         { background: var(--pink-tint); color: var(--magenta-deep); border: 1px solid var(--pink-soft); }
.badge--status-backlog     { background: var(--bg-3);     color: var(--ink-3);        border: 1px solid var(--rule); }
.badge--status-ready       { background: var(--bg-3);     color: var(--ink);          border: 1px solid var(--ink-4); }
.badge--status-in-progress { background: var(--pink-soft); color: var(--magenta-deep); border: 1px solid var(--pink); }
.badge--status-in-review   { background: var(--bg-3);     color: var(--ink-2);        border: 1px solid var(--rule-strong); }
.badge--status-done        { background: transparent;     color: var(--ink-3);        border: 1px solid var(--rule-strong); }
.badge--status-blocked     { background: var(--crimson-soft); color: var(--crimson);  border: 1px solid var(--crimson); }
.badge--closed { background: var(--ink); color: var(--bg); font-weight: 500; }
.badge--initiative {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  font-weight: 500;
  /* In narrow Sprint columns, initiative titles can be long. Clip with
     ellipsis rather than forcing the card past its column width. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge--sprint {
  font-family: var(--font-mono);
  color: var(--ink-2);
  background: var(--bg-3);
}

/* Labels */
.label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  background: var(--bg-2);
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  line-height: 1.6;
}
.label--bug { color: var(--crimson); border-color: var(--crimson-soft); background: var(--crimson-soft); }
.label--incident {
  color: var(--crimson);
  background: transparent;
  border: 1px solid var(--crimson);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.label--tech-debt { color: var(--ink-2); }
.label--kr { color: var(--magenta-deep); border-color: var(--pink-soft); background: var(--pink-tint); }
.label--deferred { color: var(--ink-4); text-decoration: line-through; }

/* Assignees */
.assignees {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.assignee { display: inline-flex; align-items: center; gap: 4px; }
.assignee::before { content: "@"; color: var(--ink-4); }
.assignees-divider { color: var(--ink-4); }

/* ============================================================
   Backlog (table)
   ============================================================ */
.backlog {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-display);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.backlog thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--ink-4);
  text-transform: uppercase;
  padding: 12px 14px 11px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.backlog tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.backlog tbody tr { transition: background var(--tx); }
.backlog tbody tr:last-child td { border-bottom: none; }
.backlog tbody tr:hover { background: var(--bg-2); }
.backlog .col-p,
.backlog .col-st,
.backlog .col-sprint,
.backlog .col-init,
.backlog .col-assignees { white-space: nowrap; width: 1%; }
.backlog .col-title { width: 50%; }
.backlog .col-repo { width: 18%; }
.backlog td.col-title a {
  display: grid;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}
.backlog td.col-title .title-text {
  font-weight: 500;
  letter-spacing: -0.005em;
}
.backlog td.col-title:hover .title-text {
  color: var(--magenta-deep);
}
.backlog td.col-title .title-labels {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.backlog td.col-repo {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.backlog td.col-repo .repo-num { color: var(--pink); font-weight: 500; }
.backlog td.col-sprint,
.backlog td.col-init {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}
.backlog td.col-sprint-empty { color: var(--ink-4); }

/* ============================================================
   Bugs
   ============================================================ */
.bug-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}
.bug {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.bug:first-child { padding-top: 4px; }
.bug-age {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  display: grid;
  gap: 4px;
}
.bug-age-primary { font-weight: 500; }
.bug-age-secondary { color: var(--ink-4); font-size: 11px; }
.bug-age.bug-age--fresh .bug-age-primary { color: var(--crimson); }
.bug-age.bug-age--stale .bug-age-primary { color: var(--ink-4); }
.bug-body { display: grid; gap: 6px; }
.bug-repo {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.bug-repo .repo-num { color: var(--pink); font-weight: 500; }
.bug-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}
.bug:hover { background: var(--bg-2); }
.bug { cursor: pointer; transition: background var(--tx); padding-left: 20px; padding-right: 20px; margin: 0 -20px; }
.bug:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; }
.backlog tbody tr { cursor: pointer; }
.backlog tbody tr:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; }
.card { cursor: pointer; }
.card:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.bug-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  border: 1px dashed var(--rule);
  padding: 28px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.empty::before { content: "// "; color: var(--ink-4); }

/* ============================================================
   Bottom bar
   ============================================================ */
.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 9px 36px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  z-index: 7;
  backdrop-filter: saturate(140%) blur(8px);
}
.bottombar-cell.bottombar-sep { color: var(--ink-4); }
.bottombar-cell.bottombar-grow { flex: 1; }
.bottombar-link {
  color: var(--ink-3);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: color var(--tx);
}
.bottombar-link:hover { color: var(--pink); text-decoration: underline; }
#bottombar-mode { color: var(--pink); font-weight: 500; }
#bottombar-mode[data-mode="live"]::before { content: "● "; color: var(--moss); }
#bottombar-mode[data-mode="mock"]::before { content: "● "; color: var(--pink); }

/* ============================================================
   Staggered fade-in
   ============================================================ */
@keyframes ledge-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-stack > * {
  opacity: 0;
  animation: ledge-in 320ms ease-out forwards;
}
.fade-stack > *:nth-child(1)  { animation-delay:  0ms; }
.fade-stack > *:nth-child(2)  { animation-delay: 24ms; }
.fade-stack > *:nth-child(3)  { animation-delay: 48ms; }
.fade-stack > *:nth-child(4)  { animation-delay: 72ms; }
.fade-stack > *:nth-child(5)  { animation-delay: 96ms; }
.fade-stack > *:nth-child(6)  { animation-delay: 120ms; }
.fade-stack > *:nth-child(7)  { animation-delay: 140ms; }
.fade-stack > *:nth-child(8)  { animation-delay: 160ms; }
.fade-stack > *:nth-child(9)  { animation-delay: 180ms; }
.fade-stack > *:nth-child(10) { animation-delay: 200ms; }
.fade-stack > *:nth-child(n+11) { animation-delay: 220ms; }

@media (prefers-reduced-motion: reduce) {
  .fade-stack > * { opacity: 1; animation: none; }
  .sync-dot { animation: none; }
  body::before { opacity: 0.6; }
}

/* ============================================================
   Issue modal (native <dialog>)
   ============================================================ */
dialog.issue-modal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 96vw;
  width: 760px;
  max-height: 90vh;
  margin: auto;
  color: var(--ink);
}
dialog.issue-modal::backdrop {
  background: rgba(28, 5, 22, 0.55);
  backdrop-filter: blur(3px);
}
:root[data-theme="dark"] dialog.issue-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
dialog.issue-modal[open] .issue-modal-content {
  animation: modal-rise 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.issue-modal-content {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -30px rgba(93, 0, 72, 0.4);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
}
.issue-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 8px;
}
.issue-modal-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.issue-modal-repo {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.issue-modal-repo .repo-num { color: var(--pink); font-weight: 500; }
.issue-modal-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.issue-modal-close {
  background: transparent;
  border: 1px solid var(--rule);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--tx);
}
.issue-modal-close:hover {
  border-color: var(--pink);
  color: var(--pink);
}
.issue-modal-title {
  margin: 4px 24px 12px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.issue-modal-foot {
  padding: 0 24px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-bottom: 1px solid var(--rule);
}
.issue-modal-foot-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-left: auto;
}
.issue-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.issue-modal-body p { margin: 0 0 12px; }
.issue-modal-body p:last-child { margin-bottom: 0; }
.issue-modal-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}
.issue-modal-body .empty-body {
  color: var(--ink-4);
  font-style: italic;
  font-family: var(--font-mono);
  font-size: 12px;
}
.issue-modal-body a { color: var(--pink); }

/* Markdown — applies to both the issue body and comments. */
.issue-modal-body h1,
.issue-modal-body h2,
.issue-modal-body h3,
.issue-modal-body h4,
.issue-modal-body h5,
.issue-modal-body h6,
.comment-body h1,
.comment-body h2,
.comment-body h3,
.comment-body h4,
.comment-body h5,
.comment-body h6 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 18px 0 8px;
  font-weight: 600;
  line-height: 1.25;
}
.issue-modal-body h1, .comment-body h1 { font-size: 20px; }
.issue-modal-body h2, .comment-body h2 { font-size: 17px; }
.issue-modal-body h3, .comment-body h3 { font-size: 15px; }
.issue-modal-body h4, .comment-body h4 { font-size: 14px; }
.issue-modal-body h5, .comment-body h5,
.issue-modal-body h6, .comment-body h6 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.issue-modal-body :is(h1,h2,h3,h4,h5,h6):first-child,
.comment-body :is(h1,h2,h3,h4,h5,h6):first-child { margin-top: 0; }

.issue-modal-body ul,
.issue-modal-body ol,
.comment-body ul,
.comment-body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.issue-modal-body li, .comment-body li { margin: 2px 0; }
.issue-modal-body li > p, .comment-body li > p { margin: 0 0 4px; }
.issue-modal-body li.task-list-item,
.comment-body li.task-list-item {
  list-style: none;
  margin-left: -20px;
  padding-left: 0;
}
.issue-modal-body li.task-list-item input[type="checkbox"],
.comment-body li.task-list-item input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--pink);
  vertical-align: middle;
}

.issue-modal-body blockquote,
.comment-body blockquote {
  margin: 0 0 12px;
  padding: 4px 12px;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-3);
  background: var(--bg-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.issue-modal-body blockquote > :last-child,
.comment-body blockquote > :last-child { margin-bottom: 0; }

.issue-modal-body pre,
.comment-body pre {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
}
.issue-modal-body pre code,
.comment-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: var(--ink);
  font-size: inherit;
}

.issue-modal-body hr,
.comment-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 16px 0;
}

.issue-modal-body img,
.comment-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}

.issue-modal-body table,
.comment-body table {
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13px;
}
.issue-modal-body th,
.issue-modal-body td,
.comment-body th,
.comment-body td {
  border: 1px solid var(--rule);
  padding: 4px 10px;
  text-align: left;
}
.issue-modal-body th, .comment-body th {
  background: var(--bg-2);
  font-weight: 600;
  color: var(--ink);
}

.issue-modal-body del,
.comment-body del { color: var(--ink-4); }

.comment-body a { color: var(--pink); }

.issue-modal-comments {
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 16px 24px 20px;
  overflow-y: auto;
  max-height: 40vh;
}
.issue-modal-comments-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  display: flex;
  gap: 4px;
}
#issue-modal-comments-count { color: var(--pink); font-weight: 600; }
.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.comment {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.comment-author {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pink);
  font-weight: 500;
}
.comment-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.comment-body {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.comment-body p { margin: 0 0 8px; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 3px;
}

.issue-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.issue-modal-github {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--tx);
}
.issue-modal-github:hover { color: var(--pink); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { grid-template-columns: 1fr; gap: 12px; padding: 18px 20px 10px; }
  .meta-strip { justify-content: flex-start; flex-wrap: wrap; }
  .view-pane, .context-strip { padding-left: 20px; padding-right: 20px; }
  .backlog { font-size: 13.5px; }
}
@media (max-width: 720px) {
  .kanban { grid-template-columns: 1fr; }
  .context-title { font-size: 28px; }
  .backlog thead { display: none; }
  .backlog tbody td { display: block; border: none; padding: 4px 0; }
  .backlog tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--rule); display: block; }
  .bug { grid-template-columns: 80px 1fr; gap: 14px; }
  body::before { height: 180px; }
}
