:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1f1e;
  --muted: #6a6f6c;
  --border: #e2e0da;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --alert-bg: #fbe9e7;
  --notice-bg: #e6f2ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151716;
    --surface: #1e2120;
    --text: #e8eae8;
    --muted: #9aa19d;
    --border: #2f3432;
    --accent: #6fb39c;
    --accent-text: #0f1a16;
    --danger: #f2877d;
    --alert-bg: #3a1f1c;
    --notice-bg: #1c3129;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
small { display: block; font-size: .85rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 1rem; font-size: .95rem; }
.topbar nav a { text-decoration: none; }
.topbar form { margin: 0; }

main { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin: 0 0 1.25rem;
}
.narrow { max-width: 26rem; margin: 2rem auto; }

.stack { display: flex; flex-direction: column; gap: .9rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .95rem; }
input, textarea {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: .55rem .65rem; width: 100%;
}
input[type=file] { padding: .4rem; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .button {
  font: inherit; cursor: pointer; display: inline-block; text-decoration: none;
  padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.danger { color: var(--danger) !important; }

.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row form { margin: 0; }
.small { font-size: .9rem; }

.alert { background: var(--alert-bg); border-radius: 8px; padding: .75rem 1rem; }
.notice { background: var(--notice-bg); border-radius: 8px; padding: .75rem 1rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.crumbs { margin: 0 0 .75rem; font-size: .9rem; }
.crumbs a { text-decoration: none; }

.meeting-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.meeting-list li + li { border-top: 1px solid var(--border); }
.meeting-list a { display: flex; flex-direction: column; padding: .9rem 1.1rem; text-decoration: none; color: var(--text); }
.meeting-list a:hover { background: var(--bg); }
.meeting-list .title { font-weight: 600; }
.meeting-list .meta { color: var(--muted); font-size: .9rem; }
.empty { text-align: center; padding: 3rem 0; color: var(--muted); }

.notes { white-space: pre-wrap; margin: 0 0 1.25rem; padding: 1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }

.files { list-style: none; margin: 0 0 1rem; padding: 0; }
.files li { padding: .75rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.files li:first-child { padding-top: 0; }
.file-head { display: flex; flex-direction: column; }
.file-head .name { font-weight: 600; overflow-wrap: anywhere; }
.file-head .muted { font-size: .85rem; }
audio { width: 100%; }

.drop {
  display: block; text-align: center; padding: 1.5rem 1rem; cursor: pointer; font-weight: 500;
  border: 2px dashed var(--border); border-radius: 10px; color: var(--muted);
}
.drop.over { border-color: var(--accent); color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.progress { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.progress progress { width: 100%; }
.progress .failed { color: var(--danger); }

details { margin-top: .5rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 500; margin-bottom: .75rem; }
.or { margin: 0; text-align: center; }

.transcript {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem;
  font: .95rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.danger-zone { text-align: right; margin-top: 2rem; }

@media (max-width: 560px) {
  .topbar nav { gap: .75rem; font-size: .9rem; }
  .page-head { flex-direction: column; }
}
