@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;500;600;700;900&display=swap");

:root {
  color-scheme: light;
  --paper: #ede4d0;
  --paper-light: #f7f1e4;
  --ink: #25231f;
  --muted: #716b61;
  --red: #9e3026;
  --red-dark: #702019;
  --gold: #a37a33;
  --rule: rgba(54, 48, 39, 0.22);
  --serif: "Noto Serif TC", "Songti TC", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.65), transparent 28rem),
    repeating-linear-gradient(96deg, transparent 0 4px, rgba(84, 62, 32, 0.018) 5px 6px),
    var(--paper);
  font-family: var(--serif);
  min-width: 320px;
}

button, a { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--paper-light);
  background: var(--red);
  text-decoration: none;
  font-size: 27px;
  font-weight: 700;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4px rgba(255,255,255,.55);
}

.masthead-copy { display: flex; align-items: baseline; gap: 20px; }
.masthead h1 { margin: 0; font-size: clamp(23px, 3vw, 34px); letter-spacing: .12em; }
.eyebrow, .section-number { margin: 0; color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.text-button { border: 0; border-bottom: 1px solid var(--ink); background: none; padding: 4px 0; cursor: pointer; }
.menu-button { display: grid; gap: 5px; width: 42px; border: 0; padding: 10px; background: none; cursor: pointer; }
.menu-button span { display: block; height: 1px; background: var(--ink); }
.drawer-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(37,35,31,.38); }
.account-drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  left: 0;
  width: min(420px, 92vw);
  height: 100dvh;
  overflow-y: auto;
  padding: 30px;
  background: var(--paper-light);
  box-shadow: 16px 0 40px rgba(37,35,31,.18);
  translate: -100% 0;
  transition: translate .25s ease;
}
.account-drawer.is-open { translate: 0; }
.drawer-header { display: flex; align-items: start; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.drawer-header h2 { margin: 4px 0 0; font-size: 30px; }
.drawer-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; font-size: 32px; line-height: 1; }
.drawer-login { padding: 28px 0; }
.drawer-login p, .account-summary p { color: var(--muted); line-height: 1.7; }
.oauth-buttons { display: grid; gap: 10px; }
.oauth-buttons a, .save-reading a { padding: 12px 16px; border: 1px solid var(--ink); color: var(--ink); text-align: center; text-decoration: none; font-weight: 700; }
.account-summary { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.account-summary h3 { margin: 0; }
.account-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; }
.account-links a { color: var(--red); }
.drawer-label { margin: 24px 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.history-list { border-top: 1px solid var(--rule); }
.history-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 15px 2px; background: none; text-align: left; cursor: pointer; }
.history-item strong { display: block; margin-bottom: 4px; }
.history-item span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { color: var(--muted); font-size: 13px; }
.drawer-new { margin-top: 30px; }
.credit-balance { display: flex; align-items: baseline; gap: 10px; margin: 18px 0; }
.credit-balance strong { color: var(--red); font-size: 38px; line-height: 1; }
.credit-balance span { color: var(--muted); font-size: 12px; }
.account-buy.secondary-button { width: 100%; margin: 0; padding: 11px 14px; font-size: 12px; }
.redeem-form { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.redeem-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.redeem-form > div { display: grid; grid-template-columns: 1fr auto; }
.redeem-form input { min-width: 0; border: 1px solid var(--rule); border-right: 0; padding: 11px 12px; color: var(--ink); background: transparent; font: 14px var(--serif); text-transform: uppercase; }
.redeem-form input:focus { outline: 1px solid var(--red); outline-offset: -1px; }
.redeem-form button { border: 0; padding: 0 16px; color: var(--paper-light); background: var(--ink); cursor: pointer; }
.redeem-form button:disabled { opacity: .6; }
.form-message { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.intro {
  padding: 52px 8%;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.intro p { margin: 0; }
.intro .intro-lead { color: var(--ink); font-size: clamp(20px, 2.5vw, 30px); font-weight: 600; line-height: 1.6; }
.not-found { min-height: 55vh; padding: clamp(60px, 12vw, 140px) 20px; border-bottom: 1px solid var(--rule); text-align: center; }
.not-found h2 { margin: 10px 0; font-size: clamp(30px, 5vw, 48px); }
.not-found > p:not(.eyebrow) { color: var(--muted); }
.not-found .secondary-button { display: inline-flex; margin-top: 24px; text-decoration: none; }
.question-field { display: block; width: min(680px, 100%); margin: 28px auto 0; text-align: left; }
.question-field span { display: block; margin-bottom: 8px; color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.question-field textarea {
  display: block;
  width: 100%;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 12px 2px;
  color: var(--ink);
  background: transparent;
  font: 18px/1.6 var(--serif);
}
.question-field textarea:focus { outline: 0; border-color: var(--red); }
.question-field textarea::placeholder { color: #9b9489; }
.question-actions { display: grid; grid-template-columns: minmax(180px, 280px) auto; align-items: center; justify-content: center; gap: 24px; margin-top: 24px; }
.question-actions .text-button { justify-self: start; }

.casting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .7fr);
  border-bottom: 1px solid var(--rule);
}

.casting-stage { padding: clamp(34px, 6vw, 72px) clamp(20px, 7vw, 90px) 56px 0; }
.stage-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 36px; }
.stage-heading h2, .ledger-heading h2, .result-heading h2 { margin: 5px 0 0; font-size: clamp(29px, 4vw, 46px); font-weight: 600; }
.direction { color: var(--muted); font-size: 14px; letter-spacing: .1em; }

.coin-field {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--rule);
  background: rgba(247, 241, 228, .48);
  isolation: isolate;
}
.coin-field::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(54,48,39,.08);
  pointer-events: none;
}
.coin-field::after {
  content: "乾坤定矣";
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: rgba(37,35,31,.16);
  font-size: 11px;
  letter-spacing: .3em;
  writing-mode: vertical-rl;
}

.coin {
  --rotation: 0deg;
  position: relative;
  width: clamp(76px, 11vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform-style: preserve-3d;
  transform: perspective(500px) rotateY(var(--rotation));
  transition: transform 1.05s cubic-bezier(.18,.72,.16,1);
  box-shadow: 0 12px 18px rgba(52,37,16,.18), inset 0 0 0 3px #76551d, inset 0 0 0 9px #c39a4a;
  background: radial-gradient(circle at 35% 28%, #ecd38e 0 10%, #ba8b35 55%, #84601f 100%);
}
.coin:nth-child(2) { margin-top: -26px; }
.coin.is-tossing { animation: coin-hop 1.05s cubic-bezier(.2,.7,.3,1); }
.coin-face {
  position: absolute;
  inset: 14%;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 1px solid rgba(91,61,13,.5);
  border-radius: 50%;
  text-align: center;
  backface-visibility: hidden;
}
.coin-face::after { content: ""; position: absolute; inset: 16%; border: 1px dotted rgba(91,61,13,.5); border-radius: 50%; }
.coin-face span { z-index: 1; font-size: clamp(24px, 4vw, 39px); font-weight: 700; text-shadow: 0 1px rgba(255,255,255,.35); }
.coin-face small { z-index: 1; font-size: 9px; font-weight: 700; }
.coin.is-yin .coin-face { transform: rotateY(180deg); }

@keyframes coin-hop {
  0%, 100% { translate: 0 0; }
  40% { translate: 0 -44px; }
}

.cast-readout { min-height: 77px; display: grid; place-items: center; text-align: center; }
.readout-placeholder { color: var(--muted); font-size: 14px; }
.readout-result { display: flex; align-items: baseline; gap: 12px; }
.readout-result strong { color: var(--red); font-size: 30px; }
.readout-result span { font-size: 15px; }

.cast-button, .secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  padding: 16px 18px 16px 24px;
  color: #fffaf0;
  background: var(--red);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .16em;
  transition: background .2s, transform .2s;
}
.cast-button:hover, .secondary-button:hover { background: var(--red-dark); }
.cast-button:active, .secondary-button:active { transform: translateY(1px); }
.cast-button:disabled { cursor: wait; opacity: .68; }
.button-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.55); font-size: 13px; }

.line-ledger { padding: clamp(34px, 6vw, 72px) 0 56px clamp(24px, 4vw, 52px); border-left: 1px solid var(--rule); }
.ledger-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.line-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.line-list li { min-height: 59px; display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--rule); transition: background .25s; }
.line-list li.is-current { background: rgba(158,48,38,.07); }
.line-position { color: var(--muted); font-size: 12px; }
.line-empty { grid-column: 2 / 4; color: #9b9489; font-size: 13px; letter-spacing: .15em; }
.yao-line { position: relative; display: flex; align-items: center; justify-content: center; width: 112px; height: 19px; }
.yao-line::before, .yao-line::after { content: ""; height: 8px; background: var(--ink); }
.yao-line.yang::before { width: 100%; }
.yao-line.yang::after { display: none; }
.yao-line.yin { justify-content: space-between; }
.yao-line.yin::before, .yao-line.yin::after { width: 43%; }
.yao-line.is-changing::before, .yao-line.is-changing::after { background: var(--red); }
.line-value { color: var(--muted); font-size: 12px; white-space: nowrap; }
.line-value strong { color: var(--red); font-size: 15px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; }
.legend-dot.old-yin, .legend-dot.old-yang { border-color: var(--red); background: var(--red); }

.result-section { padding: 70px 0; border-bottom: 1px solid var(--rule); }
.result-heading { max-width: 650px; margin-bottom: 42px; }
.result-heading > p:last-child { color: var(--muted); line-height: 1.8; }
.result-heading blockquote { margin: 20px 0 10px; padding-left: 16px; border-left: 3px solid var(--red); font-size: 18px; line-height: 1.7; }
.hexagram-pair { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); }
.hexagram-card { display: flex; justify-content: center; padding: clamp(28px,5vw,58px); background: rgba(247,241,228,.35); }
.hexagram-card + .hexagram-card { border-left: 1px solid var(--rule); }
.card-kicker { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.hexagram-card h3 { margin: 8px 0 6px; font-size: 38px; }
.hexagram-card h3 small { color: var(--muted); font-size: 13px; font-weight: 400; }
.theme { margin: 0; color: var(--gold); font-size: 13px; }
.diagram { display: flex; flex-direction: column; gap: 10px; margin-top: 25px; }
.diagram-row { display: grid; grid-template-columns: 120px 1fr; gap: 13px; align-items: center; }
.diagram-row .yao-line { width: 120px; }
.change-mark { color: var(--red); font-size: 11px; font-weight: 700; }
.interpretation-section { margin-top: 52px; border-top: 3px double var(--ink); border-bottom: 1px solid var(--rule); background: rgba(247,241,228,.28); }
.interpretation-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px clamp(20px, 4vw, 46px); border-bottom: 1px solid var(--rule); }
.interpretation-heading h2 { margin: 4px 0 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: .16em; }
.interpretation-seal { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--red); color: var(--red); font-size: 22px; font-weight: 700; rotate: 3deg; }
.interpretation-body { min-height: 280px; }
.interpretation-state { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 330px; padding: 48px 24px; text-align: center; }
.interpretation-state h3 { margin: 10px 0; font-size: clamp(21px, 3vw, 29px); }
.interpretation-state > p:not(.eyebrow) { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.8; }
.interpretation-state .secondary-button { margin-top: 24px; }
.interpretation-state .secondary-button:disabled { cursor: not-allowed; opacity: .45; }
.state-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--rule); border-radius: 50%; color: var(--red); font-size: 17px; }
.ink-loader { position: relative; width: 76px; height: 48px; margin-bottom: 20px; }
.ink-loader i { position: absolute; bottom: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); animation: ink-breathe 1.5s ease-in-out infinite; }
.ink-loader i:nth-child(1) { left: 4px; opacity: .3; }
.ink-loader i:nth-child(2) { left: 30px; width: 20px; height: 20px; animation-delay: .18s; }
.ink-loader i:nth-child(3) { right: 4px; opacity: .55; animation-delay: .36s; }
@keyframes ink-breathe { 0%, 100% { translate: 0 0; scale: .8; } 50% { translate: 0 -10px; scale: 1; } }
.reading-skeleton { display: grid; gap: 9px; width: min(500px, 80%); margin-top: 34px; }
.reading-skeleton span { height: 7px; background: linear-gradient(90deg, transparent, rgba(37,35,31,.13), transparent); background-size: 200% 100%; animation: paper-shimmer 2s linear infinite; }
.reading-skeleton span:nth-child(2) { width: 84%; }
.reading-skeleton span:nth-child(3) { width: 65%; }
@keyframes paper-shimmer { to { background-position: -200% 0; } }
.stream-reading { position: relative; min-height: 250px; }
.stream-status { display: flex; align-items: center; gap: 9px; margin: -22px auto 30px; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.stream-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: ink-breathe 1.2s ease-in-out infinite; }
.stream-cursor { display: inline-block; width: .55em; height: 1.15em; margin-left: 3px; background: var(--red); vertical-align: -.15em; animation: cursor-blink 1s steps(1) infinite; }
@keyframes cursor-blink { 50% { opacity: 0; } }
.failed-state { min-height: 280px; }
.turnstile-area { padding: 0 24px 28px; text-align: center; }
#turnstilePlaceholder { min-height: 1px; }
.locked-reading { position: relative; overflow: hidden; }
.preview-content { max-height: 255px; overflow: hidden; padding-bottom: 70px; }
.preview-fade { position: absolute; z-index: 1; top: 80px; right: 0; left: 0; height: 205px; background: linear-gradient(to bottom, rgba(237,228,208,0), var(--paper) 84%); pointer-events: none; }
.lock-card { position: relative; z-index: 2; width: min(610px, calc(100% - 32px)); margin: -34px auto 38px; border: 1px solid var(--gold); padding: 28px; background: var(--paper-light); box-shadow: 0 16px 36px rgba(52,37,16,.12); text-align: center; }
.lock-symbol { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto; border: 1px solid var(--red); color: var(--red); font-size: 13px; }
.lock-card h3 { margin: 13px 0 8px; font-size: 24px; }
.lock-card > p:not(.form-message) { margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.7; }
.lock-card .secondary-button { margin-top: 22px; }
.lock-card .show-pricing-button { display: block; margin: 16px auto 0; }
.login-cta { display: inline-block; margin-top: 22px; padding: 13px 19px; color: var(--paper-light); background: var(--red); font-weight: 700; text-decoration: none; letter-spacing: .08em; }
.markdown-body { max-width: 780px; margin: 0 auto; padding: clamp(34px, 6vw, 66px) clamp(22px, 7vw, 76px); font-size: 16px; line-height: 2; }
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 1.7em 0 .5em; color: var(--red-dark); line-height: 1.5; }
.markdown-body h3 { font-size: 25px; }
.markdown-body h4 { font-size: 20px; }
.markdown-body p { margin: 0 0 1.15em; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1.4em; padding-left: 1.8em; }
.markdown-body li { margin: .35em 0; padding-left: .3em; }
.markdown-body strong { color: var(--red-dark); }
.complete-reading::first-letter { color: var(--red); font-size: 1.25em; font-weight: 700; }
.save-reading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 22px; border: 1px solid var(--gold); }
.save-reading p { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.save-reading p span { color: var(--muted); font-size: 12px; }
.save-reading > div { display: flex; gap: 8px; }
.save-reading a { padding: 9px 12px; font-size: 12px; white-space: nowrap; }
.secondary-button { width: auto; margin: 34px auto 0; padding: 15px 28px; }
.warning-dialog { width: min(480px, calc(100% - 32px)); border: 1px solid var(--rule); padding: 0; color: var(--ink); background: var(--paper-light); }
.warning-dialog::backdrop { background: rgba(37,35,31,.52); }
.warning-dialog form { padding: 32px; }
.warning-dialog h2 { margin: 8px 0 12px; }
.warning-dialog form > p:last-of-type { color: var(--muted); line-height: 1.8; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 24px; margin-top: 24px; }
.dialog-actions .secondary-button { margin: 0; }
.pricing-dialog { width: min(900px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 0; padding: 0; color: var(--ink); background: var(--paper-light); box-shadow: 0 24px 70px rgba(37,35,31,.28); }
.pricing-dialog::backdrop { background: rgba(37,35,31,.58); backdrop-filter: blur(2px); }
.pricing-dialog-inner { position: relative; padding: clamp(28px, 6vw, 58px); }
.pricing-close { position: absolute; top: 20px; right: 22px; }
.pricing-dialog h2 { margin: 7px 0 10px; font-size: clamp(28px, 4vw, 40px); }
.pricing-intro { margin: 0 0 30px; color: var(--muted); line-height: 1.7; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pricing-tier { position: relative; display: flex; align-items: center; flex-direction: column; gap: 8px; min-height: 210px; border: 1px solid var(--rule); padding: 32px 16px 22px; color: var(--ink); background: transparent; cursor: pointer; transition: border-color .2s, translate .2s, background .2s; }
.pricing-tier:hover:not(:disabled) { border-color: var(--red); background: #fffaf0; translate: 0 -3px; }
.pricing-tier.is-featured { border-color: var(--gold); }
.pricing-tier:disabled { cursor: not-allowed; opacity: .45; }
.pricing-tier strong { color: var(--red); font-size: 42px; }
.pricing-tier strong small { font-size: 15px; }
.pricing-tier > span:not(.tier-note) { font-size: 18px; font-weight: 700; }
.pricing-tier em { margin-top: auto; color: var(--muted); font-size: 11px; font-style: normal; letter-spacing: .12em; }
.tier-note { position: absolute; top: 0; right: 0; padding: 5px 10px; color: var(--paper-light); background: var(--gold); font-size: 10px; letter-spacing: .12em; }
.pricing-loading { grid-column: 1 / -1; padding: 50px; color: var(--muted); text-align: center; }
.payment-notice { margin: 24px 0 0; border-left: 3px solid var(--gold); padding: 15px 18px; background: rgba(163,122,51,.1); line-height: 1.7; }
.payment-notice.is-success { border-color: var(--red); }
.payment-notice.is-neutral { border-color: var(--rule); color: var(--muted); }
.analytics-consent { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 28px; width: min(680px, calc(100% - 44px)); padding: 20px 22px; border: 1px solid var(--rule); background: var(--paper-light); box-shadow: 0 14px 46px rgba(37,35,31,.22); }
.analytics-consent strong { display: block; margin-bottom: 5px; }
.analytics-consent p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.consent-actions { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.consent-actions .secondary-button { margin: 0; padding: 11px 18px; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 28px, 680px); }
  .masthead-copy .eyebrow { display: none; }
  .intro { padding: 26px 0; }
  .question-field { margin-top: 18px; }
  .question-field textarea { font-size: 16px; }
  .question-actions { grid-template-columns: 1fr; gap: 14px; }
  .question-actions .text-button { justify-self: center; }
  .casting-layout { grid-template-columns: 1fr; }
  .casting-stage { grid-row: 2; padding: 30px 0 40px; }
  .line-ledger { grid-row: 1; padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .ledger-heading { align-items: center; margin-bottom: 12px; }
  .ledger-heading h2 { margin: 0; font-size: 20px; }
  .line-list { display: block; }
  .line-list li {
    display: grid;
    grid-template-columns: 42px 1fr 28px;
    min-height: 34px;
    gap: 10px;
    padding: 3px 8px;
  }
  .line-position { font-size: 10px; }
  .line-empty { grid-column: 2 / 4; font-size: 10px; letter-spacing: .1em; }
  .line-list .yao-line { width: min(100%, 150px); height: 10px; }
  .line-list .yao-line::before, .line-list .yao-line::after { height: 5px; }
  .line-value { font-size: 0; }
  .line-value strong { font-size: 12px; }
  .legend { display: none; }
  .stage-heading { margin-bottom: 20px; }
  .hexagram-pair { grid-template-columns: 1fr; }
  .hexagram-card + .hexagram-card { border-left: 0; border-top: 1px solid var(--rule); }
  .interpretation-section { margin-top: 34px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-tier { min-height: 145px; }
}

@media (max-width: 540px) {
  .masthead { grid-template-columns: auto auto 1fr; }
  .intro .intro-lead { font-size: 18px; }
  .coin-field { min-height: 170px; padding: 14px; }
  .coin { width: 76px; }
  .coin-face span { font-size: 25px; }
  .cast-readout { min-height: 58px; }
  .save-reading { align-items: stretch; flex-direction: column; }
  .save-reading > div { display: grid; }
  .interpretation-heading { padding: 20px 16px; }
  .interpretation-seal { width: 42px; height: 42px; }
  .markdown-body { font-size: 15px; }
  .lock-card { padding: 24px 18px; }
  .pricing-dialog-inner { padding: 28px 18px; }
  .analytics-consent { right: 14px; bottom: 14px; align-items: stretch; flex-direction: column; gap: 14px; width: calc(100% - 28px); }
  .consent-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
