/* SEO Desk: light, no external fonts or libraries */
:root, [data-palette="teal"] {
  --bg: #F6F4EF; --card: #FFFFFF; --panel: #F3F0EA; --line: #E2DED5; --line2: #EEEAE2;
  --ink: #1C2430; --ink2: #3E4654; --muted: #5B6472;
  --head: #1C2430; --head-ink: #F6F4EF; --head-muted: #AEB6C2;
  --accent: #0E5A57; --on-accent: #FFFFFF; --soft: #DCEBE8; --soft-ink: #0A3F3D; --mid: #BFD9D4; --mid-ink: #10302E;
  --hard: #ECE8E0; --gold: #E9D7AE; --gold-soft: #F3E6C7; --gold-ink: #5E4513; --warn: #8A5A0B; --bad: #9A2B1F;
}
[data-palette="navy"] {
  --bg: #F5F5F2; --card: #FFFFFF; --panel: #F1F2F5; --line: #DFE1E6; --line2: #ECEDF0;
  --ink: #141B2D; --ink2: #39415A; --muted: #5A6378;
  --head: #141B2D; --head-ink: #F5F5F2; --head-muted: #A9B1C4;
  --accent: #1F3A6E; --soft: #DDE5F2; --soft-ink: #16294F; --mid: #BCCBE4; --mid-ink: #13213F;
  --hard: #E9EAEE; --gold: #D9C08A; --gold-soft: #F1E7CF; --gold-ink: #5A4414; --warn: #7A5410;
}
[data-palette="forest"] {
  --bg: #F4F1EA; --card: #FFFDF8; --panel: #F0ECE3; --line: #E0DACD; --line2: #ECE7DC;
  --ink: #1E2620; --ink2: #3D473F; --muted: #5C665E;
  --head: #1F3328; --head-ink: #F4F1EA; --head-muted: #B3BFB6;
  --accent: #2E5E45; --soft: #DDE8DF; --soft-ink: #1D3D2C; --mid: #BCD3C2; --mid-ink: #183325;
  --hard: #EAE5DA; --gold: #E4CFA3; --gold-soft: #F2E6CC; --gold-ink: #594316; --warn: #7E5512;
}
[data-palette="plum"] {
  --bg: #F6F3F0; --card: #FFFFFF; --panel: #F3EFF2; --line: #E4DDE3; --line2: #EEE9ED;
  --ink: #221A28; --ink2: #463C4D; --muted: #64596B;
  --head: #2B1F33; --head-ink: #F6F3F0; --head-muted: #B9AEC0;
  --accent: #4E2E64; --soft: #E7DEED; --soft-ink: #351F45; --mid: #CDBBDA; --mid-ink: #2C1A3A;
  --hard: #ECE7EB; --gold: #E6D3A8; --gold-soft: #F3E9D2; --gold-ink: #5B4416; --warn: #7C5612;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.brand b { display: block; font-size: 17px; }
.brand small { color: var(--head-muted); font-size: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { padding: 9px 12px; border-radius: 999px; color: var(--head-ink); text-decoration: none; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { background: rgba(255,255,255,.1); }
.nav a.hot { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.tools { display: flex; align-items: center; gap: 6px; }
.swatch { min-width: 44px; min-height: 44px; border-radius: 999px; background: transparent; border: 2px solid rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 0 8px; }
.swatch[aria-pressed="true"] { border-color: var(--gold); }
.swatch i { width: 13px; height: 13px; border-radius: 50%; display: block; border: 1px solid rgba(255,255,255,.5); }
.ghost-head { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: var(--head-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; font-size: 14px; }

main { max-width: 1360px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 30px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.row > * { flex: 1 1 380px; min-width: 0; }
.row.stretch { align-items: stretch; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.dark { background: var(--head); color: var(--head-ink); border: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: none; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.outline { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { background: var(--hard); color: var(--muted); cursor: not-allowed; border-color: var(--line); }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
textarea.input { resize: vertical; min-height: 90px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .input { flex: 1 1 220px; width: auto; }

.tag { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--soft-ink); }
.tag.you { background: var(--gold-soft); color: var(--gold-ink); }
.tag.warn { background: var(--gold-soft); color: var(--warn); }
.card.ask { flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; }
.ask .body { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ask .acts { flex: 1 1 240px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ask .title { font-size: 17px; font-weight: 700; }
.ask .why { color: var(--ink2); font-size: 14px; }
.qa { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.qa label { font-size: 14px; font-weight: 500; }

.pick { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.pick.on { border-color: var(--accent); background: var(--soft); }
.pick input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.pick .t { font-weight: 700; line-height: 1.35; }
.pick .s { font-size: 13px; color: var(--ink2); }
.pick .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.idea { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.order li { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.order li.now { border-color: var(--accent); background: var(--soft); }
.order .num { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.order .txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order .txt b { font-size: 14px; line-height: 1.35; }
.order .txt small { font-size: 12px; color: var(--muted); }
.order .txt small.late { color: var(--warn); font-weight: 700; }
.order .moves { display: flex; gap: 4px; flex: none; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

.pipe { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; }
.pipe .col { background: var(--panel); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pipe .col h4 { display: flex; justify-content: space-between; font-size: 13px; }
.pipe .it { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.pipe .it span { color: var(--muted); font-size: 12px; }

.grid-kw { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.kw { min-height: 76px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px; border-radius: 12px; border: none; cursor: pointer; }
.kw b { font-size: 14px; line-height: 1.3; }
.kw small { font-size: 12px; opacity: .92; }
.kw.win { background: var(--accent); color: var(--on-accent); }
.kw.maybe { background: var(--mid); color: var(--mid-ink); }
.kw.hard { background: var(--hard); color: var(--ink2); }
.kw[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 13px; }
.facts div { padding: 8px 10px; border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.facts span { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 8px 6px; border-bottom: 1px solid var(--line2); vertical-align: top; }
td.no { color: var(--warn); font-weight: 700; }
td.yes { font-weight: 700; }
td a { word-break: break-all; }

.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat b { display: block; font-size: 26px; }
.stat span { font-size: 12px; color: var(--muted); }
.delta.up { color: var(--accent); font-weight: 700; }
.delta.down { color: var(--warn); font-weight: 700; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--panel); font-size: 14px; }
.line.hi { background: var(--soft); color: var(--soft-ink); }
.line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: grid; gap: 5px; align-items: end; height: 110px; }
.bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.bars i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--hard); min-height: 2px; }
.bars i.on { background: var(--accent); }
.bars small { font-size: 10px; color: var(--muted); }
.note { padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-ink); font-size: 14px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 14px; gap: 10px; }
details summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 32px; display: flex; align-items: center; }
.setup li { margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.toast.err { background: var(--bad); color: #fff; }
.progress { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.progress-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.progress-track { height: 10px; border-radius: 999px; background: var(--hard); overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.foot { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .top { padding: 10px 16px; position: static; }
  main { padding: 18px 16px 48px; }
  .stats3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat b { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
