/* SIDIF · iOS-style home screen web app. System colors and metrics follow Apple's Human Interface Guidelines. */

:root {
  color-scheme: light dark;
  --tint: #b51f35;
  --tint-strong: #911329;
  --tint-soft: rgba(181, 31, 53, .1);
  --on-tint: #fff;
  --bg: #f2f2f7;
  --card: #fff;
  --card-pressed: #e5e5ea;
  --fill: rgba(118, 118, 128, .12);
  --fill-strong: rgba(120, 120, 128, .2);
  --label: #000;
  --label-2: rgba(60, 60, 67, .74);
  --label-3: rgba(60, 60, 67, .3);
  --separator: rgba(60, 60, 67, .29);
  --bar: rgba(246, 246, 248, .82);
  --segment-on: #fff;
  --alert-bg: rgba(242, 242, 247, .92);
  --hud-bg: rgba(255, 255, 255, .92);
  --red: #d70015;
  --orange: #c93400;
  --green: #248a3d;
  --paper: #fff;
  --ink: #10243e;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .14);
  --tile-blue: #007aff; --tile-indigo: #5856d6; --tile-orange: #ff9500; --tile-green: #34c759;
  --tile-teal: #b51f35; --tile-purple: #af52de; --tile-pink: #ff2d55; --tile-gray: #8e8e93;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* On iPhone the text follows the size chosen in Settings › Display & Brightness › Text Size. */
@supports (font: -apple-system-body) {
  @media (hover: none) and (pointer: coarse) {
    :root { font: -apple-system-body; }
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --tint: #ff8a96;
    --tint-strong: #ffaab3;
    --tint-soft: rgba(255, 138, 150, .16);
    --on-tint: #39000b;
    --bg: #000;
    --card: #1c1c1e;
    --card-pressed: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-strong: rgba(120, 120, 128, .36);
    --label: #fff;
    --label-2: rgba(235, 235, 245, .62);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .65);
    --bar: rgba(22, 22, 24, .82);
    --segment-on: #636366;
    --alert-bg: rgba(44, 44, 46, .9);
    --hud-bg: rgba(44, 44, 46, .92);
    --red: #ff6961;
    --orange: #ffb340;
    --green: #30db5b;
    --tile-teal: #b51f35;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--label); -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); line-height: 1.29; }
html.modal-open { overflow: hidden; }
#app { overflow-x: clip; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tint); }
svg { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 24px; }

/* ---------- Screens and navigation bar ---------- */

.screen { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.content { max-width: 760px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

.navbar { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); transition: background-color .2s, box-shadow .2s; }
.navbar.scrolled { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--separator); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .navbar.scrolled { background: var(--bg); }
}
.navbar-bar { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; max-width: 792px; margin: 0 auto; padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
.nav-leading { display: flex; min-width: 0; max-width: 40%; }
.nav-trailing { display: flex; align-items: center; gap: 4px; margin-left: auto; }
/* Centered on the bar, not between its neighbours, so a hidden title never squeezes the back button. */
.nav-title { position: absolute; left: 50%; max-width: 46%; overflow: hidden; font-size: 1rem; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-50%); transition: opacity .2s; }
.navbar.scrolled .nav-title, .navbar.always .nav-title { opacity: 1; }
.nav-back { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; min-height: 44px; padding: 0 8px 0 0; border: 0; background: none; color: var(--tint); font-size: 1rem; }
.nav-back svg { width: 26px; height: 26px; stroke-width: 2.3; margin-right: -2px; }
.nav-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-button { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--tint); font-size: 1rem; }
.nav-button.strong { font-weight: 600; }
.nav-icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 4px; border: 0; border-radius: 50%; background: var(--fill); color: var(--tint); }
.nav-icon svg { width: 21px; height: 21px; stroke-width: 2.3; }
.nav-icon:active { background: var(--fill-strong); }

.large-title { padding: 2px 4px 14px; }
.large-title h1 { margin: 0; font-size: 2rem; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.large-title h1:focus { outline: none; }
.large-subtitle { margin: 4px 0 0; color: var(--label-2); font-size: .88rem; line-height: 1.35; }

/* ---------- Inset grouped lists ---------- */

.list-group { margin: 0 0 30px; }
.list-header { margin: 0 16px 7px; color: var(--label-2); font-size: .765rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; }
.list-header.title { margin: 0 4px 8px; color: var(--label); font-size: 1.18rem; font-weight: 700; text-transform: none; letter-spacing: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-footer { margin: 7px 16px 0; color: var(--label-2); font-size: .765rem; line-height: 1.38; }
.list { overflow: hidden; border-radius: var(--radius); background: var(--card); }

.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 0; padding: 11px 16px; border: 0; background: var(--card); color: var(--label); font-size: 1rem; text-align: left; text-decoration: none; }
.row:not(:last-child)::after { content: ""; position: absolute; right: 0; bottom: 0; left: var(--inset, 16px); height: 1px; background: var(--separator); transform: scaleY(.5); transform-origin: bottom; }
.row.with-icon { --inset: 57px; }
.row.doc { --inset: 68px; padding-top: 12px; padding-bottom: 12px; }
a.row, button.row, label.row { cursor: pointer; -webkit-user-select: none; user-select: none; }
a.row:active, button.row:active, label.row:active { background: var(--card-pressed); }
.row-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; color: #fff; flex: none; }
.row-icon svg { width: 19px; height: 19px; stroke-width: 2; }
.tint-blue { background: var(--tile-blue); } .tint-indigo { background: var(--tile-indigo); } .tint-orange { background: var(--tile-orange); }
.tint-green { background: var(--tile-green); } .tint-teal { background: var(--tile-teal); } .tint-purple { background: var(--tile-purple); }
.tint-pink { background: var(--tile-pink); } .tint-gray { background: var(--tile-gray); }
.row-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-size: 1rem; line-height: 1.29; overflow-wrap: anywhere; }
.row-title.strong { font-weight: 600; }
.row-subtitle { color: var(--label-2); font-size: .88rem; line-height: 1.33; overflow-wrap: anywhere; }
.row-subtitle.done { color: var(--green); }
.row-detail { color: var(--label-2); font-size: 1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-detail.tint { color: var(--tint); }
.row-detail.done { color: var(--green); display: inline-flex; align-items: center; gap: 4px; }
.row-detail.done svg { width: 18px; height: 18px; stroke-width: 2.2; }
.row-chevron { width: 13px; height: 13px; color: var(--label-3); stroke-width: 3.2; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; color: var(--label-2); font-size: .765rem; }
.row.destructive { justify-content: center; color: var(--red); }
.row.action { justify-content: center; color: var(--tint); }

.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; background: var(--fill); color: var(--label-2); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.badge.green { background: rgba(52, 199, 89, .16); color: var(--green); }
.badge.orange { background: rgba(255, 149, 0, .18); color: var(--orange); }

.doc-glyph { display: grid; place-items: center; width: 40px; height: 48px; border-radius: 7px; background: var(--fill); color: var(--label-2); flex: none; }
.doc-glyph.pdf { background: var(--tint-soft); color: var(--tint); }
.doc-glyph svg { width: 24px; height: 24px; }

/* ---------- Form rows ---------- */

.row.field { flex-direction: column; align-items: stretch; gap: 3px; padding-top: 9px; padding-bottom: 9px; transition: box-shadow .15s; }
.row.field:has(.field-input:focus) { box-shadow: inset 3px 0 0 var(--tint); }
.field-label { color: var(--label-2); font-size: .765rem; line-height: 1.3; }
.row.field:has(.field-input:focus) .field-label { color: var(--tint); }
.field-input { width: 100%; min-height: 28px; margin: 0; padding: 2px 0; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--label); font-size: max(16px, 1rem); line-height: 1.35; -webkit-appearance: none; appearance: none; }
.field-input::placeholder { color: var(--label-3); }
textarea.field-input { min-height: 76px; overflow: hidden; resize: none; }
.row.field.invalid .field-label, .field-error { color: var(--red); }
.field-error { margin: 2px 0 0; font-size: .765rem; }

.row.inline-field { justify-content: space-between; }
.inline-label { flex: 1; min-width: 0; font-size: 1rem; }
.inline-value { position: relative; display: flex; align-items: center; justify-content: flex-end; flex: none; min-width: 104px; }
.inline-control { max-width: 100%; min-height: 34px; padding: 5px 10px; border: 0; border-radius: 8px; background: var(--fill); color: var(--label); font-size: max(16px, 1rem); text-align: right; -webkit-appearance: none; appearance: none; }
.inline-control::-webkit-date-and-time-value { text-align: right; }
.inline-field.empty:not(:focus-within) .inline-control { color: transparent; }
.inline-field.empty:not(:focus-within) .inline-control::-webkit-calendar-picker-indicator { opacity: 0; }
.inline-placeholder { position: absolute; right: 10px; color: var(--tint); font-size: 1rem; pointer-events: none; }
.inline-field:not(.empty) .inline-placeholder, .inline-field:focus-within .inline-placeholder { display: none; }

.segmented { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--fill); }
.segment { flex: 1; min-width: 0; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--label); font-size: .82rem; font-weight: 500; transition: background-color .2s, box-shadow .2s; }
.segment[aria-checked="true"] { background: var(--segment-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.row.field .segmented { margin-top: 5px; }

.row.check .row-title { flex: 1; }
.row.check.long .row-title, .row.switch-row .row-title { font-size: .94rem; line-height: 1.36; }
.checkmark { width: 20px; height: 20px; color: var(--tint); stroke-width: 2.6; opacity: 0; }
.row.check input:checked ~ .checkmark { opacity: 1; }
.row.check:has(input:focus-visible), .row.switch-row:has(input:focus-visible) { box-shadow: inset 0 0 0 3px var(--tint); }

.row.switch-row .row-title { flex: 1; }
.switch { position: relative; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--fill-strong); cursor: pointer; transition: background-color .25s; -webkit-appearance: none; appearance: none; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .25s cubic-bezier(.3, .7, .4, 1); }
.switch:checked { background: #34c759; }
.switch:checked::before { transform: translateX(20px); }
.switch:focus-visible { outline-offset: 3px; }

.sig-thumb { width: 96px; height: 38px; border-radius: 6px; background: var(--paper); box-shadow: inset 0 0 0 .5px var(--separator); flex: none; }

/* ---------- Buttons, search and banners ---------- */

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--fill); color: var(--tint); font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; -webkit-user-select: none; user-select: none; transition: transform .1s, background-color .15s; }
.button svg { width: 1.15em; height: 1.15em; stroke-width: 2.2; }
.button.filled { background: var(--tint); color: var(--on-tint); }
.button.filled:active:not(:disabled) { background: var(--tint-strong); }
.button.tinted { background: var(--tint-soft); color: var(--tint); }
.button.plain { padding-right: 8px; padding-left: 8px; background: transparent; }
.button.destructive { color: var(--red); }
.button.large { min-height: 52px; font-size: 1.06rem; }
.button.block { display: flex; width: 100%; }
.button:disabled { opacity: .45; cursor: default; }
.button:active:not(:disabled) { transform: scale(.98); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-field { display: flex; align-items: center; gap: 6px; height: 38px; margin: 0 0 12px; padding: 0 8px; border-radius: 10px; background: var(--fill); color: var(--label-2); }
.search-field svg { width: 18px; height: 18px; stroke-width: 2.2; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--label); font-size: max(16px, 1rem); -webkit-appearance: none; appearance: none; }
.search-field input::placeholder { color: var(--label-2); }
.search-field:focus-within { box-shadow: 0 0 0 3px var(--tint-soft); }
.segmented.filters { margin: 0 0 22px; }
.segment .count { color: var(--label-2); font-weight: 500; margin-left: 4px; }

.banner { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 22px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); }
.banner > svg { width: 24px; height: 24px; margin-top: 1px; color: var(--tint); }
.banner-body { flex: 1; min-width: 0; }
.banner h2 { margin: 0 0 3px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.banner p { margin: 0; color: var(--label-2); font-size: .88rem; line-height: 1.38; }
.banner .button-row { margin-top: 10px; }
.banner.warning { background: rgba(255, 149, 0, .15); }
.banner.warning > svg { color: var(--orange); }
.banner img { width: 54px; height: 54px; border-radius: 12px; flex: none; }
.steps-list { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .94rem; line-height: 1.35; }
.steps-list li::before { content: counter(step); counter-increment: step; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); font-size: .74rem; font-weight: 600; flex: none; }
.glyph { display: inline-flex; color: var(--tint); vertical-align: -.22em; }
.glyph svg { width: 1.15em; height: 1.15em; stroke-width: 2.2; }

.empty-state { padding: 44px 24px 36px; border-radius: var(--radius); background: var(--card); text-align: center; }
.empty-state > svg { display: block; width: 46px; height: 46px; margin: 0 auto 12px; color: var(--label-3); stroke-width: 1.4; }
.empty-state h2 { margin: 0 0 6px; font-size: 1.18rem; }
.empty-state p { max-width: 32ch; margin: 0 auto 18px; color: var(--label-2); font-size: .94rem; line-height: 1.4; }

.save-status { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; margin: 6px 0 0; color: var(--label-2); font-size: .82rem; }
.save-status svg { width: 16px; height: 16px; stroke-width: 2.2; }
.save-status.saved { color: var(--green); }
.save-status.offline, .save-status.conflict { color: var(--orange); }
.save-status.error { color: var(--red); }

.intro-text { margin: -4px 4px 22px; color: var(--label-2); font-size: .88rem; line-height: 1.4; }
.library-footer { margin: 30px 0 8px; color: var(--label-2); font-size: .765rem; line-height: 1.5; text-align: center; }
.library-footer img { display: block; width: 118px; height: auto; margin: 0 auto 8px; }
.qr-card { width: min(250px, 68vw); margin: 6px auto 14px; padding: 12px; border-radius: 16px; background: #fff; }
.qr-card img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.link-box { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--card); color: var(--label-2); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .74rem; word-break: break-all; -webkit-user-select: all; user-select: all; }
.sheet-text { margin: 0 4px 14px; color: var(--label-2); font-size: .94rem; line-height: 1.42; }
.result { padding: 8px 4px 4px; text-align: center; }
.result > svg { width: 60px; height: 60px; margin: 6px auto 10px; color: var(--green); stroke-width: 1.6; }
.result h3 { margin: 0 0 4px; font-size: 1.3rem; }
.result p { margin: 0 auto 18px; max-width: 36ch; color: var(--label-2); font-size: .94rem; line-height: 1.42; }
.result .button { margin-bottom: 10px; }
.result .install-icon { display: block; width: 72px; height: 72px; margin: 6px auto 12px; border-radius: 16px; }
.pdf-action { margin: 0 0 30px; }
.list-footer + .pdf-action { margin-top: 14px; }

/* ---------- Dialogs ---------- */

dialog { padding: 0; border: 0; color: var(--label); }
dialog:focus { outline: none; }
dialog::backdrop { background: rgba(0, 0, 0, .36); }

.alert { width: 270px; max-width: calc(100vw - 48px); overflow: hidden; border-radius: 14px; background: var(--alert-bg); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); text-align: center; }
.alert-body { padding: 19px 16px 16px; }
.alert-body h2 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.alert-body p { margin: 5px 0 0; font-size: .8rem; line-height: 1.38; }
.alert-actions { display: flex; box-shadow: inset 0 .5px 0 var(--separator); }
.alert-actions.stacked { flex-direction: column; }
.alert-button { flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--tint); font-size: 1rem; }
.alert-button + .alert-button { box-shadow: inset .5px 0 0 var(--separator); }
.alert-actions.stacked .alert-button + .alert-button { box-shadow: inset 0 .5px 0 var(--separator); }
.alert-button.primary { font-weight: 600; }
.alert-button.destructive { color: var(--red); font-weight: 600; }
.alert-button:active { background: var(--fill); }

.sheet { display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: calc(100dvh - env(safe-area-inset-top) - 10px); margin: auto auto 0; padding-bottom: env(safe-area-inset-bottom); overflow: hidden; border-radius: 14px 14px 0 0; background: var(--bg); }
.sheet:not([open]) { display: none; }
.sheet.full { height: calc(100dvh - env(safe-area-inset-top) - 10px); max-width: 900px; }
.sheet-grabber { flex: none; width: 36px; height: 5px; margin: 6px auto 0; border-radius: 3px; background: var(--label-3); }
.sheet-bar { display: grid; flex: none; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: 50px; padding: 0 8px; }
.sheet-leading { justify-self: start; }
.sheet-trailing { justify-self: end; }
.sheet-title { max-width: 52vw; margin: 0; overflow: hidden; font-size: 1rem; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.sheet-button { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--tint); font-size: 1rem; }
.sheet-button.strong { font-weight: 600; }
/* flex-basis auto: with a 0% basis WebKit collapses the body of a sheet that has no fixed height. */
.sheet-body { flex: 1 1 auto; min-height: 0; padding: 4px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 700px) and (min-height: 640px) {
  .sheet { margin: auto; border-radius: 14px; max-height: 88dvh; }
  .sheet.full { height: auto; }
}

/* Signature pad: the drawing area keeps the 2.5:1 ratio the PDF expects. */
.signature-body { --reserve: 230px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 2px; }
.pad-context { max-width: 62ch; margin: 0; color: var(--label-2); font-size: .765rem; line-height: 1.4; text-align: center; }
.pad, .pad-tools { width: min(100%, calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--reserve)) * 2.5)); }
.pad { position: relative; aspect-ratio: 2.5; border-radius: 12px; background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 0 0 .5px var(--separator); }
.pad-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; cursor: crosshair; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pad-line { position: absolute; right: 7%; bottom: 25%; left: 7%; border-bottom: 1.5px solid #c7c7cc; pointer-events: none; }
.pad-line span { position: absolute; bottom: 3px; left: -2px; color: #8e8e93; font-size: 1.25rem; line-height: 1; }
.pad-placeholder { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #aeaeb2; font-size: 1.1rem; pointer-events: none; }
.pad-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pad-signer { flex: 1; overflow: hidden; color: var(--label-2); font-size: .88rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pad-hint { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--label-2); font-size: .765rem; }
.pad-hint svg { width: 16px; height: 16px; }
@media (orientation: landscape), (hover: hover) { .pad-hint { display: none; } }
@media (orientation: landscape) and (max-height: 520px) {
  .signature-body { --reserve: 150px; }
  .pad-context, .sheet.full .sheet-grabber { display: none; }
}

.hud { position: fixed; bottom: calc(26px + env(safe-area-inset-bottom)); left: 50%; z-index: 50; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: var(--hud-bg); box-shadow: var(--shadow); color: var(--label); font-size: .94rem; font-weight: 500; transform: translateX(-50%); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: opacity .25s; }
.hud svg { width: 20px; height: 20px; color: var(--green); stroke-width: 2.2; }
.hud.warning svg { color: var(--orange); }
.hud.leaving { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .screen.push { animation: push-in .34s cubic-bezier(.2, .9, .3, 1); }
  .screen.pop { animation: pop-in .3s cubic-bezier(.2, .9, .3, 1); }
  .sheet[open] { animation: sheet-in .34s cubic-bezier(.2, .9, .3, 1); }
  .sheet.closing { animation: sheet-out .22s ease-in forwards; }
  .alert[open] { animation: alert-in .2s ease-out; }
  .hud { animation: hud-in .3s cubic-bezier(.2, .9, .3, 1); }
  @keyframes push-in { from { transform: translateX(26%); opacity: .35; } }
  @keyframes pop-in { from { transform: translateX(-16%); opacity: .5; } }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  @keyframes alert-in { from { opacity: 0; transform: scale(1.12); } }
  @keyframes hud-in { from { opacity: 0; transform: translate(-50%, 14px); } }
}

/* Client directory and the optional legacy records use the existing grouped-list language. */
.client-actions { flex-wrap: wrap; }
.legacy-details { margin: 24px 0; }
.legacy-details summary { color: var(--tint); min-height: 44px; padding: 12px 4px; cursor: pointer; }
input[type="datetime-local"].field-input { min-width: 0; max-width: 100%; min-height: 44px; }
::selection { background: var(--tint-soft); color: var(--label); }
input, textarea { caret-color: var(--tint); }

/* Recovered ink stays proportional; only the canvas receives drawing gestures. */
.pad-recovered { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; pointer-events: none; }
img.sig-thumb { object-fit: contain; }
.signature-status { display: block; text-align: center; }
.signature-status:empty { display: none; }

/* Equipment batches: device rows, the scan sheet and stacked PDF actions. */
.button-stack { display: grid; gap: 10px; }
.scan-actions { margin: 0 0 12px; }
.scan-actions .button { flex: 1 1 180px; }
.batch-client { margin: -22px 0 26px; }
.device-glyph { width: 40px; height: 40px; }
.device-glyph.ready { background: rgba(52, 199, 89, .16); color: var(--green); }
.device-chips { gap: 4px; }
.row.device { --inset: 68px; }
.scan-body { padding-top: 4px; }
.scan-tip { margin: 8px 4px 22px; }
.scan-status { display: flex; align-items: center; gap: 8px; min-height: 1.4em; }
.scan-status:empty { display: none; }
.scan-item { gap: 10px; }
.scan-tag { width: 82px; min-height: 36px; padding: 5px 8px; border: 0; border-radius: 8px; background: var(--fill); color: var(--label); font-size: max(16px, 1rem); text-align: center; }
.scan-tag:focus { outline: 2px solid var(--tint); }
.scan-item .nav-icon { flex: none; color: var(--label-2); }
.scan-count { text-align: center; }
.scan-item .badge { white-space: normal; text-align: left; }

/* Acceso con cuenta del servidor. */
.acceso-local { display: block; margin: 0 0 18px; }
.acceso-local .list-group { margin-bottom: 12px; }
.acceso-local .field-error { margin: 0 16px 12px; }
.acceso-local .button { margin-top: 2px; }
