/* Straka — Bird Voice CE review UI
   ─────────────────────────────────────────────
   Straka's own look, deliberately not Kavka's: a different tool for a different
   audience. Nothing here is shared with kavka/css/style.css. */

:root {
  --green: #1f6b54;
  --green-dark: #154d3c;
  --green-tint: #e3f1ea;
  --warn: #c2410c;
  --warn-tint: #fdf3ec;

  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-alt: #fafaf7;
  --chip: #efeee8;

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

  --border: #dcdad1;
  --border-strong: #c9c7bd;
  --border-light: #efeee8;

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

  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { 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(--green); }
a:hover { color: var(--green-dark); }

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

[hidden] { display: none !important; }

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

/* ─── 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(--green); flex-shrink: 0; }
.brand.large { font-size: 22px; }

.trail { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trail .sep { color: var(--text-4); }
.trail a, .trail span:not(.sep) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trail a { text-decoration: none; }

.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(--green);
  font-size: 14px;
  cursor: pointer;
  margin-left: 14px;
}
button.link:hover { color: var(--green-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;
}

.empty {
  margin-top: 16px;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-3);
  background: var(--surface-alt);
  border-radius: var(--radius);
}
.empty p { margin: 0; }
.empty p + p { margin-top: 4px; }
.empty strong { color: var(--text-2); font-weight: 500; }

/* ─── Buttons and fields ──────────────────── */

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

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

input[type="email"],
input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.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: 400px; padding: 32px; }
.login .lead { margin: 12px 0 24px; color: var(--text-2); }
.login form { display: flex; flex-direction: column; }
.login input { margin-bottom: 16px; }
.login button.primary { margin-top: 8px; margin-bottom: 12px; }
.login .hint { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .page { padding: 16px; }
  .trail { display: none; }
}

/* ─── Consent ─────────────────────────────── */

body.centered.top { align-items: flex-start; padding-top: 48px; }

.consent { width: 100%; max-width: 720px; padding: 32px 40px; }

.consent-head {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.consent-title { margin: 4px 0 16px; font-size: 24px; }

.notice {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warn-tint);
  color: var(--warn);
  font-size: 14px;
  font-weight: 500;
}

.terms p { margin: 0 0 16px; color: var(--text-2); }

.points {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: none;
}
.points li {
  position: relative;
  padding: 14px 16px 14px 52px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
/* The number comes from the text itself (li.value), so the points keep the
   numbers the wording gives them. */
.points li::before {
  content: attr(value);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green-dark);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 24px;
  text-align: center;
}
.points strong { display: block; font-weight: 600; color: var(--text); }
.points span { display: block; margin-top: 2px; color: var(--text-2); }

.agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.agree input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--green);
  cursor: pointer;
}

.consent-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  body.centered.top { padding: 0; }
  .consent { padding: 24px 16px; border-radius: 0; border-left: none; border-right: none; }
  .consent-foot { flex-direction: column-reverse; align-items: stretch; }
}

/* ─── Upload ──────────────────────────────── */

.card-head, .card-foot { display: flex; align-items: center; gap: 14px; }
.card-foot { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.card-foot p { margin: 0; max-width: 640px; }

.hint { font-size: 13px; color: var(--text-3); }

button.secondary {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
button.secondary:hover { background: var(--surface-alt); }
button.secondary:disabled { opacity: 0.6; cursor: default; }

.messages {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warn-tint);
  color: var(--warn);
  font-size: 14px;
}
.messages p { margin: 0; }

.upload-body { display: flex; gap: 24px; align-items: flex-start; margin-top: 16px; }
.files { flex: 1; min-width: 0; overflow-x: auto; }

.file-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 70px 205px 190px 140px 24px;
  gap: 12px;
  align-items: center;
  min-width: 880px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  border-left: 3px solid transparent;
}
.file-head {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom-color: var(--border);
}
.file-row.item { cursor: pointer; }
.file-row.missing { background: var(--warn-tint); }
.file-row.selected { border-left-color: var(--green); }
.file-row.done { cursor: default; color: var(--text-3); }

.file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 12px; color: var(--text-3); }
.file-sub.bad { color: var(--warn); }
.file-sub.good { color: var(--green-dark); }
.mono { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

.chip {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}

.place { display: flex; align-items: center; gap: 6px; min-width: 0; }
.place svg { flex-shrink: 0; color: var(--green); }
.place.none, .place.none svg { color: var(--warn); font-weight: 500; }

.file-row input[type="text"],
.file-row input[type="datetime-local"] {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.file-row input.needed { border-color: var(--warn); }

button.remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-4);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
button.remove:hover { background: var(--chip); color: var(--text); }

.bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.2s; }

.map-panel { width: 340px; flex-shrink: 0; }
.map {
  height: 270px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  /* Leaflet's panes carry high z-indexes; keep them inside this box. */
  isolation: isolate;
}
.map.pick { cursor: crosshair; }
.map-caption { margin: 8px 0 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.map-panel button.link { margin: 6px 0 0; font-size: 13px; text-align: left; }

@media (max-width: 1100px) {
  .upload-body { flex-direction: column; }
  .map-panel { width: 100%; }
}
@media (max-width: 640px) {
  .card-head, .card-foot { flex-wrap: wrap; }
}

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

.recordings { margin-top: 16px; overflow-x: auto; }

.rec-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 100px 240px 210px;
  gap: 12px;
  align-items: center;
  min-width: 760px;
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}
.rec-head {
  padding-top: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom-color: var(--border);
}

.rec-state { font-size: 14px; }
.rec-state.wait { color: var(--text-3); }
.rec-state.bad { color: var(--warn); font-weight: 500; }
.rec-state.done { color: var(--green-dark); }
.rec-state.done .bar i { background: var(--green); }

.rec-action { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.rec-action button.link { margin: 0; white-space: nowrap; }

a.button {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
a.button:hover { background: var(--green); color: #ffffff; }

/* ─── Review ──────────────────────────────── */

.segmented { display: inline-flex; }
.segmented button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.segmented button + button { border-left: none; }
.segmented button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.segmented button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.segmented button.on {
  background: var(--green-tint);
  color: var(--green-dark);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--green);
}

.overview-card { padding: 16px 24px; }
.progress-count { font-size: 14px; font-weight: 500; white-space: nowrap; }
.overview { display: block; width: 100%; height: 44px; margin-top: 12px; border-radius: 6px; cursor: pointer; }
.overview-times {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

#review { display: flex; flex-direction: column; gap: 24px; }
.review-body { display: flex; gap: 24px; align-items: flex-start; }
.review-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.event-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; }
.event-title { font-size: 20px; font-weight: 600; }
.event-time { font-size: 15px; color: var(--text-2); }

.spectro { position: relative; border-radius: var(--radius); overflow: hidden; background: #0f1d19; }
.spectro canvas { display: block; width: 100%; height: 300px; }
.spectro #spectro-overlay { position: absolute; inset: 0; }
.spectro-status {
  position: absolute;
  left: 44px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(11, 22, 19, 0.75);
  color: #c9f2e0;
  font-size: 13px;
}

.play-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
button.play {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
button.play:hover, button.play.on { background: var(--green-dark); }

.neighbours { display: flex; flex-direction: column; margin-top: 12px; }
.neighbour {
  display: grid;
  grid-template-columns: 90px 60px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border-light);
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.neighbour:hover { background: var(--surface-alt); }
.neighbour.on { border-left-color: var(--warn); background: var(--warn-tint); }
.neighbour span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.answer-panel { width: 360px; flex-shrink: 0; }
.answer-panel label { margin-top: 16px; }
.answer-panel input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.current-answer {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 14px;
}

.key {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
}

.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked:not(:empty) { margin-bottom: 8px; }
.chosen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  border-radius: 14px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 500;
}
.chosen button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.chosen button:hover { background: rgba(21, 77, 60, 0.15); }

.suggestions { display: flex; flex-direction: column; margin-top: 6px; min-height: 8px; }
.suggestions .hint { padding: 4px 2px; }
.suggestion {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.suggestion:hover, .suggestion.on { background: var(--green-tint); }
.suggestion .latin { font-size: 12px; font-style: italic; color: var(--text-3); }

.answer-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
button.answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
button.answer:hover:not(:disabled) { background: var(--surface-alt); }
button.answer:disabled { opacity: 0.5; cursor: default; }
button.answer.primary-answer:not(:disabled) { border-color: var(--green); background: var(--green); color: #ffffff; font-weight: 600; }
button.answer.primary-answer:not(:disabled) .key { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); color: #ffffff; }
button.link:disabled { color: var(--text-4); cursor: default; text-decoration: none; }

.or { margin: 16px 0 2px; font-size: 13px; color: var(--text-3); text-align: center; }

@media (max-width: 1100px) {
  .review-body { flex-direction: column; }
  .answer-panel { width: 100%; }
}

/* Sign-in through the identity tenant: one button, or a line while signing in */
.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; }
/* Signed in, but Straka is not open to the account */
.login-no-access { margin: 0 0 12px; color: var(--text-2); }
.login-no-access p { margin: 0 0 8px; }
