:root { font: 16px/1.5 Inter, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }

:root, [data-theme="blue"] {
  color-scheme: light;
  --paper: #f0f4fb;
  --surface: #fff;
  --surface-alt: #f5f8fe;
  --ink: #14223b;
  --muted: #4e5f79;
  --line: #dbe4f1;
  --line-strong: #b8c8e0;
  --accent: #244fbd;
  --accent-hover: #1c3e96;
  --accent-text: #fff;
  --accent-ink: #24459e;
  --accent-soft: #e7efff;
  --focus: #5279e4;
  --banner: #1b3067;
  --banner-text: #f3f7ff;
  --banner-muted: #c4d4fb;
  --error: #96283d;
  --error-paper: #fff0f3;
  --error-line: #e6b7c2;
  --warn: #66480a;
  --warn-paper: #fff5d8;
  --warn-line: #d8bf7a;
  --row-padding: .78rem;
  --radius: .45rem;
}

[data-theme="sand"] {
  color-scheme: light;
  --paper: #f5eee4;
  --surface: #fffbf5;
  --surface-alt: #f9f2e8;
  --ink: #342319;
  --muted: #695146;
  --line: #e7d8c9;
  --line-strong: #cbb5a1;
  --accent: #894225;
  --accent-hover: #6e321d;
  --accent-text: #fffaf3;
  --accent-ink: #7b371f;
  --accent-soft: #f3e3d6;
  --focus: #9b502c;
  --banner: #512d23;
  --banner-text: #fff5ea;
  --banner-muted: #edc7ae;
  --error: #9b2635;
  --error-paper: #fce9e7;
  --error-line: #e7b9b2;
  --warn: #634517;
  --warn-paper: #fff1cf;
  --warn-line: #dcc286;
  --row-padding: .95rem;
}

[data-theme="night"] {
  color-scheme: dark;
  --paper: #131821;
  --surface: #1a202d;
  --surface-alt: #202938;
  --ink: #eff4ff;
  --muted: #b1bed4;
  --line: #354157;
  --line-strong: #565f78;
  --accent: #b3d9ff;
  --accent-hover: #d4eaff;
  --accent-text: #142139;
  --accent-ink: #c6e2ff;
  --accent-soft: #273a52;
  --focus: #acd6ff;
  --banner: #243953;
  --banner-text: #f4f8ff;
  --banner-muted: #c8dcf4;
  --error: #ffb6c2;
  --error-paper: #42252e;
  --error-line: #825260;
  --warn: #f2d08c;
  --warn-paper: #3e3423;
  --warn-line: #816839;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, summary, textarea { font: inherit; }
button, a, summary, label:has(input) { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), select, summary, input[type=checkbox], label:has(input[type=radio]) { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--accent-ink); font-weight: 650; text-underline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.85rem); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2, legend { font-size: 1.13rem; font-weight: 700; line-height: 1.3; letter-spacing: -.014em; }
p + p { margin-top: .65rem; }
.loading { padding: 1rem 0; color: var(--muted); }

.shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .8rem;
  min-height: 4.1rem; padding: .6rem clamp(1rem, 4vw, 3.2rem);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand {
  display: inline-flex; align-items: center; justify-self: start; gap: .55rem; min-height: 2.75rem;
  color: var(--ink); font-size: 1.26rem; letter-spacing: -.035em; font-weight: 760; text-decoration: none;
}
.brand-mark { flex: none; width: 2.25rem; height: 2.25rem; }
.nav { display: flex; align-items: center; gap: .2rem; }
.nav a {
  display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .45rem .7rem;
  border-radius: var(--radius); color: var(--muted); font-size: .9rem; font-weight: 630; text-decoration: none; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
.nav a[aria-current] { box-shadow: inset 0 -2px var(--accent); }
.header-actions { display: flex; justify-content: end; min-width: 0; }
.scan-mark {
  width: .95rem; height: .95rem; flex: none;
  background:
    linear-gradient(currentColor, currentColor) left top / 39% 2px,
    linear-gradient(currentColor, currentColor) right top / 39% 2px,
    linear-gradient(currentColor, currentColor) left bottom / 39% 2px,
    linear-gradient(currentColor, currentColor) right bottom / 39% 2px,
    linear-gradient(currentColor, currentColor) left top / 2px 39%,
    linear-gradient(currentColor, currentColor) right top / 2px 39%,
    linear-gradient(currentColor, currentColor) left bottom / 2px 39%,
    linear-gradient(currentColor, currentColor) right bottom / 2px 39%;
  background-repeat: no-repeat;
}
.scope-bar, .page { width: min(100%, 1180px); margin-inline: auto; }
.scope-bar {
  padding: .55rem clamp(1rem, 3vw, 2rem) 0; color: var(--muted); font-size: .85rem;
}
.workspace { min-width: 0; display: flex; align-items: center; gap: .45rem; }
.workspace-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-label { flex: none; }
.workspace-select { width: auto; max-width: min(40vw, 16rem); min-height: 2.5rem; padding-block: .3rem; }
.page { min-width: 0; padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 2rem; }
.section-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem;
  margin-bottom: 1.05rem; border-bottom: 1px solid var(--line-strong);
}
.section-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: -1px; padding: .4rem .65rem;
  border-bottom: 2px solid transparent; color: var(--muted); font-size: .94rem; text-decoration: none;
}
.section-nav a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.section-nav a[aria-current] { border-color: var(--accent); color: var(--accent-ink); }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .48rem; color: var(--muted); font-size: .88rem; }
.breadcrumbs a, .breadcrumbs .trail-link { display: inline-flex; align-items: center; min-height: 2.25rem; }
.breadcrumbs .trail-link { border: 0; background: transparent; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs [aria-current] { color: var(--ink); }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin-bottom: 1.2rem; }
.page-head h1 { margin: .1rem 0 .35rem; }
.page-head p, .muted { color: var(--muted); overflow-wrap: anywhere; }
.back { display: inline-block; margin-bottom: .65rem; font-size: .9rem; }
.head-actions, .row-actions, .form-actions { display: flex; align-items: center; gap: .43rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-bottom: .7rem; }
.filters { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters > input { flex: 1 1 230px; min-width: 0; }

.location-view {
  display: grid; grid-template-columns: 12rem minmax(0, 1fr); min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.location-rail { min-width: 0; padding: 1rem .7rem; border-right: 1px solid var(--line); background: var(--surface-alt); border-radius: var(--radius) 0 0 var(--radius); }
.location-rail h2 { font-size: .93rem; margin: 0 .4rem .6rem; }
.location-links { display: grid; gap: .2rem; max-height: 34rem; overflow-y: auto; padding: 3px; }
.location-link {
  display: flex; align-items: center; gap: .55rem; min-height: 3rem; min-width: 0; padding: .48rem;
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.location-link:hover, .location-link[aria-current] { background: var(--accent-soft); }
.location-link:focus-visible { outline-offset: -2px; }
.location-mark { width: .88rem; height: .86rem; flex: none; border: 1px solid var(--muted); border-radius: .15rem; background: var(--surface); }
.location-mark::before { content: ""; display: block; width: 100%; border-bottom: 1px solid var(--muted); margin-top: .23rem; }
.location-link-text { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.location-link-text .meta { margin-top: .14rem; }
.location-details { min-width: 0; padding: 1.1rem; }
.location-header { padding: .68rem .88rem; margin-bottom: .82rem; background: var(--banner); color: var(--banner-text); border-radius: var(--radius); }
.location-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .72rem; }
.location-heading h1 { min-width: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.location-context, .location-code { color: var(--banner-muted); font-size: .86rem; overflow-wrap: anywhere; }
.location-context { margin-top: .2rem; }
.location-code { font-weight: 700; }
.location-picker { display: none; }
.stock-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem; margin-bottom: .65rem; }
.stock-toolbar .search { grid-column: 1 / -1; }
.tools-menu { position: relative; }
.tools-menu > summary { list-style: none; }
.tools-menu > summary::-webkit-details-marker { display: none; }
.tools-menu > summary::after { content: ""; width: .38rem; height: .38rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.11rem) rotate(45deg); }
.tool-popover {
  position: absolute; top: calc(100% + .3rem); inset-inline-end: 0; z-index: 3; min-width: max-content;
  display: grid; gap: .22rem; padding: .36rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: 0 .7rem 1.4rem #06142d25;
}
.tool-popover > * { justify-content: flex-start; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .52rem .72rem;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink);
  text-decoration: none; font-weight: 650; line-height: 1.25; transition: background-color .16s, transform .16s;
}
button:hover, .button:hover { background: var(--accent-soft); }
button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .55; }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.subtle { background: transparent; border: 0; }
.compact { padding: .42rem .56rem; min-height: 2.48rem; font-size: .85rem; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .48rem .64rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 1.16rem; height: 1.16rem; min-height: auto; margin: 0; accent-color: var(--accent); }
.field { display: grid; gap: .33rem; font-weight: 620; }
.field small { font-weight: 400; }
.form-fields { display: grid; gap: .85rem; }
.inline { display: flex; width: max-content; max-width: 100%; align-items: center; gap: .65rem; min-height: 2.75rem; }
.form-actions { justify-content: end; margin-top: .82rem; }
.search { min-height: 2.85rem; }
.catalog-list { display: grid; border-block: 1px solid var(--line); background: var(--surface); }
.catalog-row { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.catalog-row:last-child { border-bottom: 0; }
.item-choice { width: 100%; min-width: 0; border: 0; background: transparent; text-align: start; display: block; padding: .45rem .46rem; }
.item-choice strong { color: var(--ink); }
.item-name { display: block; overflow-wrap: anywhere; font-weight: 690; }
.meta { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.picker-results { max-height: min(40vh, 18rem); overflow-y: auto; }
.scanner { display: grid; gap: .62rem; }
.scanner video { width: 100%; max-height: 50dvh; border-radius: var(--radius); background: var(--banner); }
.selected-item { display: flex; gap: .6rem; align-items: center; justify-content: space-between; background: var(--accent-soft); padding: .65rem .72rem; border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); border: 0; margin: 1.22rem 0; }

.table { border-block: 1px solid var(--line); background: var(--surface); }
.table-row {
  display: grid; grid-template-columns: minmax(100px, 1.7fr) minmax(75px, .85fr) minmax(76px, .64fr) minmax(53px, .35fr);
  align-items: center; gap: .75rem; padding: var(--row-padding) .66rem; border-bottom: 1px solid var(--line);
}
.table-row:last-child { border-bottom: 0; }
.table-head { padding-block: .5rem; background: var(--surface-alt); font-size: .8rem; color: var(--muted); font-weight: 700; }
.table-row > * { min-width: 0; }
.table-row a:not(.button) { display: inline-block; text-decoration: none; }
.table-row a:not(.button):hover { text-decoration: underline; }
.table-row strong, .table-row span { overflow-wrap: anywhere; }
.stock-table .table-row { grid-template-columns: minmax(0, 1fr) minmax(67px, .32fr); }
.stock-table .table-row:has(.stock-actions) { grid-template-columns: minmax(0, 1.25fr) minmax(67px, .4fr) minmax(184px, .85fr); }
.stock-mobile-action { display: none; }
.stock-action-menu { justify-content: start; }
.found-table .table-row { grid-template-columns: minmax(100px, 1fr) minmax(70px, .32fr); }
.members-table .table-row { grid-template-columns: minmax(0, 1fr) minmax(90px, .45fr); }
.history-table .table-row { grid-template-columns: minmax(105px, 1.6fr) minmax(80px, .8fr) minmax(84px, .85fr) minmax(84px, 1.05fr); }
.location-history .table-row { grid-template-columns: minmax(0, 1.6fr) minmax(84px, .8fr) minmax(84px, 1.05fr); }
.amount { font-size: 1.23rem; line-height: 1.2; font-weight: 725; font-variant-numeric: tabular-nums; }
.find-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .4rem 1rem; margin-bottom: .8rem; }
.find-summary .page-head { min-width: 0; margin: 0; }
.total { display: flex; flex-wrap: wrap; gap: .45rem; align-items: baseline; overflow-wrap: anywhere; }
.total strong { font-size: 1.4rem; }
.empty { padding: 1rem .64rem; border-block: 1px solid var(--line); color: var(--muted); }
[hidden] { display: none !important; }

.status { margin-bottom: .9rem; }
.status:empty { display: none; }
.notice { color: var(--accent-ink); border: 1px solid var(--line-strong); background: var(--accent-soft); padding: .64rem .75rem; border-radius: var(--radius); }
.notice.error { color: var(--error); border-color: var(--error-line); background: var(--error-paper); }
.notice.pending { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--warn); border-color: var(--warn-line); background: var(--warn-paper); }
.notice.status-inline { margin-top: .75rem; }
.label-options { display: grid; }
.label-options label {
  display: grid; grid-template-columns: auto minmax(0, .5fr) minmax(0, 1fr); gap: .7rem;
  width: 100%; min-height: 2.75rem; padding-block: .25rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere;
}
.label-format { margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.label-fields { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 10fr) minmax(0, 8fr); max-width: 26.3rem; gap: .65rem; margin-bottom: .4rem; }
.label-fields .field { min-width: 0; font-size: .88rem; }
.label-fields select { padding-inline: .45rem .35rem; }
.qr-sheet {
  --label-width: max(36mm, calc(var(--qr-size) + 6mm));
  display: grid; grid-template-columns: repeat(auto-fill, min(100%, var(--label-width)));
  align-items: start; gap: 3mm; width: 100%; max-width: 190mm;
}
.qr-sheet[data-layout="horizontal"] { --label-width: calc(var(--qr-size) + 35mm); }
.qr-label {
  color-scheme: light; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 1.2mm;
  padding: 2mm; border: .25mm solid #8b919b; background: #fff; color: #172032;
  text-align: center; break-inside: avoid; overflow-wrap: anywhere; line-height: 1.2;
}
.qr-sheet[data-layout="horizontal"] .qr-label {
  grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; justify-items: start; text-align: start; gap: 2mm;
}
.qr-label img { display: block; width: var(--qr-size); max-width: 100%; height: auto; aspect-ratio: 1; }
.qr-label-text { display: grid; gap: .75mm; min-width: 0; font-size: 9pt; }
.qr-label strong { font-size: 11pt; }
.qr-label .meta { color: #475369; font-size: 8pt; }
.settings { max-width: 440px; }
.account-info { margin: 0 0 1rem; }
.account-info dt { color: var(--muted); font-size: .88rem; }
.account-info dd { margin: .12rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.appearance { min-width: 0; padding: 0; border: 0; margin: 0; }
.appearance legend { padding: 0; margin-bottom: .65rem; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.theme-option {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .45rem;
  min-width: 0; min-height: 3rem; padding: .58rem; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.theme-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-option input { grid-column: 2; grid-row: 2; margin-top: .15rem; }
.theme-copy { grid-column: 1; grid-row: 2; overflow-wrap: anywhere; }
.theme-preview {
  grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: 26% 1fr; gap: .33rem;
  height: 4rem; padding: .33rem; background: var(--paper); border: 1px solid var(--line); border-radius: .23rem;
}
.preview-rail { background: var(--accent-soft); border-radius: .16rem; }
.preview-stock { display: grid; grid-template-rows: 1fr .2fr .2fr; gap: .27rem; min-width: 0; }
.preview-stock span { background: var(--line); border-radius: .12rem; }
.preview-stock span:first-child { background: var(--banner); }
.preview-stock span:last-child { width: 55%; background: var(--accent); }

.login-layout { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 1.1rem; }
.login { width: min(100%, 425px); padding: clamp(1.15rem, 3.2vw, 2rem); border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.login .brand { margin-bottom: .35rem; }
.login .brand-mark { width: 3rem; height: 3rem; }
.login h1 { font-size: 2rem; margin: 1.15rem 0 .85rem; }
.login .primary { width: 100%; }
.login-language { margin-top: 1rem; }
dialog {
  width: min(calc(100vw - 1.6rem), 500px); max-height: calc(100dvh - 1.6rem); padding: 1.05rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: .65rem; color: var(--ink);
  box-shadow: 0 18px 55px #09152b55;
}
dialog[open] { animation: reveal .16s ease-out both; }
dialog::backdrop { background: #101d3599; }
@keyframes reveal { from { opacity: .65; transform: translateY(.35rem); } to { opacity: 1; transform: translateY(0); } }
.dialog-head { display: flex; gap: .7rem; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.dialog-head h2 { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1024px) {
  .shell { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 3.7rem; padding-top: calc(.4rem + env(safe-area-inset-top)); padding-bottom: .4rem; }
  .brand { font-size: 1.15rem; }
  .nav {
    position: fixed; z-index: 10; inset-inline: 0; bottom: 0; display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr); gap: .15rem; background: var(--surface); border-top: 1px solid var(--line);
    padding: .31rem .38rem calc(.31rem + env(safe-area-inset-bottom));
  }
  .nav a { min-width: 0; padding: .32rem .18rem; font-size: .8rem; white-space: normal; text-align: center; }
  .page { padding-top: .8rem; }
  .page-head { gap: .45rem; margin-bottom: .72rem; }
  .page-head h1 { font-size: 1.65rem; margin: 0; }
  .page-head h1 + p { margin-top: .16rem; }
  .page-head > .head-actions { margin-inline-start: auto; }
  .page-head > .head-actions :is(.button, button) { padding-inline: .55rem; font-size: .9rem; }
  .location-view { display: block; border: 0; background: transparent; }
  .location-details, .location-header { padding: 0; }
  .location-header { background: transparent; color: var(--ink); margin-bottom: .55rem; }
  .location-header h1, .stock-title {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .location-rail, .location-code, .stock-desktop-actions { display: none; }
  .location-picker { display: block; font-weight: 650; text-overflow: ellipsis; }
  .location-context { color: var(--muted); }
  .stock-toolbar { display: flex; flex-wrap: wrap; gap: .42rem; }
  .stock-toolbar .search { flex: 1 0 min(11rem, 100%); min-height: 2.75rem; }
  .stock-toolbar .tool-popover { inset-inline-start: 0; inset-inline-end: auto; }
  .stock-mobile-action { display: inline-flex; min-height: 2.75rem; }
  .stock-table .table-row:has(.stock-actions) { grid-template-columns: minmax(0, 1fr) minmax(3.35rem, .42fr) 4.7rem; }
  .stock-actions { justify-self: end; }
  .stock-quantity { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .25rem; }
  .stock-quantity .amount { overflow-wrap: anywhere; }
  .table-row:not(.table-head) { padding-block: calc(var(--row-padding) - .21rem); }
}

@media (max-width: 510px) {
  .scope-bar, .page, .topbar { padding-inline: .82rem; }
  .workspace-select { max-width: 45vw; }
  .workspace-label { position: absolute; clip: rect(0, 0, 0, 0); }
  .table-row { grid-template-columns: minmax(0, 1.4fr) minmax(55px, .55fr) auto; gap: .46rem; padding-inline: .42rem; }
  .only-wide { display: none; }
  .history-table .table-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-table .table-head { display: none; }
  .location-history .history-time { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .55rem; color: var(--muted); font-size: .82rem; }
  .theme-options { grid-template-columns: minmax(0, 1fr); }
  .theme-option { grid-template-columns: 4rem minmax(0, 1fr) auto; align-items: center; }
  .theme-preview { grid-column: 1; grid-row: 1; height: 2rem; }
  .theme-copy { grid-column: 2; grid-row: 1; }
  .theme-copy .meta { display: none; }
  .theme-option input { grid-column: 3; grid-row: 1; }
}

@media (pointer: coarse) {
  .compact, .workspace-select { min-height: 2.75rem; }
  input:not([type=checkbox], [type=radio]), select, textarea { font-size: max(1rem, 16px); }
}

@media print {
  @page { size: A4; margin: 10mm; }
  :root { color-scheme: light; background: #fff; }
  body { background: #fff; color: #172032; }
  .shell { min-height: 0; padding: 0; }
  .topbar, .scope-bar, .no-print, .status, dialog { display: none !important; }
  .page { width: auto; max-width: none; padding: 0; margin: 0; }
  .qr-label { print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
