/* Folio — papelería: papel, grafito, tinta de bolígrafo y rotulador fluorescente */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
:root {
  --paper: #F3F5F8;
  --sheet: #FFFFFF;
  --ink: #141B2D;
  --graphite: #5A6377;
  --line: #DCE1E9;
  --pen: #2346F5;
  --pen-ink: #FFFFFF;
  --hl: #FFD92E;
  --danger: #D92D3A;
  --dark: #0B0E17;
  --dark-2: #171C2A;
  --dark-line: #2A3145;
  --on-dark: #F1F3F8;
  --on-dark-2: #A3ABBD;
  --font: "Schibsted Grotesk", -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1220; --sheet: #1A2031; --ink: #EEF1F7; --graphite: #9AA3B5;
    --line: #2A3147; --pen: #6C88FF; --pen-ink: #0B0E17;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
html { touch-action: manipulation; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.35; color: var(--ink); background: var(--paper);
  overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }

#app { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--paper); }
.view.dark { background: var(--dark); color: var(--on-dark); color-scheme: dark; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px calc(18px + var(--sar)) 24px calc(18px + var(--sal)); }

/* ---- Barras ---- */
.topbar {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: calc(var(--sat) + 8px) calc(10px + var(--sar)) 8px calc(10px + var(--sal)); min-height: calc(var(--sat) + 60px);
}
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.icon-btn:active { background: color-mix(in srgb, currentColor 12%, transparent); }
.text-btn { height: 44px; padding: 0 12px; font-weight: 500; }
.text-btn.strong { font-weight: 700; color: var(--hl); }
.brand { flex: 1; font-size: 30px; font-weight: 800; letter-spacing: -0.035em; padding-left: 10px; }
.brand span { position: relative; z-index: 0; padding: 0 3px; }
.brand span::before {
  content: ""; position: absolute; z-index: -1; left: -3px; right: -5px; top: 52%; bottom: 6%;
  background: var(--hl); transform: rotate(-1.6deg) skewX(-12deg); border-radius: 3px 6px 4px 7px;
}
@media (prefers-color-scheme: dark) { .brand span { color: #141B2D; } .brand span::before { top: 8%; bottom: 2%; } }

.search {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin: 2px calc(18px + var(--sar)) 12px calc(18px + var(--sal)); padding: 0 12px; height: 44px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; color: var(--graphite);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 16px; -webkit-user-select: text; user-select: text; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--graphite); }
.search:focus-within { border-color: var(--pen); }

.dock {
  flex: none; display: flex; gap: 10px; align-items: center;
  padding: 10px calc(18px + var(--sar)) calc(var(--sab) + 12px) calc(18px + var(--sal));
  background: linear-gradient(to bottom, transparent, var(--paper) 30%);
  margin-top: -18px; position: relative;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px;
  border-radius: 14px; font-weight: 650; font-size: 16px; white-space: nowrap; flex: 1;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.97); }
.dock .btn { min-width: 0; padding: 0 12px; }
#v-doc .dock .btn.primary { flex: 1.25; }
.btn.primary { background: var(--pen); color: var(--pen-ink); }
.btn.primary.big { flex: 1.7; height: 56px; font-size: 17px; border-radius: 16px; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--pen) 70%, transparent); }
.btn.ghost { background: var(--sheet); border: 1px solid var(--line); color: var(--ink); }
.btn.ghost[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.ghost.on-dark { background: transparent; border-color: var(--dark-line); color: var(--on-dark); }
.btn.danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---- Biblioteca ---- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; padding-top: 6px; }
.doc-card { text-align: left; display: flex; flex-direction: column; gap: 9px; min-width: 0; position: relative; }
.paper {
  position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: 3px; overflow: visible;
  box-shadow: 0 0 0 1px var(--line), 0 8px 16px -10px rgba(20, 27, 45, .45);
}
.paper img { width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 3px; display: block; }
.paper.stack { box-shadow: 0 0 0 1px var(--line), 5px 5px 0 -1px var(--sheet), 5px 5px 0 0 var(--line), 0 10px 16px -10px rgba(20, 27, 45, .45); }
.doc-card:active .paper { transform: scale(.98); }
.doc-info { display: flex; align-items: flex-start; gap: 2px; min-width: 0; }
.doc-info > div { flex: 1; min-width: 0; }
.doc-name { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sub { color: var(--graphite); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-menu { width: 34px; height: 34px; margin: -5px -8px 0 0; display: grid; place-items: center; color: var(--graphite); border-radius: 50%; flex: none; }
.no-results { color: var(--graphite); text-align: center; padding: 48px 20px; grid-column: 1 / -1; }

.empty { text-align: center; padding: 7vh 26px 0; max-width: 420px; margin: 0 auto; }
.empty h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 8px; }
.empty p { color: var(--graphite); font-size: 15.500px; line-height: 1.45; }
.empty-art {
  width: 132px; height: 168px; margin: 0 auto 30px; position: relative; background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line), 0 18px 30px -18px rgba(20, 27, 45, .5); border-radius: 3px; transform: rotate(-4deg);
}
.empty-art b { position: absolute; left: 18px; right: 18px; height: 7px; border-radius: 4px; background: var(--line); }
.empty-art b:nth-of-type(1) { top: 30px; right: 54px; background: var(--hl); height: 12px; border-radius: 2px; }
.empty-art b:nth-of-type(2) { top: 58px; }
.empty-art b:nth-of-type(3) { top: 76px; right: 40px; }
.empty-art i { position: absolute; width: 22px; height: 22px; border: 3px solid var(--pen); }
.empty-art i:nth-of-type(1) { left: -10px; top: -10px; border-right: 0; border-bottom: 0; }
.empty-art i:nth-of-type(2) { right: -10px; top: -10px; border-left: 0; border-bottom: 0; }
.empty-art i:nth-of-type(3) { right: -10px; bottom: -10px; border-left: 0; border-top: 0; }
.empty-art i:nth-of-type(4) { left: -10px; bottom: -10px; border-right: 0; border-top: 0; }

.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--hl); border-radius: 10px; padding: 12px 8px 12px 14px; margin: 2px 0 18px; font-size: 14px; line-height: 1.4; color: var(--graphite); }
.tip strong { color: var(--ink); font-weight: 650; }
.tip p { flex: 1; }
.tip button { width: 32px; height: 32px; display: grid; place-items: center; flex: none; margin-top: -4px; }
.tip .ic { width: 18px; height: 18px; }

/* ---- Documento ---- */
.doc-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; font-size: 19px; font-weight: 750; letter-spacing: -0.015em; text-align: left; color: var(--ink); }
.doc-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title .ic { color: var(--graphite); }
.doc-meta { flex: none; color: var(--graphite); font-size: 14px; padding: 0 calc(18px + var(--sar)) 10px calc(64px + var(--sal)); margin-top: -8px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 20px 14px; padding-top: 8px; align-items: end; }
.page-tile { position: relative; display: block; text-align: center; }
.page-tile .paper { aspect-ratio: auto; }
.page-tile .paper img { height: auto; object-fit: contain; }
.page-num { display: block; margin-top: 7px; font-size: 13px; font-weight: 600; color: var(--graphite); font-variant-numeric: tabular-nums; }
.page-tile.pending .paper { aspect-ratio: 3 / 4; display: grid; place-items: center; }
.sort-ctl { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; justify-content: space-between; padding: 0 4px; }
.sort-ctl button { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); }
.sort-ctl button[disabled] { opacity: .25; }
.sort-ctl .ic { width: 20px; height: 20px; stroke-width: 2.2; }

/* ---- Cámara ---- */
.cam-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--sat) + 8px) calc(10px + var(--sar)) 8px calc(10px + var(--sal)); }
.cam-toggles { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border-radius: 19px; background: var(--dark-2); color: var(--on-dark); font-size: 14px; font-weight: 600; border: 1px solid var(--dark-line); }
.chip .ic { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--hl); color: #141B2D; border-color: var(--hl); }
.cam-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; }
.cam-frame { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.cam-frame video { width: 100%; height: 100%; display: block; object-fit: cover; }
.cam-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#cam-quad { fill: rgba(255, 217, 46, .22); stroke: var(--hl); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: 0; transition: opacity .18s; }
#cam-quad.on { opacity: 1; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .28s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
.cam-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(11, 14, 23, .72); color: #fff; padding: 7px 14px; border-radius: 16px; font-size: 14px; font-weight: 550; white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cam-hint.good { background: var(--hl); color: #141B2D; }
.cam-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 12px; padding: 28px; text-align: center; background: var(--dark); }
.cam-error h2 { font-size: 21px; font-weight: 750; }
.cam-error p { color: var(--on-dark-2); font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
.cam-error .btn { flex: none; }
.cam-bottom { flex: none; padding: 14px calc(18px + var(--sar)) calc(var(--sab) + 10px) calc(18px + var(--sal)); }
.cam-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cam-side { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12.500px; font-weight: 600; color: var(--on-dark); justify-self: start; min-width: 64px; }
.cam-side .ic { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--dark-2); border: 1px solid var(--dark-line); }
.cam-done { justify-self: end; }
.cam-done[disabled] { opacity: .35; }
.cam-thumb { width: 42px; height: 52px; border-radius: 4px; background: var(--dark-2) center / cover no-repeat; border: 2px solid #fff; position: relative; display: block; }
.cam-thumb em { position: absolute; right: -9px; top: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--hl); color: #141B2D; font-style: normal; font-size: 13px; font-weight: 750; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.shutter { --p: 0; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--hl) calc(var(--p) * 1turn), #fff 0); }
.shutter i { width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 3px solid var(--dark); transition: transform .1s; }
.shutter:active i { transform: scale(.9); }
.cam-native { margin-top: 12px; width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--on-dark-2); font-size: 13.500px; font-weight: 550; }
.cam-native .ic { width: 18px; height: 18px; }

/* ---- Página ---- */
.page-title { flex: 1; text-align: center; font-weight: 650; font-size: 16px; display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.page-title small { font-size: 12px; font-weight: 500; color: var(--on-dark-2); min-height: 14px; }
.stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; padding: 6px 14px; touch-action: none; }
#page-canvas { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; min-height: 0; object-fit: contain; }
.nav-arrow { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(11, 14, 23, .6); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.nav-arrow.prev { left: calc(8px + var(--sal)); } .nav-arrow.next { right: calc(8px + var(--sar)); }
.nav-arrow[disabled] { display: none; }
.panel { flex: none; height: 128px; display: flex; align-items: center; }
.filter-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px calc(16px + var(--sar)) 8px calc(16px + var(--sal)); scrollbar-width: none; width: 100%; }
.filter-strip::-webkit-scrollbar { display: none; }
.filter-btn { flex: none; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 7px; white-space: nowrap; font-size: 12.500px; font-weight: 550; color: var(--on-dark-2); }
.filter-btn canvas { width: 70px; height: 84px; object-fit: cover; object-position: top; border-radius: 6px; background: #fff; outline: 2px solid transparent; outline-offset: 2px; display: block; }
.filter-btn span { position: relative; z-index: 0; padding: 0 4px; }
.filter-btn[aria-pressed="true"] { color: #141B2D; font-weight: 700; }
.filter-btn[aria-pressed="true"] canvas { outline-color: var(--hl); }
.filter-btn[aria-pressed="true"] span::before { content: ""; position: absolute; z-index: -1; inset: 0 -2px; background: var(--hl); border-radius: 3px 5px 3px 6px; transform: rotate(-1.500deg); }
.adjust { width: 100%; padding: 4px calc(20px + var(--sar)) 4px calc(20px + var(--sal)); display: grid; gap: 4px; }
.adjust label { display: grid; grid-template-columns: 78px 1fr 36px; align-items: center; gap: 8px; font-size: 14px; font-weight: 550; height: 34px; }
.adjust output { text-align: right; color: var(--on-dark-2); font-variant-numeric: tabular-nums; font-size: 13px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--dark-line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--hl); margin-top: -10px; border: 3px solid var(--dark); box-shadow: 0 0 0 1px var(--hl); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--dark-line); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--hl); border: 3px solid var(--dark); }
.toolbar { flex: none; display: flex; justify-content: space-around; padding: 6px calc(6px + var(--sar)) calc(var(--sab) + 8px) calc(6px + var(--sal)); border-top: 1px solid var(--dark-line); }
.toolbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; font-size: 12px; font-weight: 550; color: var(--on-dark-2); border-radius: 10px; min-width: 0; }
.toolbar button .ic { width: 23px; height: 23px; }
.toolbar button[aria-pressed="true"] { color: var(--hl); }
.toolbar button:active { background: var(--dark-2); }

/* ---- Recorte ---- */
#crop-stage { padding: 30px; }
.crop-frame { position: relative; line-height: 0; }
#crop-canvas { display: block; }
#crop-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; touch-action: none; }
#crop-svg .mask { fill: rgba(5, 7, 12, .58); }
#crop-svg .edge { fill: none; stroke: var(--hl); stroke-width: 2.500; stroke-linejoin: round; }
#crop-svg .corner { fill: rgba(255, 217, 46, .25); stroke: var(--hl); stroke-width: 3; }
#crop-svg .mid { fill: var(--hl); stroke: var(--dark); stroke-width: 1.500; }
#loupe { position: absolute; top: 10px; left: 10px; width: 132px; height: 132px; border-radius: 50%; border: 3px solid var(--hl); box-shadow: 0 8px 24px rgba(0, 0, 0, .6); background: #000; pointer-events: none; }
#loupe.right { left: auto; right: 10px; }
.crop-help { flex: none; text-align: center; color: var(--on-dark-2); font-size: 13.500px; padding: 0 20px 10px; }

/* ---- Hojas inferiores y diálogos ---- */
.scrim { position: fixed; inset: 0; background: rgba(8, 11, 20, .5); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 51; background: var(--paper); color: var(--ink); color-scheme: light dark;
  border-radius: 22px 22px 0 0; padding: 10px calc(18px + var(--sar)) calc(var(--sab) + 16px) calc(18px + var(--sal));
  max-height: calc(100% - var(--sat) - 24px - var(--kb, 0px)); overflow-y: auto; transform: translateY(calc(102% + var(--kb, 0px))); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  max-width: 560px; margin: 0 auto; -webkit-user-select: none; user-select: none;
}
.sheet.in { transform: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 4px; }
.sheet .sub { color: var(--graphite); font-size: 14.500px; margin-bottom: 14px; line-height: 1.4; }
.sheet h3 { font-size: 14px; font-weight: 650; color: var(--graphite); margin: 18px 0 8px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet input[type=text] { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--sheet); padding: 0 14px; font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.sheet input[type=text]:focus { border-color: var(--pen); }
.menu { display: grid; gap: 2px; margin: 6px -8px 0; }
.menu button { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 12px; border-radius: 12px; font-size: 16.500px; font-weight: 550; text-align: left; }
.menu button:active { background: var(--sheet); }
.menu button.danger { color: var(--danger); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--line); border-radius: 12px; padding: 4px; }
.seg button { height: 40px; border-radius: 9px; font-size: 14.500px; font-weight: 600; color: var(--graphite); padding: 0 4px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 27, 45, .15); }
.formats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.formats button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 2px 10px; border-radius: 12px; background: var(--sheet); border: 1.500px solid var(--line); min-width: 0; }
.formats button b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.formats button small { font-size: 11.500px; color: var(--graphite); font-weight: 500; white-space: nowrap; }
.formats button[aria-pressed="true"] { border-color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen); }
.formats button[aria-pressed="true"] b { color: var(--pen); }
.file-ready { display: flex; align-items: center; gap: 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 6px; }
.file-ready .badge { width: 46px; height: 56px; border-radius: 4px; background: var(--hl); color: #141B2D; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.file-ready div { min-width: 0; }
.file-ready strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-ready span { color: var(--graphite); font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14.500px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--graphite); }
.kv b { color: var(--ink); font-weight: 600; text-align: right; }
.note { color: var(--graphite); font-size: 13.500px; line-height: 1.45; margin-top: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 96px); transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 22px; font-size: 14.500px; font-weight: 550; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 40px); text-align: center; }
#toast.in { opacity: 1; transform: translate(-50%, 0); }
#busy { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(8, 11, 20, .45); }
.busy-card { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 190px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.busy-card p { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3.500px solid var(--line); border-top-color: var(--pen); animation: spin .8s linear infinite; }
.spinner.sm { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .sheet, .scrim, #toast, .btn { transition: none; }
  .cam-flash.go { animation: none; }
}
@media (min-width: 700px) {
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .dock { justify-content: center; }
  .dock .btn { flex: 0 1 220px; }
}
