/* Stamp Studio. Cool glassine-white chrome; stamps always sit on black stock-card
   surfaces, the way a stock book shows them. Airmail stripes mark the places where
   photos come in. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("./assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #eef0ee;
  --surface: #ffffff;
  --sunken: #f5f6f5;
  --ink: #14181d;
  --ink-2: #47525d;
  --ink-3: #59646d;
  --line: #dde1df;
  --line-2: #c5cbc8;
  --blue: #1f4fbf;
  --blue-dark: #183d94;
  --blue-wash: #e9eefb;
  --red: #b3261e;
  --red-wash: #fbeae8;
  --stripe-red: #cf3a30;
  --green: #17704a;
  --green-wash: #e2f2e9;
  --amber: #855600;
  --amber-wash: #fbf0d4;
  --stock: #16181b;
  --stock-2: #23272c;
  --stock-line: #363c43;
  --stock-ink: #eceef0;
  --stock-ink-2: #a3abb3;
  --r: 12px;
  --r-sm: 8px;
  --shadow:
    0 1px 2px rgba(20, 24, 29, 0.05), 0 8px 24px -12px rgba(20, 24, 29, 0.18);
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail: 232px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
body.is-locked,
body.has-drawer {
  overflow: hidden;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
fieldset,
figure,
pre {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
fieldset {
  border: 0;
  min-width: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.code {
  font-family: var(--mono);
  font-size: 0.93em;
  letter-spacing: -0.01em;
}
.num,
.amount,
.bignum,
.facts dd,
.range-ends,
.net b,
.snaps b {
  font-variant-numeric: tabular-nums;
}
.soft {
  color: var(--ink-3);
}
.i {
  width: 18px;
  height: 18px;
  flex: none;
}
.eyebrow {
  font: 500 11.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.fine {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}
.note {
  font-size: 14px;
  color: var(--ink-2);
  background: var(--sunken);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.link:hover {
  text-decoration-color: currentColor;
}
.link .i {
  width: 15px;
  height: 15px;
}

/* ---------- buttons, chips, pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.btn:hover:not(:disabled) {
  border-color: var(--ink-3);
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn.quiet:hover:not(:disabled) {
  background: rgba(20, 24, 29, 0.06);
  border-color: transparent;
}
.btn.danger {
  color: var(--red);
}
.btn.danger:hover:not(:disabled) {
  background: var(--red-wash);
  border-color: transparent;
}
.btn.danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn.sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 8px;
}
.btn.sm .i {
  width: 16px;
  height: 16px;
}
.btn.lg {
  min-height: 46px;
  padding: 0 20px;
  font-size: 15px;
}
.btn.wide {
  width: 100%;
}
.btn.is-on {
  background: var(--blue-wash);
  border-color: var(--blue);
  color: var(--blue-dark);
}
.btn.icon-only {
  padding: 0;
  width: 38px;
}
.btn.file {
  cursor: pointer;
}
.btn.file:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover:not(:disabled):not(.is-off) {
  background: rgba(20, 24, 29, 0.07);
  color: var(--ink);
}
.icon-btn.is-off {
  opacity: 0.3;
}
.chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.chip:hover:not(:disabled) {
  border-color: var(--ink-3);
  color: var(--ink);
}
.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eae8;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.ok {
  background: var(--green-wash);
  color: var(--green);
}
.pill.warn {
  background: var(--amber-wash);
  color: var(--amber);
}

/* ---------- airmail edge: where photos come in ---------- */
.airmail {
  border: 5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    repeating-linear-gradient(
        -45deg,
        var(--stripe-red) 0 11px,
        var(--surface) 11px 22px,
        var(--blue) 22px 33px,
        var(--surface) 33px 44px
      )
      border-box;
}

/* ---------- frame ---------- */
.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px;
  font: 650 18px/1 var(--display);
  letter-spacing: -0.02em;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 10px;
  background: #e2e5e3;
}
.switch button {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 24, 29, 0.14);
}
.nav {
  display: grid;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 10px;
  border-radius: 9px;
  font-weight: 550;
  color: var(--ink-2);
}
.nav a:hover {
  background: rgba(20, 24, 29, 0.05);
  color: var(--ink);
}
.nav a.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
.nav a.is-active .i {
  color: var(--blue);
}
.backup {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  color: var(--ink-2);
}
.backup:hover {
  border-color: var(--line-2);
}
.backup b {
  display: block;
  font-size: 14px;
  color: var(--ink);
}
.backup small {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
}
.backup.is-stale {
  border-color: #e2c98a;
  background: var(--amber-wash);
}
.backup.is-stale .i {
  color: var(--amber);
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
  padding: 0 32px;
  background: rgba(238, 240, 238, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 550;
  color: var(--ink-3);
  white-space: nowrap;
}
.crumbs a:hover {
  color: var(--ink);
}
.crumbs [aria-current] {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs .sep {
  color: var(--line-2);
}
.top-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.mobile-only {
  display: none;
}
.ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 32px;
  background: var(--ink);
  color: #dfe3e6;
  font-size: 14px;
}
.ribbon b {
  color: #fff;
}
.ribbon .link {
  color: #fff;
  flex: none;
}
.ribbon.warn {
  background: var(--amber-wash);
  color: #5d3d00;
  border-bottom: 1px solid #ead9a8;
}
.ribbon.warn b,
.ribbon.warn .link {
  color: #4a3000;
}
.view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 32px 96px;
}
.view-page {
  max-width: 1520px;
  padding-top: 22px;
}
.tabbar {
  display: none;
}
.boot {
  max-width: 560px;
  margin: 22vh auto;
  padding: 0 24px;
  text-align: center;
  color: var(--ink-2);
}
.boot.error {
  text-align: left;
}
.boot h1 {
  font: 650 24px/1.2 var(--display);
  color: var(--ink);
  margin-bottom: 12px;
}
.boot p + p {
  margin-top: 10px;
}

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.head h1 {
  font: 650 30px/1.1 var(--display);
  letter-spacing: -0.025em;
}
.head .sub {
  margin-top: 6px;
  color: var(--ink-2);
  max-width: 68ch;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.blank {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  color: var(--ink-2);
}
.blank > .i {
  width: 30px;
  height: 30px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.blank h2 {
  font: 650 19px/1.25 var(--display);
  color: var(--ink);
}
.blank p {
  max-width: 46ch;
  margin-bottom: 10px;
}
.blank.small {
  padding: 36px 24px;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  gap: 16px;
}
.grid.albums {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.grid.pages {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.grid.lots {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  text-align: left;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    transform 0.12s;
}
a.card:hover,
button.card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--stock);
  color: var(--stock-ink-2);
}
.cover.tall {
  aspect-ratio: 3 / 4;
}
.cover img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
}
.cover > .i {
  width: 34px;
  height: 34px;
}
.card-body {
  display: grid;
  gap: 2px;
  padding: 13px 15px 15px;
}
.card-body b {
  font-size: 16px;
  font-weight: 650;
}
.card-body small {
  color: var(--ink-3);
  font-size: 13.5px;
}
.card-body .meta {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card.add {
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 200px;
  padding: 20px;
  color: var(--ink-2);
  text-align: center;
  border-radius: var(--r);
}
.card.add .i {
  width: 26px;
  height: 26px;
  color: var(--blue);
  margin-bottom: 4px;
}
.card.add b {
  color: var(--ink);
}
.card.add small {
  font-size: 13px;
}
.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--blue-wash);
  color: var(--blue-dark);
}
.nudge span {
  flex: 1;
}
.nudge:hover {
  background: #dde5f9;
}
.welcome {
  border-radius: 16px;
  max-width: 760px;
  margin: 4vh auto 0;
}
.welcome-body {
  padding: 40px 44px;
  display: grid;
  gap: 16px;
}
.welcome h1 {
  font: 650 34px/1.08 var(--display);
  letter-spacing: -0.03em;
}
.welcome p {
  color: var(--ink-2);
  max-width: 56ch;
}
.steps {
  counter-reset: s;
  display: grid;
  gap: 10px;
  margin: 6px 0 10px;
}
.steps li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: baseline;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(s);
  font: 600 13px/1 var(--mono);
  color: var(--blue);
}
.steps b {
  color: var(--ink);
}

/* ---------- stamps on stock card ---------- */
.tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  padding: 5px;
  border-radius: 7px;
  background: var(--stock);
  color: var(--stock-ink-2);
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  display: block;
}
.tile img[data-thumb] {
  opacity: 0;
}
.tile-empty .i {
  width: 22px;
  height: 22px;
}
.tile-lg {
  width: 100%;
  height: 190px;
  padding: 16px;
  border-radius: 10px;
}
.tile.more-n {
  font: 600 13px var(--mono);
}
.tile {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}

/* ---------- page workspace ---------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}
.stagecol {
  min-width: 0;
}
.stagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager-name {
  display: grid;
  padding: 0 6px;
  line-height: 1.25;
}
.pager-name b {
  font: 650 18px/1.2 var(--display);
  letter-spacing: -0.01em;
}
.pager-name small {
  font-size: 13px;
  color: var(--ink-3);
}
.stagebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.stage {
  display: grid;
  place-items: center;
  padding: 26px;
  border-radius: 14px;
  background: var(--stock);
  background-image: linear-gradient(var(--stock-2) 1px, transparent 1px);
  background-size: 100% 64px;
  min-height: 320px;
}
.sheet {
  position: relative;
  width: 100%;
  line-height: 0;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.sheet.is-drawing {
  touch-action: none;
  outline: 2px dashed #7fa2ff;
  outline-offset: 6px;
}
.sheet > img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.box {
  position: absolute;
  padding: 0;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  line-height: 1;
}
.box {
  transform: rotate(var(--a, 0deg));
}
.box:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* found by the app and not yet touched: dashed, so it reads as a suggestion */
.box.is-found {
  border-style: dashed;
  border-color: #ffd98a;
}
.box.is-found .box-n {
  background: #ffd98a;
}
.box.is-saved {
  border-color: #8fe3b4;
}
.box.is-selected {
  border: 2px solid #7fa2ff;
  background: rgba(31, 79, 191, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 0 4px rgba(127, 162, 255, 0.3);
  cursor: move;
  touch-action: none;
  z-index: 2;
}
.box:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.box-n {
  position: absolute;
  top: -11px;
  left: -11px;
  transform: rotate(calc(-1 * var(--a, 0deg)));
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: 600 12px/1 var(--mono);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.box.is-saved .box-n {
  background: #1f8a5b;
  color: #fff;
}
.box.is-selected .box-n {
  background: var(--blue);
  color: #fff;
}
.box-n .i {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}
.h {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 2px;
}
.h::after {
  content: "";
  position: absolute;
  inset: -9px;
}
.h.nw {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}
.h.se {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}
.h.ne {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}
.h.sw {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}
/* the round handle above the box turns it */
.h.turn {
  top: -34px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: grab;
}
.h.turn::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 2px;
  height: 20px;
  background: var(--blue);
  pointer-events: none;
}
.box-new {
  position: absolute;
  border: 2px dashed #7fa2ff;
  background: rgba(31, 79, 191, 0.18);
  pointer-events: none;
  z-index: 3;
}
.foundbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #e0a73a;
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
}
.foundbar p {
  margin: 0;
  color: var(--ink-2);
}
.foundbar p b {
  color: var(--ink);
}
.foundbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.foundbar-actions > span {
  font-size: 13px;
  color: var(--ink-3);
  margin-right: 2px;
}
.insp-foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
}
.stage-help {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-3);
}
.inspector {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.inspector .blank {
  border: 0;
  padding: 72px 28px;
}
.insp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--line);
}
.insp-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper {
  display: flex;
}
.insp-hero {
  padding: 16px 18px 0;
}
.suggest {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  display: grid;
  gap: 10px;
}
.suggest-head {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.4;
}
.suggest-head .i {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.suggest-head b {
  color: var(--ink-2);
}
.suggest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.suggest-row small {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
}
.insp-foot {
  display: grid;
  gap: 4px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
  justify-items: start;
}
.insp-foot .rowlink {
  width: 100%;
}
.rowlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 9px;
  color: var(--ink-2);
}
a.rowlink:hover {
  background: var(--sunken);
}
.rowlink > span {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.rowlink b {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}
.rowlink small {
  font-size: 13px;
  color: var(--ink-3);
}
.rowlink > .i:last-child {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

/* ---------- forms ---------- */
.stamp-form {
  display: grid;
  gap: 16px;
  padding: 18px 18px 0;
}
.form-save {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0 -18px;
  padding: 12px 18px 14px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--surface) 10px);
}
.stamp-form:not(:has(.form-save)) {
  padding-bottom: 18px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field > span,
.field > label,
.field > legend {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0;
}
.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
}
input[type="text"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="search"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  line-height: 1.4;
}
textarea {
  resize: vertical;
  min-height: 72px;
}
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2347525d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 16px;
  text-overflow: ellipsis;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-3);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
  border-radius: 9px;
}
input::placeholder,
textarea::placeholder {
  color: #8a949c;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--sunken);
  color: var(--ink-2);
}
input[type="file"] {
  font-size: 13.5px;
  color: var(--ink-2);
  min-height: 0;
  padding: 0;
  border: 0;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font: 600 13.5px var(--font);
  color: var(--ink);
  cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  flex: none;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pair.three {
  grid-template-columns: 1fr 0.8fr 1.1fr;
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: 10px;
  background: #e7eae8;
}
.seg label {
  position: relative;
  display: grid;
}
.seg input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.seg span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
}
.seg input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 24, 29, 0.16);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.seg input:disabled + span {
  opacity: 0.6;
}
.checks {
  gap: 10px;
}
.checks legend {
  margin-bottom: 8px;
}
fieldset.field > legend {
  margin-bottom: 6px;
}
.checks label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  cursor: pointer;
}
.checks label input {
  margin-top: 2px;
}
.more {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.more summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.more summary::-webkit-details-marker {
  display: none;
}
.more summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.12s;
  margin: 0 4px 0 2px;
}
.more[open] summary::before {
  transform: rotate(45deg);
}
.more[open] > summary {
  margin-bottom: 14px;
}
.more > * + * {
  margin-top: 14px;
}
.back {
  max-height: 130px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.verdict {
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--amber-wash);
  color: #5d3d00;
}
.verdict.ok {
  background: var(--green-wash);
  color: var(--green);
}

/* ---------- stamp list ---------- */
.tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}
.search .i {
  position: absolute;
  left: 12px;
  top: 11px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  padding-left: 38px;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
}
.bulk b {
  margin-right: auto;
  font-weight: 600;
}
.bulk .btn.quiet {
  color: #cfd5da;
}
.bulk .btn.quiet:hover {
  background: rgba(255, 255, 255, 0.12);
}
.tablewrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: 11px 14px;
  text-align: left;
  font: 500 11.5px/1.2 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14.5px;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  cursor: pointer;
}
.table tbody tr:hover {
  background: var(--sunken);
}
.table tr.is-picked {
  background: var(--blue-wash);
}
.table tr.is-sold {
  color: var(--ink-3);
}
.table small {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
}
.table .num {
  text-align: right;
  white-space: nowrap;
}
.c-check {
  width: 44px;
  padding-right: 0 !important;
}
.cell-stamp {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.rowbtn {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 650;
  text-align: left;
  color: var(--ink);
}
.rowbtn:hover {
  color: var(--blue);
}

/* ---------- side panel ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 24, 29, 0.35);
  animation: fade 0.16s;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -12px 0 40px rgba(20, 24, 29, 0.2);
  animation: slide 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 12px 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head .tile {
  width: 64px;
  height: 64px;
}
.drawer-head > div {
  flex: 1;
  min-width: 0;
}
.drawer-head h2 {
  font: 650 19px/1.2 var(--display);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.drawer-head p {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 3px;
}
.drawer-body {
  overflow: auto;
  padding-bottom: 28px;
}
.drawer-body .rows {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-actions {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 0 18px 8px;
}
.drawer-body > .more {
  margin: 10px 18px 0;
}
.trail {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
}
.trail small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- values ---------- */
.split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.picklist {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.pick:last-child {
  border-bottom: 0;
}
.pick:hover {
  background: var(--sunken);
}
.pick.is-active {
  background: var(--blue-wash);
  border-left-color: var(--blue);
}
.pick > span:last-child {
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.pick b {
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick small {
  font-size: 13px;
  color: var(--ink-3);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.valuepanel {
  padding: 22px 24px 24px;
  display: grid;
  gap: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.panel-head h2 {
  font: 650 22px/1.2 var(--display);
  letter-spacing: -0.015em;
  margin-top: 4px;
}
.estimate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--stock);
  color: var(--stock-ink);
}
.estimate .eyebrow {
  color: var(--stock-ink-2);
}
.estimate p {
  color: var(--stock-ink-2);
  font-size: 14px;
}
.bignum {
  font: 600 46px/1.1 var(--display);
  letter-spacing: -0.03em;
  margin: 6px 0;
}
.range {
  display: grid;
  gap: 8px;
}
.range-track {
  position: relative;
  height: 22px;
}
.range-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 2px;
  background: var(--stock-line);
}
.range-track i {
  position: absolute;
  top: 6px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #8fb0ff;
}
.range-track b {
  position: absolute;
  top: 0;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  background: #fff;
}
.range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.range small {
  font-size: 12.5px;
  color: var(--stock-ink-2);
}
.valuepanel h3 {
  font: 650 16px/1.2 var(--display);
}
.records {
  display: grid;
}
.records li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.records li > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  justify-items: start;
}
.records small {
  font-size: 13.5px;
  color: var(--ink-3);
}
.records .why {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.records .why.ok {
  color: var(--green);
}
.records .why .i {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}
.records .is-out b,
.records .is-out .amount {
  color: var(--ink-3);
}
.records .is-out .amount {
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
}
.rec-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  flex: none;
}
.amount {
  font-size: 16px;
  font-weight: 600;
}
.snaps {
  display: grid;
  margin-top: 14px;
}
.snaps li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- selling ---------- */
.lot {
  padding: 20px 22px 18px;
  display: grid;
  gap: 14px;
}
.lot h2 {
  font: 650 20px/1.2 var(--display);
  letter-spacing: -0.01em;
}
.track {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 11.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.track li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.track li + li::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-2);
}
.track .is-now {
  color: var(--blue-dark);
  font-weight: 700;
}
.track .is-done {
  color: var(--green);
}
.lot-tiles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lot-tiles .tile {
  width: 64px;
  height: 64px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.facts dt {
  font-size: 13px;
  color: var(--ink-3);
}
.facts dd {
  font-size: 17px;
  font-weight: 600;
}

/* ---------- history ---------- */
.log {
  padding: 4px 22px;
}
.log section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.log section:last-child {
  border-bottom: 0;
}
.log h2 {
  font: 500 11.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.log li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 6px 0;
}
.log time {
  font: 13px/1.6 var(--mono);
  color: var(--ink-3);
}
.log b {
  font-weight: 600;
  font-size: 14.5px;
}
.log small {
  display: block;
  font-size: 13.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* ---------- dialogs ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 24, 29, 0.45);
  overflow: auto;
  animation: fade 0.14s;
}
.modal {
  width: min(540px, 100%);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(20, 24, 29, 0.35);
  animation: pop 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.wide {
  width: min(900px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 4px 24px;
}
.modal-head h2 {
  font: 650 21px/1.2 var(--display);
  letter-spacing: -0.015em;
}
.modal-body {
  padding: 10px 24px 22px;
}
.modal-body form,
.modal-body .backup-dialog {
  display: grid;
  gap: 16px;
}
.modal-body p {
  color: var(--ink-2);
}
.modal-body p b {
  color: var(--ink);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 26px 20px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 14px;
}
.drop .i {
  width: 28px;
  height: 28px;
  color: var(--blue);
}
.drop b {
  font-size: 16px;
  color: var(--ink);
}
.drop:hover b,
.drop.is-over b {
  color: var(--blue);
}
.drop.is-over {
  filter: brightness(0.97);
}
.drop:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.filelist {
  display: grid;
  gap: 4px;
  max-height: 150px;
  overflow: auto;
}
.filelist:empty {
  display: none;
}
.filelist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.filelist .i {
  width: 15px;
  height: 15px;
  color: var(--green);
  stroke-width: 2.4;
}
.filelist span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filelist small {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12.5px;
}
.checklist {
  display: grid;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.checkrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.checkrow:last-child {
  border-bottom: 0;
}
.checkrow:hover {
  background: var(--sunken);
}
.checkrow > span:last-child {
  display: grid;
  line-height: 1.3;
  min-width: 0;
}
.checkrow small {
  font-size: 13px;
  color: var(--ink-3);
}
.listing {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
}
.listing > div {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.listing-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13.5px/1.6 var(--mono);
  padding: 16px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--line);
  max-height: 340px;
  overflow: auto;
}
.net {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--sunken);
}
.net span {
  font-size: 13px;
  color: var(--ink-3);
}
.net b {
  font-size: 24px;
  font-weight: 600;
}
.net small {
  font-size: 12.5px;
  color: var(--ink-3);
}
.sect {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.sect:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.sect h3 {
  font: 650 16px/1.3 var(--display);
}
.sect p {
  font-size: 14.5px;
}
.sect > .btn {
  justify-self: start;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--sunken);
  font-size: 14px;
}
.status.warn {
  background: var(--amber-wash);
  color: #5d3d00;
}
.danger-zone h3 {
  color: var(--red);
}
.danger-zone .btn {
  justify-self: start;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 11px;
  background: var(--stock);
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  background: var(--red);
}

.modal-body form {
  align-content: start;
}
.listing .modal-foot {
  margin-top: 14px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@keyframes slide {
  from {
    transform: translateX(32px);
    opacity: 0;
  }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  .split {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
  .top {
    padding: 0 16px;
    height: 56px;
  }
  .top .btn.primary span {
    display: none;
  }
  .top .btn.primary {
    width: 38px;
    padding: 0;
  }
  .ribbon {
    padding: 9px 16px;
    font-size: 13.5px;
  }
  .view,
  .view-page {
    padding: 20px 16px 110px;
  }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
  }
  .tabbar a.is-active {
    color: var(--blue);
    background: var(--blue-wash);
  }
  .tabbar .i {
    width: 21px;
    height: 21px;
  }
  #toast {
    bottom: 84px;
  }
  .head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .head h1 {
    font-size: 26px;
  }
  .workspace,
  .split,
  .listing {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    position: static;
    max-height: none;
  }
  .stage {
    padding: 14px;
    border-radius: 12px;
  }
  .picklist {
    max-height: 260px;
    overflow: auto;
  }
  .estimate {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .grid.lots {
    grid-template-columns: minmax(0, 1fr);
  }
  .welcome-body {
    padding: 28px 22px;
  }
  .welcome h1 {
    font-size: 27px;
  }
  .table th:nth-child(3),
  .table td:nth-child(3),
  .table th:nth-child(5),
  .table td:nth-child(5) {
    display: none;
  }
  .cell-stamp {
    min-width: 0;
  }
  .backdrop {
    padding: 0;
    place-items: end center;
  }
  .modal,
  .modal.wide {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    overflow: auto;
  }
  .pair.three {
    grid-template-columns: 1fr 1fr;
  }
  .pair.three > :last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px) {
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none;
  }
  .table td,
  .table th {
    padding-left: 10px;
    padding-right: 10px;
  }
  .cell-stamp .tile {
    width: 44px;
    height: 44px;
  }
  .grid.albums,
  .grid.pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .facts dd {
    font-size: 15px;
  }
  .panel-head {
    flex-direction: column;
  }
  .valuepanel {
    padding: 18px 16px;
  }
  .bignum {
    font-size: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
