/* site/layout.css — Base element styles and the app layout: top bar, sidebar, content column, drawers, side panel, flashbar, phone drawer. Order: wwwroot/README.md. */
/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules (bulk-action bar, optional fields). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

/* VB ERP body text: 14/20 (fontSizeBodyM, lineHeightBodyM); headings bold with a slight negative tracking. */
body {
  margin: 0;
  font: 400 14px/20px var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
/* A link inside running text is underlined (VB ERP «primary» link; not by colour alone, WCAG 1.4.1) */
p a:not([class]), .hint a:not([class]), .sp-sub a, .sp-note a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--heading); font-weight: 700; }
h1 { font-size: 24px; line-height: 30px; letter-spacing: -.02em; margin: 0 0 20px; }       /* heading-xl: page header */
h2 { font-size: 20px; line-height: 24px; letter-spacing: -.015em; margin: 28px 0 12px; }   /* heading-l: container header */
h3 { font-size: 18px; line-height: 22px; letter-spacing: -.01em; margin: 20px 0 8px; }     /* heading-m */
h4 { font-size: 16px; line-height: 20px; letter-spacing: -.005em; margin: 16px 0 8px; }    /* heading-s */
h1 .badge, h2 .badge { vertical-align: 3px; font-size: 12px; letter-spacing: 0; margin-left: 6px; }
p { margin: 0 0 12px; }
strong, b { font-weight: 700; }
small { font-size: 12px; line-height: 16px; letter-spacing: .005em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code { font: 12px/1.4 var(--mono); background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
ul, ol { padding-left: 20px; }

.muted { color: var(--muted); }
.faint, .zero, .dash { color: var(--faint); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.negative { color: var(--danger); font-weight: 600; }
.positive { color: var(--ok); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.trunc-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ======================================================================
   App layout (VB ERP AppLayout, VB Admin look): top navigation, side navigation (an icon rail when
   collapsed, a drawer on phones), breadcrumbs, page header, the tools drawer (ⓘ) and the flashbar
   ====================================================================== */
html { --nav-offset: var(--sidebar-w); --rail-space: 44px; --panel-space: 0px; }
html.sb-collapsed { --nav-offset: var(--rail-w); }
.skip-link {
  position: fixed; left: 12px; top: -64px; z-index: 300; padding: 6px 16px; border-radius: var(--radius-btn);
  background: var(--accent); color: var(--on-accent); font-weight: 700; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; color: var(--on-accent); text-decoration: none; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* Top navigation: logo mark + network, «Робоча область · сторінка», utilities (theme, Профіль, Вийти) */
.topnav {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 8px;
  height: var(--topnav-h); padding: 0 16px 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.tn-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; color: var(--heading); border-radius: var(--radius-sm); }
.tn-brand:hover { color: var(--heading); text-decoration: none; }
.tn-logo {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 6px;
  background: var(--logo-bg); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.tn-name { font-size: 18px; line-height: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-context { min-width: 0; margin-left: 20px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Brand:Environment — «Тестовий сервер»: dark text on the warning yellow, like .flash-warning */
.tn-env {
  flex-shrink: 0; padding: 2px 8px; border-radius: var(--radius-badge); background: var(--warn-fill); color: #0f141a;
  font-size: 12px; line-height: 18px; font-weight: 700; white-space: nowrap;
}
.tn-utils { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.tn-link {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-btn);
  background: none; color: var(--link); font: inherit; font-weight: 700; letter-spacing: .005em; white-space: nowrap; cursor: pointer; list-style: none;
}
.tn-link::-webkit-details-marker { display: none; }
.tn-link:hover { background: var(--accent-soft); color: var(--link-hover); text-decoration: none; }
.tn-link .icon { width: 16px; height: 16px; }
.tn-link .tn-caret { width: 14px; height: 14px; }
.tn-icon { width: 32px; padding: 0; justify-content: center; color: var(--text-2); }
.tn-icon .icon { width: 18px; height: 18px; }
.tn-profile > .menu-list { top: calc(100% + 8px); min-width: 240px; }
.tn-logout { margin: 0; }
.menu-head { display: grid; gap: 2px; padding: 6px 10px 10px; margin: 0 0 4px; border-bottom: 1px solid var(--line); }
.menu-head b { color: var(--heading); }
.menu-head small { color: var(--muted); }
.burger { display: none; }
:root[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }

/* Side navigation: the network name + collapse, then Poster's sections as expandable groups (▼ title, links) */
.app { display: flex; min-height: calc(100vh - var(--topnav-h)); }
.sidebar {
  position: relative; z-index: 40; flex-shrink: 0; width: var(--sidebar-w);
  background: var(--sb-bg); border-right: 1px solid var(--sb-border); color: var(--sb-text);
  transition: width var(--dur-slow) var(--ease);
}
/* The inner column sticks under the top bar; the outer one stretches with the page, so the border reaches the bottom. */
.sb-inner {
  position: sticky; top: var(--topnav-h); height: calc(100vh - var(--topnav-h)); display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; padding: 16px 12px 16px 28px; border-bottom: 1px solid var(--sb-border); }
.sb-title { min-width: 0; color: var(--heading); font-size: 20px; line-height: 24px; font-weight: 700; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-title:hover { color: var(--heading); text-decoration: none; }
.sb-collapse, .sb-close {
  display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: var(--text-2); cursor: pointer;
}
.sb-collapse:hover, .sb-close:hover { background: var(--sb-hover); color: var(--heading); }
.sb-collapse .icon { width: 20px; height: 20px; transition: transform var(--dur) var(--ease); }
.sb-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 16px 12px 32px; }
.nav-block { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-block + .nav-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--sb-border); }
.nav-block-title { margin: 0 10px 4px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.nav-block-title-compact { display: none; }
.nav-block-empty { margin: 0 10px 4px; color: var(--muted); font-size: 12px; line-height: 18px; }
.nav-link, .nav-group > summary {
  display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 8px 4px 26px; border-radius: var(--radius-sm);
  color: var(--sb-text); font-size: 14px; line-height: 20px; cursor: pointer;
}
.nav-link:hover { color: var(--link); text-decoration: none; }
.nav-link.active { color: var(--sb-active); font-weight: 700; }
.nav-link > span, .nav-group > summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .icon { display: none; width: 18px; height: 18px; color: var(--sb-icon); }
.nav-group { margin-top: 10px; }
.nav-group > summary { padding-left: 4px; list-style: none; user-select: none; color: var(--heading); font-size: 16px; font-weight: 700; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: var(--link); }
.nav .nav-group > summary .caret { display: block; width: 16px; height: 16px; color: currentColor; transform: rotate(-90deg); transition: transform var(--dur) var(--ease); }
.nav-group[open] > summary .caret { transform: none; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 2px; }

/* Collapsed (desktop): an icon rail; a section opens as a fly-out on hover or focus (site.js keeps the groups open). */
@media (min-width: 901px) {
  html.sb-collapsed .sidebar { width: var(--rail-w); }
  html.sb-collapsed .sb-inner { overflow: visible; }
  html.sb-collapsed .sb-head { justify-content: center; min-height: 64px; padding: 16px 0; }
  html.sb-collapsed .sb-title,
  html.sb-collapsed .nav-link > span,
  html.sb-collapsed .nav-group > summary > span,
  html.sb-collapsed .nav .nav-group > summary .caret { display: none; }
  html.sb-collapsed .sb-collapse .icon { transform: rotate(180deg); }
  html.sb-collapsed .nav { align-items: center; gap: 6px; padding: 12px 0; }
  html.sb-collapsed .nav-block { align-items: center; width: 100%; }
  html.sb-collapsed .nav-block + .nav-block { margin-top: 4px; padding-top: 6px; }
  html.sb-collapsed .nav-block-title { width: 36px; margin: 0 0 3px; color: var(--muted); font-size: 8px; line-height: 12px; letter-spacing: 0; text-align: center; }
  html.sb-collapsed .nav-block-title-full { display: none; }
  html.sb-collapsed .nav-block-title-compact { display: inline; }
  html.sb-collapsed .nav-block-empty { display: none; }
  html.sb-collapsed .nav .icon { display: block; }
  html.sb-collapsed .nav-block > .nav-link, html.sb-collapsed .nav-block > .nav-group > summary {
    justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%;
  }
  html.sb-collapsed .nav-block > .nav-link:hover, html.sb-collapsed .nav-block > .nav-group > summary:hover { background: var(--selected); }
  html.sb-collapsed .nav-block > .nav-link.active, html.sb-collapsed .nav-block > .nav-group:has(.nav-link.active) > summary { background: var(--accent); }
  html.sb-collapsed .nav-block > .nav-link.active .icon, html.sb-collapsed .nav-block > .nav-group:has(.nav-link.active) > summary .icon { color: var(--on-accent); }
  html.sb-collapsed .nav-group { position: relative; margin: 0; }
  html.sb-collapsed .nav-group > .nav-sub { display: none; }
  html.sb-collapsed .nav-group:hover > .nav-sub,
  html.sb-collapsed .nav-group:focus-within > .nav-sub {
    display: flex; position: absolute; left: calc(100% + 12px); top: -8px; z-index: 60; min-width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; margin: 0; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  }
  html.sb-collapsed .nav-group:hover > .nav-sub::before,
  html.sb-collapsed .nav-group:focus-within > .nav-sub::before { content: attr(data-title); padding: 4px 10px 6px; color: var(--heading); font-weight: 700; }
  /* a hover bridge between the rail and the fly-out */
  html.sb-collapsed .nav-group:hover::after { content: ""; position: absolute; left: 100%; top: 0; width: 14px; height: 100%; }
  html.sb-collapsed .nav-group > .nav-sub .nav-link { padding: 4px 10px; }
  html.sb-collapsed .nav-group > .nav-sub .nav-link > span { display: inline; }
}

/* Content column: breadcrumbs, the flashbar, the page. The right edge leaves room for the drawer triggers. */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-right: calc(var(--rail-space) + var(--panel-space)); transition: padding-right var(--dur-slow) var(--ease); }
.content { flex: 1; width: 100%; padding: 16px 16px 40px var(--gutter); }
.content:focus { outline: none; }
/* soft-nav.js moves the focus to the new page's h1 (for screen readers); like #main itself, it is not a control to outline */
.content h1[tabindex="-1"]:focus { outline: none; }
.scrim { display: none; }

.breadcrumbs { margin: 0 0 12px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs li + li::before {
  content: ""; flex-shrink: 0; width: 16px; height: 16px; margin: 0 8px; background: var(--decor);
  -webkit-mask: var(--i-chevron-right) center / contain no-repeat; mask: var(--i-chevron-right) center / contain no-repeat;
}
.breadcrumbs a { color: var(--link); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.breadcrumbs a:hover { color: var(--link-hover); }
.breadcrumbs [aria-current] { color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root {
  --i-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

/* Page header (VB ERP Header, variant h1): title (counter), description, actions on the right */
.page-head, .stats-head, .toolbar, .fin-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 32px; margin: 0 0 20px;
}
.page-head > div:first-child, .stats-head > div:first-child { min-width: 0; }
.page-head h1, .stats-head h1, .toolbar h1, .fin-head h1 { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; margin: 0; padding: 1px 0; }
.page-head .count, h1 .count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
h1 .count::before { content: "("; }
h1 .count::after { content: ")"; }
.page-head .sub, .stats-head .subtitle, .fin-title p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; line-height: 20px; }
.page-head .actions, .fin-actions, .toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* The breadcrumbs replace the old «‹» back links */
.page-head .back, h1 > .back { display: none; }
.back { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--text-2); }
.back:hover { background: var(--row-hover); text-decoration: none; }
.back .icon { width: 20px; height: 20px; }

/* Drawer triggers (the «ⓘ» on the right) and the tools / help drawer */
.rail {
  position: fixed; top: var(--topnav-h); right: 0; bottom: 0; z-index: 45; width: var(--rail-space);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 16px; pointer-events: none;
}
.rail-btn {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: var(--neutral-fill); color: #fff; cursor: pointer; pointer-events: auto; transition: background-color var(--dur) var(--ease);
}
.rail-btn:hover { background: var(--heading); color: var(--surface); }
.rail-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.rail-btn .icon { width: 20px; height: 20px; }
.tools {
  position: fixed; top: var(--topnav-h); right: var(--rail-space); bottom: 0; z-index: 44; width: var(--tools-w); max-width: calc(100vw - 56px);
  overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-side);
}
html.tools-open { --panel-space: 0px; }
@media (min-width: 1400px) { html.tools-open { --panel-space: var(--tools-w); } html.tools-open .tools { box-shadow: none; } }
.tools-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 12px 12px 24px; border-bottom: 1px solid var(--line); }
.tools-head h2 { margin: 0; font-size: 18px; line-height: 22px; }
.tools-head h2:focus { outline: none; }
.tools-body { padding: 16px 24px 32px; color: var(--text-2); }
.tools-body h3 { margin: 20px 0 8px; font-size: 16px; line-height: 20px; }
.tools-body h3:first-child { margin-top: 0; }
.tools-list { display: grid; gap: 8px; margin: 0; padding-left: 18px; }
kbd { display: inline-block; padding: 0 6px; font: 12px/18px var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; }

/* Split panel (VB ERP SplitPanel, side position): a related record's card next to the list. It pushes the content
   on wide screens (the list stays usable) and overlays it below 1280 px; full width on phones. */
.split-panel {
  position: fixed; top: var(--topnav-h); right: var(--rail-space); bottom: 0; z-index: 46; width: var(--panel-w); max-width: calc(100vw - 56px);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-side);
  animation: panel-in var(--dur-slow) var(--ease);
}
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (min-width: 1280px) { html.panel-open { --panel-space: var(--panel-w); } html.panel-open .split-panel { box-shadow: none; } }
.sp-bar { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.sp-kind { flex: 1; min-width: 0; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-bar [data-panel-back]:not([hidden]) + .sp-kind { padding-left: 0; }
.sp-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sp-content[aria-busy="true"] > * { opacity: .5; transition: opacity .1s linear .1s; }
.sp-loading { display: flex; align-items: center; gap: 8px; padding: 24px; color: var(--muted); }

/* A record's card inside the panel (the «card» partial of an entity): head, sections of key-value pairs, related links */
.sp-card { display: flex; flex-direction: column; min-height: 100%; }
.sp-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.sp-head h2 { margin: 0; font-size: 20px; line-height: 24px; overflow-wrap: anywhere; }
.sp-head h2:focus { outline: none; }
.sp-sub { margin: 4px 0 0; color: var(--text-2); }
.sp-head .status, .sp-head .badge { margin-top: 8px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sp-body { display: grid; gap: 24px; padding: 20px 24px 32px; }
.sp-body h3 { margin: 0 0 12px; font-size: 16px; line-height: 20px; }
.sp-body .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.sp-body .kv > .wide { grid-column: 1 / -1; }
.sp-body table { margin: 0; border-radius: var(--radius-sm); }
.sp-body table th, .sp-body table td { height: 36px; padding-top: 6px; padding-bottom: 6px; }
.sp-body thead th { position: static; }
.sp-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.sp-links a { font-weight: 700; }
.sp-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 16px; }
/* The edit form of a card: fields in one column, the actions stick to the bottom of the panel */
.sp-form .sp-body { gap: 16px; }
.sp-form .fields { grid-template-columns: minmax(0, 1fr); }
.sp-form .field-label { display: block; margin: 0 0 4px; color: var(--text); font-size: 14px; font-weight: 700; }
.sp-foot {
  position: sticky; bottom: 0; margin-top: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border);
}
/* A list of records inside the panel (e.g. the stores a picker can open), filtered as you type */
.sp-filter { display: grid; gap: 12px; }
.sp-filter .search { flex: none; min-width: 0; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sp-list .menu-item { gap: 8px; padding: 6px 8px; white-space: normal; cursor: default; }
.sp-list .menu-item > a { flex: 1; min-width: 0; }
.sp-list-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sp-head h2 .count { color: var(--muted); font-weight: 400; }
/* A store picker with its «settings in the panel» button next to it */
.picker-row { display: flex; align-items: center; gap: 8px; }
.picker-row > select, .picker-row > .picker { flex: 1; min-width: 0; }
@media (max-width: 1279px) { .split-panel { z-index: 66; } }
@media (max-width: 900px) {
  .split-panel { right: 0; width: 100vw; max-width: none; border-left: 0; }
  .sp-body .kv { grid-template-columns: minmax(0, 1fr); }
}

/* Flashbar (VB ERP): coloured bars over the top of the content; success hides itself */
.flashbar {
  position: fixed; z-index: 90; top: calc(var(--topnav-h) + 12px); left: calc(var(--nav-offset) + var(--gutter)); right: calc(var(--rail-space) + var(--panel-space) + 16px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.flash {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px 8px 16px; border-radius: var(--radius-alert);
  background: var(--ok-fill); color: var(--on-fill); box-shadow: var(--shadow-sticky); pointer-events: auto; animation: flash-in var(--dur-slow) var(--ease);
}
.flash > span { flex: 1; min-width: 0; padding: 4px 0; }
.flash .flash-icon { width: 16px; height: 16px; margin-top: 6px; flex-shrink: 0; }
.flash-error { background: var(--danger-fill); }
.flash-info { background: var(--info-fill); }
.flash-warning { background: var(--warn-fill); color: #0f141a; }
.flash-x {
  display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer;
}
.flash-x:hover { background: rgba(0, 7, 22, .15); }
.flash-x .icon { width: 16px; height: 16px; }
.flash.is-leaving { animation: flash-out var(--dur-slow) ease-in forwards; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes flash-out { to { opacity: 0; transform: translateY(-8px); } }

/* Soft navigation (soft-nav.js): a slim bar along the window's top edge while the next page is on its way (after 150 ms). */
.soft-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 2px; pointer-events: none;
  background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0;
}
.soft-progress.is-on { opacity: 1; animation: soft-progress 8s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes soft-progress { from { transform: scaleX(.05); } to { transform: scaleX(.92); } }
@media (prefers-reduced-motion: reduce) { .soft-progress.is-on { animation: none; transform: scaleX(.6); } }

/* Phones and small tablets: the side navigation is a drawer opened by the burger; drawers overlay the content. */
@media (max-width: 900px) {
  html { --nav-offset: 0px; --rail-space: 0px; --gutter: 16px; }
  /* A wide table overflows until site.js wraps it in .table-scroll; on a phone that first layout would widen the page
     for good. clip (not hidden) is no scroll container, so sticky table headers keep working. */
  .content { overflow-x: clip; }
  .topnav { gap: 4px; padding: 0 8px 0 4px; }
  .burger { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); cursor: pointer; }
  .burger:hover { background: var(--sb-hover); }
  .burger .icon { width: 22px; height: 22px; }
  .tn-logo { width: 32px; height: 32px; font-size: 13px; }
  .tn-name { font-size: 16px; }
  /* the network name gives way to the utilities; the label keeps its words */
  .tn-brand { flex-shrink: 1; }
  .tn-env { padding: 1px 6px; font-size: 11px; }
  .tn-context, .tn-logout, .tn-profile .tn-link > span, .tn-profile .tn-caret { display: none; }
  .tn-profile > summary { width: 32px; padding: 0; justify-content: center; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: min(300px, 86vw); visibility: hidden;
    transform: translateX(-102%); transition: transform .2s var(--ease), visibility 0s linear .2s; box-shadow: var(--shadow-pop);
  }
  .sb-inner { top: 0; height: 100%; }
  .sb-collapse { display: none; }
  .sb-close { display: grid; }
  .nav-toggle:checked ~ .app .sidebar { visibility: visible; transform: none; transition: transform .2s var(--ease); }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: var(--backdrop); }
  .content { padding: 12px var(--gutter) 32px; }
  .breadcrumbs { padding-right: 40px; }
  .breadcrumbs li:not(:nth-last-child(-n+2)) { display: none; }
  .breadcrumbs li:nth-last-child(2)::before { display: none; }
  .rail { top: calc(var(--topnav-h) + 8px); right: 12px; bottom: auto; width: auto; padding: 0; }
  .tools { right: 0; z-index: 70; width: min(var(--tools-w), 100vw); max-width: none; }
  .flashbar { left: 12px; right: 12px; }
  .page-head > h1, .page-head > div:first-child { flex: 1 1 auto; }
}

