:root {
  color-scheme: dark;
  --ink: #f7ecd7;
  --ink-soft: #cfbaa1;
  --ink-muted: #9d8069;
  --night: #21130f;
  --night-deep: #100907;
  --panel: #2c1914;
  --panel-2: #3a2119;
  --line: rgba(230, 196, 150, .22);
  --jade: #91b49a;
  --jade-deep: #51745e;
  --gold: #d7ad64;
  --red: #9e3d31;
  --paper: #f1dfb9;
  --paper-ink: #2a1b12;
  --font: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night-deep); }
html.matching-experience-open,
body.matching-experience-open {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(128, 78, 52, .23), transparent 34rem),
    radial-gradient(circle at 82% 42%, rgba(158, 61, 49, .15), transparent 30rem),
    var(--night);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--paper-ink);
  text-decoration: none;
}
.skip-link:focus { transform: none; }

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 50;
  width: min(calc(100% - 32px), 1380px);
  min-height: 62px;
  padding: 8px 10px 8px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(230, 196, 150, .20);
  background: rgba(31, 17, 13, .82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  position: relative;
  width: 106px;
  height: 34px;
  display: block;
  overflow: hidden;
}
.brand-logo img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 132px;
  height: 132px;
  max-width: none;
  display: block;
  transform: translate(-50%, -50%);
}
.brand-footer .brand-logo { width: 118px; height: 38px; }
.brand-footer .brand-logo img { width: 146px; height: 146px; }

.header-title { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.auth-state { color: var(--ink-muted); font-size: 11px; }
.text-button {
  min-height: 44px;
  padding: 0 19px;
  border: 0;
  background: var(--paper);
  color: var(--paper-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.page-shell { width: 100%; max-width: 100%; overflow-x: hidden; }

.hero {
  width: min(100%, 1600px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 138px 6vw 72px;
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(480px, 1.07fr);
  align-items: center;
  gap: clamp(40px, 6vw, 110px);
}

.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.hero-kicker,
.chapter-heading > p,
.formula-intro > p,
.roles-pin > p:first-child,
.action-section > p {
  margin: 0 0 21px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  width: 100%;
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 4.8vw, 5.4rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -.075em;
  text-wrap: balance;
}
.hero-line { white-space: nowrap; }

.hero-lead {
  max-width: 650px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.75;
  letter-spacing: -.02em;
}

.hero-actions { margin-top: 38px; display: flex; gap: 12px; flex-wrap: wrap; }
.primary-button,
.secondary-button,
.action-button {
  min-height: 56px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .3s ease, background .3s ease, border-color .3s ease;
}
.primary-button { background: var(--paper); color: var(--paper-ink); }
.secondary-button { border-color: var(--line); background: transparent; color: var(--ink); }
.primary-button:hover, .secondary-button:hover, .action-button:hover { transform: translateY(-3px); }
.secondary-button:hover { border-color: var(--jade); background: rgba(112, 211, 189, .08); }

.privacy-line { margin: 18px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.6; }

.hero-art {
  position: relative;
  min-height: min(70vw, 740px);
  overflow: hidden;
  border: 1px solid rgba(230, 196, 150, .24);
  background: #271610;
  box-shadow: 0 50px 100px rgba(0, 0, 0, .35);
}
.hero-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, transparent 50%, rgba(23, 12, 9, .90) 100%),
    linear-gradient(90deg, rgba(35, 18, 12, .30), transparent 40%);
}
.hero-art img {
  width: 100%;
  height: 100%;
  min-height: min(70vw, 740px);
  object-fit: cover;
  object-position: 62% 50%;
  image-rendering: pixelated;
  filter: sepia(.34) saturate(.84) hue-rotate(-9deg) brightness(.90);
  transform: scale(1.01);
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.hero-art:hover img { transform: scale(1.055); }
.hero-art-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.hero-art-caption span { color: var(--jade); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.hero-art-caption strong { max-width: 260px; text-align: right; font-size: 14px; line-height: 1.5; }

.interest-section,
.formula-section,
.roles-section,
.action-section {
  width: min(calc(100% - 48px), 1380px);
  margin: 0 auto;
  padding: 160px 0;
}

.chapter-heading { max-width: 1000px; margin-bottom: 64px; }
.chapter-heading h2,
.formula-intro h2,
.roles-pin h2,
.action-section h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5.1vw, 5.8rem);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -.065em;
  text-wrap: balance;
}

/*
 * 번역 문장은 한국어보다 같은 뜻을 표현하는 글자 수가 길다.
 * 한글용 대형 타이포를 그대로 쓰면 일본어·중국어 제목이 좁은 열에서
 * 4~6줄로 갈라지므로, 비한국어 화면은 읽을 수 있는 편집 크기로 낮춘다.
 */
html:not([lang="ko"]) .chapter-heading h2,
html:not([lang="ko"]) .formula-intro h2,
html:not([lang="ko"]) .roles-pin h2,
html:not([lang="ko"]) .action-section h2 {
  font-size: clamp(2.5rem, 3.7vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

html:lang(ja) .roles-pin h2,
html:lang(zh) .roles-pin h2 {
  max-width: 9em;
}

.bento-grid {
  min-height: 710px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  border: 1px solid var(--line);
}
.bento-grid > article { overflow: hidden; }
.bento-main {
  grid-column: span 7;
  grid-row: span 2;
  padding: clamp(28px, 4vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 84% 18%, rgba(112, 211, 189, .16), transparent 18rem),
    var(--panel);
}
.bento-copy { max-width: 650px; }
.quiet-label { color: var(--jade); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.bento-main h3,
.bento-side h3 {
  margin: 18px 0 0;
  font-size: clamp(1.7rem, 3vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -.055em;
}
.bento-main p,
.bento-side p { max-width: 570px; margin: 22px 0 0; color: var(--ink-soft); line-height: 1.75; }
.bento-side {
  grid-column: span 5;
  grid-row: span 1;
  padding: clamp(26px, 3vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--line);
}
.bento-score { background: #eadfc5; color: var(--paper-ink); }
.bento-score .quiet-label { color: #8c472f; }
.bento-companion { border-top: 1px solid var(--line); background: var(--panel-2); }

.rank-preview { margin-top: 52px; border-top: 1px solid var(--line); }
.rank-row {
  min-height: 84px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 30px 56px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  transition: padding .3s ease, background .3s ease;
}
.rank-row:hover { padding-left: 12px; padding-right: 12px; background: rgba(255, 255, 255, .035); }
.rank-row > b { color: var(--ink-muted); font-size: 12px; }
.rank-row div { min-width: 0; }
.rank-row strong, .rank-row small { display: block; }
.rank-row strong { font-size: 15px; }
.rank-row small { margin-top: 5px; color: var(--ink-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row em { color: var(--jade); font-size: 26px; font-style: normal; font-weight: 800; }
.rank-name-button {
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.rank-name-button strong { display: block; }
.rank-name-button strong { width: max-content; max-width: 100%; border-bottom: 1px solid transparent; }
.rank-name-button:hover strong, .rank-name-button:focus-visible strong { border-bottom-color: var(--jade); color: var(--jade); }
.rank-name-button:focus-visible { outline: 2px solid var(--jade); outline-offset: 5px; }

.role-sprite {
  --col: 0;
  --row: 0;
  display: inline-block;
  width: 56px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(213, 161, 69, .35);
  background-image: url("/matching/assets/joseon-roles-atlas-v2.png");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  background-position: calc(var(--col) * 33.333333%) calc(var(--row) * 50%);
  image-rendering: pixelated;
}
.role-sprite--king { --col: 0; --row: 0; }
.role-sprite--queen { --col: 1; --row: 0; }
.role-sprite--prince { --col: 2; --row: 0; }
.role-sprite--councillor { --col: 3; --row: 0; }
.role-sprite--guard { --col: 0; --row: 1; }
.role-sprite--kitchen_lady { --col: 1; --row: 1; }
.role-sprite--historian { --col: 2; --row: 1; }
.role-sprite--astronomer { --col: 3; --row: 1; }
.role-sprite--medical_assistant { --col: 0; --row: 2; }
.role-sprite--investigator { --col: 1; --row: 2; }
.role-sprite--painter { --col: 2; --row: 2; }
.role-sprite--palace_maid { --col: 3; --row: 2; }

.mini-bars { display: grid; gap: 10px; margin-top: 30px; }
.mini-bars i { display: block; width: var(--value); height: 6px; background: #9e4b38; }
.companion-path { margin-top: 30px; display: flex; align-items: center; gap: 10px; color: var(--jade); font-size: 11px; font-weight: 700; }
.companion-path i { width: 24px; height: 1px; background: currentColor; }

.formula-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(50px, 8vw, 140px); align-items: start; }
.formula-intro { position: sticky; top: 130px; }
.formula-accordion { min-height: 560px; display: flex; border: 1px solid var(--line); }
.formula-item {
  width: 16%;
  min-width: 84px;
  padding: 28px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-items: start;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: width .6s cubic-bezier(.2,.8,.2,1), background .4s ease;
}
.formula-item:last-child { border-right: 0; }
.formula-item.is-open { width: 52%; background: var(--paper); color: var(--paper-ink); }
.formula-item span {
  writing-mode: vertical-rl;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
}
.formula-item.is-open span { writing-mode: horizontal-tb; color: #6b3d2f; }
.formula-item strong { margin-top: 28px; font-size: clamp(2.4rem, 4vw, 5.2rem); line-height: 1; }
.formula-item p { align-self: end; margin: 40px 0 0; color: inherit; line-height: 1.7; opacity: 0; transform: translateY(10px); transition: opacity .25s ease .2s, transform .25s ease .2s; }
.formula-item.is-open p { opacity: .74; transform: none; }

.roles-section { min-height: 2000px; display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(50px, 8vw, 150px); align-items: start; }
.roles-pin { position: sticky; top: 128px; padding-top: 28px; }
.roles-description { max-width: 540px; margin: 30px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.roles-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.role-card {
  min-height: 540px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  transform: scale(.86);
  opacity: .28;
}
.role-card:nth-child(3n + 2) { margin-top: 80px; }
.role-card-visual {
  position: absolute;
  inset: 0;
  background-image: url("/matching/assets/joseon-roles-atlas-v2.png");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  background-position: calc(var(--col) * 33.333333%) calc(var(--row) * 50%);
  image-rendering: pixelated;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.role-card:hover .role-card-visual { transform: scale(1.06); }
.role-card::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 38%, rgba(24, 12, 9, .95) 100%); }
.role-card-copy { position: absolute; left: 25px; right: 25px; bottom: 25px; z-index: 2; }
.role-card-copy small { color: var(--jade); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.role-card-copy h3 { margin: 8px 0 0; font-size: 28px; letter-spacing: -.04em; }
.role-card-copy p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.action-section { padding-top: 200px; padding-bottom: 200px; text-align: center; }
.action-portraits { height: 120px; display: flex; align-items: center; justify-content: center; margin-bottom: 32px; }
.action-portraits .role-sprite { width: 110px; border: 5px solid var(--night); box-shadow: 0 20px 45px rgba(0,0,0,.32); }
.action-portraits .role-sprite:nth-child(1) { transform: rotate(-6deg) translateX(20px); }
.action-portraits .role-sprite:nth-child(2) { position: relative; z-index: 2; width: 126px; }
.action-portraits .role-sprite:nth-child(3) { transform: rotate(6deg) translateX(-20px); }
.action-section h2 { max-width: 1050px; margin: 0 auto; }
.action-button { min-width: min(100%, 340px); margin-top: 42px; background: var(--red); color: #fff7e4; }
.action-section small { display: block; margin-top: 17px; color: var(--ink-muted); }

.site-footer {
  width: min(calc(100% - 48px), 1380px);
  min-height: 170px;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 50px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
}
.site-footer p { margin: 0; line-height: 1.65; }
.site-footer nav { display: flex; gap: 22px; }
.site-footer nav a { text-decoration: none; }

.experience {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  display: grid;
  place-items: center;
}
.experience-backdrop { position: absolute; inset: 0; background: rgba(20, 12, 8, .9); backdrop-filter: blur(14px); }
.experience-panel {
  --ink: #251a10;
  --ink-soft: #66533b;
  --ink-muted: #79664b;
  --line: rgba(76, 48, 24, .28);
  --jade: #286653;
  --red: #9f3d2e;
  position: relative;
  width: min(100%, 1040px);
  height: min(900px, calc(100dvh - 48px));
  max-height: calc(100svh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 4px solid #3f2117;
  background: #d8c397;
  color: var(--ink);
  box-shadow: 8px 8px 0 #160d09, 0 40px 120px rgba(0,0,0,.58), inset 2px 2px 0 #efdcae, inset -2px -2px 0 #70402b;
}
.experience-header {
  min-height: 70px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border-bottom: 4px solid #4d2419;
  background: #8f3429;
  color: #fff4d6;
  box-shadow: inset 2px 2px 0 #ca7157, inset -2px -2px 0 #4e1e19;
}
.experience-header > div { text-align: center; }
.experience-header .icon-button[hidden] { display: block !important; visibility: hidden; }
.experience-header span, .experience-header strong { display: block; }
.experience-header span { color: #f0c975; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.experience-header strong { margin-top: 4px; font-size: 14px; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 2px solid #5b281e; background: #bd6047; color: #fff4d6; box-shadow: inset 2px 2px 0 #dd8b6d, inset -2px -2px 0 #6d2b22; cursor: pointer; font-size: 22px; }
.icon-button:active { padding: 2px 0 0 2px; box-shadow: inset 2px 2px 0 #6d2b22, inset -1px -1px 0 #dd8b6d; }
.experience-progress { height: 5px; background: #54301f; }
.experience-progress[hidden] { display: none; }
.experience-progress i { display: block; width: 16%; height: 100%; background: #d7ad4c; transition: width .45s ease; }
.experience-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background: #ead5a8 url("/matching/assets/joseon-paper-pixel-tile.png") repeat;
  background-size: 420px 420px;
  image-rendering: pixelated;
}

.flow-screen { min-height: 670px; padding: clamp(28px, 5vw, 68px); background: rgba(247, 230, 188, .42); color: var(--ink); }
.flow-screen--split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: clamp(38px, 6vw, 90px); align-items: center; }
.flow-copy h2 { max-width: 650px; margin: 0; font-size: clamp(2.1rem, 4.8vw, 5rem); line-height: 1.05; letter-spacing: -.06em; }
.flow-copy > p { max-width: 590px; margin: 20px 0 0; color: var(--ink-soft); line-height: 1.7; }
.flow-copy .quiet-label { display: block; margin-bottom: 18px; }

.input-card { background: #6f3024; color: var(--paper-ink); }
.pixel-window {
  border: 4px solid #4b2419;
  box-shadow: 7px 7px 0 rgba(43, 22, 14, .48), inset 2px 2px 0 #d07458, inset -2px -2px 0 #35170f;
}
.pixel-window-title {
  min-height: 38px;
  padding: 5px 6px 5px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 4px solid #4b2419;
  background: #9f3d2e;
  color: #fff1cf;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  box-shadow: inset 2px 2px 0 #cf7358, inset -2px -2px 0 #5d241c;
}
.pixel-window-controls { display: flex; gap: 4px; }
.pixel-window-controls i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid #4b2419;
  background: #d3b77e;
  color: #3e2519;
  box-shadow: inset 2px 2px 0 #f4dfad, inset -2px -2px 0 #816642;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}
.input-card-scroll {
  position: relative;
  padding: clamp(27px, 4vw, 40px) clamp(22px, 4vw, 38px) 28px;
  background: #f2dfb2 url("/matching/assets/joseon-paper-pixel-tile.png") repeat;
  background-size: 380px 380px;
  image-rendering: pixelated;
}
.input-card-scroll::before,
.input-card-scroll::after {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 8px;
  border: 2px solid #663025;
  background: #aa4936;
  box-shadow: inset 2px 2px 0 #d17359, inset -2px -2px 0 #6e2d23;
  content: "";
}
.input-card-scroll::before { top: 6px; }
.input-card-scroll::after { bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 8px; color: #513725; font-size: 11px; font-weight: 900; }
.field > .field-label { display: flex; align-items: center; gap: 7px; }
.field-label b, .field-label em { padding: 2px 6px; color: #fff8df; background: #8f3a2d; font-size: 9px; font-style: normal; line-height: 1.45; }
.field-label em { color: #624b37; background: #dbc99e; }
.field input, .field select {
  min-width: 0;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: rgba(255, 248, 221, .72);
  color: var(--paper-ink);
  box-shadow: inset 2px 2px 0 #8b7452, inset -2px -2px 0 #fff4ca;
}
.field input:focus, .field select:focus { outline: 3px solid #8f3a2d; outline-offset: 1px; box-shadow: inset 2px 2px 0 #6f573b, inset -2px -2px 0 #fff4ca; }
.identity-input-row { display:grid; grid-template-columns:minmax(0,1fr) 96px; gap:0; }
.identity-input-row > #nickname { border-radius:0; }
.field .identity-input-row > input[type="hidden"] { display:none; }
.gender-choice { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.gender-choice button { min-width:0; height:52px; padding:0; border:2px solid #a8916e; border-left:0; border-radius:0; color:#8a7353; background:#f8edcf; font:inherit; font-size:12px; font-weight:900; cursor:pointer; transition:background .16s ease,color .16s ease; }
.gender-choice button[aria-pressed="true"] { color:#fff8df; background:#87372b; box-shadow:inset 2px 2px 0 #b85a43,inset -2px -2px 0 #5f251e; }
.gender-choice button:focus-visible { position:relative; z-index:2; outline:3px solid rgba(143,58,45,.22); outline-offset:1px; }
.picker-input-shell { position: relative; width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 52px; }
.time-input-shell { grid-template-columns: minmax(0, 1fr) 104px 52px; }
.picker-input-shell > input:first-child { min-width: 0; font-variant-numeric: tabular-nums; }
.time-period { min-width: 0; width: 104px; padding: 0 7px !important; border-left: 2px solid #a8916e !important; text-align: center; text-align-last: center; cursor: pointer; -webkit-appearance: none; appearance: none; }
.time-period:has(option:checked[value=""]) { color: #8a7353; }
.picker-button { position: relative; z-index: 1; width: 52px; min-width: 0; height: 52px; display: grid; place-items: center; border-left: 2px solid #a8916e; color: #684a31; background: #ead7a7; box-shadow: inset 2px 2px 0 #fff0c5, inset -2px -2px 0 #9e835c; pointer-events: none; }
.picker-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.field .native-date-picker, .field .native-time-picker { position: absolute; z-index: 2; right: 0; bottom: 0; width: 52px; min-width: 52px; height: 52px; padding: 0; border: 0; opacity: 0; pointer-events: auto; cursor: pointer; box-shadow: none; }
.field-help { margin: 8px 0 0; color: #6d746f; font-size: 10px; line-height: 1.65; }
.form-actions { margin-top: 18px; display: grid; grid-template-columns: .72fr 1.28fr; gap: 10px; }
.form-actions .flow-primary, .form-actions .flow-secondary { min-width: 0; margin-top: 0; }
.relationship-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.relationship-option { height: 46px; border: 2px solid #684a31; background: #d9c391; color: #4a3222; box-shadow: inset 2px 2px 0 #f8e7b9, inset -2px -2px 0 #8a714d; cursor: pointer; font-size: 12px; font-weight: 900; }
.relationship-option.is-selected { background: #286653; color: #fff4d5; box-shadow: inset 2px 2px 0 #173c31, inset -2px -2px 0 #58a188; }
.form-note { margin: 16px 0 0; color: #6d746f; font-size: 10px; line-height: 1.65; }
.form-error { min-height: 18px; margin: 12px 0 0; color: #a7352c; font-size: 11px; font-weight: 700; }
.flow-primary, .flow-secondary, .flow-link {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border: 1px solid transparent;
  background: var(--red);
  color: #fff8e6;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}
.input-card .flow-primary { border: 2px solid #57231c; box-shadow: inset 2px 2px 0 #d47459, inset -3px -3px 0 #68291f, 3px 3px 0 rgba(65, 37, 22, .28); }
.input-card .flow-primary:active { transform: translate(2px, 2px); box-shadow: inset 2px 2px 0 #68291f, inset -1px -1px 0 #d47459; }
.flow-secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.input-card .flow-secondary { border-color: #b7a98b; color: var(--paper-ink); }
.input-card .form-login-save { margin-top: 10px; background: rgba(255, 248, 221, .38); }
.form-save-state { margin: 13px 0 0; color: #286653; font-size: 11px; font-weight: 900; text-align: center; }
.form-save-state.is-guest { color: #796a55; }
.flow-link { min-height: auto; margin-top: 12px; background: transparent; color: var(--ink-soft); }
.result-save-login { padding: 10px 0; }
.flow-primary:disabled { opacity: .55; cursor: wait; }

.scan-screen { min-height: 670px; display: grid; place-items: center; text-align: center; }
.scan-orbit { position: relative; width: 190px; height: 190px; margin: 0 auto 36px; }
.scan-orbit::before, .scan-orbit::after { position: absolute; inset: 0; border: 1px solid var(--line); content: ""; animation: scan-spin 4s linear infinite; }
.scan-orbit::after { inset: 24px; border-color: var(--jade); animation-direction: reverse; animation-duration: 2.8s; }
.scan-orbit i { position: absolute; inset: 58px; display: grid; place-items: center; background: var(--paper); color: var(--paper-ink); font-size: 30px; font-style: normal; font-weight: 900; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scan-screen h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.8rem); letter-spacing: -.05em; }
.scan-screen p { color: var(--ink-soft); }

.result-screen { padding: 0; }
.scroll-document { position: relative; border-top: 14px solid #a34432; border-bottom: 14px solid #a34432; box-shadow: inset 0 3px 0 #6c291f, inset 0 -3px 0 #6c291f; }
.scroll-document::before,
.scroll-document::after { position: absolute; z-index: 3; top: -20px; bottom: -20px; width: 12px; border: 3px solid #5b281e; background: #b35a3c; box-shadow: inset 2px 0 0 #d27b58, inset -2px 0 0 #7b3024; content: ""; }
.scroll-document::before { left: 8px; }
.scroll-document::after { right: 8px; }
.role-result-hero { min-height: 650px; position: relative; display: grid; grid-template-columns: 1fr 1fr; background: rgba(247, 231, 191, .62); }
.result-portrait { min-height: 650px; background-image: url("/matching/assets/joseon-roles-atlas-v2.png"); background-repeat: no-repeat; background-size: 400% 300%; background-position: calc(var(--col) * 33.333333%) calc(var(--row) * 50%); image-rendering: pixelated; }
.result-copy { padding: clamp(34px, 6vw, 70px); display: flex; flex-direction: column; justify-content: center; }
.result-copy > small { color: var(--jade); font-weight: 800; letter-spacing: .12em; }
.result-copy h2 { margin: 16px 0 0; font-size: clamp(2.6rem, 6vw, 5.8rem); line-height: .96; letter-spacing: -.07em; }
.result-copy > p { margin: 22px 0 0; color: var(--ink-soft); line-height: 1.7; }
.keyword-row { margin-top: 25px; display: flex; gap: 8px; flex-wrap: wrap; }
.keyword-row span { padding: 8px 10px; border: 1px solid var(--line); color: var(--jade); font-size: 10px; }
.role-basis { margin-top: 26px; border-top: 3px double rgba(117, 83, 51, .62); border-bottom: 3px double rgba(117, 83, 51, .62); }
.role-basis-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(117, 83, 51, .34); }
.role-basis-head h3 { margin: 0; color: var(--paper-ink); font-size: 18px; letter-spacing: -.03em; }
.role-basis-head span { color: #796a55; font-size: 9px; font-weight: 800; white-space: nowrap; }
.role-basis ul { margin: 0; padding: 0; list-style: none; }
.role-basis li { min-height: 52px; display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 11px; padding: 12px 2px; border-bottom: 1px solid rgba(117, 83, 51, .22); }
.role-basis li:last-child { border-bottom: 0; }
.role-basis li i { width: 7px; height: 7px; background: var(--red); box-shadow: 2px 2px 0 rgba(91, 40, 30, .25); }
.role-basis li span { color: #4d4438; font-size: 13px; font-weight: 650; line-height: 1.6; word-break: keep-all; }
.result-actions { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.result-actions .flow-primary, .result-actions .flow-secondary { margin-top: 0; }
.role-share-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.role-share-actions .flow-secondary { margin-top: 0; border-color: #8f6e49; background: rgba(255, 248, 221, .38); color: #3f2d1e; }
.expiry-copy { margin-top: 13px; color: var(--ink-muted); font-size: 10px; }

.match-result { padding: clamp(28px, 5vw, 62px); }
.match-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.pair-person { text-align: center; }
.pair-person .role-sprite { width: min(28vw, 190px); }
.pair-person strong, .pair-person small { display: block; }
.pair-person strong { margin-top: 14px; font-size: 20px; }
.pair-person small { margin-top: 6px; color: var(--ink-muted); }
.score-seal { width: 160px; height: 160px; display: grid; place-items: center; border: 1px solid rgba(213,161,69,.48); background: var(--red); color: #fff3d5; box-shadow: inset 0 0 0 8px rgba(255,255,255,.05); transform: rotate(2deg); }
.score-seal div { transform: rotate(-2deg); text-align: center; }
.score-seal strong { display: block; font-size: 56px; line-height: 1; }
.score-seal span { display: block; margin-top: 7px; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.match-title { max-width: 780px; margin: 44px auto 0; text-align: center; }
.match-title h2 { margin: 0; font-size: clamp(2rem, 4.6vw, 4.8rem); line-height: 1.05; letter-spacing: -.06em; }
.match-title p { margin: 15px auto 0; color: var(--ink-soft); line-height: 1.65; }
.match-rank { display: inline-flex; align-items: center; margin-left: 8px; padding: 4px 9px; border: 1px solid rgba(159,61,46,.35); background: rgba(159,61,46,.08); color: #77503d; font-size: 11px; font-weight: 800; vertical-align: middle; }
.match-rank strong { margin-left: 4px; color: var(--red); font-size: 13px; }
.component-grid { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); border: 3px double #755333; background: rgba(255, 246, 214, .3); }
.component-card { min-height: 150px; padding: 23px; border-right: 1px solid var(--line); }
.component-card:last-child { border-right: 0; }
.component-card span, .component-card strong, .component-card small { display: block; }
.component-card span { color: var(--ink-muted); font-size: 10px; font-weight: 800; }
.component-card strong { margin-top: 18px; color: var(--jade); font-size: 36px; }
.component-card small { margin-top: 8px; color: var(--ink-soft); line-height: 1.5; }

.leaderboard { margin-top: 50px; }
.leaderboard-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.leaderboard-head h3 { margin: 0; font-size: 26px; }
.leaderboard-head span { color: var(--ink-muted); font-size: 10px; }
.leaderboard-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.leaderboard-refresh { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); background: rgba(255, 248, 221, .4); color: var(--paper-ink); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.leaderboard-refresh:hover, .leaderboard-refresh:focus-visible { border-color: var(--red); color: var(--red); }
.leaderboard-list { border: 3px double #755333; background: rgba(255, 246, 214, .28); }
.leaderboard-empty { padding: 38px 20px; border: 3px double #755333; color: var(--ink-muted); text-align: center; }
.experience-panel .rank-row { padding-left: 12px; padding-right: 12px; }
.experience-panel .rank-row:hover { background: rgba(107, 70, 35, .08); }
.experience-panel .rank-name-button:hover strong, .experience-panel .rank-name-button:focus-visible strong { border-bottom-color: #8f3a2d; color: #8f3a2d; }
.leaderboard .rank-row { grid-template-columns: 34px 48px 1fr auto; }
.leaderboard .rank-row .role-sprite { width: 48px; }
.owner-leaderboard { margin-top: 0; }
.owner-leaderboard .quiet-label { display: block; margin-bottom: 8px; color: var(--jade); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.owner-list-back { max-width: 360px; margin: 20px auto 0; display: block; min-height: 46px; }
.match-cta-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.match-cta-grid--result { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.match-cta-grid button, .match-cta-grid a { min-height: 50px; margin-top: 0; padding: 9px 12px; display: grid; place-items: center; text-align: center; text-decoration: none; line-height: 1.35; word-break: keep-all; }
.cta-span2 { grid-column: 1 / -1; }
.connection-note { margin-top: 12px; color: var(--ink-muted); font-size: 10px; text-align: center; }

.court-screen { padding-bottom: clamp(34px, 6vw, 70px); }
.court-role-hero { border-bottom: 3px double rgba(117, 83, 51, .62); }
.court-actions { padding: 28px clamp(24px, 5vw, 62px) 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.court-actions--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.court-actions--with-app { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.court-actions .flow-primary, .court-actions .flow-secondary { min-height: 48px; margin-top: 0; display: grid; place-items: center; text-decoration: none; }
.court-leaderboard { margin: 44px clamp(24px, 5vw, 62px) 0; }
.court-leaderboard .quiet-label { display: block; margin-bottom: 7px; color: var(--jade); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.court-screen > .connection-note { margin: 16px 24px 0; }

.pillar-compare { min-width: 0; margin-top: 42px; }
.pillar-compare > h3, .compatibility-graph > h3 { margin: 0 0 14px; font-size: 22px; }
.pillar-ledger-wrap { width: 100%; min-width: 0; overflow: hidden; border: 3px double #755333; background: rgba(255, 246, 214, .28); }
.pillar-ledger { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; }
.pillar-ledger th, .pillar-ledger td { height: 58px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 850; word-break: keep-all; }
.pillar-ledger tr > *:last-child { border-right: 0; }
.pillar-ledger tbody tr:last-child > * { border-bottom: 0; }
.pillar-ledger thead th { height: 48px; color: var(--paper-ink); }
.pillar-ledger thead th:nth-child(2), .pillar-ledger tbody th { width: 22%; color: var(--ink-muted); letter-spacing: .02em; }
.pillar-ledger tbody td { color: var(--jade); }
.pillar-repair-list:empty { display: none; }
.pillar-repair-note { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 10px; font-weight: 800; }
.pillar-repair-note span { flex: 1; }
.pillar-repair-note small { font-size: 9px; }
.pillar-repair-note button { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 2px outset #c3a471; background: #ead39b; color: #342315; font: inherit; cursor: pointer; }
.pillar-repair-note button:active { border-style: inset; }
.detail-webapp-link { display: block; width: fit-content; margin: 18px auto 0; }
.pillar-repair-screen .flow-copy p { max-width: 28ch; }

.compatibility-graph { margin-top: 38px; padding: 24px; border: 3px double #755333; background: rgba(255, 246, 214, .28); }
.score-columns { height: 250px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2.4vw, 28px); align-items: end; padding-top: 8px; border-bottom: 1px solid rgba(117, 83, 51, .28); }
.score-column { min-width: 0; height: 100%; display: grid; grid-template-rows: 28px minmax(0, 1fr) 48px; align-items: end; text-align: center; }
.score-column strong { align-self: start; color: var(--jade); font-size: 16px; line-height: 1; }
.score-column i { width: min(78%, 92px); height: 100%; display: flex; align-items: flex-end; justify-self: center; border: 1px solid rgba(117, 83, 51, .34); border-bottom: 0; background: rgba(117, 83, 51, .08); overflow: hidden; }
.score-column i b { width: 100%; display: block; background: var(--red); box-shadow: inset 3px 0 0 rgba(255,255,255,.08); transform-origin: bottom; }
.score-column span { align-self: center; color: var(--ink-soft); font-size: 12px; font-weight: 850; line-height: 1.25; word-break: keep-all; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 220;
  max-width: min(calc(100% - 32px), 440px);
  padding: 13px 18px;
  transform: translate(-50%, 20px);
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 15px 45px rgba(0,0,0,.36);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-title { display: none; }
  .hero { grid-template-columns: 1fr; padding-left: 28px; padding-right: 28px; }
  .hero h1 { max-width: 820px; }
  .hero-art { min-height: 620px; }
  .hero-art img { min-height: 620px; }
  .bento-grid { grid-template-columns: repeat(10, 1fr); grid-template-rows: auto auto; }
  .bento-main { grid-column: span 6; }
  .bento-side { grid-column: span 4; }
  .match-cta-grid--result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .court-actions { grid-template-columns: 1fr 1fr; }
  .formula-section { grid-template-columns: 1fr; }
  .formula-intro { position: static; }
  .roles-section { grid-template-columns: 1fr; min-height: auto; }
  .roles-pin { position: static; }
  .roles-gallery { margin-top: 30px; }
  .role-card { transform: none; opacity: 1; }
  .flow-screen--split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { top: max(10px, env(safe-area-inset-top)); width: calc(100% - 20px); min-height: 56px; padding-left: 12px; }
  .auth-state { display: none; }
  .text-button { min-height: 38px; padding: 0 13px; }
  .hero { min-height: auto; padding: calc(104px + env(safe-area-inset-top)) 20px 48px; gap: 38px; }
  .hero h1 { font-size: clamp(2.15rem, 8.8vw, 2.8rem); line-height: 1; }
  .hero-lead { font-size: 15px; }
  .hero-actions { display: grid; }
  .hero-actions > * { width: 100%; }
  .hero-art, .hero-art img { min-height: 390px; }
  .hero-art img { object-position: 63% 50%; }
  .hero-art-caption { left: 18px; right: 18px; bottom: 18px; align-items: start; flex-direction: column; }
  .hero-art-caption strong { text-align: left; }
  .interest-section, .formula-section, .roles-section, .action-section { width: calc(100% - 32px); padding: 86px 0; }
  .chapter-heading h2, .formula-intro h2, .roles-pin h2, .action-section h2 { font-size: clamp(2.25rem, 11vw, 4.3rem); }
  html:not([lang="ko"]) .chapter-heading h2,
  html:not([lang="ko"]) .formula-intro h2,
  html:not([lang="ko"]) .roles-pin h2,
  html:not([lang="ko"]) .action-section h2 {
    font-size: clamp(2rem, 9vw, 3.35rem);
    line-height: 1.13;
    letter-spacing: -.035em;
  }
  .bento-grid { min-height: 0; display: block; }
  .bento-main, .bento-side { min-height: auto; border: 0; border-bottom: 1px solid var(--line); }
  .bento-main { padding: 28px 22px; }
  .bento-side { padding: 28px 22px; }
  .rank-preview { margin-top: 34px; }
  .rank-row { grid-template-columns: 24px 48px 1fr auto; gap: 10px; }
  .rank-row .role-sprite { width: 48px; }
  .formula-accordion { min-height: auto; display: block; }
  .formula-item, .formula-item.is-open { width: 100%; min-height: 96px; padding: 22px; grid-template-columns: 1fr auto; grid-template-rows: auto auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .formula-item span, .formula-item.is-open span { writing-mode: horizontal-tb; }
  .formula-item strong { margin: 0; font-size: 32px; }
  .formula-item p { grid-column: 1 / -1; margin: 10px 0 0; display: none; }
  .formula-item.is-open p { display: block; }
  .roles-gallery { width: 100%; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .roles-gallery::-webkit-scrollbar { display: none; }
  .role-card { min-height: 390px; flex: 0 0 min(78vw, 310px); margin-top: 0 !important; scroll-snap-align: start; }
  .site-footer { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 20px; }
  .site-footer nav { justify-content: flex-start; }
  /* 모바일은 팝업 전체를 단일 스크롤 면으로 사용합니다.
     바깥 레이어와 본문 스크롤이 경합해 첫 스와이프가 사라지던 문제를 막습니다. */
  .experience {
    height: 100dvh;
    padding: 0;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .experience-panel { width: 100%; height: auto; max-height: none; min-height: 100dvh; overflow: visible; border: 0; }
  .experience-header {
    position: sticky;
    top: 0;
    z-index: 12;
    min-height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .experience-progress {
    position: sticky;
    top: calc(64px + env(safe-area-inset-top));
    z-index: 11;
    flex: 0 0 auto;
  }
  /* 앱 WebView는 네이티브 헤더가 웹 헤더를 대신하므로 진행바를
     WebView 콘텐츠의 최상단에 붙인다. */
  html[data-dasoni-payment-context="app"] .experience-progress {
    top: 0;
  }
  .experience-body {
    max-height: none;
    flex: 1 0 auto;
    overflow: visible;
    overscroll-behavior: auto;
    touch-action: auto;
    -webkit-overflow-scrolling: auto;
  }
  .flow-screen { min-height: calc(100svh - 67px - env(safe-area-inset-top)); padding: 24px 18px calc(36px + env(safe-area-inset-bottom)); }
  .flow-screen--split { align-content: start; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .field input, .field select { font-size: 16px; }
  .time-period { width: 96px; padding-inline: 4px !important; font-size: 12px !important; }
  .picker-input-shell { grid-template-columns: minmax(0, 1fr) 49px; }
  .time-input-shell { grid-template-columns: minmax(0, 1fr) 96px 49px; }
  .picker-button, .field .native-date-picker, .field .native-time-picker { width: 49px; min-width: 49px; }
  .relationship-options { grid-template-columns: 1fr 1fr; }
  .role-result-hero { grid-template-columns: 1fr; }
  .result-portrait { min-height: min(42svh, 340px); }
  .result-copy { padding: 28px 20px calc(38px + env(safe-area-inset-bottom)); }
  .role-basis { margin-top: 24px; }
  .role-basis-head { min-height: 58px; align-items: center; }
  .role-basis-head h3 { font-size: 22px; }
  .role-basis li { min-height: 64px; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding: 14px 4px; }
  .role-basis li i { width: 8px; height: 8px; }
  .role-basis li span { font-size: 15px; line-height: 1.65; }
  .result-actions { grid-template-columns: 1fr; }
  .role-share-actions { grid-template-columns: 1fr; }
  .match-result { padding: 30px 18px 50px; }
  .owner-detail { overflow-x: hidden; padding-left: 28px; padding-right: 28px; }
  .match-pair { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); gap: 6px; }
  .pair-person .role-sprite { width: min(100%, 124px); }
  .pair-person strong { font-size: 14px; }
  .score-seal { width: 76px; height: 76px; box-shadow: inset 0 0 0 5px rgba(255,255,255,.05); }
  .score-seal strong { font-size: 31px; }
  .score-seal span { max-width: 66px; margin-top: 4px; font-size: 8px; line-height: 1.15; }
  .match-title { margin-top: 28px; }
  .match-title h2 { font-size: 26px; line-height: 1.18; }
  .match-title p { margin-top: 9px; font-size: 14px; }
  .match-rank { display: flex; width: fit-content; margin: 8px auto 0; }
  .component-grid { grid-template-columns: 1fr 1fr; }
  .component-card { min-height: 128px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .component-card:nth-child(2) { border-right: 0; }
  .component-card:nth-child(n+3) { border-bottom: 0; }
  .component-card:last-child { border-right: 0; }
  .match-cta-grid { grid-template-columns: 1fr; }
  .match-cta-grid--result { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .match-cta-grid--result button, .match-cta-grid--result a { min-height: 48px; padding: 9px 7px; font-size: 12.5px; }
  .court-actions, .court-actions--compact { padding: 20px 18px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .court-actions--with-app > [data-open-dasoni-app]:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .court-actions .flow-primary, .court-actions .flow-secondary { min-height: 66px; padding: 10px 8px; font-size: 13px; line-height: 1.35; text-align: center; word-break: keep-all; }
  .court-leaderboard { margin: 34px 18px 0; }
  .leaderboard-head { align-items: flex-end; gap: 10px; }
  .leaderboard-head h3 { font-size: 22px; }
  .leaderboard-tools { flex-direction: column; align-items: flex-end; gap: 5px; }
  .leaderboard-refresh { min-height: 32px; padding: 0 10px; }
  .pillar-compare { margin-top: 30px; }
  .pillar-compare > h3 { font-size: 20px; }
  .pillar-ledger th, .pillar-ledger td { height: 50px; padding: 7px 5px; font-size: 15px; }
  .pillar-ledger thead th { height: 44px; }
  .pillar-ledger thead th:nth-child(2), .pillar-ledger tbody th { width: 20%; }
  .pillar-repair-note { align-items: flex-start; flex-direction: column; }
  .pillar-repair-note button { width: 100%; }
  .compatibility-graph { padding: 19px 14px; }
  .compatibility-graph > h3 { font-size: 20px; }
  .score-columns { height: 230px; gap: 8px; }
  .score-column { grid-template-rows: 26px minmax(0, 1fr) 48px; }
  .score-column strong { font-size: 15px; }
  .score-column i { width: min(74%, 62px); }
  .score-column span { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .role-card { transform: none; opacity: 1; }
}

/* ── 다소니 브릿지 카드 — 궁합(고정)→채움 지수(성장) 핸드오프 (2026-07-19) ── */
.next-bridge {
  position: relative;
  margin: 26px 0 4px;
  padding: 20px 18px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1c3143, #14202a 70%);
  color: var(--paper);
  box-shadow: 0 16px 34px rgba(65, 37, 22, .30);
}
.bridge-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  padding: 3px 9px;
  border-radius: 100px;
  background: #ff5c39;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}
.bridge-over { display: block; margin-bottom: 6px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.next-bridge h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; line-height: 1.3; }
.next-bridge h3 em { font-style: normal; color: var(--gold); }
.bridge-sub { margin: 7px 0 0; color: #c3cdc9; font-size: 13px; line-height: 1.6; }
.bridge-sub b { color: var(--gold); }
.bridge-visual {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(244, 234, 210, .08);
}
.bridge-stamp {
  flex: none;
  width: 46px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--red);
  border-radius: 11px;
  transform: rotate(-3deg);
}
.bridge-stamp strong { color: #e0917f; font-size: 16px; font-weight: 900; line-height: 1; }
.bridge-stamp i { color: #c98d80; font-style: normal; font-size: 8px; }
.bridge-arrow { flex: none; color: var(--gold); font-size: 16px; }
.bridge-ring {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bridge-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.bridge-ring b { position: relative; color: #ff9ab8; font-size: 10.5px; font-weight: 900; }
.bridge-ring-fill { animation: bridgeRingGrow 3.8s cubic-bezier(.4, 0, .2, 1) infinite .8s; }
@keyframes bridgeRingGrow {
  0% { stroke-dashoffset: 106.8; }
  45% { stroke-dashoffset: 57.7; }
  62% { stroke-dashoffset: 57.7; }
  100% { stroke-dashoffset: 106.8; }
}
.bridge-visual p { margin: 0; color: #c3cdc9; font-size: 11.5px; line-height: 1.55; }
.bridge-visual p b { color: #ff9ab8; }
.bridge-cta {
  display: block;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 100px;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}
.bridge-cta:active { transform: scale(.985); }
.bridge-trust { display: block; margin-top: 9px; text-align: center; color: #8ea0a6; font-size: 10.5px; }
