﻿:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #edf4fb;
  --text: #172033;
  --muted: #66748a;
  --line: #dbe5f0;
  --navy: #12345b;
  --navy-2: #0d2747;
  --blue: #d9ebff;
  --green: #16865f;
  --rose: #f7dde3;
  --amber: #fff2cc;
  --shadow: 0 18px 45px rgba(18, 52, 91, .10);
  color-scheme: light;
}

body.dark {
  --bg: #09111f;
  --surface: #111c2d;
  --surface-soft: #17263b;
  --text: #edf4ff;
  --muted: #aab7c8;
  --line: #293a52;
  --navy: #8fc2ff;
  --navy-2: #dbeeff;
  --blue: #183150;
  --green: #66d5a8;
  --rose: #3a1f2b;
  --amber: #3b3118;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(217, 235, 255, .8), transparent 34rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.app-header,
main,
.app-footer {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
}

.back-link {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.theme-toggle,
.button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.button.ghost { background: transparent; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 18px;
  padding: 28px 0 18px;
}

.hero > div,
.summary-card,
.notice,
.controls,
.add-card,
.check-group,
.guide-grid article {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero > div { padding: clamp(24px, 5vw, 46px); }

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 900;
  letter-spacing: .02em;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 9vw, 68px);
  line-height: .98;
  color: var(--navy-2);
}

h2 { font-size: clamp(22px, 4vw, 34px); line-height: 1.12; }

.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 720px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.summary-card {
  padding: 22px;
  display: grid;
  gap: 13px;
  align-content: center;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.summary-row span,
.summary-card p,
.notice,
.controls label,
.item-meta,
.item-detail,
.item-note,
.guide-grid p { color: var(--muted); }

.summary-row strong { color: var(--navy-2); font-size: 20px; }

.progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--navy));
  transition: width .2s ease;
}

.notice {
  padding: 16px 18px;
  margin: 8px 0 18px;
}

.controls,
.add-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.controls label,
.custom-form {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 850;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
}

.profile-card {
  grid-template-columns: 1fr 1.2fr auto;
  align-items: end;
}

.profile-card p {
  color: var(--muted);
}

.profile-card strong {
  display: block;
  margin-top: 10px;
  color: var(--navy-2);
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-button input {
  display: none;
}

.add-card {
  grid-template-columns: .9fr 1.4fr;
  align-items: end;
}

.add-card p { color: var(--muted); margin-bottom: 0; }

.custom-form {
  grid-template-columns: 1.1fr .7fr .8fr auto;
  align-items: end;
}

.tabs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 0 16px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  min-height: 40px;
  padding: 8px 14px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.checklist {
  display: grid;
  gap: 18px;
}

.check-group { padding: 18px; }

.group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.group-head h2 { margin-bottom: 4px; }

.group-head p { color: var(--muted); margin-bottom: 0; }

.group-count {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--navy-2);
  padding: 7px 10px;
  font-weight: 900;
  white-space: nowrap;
}

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

.item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin-top: 3px;
  accent-color: var(--green);
}

.item-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.item-title strong { font-size: 17px; color: var(--navy-2); }

.badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.must { background: var(--rose); color: #9b2440; }
body.dark .must { color: #ffc1cf; }
.optional { background: var(--blue); color: var(--navy-2); }
.later { background: var(--amber); color: #765500; }
body.dark .later { color: #ffe59b; }

.item-detail { margin: 0; }
.item-note { margin: 0; font-size: 14px; }

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.item-meta span,
.buy-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-soft);
}

.buy-link {
  color: var(--navy-2);
  font-weight: 900;
  text-decoration: none;
}

.item.done .item-title strong,
.item.done .item-detail { text-decoration: line-through; opacity: .68; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.guide-grid article { padding: 18px; }

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--navy-2);
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 900px) {
  .hero,
  .add-card,
  .guide-grid { grid-template-columns: 1fr; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-form,
  .profile-form { grid-template-columns: 1fr 1fr; }
  .backup-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .app-header { align-items: stretch; }
  .theme-toggle { padding-inline: 10px; }
  .hero { padding-top: 12px; }
  .hero-actions,
  .controls,
  .custom-form { grid-template-columns: 1fr; display: grid; }
  .button { width: 100%; }
  .group-head { display: grid; }
  .item { padding: 12px; }
  .item-meta { display: grid; }
  .item-meta span,
  .buy-link { width: 100%; text-align: center; }
  .app-footer { display: grid; }
}

