:root {
  --display: 'Hanken Grotesk', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', 'Courier New', monospace;
  --r: 6px; --rm: 9px; --rl: 12px; --t: 140ms ease;
  --bg: #ffffff; --bg-s: #ffffff; --bg-e: #f7f7f9; --bg-h: #f0f0f4;
  --bd: #e6e6ec; --bd2: #d8d8e2; --bd3: #c2c2d0;
  --tx: #17171f; --tx2: #57576b; --tx3: #8a8a9c;
  --accent: #7a5fc4;
  --low: #6a9a3f; --mid: #9a7a3f; --high: #b5453f;
  --sh: 0 1px 3px rgba(20,20,30,0.06), 0 4px 16px rgba(20,20,30,0.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c14; --bg-s: #11111c; --bg-e: #17172a; --bg-h: #1e1e30;
    --bd: #262638; --bd2: #32324a; --bd3: #45456a;
    --tx: #eceef2; --tx2: #b4b4c8; --tx3: #7c7c96;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c14; --bg-s: #11111c; --bg-e: #17172a; --bg-h: #1e1e30;
  --bd: #262638; --bd2: #32324a; --bd3: #45456a;
  --tx: #eceef2; --tx2: #b4b4c8; --tx3: #7c7c96;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--sans); font-size: 14px; line-height: 1.5; }

header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--bd); }
.logo { font-family: var(--display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.logo svg { flex-shrink: 0; }
header nav { display: flex; gap: 16px; font-size: 13px; }
header nav a { color: var(--tx2); text-decoration: none; }
header nav a:hover { color: var(--tx); }

main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.hero { text-align: center; margin-bottom: 28px; }
.hero h1 { font-family: var(--display); font-size: 26px; margin: 0 0 8px; }
.hero p { color: var(--tx2); margin: 0; font-size: 14px; }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .panes { grid-template-columns: 1fr; } }

.card { background: var(--bg-s); border: 1px solid var(--bd); border-radius: var(--rl); padding: 14px; box-shadow: var(--sh); }
.card-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; color: var(--tx2); }
textarea { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--bd2); border-radius: var(--r); padding: 10px; font-family: var(--sans); font-size: 13.5px; color: var(--tx); background: var(--bg); }
textarea:focus { outline: none; border-color: var(--accent); }

.controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0; }
.controls label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tx2); cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border: none; border-radius: var(--r); padding: 10px 20px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: opacity var(--t); }
button.primary:hover { opacity: 0.9; }
button.primary:disabled { opacity: 0.5; cursor: progress; }

.hidden { display: none !important; }
#results { margin-top: 24px; }
.score-row { display: flex; align-items: baseline; gap: 10px; justify-content: center; margin-bottom: 18px; }
.score-num { font-family: var(--display); font-size: 34px; font-weight: 800; }
.score-num.low { color: var(--low); } .score-num.mid { color: var(--mid); } .score-num.high { color: var(--high); }
#scoreLabel { color: var(--tx2); font-size: 13.5px; }
#status { text-align: center; color: var(--tx2); font-size: 13px; }

.highlighted { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; max-height: 320px; overflow-y: auto; }
.highlighted mark { background: color-mix(in srgb, var(--high) 25%, transparent); color: var(--tx); border-radius: 3px; padding: 0 1px; }

.section-title { font-weight: 600; font-size: 13px; color: var(--tx2); margin: 24px 0 10px; }
.semantic-pair { border: 1px solid var(--bd); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
.semantic-score { font-size: 11.5px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.semantic-sentence { font-size: 13px; color: var(--tx2); font-style: italic; }
.empty { color: var(--tx3); font-size: 13px; text-align: center; padding: 12px; }

footer { text-align: center; color: var(--tx3); font-size: 11.5px; padding: 20px; }
