:root {
  --bg: #f5f7fb; --card: #fff; --line: #e2e7ef; --ink: #1b2333; --muted: #5d677a;
  --blue: #2f6fd0; --blue-soft: #eaf2fd;
  --green: #22844f; --green-bg: #e7f6ee;
  --amber: #b4600b; --amber-bg: #fff3e0;
  --red: #c0392b; --red-bg: #fdecea;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; font-family: 'Assistant', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #8ab4f8; outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.wrap { max-width: 780px; margin: 0 auto; padding: 20px 16px 200px; }

h1 { font-size: 1.6rem; margin: 6px 0 2px; line-height: 1.25; }
h2 { font-size: 1.25rem; margin: 30px 0 12px; display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); }
.small { font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 20px; font-weight: 700; min-height: 48px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.big { width: 100%; font-size: 1.15rem; padding: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 8px 0; }
.link.danger { color: var(--red); font-weight: 600; }

/* Login */
.login { max-width: 380px; margin: 12vh auto; text-align: center; }
.login input { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; margin: 14px 0; text-align: center; font-size: 1.1rem; }
.err { color: var(--red); font-weight: 600; }

/* Upload */
.upload { text-align: center; padding: 26px 20px; }
.upload h1 { margin-bottom: 4px; }
.drop { display: block; cursor: pointer; margin: 18px 0 14px; border: 2.5px dashed #b9cbe6; border-radius: var(--radius); padding: 30px 16px; background: #f9fbff; position: relative; transition: .15s; }
.drop.over { border-color: var(--blue); background: var(--blue-soft); }
.drop.ok { border-color: var(--green); background: var(--green-bg); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .big-ico { font-size: 2.4rem; display: block; }
.drop b { font-size: 1.1rem; }
.field { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.field input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.bar { height: 10px; background: var(--line); border-radius: 10px; overflow: hidden; margin-top: 12px; }
.bar div { height: 100%; background: var(--blue); width: 0; transition: width .4s; }

/* Recordings list */
.rec { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.rec:hover { border-color: #b8cbe8; }
.rec .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; flex: none; background: var(--blue-soft); }
.rec .dot.good { background: var(--green-bg); } .rec .dot.mixed { background: var(--amber-bg); } .rec .dot.concerning { background: var(--red-bg); }
.rec .main { flex: 1; min-width: 0; }
.rec .t { font-weight: 800; font-size: 1.1rem; }
.rec .s { color: var(--muted); font-size: .92rem; }
.rec .chev { color: var(--muted); font-size: 1.4rem; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: .85rem; font-weight: 700; }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.gray { background: #eef1f5; color: var(--muted); }

/* Recording page */
.back { margin-bottom: 4px; }
.verdict { border: 0; padding: 22px; }
.verdict.good { background: var(--green-bg); } .verdict.mixed { background: var(--amber-bg); } .verdict.concerning { background: var(--red-bg); } .verdict.none { background: var(--blue-soft); }
.verdict .vh { display: flex; gap: 12px; align-items: center; font-size: 1.35rem; font-weight: 800; }
.verdict .vh .ico { font-size: 2rem; }
.verdict p { margin: 10px 0 0; font-size: 1.05rem; }
.verdict .more { margin-top: 6px; }
.counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 0; }
.count { background: rgba(255,255,255,.75); border-radius: 14px; padding: 10px 14px; }
.count b { font-size: 1.5rem; display: block; line-height: 1.2; }

.moment { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start; }
.moment.attn { border-inline-start: 6px solid var(--amber); }
.moment.attn.high { border-inline-start-color: var(--red); }
.moment.good { border-inline-start: 6px solid var(--green); }
.moment.dim { opacity: .75; }
.playbtn { grid-row: span 3; width: 74px; border: 0; border-radius: 16px; background: var(--blue-soft); color: var(--blue); font-weight: 800; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 74px; justify-content: center; }
.playbtn .tri { font-size: 1.4rem; line-height: 1; }
.playbtn .tm { direction: ltr; font-size: .95rem; }
.playbtn:hover { background: #d8e7fb; }
.moment .ttl { font-weight: 800; font-size: 1.1rem; }
.moment .quote { color: var(--muted); font-style: italic; }
.moment .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.moment.playing { box-shadow: 0 0 0 3px var(--blue); }

details.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
details.section > summary { list-style: none; padding: 16px 20px; font-weight: 800; font-size: 1.1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: '▾'; color: var(--muted); }
details.section[open] > summary::after { content: '▴'; }
details.section .inner { padding: 0 20px 16px; }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f2f6; }
.row:first-child { border-top: 0; }
.tbtn { border: 1px solid #cfe0f5; background: #fff; color: var(--blue); font-weight: 800; border-radius: 999px; padding: 4px 14px; direction: ltr; min-height: 38px; white-space: nowrap; }
.tbtn:hover { background: var(--blue-soft); }

.search { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.utt { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid #f0f2f6; }
.utt .who { font-size: .8rem; font-weight: 700; border-radius: 8px; padding: 1px 8px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.utt .who.staff { background: #e6edfb; color: #36569e; } .utt .who.child { background: #fdf0df; color: #96590f; }
.utt.hl { background: #fffbe6; }
mark { background: #ffe58a; border-radius: 3px; }

.steps { list-style: none; padding: 0; margin: 16px 0 0; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--muted); font-size: 1.05rem; }
.steps li .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; font-size: .95rem; flex: none; }
.steps li.done { color: var(--ink); } .steps li.done .ic { background: var(--green-bg); color: var(--green); }
.steps li.cur { color: var(--ink); font-weight: 800; } .steps li.cur .ic { background: var(--blue); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.note-add { display: flex; gap: 8px; }
.note-add input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.hint { background: var(--blue-soft); color: #24508e; border-radius: 14px; padding: 12px 16px; font-size: .95rem; margin-bottom: 14px; }

/* Player */
.player { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); padding: 8px 16px 12px; box-shadow: 0 -8px 24px rgba(20,40,80,.08); z-index: 10; }
.player > * { max-width: 780px; margin-inline: auto; }
.now { font-size: .9rem; color: var(--muted); min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { position: relative; height: 26px; background: #edf0f5; border-radius: 8px; cursor: pointer; direction: ltr; overflow: hidden; margin: 4px auto 8px; }
.tl-progress { position: absolute; inset: 0 auto 0 0; background: rgba(47,111,208,.18); width: 0; }
.tl-knob { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--blue); left: 0; }
.mk { position: absolute; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; margin-left: -2px; }
.mk.attn { background: var(--amber); } .mk.attn.high { background: var(--red); } .mk.good { background: var(--green); }
.mk.note { background: #7a4ed8; top: 0; bottom: 16px; width: 4px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ctl { border: 1px solid var(--line); background: #fff; border-radius: 14px; min-width: 56px; height: 48px; font-weight: 800; }
.ctl.play { width: 64px; height: 56px; border-radius: 50%; background: var(--blue); border: 0; color: #fff; font-size: 1.4rem; }
.time { direction: ltr; font-weight: 700; min-width: 110px; text-align: center; }

.toast { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 30; font-weight: 600; max-width: 90vw; text-align: center; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,50,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 22px; max-width: 420px; width: 100%; }
.modal .acts { display: flex; gap: 10px; margin-top: 16px; }

@media (max-width: 560px) {
  html { font-size: 17px; }
  .time { min-width: 0; font-size: .9rem; }
  .ctl { min-width: 48px; }
  .playbtn { width: 64px; }
}
