/* ==========================================================================
   Sprint Board — design tokens
   ========================================================================== */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo,
    Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 120ms var(--ease);
  --med: 220ms var(--ease);
}

/* ---- dark (default) ---- */
html[data-theme="dark"] {
  --bg: #0a0c11;
  --bg-grid: rgba(255, 255, 255, 0.028);
  --surface: #12151d;
  --surface-2: #171b25;
  --surface-3: #1d2230;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ecf3;
  --text-muted: #99a0b2;
  --text-faint: #6b7285;
  --accent: #6d5efc;
  --accent-hover: #7d70ff;
  --accent-soft: rgba(109, 94, 252, 0.16);
  --accent-fg: #ffffff;
  --success: #3ecf8e;
  --success-soft: rgba(62, 207, 142, 0.14);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

/* ---- light ---- */
html[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-grid: rgba(15, 20, 40, 0.03);
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f5;
  --border: rgba(16, 22, 44, 0.09);
  --border-strong: rgba(16, 22, 44, 0.16);
  --text: #171a23;
  --text-muted: #5f6779;
  --text-faint: #8b93a5;
  --accent: #5b4bf0;
  --accent-hover: #4c3ce8;
  --accent-soft: rgba(91, 75, 240, 0.1);
  --accent-fg: #ffffff;
  --success: #10a36a;
  --success-soft: rgba(16, 163, 106, 0.12);
  --danger: #d93a41;
  --danger-soft: rgba(217, 58, 65, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 22, 44, 0.06);
  --shadow-md: 0 10px 26px -12px rgba(16, 22, 44, 0.22);
  --shadow-lg: 0 28px 60px -24px rgba(16, 22, 44, 0.32);
  color-scheme: light;
}

/* ==========================================================================
   base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

/* `display` declarations below would otherwise beat the UA rule for [hidden] */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, var(--accent-soft), transparent 60%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -0.014em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-faint); background-clip: content-box; }

/* ==========================================================================
   buttons & fields
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 34px;
  padding: 0 var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast),
    transform var(--fast), box-shadow var(--fast);
}
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
}
.btn--ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }

.btn--danger-ghost {
  color: var(--danger);
  border-color: var(--border);
  background: transparent;
}
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }

.btn--icon { width: 34px; padding: 0; }
.btn--sm { height: 28px; padding: 0 var(--sp-2); font-size: 12.5px; }
.btn--block { width: 100%; height: 40px; }

.field { display: block; }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.field__input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================================
   login gate
   ========================================================================== */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  z-index: 60;
  background: var(--bg);
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.gate__glow {
  position: absolute;
  width: min(760px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}
.gate__card {
  position: relative;
  width: min(400px, 100%);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise var(--med) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
}
.gate__mark, .brand__mark { display: flex; align-items: flex-end; gap: 4px; }
.gate__mark { height: 30px; margin-bottom: var(--sp-4); }
.gate__mark span, .brand__mark span {
  width: 7px;
  border-radius: 3px;
  background: var(--accent);
}
.gate__mark span:nth-child(1) { height: 30px; }
.gate__mark span:nth-child(2) { height: 21px; opacity: 0.65; }
.gate__mark span:nth-child(3) { height: 13px; opacity: 0.38; }

.gate__title { font-size: 22px; }
.gate__sub {
  margin: 6px 0 var(--sp-5);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.gate__card .btn--block { margin-top: var(--sp-4); }
.gate__error {
  margin-top: var(--sp-3);
  padding: 8px var(--sp-3);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}
.gate__card.is-shaking { animation: shake 380ms var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  80% { transform: translateX(-1px); }
}

/* ==========================================================================
   top bar
   ========================================================================== */

.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand__mark { height: 22px; }
.brand__mark span { width: 5px; border-radius: 2px; }
.brand__mark span:nth-child(1) { height: 22px; }
.brand__mark span:nth-child(2) { height: 15px; opacity: 0.65; }
.brand__mark span:nth-child(3) { height: 9px; opacity: 0.38; }
.brand__title { font-size: 15px; line-height: 1.2; }
.brand__meta { font-size: 12px; color: var(--text-faint); }

.topbar__tools { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

.search { position: relative; }
.search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-faint);
  pointer-events: none;
}
.search input {
  width: 220px;
  height: 34px;
  padding: 0 var(--sp-3) 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--fast), box-shadow var(--fast), width var(--med);
}
.search input:focus {
  outline: none;
  width: 260px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.6); }

.segmented {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.segmented__btn {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

#theme-toggle .icon-moon { display: none; }
html[data-theme="light"] #theme-toggle .icon-sun { display: none; }
html[data-theme="light"] #theme-toggle .icon-moon { display: block; }

/* ==========================================================================
   board
   ========================================================================== */

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  overflow: hidden;
}

/* ---- tab bar ---- */
.tabbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 260px;
  height: 36px;
  padding: 0 6px 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background var(--fast), border-color var(--fast), color var(--fast),
    box-shadow var(--fast), opacity var(--fast);
}
.tab:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.tab.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm), inset 0 -2px 0 var(--tab-accent, var(--accent));
}
.tab.is-dim { opacity: 0.45; }
.tab.is-dragging { opacity: 0.4; }
.tab.is-drop-into {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  color: var(--text);
}
.tab.is-drop-before::before,
.tab.is-drop-after::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tab.is-drop-before::before { left: -5px; }
.tab.is-drop-after::after { right: -5px; }

.tab__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--tab-accent, var(--accent));
  opacity: 0.55;
  transition: opacity var(--fast);
}
.tab.is-active .tab__dot { opacity: 1; }
.tab__name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab__name-input {
  width: auto;
  min-width: 80px;
  max-width: 200px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 600;
}
.tab__name-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.tab__count {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab__count { background: var(--accent-soft); color: var(--accent); }
.tab__delete {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--fast), color var(--fast), background var(--fast);
}
.tab__delete svg { width: 13px; height: 13px; fill: currentColor; }
.tab:hover .tab__delete, .tab.is-active .tab__delete { opacity: 0.7; }
.tab__delete:hover { opacity: 1; color: var(--danger); background: var(--danger-soft); }

.tab-add {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 var(--sp-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.tab-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tab-add-form {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.tab-add-form input {
  width: 170px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.tab-add-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- active tab panel ---- */
.panel-host { flex: 1; min-height: 0; display: flex; }

.panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: var(--shadow-sm);
  animation: panel-in var(--med) both;
  transition: border-color var(--fast), background var(--fast);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }
.panel.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface));
}
.panel:focus { outline: none; }

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.panel__dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--tab-accent, var(--accent));
}
.panel__title { font-size: 15px; }
.panel__meta { color: var(--text-faint); font-size: 12px; }
.panel__add { margin-left: auto; }

.panel__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  overflow-y: auto;
  min-height: 56px;
  scrollbar-gutter: stable;
}
.panel__list.is-empty::after {
  content: attr(data-empty-label);
  display: grid;
  place-items: center;
  height: 84px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--text-faint);
  font-size: 12.5px;
}

.empty-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  text-align: center;
  padding: var(--sp-6);
}
.empty-board h2 { font-size: 16px; }
.empty-board p { font-size: 13px; }

/* ---- inline composer ---- */
.composer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-4) var(--sp-4) 0;
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.composer input, .composer textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  resize: vertical;
}
.composer input { font-weight: 550; }
.composer textarea {
  /* Roomy by default, then grows with the text (see autoGrow in app.js) up to
     the cap so the task list underneath stays visible. */
  min-height: 132px;
  max-height: 50vh;
  line-height: 1.55;
}
.composer input:focus, .composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer__actions { display: flex; gap: var(--sp-2); }

/* ==========================================================================
   task card
   ========================================================================== */

.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  padding: 10px var(--sp-3) 10px 6px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tab-accent, var(--accent));
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  animation: pop 180ms var(--ease) both;
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast),
    opacity var(--fast);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
}
.task:hover { border-top-color: var(--border-strong); border-right-color: var(--border-strong); border-bottom-color: var(--border-strong); box-shadow: var(--shadow-md); }
.task.is-dragging { opacity: 0.4; cursor: grabbing; }
.task.is-closed { background: var(--surface-2); border-left-color: var(--success); }
.task.is-closed .task__title { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.task.is-closed .task__desc { color: var(--text-faint); }
.task[hidden] { display: none; }

.task__grip {
  display: flex;
  flex: none;
  padding: 2px 0;
  margin-top: 2px;
  color: var(--text-faint);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--fast);
}
.task__grip svg { width: 14px; height: 14px; fill: currentColor; }
.task:hover .task__grip, body.is-moving-task .task__grip { opacity: 1; }

.task__main { flex: 1; min-width: 0; }
.task__side {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: none;
  align-self: center;
}

.task__top { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 4px; }
.task__id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.task__state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.task__state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.task--open .task__state { background: var(--accent-soft); color: var(--accent); }
.task--closed .task__state { background: var(--success-soft); color: var(--success); }

.task__delete, .task__edit {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity var(--fast), color var(--fast), background var(--fast);
}
.task__delete svg, .task__edit svg { width: 14px; height: 14px; }
.task:hover .task__delete, .task__delete:focus-visible,
.task:hover .task__edit, .task__edit:focus-visible { opacity: 1; }
.task__delete:hover { color: var(--danger); background: var(--danger-soft); }
.task__edit:hover { color: var(--accent); background: var(--accent-soft); }
.task.is-editing .task__edit { opacity: 1; color: var(--accent); background: var(--accent-soft); }

.task__title { font-size: 14px; font-weight: 560; line-height: 1.42; overflow-wrap: anywhere; }
.task__desc {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.task__desc:empty { display: none; }

/* ---- inline task editor ---- */
.task.is-editing { cursor: default; box-shadow: var(--shadow-md); }
.task.is-editing .task__grip { opacity: 0; }
.task__editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: 6px;
}
.task__editor input, .task__editor textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  resize: vertical;
}
.task__editor input { font-size: 14px; font-weight: 560; }
.task__editor textarea {
  min-height: 88px;
  max-height: 50vh;
  font-size: 12.5px;
  line-height: 1.55;
}
.task__editor input:focus, .task__editor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.task__editor-actions { display: flex; gap: var(--sp-2); }

.task__time { font-size: 11px; color: var(--text-faint); }
.task__toggle { border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-2); }
.task__toggle:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.task--closed .task__toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* drop marker between cards */
.drop-marker {
  height: 2px;
  margin: -1px 0;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================================
   API drawer
   ========================================================================== */

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.55);
  backdrop-filter: blur(2px);
  animation: fade var(--med) both;
}
@keyframes fade { from { opacity: 0; } }
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: slide-in var(--med) both;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.drawer__head h2 { font-size: 16px; }
.drawer__body { padding: var(--sp-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.drawer__body > .btn { align-self: flex-start; }
.drawer__body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-top: var(--sp-2); }
.drawer__body p { font-size: 13px; line-height: 1.6; }
.drawer__body code { font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: var(--r-sm); }

.copyrow { display: flex; gap: var(--sp-2); }
.copyrow .field__input { font-size: 12px; }

.endpoints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.endpoints li { display: grid; grid-template-columns: auto max-content; gap: var(--sp-2); align-items: center; justify-content: start; }
.endpoints span { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.verb {
  background: var(--accent-soft) !important;
  color: var(--accent);
  font-weight: 700;
  font-size: 10.5px !important;
  letter-spacing: 0.05em;
}

.code {
  margin: 0;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-muted);
}

/* ==========================================================================
   toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  z-index: 80;
  padding: 10px var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 550;
  animation: toast-in var(--med) both;
}
.toast.is-error { color: var(--danger); border-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 720px) {
  .topbar { padding: var(--sp-3); }
  .search input, .search input:focus { width: 150px; }
  .board { padding: var(--sp-3); gap: var(--sp-2); }
  .brand__meta { display: none; }
  .panel__head { padding: var(--sp-3); }
  .panel__meta { display: none; }
  .panel__list { padding: var(--sp-3); }
  .composer { margin: var(--sp-3) var(--sp-3) 0; }
  .task { flex-wrap: wrap; }
  .task__main { flex: 1 1 100%; }
  .task__side { width: 100%; justify-content: flex-end; margin-top: var(--sp-2); }
  .task__grip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
