/* ============================================
   솔탈 — Toss-inspired Mobile-First Design
   ============================================ */

:root {
  color-scheme: light;
  /* ── Light palette (Toss) ── */
  --bg: #F4F5F7;
  --bg-strong: #ECEEF0;
  --paper: #FFFFFF;
  --paper-strong: #F9FAFB;
  --paper-soft: rgba(255, 255, 255, 0.92);
  --ink: #4E5968;
  --ink-strong: #191F28;
  --ink-soft: #8B95A1;
  --line: #F2F4F6;
  --line-strong: #E5E8EB;
  --accent: #3182F6;
  --accent-strong: #1B64DA;
  --accent-soft: rgba(49, 130, 246, 0.08);
  --green: #34C759;
  --green-strong: #248A3D;
  --green-soft: rgba(52, 199, 89, 0.08);
  --yellow: #FFCC00;
  --yellow-soft: rgba(255, 204, 0, 0.08);
  --danger: #F04452;
  --danger-soft: rgba(240, 68, 82, 0.08);
  /* ── Solid-fill text (always contrast with solid bg) ── */
  --on-solid: #FFFFFF;       /* text on --ink-strong bg */
  --on-accent: #FFFFFF;      /* text on --accent bg */
}

/* ── Dark theme via class ── */
:root.dark {
  color-scheme: dark;
  --bg: #0A0A0A;
  --bg-strong: #141414;
  --paper: #1C1C1E;
  --paper-strong: #252528;
  --paper-soft: rgba(28, 28, 30, 0.92);
  --ink: #E4E6EA;
  --ink-strong: #F5F6F8;
  --ink-soft: #6B7684;
  --line: #252528;
  --line-strong: #333338;
  --accent: #3182F6;
  --accent-strong: #4C94F7;
  --accent-soft: rgba(49, 130, 246, 0.12);
  --green: #30D158;
  --green-strong: #32D74B;
  --green-soft: rgba(48, 209, 88, 0.12);
  --yellow: #FFD60A;
  --yellow-soft: rgba(255, 214, 10, 0.12);
  --danger: #FF453A;
  --danger-soft: rgba(255, 69, 58, 0.12);
  /* ── Dark: solid-fill text flips ── */
  --on-solid: #191F28;       /* dark text on light --ink-strong bg */
  --on-accent: #FFFFFF;      /* still white on blue */
}

/* ── Dark via system preference ── */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --bg: #0A0A0A;
    --bg-strong: #141414;
    --paper: #1C1C1E;
    --paper-strong: #252528;
    --paper-soft: rgba(28, 28, 30, 0.92);
    --ink: #E4E6EA;
    --ink-strong: #F5F6F8;
    --ink-soft: #6B7684;
    --line: #252528;
    --line-strong: #333338;
    --accent: #3182F6;
    --accent-strong: #4C94F7;
    --accent-soft: rgba(49, 130, 246, 0.12);
    --green: #30D158;
    --green-strong: #32D74B;
    --green-soft: rgba(48, 209, 88, 0.12);
    --on-solid: #191F28;
    --on-accent: #FFFFFF;
  }
}

/* ── Design tokens ── */
:root {
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

:root.dark {
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.02em;
  font-size: 15px;
  line-height: 1.5;
}

body::before,
body::after {
  content: none;
}

img {
  display: block;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ============================================
   Shell — mobile container
   ============================================ */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  isolation: isolate;
}

@media (min-width: 481px) {
  .app-shell {
    box-shadow: var(--shadow-lg);
  }
}

.app-noise {
  display: none;
}

.app-root {
  position: relative;
  width: 100%;
  min-height: 100dvh;
}

.phone-frame::before {
  content: none;
}

/* ============================================
   Layout primitives
   ============================================ */
.screen,
.stack,
.field,
.field-grid,
.hero-actions,
.field-actions,
.sheet-actions,
.overview-grid,
.pressure-grid,
.mission-grid,
.top-actions,
.auth-form,
.onboarding-form,
.profile-form {
  display: grid;
}

.screen {
  position: relative;
  gap: 28px;
  padding: 20px 20px 100px;
}

.stack {
  gap: 12px;
}

.field {
  gap: 8px;
}

.field-grid {
  gap: 20px;
}

.hero-actions,
.field-actions,
.sheet-actions {
  gap: 12px;
}

.overview-grid {
  gap: 12px;
  grid-template-columns: 1fr;
}

.pressure-grid {
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.auth-form,
.onboarding-form,
.profile-form {
  gap: 24px;
}

/* ============================================
   Top actions bar
   ============================================ */
.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.top-actions-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============================================
   Theme toggle
   ============================================ */
.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

:root.dark .theme-toggle .sun-icon {
  display: none;
}

:root.dark .theme-toggle .moon-icon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .theme-toggle .sun-icon {
    display: none;
  }

  :root:not(.light) .theme-toggle .moon-icon {
    display: block;
  }
}

/* ============================================
   Flex wrappers
   ============================================ */
.mission-tags,
.brand-row,
.mission-cta,
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================
   Panels & Cards — Toss flat card style
   ============================================ */
.panel,
.mission-card,
.auth-card,
.onboarding-card,
.profile-card,
.sheet__panel,
.tabbar,
.stat-pill,
.chip-group {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
}

.panel,
.auth-card,
.onboarding-card,
.profile-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

/* Hero panel — transparent, no chrome */
.hero-panel {
  position: relative;
  overflow: visible;
  border: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 0;
}

.hero-panel::before,
.hero-panel::after {
  content: none;
}

/* ============================================
   Mission card
   ============================================ */
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mission-card {
  display: grid;
  gap: 14px;
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--paper);
  box-shadow: none;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: cardSlideUp 0.35s ease backwards;
  min-width: 0;
  overflow: hidden;
}

.mission-card:nth-child(1) { animation-delay: 0.03s; }
.mission-card:nth-child(2) { animation-delay: 0.06s; }
.mission-card:nth-child(3) { animation-delay: 0.09s; }
.mission-card:nth-child(4) { animation-delay: 0.12s; }
.mission-card:nth-child(5) { animation-delay: 0.15s; }
.mission-card:nth-child(n+6) { animation-delay: 0.18s; }

@media (hover: hover) {
  .mission-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.mission-card:active {
  transform: scale(0.985);
}

/* ============================================
   Stat pills & chip groups
   ============================================ */
.stat-pill,
.chip-group {
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: none;
}

/* ============================================
   Screen / section headers
   ============================================ */
.screen-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.mission-screen-header {
  gap: 8px;
}

.brand-row {
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FF6B57cc, #F5C85Ec2);
  padding: 10px;
  box-shadow: 0 4px 14px rgba(255, 107, 87, 0.18);
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================
   Eyebrow badge
   ============================================ */
.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--on-solid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-panel .eyebrow {
  background: var(--ink-strong);
  color: var(--on-solid);
}

/* ============================================
   Typography — tight, confident, Toss-like
   ============================================ */
.hero-title,
.screen-title,
.section-title,
.card-title,
.sheet-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-strong);
  font-family: inherit;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.screen-title,
.hero-title {
  font-size: clamp(1.6rem, 5.5vw, 2rem);
}

.section-title,
.card-title {
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* ── Text overflow prevention for 2-col grid ── */
.mission-card .card-title,
.mission-card .card-copy,
.mission-card .muted {
  overflow-wrap: break-word;
  word-break: keep-all;
  min-width: 0;
}

.mission-card .card-title {
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
}

.mission-card .card-copy {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sheet-title {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-value,
.mission-order {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-strong);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-value {
  font-size: clamp(1.25rem, 4vw, 1.65rem);
}

.mission-order {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--line);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Body & muted text */
.hero-copy,
.muted,
.card-copy,
.field-help,
.sheet-copy,
.footnote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-copy strong,
.card-copy strong,
.sheet-copy strong {
  color: var(--ink-strong);
}

.tiny {
  font-size: 0.8rem;
}

.accent {
  color: var(--green);
}

.hot {
  color: var(--accent);
}

/* ============================================
   Field-grid patterns
   ============================================ */
/* Field grid double — always stack vertically in mobile shell */
.field-grid--double {
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ============================================
   Labels
   ============================================ */
.stat-label,
.field-label,
.chip-group__label {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

/* ============================================
   Buttons — Toss clean buttons
   ============================================ */
.button,
.button-ghost,
.button-hot,
.button-muted,
.tab-button {
  appearance: none;
  position: relative;
  z-index: 1;
  min-height: 52px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.button {
  color: var(--on-solid);
  background: var(--ink-strong);
  box-shadow: none;
}

@media (hover: hover) {
  .button:hover,
  .button-hot:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
}

.button:active {
  transform: scale(0.97);
}

.button-hot {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: none;
}

.button-hot:active {
  transform: scale(0.97);
  background: var(--accent-strong);
}

.button-ghost,
.button-muted,
.tab-button {
  color: var(--ink);
  background: var(--bg-strong);
}

.button-ghost:active,
.button-muted:active,
.tab-button:active {
  transform: scale(0.97);
  background: var(--line-strong);
}

.button-muted {
  color: var(--ink-soft);
}

.button-ghost.tiny,
.button-muted.tiny {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ============================================
   Status banner
   ============================================ */
.status-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--paper);
  box-shadow: none;
}

.status-banner[data-tone="success"] {
  background: var(--green-soft);
}

.status-banner[data-tone="error"] {
  background: var(--danger-soft);
}

.status-banner[data-tone="info"] {
  background: var(--paper-strong);
}

.warning-copy {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ============================================
   Form fields — generous spacing
   ============================================ */
.field {
  position: relative;
  z-index: 1;
  gap: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-strong);
  color: var(--ink-strong);
  box-shadow: none;
  outline: none;
  font-size: 1rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

.year-input-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}

/* ============================================
   Mission head / order / status
   ============================================ */
.mission-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mission-status,
.tag,
.chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mission-status {
  border: none;
  background: var(--line);
  color: var(--ink);
}

.mission-status[data-status="completed"] {
  background: var(--green-soft);
  color: var(--green-strong);
}

.mission-status[data-status="in_progress"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag {
  border: none;
  background: var(--line);
  color: var(--ink);
}

.tag-accent {
  background: var(--green-soft);
  color: var(--green-strong);
}

.tag-hot {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chip {
  border: none;
  background: var(--bg-strong);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.chip.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chip-grid {
  gap: 6px;
}

.mission-cta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ============================================
   Pressure cards
   ============================================ */
.pressure-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
}

.pressure-card__lead,
.profile-overview__value {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-strong);
}

.pressure-card__lead {
  font-size: 0.88rem;
  line-height: 1.55;
}

.pressure-card__icon {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  justify-self: start;
  border: none;
  background: linear-gradient(180deg, var(--paper), var(--bg-strong));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(17, 24, 39, 0.04);
}

.pressure-card__icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), transparent 58%),
    linear-gradient(145deg, var(--pressure-icon-wash, rgba(49, 130, 246, 0.18)), rgba(255, 255, 255, 0.08));
}

.pressure-card__icon::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--pressure-icon-dot, rgba(49, 130, 246, 0.28));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.42);
}

.pressure-card__emoji {
  position: relative;
  z-index: 1;
  font-family: "Tossface", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-variant-emoji: emoji;
  transform: translateY(1px);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4));
}

.pressure-card__icon--age {
  color: #D88A1C;
  --pressure-icon-wash: rgba(232, 164, 55, 0.22);
  --pressure-icon-dot: rgba(232, 164, 55, 0.36);
}

.pressure-card__icon--marriage-clock {
  color: #EE6A5A;
  --pressure-icon-wash: rgba(238, 106, 90, 0.18);
  --pressure-icon-dot: rgba(238, 106, 90, 0.3);
}

.pressure-card__icon--parents-now {
  color: #4A7FB7;
  --pressure-icon-wash: rgba(74, 127, 183, 0.18);
  --pressure-icon-dot: rgba(74, 127, 183, 0.3);
}

.pressure-card__icon--child-adult {
  color: #E1972B;
  --pressure-icon-wash: rgba(225, 151, 43, 0.2);
  --pressure-icon-dot: rgba(225, 151, 43, 0.3);
}

.pressure-card__icon--elementary-school {
  color: var(--green);
  --pressure-icon-wash: rgba(52, 199, 89, 0.16);
  --pressure-icon-dot: rgba(52, 199, 89, 0.28);
}

.pressure-card__icon--ninety-day {
  color: var(--ink);
  --pressure-icon-wash: rgba(78, 89, 104, 0.14);
  --pressure-icon-dot: rgba(78, 89, 104, 0.24);
}

.pressure-card__icon--parents-now .pressure-card__emoji,
.pressure-card__icon--ninety-day .pressure-card__emoji {
  font-size: 25px;
}

.pressure-card__value {
  margin-top: 0;
}

.pressure-card__meta {
  color: var(--ink-soft);
}

/* ============================================
   Profile overview
   ============================================ */
.profile-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-overview__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 14px;
  border: none;
  background: var(--paper);
  box-shadow: none;
}

.profile-overview__value {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================
   Bottom sheet
   ============================================ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 20px calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left));
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet__panel {
  width: min(100%, 460px);
  max-height: 88dvh;
  overflow: auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 40px;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: var(--line-strong);
}

.sheet-head {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.sheet__panel .panel {
  padding: 16px;
  box-shadow: none;
}

/* ============================================
   Tab bar — Toss-style bottom nav
   ============================================ */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 440px);
  padding: 6px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  z-index: 15;
  gap: 4px;
  background: var(--paper-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.tab-button {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  min-height: 44px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.tab-button.is-active {
  background: var(--ink-strong);
  color: var(--on-solid);
  box-shadow: none;
}

/* ============================================
   Status card & code inline
   ============================================ */
.status-card {
  gap: 8px;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 6px;
  background: var(--bg-strong);
  color: var(--ink-strong);
  font-size: 0.85em;
}

/* ============================================
   Fade-in animation
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Hover polish — desktop only
   ============================================ */
@media (hover: hover) {
  .button:hover,
  .button-hot:hover,
  .button-ghost:hover,
  .button-muted:hover,
  .tab-button:hover,
  .chip:hover {
    transform: translateY(-1px);
  }

  .mission-card:hover,
  .stat-pill:hover,
  .profile-overview__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* ============================================
   Responsive breakpoints
   ============================================ */
/* Mission grid is always 1-column inside the 480px app shell */

@media (max-width: 520px) {
  .field-grid--double,
  .year-input-row {
    grid-template-columns: 1fr;
  }

  .screen-title,
  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .field-actions > *,
  .sheet-actions > * {
    width: 100%;
  }

  .tabbar {
    width: min(calc(100% - 16px), 440px);
  }

  .profile-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .pressure-grid,
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .mission-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .mission-card {
    padding: 20px;
    gap: 16px;
  }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Accordion — clean toggle
   ============================================ */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

.accordion-box {
  background: var(--paper);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: none;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-strong);
  transition: background-color 0.15s ease;
}

.accordion-summary:active {
  background: var(--bg-strong);
}

.accordion-box[open] .accordion-summary {
  border-bottom: 1px solid var(--line);
}

.accordion-icon {
  transition: transform 0.2s ease;
  color: var(--ink-soft);
  font-size: 1rem;
}

.accordion-box[open] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0;
  animation: slideDown 0.2s ease;
}

.accordion-content .mission-grid {
  padding: 16px;
  gap: 12px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Dark tabbar
   ============================================ */
:root.dark .tabbar {
  background: rgba(28, 28, 30, 0.88);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .tabbar {
    background: rgba(28, 28, 30, 0.88);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  }
}

/* ============================================
   Progress bar (onboarding) — inline
   ============================================ */
.progress-bar-container {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}
