/* Linduška — individual acoustic monitoring of pipits
   ─────────────────────────────────────────────
   Linduška's own look. Nothing here is shared with Kavka or Straka. */

:root {
  --accent: #1f6b54;
  --accent-dark: #154d3c;
  --warn: #c2410c;

  --bg: #f4f3ee;
  --surface: #ffffff;

  --text: #1c2622;
  --text-2: #3d4540;
  --text-3: #6f766f;

  --border: #dcdad1;

  --radius: 8px;
  --radius-lg: 12px;

  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

button { font-family: inherit; font-size: inherit; }

[hidden] { display: none !important; }

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Top bar ─────────────────────────────── */

.topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand .mark { color: var(--accent); flex-shrink: 0; }
.brand.large { font-size: 22px; }

.crumb {
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.crumb::before { content: "/"; margin-right: 10px; color: var(--text-3); }

.project-nav { display: flex; gap: 4px; margin-left: 12px; }
.project-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}
.project-nav a:hover { background: #efeee8; color: var(--text); }
.project-nav a[aria-current="page"] { background: #e3f1ea; color: var(--accent-dark); font-weight: 500; }

.grow { flex-grow: 1; }

.who { font-size: 14px; color: var(--text-2); white-space: nowrap; }

button.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  margin-left: 14px;
}
button.link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ─── Page and cards ──────────────────────── */

.page {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.lead { margin: 8px 0 0; color: var(--text-2); }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--text-3); }

.message { max-width: 640px; }
.message p:last-child { margin-bottom: 0; }

/* ─── Projects ────────────────────────────── */

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}
.project-card:hover { border-color: var(--accent); color: var(--text); }
.project-name { font-size: 16px; font-weight: 600; }
.project-species { font-size: 14px; color: var(--text-2); }

/* ─── Syllable catalogue ──────────────────── */

.source { overflow-wrap: anywhere; }
.loading { margin: 0; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.type-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.type-image {
  height: 160px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.type-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.no-image { font-size: 13px; color: var(--text-3); text-align: center; }

.type-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.type-code { font-size: 18px; font-weight: 600; }
.type-usage { font-size: 13px; color: var(--text-2); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: #e6efe9;
  color: var(--accent-dark);
  font-size: 12px;
  white-space: nowrap;
}
.tag.muted { background: #ecebe5; color: var(--text-3); }
.tag.similar { background: #fbeee4; color: var(--warn); }

.type-card.not-relevant .type-image { opacity: 0.55; }

.tag.pair { background: #e7ebf3; color: #2f4a73; }

.section-head { padding: 8px 0 0; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.section-head code { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }

.pair-image { gap: 6px; }
.pair-image .half {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Filters ─────────────────────────────── */

.toolbar { display: flex; flex-direction: column; gap: 14px; padding: 16px 24px; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }

.field, .field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-3);
}
.field-label { align-self: center; }
.field input,
.field select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.field input { width: 140px; }
.field input:focus-visible,
.field select:focus-visible,
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #ffffff; }

.toolbar-summary { align-items: center; font-size: 14px; color: var(--text-2); }
.toolbar-summary button.link { margin-left: 0; }
.type-card.not-relevant .type-code { color: var(--text-3); }

/* ─── Syllable type detail ────────────────── */

a.link-card { color: inherit; text-decoration: none; }
a.link-card:hover { border-color: var(--accent); }

.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }

.detail-nav { display: flex; align-items: center; gap: 8px; }
.detail-nav .spacer { flex-grow: 1; }

.button {
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.button.secondary { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: var(--accent); }
.button.disabled { visibility: hidden; }

.detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-title h1 { font-size: 28px; }

.reference-images { display: flex; flex-wrap: wrap; gap: 16px; }
.reference-images figure,
.compare figure {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.reference-images img { max-height: 300px; max-width: 100%; }
.compare { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.compare + .compare { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.compare img { max-height: 200px; max-width: 100%; }
.compare figcaption { font-weight: 600; }
.compare-note { flex-basis: 100%; margin: 0; }

.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.plain-list .hint { margin-left: 8px; }
.pair-code { font-weight: 600; }

.sung { display: flex; flex-wrap: wrap; gap: 32px; }
.sung-block { flex: 1 1 280px; min-width: 0; }
.sung-block p { margin: 0 0 8px; }

.histogram { display: flex; align-items: flex-end; gap: 4px; height: 84px; max-width: 520px; overflow: hidden; }
.bar-column {
  flex: 1 1 0;
  min-width: 0;
  max-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bar { width: 100%; max-width: 14px; background: var(--accent); border-radius: 3px 3px 0 0; }
.bar-label { height: 16px; font-size: 11px; color: var(--text-3); white-space: nowrap; }

.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.share-label { width: 90px; color: var(--text-2); }
.share-value { width: 44px; text-align: right; color: var(--text-2); }
.share-track {
  flex: 1;
  height: 10px;
  background: #ecebe5;
  border-radius: 5px;
  overflow: hidden;
  display: inline-block;
}
.share-track.small { width: 80px; flex: none; height: 8px; vertical-align: middle; margin-right: 6px; }
.share-fill { display: block; height: 100%; background: var(--accent); }

.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; font-size: 14px; min-width: 460px; }
.data-table th { text-align: left; font-weight: 500; color: var(--text-3); padding: 6px 24px 6px 0; }
.data-table td { padding: 6px 24px 6px 0; border-top: 1px solid #efeee8; }
.mono { font-variant-numeric: tabular-nums; }

/* ─── Recordings ──────────────────────────── */

.recordings-table { width: 100%; }
.recordings-table td { white-space: nowrap; }
.state {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text-3);
  background: var(--surface);
}
.state-in-progress { border-color: #e7c9b3; background: #fdf3ec; color: #9a3412; }
.state-done { border-color: var(--accent); background: #e3f1ea; color: var(--accent-dark); }
.hint-inline { margin-left: 8px; font-size: 13px; color: var(--text-3); }

/* ─── Recording (annotation) ──────────────── */

.recording-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.recording-head .hint { margin: 4px 0 0; }
.button-link {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9c7bd;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.button-link:hover { border-color: var(--accent); color: var(--accent-dark); }

.overview-card, .view-card { padding: 20px 24px; }
.overview {
  position: relative;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #fafaf7;
  border: 1px solid #efeee8;
  cursor: pointer;
  touch-action: none;
}
.overview canvas, .view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.overview-songs, .view-songs { position: absolute; inset: 0; pointer-events: none; }
.song-mark { position: absolute; bottom: 0; height: 8px; min-width: 3px; border-radius: 2px; background: #b4b2a9; }
.song-mark.state-in-progress { background: #d97706; }
.song-mark.state-done { background: var(--accent); }
.song-mark.selected { height: 14px; outline: 2px solid var(--text); outline-offset: 0; }
.view-frame {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 2px solid var(--text);
  border-radius: 4px;
  background: rgba(31, 107, 84, 0.08);
  pointer-events: none;
  box-sizing: border-box;
  min-width: 4px;
}
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #c2410c; pointer-events: none; }

.axis { position: relative; height: 18px; margin-top: 4px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.view-axis { margin-left: 52px; }

.view-row { display: flex; gap: 8px; }
.freq-axis {
  width: 44px;
  flex-shrink: 0;
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-3);
}
.view {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: #fafaf7;
  border: 1px solid #efeee8;
}
.view { cursor: crosshair; touch-action: none; }
.song-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid #888780;
  border-right: 2px solid #888780;
  background: rgba(136, 135, 128, 0.07);
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
}
.song-band.state-in-progress { border-color: #d97706; background: rgba(217, 119, 6, 0.06); }
.song-band.state-done { border-color: var(--accent); background: rgba(31, 107, 84, 0.06); }
.song-band.selected { border-width: 3px; border-color: var(--accent); background: rgba(31, 107, 84, 0.04); }
.song-band.draft { border: 2px dashed var(--accent); background: rgba(31, 107, 84, 0.10); pointer-events: none; }
.song-band span { position: absolute; top: 6px; left: 8px; font-size: 12px; color: var(--text-2); pointer-events: none; }
.song-band.selected span { color: var(--accent-dark); font-weight: 600; }
.handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  cursor: ew-resize;
}
.handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 8px;
  height: 44px;
  margin-top: -22px;
  border-radius: 2px;
  background: var(--accent);
}
.handle-start { left: -8px; }
.handle-end { right: -8px; }

.phrase-band {
  position: absolute;
  top: 18%;
  bottom: 8%;
  border: 1px solid rgba(31, 107, 84, 0.55);
  border-radius: 6px;
  background: rgba(31, 107, 84, 0.07);
  box-sizing: border-box;
  pointer-events: auto;
  cursor: grab;
}
.phrase-band.has-kind { background: rgba(31, 107, 84, 0.08); }
.phrase-band.selected { border: 2px solid var(--accent-dark); background: rgba(31, 107, 84, 0.10); }
.phrase-band.draft { border: 2px dashed var(--accent); pointer-events: none; }
.phrase-handle { position: absolute; top: 0; bottom: 0; width: 12px; cursor: ew-resize; }
.phrase-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 6px;
  height: 28px;
  margin-top: -14px;
  border-radius: 2px;
  background: var(--accent-dark);
}
.phrase-handle.handle-start { left: -7px; }
.phrase-handle.handle-end { right: -7px; }
.cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #1c2622; pointer-events: none; }

.phrase-lane { position: relative; height: 48px; margin: 6px 0 0 52px; }
.phrase-box {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 6px;
  padding: 0;
  border: 1px dashed #c9c7bd;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}
.phrase-box.has-kind { border: 1px solid var(--accent); background: #e3f1ea; color: var(--accent-dark); }
.phrase-box.selected { box-shadow: 0 0 0 2px #1c2622; }
.phrase-box.draft { border-style: dashed; border-color: var(--accent); pointer-events: none; }
.phrase-kind { font-size: 15px; font-weight: 600; white-space: nowrap; }

.panel-row { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid #efeee8; }
.panel-row.hint { margin: 0; font-size: 14px; }
.button-small:disabled { color: #b4b2a9; border-color: #e5e3db; cursor: default; }

.examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
#examples-more { margin-top: 12px; }
.example { border: 1px solid #e5e3db; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.example-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.example-spectrogram { width: 100%; height: 110px; background: #fafaf7; border-radius: 6px; display: block; }
.example-foot { display: flex; align-items: center; gap: 8px; }
.example-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.example-play:disabled { background: #b4b2a9; cursor: default; }
.example-play.playing { background: #c2410c; }
.example .hint-inline { margin-left: 0; }

.annotate-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.repertoire { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.repertoire h2 { margin: 0; font-size: 18px; }
.repertoire h3 { margin: 8px 0 0; font-size: 15px; }
.repertoire .hint { margin: 0; }
.rep-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-label { width: 110px; font-size: 14px; color: var(--text-3); }
.rep-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rep-chip { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--accent); background: #e3f1ea; color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.rep-chip.empty { border-style: dashed; border-color: #c9c7bd; background: var(--surface); color: var(--text-3); font-weight: 400; }
.rep-chip.selected { box-shadow: 0 0 0 2px #1c2622; }
.rep-arrow { color: #8a8f88; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-extra { font-size: 13px; }
.annotate-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1200px) { .annotate-grid { grid-template-columns: minmax(0, 1fr); } }
.picker { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.picker h2 { margin: 0; font-size: 18px; }
.picker .hint { margin: 0; }
.picker-row { display: flex; align-items: flex-end; gap: 10px; }
.picker-row .grow-field { flex: 1; }
.picker-row .grow-field input { width: 100%; box-sizing: border-box; }
.picker-row .count-field input { width: 72px; }
.button-primary {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.button-primary:hover { background: var(--accent-dark); }
.button-primary:disabled { background: #b4b2a9; cursor: default; }
.picker-choice { margin: 0; font-size: 14px; color: var(--text-2); min-height: 20px; }
.family-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.family-chip {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #c9c7bd;
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.family-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding: 2px;
}
.pick-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #e5e3db;
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
}
.pick-tile:hover { border-color: var(--accent); }
.pick-tile.chosen { border: 2px solid var(--accent); background: #e3f1ea; padding: 5px; }
.pick-code { font-weight: 600; font-size: 15px; }
.pick-images { display: flex; gap: 4px; }
.pick-thumb img, .pick-thumb .pick-noimage { flex: 1; min-width: 0; height: 48px; object-fit: contain; background: #fafaf7; border-radius: 4px; display: block; }
.pick-tile.wide { grid-column: span 3; }
.pick-unclassified { display: flex; align-items: center; justify-content: center; height: 48px; font-size: 22px; color: var(--text-3); background: #fafaf7; border-radius: 4px; }
.preview-images img { flex: 1; min-width: 0; height: 220px; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.preview-links { font-size: 13px; color: var(--text-3); }
.picker-row-tight { align-items: center; }
.coded { font-size: 14px; padding: 2px 8px; border-radius: 6px; background: #e3f1ea; color: var(--accent-dark); }
.pick-similar { font-size: 12px; color: #9a3412; }
.pick-similar a { color: #9a3412; }
.picker-keys { font-size: 12px; }
.pick-preview {
  min-height: 200px;
  padding: 10px;
  border: 1px solid #e5e3db;
  border-radius: 10px;
  background: #fafaf7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick-preview .hint { margin: auto; text-align: center; }
.preview-head { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.preview-head strong { font-size: 18px; }
.preview-head a { font-size: 13px; }

.pick-tile.highlight { outline: 2px solid #1c2622; outline-offset: -2px; }

.song-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid #efeee8;
  border-radius: 10px;
  background: #fafaf7;
  min-height: 24px;
}
.song-panel .hint { margin: 0; }
.button-small {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #c9c7bd;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.button-small:hover { border-color: var(--accent); color: var(--accent-dark); }
.button-small.danger:hover { border-color: #b91c1c; color: #b91c1c; }
.save-message {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdf3ec;
  border: 1px solid #e7c9b3;
  color: #9a3412;
  font-size: 14px;
}

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.play:hover { background: var(--accent-dark); }
.segmented { display: inline-flex; align-items: center; border: 1px solid #c9c7bd; border-radius: 8px; overflow: hidden; font-size: 14px; }
.segmented button {
  min-width: 36px;
  padding: 8px 12px;
  border: none;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid #efeee8; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.segmented button:disabled { color: #b4b2a9; cursor: default; }
.zoom-label { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; border-left: 1px solid #efeee8; border-right: 1px solid #efeee8; padding: 8px 6px; }
.keys { font-size: 13px; margin: 0; }

/* ─── Buttons and messages ────────────────── */

button.primary {
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: 0.6; cursor: default; }

.error { min-height: 21px; font-size: 14px; color: var(--warn); }

/* ─── Sign-in ─────────────────────────────── */

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login { width: 100%; max-width: 420px; padding: 32px; }
.login .lead { margin: 12px 0 24px; color: var(--text-2); }
.login .hint { font-size: 13px; }

.login-actions { display: flex; flex-direction: column; }
.login-actions button.primary { margin-top: 8px; margin-bottom: 12px; }
.login-progress { margin: 8px 0 12px; color: var(--text-2); text-align: center; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .topbar .who { display: none; }
  .project-nav { margin-left: 0; }
  .project-nav a { padding: 6px 8px; }
  .freq-axis, .view { height: 220px; }
  .view-axis { margin-left: 52px; }
  .keys { display: none; }
  .page { padding: 16px; }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .type-image { height: 120px; }
}
