:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6d665e;
  --line: #e5ded4;
  --accent: #1d1b19;
  --accent-ink: #ffffff;
  --soft: #efe9e0;
  --error: #b42318;
  --ok: #1f7a4d;
  --logo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --card: #1c1a18;
    --ink: #f3efe9;
    --muted: #a49b91;
    --line: #2f2b27;
    --accent: #f3efe9;
    --accent-ink: #131211;
    --soft: #26231f;
    --error: #f97066;
    --ok: #4ade80;
    --logo-filter: invert(1);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 32px 16px 48px; }
.wrap.wide { max-width: 1100px; }
.brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; }
.brand img { width: 40px; height: 40px; filter: var(--logo-filter); }
.brand span { font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: .02em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
p.lead { color: var(--muted); margin: 0 0 20px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); }
input[type=text], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=file] { width: 100%; font: inherit; color: var(--muted); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 20px;
}
button.secondary, .btn.secondary { background: var(--soft); color: var(--ink); }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.full { width: 100%; margin-top: 20px; }
.msg { margin-top: 14px; font-size: 14px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }
.foot a { color: inherit; }

/* Player */
.player { text-align: center; }
.player .from { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.player .message { font-family: Georgia, serif; font-size: 20px; margin: 8px 0 24px; white-space: pre-wrap; }
.play {
  width: 112px; height: 112px; border-radius: 50%; padding: 0; margin: 8px auto 20px;
  box-shadow: 0 0 0 10px var(--soft);
}
.play svg { width: 44px; height: 44px; fill: currentColor; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; cursor: pointer; }
.bar > div { height: 100%; width: 0; background: var(--accent); }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Admin */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.toolbar label { margin: 0 0 4px; }
.toolbar > div { min-width: 140px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.item .qr { background: #fff; border-radius: 10px; padding: 10px; display: flex; justify-content: center; }
.item .qr svg { width: 180px; height: 180px; }
.item .code { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .08em; }
.item .meta { color: var(--muted); font-size: 13px; word-break: break-all; }
.item audio { width: 100%; margin: 10px 0; }
.item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
