:root {
  --c: #7a1f3d; --c2: #a33a5c; --bg: #faf7f5; --card: #fff; --ink: #1f1a1c; --muted: #6f6669; --line: #e8e1df;
  --ok: #1f7a4d; --warn: #9a6b00; --danger: #b3261e; --live: #d0342c; --r: 14px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-tap-highlight-color: transparent; }
a { color: var(--c); }
h1 { font-size: 1.45rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
h3 { font-size: .95rem; margin: .8rem 0 .3rem; }
.pad { padding: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.cap { text-transform: capitalize; }
.pre { white-space: pre-wrap; }
.wrap { word-break: break-all; display: block; margin: .4rem 0; }
.err-text { color: var(--danger); }
.shell main { max-width: 760px; margin: 0 auto; padding: 0 1rem calc(80px + env(safe-area-inset-bottom)); }
.page { padding-top: max(.6rem, env(safe-area-inset-top)); }
section { margin-bottom: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; margin-bottom: .8rem; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: .45rem 0 .5rem; font-size: .72rem; color: var(--muted); text-decoration: none; }
.tabbar a .ti { font-size: 1.25rem; line-height: 1.3; }
.tabbar a.on { color: var(--c); font-weight: 600; }

.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: .6rem .95rem; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--c); border-color: var(--c); color: #fff; }
.btn.danger { color: var(--danger); border-color: #e9c3c0; }
.btn.big { padding: .95rem 1rem; font-size: 1.05rem; font-weight: 600; }
.btn.block { display: block; width: 100%; margin: .5rem 0; }
.btn.small { padding: .3rem .6rem; font-size: .82rem; }
.btn.link { border: 0; background: none; color: var(--c); padding: .3rem 0; }
.icon-btn { border: 0; background: none; font-size: 1.2rem; cursor: pointer; padding: .2rem .5rem; }
.btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.btns .btn.block { margin: 0; }

input, select, textarea { font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
label { display: block; font-size: .88rem; font-weight: 500; margin: .55rem 0; }
label > input, label > select, label > textarea { margin-top: .25rem; font-weight: 400; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: .4rem .8rem .8rem; margin: .6rem 0; }
legend { font-size: .88rem; font-weight: 600; padding: 0 .3rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.inline { display: flex; gap: .5rem; margin-top: .5rem; }
.form .btn.primary { margin-top: .6rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: .8rem; }

.row-link { text-decoration: none; color: inherit; display: block; }
.row { display: flex; gap: .6rem; align-items: center; justify-content: space-between; padding: .7rem .2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.row.live { background: #fff4f3; border-radius: 10px; padding: .7rem .6rem; }
.row.unread .row-title { font-weight: 700; }
.row.inactive { opacity: .55; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 550; overflow-wrap: anywhere; }
.row-title.done { text-decoration: line-through; color: var(--muted); }
.row-side { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.row-side.col { flex-direction: column; align-items: stretch; width: 44%; }
.row-side select { width: auto; max-width: 11rem; padding: .35rem; font-size: .85rem; }
.empty { color: var(--muted); padding: .9rem .2rem; font-size: .92rem; }
.badge { display: inline-block; font-size: .74rem; padding: .15rem .5rem; border-radius: 999px; background: #f1ebe9; color: var(--ink); white-space: nowrap; }
.badge.live { background: var(--live); color: #fff; }
.badge.warn { background: #fff1cc; color: var(--warn); }
.badge.danger { background: #fde4e2; color: var(--danger); }
.badge.ok { background: #dff3e8; color: var(--ok); }
.notice { display: block; background: #fdf3e1; border: 1px solid #f2dfb5; border-radius: 10px; padding: .6rem .8rem; margin: .6rem 0; color: var(--ink); text-decoration: none; }
.error-box { background: #fde4e2; color: var(--danger); border-radius: 10px; padding: .6rem .8rem; margin: .5rem 0; }
.alert { background: #fff1cc; color: #6b4b00; border-radius: 8px; padding: .4rem .6rem; margin: .35rem 0; font-size: .88rem; }
.okline { color: var(--ok); margin: .3rem 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); background: #222; color: #fff; padding: .7rem 1rem; border-radius: 10px; z-index: 50; max-width: 92vw; box-shadow: 0 6px 20px #0003; }
.toast.err { background: var(--danger); }

.seg, .tabs { display: flex; gap: .3rem; background: #efe8e5; padding: .25rem; border-radius: 12px; margin: .5rem 0 .8rem; overflow-x: auto; }
.seg button, .tabs button { flex: 1; border: 0; background: none; padding: .5rem .6rem; border-radius: 9px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.seg button.on, .tabs button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 3px #0001; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .3rem 0; }
.day-h { text-transform: capitalize; color: var(--muted); font-size: .85rem; margin-top: 1rem; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mhead { font-size: .72rem; text-align: center; color: var(--muted); padding: .2rem; }
.mcell { min-height: 64px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: .2rem; text-align: left; font: inherit; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.mcell.out { opacity: .45; }
.mcell.today { border-color: var(--c); }
.mday { font-size: .78rem; font-weight: 600; }
.mdot { font-size: .62rem; background: #f4e3e9; color: var(--c); border-radius: 3px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.picker input { margin-bottom: .4rem; }
.picker-list { max-height: 260px; overflow-y: auto; }
.pick { padding: .25rem 0; border-bottom: 1px solid var(--line); }
.pick-opts { display: flex; gap: .5rem; align-items: center; padding: 0 0 .3rem 1.6rem; }
.pick-opts select { width: auto; padding: .3rem; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.chip { background: #f1ebe9; border-radius: 999px; padding: .2rem .3rem .2rem .6rem; font-size: .85rem; }
.chip button { border: 0; background: none; cursor: pointer; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; }
.brand { font-size: 1.3rem; margin-bottom: .6rem; color: var(--c); }

.meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.rec { border-width: 2px; }
.rec.on { border-color: var(--live); }
.rec-head { display: flex; gap: .8rem; align-items: center; }
.rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #c9c1bf; flex-shrink: 0; }
.rec-dot.small { width: 10px; height: 10px; display: inline-block; }
.rec-dot.on { background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.clock { font-size: 1.6rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 10px; background: #eee6e3; border-radius: 6px; overflow: hidden; margin: .6rem 0; }
.meter div { height: 100%; background: linear-gradient(90deg, #2e9e62, #e2b300 70%, #d0342c); transition: width .15s; }
.devices { margin-top: .6rem; border-top: 1px solid var(--line); }
.device { font-size: .88rem; padding: .35rem 0; }

.modal-bg { position: fixed; inset: 0; background: #0006; display: grid; place-items: end center; z-index: 40; }
.modal { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 1rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
@media (min-width: 640px) { .modal-bg { place-items: center; } .modal { border-radius: 18px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }

.player audio { width: 100%; }
.segments { margin-top: .5rem; }
.seg-line { display: flex; gap: .6rem; padding: .5rem .3rem; border-bottom: 1px solid var(--line); border-radius: 6px; }
.seg-line.cur { background: #fdf0f4; }
.seg-line.uncertain .seg-text { color: #5b5154; text-decoration: underline dotted #c9a; }
.ts { border: 0; background: #f1ebe9; border-radius: 6px; font: inherit; font-size: .78rem; padding: .15rem .4rem; height: fit-content; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg-body { flex: 1; min-width: 0; }
.spk { font-size: .78rem; font-weight: 600; color: var(--c2); }
.spk.unconf { color: var(--muted); }
.spk-sel { width: auto; padding: .1rem .2rem; font-size: .78rem; border: 0; background: transparent; color: inherit; font-weight: 600; }
.seg-text { margin-top: .1rem; line-height: 1.45; }
.minutes li { margin: .3rem 0; line-height: 1.45; }
.ev { margin-left: .2rem; }
.evb { border: 0; background: #f4e3e9; color: var(--c); border-radius: 4px; font-size: .72rem; padding: 0 .3rem; margin: 0 1px; cursor: pointer; }
.action .grid2 { margin-top: .3rem; }
.audit { max-height: 360px; overflow-y: auto; }
details summary { cursor: pointer; font-weight: 500; }

@media print {
  .tabbar, .btn, .tabs, .player, .toolbar, .ts { display: none !important; }
  .card { border: 0; padding: 0; }
}
