/* Kavka — Bird Voice CE Annotation UI
   Visual identity: Gate2Natura by Tereza Bartošová */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Geist:wght@300;400;500;600&display=swap');

:root {
  /* Brand colors */
  --g2n-dark: #1a2b2a;
  --g2n-dark-lighter: #243d3b;
  --g2n-coral: #e8837c;
  --g2n-coral-light: #fdf0ef;
  --g2n-blue: #4466ff;
  --g2n-blue-light: #eef1ff;
  --g2n-mint: #3dd9a0;
  --g2n-mint-light: #eafaf3;
  --g2n-forest: #2d6b3f;

  /* Functional colors */
  --bg: #f8f9f7;
  --bg-card: #ffffff;
  --bg-hover: #f0f2ed;
  --text: #1a2b2a;
  --text-secondary: #5a6b6a;
  --text-hint: #8a9a99;
  --border: #d8ddd6;
  --border-light: #e8ece5;

  /* Status colors */
  --pending-bg: #fdf6e3;
  --pending-text: #b8860b;
  --annotated-bg: var(--g2n-mint-light);
  --annotated-text: var(--g2n-forest);
  --skipped-bg: #f0f2ed;
  --skipped-text: #5a6b6a;
  --processed-bg: var(--g2n-blue-light);
  --processed-text: var(--g2n-blue);

  /* Layout */
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 4px rgba(26, 43, 42, 0.06);
  --shadow-hover: 0 3px 12px rgba(26, 43, 42, 0.1);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Geist', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 0;
  min-height: 100vh;
}

/* ─── App shell ──────────────────────────── */

.app-header {
  background: var(--g2n-dark);
  color: white;
  padding: 14px 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.app-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.app-logo .logo-accent {
  color: var(--g2n-coral);
}

.app-logo .logo-subtitle {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--g2n-mint);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: 4px;
}

.kavka-silhouette {
  width: 32px;
  height: 32px;
  opacity: 0.9;
}

.app-content {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem;
}

/* ─── Page header ─────────────────────────── */

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--g2n-dark);
}

.page-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--g2n-blue);
  text-decoration: none;
  margin-bottom: 1.25rem;
  font-weight: 500;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--g2n-dark);
}

.back-link + .back-link {
  margin-left: 1rem;
}

/* ─── Recording list ─────────────────────── */

.recording-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recording-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--shadow);
}

.recording-card:hover {
  border-color: var(--g2n-mint);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.recording-card .location {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--g2n-dark);
}

.recording-card .meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Recording ordinal + annotator progress (recordings list) ─── */

.recording-ordinal {
  color: var(--g2n-blue);
  font-weight: 700;
  margin-right: 2px;
}

.recording-progress {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Badges ──────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-pending {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.badge-annotated {
  background: var(--annotated-bg);
  color: var(--annotated-text);
}

.badge-skipped {
  background: var(--skipped-bg);
  color: var(--skipped-text);
}

.badge-processed {
  background: var(--processed-bg);
  color: var(--processed-text);
}

.badge-uploaded {
  background: var(--skipped-bg);
  color: var(--skipped-text);
}

/* ─── Segment card ────────────────────────── */

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.segment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.segment-card.active {
  border-color: var(--g2n-blue);
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--g2n-blue-light);
}

.segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.segment-header .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segment-header .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.segment-header .time {
  font-size: 0.8rem;
  color: var(--text-hint);
}

.model-suggestion {
  font-size: 0.75rem;
  color: var(--text-hint);
  background: var(--bg);
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
}

/* ─── Waveform decoration ─────────────────── */

.waveform-decoration {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  margin-left: 8px;
}

.waveform-decoration .bar {
  width: 3px;
  border-radius: 2px;
  background: var(--g2n-blue);
  opacity: 0.4;
}

/* ─── Audio player ────────────────────────── */

.audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

audio {
  flex: 1;
  height: 36px;
  border-radius: var(--radius);
}

audio::-webkit-media-controls-panel {
  background: var(--bg);
}

/* ─── Annotation form ─────────────────────── */

.annotation-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group select {
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  min-width: 200px;
  transition: border-color 0.15s;
}

.form-group select:focus {
  outline: none;
  border-color: var(--g2n-blue);
  box-shadow: 0 0 0 3px var(--g2n-blue-light);
}

.action-buttons {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.btn {
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
}

.btn-confirm {
  background: var(--g2n-dark);
  color: white;
  border-color: var(--g2n-dark);
}

.btn-confirm:hover {
  background: var(--g2n-dark-lighter);
}

.btn-noise {
  color: var(--g2n-coral);
  border-color: var(--g2n-coral);
}

.btn-noise:hover {
  background: var(--g2n-coral-light);
}

.btn-skip {
  color: var(--text-hint);
}

/* ─── Annotated segment summary ───────────── */

.annotation-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.annotation-summary .species-name {
  font-weight: 500;
  color: var(--g2n-forest);
}

.annotation-summary .voc-type {
  font-size: 0.75rem;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── Progress ────────────────────────────── */

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  margin-top: 2rem;
  border-top: 2px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  margin: 0 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g2n-mint), var(--g2n-blue));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Loading / Empty ─────────────────────── */

.loading, .empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-hint);
  font-size: 0.95rem;
}

.empty-kavka {
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ─── Notification ────────────────────────── */

.notification {
  position: fixed;
  top: 70px;
  right: 20px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification.success {
  background: var(--annotated-bg);
  color: var(--annotated-text);
  border: 1px solid var(--g2n-mint);
}

.notification.error {
  background: var(--g2n-coral-light);
  color: #a33;
  border: 1px solid var(--g2n-coral);
}

/* ─── Footer ──────────────────────────────── */

.app-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--text-hint);
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
}

/* ─── Confirmation mode & later vocalization edit ─────────── */
/* Appended for Kavka confirmation mode (annotation.js). Reuses brand tokens. */

/* Mode badge in the recording header */
.badge-mode {
  background: var(--g2n-blue-light);
  color: var(--g2n-blue);
}
.badge-mode em {
  font-style: italic;
  font-weight: 700;
}

/* Noise status badge (segment already annotated as noise) */
.badge-noise {
  background: var(--g2n-coral-light);
  color: var(--g2n-coral);
}

/* Confirmation question above the Yes/No/Unsure buttons */
.confirm-question {
  width: 100%;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-question em {
  font-style: italic;
  font-weight: 600;
  color: var(--g2n-forest);
}

/* "No" (species absent) — a negative label, distinct from noise */
.btn-absent {
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-absent:hover {
  background: var(--bg-hover);
}

/* Inline link in the footer of a done segment ("změnit odpověď") */
.btn-link {
  border: none;
  background: none;
  color: var(--g2n-blue);
  padding: 2px 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-link:hover {
  background: none;
  text-decoration: underline;
}

/* Muted text in summaries (absent / noise / skipped / no call type) */
.annotation-summary .muted {
  color: var(--text-hint);
  font-weight: 400;
}

/* "Yes" (species present) — gentle positive accent, not a pre-selected look */
.btn-yes {
  color: var(--g2n-forest);
  border-color: var(--g2n-mint);
}
.btn-yes:hover {
  background: var(--g2n-mint-light);
}


/* ─── Annotator picker (recordings page) ──────────────────── */

#annotator-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
#annotator-picker label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#annotator-picker select {
  padding: 7px 12px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  min-width: 220px;
}
#annotator-picker select:focus {
  outline: none;
  border-color: var(--g2n-blue);
  box-shadow: 0 0 0 3px var(--g2n-blue-light);
}

/* ─── "Annotating as …" line (annotation page header) ─────── */

.annotator-line {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.annotator-line strong {
  color: var(--g2n-forest);
  font-weight: 600;
}
.annotator-line.warn {
  color: var(--g2n-coral);
}
.annotator-line.warn a {
  color: var(--g2n-blue);
  font-weight: 500;
}

/* ─── Species entry screen ────────────────────────────────── */

.species-section { margin-bottom: 2rem; }
.species-section-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 0 0 0.9rem 0; display: flex; align-items: center; gap: 8px;
}
.species-section-title .count {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-subtle, #eee); border-radius: 10px; padding: 1px 9px;
}
.species-section-empty { font-size: 0.9rem; padding: 0.5rem 0; }

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.species-tile {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card, #fff); border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius-lg, 12px); padding: 0.9rem 1rem;
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}
.species-tile:hover {
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  border-color: var(--g2n-blue, #2b5a8c);
}
.species-tile.is-done { opacity: 0.72; border-color: var(--g2n-forest, #0F6E56); }
.species-tile.is-done:hover { opacity: 1; }

/* Only the two extremes get an outline. On a grid of 23, colouring every state
   turns the screen into a traffic light and stops signalling anything. */
.species-tile.is-stalled { border-color: var(--pending-text, #993C1D); }

.species-tile.is-not-ready {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
.species-tile.is-not-ready:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border, #e0e0e0);
}

.species-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.species-name { font-size: 1rem; font-weight: 700; color: var(--text, #222); }
.species-done-badge { color: var(--g2n-forest, #0F6E56); font-weight: 700; }
.species-latin { font-size: 0.8rem; font-style: italic; color: var(--text-secondary, #666); margin-top: 1px; }

.species-sides { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 5px; }
.species-side { display: flex; align-items: center; gap: 7px; }
.species-side-label {
  font-size: 0.7rem; color: var(--text-secondary, #666);
  width: 52px; flex: none;
}
.species-progress-track {
  flex: 1; height: 5px; background: var(--bg-subtle, #eee);
  border-radius: 3px; overflow: hidden;
}
.species-progress-fill { height: 100%; border-radius: 3px; }
.species-progress-fill.is-heldout { background: #D85A30; }
.species-progress-fill.is-train { background: var(--g2n-mint, #3aa981); }
.species-progress-fill.is-met { background: var(--g2n-forest, #0F6E56); }
.species-progress-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary, #666);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

.species-footnote { font-size: 0.72rem; color: var(--text-secondary, #666); margin-top: 0.6rem; }
.species-footnote.warn { color: var(--pending-text, #993C1D); }

/* ─── Back navigation (two levels up) ────────────────────── */

.back-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 0.8rem;
}

/* ─── Custom audio player ─────────────────────────────────── */

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.audio-player audio {
  display: none;   /* the element still drives everything, we just draw our own UI */
}

.play-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  color: #fff;
  background: var(--g2n-blue, #2b5a8c);
  transition: background 0.12s ease, transform 0.08s ease;
}
.play-btn:hover { transform: scale(1.06); }
.audio-player.is-playing .play-btn { background: var(--g2n-forest, #0F6E56); }

.player-track {
  flex: 1;
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: #E6E4DE;          /* empty track */
  cursor: pointer;
  overflow: hidden;
}
.player-buffered {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #C9C6BC;          /* loaded — muted grey, clearly "not playback" */
}
.player-played {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--g2n-forest, #0F6E56);   /* playback — strong, unmistakable */
  border-radius: 5px;
}

.player-time {
  flex: 0 0 auto;
  min-width: 84px;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary, #666);
}

/* ── Access gate overlay ───────────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--g2n-dark, #1a2b28);
  display: flex;
  align-items: center;
  justify-content: center;
}
#auth-overlay .auth-box {
  text-align: center;
  color: #fff;
  max-width: 320px;
  padding: 2rem;
}
#auth-overlay .auth-logo {
  width: 64px;
  margin-bottom: 1rem;
}
#auth-overlay h1 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}
#auth-overlay p {
  opacity: 0.8;
  margin: 0 0 1.5rem;
}
#auth-overlay input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  box-sizing: border-box;
}
#auth-overlay button {
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: var(--g2n-mint, #3bbfa0);
  color: #12211e;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
#auth-overlay button:disabled {
  opacity: 0.6;
  cursor: default;
}
#auth-overlay #auth-error {
  color: #ff9a9a;
  min-height: 1.2em;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.6rem;
  color: var(--g2n-mint, #3bbfa0);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ─── Working set admin ───────────────────── */

.set-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.set-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.set-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.set-side {
  font-size: 1.05rem;
  font-weight: 600;
}

.set-side-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.set-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.set-table td {
  padding: 4px 0;
  color: var(--text-secondary);
}

.set-table td.set-value {
  text-align: right;
  color: var(--text);
}

.set-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.set-controls label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.set-input {
  width: 72px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
}

.set-controls .btn {
  margin-left: auto;
}

.set-note {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.set-index {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.set-index th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-hint);
  border-bottom: 1px solid var(--border-light);
}

.set-index th.num,
.set-index td.num {
  text-align: right;
  white-space: nowrap;
}

.set-index td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.set-index tbody tr {
  cursor: pointer;
}

.set-index tbody tr:hover {
  background: var(--bg-hover);
}

.set-index tbody tr:last-child td {
  border-bottom: none;
}

.set-index-name {
  font-weight: 500;
}

.set-index-latin {
  display: block;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary);
}

.set-index-warn {
  color: var(--pending-text);
}

/* ─── Working set help ────────────────────── */

.set-help {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.set-help summary {
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--g2n-blue);
  list-style: none;
}

.set-help summary::-webkit-details-marker {
  display: none;
}

.set-help summary::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--g2n-blue-light);
  color: var(--g2n-blue);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: -3px;
}

.set-help[open] summary {
  border-bottom: 1px solid var(--border-light);
}

.set-help-body {
  padding: 1.1rem 1.5rem 1.3rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.set-help-body p {
  margin-bottom: 0.9rem;
}

.set-help-body h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-hint);
  margin: 1.2rem 0 0.5rem;
}

.set-help-body ul {
  margin: 0 0 0.9rem 1.1rem;
}

.set-help-body li {
  margin-bottom: 0.5rem;
}

.set-help-body strong {
  color: var(--text);
  font-weight: 500;
}

/* ─── Recording with no candidates ────────── */
/* Rendered as a div rather than a link, so the hover affordances of
   .recording-card have to be undone explicitly. */

.recording-card.is-unselected {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.recording-card.is-unselected:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.recording-card.is-unselected .recording-progress {
  color: var(--text-hint);
  font-weight: 400;
}

.species-personal {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.species-personal.muted { color: var(--text-hint); }


.set-topup {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-light);
}

.set-topup-head {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-hint);
  margin-bottom: 0.5rem;
}

.species-personal-left {
  margin-top: 2px;
  color: var(--text-hint);
}

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

.auth-notice {
  margin-top: 1.6rem;
  padding: 0.9rem 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.auth-notice-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f0c674;
  margin-bottom: 0.4rem;
}

.auth-notice p {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #d3ddd9;
}

.auth-notice p:last-child {
  margin-bottom: 0;
}

.auth-notice strong {
  color: #ffffff;
  font-weight: 600;
}


/* ─── Annotator help panel ────────────────── */

.help-button {
  float: right;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.help-button:hover {
  border-color: var(--g2n-blue);
  color: var(--g2n-blue);
}

.help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 900;
}

.help-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  background: var(--bg-card, #ffffff);
  border-left: 1px solid var(--border-light);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.10);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 901;
  display: flex;
  flex-direction: column;
}

.help-panel.is-open {
  transform: translateX(0);
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border-light);
  flex: none;
}

.help-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.help-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0.2rem;
}

.help-body {
  padding: 1.1rem 1.35rem 2rem;
  overflow-y: auto;
}

.help-body h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-hint);
  margin: 1.3rem 0 0.4rem;
}

.help-body h4:first-child {
  margin-top: 0;
}

.help-body p {
  margin: 0 0 0.6rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.help-body strong {
  color: var(--text);
  font-weight: 600;
}

.help-verdicts {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.5;
}

.help-verdicts td:first-child {
  padding: 3px 10px 3px 0;
  white-space: nowrap;
  vertical-align: top;
  font-weight: 600;
  color: var(--text);
}

.help-verdicts td:last-child {
  padding: 3px 0;
  color: var(--text-secondary);
}

/* A species somebody has asked for stops being greyed out — the one bit of
   feedback the press needs, and it tells it apart from the rest without
   suggesting anything has happened to it. */
.species-tile.is-not-ready.is-wanted {
  opacity: 1;
  border-color: var(--g2n-forest, #0F6E56);
}

.species-interest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.species-interest-label {
  font-size: 0.72rem;
  color: var(--text-hint);
}

.species-tile.is-wanted .species-interest-label {
  color: var(--g2n-forest, #0F6E56);
}

.species-interest-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.5;
}

.species-interest-btn.is-on {
  filter: none;
  opacity: 1;
}

.species-interest-btn:disabled {
  cursor: default;
}

.set-index-who {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Other annotators' verdicts ──────────── */

.others-tally {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.others-empty {
  font-size: 0.78rem;
  color: var(--text-hint);
}

/* ─── Five-answer verdict buttons ─────────── */

.verdict-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  width: 100%;
}

.btn-verdict {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  text-align: left;
  white-space: normal;
}

.verdict-main {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 600;
}

.verdict-icon {
  width: 1em;
  text-align: center;
}

.verdict-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-hint);
}

/* The answer given, shown in place of the buttons once a segment is judged. */
.verdict-given {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.verdict-given.btn-yes { color: var(--g2n-forest); border-color: var(--g2n-mint); background: var(--g2n-mint-light); }
.verdict-given.btn-noise { color: var(--g2n-coral); border-color: var(--g2n-coral); background: var(--g2n-coral-light); }
.verdict-given.btn-skip { color: var(--text-hint); }

/* The answer given is a label, not a button. It borrows the verdict's class for
   its colours, and with them the button's hover — which on "Ne" changed the
   background under the pointer as if it could be clicked. */
.verdict-given.btn-absent { color: var(--text-secondary); }
.verdict-given:hover { background: var(--bg); cursor: default; }
.verdict-given.btn-yes:hover { background: var(--g2n-mint-light); }
.verdict-given.btn-noise:hover { background: var(--g2n-coral-light); }

/* Footer under a judged segment: call type left, others' verdicts right. */
.segment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.segment-foot strong {
  color: var(--text);
  font-weight: 600;
}

.foot-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Help panel: what changed ────────────── */

.help-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #9a5a1c;
  background: #fdf0e3;
  border: 1px solid #f0cfa8;
  border-radius: 6px;
  vertical-align: 1px;
}

.help-verdicts td:first-child .help-tag {
  margin-left: 0;
  margin-top: 3px;
}


/* ─── Which side a recording serves ───────── */
/* Two hues that nothing else in the UI uses. Amber and mint were the obvious
   pair but both already carry a status meaning on this screen — "čeká" and
   "hotovo" — and a mark that looks like a status would be read as one. */

:root {
  --side-train: #2f7d6b;
  --side-train-bg: #e4f2ee;
  --side-train-border: #b6ddd3;
  --side-eval: #6d54b8;
  --side-eval-bg: #eee9fa;
  --side-eval-border: #cfc2ee;
}

.side-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 9px 2px 7px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.side-mark .side-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.side-mark.side-train {
  color: var(--side-train);
  background: var(--side-train-bg);
  border-color: var(--side-train-border);
}

.side-mark.side-eval {
  color: var(--side-eval);
  background: var(--side-eval-bg);
  border-color: var(--side-eval-border);
}

/* The stripe: scanning a long list should not need reading. Only on the list —
   the annotation header is not a card and has nothing to scan. */

.recording-card {
  position: relative;
  overflow: hidden;
}

.recording-card.side-train,
.recording-card.side-eval {
  padding-left: calc(1.35rem + 6px);
}

.recording-card.side-train::before,
.recording-card.side-eval::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.recording-card.side-train::before { background: var(--side-train); }
.recording-card.side-eval::before  { background: var(--side-eval); }

/* The title row now holds the place name and the mark. It wraps rather than
   squeezing: on a narrow screen the mark drops to its own line instead of
   crushing a long location name. */

.recording-card .location {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.recording-card .location-text {
  min-width: 0;
}

.recording-card .location .side-mark {
  margin-left: auto;
}

/* ─── View switch (page header) ─────────────
   Shown only to an annotator who may switch between the ordinary view and the
   training view of confirmed segments. Pushed to the right edge, next to the
   decorative waveform. */

.view-switch {
  display: inline-flex;
  margin-left: auto;
  margin-right: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  overflow: hidden;
}

.view-switch button {
  min-height: 32px;
  padding: 4px 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.view-switch button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.view-switch button[aria-pressed="true"] {
  background: var(--g2n-mint);
  color: var(--g2n-dark);
  font-weight: 600;
}

.view-switch button:focus-visible {
  outline: 2px solid white;
  outline-offset: -2px;
}

@media (max-width: 640px) {
  .app-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .view-switch {
    order: 3;
    margin: 0;
  }
}

/* ─── Voice types, given with the answer ────
   Three toggles above the answers, any combination. Pressed is dark with a
   check, so the state does not rest on colour alone. While any is on, the
   answers other than "Ano" are muted: the types go with "Ano" only. Muted is
   visual — they still work. */

.type-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.type-toggles-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-right: 4px;
}

.type-toggle {
  min-height: 34px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
}

.type-toggle:hover {
  background: var(--bg-hover);
}

.type-toggle[aria-pressed="true"] {
  background: var(--g2n-dark);
  border-color: var(--g2n-dark);
  color: white;
  font-weight: 600;
}

.type-toggle[aria-pressed="true"]::before {
  content: "✓ ";
}

.verdict-buttons.has-types .btn-verdict:not(.btn-yes) {
  opacity: 0.55;
}

.verdict-buttons.has-types .btn-yes .verdict-sub {
  color: var(--g2n-forest);
  font-weight: 600;
}

/* The types given, next to the answer in the summary of a done segment. */
.voc-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg-hover);
  font-size: 0.78rem;
  color: var(--text);
}

/* ─── Further species, given with the answer ──
   A row above the answers: picked species as chips, then a link that opens a
   search field. Closed until asked for, so the one-question flow is unchanged
   for anyone who does not need it. */

.other-species {
  margin-bottom: 10px;
}

.other-species-row,
.other-species-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.other-species-summary {
  margin-top: 8px;
}

.species-add {
  min-height: 34px;
  font-size: 0.8rem;
}

.species-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--g2n-dark);
  border-radius: 17px;
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text);
}

.species-chip button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.species-chip button:hover {
  background: var(--bg-hover);
}

.species-search {
  width: 100%;
  max-width: 360px;
  margin-top: 6px;
}

.species-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
}

.species-input:focus {
  outline: none;
  border-color: var(--g2n-blue);
  box-shadow: 0 0 0 2px var(--g2n-blue-light);
}

.species-suggestions {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.species-hint {
  padding: 4px 2px;
  font-size: 0.72rem;
  color: var(--text-hint);
}

.species-suggestion {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.species-suggestion:hover,
.species-suggestion.on {
  background: var(--g2n-blue-light);
}

.species-suggestion .latin {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-secondary);
}

/* "Ne, žádný pták" while a further species is picked: the two contradict
   each other. Dashed and greyed, and says why under its label. */
.btn-verdict:disabled {
  border-style: dashed;
  background: var(--bg);
  color: var(--text-hint);
  opacity: 1;
  cursor: not-allowed;
}

/* Further species in the summary of a done segment: outlined, so they do not
   read as the answer to the question asked. */
.species-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  font-size: 0.78rem;
  color: var(--text);
}


/* ─── Sign-in: hint, progress, notice of a changed sign-in ─── */

#auth-overlay .auth-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #d3ddd9;
}

#auth-overlay .auth-progress {
  margin: 1rem 0 0;
}

.auth-change {
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  text-align: left;
  border: 1px solid var(--g2n-mint, #3bbfa0);
  border-radius: 8px;
}

.auth-change-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--g2n-mint, #3bbfa0);
  margin-bottom: 0.4rem;
}

#auth-overlay .auth-change p {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #d3ddd9;
  opacity: 1;
}

#auth-overlay .auth-change p:last-child {
  margin-bottom: 0;
}

.auth-change strong {
  color: #ffffff;
  font-weight: 600;
}
