:root {
  --bg: #dfe3e8;
  --ink: #14171c;
  --mute: rgba(20, 23, 28, 0.62);
  --ink-dim: rgba(20, 23, 28, 0.62);
  --faint: rgba(20, 23, 28, 0.4);
  --paper: #f4f6f8;
  --panel: #eceff3;
  --accent: #8e2a22;
  --line: rgba(20, 23, 28, 0.14);
  --desk: #c9ced6;
  --font-d: "Bricolage Grotesque", ui-sans-serif, sans-serif;
  --font-t: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --fs-hero: clamp(2.7rem, 1.05rem + 6.2vw, 5.4rem);
  --fs-title: clamp(1.55rem, 1.1rem + 1.8vw, 2.25rem);
  --fs-base: clamp(1rem, 0.96rem + 0.22vw, 1.08rem);
  --space: clamp(1rem, 3vw, 1.75rem);
  --bar: 3.4rem;
  --dock: calc(4.4rem + env(safe-area-inset-bottom, 0px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-nav: 20;
  --z-overlay: 30;
  --z-sheet: 40;
  --z-cookie: 25;
  --z-busy: 50;
  --wrap: min(100% - (var(--space) * 2), 68rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-t);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: var(--fs-base);
  letter-spacing: -0.011em;
  font-feature-settings: "ss01" on, "kern" on;
  font-synthesis: none;
}

body.is-locked {
  overflow: hidden;
  height: 100svh;
}

dialog.sheet:not([open]) { display: none !important; }

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

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
p, h1, h2, h3, ul, figure { margin: 0; }

.skip { position: absolute; left: -999px; }
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  padding: .5rem .8rem;
  z-index: var(--z-nav);
}

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--bar) 1fr;
}
body.is-locked .app {
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}

.bar,
.top {
  background: var(--paper);
  color: var(--ink);
  min-height: var(--bar);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  border-bottom: 3px solid var(--accent);
}
.bar__inner,
.top__inner {
  min-height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--space);
  width: 100%;
}
.brand { text-decoration: none; color: inherit; }
.brand__name {
  font-family: var(--font-d);
  font-style: normal;
  font-optical-sizing: auto;
  font-weight: 800;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  letter-spacing: -0.05em;
}
.bar__nav {
  display: flex;
  gap: 1.05rem;
  align-items: center;
}
.bar__nav a,
.top__nav {
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}
.bar__nav a[aria-current="page"] {
  box-shadow: 0 1px 0 currentColor;
}
.top .btn--ghost,
.bar .btn--ghost {
  color: var(--ink);
  border-color: var(--line);
}
.bar__nav a:focus-visible,
.brand:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.stage { min-height: 0; }
body.is-locked .stage {
  overflow: auto;
  height: 100%;
}

.home {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.6rem);
  padding: clamp(1.2rem, 3vw, 2.2rem) 0 3rem;
}
.home > * {
  width: var(--wrap);
  margin-inline: auto;
}

.hero {
  display: grid;
  gap: 0.7rem;
  padding-block: 0.4rem 0.2rem;
}
.hero h1 {
  font-family: var(--font-d);
  font-style: normal;
  font-optical-sizing: auto;
  font-size: var(--fs-hero);
  line-height: 0.88;
  letter-spacing: -0.055em;
  font-weight: 800;
}
.hero p,
.lead {
  max-width: 38ch;
  color: var(--mute);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.16rem);
  line-height: 1.45;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.group { display: grid; gap: 0.75rem; }
.group h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
.tile {
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: left;
  padding: 0.85rem 1rem;
  min-height: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  align-items: center;
  transition: border-color 160ms var(--ease);
}
.tile:hover { border-color: var(--ink); }
.tile__icon {
  width: 2.4rem;
  height: 2.4rem;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 0;
  font-style: normal;
  flex: 0 0 auto;
}
.tile__icon svg {
  width: 1.35rem;
  height: 1.35rem;
  max-width: none;
}
.tile__title {
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.tile__blurb {
  color: var(--mute);
  font-size: 0.84rem;
  line-height: 1.4;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding-block: 0.2rem;
  border-top: 1px solid var(--line);
}
.steps article {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.steps b {
  font-family: var(--font-d);
  font-style: normal;
  font-size: 1.2rem;
  font-weight: 800;
}
.steps p { color: var(--mute); font-size: 0.92rem; max-width: 28ch; }

.room {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0.85rem var(--space) calc(0.9rem + env(safe-area-inset-bottom, 0px));
  gap: 0.7rem;
}
.room__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: end;
}
.room__head h1 {
  font-family: var(--font-d);
  font-optical-sizing: auto;
  font-size: var(--fs-title);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.room__head p { color: var(--mute); max-width: 52ch; font-size: 0.92rem; }

.dropzone {
  border: 1.5px dashed color-mix(in oklab, var(--ink) 35%, var(--desk));
  background: var(--paper);
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.4rem 1rem;
  cursor: pointer;
}
.dropzone.is-over {
  background: #fff;
  outline: 2px solid var(--accent);
}
.dropzone img {
  width: min(14rem, 62%);
  margin: 0 auto 0.65rem;
}
.dropzone b {
  font-family: var(--font-d);
  font-optical-sizing: auto;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  display: block;
  font-weight: 600;
}
.dropzone span { color: var(--mute); }

.filelist {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  overflow: auto;
  min-height: 0;
}
.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.35rem;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
}
.file-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row button {
  border: 1px solid var(--ink);
  background: transparent;
  min-height: 2.2rem;
  min-width: 2.2rem;
  padding: 0 0.5rem;
  cursor: pointer;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: end;
}
.opts label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--mute);
}
.opts input, .opts select {
  background: var(--paper);
  border: 1px solid var(--ink);
  min-height: 2.5rem;
  padding: 0.3rem 0.55rem;
}

.room__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}
.status { color: var(--mute); font-size: 0.9rem; }
.status.is-err { color: #9c1c12; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn--ghost { background: transparent; color: var(--ink); }
.btn--wide { min-width: min(100%, 14rem); }
.btn:disabled { opacity: 0.4; }

.editor-room {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  padding: 0.55rem var(--space) 0;
  gap: 0.4rem;
}
.editor-room .room__head { align-items: center; }
.editor-room .room__head h1 { font-size: clamp(1.2rem, 2vw, 1.7rem); }
.editor-room .room__head .head-actions,
.scan-room .room__head .head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.tools {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.35rem;
}
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
}
.tool-row + .tool-row {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--line);
}
.tool-k {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  flex: 0 0 auto;
}
.tool-row button {
  background: transparent;
  border: 1px solid var(--line);
  min-height: 2.15rem;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}
.tool-row button.is-on,
.tool-row .btn {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.sep { width: 1px; height: 1.1rem; background: var(--line); flex: 0 0 auto; }
.tiny { font-size: 0.75rem; color: var(--mute); display: inline-flex; gap: 0.3rem; align-items: center; }
.hint { font-size: 0.8rem; color: var(--mute); }
.zoom-label { font-size: 0.78rem; min-width: 2.6rem; text-align: center; }
.swatches { display: inline-flex; gap: 0.28rem; }
.swatches button {
  width: 1.2rem;
  height: 1.2rem;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
}
.selbar { display: inline-flex; gap: 0.28rem; }
.selbar[hidden], .cam[hidden], .text-overlay[hidden], .busy[hidden], .crop-bar[hidden] { display: none !important; }

.crop-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.8rem;
  background: var(--ink);
  color: #f4efe6;
  padding: 0.5rem 0.7rem;
}
.crop-bar p {
  font-size: 0.84rem;
  color: rgba(244, 239, 230, 0.82);
  max-width: 42ch;
}
.crop-bar__actions {
  display: flex;
  gap: 0.4rem;
}
.crop-bar .btn--ghost {
  color: #f4efe6;
  border-color: rgba(244, 239, 230, 0.4);
}
.crop-bar .btn:not(.btn--ghost) {
  background: #f4efe6;
  color: var(--ink);
  border-color: #f4efe6;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: var(--desk);
  border: 1px solid var(--line);
  padding: clamp(0.55rem, 2vw, 1.2rem);
  -webkit-overflow-scrolling: touch;
}
.canvas-wrap canvas {
  display: block;
  max-width: none;
  margin-inline: auto;
  background: #fff;
  touch-action: none;
  box-shadow: 0 10px 28px rgba(17, 19, 24, 0.12);
}
.page-sheet {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}
.page-sheet canvas { margin-inline: 0; }
.text-overlay {
  position: absolute;
  z-index: var(--z-overlay);
  border: 1px solid var(--accent);
  background: rgba(255, 255, 255, 0.94);
  font-family: var(--font-t);
  resize: both;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.empty-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 0.45rem;
  color: var(--mute);
  padding: 1rem;
  cursor: pointer;
}
.empty-hint img {
  width: min(13rem, 70%);
  margin-inline: auto;
}

.thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
  scrollbar-width: thin;
}
.thumbs__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
  padding-right: 0.45rem;
  margin-right: 0.15rem;
  border-right: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--mute);
  white-space: nowrap;
}
.thumbs__nav button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 0.4rem;
}
.thumbs button {
  border: 1px solid var(--line);
  padding: 0;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 2.6rem;
  min-height: 3.4rem;
  font-size: 0.78rem;
}
.thumbs button.is-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumbs img { width: 2.6rem; height: 3.4rem; object-fit: cover; }

.dock {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.4rem var(--space) calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.dock button {
  min-height: 3.1rem;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 0.12rem;
  font-size: 0.68rem;
  color: var(--mute);
  cursor: pointer;
}
.dock button.is-on,
.dock button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 650;
}
.dock .dock-save {
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
}

.scan-room {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  padding: 0.6rem var(--space) 0;
  gap: 0.5rem;
}
.scan-view {
  min-height: 0;
  background: #12110f;
  color: #ece8e0;
  overflow: hidden;
  position: relative;
}
.scan-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.scan-frame__page {
  width: min(72%, 22rem);
  height: min(78%, 86%);
  aspect-ratio: 210 / 297;
  max-height: 78%;
  border: 1.5px solid rgba(255, 250, 240, 0.88);
  box-shadow: 0 0 0 80vmax rgba(8, 7, 6, 0.42);
  border-radius: 1px;
}
.scan-frame[hidden] { display: none !important; }
.scan-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.scan-view video[hidden] { display: none !important; }
.scan-review {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.scan-review[hidden] { display: none !important; }
.scan-review canvas {
  display: block;
  max-width: none;
  background: #000;
}
.scan-quad {
  position: absolute;
  overflow: visible;
  touch-action: none;
}
.scan-quad__dim { fill: rgba(8, 7, 6, 0.52); }
.scan-quad__line {
  fill: none;
  stroke: #f4efe6;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.scan-quad__handle {
  fill: #f4efe6;
  stroke: #1c4f8a;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  pointer-events: auto;
}
.scan-fallback {
  height: 100%;
  min-height: 12rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.55rem;
  text-align: center;
  padding: 1.2rem;
}
.scan-fallback img { width: min(11rem, 70%); margin-inline: auto; }
.scan-fallback p { max-width: 28ch; color: rgba(236, 232, 224, 0.78); font-size: 0.92rem; }
.scan-tray {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  min-height: 4.6rem;
  padding: 0.15rem 0;
}
.scan-tray:has(.empty) { display: none; }
.scan-room.is-live,
.scan-room.is-review {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.scan-room.is-live .scan-tray,
.scan-room.is-live .scan-actions,
.scan-room.is-review .scan-tray,
.scan-room.is-review .scan-actions {
  display: none;
}
.scan-tray button {
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  flex: 0 0 3.4rem;
  position: relative;
}
.scan-tray .scan-del {
  position: absolute;
  top: 0.12rem;
  right: 0.12rem;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  line-height: 1;
}
.scan-tray img {
  width: 3.4rem;
  height: 4.4rem;
  object-fit: cover;
}
.scan-tray > div {
  flex: 0 0 3.4rem;
  position: relative;
}
.scan-tray > div > button:first-child {
  width: 100%;
}
.scan-tray .empty {
  color: var(--mute);
  font-size: 0.85rem;
  padding: 0.8rem 0.2rem;
}
.scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.scan-dock {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.4rem;
  padding: 0.45rem 0 calc(0.55rem + env(safe-area-inset-bottom, 0px));
}
.scan-dock .btn { min-height: 3.05rem; }
.scan-dock .btn--shot {
  border-radius: 0;
}
.scan-dock.is-review {
  grid-template-columns: 1fr 1fr 1.35fr;
}

.sheet {
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 1.1rem 1.15rem;
  max-width: min(40rem, calc(100% - 1.4rem));
  width: min(40rem, calc(100% - 1.4rem));
}
.sheet::backdrop { background: rgba(17, 19, 24, 0.5); }
.sheet h3 {
  font-family: var(--font-d);
  font-style: italic;
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
}
.sheet canvas {
  width: 100%;
  height: min(38vh, 14rem);
  background: #fff;
  border: 1px solid var(--ink);
  touch-action: none;
  cursor: crosshair;
}
.sheet__row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.more-grid button {
  min-height: 2.8rem;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

body.is-locked .site-footer,
body.on-tool .site-footer,
body:has(.room) .site-footer,
body:has(.editor-room) .site-footer,
body:has(.scan-room) .site-footer {
  display: none;
}

.site-footer {
  background: #1c2128;
  color: rgba(232, 236, 240, 0.72);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin-top: 0;
}
.site-footer__inner {
  width: var(--wrap);
  margin-inline: auto;
  padding-block: clamp(2.2rem, 5vw, 3.1rem) 0;
}
.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.7fr) minmax(0, 0.9fr);
  gap: clamp(1.6rem, 4vw, 3rem) clamp(1.4rem, 3vw, 2.8rem);
  padding-bottom: clamp(1.6rem, 3vw, 2.2rem);
}
.site-footer__logo {
  display: inline-block;
  font-family: var(--font-d);
  font-style: normal;
  font-weight: 800;
  font-size: clamp(2rem, 1.2rem + 2.4vw, 2.85rem);
  letter-spacing: -0.04em;
  color: #f7f3ea;
  text-decoration: none;
  line-height: 0.95;
  margin-bottom: 0.85rem;
}
.site-footer__brand p {
  max-width: 36ch;
  color: rgba(244, 239, 230, 0.62);
}
.site-footer__contacts {
  margin-top: 1.05rem;
}
.site-footer__contacts a,
.site-footer a {
  color: rgba(244, 239, 230, 0.88);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(244, 239, 230, 0.32);
}
.site-footer a:hover {
  color: #fff;
  text-decoration-color: #fff;
}
.site-footer a:focus-visible {
  outline: 2px solid #f7f3ea;
  outline-offset: 3px;
}
.site-footer__h {
  font-family: var(--font-t);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.42);
  margin-bottom: 0.85rem;
}
.site-footer__links {
  display: grid;
  gap: 0.42rem;
  justify-items: start;
}
.site-footer__links a {
  text-decoration: none;
  color: rgba(244, 239, 230, 0.82);
}
.site-footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}
.site-footer__legal {
  display: grid;
  gap: 1.35rem 1.8rem;
  padding-block: 1.15rem 0.2rem;
  border-top: 1px solid rgba(244, 239, 230, 0.12);
  font-size: 0.86rem;
  color: rgba(244, 239, 230, 0.62);
  line-height: 1.45;
}
@media (min-width: 880px) {
  .site-footer__legal {
    grid-template-columns: 1.15fr 0.85fr;
  }
}
.site-footer__legal h3 {
  font-family: var(--font-t);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.42);
  margin-bottom: 0.7rem;
}
.site-footer__legal p + p { margin-top: 0.28rem; }
.site-footer__legal b {
  font-weight: 650;
  color: rgba(244, 239, 230, 0.9);
}
.site-footer__legal .role {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(244, 239, 230, 0.1);
}
.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem 1.4rem;
  padding-block: 1rem 1.35rem;
  border-top: 1px solid rgba(244, 239, 230, 0.12);
  font-size: 0.8rem;
  color: rgba(244, 239, 230, 0.45);
}
.site-footer__short {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}
.site-footer__short a {
  color: rgba(244, 239, 230, 0.55);
  text-decoration: none;
}
.site-footer__short a:hover {
  color: #fff;
}

body:has(#cookieBar):not(.is-locked) {
  padding-bottom: 5.8rem;
}
body.is-locked .cookie-bar {
  display: none !important;
}

.cookie-bar {
  position: fixed;
  z-index: var(--z-cookie);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem 1.2rem;
  align-items: center;
  padding: 0.95rem var(--space) calc(0.95rem + env(safe-area-inset-bottom, 0px));
  background: #1c2128;
  color: rgba(232, 236, 240, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 -1px 0 rgba(232, 236, 240, 0.12);
}
.cookie-bar p { max-width: 72ch; }
.cookie-bar a {
  color: #f7f3ea;
  text-underline-offset: 0.18em;
}
.cookie-bar__ok {
  appearance: none;
  border: 0;
  background: #f7f3ea;
  color: #121318;
  min-height: 2.6rem;
  padding: 0.45rem 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.cookie-bar__ok:hover { background: #fff; }
.cookie-bar__ok:focus-visible {
  outline: 2px solid #f7f3ea;
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .site-footer__main,
  .site-footer__legal {
    grid-template-columns: 1fr;
  }
  .cookie-bar {
    grid-template-columns: 1fr;
  }
  .cookie-bar__ok { justify-self: start; }
}

.legal {
  padding-block: 3rem 3.5rem;
  max-width: 42rem;
}
.legal h1 {
  font-family: var(--font-d);
  font-style: normal;
  font-size: clamp(2rem, 1.2rem + 2vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.7rem;
  font-weight: 800;
}
.legal .lead { color: var(--mute); margin-bottom: 1.2rem; }
.legal ul {
  display: grid;
  gap: 0.85rem;
  padding: 0;
  list-style: none;
  color: var(--ink-dim);
}
.legal a { text-underline-offset: 0.16em; }

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.busy {
  position: fixed;
  inset: auto 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-busy);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1rem;
  font-weight: 600;
  pointer-events: none;
}

.panel textarea {
  width: 100%;
  min-height: 7rem;
  border: 1px solid var(--line);
  padding: 0.6rem;
}

@media (max-width: 720px) {
  .bar__nav a[data-nav="home"] { display: none; }
  .file-row { grid-template-columns: 1fr auto auto; }
  .file-row [data-file="up"] { display: none; }
  .steps { grid-template-columns: 1fr; }
  .tools--desk { display: block; padding: 0.25rem 0.4rem; }
  .tools--desk .tool-row:not(.tool-row--meta) { display: none; }
  .dock { display: grid; }
  .editor-room {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    padding-inline: 0.7rem;
  }
  .editor-room .head-actions [data-go],
  #savePdfDesk { display: none; }
  .room {
    padding-inline: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .scan-actions { grid-template-columns: 1fr; }
  .scan-dock.is-review { grid-template-columns: 1fr 1fr; }
  .scan-dock.is-review .btn:last-child { grid-column: 1 / -1; }
  .sheet {
    margin: 0;
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
  }
  .more-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 721px) {
  .scan-room {
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr 12.5rem;
  }
  .scan-room.is-live,
  .scan-room.is-review {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .scan-view { grid-row: span 2; }
  .scan-room.is-live .scan-view,
  .scan-room.is-review .scan-view { grid-row: auto; }
  .scan-tray {
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
  }
  .scan-tray button { flex: 0 0 auto; width: 100%; }
  .scan-tray img { width: 100%; height: 7rem; }
  .scan-actions, .scan-dock { grid-column: 1 / -1; }
  .scan-dock { grid-template-columns: 1fr 1.35fr; }
}
