:root {
  --bg: #f6f7fb; --card: #fff; --text: #1d2233; --muted: #6b7286; --line: #e3e6ef;
  --brand: #4f46e5; --brand-2: #eef0ff; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12141c; --card: #1b1e29; --text: #eceef6; --muted: #98a0b8; --line: #2c3040; --brand: #818cf8; --brand-2: #262a45; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 -apple-system, "Apple SD Gothic Neo", "Segoe UI", sans-serif; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--brand); text-decoration: none; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.top nav { flex: 1; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--brand-2); color: var(--brand); }
.badge.on { background: #dcfce7; color: #166534; }
.badge.demo { background: #fef3c7; color: #92400e; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mode { cursor: pointer; transition: transform .1s; }
.mode:hover { transform: translateY(-2px); border-color: var(--brand); }
.mode .ico { font-size: 28px; }
.muted { color: var(--muted); font-size: 14px; }
button, select { font: inherit; }
.btn { border: 0; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--brand-2); color: var(--brand); }
.btn.rec { background: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.qhead { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.question { font-size: 19px; font-weight: 600; margin: 6px 0 14px; }
.timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; }
.timer.over { color: var(--ok); }
.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
textarea { width: 100%; min-height: 110px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; resize: vertical; }
audio { width: 100%; margin: 8px 0; }
.fb h3 { margin: 14px 0 6px; font-size: 15px; color: var(--brand); }
.fb .corrected { background: var(--brand-2); padding: 10px 12px; border-radius: 10px; }
.imp { border-left: 3px solid var(--brand); padding: 4px 10px; margin: 8px 0; }
.imp .o { color: var(--bad); text-decoration: line-through; }
.imp .b { color: var(--ok); font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--brand-2); color: var(--brand); font-weight: 700; }
.warn { background: #fef3c7; color: #92400e; padding: 8px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 10px; }
.w-ok { color: var(--ok); } .w-miss { color: var(--bad); font-weight: 700; text-decoration: underline; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress > i { display: block; height: 100%; background: var(--brand); }
details { border-top: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; }
.shadow { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
@media (max-width: 480px) { .top { gap: 8px; } .question { font-size: 17px; } }

/* 프리토킹 */
input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; max-width: 100%; }
.chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; }
.bubble.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-top-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.tfb { align-self: flex-end; max-width: 92%; font-size: 14px; border-left: 3px solid var(--warn); background: var(--card); border-radius: 8px; padding: 8px 12px; }
.tfb.good { border-left-color: var(--ok); }
[hidden] { display: none !important; }
.ko { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 14px; }

/* 기록 선택 삭제 */
.hrow { display: flex; gap: 10px; align-items: flex-start; }
.hrow > .hsel { margin-top: 20px; width: 18px; height: 18px; flex: none; }
.hrow > .hbody { flex: 1; min-width: 0; }
