@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  font-family: Inter, system-ui, sans-serif;
  color: #212437;
  background: #f8f8fa;
  font-size: 13px;
  --navy: #072083;
  --blue: #1476c5;
  --line: #e3e3eb;
  --muted: #595d71;
  --panel: #e4e5f0;
  --studio-background: radial-gradient(ellipse at 26% 20%, #f8fbfb, #e7eff0 65%, #d6e3e7);
}
:root[data-theme="dark"] {
  --studio-background: radial-gradient(ellipse at 26% 20%, #344a57, #20343f 65%, #182b35);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible { outline: 2px solid #2367be; outline-offset: 2px; }
svg { width: 17px; height: 17px; vertical-align: middle; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: 50px; background: var(--navy);
  display: flex; flex-direction: column; align-items: center; color: white; z-index: 2;
}
.workspace { display: grid; place-items: center; background: #92aaff; width: 29px; height: 29px; margin-top: 10px; border-radius: 6px; font-weight: 700; }
.rail hr { width: 29px; margin: 10px 0 6px; border: 0; border-top: 1px solid #ffffff60; }
.rail button { width: 100%; border: 0; background: transparent; color: #b5c2f0; font-size: 8px; padding: 10px 0; display: grid; justify-items: center; gap: 5px; }
.rail button.active, .rail button:hover { color: white; background: #ffffff0f; }
.account { margin: auto 0 15px; display: grid; justify-items: center; gap: 5px; text-align: center; font-size: 7px; }
.account b { border-radius: 50%; background: #a2df69; color: #183b16; padding: 4px; }
header {
  margin-left: 50px; min-height: 44px; background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
#breadcrumbs, .header-actions { display: flex; align-items: center; gap: 10px; }
#breadcrumbs { flex-wrap: wrap; padding: 7px 0; }
#breadcrumbs button, .header-actions button, .actions button { border: 0; padding: 3px; background: transparent; }
#breadcrumbs span { color: var(--muted); }
#breadcrumbs button:hover, .actions button:hover:not(:disabled) { text-decoration: underline; }
.header-actions button { padding: 5px; border-radius: 4px; }
.header-actions button:hover { background: #eef0f7; }
main { margin-left: 50px; padding: 22px clamp(18px, 5.6vw, 100px); }
.box-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr); gap: 36px; }
.grid-side { min-width: 0; }
.actions { min-height: 55px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.actions button { color: var(--blue); }
.grid-scroll { overflow: auto; padding: 1px; }
.plate { border-collapse: collapse; width: 100%; min-width: 485px; table-layout: fixed; background: white; }
.plate th, .plate td { border: 1px solid var(--line); }
.plate th { font-weight: 400; background: #f9f9fb; }
.plate th:first-child { width: 22px; }
.plate td { padding: 0; }
.well {
  display: block; position: relative; text-align: left; width: 100%; aspect-ratio: 1.06;
  border: 0; background: white; overflow: hidden; overflow-wrap: anywhere; color: #292d43;
  font-size: clamp(9px, .77vw, 13px); padding: 5px 4px; align-content: start;
}
.well:hover { background: #f4f6fd; }
.well.selected { background: #f3f4fb; box-shadow: inset 0 0 0 1.5px #242e9a; }
.well.selected::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: #242e9a; }
.details { background: var(--panel); border-radius: 15px; padding: 25px; min-height: 100%; }
.details h1 { margin: 4px 0 18px; display: flex; align-items: center; gap: 12px; font-size: clamp(16px, 1.5vw, 24px); font-weight: 600; }
.summary { padding: 14px; border: 1px solid #a8b6ec; background: #edf0fc; border-radius: 5px; line-height: 1.55; }
.summary strong { color: #3144a4; }
.metrics { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 0; border-bottom: 1px solid #d8dbe9; font-size: 11px; }
.metrics svg { width: 13px; height: 13px; margin-right: 4px; }
.metadata { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 16px 0; }
.metadata dt { font-weight: 600; margin-bottom: 6px; }
.metadata dd { margin: 0; overflow-wrap: anywhere; }
.primary, .secondary, .danger { border-radius: 5px; padding: 8px 12px; border: 1px solid transparent; }
.primary { color: #fff; background: #243da8; }
.secondary { background: #fff; border-color: #cfd2e1; }
.danger { background: #fdf1f3; color: #a01b36; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 22px; }
.page-heading h1 { margin: 0; font-size: 26px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.card { display: grid; justify-items: start; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.card:hover, .result:hover { border-color: #8fa4ea; }
.card small, .muted { color: var(--muted); }
.result { width: 100%; text-align: left; display: block; margin: 7px 0; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.result small { display: block; margin-top: 4px; color: var(--muted); }
dialog { width: min(490px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 10px; padding: 24px; color: inherit; }
dialog::backdrop { background: #161a3566; }
dialog h2 { margin: 0 0 16px; }
dialog label { display: grid; gap: 5px; margin: 12px 0; }
input:not([type=file]), select, textarea { width: 100%; padding: 8px; border: 1px solid #bfc3d5; border-radius: 5px; background: white; color: inherit; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#error { color: #a01b36; }
#notice:not(:empty) { position: fixed; right: 18px; bottom: 18px; padding: 12px 18px; background: #202953; color: white; border-radius: 6px; z-index: 3; }
@media (max-width: 920px) { .box-layout { grid-template-columns: 1fr; gap: 18px; } }

/* Layouts measured against the public application demos. */
:root {
  --rail-width: 76px;
  --header-height: 36px;
  --navy: #061e80;
  --blue: #1680d2;
  --line: #e5e5eb;
  --panel: #e3e4ef;
  background: #f8f8fa;
  font-size: 12px;
}
[hidden] { display: none !important; }
.rail { width: var(--rail-width); }
.workspace { width: 25px; height: 25px; margin-top: 8px; }
.rail button { padding: 11px 0; }
header { margin-left: var(--rail-width); min-height: var(--header-height); padding: 0 18px; }
#breadcrumbs { gap: 7px; font-size: 11px; }
#breadcrumbs > button, #breadcrumbs > strong { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 156px; }
.header-actions { gap: 6px; }
.header-actions svg { width: 15px; height: 15px; }
main { margin-left: var(--rail-width); padding: 25px; }
main:has(.box-layout) { padding: clamp(14px, 1.3vw, 23px) clamp(24px, 5.6vw, 110px); }
main:has(.inventory-layout) { padding: 0; }
.box-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(18px, 2.5vw, 42px); }
.actions { min-height: clamp(37px, 3.43vw, 56px); gap: 10px; font-size: 11px; }
.actions svg { width: 12px; height: 12px; }
.actions button { white-space: nowrap; }
.grid-scroll { padding: 0; }
.plate { min-width: calc(17px + var(--columns) * 46px); }
.plate th { font-size: 11px; height: clamp(14px, 1.25vw, 21px); }
.plate th:first-child { width: clamp(14px, 1.25vw, 21px); }
.well { aspect-ratio: 1.02; padding: 4px 3px; font-size: clamp(8px, .73vw, 12px); }
.well.selected { box-shadow: inset 0 0 0 1px #1c2a8a; }
.well.selected:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #1c2a8a; }
.details { border-radius: 12px; padding: clamp(15px, 1.5vw, 26px); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.panel-heading h1 { margin: 6px 0 12px; font-size: clamp(15px, 1.4vw, 22px); gap: 10px; overflow-wrap: anywhere; }
.panel-heading h1 svg { flex-shrink: 0; }
.summary { padding: 10px; border-color: #c0b2e8; background: linear-gradient(106deg, #e6efff, #fce5f4); font-size: 11px; }
.summary strong { color: #3e68bc; }
.metrics { font-size: 10px; padding: 12px 0; }
.metrics svg { width: 11px; height: 11px; }
.metadata { font-size: 11px; line-height: 1.5; }
.icon-button, .text-button, .subtle, .row-button { border: 0; background: transparent; padding: 4px; }
.icon-button:hover, .row-button:hover, .text-button:hover { text-decoration: underline; }
.text-button { color: var(--blue); }
.subtle, .actions .subtle { border-radius: 4px; background: #fff; color: #262a3d; padding: 6px 9px; box-shadow: 0 1px 2px #1517340d; font-size: 11px; }
.subtle:hover { background: #f0f2f9; }
.item-shell { padding: 5px; }
.item-panel { display: flex; flex-direction: column; min-height: 100%; background: #fff; border-radius: 10px; }
.item-panel > .panel-heading { padding: 10px 13px 4px; }
.item-tabs { display: flex; gap: clamp(4px, .75vw, 12px); flex-wrap: wrap; padding: 0 13px; border-bottom: 1px solid var(--line); }
.item-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 0; font-size: 10px; }
.item-tabs button[aria-pressed=true] { color: var(--blue); border-bottom-color: #55a9f2; }
.item-content { padding: 14px; }
.item-content h3 { margin: 0 0 10px; font-size: 12px; }
.item-content h3:not(:first-child) { margin-top: 14px; }
.item-content .metadata { display: block; margin: 0; }
.item-content .metadata > div { display: grid; grid-template-columns: minmax(75px, .65fr) minmax(0, 1.6fr); gap: 10px; margin: 0 0 15px; }
.item-content .metadata dt { font-weight: 500; margin: 0; }
.item-content .metadata + h3 { border-top: 1px solid var(--line); padding-top: 12px; }
.inline-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lineage-node { padding: 7px; background: #f1f6fc; border: 1px solid #87b6e6; border-radius: 4px; }
.lineage-node small { float: right; color: var(--blue); }
.activity-feed { border-top: 1px solid var(--line); padding-top: 12px; }
.activity-entry { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 11px; }
.activity-entry small { display: block; color: var(--muted); margin-top: 3px; }
.avatar { display: inline-grid; place-items: center; background: #9cdd70; color: #27441a; width: 20px; height: 20px; border-radius: 50%; font-size: 7px; flex: 0 0 20px; }
.barcode-label { background: #fff; color: #111; text-align: center; padding: 12px; margin: 5px 0; font-size: 11px; }
.barcode-label svg { color: #111; fill: currentColor; display: block; width: 100%; height: 75px; margin: 6px 0; }
.barcode-label code { overflow-wrap: anywhere; }
dialog { max-height: min(85vh, 800px); }
dialog label.checkbox { display: flex; align-items: center; }
dialog label.checkbox input { width: auto; }
.inventory-layout { display: grid; grid-template-columns: clamp(150px, 19vw, 290px) minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); }
.inventory-nav { padding: 24px 0; background: #fff; border-right: 1px solid var(--line); }
.inventory-nav h1 { font-size: 22px; font-weight: 600; margin: 16px 18px 24px; }
.inventory-nav button { display: flex; gap: 12px; align-items: center; background: transparent; border: 0; width: 100%; padding: 10px 18px; text-align: left; }
.inventory-nav button[aria-current=page], .inventory-nav button:hover { background: #f2f5f8; color: #112879; }
.inventory-nav button[aria-current=page] { box-shadow: inset -2px 0 #243885; }
.inventory-nav svg { width: 14px; height: 14px; }
.inventory-main { min-width: 0; padding: clamp(18px, 2.6vw, 42px) clamp(18px, 4vw, 62px); }
.inventory-main > input[type=search], .order-tools input[type=search] { border-color: #e6e7ee; padding: 5px 9px; }
.inventory-main .page-heading { margin: 28px 0 18px; }
.inventory-main .page-heading h1 { font-size: 22px; font-weight: 600; }
.freezer-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.freezer-cards .card { padding: 0; width: 100%; overflow: hidden; gap: 0; }
.freezer-card-art { width: 100%; min-height: 68px; display: grid; place-items: center; background: #edf0fa; color: #6578b5; }
.freezer-cards .card > span:last-child { padding: 14px; }
.freezer-cards .card small { display: block; margin-top: 4px; }
.storage-layout { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.storage-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.storage-heading, .shelf-heading { display: flex; align-items: center; gap: 9px; }
.storage-heading { background: #f9f9fb; min-height: 43px; border-bottom: 1px solid var(--line); padding: 7px 12px; }
.storage-heading strong { font-weight: 500; }
.storage-heading button, .shelf-heading .subtle { margin-left: auto; }
.shelves { padding: 0 20px 16px; max-height: calc(100vh - 130px); overflow: auto; }
.shelf-section { margin: 12px 0 23px; }
.shelf-heading { margin-bottom: 10px; }
.shelf-heading .icon-button { font-weight: 600; }
.rack-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rack-card { background: #f9f9fb; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; font-size: 10px; }
.rack-card span { height: 4px; width: 34%; border-radius: 12px; background: #b4b9d5; }
.rack-card:hover, .rack-card.current { border-color: #4150a2; }
.box-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px clamp(16px, 6vw, 130px); }
.box-cards button { background: white; min-height: 75px; box-shadow: 0 2px 5px #191f4420; border: 1px solid #f4f4f8; border-radius: 5px; padding: 5px; font-size: 11px; }
.box-cards button:hover { border-color: #868dc3; }
.space-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.space-card { background: #fff; border: 0; overflow: hidden; border-radius: 6px; box-shadow: 0 2px 5px #171a3620; padding: 0; text-align: left; }
.space-card img { width: 100%; object-fit: cover; aspect-ratio: 4.2; display: block; }
.space-card > span { display: flex; align-items: center; gap: 12px; padding: 13px; min-height: 65px; }
.space-card strong { font-weight: 500; font-size: 14px; }
.space-card svg { background: var(--panel); color: #102781; padding: 8px; width: 35px; height: 35px; border-radius: 50%; flex-shrink: 0; }
.space-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 35px; align-items: start; }
.space-map { position: relative; height: min(66vh, 620px); min-height: 295px; }
.map-unit { position: absolute; top: var(--y); left: var(--x); width: var(--w); height: var(--h); border: 1px solid currentColor; font-size: 10px; overflow: hidden; }
.map-unit:hover { filter: saturate(2); }
.map-unit.red { background: #fff1f1; color: #c64d52; }
.map-unit.blue { background: #eef1fc; color: #495eb0; }
.map-unit.pink { background: #fbeff6; color: #b54378; }
.map-unit.teal { background: #eafafa; color: #207d79; }
.map-unit.purple { background: #f5effb; color: #7243ad; }
.map-unit.yellow { background: #fcf8ec; color: #966919; }
.map-unit.orange { background: #fcf1e9; color: #a9522c; }
.space-directory h2 { font-size: 14px; margin: 7px 0 10px; }
.directory-stats { background: #e7eaf3; padding: 12px; border-radius: 6px; margin-bottom: 12px; }
.category-list > .cards { padding: 18px; }
.category-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 28px; }
.category-layout > .details { min-height: max(435px, 76vh); }
.table-actions, .order-heading, .order-tools, .pagination, .order-detail-status { display: flex; align-items: center; gap: 8px; }
.table-actions select { width: auto; border-color: var(--line); padding: 5px; }
.category-layout .table-actions { margin-bottom: 16px; }
.table-frame { min-height: max(380px, 68vh); border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.list-table { border-collapse: collapse; width: 100%; font-size: 11px; text-align: left; }
.list-table th, .list-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.list-table th { font-weight: 600; white-space: nowrap; color: #282b40; }
.list-table small { display: block; color: var(--muted); min-height: 0; }
.list-table tr.current { background: #eef2f8; }
.list-table .row-button { text-align: left; padding: 0; }
.category-layout .list-table td:first-child { padding-left: 15px; }
.category-layout .list-table td { height: clamp(28px, 3.1vw, 44px); }
.order-heading, .order-tools { justify-content: space-between; margin: 0 0 21px; }
.order-heading .primary { background: var(--navy); padding: 6px 10px; }
.order-tools { margin-bottom: 30px; }
.order-tools input[type=search] { width: min(220px, 50%); }
.segmented { display: flex; flex-wrap: wrap; gap: 2px; background: var(--panel); padding: 3px; border-radius: 4px; }
.segmented button { background: transparent; border: 0; padding: 4px 7px; color: #373b53; font-size: 10px; }
.segmented button[aria-pressed=true] { background: #fff; border-radius: 3px; }
.segmented small { color: #595688; }
.order-table { overflow: auto; }
.order-table th { background: #fff; }
.order-table :is(th,td):first-child { min-width: 125px; width: 38%; }
.order-table :is(th,td) { padding: 10px 6px; }
.order-table :is(th,td):not(:first-child) { white-space: nowrap; }
.status { display: inline-block; font-size: 10px; border-radius: 3px; background: #ededf3; padding: 3px 6px; color: #3e425a; }
.status.approved { background: #f4eafa; color: #63348c; }
.status.ordered { background: #edf2fd; color: #3e57a6; }
.status.received { background: #edf9e7; color: #3c6c27; }
.status.cancelled { background: #fce8eb; color: #963447; }
.pagination { margin-top: 12px; }
.order-detail { position: fixed; z-index: 3; top: 0; right: 0; bottom: 0; width: min(355px, 92vw); overflow-y: auto; background: #f8f8fa; box-shadow: -7px 0 22px #1c214328; padding: 18px; }
.order-detail h2 { font-size: 16px; font-weight: 600; }
.order-detail-status { margin: 22px 0; }
.order-detail .item-tabs { padding: 0; }
.order-detail .item-content { padding: 16px 0; }
@media (max-width: 900px) {
  .box-layout, .storage-layout, .category-layout, .space-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .shelves { max-height: 420px; }
  .space-cards, .freezer-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-main { padding: 18px; }
}
@media (max-width: 550px) {
  .inventory-layout { grid-template-columns: minmax(0, 1fr); }
  .inventory-nav { padding: 6px; display: flex; flex-wrap: wrap; }
  .inventory-nav h1 { display: none; }
  .inventory-nav button { width: auto; padding: 6px; gap: 3px; font-size: 10px; }
  .order-heading { flex-wrap: wrap; }
}
@media print {
  body:has(.barcode-print) > :not(dialog) { display: none; }
  dialog:has(.barcode-print) { position: static; border: 0; width: 100%; max-height: none; overflow: visible; }
  dialog:has(.barcode-print) .dialog-actions, dialog:has(.barcode-print) h2 { display: none; }
  .barcode-label { break-inside: avoid; }
}

.well { display: flex; align-items: flex-start; aspect-ratio: 1.08; font-size: clamp(8px, .7vw, 12px); }
.well span { min-width: 0; overflow-wrap: anywhere; }
.summary { min-height: 70px; }
.inventory-main:has(.space-cards), .inventory-main:has(.freezer-cards) { padding-inline: clamp(18px, 4.5vw, 77px); }
.space-cards { gap: 18px; }
.space-card > span { min-height: 74px; }
.lineage-list { margin: 5px 0 14px; padding-left: 18px; }
.lineage-list li { padding: 3px 0 3px 6px; }
.item-content > .lineage-node + .inline-heading { margin-top: 14px; }
.storage-heading .map-actions { margin-left: auto; }
.map-unit[data-edit-unit] { border-style: dashed; }

.rail .account { margin: auto 0 6px; overflow-wrap: anywhere; }
.rail .account:disabled { opacity: 1; }
.member-list { display: grid; gap: 5px; }
.member-list div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.backup-link { display: inline-block; margin: 5px 0; text-decoration: none; }

#alerts-button { position: relative; }
#alerts-button b { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; background: #c64080; border-radius: 50%; border: 1px solid white; }
#alerts-panel { position: fixed; z-index: 4; top: var(--header-height); right: 20px; width: min(315px, calc(100vw - 32px)); min-height: 100px; background: white; box-shadow: 0 7px 27px #1c214329; border: 1px solid var(--line); border-radius: 7px; padding: 14px; font-size: 11px; }
.alert-heading, .alert-entry { display: flex; gap: 8px; align-items: flex-start; }
.alert-heading { align-items: center; justify-content: space-between; padding-bottom: 10px; }
.alert-heading select { width: auto; padding: 4px; }
.alert-heading strong span { color: var(--blue); }
.alerts-list { max-height: min(420px, 65vh); overflow: auto; }
.alert-entry { padding: 10px 3px; border-bottom: 1px solid var(--line); }
.alert-entry:last-child { border-bottom: none; }
.alert-entry button { padding: 0; text-align: left; color: var(--blue); }
.alert-entry p { margin: 4px 0; }
.alert-entry small { color: var(--muted); }
.alert-symbol { flex: 0 0 24px; height: 24px; display: grid; place-items: center; background: #e7ebfa; color: #40539d; border-radius: 50%; }
.alert-symbol svg { width: 12px; height: 12px; }
.order-table .tracker-table :is(th,td):first-child { width: 32px; min-width: auto; }
.tracker-table :is(th,td):nth-child(2) { width: 29%; min-width: 140px; }
.tracker-table :is(th,td) { padding-block: 8px; }
.tracker-table .tracker-records td { background: #eef1f9; padding-block: 4px; }
.stock-dot { width: 6px; height: 6px; border-radius: 50%; background: #66a448; display: inline-block; margin-right: 6px; }
.stock-dot.running-low { background: #eda928; }
.stock-dot.out-of-stock { background: #d4465a; }
.stock-dot.reordered { background: #a3a9bf; }
main:has(.tracker-form) { padding: 0; }
.tracker-form-heading { display: flex; align-items: center; justify-content: space-between; background: white; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.tracker-form-heading h1 { font-size: 16px; font-weight: 500; margin: 0; }
.tracker-form-fields { width: min(324px, calc(100% - 32px)); margin: 28px auto; }
.tracker-form-fields label { display: grid; gap: 5px; margin: 15px 0; }
#tracker-error { color: #a01b36; }

/* Give the three navigation regions consistent spacing at their own scale. */
.rail { padding: 12px 12px 8px; overflow-y: auto; scrollbar-width: thin; }
.rail .workspace { flex: 0 0 34px; width: 34px; margin-top: 0; font-size: 14px; }
.rail button { flex-shrink: 0; border-radius: 7px; padding: 11px 3px; gap: 5px; font-size: 9px; line-height: 1.15; }
.rail button > span svg { width: 18px; height: 18px; }
.rail button[data-view] { margin-block: 2px; }
.rail button.active { background: #ffffff25; }
.rail .account { padding: 9px 3px; }
.rail hr { flex-shrink: 0; width: 100%; margin-block: 11px 6px; }
@media (max-width: 550px) {
  :root { --rail-width: 62px; }
  .rail { padding-inline: 8px; }
  .rail button { padding-block: 9px; font-size: 8px; }
}
.inventory-nav { --nav-inset: clamp(10px, 1.3vw, 20px); padding: 24px var(--nav-inset); }
.inventory-nav h1 { margin: 8px 7px 20px; }
.inventory-nav button { padding: 9px 8px; margin: 3px 0; gap: 10px; border-radius: 5px; }
.inventory-nav button[aria-current=page] { box-shadow: inset 2px 0 #243885; }
main:has(.notebook-layout) { padding: 0; }
.notebook-layout { display: grid; grid-template-columns: clamp(162px, 15.4vw, 252px) minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); }
.notebook-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 9px; background: #fbfbfc; border-right: 1px solid var(--line); padding: 10px 10px 6px; }
.notebook-workspace { min-height: 25px; display: flex; gap: 8px; align-items: center; color: var(--muted); padding-inline: 5px; }
.notebook-workspace svg, .notebook-tree svg, .notebook-trash svg, .notebook-strip svg { width: 12px; height: 12px; flex-shrink: 0; }
.notebook-sidebar > .primary { width: 100%; background: var(--navy); border-radius: 4px; }
.notebook-sidebar input[type=search] { border-color: var(--line); padding: 6px 8px; }
.notebook-tree { min-height: 90px; max-height: calc(100dvh - 185px); overflow: auto; }
.notebook-tree button, .notebook-trash { display: flex; align-items: center; gap: 7px; border: 0; border-radius: 4px; background: transparent; min-height: 25px; width: 100%; padding: 5px 6px; text-align: left; font-size: 11px; }
.notebook-tree button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notebook-tree .notebook-document { padding-left: 15px; }
.notebook-folder > .notebook-folder { margin-left: 10px; }
.notebook-tree button:hover, .notebook-tree button[aria-current=page], .notebook-trash[aria-pressed=true] { background: #e9eaf4; }
.notebook-trash { margin-top: auto; color: var(--muted); }
.notebook-main { position: relative; min-width: 0; background: white; }
.notebook-strip { display: flex; gap: 4px; align-items: stretch; background: #f8f8fb; border-bottom: 1px solid var(--line); overflow: auto; }
.notebook-strip :is(span,button) { border: 0; background: transparent; display: flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 6px 10px; color: var(--muted); font-size: 11px; }
.notebook-strip button[aria-current=page] { background: white; color: #202437; }
.notebook-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-inline: 12px; gap: 8px; border-bottom: 1px solid var(--line); }
.notebook-tabs nav, .notebook-actions, .notebook-format { display: flex; align-items: center; gap: 10px; }
.notebook-tabs nav button { padding: 9px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; }
.notebook-tabs nav button[aria-pressed=true] { color: #14277b; border-color: #23398e; }
.notebook-actions .primary { padding: 4px 9px; font-size: 10px; }
.notebook-status { padding: 3px 7px; background: #eaf3fd; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.notebook-status.completed { background: #e9f5e6; color: #286222; }
.notebook-assignee { font-size: 10px; color: var(--muted); }
.notebook-format { gap: 4px; padding: 4px 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); min-height: 34px; font-size: 11px; }
.notebook-inline-label > span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.notebook-format select { width: auto; padding: 3px 5px; border: 0; }
.notebook-format .icon-button { min-width: 25px; padding: 4px; }
.notebook-format .icon-button:hover { background: #edf0f8; border-radius: 3px; }
.notebook-paper-scroll { overflow: auto; max-height: calc(100dvh - 120px); min-height: 300px; }
.notebook-paper { width: min(76%, 755px); margin: 0 auto; padding: 40px 0 80px; font-size: calc(13px * var(--notebook-scale, 1)); line-height: 1.6; }
.notebook-paper h1 { font-size: 1.8em; line-height: 1.25; font-weight: 550; margin: 0 0 30px; overflow-wrap: anywhere; }
.notebook-body { overflow-wrap: anywhere; min-height: 8em; padding-block: 2px; }
.notebook-body:focus { outline: 0; }
.notebook-body[contenteditable=true]:empty::before { content: 'Start writing'; color: var(--muted); cursor: text; }
.notebook-body h2 { font-size: 1.55em; margin: 1.5em 0 .3em; font-weight: 550; }
.notebook-body h3 { font-size: 1.27em; margin: 1em 0 .3em; }
.notebook-body p { margin: .5em 0; }
.notebook-body ul, .notebook-body ol { padding-left: 1.55em; }
.notebook-body li { margin: .2em 0; }
.notebook-body table { border-collapse: collapse; width: 100%; margin: 1.8em 0; table-layout: fixed; }
.notebook-body th, .notebook-body td { border: 1px solid var(--line); padding: .58em; text-align: left; }
.notebook-body blockquote, .notebook-comment blockquote { border-left: 2px solid #eac765; margin: .65em 0; padding-left: .8em; color: var(--muted); }
.notebook-body pre { white-space: pre-wrap; }
.notebook-material { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; margin: 0 6px 4px 0; font-size: 11px; background: #f4f5f9; border: 0; border-radius: 4px; }
.notebook-material:hover { background: #ebedf8; }
.notebook-material svg { width: 11px; height: 11px; }
.notebook-tools { position: absolute; top: 72px; right: 6px; display: grid; gap: 5px; }
.notebook-tools svg { width: 13px; height: 13px; }
.notebook-empty, .notebook-section { padding: 38px clamp(22px, 7vw, 100px); }
.notebook-section .inline-heading h2 { margin: 0; font-size: 17px; }
.notebook-section .metadata { max-width: 640px; }
.notebook-materials { margin-bottom: 12px; }
.notebook-side-panel { position: absolute; z-index: 2; inset: 64px 0 0 auto; width: min(306px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -5px 0 18px #18204415; padding: 14px; overflow: auto; }
.notebook-side-panel h2 { margin: 0; font-size: 14px; }
.notebook-comment, .notebook-version { border-bottom: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.notebook-side-panel small { display: block; color: var(--muted); margin: 3px 0; }
.notebook-comment p { white-space: pre-wrap; }
.comment-reply { border-left: 2px solid var(--line); padding-left: 8px; margin-left: 5px; }
@media (max-width: 710px) {
  .notebook-layout { grid-template-columns: minmax(0, 1fr); }
  .notebook-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .notebook-tree { max-height: 175px; min-height: 0; }
  .notebook-paper { width: calc(100% - 54px); padding-top: 24px; }
}
@media (max-width: 550px) {
  .inventory-nav { gap: 3px; padding: 7px; }
  .inventory-nav button { margin: 0; padding: 6px; gap: 3px; }
  .inventory-nav button[aria-current=page] { box-shadow: inset 0 -2px #243885; }
}

.csv-mapping { display: grid; gap: 7px; margin: 14px 0; }
.csv-map-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 10px; }
.csv-map-row label { margin: 0; }
.csv-example { margin: 16px 0; }
.csv-example table { margin-top: 10px; border-collapse: collapse; width: 100%; table-layout: fixed; }
.csv-example :is(th, td) { text-align: left; padding: 5px; overflow-wrap: anywhere; border: 1px solid var(--line); }

main:has(.core-shell, .reports-workspace) { padding: 0; }
.core-shell { display: grid; grid-template-columns: clamp(140px, 15vw, 230px) minmax(0, 1fr); min-height: calc(100dvh - var(--header-height)); }
.core-main { padding: 27px clamp(16px, 3.3vw, 49px); min-width: 0; }
.core-heading { margin-top: 0; }
.core-heading h1 { font-size: 24px; font-weight: 550; margin-bottom: 4px; }
.core-heading .muted { display: block; }
.core-filters { margin-bottom: 21px; flex-wrap: wrap; }
.core-filters input[type=search] { max-width: 320px; }
.core-filters input[type=date], .core-filters select { width: auto; max-width: 100%; }
.equipment-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 17px; }
.equipment-card { padding: 0; background: white; border: 1px solid #e7eaf4; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px #1826530b; text-align: left; }
.equipment-card:hover { border-color: #8798d7; }
.equipment-card-art { display: grid; place-items: center; position: relative; min-height: 100px; background: linear-gradient(136deg, #edf0fa, #e2e7f4); color: #334ba5; }
.equipment-card-art > span { position: absolute; top: 9px; left: 11px; color: #4d5773; font-size: 10px; }
.equipment-card-info { display: grid; gap: 6px; padding: 13px; min-height: 103px; }
.equipment-card-info strong { font-size: 13px; font-weight: 550; }
.equipment-card-info .muted, .equipment-card-info > span { font-size: 11px; }
.equipment-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.equipment-tags > span, .equipment-unit-status { padding: 2px 6px; border-radius: 3px; background: #ebf4fe; color: #354586; font-size: 10px; }
.equipment-tags > span:nth-child(2) { background: #fff3d7; color: #77530b; }
.core-tabs { padding: 0; }
.core-panel { padding: 17px 0; }
.core-panel h2, .schedule-heading { font-size: 16px; font-weight: 550; }
.core-list-scroll, .schedule-scroll { overflow: auto; }
.schedule-scroll { max-height: 56vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.schedule-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: calc(160px + var(--calendar-days) * 82px); font-size: 11px; text-align: left; }
.schedule-table th, .schedule-table td { padding: 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.schedule-table th { font-weight: 500; }
.schedule-table thead th { position: sticky; top: 0; z-index: 1; background: #f1f3f9; }
.schedule-table tbody th { width: 160px; min-width: 155px; background: #fafafd; }
.schedule-table th small { display: block; margin-top: 2px; color: var(--muted); }
.schedule-table td { height: 39px; }
.schedule-slot, .schedule-booking { border: 0; border-radius: 3px; padding: 3px 6px; display: block; width: 100%; font-size: 10px; }
.schedule-slot { background: transparent; color: #384675; }
.schedule-slot:hover, .schedule-slot:focus-visible { background: #edf1ff; }
.schedule-booking { color: #243986; background: #dce5ff; margin-bottom: 3px; text-align: left; overflow-wrap: anywhere; }
.report-list { padding: 18px 6px; }
.report-list h1 { font-weight: 550; }
.reports-workspace { min-height: calc(100dvh - var(--header-height)); background: white; }
.report-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; background: #f8f8fb; min-height: 57px; padding: 10px 22px; }
.report-toolbar > button { justify-self: start; text-align: left; overflow-wrap: anywhere; }
.report-toolbar .table-actions { justify-self: end; }
.report-steps { list-style: none; display: flex; align-items: center; gap: 27px; padding: 0; margin: 0; }
.report-steps li { position: relative; display: grid; place-items: center; border-radius: 50%; width: 19px; height: 19px; color: #434a66; background: #e7eaf3; font-size: 10px; }
.report-steps li.done { background: #1f8be5; color: white; }
.report-steps li + li::before { content: ''; position: absolute; width: 20px; height: 1px; top: 50%; right: calc(100% + 3px); background: #d7dcec; }
.report-steps li.done + li.done::before { background: #1f8be5; }
.report-selection, .report-customize { padding: 18px 22px; }
.report-selection > p { margin: 0 0 20px; }
.report-picker { display: grid; grid-template-columns: minmax(155px, 30%) minmax(0, 1fr); min-height: 56vh; border: 1px solid var(--line); border-radius: 5px; }
.report-picker nav { border-right: 1px solid var(--line); }
.report-picker nav strong { display: block; padding: 10px; font-weight: 550; }
.report-picker nav button { display: flex; align-items: center; gap: 7px; text-align: left; border: 0; border-bottom: 1px solid var(--line); width: 100%; padding: 9px 10px; background: white; }
.report-picker nav button[aria-pressed=true] { background: #e3effb; }
.report-picker svg { width: 12px; height: 12px; flex-shrink: 0; }
.report-source-table { overflow: auto; }
.report-source-table input[type=checkbox] { width: auto; }
.report-customize { width: min(670px, 100%); margin-inline: auto; }
.report-customize h1 { font-size: 19px; font-weight: 550; }
.report-customize ol { list-style: none; padding: 0; }
.report-customize li { padding: 7px 0; display: flex; align-items: end; gap: 7px; }
.report-customize label { flex: 1; display: grid; gap: 5px; }
.report-label { color: var(--muted); }
.report-preview > h1 { text-align: center; font-size: 13px; font-weight: 550; margin: 0; padding: 18px; }
.report-pages { width: min(96%, 700px); padding: 5px clamp(8px, 2vw, 27px); margin-inline: auto; background: #2b2c30; max-height: 68vh; overflow: auto; }
.report-page { padding: clamp(14px, 4vw, 48px); background: white; margin-bottom: 7px; min-height: 300px; overflow-wrap: anywhere; }
.report-page h1 { margin: 0 0 15px; font-size: 19px; font-weight: 550; }
.report-cover h2 { font-size: 13px; border-bottom: 1px solid var(--line); padding-top: 20px; }
.report-cover ol { padding: 0 18px; line-height: 1.9; }
@media (max-width: 640px) {
  .core-shell, .report-picker { grid-template-columns: minmax(0, 1fr); }
  .core-main { padding: 17px; }
  .core-shell .inventory-nav { display: flex; flex-wrap: wrap; padding: 7px; }
  .core-shell .inventory-nav h1 { display: none; }
  .core-shell .inventory-nav button { width: auto; gap: 5px; }
  .report-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 10px; }
  .report-toolbar .report-steps { grid-column: 2; }
  .report-toolbar .table-actions { grid-column: 1 / -1; }
}
@media print {
  body:has(.report-preview) > :not(main), body:has(.report-preview) :is(.report-toolbar, .report-preview > h1) { display: none !important; }
  body:has(.report-preview) main { margin: 0; }
  .report-pages { overflow: visible; max-height: none; width: 100%; padding: 0; background: white; }
  .report-page { margin: 0; padding: 12px; }
  .report-page + .report-page { break-before: page; }
}

.bookmarked-boxes { margin-bottom: 20px; }
.bookmarked-boxes h2 { margin: 0 0 8px; font-size: 13px; }
.bookmarked-boxes button { margin: 0 6px 6px 0; }
.bookmarked-boxes svg { width: 12px; height: 12px; }
#bookmark-box[aria-pressed=true] svg { fill: #a2b4ee; color: #213889; }
.search-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.restore-choice { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }

.notebook-library-button { text-align: left; background: #eef0fb; color: #253987; border: 0; border-radius: 4px; padding: 6px 8px; }
.notebook-library-button svg { width: 12px; height: 12px; margin-right: 4px; }
.notebook-library-button[aria-pressed=true] { background: #dce5ff; }
.protocol-library { padding: clamp(18px, 4vw, 48px); }
.protocol-library h1 { margin: 7px 0; font-size: 22px; font-weight: 550; }
.protocol-library h2 { font-size: 14px; font-weight: 550; }
.protocol-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .45fr); gap: 18px; }
.protocol-text { white-space: pre-wrap; line-height: 1.65; padding: 12px; border: 1px solid var(--line); border-radius: 4px; overflow-wrap: anywhere; }
.protocol-list { margin-top: 13px; }
@media (max-width: 550px) { .protocol-columns { grid-template-columns: 1fr; } }
dialog.document-comparison { width: min(900px, calc(100% - 32px)); }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.comparison-grid section { border: 1px solid var(--line); padding: 8px 12px; }
@media (max-width: 550px) { .comparison-grid { grid-template-columns: 1fr; } }

.item-type-list { list-style: none; padding: 0; }
.item-type-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.item-type-field { margin: 10px 0; border: 1px solid var(--line); border-radius: 4px; }
.item-type-field .table-actions > label { flex: 1; }
.notebook-save-state { max-width: 145px; font-size: 10px; }
.report-review-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px 12px; margin: 0 16px 15px; font-size: 11px; }
.report-review-status > div { border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; }
@media print { .report-review-status { display: none; } }
#follow-inventory[aria-pressed=true], #follow-notebook[aria-pressed=true] { color: #1a429a; background: #dce6ff; border-radius: 4px; }

body:is([data-layout=loading], [data-layout=auth]) > :is(.rail, header) { display: none; }
body:is([data-layout=loading], [data-layout=auth]) #view { margin: 0; padding: 0; }
/* ---------- Sign-in and setup ---------- */
.auth-page {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: #f6f7fb; font-size: 14px;
}
.auth-showcase {
  display: flex; flex-direction: column; gap: 28px; padding: clamp(30px, 4.4vw, 72px); color: white;
  background: linear-gradient(180deg, rgb(9 20 37 / .62), transparent 30%, rgb(4 17 33 / .60) 59%, #071726 98%),
    #0a1d2e url("assets/photos/lab-cover.webp") 52% center / cover no-repeat;
}
.auth-showcase .auth-pitch { margin-top: auto; padding-top: clamp(120px, 29vh, 360px); }
.auth-brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.auth-brand-compact { display: none; color: #10175a; font-size: 14px; margin-bottom: 28px; }
.auth-showcase .auth-pitch h2 { margin: 0 0 16px; max-width: 560px; font-size: clamp(32px, 3.6vw, 58px); line-height: 1.06; font-weight: 620; letter-spacing: -.04em; text-wrap: balance; }
.auth-showcase .auth-pitch p { margin: 0; max-width: 450px; color: #e3edf4; font-size: 15px; line-height: 1.55; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #e0ebf1; font-size: 13px; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points li::before {
  content: ''; flex: 0 0 16px; height: 16px; border-radius: 50%;
  background: #12d6ae url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.9' fill='none' stroke='%230b1660' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 40px 24px; }
.auth-card { width: min(100%, 400px); }
.auth-eyebrow { display: inline-block; margin-bottom: 12px; padding: 4px 9px; border-radius: 99px; background: #e8edff; color: #2a3fc2; font-size: 11.5px; font-weight: 600; }
.auth-card h1 { margin: 0 0 8px; font-size: 28px; font-weight: 680; letter-spacing: -.025em; line-height: 1.15; color: #10153f; }
.auth-lede { margin: 0 0 28px; color: #5b6080; font-size: 14.5px; line-height: 1.5; }
.auth-card form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 7px; }
.auth-card label { font-size: 13px; font-weight: 600; color: #22284f; }
.auth-card input {
  min-height: 44px; padding: 10px 13px; font-size: 14.5px; border: 1px solid #cfd4e6; border-radius: 9px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input::placeholder { color: #a1a6bf; }
.auth-card input:hover { border-color: #aeb5d2; }
.auth-card input:focus { outline: none; border-color: #3a55e8; box-shadow: 0 0 0 4px #3a55e824; }
.auth-card small { color: #6b7091; font-size: 12.5px; }
.auth-card .primary {
  min-height: 46px; margin-top: 4px; border-radius: 9px; font-size: 14.5px; font-weight: 600;
  background: linear-gradient(180deg, #4462f2, #2f48d8); box-shadow: 0 1px 0 #ffffff33 inset, 0 6px 16px #2f48d838;
  transition: transform .1s, box-shadow .15s;
}
.auth-card .primary:hover { box-shadow: 0 1px 0 #ffffff33 inset, 0 10px 24px #2f48d84d; }
.auth-card .primary:active { transform: translateY(1px); }
.auth-password { position: relative; }
.auth-password input { width: 100%; padding-right: 64px; }
.auth-password button {
  position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; border-radius: 6px;
  background: transparent; padding-inline: 10px; color: #3a55e8; font-size: 13px; font-weight: 600;
}
.auth-password button:hover { background: #eef1ff; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff1f0; color: #9b2c24; border: 1px solid #fcd5d1; font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; color: #9398b3; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e5f0; }
.auth-demo {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 9px;
  border: 1px solid #d3d8ea; background: #fff; color: #1d2459; font-weight: 600; text-decoration: none; transition: border-color .15s, background .15s;
}
.auth-demo:hover { border-color: #a9b2d8; background: #fafbff; }
.auth-demo span { transition: transform .15s; }
.auth-demo:hover span { transform: translateX(3px); }
.auth-footer { margin: 0; color: #81869f; font-size: 12.5px; text-align: center; }
.auth-waiting { display: grid; gap: 14px; }
.auth-single { grid-template-columns: 1fr; }
.auth-single .auth-brand-compact { display: flex; }
.auth-steps { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid #e2e5f0; border-radius: 10px; background: #fff; }
.auth-steps span { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e8edff; color: #2a3fc2; font-weight: 700; font-size: 12px; }
.auth-steps p { margin: 2px 0 0; color: #3b4064; line-height: 1.5; font-size: 13.5px; }
.auth-steps code { padding: 1px 6px; border-radius: 5px; background: #f0f2f9; font-size: 12.5px; }
@media (max-width: 920px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-brand-compact { display: flex; }
  .auth-main { justify-content: flex-start; padding-top: clamp(24px, 6vh, 64px); }
  .auth-card .auth-brand-compact {
    min-height: 84px; padding: 18px; margin: 0 0 25px; border-radius: 12px; color: white;
    background: linear-gradient(90deg, #0a2035 0%, rgb(10 32 53 / .79) 36%, transparent 100%),
      #0a2035 url("assets/photos/lab-cover.webp") 52% 46% / cover;
  }
}

/* ---------- Brand, rail, and account ---------- */
.rail { background: linear-gradient(180deg, #0b1764, #081250); }
.rail .workspace { background: none; border: 0; padding: 0; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; }
.rail .workspace:hover { background: none; filter: brightness(1.08); }
.rail .workspace .brand-mark { display: block; box-shadow: 0 4px 12px #00000040; border-radius: 8px; }
.rail .account b { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: linear-gradient(135deg, #7ff0d8, #3fc6a8); color: #06302a; font-size: 10.5px; letter-spacing: .02em; }
.rail .account.signed-out b { background: #ffffff1f; color: #dfe5ff; }
.rail .account.signed-out b svg { width: 15px; height: 15px; }

/* ---------- Illustrated cards ---------- */
.art { display: block; width: 100%; height: 100%; object-fit: cover; }
.space-card { border: 1px solid #e3e6f1; box-shadow: 0 1px 2px #1a225008; border-radius: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.space-card:hover { transform: translateY(-2px); border-color: #c9d0ea; box-shadow: 0 12px 28px #1a22501a; }
.space-card-art { display: block; aspect-ratio: 400 / 150; overflow: hidden; border-bottom: 1px solid #eceef6; }
.space-card > span:last-child { min-height: 64px; }
.space-card, .equipment-card, .freezer-cards .card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.space-card > span:last-child svg { width: 32px; height: 32px; padding: 7px; }
.equipment-card { border-radius: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.instrument-heading { display: flex; gap: 16px; align-items: center; min-width: 0; }
.instrument-thumbnail { width: clamp(66px, 7vw, 98px); flex: none; aspect-ratio: 8 / 5; overflow: hidden; border-radius: 9px; background: var(--studio-background); }
.equipment-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #1a22501a; border-color: #c9d0ea; }
.equipment-card-art { display: block; min-height: 0; aspect-ratio: 240 / 150; padding: 0; background: var(--studio-background); border-bottom: 1px solid #eceef6; }
.freezer-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 300px)); }
.freezer-cards .card { border-radius: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.freezer-cards .card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #1a22501a; border-color: #c9d0ea; }
.freezer-card-art { display: block; min-height: 0; aspect-ratio: 320 / 150; background: var(--studio-background); border-bottom: 1px solid #eceef6; }
.freezer-cards .card strong { font-size: 13.5px; }

/* ---------- Dashboard ---------- */
.dashboard { max-width: 1240px; margin: 0 auto; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 24px; }
.dashboard-heading h1 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.dashboard-heading p { margin: 0; font-size: 13px; }
.dashboard-heading .table-actions { display: flex; gap: 8px; }
.dashboard-heading .table-actions button { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 8px 14px; font-weight: 550; }
.dashboard-heading .table-actions svg { width: 15px; height: 15px; }
.eyebrow { color: #3a55e8; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile {
  display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px 18px; border-radius: 12px;
  background: #fff; border: 1px solid #e3e6f1; box-shadow: 0 1px 2px #1a225008; transition: border-color .15s, box-shadow .15s;
}
.stat-tile:hover { border-color: #c4cbe8; box-shadow: 0 8px 22px #1a225012; }
.stat-label { color: #5d6283; font-size: 12px; font-weight: 550; }
.stat-tile strong { font-size: 28px; font-weight: 680; letter-spacing: -.02em; color: #10153f; font-variant-numeric: tabular-nums; }
.stat-tile small { display: grid; gap: 7px; width: 100%; color: #6b7091; font-size: 11.5px; }
.stat-tile.warn strong { color: #b5640b; }
.stat-tile.ok strong { color: #138a6c; }
.meter { display: block; width: 100%; height: 6px; border-radius: 99px; background: #eceff8; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4664f0, #6d86ff); }
.meter.small { width: 64px; flex: 0 0 64px; height: 5px; }
.meter.small > span { background: #f2a33a; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { background: #fff; border: 1px solid #e3e6f1; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px #1a225008; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel .text-button { border: 0; background: none; color: #3a55e8; font-weight: 550; padding: 4px 0; }
.panel .text-button:hover { text-decoration: underline; }
.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f1f7; }
.panel-list li:first-child { border-top: 0; }
.panel-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.panel-list strong { font-weight: 550; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-list small { color: #6b7091; font-size: 11.5px; }
.panel-list.compact li { padding: 8px 0; }
.panel-list .stock-dot { margin: 0; flex: 0 0 8px; height: 8px; width: 8px; }
.panel-empty { display: grid; justify-items: center; gap: 4px; padding: 18px 0 8px; margin: 0; color: #6b7091; text-align: center; }
.panel-empty p { margin: 0; }
.pill { flex-shrink: 0; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #eef0f7; color: #4a5075; }
.pill.pending { background: #fff4e0; color: #9a5a08; }
.pill.info { background: #e8edff; color: #2a3fc2; }
.pill.ok { background: #e3f6f0; color: #137a60; }
.timeline-dot { flex: 0 0 8px; height: 8px; border-radius: 50%; background: #4664f0; box-shadow: 0 0 0 3px #e8edff; }
.equipment-summary { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 10px; border-bottom: 1px solid #f0f1f7; }
.equipment-summary strong { font-size: 22px; font-weight: 680; color: #138a6c; }
.equipment-summary span { color: #5d6283; }
.dashboard-note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff7e8; color: #8a5208; }
.dashboard-note svg { width: 15px; height: 15px; }
@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ---------- Activity and empty states ---------- */
.activity-list { list-style: none; margin: 0; padding: 4px 18px; max-width: 860px; background: #fff; border: 1px solid #e3e6f1; border-radius: 12px; }
.activity-list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid #f0f1f7; }
.activity-list li:first-child { border-top: 0; }
.activity-list li > div { display: grid; gap: 3px; }
.activity-list strong { font-weight: 550; }
.activity-list small { color: #6b7091; }
.empty-state { display: grid; justify-items: center; gap: 6px; max-width: 420px; margin: 8vh auto 0; text-align: center; color: #5d6283; }
.empty-state h2 { margin: 8px 0 0; font-size: 16px; color: #10153f; }
.empty-state p { margin: 0; line-height: 1.5; }
.empty-art { width: 132px; height: auto; }
.panel-empty .empty-art { width: 96px; }
.space-card > .space-card-art { display: block; padding: 0; min-height: 0; gap: 0; }

/* ---------- Item type colors ---------- */
:root {
  --t-cellline: #13a48f; --t-plasmid: #7a5ce0; --t-antibody: #3a6ff0; --t-primer: #e29a1f;
  --t-reagent: #e0577a; --t-sample: #5f6b85; --t-other: #8a90ad;
}
.t-cellline { --tc: var(--t-cellline); } .t-plasmid { --tc: var(--t-plasmid); } .t-antibody { --tc: var(--t-antibody); }
.t-primer { --tc: var(--t-primer); } .t-reagent { --tc: var(--t-reagent); } .t-sample { --tc: var(--t-sample); }
[class*="t-"] { --tc-fallback: var(--t-other); }

/* ---------- Freezer box ---------- */
main:has(.box-layout) { padding: 22px clamp(20px, 3vw, 48px); }
.box-layout { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: clamp(18px, 2vw, 32px); align-items: start; }
.actions { gap: 8px; min-height: 48px; }
.actions .subtle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #e1e4ef; border-radius: 8px; font-size: 12px; font-weight: 500; box-shadow: 0 1px 2px #1a225008; }
.actions .subtle:hover { background: #f6f7fc; border-color: #ccd2e8; text-decoration: none; }
.actions > span { color: #2b3163; font-weight: 600; font-size: 12px; }
.actions button:not(.subtle) { padding: 6px 10px; border-radius: 7px; font-weight: 550; font-size: 12px; }
.actions button:not(.subtle):hover:not(:disabled) { background: #eef1ff; text-decoration: none; }
.grid-scroll { background: #fff; border: 1px solid #e3e6f1; border-radius: 14px; padding: 12px 14px 14px 8px; box-shadow: 0 1px 2px #1a225008; }
.plate { border-collapse: separate; border-spacing: 5px; background: transparent; min-width: calc(24px + var(--columns) * 52px); }
.plate th, .plate td { border: 0; }
.plate th { background: transparent; color: #8a8fac; font-size: 11px; font-weight: 600; height: 18px; }
.plate th:first-child { width: 18px; }
.well {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px;
  aspect-ratio: 1; padding: 7px 7px 6px; border-radius: 10px; font-size: clamp(9px, .68vw, 11.5px); line-height: 1.2;
  background: color-mix(in srgb, var(--tc, var(--t-other)) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--tc, var(--t-other)) 22%, #fff); color: #1d2247;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.well span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 550; overflow-wrap: break-word; hyphens: auto; }
.well-cap { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: var(--tc, var(--t-other)); box-shadow: inset 0 -2px 0 #00000026; }
.well:hover { border-color: color-mix(in srgb, var(--tc, var(--t-other)) 60%, #fff); background: color-mix(in srgb, var(--tc, var(--t-other)) 14%, #fff); }
.well.empty { background: #fafbfe; border: 1.5px dashed #dfe3f0; justify-content: center; align-items: center; }
.well.empty small { color: #b3b8cf; font-size: 10.5px; font-weight: 600; }
.well.empty:hover { border-color: #9aa6db; background: #f3f5ff; }
.well.empty:hover small { color: #5a6bd0; }
.well.expiring::before { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #f2a33a; box-shadow: 0 0 0 2px #fff; }
.well.selected, .well.selected:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3a55e8; border-color: #3a55e8; outline: 0; }
.well.selected::after { display: none; }
.plate-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 4px 0; color: #5d6283; font-size: 11.5px; }
.plate-legend span { display: inline-flex; align-items: center; gap: 7px; }
.plate-legend b { color: #1d2247; font-weight: 650; }
.plate-legend .well-cap { width: 10px; height: 10px; }
.plate-legend .well-cap.empty { background: #fff; border: 1.5px dashed #c3c9de; box-shadow: none; }
.plate-legend .well-cap.expiring-key { background: #f2a33a; }
.details { background: #fff; border: 1px solid #e3e6f1; border-radius: 14px; box-shadow: 0 1px 2px #1a225008; padding: 20px 22px; min-height: 0; }
.panel-heading h1 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.occupancy { padding: 14px 16px; border-radius: 12px; background: #f6f7fc; border: 1px solid #eceef6; }
.occupancy-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; color: #5d6283; font-weight: 550; }
.occupancy-head strong { font-size: 22px; color: #10153f; font-variant-numeric: tabular-nums; }
.occupancy-head small { font-size: 13px; color: #8a8fac; font-weight: 550; }
.meter.stacked { display: flex; height: 8px; background: #e6e9f4; }
.meter.stacked > span { border-radius: 0; background: var(--tc, var(--t-other)); }
.occupancy p { margin: 10px 0 0; color: #5d6283; font-size: 12px; }
.metrics { font-size: 11.5px; color: #4a5075; border-bottom-color: #eceef6; }
.details .metadata dt { color: #6b7091; font-weight: 550; font-size: 11.5px; }
.details .metadata dd { color: #1d2247; font-size: 12.5px; }

/* ---------- Consistency pass ---------- */
.rail button { font-size: 10px; }
header { background: #ffffffe6; backdrop-filter: saturate(1.4) blur(8px); position: sticky; top: 0; z-index: 1; }
#breadcrumbs { font-size: 12px; }
#breadcrumbs > strong { color: #10153f; }
.subtle { border: 1px solid #e1e4ef; border-radius: 8px; padding: 7px 12px; font-size: 12px; font-weight: 500; }
.subtle:hover { border-color: #ccd2e8; background: #f6f7fc; }
.primary { border-radius: 8px; background: #3149d8; font-weight: 550; }
.primary:hover { background: #2a40c4; }
.secondary { border-radius: 8px; }
input[type=search], .inventory-main > input { border-radius: 9px; border-color: #dde1ee; padding: 10px 13px; }
input:not([type=file]):focus, select:focus, textarea:focus { outline: none; border-color: #3a55e8; box-shadow: 0 0 0 3px #3a55e824; }
dialog { border-radius: 14px; box-shadow: 0 24px 64px #10184a40; border-color: #e3e6f1; }
dialog::backdrop { background: #0d14406b; backdrop-filter: blur(2px); }
#notice:not(:empty) { border-radius: 10px; background: #10184a; box-shadow: 0 12px 32px #10184a40; font-weight: 500; }
@media (max-width: 920px) { .box-layout { grid-template-columns: 1fr; } }

/* ---------- Phones: bottom tab bar, compact header and wells ---------- */
@media (max-width: 600px) {
  :root { --rail-width: 0px; }
  .rail {
    inset: auto 0 0 0; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); flex-direction: row; align-items: stretch;
    justify-content: space-around; padding: 4px 4px env(safe-area-inset-bottom); overflow: visible; z-index: 5;
    box-shadow: 0 -8px 24px #0a124a33;
  }
  .rail .workspace, .rail hr { display: none; }
  .rail button, .rail button[data-view] { flex: 1 1 0; min-width: 0; margin: 0; padding: 7px 0 5px; font-size: 9.5px; gap: 4px; border-radius: 10px; }
  .rail .account { margin: 0; }
  .rail .account b { width: 22px; height: 22px; font-size: 9px; }
  header, main { margin-left: 0; }
  main { padding: 16px 16px 84px; }
  main:has(.box-layout) { padding: 12px 12px 84px; }
  #breadcrumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .rail button[data-view=history] { display: none; }
  #breadcrumbs::-webkit-scrollbar { display: none; }
  header { gap: 8px; padding: 0 12px; }
  .well { padding: 5px; border-radius: 8px; gap: 2px; }
  .well span { -webkit-line-clamp: 2; font-size: 9px; }
  .well-cap { width: 9px; height: 9px; }
  .plate { border-spacing: 3px; min-width: calc(18px + var(--columns) * 56px); }
  .grid-scroll { padding: 6px; }
  .dashboard-heading h1 { font-size: 22px; }
  .stat-tile strong { font-size: 24px; }
}

/* ---------- Notebook ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.notebook-sidebar { background: #fafbfd; padding: 14px 12px 10px; gap: 10px; }
.notebook-workspace { font-weight: 650; color: #1d2247; font-size: 12.5px; padding: 2px 6px 4px; }
.notebook-workspace svg { color: #3a55e8; }
.notebook-sidebar > .primary { border-radius: 8px; padding: 9px 12px; font-weight: 600; background: #3149d8; }
.notebook-sidebar input[type=search] { border-radius: 8px; border-color: #e1e4ef; }
.notebook-library-button { border-radius: 8px; padding: 8px 10px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.notebook-tree button, .notebook-trash { border-radius: 7px; min-height: 30px; font-size: 12px; }
.notebook-tree button[data-folder] { font-weight: 600; color: #3b4064; }
.notebook-tree button[aria-current=page] { background: #e8edff; color: #1d2c9e; font-weight: 550; }
.notebook-strip { background: #fafbfd; }
.notebook-strip :is(span, button) { font-size: 12px; padding: 9px 12px; }
.notebook-strip button[aria-current=page] { box-shadow: inset 0 -2px #3a55e8; }
.notebook-tabs { padding-inline: 18px; min-height: 46px; }
.notebook-tabs nav { gap: 20px; }
.notebook-tabs nav button { font-size: 12.5px; padding: 13px 0 11px; color: #5d6283; font-weight: 550; }
.notebook-tabs nav button[aria-pressed=true] { color: #1d2c9e; border-color: #3a55e8; }
.notebook-actions { gap: 10px; }
.notebook-actions .primary { padding: 6px 14px; font-size: 12px; border-radius: 7px; }
.notebook-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #e8edff; color: #2a3fc2; }
.notebook-status.completed { background: #e3f6f0; color: #137a60; }
.notebook-assignee, .notebook-save-state { font-size: 11.5px; }
.notebook-format { gap: 6px; padding: 6px 14px; min-height: 46px; background: #fff; position: sticky; top: 0; z-index: 1; }
.notebook-format select { border: 1px solid transparent; border-radius: 7px; padding: 5px 8px; font-size: 12px; font-weight: 550; background: transparent; }
.notebook-format select:hover { background: #f3f5fb; }
#notebook-style { min-width: 118px; }
.notebook-zoom { margin-left: auto; }
.tool-group { display: flex; align-items: center; gap: 2px; padding-left: 6px; margin-left: 2px; border-left: 1px solid #eceef6; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: #3b4064; font-size: 12px; font-weight: 550; }
.tool svg { width: 16px; height: 16px; }
.tool:hover { background: #f0f2fa; color: #10153f; }
.tool[aria-pressed=true] { background: #e2e8ff; color: #2236c4; }
.tool.labelled { padding: 0 9px; }
.notebook-readonly { color: #6b7091; font-size: 12px; font-weight: 550; }
.notebook-paper-scroll { background: #f6f7fb; max-height: calc(100dvh - 186px); }
.notebook-paper { width: min(calc(100% - 48px), 800px); margin: 28px auto 40px; padding: 56px clamp(28px, 6vw, 72px) 64px; background: #fff; border: 1px solid #e6e8f2; border-radius: 12px; box-shadow: 0 2px 6px #1a225008, 0 18px 40px #1a22500a; font-size: calc(14px * var(--notebook-scale, 1)); line-height: 1.65; color: #1d2247; }
.notebook-paper h1 { font-size: 2em; font-weight: 700; letter-spacing: -.02em; margin-bottom: .9em; }
.notebook-body h2 { font-size: 1.3em; font-weight: 650; letter-spacing: -.01em; margin: 1.6em 0 .4em; }
.notebook-body h3 { font-size: 1.1em; font-weight: 650; }
.notebook-body table { border-radius: 8px; overflow: hidden; font-size: .93em; }
.notebook-body th { background: #f6f7fc; font-weight: 600; color: #3b4064; }
.notebook-body th, .notebook-body td { border-color: #e3e6f1; }
.notebook-body blockquote { border-left: 3px solid #3a55e8; background: #f6f8ff; padding: .5em .9em; border-radius: 0 6px 6px 0; color: #3b4064; }
.notebook-body pre { background: #f4f5fa; border-radius: 8px; padding: .8em 1em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.notebook-body hr { border: 0; border-top: 1px solid #e3e6f1; margin: 1.6em 0; }
.notebook-links { margin-top: 2.2em; padding-top: 1.2em; border-top: 1px solid #eceef6; }
.notebook-links h4 { margin: 0 0 .7em; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a8fac; }
.notebook-material { padding: 6px 10px; border-radius: 99px; background: #eef1ff; color: #2236c4; font-size: 12px; font-weight: 550; }
.notebook-material:hover { background: #e0e6ff; }
.notebook-footer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 18px; border-top: 1px solid #eceef6; color: #6b7091; font-size: 11.5px; background: #fff; }
.notebook-tools { top: 172px; right: 14px; gap: 8px; z-index: 2; }
.notebook-tools .icon-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #fff; border: 1px solid #e3e6f1; box-shadow: 0 2px 6px #1a22500d; }
.notebook-tools .icon-button:hover { border-color: #c4cbe8; }
.notebook-tools svg { width: 16px; height: 16px; }
.notebook-side-panel { inset: 92px 0 0 auto; padding: 18px; border-left-color: #e3e6f1; }
.notebook-comment { padding: 12px 0; }
@media (max-width: 760px) {
  .notebook-paper { width: calc(100% - 20px); margin: 10px auto; padding: 28px 20px 40px; }
  .notebook-format { overflow-x: auto; flex-wrap: nowrap; }
  .notebook-tools { display: none; }
}
.inline-form { display: grid; gap: 6px; margin: 4px 0 18px; }
.inline-form label { margin: 0; font-weight: 600; }
.inline-form-row { display: flex; gap: 8px; }
.list-table { font-size: 12px; background: #fff; border: 1px solid #e3e6f1; border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.list-table th { background: #f8f9fc; color: #5d6283; font-size: 11.5px; font-weight: 600; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tbody tr:hover td { background: #fafbff; }
.list-table .row-button { color: #2a3fc2; font-weight: 550; }
.list-table .row-button:hover { text-decoration: underline; }
.row-actions { text-align: right; }
.repository-table small { display: inline; }

/* ---------- Orders and stock tracker ---------- */
.inventory-main .page-heading { align-items: flex-end; margin-top: 0; }
.inventory-main .page-heading h1 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 4px; }
.inventory-main .page-heading p { margin: 0; }
.inventory-main .page-heading .primary { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 9px 14px; }
.inventory-main .page-heading .primary svg { width: 15px; height: 15px; }
.order-stats { margin-bottom: 18px; }
.stat-tile.selected { border-color: #3a55e8; box-shadow: 0 0 0 3px #3a55e81f; }
.stat-tile.static { cursor: default; }
.stat-tile.static:hover { border-color: #e3e6f1; box-shadow: 0 1px 2px #1a225008; }
.order-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.order-heading input[type=search] { width: min(320px, 100%); }
.segmented { background: #eceef6; padding: 3px; border-radius: 9px; gap: 2px; }
.segmented button { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 550; color: #4a5075; }
.segmented button[aria-pressed=true] { background: #fff; color: #10153f; box-shadow: 0 1px 3px #1a22501a; border-radius: 7px; }
.segmented small { color: #8a8fac; font-weight: 600; margin-left: 2px; }
.order-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.order-tools input[type=search] { width: min(320px, 100%); }
.status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.status.requested { background: #fff4e0; color: #9a5a08; }
.status.approved { background: #f1ebff; color: #5b3cc4; }
.status.ordered { background: #e8edff; color: #2a3fc2; }
.status.received { background: #e3f6f0; color: #137a60; }
.status.cancelled { background: #fde9ec; color: #a3243c; }
.person { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar { width: 26px; height: 26px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.avatar.tone-0 { background: #e0e7ff; color: #2a3fc2; } .avatar.tone-1 { background: #d9f3ec; color: #127560; }
.avatar.tone-2 { background: #fdebd3; color: #94540a; } .avatar.tone-3 { background: #f1e6ff; color: #6233c0; }
.avatar.tone-4 { background: #fde4ea; color: #a3243c; } .avatar.tone-5 { background: #e3eef8; color: #2c5d86; }
.list-table td { vertical-align: middle; }
.list-table td small { margin-top: 2px; }
.row-action { border: 1px solid #d9deef; background: #fff; color: #2a3fc2; border-radius: 7px; padding: 5px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.row-action:hover { border-color: #a9b4e6; background: #f6f8ff; }
.row-action.strong { background: #3149d8; border-color: #3149d8; color: #fff; }
.row-action.strong:hover { background: #2a40c4; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
td.row-actions { display: table-cell; text-align: right; white-space: nowrap; }
td.row-actions > * { vertical-align: middle; margin-left: 4px; }
.pagination { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: #5d6283; font-size: 12px; }
.pill.danger { background: #fde9ec; color: #a3243c; }
.qty-cell { display: flex; align-items: center; gap: 10px; }
.qty-cell b { min-width: 22px; font-variant-numeric: tabular-nums; }
.meter.small.ok > span { background: #19a57f; }
.meter.small.pending > span { background: #f2a33a; }
.meter.small.danger > span { background: #e0465f; }
.meter.small.info > span { background: #4664f0; }
.tracker-table .chevron { min-width: 26px; height: 26px; }
.tracker-table .chevron svg { width: 15px; height: 15px; transition: transform .15s; }
.tracker-table .chevron[aria-expanded=true] svg { transform: rotate(90deg); }
.tracker-table tr.expanded td { background: #fafbff; }
.tracker-table .tracker-records td { background: #f6f7fc; padding: 4px 14px 14px 0; }
.record-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #e3e6f1; border-radius: 10px; overflow: hidden; font-size: 12px; }
.record-table th { text-align: left; font-size: 11px; color: #6b7091; font-weight: 600; padding: 8px 12px; background: #fafbfd; border-bottom: 1px solid #eceef6; }
.record-table td { padding: 8px 12px; border-bottom: 1px solid #f0f1f7; }
.record-table tr:last-child td { border-bottom: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #e1e4ef; border-radius: 8px; padding: 2px; background: #fff; }
.stepper .tool { min-width: 26px; height: 26px; font-size: 15px; }
.stepper span { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.warn-text { color: #9a5a08; font-weight: 600; }
.empty-state .primary { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.tracker-table .record-table th, .tracker-table .record-table td { padding: 8px 12px; }
.inventory-main > input[type=search] + .page-heading { margin-top: 22px; }

/* ---------- Tooltips and status dots ---------- */
#tooltip {
  position: fixed; z-index: 50; max-width: 260px; display: grid; gap: 2px; padding: 8px 11px; border-radius: 9px;
  background: #10153f; color: #dfe4ff; font-size: 12px; line-height: 1.4; pointer-events: none;
  box-shadow: 0 10px 28px #0a103a40; animation: tip-in .12s ease-out;
}
#tooltip strong { color: #fff; font-weight: 650; }
#tooltip span { color: #c3cbf2; }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } }
.well-flag { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; cursor: help; }
.well-flag::after { content: ''; position: absolute; inset: -6px; }
.well-flag.soon { background: #f2a33a; }
.well-flag.expired { background: #e0465f; }
.well.expiring::before { display: none; }
.plate-legend span[data-tip] { cursor: help; }
.plate-legend .well-cap.expired-key { background: #e0465f; }
.stock-dot[data-tip] { cursor: help; }
:root[data-theme="dark"] .well-flag { box-shadow: 0 0 0 2px #171a2c; }
#tooltip { border: 1px solid #ffffff1f; }

/* Supabase sign-in: mode links, notices, and the account dialog's members and invite links. */
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-link { border: 0; background: none; padding: 0; color: #3a55e8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-switch { margin: 18px 0 0; color: #5b6080; font-size: 13.5px; text-align: center; line-height: 1.6; }
.auth-switch .auth-link { font-size: 13.5px; }
.auth-notice { margin: 0; padding: 10px 12px; border-radius: 8px; background: #eef7f1; color: #1e6b3d; border: 1px solid #cbe8d5; font-size: 13px; line-height: 1.45; }
.account-who { margin: -4px 0 18px; line-height: 1.5; }
.member-list div > span:first-child { display: grid; gap: 1px; min-width: 0; }
.member-list small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.member-actions { display: flex; align-items: center; gap: 8px; }
.member-actions select { padding: 4px 6px; }
.inline-form .muted { margin: 0; font-size: 12.5px; }
.inline-form-row select { flex: 1; min-width: 0; }
.invite-list { display: grid; gap: 8px; margin: -8px 0 18px; }
.invite-row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.invite-row.fresh { border-color: #3a55e8; box-shadow: 0 0 0 3px #3a55e81f; }
.invite-meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.invite-row input { min-width: 0; font-size: 12.5px; }
.danger-text { color: #b42318; margin-right: auto; }
#dialog h3 { margin: 18px 0 8px; }
#dialog .member-list { margin-bottom: 20px; }
#dialog .table-actions + .inline-form, #dialog .invite-list + h3 { margin-top: 20px; }
.equipment-cards > .empty-state { grid-column: 1 / -1; }
.auth-hint { margin: 0; color: #5b6080; font-size: 13.5px; line-height: 1.5; }
.auth-lede strong { color: #10153f; font-weight: 650; overflow-wrap: anywhere; }

/* ==========================================================================
   Layout system: one set of page margins, section navs, and headings for every screen.
   ========================================================================== */
:root { --page-x: clamp(20px, 3.4vw, 52px); --page-top: clamp(24px, 3vw, 40px); --page-bottom: 56px; --section-nav: clamp(200px, 17vw, 252px); }
@media (min-width: 901px) {
  main { padding: var(--page-top) var(--page-x) var(--page-bottom); }
  main:has(.box-layout) { padding: calc(var(--page-top) - 8px) var(--page-x) var(--page-bottom); }
  main:has(.inventory-layout), main:has(.core-shell, .reports-workspace), main:has(.notebook-layout), main:has(.tracker-form) { padding: 0; }
  .inventory-layout, .core-shell { grid-template-columns: var(--section-nav) minmax(0, 1fr); }
  .inventory-main, .inventory-main:has(.space-cards), .inventory-main:has(.freezer-cards), .core-main {
    padding: var(--page-top) var(--page-x) var(--page-bottom); padding-inline: var(--page-x);
  }
  .inventory-nav, .core-shell .inventory-nav { padding: var(--page-top) 14px; }
  .inventory-nav h1 { margin: 0 10px 18px; font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
  .inventory-nav button { border-radius: 8px; padding: 9px 12px; margin-bottom: 2px; }
  .report-list { padding: 0; }
  .reports-workspace > .report-list, .reports-workspace .report-list { padding: var(--page-top) var(--page-x) var(--page-bottom); }
}
.dashboard { margin: 0; max-width: 1280px; }

/* Page headings share one size and rhythm. */
.page-heading, .inventory-main .page-heading, .core-heading { align-items: flex-end; gap: 16px; margin: 0 0 24px; flex-wrap: wrap; }
.page-heading h1, .inventory-main .page-heading h1, .core-heading h1, .report-list h1, .history-page h1 {
  margin: 0; font-size: 26px; font-weight: 680; letter-spacing: -.022em; line-height: 1.2;
}
.page-heading p, .page-heading .muted, .core-heading .muted { display: block; margin: 5px 0 0; font-size: 13.5px; color: #5d6283; }
.page-heading .table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-search { display: block; width: min(100%, 440px); margin: -6px 0 22px; }
.inventory-main > input[type=search] + .page-heading { margin-top: 0; }

/* Buttons in toolbars line up at one height. */
.page-heading .table-actions :is(button, select), .core-filters :is(input, select) { min-height: 36px; }
.page-heading .table-actions .subtle { border: 1px solid #dfe2ee; background: #fff; border-radius: 8px; padding: 7px 13px; font-weight: 550; }
.page-heading .table-actions .subtle:hover { border-color: #b7bdd8; background: #fafbff; text-decoration: none; }

/* Section tabs inside detail panels, drawers, and instrument pages. */
.item-tabs { gap: 22px; padding: 0 2px; }
.item-tabs button, .core-tabs button { font-size: 13.5px; font-weight: 550; color: #5d6283; padding: 10px 0 9px; border-bottom-width: 2px; }
.item-tabs button:hover { color: #10153f; text-decoration: none; }
.item-tabs button[aria-pressed=true], .item-tabs button[aria-current=page] { color: #2f48d8; border-bottom-color: #3a55e8; }

/* Freezer, shelf, and rack panels. */
@media (min-width: 901px) { .storage-layout { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.15fr); gap: clamp(16px, 2vw, 28px); } }
.storage-panel { border-color: #e3e6f1; border-radius: 14px; box-shadow: 0 1px 2px #10153f0a; }
.storage-heading { min-height: 56px; padding: 10px 14px 10px 18px; gap: 8px; background: #fbfbfe; }
.storage-heading svg { width: 17px; height: 17px; color: #3a55e8; flex-shrink: 0; }
.storage-heading strong { display: grid; gap: 1px; margin-right: auto; font-weight: 650; font-size: 14.5px; min-width: 0; }
.storage-heading strong small { font-weight: 450; font-size: 12px; color: #6b7091; }
.storage-heading button, .shelf-heading .subtle { margin-left: 0; }
.storage-heading .subtle, .shelf-heading .subtle { border: 1px solid #dfe2ee; background: #fff; border-radius: 8px; padding: 6px 11px; font-weight: 550; font-size: 13px; }
.shelves { padding: 4px 18px 18px; }
.shelf-section { margin: 16px 0 22px; }
.shelf-section + .shelf-section { padding-top: 18px; border-top: 1px solid #eef0f6; margin-top: 0; }
.shelf-heading { gap: 6px; margin-bottom: 12px; }
.shelf-heading > button:first-child { margin-right: auto; font-weight: 650; font-size: 14px; padding: 0; }
.rack-cards { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.rack-card { aspect-ratio: auto; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 12px; border-radius: 10px; background: #fff; border-color: #e3e6f1; text-align: left; font-size: 12px; }
.rack-card strong { font-size: 13.5px; font-weight: 650; color: #10153f; }
.rack-card small { color: #6b7091; font-size: 12px; }
.rack-card .rack-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; width: 100%; height: auto; background: none; border-radius: 0; margin-bottom: 10px; }
.rack-card .rack-slots i { height: 18px; border-radius: 3px; background: #eef0f7; border: 1px solid #e3e6f1; }
.rack-card .rack-slots i.filled { background: #dfe5ff; border-color: #b9c5fb; }
.rack-card:hover { border-color: #a9b4e8; box-shadow: 0 4px 14px #10153f12; }
.rack-card.current { border-color: #3a55e8; box-shadow: 0 0 0 3px #3a55e81f; }
.shelf-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.box-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 18px; }
.box-cards button { display: grid; gap: 4px; min-height: 0; padding: 14px; border-radius: 10px; border: 1px solid #e3e6f1; box-shadow: none; text-align: left; font-size: 12px; }
.box-cards button strong { font-size: 13.5px; font-weight: 650; color: #10153f; line-height: 1.3; }
.box-cards button small { color: #6b7091; font-size: 12px; }
.box-cards button:hover { border-color: #a9b4e8; box-shadow: 0 4px 14px #10153f12; }
.box-fill { display: block; height: 5px; margin-top: 6px; border-radius: 99px; background: #eef0f7; overflow: hidden; }
.box-fill i { display: block; height: 100%; border-radius: inherit; background: #3a55e8; }
.box-cards > p { grid-column: 1 / -1; margin: 8px 0; }
.storage-hint { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 220px; padding: 32px; border: 1.5px dashed #d6dbec; border-radius: 14px; color: #6b7091; text-align: center; font-size: 13px; }
.storage-hint svg { width: 22px; height: 22px; color: #8a93c4; }
.storage-hint strong { color: #22284f; font-size: 14px; }

/* Box view: breathing room under the legend and a balanced title. */
.plate-legend { margin-top: 14px; padding-bottom: 4px; }
.panel-heading h1 { text-wrap: balance; line-height: 1.25; }

/* Space map: units keep clear of the map edge. */
.space-map { margin: 14px; height: calc(min(66vh, 620px) - 28px); }

/* Dialogs: comfortable padding and two-column rows for short fields. */
dialog { padding: 26px 28px 24px; border-radius: 14px; border-color: #e3e6f1; box-shadow: 0 24px 60px #10153f33; }
dialog h2 { font-size: 19px; letter-spacing: -.015em; margin-bottom: 18px; }
dialog label { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: #22284f; }
dialog form > p.muted, dialog > p { margin: 0 0 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.dialog-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef0f6; }
dialog :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) { min-height: 38px; border-radius: 8px; }

/* Tables with no rows. */
.table-empty { margin: 0; padding: 28px 16px; text-align: center; color: #6b7091; font-size: 13.5px; background: #fff; border: 1px solid #e3e6f1; border-top: 0; border-radius: 0 0 12px 12px; }

/* Notifications panel. */
.alert-heading { padding-bottom: 12px; border-bottom: 1px solid #eef0f6; }
.alert-heading strong span { color: #3a55e8; }
#notification-settings svg { width: 16px; height: 16px; }
.inventory-main > .page-search { width: min(100%, 440px); padding: 9px 13px; }
.core-filters input[type=search] { padding: 9px 13px; }
.equipment-card-info > span { text-wrap: pretty; }
.map-unit { font-size: 12px; font-weight: 550; display: grid; place-items: center; text-align: center; padding: 4px; border-radius: 6px; }
.directory-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 16px; border-radius: 10px; background: #f1f3fa; color: #4a5072; font-size: 13px; }
.directory-stats b { color: #10153f; font-weight: 680; margin-right: 3px; }
/* Stacked layouts: the section nav keeps its natural height when the page content is short. */
@media (max-width: 900px) {
  .inventory-layout, .core-shell { grid-template-rows: auto 1fr; align-content: start; }
  .inventory-nav { align-content: flex-start; align-self: start; }
}

/* Left rail: wide enough for every label, with even padding and a highlight that wraps the whole item. */
@media (min-width: 601px) {
  :root { --rail-width: 88px; }
  .rail { padding: 14px 10px 12px; gap: 0; }
  .rail .workspace { margin-bottom: 4px; }
  .rail hr { width: 100%; margin: 12px 0 10px; border-top-color: #ffffff26; }
  .rail button, .rail button[data-view] {
    width: 100%; margin: 0 0 4px; padding: 10px 4px 9px; gap: 6px; border-radius: 10px;
    font-size: 10.5px; font-weight: 500; line-height: 1.1; white-space: nowrap; letter-spacing: .005em; color: #b9c3ee;
  }
  .rail button > span svg { width: 19px; height: 19px; }
  .rail button:hover { background: #ffffff14; color: #fff; }
  .rail button.active { background: #ffffff24; color: #fff; box-shadow: inset 0 0 0 1px #ffffff14; }
  .rail .account { margin: auto 0 0; padding: 10px 4px 8px; white-space: normal; overflow-wrap: anywhere; }
  .rail .account span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Section nav: a filled highlight instead of an edge bar that bent around the rounded corner. */
.inventory-nav button, .inventory-nav button[aria-current=page] { box-shadow: none; }
.inventory-nav button:hover { background: #f4f5fa; color: #10153f; }
.inventory-nav button[aria-current=page] { background: #eef1ff; color: #2a3fc2; font-weight: 600; }
.inventory-nav button[aria-current=page] svg { color: #3a55e8; }

/* Detail panels: a small kicker line with actions, then the full-width title. */
.panel-heading.stacked { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.panel-heading.stacked h1 { grid-column: 1 / -1; display: block; margin: 0 0 16px; font-size: 21px; font-weight: 680; letter-spacing: -.018em; line-height: 1.25; text-wrap: balance; }
.panel-kicker { display: flex; align-items: center; gap: 7px; min-width: 0; color: #5d6283; font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-kicker svg { width: 15px; height: 15px; color: #3a55e8; flex-shrink: 0; }
.panel-heading.stacked .table-actions { gap: 2px; }
.panel-heading.stacked .icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; padding: 0; }
.panel-heading.stacked .icon-button:hover { background: #f1f3fa; text-decoration: none; }
.panel-heading.stacked .icon-button[data-action=export-box-excel] { width: auto; padding: 0 8px; font-size: 11.5px; font-weight: 650; color: #3b4064; }
.item-panel > .panel-heading { padding: 0; }
.item-panel .item-content { padding: 16px 0 0; }
.item-panel .item-tabs { padding: 0; }

/* Box toolbar: selection actions are real buttons, matching the box actions. */
.grid-side .actions { gap: 8px; }
.grid-side .actions button:not(.subtle) {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #e1e4ef; border-radius: 8px; background: #fff;
  color: #22284f; font-size: 12px; font-weight: 550; box-shadow: 0 1px 2px #1a225008;
}
.grid-side .actions button:not(.subtle):hover:not(:disabled) { background: #f6f7fc; border-color: #ccd2e8; text-decoration: none; }
.grid-side .actions button:disabled { opacity: .45; cursor: default; box-shadow: none; }
.grid-side .actions button.primary-action { background: #3a55e8; border-color: #3a55e8; color: #fff; }
.grid-side .actions button.primary-action:hover:not(:disabled) { background: #2f48d8; border-color: #2f48d8; }
.grid-side .actions button.clear-selection { margin-left: auto; border-color: transparent; box-shadow: none; color: #5d6283; }
.selection-count { display: inline-flex; align-items: center; height: 32px; padding: 0 11px; border-radius: 8px; background: #eef1ff; color: #2a3fc2; font-size: 12px; font-weight: 650; }
.box-layout > .details { margin-top: 8px; }

/* Position labels wrap at word and hyphen boundaries, never mid-word. */
.well span { hyphens: manual; overflow-wrap: break-word; -webkit-line-clamp: 2; }

/* Sign-in footer lines up with the form. */
.auth-footer { max-width: 400px; text-wrap: balance; }

/* Inventory search boxes match the height of the buttons beside them. */
.inventory-main > input.page-search, .order-tools input[type=search] { padding: 9px 13px; border-radius: 9px; border-color: #dde1ee; min-height: 38px; }

/* Storage unit: category cards with a tinted icon. */
.category-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.category-card { gap: 4px; padding: 16px; border-radius: 12px; border-color: #e3e6f1; }
.category-card:hover { border-color: #a9b4e8; box-shadow: 0 4px 14px #10153f12; }
.category-card strong { font-size: 14px; font-weight: 650; color: #10153f; margin-top: 8px; }
.category-card small { font-size: 12.5px; color: #6b7091; }
.card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #eef1ff; color: #3a55e8; }
.card-icon svg { width: 17px; height: 17px; }
.category-list > .cards > p { grid-column: 1 / -1; margin: 6px 0; }

/* Category view: the table and panel size to their content. */
.category-layout > .details, .table-frame { min-height: 0; }
.table-frame { border-color: #e3e6f1; border-radius: 12px; background: #fff; }
.category-layout { align-items: start; }

/* Order drawer. */
.order-detail { width: min(420px, 94vw); padding: 22px 24px; background: #fff; box-shadow: -18px 0 48px #10153f2e; border-left: 1px solid #e3e6f1; }
.order-detail .panel-heading.stacked h1 { font-size: 20px; margin-bottom: 14px; }
.order-detail-status { justify-content: space-between; margin: 0 0 20px; padding: 12px 0; border-block: 1px solid #eef0f6; }
.order-detail-actions { display: flex; gap: 8px; }
.order-detail .item-tabs { flex-wrap: nowrap; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.order-detail .item-tabs button { white-space: nowrap; }
.order-detail .metadata > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.order-detail > p { margin: 0 0 12px; font-size: 13px; }
#close-order svg { width: 16px; height: 16px; }
.order-detail .metadata { display: block; }

/* Notebook: one active item at a time, sections aligned with the page, side panels beside the page instead of over it. */
.notebook-library-button { background: transparent; color: #22284f; }
.notebook-library-button:hover { background: #f1f3fa; }
.notebook-library-button[aria-pressed=true] { background: #eef1ff; color: #2a3fc2; }
.notebook-library-button svg { color: #3a55e8; }
.notebook-section, .notebook-empty:not(.empty-state) { max-width: 800px; margin: 0 auto; padding: 36px 24px 48px; box-sizing: content-box; }
.notebook-section .inline-heading { margin-bottom: 18px; }
.notebook-section .inline-heading h2 { font-size: 20px; font-weight: 680; letter-spacing: -.015em; }
.notebook-section .metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; max-width: none; }
.notebook-section .metadata > div { margin: 0; }
.notebook-section .metadata dt { color: #6b7091; font-size: 12px; font-weight: 550; margin-bottom: 4px; }
.notebook-section .metadata dd { margin: 0; color: #1d2247; font-size: 14px; }
.notebook-section .inline-heading:not(:first-child) { margin-top: 32px; padding-top: 24px; border-top: 1px solid #eef0f6; }
.notebook-main:has(.notebook-side-panel) .notebook-paper-scroll { padding-right: min(320px, 40%); }
.notebook-side-panel { width: min(320px, 40%); box-shadow: none; }
.notebook-side-panel h2 { font-size: 15px; }
.protocol-library { padding: var(--page-top, 36px) var(--page-x, 40px) 48px; }
.protocol-library h1 { margin: 0; font-size: 26px; font-weight: 680; letter-spacing: -.022em; }
.protocol-library .inline-heading { margin-bottom: 20px; }
.protocol-list .result { padding: 14px 16px; margin: 0 0 8px; border-radius: 10px; border-color: #e3e6f1; font-weight: 600; color: #10153f; }
.protocol-list .result small { font-weight: 450; color: #6b7091; font-size: 12.5px; }

/* Metadata lists read at body size everywhere. */
.metadata dt { color: #6b7091; font-size: 12px; font-weight: 550; }
.metadata dd { color: #1d2247; font-size: 13.5px; }
.core-main .metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.core-main .metadata > div { margin: 0; }
.core-main .metadata dd { margin: 4px 0 0; }
.core-tabs { padding: 0; }

/* Equipment units: status pills and a right-aligned edit action. */
.core-main .list-table td:last-child { text-align: right; }
.core-main .list-table .text-button { border: 1px solid #d9deef; background: #fff; color: #2a3fc2; border-radius: 7px; padding: 5px 11px; font-size: 12px; font-weight: 600; text-decoration: none; }
.core-main .list-table .text-button:hover { border-color: #a9b4e6; background: #f6f8ff; }

/* Schedule rows that can't be booked say why. */
.slot-note { color: #a15c07; font-weight: 550; }
.schedule-blocked td { background: repeating-linear-gradient(135deg, #fafbfd 0 6px, #f4f5f9 6px 12px); }

/* Report builder: labelled steps and the shared page margins. */
.report-toolbar { padding: 12px var(--page-x, 40px); background: #fafbfd; border-bottom: 1px solid #eef0f6; }
.report-steps { gap: 10px; }
.report-steps li { width: auto; height: auto; display: flex; align-items: center; gap: 8px; border-radius: 0; background: none; font-size: 12.5px; font-weight: 550; color: #6b7091; }
.report-steps li b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e7eaf3; color: #434a66; font-size: 11px; }
.report-steps li.done b { background: #3a55e8; color: #fff; }
.report-steps li[aria-current=step] { color: #10153f; }
.report-steps li + li::before { position: static; display: block; width: 28px; height: 1px; background: #d7dcec; }
.report-steps li.done + li.done::before { background: #3a55e8; }
.report-selection, .report-customize { padding: 28px var(--page-x, 40px) 48px; }
.report-picker { min-height: 0; border-color: #e3e6f1; border-radius: 12px; overflow: hidden; background: #fff; }
.report-picker nav button[aria-pressed=true] { background: #eef1ff; color: #2a3fc2; font-weight: 600; }
.report-steps li, .report-steps li.done { background: none; color: #6b7091; }
.report-steps li[aria-current=step], .report-steps li.done[aria-current=step] { color: #10153f; }

/* Choice dialogs: each option is a card with an icon and a one-line explanation. */
.notebook-choice { display: grid; gap: 10px; }
.choice-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; background: #fff; border: 1px solid #e3e6f1; border-radius: 12px; }
.choice-card:hover { border-color: #a9b4e8; background: #fafbff; }
.choice-card strong { display: block; font-size: 14px; color: #10153f; }
.choice-card small { display: block; margin-top: 2px; color: #6b7091; font-size: 12.5px; }

/* Tracker form: a centered card under the page header. */
.tracker-form-heading { padding: 18px var(--page-x, 40px); border-bottom-color: #eef0f6; }
.tracker-form-heading h1 { font-size: 20px; font-weight: 680; letter-spacing: -.015em; }
.tracker-form-fields { width: min(480px, calc(100% - 32px)); margin: 32px auto; padding: 24px 26px 10px; background: #fff; border: 1px solid #e3e6f1; border-radius: 14px; }
.tracker-form-fields > p.muted { margin: 0 0 18px; font-size: 13px; line-height: 1.5; }
.tracker-form-fields label { display: grid; gap: 6px; margin: 0 0 16px; font-size: 13px; font-weight: 600; color: #22284f; }
.tracker-form-fields :is(input, select) { min-height: 38px; border-radius: 8px; }

/* Field values use regular weight; labels stay bold. Labels that sit outside their field get the same spacing. */
dialog label :is(input, select, textarea), .tracker-form-fields label :is(input, select) { font-weight: 400; font-size: 13.5px; color: #10153f; }
dialog label:not(.checkbox):has(+ :is(select, input, textarea)) { margin-bottom: 6px; }
dialog form > :is(select, input:not([type=hidden]), textarea) { width: 100%; margin-bottom: 14px; }
dialog label.checkbox { font-weight: 550; margin-bottom: 10px; }

/* ---------- Phone and tablet fixes ---------- */
html, body { overflow-x: clip; }
.inventory-main, .core-main { min-width: 0; overflow-x: clip; }
.order-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) {
  /* Section tabs: one scrollable row instead of wrapping. */
  .inventory-nav, .core-shell .inventory-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid #eef0f6; }
  .inventory-nav::-webkit-scrollbar { display: none; }
  .inventory-nav button, .core-shell .inventory-nav button { flex: 0 0 auto; width: auto; margin: 0; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
  /* Notebook side panels cover the page instead of squeezing it. */
  .notebook-main:has(.notebook-side-panel) .notebook-paper-scroll { padding-right: 0; }
  .notebook-side-panel { width: 100%; box-shadow: none; }
  /* Report builder header stacks. */
  .report-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 16px; }
  .report-toolbar > button { grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .report-toolbar .report-steps { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .report-toolbar .table-actions { grid-column: 2; grid-row: 1; }
  .report-steps li span { display: none; }
  .report-steps li[aria-current=step] span { display: inline; }
  .report-selection, .report-customize { padding: 20px 16px 40px; }
  /* Storage map labels stay inside their units. */
  .map-unit { font-size: 10.5px; padding: 2px; overflow-wrap: anywhere; line-height: 1.15; }
  .order-detail { width: 100vw; max-width: 100vw; }
}
/* Scroll containers contain their absolutely positioned labels, so nothing widens the page on phones. */
.order-table, .grid-scroll, .schedule-scroll, .table-frame, .inventory-nav { position: relative; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
