:root {
  --bg: #0b1220;
  --panel: #131c2e;
  --panel-2: #1a2740;
  --border: #25344f;
  --text: #e7eefc;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #16243d 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
.wrap { max-width: 820px; margin: 0 auto; padding: 28px 18px 64px; }
header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
header.top h1 { font-size: 1.25rem; margin: 0; letter-spacing: .2px; }
header.top .tag { color: var(--muted); font-size: .82rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card p.help { color: var(--muted); margin: 0 0 16px; font-size: .9rem; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 12px 0 6px; }
input[type=text], textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 13px; font-size: .95rem; font-family: inherit;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 11px 18px; font-size: .92rem; font-weight: 600;
  cursor: pointer; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07121f;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.warn { background: linear-gradient(135deg, #f59e0b, #f87171); color: #1a0c00; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }
.scenarios { display: grid; gap: 12px; }
.scenario {
  text-align: left; cursor: pointer; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; color: var(--text); transition: border-color .15s, transform .05s;
}
.scenario:hover { border-color: var(--accent); }
.scenario.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(45,212,191,.25); }
.scenario h3 { margin: 0 0 6px; font-size: .98rem; }
.scenario pre { white-space: pre-wrap; font-family: inherit; color: var(--muted); margin: 0; font-size: .86rem; }
.meta-strip { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.score-badge { font-size: 2.4rem; font-weight: 800; }
.score-wrap { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.score-good { color: var(--good); } .score-mid { color: var(--warn); } .score-bad { color: var(--bad); }
.feedback { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; white-space: pre-wrap; font-size: .92rem; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.bubble { padding: 10px 13px; border-radius: 12px; max-width: 85%; font-size: .9rem; white-space: pre-wrap; }
.bubble.user { align-self: flex-end; background: var(--accent-2); color: #061522; }
.bubble.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.notice { font-size: .85rem; padding: 10px 13px; border-radius: 10px; margin-top: 10px; }
.notice.ok { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.4); color: var(--good); }
.notice.err { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); color: var(--bad); }
.media-prev { display: block; max-width: 100%; max-height: 320px; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { color: var(--muted); font-size: .78rem; text-align: center; margin-top: 22px; }
