:root {
  --bg-ivory: #f6efdf;
  --bg-pattern: #efe6d4;
  --surface: #fff9ef;
  --surface-strong: #fffdf8;
  --ink: #3a3126;
  --muted: #6d6559;
  --accent: #7f946d;
  --accent-soft: #d9e1cd;
  --danger: #b05f4a;
  --line: #d9cdb9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Gowun Dodum", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, #f9f4e8 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #e9deca 0%, transparent 35%),
    linear-gradient(180deg, var(--bg-ivory), var(--bg-pattern));
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px 110px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Nanum Myeongjo", serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 6px 14px rgba(58, 49, 38, 0.06);
}

.top-header {
  margin-bottom: 12px;
}

.top-header h1 {
  margin-top: 4px;
  font-size: 1.5rem;
}

.top-header .subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.eyebrow {
  font-size: 0.8rem;
  color: #5c6e4d;
  font-weight: 700;
}

.view {
  display: none;
  animation: fade-in 0.2s ease;
}

.view.active {
  display: block;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.hint {
  color: var(--muted);
  line-height: 1.55;
}

.step-tracker {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.step-tracker li {
  min-height: 48px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 12px;
  background: #f1e8d9;
  color: #6d6559;
  font-size: 0.86rem;
  padding: 6px;
}

.step-tracker li.active {
  background: #e0e9d5;
  color: #304224;
  font-weight: 700;
}

.step-tracker li.done {
  background: #d2ddc4;
  color: #2f4321;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

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

.chip {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.chip.selected {
  border-color: #6b8257;
  background: var(--accent-soft);
  color: #2b3d1f;
  font-weight: 700;
}

.input-stack {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.9rem;
  color: #4f4639;
}

textarea,
input[type="text"],
input:not([type]),
input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
}

textarea:focus,
input:focus {
  outline: 2px solid #b6c8a1;
  border-color: #9fb587;
}

.step-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.secondary {
  background: #d8d2c3;
  color: #3f372b;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.pause-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.pause-circle {
  --progress: 0deg;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) var(--progress), #e9deca 0);
  display: grid;
  place-items: center;
  transition: background 0.15s linear;
}

.pause-inner {
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: #fffdf7;
  display: grid;
  place-items: center;
  color: #314421;
}

.pause-inner strong {
  font-size: 1.5rem;
}

.hidden {
  display: none !important;
}

.check-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fffefb;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.family-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.family-item {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fffefb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.family-item p {
  margin: 0;
  line-height: 1.4;
}

.remove-btn {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #cfb8a4;
  border-radius: 10px;
  background: #fff4ec;
  color: var(--danger);
  font: inherit;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #faf3e5;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.nav-btn {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.nav-btn.active {
  border-color: #70855d;
  background: #dde7d1;
  color: #2f4321;
  font-weight: 700;
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(51, 41, 29, 0.45);
  padding: 16px;
}

.onboarding-card {
  width: 100%;
  max-width: 420px;
  background: #fffdf7;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(30px);
  background: #3d342a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 80;
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (min-width: 680px) {
  .chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
