/* ============================================================================
   SEO Audits — light, legible UI
   Single accent (blue) on a soft neutral canvas. System font stack for speed.
   ========================================================================== */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: #e4e9f1;
  --border-strong: #d3dbe7;
  --ink: #1c2531;
  --text: #2c3645;
  --muted: #6b7686;
  --faint: #9aa4b2;

  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #eaf1fe;
  --navy: #0c2742;

  --green: #137a45; --green-soft: #e7f6ee;
  --amber: #9a6700; --amber-soft: #fdf3e2;
  --red: #b42318;   --red-soft: #fdecea;
  --slate: #5a6675; --slate-soft: #eef1f6;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,32,64,.04), 0 6px 20px rgba(16,32,64,.05);
  --shadow-sm: 0 1px 2px rgba(16,32,64,.05);
  --ring: 0 0 0 3px rgba(37,99,235,.18);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: var(--slate-soft); padding: .08em .4em; border-radius: 5px; }

/* ---- Header --------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--navy));
  box-shadow: var(--shadow-sm);
}
.brand .logo svg { width: 18px; height: 18px; }
.brand h1 { font-size: 16px; font-weight: 650; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-badge { font-size: 13px; color: var(--muted); }
.user-badge b { color: var(--text); font-weight: 600; }

/* ---- Layout --------------------------------------------------------------- */
.container {
  max-width: 1500px; margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 48px) 64px;
  display: flex; flex-direction: column; gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 26px);
}
.card > h2 {
  margin: 0 0 4px; font-size: 17px; font-weight: 650; color: var(--ink); letter-spacing: -.01em;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .hint { margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 18px; }
.hint code { font-size: 12px; }

/* ---- Form ----------------------------------------------------------------- */
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field input {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.help { font-size: 12px; color: var(--muted); line-height: 1.45; }

.actions { display: flex; align-items: center; gap: 12px; }
button {
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent; padding: 10px 18px;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s, transform .05s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
button.primary:hover:not(:disabled) { background: var(--accent-ink); }
button.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
button.ghost:hover:not(:disabled) { background: var(--slate-soft); }

/* ---- Flash ---------------------------------------------------------------- */
.flash { display: none; font-size: 13px; padding: 9px 12px; border-radius: var(--radius-sm); }
.flash.show { display: block; }
.flash.success { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }

/* ---- Stats strip ---------------------------------------------------------- */
.statbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px;
}
.stat b { color: var(--ink); font-weight: 700; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.stat.run .dot { background: var(--accent); }
.stat.done .dot { background: var(--green); }
.stat.fail .dot { background: var(--red); }
.stat.queue .dot { background: var(--amber); }

/* ---- Job list (cards, updated in place — no full re-render) ---------------- */
.jobs { display: flex; flex-direction: column; gap: 12px; }
.empty {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 34px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
}
.job {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 18px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.job:hover { border-color: var(--border-strong); }
.job.is-running { border-color: #bcd2fb; box-shadow: 0 0 0 1px #bcd2fb inset, var(--shadow-sm); }
.job-main { min-width: 0; }
.job-site { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-url {
  font-weight: 600; color: var(--ink); font-size: 14.5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-url:hover { color: var(--accent-ink); }
.job-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.kw { font-size: 13.5px; color: var(--text); }
.chip {
  font-size: 11.5px; color: var(--muted); background: var(--slate-soft);
  border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.chip.target { background: var(--accent-soft); color: var(--accent-ink); }
.job-sub { margin-top: 7px; font-size: 12px; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; }
.job-sub .sep { color: var(--border-strong); }

.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; justify-self: end; }
.downloads { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dl {
  font-size: 12.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid #d6e4fd;
  padding: 5px 10px; border-radius: 7px; white-space: nowrap;
}
.dl:hover { background: #dde9fe; text-decoration: none; }
button.dl { cursor: pointer; font-family: inherit; }

/* translate "⋮" dropdown */
.transmenu { position: relative; }
.transmenu-btn {
  cursor: pointer; font-family: inherit; line-height: 1;
  font-size: 16px; font-weight: 700; color: var(--muted);
  background: var(--accent-soft); border: 1px solid #d6e4fd;
  padding: 4px 9px; border-radius: 7px;
}
.transmenu-btn:hover { background: #dde9fe; color: var(--accent-ink); }
.transmenu-list {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow);
  flex-direction: column; gap: 2px;
}
.transmenu.open .transmenu-list { display: flex; }
.transmenu-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); padding: 4px 8px 6px;
}
.transmenu-item {
  display: block; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: none; border: none; border-radius: 6px; padding: 7px 9px; white-space: nowrap;
}
.transmenu-item:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.transmenu-item.busy { color: var(--muted); cursor: progress; }
.transmenu-item.retry { color: var(--red); }
.link-btn {
  background: none; border: none; padding: 2px 0; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.link-btn:hover { color: var(--accent-ink); text-decoration: underline; }
.err { font-size: 12.5px; color: var(--red); max-width: 280px; text-align: right; }

/* status pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px 3px 8px; border-radius: 999px; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.queued { color: var(--amber); background: var(--amber-soft); }
.pill.running { color: var(--accent-ink); background: var(--accent-soft); }
.pill.done { color: var(--green); background: var(--green-soft); }
.pill.failed { color: var(--red); background: var(--red-soft); }
.pill.running .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* logs */
.job-logs { grid-column: 1 / -1; margin-top: 10px; }
.job-logs pre {
  margin: 0; max-height: 320px; overflow: auto;
  background: #0e1726; color: #d6deea; border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

/* ---- Login ---------------------------------------------------------------- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 14px;
}
.login-logo {
  width: 46px; height: 46px; border-radius: 13px; color: #fff;
  display: grid; place-items: center; margin: 2px auto 4px;
  background: linear-gradient(135deg, var(--accent), var(--navy)); box-shadow: var(--shadow-sm);
}
.login-logo svg { width: 24px; height: 24px; }
.login-card h1 { margin: 0; text-align: center; font-size: 20px; color: var(--ink); }
.login-card .sub { margin: 0 0 6px; text-align: center; font-size: 13px; color: var(--muted); }
.login-foot { margin-top: 4px; text-align: center; font-size: 11.5px; color: var(--faint); }

@media (max-width: 620px) {
  .row { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
  .job-side { align-items: flex-start; justify-self: start; }
  .downloads, .err { justify-content: flex-start; text-align: left; }
  .transmenu-list { right: auto; left: 0; }
}

/* ---- Tab navigation + tool pages ------------------------------------------ */
.tabs {
  position: sticky; top: 61px; z-index: 9;
  display: flex; gap: 4px; overflow-x: auto;
  padding: 8px clamp(16px, 4vw, 40px) 0;
  background: rgba(245,247,251,.9); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 0 0 auto; background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 9px 14px 12px; border-radius: 0; border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---- Onglets clés : badge couronne ---------------------------------------- */
.tab-key { position: relative; }
.tab-crown {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; vertical-align: -2px;
}
.tab-crown svg { width: 100%; height: 100%; display: block; }
.tab-key[data-accent="audit"]   .tab-crown { color: var(--accent); }
.tab-key[data-accent="gsc"]     .tab-crown { color: #6b3fc7; }
.tab-key[data-accent="content"] .tab-crown { color: var(--green); }
.tab-key[data-accent="links"]   .tab-crown { color: var(--amber); }

.tool { display: none; }
.tool.is-active { display: block; }
.opt { color: var(--faint); font-weight: 400; }

/* ---- Type badge on job cards ---------------------------------------------- */
.type-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap; flex: 0 0 auto;
  background: var(--slate-soft); color: var(--slate);
}
.type-badge.t-audit   { background: #e9eefc; color: #2945c9; }
.type-badge.t-gsc     { background: #e7f6ee; color: var(--green); }
.type-badge.t-content { background: #fdf3e2; color: var(--amber); }
.type-badge.t-links   { background: #efeaff; color: #6b3fc7; }

/* ============================================================================
   Projects
   ========================================================================== */
.project-head { display: flex; align-items: center; gap: 12px; margin: -2px 0 2px; }
.back-btn {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
}
.back-btn svg { width: 18px; height: 18px; }
.project-head-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.project-head h2 { margin: 0; font-size: 18px; color: var(--ink); letter-spacing: -.01em; line-height: 1.2; }
.project-head .job-url { font-weight: 500; font-size: 13px; color: var(--muted); }
.project-switch { display: flex; flex-shrink: 0; margin-left: auto; }
.project-switch select { min-width: 180px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.project-card {
  text-align: left; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.project-card:hover { border-color: var(--accent); box-shadow: var(--ring); transform: translateY(-2px); }
.project-card-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.project-name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.project-card-url {
  font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-card-snaps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.snap-chip {
  font-size: 11px; color: var(--muted); background: var(--slate-soft);
  border-radius: 6px; padding: 2px 7px;
}
.snap-chip b { color: var(--text); font-weight: 650; }

/* ---- Snapshot panels ------------------------------------------------------ */
.snapshot-panel { display: flex; flex-direction: column; gap: 12px; }
.snap-state { font-size: 14px; color: var(--text); }
.snap-state b { color: var(--ink); }
.snap-cooldown {
  font-size: 13px; color: var(--amber); background: var(--amber-soft);
  border: 1px solid #f3e2c0; border-radius: var(--radius-sm); padding: 9px 12px;
}
.snap-cooldown b { color: var(--amber); }
.snap-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
button.ghost.danger { color: var(--red); border-color: #f3c9c4; }
button.ghost.danger:hover:not(:disabled) { background: var(--red-soft); }

/* ---- History card task progress ------------------------------------------- */
.job-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
button.primary.sm { padding: 6px 12px; font-size: 13px; }
.downloads.secondary .dl {
  background: var(--surface-2); color: var(--muted); border-color: var(--border-strong); font-weight: 500;
}
.downloads.secondary .dl:hover { background: var(--slate-soft); color: var(--text); }
.progress { width: 90px; height: 6px; background: var(--slate-soft); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); border-radius: 999px; transition: width .2s; }
.progress-text { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.faint-dash { color: var(--faint); font-size: 12.5px; }

/* ============================================================================
   Kanban board overlay
   ========================================================================== */
body.no-scroll { overflow: hidden; }
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(12,28,52,.45); backdrop-filter: blur(2px);
  display: flex; align-items: stretch; justify-content: center;
  padding: clamp(8px, 3vw, 32px);
}
/* `display:flex` above would otherwise beat the UA [hidden] rule, leaving the
   empty board permanently visible. Keep the attribute authoritative. */
.overlay[hidden] { display: none; }
.board-modal {
  width: 100%; max-width: 1180px; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.board-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.board-head-info h3 { margin: 0; font-size: 16px; color: var(--ink); }
.board-head-info .hint { margin: 2px 0 0; }
.board-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* On the snapshot tabs (GSC, Content, Site Structure, Audit) the filter bar sits
   on its own row — push it to the right to match the Tasks page layout. */
.tab-board .board-filters { justify-content: flex-end; }
.board-filter {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px;
}
.board-filter-btn {
  font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px;
  display: inline-flex; align-items: center; gap: 6px; max-width: 320px;
}
.board-filter-btn:hover { border-color: var(--accent, var(--border-strong)); }
.board-filter-btn b { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-filter-btn.is-active { background: var(--accent-soft, var(--surface-2)); border-color: var(--accent, var(--border-strong)); }
.board-filter-btn .x { font-weight: 700; font-size: 15px; line-height: 1; padding: 0 2px; opacity: .7; }
.board-filter-btn .x:hover { opacity: 1; }

/* status filter (Google-Ads-style status toggles) */
.status-filter { position: relative; display: inline-flex; }
.status-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  min-width: 200px; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px;
}
.status-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
}
.status-opt:hover { background: var(--surface-2); }
.status-opt input { margin: 0; cursor: pointer; }
.status-opt > span:first-of-type { flex: 1; }
.status-opt-count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border-radius: 999px; padding: 1px 8px;
}

/* page filter popup */
#pageFilterOverlay, #newProjectOverlay { align-items: center; }
#newProjectOverlay #projectForm { display: flex; flex-direction: column; gap: 14px; }
.popup {
  width: 100%; max-width: 460px; background: var(--bg);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; align-self: center;
}
.popup h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.popup .hint { margin: 0 0 14px; }
.popup code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.popup-row { display: flex; gap: 8px; align-items: stretch; }
.popup-row .board-filter { flex: 0 0 auto; }
.popup input {
  flex: 1 1 auto; width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.popup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.delete-label { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.delete-label code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; color: var(--ink); font-weight: 650; }
.danger-confirm {
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--red); border: 1px solid var(--red);
  border-radius: var(--radius-sm); padding: 9px 16px;
  transition: filter .15s, opacity .15s;
}
.danger-confirm:hover:not(:disabled) { filter: brightness(.93); }
.danger-confirm:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Reports tab ---------------------------------------------------------- */
.reports-list { display: flex; flex-direction: column; gap: 18px; }
.report-group { display: flex; flex-direction: column; gap: 8px; }
.report-group-head {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}
.report-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.report-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.report-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.report-latest {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent-ink);
}
.report-actions { display: flex; align-items: center; gap: 6px; }
.report-older-toggle {
  align-self: flex-start; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 600; color: var(--accent-ink);
  background: none; border: none; padding: 2px 0;
}
.report-older-toggle:hover { text-decoration: underline; }
.report-older { display: flex; flex-direction: column; gap: 8px; }
.report-older[hidden] { display: none; }
.report-older .report-row { background: var(--bg, var(--surface)); }

/* ---- Project settings tab ------------------------------------------------- */
.settings-section {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px; border-radius: var(--radius);
}
.settings-section-text h3 { margin: 0 0 2px; font-size: 15px; color: var(--ink); }
.settings-section-text .hint { margin: 0; }
.settings-section.danger-zone { border: 1px solid #f3c9c4; background: var(--red-soft); }
.board-downloads { display: flex; gap: 6px; }

/* ---- Accounts + sharing --------------------------------------------------- */
.role-chip {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; padding: 1px 7px; vertical-align: middle;
}
#shareSection { display: block; border: 1px solid var(--border); }
#shareSection .settings-section-text { width: 100%; }
.share-form { display: flex; gap: 8px; margin-top: 10px; }
.share-form input {
  flex: 1 1 auto; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px;
}
.share-list, .account-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.share-row, .account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.share-row-email, .account-row-email { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.account-row-actions { display: flex; gap: 6px; }
.share-empty { font-size: 13px; color: var(--muted); padding: 4px 0; }

.popup-wide { max-width: 560px; }
.account-form { display: flex; flex-direction: column; gap: 12px; }

/* context (nothing lost) */
.ctx-wrap { padding: 12px 20px 0; }
.ctx-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 6px; }
.ctx { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.ctx summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.ctx-body { padding: 0 14px 12px; font-size: 13px; color: var(--text); }
.ctx-body p { margin: 6px 0; }
.ctx-bits { color: var(--muted); font-size: 12.5px; }
.ctx-skip { color: var(--muted); }

/* columns */
.kanban {
  display: grid; grid-template-columns: repeat(var(--kcols, 3), 1fr); gap: 20px;
  padding: 16px 20px 24px; overflow: auto; flex: 1;
}
/* Inline board inside the project "Tasks" tab (not an overlay). */
.inline-kanban { padding: 4px 0 0; }
.inline-kanban .kcol-head { position: static; }

.kcol { display: flex; flex-direction: column; min-height: 120px; }
.kcol-head {
  position: sticky; top: 0; z-index: 1;
  font-size: 13px; font-weight: 700; color: var(--ink);
  padding: 8px 4px; display: flex; align-items: center; gap: 8px;
}
.kcount {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--slate-soft); border-radius: 999px; padding: 1px 8px;
}
.kcol-body {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; min-height: 80px; transition: background .12s, border-color .12s;
}
.kcol-body.drop-hover { background: var(--accent-soft); border-color: var(--accent); }
.kcol-empty { text-align: center; color: var(--faint); font-size: 13px; padding: 14px 0; }

/* task card */
.task {
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 16px 18px; cursor: grab;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.task:hover { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft); }
.task:active { cursor: grabbing; }
.task.dragging { opacity: .5; }
.task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title { font-size: 16px; font-weight: 650; color: var(--ink); line-height: 1.4; }
.t-url { font-size: 12.5px; color: var(--accent-ink); word-break: break-all; }
.t-impact, .t-effort, .t-prio, .t-source {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--slate-soft); border-radius: 5px; padding: 2px 8px;
}
.t-prio { color: var(--accent-ink); background: var(--accent-soft); }
.t-source { color: var(--slate); }
.cat {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 5px; background: var(--slate-soft); color: var(--slate);
}
.cat-meta, .cat-missing_meta { background: #e9eefc; color: #2945c9; }
.cat-internal_link, .cat-anchor_optimization, .cat-orphan_page, .cat-deep_page { background: #efeaff; color: #6b3fc7; }
.cat-content_add, .cat-content_rewrite, .cat-rewrite, .cat-thin_content, .cat-cluster, .cat-new_page { background: #fdf3e2; color: var(--amber); }
.cat-quick_win, .cat-low_hanging_fruit { background: #e7f6ee; color: var(--green); }
.cat-cannibalization, .cat-ranking_drop, .cat-outdated, .cat-delete_redirect { background: var(--red-soft); color: var(--red); }

/* SEO Audit Keyword — suggested keywords from the GSC snapshot */
.kw-suggestions { margin-bottom: 16px; }
.kw-suggestions-hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.kw-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.kw-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; cursor: pointer; text-align: left;
  background: #e7f6ee; border: 1px solid #cdebd9; color: var(--green);
  border-radius: 8px; padding: 6px 10px; transition: border-color .12s, box-shadow .12s;
}
.kw-tag:hover { border-color: var(--green); box-shadow: 0 0 0 1px #cdebd9; }
.kw-tag-q { font-size: 13px; font-weight: 650; color: var(--ink); }
.kw-tag-meta { font-size: 11.5px; font-weight: 600; color: var(--green); white-space: nowrap; }
.kw-tag.kw-quick_win { background: var(--accent-soft); border-color: #d6e4fd; color: var(--accent-ink); }
.kw-tag.kw-quick_win .kw-tag-meta { color: var(--accent-ink); }

/* ---- Keywords tab ---- */
.kw-section-title { font-size: 14px; font-weight: 650; color: var(--ink); margin: 0 0 12px; }
.kw-pinned { margin-bottom: 22px; }
.kw-pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 6px; }
.kw-pin-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.kw-pin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kw-pin-q { font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.kw-unpin { font-size: 12px; color: var(--muted); flex: none; }
.kw-unpin:hover { color: var(--ink); }
.kw-pin-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.kw-pin-metrics b { color: var(--ink); font-weight: 700; }
.kw-pin-points { font-size: 11.5px; color: var(--muted); }
.kw-trend { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.kw-trend-up { color: #157347; background: #e7f6ee; }
.kw-trend-down { color: #b42318; background: #fde9e7; }
.kw-trend-flat { color: var(--muted); background: var(--slate-soft); }
.kw-pin-actions { display: flex; }
.kw-pin-actions .kw-gen { font-size: 12.5px; padding: 6px 12px; }

.kw-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.kw-list-head .kw-section-title { margin: 0; }
.kw-search {
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 11px; min-width: 220px;
}
.kw-search:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.kw-list { overflow-x: auto; }
.kw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kw-table th, .kw-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.kw-table th { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kw-table tbody tr:hover { background: var(--surface-2); }
.kw-table .kw-num { text-align: right; white-space: nowrap; width: 88px; }
.kw-table .kw-q { font-weight: 600; color: var(--ink); max-width: 320px; }
.kw-actions-cell { white-space: nowrap; width: 1%; }
.kw-actions-cell .kw-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.kw-actions-cell button { font-size: 12px; padding: 5px 11px; }
.kw-pin-btn { min-width: 64px; text-align: center; }
.kw-pin-btn.is-pinned { color: var(--green); border-color: #cdebd9; background: #e7f6ee; }

.task-actions { display: flex; }
.task-detail-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid #d6e4fd;
  border-radius: 6px; padding: 5px 12px; cursor: pointer;
}
.task-detail-btn:hover { background: #dce8fe; border-color: var(--accent); }
.task-chat-count {
  font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: #fff; border-radius: 999px; padding: 0 6px;
}
.t-why { color: var(--muted); font-style: italic; }
.t-exact { position: relative; margin-top: 6px; }
.t-exact pre {
  margin: 0; background: #0e1726; color: #d6deea; border-radius: 7px;
  padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
}
.copy-btn {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: rgba(255,255,255,.12); color: #d6deea; border: 1px solid rgba(255,255,255,.18);
}
.copy-btn:hover { background: rgba(255,255,255,.22); }
.t-meta { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); }
.t-meta li { margin: 2px 0; word-break: break-word; }

.task-move { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.move-btn {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 5px 11px;
}
.move-btn:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: #d6e4fd; }

/* ---- Task detail + chat popup -------------------------------------------- */
/* Sits above the board overlay (z-index 50) so a task can be inspected while
   the per-analysis board is open. */
#taskDetailOverlay { z-index: 60; align-items: center; }
.task-modal {
  position: relative;
  width: 100%; max-width: 1100px; height: min(82vh, 820px);
  display: grid; grid-template-columns: 1.45fr 1fr;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.task-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 5;
  width: 30px; height: 30px; border-radius: 8px; line-height: 1;
  font-size: 22px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer;
}
.task-modal-close:hover { color: var(--ink); background: var(--slate-soft); }

/* Big prev/next task navigation, anchored to the modal side edges */
.task-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 84px; padding: 0;
  font-size: 34px; line-height: 1; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; cursor: pointer; box-shadow: var(--shadow);
  transition: color .12s, background .12s, opacity .12s;
}
.task-nav-btn:hover { color: var(--ink); background: var(--slate-soft); }
.task-nav-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.task-nav-prev { left: 10px; }
.task-nav-next { right: 10px; }
@media (max-width: 720px) {
  .task-nav-btn { width: 38px; height: 64px; font-size: 28px; }
  .task-nav-prev { left: 6px; }
  .task-nav-next { right: 6px; }
}

/* Left: readable task detail */
.task-modal-detail { overflow: auto; padding: 26px 28px; background: var(--surface); }
.task-modal-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.task-modal-h { margin: 0 0 6px; font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.tm-url { display: inline-block; margin-bottom: 14px; word-break: break-all; }
.tm-section { margin: 0 0 16px; }
.tm-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); margin-bottom: 5px;
}
.tm-body { font-size: 14.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.tm-label .copy-btn {
  position: static; margin-left: auto;
  background: var(--accent-soft); color: var(--accent-ink); border-color: #d6e4fd;
}
.tm-label .copy-btn:hover { background: #dce8fe; }
.tm-exact {
  margin: 0; background: #0e1726; color: #d6deea; border-radius: 8px;
  padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto;
}
.tm-context { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.tm-context > summary {
  cursor: pointer; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted);
}
.tm-context > summary:hover { color: var(--accent-ink); }
.tm-sub { margin-top: 12px; }
.tm-sub b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 4px; }
.tm-sub pre {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto;
  color: var(--text);
}

/* Right: chat */
.task-modal-chat { display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface-2); min-height: 0; }
.task-chat-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.task-chat-head h4 { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.task-chat-model { font-size: 11px; font-weight: 600; color: var(--faint); }
.task-chat-messages { flex: 1 1 auto; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto 0; }
.chat-msg { display: flex; }
.chat-msg.chat-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 85%; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  padding: 9px 13px; border-radius: 12px;
}
.chat-user .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-assistant .chat-bubble { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.chat-error { background: var(--red-soft); color: var(--red); border-color: #f3c9c4; }
/* Rendered Markdown inside assistant bubbles */
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-bubble li { margin: 3px 0; }
.chat-bubble li::marker { color: var(--muted); }
.chat-bubble .md-h { font-weight: 700; color: var(--ink); margin: 12px 0 4px; }
.chat-bubble .md-h:first-child { margin-top: 0; }
.chat-bubble strong { font-weight: 700; color: var(--ink); }
.chat-bubble a { text-decoration: underline; }
.chat-bubble code.md-code {
  font-family: var(--mono); font-size: .86em;
  background: var(--slate-soft); color: var(--ink); padding: .06em .36em; border-radius: 4px;
}
.chat-bubble .md-pre {
  margin: 6px 0; background: #0e1726; color: #d6deea; border-radius: 7px;
  padding: 10px 12px; overflow: auto;
}
.chat-bubble .md-pre code { font-family: var(--mono); font-size: 11.5px; line-height: 1.5; background: none; padding: 0; color: inherit; }
.chat-bubble.is-streaming::after {
  content: '▍'; margin-left: 1px; color: var(--muted); animation: chat-blink 1s steps(2, start) infinite;
}
@keyframes chat-blink { to { visibility: hidden; } }
.task-chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.task-chat-form textarea {
  flex: 1 1 auto; resize: none; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; line-height: 1.45; max-height: 140px;
}
.task-chat-form textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: var(--ring); }
.task-chat-form button { flex: 0 0 auto; }

/* ---- Dashboard ------------------------------------------------------------ */
.dashboard { display: flex; flex-direction: column; gap: 22px; }
.dash-section { display: flex; flex-direction: column; gap: 12px; }
.dash-section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dash-section-head h3 { margin: 0; font-size: 14px; color: var(--ink); font-weight: 700; }
.dash-section-head .hint { margin: 0; font-size: 12.5px; }
.dash-perf-controls { margin-left: auto; display: inline-flex; align-items: baseline; gap: 10px; }
.dash-perf-meta { font-size: 12px; color: var(--faint); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dash-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow-sm);
}
.dash-card-label {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.dash-card-value {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.1;
}
.dash-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-delta { font-size: 12.5px; font-weight: 700; }
.dash-delta.up { color: var(--green); }
.dash-delta.down { color: var(--red); }
.dash-delta.flat { color: var(--muted); }
.dash-chart {
  position: relative; height: 320px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.dash-chart .empty { height: 100%; display: flex; align-items: center; justify-content: center; }

/* ---- Client Deliverables tab --------------------------------------------- */
.cd-builder { display: flex; flex-direction: column; gap: 16px; }
.cd-controls {
  display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.cd-kind { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--slate-soft); }
.cd-kind-btn {
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted);
}
.cd-kind-btn.is-active { background: var(--surface); color: var(--accent-ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.cd-period label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cd-period-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-period-sep { font-size: 12.5px; color: var(--muted); }
.cd-period .board-filter { min-width: 120px; }
.cd-period .help { margin-top: 6px; }

.cd-tasks-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cd-tasks-head h3 { margin: 0 0 2px; font-size: 15px; }
.cd-tasks-head .hint { margin: 0; }
.cd-tasks-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cd-hideused { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

.cd-tasklist {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 380px; overflow-y: auto;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.cd-task {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.cd-task:hover { border-color: var(--border-strong); }
.cd-task input { margin-top: 2px; }
.cd-task.is-used { background: var(--surface-2); }
.cd-task-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cd-task-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cd-task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cd-status {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 5px; background: var(--slate-soft); color: var(--slate);
}
.cd-status-todo { background: var(--accent-soft); color: var(--accent-ink); }
.cd-status-in_progress { background: #fdf3e2; color: var(--amber); }
.cd-status-done { background: #e7f6ee; color: var(--green); }
.cd-used-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--red-soft); color: var(--red);
}

.cd-generate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cd-selcount { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cd-docs-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.cd-docs-section h3 { margin: 0 0 14px; font-size: 15px; }
.report-sub { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cd-doc-status.busy { font-size: 12.5px; font-weight: 600; color: var(--amber); }
.cd-doc-error { display: block; margin-top: 4px; font-size: 12px; color: var(--red); }
.cd-doc-del { font-size: 12.5px; padding: 5px 10px; }

@media (max-width: 760px) {
  .kanban { grid-template-columns: 1fr; }
  .board-modal { max-height: 100%; }
  .task-modal { grid-template-columns: 1fr; height: 100%; max-height: 100%; }
  .task-modal-detail { max-height: 45%; }
  .task-modal-chat { border-left: none; border-top: 1px solid var(--border); }
  .dash-chart { height: 260px; }
  .cd-controls { flex-direction: column; gap: 16px; }
}

/* ============================================================================
   Toast notifications
   ========================================================================== */
.toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 38px 14px 16px;
  animation: toast-in .22s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast.is-leaving { animation: toast-out .18s ease-in forwards; }
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
.toast-title { font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.toast-message { color: var(--text); font-size: 13px; line-height: 1.5; }
.toast-email {
  display: block;
  margin: 8px 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #d6e4fd;
  border-radius: 6px;
  padding: 6px 8px;
  word-break: break-all;
}
.toast-copy {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background .15s;
}
.toast-copy:hover { background: var(--accent-ink); }
.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
}
.toast-close:hover { background: var(--surface-2); color: var(--text); }
