:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e4e2dc;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --ok: #2f7d4f;
  --busy: #8a6d1c;
  --err: #b3261e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
main { max-width: 920px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 0.6rem; }
.card h2 { margin-top: 0; }
h3 { font-size: 0.95rem; margin: 1rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
code { background: #eeece6; padding: 0 0.25em; border-radius: 3px; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.top nav { display: flex; gap: 1rem; flex: 1; }
.top nav a { text-decoration: none; color: var(--muted); padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.top nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.account { display: flex; gap: 0.8rem; align-items: center; color: var(--muted); font-size: 0.9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; }
.card.narrow { max-width: 420px; margin: 4rem auto; }
.center { text-align: center; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.6rem 0; }
.inline { display: inline; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty { color: var(--muted); padding: 1rem 0; }
.error { color: var(--err); }
.notice { background: #eef5f1; border: 1px solid #cfe3d7; padding: 0.5rem 0.8rem; border-radius: 6px; }
.dim { opacity: 0.55; }

input[type="text"], input[type="email"], input[type="search"], select {
  font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0;
}
input[type="text"], input[type="email"], input[type="search"] { flex: 1; }
button, .button {
  font: inherit; padding: 0.45rem 0.9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  text-decoration: none; color: var(--ink); display: inline-block;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--err); border-color: #e7c4c1; }
button.link { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button.link.danger { color: var(--err); }

.badge { display: inline-block; font-size: 0.78rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: #eeece6; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e3f1e8; color: var(--ok); }
.badge.busy { background: #f6efd9; color: var(--busy); }
.badge.error { background: #f8e3e1; color: var(--err); }

.head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.search { display: flex; gap: 0.4rem; flex: 1; max-width: 460px; }

.recs { list-style: none; padding: 0; margin: 0; }
.rec a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.5rem; text-decoration: none; color: var(--ink); }
.rec a:hover { border-color: var(--accent); }
.rec-main { display: flex; flex-direction: column; min-width: 0; }
.rec-title { font-weight: 600; }
.rec-sub { color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
table.list th { font-weight: 600; color: var(--muted); background: #faf9f6; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form + form { margin-left: 0.8rem; }

.rec-head .meta { color: var(--muted); margin: 0.2rem 0 0.8rem; }
.title-form { display: flex; gap: 0.6rem; align-items: center; }
.title-form input { font-size: 1.5rem; font-weight: 700; border-color: transparent; padding: 0.1rem 0.3rem; margin-left: -0.3rem; }
.title-form input:hover, .title-form input:focus { border-color: var(--line); }
audio { width: 100%; margin: 0.4rem 0; }
.downloads { font-size: 0.9rem; }

.summary ul { padding-left: 1.2rem; }
.tasks { list-style: none; padding-left: 0 !important; }
.tasks li { margin: 0.25rem 0; }
.due { color: var(--muted); }

details.transcript > summary { cursor: pointer; font-weight: 600; }
.lines { margin-top: 0.8rem; max-height: 70vh; overflow-y: auto; }
.line { margin: 0.15rem 0; padding: 0.15rem 0.4rem; border-radius: 4px; cursor: pointer; }
.line:hover { background: #f1f0eb; }
.line.playing { background: #e3f1e8; }
.ts { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
.spk { font-weight: 600; }

.versions ul, .shares, .links { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; font-size: 0.92rem; }
.share { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.2rem; }
.newlink input { width: 100%; margin-top: 0.3rem; font-family: ui-monospace, monospace; }

@media (max-width: 640px) {
  .rec a { flex-direction: column; }
  .rec-meta { align-items: flex-start; flex-direction: row; gap: 0.6rem; }
  .account .email { display: none; }
}
