:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: #fffefa;
  --surface-soft: #f4f5ef;
  --text: #263d35;
  --muted: #68736b;
  --accent: #2d5c50;
  --accent-soft: #e7eee8;
  --line: #e4e7de;
  --warm: #ab573f;
  --error: #a5372c;
  --error-bg: #fff0eb;
  --shadow: 0 6px 28px rgb(48 60 43 / 4%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { line-height: 1.4; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 650; font-size: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 4px; }
.page-shell { width: min(100% - 32px, 544px); margin: 0 auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 5; padding: 10px 14px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 25px 0 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 15px; font-weight: 750; }
.brand-seal { display: grid; place-items: center; width: 29px; height: 29px; background: var(--accent); color: #fff; border-radius: 8px 8px 8px 2px; font-family: Georgia, "Batang", serif; font-size: 20px; }
.brand-sub { font-weight: 450; color: var(--muted); font-size: 13px; }
.header-note { color: var(--muted); font-size: 11px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 4px 0; font-size: 12px; color: var(--muted); }
.site-nav a { min-height: 32px; display: inline-flex; align-items: center; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; text-decoration-thickness: 2px; }
.hero { position: relative; padding: 37px 4px 29px; isolation: isolate; }
/* TASK-11: shared scenery; reserve sky for copy and the lower band for mountains. */
html:has(> body.arirang-paper) { scrollbar-gutter: stable; }
.arirang-page .hero.arirang-hero { padding: 40px 0 304px; margin-bottom: 48px; }
.arirang-hero-content { position: relative; z-index: 1; }
.arirang-hero-scene { position: absolute; inset: 0 auto 0 50%; transform: translateX(-50%); width: 100vw; overflow: hidden; background: var(--art-sky, var(--bg)); pointer-events: none; }
.arirang-hero-scene::after { content: ''; position: absolute; inset: 0 0 auto; height: 240px; background: linear-gradient(var(--bg), transparent); }
.arirang-hero-art { position: absolute; bottom: 0; width: 100%; height: 400px; }
.arirang-hero > .ny-year-seal { z-index: 1; }
.arirang-footer-landscape { position: relative; left: 50%; transform: translateX(-50%); width: 100vw; height: 144px; margin-top: 48px; pointer-events: none; overflow: hidden; opacity: .65; }
.arirang-footer-landscape .arirang-art { width: 100%; height: 100%; }
@media (max-width: 600px) {
  .arirang-page .hero.arirang-hero { padding: 32px 0 264px; }
  .arirang-hero-art { height: 240px; }
  .arirang-hero-scene::after { height: 200px; }
}
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .07em; }
.small-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--warm); }
.hero h1 { margin-top: 15px; font-size: clamp(30px, 7.5vw, 38px); font-weight: 650; letter-spacing: -.05em; line-height: 1.35; }
.hero-copy { margin-top: 16px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-elements { display: flex; gap: 16px; margin-top: 23px; color: var(--muted); font-family: Georgia, "Batang", serif; font-size: 13px; }
.hero-elements span:nth-child(2) { color: var(--warm); }
.card { padding: 24px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 21px; }
.section-heading h2 { font-size: 20px; letter-spacing: -.03em; }
.section-heading h3 { display: flex; align-items: center; gap: 9px; font-size: 18px; letter-spacing: -.025em; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-mark { color: var(--warm); font-family: Georgia, "Batang", serif; font-size: 26px; line-height: 1; opacity: .65; }
.section-number { color: var(--warm); font-size: 10px; font-weight: 550; letter-spacing: .02em; }
.calendar-field, .birth-field, .time-field { margin-bottom: 20px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 10px; }
.segmented-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented-control label { display: grid; place-items: center; min-height: 38px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 14px; }
.segmented-control input:checked + label { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 1px 6px rgb(0 0 0 / 5%); }
.segmented-control input:focus-visible + label { outline: 3px solid var(--warm); outline-offset: 1px; }
.leap-check { margin-top: 10px; font-size: 14px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; vertical-align: middle; margin: 0 7px 2px 0; }
.date-fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.form-field { min-width: 0; }
.form-field label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; }
.time-field > label { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
select, input[type="text"] { width: 100%; min-width: 0; min-height: 46px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 9px; background-color: var(--surface); color: var(--text); font-size: 14px; }
select[aria-invalid="true"] { border-color: var(--error); }
.field-help { font-size: 12px; line-height: 1.65; color: var(--muted); }
.time-field .field-help { margin-top: 7px; }
.gender-options { display: flex; gap: 28px; }
.gender-options label { display: flex; align-items: center; min-height: 40px; cursor: pointer; font-size: 14px; }
.leap-check label { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; }
.button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; width: 100%; border: 1px solid transparent; border-radius: 11px; padding: 12px 16px; font-weight: 650; font-size: 15px; transition: background-color .15s; }
.button-primary { background: var(--accent); color: #fff; margin-top: 23px; }
.button-primary:hover:not(:disabled) { background: #21483e; }
.button-secondary { color: var(--accent); border-color: var(--line); background: var(--surface); }
.button-secondary:hover { background: var(--accent-soft); }
.privacy-note { margin-top: 11px; text-align: center; font-size: 11px; color: var(--muted); }
.text-button { padding: 6px 0; color: var(--accent); background: none; border: none; font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; min-height: 36px; }
.return-visit { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 12px; color: var(--muted); }
.form-error { background: var(--error-bg); color: var(--error); font-size: 13px; padding: 12px; border-radius: 9px; margin-top: 12px; }
#load-status { text-align: center; margin-top: 12px; }
.result-intro { padding: 26px 4px 22px; }
.result-intro h2 { font-size: 23px; letter-spacing: -.04em; margin: 8px 0; }
.result-intro h2:focus { outline: none; }
#result-title, #fortune-title, #items-title { scroll-margin-top: 24px; }
.badge { flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--muted); font-size: 11px; }
.pillars-table { width: 100%; table-layout: fixed; border-spacing: 5px; margin: -5px 0 12px; text-align: center; }
.pillars-table caption { caption-side: bottom; text-align: left; font-size: 11px; color: var(--muted); padding-top: 11px; }
.pillars-table th { font-weight: 550; font-size: 12px; padding-bottom: 7px; color: var(--muted); }
.pillars-table th small { display: block; font-size: 10px; color: var(--warm); font-weight: 550; }
.pillar-symbol { padding: 9px 2px 8px; border-radius: 8px; background: var(--element-color); color: var(--symbol-ink); }
.pillar-hanja { display: block; font-family: Georgia, "Batang", serif; font-size: 31px; line-height: 1.25; }
.pillar-ko { display: block; font-size: 12px; line-height: 1.7; }
.pillar-element { display: block; font-size: 9px; opacity: .85; }
.pillar-unknown { background: var(--surface-soft); color: var(--muted); }
.element-bars { display: grid; gap: 12px; margin: 3px 0 16px; }
.element-row { display: grid; grid-template-columns: 44px 1fr 25px; gap: 10px; align-items: center; font-size: 12px; }
.element-label { font-weight: 650; }
.element-track { height: 10px; border-radius: 10px; background: var(--surface-soft); overflow: hidden; }
.element-fill { display: block; height: 100%; width: var(--bar-width); background: var(--element-color); border-radius: inherit; }
.element-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.element-reading { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.reading-label { font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.element-reading article + article { margin-top: 24px; }
.element-reading h4 { font-size: 14px; margin-bottom: 8px; }
.body-copy { font-size: 14px; color: var(--muted); line-height: 1.85; }
.element-reading .body-copy + .body-copy { margin-top: 8px; }
.daymaster-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.daymaster-seal { display: grid; place-items: center; flex-shrink: 0; width: 61px; height: 70px; border-radius: 30px 30px 7px 7px; background: var(--accent-soft); color: var(--accent); font-family: Georgia, "Batang", serif; font-size: 37px; }
.daymaster-name { color: var(--warm); font-size: 12px; margin-bottom: 5px; }
.daymaster-profile h4 { font-size: 20px; letter-spacing: -.04em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.chip { padding: 4px 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.trait-block { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.trait-block h4 { font-size: 14px; margin-bottom: 8px; }
.trait-block ul { margin: 0; padding-left: 20px; }
.trait-block li + li { margin-top: 8px; }
.fortune-lead { display: flex; align-items: center; gap: 16px; padding: 17px 0 22px; border-bottom: 1px solid var(--line); }
.score-ring { display: grid; place-items: center; width: 78px; height: 78px; flex-shrink: 0; border-radius: 50%; background: conic-gradient(var(--accent) var(--score-angle), var(--accent-soft) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.score-value { position: relative; text-align: center; font-size: 26px; line-height: 1.1; font-weight: 650; }
.score-value small { display: block; margin-top: 4px; font-size: 9px; color: var(--muted); font-weight: 450; }
.fortune-lead h4 { font-size: 18px; letter-spacing: -.03em; }
.fortune-lead .field-help { margin-bottom: 6px; }
.fortune-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.fortune-row h4 { font-size: 14px; margin-bottom: 7px; }
.fortune-tip { margin-top: 18px; padding: 15px; background: var(--accent-soft); border-radius: 11px; }
.fortune-tip h4 { color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.toss-banner { display: block; margin-top: 15px; padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; text-decoration: none; }
.toss-banner strong { display: block; color: var(--accent); font-size: 14px; margin-bottom: 4px; }
.lucky-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.lucky-tile { padding: 13px; background: var(--surface-soft); border-radius: 11px; }
.lucky-tile h4 { font-size: 11px; color: var(--muted); font-weight: 550; margin-bottom: 7px; }
.lucky-numbers { font-family: Georgia, serif; font-size: 24px; line-height: 1.5; letter-spacing: .05em; }
.lucky-colors { font-size: 14px; font-weight: 650; }
.color-dot { display: inline-block; width: 10px; height: 10px; background: var(--element-color); border-radius: 50%; margin-right: 5px; }
.lucky-note { margin-top: 10px; }
.items-intro { margin-bottom: 12px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.product-link { display: block; height: 100%; text-decoration: none; }
.product-link:hover .product-name { text-decoration: underline; text-underline-offset: 3px; }
.product-art { display: grid; place-items: center; aspect-ratio: 1.4; background: var(--accent-soft); color: var(--accent); font-family: Georgia, "Batang", serif; font-size: 35px; }
.product-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; }
.platform-label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.product-name { font-size: 13px; font-weight: 650; line-height: 1.6; }
.product-note { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.product-cta { display: block; margin-top: 9px; font-size: 11px; font-weight: 650; color: var(--accent); }
.product-pending { background: var(--surface-soft); }
.product-pending .product-art { background: var(--surface-soft); color: var(--muted); border-bottom: 1px solid var(--line); }
.product-pending .product-name, .product-pending .product-cta { color: var(--muted); }
.disclosure { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 13px; }
.demo-note { margin-top: 12px; }
.share-card { text-align: center; padding-top: 22px; }
.share-sun { font-family: Georgia, serif; color: var(--warm); font-size: 28px; }
.share-card h3 { margin: 7px 0 9px; font-size: 19px; }
.share-card > p { font-size: 13px; color: var(--muted); }
.share-card .button { margin-top: 18px; }
#share-status { margin-top: 10px; }
#share-status:empty { display: none; }
#share-fallback { text-align: left; margin-top: 13px; font-size: 12px; }
#share-url { margin-top: 6px; }
.site-footer { padding: 20px 9px 36px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.85; }
.site-footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.site-footer p + p { margin-top: 8px; }
.footer-brand { font-size: 12px; font-weight: 650; margin-bottom: 16px; color: var(--text); }
@media (max-width: 390px) {
  .card { padding: 20px 17px; }
  .header-note { display: none; }
  .section-heading h3 { font-size: 16px; gap: 7px; }
  .section-heading { gap: 6px; }
  .date-fields { gap: 6px; }
  select { padding-inline: 5px; font-size: 13px; }
  .fortune-lead { gap: 12px; }
  .fortune-lead h4 { font-size: 17px; }
  .product-grid { gap: 8px; }
  .product-info { padding: 10px; }
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --bg: #181f1c; --surface: #222b26; --surface-soft: #2b352e; --text: #e4e8df; --muted: #acb6ac; --accent: #9ac3af; --accent-soft: #303f35; --line: #394239; --warm: #d9a18b; --error: #ffc1af; --error-bg: #4a302a; --shadow: none; }
  .brand-seal, .button-primary { background: #386455; color: #fff; }
  .button-primary:hover:not(:disabled) { background: #437561; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* TASK-8C: common controls and quiet material tokens. */
:root {
  --wood-bg: #e5eee4; --wood-ink: #34583c;
  --fire-bg: #f4e3d9; --fire-ink: #8a4c36;
  --earth-bg: #efe7d3; --earth-ink: #74603d;
  --metal-bg: #e7eae4; --metal-ink: #526055;
  --water-bg: #e2e9ed; --water-ink: #3e5e70;
  --gold-bg: #f2ead1; --gold-ink: #796023;
  --care-bg: #f5e6de; --care-ink: #925c46; --gauge-mid: #bed0bd;
  --shadow: 0 1px 2px rgb(48 60 43 / 3%), 0 8px 24px rgb(48 60 43 / 4%);
}
body { font-variant-numeric: tabular-nums; }
.page-shell { width: min(100% - 40px, 544px); }
.card { border: 0; }
.site-nav { gap: 4px 16px; padding-inline: 0; }
.site-nav a { text-decoration: none; border-bottom: 2px solid transparent; transition: color 200ms ease-out, border-color 200ms ease-out; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.button { text-decoration: none; transition: background-color 200ms ease-out, transform 200ms ease-out; }
.text-button:hover { color: var(--warm); }
button, a { touch-action: manipulation; }
button:active:not(:disabled), .button:active, .product-action:active { transform: scale(.98); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368736b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px; background-color: var(--surface-soft); border-color: transparent; }
select:hover { border-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { appearance: none; background: var(--surface); border: 1.75px solid var(--muted); border-radius: 50%; position: relative; flex-shrink: 0; cursor: pointer; }
input[type="radio"]:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
input[type="checkbox"] { border-radius: 4px; }
input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent); }
input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--surface); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg); }
.segmented-control input { appearance: auto; position: absolute; }
.gender-options { gap: 8px; }
.gender-options label { flex: 1; padding: 8px 12px; background: var(--surface-soft); border-radius: 10px; }
.gender-options label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.chip { border: 0; }
@media (max-width: 390px) { select { padding-right: 22px; background-position: right 4px center; } }
@media (prefers-color-scheme: dark) {
  :root {
    --wood-bg: #304537; --wood-ink: #c2d6bb;
    --fire-bg: #4b372e; --fire-ink: #e6bba1;
    --earth-bg: #443e2b; --earth-ink: #d5c598;
    --metal-bg: #39433d; --metal-ink: #c8d4c9;
    --water-bg: #2e3e49; --water-ink: #b7cedf;
    --gold-bg: #443d29; --gold-ink: #ddc98c;
    --care-bg: #47372f; --care-ink: #e0b49d; --gauge-mid: #597360;
    --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 8px 24px rgb(0 0 0 / 6%);
  }
}
