/* The admin's common stylesheet: the frame every
   signed-in support page sits in, its menus, and the base rules the support
   pages rely on. Sizes and colours are what the browser computed on today's
   admin at 1680, 1280 and 1024 px wide; the markup and the class names are
   the port's own (`src/app/admin/shell.rs`). Every other admin area keeps
   its rules in `admin-<area>.css` beside this file.

   Plain CSS, linked after the app's Tailwind sheet: the `base` layer below
   merges into Tailwind's, so its utilities still win over it. */

@layer base {
  *, ::after, ::before, ::backdrop { border-color: var(--border); outline-color: var(--ring); }
  button, [role=button] { cursor: pointer; }
}
:root {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --ad-avatar: oklch(0.442 0.017 285.786);
  --ad-tip: oklch(0.145 0 0);
  --ad-tip-foreground: oklch(0.985 0 0);
}
/* A support page scrolls; the customer module's body does not. */
body.CADmodul { overflow: visible; }
/* Today's 44 px touch targets on a phone, unlayered as today's. */
@media (max-width: 768px) {
  button { min-width: 44px; min-height: 44px; }
  input[type=number], input[type=text] { min-height: 44px; }
}

.ad-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* -- the frame ---------------------------------------------------------- */

.ad-frame { --ad-side: 16rem; display: flex; width: 100%; min-height: 100svh; }
.ad-frame[data-fold=folded] { --ad-side: 3rem; }

.ad-side { display: none; color: var(--sidebar-foreground); }
.ad-side-gap { position: relative; width: var(--ad-side); background: transparent; transition: width 200ms linear; }
.ad-side-panel {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
  display: none; flex-direction: column; width: var(--ad-side); height: 100svh;
  background: var(--sidebar); border-right: 1px solid var(--border);
  transition: width 200ms linear;
}
@media (min-width: 768px) {
  .ad-side { display: block; }
  .ad-side-panel { display: flex; }
}

.ad-side-head { display: flex; flex-direction: column; gap: 8px; padding: 24px 16px; }
.ad-logo { display: block; }
.ad-logo-wide { display: block; height: 24px; width: auto; }
.ad-logo-mark { display: none; width: 20px; height: 20px; }
.ad-frame[data-fold=folded] .ad-side-head { align-items: center; padding-left: 0; padding-right: 0; }
.ad-frame[data-fold=folded] .ad-logo-wide { display: none; }
.ad-frame[data-fold=folded] .ad-logo-mark { display: block; }

.ad-side-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow: auto; }
.ad-frame[data-fold=folded] .ad-side-body { overflow: hidden; }

.ad-group { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; padding: 0 8px; }
.ad-group-label {
  display: flex; align-items: center; flex-shrink: 0; height: 32px; padding: 0 8px;
  border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 500;
  color: color-mix(in oklab, var(--sidebar-foreground) 70%, transparent);
  transition: margin 200ms linear, opacity 200ms linear;
}
.ad-frame[data-fold=folded] .ad-group-label { margin-top: -32px; opacity: 0; }

.ad-menu { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; margin: 0; padding: 0; list-style: none; }
.ad-li { position: relative; }

.ad-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 8px;
  overflow: hidden; border-radius: 10px; outline: none; background: transparent;
  color: var(--sidebar-foreground); font-size: 14px; line-height: 20px; text-align: left;
  text-decoration: none;
  transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1), height 150ms cubic-bezier(0.4, 0, 0.2, 1), padding 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-item > svg, .ad-item > .ad-theme-icon > svg { width: 16px; height: 16px; flex-shrink: 0; }
.ad-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-item:hover, .ad-item[aria-expanded=true] { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.ad-item[aria-current=page] { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); font-weight: 500; }
.ad-item:focus-visible { box-shadow: 0 0 0 2px var(--sidebar-ring); }
.ad-frame[data-fold=folded] .ad-item { width: 32px; height: 32px; padding: 8px; }

.ad-cta {
  height: 48px; background: var(--primary); color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}
.ad-cta:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); color: var(--primary-foreground); box-shadow: none; }
.ad-frame[data-fold=folded] .ad-cta { padding: 0; justify-content: center; }

.ad-side-foot { display: flex; flex-direction: column; gap: 12px; padding: 8px; border-top: 1px solid var(--border); }
.ad-menu-muted .ad-item > svg, .ad-theme-icon { color: var(--muted-foreground); }
.ad-theme-icon { display: inline-flex; flex-shrink: 0; }
.ad-theme-icon > svg { display: none; }
html:not([data-theme-choice]) .ad-when-light,
html[data-theme-choice=light] .ad-when-light,
html[data-theme-choice=dark] .ad-when-dark,
html[data-theme-choice=system] .ad-when-system { display: block; }

.ad-user { height: 48px; }
.ad-user > svg.ad-user-chevron { margin-left: auto; color: var(--muted-foreground); }
.ad-user-id { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.ad-avatar {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 9999px; overflow: hidden;
  background: var(--ad-avatar); color: #fff; font-size: 14px; line-height: 20px;
}
.ad-user-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ad-user-name { display: block; width: 100%; font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-user-name:empty { display: none; }
.ad-user-mail { display: block; width: 100%; font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-frame[data-fold=folded] .ad-user { padding: 0; }

/* -- the page ----------------------------------------------------------- */

.ad-inset { position: relative; display: flex; flex-direction: column; flex: 1; width: 100%; min-width: 0; background: transparent; }
.ad-head {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  height: 64px; flex-shrink: 0; padding: 0 16px;
  background: var(--background); border-bottom: 1px solid var(--border);
}
.ad-trigger {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 28px; height: 28px; margin-left: -4px; border-radius: 8px;
  background: transparent; color: var(--muted-foreground); outline: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-trigger > svg { width: 16px; height: 16px; pointer-events: none; }
.ad-trigger:hover { background: var(--accent); color: var(--accent-foreground); }
.ad-trigger:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-main { flex: 1; min-width: 0; padding: 24px; }
@media (min-width: 768px) { .ad-main { padding: 32px; } }
.ad-page { width: 100%; min-width: 0; }
.ad-page-narrow { max-width: 80rem; margin: 0 auto; }

.ad-title > h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.025em; }
.ad-title > p { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted-foreground); }

.ad-foot { padding: 16px 24px; border-top: 1px solid var(--border); }
.ad-foot-row { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px; }
@media (min-width: 640px) { .ad-foot-row { flex-direction: row; } }
.ad-foot-text { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ad-social { display: flex; align-items: center; gap: 16px; }
.ad-social > a { display: block; color: var(--muted-foreground); transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.ad-social > a:hover { color: var(--foreground); }
.ad-social svg { display: block; width: 20px; height: 20px; }

/* -- the menus (Appearance, the user) and the rail's tooltip ------------- */

.ad-pop {
  position: absolute; z-index: 50; min-width: 100%; padding: 4px; overflow: hidden; outline: none;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  animation: ad-pop-in 150ms ease;
}
.ad-pop[hidden] { display: none; }
.ad-pop-right { left: calc(100% + 4px); bottom: 0; }
.ad-pop-user { border-radius: 10px; }
@keyframes ad-pop-in { from { opacity: 0; transform: scale(0.95) translateX(-8px); } }
.ad-pop-item {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border-radius: 6px; outline: none; background: transparent;
  color: inherit; font-size: 14px; line-height: 20px; text-align: left; text-decoration: none;
  cursor: default; user-select: none;
}
.ad-pop-item > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted-foreground); }
.ad-pop-item:hover, .ad-pop-item:focus { background: var(--accent); color: var(--accent-foreground); }
.ad-pop-head { display: flex; align-items: center; gap: 10px; text-align: left; font-size: 14px; line-height: 20px; }
.ad-pop-sep { height: 1px; margin: 4px -4px; background: var(--border); }

.ad-tip {
  position: fixed; z-index: 60; padding: 6px 12px; border-radius: 6px; pointer-events: none;
  background: var(--ad-tip); color: var(--ad-tip-foreground); font-size: 12px; line-height: 16px;
  white-space: nowrap; animation: ad-tip-in 150ms ease;
}
.ad-tip::before {
  content: ""; position: absolute; left: -4px; top: 50%; width: 10px; height: 10px;
  background: inherit; border-radius: 2px; transform: translateY(-50%) rotate(45deg);
}
@keyframes ad-tip-in { from { opacity: 0; transform: scale(0.95) translateX(-8px); } }

/* -- the phone drawer (below 768 px) ------------------------------------ */

.ad-backdrop { display: none; }
@media (max-width: 767.98px) {
  .ad-frame[data-drawer=open] .ad-side { display: block; }
  .ad-frame[data-drawer=open] .ad-side-gap { display: none; }
  .ad-frame[data-drawer=open] .ad-side-panel {
    display: flex; z-index: 50; width: 18rem; border-right: 0;
    animation: ad-drawer-in 500ms ease-in-out;
  }
  .ad-frame[data-drawer=open] .ad-backdrop {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.5);
    animation: ad-fade-in 150ms ease;
  }
}
@keyframes ad-drawer-in { from { transform: translateX(-100%); } }
@keyframes ad-fade-in { from { opacity: 0; } }

/* -- dark (Appearance > Dark, or System on a dark OS) ------------------- */

/* Today's dark palette, as the browser computes it on today's support
   pages with the Appearance choice Dark (measured): a blue-black
   page, near-black cards, ice-blue primary. Every rule that reads a token
   follows it; the few that today's pages draw differently in dark are at
   the end of this sheet ("dark: what the tokens do not carry"). */
html.dark {
  --background: var(--color-eplast-blue-900);
  --foreground: #fbf8f3;
  --card: var(--color-eplast-blue-800);
  --card-foreground: #fbf8f3;
  --popover: var(--color-eplast-blue-800);
  --popover-foreground: #fbf8f3;
  --primary: var(--color-eplast-ice-500);
  --primary-foreground: #06070c;
  --secondary: var(--color-eplast-blue-600);
  --secondary-foreground: #fbf8f3;
  --muted: var(--color-eplast-blue-700);
  --muted-foreground: #c2c2c2;
  --accent: #205567;
  --accent-foreground: #fbf8f3;
  --destructive: #cb2f2f;
  --border: var(--color-eplast-blue-600);
  --input: var(--color-eplast-blue-600);
  --ring: #5ea5bc;
  --link: #86bbcd;
  --link-hover: #afd2dd;
  --sidebar: var(--color-eplast-blue-800);
  --sidebar-foreground: #fbf8f3;
  --sidebar-primary: var(--color-eplast-ice-500);
  --sidebar-primary-foreground: #06070c;
  --sidebar-accent: #163944;
  --sidebar-accent-foreground: #fbf8f3;
  --sidebar-border: var(--color-eplast-blue-600);
  --sidebar-ring: #5ea5bc;
}
html.dark body { background: var(--background); color: var(--foreground); }

/* -- the overview, `/` (src/app/admin/overview.rs) ----------------------- */

.ov { display: flex; flex-direction: column; gap: 24px; padding: 24px; }
.ov-head { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 768px) { .ov-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.ov-title > h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.025em; }
.ov-title > p { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted-foreground); }
.ov-status { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ov-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) { .ov-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ov-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ov-card, .ov-panel {
  display: flex; flex-direction: column; background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.ov-card { gap: 8px; padding: 16px 0; min-height: 132px; }
.ov-card-alert { border-color: color-mix(in oklab, #cb2f2f 40%, transparent); }
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 16px; }
.ov-card-head > div { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted-foreground); }
.ov-card-head > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted-foreground); }
.ov-card-alert .ov-card-head > svg { color: #cb2f2f; }
.ov-card-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 16px; }
.ov-card-body > a { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--primary); text-decoration: none; }
.ov-card-body > a:hover { text-decoration: underline; }
.ov-value { font-size: 30px; line-height: 36px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-helper { margin: 4px 0 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ov-note { margin: 2px 0 0; font-size: 11px; line-height: 16.5px; color: var(--muted-foreground); }
.ov-panel { gap: 24px; padding: 24px 0; min-width: 0; }
.ov-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 24px; min-height: 20px; }
.ov-panel-head > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted-foreground); }
.ov-panel-head-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.ov-panel-head-stack > p { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ov-panel-title { font-size: 16px; line-height: 16px; font-weight: 600; }
.ov-panel-body { padding: 0 24px; min-width: 0; }
.ov-empty { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ov-chart { position: relative; height: 320px; font-size: 12px; line-height: 14px; color: #666; }
.ov-yaxis { position: absolute; left: 0; top: 0; width: 46px; height: 100%; }
.ov-yaxis > span { position: absolute; right: 0; white-space: nowrap; }
.ov-plot { position: absolute; left: 60px; top: 16px; width: calc(100% - 76px); height: 266px; overflow: visible; }
.ov-xaxis { position: absolute; left: 60px; top: 293.5px; width: calc(100% - 76px); height: 14px; }
.ov-xaxis > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ov-xaxis > .ov-x-last { left: auto; right: -16px; transform: none; }
.ov-grid { stroke: color-mix(in oklab, var(--border) 50%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ov-line { stroke-width: 2; vector-effect: non-scaling-stroke; }
/* The lines draw in from the left in 1.5 s (M-90): their own layer is
   uncovered left to right. */
.ov-lines { animation: ov-draw 1.5s ease; }
@keyframes ov-draw { from { clip-path: inset(-8px 100% -8px 0); } to { clip-path: inset(-8px 0 -8px 0); } }
/* Today's two lists: below 1536 px one column as wide as the widest list's
   table needs (a long row widens the page on a phone, never a scroller in
   the panel); from 1536 px two columns split 0.9 to 1.1 that a table wider
   than its share pushes (580 and 708 px at 1680 with one visit or none),
   the panels at least 420 px tall (the empty split measured;
   the rule read off today's grid: the 0.36460 / 0.59488
   fractions fitted before left 4 % of the row empty with one visit). */
.ov-tables { display: grid; grid-template-columns: auto; gap: 24px; align-items: start; }
.ov-tables > .ov-panel, .ov-tables .ov-panel-body { min-width: auto; }
@media (min-width: 1536px) {
  .ov-tables { grid-template-columns: 0.9fr 1.1fr; align-items: stretch; }
  .ov-tables .ov-panel { min-height: 420px; }
}
.ov-table-box { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 16px; }
.ov-table thead { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.ov-table tr { border-bottom: 1px solid var(--border); transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.ov-table tbody tr:last-child { border-bottom: 0; }
.ov-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.ov-table th {
  height: 44px; padding: 0 16px; text-align: left; vertical-align: middle; white-space: nowrap;
  font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.ov-table td { padding: 12px 16px; vertical-align: middle; white-space: nowrap; }
.ov-table .ov-right { text-align: right; }
.ov-link { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--primary); text-decoration: none; }
.ov-link:hover { text-decoration: underline; }
.ov-detail { margin-top: 4px; color: var(--muted-foreground); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* The attention table's event column: half the table and no wider, so a long
   error text is cut, as today's (admin-leftovers8). */
.ov-table td.ov-event { width: 50%; max-width: 0; }
/* Its columns are fixed at today's 50, 28 and 22 per cent of the table, so
   the type and time columns give way before the table grows. */
.ov-table-attention { table-layout: fixed; }
.ov-table-attention th:nth-child(1) { width: 50%; }
.ov-table-attention th:nth-child(2) { width: 28%; }
.ov-table-attention th:nth-child(3) { width: 22%; }
.ov-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color: var(--foreground); }
.ov-muted { color: var(--muted-foreground); }
.ov-badge {
  display: inline-flex; align-items: center; justify-content: center; width: fit-content; white-space: nowrap;
  padding: 2px 8px; border: 1px solid transparent; border-radius: 9999px;
  font-size: 10px; line-height: 13.33px; font-weight: 500;
}
.ov-badge-soft { background: var(--secondary); color: var(--secondary-foreground); }
.ov-badge-outline { border-color: var(--border); color: var(--foreground); }
.ov-badge-red { background: var(--destructive); color: #fff; }
.ov-contact { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: #cb2f2f; text-decoration: none; }
.ov-contact > svg { width: 16px; height: 16px; }

/* -- shared pieces of the support pages -------------------------------- */

/* A section's title row with its action on the right (Users / Add User). */
.ad-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
/* The primary button with a leading icon (Add User). */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 16px; flex-shrink: 0;
  height: 36px; padding: 8px 12px; border: 0; border-radius: 8px; white-space: nowrap;
  background: var(--primary); color: var(--primary-foreground);
  font-size: 14px; line-height: 20px; font-weight: 500; outline: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-btn > svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
.ad-btn:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
.ad-btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-btn:disabled { opacity: 0.5; pointer-events: none; }

/* Stacks: the page's 24 px rhythm and the tabs' 16 px. */
.ad-stack { display: flex; flex-direction: column; gap: 24px; }
.ad-stack-16 { display: flex; flex-direction: column; gap: 16px; }
.ad-section-title > h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.ad-section-title > p { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ad-muted { color: var(--muted-foreground); }
.ad-strong { font-weight: 500; }

/* Tabs (one or more triggers in a pale grey track). */
.ad-tabs { display: inline-flex; align-items: center; justify-content: center; width: fit-content; height: 36px; padding: 3px; border-radius: 10px; background: var(--muted); color: var(--muted-foreground); }
.ad-tab {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; height: calc(100% - 1px);
  padding: 4px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; white-space: nowrap;
  color: var(--foreground); font-size: 14px; line-height: 20px; font-weight: 500; outline: none;
  transition: color 150ms, box-shadow 150ms;
}
.ad-tab[aria-selected=true] { background: var(--background); box-shadow: var(--shadow-sm); }
.ad-tab:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); outline: 1px solid var(--ring); }

/* The support pages' table: 14 px rows under a 44 px uppercase head. */
.ad-table-box { position: relative; width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.ad-table { width: 100%; border-collapse: collapse; caption-side: bottom; font-size: 14px; line-height: 20px; }
.ad-table thead { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.ad-table tr { border-bottom: 1px solid var(--border); transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.ad-table tbody tr:last-child { border-bottom: 0; }
.ad-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.ad-table th {
  height: 44px; padding: 0 16px; text-align: left; vertical-align: middle; white-space: nowrap;
  font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.ad-table td { padding: 12px 16px; vertical-align: middle; white-space: nowrap; }
.ad-cell-row { display: flex; align-items: center; gap: 8px; }

/* Badges. */
.ad-badge {
  display: inline-flex; align-items: center; justify-content: center; width: fit-content; flex-shrink: 0; gap: 4px;
  padding: 2px 8px; overflow: hidden; border: 1px solid transparent; border-radius: 9999px; white-space: nowrap;
  font-size: 12px; line-height: 16px; font-weight: 500;
}
.ad-badge-primary { background: var(--primary); color: var(--primary-foreground); }
.ad-badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.ad-badge-outline { border-color: var(--border); color: var(--foreground); }
.ad-dot { display: inline-block; width: 8px; height: 8px; flex-shrink: 0; border-radius: 9999px; }
.ad-dot-green { background: #74c350; }
.ad-dot-grey { background: #9ca3af; }

/* A row's dots menu. */
.ad-row-menu { position: relative; display: flex; justify-content: flex-end; }
.ad-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--foreground); outline: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-icon-btn > svg { width: 16px; height: 16px; }
.ad-icon-btn:hover, .ad-icon-btn[aria-expanded=true] { background: var(--accent); color: var(--accent-foreground); }
.ad-icon-btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-pop-below { position: fixed; min-width: 8rem; }
.ad-pop-danger, .ad-pop-danger > svg { color: #cb2f2f; }
.ad-pop-danger:hover, .ad-pop-danger:focus { background: color-mix(in oklab, #cb2f2f 10%, transparent); color: #cb2f2f; }

/* Dialogs (native <dialog>, opened modal by admin.js). */
.ad-dialog {
  position: fixed; inset: 0; margin: auto; width: calc(100% - 2rem); max-width: 448px; height: fit-content; max-height: calc(100% - 2rem);
  padding: 24px; overflow: visible; border: 1px solid var(--border); border-radius: 10px;
  background: var(--background); color: var(--foreground);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  /* A row's dialogs sit in a table cell: undo what the cell passes down. */
  white-space: normal; text-align: left; font-size: 16px; line-height: 24px; font-weight: 400;
}
.ad-dialog[open] { animation: ad-dialog-in 200ms ease; }
.ad-dialog.ad-closing { animation: ad-dialog-out 200ms ease forwards; }
.ad-dialog::backdrop { background: rgb(0 0 0 / 0.5); animation: ad-fade-in 150ms ease; }
.ad-dialog.ad-closing::backdrop { animation: ad-fade-out 150ms ease forwards; }
@keyframes ad-dialog-in { from { opacity: 0; transform: scale(0.95); } }
@keyframes ad-dialog-out { to { opacity: 0; transform: scale(0.95); } }
@keyframes ad-fade-out { to { opacity: 0; } }
.ad-dialog-head { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ad-dialog-head > h2 { margin: 0; font-size: 18px; line-height: 18px; font-weight: 600; }
.ad-dialog-head > p { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ad-dialog-x {
  position: absolute; top: 16px; right: 16px; display: inline-flex; width: 16px; height: 16px; padding: 0;
  border: 0; border-radius: 2px; background: transparent; color: var(--foreground); opacity: 0.7; outline: none;
  transition: opacity 150ms;
}
.ad-dialog-x:hover { opacity: 1; }
.ad-dialog-x > svg { width: 16px; height: 16px; }
/* On a phone the close button is a 44 px target (the rule above); today's
   icon sits at its left, halfway down. */
.ad-dialog-x { align-items: center; }
/* Today's fields select in the primary colour (the Edit User dialog opens
   with its e-mail selected), and the button a dialog opens on shows its
   ring even when the dialog was opened with a pointer. */
.ad-dialog input::selection { background: var(--primary); color: var(--primary-foreground); }
.ad-dialog .ad-btn-outline[data-opened-focus]:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-form { display: grid; gap: 16px; padding: 16px 0; }
.ad-form-gap { margin-top: 16px; }
.ad-field { display: grid; gap: 8px; }
.ad-field > label { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 14px; font-weight: 500; user-select: none; }
.ad-req { color: #cb2f2f; }
.ad-help { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.ad-input, .ad-select {
  width: 100%; min-width: 0; height: 36px; padding: 4px 12px; border: 1px solid var(--input); border-radius: 8px;
  background: transparent; color: var(--foreground); font: inherit; font-size: 14px; line-height: 20px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: none; transition: color 150ms, box-shadow 150ms, border-color 150ms;
}
.ad-input::placeholder { color: var(--muted-foreground); }
.ad-input:focus-visible, .ad-select:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-input:user-invalid { border-color: var(--destructive); }
.ad-select {
  appearance: none; field-sizing: content; width: auto; justify-self: start; padding: 8px 36px 8px 12px; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5c5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.ad-check { display: flex; align-items: center; gap: 12px; }
.ad-check > label { font-size: 14px; line-height: 14px; user-select: none; }
.ad-check > input[type=checkbox] {
  appearance: none; display: grid; place-content: center; width: 16px; height: 16px; margin: 0; flex-shrink: 0;
  border: 1px solid var(--input); border-radius: 4px; background: transparent; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  cursor: pointer; outline: none;
}
.ad-check > input[type=checkbox]:checked {
  border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fbf8f3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
}
.ad-check > input[type=checkbox]:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; }
.ad-dialog-foot-gap { margin-top: 16px; }
.ad-btn-text { padding: 8px 16px; gap: 8px; }
.ad-btn-danger { background: var(--destructive); color: #fff; }
.ad-btn-danger:hover { background: color-mix(in oklab, var(--destructive) 90%, transparent); }
.ad-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; height: 36px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--foreground);
  font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; outline: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.ad-btn-outline:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ov-chart:focus-visible { outline: none; }
.ov-tip {
  position: absolute; left: 0; top: 0; z-index: 5; display: grid; gap: 4px; width: max-content; padding: 8px;
  border: 1px solid var(--border); border-radius: 10px; background: color-mix(in oklab, var(--background) 95%, transparent);
  color: var(--foreground); font-size: 12px; line-height: 16px; pointer-events: none;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transition: transform 400ms ease;
}
.ov-tip-head { font-weight: 500; }
.ov-tip-rows { display: grid; gap: 4px; }
.ov-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ov-tip-key { display: flex; align-items: center; gap: 8px; }
.ov-tip-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 9999px; }
.ov-tip-name { color: var(--muted-foreground); white-space: nowrap; }
.ov-tip-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-active-dot {
  position: absolute; z-index: 4; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid #fff;
  border-radius: 9999px; pointer-events: none;
}

/* -- the sign-in pages: /login, /recover-password, /reset-password ------- */

.au-frame { display: flex; flex-direction: column; min-height: 100svh; }
.au-brand { display: none; position: relative; }
.au-brand-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.au-brand-inner-small { gap: 12px; }
.au-logo { display: block; height: 56px; width: auto; }
.au-logo-small { display: block; height: 40px; width: auto; }
.au-visit { margin: 0; text-align: center; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.au-visit > a { color: var(--primary); text-decoration: none; }
.au-visit > a:hover { text-decoration: underline; }
.au-main { display: flex; flex-direction: column; min-height: 100svh; padding: 12px 16px; }
@media (min-width: 640px) { .au-main { padding: 16px 24px; } }
.au-top { display: flex; justify-content: flex-end; }
.au-theme-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.au-theme {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--background);
  color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.au-theme:hover { background: var(--accent); color: var(--accent-foreground); }
.au-theme:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.au-theme > svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.au-sun { transform: rotate(0) scale(1); }
.au-moon { position: absolute; transform: rotate(90deg) scale(0); }
html.dark .au-sun { transform: rotate(-90deg) scale(0); }
html.dark .au-moon { transform: rotate(0) scale(1); }
.au-pop { top: calc(100% + 4px); right: 0; left: auto; bottom: auto; min-width: 8rem; }
.au-mobile-brand { display: flex; align-items: center; justify-content: center; min-height: 30svh; }
.au-center { display: flex; flex: 1; align-items: flex-start; justify-content: center; padding-top: 0; }
.au-box { width: 100%; max-width: 320px; }
.au-foot { padding-top: 8px; }
@media (min-width: 960px) {
  .au-frame { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .au-brand { display: flex; align-items: center; justify-content: center; padding: 0 40px; background: var(--muted); }
  .au-mobile-brand { display: none; }
  .au-center { align-items: center; }
  .au-foot { padding-top: 16px; }
}
.au-form { display: flex; flex-direction: column; gap: 24px; }
.au-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.au-head > h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; }
.au-fields { display: grid; gap: 16px; }
.au-item { display: grid; gap: 8px; }
.au-label-row { display: flex; align-items: center; }
.au-label { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 14px; font-weight: 500; user-select: none; }
.au-forgot { margin-left: auto; font-size: 14px; line-height: 20px; color: inherit; text-decoration: none; text-underline-offset: 4px; }
.au-forgot:hover { text-decoration: underline; }
.au-input {
  width: 100%; min-width: 0; height: 36px; padding: 4px 12px; border: 1px solid var(--input); border-radius: 8px;
  background: transparent; color: var(--foreground); font: inherit; font-size: 16px; line-height: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: none; transition: color 150ms, box-shadow 150ms;
}
@media (min-width: 768px) { .au-input { font-size: 14px; line-height: 20px; } }
.au-input::placeholder { color: var(--muted-foreground); }
.au-input::selection { background: var(--primary); color: var(--primary-foreground); }
.au-input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.au-input[aria-invalid=true] { border-color: var(--destructive); box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent); }
.au-password { position: relative; }
.au-password > .au-input { padding-right: 40px; }
.au-eye {
  position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--foreground); outline: none;
}
.au-eye:hover { color: var(--accent-foreground); }
.au-eye:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.au-eye > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted-foreground); pointer-events: none; }
.au-field-message { margin: 0; font-size: 14px; line-height: 20px; color: var(--destructive); }
.au-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 8px 16px;
  border: 0; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); white-space: nowrap;
  font-size: 14px; line-height: 20px; font-weight: 500; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.au-submit:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
.au-submit:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.au-submit:disabled { opacity: 0.5; pointer-events: none; }
.au-note { text-align: center; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.au-alt { text-align: center; font-size: 14px; line-height: 20px; }
.au-alt > a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
.au-message { text-align: center; font-size: 14px; line-height: 20px; }
/* Dev b4883b16: after one's own password change, measured on today's (SH16). */
.au-signed-out { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: var(--card); color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.au-message > p { margin: 0; }
.au-message-error { color: var(--destructive); }
.au-message-title { font-weight: 500; }

/* -- admin-leftovers8 --------------------------------------------------- */

/* Today's toast: bottom right, 24 px in, 356 px wide, rich colours, the
   system font stack, in from below over 400 ms. */
.ad-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 2147483000; display: flex; flex-direction: column-reverse; gap: 14px; width: 356px; margin: 0; padding: 0; pointer-events: none; }
.ad-toast {
  position: relative; display: flex; align-items: center; gap: 6px; box-sizing: border-box; width: 356px; padding: 16px;
  border: 1px solid; border-radius: 10px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.1); pointer-events: auto;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 13px; line-height: 1.5; transition: transform 400ms, opacity 400ms;
}
.ad-toast[data-state=entering], .ad-toast[data-state=leaving] { transform: translateY(100%); opacity: 0; }
.ad-toast-error { background: rgb(255 240 240); border-color: rgb(255 224 225); color: rgb(230 0 0); }
.ad-toast-success { background: rgb(236 253 243); border-color: rgb(191 246 212); color: rgb(0 138 46); }
.ad-toast-close {
  position: absolute; left: -6px; top: -6px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  padding: 0; border: 1px solid; border-color: inherit; border-radius: 50%; background: inherit; color: inherit; cursor: pointer;
  transition: opacity 100ms, background 200ms, border-color 200ms;
}
.ad-toast-close > svg { display: block; width: 12px; height: 12px; }
.ad-toast-icon { display: flex; flex: none; width: 16px; height: 16px; margin: 0 4px 0 -3px; }
.ad-toast-icon > svg { display: block; width: 16px; height: 16px; margin-left: -1px; }
.ad-toast-body { display: flex; flex-direction: column; gap: 2px; }
.ad-toast-title { font-weight: 500; line-height: 1.5; }
.ad-toast-text { line-height: 1.4; }

/* A field's message under it, as today's form shows it after a bad value. */
.ad-field[data-invalid] > label { color: #cb2f2f; }
.ad-field-error { margin: 0; font-size: 14px; line-height: 20px; color: #cb2f2f; }
.ad-input[aria-invalid=true] { border-color: #cb2f2f; }
.ad-input[aria-invalid=true]:focus-visible { box-shadow: 0 0 0 3px rgb(203 47 47 / 0.2); }

/* The kit's select: the trigger and its list, centred under it. */
.ad-sel { position: relative; justify-self: start; }
.ad-sel-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 8px 12px;
  border: 1px solid var(--input); border-radius: 8px; background: transparent; color: var(--foreground);
  font: inherit; font-size: 14px; line-height: 20px; white-space: nowrap; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  cursor: default; outline: none; transition: color 150ms, box-shadow 150ms, border-color 150ms;
}
.ad-sel-trigger > span { display: flex; align-items: center; }
.ad-sel-trigger > svg { width: 16px; height: 16px; flex: none; opacity: 0.5; color: var(--muted-foreground); }
.ad-sel-trigger:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ad-sel-list {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 50%; translate: -50% 0; min-width: 128px; box-sizing: border-box;
  padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--popover, #fff); color: var(--popover-foreground, inherit);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.ad-sel-list[data-state=open] { animation: ad-sel-in 150ms ease; }
.ad-sel-list[data-state=closed] { animation: ad-sel-out 150ms ease forwards; }
@keyframes ad-sel-in { from { opacity: 0; transform: translateY(-8px) scale(0.95); } }
@keyframes ad-sel-out { to { opacity: 0; transform: scale(0.95); } }
.ad-sel-opt {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 32px 6px 8px; border-radius: 6px;
  font-size: 14px; line-height: 20px; white-space: nowrap; cursor: default; outline: none; user-select: none;
}
.ad-sel-opt[data-highlighted] { background: var(--color-eplast-ice-100); color: rgb(30 37 59); }
.ad-sel-opt > svg { position: absolute; right: 7px; width: 16px; height: 16px; color: var(--muted-foreground); }
.ad-sel-opt[aria-selected=false] > svg { display: none; }

/* The cart/update advice per failed line (cart_failures.rs), on the visit page and the overview. */
.acx-cf-badge, .acx-cf-code { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 9999px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.acx-cf-owner a, .acx-cf-link { color: var(--primary); }
.acx-cf-owner a:hover, .acx-cf-link:hover { text-decoration: underline; }
.acx-cf-line { margin: 0 0 16px; padding-left: 12px; border-left: 2px solid oklch(0.769 0.188 70.08); font-size: 14px; line-height: 20px; }
.acx-cf-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.acx-cf-line-head > strong { font-weight: 700; }
.acx-cf-line .acx-cf-code { margin-left: 0; }
.acx-cf-line > h4 { margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; }
.acx-cf-line > ol { margin: 0 0 8px; padding-left: 20px; list-style: decimal; }
.acx-cf-line > ol > li + li { margin-top: 4px; }
.acx-cf-last-resort { margin: 0 0 8px; }
.acx-cf-link { display: inline-block; margin-bottom: 8px; }
.acx-cf-small { margin: 0 0 8px; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.acx-cf-small.acx-cf-fixed { margin-bottom: 0; }
.acx-cf-line:last-child { margin-bottom: 0; }
/* The overview's cart rows: **Se anbefalte tiltak** opens the advice in the row. */
.ov-advice { margin-top: 8px; }
.ov-advice > summary { display: list-item; list-style: inside disclosure-closed; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--foreground); cursor: pointer; }
.ov-advice[open] > summary { list-style-type: disclosure-open; }
.ov-advice-body { margin-top: 8px; }
.ov-table-attention td { vertical-align: top; }

/* -- dark: what the tokens do not carry ------------------------------------
   Today's support pages in dark draw a few things otherwise than their light
   tokens would give: measured on today's pages with the Appearance choice
   Dark, element by element against the same element in light. Light is
   untouched by everything below. */

/* The logo and the sidebar's mark are today's negative files in dark: the
   page carries both, and shows the one for its appearance. */
html:not(.dark) .ad-dark-only, html.dark .ad-light-only { display: none !important; }

/* Fields: a 30 % wash of the input colour where light has none. */
html.dark :is(input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color], [type=submit], [type=button], [type=hidden]), textarea, select),
html.dark :is(.ad-sel-trigger, .at-sel-trigger, .mf-sel-t, .xw-sel-t, .acx-select > button),
html.dark input[type=checkbox]:not(:checked) {
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
}
html.dark :is(.ad-sel-trigger, .at-sel-trigger, .mf-sel-t, .xw-sel-t, .acx-select > button, select):hover {
  background-color: color-mix(in oklab, var(--input) 50%, transparent);
}

/* Outline buttons: the same wash, bordered in the input colour. */
html.dark :is(.ad-btn-outline, .acx-btn-outline, .at-btn-line, .rk-btn-line, .mf-obtn, .px-btn, .au-theme) {
  border-color: var(--input);
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
}
html.dark :is(.ad-btn-outline, .acx-btn-outline, .at-btn-line, .rk-btn-line, .mf-obtn, .px-btn, .au-theme):hover {
  background-color: color-mix(in oklab, var(--input) 50%, transparent);
}
/* Ghost buttons light up at half the accent. */
html.dark :is(.acx-btn-ghost, .at-btn-ghost, .mf-ghost, .ad-icon-btn):hover {
  background-color: color-mix(in oklab, var(--accent) 50%, transparent);
}

/* Tabs: the chosen one washed and bordered, the others in the muted text. */
html.dark :is(.ad-tab, .acx-tabs > button, .mf-tab) { color: var(--muted-foreground); }
html.dark :is(.ad-tab[aria-selected=true], .acx-tabs > button[aria-selected="true"], .mf-tab[aria-selected="true"]) {
  border-color: var(--input);
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
  color: var(--foreground);
}

/* Destructive buttons and badges at 60 %. */
html.dark :is(.ad-btn-danger, .ov-badge-red, .rk-badge-red, .at-badge-red) {
  background-color: color-mix(in oklab, var(--destructive) 60%, transparent);
}

/* Amber notices (Needs attention on /manufacturing): today's dark amber
   wash at 20 % instead of the pale yellow. */
html.dark .mf-warn { background: color-mix(in oklab, oklch(0.279 0.077 45.635) 20%, transparent); }
html.dark .mf-abtn { background-color: color-mix(in oklab, var(--input) 30%, transparent); }

/* The overview chart's axis words, in the muted text as today's. */
html.dark .ov-chart { color: var(--muted-foreground); }

/* The toasts follow the system's appearance, not the stored choice, as
   today's do: dark rich colours whenever the system is dark. */
@media (prefers-color-scheme: dark) {
  .ad-toast-error { background: hsl(358, 76%, 10%); border-color: hsl(357, 89%, 16%); color: hsl(358, 100%, 81%); }
  .ad-toast-success { background: hsl(150, 100%, 6%); border-color: hsl(147, 100%, 12%); color: hsl(150, 86%, 65%); }
}
