:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #191f28;
  --muted: #6b7684;
  --soft: #eef1f5;
  --line: #e5e8eb;
  --blue: #3182f6;
  --blue-soft: #e8f3ff;
  --green: #00a889;
  --yellow: #f6c044;
  --red: #f04452;
  --shadow: 0 10px 28px rgba(25, 31, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  word-break: keep-all;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
}

.screen {
  min-height: 100vh;
  padding: 28px 20px 32px;
}

.hidden {
  display: none;
}

.top-visual {
  display: flex;
  justify-content: flex-end;
  height: 92px;
}

.bag-shape {
  position: relative;
  width: 92px;
  height: 76px;
  margin-top: 8px;
  border-radius: 22px;
  background: linear-gradient(135deg, #3182f6, #00a889);
  box-shadow: var(--shadow);
}

.bag-handle {
  position: absolute;
  top: -16px;
  left: 27px;
  width: 38px;
  height: 26px;
  border: 8px solid #8ec5ff;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
}

.bag-pocket {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
}

.bag-check {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.setup-form {
  display: grid;
  gap: 24px;
}

.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.choice-chip.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.primary-button,
.secondary-button,
.icon-button,
.segment-button,
.filter-button,
.check-button,
.row-toggle,
.item-content {
  border: 0;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
}

.app-header {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.progress-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding: 20px;
  border-radius: 8px;
  background: #f2f7ff;
}

.progress-copy {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

#progress-title {
  display: block;
  font-size: 34px;
  line-height: 1;
}

#progress-detail {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.progress-ring {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background:
    conic-gradient(var(--blue) var(--progress, 0%), #dce8f8 0);
}

.progress-ring span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.remaining-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 14px 0 20px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eefaf7;
  color: #087d6a;
  font-size: 14px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 46px;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
}

.segment-button {
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.segment-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(25, 31, 40, 0.08);
}

.filter-strip {
  display: flex;
  gap: 8px;
  margin: 16px -20px 8px;
  padding: 0 20px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-button.active {
  background: var(--text);
  color: #ffffff;
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.item-main {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
}

.check-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.check-button.checked {
  background: var(--blue);
  color: #ffffff;
}

.item-content {
  min-width: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.item-content strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
  word-break: keep-all;
}

.item-content span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.row-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.item-detail {
  display: grid;
  gap: 10px;
  padding: 0 14px 16px 64px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff6df;
  color: #8b6508;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 36px 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.notice {
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.secondary-button.danger {
  color: var(--red);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 20px;
  left: 16px;
  max-width: 480px;
  min-height: 44px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(25, 31, 40, 0.92);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 720px) {
  body {
    padding: 32px 0;
  }

  .app-shell {
    min-height: calc(100vh - 64px);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .screen {
    min-height: calc(100vh - 64px);
  }
}
