:root {
  --handheld-canvas: #f3f5fa;
  color-scheme: light;
  --ink: #202436;
  --muted: #62697b;
  --line: #e4e7ef;
  --soft: #f5f6fa;
  --accent: #6b5300;
  --accent-fill: #ffe04a;
  --accent-hover: #f5d137;
  --accent-on: #231c0a;
  --accent-stroke: #ad8710;
  --accent-border: #eddb91;
  --tint: #fff4c6;
  --tint-subtle: #fffae9;
  --success: #22654f;
  --surface: #fff;
  --success-bg: #e6f5ee;
  --warning: #80500d;
  --warning-bg: #fff2d8;
  --warning-border: #e6c384;
  --warning-panel: #fffbf3;
  --danger: #9b3d3a;
  --danger-bg: #ffe9e8;
  --radius: 15px;
  --section-gap: clamp(16px, 2vw, 28px);
  font: 100%/1.45 var(--font-ui);
  color: var(--ink);
  background: white;
}
*, *::before, *::after { box-sizing: border-box; }
body,h1,h2,h3,p,dl,dd,ol { margin:0; }
body:has(dialog[open]) { overflow:hidden; }
button,input,select,textarea { font:inherit;color:inherit; }
button,summary { cursor:pointer; }
button:disabled,input:disabled,select:disabled { opacity:.55;cursor:default; }
a { color:inherit;text-decoration:none; }
svg { display:block; width:20px; height:20px; flex:none; }
img { display:block; }
[hidden] { display:none!important; }
:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
#dialog-title:focus, #co-photo-title:focus, main:focus {outline:none}
html:not([data-keyboard-nav]) :focus {outline:none !important}
html:not([data-keyboard-nav]) .filter-choice input:focus-visible + span {outline:none}
.skip { position:fixed;top:6px;left:6px;transform:translateY(-150%);z-index:5;background:white;padding:10px; }
.skip:focus { transform:none; }
h2 { font:var(--type-section);letter-spacing:var(--heading-tracking); }
h3 { font:var(--type-card);letter-spacing:var(--heading-tracking); }
small,.secondary-copy { font-size:13px;color:var(--muted); }
.secondary-copy { display:block; }
.app { min-height:100svh;display:grid;grid-template-columns:clamp(210px,16.8vw,260px) minmax(0,1fr); }
.sidebar { position:sticky;top:0;align-self:start;display:flex;flex-direction:column;min-height:100svh;max-height:100svh;overflow:auto;border-right:1px solid var(--line);padding:28px 16px 18px;background:#fafbfe; }
.brand { display:block; margin-inline:4px; }
.brand-logo { width:100%;height:auto; }
.sidebar-profile {display:flex;align-items:center;gap:10px;min-width:0;margin-top:auto;padding:12px 8px;border-top:1px solid var(--line);color:var(--ink)}
.sidebar-profile:hover,.sidebar-profile[aria-current=page] {background:var(--tint);border-radius:9px}
.profile-initials,.crew-avatar,.site-symbol {display:grid;place-items:center;flex:none;background:var(--tint);color:var(--accent);font-weight:700;font-style:normal}
.profile-initials {width:36px;height:36px;border-radius:50%;font-size:13px}
.profile-copy {display:grid;gap:2px;min-width:0;line-height:1.25}
.profile-copy strong {font-size:14px;font-weight:620;overflow-wrap:anywhere}
.profile-copy small {font-size:12px;color:var(--muted)}
.profile-arrow {width:15px;height:15px;margin-left:auto;transform:rotate(-90deg);color:var(--muted)}
.nav { display:grid;gap:4px;margin:32px 0; }
@media(min-width:801px) {
  .sidebar .brand,.sidebar-profile {flex-shrink:0}
  .sidebar .nav {min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:3px}
  .sidebar .profile-dock {display:grid;gap:4px;padding-inline:3px}
}
.nav-link,.nav-group,.object-link,.all-link { border:0;color:#505668;background:transparent;border-radius:9px;transition:background-color .16s,color .16s; }
.nav-link,.nav-group { width:100%;min-height:42px;display:flex;align-items:center;gap:12px;padding:10px 12px;text-align:left;font-size:15px;font-weight:560; }
.nav-label { min-width:0;overflow-wrap:anywhere; }
.nav-count,.mobile-due span {
  display:grid;place-items:center;min-width:22px;padding:1px 5px;border-radius:6px;
  font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;
}
.nav-count { flex:none;margin-inline-start:auto;background:var(--accent-fill);color:var(--accent-on); }
.nav-count.warning,.mobile-due span { background:var(--warning-bg);color:var(--warning); }
.mobile-due { margin-left:auto;margin-right:8px;padding:4px 8px;min-height:40px;display:inline-flex;gap:6px;align-items:center;border-radius:8px;color:var(--warning); }
.nav-link svg,.nav-group svg { color:#757c8d; }
.sidebar :is(.nav-link,.nav-group,.object-link,.all-link):hover { background:#f0f2f8;color:var(--ink); }
.sidebar :is(.nav-link,.object-link,.all-link)[aria-current=page] { background:var(--tint);color:var(--accent);font-weight:650; }
.nav-link[aria-current=page] svg { color:inherit; }
.sidebar :is(.nav-link,.nav-group):focus-visible { outline-offset:-2px; }
@media screen and (min-width:801px) and (max-width:1330px) {
  .nav-link,.nav-group { gap:8px;padding-inline:9px;font-size:14px; }
  .nav-count { padding-inline:4px;font-size:11px; }
}
.site-nav { border-top:1px solid var(--line);padding-top:14px;margin-top:12px; }
.chevron { margin-left:auto;width:15px;transition:transform .22s; }
[aria-expanded=false] .chevron { transform:rotate(-90deg); }
.nav-reveal { display:grid;grid-template-rows:1fr;transition:grid-template-rows .23s ease,opacity .23s; }
.nav-reveal[inert] { grid-template-rows:0fr;opacity:0; }
.nav-clip { overflow:hidden;min-height:0; }
.nested { display:grid;gap:3px;padding:4px; }
.nested :focus-visible { outline-offset:-2px; }
.object-link { display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:9px;align-items:center;min-height:39px;padding:7px 9px;font-size:14px; }
.object-name { overflow-wrap:anywhere; }
.object-ring { width:12px;height:12px;border-radius:50%;background:conic-gradient(var(--accent-stroke) var(--fill),#dcdfeb 0);mask:radial-gradient(circle,transparent 40%,black 47%); }
.object-count { font-size:12px;font-variant-numeric:tabular-nums; }
.all-link { padding:8px 10px 8px 30px;font-size:14px; }
.mobile-header { display:none; }
main { min-width:0;width:100%;max-width:1510px;margin:0 auto;padding:clamp(22px,2.7vw,44px) clamp(20px,3.2vw,54px) 48px; }
.section-head { display:grid;gap:6px;margin-bottom:var(--section-gap); }
.back-link { display:inline-flex;align-items:center;gap:6px;justify-self:start;color:var(--muted);font-size:13px;padding-block:4px;margin-bottom:5px; }
.back-link svg { width:15px;height:15px; }
.back-link:hover { color:var(--accent); }
.dispatch-path a:hover { text-decoration:underline; }
.section-title,.title-label { display:flex;align-items:center;gap:11px; }
.section-title { justify-content:space-between;flex-wrap:wrap; }
.section-title .title-label { min-width:0; }
.section-title h1 { overflow-wrap:anywhere; }
.title-count { padding:2px 8px;border-radius:8px;background:var(--soft);color:var(--muted);font-size:15px;font-variant-numeric:tabular-nums; }
.section-head p { color:var(--muted);font-size:15px; }
.button,.icon-button { display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border-radius:9px;border:1px solid transparent;padding:8px 14px;font-weight:600;font-size:14px;transition:background-color .15s,box-shadow .15s; }
.button.primary { background:var(--accent-fill);color:var(--accent-on);box-shadow:0 1px 2px #58450024; }
.button.primary:hover { background:var(--accent-hover); }
.button.secondary,.icon-button { background:white;border-color:#d9ddea; }
.button.secondary:hover,.icon-button:hover { background:var(--soft); }
.inv-quick-actions > .button[data-source="find"] { background:var(--tint);border-color:var(--accent-border);color:var(--accent-on); }
.inv-quick-actions > .button[data-source="find"]:hover { background:var(--accent-fill); }
.inv-quick-actions > .button[data-source="find"]:disabled { background:var(--tint); }
.icon-button { padding:8px;min-width:36px;min-height:36px; }
.button svg,.icon-button svg { width:17px;height:17px; }
.empty { border:1px dashed #d9ddea;border-radius:12px;padding:20px;color:var(--muted);font-size:14px; }
.workspace-empty {
  display:grid; grid-template-columns:clamp(150px,22vw,192px) minmax(0,1fr); align-items:center;
  gap:clamp(20px,3vw,34px); width:min(100%,720px); padding:26px;
  border:1px solid var(--line); border-radius:22px;
  background:linear-gradient(165deg,#f5f7ff,var(--surface) 58%);
}
.workspace-empty img { width:100%; height:auto; }
.workspace-empty-content { display:grid; justify-items:start; gap:8px; min-width:0; }
.workspace-empty h2 { font-size:clamp(21px,5vw,24px); line-height:1.15; text-wrap:balance; }
.workspace-empty p { max-width:36ch; color:var(--muted); font-size:14px; text-wrap:pretty; }
.workspace-empty-actions { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:8px; }
.workspace-empty-actions .button { min-height:44px; border-radius:11px; }
.workspace-empty-actions [data-import-open] { border-color:transparent; background:transparent; color:var(--accent); }
.workspace-empty-actions [data-import-open]:hover { background:var(--tint); }
.directory-grid+.workspace-empty { margin-top:14px; }
@media (max-width:640px) {
  .workspace-empty { grid-template-columns:minmax(0,1fr); justify-items:center; gap:12px; padding:16px 15px; text-align:center; }
  .workspace-empty:has([data-import-open]) { padding-bottom:10px; }
  .workspace-empty img { width:clamp(116px,36vw,148px); }
  .workspace-empty-content { justify-items:center; width:100%; }
  .workspace-empty-actions { width:min(100%,260px); display:grid; gap:0; margin-top:4px; }
}
.workspace-empty.compact {
  grid-template-columns:clamp(65px,18vw,87px) minmax(0,1fr);
  justify-items:stretch; gap:12px; padding:14px; border-radius:17px; text-align:start;
}
.workspace-empty.compact img { width:100%; }
.workspace-empty.compact .workspace-empty-content { justify-items:start; gap:4px; }
.workspace-empty.compact h3 { font-size:16px; line-height:1.2; }
.workspace-empty.compact p { font-size:13px; }
.workspace-empty.compact .workspace-empty-actions { width:auto; margin-top:4px; }
.workspace-empty.compact .button { padding-inline:12px; }
.directory-rows>.workspace-empty { width:100%; border:0; border-radius:0; }
.directory-people+.workspace-empty { border-top:1px solid var(--line); }

.field,.kit-picker { display:grid;gap:6px; }
.field,.due-fields small { font-size:13px;font-weight:580;color:var(--muted); }
.input,.due-fields input,.due-fields select,.due-calendar summary { width:100%;min-width:0;min-height:41px;padding:9px 12px;background:white;border:1px solid #d8dce8;border-radius:9px;color:var(--ink);font-size:15px; }
.search { max-width:390px;margin-bottom:18px; }
.kit-status { display:inline-flex;align-items:center;gap:6px;max-width:100%;border-radius:6px;padding:4px 8px;font-size:12px;line-height:1.25;font-weight:600;color:#535e78;background:#eef1f7; }
.kit-status.ready { background:var(--success-bg);color:var(--success); }
.kit-status.pending { background:var(--warning-bg);color:var(--warning); }
.kit-status.disputed { background:var(--danger-bg);color:var(--danger); }
.kit-status.requested { background:var(--tint);color:var(--accent); }
.project-grid,.crew-grid,.crew-detail-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(245px,100%),1fr));gap:16px;align-items:stretch; }
.project-tile,.crew-tile,.crew-block,.dispatch-row,.kit-register,.kit-detail,.inv-register,.inv-side { border:1px solid var(--line);border-radius:var(--radius);background:white;min-width:0; }
.project-tile,.crew-tile { display:flex;flex-direction:column;padding:20px;transition:box-shadow .18s,border-color .18s,transform .18s; }
.project-tile:hover,.crew-tile:hover { border-color:#bcc4e1;box-shadow:0 7px 20px #252c4810;transform:translateY(-2px); }
.project-tile header,.crew-tile header { display:flex;gap:10px;align-items:center; }
.project-tile header { justify-content:space-between;margin-bottom:20px; }
.site-symbol,.crew-avatar { width:41px;height:41px;border-radius:12px; }
.project-tile:nth-child(3n+2) .site-symbol,.crew-tile:nth-child(3n+2) .crew-avatar { background:#e1f0ef;color:#426a68; }
.project-tile:nth-child(3n+3) .site-symbol,.crew-tile:nth-child(3n+3) .crew-avatar { background:#f5e9df;color:#79543c; }
.project-tile p,.crew-tile p { color:var(--muted);font-size:14px;margin-top:3px; }
.project-tile dl { display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 10px;margin:18px 0;font-size:14px; }
.project-tile dt { color:var(--muted); }
.project-tile footer { margin-top:auto;padding-top:14px;border-top:1px solid var(--line); }
.project-tile footer span { display:flex;justify-content:space-between;font-size:13px;color:var(--muted); }
progress { display:block;appearance:none;overflow:hidden;height:5px;width:100%;border:none;border-radius:4px;background:#e8eaf1;margin-top:7px; }
progress::-webkit-progress-bar { background:#e8eaf1; }
progress::-webkit-progress-value { background:var(--accent-stroke); border-radius:4px; }
progress::-moz-progress-bar { background:var(--accent-stroke); }
.site-overview { display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:12px;padding:18px 0;margin-bottom:24px;border-block:1px solid var(--line); }
.site-overview > div { display:grid;align-content:start;gap:5px;padding:0 16px;min-width:0; }
.site-overview > div:first-child {padding-left:0}
.site-overview > div + div { border-left:1px solid #dfe4f0; }
.site-overview strong,.site-overview a { font-size:15px;font-weight:620; }
.site-overview a { color:var(--accent); }
.site-overview progress { max-width:145px;margin:2px 0 0; }
.site-page .site-back { display:inline-flex;align-items:center;min-height:44px;margin-bottom:6px; }
.site-hero {
  margin-bottom:16px;border:1px solid var(--line);border-radius:19px;background:var(--surface);
}
.site-identity {
  display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:start;gap:12px;
  padding:17px 16px;border-radius:19px 19px 0 0;
}
.site-identity-mark {
  display:grid;place-items:center;width:46px;height:46px;border-radius:13px;
  background:var(--tint);color:var(--accent);
}
.site-identity-mark svg {width:23px;height:23px}
.site-identity-copy {min-width:0;align-self:center}
.site-identity h1 {font:var(--type-page);font-size:clamp(24px,5vw,34px);letter-spacing:var(--title-tracking);overflow-wrap:anywhere}
.site-identity-copy p {display:grid;grid-template-columns:14px minmax(0,1fr);gap:5px;margin-top:4px;color:var(--muted);font-size:14px;overflow-wrap:anywhere}
.site-identity-copy p svg {width:14px;height:14px;margin-top:2px}
.site-actions {position:relative}
.site-actions summary {
  display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:11px;
  list-style:none;color:var(--muted);background:var(--surface)
}
.site-actions summary::-webkit-details-marker {display:none}
.site-actions[open] summary,.site-actions summary:hover {color:var(--accent);background:var(--tint)}
.site-action-list {
  position:absolute;inset:calc(100% + 6px) 0 auto auto;z-index:3;min-width:184px;
  padding:5px;border:1px solid var(--line);border-radius:13px;background:var(--surface);
  box-shadow:0 10px 24px #20243624
}
.site-action-list .co-entry {display:grid;gap:2px}
.site-action-list .button {
  width:100%;min-height:44px;justify-content:flex-start;padding:8px 10px;border:0;
  background:var(--surface);color:var(--ink);text-align:start;white-space:nowrap
}
.site-action-list .button:hover {background:var(--soft)}
.site-phase-action {display:flex;padding:0 16px 14px}
.site-phase-action .button {min-height:44px}
.site-facts {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;
  padding:13px 16px 16px;border-top:1px solid var(--line)
}
.site-facts>div {min-width:0;display:grid;align-content:start;gap:4px}
.site-facts dt {display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px}
.site-facts dt svg {width:15px;height:15px;color:var(--accent)}
.site-facts dd {padding-inline-start:21px;font:var(--type-card);overflow-wrap:anywhere}
.site-facts a {color:var(--accent)}
.site-kit-blank {
  display:grid;justify-items:center;gap:10px;min-width:0;padding:21px 16px;
  border:1px solid var(--line);border-radius:19px;background:var(--surface);text-align:center
}
.site-kit-blank h2 {margin-bottom:5px;line-height:1.2}
.site-kit-blank p {max-width:40ch;color:var(--muted);font-size:14px;text-wrap:pretty}
.site-kit-blank img {width:clamp(106px,34vw,144px);height:auto}
.site-kit-actions .button,.site-kit-head .button {min-height:44px;border-radius:11px}
.site-kit-head {row-gap:9px}
.site-kit-head small {display:block;margin-top:3px;font-variant-numeric:tabular-nums}
.site-kit-head progress {flex:1 0 100%;height:6px;margin:0}
.site-kit-complete::-webkit-progress-value {background:var(--success)}
.site-kit-complete::-moz-progress-bar {background:var(--success)}
.kit-state {
  --kit-state-ink:var(--muted);--kit-state-bg:#ebedf4;
  display:inline-flex;align-items:center;gap:6px;max-width:100%;
  color:var(--kit-state-ink);font-size:12px;font-weight:650;line-height:1.2
}
.kit-state-icon {
  display:grid;place-items:center;flex:none;width:19px;height:19px;border-radius:50%;
  background:var(--kit-state-bg);color:inherit
}
.kit-state-icon svg {width:12px;height:12px;stroke-width:2}
.kit-state-ready {--kit-state-ink:var(--success);--kit-state-bg:var(--success-bg)}
.kit-state-pending {--kit-state-ink:var(--warning);--kit-state-bg:var(--warning-bg)}
.kit-state-disputed,.kit-state-missing {--kit-state-ink:var(--danger);--kit-state-bg:var(--danger-bg)}
.kit-state-requested,.kit-state-booked {--kit-state-ink:var(--accent);--kit-state-bg:var(--tint)}
.kit-state-short {display:none}
.site-kit-detail-heading {display:flex;flex-wrap:wrap;align-items:baseline;gap:8px 12px}
.site-kit-detail-heading h2 {min-width:0;overflow-wrap:anywhere}
.site-kit-detail-heading .kit-state {min-height:24px;padding:3px 8px 3px 4px;border-radius:16px;background:var(--kit-state-bg)}
.site-kit-detail-heading .kit-state-icon {width:17px;height:17px}
.site-kit-place {display:none}
@media(min-width:801px) {
  .site-hero {border:0;border-radius:0;background:transparent}
  .site-identity {grid-template-columns:minmax(0,1fr) auto;gap:16px;padding:0 0 16px;border-radius:0}
  .site-identity-mark {display:none}
  .site-facts {grid-template-columns:repeat(2,minmax(0,320px));padding:12px 0 14px;border-block:1px solid var(--line)}
  .site-facts>div + div {border-inline-start:1px solid var(--line);padding-inline-start:18px}
  .site-actions summary {border:1px solid var(--line)}
  .site-phase-action {padding:0 0 10px}
}
@media(max-width:600px) {
  .site-identity {grid-template-columns:38px minmax(0,1fr) auto;gap:8px;padding:13px 12px}
  .site-identity-mark {width:36px;height:36px;border-radius:10px}
  .site-identity-mark svg {width:19px;height:19px}
  .site-facts {padding:12px}
  .site-facts dt {font-size:12px}
  .site-facts dd {font-size:14px}
  .site-kit-blank {padding:16px 14px 18px}
  .site-kit-head {padding:12px}
  .site-kit-head .button {padding-inline:9px;font-size:12px}
  .site-kit .kit-table {table-layout:fixed}
  .site-kit .kit-table th:last-child {width:35%}
  .site-kit .kit-state {gap:5px}
  .site-kit .kit-state-icon {width:17px;height:17px}
  .site-kit .kit-state.has-short .kit-state-full {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .site-kit .kit-state-short {display:inline}
  .site-kit .kit-pick {min-width:0}
  .site-kit .kit-pick b {min-width:0;overflow-wrap:anywhere}
  .site-kit .kit-pick :is(img,.no-photo) {width:42px;height:41px;flex:none}
  .site-kit-place {display:block;margin-top:2px;font-size:12px;font-weight:400}
}

.kit-layout,.inv-layout { display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:start;gap:20px; }
.kit-register,.inv-register,.inv-side,.kit-detail { overflow:clip; }
.kit-toolbar { display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:16px 18px; }
.kit-table { width:100%;border-collapse:collapse;text-align:left;font-size:14px; }
.kit-table th { padding:10px 11px;background:#f5f6fa;color:var(--muted);font-size:12px;font-weight:610; }
.kit-table td { border-top:1px solid var(--line);padding:11px; }
.kit-table tr[data-select-tool],.kit-table tr[data-inventory-id] { cursor:pointer; }
.kit-table tbody tr:hover { background:#f8f9fc; }
.kit-table tr.chosen { background:var(--tint-subtle);box-shadow:inset 2px 0 var(--accent-stroke); }
.kit-pick { display:flex;align-items:center;text-align:left;gap:10px;border:0;background:transparent;padding:0;font-size:14px;line-height:1.35; }
.kit-pick b { font-weight:650; }
.kit-pick img { width:48px;height:39px;object-fit:cover;border-radius:7px; }
.kit-detail { padding:14px;display:grid;gap:15px; }
.detail-cover { position:relative; }
.detail-cover .kit-status { position:absolute;bottom:9px;left:9px; }
.kit-detail dt { color:var(--muted);font-size:13px;margin-top:11px; }
.kit-detail dt:first-child { margin:0; }
.kit-detail dd { font-size:15px;font-weight:600;margin-top:2px; }
.kit-register > .empty { margin:0 15px 15px; }
.inv-layout { grid-template-columns:minmax(0,2fr) minmax(265px,.92fr); }
.inv-toolbar { position:relative;display:flex;gap:8px;align-items:center; }
.inv-search { display:flex;align-items:center;gap:9px;flex:1;max-width:560px;min-width:0;border:1px solid #d9ddea;border-radius:9px;padding:0 12px; }
.inv-search:focus-within { border-color:var(--accent); }
.inv-search svg,.inv-filter-menu svg { width:17px;height:17px;color:var(--muted); }
.inv-search input { width:100%;min-width:0;padding:9px 0;min-height:40px;border:0;outline:0;background:transparent;font-size:14px; }
.inv-filter-menu { position:relative; }
.inv-filter-menu summary { display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:9px;padding:9px 12px;min-height:40px;font-size:14px; }
summary::-webkit-details-marker { display:none; }
.inv-filter-menu[open] summary { background:var(--tint); }
[data-filter-count]:empty { display:none; }
.inv-filter-panel { position:absolute;z-index:2;top:calc(100% + 6px);right:0;width:min(430px,85vw);max-height:65svh;overflow:auto;padding:16px;display:grid;gap:12px;border:1px solid var(--line);border-radius:14px;background:white;box-shadow:0 10px 38px #27305122; }
.inv-filter-panel header { display:flex;align-items:center;justify-content:space-between; }
.inv-filter-panel header button,.copy-reminder { border:0;background:transparent;color:var(--accent); }
.filter-group,.kit-picker { min-width:0;border:0;margin:0;padding:0; }
.filter-group legend,.kit-picker legend { padding:0 0 7px;font-size:14px;font-weight:650; }
.filter-group > div,.inv-active-filters { display:flex;gap:5px;flex-wrap:wrap; }
.filter-choice { position:relative;cursor:pointer; }
.filter-choice input { position:absolute;width:1px;height:1px;opacity:0; }
.filter-choice span,.inv-chip { display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;padding:6px 9px;font-size:13px;background:white; }
.filter-choice input:checked + span,.inv-chip { background:var(--tint);border-color:var(--accent-border);color:var(--accent); }
.filter-choice input:focus-visible + span { outline:2px solid var(--accent); }
.inv-active-filters { margin:7px 0 15px; }
.inv-chip { gap:5px; }
.inv-chip svg { width:13px;height:13px; }
.inv-register td { font-size:13px; }
.inv-register .kit-pick img { width:39px;height:34px; }
.inv-mobile-meta { display:none; }
.inv-time { color:var(--muted); }
.instrument-id { padding:14px;display:grid;gap:12px;border-bottom:1px solid var(--line); }
.inventory-photo,.detail-cover { aspect-ratio:16/9; overflow:hidden; border-radius:10px; background:#f5f5f5; margin-inline:-6px; }
.inventory-photo img,.detail-cover img { width:100%;height:100%;object-fit:cover;object-position:center; }
.movement-route,.inv-journal { padding:16px; }
.movement-heading { display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;margin-bottom:15px; }
.movement-stop { display:flex;gap:10px;position:relative; }
.movement-stop > div { display:grid;gap:2px;padding-bottom:16px; }
.movement-stop i { z-index:1;display:grid;place-items:center;border-radius:50%;width:29px;height:29px;background:var(--soft);color:var(--muted); }
.movement-stop svg { width:15px;height:15px; }
.movement-stop span { font-size:13px;color:var(--muted); }
.movement-stop.destination i { background:var(--tint);color:var(--accent); }
.movement-stop.origin:has(+ .destination)::after { content:'';position:absolute;left:14px;top:28px;bottom:0;border-left:1px dashed #bec5d6; }
.asset-custody { display:grid; gap:10px; margin-bottom:12px; }
.asset-custody > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.asset-custody dt { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:13px; }
.asset-custody dt svg { width:15px; height:15px; }
.asset-custody dd { text-align:right; font-size:15px; font-weight:650; overflow-wrap:anywhere; }
.asset-confirmation { padding-top:9px; margin-bottom:14px; border-top:1px solid var(--line); }
.inv-actions,.receipt-actions { display:grid;gap:7px; }
.movement-route > .detail-action { width:100%; }
.inv-journal { border-top:1px solid var(--line);background:#fafbfd; }
.example-history summary { padding-top:8px;color:var(--muted);font-size:14px; }
.movement-timeline { list-style:none;padding:0;margin:12px 0 0; }
.movement-timeline li { position:relative;margin-left:4px;border-left:1px solid var(--line);padding:0 0 12px 12px; }
.movement-timeline li:last-child { border-color:transparent;padding-bottom:0; }
.movement-timeline li:first-child::before { background:var(--accent-stroke); }
.movement-timeline p { font-size:14px; }
.dispatch-tabs { display:inline-flex;max-width:100%;gap:3px;flex-wrap:wrap;padding:4px;margin-bottom:18px;border-radius:11px;background:var(--soft); }
.dispatch-tabs button { border:1px solid transparent;background:transparent;padding:7px 11px;border-radius:8px;color:var(--muted);font-size:14px; }
.dispatch-tabs button[aria-pressed=true] { background:var(--tint);border-color:var(--accent-border);box-shadow:0 1px 3px #22294410;color:var(--accent); }
.dispatch-tabs span { margin-left:4px;font-variant-numeric:tabular-nums; }
.dispatch-list,.crew-moves { display:grid;gap:10px; }
.dispatch-row { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr) minmax(120px,auto);align-items:center;gap:16px;padding:16px; }
.row-identity { display:flex;align-items:center;gap:10px;min-width:0; }
.row-identity > div { min-width:0;overflow-wrap:anywhere; }
.row-identity img { width:58px;height:48px;flex:none;object-fit:cover;border-radius:9px; }
.row-identity .kit-status { margin-top:4px; }
.transfer-route {
  display: grid;
  grid-template-columns: minmax(0,1fr) 19px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 11px;
  background: var(--soft);
}
.transfer-route > div { display:grid; align-content:start; gap:3px; min-width:0; overflow-wrap:anywhere; }
.transfer-route small, .transfer-route span, .transfer-route a { font-size: 12px; line-height: 1.35; color:var(--muted); }
.transfer-route strong { font-size:14px; line-height:1.28; }
.transfer-route a { color:var(--accent); }
.transfer-route-arrow { width:17px; height:17px; transform:rotate(180deg); color:var(--muted); }
.dispatch-action { display:grid; gap:5px; min-width:0; }
.dispatch-action .button { min-height:44px; min-width:0; white-space:normal; text-align:center; }
.crew-avatar { font-size:14px;border-radius:50%; }
.crew-sites { display:grid;gap:4px;padding:20px 0; }
.crew-tile footer { display:flex;gap:30px;padding-top:12px;margin-top:auto;border-top:1px solid var(--line); }
.crew-tile footer span { display:grid;gap:3px;font-size:13px;color:var(--muted); }
.crew-tile footer b { font-size:24px;line-height:1.15;color:var(--ink);font-weight:620; }
.crew-detail-grid { align-items:start; }
.crew-block { padding:18px; }
.crew-block h2 { margin-bottom:12px; }
.crew-line { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 0;border-top:1px solid var(--line); }
.crew-line span { font-size:13px;color:var(--muted); }
.crew-line[href]:hover { color:var(--accent); }
.crew-tool img { width:42px;height:34px;border-radius:6px;object-fit:cover; }
.crew-tool strong { flex:1;font-size:14px; }
.crew-moves { margin-top:24px; }
dialog { padding:0;width:min(505px,calc(100% - 24px));max-height:calc(100dvh - 36px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:18px;background:white;color:var(--ink);box-shadow:0 16px 70px #151d3c32; }
dialog::backdrop { background:#232a405c; }
.dialog-head { position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 20px;border-bottom:1px solid var(--line);background:white; }
.dialog-head h2 {min-width:0}
.dialog-head .icon-button {width:44px;height:44px;flex:none;border:0;color:var(--muted)}
.dialog-body {--dialog-pad:20px;display:grid;grid-template-columns:minmax(0,1fr);gap:16px;padding:var(--dialog-pad);padding-block-end:var(--dialog-tail,var(--dialog-pad))}
#dialog {overflow-wrap:anywhere}
.dialog-body > *, .dialog-body fieldset {min-width:0}
.dialog-body .input {max-width:100%}
.dialog-actions { display:flex;flex-wrap:wrap;justify-content:end;gap:8px;padding-top:12px;border-top:1px solid var(--line); }
.dialog-instrument { display:flex;align-items:center;gap:13px;font-size:18px; }
.dialog-instrument img { width:74px;height:53px;object-fit:cover;border-radius:9px; }
.transfer-stops { border:1px solid var(--line); }
.movement-source { color:var(--muted);font-size:14px; }
.dispute-note { background:#fff3e3;border-radius:8px;padding:12px;font-size:14px; }
[data-copy-result]:empty { display:none; }
.due-picker { background:var(--soft);border-radius:12px;padding:14px; }
.due-fields { display:grid;grid-template-columns:minmax(0,1fr) 87px;gap:9px;margin-top:10px; }
.due-fields small { display:block;margin-bottom:4px; }
.due-fields select + input:not([hidden]) { margin-top:5px; }
.due-calendar summary { display:flex;justify-content:space-between;align-items:center;gap:5px; }
.calendar-panel { padding:8px;margin-top:6px;background:white;border:1px solid var(--line);border-radius:10px; }
.calendar-head,.day-shortcuts { display:flex;align-items:center;justify-content:space-between;gap:4px; }
.calendar-head strong { font-size:14px;text-transform:capitalize; }
.calendar-panel button { border:0;border-radius:7px;background:transparent;min-height:32px; }
.calendar-head button { display:grid;place-items:center;width:32px; }
.calendar-head button svg { width:16px;height:16px; }
.calendar-head [data-month-step="-1"] svg { transform:rotate(90deg); }
.calendar-head [data-month-step="1"] svg { transform:rotate(-90deg); }
.calendar-grid { display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center; }
.calendar-grid small { font-size:11px;padding-top:7px; }
.calendar-grid button { font-size:14px; }
.calendar-grid .outside { color:var(--muted); }
.calendar-panel button:hover { background:var(--soft); }
.calendar-grid button[aria-pressed=true] { background:var(--accent-fill);color:var(--accent-on); }
.day-shortcuts { border-top:1px solid var(--line);margin-top:5px; }
.day-shortcuts button { color:var(--accent);font-size:13px; }
/* The same calendar is used for a date alone and for deadlines with a clock. */
.due-picker {min-width:0}
.date-mobile-trigger {display:none}
.due-picker.day-only {background:transparent;padding:0}
.due-picker.day-only h3 {font-size:13px;font-weight:580;color:var(--muted);letter-spacing:normal}
.due-picker.day-only .due-fields {grid-template-columns:minmax(0,1fr);margin-top:6px}
.date-value {display:flex;align-items:center;gap:9px;min-width:0;text-align:left}
.date-value svg,.date-chevron {width:16px;height:16px;color:var(--muted)}
.due-calendar summary {list-style:none;min-height:44px;font-variant-numeric:tabular-nums}
.due-calendar summary::-webkit-details-marker {display:none}
.due-calendar[open] summary {border-color:var(--accent)}
.due-calendar[open] .date-chevron {transform:rotate(180deg)}
.calendar-grid button[aria-current=date]:not([aria-pressed=true]) {color:var(--accent);font-weight:700;box-shadow:inset 0 0 0 1px var(--line)}
.calendar-panel button:disabled {opacity:.35;cursor:default;background:transparent}
.calendar-panel {padding:10px}
.day-shortcuts {justify-content:flex-start;gap:8px;padding-top:5px}

@media (max-width:640px), (max-width:900px) and (pointer:coarse) {
  .due-picker:not(.date-inline) { padding:0; background:transparent; }
  .due-picker:not(.date-inline)>.due-fields { display:none; }
  .due-picker h3 { margin:0 0 5px; color:var(--muted); font:var(--type-label); letter-spacing:normal; }
  .date-mobile-trigger {
    display:grid; grid-template-columns:20px minmax(0,1fr) 16px; align-items:center; gap:10px;
    width:100%; min-height:48px; padding:10px 11px; border:1px solid var(--line); border-radius:12px;
    background:var(--surface); color:var(--ink); text-align:start; font-size:14px; font-weight:620;
    font-variant-numeric:tabular-nums;
  }
  .date-mobile-trigger>svg:first-child { width:18px; height:18px; color:var(--accent); }
  .date-mobile-trigger>span { overflow-wrap:anywhere; }
  .date-mobile-trigger[aria-invalid=true] { border-color:var(--danger); }
  :is(.mobile-date-sheet,.entity-select-sheet) {
    position:fixed; inset:auto 0 0; width:min(100%,460px); max-width:100%; max-height:calc(100dvh - 12px);
    margin:0 auto; padding:0 16px max(12px,env(safe-area-inset-bottom)); border:0; border-radius:26px 26px 0 0;
    overflow:auto; color:var(--ink); background:var(--surface); overscroll-behavior:contain; scroll-padding-block:62px 68px;
  }
  .mobile-date-sheet[open] {
    display:flex; flex-direction:column; min-height:min(var(--date-sheet-size,0px),calc(100dvh - 12px));
    animation:date-sheet-in 220ms cubic-bezier(.2,.75,.2,1);
  }
  .mobile-date-sheet[open]>* { flex-shrink:0; }
  .entity-select-sheet[open] { animation:date-sheet-in 200ms cubic-bezier(.2,.75,.2,1); }
  :is(.mobile-date-sheet,.entity-select-sheet)::backdrop { background:#151d3c66; }
  body:has(:is(.mobile-date-sheet,.entity-select-sheet)[open]) #dialog[open] { visibility:hidden; }
  body:has(:is(.mobile-date-sheet,.entity-select-sheet)[open]) #dialog::backdrop { background:transparent; }
  :is(.mobile-date-sheet,.entity-select-sheet) header {
    position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center;
    gap:10px; padding:12px 0 8px; background:var(--surface);
  }
  :is(.mobile-date-sheet,.entity-select-sheet) header h2 { font:var(--type-dialog); overflow-wrap:anywhere; }
  :is(.mobile-date-sheet,.entity-select-sheet) header .icon-button { min-width:44px; min-height:44px; flex:none; border:0; border-radius:50%; background:var(--soft); }
  .entity-select-field { position:relative; display:grid; gap:6px; min-width:0; }
  #dialog .entity-select-native:is(.input) {
    position:absolute; width:1px; height:1px; min-height:0; inset:0 auto auto 0; padding:0;
    clip-path:inset(50%); opacity:0; pointer-events:none;
  }
  .entity-select-trigger {
    display:grid; grid-template-columns:19px minmax(0,1fr) 15px; align-items:center; gap:9px;
    min-height:46px; padding:9px 10px; border:1px solid var(--line); border-radius:11px;
    color:var(--ink); background:var(--surface); font-size:14px; font-weight:590; text-align:start;
  }
  .entity-select-trigger span { overflow-wrap:anywhere; }
  .entity-select-trigger:disabled { color:var(--muted); background:var(--soft); }
  .entity-select-trigger[aria-invalid=true] { border-color:var(--danger); }
  .entity-select-trigger svg { width:17px; height:17px; color:var(--accent); }
  .entity-select-trigger .entity-select-arrow { width:14px; height:14px; color:var(--muted); }
  .entity-select-sheet { max-height:min(74dvh,560px); padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  .entity-select-search { position:relative; display:block; margin:2px 0 10px; }
  .entity-select-search svg { position:absolute; top:50%; left:13px; width:17px; height:17px; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
  .entity-select-search .input { min-height:44px; padding-inline-start:39px; background:var(--soft); border-color:transparent; }
  .entity-select-options { display:grid; gap:4px; max-height:min(56dvh,440px); overflow:auto; overscroll-behavior:contain; }
  .entity-select-option {
    display:grid; grid-template-columns:35px minmax(0,1fr) 18px; align-items:center; gap:10px;
    width:100%; min-height:52px; padding:8px 10px; border:0; border-radius:11px; color:var(--ink);
    background:transparent; font-size:14px; text-align:start;
  }
  .entity-select-option[aria-pressed=true] { background:var(--tint); color:var(--accent); }
  .entity-select-option>span:nth-child(2) { display:grid; gap:3px; min-width:0; overflow-wrap:anywhere; }
  .entity-select-option strong { font-size:15px; font-weight:620; line-height:1.25; }
  .entity-select-option small { font-size:12px; line-height:1.3; color:var(--muted); }
  .entity-select-option svg { width:17px; height:17px; color:var(--accent); }
  .entity-option-mark { display:grid; place-items:center; width:35px; height:35px; border-radius:10px; background:var(--soft); color:var(--accent); font-size:12px; font-weight:700; }
  .entity-select-empty { padding:12px 10px; color:var(--muted); font-size:14px; }
  .mobile-date-selection {
    display:flex; justify-content:space-between; align-items:center; gap:9px; min-height:52px;
    margin-bottom:11px; padding:7px 11px; border-radius:14px; color:var(--accent); background:var(--tint);
  }
  .mobile-date-selection>span { display:flex; align-items:center; gap:8px; min-width:0; line-height:1.2; }
  .mobile-date-selection svg,.mobile-date-tabs svg { width:17px; height:17px; }
  .mobile-date-selection time { flex:none; padding:5px 8px; border-radius:8px; background:var(--surface); font-weight:680; font-variant-numeric:tabular-nums; }
  .mobile-date-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:4px; margin-bottom:9px; border-radius:13px; background:var(--soft); }
  .mobile-date-tabs button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:4px; border:0; border-radius:10px; color:var(--muted); background:transparent; font-size:14px; font-weight:640; }
  .mobile-date-tabs button[aria-pressed=true] { color:var(--accent); background:var(--surface); box-shadow:0 1px 4px #20243616; }
  :is(.mobile-date-sheet,.date-inline) .calendar-panel { margin:0; padding:0; border:0; }
  :is(.mobile-date-sheet,.date-inline) .calendar-head { margin-bottom:5px; }
  :is(.mobile-date-sheet,.date-inline) .calendar-head button { width:44px; min-height:44px; border-radius:11px; color:var(--accent); background:var(--soft); }
  :is(.mobile-date-sheet,.date-inline) .calendar-head button:disabled { background:transparent; }
  :is(.mobile-date-sheet,.date-inline) .calendar-head strong { font-size:16px; }
  :is(.mobile-date-sheet,.date-inline) .calendar-grid small { padding:4px 0; color:var(--muted); }
  :is(.mobile-date-sheet,.date-inline) .calendar-grid button { min-height:44px; border-radius:10px; font-weight:600; font-variant-numeric:tabular-nums; }
  :is(.mobile-date-sheet,.date-inline) .calendar-grid button[aria-current=date]:not([aria-pressed=true]) { box-shadow:none; background:var(--tint); }
  :is(.mobile-date-sheet,.date-inline) .day-shortcuts { flex-wrap:wrap; gap:6px; border:0; margin-top:4px; }
  :is(.mobile-date-sheet,.date-inline) .day-shortcuts button { padding:0 10px; min-height:44px; border-radius:10px; background:var(--soft); color:var(--accent); font-weight:620; }
  .mobile-date-time { display:grid; flex-grow:1; align-content:center; justify-items:center; gap:4px; padding:8px 0 0; font-variant-numeric:tabular-nums; }
  .clock-wheels { display:grid; grid-template-columns:1fr 18px 1fr; align-items:end; gap:8px; width:min(100%,300px); }
  .clock-column { min-width:0; text-align:center; color:var(--muted); font:var(--type-label); }
  .clock-track { --clock-step:44px; position:relative; margin-top:6px; border-radius:16px; background:var(--soft); overflow:hidden; }
  .clock-track::before,.clock-track::after { position:absolute; content:""; inset:0; pointer-events:none; }
  .clock-track::before { inset:var(--clock-step) 5px; border-radius:11px; background:var(--tint); }
  .clock-track::after { background:linear-gradient(var(--soft),transparent 28%,transparent 72%,var(--soft)); }
  .clock-wheel { position:relative; height:calc(var(--clock-step) * 3); overflow:auto; padding-block:var(--clock-step); scroll-snap-type:y mandatory; overscroll-behavior:contain; scrollbar-width:none; }
  .clock-wheel::-webkit-scrollbar { display:none; }
  .clock-wheel button { display:block; width:100%; height:var(--clock-step); padding:0; border:0; scroll-snap-align:center; background:transparent; color:var(--muted); font-size:19px; }
  .clock-wheel button.selected { color:var(--accent); font-size:29px; font-weight:700; }
  .clock-colon { height:132px; display:grid; place-items:center; color:var(--accent); font-size:23px; font-weight:700; }
  .clock-manual { min-height:44px; padding:0 12px; border:0; background:transparent; color:var(--accent); font-size:14px; font-weight:620; }
  .mobile-date-time input {
    text-align:center; width:min(100%,220px); min-height:64px; padding:6px; border:1px solid var(--line); border-radius:14px;
    background:var(--soft); color:var(--ink); font-size:30px; font-weight:680;
  }
  .mobile-date-time small { color:var(--muted); }
  .mobile-date-time small:empty { display:none; }
  .mobile-date-sheet footer { position:sticky; bottom:0; margin-top:auto; padding-top:10px; background:var(--surface); }
  .mobile-date-sheet footer .button { width:100%; min-height:48px; border-radius:13px; }
}
@keyframes date-sheet-in {
  from { opacity:0; transform:translateY(18px); }
  to { opacity:1; transform:translateY(0); }
}

@media (max-height:480px) {
  .mobile-date-sheet :is(header,footer) { position:static; }
}
.day-shortcuts button {padding-inline:9px}
.date-error {margin:5px 0 0;font-size:13px;color:var(--danger)}
.due-calendar summary[aria-invalid=true] {border-color:var(--danger)}
.initial-kit summary { padding:5px 0;font-weight:600; }
.kit-choice { display:grid;grid-template-columns:40px minmax(0,1fr) 20px;align-items:center;gap:8px;padding:7px;border-radius:8px;cursor:pointer; }
.kit-choice img { width:40px;height:32px;object-fit:cover;border-radius:5px; }
.kit-choice input { grid-column:3;grid-row:1;accent-color:var(--accent-fill);width:18px;height:18px; }
.kit-choice > span { grid-column:2;grid-row:1; }
.kit-choice:has(:checked) { background:var(--tint-subtle); }
[data-kit-count] { color:var(--accent); }
[data-form=kit] .dialog-actions { position:sticky;bottom:0;background:white;padding-block:8px; }
.toast { position:fixed;bottom:18px;right:18px;max-width:calc(100% - 36px);padding:11px 15px;background:var(--ink);color:white;border-radius:10px;z-index:4;pointer-events:none; }
.toast:empty { display:none; }
@media(min-width:1280px) {
  .inv-layout { grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); }
}
@media(max-width:1150px) {
  .dispatch-row { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); }
  .dispatch-action { grid-column:1/-1;justify-self:start; }
}
@media(max-width:1000px) {
  .kit-layout,.inv-layout { grid-template-columns:minmax(0,1fr); }
  .kit-detail { max-width:550px; }
  .inv-side,.inv-mobile-card .instrument-id h2 { display:none; }
  .inv-mobile-card { padding:0; }
}
@media(max-width:800px) {
  .app { display:block;min-height:auto; }
  .mobile-header { display:flex;align-items:center;justify-content:space-between; }
  .mobile-header .brand { width:155px;margin:0; }
  .sidebar { display:none;min-height:0;max-height:none;position:static;padding:10px 12px;border-bottom:1px solid var(--line);border-right:0; }
  .sidebar.is-open { display:flex; }
  .sidebar .brand { display:none; }
  .sidebar-profile { margin-top:10px; }
  .nav { margin:0; }
  main { padding:18px 14px 32px; }
  .section-head { margin-bottom:18px; }
}
@media(max-width:600px) {
  .inv-full,.last-place { display:none; }
  .inv-mobile-meta { display:block;font-size:12px;font-weight:400;color:var(--muted); }
  .inv-filter-menu { position:static; }
  .inv-filter-panel { width:100%; }
  .kit-table td,.kit-table th { padding:8px; }
  .dispatch-row { grid-template-columns:minmax(0,1fr); gap:11px; padding:12px; }
  .dispatch-action { justify-self:stretch; }
  .site-overview { grid-template-columns:1fr 1.2fr;gap:12px;padding:14px 0;margin-bottom:18px; }
  .site-overview > div { padding:0; }
  .site-overview > div + div { border:0; }
  .dialog-body {--dialog-pad:14px}
  .dialog-head {padding:14px}
  .inv-mobile-card { padding:0; }
  .dialog-actions .button { flex:1; }
  .with-clock .due-fields:has([open]) { grid-template-columns:1fr; }
  .with-clock .due-fields:has([open]) > div:last-child { max-width:90px; }
}
@media(pointer:coarse) {
  .nav-link,.nav-group,.object-link,.all-link,.button,.icon-button,.filter-choice span,.calendar-grid button { min-height:44px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition-duration:0s!important;animation-duration:0s!important; }
}

.no-photo { display:inline-block; flex:none; width:42px; height:34px; border-radius:6px; background:#f5f5f5 url("assets/missing-tool.webp") center / contain no-repeat; }
.inventory-photo .no-photo,.detail-cover .no-photo { display:block;width:100%;height:100%;background-size:100% auto; }
.site-page .detail-cover:has(>.no-photo) {aspect-ratio:auto;height:122px}
.site-page .detail-cover>.no-photo {background-size:auto 72px}

.kit-miniatures .no-photo { width:34px; height:28px; }
.kit-picker .no-photo { grid-row:1; grid-column:1; }
.photo-upload { display:grid; gap:10px; min-width:0; padding:13px; border:1px solid var(--line); border-radius:16px; background:var(--soft); color:var(--ink); }
.photo-upload-info { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; }
.photo-upload-info>div { display:grid; gap:3px; }
.photo-upload-info strong { font:var(--type-card); }
.photo-upload-info small { color:var(--muted); line-height:1.3; }
.photo-upload-thumbnail { position:relative; display:grid; place-items:center; width:66px; height:66px; overflow:hidden; border-radius:13px; background:var(--tint); color:var(--accent); }
.photo-upload-thumbnail>svg { width:23px; height:23px; }
.photo-upload-thumbnail img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:var(--surface); }
.photo-upload-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.photo-upload-actions .button { min-height:46px; border-radius:10px; min-width:0; text-align:center; }
.photo-upload-actions .photo-remove { padding-inline:11px; background:transparent; border-color:transparent; color:var(--muted); }
.photo-select { position:relative; overflow:hidden; cursor:pointer; }
.photo-select input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
html[data-keyboard-nav] .photo-select:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.photo-upload-error { color:var(--danger); font-size:13px; line-height:1.4; }
.tool-place-field { display:grid; gap:6px; min-width:0; }
.tool-place-field>span { color:var(--muted); font:var(--type-label); }
.tool-place-picker { min-width:0; border:1px solid var(--line); border-radius:13px; background:var(--surface); }
.tool-place-picker>summary {
  display:grid; grid-template-columns:32px minmax(0,1fr) 16px; align-items:center; gap:10px;
  min-height:50px; padding:8px 11px; list-style:none; cursor:pointer;
}
.tool-place-picker>summary::-webkit-details-marker { display:none; }
.tool-place-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:var(--accent); background:var(--tint); }
.tool-place-icon svg { width:17px; height:17px; }
.tool-place-picker>summary strong { color:var(--muted); font-size:14px; font-weight:580; overflow-wrap:anywhere; }
.tool-place-picker[data-has-place]>summary strong { color:var(--ink); font-weight:640; }
.tool-place-chevron { width:16px; height:16px; color:var(--muted); transition:transform 160ms ease; }
.tool-place-picker[open] .tool-place-chevron { transform:rotate(180deg); }
.tool-place-panel { display:grid; gap:5px; padding:9px; border-top:1px solid var(--line); }
.tool-place-search { position:relative; display:block; }
.tool-place-search>svg { position:absolute; top:50%; left:11px; width:17px; height:17px; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.tool-place-search input.input { min-height:44px; padding-inline-start:36px; border-color:transparent; background:var(--soft); }
.tool-place-search input.input:focus { border-color:var(--accent); }
.tool-place-options { display:grid; max-height:min(264px,36dvh); overflow:auto; overscroll-behavior:contain; }
.tool-place-options p { margin:7px 8px 1px; color:var(--muted); font-size:12px; font-weight:650; }
.tool-place-option,.tool-place-new {
  display:grid; grid-template-columns:18px minmax(0,1fr) auto; align-items:center; gap:9px;
  width:100%; min-height:44px; padding:7px 8px; border:0; border-radius:9px;
  text-align:start; overflow-wrap:anywhere; color:var(--ink); background:transparent; font-size:14px;
}
.tool-place-option svg,.tool-place-new svg { width:17px; height:17px; color:var(--accent); }
.tool-place-option[aria-pressed=true],.tool-place-new { background:var(--tint); color:var(--accent); font-weight:620; }
.tool-place-option:hover { background:var(--soft); }
.tool-place-clear { justify-self:start; min-height:44px; padding:5px 8px; border:0; background:transparent; color:var(--muted); font-size:13px; }
.tool-form-error { color:#953d30;font-size:14px; }



.handoff-sheet { gap:14px; }
.handoff-item { display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap;min-width:0; }
.handoff-item .dialog-instrument { min-width:0;overflow-wrap:anywhere; }
.handoff-item .dialog-instrument img { flex:none; }
.handoff-sheet .secondary-copy { margin:0;line-height:1.45; }
.handoff-footer { display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--line);padding-top:14px; }
.handoff-decisions { margin-left:auto;display:flex;align-items:center;gap:7px; }
.handoff-decisions .primary { min-width:100px; }
.handoff-more { border-top:1px solid var(--line);padding-top:4px; }
.handoff-more summary,.quiet-decision { color:var(--muted);background:transparent; }
.handoff-more summary { display:flex;align-items:center;justify-content:space-between;gap:8px;list-style:none;font-size:14px;font-weight:550;padding:10px 7px;border-radius:8px; }
.handoff-more summary svg { width:14px;height:14px; }
.handoff-more[open] summary svg { transform:rotate(180deg); }
.handoff-more[open] summary,.quiet-decision:hover,.handoff-more summary:hover { background:var(--soft); }
.handoff-more > div { display:grid;gap:2px;padding:4px;background:var(--soft);border-radius:9px;margin-top:4px; }
.transfer-option { display:flex;width:100%;justify-content:flex-start;background:transparent;font-weight:500; }
.transfer-option:hover { background:white; }
.cancel-option { color:#983a32; }
@media(max-width:420px){.handoff-decisions .button{padding-inline:10px}.handoff-decisions .primary{min-width:76px}.handoff-footer{gap:4px}}

.instrument-id.compact-id {display:flex;align-items:center;gap:12px}
.compact-id .inventory-photo {order:-1;width:64px;flex:none;margin:0}
.custody-summary {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.custody-person,.custody-place {display:flex;gap:7px;align-items:flex-start;min-width:0}
.custody-summary svg {width:17px;height:17px;color:var(--muted);margin-top:2px}
.custody-summary small,.custody-summary strong {display:block;overflow-wrap:anywhere}
.custody-summary strong {margin-top:3px;font-size:15px}
.tool-place-edit.button {display:flex;width:fit-content;max-width:100%;margin-top:4px;min-height:36px;padding:5px 0;border:0;border-radius:6px;background:transparent;color:var(--accent);font-size:13px;white-space:normal;text-align:left;justify-content:flex-start}
.tool-place-edit.button:hover {text-decoration:underline}
@media(max-width:640px) {
  .tool-place-edit.button {min-height:44px;margin-top:0}
}
.recorded-at,.custody-summary .inv-actions {grid-column:1/-1}
.recorded-at {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:3px 12px;padding-top:10px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
.recorded-at time {color:var(--ink);font-variant-numeric:tabular-nums}
.inv-journal h4 {margin:12px 0 4px;font-size:12px;font-weight:600;color:var(--muted)}
.journal-row {display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px;padding:9px 0;border-top:1px solid var(--line)}
.journal-row small {font-variant-numeric:tabular-nums}
.journal-row strong,.journal-row span {display:block;font-size:14px;overflow-wrap:anywhere}
.journal-row span {margin-top:3px;color:var(--muted);font-size:13px}
.journal-extra summary {font-size:13px;color:var(--accent);padding:7px 0}
.inv-mobile-card .compact-id {padding:0;border:0}
.inv-mobile-card .compact-id .inventory-photo {display:none}

/* All #dialog selects share the same trigger, including Safari's native controls. */
#dialog select:is(.input,[data-clock-choice]) {
  -webkit-appearance:none;
  appearance:none;
  display:block;
  box-sizing:border-box;
  width:100%;
  height:46px;
  min-height:46px;
  padding:0 38px 0 12px;
  border:1px solid #d4d9e5;
  border-radius:10px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2362697b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  font:500 15px/1.35 var(--font-ui);
  text-overflow:ellipsis;
  box-shadow:0 1px 2px #20243608;
  cursor:pointer;
}
#dialog select:is(.input,[data-clock-choice]):hover:enabled {border-color:#adb7ce}
#dialog select:is(.input,[data-clock-choice]):focus-visible {border-color:var(--accent);outline:2px solid var(--accent-stroke);outline-offset:1px}
#dialog select:is(.input,[data-clock-choice]):disabled {background-color:var(--soft);box-shadow:none;cursor:default}
#dialog select[data-clock-choice] {padding-left:9px;padding-right:23px;background-position:right 6px center;font-variant-numeric:tabular-nums}
@supports (appearance:base-select) {
  #dialog select:is(.input,[data-clock-choice]), #dialog select::picker(select) {appearance:base-select}
  #dialog select:is(.input,[data-clock-choice]) {display:flex;align-items:center}
  #dialog select::picker-icon {display:none}
  #dialog select::picker(select) {
    margin-block:4px;padding:4px;max-height:min(300px,45dvh);overflow:auto;
    border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--ink);box-shadow:0 8px 22px #252e491a;
  }
  #dialog select option {display:flex;align-items:center;gap:8px;min-height:36px;padding:7px 10px;border-radius:7px;font-size:14px;color:var(--ink)}
  #dialog select option:checked {background:var(--tint);color:var(--accent);font-weight:600}
  #dialog select option:is(:hover,:focus-visible) {background:var(--soft)}
}
.dialog-body > .field,.company-form .field {gap:7px}
.movement-item {display:flex;align-items:center;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.movement-item .tool-photo,.movement-item .no-photo {width:66px;height:49px;object-fit:cover;border-radius:8px}
.movement-item > div {display:grid;gap:3px;min-width:0;overflow-wrap:anywhere}
.movement-item strong {font-size:18px;letter-spacing:-.025em}
@media(max-width:600px){#dialog select:is(.input,[data-clock-choice]){font-size:16px}}

.object-groups {display:grid;gap:26px}
.object-group-title {font-size:17px;margin:0 0 12px}
.object-group .project-grid {grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr))}
.handover-cover {width:100%;height:100%;padding:0;border:0;display:block;cursor:zoom-in}
.detail-cover .kit-status {pointer-events:none}

@media screen and (min-height:420px) {
  #dialog .dialog-body > .dialog-actions:last-child {
    position:sticky;bottom:0;z-index:1;background:var(--surface);
    margin-inline:calc(-1 * var(--dialog-pad));margin-bottom:calc(-1 * var(--dialog-tail,var(--dialog-pad)));
    padding:8px var(--dialog-pad) max(8px,env(safe-area-inset-bottom));
  }
  #dialog {scroll-padding-block:70px 76px}
}
@media(max-width:600px) {
  #dialog :is(input:not([type=checkbox],[type=radio],[type=hidden]),textarea,select) {font-size:16px}
}
.button[aria-busy=true] {cursor:progress}

.mobile-tabs { display:none; }
@media screen and (max-width:800px) {
  :root {
    --handheld-tabs-height:63px;
    --handheld-bottom-space:calc(var(--handheld-tabs-height) + 10px + env(safe-area-inset-bottom));
  }
  html:has(body:not(.auth-mode) .mobile-tabs) { scroll-padding-bottom:var(--handheld-bottom-space); }
  body:has(.mobile-tabs):not(.auth-mode) main { padding-bottom:var(--handheld-bottom-space); }
  .mobile-tabs { position:fixed; z-index:5; inset:auto 0 0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:5px 6px calc(5px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--surface); }
  .mobile-tabs a { display:grid; grid-template-rows:28px 14px; justify-items:center; align-content:center; gap:2px; min-height:48px; border-radius:10px; color:var(--muted); font-size:11px; font-weight:600; line-height:14px; text-decoration:none; transition:color 160ms ease,transform 160ms ease; }
  .mobile-tabs a span { display:grid; place-items:center; width:48px; height:28px; border-radius:12px; transition:background-color 160ms ease; }
  .mobile-tabs svg { width:21px; height:21px; }
  .mobile-tabs a[aria-current] { color:var(--accent); }
  .mobile-tabs a[aria-current] span { background:var(--tint); }
  .mobile-header:has([aria-expanded=true]) .mobile-tabs,
  body:has(input:focus,textarea:focus,dialog[open]) .mobile-tabs { display:none; }
  body:has(.mobile-tabs) .toast { bottom:var(--handheld-bottom-space); }
  .mobile-header .brand { width:136px; }
  input:not([type=checkbox]):not([type=radio]), textarea, select { font-size:max(16px,1em); }
}
@media print { .mobile-tabs { display:none!important; } }

/* Compact workspace shared by the handheld clients. */
@media screen and (max-width:800px) {
  body:not(.auth-mode) { background:var(--handheld-canvas); }
  .mobile-header { min-height:62px; padding:6px 18px; background:var(--handheld-canvas); }
  .phone-topbar {
    position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center;
    column-gap:8px; width:100%;
  }
  .phone-company { min-width:0; }
  .phone-workspace {
    display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:9px;
    min-height:50px; border-radius:12px; list-style:none; cursor:pointer; color:var(--ink);
  }
  .phone-workspace::-webkit-details-marker { display:none; }
  .phone-workspace-logo { display:grid; place-items:center; width:38px; height:38px; }
  .phone-workspace-logo::before { content:""; width:26px; height:27px; background:url("assets/instrumentur-mark.png") center/contain no-repeat; }
  .phone-workspace-id { min-width:0; display:grid; line-height:1.25; gap:3px; }
  .phone-workspace-name { display:flex; align-items:center; min-width:0; gap:4px; }
  .phone-workspace-id :is(strong,small) { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .phone-workspace-id strong { font-size:14px; font-weight:700; letter-spacing:-.015em; }
  .phone-workspace-id small { color:var(--muted); font-size:12px; }
  .phone-workspace-arrow { flex:none; width:12px; height:12px; color:var(--muted); transition:transform 170ms ease; }
  .phone-company[open] :is(.phone-workspace-name,.phone-workspace-arrow) { color:var(--accent); }
  .phone-company[open] .phone-workspace-arrow { transform:rotate(180deg); }
  .phone-topbar .mobile-utilities { margin:0 -5px 0 0; gap:0; }
  .phone-topbar .notice-link.compact {
    position:relative; display:grid; place-items:center; height:44px; width:44px;
    border-radius:50%; background:transparent; color:var(--ink);
  }
  .phone-topbar .notice-link.compact[aria-current] { background:var(--tint); color:var(--accent); }
  .phone-topbar .notice-link.compact svg { height:22px; width:22px; color:inherit; }
  .phone-topbar .notice-count {
    position:absolute; top:4px; left:calc(50% + 3px); min-width:16px; height:16px; padding:0 3px;
    line-height:14px; font-size:10px; font-variant-numeric:tabular-nums; border-radius:9px;
    box-shadow:0 0 0 2px var(--handheld-canvas);
  }
  .phone-topbar .notice-link.chat-nav svg { width:24px;height:24px; }
  .phone-topbar .chat-nav .notice-count {
    top:2px;left:auto;right:0;min-width:15px;height:15px;
    display:grid;place-items:center;line-height:1;font-size:9px;
  }
  body:not(.auth-mode) main { padding:14px 18px 82px; }
  main .section-head { margin-bottom:18px; }
  main .title-label { gap:8px; }
  main > :is(.section-head,.inv-page) .section-title { align-items:flex-start; }
  main > :is(.section-head,.inv-page) .title-label { min-height:44px; }
  .inv-page .section-title .title-label { flex-shrink:0; max-width:100%; }
  main .title-count { font-size:13px; line-height:1; padding:5px 7px; background:#e2e6ef; border-radius:8px; }
  .mobile-tabs { min-height:var(--handheld-tabs-height); padding:5px 8px calc(5px + env(safe-area-inset-bottom)); border-top:1px solid #dce1eb; }
  .phone-sections {
    position:absolute; z-index:6; inset:calc(100% + 8px) 0 auto; max-width:390px;
    max-height:calc(100vh - 132px); max-height:calc(100dvh - 132px);
    display:grid; gap:8px; padding:9px; overflow-y:auto; overscroll-behavior:contain;
    border:1px solid #e5e9f2; border-radius:20px; background:var(--surface); transform-origin:top left;
    box-shadow:0 16px 36px #26325325, 0 2px 6px #26325310;
  }
  .phone-company:not([open]) .phone-sections { display:none; }
  .phone-company[open] .phone-sections { animation:company-menu-in 185ms cubic-bezier(.2,.75,.2,1); }
  .phone-profile { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; border-radius:13px; padding:9px; color:var(--ink); background:var(--tint); }
  .phone-profile>span { display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:var(--surface); color:var(--accent); font-size:13px; font-weight:700; }
  .phone-profile div { display:grid; gap:3px; }
  .phone-profile strong { font-size:14px; line-height:1.25; }
  .phone-profile small { color:var(--muted); font-size:12px; line-height:1.25; overflow-wrap:anywhere; }
  .phone-sections nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  .phone-sections nav a { display:grid; grid-template-columns:29px minmax(0,1fr); gap:7px; align-items:center; min-height:46px; padding:5px 7px; border-radius:11px; color:var(--ink); font-size:13px; font-weight:620; line-height:1.25; overflow-wrap:anywhere; }
  .phone-sections nav i { display:grid; place-items:center; width:29px; height:29px; border-radius:8px; color:var(--accent); background:var(--soft); }
  .phone-sections nav i svg { width:16px; height:16px; }
  .phone-sections nav a[aria-current] { color:var(--accent); background:var(--tint); }
  .phone-menu-contact a { background:var(--soft); }
  .phone-menu-contact a:first-child i { background:var(--surface); }
  .phone-menu-contact a:last-child i { background:#e6f3ef; color:#286457; }
  .phone-sections .phone-section-shortcuts { padding-top:5px; border-top:1px solid var(--line); }
  .phone-sections nav .phone-row-arrow { display:none; }
  .phone-row-arrow { width:16px; height:16px; color:#80899c; transform:rotate(-90deg); flex:none; }
}
@keyframes company-menu-in {
  from { opacity:0; transform:translateY(-5px) scale(.98); }
  to { opacity:1; transform:none; }
}
@media screen and (max-width:800px) and (hover:hover) {
  .phone-workspace:hover .phone-workspace-name { color:var(--accent); }
  .phone-topbar .notice-link.compact:hover,.phone-sections nav a:hover { background-color:var(--tint); }
}

@media screen and (max-width:640px) {
  .inv-page .inv-more summary { padding:8px 10px; font-weight:600; color:var(--accent); }
  .inv-page .qr-tools.inv-quick-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0 0 19px; padding:0; }
  .inv-page .inv-quick-actions:has(>:only-child) { grid-template-columns:1fr; }
  .phone-action { min-width:0; display:grid; align-content:start; justify-items:start; gap:4px; padding:11px 14px 14px; border:0; border-radius:18px; text-align:left; line-height:1.24; }
  .phone-action.find { background:radial-gradient(ellipse at 50% 0%,#fff4ba,transparent 68%), var(--accent-fill); color:var(--accent-on); }
  .phone-action.scan { background:radial-gradient(ellipse at 50% 0%,#eef8ed,transparent 65%), #dce9e5; color:#234c41; }
  .phone-action-art { width:90px; max-width:100%; height:80px; justify-self:center; margin-bottom:1px; object-fit:contain; }
  .phone-action-title { font-weight:690; font-size:16px; letter-spacing:-.025em; }
  .phone-action small { font-size:12px; font-weight:450; }
  .phone-action.find small { color:#5a4500; }
  .phone-action:disabled { color:var(--muted); opacity:1; }
  .phone-action.find:disabled { background:var(--tint); }
  .phone-action.scan:disabled { background:var(--success-bg); }
  .phone-action:disabled img { opacity:.63; }
  .phone-action:disabled small { color:var(--muted); }
  .phone-action:active,.phone-equipment button:active { filter:brightness(.95); }
  .inv-page .inv-toolbar { gap:8px; }
  .inv-page .inv-search,.phone-filter { background:#fff; min-height:46px; border:1px solid #d6dce7; border-radius:14px; }
  .inv-page .inv-search { padding:0 13px; }
  .inv-page .inv-search input { min-height:44px; }
  .phone-filter { position:relative; display:grid; place-items:center; width:48px; flex:none; padding:0; }
  .phone-filter svg { width:21px; height:21px; }
  .phone-filter [data-filter-count]:not(:empty) { position:absolute; top:-4px; right:-4px; border-radius:15px; min-width:18px; padding:1px 4px; background:var(--accent-fill); color:var(--accent-on); font-weight:650; font-size:11px; }
  .phone-filter-form { display:grid; gap:20px; }
  .phone-filter-form .filter-choice span { display:inline-flex; align-items:center; min-height:44px; border-radius:12px; padding-inline:12px; }
  .inv-page .inv-active-filters { margin:9px 0 12px; }
  .inv-page .inv-active-filters:empty { margin:14px 0 0; }
  .phone-equipment { margin:0; padding:0; list-style:none; border:1px solid #e0e5ef; border-radius:20px; overflow:hidden; background:white; }
  .phone-equipment li { position:relative; }
  .phone-equipment li + li::before { position:absolute; content:""; left:90px; right:14px; top:0; height:1px; background:var(--line); }
  .phone-equipment button { width:100%; display:flex; align-items:center; gap:12px; padding:13px; min-height:98px; text-align:left; border:0; background:white; }
  .phone-equipment-photo { width:64px; height:68px; flex:none; overflow:hidden; border-radius:13px; background:#f0f2f6; }
  .phone-equipment-photo img,.phone-equipment-photo .no-photo { width:100%; height:100%; display:block; object-fit:cover; }
  .phone-equipment-copy { flex:1; min-width:0; display:grid; justify-items:start; gap:2px; }
  .phone-equipment-copy>small { max-width:100%; overflow-wrap:anywhere; color:var(--muted); font:550 12px/1.3 var(--font-ui); font-variant-numeric:tabular-nums; }
  .phone-equipment-copy>strong { font-size:16px; letter-spacing:-.027em; line-height:1.18; margin:1px 0 3px; overflow-wrap:anywhere; }
  .phone-equipment-meta { display:flex; align-items:baseline; gap:5px; color:#556074; font-size:12.5px; line-height:1.25; overflow-wrap:anywhere; }
  .phone-equipment-meta svg { width:12px; height:12px; flex:none; align-self:center; }
  .phone-equipment-copy .kit-status { margin-top:3px; }
  #dialog { position:fixed; inset:auto 0 0; margin:0 auto; width:100%; max-width:100%; max-height:calc(100dvh - 14px); border-radius:23px 23px 0 0; border:0; box-shadow:0 -6px 40px #18213a23; }
  #dialog::backdrop { background:#131c34a1; }
  #dialog .dialog-head { padding:13px 16px 12px 19px; min-height:64px; background:white; border-radius:23px 23px 0 0; }
  #dialog .dialog-head .icon-button { min-height:44px; min-width:44px; border:0; background:var(--soft); border-radius:50%; }
  #dialog .dialog-body { --dialog-pad:18px; }
  body:has(.phone-filter-form) #dialog { scroll-padding-bottom:16px; }
}
@media screen and (max-width:360px) {
  #main-content .inv-page .section-title h1 { font-size:clamp(26px,8.1vw,30px); }
  .phone-action { padding-inline:10px; }
  .phone-action-art { width:80px; height:70px; }
  .phone-action-title { font-size:14px; }
}
@media screen and (max-width:800px) {
  body:not(.auth-mode) { min-height:100vh; min-height:100dvh; }
  :is(.phone-workspace,.phone-profile,.phone-sections nav a,.inv-quick-actions button,.phone-filter,
      .phone-equipment button,.mobile-utilities .notice-link,.dialog-head .icon-button,.held-tool,.personal-site) {
    transition:background-color 160ms ease, transform 160ms ease;
  }
  .button { transition-property:background-color,box-shadow,transform; }
  :is(.mobile-tabs a,.phone-workspace,.phone-profile,.phone-sections nav a,.inv-quick-actions button,
      .phone-filter,.phone-equipment button,.mobile-utilities .notice-link,.dialog-head .icon-button,
      .held-tool,.personal-site,.button:not(:disabled)):active { transform:scale(.98); }
  .phone-sections nav a:active { background:var(--soft); }
  .toast:not(:empty) { animation:handheld-feedback 180ms ease-out; }
}
@keyframes handheld-feedback {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:none; }
}
@media screen and (max-width:800px) and (prefers-reduced-motion:no-preference) {
  #dialog {
    opacity:0; transform:translateY(20px);
    transition:transform 235ms cubic-bezier(.2,.75,.2,1), opacity 180ms ease,
      display 235ms allow-discrete, overlay 235ms allow-discrete;
  }
  #dialog[open] { opacity:1; transform:none; }
  #dialog::backdrop { opacity:0; transition:opacity 200ms ease, display 235ms allow-discrete, overlay 235ms allow-discrete; }
  #dialog[open]::backdrop { opacity:1; }
  @starting-style {
    #dialog[open] { opacity:0; transform:translateY(20px); }
    #dialog[open]::backdrop { opacity:0; }
  }
}
@media screen and (max-width:640px) {
  .phone-incoming { display:flex; align-items:center; gap:10px; width:100%; min-height:58px; margin:-6px 0 14px; padding:9px 12px; text-align:left; border:1px solid #e5d9be; border-radius:14px; background:#fff8e9; color:var(--ink); }
  .phone-incoming>span:nth-child(2) { flex:1; min-width:0; display:grid; gap:2px; }
  .phone-incoming strong { font-size:14px; line-height:1.25; }
  .phone-incoming small { font-size:12px; line-height:1.25; color:#665b45; }
  .phone-incoming-icon { display:grid; place-items:center; color:#805514; width:26px; flex:none; }
  .phone-incoming-icon svg { width:20px; height:20px; }
}

/* Action rows share columns on handheld sheets, including when only one action is available. */
@media screen and (max-width:800px), screen and (max-width:1024px) and (pointer:coarse) {
  #dialog,.unit-sheet { --sheet-gutter:16px; --sheet-action-height:46px; }
  #dialog .dialog-head { padding-inline:var(--sheet-gutter); }
  #dialog .dialog-body { --dialog-pad:var(--sheet-gutter); --dialog-tail:8px; }
  #dialog .dialog-head h2 { overflow-wrap:anywhere; }
  #dialog :is(.dialog-actions,.handoff-decisions,.rental-actions),.unit-sheet .sheet-button-row {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-flow:row; align-items:stretch; justify-items:stretch; gap:8px; min-width:0;
  }
  #dialog :is(.dialog-actions,.handoff-decisions,.rental-actions)>:last-child:nth-child(odd),
  .unit-sheet .sheet-button-row>:only-child { grid-column:1/-1; }
  #dialog :is(.dialog-actions,.handoff-decisions,.rental-actions)>.button,.unit-sheet .sheet-button-row>.button,
  .unit-sheet .rental-tool-action>.button,#dialog .dialog-body>.button {
    min-width:0; max-width:100%; width:100%; min-height:var(--sheet-action-height); height:auto; margin:0;
    padding:10px 9px; line-height:1.25; white-space:normal; overflow-wrap:anywhere; text-align:center; justify-content:center;
    font-size:14px; border-radius:12px;
  }
  #dialog .button > svg { flex-shrink:0; }
  #dialog .handoff-sheet { gap:10px; }
  #dialog .handoff-footer { display:block; padding-top:10px; }
  #dialog .handoff-decisions { grid-template-columns:minmax(0,1fr); }
  #dialog .handoff-footer:not(:has(.button)) { display:none; }
  #dialog .handoff-more { padding-top:0; }
  #dialog .handoff-more > summary { width:100%; min-height:44px; justify-content:space-between; }
  #dialog .unit-sheet { display:grid; grid-template-columns:minmax(0,1fr); width:100%; min-width:0; }
  #dialog .inv-mobile-card { padding:0; }
  .unit-sheet>header.unit-overview,.unit-sheet>.unit-actions,.unit-sheet>.movement-route { padding:14px var(--sheet-gutter); min-width:0; }
  .unit-sheet .unit-overview h2 { margin:0 0 12px; }
  #dialog .unit-overview h2 { display:none; }
  .unit-sheet dl,.unit-sheet dt,.unit-sheet dd { margin:0; }
  .unit-identity { display:grid; grid-template-columns:clamp(80px,23vw,100px) minmax(0,1fr); align-items:center; gap:14px; }
  .unit-sheet .unit-identity .co-thumb { width:100%; height:auto; aspect-ratio:1; border-radius:14px; margin:0; }
  .unit-identity dl { min-width:0; display:grid; gap:9px; }
  .unit-identity dt,.unit-sheet .recorded-at>span { font-size:13px; color:var(--muted); line-height:1.25; }
  .unit-identity dd { margin-top:2px; font-size:16px; font-weight:650; letter-spacing:-.02em; line-height:1.25; overflow-wrap:anywhere; }
  .unit-sheet .recorded-at { margin-top:14px; font-size:13px; }
  .unit-sheet .unit-actions { display:grid; gap:8px; padding-top:0; }
  .unit-sheet :is(.rental-tool-action,.src-group,.co-tool,.tool-drawer>summary) { padding-inline:var(--sheet-gutter); }
  .unit-sheet .rental-tool-action { justify-items:stretch; grid-template-columns:minmax(0,1fr); }
  .unit-sheet > .tool-drawer { min-width:0; }
  .unit-group-edit { width:100%; min-height:var(--sheet-action-height); display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:14px var(--sheet-gutter); background:white; border:0; border-top:1px solid var(--line); text-align:start; }
  .unit-group-edit>span:first-child { display:grid; min-width:0; gap:2px; overflow-wrap:anywhere; }
  .unit-group-edit small { color:var(--muted); font-size:13px; }
  .unit-group-edit strong { font-size:14px; font-weight:600; }
  .unit-edit-label { color:var(--accent); font-size:14px; font-weight:600; }
  .unit-sheet .co-tool>header { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  .unit-sheet .co-tool>header>.button { width:100%; justify-content:center; min-height:var(--sheet-action-height); }
}
@media screen and (max-width:640px) and (max-height:520px) {
  #dialog .dialog-body>.dialog-actions:last-child { position:static; }
}

@media (max-width: 360px) {
  .transfer-route { grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr); gap:7px; padding:9px; }
  .transfer-route-arrow { width:13px; height:13px; }
}

#dialog:has(.transfer-confirmation) .dialog-head {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  justify-content:stretch;
  justify-items:center;
  gap:9px;
  padding:20px var(--dialog-pad,16px) 14px;
  border-bottom:0;
  text-align:center;
}
.transfer-confirmation-icon {
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:14px;
  background:var(--success-bg);
  color:var(--success);
}
.transfer-confirmation-icon svg { width:23px; height:23px; stroke-width:2.3; }
#dialog .transfer-confirmation {
  display:grid;
  gap:12px;
  padding-top:0;
  padding-bottom:max(8px,env(safe-area-inset-bottom));
}
.transfer-confirmation-tool {
  min-width:0;
  overflow-wrap:anywhere;
  padding:10px 12px;
  border-radius:12px;
  background:var(--soft);
}
.transfer-confirmation-tool > :is(img,.no-photo) {
  width:53px;
  height:49px;
  flex:none;
  border-radius:9px;
  object-fit:cover;
}
.transfer-confirmation-tool > div { display:grid; gap:3px; min-width:0; }
.transfer-confirmation-tool strong { font:var(--type-card); }
.transfer-confirmation-tool small { font:var(--type-caption); color:var(--muted); }
#dialog .transfer-confirmation .dialog-actions { position:static; display:block; margin:0; padding:0; border:0; }
.transfer-confirmation .dialog-actions .button { width:100%; min-height:46px; }
@media (prefers-reduced-motion:no-preference) {
  .transfer-confirmation-icon { animation:confirmation-icon-in 325ms 35ms cubic-bezier(.2,.73,.32,1) both; }
  .transfer-confirmation-icon path {
    stroke-dasharray:24;
    animation:confirmation-tick-in 300ms 135ms ease-out both;
  }
  .transfer-confirmation-tool { animation:confirmation-details-in 310ms 65ms ease-out both; }
}
@keyframes confirmation-icon-in {
  from { opacity:0; transform:scale(.78); }
  to { opacity:1; transform:scale(1); }
}
@keyframes confirmation-tick-in { from { stroke-dashoffset:24; } to { stroke-dashoffset:0; } }
@keyframes confirmation-details-in {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:none; }
}

@media screen and (min-width:801px) and (hover:hover) and (pointer:fine) {
  .transfer-register .move-card,.crew-detail .move-card {
    grid-template-columns:minmax(120px,23%) minmax(0,1fr);
    gap:12px 18px;
  }
  .transfer-register .move-card { max-inline-size:62rem; }
  :is(.transfer-register,.crew-detail) .transfer-route {
    grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);
    justify-self:center;
    inline-size:max-content;
    max-inline-size:min(100%,27rem);
    gap:10px;
    padding:10px 14px;
  }
  :is(.transfer-register,.crew-detail) .transfer-route > div:first-child {
    justify-items:end;
    text-align:end;
  }
  :is(.transfer-register,.crew-detail) .transfer-route-arrow {
    width:20px;
    height:20px;
    color:var(--ink);
  }
  :is(.transfer-register,.crew-detail) .dispatch-action { grid-column:2; justify-self:end; }
  .site-page .site-hero {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    margin-bottom:20px;
    border:1px solid var(--line);
    border-radius:18px;
    background:var(--surface);
  }
  .site-page .site-identity {
    grid-column:1/-1;
    grid-template-columns:46px minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
    padding:18px 20px;
  }
  .site-page .site-identity-mark { display:grid; }
  .site-page :is(.site-facts,.site-overview) {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));
    gap:0;
    min-width:0;
    padding:14px 4px;
    border-block:1px solid var(--line);
    background:var(--soft);
  }
  .site-page .site-facts { grid-column:1/-1; border-bottom:0; border-radius:0 0 17px 17px; }
  .site-page :is(.site-facts,.site-overview)>div { padding-inline:16px; overflow-wrap:anywhere; }
  .site-page :is(.site-facts,.site-overview)>div + div { border-inline-start:1px solid var(--line); }
  .site-page .site-facts dd { padding-inline-start:0; }
  .co-handover .site-hero { margin-bottom:0; border-radius:18px 18px 0 0; border-bottom:0; }
  .co-handover .site-identity { grid-column:1; grid-template-columns:46px minmax(0,1fr); }
  .co-handover .site-phase-action { padding:0 20px 0 0; }
  .co-handover .site-overview {
    margin-bottom:20px;
    border:1px solid var(--line);
    border-radius:0 0 18px 18px;
  }
  .co-handover .site-overview progress { max-width:280px; }
  .site-page .kit-layout { margin-top:0; }
  .co-handover .kit-layout:not(:has(.kit-detail)) { grid-template-columns:minmax(0,1fr); }
}

@media screen and (min-width:1060px) and (hover:hover) and (pointer:fine) {
  .transfer-register .move-card,.crew-detail .move-card {
    grid-template-columns:minmax(170px,24%) minmax(0,1fr) minmax(0,11.5rem);
  }
  :is(.transfer-register,.crew-detail) .dispatch-action { grid-column:3; }
}
