body {
  min-height: 100vh;
  --paper: rgba(24, 18, 14, 0.92);
  --ink: #f6efe4;
  --ink-soft: #d2c3ae;
  --line: rgba(214, 184, 122, 0.28);
  --line-strong: rgba(214, 184, 122, 0.62);
  --seal: #e07a5f;
  --desk: #100e0c;
  background-color: #100e0c;
  background-image: linear-gradient(180deg, rgba(16, 14, 12, 0.42), rgba(16, 14, 12, 0.78)), var(--hero, none);
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
.desk {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}
.sheet {
  width: min(440px, 100%);
  margin: auto 0;
  background: rgba(24, 18, 14, 0.9);
  border: 1px solid rgba(214, 184, 122, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 0 28px 36px;
  position: relative;
  overflow: hidden;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 184, 122, 0.28);
  pointer-events: none;
}
.hero {
  width: calc(100% + 56px);
  height: 176px;
  margin: 0 -28px 18px;
  object-fit: cover;
  display: block;
}
.hero-thin { height: 108px; }
.emblem {
  width: 86px;
  height: 86px;
  margin: 0 auto 8px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(214, 184, 122, 0.8);
}
.panel { position: relative; padding-top: 22px; }
.panel:has(.hero) { padding-top: 0; }
.eyebrow, .mark {
  margin: 0;
  text-align: center;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  font-size: 12px;
  color: var(--ink-soft);
}
.seal {
  width: 68px;
  height: 68px;
  margin: 22px auto 8px;
  display: grid;
  place-items: center;
  color: var(--seal);
  border: 2px solid var(--seal);
  font-family: var(--kai);
  font-size: 34px;
  line-height: 1;
  transform: rotate(-8deg);
}
h1, h2, h3 { font-family: var(--kai); font-weight: 500; letter-spacing: 0.08em; }
h1 { margin: 8px 0 0; text-align: center; font-size: 40px; line-height: 1.2; }
h2 { margin: 0; font-size: 28px; line-height: 1.35; }
.lead, .note, .hint { color: var(--ink-soft); font-size: 15px; }
.lead { text-align: center; margin: 14px 0 0; }
.center { text-align: center; }
.rule { height: 1px; margin: 22px 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); border: 0; }
.points { margin: 0; padding: 0; list-style: none; }
.points li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.points li:last-child { border-bottom: 1px solid var(--line); }
.field { margin: 22px 0 8px; }
.field input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 22px;
  padding: 10px 0 8px;
  border-radius: 0;
}
.field input::placeholder { letter-spacing: 0.3em; color: #b3aa9e; }
.btn, .choice, .nav-btn {
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 0;
}
.btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: #8d342c;
  color: #f6efe4;
  border-color: #e2c48a;
}
.btn.ghost, .nav-btn { background: transparent; color: var(--ink); letter-spacing: 0.18em; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.error { min-height: 1.4em; color: var(--seal); text-align: center; font-size: 14px; }
.pref { display: grid; gap: 10px; margin-top: 18px; }
.choice {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
}
.choice b { display: block; font-weight: 500; letter-spacing: 0.08em; }
.choice b { color: var(--ink); font-size: 17px; font-weight: 500; }
.choice span { color: var(--ink-soft); font-size: 14px; }
.answers .choice span { color: var(--ink); font-size: 16px; }
.choice .mark-char {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--seal);
  font-family: var(--kai);
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}
.choice.selected { background: rgba(214, 184, 122, 0.16); border-color: #e2c48a; }
.field input { color: #f6efe4; }
.toast { background: #f6efe4; color: #1a1410; }
.q-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--ink-soft); font-size: 14px; }
.q-top b { color: var(--ink); font-weight: 500; letter-spacing: 0.12em; }
.track { height: 1px; background: var(--line); margin: 10px 0 22px; }
.track i { display: block; height: 2px; background: var(--ink); width: 0; margin-top: -1px; }
.q-text { font-size: 22px; min-height: 4.2em; }
.answers { display: grid; gap: 10px; }
.hint { min-height: 1.5em; margin: 12px 0; }
.qnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-btn { padding: 11px 8px; }
.result-kicker { text-align: center; letter-spacing: 0.32em; color: var(--ink-soft); font-size: 13px; margin: 0; }
.result-name { text-align: center; font-family: var(--kai); font-size: 46px; margin: 8px 0 0; line-height: 1.15; }
.meta { text-align: center; color: var(--ink-soft); margin: 6px 0 0; }
.near {
  width: 92px;
  margin: 16px auto 0;
  padding: 8px 0 6px;
  text-align: center;
  color: var(--seal);
  border: 2px solid var(--seal);
}
.near b { display: block; font-family: var(--kai); font-size: 32px; line-height: 1; font-weight: 500; }
.near span { font-size: 12px; letter-spacing: 0.22em; }
.quote { text-align: center; font-family: var(--kai); font-size: 18px; margin: 16px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag { border: 1px solid var(--line-strong); padding: 2px 8px; font-size: 13px; color: var(--ink-soft); }
.section-title {
  margin: 22px 0 8px;
  font-family: var(--kai);
  font-size: 20px;
  letter-spacing: 0.14em;
}
.dim { display: grid; grid-template-columns: 3.2em 1fr 2.6em; gap: 8px; align-items: center; margin: 7px 0; font-size: 14px; }
.dim .bar { height: 1px; background: var(--line-strong); }
.dim .bar i { display: block; height: 3px; background: var(--ink); margin-top: -1px; }
.cards { display: grid; gap: 10px; }
.card { border-top: 1px solid var(--line); padding-top: 8px; }
.card b { display: block; font-weight: 500; }
.foot-links { margin-top: 28px; text-align: center; }
.foot-links a { color: var(--ink-soft); font-size: 13px; }
.draft-flag {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--seal);
  font-size: 12px;
  letter-spacing: 0.2em;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(40, 32, 24, 0.45);
  display: grid;
  place-items: end center;
  padding: 16px;
}
.modal .dialog {
  width: min(440px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 18px 16px 16px;
}
.modal img { width: 100%; height: auto; background: white; }
.modal .actions { margin-top: 12px; }
@media (max-width: 520px) {
  .desk { padding: 0; display: block; }
  .sheet { width: 100%; min-height: 100vh; margin: 0; border: 0; box-shadow: none; }
}
