@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font: 400 16px/1.5 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #edf2f8;
  background: #141619;
  --surface: #1e2227;
  --line: #353c45;
  --muted: #aeb8c5;
  --accent: #8dccff;
  --user-accent: #a8d7ff;
  --gutter: clamp(1.1rem, 2.9vw, 2.4rem);
  --cell-edge: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 13.75rem minmax(0, 1fr); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: wait; opacity: .68; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .warehouse-name { font-weight: 400; }

.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow: auto;
  padding: 1.45rem .73rem; background: #191c20; border-right: 1px solid #2c323a; }
.brand { display: flex; flex-direction: column; align-items: center; gap: .38rem; font-weight: 700; padding: 0 .7rem; text-align: center; }
.brand-logo { display: block; width: 4rem; height: auto; }
.sidebar nav { display: grid; gap: .22rem; margin-top: 1.55rem; }
.sidebar button {
  display: flex;
  align-items: center;
  gap: .57rem;
  padding: .54rem .7rem;
  border: 0;
  border-radius: .42rem;
  color: #c1cbd8;
  background: transparent;
  font-size: .9rem;
  text-align: left;
}
.sidebar button:hover { background: #272e37; color: #fff; }
.sidebar button[aria-current] { background: #223b53; color: #cae9ff; box-shadow: inset 3px 0 #71baff; }
.nav-icon {
  display: block;
  width: 1.03rem;
  height: 1.03rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar button[aria-current] .nav-icon { color: var(--accent); }
.project-author { display: grid; gap: .22rem; margin-top: auto; padding: 1.15rem .7rem 0; font-size: .875rem; }
.project-author small { color: #8fa2b7; font-size: .72rem; }
.project-author span { color: #d3deec; }
.project-author .panel-version { color: #8dcaba; margin-block-start: 1.05rem; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 3.55rem;
  padding: .8rem var(--gutter);
  background: #1a1d21;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
  color: #f4f7fb;
}
.panel-identity, .panel-session { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.panel-identity svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.user-name { padding-inline-start: .7rem; border-inline-start: 1px solid var(--line); color: var(--user-accent); }
.panel-session .secondary { min-height: 2rem; padding: .25rem .6rem; }
main { padding: 1.85rem var(--gutter) 2.5rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
h1 { font-size: clamp(1.62rem, 3vw, 2rem); line-height: 1.17; letter-spacing: -.018em; }
h2 { font-size: 1.125rem; line-height: 1.35; }
.page-heading p, .panel-heading p, #form-context { margin-top: .43rem; color: var(--muted); }
main[data-section="managers"] { padding-top: 2.35rem; }
main[data-section="managers"] .record-toolbar { margin-top: .65rem; }
main[data-section="managers"] #content { margin-top: .7rem; }

.primary, .secondary { border: 1px solid transparent; border-radius: .55rem; min-height: 2.65rem; padding: .45rem .84rem; }
.primary { background: #66b5ff; border-color: #72bcff; color: #0e2032; }
.primary:hover { background: #8ccbff; }
.secondary { background: #252c34; border-color: #47586a; color: #c1e2fc; }
.secondary:hover { background: #2a3d50; border-color: #6791b7; }
.primary.danger { background: #9e3d4c; border-color: #bc5a69; color: #fff4f6; }
.primary.danger:hover { background: #a74453; }
:is(#add, #add-contact, #add-post, #close-contacts, #preview-notifications) {
  min-height: 2.35rem;
  padding: .33rem .72rem;
  font-size: .9375rem;
}
:is(#add, #add-contact, #add-post) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  background: linear-gradient(180deg, #a4d8ff, #7bbaf2 56%, #67a9e6);
  border-color: #b7e0ff #87bdea #4f8ac0;
  box-shadow: inset 0 1px 0 #fff6, 0 2px 0 #315b83, 0 4px 10px #0005;
}
:is(#add, #add-contact, #add-post):hover:not(:disabled) {
  background: linear-gradient(180deg, #b6e1ff, #91c7f9 56%, #78b6ef);
}
:is(#add, #add-contact, #add-post):active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 #fff5, 0 1px 0 #315b83, 0 2px 4px #0005;
}
:is(#add, #add-contact, #add-post:not(.is-replacement))::before {
  content: "";
  width: .8rem;
  height: .8rem;
  flex: none;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
}

.record-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem 1rem; margin-top: 1.15rem; }
.record-toolbar:has(> [hidden] + [hidden]) { display: none; }
.record-toolbar > .primary { margin-inline-start: auto; margin-inline-end: calc(var(--cell-edge) + 1px); }
main[data-section="warehouses"] { --warehouse-action-inset: calc(2 * var(--cell-edge) + 2px); }
main[data-section="warehouses"] .record-toolbar > .primary { margin-inline-end: var(--warehouse-action-inset); }
.filters { display: flex; flex: 1 1 37rem; align-items: end; flex-wrap: wrap; gap: .75rem 1rem; min-width: 0; }
.list-mode { display: flex; flex-wrap: wrap; gap: 1.15rem; order: 1; }
.list-mode button {
  min-height: 2.4rem;
  padding: .35rem .08rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #aeb9c8;
  font-size: .9rem;
}
.list-mode button:hover { color: #bbdfff; }
.list-mode button[aria-pressed="true"] { border-bottom-color: #6db8ff; color: var(--accent); }
.warehouse-filter { position: relative; width: min(100%, 14rem); }
.history-filters { display: grid; justify-items: start; gap: .72rem; margin-top: 1.15rem; }
.plate-search { appearance: none; }
.passage-paging { display: flex; align-items: center; justify-content: flex-end; gap: .65rem;
  padding: .65rem var(--cell-edge); border-top: 1px solid var(--line); }
.passage-detail { display: block; margin-top: .32rem; padding-inline-start: 1.07rem;
  max-width: 18rem; color: var(--muted); font-size: .82rem; }
#passage-photo { width: min(46rem, calc(100% - 2rem)); }
#passage-photo-image img { display: block; max-width: 100%; max-height: 65vh; margin: .65rem auto 0; border-radius: .42rem; }
#passage-photo-status:not(:empty) { margin-top: .55rem; }
.history-filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem;
  width: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: .55rem; background: #20252b; }
.history-filter { flex: 1 1 8.75rem; min-width: min(100%, 8.75rem); max-width: 12rem; }
.history-filter-row .filter-trigger, .history-filter-row .secondary { min-height: 2.4rem; }
.history-filter-row .secondary { margin-inline-start: auto; }
.history-filter label { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }
.filter-trigger { display: flex; align-items: center; justify-content: space-between; gap: .55rem; width: 100%;
  min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid #4c5866; border-radius: .5rem;
  background: #181b20; color: #edf2f8; text-align: left; }
.filter-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-trigger::after { content: ""; flex: none; width: .45rem; height: .45rem; margin-top: -.15rem;
  border: solid #a9c8e3; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.filter-trigger:is(:hover, [aria-expanded="true"]):not(:disabled) { border-color: #7caed9; background: #223244; }
.filter-trigger[aria-expanded="true"]::after { margin-top: .15rem; transform: rotate(225deg); }
#warehouse-trigger:disabled { cursor: default; }
#warehouse-trigger:disabled::after { display: none; }
.filter-dropdown { position: fixed; inset: auto; width: max-content; max-width: min(26rem, calc(100vw - 1rem));
  max-height: min(18rem, calc(100dvh - 1rem)); margin: 0; padding: .3rem; border: 1px solid #4e647a;
  border-radius: .5rem; background: #212831; color: #edf2f8; box-shadow: 0 .45rem 1.2rem #0008; overflow: auto; }
.filter-dropdown:popover-open { display: grid; }
.filter-option { border: 0; border-radius: .3rem; background: transparent; color: inherit;
  padding: .45rem .62rem; font-size: .9rem; text-align: left; overflow-wrap: anywhere; }
.filter-option:is(:hover, :focus) { background: #2c4056; outline: none; }
.filter-option[aria-selected="true"] { color: #b9e0ff; box-shadow: inset 2px 0 #85c7ff; }
.period-trigger { width: auto; gap: .65rem; }
.period-trigger .nav-icon { color: var(--accent); }
.period-calendar { width: min(22rem, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem); padding: .72rem; }
.period-calendar button:disabled { cursor: default; }
.period-calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .62rem; }
.period-calendar-heading h2 { font-size: 1rem; text-transform: capitalize; }
.period-calendar-heading button { min-width: 2rem; font-size: 1.05rem; }
.period-weekdays, .period-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .16rem; text-align: center; }
.period-weekdays { margin-bottom: .28rem; color: var(--muted); font-size: .78rem; }
.period-day { min-height: 2.05rem; padding: .1rem; border: 1px solid transparent; border-radius: .28rem; color: #edf2f8; background: transparent; font-size: .88rem; }
.period-day:not(:disabled):hover, .period-day[aria-pressed="true"] { background: #2c4056; }
.period-day:disabled { color: #808a98; opacity: 1; }
.period-day[aria-current="date"] { border-color: #5b7fa2; }
.period-day.period-boundary { background: #83c4fb; color: #112235; }
.period-day:focus-visible { outline-width: 2px; outline-offset: -2px; }
.period-day.period-boundary:focus-visible { outline-color: #152e46; }
.period-hint { margin-top: .62rem; color: var(--muted); font-size: .8rem; }
.period-controls { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.period-controls .row-action { font-size: .78rem; }
label { display: block; margin-bottom: .35rem; font-size: .9rem; }
input, select { min-height: 2.75rem; width: 100%; border: 1px solid #4c5866; border-radius: .5rem; padding: .5rem .68rem; background: #181b20; color: #edf2f8; }
select { padding-right: 1rem; }

.panel { margin-top: 1rem; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; box-shadow: 0 1px 3px #0003; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: .94rem 1.13rem; }
.panel-heading h2 { display: flex; align-items: center; gap: .55rem; overflow-wrap: anywhere; }
.panel-heading h2 .nav-icon { color: #93a9c0; }
.panel-heading p { font-size: .9rem; }
:is(#warehouse-responsible, #warehouse-posts, #warehouse-contacts) > .panel-heading {
  padding-inline-end: calc(var(--warehouse-action-inset) - 1px);
}
.table-scroll { overflow: auto; border-radius: 0 0 .55rem .55rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .65rem .72rem; vertical-align: middle; text-align: left; }
th:first-child, td:first-child { padding-left: var(--cell-edge); }
th:last-child, td:last-child { padding-right: var(--cell-edge); }
thead th {
  background: #303d49;
  color: var(--user-accent);
  border-bottom: 1px solid #4a6174;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
td { border-top: 1px solid var(--line); font-size: .9375rem; overflow-wrap: anywhere; }
tbody tr:nth-child(even):not(.history-record) { background: #21262b; }
#content[data-view="warehouses"] table { min-width: 46rem; }
#content[data-view="warehouses"] #records :is(th, td):first-child { width: 24%; }
.warehouse-row { cursor: pointer; transition: background-color .16s ease; }
#records .warehouse-row:is(:hover, :focus-within) { background-color: #303840; }
#records .warehouse-row:has(.warehouse-name[aria-expanded="true"]) { background-color: #24394e; }
#records .warehouse-row:has(.warehouse-name[aria-expanded="true"]) > td:first-child { box-shadow: inset 3px 0 var(--accent); }
.warehouse-name { padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.warehouse-name[aria-expanded="true"] { color: var(--accent); }
#contact-records table { min-width: 43rem; }
#contact-records td:first-child { min-width: 10rem; }
#contact-records th:nth-last-child(2) { width: 12.5rem; min-width: 11rem; }
#contact-records th:last-child { width: 10rem; min-width: 8.75rem; }
#contact-records :is(th, td):nth-last-child(2) { text-align: center; }
#contact-records .contact-visibility { padding: .35rem .5rem; }
#contact-records .admin-menu-trigger { white-space: nowrap; }
#content[data-view="administrators"] table { min-width: 56rem; }
#content[data-view="administrators"] td:nth-child(5),
#content[data-view="administrators"] td:nth-child(6) { white-space: nowrap; }
#content[data-view="managers"] table { min-width: 33rem; }
#content[data-view="permanent"] table { min-width: 49rem; }
.plate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scope { display: block; margin-top: .18rem; color: var(--muted); font-size: .82rem; }
:is(#records, #contact-records) :is(th, td):last-child { text-align: right; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; align-items: center; }
#content:is([data-view="warehouses"], [data-view="managers"], [data-view="permanent"], [data-view="administrators"])
  #records :is(th, td):last-child {
  width: 1%;
  text-align: left;
  white-space: nowrap;
}
#content:is([data-view="warehouses"], [data-view="managers"], [data-view="permanent"], [data-view="administrators"])
  #records td:last-child > .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.row-action {
  padding: .32rem .65rem;
  border: 1px solid #41576e;
  border-radius: .38rem;
  background: #222f3d;
  color: var(--accent);
  font-size: .875rem;
}
.row-action:hover { background: #2b4258; border-color: #6b91b5; }
.row-action.danger-text { border-color: #6b454f; background: #392a31; color: #ffc0ca; }
.row-action.danger-text:hover { background: #4e303a; border-color: #9c5968; }
.permit-details-toggle { display: inline-flex; align-items: center; gap: .55rem;
  cursor: pointer; list-style: none; white-space: nowrap; }
.permit-details-toggle::-webkit-details-marker { display: none; }
.permit-details-toggle::before { content: ""; flex: none; width: .4rem; height: .4rem;
  border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(-45deg); }
details[open] > .permit-details-toggle::before { transform: rotate(45deg); }
.permit-details-toggle:is(:hover, :focus-visible) { color: #edf2f8; }
:is(.contact-visibility, .fault-notification-setting) { display: inline-flex; align-items: center; gap: .35rem; margin: 0; color: #c0d4e8; }
:is(.contact-visibility, .fault-notification-setting) input { width: 1.05rem; min-height: 1.05rem; margin: .15rem .05rem; accent-color: var(--accent); }
.fault-notification-setting { padding-block: .2rem; }
.fault-notification-setting input { flex: 0 0 1.05rem; }
.fault-notification-note { color: var(--muted); font-size: .8rem; }
#content[data-view="administrators"] th:nth-last-child(2) { white-space: normal; min-width: 7rem; }
.empty { border-top: 1px solid var(--line); padding: 1.05rem var(--cell-edge) 1.25rem; color: var(--muted); }
.chief-list { display: grid; gap: .65rem; padding: 0 var(--cell-edge) var(--cell-edge); }
.chief-record { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #252b32;
  border: 1px solid #3b4753; border-radius: .5rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.chief-name { flex: 1 1 14rem; min-width: 0; }
.chief-name h3 { color: var(--accent); font-size: 1.12rem; }
.chief-name small, .chief-details dt { color: var(--muted); font-size: .78rem; }
.chief-name p { margin-top: .18rem; }
.chief-details { display: grid; gap: .17rem .65rem; grid-template-columns: auto auto; margin: 0; }
.chief-details dd { margin: 0; font-size: .9rem; }
.chief-details dt { align-self: center; }
.chief-record button { margin-inline-start: auto; }
#warehouse-contacts { background: #262c34; border-color: #3d4854; }
#warehouse-contacts :is(h2, h2 .nav-icon) { color: var(--accent); }
#content[data-view="warehouses"] #records, #contact-records, #responsible-details,
#post-records, #post-refresh-status, #pending-post { margin: 0 var(--cell-edge) 1rem; }
:is(#content[data-view="warehouses"] #records, #contact-records, #post-records) > :is(.table-scroll, .empty),
#notification-records > .table-scroll, #responsible-details { border: 1px solid #3d4854; border-radius: .5rem; }
#responsible-details > .empty { border-top: 0; }
.warehouse-notifications { display: grid; gap: .75rem; padding: 1rem var(--cell-edge) 1.2rem; border-top: 1px solid #3d4854; }
.warehouse-notifications h3, .notification-preview legend { color: var(--accent); }
.warehouse-notifications > p { color: var(--muted); font-size: .9rem; }
#post-records :is(th, td):last-child { text-align: left; width: 1%; white-space: nowrap; }
#pending-post { padding-inline-end: calc(var(--cell-edge) + 1px); }
#pending-post > p { margin-inline-end: auto; }
#notification-records table { min-width: 34rem; }
#notification-records :is(th, td):last-child { text-align: right; }
#notification-records .row-action { white-space: nowrap; }
.notification-preview { min-width: 0; margin: 0; padding: .75rem; border: 1px solid #3d4854; border-radius: .5rem; }
.notification-preview legend { padding-inline: .3rem; }
.notification-preview-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.notification-preview-controls button { margin-inline-start: auto; }
#preview-warehouse-operations { margin-top: .6rem; font-size: .9rem; }
#notification-preview-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .65rem; }
#notification-preview-result:not(:empty) { margin-top: .75rem; }
.notification-preview-group { min-width: 0; border: 1px solid #405164; border-radius: .4rem; padding: .65rem .8rem; background: #202730; }
.notification-preview-group h4 { margin: 0; font-size: .92rem; }
.notification-preview-group ul { list-style: none; padding: 0; margin: .4rem 0 0; }
.notification-preview-group li { padding-block: .4rem; overflow-wrap: anywhere; }
.notification-preview-group li + li { border-top: 1px solid #3d4854; }
.notification-recipient-name { color: #c8e4fc; }
.notification-preview-group li p { margin-top: .22rem; font-size: .88rem; }
.notification-preview-group .needs-contact { display: table; margin-top: .18rem; }
:is(#warehouse-responsible, #warehouse-posts) { background: #262c34; }
:is(#warehouse-responsible, #warehouse-posts) h2 { color: var(--accent); }
.responsible-person { display: grid; grid-template-columns: max-content minmax(0, 1fr);
  column-gap: .9rem; row-gap: .35rem; margin: 0;
  padding: .75rem var(--cell-edge) 1rem; }
.responsible-person dt { color: var(--muted); font-size: .875rem; }
.responsible-person dd { margin: 0; overflow-wrap: anywhere; }
.admin-name { color: var(--user-accent); }
.admin-active { color: #8ddab0; }
.admin-disabled { color: #ff9ba5; }
.admin-menu-trigger { display: inline-flex; align-items: center; gap: .5rem; }
.admin-menu-trigger::after { content: ""; width: .4rem; height: .4rem; margin-top: -.16rem;
  border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.admin-menu { position: fixed; inset: auto; width: 13rem; max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem); margin: 0; padding: .25rem; border: 1px solid #47586a;
  border-radius: .55rem; background: #212831; color: #edf2f8; box-shadow: 0 .5rem 1.4rem #0007; }
.admin-menu:popover-open { display: grid; }
.admin-menu .row-action { border: 0; padding: .45rem .6rem; background: transparent; color: inherit; text-align: left; }
.admin-menu .row-action:hover { background: #2b4258; }
.admin-menu .danger-text { color: #ffb2bd; }
.admin-menu .danger-text:hover { background: #4e303a; }
.muted { color: var(--muted); }
.message { margin-top: .85rem; padding: .5rem .72rem; background: #223b36; color: #afe4cf; border-radius: .45rem; font-size: .9rem; }
.message.error { background: #452b32; color: #ffc2ca; }
.success-notice {
  position: fixed;
  z-index: 8;
  inset-inline-end: var(--gutter);
  inset-block-end: var(--gutter);
  max-width: calc(100% - 2 * var(--gutter));
  margin: 0;
  border: 1px solid #3a6157;
  box-shadow: 0 4px 14px #0004;
  opacity: 0;
  pointer-events: none;
}
.setup-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem; background: #223448; color: #cee6fb; }
.setup-note p { flex: 1 1 18rem; }
.needs-contact { display: inline-block; padding: .14rem .45rem; border-radius: .3rem; background: #3c3328; color: #f6d49a; font-size: .8rem; }
#content:is([data-view="history"], [data-view="passages"]) :is(th, td):last-child { text-align: left; }
#content[data-view="history"] table { min-width: 46rem; }
.history-record:nth-child(even of .history-record) { background: #21262b; }
.history-action { display: flex; align-items: flex-start; gap: .45rem; font-size: .875rem; overflow-wrap: normal; }
.history-action::before { content: ""; flex: 0 0 .62rem; height: .62rem; margin-top: .34em;
  border-radius: 50%; background: var(--action-dot, var(--muted)); }
.history-action[data-tone="restore"] { --action-dot: #8ddab0; }
.history-action[data-tone="disable"] { --action-dot: #f2ce80; }
.history-action[data-tone="remove"] { --action-dot: #ff9ba5; }
.history-action[data-tone="add"] { --action-dot: #8dccff; }
.history-action[data-tone="edit"] { --action-dot: #c6adf4; }
.history-action[data-tone="credentials"] { --action-dot: #a9bccf; }
.history-detail-toggle { display: inline-flex; align-items: baseline; gap: .46rem; padding: 0; border: 0;
  background: transparent; color: inherit; text-align: left; }
.history-detail-toggle::before { content: "▸"; flex: none; color: var(--accent); }
.history-detail-toggle[aria-expanded="true"]::before { content: "▾"; }
.history-detail-toggle:hover { color: var(--accent); }
.history-detail-row > td { padding: .75rem var(--cell-edge); background: #181d23; }
.history-detail-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.history-snapshot { border: 1px solid #374655; border-radius: .48rem; padding: .75rem .85rem; background: #232b34; }
.history-snapshot h3 { margin-bottom: .5rem; color: var(--accent); font-size: .9rem; }
.history-snapshot dl { display: grid; gap: .15rem; margin: 0; font-size: .875rem; }
.history-snapshot dl > div { display: grid; grid-template-columns: minmax(6rem, .85fr) minmax(0, 1.5fr); gap: .6rem; padding: .2rem .4rem; border-radius: .26rem; }
.history-snapshot dt { color: var(--muted); }
.history-snapshot dd { margin: 0; overflow-wrap: anywhere; }
.history-field-changed { background: #2e4052; }

dialog { width: min(30rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); border: 1px solid #4c5866; border-radius: .9rem; padding: 1.35rem; color: inherit; background: linear-gradient(#252d36, var(--surface) 6rem); box-shadow: 0 16px 50px #0007; }
dialog::backdrop { background: #080b11bd; }
dialog h2 { color: var(--accent); font-size: 1.35rem; }
dialog .filter-trigger:disabled { cursor: default; }
dialog .filter-trigger[aria-invalid="true"] { border-color: #ff9ba5; }
#form-context { overflow-wrap: anywhere; }
#fields:not(:empty) { margin-top: 1rem; }
.field + .field { margin-top: .78rem; }
.field small { display: block; margin-top: .35rem; color: var(--muted); }
.form-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: .6rem; margin-top: 1.15rem; }
.compact-actions .form-actions button { min-height: 2.2rem; padding: .28rem .68rem; font-size: .875rem; }
.form-review { padding: .7rem; margin-top: .65rem; border: 1px solid #47586a; border-radius: .45rem; font-size: .93rem; }
.form-review p, .form-review ul, .form-review button { margin-top: .45rem; }
.credentials-data { display: grid; gap: .6rem; margin-top: 1rem; }
.credentials-data dt { color: var(--muted); font-size: .9rem; }
.credentials-data dd { margin: 0; background: #181b20; border-radius: .45rem; padding: .65rem; user-select: all; overflow-wrap: anywhere; }
.post-code-hint { margin-top: .8rem; color: #afcbe2; font: 300 .9rem/1.5 system-ui, sans-serif; }
.auth-screen { grid-column: 1 / -1; display: grid; place-items: center; padding: 1.5rem; }
.auth-screen form { width: min(100%, 27rem); margin: 0; padding: 1.65rem; }
#auth-fields { margin-top: 1rem; }
#auth-submit { margin-top: 1rem; }

@media (max-width: 58rem) {
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: .8rem var(--gutter); border-right: 0; }
  .brand { padding: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; margin-top: .65rem; }
  .sidebar button { padding: .43rem .55rem; }
  main { padding-top: 1.45rem; }
}

@media (max-width: 34rem) {
  :root { --cell-edge: .59rem; }
  .panel-heading { padding-inline: .73rem; }
  th, td, th:first-child, td:first-child, th:last-child, td:last-child { padding-left: .59rem; padding-right: .59rem; }
  .row-action { padding-inline: .4rem; font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .warehouse-row { transition: none; }
}
