:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1b1f24; --muted: #66707c; --line: #e2e5ea;
  --brand: #1f5eff; --brand-ink: #fff; --red: #c62828; --red-bg: #fdecec; --green: #1b7f4b; --green-bg: #e8f6ee;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 920px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 18px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 14px; }
p { margin: 0 0 8px; }
ul { margin: 0 0 8px; padding-left: 20px; }
.muted { color: var(--muted); } .center { text-align: center; margin-top: 20vh; } .red { color: var(--red); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }

header.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 700; } header.top .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; color: var(--ink); border: 1px solid transparent; }
.tabs button[aria-current="page"] { background: var(--bg); border-color: var(--line); }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
label.check input { width: auto; margin-top: 4px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; }
label.button { margin: 0; font-size: 15px; }
button.secondary, .button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.danger { background: var(--red); border-color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }

.auth { max-width: 380px; margin: 12vh auto 0; }
.auth button { width: 100%; }

.rec { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 10px; background: var(--bg); }
.rec .live { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.rec .preview { max-height: 120px; overflow: auto; font-size: 13px; color: var(--muted); margin-top: 8px; white-space: pre-wrap; }

details.call { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
details.call > summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
details.call > summary::-webkit-details-marker { display: none; }
details.call .body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.kind { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.badge { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 8px; background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
details.sub { margin-top: 10px; } details.sub > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.doc { position: relative; } .doc .copy { position: absolute; top: 6px; right: 6px; padding: 3px 9px; font-size: 12px; }
pre { white-space: pre-wrap; word-wrap: break-word; font: 13.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 6px 0 0; max-height: 420px; overflow: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile.alert .n { color: var(--red); }
.rmhead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin-bottom: 8px; }
.status { font-size: 13px; border-radius: 99px; padding: 1px 9px; background: var(--bg); border: 1px solid var(--line); }
.status.done { background: var(--green-bg); color: var(--green); border-color: transparent; }
.headline { font-size: 17px; font-weight: 600; margin: 6px 0; }
.calllist button { display: flex; width: 100%; text-align: left; justify-content: flex-start; flex-wrap: wrap; background: var(--bg); color: var(--ink); border-color: var(--line); font-weight: 500; margin-bottom: 6px; }
table { width: 100%; border-collapse: collapse; } td, th { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); } th { font-size: 13px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.row label { margin: 0; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog .close { float: right; background: none; border: none; color: var(--ink); font-size: 22px; padding: 0 6px; }
dialog details.call { border: none; } dialog details.call > summary { padding-left: 0; } dialog details.call .body { padding: 0; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
