/* Shop, contracts, contract sheet and locked page. */

.page-head { margin-bottom: clamp(28px, 5vh, 56px); max-width: 40rem; }
.note {
  margin-top: 14px;
  font-size: .875rem;
  color: var(--muted);
  display: flex; gap: 8px; align-items: baseline;
}
.note::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); transform: translateY(-2px); }

/* ---------------------------------------------------------------- shop */

.shop {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: start;
}
.shop .page-head { position: sticky; top: 110px; }

.packages { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.package {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  padding: clamp(16px, 2.6vh, 26px) 4px;
  border-bottom: 1px solid var(--line);
}
.package-size {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 12px;
  min-width: 0;
}
.package-size .name {
  grid-column: 1 / -1;
  font-size: var(--step-1);
  color: var(--text);
  margin-bottom: 4px;
}
.package-size .amount {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  line-height: 1;
  color: var(--fog-silver);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.package-size .word { font-size: .875rem; color: var(--muted); }
/* the term itself is the headline of each package */
.package-size .term {
  grid-column: 1 / -1;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 2.9vw, 2.6rem);
  line-height: 1.05;
  color: var(--fog-silver);
  transition: color .3s;
}
.package:hover .term, .package:focus-within .term { color: #e9c886; }
.package-size .secs {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: .8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 3D backgrounds of Contracts (Time Stones) and Profile (personal timepiece) */
.bg-3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}
.contracts-page, .profile { position: relative; z-index: 5; }

/* ---------------------------------------------------------------- contracts: archive of documents */

.contracts-page .page-head { margin-bottom: 32px; }
.archive-summary {
  display: inline-block;
  margin: 16px 0 0;
  padding: 6px 14px;
  border: 1px solid rgba(224, 177, 84, .45);
  border-radius: 999px;
  color: #e9c886;
  font-family: var(--display);
  font-size: .875rem;
}
.archive {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr));
  gap: 22px;
}
.doc-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(224, 177, 84, .22);
  border-radius: 22px;
  background:
    radial-gradient(90% 80% at 0% 0%, rgba(224, 177, 84, .07), transparent 60%),
    rgba(8, 8, 8, .72);
  backdrop-filter: blur(12px);
  transition: border-color .3s;
}
.doc-card:hover, .doc-card:focus-within { border-color: rgba(224, 177, 84, .5); }
/* the real certificate, shrunk to a thumbnail */
.doc-thumb {
  display: block;
  width: 168px;
  height: 238px;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
  transform: rotate(-2deg);
  transition: transform .4s var(--ease);
}
.doc-card:hover .doc-thumb { transform: rotate(0deg) translateY(-3px); }
.doc-thumb-inner { width: 560px; transform: scale(.3); transform-origin: 0 0; pointer-events: none; }
.doc-thumb-inner .cert { box-shadow: none; border-radius: 0; }
.doc-no { margin: 0 0 6px; font-size: .75rem; letter-spacing: .18em; color: var(--muted); }
.doc-term { font-family: var(--deco); font-weight: 400; font-size: clamp(1.9rem, 3vw, 2.4rem); line-height: 1.05; margin: 0 0 10px; }
.doc-meta { margin: 0; color: var(--muted); font-size: .875rem; }
.doc-price { margin: 4px 0 0; font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: #e9c886; }
.doc-saved { margin: 8px 0 0; font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.doc-saved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #a9d6bd; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.archive-empty {
  display: grid; justify-items: center; gap: 18px; text-align: center;
  max-width: 30rem; margin: 40px auto 0; padding: 40px 24px;
  border: 1px dashed rgba(224, 177, 84, .35); border-radius: 24px;
  color: var(--fog-silver);
}
.archive-empty p { margin: 0; color: var(--muted); font-size: var(--step-1); }
@media (max-width: 560px) {
  .doc-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .doc-actions { justify-content: center; }
}

/* ---------------------------------------------------------------- invitation request window */

.request-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid rgba(224, 177, 84, .45);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(224, 177, 84, .08), transparent 60%),
    #0c0c0c;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  overflow-y: auto;
}
.request-dialog[open] { animation: rq-in .45s var(--ease); }
@keyframes rq-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.request-form { padding: 30px clamp(20px, 5vw, 36px) 26px; text-align: center; }
.rq-emblem { color: var(--fog-silver); margin: 0 auto 10px; display: block; }
.request-form h2 { margin: 0 0 8px; }
.rq-lead { color: var(--muted); margin: 0 auto 6px; max-width: 40ch; font-size: .9375rem; }
.rq-email { color: #e9c886; margin: 0 0 22px; font-size: .9375rem; overflow-wrap: anywhere; }
.request-form .field { text-align: left; }
.rq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.rq-grid .field { min-width: 0; }
.rq-grid input, .rq-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
.rq-gender { border: 0; padding: 0; margin: 4px 0 18px; display: flex; gap: 10px; flex-wrap: wrap; text-align: left; }
.rq-gender legend { width: 100%; font-size: .875rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.rq-gender label {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.rq-gender input { position: absolute; opacity: 0; pointer-events: none; }
.rq-gender label:has(input:checked) { border-color: #e0b154; background: rgba(224, 177, 84, .1); color: #e9c886; }
.rq-gender label:has(input:focus-visible) { outline: 2px solid var(--fog-silver); outline-offset: 3px; }
.rq-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 2px solid rgba(224, 177, 84, .55);
  background: rgba(224, 177, 84, .05);
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.5;
  text-align: left;
}
.request-form .error { text-align: left; }
.rq-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 520px) {
  .rq-grid { grid-template-columns: 1fr; }
  .rq-actions .btn { flex: 1; }
}

/* ---------------------------------------------------------------- profile: personal card + sections */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  max-width: 1100px;
}
.member-card {
  position: sticky; top: 100px;
  background: #f6f4ee;
  color: #1a1a1a;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transform: rotate(-1deg);
}
.mc-frame { border: 1px solid #a8761f; padding: 5px; }
.mc-inner {
  border: 1px solid #a8761f;
  padding: 26px 22px 18px;
  text-align: center;
  display: grid;
  justify-items: center;
  font-family: var(--deco-text);
}
.mc-kicker { margin: 0 0 14px; font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: #6b675f; }
.mc-emblem { color: #1a1a1a; margin-bottom: 14px; }
.mc-name { font-family: var(--deco); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; margin: 0 0 4px; overflow-wrap: anywhere; }
.mc-since { margin: 0 0 18px; font-size: 13px; color: #6b675f; }
.mc-facts { width: 100%; margin: 0 0 18px; display: grid; gap: 0; border-top: 1px solid rgba(168, 118, 31, .4); }
.mc-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(168, 118, 31, .4); }
.mc-facts dt { font-size: 13px; color: #6b675f; }
.mc-facts dd { margin: 0; font-family: var(--deco); font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.mc-sign {
  width: 100%;
  min-height: 74px;
  display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 4px;
}
.mc-sig { max-height: 70px; max-width: 80%; object-fit: contain; }
.mc-nosig { font-size: 12px; color: #8a857b; font-style: italic; }
.mc-brand { margin: 18px 0 0; font-size: 15px; color: #1a1a1a; --wm-accent: #a8761f; }
.mc-brand .wm-tag { color: #6b675f; }

.profile-sections { display: grid; gap: 20px; }
.profile-section {
  border: 1px solid rgba(224, 177, 84, .22);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 30px);
  /* frosted glass over the 3D watch, so the forms stay easy to read */
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(224, 177, 84, .06), transparent 60%),
    rgba(8, 8, 8, .78);
  backdrop-filter: blur(14px);
}
.profile-section h2 { font-family: var(--deco); font-weight: 400; font-size: 1.6rem; margin: 0 0 18px; color: #f2e6cc; }
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .member-card { position: static; transform: none; max-width: 400px; width: 100%; justify-self: center; }
}

/* ---------------------------------------------------------------- profile (shared bits) */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
  max-width: 1080px;
}
.profile-card {
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
  background: rgba(255, 255, 255, .02);
}
.profile-card h2 { font-family: var(--display); font-weight: 500; font-size: var(--step-1); margin: 0 0 16px; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 20px; }
.profile-facts dt { color: var(--muted); font-size: .8125rem; }
.profile-facts dd { margin: 2px 0 0; font-weight: 500; }
.profile-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.profile-msg { color: var(--fog-silver); font-size: .875rem; margin: 8px 0 0; }
.profile-note { color: var(--muted); margin: 0 0 12px; }
.sig-frame {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  place-items: center;
  min-height: 140px;
}
.btn--danger:hover { border-color: #ff9b7d; color: #ffb39a; }

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* the astrolabe behind the shop; rows light up gold with their orbits */
.shop-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}
.rate {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 1px solid rgba(224, 177, 84, .45);
  border-radius: 999px;
  color: #e9c886;
  font-family: var(--display);
  font-size: .875rem;
  font-weight: 500;
}
.package { position: relative; transition: background-color .3s; }
.package:hover, .package:focus-within { background: linear-gradient(90deg, rgba(224, 177, 84, .07), transparent 70%); }
.package:hover .amount, .package:focus-within .amount { color: #e9c886; }
.package .amount { transition: color .3s; }
.package-price {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-1);
  letter-spacing: 0;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- contracts list */

.ledger { width: 100%; border-collapse: collapse; }
.ledger th {
  text-align: left;
  font-weight: 400;
  font-size: .875rem;
  color: var(--muted);
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--line-strong);
}
.ledger td { padding: 18px 12px 18px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger .num-cell {
  font-family: var(--display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: 0;
  white-space: nowrap;
}
.ledger .actions { text-align: right; white-space: nowrap; }
.ledger .actions .btn { min-height: 38px; padding: 6px 16px; }
.ledger .actions .btn + .btn { margin-left: 8px; }
.ledger-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 48px);
  display: grid; gap: 18px; justify-items: start;
  max-width: 36rem;
}
.ledger-empty p { margin: 0; color: var(--muted); font-size: var(--step-1); }

/* ---------------------------------------------------------------- contract sheet */

.sheet-tools {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 820px; margin: 0 auto 20px;
}
.sheet-tools a.back { color: var(--muted); text-decoration: none; }
.sheet-tools a.back:hover { color: var(--text); }

.sheet {
  max-width: 820px;
  margin: 0 auto;
  background: #f6f4ee;
  color: #1a1a1a;
  border-radius: 6px;
  padding: clamp(14px, 3vw, 28px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  --ink: #1a1a1a;
  --ink-soft: #5c5a55;
  --gold: #a8761f;
}
.sheet--print { box-shadow: none; border-radius: 0; max-width: none; padding: 28px; }
/* double rule frame, like an engraved certificate */
.sheet-frame {
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold);
  outline-offset: -6px;
  padding: clamp(22px, 5vw, 52px) clamp(18px, 5vw, 56px);
}
.sheet-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(168, 118, 31, .45);
}
.sheet-brand { display: inline-flex; align-items: center; font-size: 15px; color: var(--ink); --wm-accent: var(--gold); }
.sheet-brand .mark { width: 26px; height: 26px; color: var(--ink); }
.sheet .no { font-family: var(--deco-text); font-size: 12px; letter-spacing: .14em; color: var(--ink-soft); white-space: nowrap; }

/* ---- agreement text (also used in the purchase confirmation) */
/* Decorative display face from the client's sample. A licensed Doppelganger file dropped into
   static/fonts/ is used first; Poiret One is the free stand-in (Cyrillic + Latin). */
@font-face {
  font-family: "Doppelganger";
  src: url("/static/fonts/doppelganger.woff2") format("woff2"),
       url("/static/fonts/doppelganger.otf") format("opentype");
  font-display: swap;
}
:root {
  --deco: "Doppelganger", "Poiret One", "Songti SC", "Noto Serif SC", serif;
  --deco-text: "Didact Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.agreement { font-family: var(--deco-text); font-size: 14.5px; line-height: 1.7; }
.ag-head { text-align: center; margin-bottom: 22px; }
.ag-head h2 { font-family: var(--deco); font-weight: 400; font-size: clamp(26px, 3.8vw, 36px); line-height: 1.15; margin: 0; letter-spacing: .02em; }
.ag-sub { margin: 8px 0 0; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.ag-intro { margin: 0 0 12px; }
.ag-parties { margin: 0 0 22px; padding: 14px 0; border-top: 1px solid rgba(128, 128, 128, .3); border-bottom: 1px solid rgba(128, 128, 128, .3); }
.ag-parties p { margin: 0; }
.ag-and { margin: 6px 0 !important; font-style: italic; opacity: .7; }
.ag-sec { margin: 0 0 16px; break-inside: avoid; }
.ag-sec h3 { font-family: var(--deco); font-weight: 400; font-size: 20px; letter-spacing: .02em; margin: 0 0 4px; }
.ag-sec h3 span { color: var(--gold, #e0b154); }
.ag-sec p { margin: 0 0 6px; max-width: 70ch; }
.ag-sec ul { margin: 4px 0 8px; padding-left: 1.3em; }
.ag-sec li::marker { color: var(--gold, #e0b154); }
.ag-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 10px; }
.ag-sign p { margin: 0 0 6px; }
.ag-sign p span, .ag-sign-line > span { opacity: .65; }
.ag-role { font-family: var(--deco); font-size: 18px; opacity: 1 !important; }
.ag-sign-line {
  position: relative;
  display: flex; align-items: flex-end; gap: 8px;
  min-height: 64px;
  margin: 0 0 8px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}
.ag-sig { max-height: 72px; max-width: 70%; object-fit: contain; }
.ag-sig-empty { flex: 1; }

/* ---- certificate: the sample's layout in the contract's Art Deco style
   (ivory paper, double gold frame, decorative display face, Didact Gothic text) */
.cert {
  --cert-ink: #1a1a1a;
  --cert-soft: #6b675f;
  --cert-gold: #a8761f;
  width: min(560px, 100%);
  margin: 0 auto;
  aspect-ratio: 420 / 595;          /* A5 */
  background: #f6f4ee;
  color: var(--cert-ink);
  font-family: var(--deco-text);
  text-align: center;
  padding: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  border-radius: 4px;
  display: flex;
}
/* double gold rule built from two nested borders, so it also shows in the PDF */
.cert-frame { flex: 1; display: flex; border: 1px solid var(--cert-gold); padding: 5px; }
.cert-inner {
  flex: 1;
  border: 1px solid var(--cert-gold);
  padding: clamp(22px, 6vw, 40px) clamp(18px, 5vw, 38px) clamp(16px, 4vw, 26px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cert--print { box-shadow: none; border-radius: 0; width: 560px; height: 790px; aspect-ratio: auto; overflow: hidden; }
.cert-title {
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(34px, 8vw, 52px);
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 4px;
}
.cert-sub {
  margin: 0 0 22px;
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cert-soft);
}
.cert-emblem { width: 30%; height: auto; color: var(--cert-ink); margin-bottom: 26px; }
.cert-fields { width: 100%; display: grid; gap: 14px; margin-bottom: 26px; text-align: left; }
.cert-field { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: clamp(15px, 3.2vw, 18px); }
.cert-label { flex: none; color: var(--cert-soft); }
.cert-value {
  flex: 1;
  border-bottom: 1px solid var(--cert-ink);
  padding: 0 4px 3px;
  font-family: var(--deco);
  font-size: 1.3em;
  text-align: center;
  min-height: 1.2em;
}
.cert-lead { margin: 0; font-size: clamp(14px, 3vw, 16.5px); }
.cert-amount {
  margin: 6px 0 8px;
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(22px, 4.8vw, 30px);
  line-height: 1.15;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cert-amount::after {
  content: "";
  display: block;
  width: 64px;
  margin: 10px auto 0;
  border-bottom: 1px solid var(--cert-gold);
}
.cert-share { margin: 0; font-size: clamp(14px, 3vw, 16.5px); line-height: 1.45; }
.cert-closing {
  margin: auto 0 0;
  padding-top: 18px;
  font-family: var(--deco);
  color: var(--cert-soft);
  font-size: clamp(16px, 3.4vw, 20px);
  line-height: 1.45;
}
.cert-no { margin: 14px 0 0; font-size: 10.5px; letter-spacing: .18em; color: var(--cert-soft); }
.cert:lang(zh) .cert-title { letter-spacing: .3em; }

.contract-docs { display: grid; gap: 40px; }
.doc-tabs { display: flex; gap: 6px; justify-content: center; margin: 0 auto 20px; }
.doc-tabs button[aria-selected="true"] { background: var(--fog-silver); color: var(--frame); border-color: var(--fog-silver); }

/* ---- the Time Stone: glyph, QR and access code */
.stone {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-top: 26px; padding: 18px 20px;
  border: 1px solid rgba(168, 118, 31, .45);
  break-inside: avoid;
}
.stone-glyph, .stone-qr { display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); }
.stone-glyph .glyph { color: var(--ink); }
.stone-qr svg { width: 96px; height: 96px; }
.stone-facts { margin: 0; display: grid; gap: 10px; }
.stone-facts dt { font-size: 12px; color: var(--ink-soft); }
.stone-facts dd { margin: 0; font-family: var(--deco); font-size: 19px; letter-spacing: .04em; }
.signed-note { margin: 18px 0 0; font-size: 12px; color: var(--ink-soft); text-align: right; }

/* ---- purchase confirmation */
.confirm-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; }
.confirm-dialog[open] { display: flex; flex-direction: column; }
/* header and buttons stay put; only the middle scrolls, so "Sign and buy" is always reachable */
.confirm-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.confirm-head, .confirm-foot { flex: none; }
.confirm-head { padding: 24px 28px 14px; border-bottom: 1px solid var(--line); }
.confirm-head h2 { margin: 0 0 4px; }
.confirm-head p { margin: 0; color: #e9c886; font-family: var(--display); font-size: .9375rem; }
.confirm-body { padding: 20px 28px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.confirm-body h3 { font-family: var(--display); font-weight: 500; font-size: 1rem; margin: 22px 0 12px; }
.confirm-body h3:first-child { margin-top: 0; }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ag-scroll {
  max-height: clamp(160px, 32vh, 300px); overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
}
.agreement--preview .ag-sec h3 span, .agreement--preview .ag-sec li::marker { color: #e0b154; }
.agreement--preview .ag-sig { filter: invert(1); }
.agreement--preview .ag-sig--provider { filter: invert(1); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #e0b154; flex: none; }
.sig-choice { display: grid; gap: 10px; }
.sig-option {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
}
.sig-option:has(input:checked) { border-color: #e0b154; background: rgba(224, 177, 84, .06); }
.sig-option input { accent-color: #e0b154; width: 18px; height: 18px; flex: none; }
.sig-option .sig-img { max-height: 54px; }
.confirm-foot {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
}
.confirm-foot .error { margin: 0 auto 0 0; }
.confirm-todo { margin: 0 auto 0 0; font-size: .875rem; color: var(--muted); max-width: 46ch; }
.confirm-todo.is-ready { color: #e9c886; }
.confirm-foot .error:not([hidden]) + .confirm-todo { display: none; }

@media (max-width: 640px) {
  .confirm-grid, .ag-signs { grid-template-columns: 1fr; }
  .confirm-head, .confirm-body, .confirm-foot { padding-left: 18px; padding-right: 18px; }
}

/* ---------------------------------------------------------------- locked
   Left: the hourglass that forms out of sand. Right: sign in with a code, or ask for one. */

.locked {
  position: relative; z-index: 5;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  padding: 96px clamp(20px, 5vw, 80px) 88px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.locked-stage {
  position: relative;
  height: min(78vh, 720px);
  min-height: 360px;
}
.locked-stage.is-off { display: none; }
.hourglass-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.locked-body { max-width: 30rem; }
/* the full wordmark sits above the title, so the header keeps just the ring */
.brand--ring .wm-l { display: none; }
.brand--ring .wm-o { width: 28px; height: 28px; margin: 0; }
.locked-brand { margin: 0 0 26px; font-size: clamp(1.15rem, 1.8vw, 1.45rem); color: var(--text); }
.locked-brand .wordmark { align-items: flex-start; }
.locked h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
.locked-text { color: var(--muted); font-size: var(--step-1); line-height: 1.5; margin: 0 0 32px; max-width: 36ch; }
.locked .error { font-size: var(--step-0); margin: -12px 0 24px; color: #ffb39a; }

.entry { margin: 0 0 22px; }
.entry > label { display: block; font-size: .9375rem; color: var(--text); margin-bottom: 8px; }
.entry-row {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
}
.entry-row:focus-within { border-color: var(--fog-silver); }
.entry-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 14px;
  font-size: 1rem;
}
.entry-row input:focus-visible { outline: none; }
.entry-row input::placeholder { color: rgba(140, 140, 140, .7); }
.entry-row .btn { flex: none; }
.entry--code input {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: .16em;
}
.entry--code input::placeholder { letter-spacing: .14em; }
.entry--code input[type="text"] { text-transform: uppercase; }  /* codes look upper-case; the value stays as typed */
.entry-msg { margin: 10px 0 0; font-size: .9375rem; color: var(--fog-silver); max-width: 42ch; }
.entry-msg.is-error { color: #ffb39a; }
.have-qr { margin: 28px 0 0; font-size: .875rem; color: var(--muted); }

@media (max-width: 860px) {
  .locked { grid-template-columns: 1fr; padding-top: 80px; gap: 0; }
  .locked-stage { height: 32vh; min-height: 230px; }
  .locked-body { justify-self: center; width: 100%; }
  .locked h1 { font-size: 1.65rem; }
  .locked-text { font-size: var(--step-0); margin-bottom: 24px; }
}

@media (max-width: 520px) {
  .entry-row { flex-direction: column; border-radius: 20px; }
  .entry-row input { min-height: 44px; }
}

@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; }
  .shop .page-head { position: static; }
}

@media (max-width: 760px) {
  .package { grid-template-columns: 1fr auto; }
  .package .btn { grid-column: 1 / -1; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .ledger td { border: 0; padding: 0; }
  .ledger .actions { grid-column: 1 / -1; text-align: left; margin-top: 10px; }
  .parties, .signs { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- legal: links, pages, order steps, withdrawal */
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 36px 0 8px; font-size: .8125rem; }
.legal-links a, .legal-tabs a { color: var(--muted); text-decoration: none; }
.legal-links a:hover, .legal-tabs a:hover { color: var(--text); text-decoration: underline; }
.legal { max-width: 820px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 28px; }
.legal-tabs a[aria-current] { color: #e9c886; }
.legal-version { color: var(--muted); font-size: .8125rem; margin-top: 28px; }
.ag-doc h3 { font-family: var(--deco); font-weight: 400; font-size: 20px; margin: 20px 0 4px; }
.ag-doc p { margin: 0 0 8px; max-width: 72ch; overflow-wrap: anywhere; }
.ag-banner { padding: 10px 14px; border: 1px dashed #c0562f; color: #c0562f; font-weight: 600; }
.agreement--preview .ag-banner { border-color: #ffb39a; color: #ffb39a; }
.ag-accepted { margin: 24px 0 8px; padding-top: 14px; border-top: 1px solid rgba(128, 128, 128, .3); }
.ag-marks { display: flex; gap: 28px; align-items: flex-end; margin-bottom: 18px; }
.ag-marks .ag-sig { max-width: 40%; }
.signed-hash { overflow-wrap: anywhere; text-align: left; }
.code-info { color: var(--muted); font-size: .875rem; margin: 0 0 10px; }
.code-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.code-row input {
  width: 9.5em; min-height: 46px; padding: 8px 14px; text-align: center;
  font-family: var(--display); font-size: 1.1rem; letter-spacing: .2em;
  background: #000; border: 1px solid var(--line-strong); border-radius: 14px;
}
.sig-details { margin-top: 22px; }
.sig-details summary { cursor: pointer; color: var(--muted); font-size: .875rem; margin-bottom: 12px; }
.rq-accept { text-align: left; margin: 0 0 16px; font-size: .875rem; }
.sheet-buttons { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.withdraw-bar {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between;
  margin: 0 0 20px; padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 18px;
}
.withdraw-bar p { margin: 0; font-size: .875rem; color: var(--muted); }
.withdraw-dialog { width: min(480px, calc(100vw - 24px)); padding: 28px; }
.legacy-note { color: var(--muted); font-size: .875rem; }
.legacy-pdf { width: 100%; height: 80vh; border: 0; border-radius: 12px; background: #fff; }

.licence-note { margin-top: 18px; }
.confirm-form select { width: 100%; min-width: 0; }

/* 7 years: not sold online, a personal arrangement */
.package-price.package-price--personal {
  font-family: var(--sans); font-weight: 500; font-size: .875rem; line-height: 1.35;
  color: #e9c886; text-align: right; white-space: normal; max-width: 13ch;
}
.personal-dialog textarea {
  width: 100%; min-width: 0; box-sizing: border-box; resize: vertical;
  padding: 12px 14px; font: inherit; color: inherit;
  background: #000; border: 1px solid var(--line-strong); border-radius: 14px;
}
