:root {
  --bg: #0f1419;
  --panel: #171e26;
  --ink: #e8eef4;
  --muted: #93a1b0;
  --line: #2a3542;
  --accent: #3d9cf0;
  --ok: #3dce8b;
  --warn: #e0a44a;
  --bad: #e05a5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: #12181f;
}
header h1 { margin: 0; font-size: 16px; font-weight: 650; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav button, .btn {
  background: #22303d; color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
nav button.active, .btn.primary { background: var(--accent); border-color: var(--accent); color: #061018; }
.btn.ghost { background: transparent; }
main { max-width: 1100px; margin: 0 auto; padding: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 14px;
}
h2 { margin: 0 0 10px; font-size: 18px; }
p.muted, .muted { color: var(--muted); }
textarea, input[type=text], input[type=password], input[type=number], select {
  width: 100%; background: #0f151b; color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font: inherit;
}
textarea { min-height: 180px; resize: vertical; }
#prior, #extra, #chatIn { min-height: 80px; }
#chatLog { max-height: 240px; overflow: auto; }
label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .row { grid-template-columns: 1fr; } }
.out {
  white-space: pre-wrap; background: #0c1116; border-radius: 8px; padding: 12px;
  border: 1px solid var(--line); min-height: 80px;
}
.banner { padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.banner.warn { background: #3a2c14; color: #f3d39a; }
.banner.bad { background: #3a1818; color: #f3b0b0; }
.banner.ok { background: #143328; color: #b6f0d4; }
.hidden { display: none; }
#qrbox { text-align: center; }
#qrbox canvas, #qrbox img { background: white; padding: 10px; border-radius: 8px; }
.filelist { list-style: none; padding: 0; margin: 0; }
.filelist li {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.small { font-size: 13px; }
.issue-row { display: block; margin: 6px 0; }
#errorHead.alert-error { color: #e05a5a; }
#suggestHead.alert-suggest { color: #e0a44a; }
#errorList.alert-error-box { border-color: #e05a5a; }
#suggestList.alert-suggest-box { border-color: #e0a44a; }
