:root {
  --paper: #f3efe6;
  --paper-deep: #e9e2d5;
  --paper-warm: #ded4c4;
  --ink: #211e19;
  --ink-soft: #514a42;
  --muted: #6e655c;
  --gold: #855f25;
  --rose: #8f5551;
  --line: #d5ccbd;
  --line-strong: #bfb29f;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --latin: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --page-pad: clamp(28px, 7vw, 92px);
  --ease: cubic-bezier(.22, .72, .28, 1);
}

* { box-sizing: border-box; }

html { background: #cec7bb; }

body {
  margin: 0;
  color: var(--ink);
  background: #cec7bb;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
}

button { font: inherit; }

button,
[role="button"] { touch-action: manipulation; }

button:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

.app {
  position: relative;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 var(--page-pad) 32px;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(74, 62, 48, .018) 0, rgba(74, 62, 48, .018) 1px, transparent 1px, transparent 5px),
    linear-gradient(90deg, rgba(255,255,255,.2), transparent 18%, transparent 82%, rgba(108,91,68,.035));
  box-shadow: 0 0 40px rgba(45, 37, 28, .08);
}

.site-header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(213, 204, 189, .8);
}

.logo {
  color: var(--gold);
  font: 600 11px/1 var(--latin);
  letter-spacing: .34em;
}

.logo span { letter-spacing: .08em; }

.header-link {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  background: none;
  font-size: 12px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}

.header-link:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.screen {
  display: none;
  min-height: calc(100dvh - 118px);
  padding: clamp(48px, 7vh, 76px) 0;
}

.screen.active {
  display: block;
  animation: page-enter 420ms var(--ease) both;
}

.kicker {
  margin: 0 0 16px;
  color: var(--rose);
  font: 600 11px/1.4 var(--latin);
  letter-spacing: .3em;
  text-transform: uppercase;
}

.hero {
  min-height: 555px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  align-items: center;
  gap: clamp(32px, 6vw, 76px);
}

.hero-copy { position: relative; z-index: 1; }

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(66px, 8.2vw, 102px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: .035em;
}

.hero h1 b {
  display: block;
  margin-top: .12em;
  color: var(--gold);
  font-size: .76em;
  font-weight: 400;
}

.subtitle {
  margin: 25px 0 25px;
  color: var(--muted);
  font: 400 16px/1.4 var(--latin);
  letter-spacing: .28em;
}

.lede {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 19px;
  letter-spacing: .08em;
}

.primary,
.secondary,
.tertiary {
  min-height: 48px;
  padding: 13px 23px;
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .08em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary {
  border: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.primary:hover { background: #363129; }

.primary span { margin-left: 20px; }

.secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: rgba(255,255,255,.14);
}

.secondary:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.tertiary {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
}

.primary:active,
.secondary:active,
.tertiary:active { transform: translateY(1px); }

.primary:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: .58;
}

.seal {
  position: relative;
  height: 430px;
  display: grid;
  place-items: center;
}

.seal::before,
.seal::after {
  content: "";
  position: absolute;
  z-index: 0;
  background: rgba(164, 129, 63, .24);
}

.seal::before {
  width: 1px;
  height: 92%;
}

.seal::after {
  width: 92%;
  height: 1px;
}

.seal strong {
  z-index: 2;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  color: var(--paper);
  background: var(--gold);
  box-shadow: 0 0 0 10px var(--paper), 0 0 0 11px rgba(164,129,63,.45);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
}

.seal small {
  position: absolute;
  z-index: 2;
  bottom: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--paper);
  font: 600 10px/1 var(--latin);
  letter-spacing: .25em;
}

.ring {
  position: absolute;
  z-index: 1;
  aspect-ratio: 1;
  border: 1px solid rgba(164, 129, 63, .34);
  border-radius: 50%;
}

.r1 { width: 94%; }
.r2 { width: 70%; }
.r3 { width: 46%; }

.index-head {
  margin-top: 22px;
  padding: 19px 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line-strong);
}

.index-head span { font-size: 18px; }

.index-head i {
  color: var(--muted);
  font: 400 11px/1 var(--latin);
  letter-spacing: .04em;
}

.authors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.author {
  min-height: 102px;
  padding: 17px 17px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms ease;
}

.author:hover { background: rgba(233,226,213,.65); }

.author b {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.author em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 400 12px/1.3 var(--latin);
}

.author small {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: 11px;
}

.home-foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}

.quiz-top {
  position: relative;
  padding-bottom: 19px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.quiz-top b {
  color: var(--gold);
  font: 600 12px/1 var(--latin);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.quiz-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  overflow: hidden;
}

.quiz-progress span {
  display: block;
  width: 5%;
  height: 100%;
  background: var(--rose);
  transition: width 360ms var(--ease);
}

.question {
  width: min(820px, 100%);
  margin: clamp(72px, 11vh, 112px) auto clamp(54px, 8vh, 80px);
}

.question h2 {
  margin: 0 0 20px;
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .025em;
}

.question > p:not(.kicker) {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.options {
  margin-top: 35px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option {
  min-height: 82px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255,255,255,.18);
  text-align: left;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  cursor: pointer;
  transition: transform 160ms ease, color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.option b { font-weight: 400; }

.option span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(164,129,63,.55);
  border-radius: 50%;
  color: var(--gold);
  font: 600 11px/1 var(--latin);
}

.option:hover,
.option.selected {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.option:hover span,
.option.selected span {
  color: var(--paper);
  border-color: rgba(243,239,230,.55);
}

.quiz-nav {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.quiz-nav button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.quiz-nav button:disabled {
  cursor: default;
  opacity: .35;
}

.result-hero {
  position: relative;
  min-height: 420px;
  padding: 70px min(4vw, 44px) 62px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
}

.result-hero::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 0;
  width: 3px;
  background: var(--rose);
}

.result-hero h2 {
  max-width: 70%;
  margin: 10px 0 8px;
  font-size: clamp(64px, 8vw, 92px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .03em;
}

.result-hero .latin {
  margin: 0;
  color: var(--muted);
  font: 400 12px/1.4 var(--latin);
  letter-spacing: .3em;
}

.result-hero > p:not(.kicker):not(.latin) {
  margin: 6px 0 0;
  color: var(--muted);
  font: 400 15px/1.5 var(--latin);
  letter-spacing: .12em;
}

.result-stamp {
  position: absolute;
  top: 92px;
  right: 5%;
  width: 164px;
  height: 164px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(164,129,63,.62);
  border-radius: 50%;
  box-shadow: 0 0 0 13px var(--paper), 0 0 0 14px rgba(164,129,63,.35);
  color: var(--muted);
}

.result-stamp::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(164,129,63,.45);
  border-radius: 50%;
}

.result-stamp span {
  z-index: 1;
  font: 600 10px/1 var(--latin);
  letter-spacing: .2em;
}

.result-stamp b {
  z-index: 1;
  margin-top: 9px;
  color: var(--gold);
  font: 400 42px/1 var(--latin);
  font-variant-numeric: tabular-nums;
}

.result-intro {
  margin: 62px 0;
  padding: 34px 2px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  column-gap: clamp(42px, 7vw, 86px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-intro > p {
  grid-row: 1 / 3;
  margin: 0;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.9;
}

.result-intro blockquote {
  position: relative;
  margin: 0;
  padding-left: 30px;
  color: var(--ink);
  font-size: clamp(23px, 2.7vw, 31px);
  line-height: 1.65;
}

.result-intro blockquote::before {
  content: "“";
  position: absolute;
  top: -19px;
  left: 0;
  color: var(--gold);
  font: 400 52px/1 var(--latin);
}

.result-intro small {
  padding: 12px 0 0 30px;
  color: var(--muted);
  font-size: 12px;
}

.result-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr);
  gap: clamp(44px, 7vw, 78px);
}

.result-cols article > p:not(.kicker),
.family > p:not(.kicker),
.books span {
  color: var(--ink-soft);
  line-height: 1.95;
}

.result-cols h3 {
  margin: 0 0 18px;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.55;
}

.dna {
  margin-top: 38px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.dna span {
  margin: 0 8px 9px 0;
  padding: 7px 12px;
  display: inline-block;
  border: 1px solid rgba(164,129,63,.72);
  border-radius: 2px;
  color: var(--gold);
  font-size: 12px;
}

.result-cols aside {
  padding-left: clamp(24px, 4vw, 46px);
  border-left: 1px solid var(--line);
}

.grid polygon {
  fill: none;
  stroke: #d1c5b3;
  stroke-width: 1;
}

.labels text {
  fill: var(--muted);
  font-family: var(--serif);
  font-size: 10px;
  text-anchor: middle;
}

.result-cols svg {
  width: 100%;
  max-width: 350px;
  display: block;
  margin: 0 auto;
}

.result-cols #radar {
  fill: rgba(155,98,93,.16);
  stroke: var(--rose);
  stroke-width: 2;
}

.trait-list {
  margin-top: 4px;
  display: grid;
  gap: 7px;
}

.trait-list div {
  padding-bottom: 7px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted rgba(191,178,159,.72);
  color: var(--muted);
  font-size: 12px;
}

.trait-list b {
  color: var(--ink);
  font-family: var(--latin);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.family,
.books { margin-top: 68px; }

.family-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}

.family-card {
  min-height: 220px;
  padding: 22px 22px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.family-card:last-child { border-right: 0; }

.family-card b {
  display: block;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}

.family-card small {
  display: block;
  margin: 7px 0 14px;
  color: var(--rose);
  font-size: 11px;
}

.family-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.85;
}

.family-card strong {
  display: block;
  margin-top: 16px;
  color: var(--gold);
  font: 400 24px/1 var(--latin);
  text-align: right;
}

.books > div {
  padding: 17px 0;
  display: grid;
  grid-template-columns: minmax(190px, 230px) 1fr;
  gap: 28px;
  border-top: 1px solid var(--line);
}

.books > div:last-child { border-bottom: 1px solid var(--line); }

.books b { font-weight: 500; }

.books span { font-size: 13px; }

.result-actions {
  margin-top: 52px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

footer {
  padding-top: 30px;
  color: #a79b8e;
  font: 600 10px/1 var(--latin);
  letter-spacing: .3em;
  text-align: center;
}

dialog {
  color: var(--ink);
  font-family: var(--serif);
}

dialog::backdrop {
  background: rgba(32, 28, 23, .68);
  backdrop-filter: blur(3px);
}

.about-dialog,
.share-dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.about-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
}

.about-dialog[open],
.share-dialog[open] {
  display: grid;
  place-items: center;
}

.about-dialog__panel {
  width: min(90vw, 540px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 24px 70px rgba(42,34,25,.25);
}

.dialog-head {
  padding: 22px 24px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.dialog-head .kicker { margin-bottom: 8px; }

.dialog-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
}

.dialog-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font: 400 28px/1 var(--latin);
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.about-dialog__body {
  padding: 25px 24px 28px;
  color: var(--ink-soft);
}

.about-dialog__body p {
  margin: 0;
  line-height: 1.95;
}

.about-dialog__body p + p { margin-top: 14px; }

.share-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
}

.share-dialog__panel {
  width: min(92vw, 660px);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(42,34,25,.28);
}

.share-preview {
  min-height: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #d5cdc0;
}

.share-preview img {
  width: min(100%, 390px);
  height: auto;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: contain;
  background: var(--paper);
  box-shadow: 0 16px 38px rgba(45,36,27,.2);
  user-select: none;
  -webkit-user-select: none;
}

.share-status {
  margin: 0;
  padding: 12px 24px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.share-dialog__actions {
  padding: 16px 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.share-dialog__actions button { min-height: 44px; }

.share-dialog-open { overflow: hidden; }

@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  :root { --page-pad: 24px; }

  .authors { grid-template-columns: repeat(2, 1fr); }

  .hero {
    min-height: 540px;
    grid-template-columns: 1fr minmax(230px, .72fr);
    gap: 10px;
  }

  .hero h1 { font-size: clamp(58px, 11vw, 78px); }

  .seal { height: 300px; }

  .result-cols { grid-template-columns: 1fr; }

  .result-cols aside {
    padding: 30px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  :root { --page-pad: 16px; }

  html,
  body { background: var(--paper); }

  body { font-size: 16px; }

  .app {
    width: 100%;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .site-header { height: 62px; }

  .logo {
    font-size: 10px;
    letter-spacing: .25em;
  }

  .header-link { font-size: 12px; }

  .screen {
    min-height: calc(100dvh - 94px);
    padding: 34px 0;
  }

  .hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .hero-copy { order: 1; }

  .hero h1 {
    max-width: 360px;
    font-size: clamp(54px, 16vw, 70px);
    line-height: 1.02;
    letter-spacing: .015em;
  }

  .hero h1 b { margin-top: .08em; }

  .subtitle {
    margin: 18px 0 19px;
    font-size: 12px;
    letter-spacing: .23em;
  }

  .lede {
    margin-bottom: 22px;
    font-size: 16px;
    letter-spacing: .035em;
  }

  .hero .primary { width: 150px; }

  .seal {
    order: 2;
    height: 178px;
    margin: 9px 0 5px;
  }

  .seal::before { height: 150px; }

  .seal::after { width: 260px; }

  .seal strong {
    width: 72px;
    height: 72px;
    font-size: 40px;
    box-shadow: 0 0 0 7px var(--paper), 0 0 0 8px rgba(164,129,63,.45);
  }

  .seal small {
    bottom: 3px;
    font-size: 8px;
  }

  .r1 { width: 164px; }
  .r2 { width: 124px; }
  .r3 { width: 88px; }

  .index-head {
    margin-top: 20px;
    padding-top: 16px;
  }

  .index-head span { font-size: 16px; }

  .index-head i { font-size: 9px; }

  .author {
    min-height: 92px;
    padding: 13px 10px 12px;
  }

  .author b { font-size: 14px; }
  .author em { font-size: 10px; }
  .author small { font-size: 10px; }

  .home-foot { font-size: 10px; }

  .question {
    margin: 66px auto 58px;
  }

  .question h2 {
    font-size: 31px;
    line-height: 1.35;
  }

  .question > p:not(.kicker) {
    font-size: 14px;
    line-height: 1.75;
  }

  .options {
    margin-top: 27px;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .option {
    min-height: 72px;
    padding: 14px;
    font-size: 15px;
  }

  .quiz-nav {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: rgba(243,239,230,.96);
  }

  .quiz-nav span {
    max-width: 66%;
    text-align: right;
  }

  .result-hero {
    min-height: 0;
    padding: 44px 17px 38px;
  }

  .result-hero::before {
    top: 20px;
    bottom: 20px;
  }

  .result-hero h2 {
    max-width: 100%;
    margin-top: 9px;
    font-size: clamp(52px, 16vw, 70px);
  }

  .result-hero > p:not(.kicker):not(.latin) {
    font-size: 13px;
  }

  .result-stamp {
    position: relative;
    top: auto;
    right: auto;
    width: 112px;
    height: 112px;
    margin: 35px 0 0 auto;
    box-shadow: 0 0 0 8px var(--paper), 0 0 0 9px rgba(164,129,63,.35);
  }

  .result-stamp::before { inset: 13px; }

  .result-stamp b { font-size: 31px; }

  .result-intro {
    margin: 38px 0 44px;
    padding: 27px 2px;
    display: block;
  }

  .result-intro > p {
    font-size: 17px;
    line-height: 1.85;
  }

  .result-intro blockquote {
    margin-top: 28px;
    padding-left: 25px;
    font-size: 21px;
  }

  .result-intro small {
    display: block;
    padding-left: 25px;
  }

  .result-cols { gap: 28px; }

  .result-cols h3 { font-size: 23px; }

  .family,
  .books { margin-top: 48px; }

  .family-list { grid-template-columns: 1fr; }

  .family-card {
    min-height: 0;
    border-right: 0;
  }

  .books > div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 14px 0;
  }

  .result-actions {
    margin-top: 38px;
    flex-direction: column;
    gap: 8px;
  }

  .result-actions button { width: 100%; }

  .dialog-head { padding: 17px 16px 14px; }

  .dialog-head h2 { font-size: 21px; }

  .about-dialog__panel { width: calc(100% - 24px); }

  .about-dialog__body { padding: 21px 17px 24px; }

  .share-dialog__panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .share-preview {
    padding: 14px;
    align-content: center;
  }

  .share-preview img {
    width: min(100%, 410px);
    max-height: calc(100dvh - 244px);
  }

  .share-status { padding: 10px 16px 0; }

  .share-dialog__actions {
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr;
  }

  .share-dialog__actions:has(#systemShareBtn:not([hidden])) {
    grid-template-columns: 1fr 1fr;
  }

  .share-dialog__actions button { width: 100%; }
}


/* Author portrait system */
.author {
  min-height: 122px;
  padding: 15px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.author-portrait {
  width: 56px;
  height: 70px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(133,95,37,.34);
  clip-path: polygon(2% 3%, 97% 0, 100% 96%, 4% 100%);
  filter: sepia(.06) saturate(.88) contrast(1.02);
  transform: rotate(-.55deg);
}

.author:nth-child(4n+2) .author-portrait,
.author:nth-child(4n+3) .author-portrait { transform: rotate(.55deg); }

.author-copy { min-width: 0; }

.author-copy b,
.author-copy em,
.author-copy small { overflow-wrap: anywhere; }

.result-hero {
  min-height: 500px;
  padding: 54px min(4vw, 44px) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  align-items: center;
  gap: clamp(40px, 6vw, 76px);
}

.result-identity { min-width: 0; }

.result-hero h2 {
  max-width: none;
  font-size: clamp(52px, 7vw, 82px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.result-identity > p:not(.kicker):not(.latin) {
  margin: 6px 0 0;
  color: var(--muted);
  font: 400 15px/1.5 var(--latin);
  letter-spacing: .12em;
}

.result-portrait {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0;
  justify-self: end;
}

.result-portrait__image {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
  box-shadow: 12px 14px 0 rgba(133,95,37,.08);
  transform: rotate(.65deg);
}

.result-portrait__image::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(243,239,230,.48);
  pointer-events: none;
}

.result-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: sepia(.04) saturate(.92) contrast(1.02);
}

.result-portrait figcaption {
  margin-top: 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font: 600 9px/1.3 var(--latin);
  letter-spacing: .14em;
}

.result-portrait figcaption b {
  color: var(--rose);
  font-weight: 600;
}

.result-portrait .result-stamp {
  top: auto;
  right: auto;
  bottom: 20px;
  left: -70px;
  width: 132px;
  height: 132px;
  background: rgba(243,239,230,.94);
  box-shadow: 0 0 0 9px rgba(243,239,230,.88), 0 0 0 10px rgba(164,129,63,.35);
  transform: rotate(-7deg);
}

.result-portrait .result-stamp::before { inset: 15px; }
.result-portrait .result-stamp b { font-size: 34px; }

.family-card__head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.family-card__head img {
  width: 54px;
  height: 68px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(133,95,37,.34);
  clip-path: polygon(2% 3%, 97% 0, 100% 96%, 4% 100%);
  filter: sepia(.06) saturate(.88) contrast(1.02);
}

.family-card__head small { margin-bottom: 0; }
.family-card > p { margin-top: 16px; }

@media (max-width: 820px) {
  .result-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: 36px;
  }

  .result-portrait .result-stamp {
    left: -45px;
    width: 116px;
    height: 116px;
  }
}

@media (max-width: 620px) {
  .author {
    min-height: 106px;
    padding: 12px 9px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
  }

  .author-portrait { width: 42px; height: 53px; }
  .author b { font-size: 12px; line-height: 1.42; }
  .author em { margin-top: 4px; font-size: 9px; }
  .author small { font-size: 9px; line-height: 1.4; }

  .result-hero {
    padding: 38px 17px 42px;
    display: block;
  }

  .result-hero h2 {
    margin-top: 10px;
    font-size: clamp(40px, 12vw, 58px);
    line-height: 1.08;
  }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}