:root {
  --bg: #efefef;
  --panel: #f8f8f8;
  --line: #d5d5d5;
  --text: #202020;
  --muted: #666;
  --accent: #4b5563;
  --accent-2: #374151;
  --danger: #991b1b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent-2); text-decoration: none; }
.page-shell { padding: 18px; }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
.sidebar, .card, .content { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.sidebar { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: calc(100vh - 36px); }
.sidebar a { padding: 10px 12px; border-radius: 10px; }
.sidebar a:hover { background: #ececec; }
.brand { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.content { padding: 20px; overflow: auto; }
.card { padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 60px auto; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline-form, .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 12px; }
.input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #c9c9c9; border-radius: 10px; background: white; }
.input.small { width: auto; min-width: 120px; }
.btn { padding: 10px 14px; border: 0; border-radius: 10px; background: var(--accent); color: white; cursor: pointer; }
.btn.secondary { background: #7a7a7a; }
.btn.danger { background: var(--danger); }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; text-align: left; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fbfbfb; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label, .muted { color: var(--muted); }
.flash-wrap { display: flex; flex-direction: column; gap: 10px; max-width: 900px; margin: 0 auto 18px; }
.flash { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: white; }
.flash.error { border-color: #f2b7b7; }
.checkbox { display: flex; gap: 10px; align-items: center; }
.test-shell { max-width: 980px; margin: 0 auto; }
.test-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.item-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.item-nav button { width: 42px; height: 42px; border: 1px solid var(--line); background: white; border-radius: 10px; cursor: pointer; }
.item-nav button.current { background: #dcdcdc; }
.item-nav button.submitted { border-color: #8a8a8a; }
.matrix-grid { width: min(78vw, 420px); height: min(78vw, 420px); margin: 0 auto 16px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 8px; }
.options-grid { width: min(82vw, 520px); margin: 0 auto 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.matrix-cell, .opt-btn { background: white; border: 1px solid #111; border-radius: 10px; aspect-ratio: 1 / 1; }
.opt-btn { cursor: pointer; padding: 4px; }
.opt-btn.selected { background: #dddddd; }
.test-actions { display: flex; justify-content: center; gap: 10px; }
svg { width: 100%; height: 100%; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
}
