:root {
  --bg: #DCD8CE;
  --surface: #EAE6DC;
  --surface-alt: #D4CFC4;
  --text: #1A1A20;
  --text-muted: #5A5A66;
  --border: rgba(26, 26, 32, 0.14);
  --primary: #FF5E1A;
  --primary-dark: #D9480F;
  --primary-soft: rgba(255, 199, 0, 0.22);
  --accent: #FF5E1A;
  --accent-soft: rgba(255, 94, 26, 0.13);
  --kakao: #fee500;
  --kakao-text: #191919;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #B86E00;
  --warning-soft: rgba(255, 199, 0, 0.2);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 6px 20px rgba(24, 22, 16, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 85% 360px at 50% 0%, rgba(255, 199, 0, 0.1), transparent 70%),
    radial-gradient(rgba(26, 26, 32, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
  background-repeat: no-repeat, repeat;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: 48px;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.brand-link {
  text-decoration: none;
}

.brand-badge {
  background: var(--text);
  color: #fff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: -0.02em;
}

.brand-divider {
  color: var(--border);
}

.brand-tool {
  color: var(--primary);
  font-weight: 800;
}

.text-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.text-btn:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* Main */
.main-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-intro {
  text-align: center;
  padding: 4px 0 2px;
}

.hero-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Next Holiday Top Banner */
.holiday-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.holiday-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.holiday-top-tag {
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 90, 54, 0.2);
  color: #ff8a70;
  padding: 2px 7px;
  border-radius: 6px;
}

.holiday-top-name {
  font-size: 14px;
  font-weight: 800;
}

.holiday-top-date {
  font-size: 12px;
  color: #94a3b8;
}

.holiday-top-dday {
  font-size: 18px;
  font-weight: 900;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

/* 3-in-1 Tabs */
.tab-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.card-desc {
  margin: -4px 0 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.count-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.basis-toggle {
  display: inline-flex;
  background: var(--bg);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
}

.basis-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.basis-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.opt-tag {
  font-weight: 500;
  color: var(--text-muted);
}

.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  outline: none;
}

.field-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

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

.mini-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.mini-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.stepper-row .field-input {
  flex: 1;
}

.step-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  border-radius: 10px;
  cursor: pointer;
}

.step-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-primary {
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-primary .kpi-num {
  color: var(--primary);
}

.gauge-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gauge-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 9px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.progress-fill.is-warn {
  background: var(--warning);
}

.progress-fill.is-danger {
  background: var(--danger);
}

.sub-info-list {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.sub-info-row strong {
  color: var(--text);
}

/* Receipt Card */
.receipt-card {
  filter: drop-shadow(0 8px 20px rgba(15, 23, 42, 0.08));
}

.receipt-teeth-top,
.receipt-teeth-bottom {
  height: 10px;
  width: 100%;
  background-size: 16px 10px;
  background-repeat: repeat-x;
}

.receipt-teeth-top {
  background-image: linear-gradient(135deg, transparent 50%, #ffffff 50%),
    linear-gradient(225deg, transparent 50%, #ffffff 50%);
}

.receipt-teeth-bottom {
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(315deg, transparent 50%, #ffffff 50%);
}

.receipt-body {
  background: #ffffff;
  padding: 18px 20px;
}

.receipt-head {
  text-align: center;
}

.receipt-brand {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.receipt-title {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 900;
}

.receipt-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.receipt-divider {
  border-top: 1.5px dashed #cbd5e1;
  margin: 14px 0;
}

.receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.r-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.r-row span {
  color: var(--text-muted);
  font-weight: 600;
}

.r-row strong {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.r-highlight {
  color: var(--primary);
  font-size: 15px;
}

.diagnosis-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.diag-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.diag-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.receipt-barcode {
  margin-top: 14px;
  text-align: center;
}

.barcode-bars {
  height: 26px;
  margin: 0 auto 5px;
  max-width: 220px;
  background: repeating-linear-gradient(
    90deg,
    #111827 0 2px,
    transparent 2px 4px,
    #111827 4px 7px,
    transparent 7px 9px,
    #111827 9px 10px,
    transparent 10px 14px
  );
  opacity: 0.85;
}

.barcode-caption {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Share Buttons */
.share-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.kakao-btn {
  background: var(--kakao);
  color: var(--kakao-text);
}

.link-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Holiday Tab */
.holiday-hero-card {
  text-align: center;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.holiday-hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.holiday-hero-dday {
  margin-top: 8px;
  font-size: 38px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.holiday-hero-name {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 900;
}

.holiday-hero-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.holiday-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.holiday-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.holiday-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.holiday-item-title {
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.holiday-item-date {
  font-size: 12px;
  color: var(--text-muted);
}

.golden-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 6px;
}

.holiday-dday-pill {
  font-size: 13px;
  font-weight: 900;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Age Tab */
.age-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.age-pill-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.age-pill-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.age-pill-val {
  font-size: 14px;
  font-weight: 800;
}

/* AdSense Slot */
.ad-slot {
  position: relative;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 4px;
}

.ad-placeholder-text {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

/* Cross Promotion */
.cross-promo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.cross-promo-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}

.promo-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.promo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.promo-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.promo-featured {
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.promo-emoji {
  font-size: 24px;
  line-height: 1;
}

.promo-info {
  flex: 1;
}

.promo-name {
  font-size: 14px;
  font-weight: 800;
}

.promo-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.promo-arrow {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

/* FAQ Accordion */
.faq-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.faq-heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}

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

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  overflow: hidden;
}

.faq-q {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "▾";
  font-size: 12px;
  color: var(--text-muted);
}

.faq-item[open] .faq-q::after {
  content: "▴";
}

.faq-a {
  padding: 0 14px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.tool-footer {
  margin-top: 24px;
  padding: 0 16px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
