
/* ── PIN SCREEN ─────────────────────────────────── */
.pin-screen {
  position:fixed; inset:0; z-index:9999;
  background:#000;
  display:flex; align-items:center; justify-content:center;
  transition:opacity 0.4s ease;
}
.pin-inner {
  display:flex; flex-direction:column; align-items:center; gap:32px;
  padding:40px 24px;
}
.pin-logo {
  font-family:var(--sans); font-size:15px; font-weight:500;
  color:rgba(255,255,255,0.4); letter-spacing:0.01em;
}
.pin-logo span { font-weight:300; }
.pin-label {
  font-family:var(--sans); font-size:13px; font-weight:500;
  color:rgba(255,255,255,0.5); letter-spacing:0.08em; text-transform:uppercase;
  transition:color 0.2s;
}
.pin-inputs {
  display:flex; gap:12px;
}
.pin-input {
  width:52px; height:60px;
  background:rgba(255,255,255,0.08);
  border:1.5px solid rgba(255,255,255,0.15);
  border-radius:12px;
  color:#fff; font-size:24px; font-weight:500;
  text-align:center;
  outline:none;
  transition:border-color 0.15s, background 0.15s;
  -webkit-text-security:disc;
  font-family:var(--sans);
}
.pin-input:focus {
  border-color:rgba(255,255,255,0.5);
  background:rgba(255,255,255,0.12);
}
@keyframes shake {
  0%,100% { transform:translateX(0); }
  20%      { transform:translateX(-8px); }
  40%      { transform:translateX(8px); }
  60%      { transform:translateX(-6px); }
  80%      { transform:translateX(6px); }
}
.pin-dots.shake { animation:shake 0.5s ease; }

:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface2: #1e2333;
  --border: #2a3045;
  --accent: #4ade80;
  --accent-dim: rgba(74,222,128,0.12);
  --fail: #f87171;
  --fail-dim: rgba(248,113,113,0.12);
  --warn: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --mono: 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --sans: 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --header-h: 88px;
  --nav-h: 48px;
  --progress-h: 40px;
  --bottom-h: 68px;
}
body.light-mode {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --surface2: #f0f0eb;
  --border: #e2e2da;
  --accent: #16a34a;
  --accent-dim: rgba(22,163,74,0.1);
  --fail: #dc2626;
  --fail-dim: rgba(220,38,38,0.1);
  --text: #1a1a1a;
  --text-muted: #8a8a8a;
  --text-dim: #555555;
}
body.light-mode { background:#f5f5f0; }
body.light-mode .scroll-area { background:#f5f5f0; }
body.light-mode html { background:#f5f5f0; }
body.light-mode .app-logo { color:#1a1a1a; }
body.light-mode .status-pill { background:rgba(22,163,74,0.1); color:#16a34a; border-color:rgba(22,163,74,0.25); }
body.light-mode .sec-tab { background:#F9F9F3; border-color:#DEDED5; }
body.light-mode .btn-report { background:#9A9A98; color:#ffffff; }
body.light-mode .btn-save { color:#9A9A98; border-color:#9A9A98; }
body.light-mode .btn-save:hover { background:rgba(154,154,152,0.12); }
body.light-mode .sec-tab.active { background:#EEEEE8; border-color:#9A9A98; border-width:2px; }
body.light-mode .sec-tab.active .sec-tab-icon { color:#000000; }
body.light-mode .sec-tab.active .sec-tab-label { color:#000000; }
body.light-mode .sec-tab.active .sec-tab-count { color:#000000; }
body.light-mode .sec-tab.active .sec-tab-count .done { color:#000000; }
body.light-mode .group-notes-input { background:var(--surface2); }
body.light-mode .accordion-trigger { background:var(--surface); }
body.light-mode .group-trigger { background:var(--surface); }
body.light-mode .improvement-row { background:var(--surface2); }
body.light-mode .improvement-row.is-checked { background:rgba(96,165,250,0.08); }
body.light-mode .section-notes-trigger { background:var(--surface2); }

/* ── THEME TOGGLE ── */
.theme-toggle {
  background:none; border:none; cursor:pointer; padding:13px;
  color:var(--text-muted); transition:color 0.15s; display:flex; align-items:center;
  float:right; margin-bottom:-42px;
}
.theme-toggle:hover { color:var(--text); }
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; background:#0f1117; }
body { background:#0f1117; color:var(--text); font-family:var(--sans); display:flex; flex-direction:column; }

/* ── HEADER ── */
.app-header {
  background:var(--surface);
  border-bottom:1px solid var(--border);
  padding:12px 16px 10px;
  flex-shrink:0;
  z-index:50;
}
.header-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.app-logo { font-family:var(--mono); font-size:12px; font-weight:600; letter-spacing:0.1em; color:#ffffff; text-transform:uppercase; }
.app-logo span { color:var(--text-muted); }

/* Editable site name */
.site-name-wrap { display:flex; align-items:center; gap:6px; }
.site-name[contenteditable="true"] {
  outline:none; border-bottom:1px dashed var(--text-muted);
  padding-bottom:1px; cursor:text; min-width:40px;
}
.site-name[contenteditable="true"]:focus { border-bottom-color:var(--accent); }
.edit-name-btn {
  background:none; border:none; cursor:pointer; color:var(--text-muted);
  padding:2px; display:flex; align-items:center; transition:color 0.15s; flex-shrink:0;
}
.edit-name-btn:hover { color:var(--accent); }

.status-pill {
  font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:0.1em;
  padding:3px 9px; border-radius:20px; text-transform:uppercase;
  background:rgba(74,222,128,0.15); color:var(--accent); border:1px solid rgba(74,222,128,0.3);
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
}
.site-name { font-size:16px; font-weight:600; letter-spacing:-0.01em; }
.site-meta { font-family:var(--mono); font-size:10px; color:var(--text-muted); letter-spacing:0.04em; margin-top:2px; }

/* Prevent iOS auto-zoom on input focus — must be 16px or larger */
input, textarea, select { font-size: 16px !important; }
.section-nav {
  display:flex; overflow-x:auto; gap:4px; padding:8px 12px;
  background:var(--surface); border-bottom:1px solid var(--border);
  flex-shrink:0; scrollbar-width:none;
}
.section-nav::-webkit-scrollbar { display:none; }
.sec-tab {
  flex-shrink:0; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:6px 10px; border-radius:8px; cursor:pointer; border:1.5px solid #2A3045;
  background:#191D2A; transition:all 0.15s; min-width:60px; position:relative;
}
.sec-tab .followup-dot {
  display:none; position:absolute; top:4px; right:4px;
  width:6px; height:6px; border-radius:50%; background:#fbbf24;
}
.sec-tab.has-followup .followup-dot { display:block; }
.sec-tab.active { background:#2A3045; border-color:#64748B; border-width:2px; }
.sec-tab-icon { display:flex; align-items:center; justify-content:center; }
.sec-tab-label { font-family:var(--mono); font-size:8px; font-weight:600; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted); white-space:nowrap; }
.sec-tab.active .sec-tab-label { color:#FFFFFF; }
.sec-tab-count { font-family:var(--mono); font-size:8px; color:var(--text-muted); }
.sec-tab-count .done { color:var(--accent); }

/* ── PROGRESS ── */
.progress-bar-wrap {
  background:var(--surface); padding:8px 16px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:10px; flex-shrink:0;
}
.progress-track { flex:1; height:4px; background:var(--border); border-radius:2px; overflow:hidden; }
.progress-fill { height:100%; background:var(--accent); border-radius:2px; transition:width 0.4s ease; width:0%; }
.progress-label { font-family:var(--mono); font-size:10px; color:var(--text-muted); white-space:nowrap; min-width:52px; text-align:right; }

/* ── SCROLL AREA ── */
.scroll-area { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding-bottom:var(--bottom-h); background:#0f1117; }

/* ── SECTION HEADER ── */
.section-header {
  padding:16px 16px 4px 24px;
  display:flex; align-items:center; gap:14px;
}
.section-header-icon { display:flex; align-items:center; flex-shrink:0; color:var(--text); }
.sec-tab-icon { display:flex; align-items:center; justify-content:center; color:var(--text); }
.sec-tab.active .sec-tab-icon { color:#FFFFFF; }
.picker-option-icon { display:flex; align-items:center; flex-shrink:0; color:var(--text); }
.section-header-title { font-family:var(--mono); font-size:16px; font-weight:600; letter-spacing:0.1em; text-transform:uppercase; color:var(--text); }
.section-header-sub { font-family:var(--mono); font-size:10px; color:var(--text-muted); margin-top:1px; }
.btn-remove-section {
  margin-left:auto; display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; flex-shrink:0;
  background:none; border:none; border-radius:8px;
  color:var(--text-muted); cursor:pointer; transition:all 0.15s;
}
.btn-remove-section:hover { background:rgba(239,68,68,0.12); color:var(--fail); }

/* ── GROUP ACCORDION ── */
.group-accordion { margin-bottom:4px; }
.group-accordion.no-trigger { margin-top:12px; }

.group-trigger {
  width:100%; background:var(--surface); border:none; padding:16px 16px 12px 22px;
  display:flex; align-items:center; gap:14px; cursor:pointer; text-align:left;
  position:relative;
}
.group-chevron { color:var(--text-muted); transition:transform 0.25s ease; flex-shrink:0; margin-left:4px; margin-right:4px; }
.group-accordion.group-open .group-chevron { transform:rotate(180deg); }
.group-name {
  flex:1; font-family:var(--mono); font-size:10px; font-weight:600;
  letter-spacing:0.1em; color:var(--text);
  outline:none; background:none; border:none;
  border-bottom:1px solid transparent; padding-bottom:1px;
  cursor:pointer;
}
.group-name:focus { border-bottom-color:var(--accent); color:var(--text); cursor:text; }
.group-count { font-family:var(--mono); font-size:9px; color:var(--text-muted); white-space:nowrap; transition:opacity 0.15s; }
.group-trigger:focus-within .group-count { opacity:0; }
.group-count .done { color:var(--accent); }
.btn-del-group {
  background:none; border:none; padding:8px 10px; color:var(--text-muted);
  cursor:pointer; display:flex; align-items:center; border-radius:6px; transition:all 0.15s;
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  opacity:0; pointer-events:none;
}
.btn-del-group.visible { opacity:1; pointer-events:auto; }
.btn-del-group:hover { color:var(--fail); background:rgba(248,113,113,0.08); }
.group-panel { max-height:0; overflow:hidden; transition:max-height 0.35s ease; }
.group-accordion.group-open .group-panel { max-height:9999px; }
.group-items { display:flex; flex-direction:column; gap:3px; padding:8px 12px 8px; }
.group-accordion:not(.has-trigger) .group-items { padding-top:0; }

/* Divider between groups */
.group-divider { border:none; border-top:1px solid var(--border); margin:0 16px 4px; }

/* Add group button */
.btn-add-group {
  display:flex; align-items:center; justify-content:center; gap:7px;
  margin:4px 12px 12px; padding:10px;
  background:none; border:1.5px dashed var(--border); border-radius:10px;
  font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--text-muted); cursor:pointer; transition:all 0.15s;
  width:calc(100% - 24px);
}
.btn-add-group:hover { border-color:var(--accent); color:var(--accent); }

/* ── ACCORDION ── */
.accordion-list { display:flex; flex-direction:column; gap:3px; padding:0 12px 8px; }

.accordion-item {
  background:var(--surface); border:1px solid var(--border);
  border-left:3px solid transparent;
  border-radius:10px; overflow:hidden; transition:border-color 0.2s;
}
.accordion-item.is-open { border-color:#2e3a52; }
body.light-mode .accordion-item.is-open { border-color:#DEDED5; }
body.light-mode .accordion-item.is-open.status-pass { border-left-color:var(--accent); }
body.light-mode .accordion-item.is-open.status-fail { border-left-color:var(--fail); }
body.light-mode .accordion-item.is-open.status-na { border-left-color:var(--text-muted); }
body.light-mode .accordion-item.is-open.has-improvement { border-left-color:#60a5fa; }
body.light-mode .accordion-item.is-open.has-followup { border-left-color:#fbbf24; }
.accordion-item.status-pass { border-left:3px solid var(--accent); }
.accordion-item.status-fail { border-left:3px solid var(--fail); }
.accordion-item.status-na   { border-left:3px solid var(--text-muted); }
.accordion-item.has-improvement { border-left:3px solid #60a5fa; }
.accordion-item.priority-high .item-number::after { content:'●'; color:var(--fail); font-size:6px; vertical-align:middle; margin-left:2px; }
.badge-group { display:flex; align-items:stretch; flex-shrink:0; }
.badge-improvement {
  display:none; align-items:center; justify-content:center;
  width:28px; flex-shrink:0; color:#60a5fa;
  background:rgba(96,165,250,0.15); border:1px solid rgba(96,165,250,0.35);
  border-right:1px solid rgba(96,165,250,0.35); border-radius:8px 0 0 8px;
}
.accordion-item.has-improvement .badge-improvement { display:flex; }
.accordion-item.has-improvement .item-badge { border-left:none; border-radius:0 8px 8px 0; }

/* ── IMPROVEMENT CHECKBOX ── */
.flags-row { display:flex; gap:6px; margin-bottom:10px; }
.improvement-row {
  display:flex; align-items:center; gap:8px; flex:1;
  padding:9px 11px; background:var(--surface);
  border:1.5px solid var(--border); cursor:pointer; transition:all 0.15s;
  border-radius:8px;
}
.improvement-row.is-checked { border-color:rgba(96,165,250,0.4); background:rgba(96,165,250,0.08); }
.improvement-row input[type="checkbox"] { display:none; }
.flag-icon { display:flex; align-items:center; flex-shrink:0; }
.flag-icon .flag-filled { display:none; }
.improvement-row.is-checked .flag-icon .flag-outline { display:none; }
.improvement-row.is-checked .flag-icon .flag-filled { display:flex; }
.followup-row.is-checked .flag-icon .flag-outline { display:none; }
.followup-row.is-checked .flag-icon .flag-filled { display:flex; }
.improvement-label {
  font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--text-muted); flex:1;
}
.improvement-row.is-checked .improvement-label { color:#60a5fa; }
.improvement-notes {
  width:100%; background:var(--surface2); border:1.5px solid var(--border); border-radius:8px;
  color:var(--text); font-family:var(--sans); font-size:13px; padding:9px 11px;
  resize:none; outline:none; min-height:64px; transition:border-color 0.15s, height 0.2s ease;
  display:none; margin-bottom:10px;
}
.improvement-notes.visible { display:block; }
.improvement-notes::placeholder { color:var(--text-muted); }
.improvement-notes:focus { border-color:rgba(96,165,250,0.4); min-height:140px; }

.accordion-trigger {
  width:100%; background:var(--surface); border:none; padding:13px 14px;
  display:flex; align-items:center; gap:12px; cursor:pointer; text-align:left;
}
.item-number { font-family:var(--mono); font-size:10px; font-weight:600; color:var(--text-muted); min-width:20px; }
.item-info { flex:1; min-width:0; }
.item-title { font-size:13px; font-weight:500; color:var(--text); letter-spacing:-0.01em; margin-bottom:1px; }
.item-subtitle { font-family:var(--mono); font-size:9px; color:var(--text-muted); letter-spacing:0.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-badge {
  font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:0.08em;
  text-transform:uppercase; padding:0 8px; border-radius:8px; border:1px solid transparent;
  flex-shrink:0; height:28px; display:flex; align-items:center;
}
.badge-pending { background:var(--surface2); color:var(--text-muted); border-color:var(--border); }
.badge-pass    { background:var(--accent-dim); color:var(--accent); border-color:rgba(74,222,128,0.25); }
.badge-fail    { background:var(--fail-dim); color:var(--fail); border-color:rgba(248,113,113,0.25); }
.badge-na      { background:rgba(100,116,139,0.15); color:var(--text-muted); border-color:rgba(100,116,139,0.2); }
.chevron { color:var(--text-muted); transition:transform 0.25s ease; flex-shrink:0; }
.accordion-item.is-open .chevron { transform:rotate(180deg); }

/* ── PANEL ── */
.accordion-panel { max-height:0; overflow:hidden; transition:max-height 0.3s ease; }
.accordion-item.is-open .accordion-panel { max-height:800px; }
.panel-inner { padding:0 14px 16px; border-top:1px solid var(--border); padding-top:14px; display:flex; flex-direction:column; gap:12px; }

.question-text {
  font-size:13px; color:var(--text-dim); line-height:1.6;
  padding:10px 12px; background:var(--surface2); border-radius:8px; border-left:2px solid var(--border);
}
.ada-ref {
  display:flex; align-items:flex-start; gap:8px; padding:8px 10px;
  background:rgba(245,158,11,0.06); border:1px solid rgba(245,158,11,0.15); border-radius:6px;
}
.ada-ref-label { font-family:var(--mono); font-size:9px; color:var(--warn); font-weight:600; letter-spacing:0.08em; white-space:nowrap; padding-top:1px; }
.ada-ref-text { font-size:11px; color:var(--text-muted); line-height:1.4; }

/* ── RADIO ── */
.radio-group { display:flex; gap:6px; }
.radio-option { flex:1; }
.radio-option input[type="radio"] { display:none; }
.radio-label {
  -webkit-user-select:none; user-select:none;
  display:flex; align-items:center; justify-content:center; padding:9px 6px; border-radius:8px;
  border:1.5px solid var(--border); background:var(--surface2); cursor:pointer;
  font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:0.06em;
  color:var(--text-muted); transition:all 0.15s ease; text-transform:uppercase; gap:4px;
}
.radio-option input[type="radio"]:checked + .radio-label.pass-label { background:var(--accent-dim); border-color:var(--accent); color:var(--accent); }
.radio-option input[type="radio"]:checked + .radio-label.fail-label { background:var(--fail-dim); border-color:var(--fail); color:var(--fail); }
.radio-option input[type="radio"]:checked + .radio-label.na-label   { background:rgba(100,116,139,0.15); border-color:var(--text-muted); color:var(--text-dim); }

/* ── NOTES ── */
.field-label { font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-muted); margin-bottom:5px; }
.notes-input {
  width:100%; background:var(--surface2); border:1.5px solid var(--border); border-radius:8px;
  color:var(--text); font-family:var(--sans); font-size:13px; padding:9px 11px;
  resize:none; outline:none; transition:border-color 0.15s, height 0.2s ease; min-height:64px;
}
.notes-input::placeholder { color:var(--text-muted); }
.notes-input:focus { border-color:#3a4560; min-height:140px; }
.group-notes-input { min-height:36px; max-height:36px; overflow:hidden; background:var(--surface); border-color:var(--border); }
.group-notes-input:focus { min-height:80px; max-height:200px; overflow:auto; }

/* ── PHOTO ── */
.photo-section { display:flex; flex-direction:column; gap:6px; }
.photo-trigger {
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:10px; border-radius:8px; border:1.5px dashed var(--border);
  background:var(--surface2); cursor:pointer; color:var(--text-muted);
  font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:0.06em;
  text-transform:uppercase; transition:all 0.15s;
}
.photo-trigger:hover { border-color:#3a4560; color:var(--text-dim); }
.photo-trigger input[type="file"] { display:none; }
.photo-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.photo-thumb {
  aspect-ratio:1; border-radius:6px; overflow:hidden; position:relative;
  background:var(--surface2); cursor:pointer;
}
.photo-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-remove {
  position:absolute; top:3px; right:3px; width:18px; height:18px;
  background:rgba(0,0,0,0.7); border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:10px; color:#fff; border:none; cursor:pointer; line-height:1;
}
.photo-save {
  position:absolute; bottom:3px; right:3px; width:22px; height:22px;
  background:rgba(0,0,0,0.65); border-radius:50%; display:flex; align-items:center; justify-content:center;
  border:none; cursor:pointer; transition:background 0.15s;
}
.photo-save:hover { background:rgba(74,222,128,0.8); }
.photo-save.saved { background:rgba(74,222,128,0.7); }
.photo-save svg { flex-shrink:0; }

/* ── SECTION NOTES ── */
.section-notes-wrap {
  padding:4px 12px 16px;
}
.section-notes-trigger {
  width:100%; background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:12px 16px; display:flex; align-items:center;
  gap:10px; cursor:pointer; text-align:left; transition:border-color 0.2s;
  color:var(--text-muted); height:44px;
}
.section-notes-trigger.has-content { border-color:rgba(74,222,128,0.3); }
.section-notes-label {
  flex:1; font-family:var(--mono); font-size:10px; font-weight:600;
  letter-spacing:0.1em; text-transform:uppercase; color:var(--text-muted);
}
.section-notes-trigger.has-content .section-notes-label { color:var(--accent); }
.section-notes-panel { display:none; padding:10px 12px 0; }
.section-notes-wrap.open .section-notes-panel { display:block; }
.section-notes-wrap.open .section-notes-trigger { border-radius:10px 10px 0 0; border-bottom:none; }
.section-notes-textarea {
  width:100%; background:var(--surface2); border:1.5px solid var(--border);
  border-radius:0 0 10px 10px; color:var(--text); font-family:var(--sans);
  font-size:13px; padding:10px 12px; resize:none; outline:none;
  transition:border-color 0.15s, height 0.2s ease; min-height:80px;
}
.section-notes-textarea::placeholder { color:var(--text-muted); }
.section-notes-textarea:focus { border-color:#2e4a3a; min-height:130px; }

/* ── BOTTOM BAR ── */
.bottom-bar {
  position:fixed; bottom:0; left:0; right:0;
  background:var(--surface); border-top:1px solid var(--border);
  padding:10px 14px; display:flex; gap:8px; align-items:stretch;
  z-index:50;
}
.btn-base {
  height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:10px; cursor:pointer; transition:all 0.15s;
  font-family:var(--mono); font-weight:600; letter-spacing:0.07em;
  text-transform:uppercase; white-space:nowrap; border:1.5px solid var(--border);
  background:var(--surface2); color:var(--text-muted); flex-shrink:0;
}
.btn-base:hover { border-color:#3a4560; color:var(--text); }
.btn-files {
  padding:0 14px; gap:7px; font-size:11px;
  height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:10px; cursor:pointer; transition:all 0.15s;
  font-family:var(--mono); font-weight:600; letter-spacing:0.07em;
  text-transform:uppercase; white-space:nowrap; border:1.5px solid var(--border);
  background:var(--surface2); color:var(--text-muted); flex-shrink:0;
}
.btn-files:hover { border-color:#3a4560; color:var(--text); }
.btn-files-inner { position:relative; display:flex; align-items:center; gap:7px; }
.gallery-badge {
  position:absolute; top:-7px; right:-9px;
  background:var(--accent); color:#0a1a0f;
  font-family:var(--mono); font-size:8px; font-weight:700;
  min-width:16px; height:16px; border-radius:8px;
  display:none; align-items:center; justify-content:center;
  padding:0 3px; letter-spacing:0; line-height:1;
  border:1.5px solid var(--surface);
}
.gallery-badge.visible { display:flex; }
.bar-divider {
  width:1px; background:var(--border); align-self:stretch; flex-shrink:0; margin:0 2px;
}
.btn-report {
  flex:1; height:44px; padding:0 12px; background:#64748B; color:#ffffff;
  border:none; border-radius:0 10px 10px 0; font-family:var(--mono); font-size:11px;
  font-weight:700; letter-spacing:0.08em; text-transform:uppercase; cursor:pointer;
  transition:opacity 0.15s;
}
.btn-report:hover { opacity:0.9; }
.btn-report:disabled { opacity:0.35; cursor:not-allowed; }
.btn-save {
  padding:0 14px; gap:7px; font-size:11px;
  height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:10px 0 0 10px; cursor:pointer; transition:all 0.15s;
  font-family:var(--mono); font-weight:600; letter-spacing:0.07em;
  text-transform:uppercase; white-space:nowrap; flex-shrink:0;
  background:transparent; color:#64748B;
  border:1.5px solid #64748B; border-right:none;
}
.btn-save:hover { background:rgba(100,116,139,0.15); }

/* ── TOAST ── */
.toast {
  position:fixed; top:16px; left:50%; transform:translateX(-50%) translateY(-10px);
  background:var(--surface2); border:1px solid var(--accent); color:var(--accent);
  font-family:var(--mono); font-size:11px; padding:9px 18px; border-radius:8px;
  opacity:0; transition:all 0.25s ease; pointer-events:none; white-space:nowrap; z-index:200;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

.sec-tab-add {
  border-style:dashed; color:var(--text-muted); padding-top:10px;
}
.sec-tab-add:hover { border-color:var(--accent); }
.sec-tab-add .sec-tab-label { color:var(--text-muted); }

/* ── SECTION PICKER ── */
.picker-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:300;
  display:none; align-items:flex-end; justify-content:center;
}
.picker-overlay.open { display:flex; }
.picker-sheet {
  background:var(--surface); border:1px solid var(--border);
  border-radius:16px 16px 0 0; width:100%; max-width:480px;
  padding:0 0 32px; max-height:70vh; overflow-y:auto;
}
.picker-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px 12px; border-bottom:1px solid var(--border);
  position:sticky; top:0; background:var(--surface); z-index:1;
}
.picker-title { font-size:15px; font-weight:600; letter-spacing:-0.01em; }
.picker-close {
  background:none; border:none; color:var(--text-muted); font-size:16px;
  cursor:pointer; padding:4px 6px; border-radius:6px; transition:color 0.15s;
}
.picker-close:hover { color:var(--text); }
.picker-list { display:flex; flex-direction:column; gap:2px; padding:10px 12px; }
.picker-option {
  display:flex; align-items:center; gap:12px; padding:14px 12px 14px 4px;
  border-radius:10px; cursor:pointer; transition:background 0.15s;
  border:1.5px solid transparent;
}
.picker-option:hover { background:var(--surface2); }
.picker-option.added { opacity:0.45; pointer-events:none; }
.picker-option-icon { font-size:22px; flex-shrink:0; }
.picker-option-info { flex:1; }
.picker-option-name { font-size:14px; font-weight:600; margin-bottom:2px; }
.picker-option-count { font-family:var(--mono); font-size:10px; font-weight:400; color:var(--text-muted); margin-left:4px; }
.picker-option-desc { font-size:12px; color:var(--text-muted); }
.picker-option-badge {
  font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:0.08em;
  text-transform:uppercase; padding:3px 8px; border-radius:4px; flex-shrink:0;
}
.picker-option-badge.available { background:var(--accent-dim); color:var(--accent); border:1px solid rgba(74,222,128,0.25); }
.picker-option-badge.active { background:var(--surface2); color:var(--text-muted); border:1px solid var(--border); }

/* ── CONFIRM DIALOG ── */
.confirm-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:400;
  display:none; align-items:center; justify-content:center; padding:24px;
}
.confirm-overlay.open { display:flex; }
.confirm-box {
  background:var(--surface2); border:1px solid var(--border); border-radius:14px;
  padding:24px; width:100%; max-width:320px; display:flex; flex-direction:column; gap:12px;
}
.confirm-title { font-size:15px; font-weight:600; color:var(--text); }
.confirm-msg { font-size:13px; color:var(--text-muted); line-height:1.5; }
.confirm-actions { display:flex; gap:8px; margin-top:4px; }
.confirm-cancel {
  flex:1; padding:11px; background:var(--surface); border:1.5px solid var(--border);
  border-radius:10px; color:var(--text-muted); font-family:var(--mono); font-size:11px;
  font-weight:600; letter-spacing:0.06em; text-transform:uppercase; cursor:pointer; transition:all 0.15s;
}
.confirm-cancel:hover { border-color:var(--text-muted); color:var(--text); }
.confirm-ok {
  flex:1; padding:11px; background:var(--fail-dim); border:1.5px solid var(--fail);
  border-radius:10px; color:var(--fail); font-family:var(--mono); font-size:11px;
  font-weight:600; letter-spacing:0.06em; text-transform:uppercase; cursor:pointer; transition:all 0.15s;
}
.confirm-ok:hover { background:var(--fail); color:#fff; }

/* ── PHOTO VIEWER ── */
.photo-viewer {
  position:fixed; inset:0; background:rgba(0,0,0,0.92); z-index:300;
  display:none; align-items:center; justify-content:center;
}
.photo-viewer.open { display:flex; }
.photo-viewer img { max-width:95vw; max-height:90vh; border-radius:8px; object-fit:contain; }
.photo-viewer-close {
  position:absolute; top:16px; right:16px; background:rgba(255,255,255,0.1);
  border:none; border-radius:50%; width:36px; height:36px; color:#fff; font-size:18px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
/* ── RESET DIALOG ── */
.reset-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7);
  z-index:300; align-items:center; justify-content:center;
  backdrop-filter:blur(4px); padding:24px;
}
.reset-overlay.open { display:flex; }
.reset-sheet {
  background:var(--surface); border-radius:16px;
  padding:24px 20px; width:100%; max-width:360px;
  border:1px solid rgba(248,113,113,0.3);
}
.reset-title {
  font-family:var(--mono); font-size:13px; font-weight:700;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--fail);
  margin-bottom:6px;
}
.reset-desc {
  font-size:12px; color:var(--text-muted); line-height:1.6; margin-bottom:18px;
}
.reset-input {
  width:100%; background:var(--surface2); border:1.5px solid var(--border);
  border-radius:8px; color:var(--text); font-family:var(--mono);
  font-size:14px !important; font-weight:700; letter-spacing:0.12em;
  padding:12px 14px; outline:none; text-transform:uppercase; margin-bottom:14px;
  transition:border-color 0.15s;
}
.reset-input:focus { border-color:var(--fail); }
.reset-input.valid { border-color:var(--fail); color:var(--fail); }
.reset-actions { display:flex; gap:8px; }
.btn-reset-cancel {
  flex:1; padding:12px; background:var(--surface2); color:var(--text-dim);
  border:1.5px solid var(--border); border-radius:10px; font-family:var(--mono);
  font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; cursor:pointer;
}
.btn-reset-confirm {
  flex:1; padding:12px; background:var(--fail); color:#fff;
  border:none; border-radius:10px; font-family:var(--mono); font-size:11px;
  font-weight:700; letter-spacing:0.08em; text-transform:uppercase; cursor:pointer;
  opacity:0.35; transition:opacity 0.15s; pointer-events:none;
}
.btn-reset-confirm.ready { opacity:1; pointer-events:auto; }

/* ── GALLERY SHEET ── */
.gallery-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6);
  z-index:200; align-items:flex-end; justify-content:center;
  backdrop-filter:blur(4px);
}
.gallery-overlay.open { display:flex; }
.gallery-sheet {
  background:var(--surface); border-radius:20px 20px 0 0;
  width:100%; max-width:480px; max-height:88vh;
  display:flex; flex-direction:column;
  border-top:1px solid var(--border);
}
.gallery-header {
  padding:18px 18px 12px; display:flex; align-items:center;
  justify-content:space-between; flex-shrink:0;
  border-bottom:1px solid var(--border);
}
.gallery-title {
  font-family:var(--mono); font-size:13px; font-weight:600;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--text);
}
.gallery-subtitle { font-size:11px; color:var(--text-muted); margin-top:2px; }
.gallery-close {
  background:var(--surface2); border:none; border-radius:50%;
  width:30px; height:30px; display:flex; align-items:center;
  justify-content:center; cursor:pointer; color:var(--text-muted); font-size:16px;
}
.gallery-scroll { overflow-y:auto; padding:14px; flex:1; }
.gallery-section-label {
  font-family:var(--mono); font-size:9px; font-weight:600;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--text-muted);
  margin:12px 0 8px; 
}
.gallery-section-label:first-child { margin-top:0; }
.gallery-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:4px; }
.gallery-thumb {
  aspect-ratio:1; border-radius:8px; overflow:hidden; position:relative;
  background:var(--surface2); cursor:pointer;
}
.gallery-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-thumb .photo-save {
  width:26px; height:26px; bottom:4px; right:4px;
}
.gallery-item-label {
  font-size:9px; color:var(--text-muted); margin-top:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-family:var(--mono); letter-spacing:0.03em;
}
.gallery-empty {
  text-align:center; padding:48px 20px; color:var(--text-muted); font-size:13px;
}
.gallery-empty svg { margin-bottom:12px; opacity:0.3; }
/* ── FOLLOW-UP FLAG ── */
.followup-row {
  display:flex; align-items:center; gap:8px; flex:1;
  padding:9px 11px; background:var(--surface);
  border:1.5px solid var(--border); cursor:pointer; transition:all 0.15s;
  border-radius:8px;
}
.followup-row.is-checked { border-color:rgba(251,191,36,0.4); background:rgba(251,191,36,0.07); }
.followup-label {
  font-family:var(--mono); font-size:10px; font-weight:600;
  letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted);
  transition:color 0.15s;
}
.followup-row.is-checked .followup-label { color:#fbbf24; }
.accordion-item.has-followup { border-left:3px solid #fbbf24; }
body.light-mode .followup-row { background:var(--surface2); }
body.light-mode .followup-row.is-checked { background:rgba(251,191,36,0.08); }

/* ── EXPORT DIALOG ── */
.export-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6);
  z-index:200; align-items:flex-end; justify-content:center;
  backdrop-filter:blur(4px);
}
.export-overlay.open { display:flex; }
.export-sheet {
  background:var(--surface); border-radius:20px 20px 0 0;
  padding:24px 20px 36px; width:100%; max-width:480px;
  border-top:1px solid var(--border);
}
.export-title {
  font-family:var(--mono); font-size:13px; font-weight:600;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--text);
  margin-bottom:6px;
}
.export-subtitle {
  font-size:12px; color:var(--text-muted); margin-bottom:20px; line-height:1.5;
}
.export-options { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.export-option {
  display:flex; align-items:center; gap:14px;
  padding:14px 16px; background:var(--surface2);
  border:1.5px solid var(--border); border-radius:12px; cursor:pointer;
  transition:border-color 0.15s;
}
.export-option.selected { border-color:var(--accent); }
.export-option-check {
  width:20px; height:20px; border-radius:6px; border:1.5px solid var(--border);
  background:var(--surface); flex-shrink:0; display:flex; align-items:center;
  justify-content:center; transition:all 0.15s;
}
.export-option.selected .export-option-check {
  background:var(--accent); border-color:var(--accent);
}
.export-check-icon { display:none; }
.export-option.selected .export-check-icon { display:block; }
.export-option-info { flex:1; }
.export-option-name {
  font-family:var(--mono); font-size:11px; font-weight:600;
  letter-spacing:0.06em; text-transform:uppercase; color:var(--text); margin-bottom:2px;
}
.export-option-desc { font-size:11px; color:var(--text-muted); line-height:1.4; }
.export-option-icon { color:var(--text-muted); flex-shrink:0; }
.export-option.selected .export-option-icon { color:var(--accent); }
.export-actions { display:flex; gap:8px; }
.btn-export-cancel {
  padding:13px 20px; background:var(--surface2); color:var(--text-dim);
  border:1.5px solid var(--border); border-radius:10px; font-family:var(--mono);
  font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase;
  cursor:pointer; transition:all 0.15s;
}
.btn-export-go {
  flex:1; padding:13px; background:var(--accent); color:#0a1a0f;
  border:none; border-radius:10px; font-family:var(--mono); font-size:11px;
  font-weight:700; letter-spacing:0.08em; text-transform:uppercase; cursor:pointer;
  transition:opacity 0.15s;
}
.btn-export-go:hover { opacity:0.9; }
.export-summary {
  font-family:var(--mono); font-size:10px; color:var(--text-muted);
  margin-bottom:16px; padding:10px 12px; background:var(--surface2);
  border-radius:8px; line-height:1.6;
}

