:root {
  --paper: #f6efe4;
  --panel: rgba(255, 251, 245, 0.92);
  --surface: rgba(255, 255, 255, 0.86);
  --ink: #19222b;
  --muted: #62707b;
  --line: rgba(25, 34, 43, 0.1);
  --salmon: #e77856;
  --forest: #2d6d63;
  --forest-soft: rgba(45, 109, 99, 0.12);
  --gold: #e9b85d;
  --gold-soft: rgba(233, 184, 93, 0.16);
  --berry: #b94a58;
  --berry-soft: rgba(185, 74, 88, 0.14);
  --sky: #dcebec;
  --shadow: 0 22px 56px rgba(25, 34, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(233, 184, 93, 0.42), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(45, 109, 99, 0.2), transparent 24%),
    linear-gradient(180deg, #fffaf3 0%, #f3eadc 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.page {
  width: min(1260px, calc(100% - 34px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero,
.panel,
.summary-card,
.card,
.spotlight-card,
.mission-card,
.lock-card,
.timeline-entry,
.phrase-choice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise 0.55s ease both;
}

.hero,
.panel {
  padding: 30px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(233, 184, 93, 0.24), rgba(231, 120, 86, 0.1)),
    rgba(255, 251, 245, 0.92);
}

.hero::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -72px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 109, 99, 0.2), transparent 70%);
  pointer-events: none;
}

.eyebrow,
.chip,
.badge,
.tag,
.mini-chip,
.lock-chip,
.quick-chip,
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow,
.chip,
.mini-chip,
.quick-chip {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 34, 43, 0.08);
  color: var(--ink);
}

.badge {
  background: var(--berry-soft);
  color: var(--berry);
}

.tag,
.state-chip.is-good,
.lock-chip.lock-must {
  background: var(--forest-soft);
  color: var(--forest);
}

.state-chip.is-warn,
.lock-chip.lock-flex {
  background: var(--gold-soft);
  color: #9b6a14;
}

.state-chip.is-alert,
.lock-chip.lock-drop {
  background: var(--berry-soft);
  color: var(--berry);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.08;
}

h1 {
  margin-top: 16px;
  max-width: 960px;
  font-size: clamp(34px, 5vw, 58px);
}

h2 {
  font-size: clamp(28px, 3vw, 34px);
}

h3 {
  font-size: 24px;
}

p,
li,
label,
button,
input,
textarea {
  line-height: 1.7;
}

.lead {
  max-width: 960px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.panel-intro,
.small,
.notice,
.card p,
.spotlight-card p,
.summary-card p,
.lock-card p,
.footer-note,
.timeline-meta,
.timeline-empty,
.field-help {
  color: var(--muted);
}

.chip-row,
.button-row,
.toggle-group,
.metric-row,
.mini-chip-row,
.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button-row {
  align-items: center;
}

.cta,
.toggle-btn,
.mission-toggle,
.lock-toggle,
.phrase-action,
.quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cta:hover,
.toggle-btn:hover,
.mission-toggle:hover,
.lock-toggle:hover,
.phrase-action:hover,
.quick-action:hover {
  transform: translateY(-1px);
}

.cta,
.quick-action.is-primary,
.phrase-action.is-primary,
.lock-toggle.is-active {
  background: var(--ink);
  color: #fff;
}

.cta.alt,
.toggle-btn,
.mission-toggle,
.quick-action,
.phrase-action,
.lock-toggle {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-color: rgba(25, 34, 43, 0.12);
}

.toggle-btn.is-active,
.mission-card.is-done .mission-toggle {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.layout-grid,
.control-grid,
.delay-grid,
.location-grid,
.drive-grid,
.tracker-grid,
.food-grid,
.share-grid,
.start-grid,
.phrase-grid,
.timeline-grid,
.hero-grid,
.status-grid,
.summary-grid,
.mission-grid,
.lock-grid,
.nearby-list,
.phrase-choice-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hero-grid,
.start-grid,
.delay-grid,
.location-grid,
.drive-grid,
.tracker-grid,
.food-grid,
.share-grid,
.phrase-grid,
.timeline-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-grid {
  grid-template-columns: 0.96fr 1.15fr 1fr;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lock-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card,
.card,
.spotlight-card,
.mission-card,
.lock-card,
.phrase-choice,
.timeline-entry {
  padding: 20px;
  background: var(--surface);
  border: 1px solid rgba(25, 34, 43, 0.08);
  border-radius: 24px;
}

.summary-card strong,
.stat-value,
.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.3;
}

.summary-card .label,
.section-label,
.stat-label,
.timeline-time {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label + .toggle-group,
.section-label + .button-row {
  margin-top: 10px;
}

.title-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
}

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

.status-box,
.metric-card,
.hero-status-card,
.quick-stat {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(25, 34, 43, 0.08);
}

.status-box strong,
.metric-card strong,
.hero-status-card strong,
.quick-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.metric-row.is-five {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.notice,
.field-note,
.share-link-box,
.text-input-wrap,
.timeline-form,
.phrase-display {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(233, 184, 93, 0.12);
  border: 1px solid rgba(233, 184, 93, 0.24);
}

.field-note.is-cool,
.share-link-box,
.text-input-wrap,
.timeline-form,
.phrase-display {
  background: rgba(220, 235, 236, 0.4);
  border-color: rgba(45, 109, 99, 0.18);
}

.progress-track {
  margin-top: 18px;
  height: 12px;
  border-radius: 999px;
  background: rgba(25, 34, 43, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--salmon), var(--gold), var(--forest));
  transition: width 0.24s ease;
}

.expense-rows,
.timeline-list,
.link-stack,
.drive-links,
.phrase-choice-list,
.nearby-list,
.log-type-row {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.expense-row,
.nearby-item,
.drive-link,
.link-card,
.phrase-choice,
.timeline-entry {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(25, 34, 43, 0.08);
  text-decoration: none;
  color: var(--ink);
}

.expense-row {
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
}

.expense-row label {
  font-weight: 600;
}

.expense-row span,
.nearby-meta,
.drive-link small,
.link-card small,
.phrase-choice small,
.timeline-meta,
.log-type-row small {
  color: var(--muted);
}

.expense-row input,
.share-link-input,
.timeline-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(25, 34, 43, 0.12);
  background: #fff;
}

.expense-row input,
.share-link-input {
  text-align: right;
}

.share-link-input {
  text-align: left;
}

.timeline-textarea {
  min-height: 92px;
  resize: vertical;
}

.qr-frame {
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 18px auto 0;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(25, 34, 43, 0.08);
  overflow: hidden;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.big-japanese {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.pronunciation {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.lock-card.is-skip {
  border-color: rgba(185, 74, 88, 0.22);
  background: linear-gradient(180deg, rgba(255, 244, 245, 0.94), rgba(255, 255, 255, 0.9));
}

.lock-card.is-shorten {
  border-color: rgba(233, 184, 93, 0.28);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.94), rgba(255, 255, 255, 0.9));
}

.lock-card.is-keep {
  border-color: rgba(45, 109, 99, 0.22);
}

.lock-title-row,
.nearby-top,
.timeline-top,
.phrase-choice-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.lock-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mission-card {
  position: relative;
  display: grid;
  gap: 12px;
}

.mission-card.is-done {
  background: linear-gradient(180deg, rgba(236, 249, 245, 0.92), rgba(255, 255, 255, 0.88));
  border-color: rgba(45, 109, 99, 0.26);
}

.mission-card.is-done::after {
  content: "COMPLETE";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--forest);
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-status-card .button-row,
.hero-status-card .mini-chip-row {
  margin-top: 14px;
}

.quick-chip-row {
  margin-top: 10px;
}

.quick-chip {
  text-transform: none;
  letter-spacing: 0;
}

.timeline-entry {
  position: relative;
  padding-left: 18px;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: -14px;
  width: 2px;
  background: rgba(25, 34, 43, 0.12);
}

.timeline-entry:last-child::before {
  display: none;
}

.timeline-empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(25, 34, 43, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-grid,
  .hero-grid,
  .start-grid,
  .delay-grid,
  .location-grid,
  .drive-grid,
  .tracker-grid,
  .food-grid,
  .share-grid,
  .phrase-grid,
  .timeline-grid,
  .mission-grid,
  .lock-grid,
  .status-grid,
  .metric-row.is-five {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1260px);
  }

  .hero,
  .panel {
    padding: 22px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .expense-row {
    grid-template-columns: 1fr;
  }

  .cta,
  .toggle-btn,
  .mission-toggle,
  .lock-toggle,
  .phrase-action,
  .quick-action {
    width: 100%;
  }

  .button-row,
  .lock-toggle-row {
    flex-direction: column;
    align-items: stretch;
  }
}
