:root { --ink: #1d2733; --muted: #6b7785; --line: #e3e8ee; --bg: #f6f8fa; --accent: #1f6feb; --warn: #b54708; --bad: #c62828; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; color: var(--ink); text-decoration: none; }
nav { display: flex; gap: 16px; align-items: center; }
nav a { color: var(--accent); text-decoration: none; }
nav form { margin: 0; }
.who { color: var(--muted); }
main { max-width: 1150px; margin: 24px auto; padding: 0 16px; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; }
.narrow { max-width: 380px; margin: 60px auto; }
h1 { font-size: 1.4rem; margin-top: 0; } h2 { font-size: 1.1rem; margin: 22px 0 8px; }
label { display: block; margin: 12px 0 6px; font-weight: 600; }
input, textarea { width: 100%; padding: 10px; border: 1px solid #c9d1d9; border-radius: 6px; font: inherit; }
button, .button { display: inline-block; margin-top: 12px; padding: 9px 18px; background: var(--accent); color: #fff; border: 0; border-radius: 6px; font: inherit; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .6; cursor: wait; }
button.link { background: none; color: var(--accent); padding: 0; margin: 0; }
.scenario { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; margin: 0 0 12px; }
.scenario dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.scenario dd { margin: 0; }
.objection { font-size: 1.25rem; margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: #f0f6ff; }
.answer { white-space: pre-wrap; background: var(--bg); padding: 10px 14px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.error { color: var(--bad); } .warn { color: var(--warn); }
.alert { border: 1px solid #f5c2a8; background: #fff4ed; padding: 10px 14px; border-radius: 6px; color: var(--warn); }
.alert ul { margin: 6px 0 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scores th { width: 120px; white-space: nowrap; }
.score { font-weight: 700; text-align: center; width: 36px; }
.s1, .s2 { color: var(--bad); } .s3 { color: var(--warn); } .s4, .s5 { color: #1a7f37; }
.letters td:not(:first-child), .letters th { text-align: center; }
.weakest td { background: #fff8e6; }
.spark { width: 100%; height: 44px; margin-top: 10px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.suggestions li { margin-bottom: 8px; }
.attempts .detail td { border-bottom: 1px solid var(--line); padding-top: 0; }
.attempts .detail td:empty { display: none; }
details summary { cursor: pointer; color: var(--accent); font-size: .9rem; }

.grading { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.grading[hidden] { display: none; }
.grading-text { flex: 1; }
.elapsed { float: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 6px; margin-top: 8px; background: var(--line); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.spinner { width: 22px; height: 22px; border: 3px solid #cfe0fb; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.grading.slow .fill { background: var(--warn); }
.grading.slow .spinner { border-top-color: var(--warn); }
textarea[readonly] { background: var(--bg); color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.switch button { border: 0; background: #fff; padding: 4px 12px; cursor: pointer; color: var(--accent); }
.switch button.on { background: var(--accent); color: #fff; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
