:root {
  color-scheme: light;
  --ink: #172333;
  --muted: #53657a;
  --line: #ccd6df;
  --paper: #f4f6f7;
  --card: #fff;
  --green: #176b56;
  --focus: #176b56;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { max-width: 900px; margin: 0 auto; padding: clamp(22px, 5vw, 56px); }
.eyebrow { margin: 0 0 8px; color: var(--muted); font: 650 .78rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.04em; }
.intro { max-width: 68ch; margin: 12px 0 24px; color: var(--muted); font-size: 1.05rem; }
nav { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 22px; }
a { color: #155e66; text-underline-offset: 3px; }
.panel { margin: 14px 0; padding: clamp(15px, 3vw, 22px); border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.notice { padding: 12px; border-left: 4px solid #9a5a17; background: #fff8e8; }
.publish-panel > p { max-width: 72ch; }
.publish-panel > button { min-height: 48px; padding-inline: 20px; }
h2 { margin: 0 0 10px; font-size: 1.08rem; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
#engine-status { color: var(--muted); font-size: .88rem; }
#engine-status[data-state="ready"] { color: var(--green); }
#engine-status[data-state="error"] { color: #9d3333; }
textarea { display: block; width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font: 1.1rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.draft-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#draft-count { margin-right: auto; color: var(--muted); font-size: .88rem; }
button { min-height: 42px; border: 1px solid #0b5e51; border-radius: 7px; padding: 8px 14px; color: #fff; background: #0b7465; font: inherit; font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: #075c51; }
button:disabled { cursor: not-allowed; opacity: .5; }
button.secondary { color: #174b4c; background: #fff; border-color: var(--line); }
button.secondary:hover:not(:disabled) { background: #edf4f2; }
.muted, .footer-note { color: var(--muted); }
.muted { margin: -2px 0 12px; font-size: .91rem; }
.suggestions { display: flex; min-height: 44px; flex-wrap: wrap; gap: 8px; }
.suggestions button { min-width: 92px; }
.suggestions:empty::after { content: "Type a letter or word to see suggestions."; align-self: center; color: var(--muted); font-size: .9rem; }
.keyboard { display: grid; gap: 8px; }
.key-row { display: flex; justify-content: center; gap: clamp(4px, 1vw, 8px); }
.key { flex: 1 1 0; min-width: 0; max-width: 66px; min-height: clamp(44px, 7vw, 58px); padding: 6px 3px; color: #253640; background: #f8fafb; border-color: #d4dde2; box-shadow: 0 2px 0 #d7e0e4; }
.key:hover:not(:disabled) { background: #eaf3f1; }
.key.wide { flex: 2.1 1 0; max-width: 145px; }
.key.space { flex: 5 1 0; max-width: 390px; }
.details summary { cursor: pointer; font-weight: 650; }
.details p { max-width: 74ch; }
.footer-note { margin: 18px 2px 0; font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 460px) {
  .key-row { gap: 4px; }
  .key { padding-inline: 1px; font-size: .91rem; }
  .suggestions button { min-width: 0; flex: 1; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}
@media (forced-colors: active) {
  .panel, button { border: 1px solid CanvasText; }
  button { color: ButtonText; background: ButtonFace; }
  .notice { border: 1px solid CanvasText; }
}
