:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #202923;
  background: #f7f8f1;
  --ink: #202923;
  --muted: #536158;
  --line: #d5ded0;
  --deep: #354c40;
  --accent: #6841b3;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip { position: absolute; z-index: 1; top: 8px; left: 8px; transform: translateY(-170%); padding: 12px; background: #fff; }
.skip:focus { transform: none; }
.site-bar, footer {
  width: min(1100px, 100%); padding: 14px clamp(16px, 3vw, 32px); margin: auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.site-bar { border-bottom: 1px solid var(--line); min-height: 76px; }
.wordmark { font-size: 25px; font-weight: 800; letter-spacing: -1.25px; }
.wordmark span { color: var(--accent); }
.languages { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.languages a, .home-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .84rem; padding: 0 9px; }
.languages a[aria-current] { color: #5b3999; background: #ebe6f3; border-radius: 9px; font-weight: 700; }
.home-link { gap: 5px; }
main { padding: 0 clamp(16px, 3.5vw, 32px); }
main:focus, h1:focus { outline: 0; }
.intro { display: grid; align-items: center; grid-template-columns: 1fr .95fr; gap: clamp(24px, 5vw, 66px); max-width: 1010px; margin: clamp(38px, 7vw, 80px) auto; }
.facts, .topic { color: var(--deep); font-size: .85rem; font-weight: 750; }
h1, h2, p, dt, .choice, .button, summary { overflow-wrap: anywhere; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) p, :lang(ko) button, :lang(ko) dt { word-break: keep-all; }
h1 { margin: .25em 0; font-size: clamp(2rem, 4.1vw, 3.65rem); line-height: 1.22; letter-spacing: -.045em; }
h2 { margin: 0 0 .5em; font-size: clamp(1.16rem, 2.4vw, 1.5rem); line-height: 1.4; }
p { margin: .6em 0; line-height: 1.7; color: var(--muted); }
.lead { color: var(--ink); font-size: clamp(1.025rem, 2vw, 1.15rem); }
.button {
  display: inline-flex; gap: 9px; justify-content: center; align-items: center; min-height: 47px;
  padding: 10px 18px; border: 1px solid #a7b5a4; border-radius: 12px; background: #fff;
  font-size: .95rem; font-weight: 650; text-align: center; color: var(--ink); line-height: 1.45;
}
.button.primary { color: #fff; background: var(--deep); border-color: var(--deep); }
#civic-start { margin-top: 16px; }
.privacy-note { font-size: .82rem; margin-top: 12px; }
.intro-visual { min-width: 0; }
.intro-visual img { display: block; width: 100%; height: auto; border-radius: 18px; background: #e4e9de; }
.question { max-width: 660px; min-height: 58vh; margin: clamp(20px, 4vw, 55px) auto 70px; }
.question-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); }
.text-button {
  display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 4px 2px;
  border: 0; color: var(--deep); background: none; text-decoration: underline; text-underline-offset: 3px; font-size: .88rem;
}
#round-label { flex-shrink: 0; font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; width: 100%; height: 6px; margin: 2px 0 28px; border: 0; border-radius: 10px; background: #e0e6da; overflow: hidden; }
progress::-webkit-progress-bar { background: #e0e6da; }
progress::-webkit-progress-value { background: #627f69; }
progress::-moz-progress-bar { background: #627f69; }
.question h1 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.47; letter-spacing: -.035em; }
.choices { margin-top: 22px; display: grid; gap: 10px; }
.choice {
  width: 100%; min-height: 56px; padding: 14px 18px; text-align: start; border-radius: 12px;
  border: 1px solid #bac8b6; background: #fff; color: var(--ink); line-height: 1.55; font-weight: 550;
}
.choice[data-selected] { border-color: var(--deep); box-shadow: inset 3px 0 var(--deep); }
.choice small { display: block; color: var(--deep); font-size: .77rem; margin-top: 3px; }
@media (hover:hover) {
  .choice:hover, .button:not(.primary):hover { border-color: var(--deep); background: #edf2e9; }
  .primary:hover { background: #2a3c33; }
}
.result { max-width: 960px; margin: clamp(18px, 4vw, 48px) auto 65px; }
.result-hero {
  --inset: clamp(18px, 3.8vw, 40px);
  display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  grid-template-areas: "title art" "summary art" "spectrum art";
  align-content: start; border: 1px solid #cfcfc0; border-radius: 18px; overflow: hidden; background: #fffcf5;
}
.result-hero h1, .result-summary, .spectrum { min-width: 0; margin-inline: var(--inset); }
.result-hero h1 {
  grid-area: title; align-self: end; margin-block: var(--inset) 0;
  font-size: clamp(2.2rem, 5.5vw, 3.65rem); line-height: 1.12; color: #233f3c; letter-spacing: -.055em;
}
.result-summary { grid-area: summary; margin-block: 10px 0; align-self: start; color: var(--ink); line-height: 1.55; }
.result-art { grid-area: art; align-self: stretch; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center; }
.spectrum { grid-area: spectrum; align-self: end; margin-block: 16px var(--inset); font-variant-numeric: tabular-nums; }
.spectrum-plot { position: relative; padding-top: 34px; }
.spectrum-value {
  position: absolute; top: 0; left: clamp(19px, var(--position), calc(100% - 19px)); transform: translateX(-50%);
  min-width: 38px; padding: 3px 5px; border-radius: 6px; text-align: center;
  color: white; background: #243534; font-size: .82rem; font-weight: 750; line-height: 1.45;
}
.spectrum-rail { display: grid; grid-template-columns: var(--left-stop) calc(var(--right-stop) - var(--left-stop)) 1fr; height: 12px; overflow: hidden; border-radius: 6px; }
.spectrum-rail i:nth-child(1) { background: #89a5b5; }
.spectrum-rail i:nth-child(2) { background: #dbc991; border-inline: 2px solid #fffcf5; }
.spectrum-rail i:nth-child(3) { background: #d49e8c; }
.spectrum-marker {
  position: absolute; bottom: -2px; left: var(--position); transform: translateX(-50%);
  width: 5px; height: 26px; background: #243534; border-radius: 2px; box-shadow: 0 0 0 2px #fffcf5;
}
.spectrum-labels { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; margin-top: 8px; font-weight: 700; font-size: clamp(.72rem,1.5vw,.89rem); }
.spectrum-labels span:nth-child(2) { text-align: center; }
.spectrum-labels span:nth-child(3) { text-align: end; }
.spectrum-labels small { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; font-weight: 500; }
@media (forced-colors: active) {
  .spectrum-rail { border: 1px solid CanvasText; }
  .spectrum-rail i:nth-child(2) { border-color: CanvasText; }
  .spectrum-marker { forced-color-adjust: none; background: Highlight; outline: 1px solid CanvasText; }
  .spectrum-value { border: 1px solid CanvasText; }
}
.result-scope { margin: 9px 2px 20px; font-size: .85rem; }
.overall-counts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 20px 0 6px; padding: 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.overall-counts > div + div { border-inline-start: 1px solid var(--line); }
.overall-counts dt { padding-inline: 4px; font-size: .86rem; }
.overall-counts dd { margin: 4px 0 0; font-size: 1.35rem; font-weight: 750; }
.score-details { margin: 12px 0 22px; }
.score-details p { max-width: 70ch; }
.breakdown { margin: 26px 0; }
.axes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.axis-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: clamp(16px, 2.5vw, 24px); }
.axis-card h3 { margin: 0; font-size: 1rem; }
.axis-counts { margin: 16px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.axis-counts > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-top: 6px; font-size: .87rem; line-height: 1.5; }
.axis-counts dd { flex-shrink: 0; margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.sharing { background: #e7eee2; padding: clamp(16px, 3vw, 26px); border-radius: 16px; }
.sharing p { font-size: .91rem; }
.civic-partner { margin: 18px 0; padding: 14px 18px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.civic-partner p { margin: 0; font-size: .82rem; line-height: 1.5; }
.civic-partner .partner-label { margin-bottom: 4px; color: var(--ink); font-weight: 700; }
.civic-partner a { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; color: var(--deep); text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 1px; }
#copy-feedback:empty, #civic-card-feedback:empty { display: none; }
#civic-card-preview img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 12px; }
#manual-copy label { display: block; font-size: .9rem; margin-bottom: 6px; }
#manual-copy textarea { width: 100%; padding: 10px; resize: vertical; border: 1px solid #a4b39e; border-radius: 6px; }
#civic-review { margin: 24px 0; border-block: 1px solid var(--line); }
summary { cursor: pointer; padding: 16px 2px; min-height: 44px; font-weight: 700; }
#civic-review ol { padding: 0; margin: 0; list-style: none; }
#civic-review li { padding: 14px 0; border-top: 1px solid var(--line); }
.review-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.review-heading button { flex-shrink: 0; }
.review-question { margin: 0; font-size: .95rem; color: var(--ink); }
.review-answer { font-weight: 700; color: var(--deep); padding-left: 10px; border-left: 3px solid #95af94; }
.review-answer small { display: block; font-size: .83rem; font-weight: 550; }
.review-note { font-size: .86rem; }
footer { margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; gap: 0 20px; }
footer a { min-height: 44px; display: inline-flex; align-items: center; }
footer span { margin-left: auto; }
@media (max-width: 700px) {
  .result-hero { grid-template-columns: minmax(0,1fr); grid-template-areas: "title" "summary" "spectrum" "art"; }
  .result-art { height: clamp(108px, 35vw, 180px); }
  .spectrum { margin-block: 16px 17px; }
  .intro { grid-template-columns: minmax(0,1fr); margin: 28px auto 32px; gap: 22px; }
  .intro-visual img { max-height: 265px; object-fit: cover; }
  .axes { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .site-bar { gap: 10px; min-height: 64px; padding-block: 8px; }
  .home-link { display:none; }
}
@media (max-width: 400px) {
  .actions { display: grid; }
  footer { gap: 0 12px; }
  .question { margin-bottom: 36px; }
}
