:root {
  --bg: #f7f8fb;
  --panel: #fff;
  --ink: #172033;
  --muted: #657086;
  --line: #dce2ec;
  --blue: #246bfe;
  --amber: #b97708;
  --red: #c73535;
  --shadow: 0 10px 28px rgba(31,42,68,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, input { font: inherit; }
.shell { max-width: 1320px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
h1, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); margin-top: 5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.panel-body { padding: 16px; }
.controls { display: grid; grid-template-columns: 190px 180px 1fr; gap: 12px; align-items: end; }
label { display: block; color: #3d485c; font-size: 12px; font-weight: 800; margin-bottom: 7px; }
select, input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcff; }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; font-size: 26px; margin-top: 4px; }
.block-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tab { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 7px 12px; cursor: pointer; font-weight: 800; }
.tab.active { background: var(--blue); border-color: var(--blue); color: white; }
.question-list { display: grid; gap: 10px; }
.question-row {
  display: grid;
  grid-template-columns: 82px minmax(280px, 1fr) 110px 100px minmax(260px, .9fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}
.qid { font-weight: 900; font-size: 18px; }
.preview { color: #33415c; line-height: 1.35; }
.answer-select { min-height: 38px; }
.strike-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.strike-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  font-weight: 750;
}
.strike-pill input { margin: 0; }
.strike-pill.checked { color: #4e5962; background: #eef2f5; text-decoration: line-through; }
.flag-box {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.flag-box input { margin: 0; }
.flag-box.checked { border-color: #f2b641; background: #fff7df; color: #8a5f00; }
.row-note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.dirty { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(185,119,8,.12); }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #172033;
  color: white;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  display: none;
  z-index: 20;
}
.toast.show { display: block; }
@media (max-width: 980px) {
  .controls, .summary, .question-row { grid-template-columns: 1fr; }
  .topbar { display: block; }
  .actions { margin-top: 12px; }
}
