:root {
  --navy: #0b2547;
  --teal: #009b94;
  --accent: #00756f;        /* white text on this passes AA */
  --accent-hover: #005f5a;
  --bg: #f6f9fb;
  --surface: #ffffff;
  --text: #0b2547;
  --muted: #4a5b70;
  --border: #c9d4df;
  --field: #ffffff;
  --warn-bg: #fff6e0;
  --warn-text: #6b4b00;
  --focus: #009b94;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07182e;
    --surface: #0d2340;
    --text: #e8eef5;
    --muted: #a7b6c8;
    --border: #2a4466;
    --field: #081a31;
    --accent: #13b3aa;
    --accent-hover: #2ccbc1;
    --warn-bg: #3a2e0c;
    --warn-text: #f4d98a;
    --focus: #2ccbc1;
  }
  .primary { color: #04201e !important; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top .wrap { padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-block; line-height: 0; }
.brand img { height: 48px; width: auto; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 32px 0 8px; }
h2 { font-size: 1.3rem; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; }
.tool, .about {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 24px;
}
.field + .field, .modes + .field { margin-top: 16px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.label-row label, legend { font-weight: 600; white-space: nowrap; }
.actions { display: flex; gap: 8px; }
textarea {
  width: 100%; display: block; resize: vertical; min-height: 140px;
  font: 14px/1.5 var(--mono); color: var(--text); background: var(--field);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  overflow-wrap: anywhere; word-break: break-all;
}
textarea:focus-visible, button:focus-visible, .modes input:focus-visible + span {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
#seq-out { background: var(--bg); }
button {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 6px 14px; min-height: 36px;
}
.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.ghost:hover { border-color: var(--accent); }
.modes { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.modes legend { width: 100%; padding: 0; margin-bottom: 6px; }
.modes label { position: relative; }
.modes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.modes span {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
.modes input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) {
  .modes input:checked + span { background: var(--accent); border-color: var(--accent); color: #04201e; }
}
.stats { font: 13px/1.5 var(--mono); color: var(--muted); margin: 8px 0 0; overflow-wrap: anywhere; }
.notes { list-style: none; padding: 0; margin: 8px 0 0; }
.notes li {
  background: var(--warn-bg); color: var(--warn-text); border-radius: 8px;
  padding: 8px 12px; font-size: 0.9rem; margin-top: 6px;
}
.about ul { padding-left: 20px; margin: 0; }
.about li + li { margin-top: 6px; }
code { font-family: var(--mono); font-size: 0.9em; }
.credit { color: var(--muted); font-size: 0.9rem; margin: 16px 0 0; }
a { color: var(--accent); }
.foot { color: var(--muted); font-size: 0.85rem; padding: 8px 0 32px; }
