/* Component styles. Rules: colors/z/durations/alphas ONLY via tokens.
   Lift is the offset edge (.lifted from tokens); shadows are banned. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--vellum); color: var(--ink);
  font-family: Georgia, 'Iowan Old Style', serif;
  overscroll-behavior: none;
}
.mono { font-family: ui-monospace, Menlo, monospace; }

/* ---- chrome bar (minimal button space; never combines with gestures) ---- */
.bar {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: var(--s2) var(--s3); border-bottom: 1px solid var(--hairline);
  background: var(--bone);
}
.bar h1 { font-size: 1rem; margin: 0; letter-spacing: .06em; }
.bar .sub { color: var(--slate); font-style: italic; font-size: .85rem; }
.bar .spacer { flex: 1; }
.bar .hint { font-size: .68rem; color: var(--umber); }
.bar button {
  font: inherit; font-family: ui-monospace, Menlo, monospace; font-size: .72rem;
  border: 1px solid var(--hairline); background: var(--bone); color: var(--graphite);
  border-radius: 4px; padding: 2px 10px; cursor: pointer;
}
.bar button[aria-pressed="true"] { border-color: var(--sienna); color: var(--sienna); }
.stratum-flag { font-size: .72rem; color: var(--sienna); }

/* ---- the room ---- */
.room {
  position: relative; height: calc(100vh - 46px);
  display: grid; grid-template-columns: 1fr var(--s6); overflow: hidden;
  touch-action: none;
}

/* bed + sheet */
.bed { position: relative; z-index: var(--z-bed); overflow-y: auto; padding: var(--s5); }
.sheet {
  position: relative; max-width: 560px; margin: 0 auto;
  background: var(--bone); border: 1px solid var(--hairline);
  padding: var(--s5) var(--s5) var(--s6); min-height: 70vh;
}
.forme {
  position: relative; z-index: var(--z-forme);
  margin: 0 0 var(--s3); line-height: 1.55; opacity: var(--a-ink);
}
.forme.from-proposal { border-left: 2px solid var(--tint); padding-left: var(--s2); }

.inklayer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: var(--z-forme); pointer-events: none;
}
.inklayer path {
  fill: none; stroke: var(--ink); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.inklayer path.annotation { stroke: var(--sienna); opacity: var(--a-proof); }

/* proposals — machine-authored, never --a-ink until composited by a pen */
.proposal-band { margin-top: var(--s4); display: grid; gap: var(--s2); }
.proposal {
  position: relative; z-index: var(--z-proposal);
  border: 1px dashed var(--deckle); background: var(--plate);
  padding: var(--s2) var(--s3); opacity: var(--a-proof);
  min-height: 44px; cursor: default;
  transition: opacity var(--settle) var(--press), transform var(--pull) var(--press);
}
.proposal .who { font-size: .68rem; color: var(--umber); display: block; margin-bottom: 2px; }
.proposal .note {
  font-size: .8rem; color: var(--sienna); font-style: italic;
  border-top: 1px solid var(--hairline); margin-top: var(--s1); padding-top: var(--s1);
  opacity: var(--a-proof);
}
.proposal.receding { transform: translateX(60vw); opacity: var(--a-sketch); }

/* margin rail + embers */
.rail {
  position: relative; z-index: var(--z-margin);
  border-left: 1px solid var(--hairline); background: var(--greige);
  display: flex; flex-direction: column; align-items: center;
  padding-top: var(--s4); gap: var(--s3);
}
.ember {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--deckle);
  background: var(--ember); cursor: pointer; padding: 0;
  display: block;
}
.ember.spent { background: var(--tint); }

/* surfaced reports */
.surfaced-layer { position: absolute; inset: 0; z-index: var(--z-surfaced); pointer-events: none; }
.report {
  position: absolute; pointer-events: auto;
  width: min(340px, 70vw); background: var(--bone);
  padding: var(--s3); opacity: var(--a-pressproof);
  transition: transform var(--pull) var(--press), opacity var(--pull) var(--press);
}
.report .who { font-size: .68rem; color: var(--umber); display: block; margin-bottom: 2px; }

/* consent layer — may only ask */
.consent-layer {
  position: absolute; left: 0; right: var(--s6); bottom: var(--s4);
  z-index: var(--z-consent); display: flex; justify-content: center; pointer-events: none;
}
.consent {
  pointer-events: auto; background: var(--bone); border: 1px solid var(--deckle);
  padding: var(--s3) var(--s4); max-width: 460px;
}
.consent .q { margin: 0 0 var(--s2); font-size: .92rem; }
.consent .options { display: flex; gap: var(--s2); }
.consent .options button {
  flex: 1 1 0; font: inherit; font-size: .85rem; min-height: 44px;
  border: 1px solid var(--graphite); background: var(--bone); color: var(--ink);
  cursor: pointer; padding: var(--s1) var(--s3);
}
.consent .resolved { font-size: .8rem; color: var(--slate); font-style: italic; }

/* notations — quiet refusals near the gesture site */
.notation {
  position: fixed; z-index: var(--z-consent);
  font-family: ui-monospace, Menlo, monospace; font-size: .75rem;
  color: var(--graphite); background: var(--plate);
  border: 1px solid var(--hairline); padding: 2px 8px; pointer-events: none;
  transition: opacity var(--settle) var(--press); opacity: var(--a-ink);
}
.notation.fading { opacity: 0; }

/* registration cross — holds show progress (quarter turn) */
.holdcross {
  position: fixed; z-index: var(--z-consent); pointer-events: none;
  font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; color: var(--sienna);
  transition: transform calc(var(--kiss) + var(--settle) + 100ms) linear;
}
.holdcross.turning { transform: rotate(90deg); }

/* shear fan — read-only view of strata */
.shear-layer {
  position: absolute; inset: 0; z-index: var(--z-surfaced);
  background: var(--tint); padding: var(--s4); overflow-y: auto;
}
.shear-layer .mini {
  max-width: 420px; margin: 0 auto var(--s3); background: var(--bone);
  border: 1px solid var(--deckle); padding: var(--s2) var(--s3);
  font-size: .72rem; opacity: var(--a-pressproof);
}
.shear-layer .mini .label { color: var(--sienna); display: block; margin-bottom: 2px;
  font-family: ui-monospace, Menlo, monospace; }

/* structure register (the other half of the page) */
.structure-layer {
  position: absolute; inset: 0; z-index: var(--z-surfaced);
  background: var(--bone); padding: var(--s4) var(--s5); overflow: auto;
}
.structure-layer pre {
  font-family: ui-monospace, Menlo, monospace; font-size: .74rem;
  line-height: 1.5; color: var(--graphite); white-space: pre-wrap; margin: 0;
}

.hidden { display: none; }
