*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3248;
  --accent: #4f8ef7;
  --accent2: #7c5cfc;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --text: #e8eaf6;
  --muted: #8b90a8;
  --radius: 14px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, #1a1d27 0%, #1e2235 100%);
  border-bottom: 1px solid var(--border);
  padding: 24px 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto 16px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.van-icon {
  font-size: 2.4rem;
  line-height: 1;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.score-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  text-align: center;
  min-width: 90px;
  transition: background 0.3s;
}

.score-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.score-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 2px;
}

.score-pct {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.van-details-bar {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 16px;
  flex-wrap: wrap;
}

.van-details-bar input {
  flex: 1;
  min-width: 140px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.van-details-bar input:focus {
  border-color: var(--accent);
}

.van-details-bar input::placeholder { color: var(--muted); }

.progress-bar-wrap {
  max-width: 760px;
  margin: 0 auto;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.verdict-bar {
  max-width: 760px;
  margin: 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 0 10px;
  color: var(--muted);
  letter-spacing: 0.3px;
  min-height: 28px;
  transition: color 0.3s;
}

/* ── MAIN ── */
main {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── SECTION CARD ── */
.check-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.section-header:hover { background: var(--surface2); }

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon { font-size: 1.2rem; }

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.section-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.section-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-score-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--muted);
  transition: all 0.3s;
}

.section-score-pill.done { background: rgba(34,197,94,0.15); border-color: var(--green); color: var(--green); }
.section-score-pill.partial { background: rgba(245,158,11,0.15); border-color: var(--amber); color: var(--amber); }

.chevron {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.25s;
}

.check-section.collapsed .chevron { transform: rotate(-90deg); }

.section-body {
  border-top: 1px solid var(--border);
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.check-section.collapsed .section-body { max-height: 0 !important; border-top: none; }

/* ── CHECKLIST ITEMS ── */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.check-item:last-child { border-bottom: none; }
.check-item:hover { background: rgba(79,142,247,0.04); }

.check-item.checked { background: rgba(34,197,94,0.04); }
.check-item.flagged { background: rgba(239,68,68,0.05); }

.check-item input[type="checkbox"] { display: none; }

.custom-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.2s;
  font-size: 0.75rem;
}

.check-item.checked .custom-check {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.check-item.flagged .custom-check {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.item-content { flex: 1; }

.item-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.item-hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.item-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.tag-critical { background: rgba(239,68,68,0.2); color: #f87171; }
.tag-important { background: rgba(245,158,11,0.2); color: #fbbf24; }
.tag-ac { background: rgba(79,142,247,0.2); color: #93c5fd; }

.item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.flag-btn {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.flag-btn:hover { border-color: var(--red); color: var(--red); }
.flag-btn.active { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.1); }

.item-note-input {
  width: 100%;
  margin-top: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 7px 10px;
  outline: none;
  resize: none;
  min-height: 36px;
  transition: border-color 0.2s;
  display: none;
}

.item-note-input.visible { display: block; }
.item-note-input:focus { border-color: var(--accent); }
.item-note-input::placeholder { color: var(--muted); }

/* ── NOTES SECTION ── */
.notes-section, .offer-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.notes-section h2, .offer-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 28px;
}

.notes-section textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

.notes-section textarea:focus { border-color: var(--accent); }
.notes-section textarea::placeholder { color: var(--muted); }

/* ── OFFER CALCULATOR ── */
.offer-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 760px;
  margin: 20px auto 0;
}

.offer-section h2 { margin-top: 0; }

.offer-grid { display: flex; flex-direction: column; gap: 12px; }

.offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offer-row label {
  font-size: 0.84rem;
  color: var(--muted);
  flex: 1;
}

.offer-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 130px;
}

.offer-input-wrap span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
  border-right: 1px solid var(--border);
}

.offer-input-wrap input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 9px 10px;
  outline: none;
  width: 100px;
}

.offer-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 4px;
}

.offer-result span { font-size: 0.84rem; color: var(--muted); }

.offer-result strong {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green);
}

.calc-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.calc-btn:hover { opacity: 0.88; }

/* ── ACTION BAR ── */
.action-bar {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 0 16px;
  display: flex;
  gap: 12px;
}

.btn-reset, .btn-export {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-reset:hover { border-color: var(--red); color: var(--red); }

.btn-export {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-export:hover { background: var(--accent); color: white; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
  z-index: 999;
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  h1 { font-size: 1.1rem; }
  .van-icon { font-size: 1.8rem; }
  .score-num { font-size: 1.3rem; }
  .check-item { padding: 12px 14px; }
  .section-header { padding: 14px 14px; }
  .offer-row { flex-direction: column; align-items: flex-start; }
  .offer-input-wrap { width: 100%; }
  .offer-input-wrap input { width: 100%; }
}