/* ============================================================
   DS Soteria — App styles
   Brand: deep safety green + gold. Mobile-first, thumb-friendly.
   ============================================================ */

:root {
  --brand: #0f3d2e;
  --brand-2: #16523e;
  --gold: #ffb000;
  --green: #22a054;
  --amber: #eb960a;
  --red: #d6372e;

  --bg: #f2f5f3;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --text: #1c2a24;
  --muted: #64766d;
  --line: #dde5e0;
  --shadow: 0 1px 3px rgba(15, 61, 46, .12);
  --focus: #2f8f6b;
}

[data-theme="dark"] {
  --bg: #101614;
  --panel: #18211d;
  --panel-2: #1e2925;
  --text: #e4ece7;
  --muted: #93a49b;
  --line: #2b3833;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Field PWA: no rubber-band/pull-to-refresh bounce, no double-tap
   zoom — the page must stay put under work gloves. (Signature canvas
   sets touch-action:none on itself for drawing.) */
html { overscroll-behavior: none; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: pan-y;   /* vertical scroll only — no pinch, no horizontal pan */
}
.hidden { display: none !important; }
a { color: var(--focus); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }

/* ── Auth ─────────────────────────────────────── */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #1d5c45, var(--brand) 60%);
  padding: 20px;
}
.auth-card {
  background: var(--panel); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35);
  padding: 34px 30px; width: 100%; max-width: 420px;
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.logo-sigma {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 10px; background: var(--brand);
  color: var(--gold); font: bold 26px/1 Georgia, serif;
}
.logo-sigma.sm { width: 28px; height: 28px; font-size: 17px; border-radius: 7px; }
.logo-title { font-weight: 700; font-size: 1.25rem; }
.logo-sub { color: var(--muted); font-size: .85rem; }
.auth-blurb { color: var(--muted); font-size: .9rem; margin: 8px 0 20px; }
.auth-note { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 14px; }
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #2f2f2f; color: #fff; border: none; border-radius: 8px;
  padding: 12px; font-size: .95rem; cursor: pointer;
}
.btn-ms:hover { background: #1f1f1f; }

/* ── Shell ────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff; height: 52px; padding: 0 12px;
  padding-top: env(safe-area-inset-top);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 1rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-user { font-size: .82rem; opacity: .85; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  background: transparent; color: #fff; border: none; font-size: 1.05rem;
  cursor: pointer; padding: 6px 8px; border-radius: 6px;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.nav-burger { display: none; background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; }
.net-badge {
  background: var(--amber); color: #fff; border-radius: 20px; padding: 2px 10px;
  font-size: .8rem; animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .6; } }

.layout { display: flex; min-height: calc(100vh - 52px); }
.sidenav {
  width: 214px; flex: 0 0 214px; background: var(--panel); border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
}
.sidenav a {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: .93rem;
}
.sidenav a:hover { background: var(--panel-2); }
.sidenav a.active { background: var(--brand); color: #fff; }
.nav-sep { margin: 14px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav-foot { margin-top: auto; padding: 10px 12px; color: var(--muted); font-size: .75rem; display: flex; justify-content: space-between; }
.nav-scrim { display: none; }

.main { flex: 1; padding: 18px; min-width: 0; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* ── Cards / tiles ────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h2 { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
}
.tile .t-num { font-size: 1.7rem; font-weight: 700; }
.tile .t-label { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.tile.t-red .t-num { color: var(--red); }
.tile.t-amber .t-num { color: var(--amber); }
.tile.t-green .t-num { color: var(--green); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Buttons / forms ──────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); border-radius: 8px; padding: 8px 14px;
  font-size: .9rem; cursor: pointer;
}
.btn:hover { background: var(--panel-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #3a2a00; font-weight: 600; }
.btn-danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn-sm { padding: 4px 9px; font-size: .8rem; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.w-full { width: 100%; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
textarea { min-height: 74px; resize: vertical; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: .9rem; padding: 8px 0; }
.checkbox-line input { width: 20px; height: 20px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filter-bar > * { flex: 0 1 auto; width: auto; }
.filter-bar select, .filter-bar input { width: auto; min-width: 130px; padding: 8px 10px; }

/* ── Tables ───────────────────────────────────── */
/* wide content may still pan horizontally inside its own scroller */
.table-wrap { overflow-x: auto; touch-action: pan-x pan-y; }
.grid-fill { touch-action: pan-x pan-y; }
input[type=range] { touch-action: none; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th {
  text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.rowlink { cursor: pointer; }
table.data tr.rowlink:hover td { background: var(--panel-2); }
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pagination .pg-info { color: var(--muted); font-size: .82rem; margin-left: 6px; }

/* ── Badges / lights ──────────────────────────── */
.badge {
  display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: .74rem; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.b-published { background: #e4f5eb; border-color: #b5e3c8; color: #147a3d; }
.badge.b-draft     { background: #fff5df; border-color: #ffdf9a; color: #8a6100; }
.badge.b-archived  { background: var(--panel-2); }
[data-theme="dark"] .badge.b-published { background: #143526; border-color: #1e5a3c; color: #5ad391; }
[data-theme="dark"] .badge.b-draft     { background: #3a2f12; border-color: #6b5825; color: #ffcf70; }

.dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: -1px; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red   { background: var(--red); }
.dot.none  { background: var(--line); }

.light-chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 2px 10px;
  font-size: .76rem; font-weight: 700; color: #fff;
}
.light-chip.green { background: var(--green); }
.light-chip.amber { background: var(--amber); }
.light-chip.red   { background: var(--red); }

/* ── Traffic light input (fill) ───────────────── */
.traffic-row { display: flex; gap: 14px; padding: 6px 0 2px; }
.t-disc {
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--line);
  background: var(--panel-2); cursor: pointer; font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: transform .08s;
  -webkit-user-select: none; user-select: none;
}
.t-disc:active { transform: scale(.92); }
/* Unselected discs carry a clear colour hint (tint + coloured ring +
   coloured symbol) so you can see which is which BEFORE choosing */
.t-disc.green { border-color: rgba(34,160,84,.55);  background: rgba(34,160,84,.14);  color: var(--green); }
.t-disc.amber { border-color: rgba(235,150,10,.55); background: rgba(235,150,10,.16); color: var(--amber); }
.t-disc.red   { border-color: rgba(214,55,46,.55);  background: rgba(214,55,46,.14);  color: var(--red); }
.t-disc.green.on { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px rgba(34,160,84,.25); }
.t-disc.amber.on { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 0 0 4px rgba(235,150,10,.25); }
.t-disc.red.on   { background: var(--red);   border-color: var(--red);   color: #fff; box-shadow: 0 0 0 4px rgba(214,55,46,.25); }
/* When a sibling IS selected, fade the others so the choice pops */
.traffic-row:has(.on) .t-disc:not(.on), td:has(.t-disc.on) .t-disc:not(.on) { opacity: .45; }
/* Yes/No pills — words on the buttons, colour = good/bad polarity */
.yn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 118px; justify-content: center;
  padding: 13px 20px; border-radius: 30px; font-size: 1.05rem; font-weight: 700;
  border: 3px solid var(--line); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: transform .08s;
  -webkit-user-select: none; user-select: none;
}
.yn-pill:active { transform: scale(.95); }
.yn-pill .yn-ico { font-size: 1.15rem; line-height: 1; }
.yn-pill.green { border-color: rgba(34,160,84,.55);  background: rgba(34,160,84,.14);  color: var(--green); }
.yn-pill.amber { border-color: rgba(235,150,10,.55); background: rgba(235,150,10,.16); color: var(--amber); }
.yn-pill.red   { border-color: rgba(214,55,46,.55);  background: rgba(214,55,46,.14);  color: var(--red); }
.yn-pill.green.on { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px rgba(34,160,84,.25); }
.yn-pill.amber.on { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 0 0 4px rgba(235,150,10,.25); }
.yn-pill.red.on   { background: var(--red);   border-color: var(--red);   color: #fff; box-shadow: 0 0 0 4px rgba(214,55,46,.25); }
.traffic-row:has(.yn-pill.on) .yn-pill:not(.on) { opacity: .45; }

.escalation {
  border-left: 3px solid var(--amber); background: var(--panel-2);
  border-radius: 0 8px 8px 0; padding: 10px 12px; margin-top: 8px;
}
.escalation.red { border-left-color: var(--red); }

/* ── Fill UI ──────────────────────────────────── */
.fill-wrap { max-width: 760px; margin: 0 auto; }
.fill-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fill-icon { font-size: 1.6rem; }
.fill-progress { height: 5px; background: var(--line); border-radius: 4px; margin: 10px 0 18px; overflow: hidden; }
.fill-progress > div { height: 100%; background: var(--gold); transition: width .2s; }
.f-field { margin-bottom: 18px; }
.f-label { font-weight: 600; margin-bottom: 6px; display: block; }
.f-label .req { color: var(--red); }
.f-help { color: var(--muted); font-size: .82rem; margin: -2px 0 6px; }
.f-error { color: var(--red); font-size: .8rem; margin-top: 4px; }
.f-section {
  background: var(--brand); color: #fff; border-radius: 8px; padding: 8px 14px;
  font-weight: 600; margin: 22px 0 14px;
}
.f-instruction { color: var(--muted); font-size: .88rem; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.choice-list { display: flex; flex-direction: column; gap: 6px; }
.choice-item {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px; cursor: pointer; background: var(--panel);
}
.choice-item input { width: 19px; height: 19px; }
.choice-item.on { border-color: var(--focus); background: var(--panel-2); }
.rating-row { display: flex; gap: 6px; font-size: 1.7rem; cursor: pointer; -webkit-user-select: none; user-select: none; }
.rating-row span { opacity: .3; }
.rating-row span.on { opacity: 1; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .rm {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: .8rem;
}
.sig-canvas { border: 1px dashed var(--muted); border-radius: 8px; background: #fff; touch-action: none; width: 100%; }
.repeat-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--panel-2); }
.repeat-item .ri-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.grid-fill { overflow-x: auto; }
.grid-fill table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.grid-fill th, .grid-fill td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.grid-fill td:first-child, .grid-fill th:first-child { text-align: left; }
.grid-fill .t-disc { width: 34px; height: 34px; font-size: .9rem; display: inline-flex; margin: 0 2px; border-width: 2px; }
.fill-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.fill-nav .btn { min-width: 110px; justify-content: center; padding: 12px 16px; }

/* ── Forms list (fill cards) ──────────────────── */
.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  cursor: pointer; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start;
}
.form-card:hover { border-color: var(--focus); }
.form-card .fc-icon { font-size: 1.7rem; }
.form-card .fc-name { font-weight: 600; }
.form-card .fc-cat { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* ── Designer ─────────────────────────────────── */
.designer { display: grid; grid-template-columns: 210px 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .designer { grid-template-columns: 1fr; } }
.palette { position: sticky; top: 66px; max-height: calc(100vh - 90px); overflow-y: auto; }
.palette .pal-group { margin-bottom: 10px; }
.palette .pal-group h4 { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.pal-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--panel); border-radius: 7px;
  padding: 6px 9px; margin-bottom: 4px; font-size: .82rem; cursor: pointer;
}
.pal-item:hover { border-color: var(--focus); background: var(--panel-2); }
.canvas-field {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--panel); cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.canvas-field:hover { border-color: var(--focus); }
.canvas-field.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,176,0,.3); }
.canvas-field .cf-type { font-size: 1.15rem; width: 26px; text-align: center; }
.canvas-field .cf-label { font-weight: 600; font-size: .9rem; }
.canvas-field .cf-sum { color: var(--muted); font-size: .75rem; }
.canvas-field .cf-actions { margin-left: auto; display: flex; gap: 2px; }
.canvas-field .cf-actions button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: .95rem; padding: 3px 5px; border-radius: 5px; }
.canvas-field .cf-actions button:hover { background: var(--panel-2); color: var(--text); }
.canvas-field.cf-section { background: var(--brand); }
.canvas-field.cf-section .cf-label { color: #fff; }
.canvas-field.cf-section .cf-actions button { color: rgba(255,255,255,.7); }
.page-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.page-tabs .pt {
  border: 1px solid var(--line); background: var(--panel); border-radius: 20px;
  padding: 5px 14px; font-size: .82rem; cursor: pointer;
}
.page-tabs .pt.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.props { position: sticky; top: 66px; max-height: calc(100vh - 90px); overflow-y: auto; }
.props .card { margin-bottom: 10px; }
.child-editor { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; background: var(--panel-2); }
.child-editor .ce-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.child-editor select, .child-editor input { padding: 6px 8px; font-size: .82rem; }

/* ── Detail view ──────────────────────────────── */
.detail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 18px; font-size: .88rem; }
.detail-meta .dm-k { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.answer-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.answer-row .a-label { flex: 0 0 42%; color: var(--muted); font-size: .88rem; }
.answer-row .a-val { flex: 1; font-size: .92rem; word-break: break-word; }
.answer-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.answer-imgs img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.answer-imgs img.sig { width: auto; height: 70px; object-fit: contain; background: #fff; }

/* ── Charts (hand-rolled SVG/CSS) ─────────────── */
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 8px; }
.chart-bars .cb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 3px; }
.chart-bars .cb div { border-radius: 2px 2px 0 0; }
.chart-bars .cb:hover { opacity: .8; }
.hbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; }
.hbar .hb-label { flex: 0 0 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-track { flex: 1; background: var(--panel-2); border-radius: 6px; height: 18px; overflow: hidden; display: flex; }
.hbar .hb-n { flex: 0 0 34px; text-align: right; color: var(--muted); font-size: .8rem; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-legend { font-size: .85rem; display: flex; flex-direction: column; gap: 6px; }

/* ── Toast / modal ────────────────────────────── */
.toast-wrap { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--brand); color: #fff; border-radius: 10px; padding: 11px 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: .9rem; animation: toastIn .18s ease-out;
}
.toast.err { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.modal-scrim {
  position: fixed; inset: 0; background: rgba(10, 20, 16, .55); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--panel); border-radius: 14px; max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 20px; box-shadow: 0 16px 60px rgba(0,0,0,.4);
}
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: .88rem; margin-bottom: 12px; }
.alert-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2; }
[data-theme="dark"] .alert-error { background: #3a1917; color: #ff8a80; border-color: #5c2422; }
.alert-info { background: #e7f0fb; color: #1d4f91; border: 1px solid #c4d9f2; }
[data-theme="dark"] .alert-info { background: #16283c; color: #8ab8f0; border-color: #274766; }

.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: .9rem; }

/* ── Accordion (settings) ─────────────────────── */
details.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--panel); }
details.acc summary { padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; }
details.acc .acc-body { padding: 0 14px 12px; }

/* ── Mobile ───────────────────────────────────── */
@media (max-width: 860px) {
  .nav-burger { display: block; }
  .sidenav {
    position: fixed; top: 52px; bottom: 0; left: 0; z-index: 50;
    transform: translateX(-105%); transition: transform .2s ease-out; box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .sidenav.open { transform: none; }
  .nav-scrim.show { display: block; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.4); z-index: 45; }
  .main { padding: 12px; }
  .topbar-user { display: none; }
  .designer .palette, .designer .props { position: static; max-height: none; }
  .answer-row { flex-direction: column; gap: 2px; }
  .answer-row .a-label { flex: none; }
}

/* ── Print (submission detail) ────────────────── */
@media print {
  .topbar, .sidenav, .nav-scrim, .filter-bar, .no-print, .toast-wrap { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .main { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  .answer-row { break-inside: avoid; }
}
