:root {
  --bg: #111315;
  --surface: #181c20;
  --surface-2: #20252b;
  --line: #2d333b;
  --text: #eef1f4;
  --muted: #9aa4b0;
  --orange: #e86a24;
  --orange-hover: #f57b36;
  --ok: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --radius: 10px;
}

html[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #d5dce3;
  --text: #161b22;
  --muted: #57606a;
  --orange: #d95b16;
  --orange-hover: #c24d0d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Golos Text", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
}
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 820px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.kpi {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.kpi-val { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi-lbl { font-size: 13px; color: var(--muted); margin-top: 6px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.badge-orange { border-color: var(--orange); color: var(--orange); }
.badge-danger { border-color: var(--danger); color: var(--danger); }
.badge-warn { border-color: var(--warn); color: var(--warn); }
.badge-ok { border-color: var(--ok); color: var(--ok); }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 76px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--orange); text-decoration: none; }
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #ffffff;
}
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.q-block {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.q-title { font-weight: 700; margin-bottom: 10px; }
.choices-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.choice-item input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); flex-shrink: 0; }
.note-box {
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-left: 3px solid var(--orange);
  border-radius: 6px;
}
.voice-box {
  border: 1px dashed var(--orange);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-2);
  margin: 16px 0;
}
.bar-row { display: grid; grid-template-columns: 200px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.bar-track { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--orange); border-radius: 999px; }

.muted { color: var(--muted); font-size: 14px; }
.ico { width: 16px; height: 16px; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.alert { padding: 12px 14px; border-radius: 8px; border-left: 4px solid var(--orange); background: var(--surface-2); margin-bottom: 14px; }
.hidden, [hidden] { display: none !important; }

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .choices-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 38px; }
  .btn { width: 100%; }
  .btn-inline-auto { width: auto; }
}
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .card { border-color: #cccccc; break-inside: avoid; }
}
