:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --ink: #0b1626;
  --muted: #5b6a7d;
  --line: #dfe6f0;
  --accent: #1668b8;
  --accent-ink: #ffffff;
  --accent-soft: #e7f1fb;
  --danger: #c8372d;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(11, 22, 38, 0.08);
}

:root[data-theme="dark"] {
  --bg: #0b1018;
  --surface: #121a26;
  --surface-2: #172130;
  --ink: #eaf1fb;
  --muted: #93a3b8;
  --line: #223043;
  --accent: #4ea1ff;
  --accent-ink: #06101d;
  --accent-soft: #14263c;
  --danger: #ff7b72;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-top)) 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
}

.brand-name { font-weight: 700; letter-spacing: 0.06em; font-size: 13px; }
.brand-sub { color: var(--muted); font-size: 12px; }

.step-pill {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 10px;
}

.content { flex: 1; padding: 18px 18px 120px; }

.screen { animation: fade 0.22s ease; }
.screen[hidden] { display: none; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.title {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 6px 0 10px;
}

.lead { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.section-head h2 { font-size: 15px; margin: 0; letter-spacing: 0.01em; }
.hint { font-size: 12px; color: var(--muted); }

.list { display: grid; gap: 10px; }

.card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}

.card:active { transform: scale(0.995); }
.card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.card-main { flex: 1; min-width: 0; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.card-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-meta { display: flex; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }

.price { white-space: nowrap; font-weight: 700; font-size: 15px; }

.check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 2px;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
}

.card[aria-pressed="true"] .check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.toggle-dot {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.15s ease;
}

.toggle-dot::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.toggle[aria-pressed="true"] .toggle-dot { background: var(--accent); border-color: var(--accent); }
.toggle[aria-pressed="true"] .toggle-dot::after { transform: translateX(18px); background: var(--accent-ink); }

.toggle-text strong { display: block; font-size: 14px; }
.toggle-text small { color: var(--muted); font-size: 12px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field em { font-style: normal; opacity: 0.7; }

.field input,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus { border-color: var(--accent); }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  margin-top: 6px;
}

.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary-row span { color: var(--muted); }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; }

.error { color: var(--danger); font-size: 13px; margin: 10px 0 0; }

.dock {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom)) 18px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.dock[hidden] { display: none; }

.dock-total { flex: 1; min-width: 0; }
.dock-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dock-total strong { font-size: 19px; letter-spacing: -0.01em; }
.dock-total small { display: block; color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:disabled { opacity: 0.45; cursor: default; }
.btn.ghost { width: 100%; margin-top: 14px; }
.btn.link { background: none; border: none; color: var(--muted); width: 100%; margin-top: 8px; }

.success { text-align: center; padding-top: 18px; }
.success-mark {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 8px auto 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
}

.success .summary-card { text-align: left; }

@media (min-width: 520px) {
  .title { font-size: 30px; }
  .content { padding: 26px 22px 10px; }
}
