:root {
  color-scheme: light;
  --font-display: "Instrument Serif", serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --world-sage: #5f7154;
  --world-deep: #293f34;
  --paper: #f2ebdb;
  --paper-warm: #f7f0e3;
  --paper-deep: #e2dac6;
  --ink: #211a13;
  --ink-soft: #564a3d;
  --ink-faint: #756958;
  --rule: rgba(33, 26, 19, .18);
  --hairline: rgba(33, 26, 19, .09);
  --green: #42694e;
  --green-deep: #2f513b;
  --rose: #995c58;
  --amber: #8a6417;
  --blue: #4f6573;
  --shadow: 0 16px 45px rgba(31, 28, 20, .22);
  --rail-width: 154px;
  --topbar-height: 72px;
  --shell-head-height: 44px;
  --shell-night: #07100c;
  --shell-starlight: #d7c8a5;
  --shell-line: rgba(228, 216, 188, .34);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: var(--font-body);
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; min-height: 100dvh; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--world-sage);
  overflow-x: hidden;
  padding-top: var(--shell-head-height);
}

body.home-standalone {
  padding-top: calc(var(--shell-head-height) + var(--safe-top));
}

body.home-standalone .shell-running-head {
  height: calc(var(--shell-head-height) + var(--safe-top));
  padding-top: var(--safe-top);
}

body.home-standalone .shell-panel {
  top: calc(var(--shell-head-height) + var(--safe-top) + 8px);
  max-height: calc(100dvh - var(--shell-head-height) - var(--safe-top) - 20px);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: calc(var(--shell-head-height) + 12px);
  z-index: 200;
  padding: 9px 14px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(calc(-100% - var(--shell-head-height) - 18px));
}

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

.painted-world {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--world-sage);
}

.painted-world svg { width: 100%; height: 100%; display: block; }
.world-sun { transform-box: fill-box; transform-origin: center; animation: world-sun-breathe 10s ease-in-out infinite; }
.world-hill { transform-box: fill-box; transform-origin: 50% 100%; }
.world-hill-far { animation: world-meadow-far 24s ease-in-out infinite; }
.world-hill-mid { animation: world-meadow-mid 18s ease-in-out infinite; }
.world-hill-near { animation: world-meadow-near 13s ease-in-out infinite; }
.world-flowers { transform-box: fill-box; transform-origin: 50% 100%; animation: world-flower-sway 8s ease-in-out infinite; }

@keyframes world-sun-breathe { 0%, 100% { opacity: .82; transform: scale(.985); } 50% { opacity: .91; transform: scale(1.025); } }
@keyframes world-meadow-far { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.008); } }
@keyframes world-meadow-mid { 0%, 100% { transform: scaleY(1.004); } 50% { transform: scaleY(.997); } }
@keyframes world-meadow-near { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.006); } }
@keyframes world-flower-sway { 0%, 100% { transform: skewX(-.35deg); } 50% { transform: skewX(.55deg); } }

.visually-hidden {
  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;
}

.shell-boot {
  --boot-shift-x: 0px;
  --boot-shift-y: 0px;
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  color: #efe5cf;
  overflow: hidden;
}

.shell-boot-ground {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 43%, #14251d 0, #0a1712 28%, var(--shell-night) 68%),
    var(--shell-night);
  transition: opacity .62s ease;
}

.shell-boot-stack {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  gap: 30px;
  text-align: center;
}

.shell-boot-mark {
  width: clamp(88px, 12vw, 116px);
  height: auto;
  color: #efe7d3;
  overflow: visible;
  transform-origin: center;
}

.shell-boot-pane {
  opacity: 0;
  transform: scale(.94);
  transform-box: fill-box;
  transform-origin: center;
}

.shell-boot-pane-a { animation: shell-stain-arrive .5s .12s ease forwards; }
.shell-boot-pane-b { animation: shell-stain-arrive .5s .28s ease forwards; }
.shell-boot-pane-c { animation: shell-stain-arrive .5s .44s ease forwards; }

.shell-boot-frame path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: shell-pane-draw .82s .18s ease forwards;
}

.shell-boot-lamp {
  opacity: 0;
  transform: scale(.82);
  animation: shell-lamp-flash 1.05s .6s ease forwards, shell-lamp-breathe 7s 1.75s ease-in-out infinite;
}

.shell-boot-copy { opacity: 0; transform: translateY(8px); animation: shell-copy-arrive .52s 1.08s ease forwards; }
.shell-boot-wordmark { font: 400 clamp(38px, 6vw, 56px)/1 var(--font-display); letter-spacing: -.025em; }
.shell-boot-rule { width: 34px; height: 1px; margin: 17px auto 12px; background: var(--shell-line); }
.shell-boot .client-load-progress { gap: 0; }
.shell-boot .client-load-progress p { margin: 0; color: #bfb59e; font: 400 10px/1.5 var(--font-mono); letter-spacing: .13em; text-transform: uppercase; }
.shell-boot-block { display: block; width: 5px; height: 8px; margin: 11px auto 0; background: #e1c88e; opacity: .34; }
.shell-boot.is-waiting .shell-boot-block { animation: shell-block-wait 1.05s steps(2, end) infinite; }

.shell-boot.is-return .shell-boot-pane { opacity: 1; transform: none; animation: none; }
.shell-boot.is-return .shell-boot-frame path { stroke-dashoffset: 0; animation: none; }
.shell-boot.is-return .shell-boot-lamp { opacity: 1; transform: none; animation: shell-lamp-breathe 2.8s ease-in-out infinite; }
.shell-boot.is-return .shell-boot-copy { opacity: 1; transform: none; animation: none; }

.shell-boot.is-handoff { pointer-events: none; }
.shell-boot.is-handoff .shell-boot-ground { opacity: 0; }
.shell-boot.is-handoff .shell-boot-copy { opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }
.shell-boot.is-handoff .shell-boot-mark {
  filter: none;
  transform: translate(var(--boot-shift-x), var(--boot-shift-y)) scale(.16);
  transition: transform .76s cubic-bezier(.2, .75, .25, 1), filter .25s ease;
}

.shell-boot.is-failed .shell-boot-copy { opacity: 1; transform: none; animation: none; }
.shell-boot.is-failed .client-load-progress { display: none; }
.shell-boot .client-load-failure {
  width: min(590px, calc(100vw - 40px));
  padding: clamp(24px, 6vw, 48px);
  border-color: rgba(228, 216, 188, .25);
  background: #101d17;
  color: #efe5cf;
}
.shell-boot .client-load-failure h1 { color: #efe5cf; }
.shell-boot .client-load-failure > p:not(.eyebrow) { color: #c7bda8; }
.shell-boot .client-load-failure .secondary-action { border-color: #efe5cf; color: #efe5cf; }

@keyframes shell-pane-draw { to { stroke-dashoffset: 0; } }
@keyframes shell-stain-arrive { to { opacity: 1; transform: scale(1); } }
@keyframes shell-lamp-flash {
  0% { opacity: 0; transform: scale(.82); }
  44% { opacity: 1; transform: scale(1.035); }
  62% { opacity: .68; transform: scale(.985); }
  78% { opacity: 1; transform: scale(1.012); }
  100% { opacity: .92; transform: scale(1); }
}
@keyframes shell-copy-arrive { to { opacity: 1; transform: translateY(0); } }
@keyframes shell-lamp-breathe { 0%, 100% { opacity: .88; } 50% { opacity: 1; } }
@keyframes shell-block-wait { 50% { opacity: 1; } }

.shell-running-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: var(--shell-head-height);
  display: grid;
  grid-template-columns: minmax(178px, auto) minmax(0, 1fr) auto;
  align-items: center;
  color: #30281e;
  background: #eee5d3;
  border-bottom: 1px solid rgba(40, 32, 22, .22);
  box-shadow: 0 2px 0 rgba(31, 27, 19, .035);
  opacity: .001;
  transform: translateY(-4px);
  transition: color .32s ease, background-color .32s ease, opacity .24s ease, transform .24s ease;
}

body.shell-has-landed .shell-running-head { opacity: 1; transform: none; }
body.curtain-up .shell-running-head { color: #ece2cd; background: #1b2b22; border-bottom-color: rgba(236, 226, 205, .16); }

.shell-brand {
  align-self: stretch;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-right: 1px solid currentColor;
  padding: 0 14px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.shell-brand:hover, .shell-head-button:hover, .shell-curtain:hover { background: rgba(88, 74, 53, .08); }
body.curtain-up .shell-brand:hover, body.curtain-up .shell-head-button:hover, body.curtain-up .shell-curtain:hover { background: rgba(255, 255, 255, .07); }
.shell-head-mark { flex: 0 0 auto; color: #2e2a24; overflow: visible; }
.shell-head-frame { opacity: .96; }
.shell-head-lamp { opacity: .94; }
.shell-wordmark { overflow: hidden; font: 400 20px/1 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }

.shell-context { min-width: 0; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 0 12px; font-size: 11px; }
.shell-context strong { max-width: min(34vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.shell-app-name { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.shell-context-rule { opacity: .42; }

.shell-signals { align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
.shell-adapter-state, .shell-time, .shell-head-button { font-family: var(--font-mono); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.shell-adapter-state { display: flex; align-items: center; gap: 7px; padding: 0 12px; white-space: nowrap; }
.shell-adapter-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.shell-adapter-state[data-state="ready"]::before { background: var(--green); }
.shell-adapter-state[data-state="error"]::before { background: var(--rose); }
.shell-time { min-width: 48px; padding: 0 8px; text-align: center; white-space: nowrap; }
.shell-head-button { align-self: stretch; border: 0; border-left: 1px solid currentColor; padding: 0 13px; color: inherit; background: transparent; cursor: pointer; }
.shell-curtain { align-self: stretch; width: 42px; display: grid; place-items: start center; border: 0; border-left: 1px solid currentColor; padding: 0; color: inherit; background: transparent; cursor: pointer; }

.shell-panel {
  position: fixed;
  top: calc(var(--shell-head-height) + 8px);
  z-index: 95;
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100vh - var(--shell-head-height) - 20px);
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.shell-launcher-panel { left: 8px; }
.shell-settings-panel { right: 8px; }
.shell-panel-heading { position: relative; display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 0 34px 18px 0; border-bottom: 1px solid var(--rule); }
.shell-panel-heading h2 { margin: 0; font: 400 38px/1 var(--font-display); }
.shell-panel-heading .sheet-close { top: -8px; right: -8px; }
.shell-app-ticket { width: 100%; display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; margin: 18px 0; border: 1px solid var(--ink); padding: 13px; background: var(--paper); text-align: left; cursor: pointer; }
.shell-app-ticket-mark { display: grid; place-items: center; width: 42px; height: 50px; color: var(--paper); background: var(--world-deep); font: 400 28px/1 var(--font-display); }
.shell-app-ticket strong, .shell-app-ticket small { display: block; }
.shell-app-ticket small { margin-top: 4px; color: var(--ink-faint); }
.shell-place-card { padding: 17px; border: 1px solid var(--rule); background: var(--paper); }
.shell-place-card > strong { font: 400 28px/1 var(--font-display); }
.shell-place-card p:last-child, .shell-panel-note { margin-bottom: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.shell-panel-note { margin-top: 18px; }
.shell-status-list { margin: 18px 0; border-top: 1px solid var(--rule); }
.shell-status-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.shell-status-list dt { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.shell-status-list dd { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.shell-settings-actions { display: grid; gap: 9px; }
.shell-settings-actions > button { width: 100%; min-height: 44px; }
.install-home-trigger[data-state="ready"] { border-color: var(--green-deep); background: var(--green-deep); }
.install-home-trigger[data-state="installed"] { border-color: var(--rule); color: var(--ink); background: var(--paper); }

.app-shell {
  min-height: calc(100vh - var(--shell-head-height));
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
}

body:not([data-home-view="scene"]) .app-shell { display: block; }
body:not([data-home-view="scene"]) .paper-register { min-height: calc(100vh - var(--shell-head-height)); }

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--rail-width) 1fr auto;
  align-items: center;
  min-width: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: margin .45s ease, background-color .3s ease;
  z-index: 20;
}

.home-edition {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  border: 0;
  border-right: 1px solid var(--rule);
  padding: 0 22px;
  background: transparent;
  cursor: pointer;
}

.home-edition span { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.home-edition em { font-family: var(--font-mono); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); }

.place-title { min-width: 0; padding: 0 28px; }
.place-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eyebrow, .edition-mark {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar-actions { display: flex; align-items: center; gap: 14px; padding-right: 20px; }

.sync-state {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.round-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper-warm);
  cursor: pointer;
}

.rail {
  grid-column: 1;
  grid-row: 2;
  background: var(--paper-deep);
  border-right: 1px solid var(--rule);
  z-index: 15;
  transition: margin .45s ease, background-color .3s ease;
}

.primary-navigation { display: grid; gap: 2px; padding: 22px 12px; }

.primary-navigation button {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  padding: 11px 10px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.primary-navigation button span { color: var(--ink-faint); text-align: center; }
.primary-navigation button:hover { background: rgba(255, 255, 255, .28); }
.primary-navigation button[aria-current="page"] { border-left-color: var(--ink); color: var(--ink); background: rgba(255, 255, 255, .42); }

.paper-register {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: calc(100vh - var(--shell-head-height) - var(--topbar-height));
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, var(--hairline) .8px, transparent .9px);
  background-size: 18px 18px;
  transition: margin .45s ease, box-shadow .45s ease;
  z-index: 10;
}

.paper-register:focus { outline: 1px solid var(--rule); outline-offset: -1px; }

body.curtain-up .topbar { margin: 20px 32px 0; background: var(--paper); box-shadow: var(--shadow); }
body.curtain-up .rail { margin: 0 0 24px 32px; box-shadow: -12px 22px 36px rgba(20, 32, 24, .18); }
body.curtain-up .paper-register { margin: 0 32px 24px 0; box-shadow: 18px 25px 48px rgba(20, 32, 24, .28); }

.loading-view {
  min-height: calc(100vh - var(--shell-head-height) - var(--topbar-height));
  display: grid;
  place-content: center;
  color: var(--ink-faint);
  text-align: center;
}

.client-load-progress {
  display: grid;
  gap: 18px;
}

.client-load-failure {
  width: min(620px, calc(100vw - 44px));
  padding: clamp(30px, 7vw, 64px);
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  color: var(--ink);
}

.client-load-failure[hidden] { display: none; }
.client-load-failure h1 { margin: 12px 0 18px; font: 400 clamp(42px, 6vw, 68px)/.94 var(--font-display); }
.client-load-failure > p:not(.eyebrow) { margin: 0 0 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.client-load-failure .secondary-action { display: inline-block; text-decoration: none; }

.proof-mark {
  width: 28px;
  height: 28px;
  margin: auto;
  border: 1px solid var(--ink-faint);
  border-radius: 50%;
  position: relative;
  animation: proof-turn 1.8s linear infinite;
}

.proof-mark::after { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 18px; background: var(--ink); transform-origin: 50% 19px; }

@keyframes proof-turn { to { transform: rotate(360deg); } }

.commission-view {
  min-height: calc(100vh - var(--shell-head-height));
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(520px, 1.2fr);
  background: var(--paper);
}

.access-view { min-height: calc(100vh - var(--shell-head-height)); display: grid; place-items: center; padding: 40px 22px; background: var(--paper); }
.access-view > div { width: min(620px, 100%); padding: clamp(30px, 7vw, 74px); border: 1px solid var(--rule); background: var(--paper-warm); }
.access-view h1 { margin: 12px 0 18px; font: 400 clamp(48px, 7vw, 78px)/.92 var(--font-display); }
.access-view p { margin: 0 0 28px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }

.commission-intro {
  padding: clamp(42px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f4ead7;
  background: var(--world-deep);
}

.commission-intro .edition-mark { color: #b9c6ae; }
.commission-intro h1 { max-width: 560px; margin: 14px 0 20px; font: 400 clamp(54px, 7vw, 96px)/.9 var(--font-display); letter-spacing: -.035em; }
.commission-intro p { max-width: 520px; margin: 0; color: #d7dfcf; font-size: 17px; line-height: 1.65; }

.commission-promise { display: grid; gap: 10px; margin-top: 52px; color: #c7d0c0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.commission-promise span::before { content: "✓"; margin-right: 10px; color: #e4b66f; }

.paper-form {
  align-self: center;
  width: min(840px, 100%);
  padding: clamp(36px, 7vw, 100px);
}

.form-heading { display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start; margin-bottom: 42px; }
.folio-number { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--rule); border-radius: 50%; font-family: var(--font-mono); font-size: 11px; }
.form-heading h2 { margin: 0; font: 400 clamp(34px, 4vw, 52px)/1 var(--font-display); }

.field-grid { display: grid; gap: 22px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field.wide { grid-column: 1 / -1; }
.field { display: grid; gap: 8px; align-content: start; }
.field > span { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field small { color: var(--ink-faint); font-size: 11px; line-height: 1.45; }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 11px 2px;
  color: var(--ink);
  background: transparent;
  resize: vertical;
}

.field textarea { border: 1px solid var(--rule); padding: 12px; background: var(--paper-warm); }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.form-actions p { max-width: 390px; margin: 0; color: var(--ink-faint); font-size: 12px; line-height: 1.55; }

.primary-action,
.secondary-action,
.quiet-action,
.danger-action {
  border: 1px solid var(--ink);
  padding: 11px 17px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.secondary-action { background: transparent; color: var(--ink); }
.quiet-action { border-color: var(--rule); background: transparent; color: var(--ink-soft); }
.danger-action { border-color: var(--rose); background: var(--rose); }
.primary-action:disabled, .secondary-action:disabled { opacity: .45; cursor: not-allowed; }

.scene-view { min-height: calc(100vh - var(--shell-head-height) - var(--topbar-height)); padding: 34px clamp(22px, 4vw, 64px) 90px; }
.scene-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--rule); }
.scene-header h1 { margin: 0; font: 400 clamp(48px, 5vw, 76px)/.95 var(--font-display); letter-spacing: -.025em; }
.scene-deck { max-width: 700px; margin: 13px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.scene-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.scene-content { min-width: 0; max-width: 100%; padding-top: 28px; }

.edition-grid { min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 28px; }
.edition-grid > * { min-width: 0; max-width: 100%; }
.paper-panel { min-width: 0; border: 1px solid var(--rule); background: var(--paper-warm); box-shadow: 0 8px 0 rgba(33, 26, 19, .025); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.panel-heading h2, .panel-heading h3 { margin: 0; font-family: var(--font-display); font-weight: 400; }
.panel-heading h2 { font-size: 28px; }
.panel-heading h3 { font-size: 23px; }
.panel-body { padding: 18px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); margin-bottom: 28px; background: var(--paper-warm); }
.metric { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--rule); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font: 400 30px/1 var(--font-display); }

.level-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; }
.level-tabs button { white-space: nowrap; border: 1px solid var(--rule); padding: 8px 12px; color: var(--ink-soft); background: transparent; cursor: pointer; }
.level-tabs button[aria-selected="true"] { border-color: var(--ink); color: var(--paper); background: var(--ink); }

.plan-stage { position: relative; min-height: 480px; margin-top: 12px; border: 1px solid var(--rule); overflow: hidden; background-color: #f7f0e3; background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px); background-size: 24px 24px; }
.plan-stage svg { display: block; width: 100%; max-width: 100%; min-height: 480px; }
.plan-empty { min-height: 480px; display: grid; place-content: center; gap: 14px; padding: 40px; text-align: center; }
.plan-empty p { max-width: 440px; margin: 0 auto; color: var(--ink-soft); line-height: 1.55; }

.space-list { display: grid; gap: 1px; background: var(--rule); }
.space-card { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; border: 0; padding: 15px 16px; background: var(--paper-warm); text-align: left; cursor: pointer; }
.space-card:hover, .space-card[aria-current="true"] { background: #fff9ee; }
.space-card strong { display: block; }
.space-card small { display: block; margin-top: 3px; color: var(--ink-faint); }
.room-facts { padding: 18px 16px; border-top: 1px solid var(--rule); }
.room-facts dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 14px; }
.room-facts dl div { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.room-facts dt { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; }
.room-facts dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 24px; }
.room-facts ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.status-mark { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-faint); text-transform: uppercase; }
.status-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.status-mark[data-state="planning_grade"]::before { background: var(--green); }
.status-mark[data-state="not_started"]::before { background: var(--ink-faint); }

.empty-register { padding: 44px 26px; text-align: center; }
.empty-register h2 { margin: 0 0 8px; font: 400 34px/1 var(--font-display); }
.empty-register p { max-width: 550px; margin: 0 auto 22px; color: var(--ink-soft); line-height: 1.55; }

.record-table { width: 100%; border-collapse: collapse; }
.record-table th, .record-table td { border-bottom: 1px solid var(--rule); padding: 12px 10px; text-align: left; vertical-align: top; }
.record-table th { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

.pending-invite { margin: 24px 0; padding: 18px; border: 1px solid var(--rule); background: var(--paper-warm); }
.pending-invite p { margin: 0 0 16px; font-size: 13px; }

.image-board-panel { margin-bottom: 28px; overflow: hidden; }
.image-board-heading { align-items: end; }
.image-board-heading > div > p { margin: 0 0 5px; }
.compact-filter { display: grid; gap: 5px; min-width: 180px; }
.compact-filter span { color: var(--ink-faint); font: 500 8px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.compact-filter select { width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 7px 2px; color: var(--ink); background: transparent; }
.image-custody-line { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 14px 18px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.image-custody-line p, .image-custody-line [data-image-detail-state] { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.image-content-retry { justify-self: start; }
.image-board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); }
.image-board-card { min-width: 0; display: grid; grid-template-rows: auto 1fr; border: 0; padding: 0; color: var(--ink); background: var(--paper-warm); text-align: left; cursor: pointer; }
.image-board-card:hover, .image-board-card:focus-visible { background: #fff9ee; }
.image-board-preview, .image-detail-preview { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; background: #d9d4bd; }
.image-board-preview img, .image-detail-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-board-placeholder { display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; height: 100%; color: #e9e3d4; background: var(--world-deep); }
.image-board-placeholder span { font: 500 8px/1 var(--font-mono); letter-spacing: .15em; }
.image-board-placeholder strong { font: 400 30px/1 var(--font-display); }
.image-board-copy { min-width: 0; display: block; padding: 15px; }
.image-board-copy > strong, .image-board-copy > small, .image-pixel-boundary { display: block; }
.image-board-copy > strong { margin-top: 5px; overflow: hidden; font: 400 25px/1 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.image-board-copy > small { margin-top: 8px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.image-pixel-boundary { margin-top: 12px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.image-board-state { min-height: 260px; }
.image-board-empty { min-height: 250px; display: grid; place-content: center; }
.image-custody-notice { margin-bottom: 28px; }
.room-inspiration-action { width: 100%; margin-top: 16px; }

.image-detail-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1fr); gap: 26px; padding-top: 24px; }
.image-detail-copy > p { color: var(--ink-soft); line-height: 1.6; }
.artifact-detail-list { margin: 0; }
.artifact-detail-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.artifact-detail-list dt { color: var(--ink-faint); font: 500 8px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.artifact-detail-list dd { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.image-detail-copy .image-custody-line { grid-template-columns: 1fr; margin-top: 18px; border: 1px solid var(--rule); }

.image-upload-progress { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 14px; align-items: center; margin: 18px 0; }
.image-upload-progress progress { width: 100%; height: 6px; border: 0; accent-color: var(--green-deep); }
.image-upload-progress span { color: var(--ink-faint); font: 500 8px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.image-upload-error { margin: 0 0 18px; border-color: rgba(126, 55, 45, .38); }
.image-upload-layout { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.image-composer-preview { min-width: 0; padding: 14px; border: 1px solid var(--rule); background: var(--paper); }
.image-composer-preview > p { margin: 13px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; word-break: break-word; }
.image-composer-fields .wide { grid-column: 1 / -1; }
.image-composer-fields code { font-family: var(--font-mono); font-size: 10px; }
.image-source-chooser { min-height: 390px; display: grid; place-content: center; justify-items: center; gap: 20px; padding: 38px; border: 1px dashed var(--rule); background: var(--paper); text-align: center; }
.image-source-chooser > p { max-width: 560px; margin: 0; color: var(--ink-soft); line-height: 1.6; }
.image-source-chooser > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.image-source-action { position: relative; overflow: hidden; }
.image-source-action input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; opacity: 0; cursor: pointer; }
.image-source-action:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.image-source-note { font-size: 11px; }

.home-guide-panel { margin-bottom: 28px; overflow: hidden; }
.home-guide-heading { align-items: end; }
.home-guide-heading > div > p { margin: 0 0 5px; }
.home-guide-state { min-height: 240px; }
.home-guide-document-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 24px; border-bottom: 1px solid var(--rule); }
.home-guide-document-heading h3 { margin: 4px 0 0; font: 400 clamp(36px, 5vw, 58px)/.95 var(--font-display); }
.home-guide-document-heading > p { margin: 0; color: var(--ink-faint); font: 500 9px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.guide-access-boundary { display: grid; grid-template-columns: 20px 1fr; gap: 9px; margin: 18px 22px; padding: 12px 14px; border: 1px solid var(--rule); background: var(--paper); }
.guide-access-boundary > span { color: var(--green); }
.guide-access-boundary p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.home-guide-layout { display: grid; grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.home-guide-index { min-width: 0; padding: 22px 18px; border-right: 1px solid var(--rule); background: var(--paper); }
.home-guide-index > p { margin: 0 0 12px; }
.home-guide-index ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.home-guide-index li { min-width: 0; }
.home-guide-index a { display: block; overflow: hidden; border-left: 2px solid transparent; padding: 8px 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; text-decoration: none; text-overflow: ellipsis; }
.home-guide-index a:hover, .home-guide-index a:focus-visible { border-left-color: var(--ink); color: var(--ink); background: var(--paper-warm); }
.guide-document { min-width: 0; background: var(--paper-warm); }
.guide-tab { min-width: 0; padding: clamp(24px, 4vw, 48px); scroll-margin-top: calc(var(--shell-head-height) + var(--topbar-height) + 18px); }
.guide-tab + .guide-tab { border-top: 1px solid var(--rule); }
.guide-tab-header { margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.guide-tab-header p { margin: 0 0 5px; }
.guide-tab-header h3 { margin: 0; font: 400 31px/1 var(--font-display); }
.guide-heading, .guide-paragraph, .guide-list-item > span:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-heading { margin: 28px 0 10px; color: var(--ink); }
.guide-heading[data-level="1"] { font: 400 clamp(30px, 4vw, 46px)/1 var(--font-display); }
.guide-heading[data-level="2"] { font: 400 28px/1.05 var(--font-display); }
.guide-heading[data-level="3"] { font: 400 22px/1.1 var(--font-display); }
.guide-heading[data-level="4"], .guide-heading[data-level="5"], .guide-heading[data-level="6"] { font-size: 15px; font-weight: 700; line-height: 1.3; }
.guide-paragraph { max-width: 800px; margin: 10px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.72; }
.guide-paragraph.is-empty { min-height: 12px; }
.guide-document a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.guide-list { display: grid; gap: 7px; max-width: 800px; margin: 14px 0 20px; }
.guide-list-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.guide-list-marker { color: var(--green-deep); font-family: var(--font-mono); font-size: 10px; line-height: 2.2; text-align: right; }
.guide-depth-1 { padding-inline-start: 14px; }
.guide-depth-2 { padding-inline-start: 28px; }
.guide-depth-3 { padding-inline-start: 42px; }
.guide-depth-4 { padding-inline-start: 56px; }
.guide-depth-5 { padding-inline-start: 70px; }
.guide-depth-6 { padding-inline-start: 84px; }
.guide-depth-7 { padding-inline-start: 98px; }
.guide-depth-8 { padding-inline-start: 112px; }
.guide-table-scroll { max-width: 100%; margin: 22px 0; overflow: auto; border: 1px solid var(--rule); background: var(--paper); }
.guide-table-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.guide-table { width: 100%; min-width: 420px; border-collapse: collapse; }
.guide-table td { min-width: 120px; padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); vertical-align: top; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-table td:last-child { border-right: 0; }
.guide-table .guide-paragraph { margin: 4px 0; font-size: 12px; }
.guide-table .guide-list { margin: 6px 0; }
.guide-table .guide-list-item { font-size: 12px; }
.guide-unsupported { display: grid; grid-template-columns: minmax(100px, .25fr) minmax(0, 1fr); gap: 14px; margin: 16px 0; padding: 12px 14px; border: 1px dashed var(--rule); color: var(--ink-faint); background: var(--paper); }
.guide-unsupported > span { font: 500 8px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.guide-unsupported p { margin: 0; font-size: 11px; line-height: 1.45; }
.guide-tab-empty { padding: 34px 0; color: var(--ink-soft); }
.home-guide-empty h3 { margin: 0 0 8px; font: 400 34px/1 var(--font-display); }
.guide-fidelity { padding: 20px 24px; border-top: 1px solid var(--rule); background: var(--paper); }
.guide-fidelity > p { max-width: 760px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.guide-fidelity > h4 { margin: 6px 0; font: 400 25px/1 var(--font-display); }
.guide-fidelity details { max-width: 760px; margin-top: 14px; }
.guide-fidelity summary { cursor: pointer; color: var(--ink-soft); font-size: 11px; }
.guide-fidelity ul { margin: 10px 0 0; padding-left: 20px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.guide-fidelity li span { font-family: var(--font-mono); font-size: 9px; }

.artifact-library-grid {
  display: grid;
  grid-template-columns: minmax(240px, .38fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.artifact-shelf { min-height: 390px; }
.artifact-reading-table { min-height: 540px; overflow: hidden; }
.library-evidence { margin-top: 28px; overflow-x: auto; }

.artifact-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 34px;
  color: var(--ink-soft);
  text-align: center;
}

.artifact-state h2, .artifact-state h3 { margin: 0; font: 400 34px/1 var(--font-display); color: var(--ink); }
.artifact-state p { max-width: 520px; margin: 0; line-height: 1.55; }
.artifact-reader-empty { min-height: 538px; }
.artifact-empty { padding-inline: 18px; }

.artifact-list { margin: 0; padding: 0; list-style: none; }
.artifact-list li + li { border-top: 1px solid var(--rule); }
.artifact-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  padding: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.artifact-list button:hover, .artifact-list button[aria-current="true"] { background: #fff9ee; }
.artifact-list button[aria-current="true"] { box-shadow: inset 3px 0 0 var(--ink); }
.artifact-list-mark { display: grid; place-items: center; width: 42px; height: 52px; border: 1px solid var(--rule); background: var(--paper); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.artifact-list strong, .artifact-list small { display: block; overflow: hidden; text-overflow: ellipsis; }
.artifact-list strong { white-space: nowrap; }
.artifact-list small { margin-top: 5px; color: var(--ink-faint); font-size: 10px; line-height: 1.35; }

.artifact-reader-heading { display: flex; justify-content: space-between; gap: 22px; align-items: start; padding: 22px; border-bottom: 1px solid var(--rule); }
.artifact-reader-heading h2 { margin: 0; font: 400 clamp(34px, 4vw, 52px)/.96 var(--font-display); }
.artifact-reader-heading > div > p:last-child { max-width: 660px; margin: 10px 0 0; color: var(--ink-soft); line-height: 1.5; }
.artifact-safety { display: grid; grid-template-columns: 20px 1fr; gap: 9px; margin: 18px 22px; padding: 12px 14px; border: 1px solid var(--rule); background: var(--paper); }
.artifact-safety > span { color: var(--green); }
.artifact-safety p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.artifact-frame-holder, [data-artifact-preview-frame], [data-artifact-confirm-frame] { min-height: 560px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); }
.artifact-frame { display: block; width: 100%; min-height: 720px; border: 0; background: var(--paper); }

.artifact-semantic { padding: 26px; border-top: 1px solid var(--rule); }
.artifact-semantic > h3 { margin: 4px 0 8px; font: 400 30px/1 var(--font-display); }
.artifact-semantic > p:not(.eyebrow), .artifact-semantic section p { color: var(--ink-soft); line-height: 1.55; }
.artifact-semantic section { padding: 18px 0; border-top: 1px solid var(--rule); }
.artifact-semantic section h4 { margin: 0 0 8px; font: 400 23px/1 var(--font-display); }
.artifact-semantic section p, .artifact-semantic section ul { margin: 7px 0; }
.artifact-semantic section small { color: var(--ink-faint); }

.artifact-composer-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); gap: 26px; padding-top: 24px; }
.artifact-composer-fields { min-width: 0; }
.artifact-composer-preview { min-width: 0; align-self: start; position: sticky; top: 0; border: 1px solid var(--rule); background: var(--paper); }
.artifact-composer-preview > .eyebrow { padding: 14px 16px 8px; }
.artifact-composer-preview [data-artifact-preview-frame], .artifact-composer-preview [data-artifact-confirm-frame] { min-height: 440px; }
.artifact-composer-preview .artifact-frame { min-height: 560px; }
.artifact-preview-note { margin: 0; padding: 13px 16px; border-top: 1px solid var(--rule); color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.artifact-section-stack { display: grid; gap: 18px; margin: 24px 0 14px; }
.artifact-section-editor { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--rule); background: var(--paper); }
.artifact-section-editor legend { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 7px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.artifact-section-editor legend .quiet-action { padding: 6px 9px; font-size: 9px; text-transform: none; letter-spacing: 0; }

.artifact-confirmation { display: grid; grid-template-columns: minmax(240px, .55fr) minmax(0, 1fr); gap: 28px; padding-top: 24px; }
.artifact-confirmation > div:first-child > p { color: var(--ink-soft); line-height: 1.6; }
.artifact-confirmation dl { margin: 24px 0 0; border-top: 1px solid var(--rule); }
.artifact-confirmation dl div { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.artifact-confirmation dt { color: var(--ink-faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.artifact-confirmation dd { margin: 0; text-align: right; }

.household-members-panel { margin-top: 28px; }
.household-participation { display: grid; grid-template-columns: minmax(220px, .45fr) minmax(0, 1fr); gap: 24px; }
.household-participation h3 { margin: 0 0 7px; font: 400 30px/1 var(--font-display); }
.household-participation p { color: var(--ink-soft); line-height: 1.5; }
.invite-receipt, .household-access-note, .custody-notice { padding: 18px; border: 1px solid var(--rule); background: var(--paper); }
.invite-receipt p:last-child, .household-access-note p:last-child, .custody-notice p:last-child { margin-bottom: 0; }
.custody-notice { margin-top: 24px; }
.artifact-custody-notice { margin: 0 0 24px; }

.paper-sheet {
  position: fixed;
  z-index: 80;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.stub-launcher {
  position: fixed;
  left: 20px;
  bottom: 14px;
  z-index: 50;
  width: 54px;
  display: grid;
  justify-items: center;
  gap: 2px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  filter: drop-shadow(0 7px 7px rgba(20, 32, 24, .26));
  cursor: pointer;
}

.stub-launcher:hover .stub-ticket { transform: translateY(-3px); }
.stub-ticket { display: block; width: 50px; height: 80px; transition: transform .2s ease; }
.stub-label { padding: 2px 5px; color: #eee5d3; background: var(--world-deep); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }

.stub-panel { left: 18px; bottom: 108px; width: min(390px, calc(100vw - 36px)); padding: 28px; }
.stub-panel h2 { margin: 0 0 14px; font: 400 37px/1 var(--font-display); }
.stub-panel > p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.55; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.stub-status { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; margin: 22px 0; padding: 14px; border: 1px solid var(--rule); }
.stub-status > span { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.stub-status[data-state="unavailable"] > span { background: var(--ink-faint); }
.stub-status p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

.modal-scrim { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 22px; background: rgba(26, 28, 23, .72); }
.modal { position: relative; width: min(760px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: 28px; background: var(--paper-warm); border: 1px solid var(--ink); box-shadow: var(--shadow); }
.modal.large { width: min(1080px, 100%); }
.modal-header { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.modal-header h2 { margin: 0; font: 400 40px/1 var(--font-display); }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }

.modal.install-modal { width: min(720px, 100%); }
.install-modal-header h2 { max-width: 520px; font-size: clamp(40px, 7vw, 62px); }
.install-home-intro {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.install-home-mark { display: block; width: 108px; height: 108px; }
.install-device-label { margin: 0 0 6px; color: var(--green-deep); font: 500 9px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.install-home-intro h3 { margin: 0; font: 400 38px/1 var(--font-display); }
.install-home-intro div > p:last-child { margin: 9px 0 0; color: var(--ink-soft); line-height: 1.5; }
.install-steps { display: grid; gap: 0; margin: 0; padding: 8px 0; list-style: none; counter-reset: install-step; }
.install-steps li {
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  line-height: 1.5;
  counter-increment: install-step;
}
.install-steps li::before {
  content: counter(install-step, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  font: 500 9px/1 var(--font-mono);
}
.install-boundary, .install-complete { margin-top: 20px; padding: 18px; border: 1px solid var(--rule); background: var(--paper); }
.install-boundary p:last-child, .install-complete p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.install-complete { border-color: rgba(66, 105, 78, .42); }
.install-complete strong { display: block; margin-bottom: 6px; color: var(--green-deep); }
.install-modal-footer > button { min-height: 44px; }

.census-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 22px 0; background: var(--rule); }
.census-progress button { border: 0; padding: 10px 7px; color: var(--ink-faint); background: var(--paper); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; cursor: pointer; }
.census-progress button[aria-current="step"] { color: var(--paper); background: var(--ink); }
.census-progress button[data-complete="true"]::before { content: "✓ "; }
.census-photo-drafts { margin-top: 14px; padding: 16px; border: 1px solid var(--rule); background: var(--paper); }
.census-photo-drafts > p { margin: 0; }
.census-photo-drafts ul { display: grid; gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.census-photo-drafts li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid var(--rule); }
.census-photo-drafts li > span { display: grid; gap: 3px; }
.census-photo-drafts small { color: var(--ink-faint); }
.census-photo-drafts .census-photo-boundary { color: var(--ink-faint); font-size: 12px; }
.census-photo-promotion-note { border-color: var(--ink); }

.repeat-list { display: grid; gap: 10px; }
.repeat-row { display: grid; grid-template-columns: 34px minmax(130px, 1fr) 110px 110px 42px; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--rule); background: var(--paper); }
.repeat-row.opening-row { grid-template-columns: 120px repeat(4, minmax(90px, 1fr)) 42px; }
.opening-card { position: relative; min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--rule); background: var(--paper); }
.opening-card legend { padding: 0 8px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.opening-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
.opening-wide { grid-column: span 2; }
.opening-remove { position: absolute; top: 8px; right: 8px; }
.row-number { align-self: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.mini-field { display: grid; gap: 5px; }
.mini-field span { color: var(--ink-faint); font-size: 10px; }
.mini-field small { color: var(--ink-faint); font-size: 9px; }
.mini-field input, .mini-field select { min-width: 0; width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 8px 2px; background: transparent; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--rule); background: transparent; cursor: pointer; }

.validation-list { display: grid; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.validation-list li { display: grid; grid-template-columns: 22px 1fr; gap: 7px; padding: 10px 12px; border: 1px solid var(--rule); background: var(--paper); }
.validation-list li[data-level="pass"]::before { content: "✓"; color: var(--green); }
.validation-list li[data-level="warn"]::before { content: "!"; color: var(--amber); }
.validation-list li[data-level="error"]::before { content: "×"; color: var(--rose); }

.dossier { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dossier-section { border-top: 1px solid var(--rule); padding-top: 14px; }
.dossier-section h3 { margin: 0 0 10px; font: 400 24px/1 var(--font-display); }
.dossier-section p { color: var(--ink-soft); line-height: 1.5; }

.toast-region { position: fixed; right: max(18px, var(--safe-right)); bottom: max(18px, var(--safe-bottom)); z-index: 120; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; color: var(--paper); background: var(--ink); box-shadow: var(--shadow); font-size: 13px; }
.toast[data-tone="error"] { background: var(--rose); }

@media (min-width: 681px) and (max-width: 1180px) {
  .scene-view { padding-inline: 24px; }
  .edition-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 980px) {
  :root { --rail-width: 82px; }
  .home-edition { padding: 0 14px; }
  .home-edition span { font-size: 18px; }
  .shell-date { display: none; }
  .primary-navigation button { grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 10px 2px; font-size: 10px; }
  .primary-navigation button span { font-size: 16px; }
  .edition-grid { grid-template-columns: 1fr; }
  .commission-view { grid-template-columns: 1fr; }
  .commission-intro { min-height: 44vh; }
  .home-guide-layout { grid-template-columns: 1fr; }
  .home-guide-index { border-right: 0; border-bottom: 1px solid var(--rule); }
  .home-guide-index ol { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .artifact-library-grid { grid-template-columns: 1fr; }
  .artifact-shelf { min-height: 0; }
  .artifact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artifact-list li + li { border-top: 0; }
  .artifact-list li { border-bottom: 1px solid var(--rule); }
  .artifact-composer-layout, .artifact-confirmation { grid-template-columns: 1fr; }
  .artifact-composer-preview { position: static; }
  .image-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-upload-layout, .image-detail-layout { grid-template-columns: 1fr; }
  .image-composer-preview { max-width: 560px; }
}

@media (max-width: 680px) {
  :root { --topbar-height: 60px; }
  .app-shell { display: block; padding-bottom: 68px; }
  .topbar { position: sticky; top: var(--shell-head-height); grid-template-columns: auto 1fr auto; height: var(--topbar-height); }
  body.home-standalone .app-shell { padding-bottom: calc(68px + var(--safe-bottom)); }
  body.home-standalone .topbar { top: calc(var(--shell-head-height) + var(--safe-top)); }
  .home-edition { border-right: 0; padding: 0 12px; }
  .home-edition em { display: none; }
  .shell-running-head { grid-template-columns: minmax(128px, auto) minmax(0, 1fr) auto; }
  .shell-brand { padding: 0 10px; gap: 7px; }
  .shell-wordmark { font-size: 17px; }
  .shell-context { justify-content: flex-start; gap: 5px; padding: 0 8px; }
  .shell-context strong { max-width: 24vw; }
  .shell-context-rule, .shell-context strong { display: none; }
  .shell-adapter-state, .shell-time { display: none; }
  .shell-head-button { width: 46px; overflow: hidden; padding: 0 7px; font-size: 0; }
  .shell-head-button::before { content: "Set"; font: 500 8px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
  .shell-curtain { width: 38px; }
  .shell-panel { top: calc(var(--shell-head-height) + 6px); left: 6px; right: 6px; width: auto; max-height: calc(100vh - var(--shell-head-height) - 12px); }
  body.home-standalone .shell-panel { top: calc(var(--shell-head-height) + var(--safe-top) + 6px); max-height: calc(100dvh - var(--shell-head-height) - var(--safe-top) - 12px); }
  .place-title { padding: 0 8px; }
  .place-title .eyebrow { display: none; }
  .topbar-actions { gap: 7px; padding-right: 10px; }
  .sync-state { display: none; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; height: 68px; border: 0; border-top: 1px solid var(--rule); background: var(--paper-deep); }
  body.home-standalone .rail { height: calc(68px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); }
  .primary-navigation { grid-template-columns: repeat(6, 1fr); height: 100%; padding: 4px; gap: 0; }
  .primary-navigation button { border-left: 0; border-top: 2px solid transparent; padding: 6px 1px; font-size: 8px; }
  .primary-navigation button[aria-current="page"] { border-left-color: transparent; border-top-color: var(--ink); }
  .paper-register { min-height: calc(100vh - var(--shell-head-height) - 68px); }
  body.curtain-up .topbar, body.curtain-up .rail, body.curtain-up .paper-register { margin: 0; box-shadow: none; }
  .commission-view { min-height: calc(100vh - var(--shell-head-height) - 68px); }
  .commission-intro { padding: 42px 24px; }
  .commission-intro h1 { font-size: 58px; }
  .commission-promise { margin-top: 28px; }
  .paper-form { padding: 36px 22px 100px; }
  .two-column { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .field input, .field select, .field textarea, .mini-field input, .mini-field select { font-size: 16px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .primary-action { width: 100%; }
  .scene-view { padding: 24px 16px 84px; }
  .scene-header { align-items: stretch; flex-direction: column; }
  .scene-actions { justify-content: flex-start; }
  .scene-actions > button { flex: 1; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
  .plan-stage, .plan-stage svg, .plan-empty { min-height: 360px; }
  .repeat-row, .repeat-row.opening-row { grid-template-columns: 28px 1fr 1fr; }
  .repeat-row > .mini-field:nth-of-type(n + 3), .repeat-row.opening-row > .mini-field:nth-of-type(n + 3) { grid-column: span 1; }
  .repeat-row .icon-button { grid-column: 3; grid-row: 1; justify-self: end; }
  .opening-card { padding: 16px 12px; }
  .opening-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opening-wide { grid-column: 1 / -1; }
  .census-progress { grid-template-columns: repeat(5, minmax(80px, 1fr)); overflow-x: auto; }
  .census-photo-drafts li { align-items: stretch; flex-direction: column; }
  .census-photo-drafts li .secondary-action { width: 100%; }
  .dossier { grid-template-columns: 1fr; }
  .artifact-list { grid-template-columns: 1fr; }
  .artifact-reader-heading { align-items: stretch; flex-direction: column; }
  .artifact-reader-heading .secondary-action { width: 100%; }
  .artifact-frame-holder { min-height: 430px; }
  .artifact-frame { min-height: 560px; }
  .artifact-composer-preview [data-artifact-preview-frame], .artifact-composer-preview [data-artifact-confirm-frame] { min-height: 360px; }
  .artifact-section-editor { padding: 14px 10px; }
  .household-participation { grid-template-columns: 1fr; }
  .stub-launcher { left: auto; right: 14px; bottom: 78px; }
  .stub-panel { left: 14px; bottom: 78px; }
  body.home-standalone .stub-launcher { right: max(14px, var(--safe-right)); bottom: calc(78px + var(--safe-bottom)); }
  body.home-standalone .stub-panel { left: max(14px, var(--safe-left)); bottom: calc(78px + var(--safe-bottom)); }
  .modal-scrim { align-items: end; padding: 10px max(10px, var(--safe-right)) max(10px, var(--safe-bottom)) max(10px, var(--safe-left)); }
  .modal.install-modal { max-height: calc(100dvh - var(--safe-top) - 12px); padding: 24px 20px; }
  .image-board-heading { align-items: start; flex-direction: column; }
  .compact-filter { width: 100%; }
  .image-custody-line { grid-template-columns: 1fr; gap: 9px; }
  .image-board-grid { grid-template-columns: 1fr; }
  .image-board-card { grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto; }
  .image-board-preview { aspect-ratio: 1; }
  .image-board-copy > strong { font-size: 22px; }
  .image-source-chooser { min-height: 330px; padding: 28px 18px; }
  .image-source-chooser > div, .image-source-action { width: 100%; }
  .home-guide-heading, .home-guide-document-heading { align-items: stretch; flex-direction: column; }
  .home-guide-heading .secondary-action { width: 100%; }
  .home-guide-index ol { grid-template-columns: 1fr; }
  .home-guide-index .guide-depth-1, .home-guide-index .guide-depth-2, .home-guide-index .guide-depth-3, .home-guide-index .guide-depth-4, .home-guide-index .guide-depth-5, .home-guide-index .guide-depth-6, .home-guide-index .guide-depth-7, .home-guide-index .guide-depth-8 { padding-inline-start: 14px; }
  .guide-tab { padding: 24px 18px; }
  .guide-list-item.guide-depth-5, .guide-list-item.guide-depth-6, .guide-list-item.guide-depth-7, .guide-list-item.guide-depth-8 { padding-inline-start: 56px; }
  .guide-unsupported { grid-template-columns: 1fr; gap: 5px; }
  .artifact-detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .image-upload-progress { grid-template-columns: 1fr; }
  .install-home-intro { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 22px 0; }
  .install-home-mark { width: 76px; height: 76px; }
  .install-home-intro h3 { font-size: 30px; }
  .install-modal-footer { align-items: stretch; flex-direction: column-reverse; }
  .install-modal-footer > button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .shell-boot-pane { opacity: 1; transform: none; }
  .shell-boot-frame path { stroke-dashoffset: 0; }
  .shell-boot-lamp, .shell-boot-copy { opacity: 1; transform: none; }
  .world-sun, .world-hill, .world-flowers { animation: none !important; transform: none !important; }
}
