:root {
  font-family:
    "IBM Plex Sans",
    Segoe UI,
    Arial,
    sans-serif;
  color: #252925;
  background: #f4f5f2;
  font-size: 15px;
  --green: #2d7715;
  --muted: #626a60;
  --line: #d9ddd6;
  --panel: #ffffff;
  --canvas: #f4f5f2;
  --navy: #202321;
  --steel: #e8ebe5;
  --electric: #48aa26;
  --brand-heading: #2d7715;
  --brand-icon: #48aa26;
  --on-accent: #172013;
  --danger: #b42318;
  --amber: #a76611;
  color-scheme: light;
}
.information-sources { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.information-sources h3 { margin: 0 0 8px; }
.information-source-links { padding-left: 20px; }
.information-source-links li { margin: 8px 0; }
.information-source-links a { overflow-wrap: anywhere; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: inherit;
  border-radius: 9px;
  padding: 11px 16px;
  font-weight: 600;
  transition: background 0.15s;
}
button:hover {
  background: #edf3ef;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  color: var(--on-accent);
  border-color: var(--green);
}
button.primary:hover {
  background: #3c901e;
}
button.danger {
  color: #ad4036;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 9px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 17px;
}
h1,
h2,
h3 {
  color: var(--brand-heading);
}
small,
.muted {
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #202321;
  color: #e6e9e4;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 28px;
}
.mark {
  background: #48aa26;
  color: #172013;
  width: 35px;
  height: 39px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 29px;
}
.sidebar small {
  color: #a9b2a6;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 24px 12px 8px;
}
.sidebar button {
  background: transparent;
  color: #c9cec7;
  border: 0;
  text-align: left;
  font-size: 14px;
  padding: 12px;
}
.sidebar button.active,
.sidebar button:hover {
  background: #343a33;
  color: #fff;
}
.sidebar .sub {
  padding-left: 28px;
  font-size: 12px;
}
.side-footer {
  margin-top: auto;
  padding-top: 50px;
  color: #a9b2a6;
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 18px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.topbar .brand {
  display: none;
  margin: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}
.content {
  padding: 34px;
  max-width: 1600px;
  margin: auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 27px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--green);
  margin-bottom: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.stat {
  min-width: 0;
  padding: 12px 14px;
}
.stat[data-stock-filter] { text-align: left; color: inherit; font-weight: inherit; cursor: pointer; }
.stat[data-stock-filter]:hover, .stat[data-stock-filter][aria-pressed="true"] { border-color: var(--electric, #27d7e7); box-shadow: inset 0 0 0 1px var(--electric, #27d7e7); }
.stat[data-stock-filter]:focus-visible { outline: 2px solid var(--electric, #27d7e7); outline-offset: 3px; }
.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  margin: 5px 0 3px;
  font-variant-numeric: tabular-nums;
}
.stat small {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.toolbar {
  padding: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
input,
select,
textarea {
  border: 1px solid #d5dfd7;
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: inherit;
  max-width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #84bb98;
}
.search {
  flex: 1;
  min-width: 200px;
}
.toolbar input[type="number"] {
  width: 155px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7b8c82;
  background: #fafcf9;
  text-align: left;
  padding: 16px;
}
td {
  padding: 16px;
  border-top: 1px solid #edf0eb;
  font-size: 14px;
}
tbody tr {
  cursor: default;
}
tbody tr:hover {
  background: #f6faf5;
}
.item-cell {
  display: flex;
  align-items: center;
  gap: 13px;
}
.thumb {
  width: 49px;
  height: 49px;
  object-fit: cover;
  border-radius: 9px;
  background: #eef3ec;
}
.placeholder {
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #81a490;
}
.badge {
  display: inline-block;
  background: #eef5e9;
  color: #45723c;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge.warn {
  background: #fff1d9;
  color: #967016;
}
.empty {
  text-align: center;
  padding: 65px 25px;
  color: var(--muted);
}
.empty .empty-icon {
  font-size: 44px;
  margin-bottom: 17px;
  color: #75a187;
}
.empty h2 {
  color: #2e4b3e;
}
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.action-card {
  text-align: left;
  padding: 25px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.action-card .icon {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  background: #eef5e7;
  border-radius: 13px;
  font-size: 25px;
  margin-bottom: 20px;
  color: var(--green);
}
.action-card h3 {
  margin-bottom: 8px;
}
.action-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  padding: 18px;
}
.item-card {
  padding: 0;
  text-align: left;
  overflow: hidden;
}
.item-card > img,
.item-card > .placeholder {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-radius: 0;
}
.item-card > div:last-child {
  padding: 17px;
}
.item-card strong {
  display: block;
  margin-bottom: 8px;
}
.item-card .stock {
  font-size: 22px;
  margin-top: 14px;
}
.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
.field[hidden] {
  display: none;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-weight: 400;
}
.field.full {
  grid-column: 1/-1;
}
.form-section {
  padding: 24px;
  margin-bottom: 20px;
}
.form-section h3 {
  margin-bottom: 22px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.photo-upload {
  border: 2px dashed #cddfd0;
  background: #f7faf5;
  padding: 30px;
  text-align: center;
  border-radius: 12px;
  margin-bottom: 18px;
}
.gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.gallery img {
  width: 110px;
  height: 100px;
  object-fit: cover;
  border-radius: 9px;
  cursor: zoom-in;
}
.photo-entry {
  position: relative;
}
.photo-entry button {
  position: absolute;
  right: 2px;
  top: 2px;
  padding: 2px 7px;
  background: white;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.detail-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}
.hero-photo {
  width: 100%;
  height: 270px;
  object-fit: contain;
  background: #f2f5ef;
  border-radius: 12px;
}
.big-stock {
  font-size: 39px;
  font-weight: 700;
  margin: 20px 0;
}
.segment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.timeline {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.timeline p {
  margin: 6px 0;
  font-size: 13px;
}
.notice {
  padding: 15px;
  background: #fff5df;
  border-radius: 9px;
  color: #806120;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.success {
  background: #edf7e6;
  color: #416e34;
}
dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 100px #143f3530;
  padding: 28px;
  max-width: 850px;
  width: calc(100% - 30px);
  max-height: 90vh;
}
dialog::backdrop {
  background: #0d251d85;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 20px;
}
.dialog-head button {
  padding: 4px 10px;
  font-size: 23px;
}
.login {
  max-width: 430px;
  margin: 12vh auto;
  padding: 35px;
}
.login .brand {
  margin-left: 0;
}
.login .field {
  margin-bottom: 20px;
}
.login h1 {
  font-size: 25px;
}
.result {
  padding: 20px;
  margin-bottom: 16px;
}
.result .matches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.qr-label {
  text-align: center;
  padding: 20px;
  border: 1px dashed #bbb;
  display: inline-block;
  break-inside: avoid;
}
.qr-label img {
  width: 170px;
  height: 170px;
}
.qr-label p {
  margin: 5px;
}
.qr-label small {
  font-size: 9px;
}
.error-text {
  color: #ac3d33;
  font-size: 13px;
  margin: 12px 0;
  white-space: pre-wrap;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #173f32;
  color: white;
  padding: 13px 22px;
  border-radius: 10px;
  box-shadow: 0 5px 25px #0002;
  z-index: 100;
  display: none;
}
video {
  width: 100%;
  max-height: 350px;
  background: #122b24;
  border-radius: 10px;
}
.mobile-mode .sidebar {
  display: none;
}
.mobile-mode .shell {
  display: block;
}
.mobile-mode .topbar .brand {
  display: flex;
}
.mobile-mode .breadcrumb {
  display: none;
}
.mobile-mode .desktop-only {
  display: none !important;
}
.mobile-mode .content {
  max-width: 850px;
}
.mobile-mode .actions-grid {
  grid-template-columns: repeat(2, 1fr);
}
.mobile-mode .topbar {
  padding: 17px 20px;
}
.mobile-mode .content {
  padding: 24px 20px;
}
.mobile-mode .heading h1 {
  font-size: 27px;
}
.label-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.footer-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 18px;
}
.status-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: #9eda76;
  margin-right: 7px;
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .shell {
    display: block;
  }
  .topbar {
    padding: 15px;
  }
  .topbar .brand {
    display: flex;
    font-size: 22px;
  }
  .breadcrumb,
  .operator-name,
  .desktop-only {
    display: none !important;
  }
  .content {
    padding: 22px 16px;
  }
  .heading {
    align-items: start;
  }
  .heading h1 {
    font-size: 26px;
  }
  .heading .buttons button {
    padding: 10px;
  }
  .actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .action-card {
    padding: 18px;
  }
  .action-card h3 {
    font-size: 16px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  .stat strong {
    font-size: 23px;
  }
  .form-grid,
  .detail-body {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .form-section {
    padding: 18px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .toolbar {
    padding: 12px;
  }
  .top-actions {
    gap: 6px;
  }
  .top-actions button {
    padding: 8px;
  }
  .topbar .brand {
    gap: 7px;
  }
  .topbar .mark {
    width: 28px;
    height: 33px;
  }
  .hero-photo {
    height: 200px;
  }
  dialog {
    padding: 20px;
  }
  .login {
    margin: 7vh 16px;
  }
  .table-wrap {
    display: none;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  body > dialog[open] {
    display: block !important;
    position: static;
    max-width: none;
    width: 100%;
    max-height: none;
    box-shadow: none;
  }
  dialog::backdrop,
  .no-print {
    display: none !important;
  }
  .label-wall {
    display: flex;
  }
  .qr-label {
    margin: 10px;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  gap: 4px;
}
.sidebar button {
  flex-shrink: 0;
}
.side-footer {
  padding-top: 25px;
}
.qr-label h2 {
  max-width: 230px;
}
.sidebar .brand {
  flex-shrink: 0;
}
.toolbar input[type="number"] {
  width: 180px;
}
.field small {
  font-weight: 400;
}

.upload-button {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid #cbdccf;
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-weight: 600;
}
.upload-button:hover {
  background: #edf5e8;
}
.upload-button:focus-within {
  outline: 2px solid #16634c;
}

.match-caption{display:flex;flex-direction:column;gap:5px;text-align:left;min-width:0}.match-title{white-space:normal;overflow-wrap:anywhere;color:#213a35}.missing-part-number{color:#946b25}.matches button{max-width:100%;min-width:0}.matches .thumb{flex-shrink:0}
/* Keep literal photo markings readable on narrow mobile screens. */
.photo-readings { margin-bottom: 20px; padding: 16px; border: 1px solid #79aaa3; border-radius: 12px; }
.photo-reading { margin: 12px 0; }
.read-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 600 16px/1.6 monospace; user-select: text; margin: 8px 0 16px; }
.cable-suggestions { max-height: 300px; overflow-y: auto; border: 1px solid #79aaa3; border-radius: 8px; padding: 8px; background: var(--panel, #fff); color: #153b36; z-index: 10; }
.cable-suggestions[hidden] { display: none; }
.cable-suggestion-row { border-bottom: 1px solid #dbe5e3; padding: 5px 0; }
.cable-suggestion-row button { display: block; width: 100%; text-align: left; white-space: normal; }
.cable-suggestion-row strong, .cable-suggestion-row small { display: block; overflow-wrap: anywhere; }
.cable-suggestion-row a { display: inline-block; margin: 4px 8px; }

.interface-return { padding: 12px 20px; background: #e9f3ed; border-bottom: 1px solid #c8dbce; }
.interface-return a { display: inline-block; font-weight: 700; padding: 8px 12px; color: #173e2c; background: white; border: 1px solid #a9c5b4; border-radius: 8px; }

/* BAUR palette: corporate green with neutral light and charcoal dark surfaces. */
:root[data-theme="dark"] {
  color-scheme: dark;
  color: #eceeeb;
  background: #101112;
  --green: #48aa26;
  --muted: #b0b5af;
  --line: #34383a;
  --panel: #1b1d1f;
  --canvas: #101112;
  --navy: #0b0c0d;
  --steel: #292c2e;
  --electric: #48aa26;
  --brand-heading: #72d44d;
  --brand-icon: #72d44d;
  --on-accent: #172013;
  --amber: #ffc067;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    color: #eceeeb;
    background: #101112;
    --green: #48aa26;
    --muted: #b0b5af;
    --line: #34383a;
    --panel: #1b1d1f;
    --canvas: #101112;
    --navy: #0b0c0d;
    --steel: #292c2e;
    --electric: #48aa26;
    --brand-heading: #72d44d;
    --brand-icon: #72d44d;
    --on-accent: #172013;
    --amber: #ffc067;
  }
}
body { color: inherit; background: var(--canvas); }
.sidebar { background: var(--navy); color: #e6e9e4; border-right: 1px solid var(--line); }
.sidebar small { color: #aeb8a8; }
.sidebar button { color: #c9cec7; display: flex; align-items: center; gap: 12px; white-space: normal; overflow-wrap: anywhere; }
.sidebar button > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.sidebar button.active, .sidebar button:hover { background: #2d3c28; color: #f1f5ee; }
.sidebar .side-sub { padding-left: 46px; font-size: 13px; }
.side-chevron { margin-left: auto; color: #aeb8a8; }
.side-footer { color: #aeb8a8; }
.brand { color: inherit; }
.mark { background: var(--electric); color: #fff; border-radius: 9px; width: 36px; height: 39px; }
.mark svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar { background: var(--panel); border-color: var(--line); }
.panel, .stat { color: inherit; background: var(--panel); border-color: var(--line); box-shadow: 0 2px 7px #00000008; }
input, select, textarea, .lang, .theme-control { color: inherit; background: var(--panel); border-color: var(--line); }
button { color: inherit; background: var(--panel); border-color: var(--line); }
button:hover { background: color-mix(in srgb, var(--panel), var(--electric) 8%); }
button.primary { background: var(--electric); border-color: var(--electric); color: #fff; }
button.primary:hover { background: color-mix(in srgb, var(--electric), #fff 10%); }
a, .eyebrow { color: var(--brand-heading); }
h1, h2, h3 { color: var(--brand-heading); }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand-heading); }
.badge { background: color-mix(in srgb, var(--electric), var(--panel) 88%); color: var(--brand-heading); }
.badge.warn, .notice { background: color-mix(in srgb, var(--amber), var(--panel) 88%); color: var(--amber); }
.success { background: #e8f3ed; color: #175b3f; }
.timeline, td { border-color: var(--line); }
th { color: var(--muted); background: color-mix(in srgb, var(--panel), var(--steel) 5%); }
tbody tr:hover { background: color-mix(in srgb, var(--panel), var(--electric) 5%); }
.thumb, .hero-photo { background: color-mix(in srgb, var(--panel), var(--steel) 8%); }
.login { background: var(--panel); }
.top-actions { gap: 9px; }
.top-actions > button { display: inline-grid; place-items: center; padding: 9px; }
.icon-svg { width: 19px; height: 19px; flex: 0 0 19px; vertical-align: middle; }
.action-card .icon .icon-svg { width: 29px; height: 29px; }
.theme-control { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 0 5px; }
.theme-control .icon-svg { width: 16px; height: 16px; }
.theme-control select { border: 0; padding: 7px 4px; }
.inventory-title { padding: 16px 18px 0; display: flex; justify-content: space-between; gap: 12px; }
.result-summary { color: var(--muted); padding: 0 18px 12px; font-size: 13px; }
.item-title { display: block; color: inherit; margin-top: 12px; }
.item-sku { display: block; font: 400 12px/1.45 inherit; color: var(--muted); overflow-wrap: anywhere; }
.zero-stock { color: #b42318 !important; font-weight: 700; }
.activity-title { font-size: 18px; margin: 17px 0 4px; }
.timeline-head { display: flex; align-items: center; gap: 10px; }
.timeline-head > .badge { margin-left: auto; }
.timeline-author { display: flex; flex-direction: column; gap: 2px; }
.timeline-author small, .activity-tech { color: var(--muted); font-size: 12px; }
.user-avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--electric), var(--panel) 82%); color: var(--brand-heading); font-weight: 750; }
.activity-tech { display: flex; flex-wrap: wrap; gap: 10px; }
.activity-quantity { margin-top: 14px !important; color: inherit; }
.technical-list, .recognition-audit { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.technical-list p { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }
.technical-list small { color: var(--muted); }
.literal-reading { border-top: 1px solid var(--line); padding-top: 8px; }
.literal-reading pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.duplicate-list { display: grid; gap: 8px; margin: 14px 0; }
.duplicate-choice { display: flex; flex-direction: column; align-items: start; gap: 4px; text-align: left; }
.duplicate-choice small { color: var(--muted); font-weight: 400; }
.stock-match-details { display: grid; gap: 5px; width: 100%; min-width: 0; margin: 6px 0; text-align: left; font-size: 12px; font-weight: 400; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.stock-match-details .stock-match-label { margin-top: 3px; font-weight: 700; }
.stock-match-details .stock-match-location { display: block; }
.stock-match-heading { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-width: 0; }
.stock-match-heading .stock-match-photo { display: block; flex: 0 0 72px; width: 72px; height: 72px; object-fit: contain; border-radius: 6px; }
.stock-match-heading .placeholder { display: grid; }
.detail-actions { display: flex; align-items: start; gap: 8px; }
.backup-tools { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.backup-tools summary { cursor: pointer; font-weight: 650; margin-bottom: 12px; }
.backup-status { overflow-wrap: anywhere; }
.taxonomy-review, .taxonomy-review__item, .taxonomy-review__assignment, .taxonomy-review__preview { color: inherit; }
.taxonomy-review__item, .taxonomy-review__assignment { border-color: var(--line) !important; }
.zero-stock, .missing-part-number { color: #b42318; }
.actions-grid { align-items: stretch; }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .mobile-mode .top-actions { gap: 5px; }
  .theme-control .icon-svg { display: none; }
  .theme-control select { max-width: 105px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .inventory-title { align-items: start; }
  .toolbar > select, .toolbar > input { min-width: 0; flex: 1 1 145px; }
  .item-card { align-items: start; }
  .detail-actions { flex-wrap: wrap; justify-content: end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media print {
  html, body, dialog, .label-wall, .qr-label { color: #111 !important; background: #fff !important; color-scheme: light !important; }
  .qr-label { border-color: #777 !important; filter: none !important; }
}
:root[data-theme="dark"] .success { background: #18392f; color: #9be0bd; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .success { background:#18392f; color:#9be0bd; } }

/* Shared surfaces also cover the receipt, catalogue and dialog views. */
:root { --danger: #b42318; }
:root[data-theme="dark"] { --danger: #ffaaa3; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] { --danger: #ffaaa3; }
}
button.primary { color: var(--on-accent); }
.action-card, .upload-button, .photo-entry button, dialog { color: inherit; background: var(--panel); border-color: var(--line); }
.action-card .icon { background: color-mix(in srgb, var(--electric), var(--panel) 91%); color: var(--brand-icon); }
.photo-upload { border-color: var(--line); background: color-mix(in srgb, var(--electric), var(--panel) 97%); }
.upload-button:hover { background: color-mix(in srgb, var(--electric), var(--panel) 90%); }
.cable-suggestions, .match-title { color: inherit; }
.empty h2 { color: var(--brand-heading); }
.cable-suggestions, .photo-readings, .cable-suggestion-row { border-color: var(--line); }
.interface-return { background: color-mix(in srgb, var(--electric), var(--panel) 94%); border-color: var(--line); }
.interface-return a { color: var(--brand-heading); background: var(--panel); border-color: var(--line); }
.zero-stock { color: var(--danger) !important; }
.error-text, button.danger, .missing-part-number { color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.item-cell > div, .item-cell > span, .field, .action-card { min-width: 0; }
.item-cell .thumb { flex-shrink: 0; }
.duplicate-dialog { padding: 24px; box-shadow: 0 12px 48px #08142055; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.section-heading h2, .section-heading h3 { margin-bottom: 12px; }
.item-cell strong, .item-cell small, .activity-title, .detail-sku { overflow-wrap: anywhere; }
.table-wrap table { table-layout: fixed; white-space: normal; min-width: 800px; }
.inventory-table th:nth-child(1) { width: 39%; }
.inventory-table th:nth-child(2) { width: 20%; }
.inventory-table th:nth-child(3) { width: 13%; }
.inventory-table th:nth-child(4) { width: 17%; }
.inventory-table th:nth-child(5) { width: 11%; }
.inventory-table.has-length th:nth-child(1) { width: 36%; }
.inventory-table.has-length th:nth-child(2) { width: 17%; }
.inventory-table.has-length th:nth-child(3) { width: 12%; }
.inventory-table.has-length th:nth-child(4) { width: 12%; }
.inventory-table.has-length th:nth-child(5) { width: 13%; }
.inventory-table.has-length th:nth-child(6) { width: 10%; }
.table-wrap th, .table-wrap td { padding: 13px 10px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .topbar { padding: 10px 8px; gap: 5px; }
  .topbar .brand { font-size: 19px; gap: 5px; flex-shrink: 0; margin: 0; }
  .topbar .mark, .topbar .mark svg { width: 27px; height: 31px; }
  .top-actions, .mobile-mode .top-actions { gap: 4px; min-width: 0; }
  .top-actions > button { padding: 8px; }
  .theme-control { padding: 0 2px; }
  .theme-control select { max-width: 80px; padding: 7px 2px; font-size: 13px; }
  .topbar .lang { padding: 7px 4px; font-size: 13px; }
  .detail-head { flex-wrap: wrap; }
  .detail-head > div { min-width: 0; }
  .photo-upload { padding: 20px 12px; }
  .action-card { overflow-wrap: anywhere; }
}
@media print {
  dialog *, .qr-label * { color: #111 !important; background: transparent !important; }
}

/* Original supplied transparent warehouse logo, shared by all brand placements. */
.mark { width: 44px; height: 44px; flex: 0 0 44px; background: transparent; border-radius: 0; }
.mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Larger supplied operation illustrations stay legible on both surfaces. */
.action-card .icon {
  width: 94px;
  height: 94px;
  padding: 7px;
  background: color-mix(in srgb, var(--panel), #d9ddd6 18%);
}
.action-card .operation-pictogram {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sidebar .category-icon { color: var(--brand-icon); flex: 0 0 19px; }
/* Locally bundled fonts keep typography consistent on offline workstations. */
:root { font-synthesis: none; }
h1, h2, h3, .brand-wordmark, .stat strong, .big-stock { font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif; }
h1, h2 { letter-spacing: -.025em; font-weight: 600; }
h3 { letter-spacing: -.012em; font-weight: 600; }
button { font-weight: 600; }
th { font-weight: 600; letter-spacing: .065em; }
.item-cell strong, .item-title { font-weight: 600; line-height: 1.4; }
.item-sku, .detail-sku, .stock, .big-stock, .stat strong, .activity-quantity { font-variant-numeric: tabular-nums; }
.brand-wordmark { font-size: 27px; font-weight: 700; letter-spacing: -.055em; line-height: 1; white-space: nowrap; }
.sidebar .brand-home, .topbar .brand-home { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; min-height: 44px; padding: 6px 0; text-align: left; }
.sidebar .brand-home { margin: 0 10px 22px; }
.brand-home:hover .brand-wordmark { color: var(--brand-heading); }
.sidebar .brand-home:hover .brand-wordmark { color: #72d44d; }
.topbar .brand-home { display: none; margin: 0; }
.history-material-link { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; min-height: 44px; padding: 4px 0; color: var(--brand-heading); border: 0; border-radius: 3px; background: transparent; text-align: left; font: inherit; }
.history-material-link span { min-width: 0; overflow-wrap: anywhere; }
.history-material-link:hover { text-decoration: underline; }
.history-material-link .icon-svg { width: 16px; height: 16px; flex-basis: 16px; }
@media (max-width: 760px) {
  .topbar .brand-wordmark { font-size: 22px; letter-spacing: -.05em; }
  .topbar .brand-home { display: inline-flex; gap: 6px; }
}
/* Material detail: identity, visual context, stock workspace, specifications, history. */
dialog:has(.material-detail) { max-width: 1120px; padding: 24px; }
dialog:has(.material-detail) .dialog-head { margin-bottom: 12px; align-items: center; }
dialog:has(.material-detail) .dialog-head > h2 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
dialog:has(.material-detail) #close-modal { min-width: 44px; min-height: 44px; }
.material-detail { min-width: 0; }
.material-detail button { min-height: 44px; }
.material-detail button:disabled { cursor: not-allowed; opacity: .45; }
.material-detail__header { align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 22px; }
.detail-identity { flex: 1 1 420px; min-width: 0; }
.detail-classification { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.detail-subcategory { color: var(--muted); font-size: 12px; }
.material-detail__header h2 { margin: 12px 0 8px; font-size: clamp(23px, 2.3vw, 30px); line-height: 1.25; overflow-wrap: anywhere; }
.material-detail .detail-sku { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 13px; }
.material-detail .detail-sku > span { color: var(--muted); }
.material-detail .detail-sku strong { font-weight: 500; overflow-wrap: anywhere; }
.detail-tools { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 1 auto; align-items: center; }
.detail-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; font-size: 13px; }
.material-detail__content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 360px); grid-template-areas: 'visual stock' 'technical stock' 'history history'; gap: 22px 26px; align-items: start; }
.material-detail__content:has(.material-detail__provenance) { grid-template-areas: 'visual stock' 'technical stock' 'provenance stock' 'history history'; }
.material-detail__content > * { min-width: 0; }
.material-detail__visual { grid-area: visual; }
.detail-photo-button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); overflow: hidden; background: var(--canvas); }
.detail-photo-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.detail-photo-tools button { color: var(--brand-heading); font-size: 13px; padding: 8px 12px; }
.material-detail .hero-photo { display: block; height: 310px; border-radius: 10px; object-fit: contain; }
.material-detail .hero-photo.placeholder { display: grid; }
.material-detail .detail-gallery { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.detail-gallery button { padding: 3px; border: 1px solid var(--line); border-radius: 8px; width: 64px; height: 64px; }
.detail-gallery button img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.detail-description { margin-top: 20px; }
.material-detail h3 { font-size: 15px; line-height: 1.35; margin: 0 0 12px; }
.detail-description p { margin: 0; line-height: 1.6; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-full-description summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--brand-heading); font-size: 13px; }
.detail-description:has(.detail-full-description[open]) .detail-description-preview { display: none; }
.material-detail__stock { grid-area: stock; border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: color-mix(in srgb, var(--panel), var(--canvas) 42%); }
.detail-stock-total > span { color: var(--muted); font-size: 13px; }
.material-detail .big-stock { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 7px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-action-group { margin-top: 22px; }
.detail-primary-actions, .detail-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-secondary-actions { margin-top: 8px; }
.detail-action-group button { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; padding: 11px 10px; text-align: left; font-size: 13px; line-height: 1.3; }
.detail-action-group button span { min-width: 0; overflow-wrap: anywhere; }
.detail-primary-actions button { min-height: 58px; }
.detail-primary-actions [data-move="receive"] { border-color: var(--brand-heading); }
.detail-count-group { padding-top: 16px; margin-top: 18px; border-top: 1px solid var(--line); }
.detail-positions { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.material-detail .detail-position { flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.material-detail .detail-position:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-position__info { flex: 1 1 135px; display: grid; gap: 5px; min-width: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.detail-position__info strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.detail-position__info small { color: var(--muted); }
.detail-position__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-position__issue { display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 8px; color: var(--brand-heading); font-size: 12px; }
.detail-segment-qr { display: grid; place-items: center; padding: 8px; min-width: 44px; }
.material-detail .technical-list { grid-area: technical; margin: 0; padding: 18px; border-radius: 10px; }
.technical-list dl { margin: 0; }
.technical-list dl > div { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.technical-list dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.technical-list dt { color: var(--muted); }
.technical-list dd { margin: 0; overflow-wrap: anywhere; }
.material-detail__provenance { grid-area: provenance; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.material-detail__provenance summary { cursor: pointer; color: var(--muted); font-size: 13px; min-height: 30px; align-content: center; }
.material-detail__provenance .recognition-audit { margin: 12px 0 0; padding: 0; border: 0; }
.material-detail__history { grid-area: history; border-top: 1px solid var(--line); padding-top: 22px; }
.detail-section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.detail-section-heading small { color: var(--muted); font-size: 12px; }
.material-detail__history .activity-title { font-size: 14px; margin: 12px 0 5px; }
.material-detail__history .timeline:last-child { border-bottom: 0; }
@media (max-width: 760px) {
  dialog:has(.material-detail) { padding: 16px; width: calc(100% - 20px); max-height: 94vh; }
  .material-detail__header { display: block; margin-bottom: 18px; padding-bottom: 16px; }
  .detail-tools { margin-top: 14px; }
  .material-detail__content { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'visual' 'stock' 'technical' 'history'; gap: 18px; }
  .material-detail__content:has(.material-detail__provenance) { grid-template-areas: 'visual' 'stock' 'technical' 'provenance' 'history'; }
  .material-detail .hero-photo { height: 230px; }
  .material-detail__stock { padding: 16px; }
  .material-detail__header h2 { font-size: 23px; }
  .material-detail__history .timeline-head { flex-wrap: wrap; }
  .material-detail__history .timeline-head > .badge { margin-left: 0; }
  .material-detail__history .activity-tech { overflow-wrap: anywhere; }
}
/* Material, category and position are independent, keyboard-accessible targets. */
.item-open {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 400;
}
.item-open strong { font-weight: 650; }
.item-open small { color: var(--muted); }
.item-open:hover, .item-location:hover { background: color-mix(in srgb, var(--panel), var(--electric) 9%); }
.category-link { border: 1px solid transparent; text-align: left; white-space: normal; }
.category-link:hover { border-color: var(--brand-heading); }
.location-links { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.item-location { border: 0; background: transparent; padding: 5px 2px; color: var(--brand-heading); font-size: 12px; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.item-location:hover { text-decoration: underline; }
.sort-header { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; border: 0; background: transparent; border-radius: 3px; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; }
.sort-header:hover, th[aria-sort="ascending"] .sort-header, th[aria-sort="descending"] .sort-header { color: var(--brand-heading); }
article.item-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
article.item-card .item-open { padding: 0; }
article.item-card .card-photo { display: block; width: 100%; height: 155px; object-fit: cover; border-radius: 7px; }
article.item-card .card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
article.item-card > div:last-child { padding: 0; }
article.item-card .stock { margin: 0; font-size: 20px; }
article.item-card .hint { margin: 0; }
@media (min-width: 1280px) {
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  article.item-card .item-open { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 12px; align-items: center; }
  article.item-card .card-photo { width: 82px; height: 82px; }
  article.item-card .item-title { margin-top: 0; }
  .item-location, .category-link { min-height: 36px; }
}
:root[data-theme="dark"] .action-card .icon { background: #c7cdc3; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .action-card .icon { background: #c7cdc3; }
}
@media (max-width: 700px) {
  .topbar .mark { width: 32px; height: 32px; flex-basis: 32px; }
}
.experimental-mode { border-color: color-mix(in srgb, var(--electric), var(--line) 35%); color: var(--brand-heading); }
.experimental-mode-indicator { margin: 0 0 12px; }
.experimental-toggle { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.experimental-toggle input { width: auto; }
.experimental-audit { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel), var(--electric) 3%); }
.experimental-audit h4 { margin: 0 0 8px; }
.experimental-warning { margin: 8px 0; }
.experimental-evidence-list { display: grid; gap: 8px; }
.experimental-evidence { display: grid; gap: 4px; padding: 8px 10px; border-left: 2px solid var(--electric); background: var(--panel); overflow-wrap: anywhere; }
.experimental-evidence small { color: var(--muted); }
.experimental-evidence p { margin: 2px 0; }
.experimental-evidence a { font-size: 12px; }
.experimental-audit details { margin-top: 8px; }
.experimental-audit ul { margin-bottom: 0; padding-left: 20px; }
.cable-parameters dl { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 6px 16px; }
.cable-parameters dd { margin: 0; overflow-wrap: anywhere; }
.parameter-comparison { overflow-x: auto; }
.parameter-comparison table { width: 100%; font-size: 0.85rem; }
.parameter-comparison th, .parameter-comparison td { white-space: normal; overflow-wrap: anywhere; padding: 6px; text-align: left; }
.identification-crop { width: min(940px, calc(100vw - 24px)); max-height: 94dvh; overflow: auto; padding: 16px; }
.identification-crop h2 { margin: 0; font-size: 1.15rem; }
.identification-crop > p { margin: 8px 0; }
.identification-crop canvas { display: block; max-width: 100%; max-height: calc(94dvh - 288px); width: auto; height: auto; margin: 8px auto; touch-action: none; cursor: crosshair; }
.identification-crop [data-save] { display: block; width: 100%; min-height: 44px; }
.identification-crop .crop-rotation { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.identification-crop .crop-rotation button { min-height: 44px; padding: 8px; }
.identification-crop .buttons { margin-top: 8px; justify-content: flex-end; }
.identification-crop .crop-error:empty { display: none; }
.identification-crop .crop-error { color: var(--danger, #d74b4b); }
.photo-entry button.crop-identification { top: auto; bottom: 2px; left: 2px; right: 2px; width: auto; height: auto; border-radius: 5px; font-size: 13px; padding: 7px; }
/* QR selection is a compact utility column; keep the material column dominant. */

/* Compact print queue controls belong at the end of each inventory row. */
.inventory-table.print-selectable th:first-child{width:34%}
.inventory-table.print-selectable .print-plan-cell{width:142px;padding:6px 4px;vertical-align:middle;font-size:10px;text-align:right}
.print-plan-controls{display:flex;align-items:center;justify-content:flex-end;gap:4px}
.print-plan-controls input[type=checkbox],.print-plan-cell input[type=checkbox]{width:14px;height:14px;min-width:14px;margin:0;padding:0}
.print-plan-controls input[type=number]{width:52px;min-width:0;height:27px;padding:2px 1px 2px 4px;font-size:12px;border-radius:4px}
.print-plan-controls input::-webkit-inner-spin-button{opacity:1;height:23px;cursor:pointer}
#vs-print-preview{position:fixed;right:22px;bottom:18px;z-index:80;display:flex;gap:14px;background:#fff;color:#193c2b;padding:12px;border:1px solid #b7c9bd;border-radius:10px;box-shadow:0 4px 20px #0002}
#vs-print-preview[hidden]{display:none}.vs-preview-thumb{width:112px;height:159px;position:relative;align-self:flex-end;outline:none}.vs-a5-sheet{box-sizing:border-box;width:148mm;height:210mm;padding:6mm;display:grid;background:white;color:#16271d;gap:0}
.vs-preview-thumb>.vs-a5-sheet{position:absolute;right:0;bottom:0;transform:scale(.2);transform-origin:bottom right;box-shadow:0 0 5px #0005;transition:transform .15s;z-index:1}
.vs-preview-thumb:hover>.vs-a5-sheet,.vs-preview-thumb:focus>.vs-a5-sheet{transform:scale(.72);box-shadow:0 4px 24px #0005}
.vs-preview-controls{width:150px;display:flex;flex-direction:column;gap:6px;font:13px system-ui}.vs-preview-controls button{padding:5px 9px;min-height:29px}.vs-preview-controls select{padding:3px;width:74px}.vs-page-nav{display:flex;align-items:center;justify-content:space-between;gap:7px}.vs-preview-controls small{font-size:11px}.vs-print-error{color:#ac2424}
.vs-label{box-sizing:border-box;border:.2mm dashed #ccc;display:flex;align-items:center;justify-content:center;gap:2mm;padding:2mm;min-height:0;min-width:0;overflow:hidden}.vs-label img{width:var(--qr);height:var(--qr);flex-shrink:0}.vs-label>div{min-width:0;max-width:100%}.vs-label strong{font:700 var(--font) system-ui;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.vs-label p{font:calc(var(--font) * .85) system-ui;margin:1mm 0}.vs-label small{font:calc(var(--font) * .72) system-ui}.vs-label.stacked{flex-direction:column;text-align:center}
#vs-print-pages{position:fixed;left:-100000px;top:0}@page{size:A5 portrait;margin:0}
@media print{body:has(#vs-print-pages)>*:not(#vs-print-pages){display:none!important}body:has(#vs-print-pages){margin:0!important;padding:0!important;background:white!important}#vs-print-pages{display:block!important;position:static;left:auto;top:auto}#vs-print-pages .vs-a5-sheet{break-after:page;page-break-after:always;margin:0}#vs-print-pages .vs-a5-sheet:last-child{break-after:auto;page-break-after:auto}}
@media(max-height:650px){.vs-preview-thumb:hover>.vs-a5-sheet,.vs-preview-thumb:focus>.vs-a5-sheet{transform:scale(.55)}}

/* Compact photo-first material detail. */
dialog:has(.material-detail){padding:14px;max-width:860px;}
.material-detail__visual{margin:0 0 10px;}
.material-detail .hero-photo{height:190px;width:100%;}
.material-detail .detail-gallery{margin-top:5px;flex-wrap:nowrap;overflow-x:auto;}
.material-detail .detail-gallery button,.material-detail .detail-gallery img{height:40px;width:48px;object-fit:contain;}
.material-detail__header{margin-bottom:10px;padding-bottom:10px;}
.material-detail__header h2{font-size:22px;margin:6px 0;}
.material-detail__content,.material-detail__content:has(.material-detail__provenance){display:flex;flex-direction:column;gap:10px;}
.material-detail__content>*{width:100%;box-sizing:border-box;}
.material-detail__stock{padding:10px;}
.detail-stock-total{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.material-detail .big-stock{margin:0;font-size:26px;}
.detail-primary-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px;}
.detail-primary-actions button{min-height:44px;padding:7px;}
.detail-positions{margin-top:10px;padding-top:8px;}
.material-detail h3{margin-bottom:6px;}
.material-detail .detail-position{padding:6px 0;gap:6px;}
.material-detail .technical-list{padding:10px;}
.material-detail .technical-list dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px;}
.material-detail .detail-description{margin:0;}
.material-detail .detail-description p{margin:4px 0;}
.material-detail__history{padding-top:8px;}
.material-detail__history summary{cursor:pointer;min-height:36px;align-content:center;}
.detail-source-links:empty{display:none;}
@media(max-width:700px){
 dialog:has(.material-detail){padding:10px;width:calc(100% - 12px);}
 .material-detail .hero-photo{height:160px;}
 .material-detail__header{display:flex;gap:6px;}
 .material-detail__header h2{font-size:20px;}
 .material-detail .detail-tools{margin:0;}
 .detail-primary-actions button{font-size:12px;}
}

.detail-source-links .information-source-links{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:0}.detail-source-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:8px;text-decoration:none}

.app-update-link{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:4px 9px;border:1px solid var(--line);border-radius:7px;color:var(--brand-heading);font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap}

.queue-qr-print{display:flex;align-items:center;gap:8px;margin:12px 0;font-size:14px}.queue-qr-print input{width:18px;height:18px}

/* Keep print navigation reachable while the page preview is enlarged. */
.vs-preview-controls{position:relative;z-index:2}.vs-preview-controls .vs-page-nav button{min-width:40px;min-height:40px}.vs-preview-thumb>.vs-a5-sheet{pointer-events:none}

/* Each print sheet occupies exactly one A5 page; no screen overflow participates. */
@media print{
 html:has(#vs-print-pages),body:has(#vs-print-pages){width:148mm!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important;}
 #vs-print-pages{width:148mm!important;margin:0!important;padding:0!important;border:0!important;line-height:normal;}
 #vs-print-pages .vs-a5-sheet{width:148mm!important;height:209.9mm!important;max-height:209.9mm!important;box-sizing:border-box!important;overflow:hidden!important;break-inside:avoid!important;page-break-inside:avoid!important;break-before:auto;box-shadow:none!important;transform:none!important;}
 #vs-print-pages .vs-a5-sheet:last-child{break-after:auto!important;page-break-after:auto!important;}
 #vs-print-pages .vs-label{break-inside:avoid;min-height:0;overflow:hidden;}
 #vs-print-pages .vs-label p,#vs-print-pages .vs-label small{overflow-wrap:anywhere;}
}

/* Reserve physical printer margins instead of a full-bleed A5 box. */
@page{size:148mm 210mm;margin:6mm}
@media print{
 html:has(#vs-print-pages),body:has(#vs-print-pages),#vs-print-pages{width:136mm!important;}
 #vs-print-pages .vs-a5-sheet{width:136mm!important;height:197.8mm!important;max-height:197.8mm!important;padding:0!important;}
}

.detail-storage-summary{display:flex;flex-direction:column;gap:4px;margin:8px 0;padding:9px 12px;border-left:3px solid var(--brand-heading);background:var(--canvas);font-size:14px}.detail-storage-summary>strong,.item-storage-summary>small{color:var(--muted);font-size:12px}.detail-storage-summary>span{font-weight:650;overflow-wrap:anywhere}.item-storage-summary{margin:8px 0}.location-links .item-location{color:var(--text);font-size:13px;font-weight:600;white-space:normal;min-width:100px}

.research-queue-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 14px;padding:12px 14px;margin:8px 0}.research-queue-row h3{font-size:15px;margin:0;overflow-wrap:anywhere}.research-queue-row [data-row-status]{grid-column:1;margin:0;color:var(--muted)}.research-queue-row button{grid-column:2;grid-row:1 / 3;align-self:center}.research-queue-row[data-status=running]{border-left:4px solid var(--electric)}.research-queue-row[data-status=failed],.research-queue-row[data-status=not-found],.research-queue-row[data-status=source-error]{border-left:4px solid var(--amber)}

/* Identical usable area in preview and print; full text is measured before printing. */
.vs-a5-sheet{height:209.8mm;color:#000}
.vs-label strong{display:block;-webkit-line-clamp:unset;overflow:visible;line-height:1.15}
.vs-label>div{flex-shrink:0;overflow-wrap:anywhere;line-height:1.15}
.vs-label p{line-height:1.15;margin:.7mm 0}
.vs-label small{display:block;line-height:1.15}

.identification-specs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px}.identification-specs dt{font-size:12px;color:var(--muted)}.identification-specs dd{margin:3px 0;overflow-wrap:anywhere}.identification-review .gallery img{max-height:140px}@media(max-width:600px){.identification-specs{grid-template-columns:1fr}}
