:root {
  --bg: #f6f6f4; --surface: #fcfcfb; --border: rgba(11, 11, 11, 0.10);
  --text: #0b0b0b; --text2: #52514e; --muted: #7a7973;
  --accent: #2a78d6; --accent-soft: #e3eefb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --surface: #1a1a19; --border: rgba(255, 255, 255, 0.10);
    --text: #ffffff; --text2: #c3c2b7; --muted: #8f8e88;
    --accent: #3987e5; --accent-soft: #1c2c40;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
header { padding: 32px 0 16px; text-align: center; }
h1 { font-size: 2rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { margin: 0 0 8px; color: var(--text2); }
.privacy { margin: 0; font-size: 0.85rem; color: var(--muted); }
h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0 0 14px; }
h3 { font-size: 0.9rem; color: var(--text2); font-weight: 600; margin: 18px 0 8px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 700; flex: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.hint { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }
a { color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 520px) { .tiles { gap: 6px; } .tile { padding: 10px 2px; font-size: 0.78rem; } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 0.85rem; cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.tile .emo { font-size: 1.7rem; line-height: 1; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(0.97); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.own { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn input { display: none; }
.btn.recording { border-color: #e34948; color: #e34948; }
.now-playing { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text2); }
audio { width: 100%; }

.status { text-align: center; }
.status p { margin: 6px 0 10px; }
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.status.listening .bar { display: none; }

.answer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.answer-emoji { font-size: 2.8rem; line-height: 1; }
.answer-label { font-size: 1.5rem; font-weight: 700; text-transform: capitalize; }
.answer-note { color: var(--text2); font-size: 0.95rem; }
.answer-pct { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.others .o { display: grid; grid-template-columns: 1.6rem 9rem 1fr 3.2rem; align-items: center; gap: 8px;
  font-size: 0.9rem; margin-bottom: 6px; }
.others .o .name { text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.others .o .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text2); }
.others .track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.others .fill { height: 100%; background: var(--accent); opacity: 0.55; border-radius: 3px; }
@media (max-width: 520px) { .others .o { grid-template-columns: 1.6rem 7rem 1fr 3rem; } }

.details summary { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; cursor: pointer; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.2s; }
.details[open] summary::after { transform: rotate(180deg); }
canvas { width: 100%; height: 200px; display: block; border-radius: 8px; background: #000; margin-top: 12px; }
.axis { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.error { color: #e34948; }
footer { padding: 4px 16px 32px; text-align: center; font-size: 0.8rem; color: var(--muted); }
