:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --border: #e2e2dc;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --rec: #d93636;
  --ok: #2e7d4f;
  --warn: #9a6400;
  --warn-bg: #fff4dc;
  --err-bg: #fde8e8;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #212120;
    --text: #ecece8;
    --muted: #9c9c96;
    --border: #353532;
    --accent: #6ea0ec;
    --accent-text: #0e1a2c;
    --rec: #f06060;
    --ok: #6cc28f;
    --warn: #e4b35a;
    --warn-bg: #3a2f17;
    --err-bg: #3d1f1f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand::before { content: "●"; color: var(--rec); margin-right: .4rem; }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }

main { max-width: 920px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.narrow { max-width: 420px; margin: 3rem auto; }

label { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none !important;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-rec { background: var(--rec); color: #fff; border-color: var(--rec); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-danger { color: var(--rec); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list a { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: .8rem .2rem; color: var(--text); }
.list a:hover { text-decoration: none; background: var(--bg); }
.list .title { font-weight: 600; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.badge.ready { color: var(--ok); }
.badge.processing, .badge.summarizing, .badge.recording { color: var(--warn); }

.notice { padding: .75rem 1rem; border-radius: 8px; background: var(--warn-bg); margin: .75rem 0; }
.notice.error { background: var(--err-bg); }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-top: .5rem; }
.mode { border: 2px solid var(--border); border-radius: var(--radius); padding: .9rem; cursor: pointer; background: var(--bg); }
.mode input { display: none; }
.mode strong { display: block; }
.mode.sel { border-color: var(--accent); }

.recbox { text-align: center; padding: 2rem 1rem; }
.timer { font-size: 3rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--rec); margin-right: .5rem; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.meter { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; max-width: 320px; margin: 1rem auto; }
.meter > div { height: 100%; background: var(--ok); width: 0; transition: width .1s; }
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: .5rem 0; }
.progress > div { height: 100%; background: var(--accent); }

.summary ul { margin: .25rem 0; padding-left: 1.2rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.transcript p { margin: 0 0 .5rem; }
.transcript .ts { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; margin-right: .5rem; }

.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; max-width: calc(100% - 32px); z-index: 10;
}
@media (max-width: 560px) {
  .timer { font-size: 2.4rem; }
  .list a { flex-direction: column; align-items: flex-start; gap: .25rem; }
}
