/* hmmony — one stylesheet. Plain and descriptive: manuscript paper, dark ink,
   one accent. The grid and the staff have to be readable on a laptop in a
   lesson and on a phone on the train, so contrast and tap targets come first. */
:root {
  color-scheme: light dark;
  --bg: #faf8f3;
  --panel: #ffffff;
  --panel-2: #f2efe6;
  --line: #ddd8ca;
  --ink: #1d1f24;
  --muted: #5d6170;
  --accent: #2d5bd7;
  --accent-ink: #ffffff;
  --error: #c4352b;
  --error-bg: #fbe5e2;
  --warning: #9a6200;
  --warning-bg: #fdf0d5;
  --good: #1f7a4d;
  --selected: #2d5bd7;
  --selected-bg: #e3eafc;
  --radius: 12px;
  --music: "Noto Music", "Bravura Text", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --panel: #1b1e25; --panel-2: #232731; --line: #343946; --ink: #eceef3; --muted: #a0a6b6;
    --accent: #7ea2ff; --accent-ink: #0d1430; --error: #ff7a6e; --error-bg: #3a1f1d; --warning: #f0b54a; --warning-bg: #352a14;
    --good: #5fd39a; --selected: #7ea2ff; --selected-bg: #1f2a47;
  }
}

* { box-sizing: border-box; }
/* Components set display; `hidden` must still win. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { max-width: 820px; width: 100%; margin: 0 auto; padding: 32px 20px 64px; flex: 1; }
main.wide { max-width: 1180px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 14px; }
h2 { font-size: clamp(21px, 3vw, 26px); letter-spacing: -0.015em; margin: 36px 0 10px; line-height: 1.25; }
h3 { font-size: 18px; margin: 22px 0 8px; }
a { color: var(--accent); }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 50; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header & footer */
.site-header { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; font-size: 19px; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.site-header nav a:hover { background: var(--panel-2); }
.site-header nav a[aria-current="page"] { background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.account { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.account a:not(.btn) { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); padding: 22px 20px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ink); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 5px 12px; min-height: 34px; font-size: 14px; border-radius: 8px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--error); border: 1px solid var(--error); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 650; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.error { color: var(--error); font-weight: 600; }
.ok { color: var(--good); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.pill.error { color: var(--error); border-color: var(--error); background: var(--error-bg); }
.pill.warning { color: var(--warning); border-color: var(--warning); background: var(--warning-bg); }
.pill.good { color: var(--good); border-color: var(--good); }
.honeypot { position: absolute; left: -5000px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 650; }

/* Landing */
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); }
.hero .lede { font-size: 20px; color: var(--muted); max-width: 46ch; }
.cta { margin: 22px 0 8px; }
.cta form { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 560px; }
.cta form .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .cta form { grid-template-columns: 1fr; } }
.roles { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.roles label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }
.demo { margin: 26px 0; }
.checks { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.checks li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.checks li strong { display: block; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 50px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; }

/* The staff */
.staff-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; overflow-x: auto; }
svg.staff { display: block; color: var(--ink); }
svg.staff .line { stroke: currentColor; stroke-width: 1; opacity: .7; }
svg.staff .clef { font-family: var(--music); fill: currentColor; }
svg.staff .clef.treble { font-size: 58px; }
svg.staff .clef.bass { font-size: 34px; }
svg.staff .acc { font-family: var(--music); font-size: 17px; fill: currentColor; }
svg.staff .num { font-size: 12px; fill: var(--muted); text-anchor: middle; }
svg.staff .note { cursor: pointer; }
svg.staff .note .head { fill: currentColor; }
svg.staff .note .stem { stroke: currentColor; stroke-width: 1.3; }
svg.staff .note.locked { opacity: .55; }
svg.staff .note.warning { color: var(--warning); }
svg.staff .note.error { color: var(--error); }
svg.staff .note.selected { color: var(--selected); }

/* The grid */
.grid-wrap { overflow-x: auto; margin: 12px 0 4px; }
table.grid { border-collapse: separate; border-spacing: 4px; }
table.grid th { font-size: 13px; color: var(--muted); font-weight: 650; text-align: center; padding: 0 2px; }
table.grid tbody th { text-align: right; padding-right: 6px; font-weight: 800; color: var(--ink); }
table.grid td input { width: 54px; min-height: 40px; padding: 6px 4px; text-align: center; font: 600 15px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
table.grid td input.locked { background: var(--panel-2); color: var(--muted); }
table.grid td.m-warning input { border-color: var(--warning); background: var(--warning-bg); }
table.grid td.m-error input, table.grid td.m-invalid input { border-color: var(--error); background: var(--error-bg); }
table.grid td.m-selected input { border-color: var(--selected); background: var(--selected-bg); box-shadow: 0 0 0 1px var(--selected); }
table.grid tr.voice-a td input, table.grid tr.voice-b td input { margin-top: 0; }
table.grid tbody tr.voice-t td { padding-top: 8px; }

/* The checker */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=text] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.context { background: var(--panel-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 8px; font-weight: 650; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.finding { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.finding.sev-error { border-left-color: var(--error); }
.finding.sev-warning { border-left-color: var(--warning); }
.finding[aria-current="true"] { box-shadow: 0 0 0 2px var(--selected); }
.finding .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; cursor: pointer; }
.finding .head strong { font-size: 15px; }
.finding .msg { margin: 4px 0 0; }
.finding .more { margin-top: 8px; font-size: 15px; }
.finding .more p { margin: 0 0 8px; }
.finding .actions { display: flex; gap: 12px; margin-top: 6px; font-size: 14px; flex-wrap: wrap; }
.ai { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.ai p { margin: 0 0 6px; }
.keys { font-size: 13px; color: var(--muted); }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel); }

/* Sets */
.matrix { border-collapse: collapse; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 8px; text-align: center; font-size: 14px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix button { font: inherit; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; cursor: pointer; color: var(--ink); }
.matrix button.clean { color: var(--good); border-color: var(--good); }
.matrix button.has-errors { color: var(--error); border-color: var(--error); }
.code { font: 700 22px/1 ui-monospace, monospace; letter-spacing: .14em; }
