/* ──────────────────────────────────────────────────────────
   맘초헬스 트래커 — App styles
   (tokens.css 154–179 베이스 + 컴포넌트)
   ────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

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

a { text-decoration: none; color: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

.mh-body {
  font-family: var(--mh-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  background: var(--mh-bg);
  color: var(--mh-fg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.mh-screen {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--mh-bg);
  color: var(--mh-fg);
  font-feature-settings: 'ss03', 'tnum';
  position: relative;
}

.mh-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ── Landing ──────────────────────────────────────────── */

.mh-landing {
  display: flex;
  flex-direction: column;
  padding: 64px 22px 44px;
  overflow-y: auto;
}

.mh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.mh-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--mh-fg);
  letter-spacing: -0.01em;
}

.mh-hero { margin-bottom: 28px; }
.mh-hero-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--mh-fg);
  text-wrap: balance;
}
.mh-hero-sub {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--mh-fg-2);
}

.mh-error-banner {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--mh-r-md);
  background: var(--mh-warn-soft);
  border: 1px solid var(--mh-line);
  font-size: 13px;
  color: var(--mh-warn);
}

.mh-form { margin-bottom: 22px; }
.mh-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mh-fg-3);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.mh-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mh-surface);
  border: 1.5px solid var(--mh-line-strong);
  border-radius: var(--mh-r-md);
  padding: 13px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mh-input-wrap:focus-within,
.mh-input-wrap.has-value {
  border-color: var(--mh-accent);
  box-shadow: 0 0 0 4px var(--mh-accent-soft);
}
.mh-input-wrap input,
.mh-input-wrap textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--mh-fg);
}
.mh-input-wrap input::placeholder,
.mh-input-wrap textarea::placeholder { color: var(--mh-fg-4); }
.mh-input-wrap textarea {
  resize: none;
  min-height: 72px;
  line-height: 1.5;
  font-family: inherit;
}

.mh-submit-btn {
  margin-top: 10px;
  width: 100%;
  height: 52px;
  background: var(--mh-bg-sub);
  color: var(--mh-fg-3);
  border-radius: var(--mh-r-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: default;
  transition: background 0.15s;
}
.mh-submit-btn.active {
  background: var(--mh-accent);
  color: #fff;
  cursor: pointer;
}

.mh-form-hint {
  margin: 12px 2px 0;
  font-size: 12px;
  color: var(--mh-fg-3);
  line-height: 1.55;
}

.mh-divider {
  height: 1px;
  border: 0;
  background: var(--mh-line);
  margin: 4px -22px;
}

.mh-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.mh-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mh-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--mh-accent-soft);
  color: var(--mh-accent-ink);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mh-step-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mh-fg);
  margin-bottom: 2px;
  padding-top: 1px;
}
.mh-step-body {
  font-size: 12px;
  color: var(--mh-fg-3);
  line-height: 1.5;
}

.mh-security-note {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--mh-bg-sub);
  border-radius: var(--mh-r-md);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--mh-line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--mh-fg-2);
}

/* ── Timeline ─────────────────────────────────────────── */

.mh-timeline {
  display: flex;
  flex-direction: column;
}

.mh-tl-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--mh-bg);
  padding-top: 56px;
  border-bottom: 1px solid var(--mh-line);
}

.mh-tl-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 12px;
}
.mh-tl-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mh-tl-brand-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mh-fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mh-tl-people {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 8px;
  font-size: 13px;
}
.mh-tl-mother {
  color: var(--mh-fg-1);
  font-weight: 600;
}
.mh-tl-baby {
  color: var(--mh-accent);
  font-weight: 600;
}
.mh-tl-sep {
  color: var(--mh-fg-3);
}

.mh-refresh-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mh-fg-2);
  background: var(--mh-surface);
  border: 1px solid var(--mh-line);
}
.mh-refresh-btn:hover { background: var(--mh-surface-2); }

.mh-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 4px;
}

.mh-nav-arrow {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mh-surface);
  border: 1px solid var(--mh-line);
  color: var(--mh-fg-2);
  flex-shrink: 0;
}
.mh-nav-arrow:hover { background: var(--mh-surface-2); }
.mh-nav-arrow--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.mh-date-label {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.mh-date-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--mh-fg);
  letter-spacing: -0.018em;
  line-height: 1.15;
}
.mh-date-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--mh-fg-3);
  font-weight: 500;
}
.mh-today-tag { color: var(--mh-accent); font-weight: 600; }
.mh-reg-tag { color: var(--mh-sage); font-weight: 600; }

.mh-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 0 14px 10px;
}
.mh-status-dot {
  display: inline-flex;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--mh-sage);
  box-shadow: 0 0 0 3px var(--mh-sage-soft);
}
.mh-status-label {
  font-size: 11px;
  color: var(--mh-fg-3);
}

/* ── DateStrip ──────────────────────────────────────── */

.mh-datestrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 14px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mh-datestrip::-webkit-scrollbar { display: none; }

.mh-day-pill {
  flex: 0 0 52px;
  height: 64px;
  border-radius: var(--mh-r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  padding: 6px 0 8px;
  background: transparent;
  border: 1px solid var(--mh-line);
  color: var(--mh-fg);
}
.mh-day-pill--today {
  background: var(--mh-surface);
  border-color: var(--mh-line-strong);
}
.mh-day-pill--selected {
  background: var(--mh-accent);
  border-color: var(--mh-accent);
  color: #fff;
}
.mh-day-pill--selected .mh-day-wd { color: rgba(255,255,255,0.85); }
.mh-day-pill--disabled { opacity: 0.55; cursor: default; color: var(--mh-fg-4); }

.mh-day-wd {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mh-fg-3);
}
.mh-day-wd--sun { color: var(--mh-accent); }
.mh-day-pill--selected .mh-day-wd--sun { color: rgba(255,255,255,0.85); }

.mh-day-d {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mh-day-dot {
  margin-top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: transparent;
}
.mh-day-dot--active { background: var(--mh-sage); }
.mh-day-pill--selected .mh-day-dot--active { background: rgba(255,255,255,0.85); }

.mh-day-today-label {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--mh-accent);
  letter-spacing: 0.05em;
}

.mh-tl-totals-wrap {
  padding: 0 14px 14px;
}

.mh-tl-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Event card ─────────────────────────────────────── */

.mh-event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mh-event {
  display: grid;
  align-items: center;
  column-gap: 14px;
  padding: 14px 16px;
  background: var(--mh-surface);
  border-radius: var(--mh-r-md);
  box-shadow: var(--mh-shadow-1);
  border: 1px solid var(--mh-line);
  position: relative;
  overflow: hidden;
}

.mh-event-new-dot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mh-accent);
  box-shadow: 0 0 0 4px var(--mh-accent-soft);
}

.mh-event-time {
  font-size: 17px;
  font-weight: 600;
  color: var(--mh-fg);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.mh-event-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mh-event-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--mh-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mh-event-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mh-event-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--mh-fg);
  line-height: 1.1;
}
.mh-event-interval {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--mh-fg-3);
  line-height: 1.2;
  font-weight: 500;
}

.mh-event-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.mh-event-val-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--mh-fg);
  letter-spacing: -0.02em;
  line-height: 1;
}
.mh-event-val-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--mh-fg-3);
}

/* ── TotalsStrip ────────────────────────────────────── */

.mh-totals {
  background: var(--mh-surface-2);
  border-radius: var(--mh-r-md);
  padding: 14px 14px 12px;
  border: 1px solid var(--mh-line);
}
.mh-totals--compact {
  padding: 10px 12px 8px;
}
.mh-totals-header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mh-fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.mh-totals--compact .mh-totals-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding-left: 2px;
}
.mh-totals-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mh-totals--compact .mh-totals-grid { gap: 4px; }

.mh-totals-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 4px;
}
.mh-totals--compact .mh-totals-cell { gap: 2px; padding: 4px 4px; }

.mh-totals-icon { opacity: 0.85; }
.mh-totals-val { display: flex; align-items: baseline; gap: 1px; }
.mh-totals-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--mh-fg);
  letter-spacing: -0.02em;
  line-height: 1;
}
.mh-totals--compact .mh-totals-num { font-size: 15px; }
.mh-totals-num.muted, .mh-totals-unit.muted { color: var(--mh-fg-4); }
.mh-totals-unit { font-size: 9.5px; color: var(--mh-fg-3); font-weight: 500; }
.mh-totals--compact .mh-totals-unit { font-size: 9px; }
.mh-totals-lbl { font-size: 10px; color: var(--mh-fg-3); }
.mh-totals--compact .mh-totals-lbl { font-size: 9.5px; }

/* ── Empty state ────────────────────────────────────── */

.mh-empty-state {
  margin-top: 28px;
  padding: 36px 22px 32px;
  background: var(--mh-surface);
  border: 1px solid var(--mh-line);
  border-radius: var(--mh-r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--mh-shadow-1);
}
.mh-empty-graphic { margin-bottom: 0; }
.mh-empty-title {
  margin: 20px 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--mh-fg);
}
.mh-empty-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mh-fg-2);
  max-width: 240px;
}
.mh-empty-countdown {
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--mh-bg-sub);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mh-fg-2);
}
.mh-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mh-accent);
  animation: mh-pulse 1.4s ease-out infinite;
}
@keyframes mh-pulse { 0%, 100% { opacity: .4 } 50% { opacity: 1 } }

/* ── Error state ────────────────────────────────────── */

.mh-error-state {
  margin-top: 12px;
  padding: 24px 22px;
  background: var(--mh-warn-soft);
  border: 1px solid var(--mh-line);
  border-radius: var(--mh-r-lg);
}
.mh-error-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--mh-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.mh-error-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--mh-fg);
}
.mh-error-body {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mh-fg-2);
}
.mh-error-actions { display: flex; gap: 8px; }
.mh-btn-primary {
  flex: 1;
  height: 42px;
  border-radius: var(--mh-r-md);
  background: var(--mh-accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mh-error-meta {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--mh-r-sm);
  background: var(--mh-surface);
  border: 1px solid var(--mh-line);
  font-size: 11.5px;
  color: var(--mh-fg-3);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mh-error-meta svg { margin-top: 2px; }

/* ── Responsive: desktop centering ─────────────────── */

@media (min-width: 640px) {
  .mh-body {
    align-items: flex-start;
    padding-top: 24px;
  }
  .mh-screen {
    border-left: 1px solid var(--mh-line);
    border-right: 1px solid var(--mh-line);
    min-height: calc(100vh - 48px);
    border-radius: var(--mh-r-lg);
    overflow: hidden;
  }
}
