:root {
  --accent: #c51236;
  --accent-dark: #970d29;
  --ink: #242428;
  --muted: #73737d;
  --line: #ececef;
  --paper: #ffffff;
  --soft: #f7f5f3;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 13px max(18px, env(safe-area-inset-left));
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.site-home-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(255,255,255,.15);
}

.site-home-link:hover,
.site-home-link:focus { color: inherit; text-decoration: none; }
.site-home-link:focus-visible {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 4px;
  border-radius: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255,255,255,.16);
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
}

.site-header h1 { margin: 0; font-size: 21px; }
.site-header p { margin: 2px 0 0; font-size: 12px; opacity: .82; }

.page-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 14px calc(32px + env(safe-area-inset-bottom));
}

.hero-card,
.form-card,
.result-card {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(30,20,20,.05);
}

.hero-card { margin-bottom: 24px; }
.hero-card h2 { margin: 6px 0 7px; font-size: 23px; letter-spacing: -.04em; }
.hero-card p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 11px;
}

.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.menu-grid { display: grid; gap: 10px; }

.fortune-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.fortune-card:active { transform: scale(.99); }
.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  height: 50px;
  border-radius: 15px;
  color: #fff;
  background: var(--accent);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.card-copy strong { font-size: 16px; }
.card-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.arrow { color: #aaa; font-size: 28px; }
.notice { margin: 22px 4px 0; color: var(--muted); font-size: 12px; text-align: center; }

.page-title { margin: 2px 0 15px; font-size: 24px; letter-spacing: -.04em; }
.back-link { display: inline-flex; margin-bottom: 10px; color: var(--accent); font-size: 14px; font-weight: 700; }
.person-block + .person-block { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.person-block h2 { margin: 0 0 14px; font-size: 17px; }
.field { margin-top: 15px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.radio-row { display: flex; gap: 18px; min-height: 44px; align-items: center; }
.radio-row label { display: inline-flex; gap: 7px; align-items: center; }
.select-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 7px; }
.time-row { grid-template-columns: 1fr 1fr 1.35fr; }

select,
button {
  min-height: 46px;
  border-radius: 11px;
  font: inherit;
}

select {
  width: 100%;
  padding: 0 9px;
  border: 1px solid #d9d9df;
  color: var(--ink);
  background: #fff;
}

.submit-button {
  width: 100%;
  margin-top: 24px;
  border: 0;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.submit-button:active { background: var(--accent-dark); }
.result-card { font-size: 15px; line-height: 1.8; white-space: normal; }
.error-card { color: #8d1730; background: #fff7f8; }
.single-select { grid-template-columns: minmax(0, 220px); }
.fortune-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.fortune-section h2 { margin: 0 0 7px; color: var(--accent); font-size: 17px; }
.fortune-section p { margin: 0; }

.menu-ad-row { grid-column: 1 / -1; }
.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 112px;
  margin: 24px 0;
  padding: 20px;
  overflow: hidden;
  border-radius: 16px;
  text-align: center;
}
.ad-slot-placeholder {
  display: none;
  border: 1px dashed #c9c9cf;
  color: #7b7b84;
  background: repeating-linear-gradient(-45deg,#fafafa,#fafafa 8px,#f6f6f6 8px,#f6f6f6 16px);
}
.ad-slot strong { display: block; font-size: 14px; }
.ad-slot small { display: block; margin-top: 4px; font-size: 11px; }
.ad-label {
  position: absolute;
  top: 7px;
  left: 9px;
  color: #92929a;
  font-size: 10px;
  letter-spacing: .08em;
}
.ad-slot-live { min-height: 100px; padding: 18px 0; background: #fff; }
.ad-slot + .submit-button { margin-top: 16px; }

.legacy-content { overflow: hidden; }

.site-footer {
  margin: 28px 0 8px;
  padding: 20px 12px 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.site-footer a { color: #555; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 12px 0 0; }

.legal-card { line-height: 1.75; }
.legal-card h2 { margin: 25px 0 8px; font-size: 18px; }
.legal-card h2:first-child { margin-top: 0; }
.legal-card p, .legal-card li { color: #3f3f46; }
.legal-card ul, .legal-card ol { padding-left: 22px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.legal-table th, .legal-table td { padding: 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { width: 28%; background: #faf7f7; }
.legal-email { color: var(--accent); font-weight: 700; word-break: break-all; }
.ad-size-table th:first-child { width: 22%; }
.ad-size-table th:nth-child(2) { width: 24%; }
.agency-copy {
  padding: 15px;
  border: 1px solid #ead9dd;
  border-radius: 12px;
  background: #fff8fa;
  line-height: 1.75;
}
code { padding: 2px 5px; border-radius: 5px; background: #f1f1f3; font-size: .92em; }

@media (max-width: 520px) {
  .ad-size-table, .ad-size-table thead, .ad-size-table tbody,
  .ad-size-table tr, .ad-size-table th, .ad-size-table td { display: block; width: 100%; }
  .ad-size-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ad-size-table tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .ad-size-table td { border: 0; border-bottom: 1px solid var(--line); }
  .ad-size-table td:last-child { border-bottom: 0; }
  .ad-size-table td:first-child { color: var(--accent); background: #faf7f7; font-weight: 800; }
}

.home-guide { margin-top: 24px; }
.home-guide h2 { margin: 8px 0 12px; font-size: 21px; }
.home-guide p { margin: 9px 0; color: #4b4b54; line-height: 1.75; }
.guide-more { display: inline-flex; margin-top: 8px; color: var(--accent); font-weight: 800; text-decoration: none; }
.guide-grid { display: grid; gap: 12px; }
.guide-card { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #fff; text-decoration: none; }
.guide-card:hover, .guide-card:focus { border-color: var(--accent); box-shadow: 0 8px 24px rgba(160,0,40,.09); }
.guide-card strong { display: block; margin-bottom: 7px; font-size: 17px; }
.guide-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.55; }
.guide-article h2 { margin: 28px 0 9px; color: var(--accent); font-size: 19px; }
.guide-article h2:first-child { margin-top: 0; }
.guide-article p { margin: 8px 0; color: #3f3f46; line-height: 1.85; }
.related-guides { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.related-guides a { color: var(--accent); font-weight: 700; }

@media (min-width: 620px) {
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.legacy-content table { width: 100% !important; max-width: 100% !important; }
.legacy-content td { height: auto; padding: 6px 3px; font-family: inherit; font-size: 14px; line-height: 1.55; }
.legacy-content img { max-width: 100%; height: auto; }
.legacy-content form { width: 100%; }
.legacy-content select,
.legacy-content input[type="text"] { max-width: 100%; min-height: 42px; margin: 3px 1px; }
.legacy-content input[type="button"],
.legacy-content input[type="submit"] { min-height: 44px; margin: 4px 1px; padding: 0 12px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); font-weight: 700; }
.legacy-content br + br { line-height: .6; }

.mbti-intro { margin-bottom: 16px; }
.mbti-intro strong { display: block; margin-bottom: 6px; font-size: 17px; }
.mbti-question { margin: 0 0 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mbti-question legend { width: 100%; padding: 0 0 10px; font-size: 16px; font-weight: 800; }
.mbti-question legend span { display: inline-grid; place-items: center; width: 29px; height: 29px; margin-right: 8px; border-radius: 9px; color: #fff; background: var(--accent); font-size: 13px; }
.mbti-question label { display: flex; align-items: center; gap: 9px; min-height: 48px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.mbti-question label:has(input:checked) { border-color: var(--accent); background: #fff6f8; }
.mbti-question input { flex: 0 0 auto; accent-color: var(--accent); }
.mbti-result { text-align: center; }
.mbti-type { margin: 10px 0 0; color: var(--accent); font-size: clamp(44px,14vw,72px); font-weight: 900; letter-spacing: .08em; line-height: 1.1; }
.mbti-result h1 { margin: 5px 0 14px; font-size: 25px; }
.mbti-summary { margin: 0 auto 22px; max-width: 520px; color: #44444c; }
.mbti-bars { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mbti-bar + .mbti-bar { margin-top: 15px; }
.mbti-bar div { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.mbti-bar div span { color: var(--muted); }
.mbti-bar i { display: block; height: 9px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #dedee3; }
.mbti-bar em { display: block; height: 100%; background: var(--accent); }
.mbti-detail { text-align: left; }
.mbti-detail h2 { margin: 22px 0 6px; color: var(--accent); font-size: 17px; }
.mbti-detail p { margin: 7px 0; }
.mbti-feature-list { margin: 8px 0 4px; padding-left: 21px; }
.mbti-feature-list li { margin: 7px 0; }
.mbti-axis-detail { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.mbti-axis-detail h3 { margin: 0 0 6px; font-size: 15px; }
.mbti-axis-detail p { margin: 0; }
.mbti-note { margin-top: 24px; padding: 16px; border-radius: 12px; background: #fff6f8; }
.mbti-note strong { color: var(--accent); }
.mbti-retry { display: grid; place-items: center; margin-top: 16px; }

@media (min-width: 620px) {
  .page-shell { padding-top: 28px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-card, .form-card, .result-card { padding: 28px; }
}
