/* TalkTel — palette drawn from Burmese lacquerware: lacquer red, jade green, aged gold on a cool paper ground */
:root {
  --paper: #edf1ee;
  --surface: #f8faf8;
  --ink: #17211e;
  --muted: #55645e;
  --line: #c7d1cb;
  --lacquer: #b8321b;
  --lacquer-deep: #8e2210;
  --jade: #1f6b58;
  --gold: #8a5d0c;
  --font: "Source Sans 3", "Noto Sans Myanmar", "Padauk", "Myanmar Text", system-ui, sans-serif;
  --nav-h: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;              /* Myanmar script needs generous leading */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
[hidden] { display: none !important; }

h1, h2 { margin: 0; line-height: 1.4; font-weight: 600; }
h1 { font-size: 20px; letter-spacing: 0.01em; }
h2 { font-size: 17px; }
p { margin: 0 0 8px; }
a { color: var(--jade); }
.muted { color: var(--muted); font-size: 15px; }
.strong { font-weight: 600; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
  background: var(--ink); color: #f1f4f2;
}
.badge { font-size: 13px; padding: 1px 10px; border-radius: 99px; background: var(--gold); color: #fff; }
.badge.online { background: var(--jade); }

main { max-width: 720px; margin: 0 auto; padding: 0 18px; }
.view { padding-top: 20px; }

/* ---------- Record (the one memorable element) ---------- */
.rec { display: flex; flex-direction: column; align-items: center; padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.ringwrap { position: relative; width: 196px; height: 196px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 3; }
.ring-progress {
  fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 515.2; stroke-dashoffset: 515.2;
}
.recbtn {
  width: 148px; height: 148px; border-radius: 50%; border: 0;
  background: var(--lacquer); color: #fff7f3; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.12);
  transition: background 0.15s;
}
.recbtn:hover { background: var(--lacquer-deep); }
.recbtn.live { background: var(--ink); }
.recbtn.paused { background: var(--gold); }
.timer { font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 600; }
.recbtn.live #micIcon, .recbtn.paused #micIcon { width: 26px; height: 26px; }
.recstatus { margin: 12px 0 8px; text-align: center; min-height: 30px; }
.reccontrols { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }

/* ---------- Buttons & fields ---------- */
.btn {
  font: inherit; min-height: 46px; padding: 8px 18px; border-radius: 8px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer;
}
.btn:hover { background: rgba(23, 33, 30, 0.07); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #0d1513; }
.btn-danger { border-color: var(--lacquer); color: var(--lacquer); }
.btn-danger:hover { background: rgba(184, 50, 27, 0.08); }
.btn-wide { width: 100%; margin: 14px 0; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.linkbtn { font: inherit; background: none; border: 0; color: var(--jade); text-decoration: underline; padding: 10px 6px; min-height: 44px; cursor: pointer; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

label { display: block; margin: 14px 0 0; font-weight: 600; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; min-height: 46px;
  font: inherit; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px;
}
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin: 0; }
textarea { resize: vertical; line-height: 1.7; }
:focus-visible { outline: 3px solid var(--jade); outline-offset: 2px; }

/* ---------- Rows (lists use hairlines, not cards) ---------- */
.block { padding-top: 20px; }
.blockhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.rowlink {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0;
  padding: 12px 2px; cursor: pointer; text-decoration: none;
}
.rowlink:hover { background: rgba(255, 255, 255, 0.55); }
.rowtitle { font-weight: 600; display: block; overflow-wrap: anywhere; }
.rowmeta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.rowsum { display: block; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.status { font-size: 13px; padding: 0 9px; border-radius: 99px; border: 1px solid currentColor; line-height: 1.6; }
.s-saved { color: var(--jade); }
.s-needs_review, .s-processing, .s-transcribing, .s-transcribed { color: var(--gold); }
.s-error { color: var(--lacquer); }
.s-draft { color: var(--muted); }
.job { padding: 12px 2px; }
.job .row { margin: 8px 0 0; }
.job .btn { min-height: 40px; padding: 4px 14px; }
.empty { color: var(--muted); padding: 14px 2px; }

.panel { border: 1.5px solid var(--line); border-radius: 8px; padding: 14px; margin-top: 16px; background: var(--surface); }
.panel audio { width: 100%; margin: 8px 0; }
.notice { border-left: 4px solid var(--gold); background: var(--surface); padding: 10px 14px; margin: 0 0 14px; }
.notice.bad { border-color: var(--lacquer); }
.notice.good { border-color: var(--jade); }

/* ---------- Notes / filters ---------- */
.searchbar { position: sticky; top: 52px; background: var(--paper); padding: 4px 0 6px; z-index: 2; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.filters select:last-child { grid-column: 1 / -1; }

/* ---------- Note editor ---------- */
.noteform h2 { margin-top: 24px; }
.ai-row { display: grid; grid-template-columns: 1fr 112px 46px; gap: 8px; align-items: start; margin-top: 8px; }
.ai-row input, .ai-row select { margin-top: 0; }
.ai-row .iconbtn { min-height: 46px; width: 46px; padding: 0; }
details.transcript { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 10px; }
details.transcript summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.backlink { display: inline-block; margin-bottom: 6px; }

/* ---------- Bottom nav ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a {
  display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--muted);
  border-top: 3px solid transparent; margin-top: -1px; font-weight: 600;
}
.tabs a.active { color: var(--ink); border-top-color: var(--lacquer); }

/* ---------- Toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  max-width: min(92vw, 520px); padding: 10px 18px; border-radius: 8px;
  background: var(--ink); color: #fff; z-index: 30;
}
.toast.bad { background: var(--lacquer-deep); }
.dlg { border: 0; border-radius: 10px; padding: 20px; width: min(92vw, 440px); background: var(--surface); color: var(--ink); }
.dlg::backdrop { background: rgba(23, 33, 30, 0.55); }
.dlgbtns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

@media (min-width: 720px) {
  .view { padding-top: 32px; }
  .filters { grid-template-columns: 1fr 1fr 1.4fr; }
  .filters select:last-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
