:root {
  --bg: #f6f7fb; --card: #ffffff; --fg: #0f172a; --muted: #64748b; --line: #e2e8f0; --accent: #2563eb; --accent-fg: #fff;
  --danger: #dc2626; --warn: #d97706; --ok: #16a34a; --mark: #fde68a; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --card: #111a2e; --fg: #e5e7eb; --muted: #94a3b8; --line: #1f2a44; --accent: #60a5fa; --accent-fg: #0b1220; --mark: #854d0e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1rem 0 .5rem; }
h3 { font-size: .95rem; margin: .9rem 0 .3rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .error { color: var(--danger); } .danger { color: var(--danger); }
code { background: var(--line); padding: 0 .3em; border-radius: 4px; font-size: .9em; }

.top { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--fg); display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); display: inline-block; }
.top nav { display: flex; align-items: center; gap: 1rem; }
.top nav a { color: var(--fg); } .top nav a.active { font-weight: 600; }
.inline { display: inline; }
main { max-width: 1240px; margin: 0 auto; padding: 1.2rem; }
main.center { display: flex; justify-content: center; padding-top: 4rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.card.narrow { width: 100%; max-width: 420px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
label:has(input[type=checkbox]) { flex-direction: row; align-items: center; color: var(--fg); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=datetime-local], select, textarea {
  font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.btn { display: inline-block; font: inherit; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
button.link.danger { color: var(--danger); }
.pill { display: inline-block; font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; background: var(--line); color: var(--fg); vertical-align: middle; }
.pill.warn { background: #fef3c7; color: #92400e; } .pill.err { background: #fee2e2; color: #991b1b; }
.notice { background: var(--card); border: 1px dashed var(--line); padding: .6rem .9rem; border-radius: 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.search { display: flex; gap: .4rem; flex: 1; min-width: 280px; } .search input { flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; background: var(--line); color: var(--fg); }
.tag.on { background: var(--accent); color: var(--accent-fg); } .tag.clear { background: transparent; color: var(--muted); }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); } .empty h2 { color: var(--fg); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.thumb { position: relative; aspect-ratio: 16/9; background: #0f172a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; } .thumb .ph { font-size: 2.5rem; }
.thumb .dur { position: absolute; right: .5rem; bottom: .4rem; background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; padding: .05rem .4rem; border-radius: 4px; }
.thumb .pill { position: absolute; left: .5rem; top: .4rem; }
.meta { padding: .7rem .9rem; display: flex; flex-direction: column; gap: .25rem; }
.meta .title { color: var(--fg); font-weight: 600; } .sub { color: var(--muted); font-size: .85rem; }
.snippet { font-size: .85rem; color: var(--fg); } mark { background: var(--mark); color: inherit; padding: 0 .1em; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; color: var(--muted); }

.recstatus { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.led { width: 12px; height: 12px; border-radius: 50%; background: var(--line); display: inline-block; }
.led.on { background: var(--danger); animation: blink 1.2s infinite; } .led.paused { background: var(--warn); }
@keyframes blink { 50% { opacity: .3; } }
.preview { width: 100%; max-height: 300px; background: #000; border-radius: 8px; margin-top: .8rem; }
.progress { position: relative; height: 22px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: .8rem; }
.progress .bar { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .8rem; }

.meeting-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.meeting-head h1[contenteditable]:hover { outline: 1px dashed var(--line); }
.editable:hover { outline: 1px dashed var(--line); } .saved { outline: 2px solid var(--ok) !important; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.menu > div { position: absolute; right: 0; top: 2.2rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; display: flex; flex-direction: column; gap: .4rem; z-index: 4; min-width: 220px; }
.meeting-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; margin-top: 1rem; }
@media (max-width: 1000px) { .meeting-body { grid-template-columns: 1fr; } }
.player { width: 100%; background: #000; border-radius: var(--radius); max-height: 70vh; }
audio.player { background: var(--card); max-height: none; }
.player.placeholder { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: #cbd5e1; }
.highlight-add { display: flex; gap: .4rem; margin-top: .8rem; } .highlight-add input { flex: 1; }
kbd { font: .8em monospace; background: var(--line); padding: 0 .35em; border-radius: 4px; }
.highlights { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-direction: column; gap: .2rem; }
.notes { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1.2rem 1rem; margin-top: 1rem; }
.notes ul { padding-left: 1.2rem; } .notes .topics a { font-variant-numeric: tabular-nums; }
.transcript-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .transcript-head h2 { margin: .4rem 0; flex: 1; }
.transcript { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; max-height: 75vh; overflow: auto; font-size: .95rem; }
.seg { display: flex; gap: .6rem; padding: .25rem .3rem; border-radius: 6px; } .seg:hover { background: var(--bg); }
.seg.active { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.seg .t { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 3.6rem; font-size: .8rem; padding-top: .15rem; }
.kv th { text-align: left; padding: .3rem .6rem .3rem 0; color: var(--muted); font-weight: 500; vertical-align: top; white-space: nowrap; }
.kv td { padding: .3rem 0; }
.jobs { width: 100%; border-collapse: collapse; font-size: .85rem; } .jobs th, .jobs td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.jobs tr.error td { color: var(--danger); } .jobs td.err { max-width: 420px; word-break: break-word; }
ul.plain { list-style: none; padding: 0; }
