:root {
  --bg: oklch(96.5% 0.012 82);
  --surface: oklch(99.2% 0.005 82);
  --fg: oklch(24% 0.042 252);
  --muted: oklch(47% 0.026 245);
  --border: oklch(84% 0.018 76);
  --accent: oklch(55% 0.155 29);
  --ink: oklch(21% 0.045 252);
  --sage: oklch(55% 0.055 170);
  --gold: oklch(73% 0.105 82);
  --error: oklch(52% 0.175 27);
  --success: oklch(48% 0.105 158);

  --font-display: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, Georgia, serif;
  --font-body: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --page-pad: clamp(18px, 4vw, 54px);
  --content-max: 1320px;
  --radius-control: 4px;
  --radius-frame: 8px;
  --ease-out: cubic-bezier(.2, .75, .2, 1);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 79px, color-mix(in oklch, var(--surface) 5%, transparent) 79px 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, color-mix(in oklch, var(--surface) 4%, transparent) 79px 80px);
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3,
figure,
blockquote,
pre {
  margin: 0;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

[hidden] {
  display: none !important;
}

::selection {
  background: color-mix(in oklch, var(--accent) 34%, var(--surface));
  color: var(--fg);
}

:focus-visible {
  outline: 3px solid var(--surface);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--fg);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  color: color-mix(in oklch, var(--surface) 92%, var(--ink));
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
}

.wordmark,
.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark-seal {
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--gold) 18%, transparent);
}

.privacy-note {
  color: color-mix(in oklch, var(--surface) 64%, var(--ink));
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

#main-content {
  min-width: 0;
}

.locked-view {
  display: grid;
  min-height: calc(100vh - 136px);
  place-items: center;
  padding-block: clamp(8px, 2vw, 26px) 26px;
}

.locked-card {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  width: min(100%, 1280px);
  min-height: min(760px, calc(100vh - 150px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--gold) 34%, var(--border));
  border-radius: var(--radius-frame);
  color: var(--fg);
  box-shadow: 0 34px 100px color-mix(in oklch, var(--ink) 72%, transparent);
  animation: card-enter 620ms var(--ease-out) both;
}

.locked-art {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(16px, 2.4vw, 28px);
  background: var(--ink);
}

.locked-art::after {
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in oklch, var(--gold) 26%, transparent);
  content: "";
  pointer-events: none;
}

.locked-art img {
  width: 100%;
  max-height: min(650px, 66vh);
  margin: auto;
  object-fit: contain;
  animation: art-settle 900ms 100ms var(--ease-out) both;
}

.art-caption {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  color: color-mix(in oklch, var(--surface) 70%, var(--ink));
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.locked-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 74px);
}

.eyebrow,
.section-kicker {
  color: color-mix(in oklch, var(--sage) 66%, var(--fg));
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.locked-panel h1 {
  max-width: 10ch;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.2vw, 72px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.12;
}

.locked-lead {
  max-width: 34em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 18px);
  line-height: 1.75;
}

.unlock-form {
  margin-top: 28px;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.field-heading label {
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
}

.field-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  min-height: 54px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--fg) 30%, var(--border));
  border-radius: var(--radius-control);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.password-control:focus-within {
  border-color: var(--fg);
  box-shadow: 0 0 0 1px var(--fg);
}

.password-control input {
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
}

.password-control input::placeholder {
  color: color-mix(in oklch, var(--muted) 72%, var(--surface));
}

.password-control input[aria-invalid="true"] {
  color: var(--error);
}

.icon-button {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
}

.icon-button:hover {
  background: color-mix(in oklch, var(--fg) 7%, var(--surface));
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-help,
.field-error {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.field-help {
  color: var(--muted);
}

.field-error {
  color: var(--error);
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 80ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: .78;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--fg);
}

.button-primary:hover:not(:disabled) {
  background: color-mix(in oklch, var(--accent) 76%, var(--gold));
  border-color: color-mix(in oklch, var(--accent) 76%, var(--gold));
  color: var(--fg);
}

.button-secondary {
  background: transparent;
  border-color: color-mix(in oklch, var(--fg) 24%, var(--border));
  color: var(--fg);
}

.button-secondary:hover:not(:disabled) {
  background: color-mix(in oklch, var(--fg) 6%, var(--surface));
  border-color: var(--fg);
  color: var(--fg);
}

.unlock-button {
  width: 100%;
  margin-top: 18px;
}

.button-loading {
  display: none;
  align-items: center;
  gap: 9px;
}

.unlock-form.is-loading .button-ready {
  display: none;
}

.unlock-form.is-loading .button-loading {
  display: inline-flex;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid color-mix(in oklch, var(--fg) 26%, transparent);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

.production-note {
  max-width: 44em;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.page-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 18px;
  color: color-mix(in oklch, var(--surface) 58%, var(--ink));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.footer-line {
  width: 56px;
  height: 1px;
  background: color-mix(in oklch, var(--surface) 24%, transparent);
}

.noscript-note {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 100;
  padding: 14px;
  background: var(--surface);
  color: var(--fg);
  text-align: center;
}

/* Unlocked letter */
.unlocked-view {
  width: min(100%, var(--content-max));
  margin-inline: auto;
  padding-top: clamp(8px, 1.6vw, 22px);
}

.letter-mast {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 4px 22px;
  color: color-mix(in oklch, var(--surface) 88%, var(--ink));
}

.letter-mast-copy {
  display: grid;
  max-width: 620px;
  gap: 7px;
}

.letter-mast-copy span:first-child {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.letter-mast-copy strong {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 500;
  line-height: 1.35;
}

.logout-button {
  flex: 0 0 auto;
  border-color: color-mix(in oklch, var(--surface) 30%, transparent);
  color: var(--surface);
}

.logout-button:hover:not(:disabled) {
  background: color-mix(in oklch, var(--surface) 10%, transparent);
  border-color: color-mix(in oklch, var(--surface) 72%, transparent);
  color: var(--surface);
}

.logout-button svg,
.control-button svg,
.code-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.letter-paper {
  overflow: hidden;
  background: var(--surface);
  border-top: 5px solid var(--accent);
  color: var(--fg);
  box-shadow: 0 34px 110px color-mix(in oklch, var(--ink) 70%, transparent);
}

.greeting-section {
  padding: clamp(38px, 6vw, 88px) clamp(24px, 6vw, 82px) clamp(46px, 7vw, 90px);
}

.greeting-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .72fr);
  gap: clamp(38px, 6vw, 88px);
  align-items: center;
}

.greeting-copy h1 {
  max-width: 11ch;
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
  outline: 0;
}

.greeting-copy h1 em {
  color: color-mix(in oklch, var(--sage) 58%, var(--fg));
  font-style: normal;
  font-weight: 500;
}

.greeting-name {
  color: var(--accent);
}

.greeting-message {
  max-width: 35em;
  margin-top: 28px;
  color: color-mix(in oklch, var(--fg) 72%, var(--muted));
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.9;
}

.greeting-message + .greeting-message {
  margin-top: 14px;
}

.gift-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.gift-fact {
  display: grid;
  gap: 5px;
}

.gift-fact .fact-index {
  color: var(--sage);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.gift-fact strong {
  font-size: 14px;
  line-height: 1.45;
}

.gift-fact span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.keepsake {
  width: min(100%, 440px);
  justify-self: end;
  padding: 12px;
  background: var(--ink);
  border: 1px solid color-mix(in oklch, var(--gold) 38%, var(--ink));
}

.keepsake img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.keepsake figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 4px 2px;
  color: color-mix(in oklch, var(--surface) 68%, var(--ink));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.handoff-section {
  padding: clamp(46px, 6vw, 78px) clamp(24px, 6vw, 82px);
  border-top: 1px solid var(--border);
}

.connection-section {
  padding: clamp(46px, 6vw, 78px) clamp(24px, 6vw, 82px);
  background: color-mix(in oklch, var(--bg) 54%, var(--surface));
  border-top: 1px solid var(--border);
}

.connection-intro {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(280px, 1.3fr);
  gap: clamp(30px, 5vw, 74px);
  align-items: end;
  margin-bottom: clamp(30px, 4vw, 48px);
}

.connection-intro h2 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.16;
}

.connection-intro > p {
  max-width: 44em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.connection-ledger {
  border-top: 1px solid var(--fg);
}

.connection-row {
  display: grid;
  grid-template-columns: minmax(170px, .72fr) minmax(210px, 1fr) minmax(190px, .9fr) auto;
  gap: clamp(16px, 2.6vw, 34px);
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.connection-identity {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.connection-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--sage) 46%, var(--border));
  border-radius: 50%;
  color: var(--sage);
}

.connection-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.connection-identity h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.connection-status {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  background: color-mix(in oklch, var(--gold) 24%, var(--surface));
  color: color-mix(in oklch, var(--fg) 72%, var(--gold));
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.45;
}

.connection-value {
  min-width: 0;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.connection-note,
.connection-footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.connection-copy {
  min-width: 66px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.connection-copy.is-copying {
  min-width: 66px;
}

.connection-footnote {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(280px, 1.3fr);
  gap: clamp(30px, 5vw, 74px);
  align-items: end;
  margin-bottom: clamp(34px, 5vw, 58px);
}

.section-intro h2,
.agent-copy h2,
.signoff h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.16;
}

.section-intro h2 {
  margin-top: 14px;
  font-size: clamp(34px, 4vw, 54px);
}

.section-intro > p {
  max-width: 42em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.placeholder-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--error);
  font-size: 12px;
  font-weight: 700;
}

.placeholder-note::before {
  width: 7px;
  height: 7px;
  background: var(--error);
  border-radius: 50%;
  content: "";
}

.account-ledger {
  border-top: 1px solid var(--fg);
}

.account-row {
  display: grid;
  grid-template-columns: minmax(180px, .54fr) minmax(0, 1.8fr);
  gap: clamp(18px, 3vw, 42px);
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.account-details {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(140px, .9fr) minmax(210px, 1.1fr);
  gap: 12px;
  min-width: 0;
  align-items: start;
}

.account-identity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
}

.account-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--sage) 50%, var(--border));
  border-radius: 50%;
  color: var(--sage);
}

.account-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.account-title {
  min-width: 0;
}

.account-title h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.account-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.account-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  align-items: stretch;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.field-value {
  min-width: 0;
  align-self: center;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.field-value.is-secret:not(.is-revealed) {
  color: color-mix(in oklch, var(--fg) 68%, var(--muted));
  letter-spacing: 0;
}

.field-link {
  color: color-mix(in oklch, var(--fg) 80%, var(--sage));
  text-decoration-color: color-mix(in oklch, var(--sage) 62%, transparent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.field-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.field-actions {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.control-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.control-button:hover {
  background: color-mix(in oklch, var(--fg) 7%, var(--surface));
  color: var(--fg);
}

.control-button + .control-button {
  border-left: 1px solid var(--border);
}

.control-button.is-copying {
  min-width: 80px;
  color: var(--success);
}

.copy-button {
  min-width: 80px;
}

.reveal-button {
  min-width: 64px;
}

.agent-section {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr);
  gap: clamp(32px, 5vw, 76px);
  padding: clamp(46px, 6vw, 82px) clamp(24px, 6vw, 82px);
  background: var(--ink);
  color: var(--surface);
}

.agent-copy h2 {
  margin-top: 14px;
  font-size: clamp(34px, 4vw, 52px);
}

.agent-copy > p {
  max-width: 36em;
  margin-top: 22px;
  color: color-mix(in oklch, var(--surface) 68%, var(--ink));
  font-size: 14px;
  line-height: 1.85;
}

.agent-steps {
  display: grid;
  gap: 0;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: agent-step;
}

.agent-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid color-mix(in oklch, var(--surface) 14%, transparent);
  color: color-mix(in oklch, var(--surface) 78%, var(--ink));
  font-size: 13px;
  counter-increment: agent-step;
}

.agent-steps li::before {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  content: "0" counter(agent-step);
}

.markdown-console {
  min-width: 0;
  overflow: hidden;
  background: color-mix(in oklch, var(--ink) 88%, black);
  border: 1px solid color-mix(in oklch, var(--gold) 30%, transparent);
  border-radius: var(--radius-frame);
}

.console-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid color-mix(in oklch, var(--surface) 14%, transparent);
}

.console-file {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: color-mix(in oklch, var(--surface) 72%, var(--ink));
  font-family: var(--font-mono);
  font-size: 11px;
}

.console-file::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--gold);
  border-radius: 50%;
  content: "";
}

.console-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.code-action {
  display: inline-flex;
  min-width: 84px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in oklch, var(--surface) 22%, transparent);
  border-radius: var(--radius-control);
  background: transparent;
  color: color-mix(in oklch, var(--surface) 86%, var(--ink));
  font-size: 11px;
  font-weight: 700;
}

.code-action:hover {
  background: color-mix(in oklch, var(--surface) 10%, transparent);
  border-color: color-mix(in oklch, var(--surface) 58%, transparent);
  color: var(--surface);
}

.code-action.is-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.code-action.is-primary:hover {
  background: color-mix(in oklch, var(--gold) 82%, var(--surface));
  border-color: color-mix(in oklch, var(--gold) 82%, var(--surface));
  color: var(--ink);
}

.code-action.is-copying {
  color: color-mix(in oklch, var(--success) 72%, var(--surface));
}

.markdown-console pre {
  max-height: 570px;
  overflow: auto;
  padding: 22px;
  color: color-mix(in oklch, var(--surface) 84%, var(--gold));
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.72;
  tab-size: 2;
}

.markdown-console code {
  font: inherit;
  white-space: pre;
}

.console-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid color-mix(in oklch, var(--gold) 22%, transparent);
  color: color-mix(in oklch, var(--surface) 62%, var(--ink));
  font-size: 11px;
  line-height: 1.6;
}

.console-warning svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.signoff {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(280px, 1.2fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: end;
  padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 82px);
  border-top: 1px solid var(--border);
}

.signoff h2 {
  margin-top: 14px;
  font-size: clamp(34px, 4vw, 56px);
}

.signoff-copy {
  max-width: 44em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.signoff-copy strong {
  display: block;
  margin-top: 18px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 500;
  line-height: 1.45;
}

.letter-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(24px, 6vw, 82px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.letter-bottom span:last-child {
  text-align: right;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes art-settle {
  from { opacity: 0; transform: translateY(12px) rotate(-1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1080px) {
  .locked-card {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    min-height: auto;
  }

  .locked-panel {
    padding: 42px;
  }

  .locked-panel h1 {
    font-size: clamp(44px, 5vw, 58px);
  }

  .greeting-grid {
    grid-template-columns: minmax(0, 1fr) minmax(270px, .65fr);
    gap: 42px;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .account-details {
    grid-template-columns: minmax(170px, 1.2fr) minmax(140px, .9fr) minmax(200px, 1.1fr);
  }
}

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

  .locked-art {
    min-height: 280px;
  }

  .locked-art img {
    width: auto;
    max-width: 100%;
    max-height: 340px;
  }

  .locked-panel {
    padding: clamp(30px, 7vw, 54px);
  }

  .greeting-grid,
  .section-intro,
  .connection-intro,
  .agent-section,
  .signoff {
    grid-template-columns: 1fr;
  }

  .keepsake {
    width: min(100%, 420px);
    justify-self: start;
  }

  .connection-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 16px;
  }

  .connection-identity,
  .connection-value,
  .connection-note {
    grid-column: 1;
  }

  .connection-copy {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
  }

  .agent-copy {
    max-width: 720px;
  }

  .section-intro {
    align-items: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 16px;
  }

  .site-bar {
    min-height: 58px;
  }

  .privacy-note {
    font-size: 10px;
  }

  .wordmark {
    font-size: 10px;
  }

  .locked-view {
    padding-top: 0;
  }

  .locked-card {
    border-radius: 4px;
  }

  .locked-art {
    min-height: 236px;
    padding: 14px;
  }

  .locked-art::after {
    inset: 8px;
  }

  .locked-art img {
    max-height: 245px;
  }

  .art-caption {
    margin-top: 8px;
    font-size: 9px;
  }

  .locked-panel {
    padding: 30px 20px 28px;
  }

  .locked-panel h1 {
    margin-top: 14px;
    font-size: clamp(38px, 12vw, 50px);
    letter-spacing: 0;
  }

  .locked-lead {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.75;
  }

  .field-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .unlock-form {
    margin-top: 24px;
  }

  .field-heading span {
    text-align: left;
  }

  .page-footer {
    min-height: 62px;
    justify-content: center;
    font-size: 9px;
    text-align: center;
  }

  .page-footer .footer-line,
  .page-footer span:last-child {
    display: none;
  }

  .letter-mast {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
  }

  .logout-button {
    width: 100%;
  }

  .greeting-section,
  .connection-section,
  .handoff-section,
  .agent-section,
  .signoff {
    padding-right: 20px;
    padding-left: 20px;
  }

  .greeting-copy h1 {
    font-size: clamp(42px, 13.5vw, 58px);
  }

  .connection-intro {
    align-items: start;
  }

  .connection-row {
    padding-block: 16px;
  }

  .connection-copy {
    min-width: 44px;
    width: 44px;
    padding-inline: 0;
  }

  .connection-copy.is-copying {
    min-width: 44px;
    width: 44px;
  }

  .connection-copy span {
    display: none;
  }

  .gift-facts {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gift-fact {
    grid-template-columns: 30px minmax(0, .6fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
  }

  .gift-fact:first-child {
    border-top: 0;
  }

  .keepsake {
    width: 100%;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-block: 24px;
  }

  .account-details {
    grid-template-columns: 1fr;
  }

  .account-identity {
    grid-column: auto;
  }

  .console-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .console-file {
    min-height: 28px;
    padding-inline: 4px;
  }

  .console-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .code-action {
    min-width: 0;
    min-height: 44px;
  }

  .markdown-console pre {
    max-height: 480px;
    padding: 17px;
    font-size: 11px;
  }

  .letter-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 20px;
  }

  .letter-bottom span:last-child {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .page-shell {
    padding-inline: 12px;
  }

  .locked-panel {
    padding-inline: 16px;
  }

  .greeting-section,
  .connection-section,
  .handoff-section,
  .agent-section,
  .signoff {
    padding-right: 16px;
    padding-left: 16px;
  }

  .field-actions .control-button {
    padding-inline: 8px;
  }

  .reveal-button {
    min-width: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .spinner {
    animation: none;
    border-color: var(--fg);
  }
}
