:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #0a1929;
  --ink-2: #3b4a5c;
  --ink-3: #6b7a8b;
  --border: #e7e2d9;
  --border-strong: #d4cdc0;
  --brand: #043460;
  --brand-2: #19b0ed;
  --accent: #e84393;

  --t-adaptive-bg:   #fde7ef;  --t-adaptive-fg:   #a01457;
  --t-ai-bg:         #d6f5e6;  --t-ai-fg:         #0f6b44;
  --t-shop-bg:       #ffe6d1;  --t-shop-fg:       #9a4112;
  --t-data-bg:       #e3e8ef;  --t-data-fg:       #3b4a5c;
  --t-multi-bg:      #ece5fb;  --t-multi-fg:      #5b21b6;
  --t-pdf-bg:        #fdebc6;  --t-pdf-fg:        #8b5a13;
  --t-integ-bg:      #ebebe7;  --t-integ-fg:      #4b5563;
  --t-insights-bg:   #fef3c0;  --t-insights-fg:   #7d5212;
  --t-compliance-bg: #fde0e0;  --t-compliance-fg: #9b1e1e;
  --t-content-bg:    #d6e6fa;  --t-content-fg:    #1e3a72;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 1480px; margin: 0 auto; padding: 36px 36px 80px; }

/* ── Header ───────────────────────────────────────────── */
.header { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-bottom: 28px; }
.header-left h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.header-left .subtitle {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 400;
  max-width: 560px;
}
.header-right { text-align: right; color: var(--ink-3); font-size: 12px; }
.header-right .updated { font-weight: 500; }
.header-right .meta { margin-top: 4px; font-size: 11px; }

/* ── Toolbar ──────────────────────────────────────────── */
.toolbar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(10,25,41,0.02);
}
.toolbar-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.toolbar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 600; margin-right: 6px;
}
.filter-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--ink-3); color: var(--ink); }
.filter-pill.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Theme dropdown */
.theme-select { position: relative; }
.theme-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  min-width: 180px;
}
.theme-trigger:hover { border-color: var(--ink-3); }
.theme-trigger[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10,25,41,0.06);
}
.theme-trigger-label { flex: 1; text-align: left; }
.theme-caret {
  color: var(--ink-3);
  font-size: 10px;
  transition: transform .15s ease;
}
.theme-trigger[aria-expanded="true"] .theme-caret { transform: rotate(180deg); }
.theme-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}
.theme-dot.all {
  background: linear-gradient(135deg, var(--t-adaptive-fg) 0%, var(--t-ai-fg) 50%, var(--t-shop-fg) 100%);
}
.theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10,25,41,0.10);
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
}
.theme-menu[hidden] { display: none; }
.theme-menu li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
}
.theme-menu li:hover { background: var(--surface-2); }
.theme-menu li[aria-selected="true"] {
  background: var(--ink);
  color: white;
}
.theme-menu li[aria-selected="true"] .theme-dot { box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.search {
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  width: 220px;
  background: var(--surface-2);
  color: var(--ink);
}
.search:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: var(--brand-2); }

/* ── Board ────────────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 18px;
}
@media (max-width: 1280px) {
  .board { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; }
}

.column { min-width: 0; }
.column-header { padding: 0 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.column-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
}
.column-count {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 999px;
}
.column-sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.column.live .column-title::before { content: ''; display:inline-block; width:7px; height:7px; border-radius:50%; background:#22c55e; margin-right: 6px; transform: translateY(-2px); }
.column.q2 .column-title::before { content: ''; display:inline-block; width:7px; height:7px; border-radius:50%; background:#f59e0b; margin-right: 6px; transform: translateY(-2px); }

/* ── Card ─────────────────────────────────────────────── */
.card-stack { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(10,25,41,0.06);
  transform: translateY(-1px);
}
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.01em;
}
.tag-status {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink-3);
  font-weight: 500;
}
.tag-status.wip { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.tag-status.live { color: #166534; border-color: #86efac; background: #f0fdf4; }
.tag-status.planned { color: #4338ca; border-color: #c7d2fe; background: #eef2ff; }
.tag-status.internal { color: #475569; border-color: #cbd5e1; background: #f1f5f9; }
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 2px 0 6px;
}
.card-sub {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.45;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; color: var(--ink-3); font-weight: 500;
}
.card-cap { display: inline-flex; align-items: center; gap: 4px; }
.card-cap-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.card-cap-dot.xs { background: #94a3b8; } .card-cap-dot.s { background: #22c55e; }
.card-cap-dot.m { background: #f59e0b; } .card-cap-dot.l { background: #ea580c; }
.card-cap-dot.xl { background: #dc2626; }
.card-arrow { color: var(--ink-3); font-size: 11px; }

/* Tag color variants */
.t-adaptive   { background: var(--t-adaptive-bg); color: var(--t-adaptive-fg); }
.t-ai         { background: var(--t-ai-bg); color: var(--t-ai-fg); }
.t-shop       { background: var(--t-shop-bg); color: var(--t-shop-fg); }
.t-data       { background: var(--t-data-bg); color: var(--t-data-fg); }
.t-multi      { background: var(--t-multi-bg); color: var(--t-multi-fg); }
.t-pdf        { background: var(--t-pdf-bg); color: var(--t-pdf-fg); }
.t-integ      { background: var(--t-integ-bg); color: var(--t-integ-fg); }
.t-insights   { background: var(--t-insights-bg); color: var(--t-insights-fg); }
.t-compliance { background: var(--t-compliance-bg); color: var(--t-compliance-fg); }
.t-content    { background: var(--t-content-bg); color: var(--t-content-fg); }

.card.dim { opacity: 0.25; pointer-events: none; }

/* ── Side panel ───────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0;
  background: rgba(10,25,41,0.35);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 50;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(620px, 92vw);
  background: var(--bg);
  box-shadow: -8px 0 30px rgba(10,25,41,0.12);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 51;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.panel.open { transform: translateX(0); }
.panel-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.panel-close {
  background: transparent; border: 1px solid var(--border-strong);
  width: 30px; height: 30px; border-radius: 8px;
  cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  margin-bottom: 14px;
  font-family: inherit;
}
.panel-close:hover { background: var(--surface-2); color: var(--ink); }
.panel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px; font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.panel-sub { color: var(--ink-2); font-size: 14px; line-height: 1.55; }

.panel-body { padding: 20px 28px 40px; flex: 1; }
.section { margin-bottom: 24px; }
.section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; color: var(--ink-3); margin-bottom: 8px;
}
.section-body { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.section-body ul { padding-left: 18px; margin: 0; }
.section-body li { margin-bottom: 4px; }

.meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.meta-item .meta-k {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 600; margin-bottom: 3px;
}
.meta-item .meta-v { font-size: 13px; font-weight: 500; color: var(--ink); }
.meta-item .meta-v a { color: var(--brand); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.meta-item .meta-v a:hover { border-bottom-color: var(--brand); }

/* ── Legend ───────────────────────────────────────────── */
.legend {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-wrap: wrap; gap: 16px 22px;
  align-items: center;
}
.legend-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 600;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2); font-weight: 500;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Footer note */
.foot-note {
  margin-top: 20px; font-size: 11px; color: var(--ink-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* Spans indicator */
.spans {
  margin-top: 8px;
  font-size: 10.5px; color: var(--ink-3); font-style: italic;
  font-weight: 500;
}

.empty-state {
  text-align: center; color: var(--ink-3);
  font-size: 12px; padding: 24px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
