:root {
  --rt-light-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  /* Branch palette (D7): Stock darkened to terracotta, Categories moved to slate. */
  --rt-category: #64748b; /* was #ffc400 amber — moved off amber to avoid clashing with Stock */
  --rt-company: #0078d4;
  --rt-delivery: #4830d1;
  --rt-validation: #1ba756;
  --rt-location: #17b3a3; /* deepened from #66dcc5 for legibility as text on white */
  --rt-setting: #2a4a5a;
  --rt-search: #17a2b8;
  --rt-user: #4e4083;
  --rt-fushsia: #915c83;
  --rt-green20: #498205;
  --rt-item: #503191;
  --rt-stock: #e8590c; /* was #ff9000 — terracotta, deeper and clear of the amber family */
  --rt-dark-orange: #dd5030;
  --rt-inhouse: #008080;
  --rt-notice: #e9681e;
}

a {
  text-decoration: none;
  color: #024c9b;
}
a:hover {
  color: purple;
}

.navbar-nav .nav-link .bi,
.dropdown-menu .dropdown-item .bi {
  margin-right: 0.1rem;
}

.navbar {
  box-shadow: var(--rt-light-shadow);
}

.panel {
  margin-bottom: 0.75rem;
  background-color: #fff;
  border: 1px solid #eee;
}

.panel-heading {
  padding: 3px;
  padding-top: 5px;
  padding-left: 15px;
  color: var(--bs-body-color);
  background-color: var(--bs-light);
  box-shadow: var(--rt-light-shadow);
}

.panel-psuedo-heading {
  padding: 3px;
  padding-top: 5px;
  padding-left: 15px;
  color: var(--bs-body-color);
  background-color: var(--bs-light);
  box-shadow: var(--rt-light-shadow);
}

.panel-content {
  padding: 10px;
}

.panel-group {
  margin-bottom: 5px;
  border-radius: 2px;
}

.panel-hidden {
  display: none;
}

.panel-heading .badge {
  float: right;
}

.badge-right {
  float: right;
}

.input-group-text-fw-sm {
  width: 8rem;
}

.input-group-text-fw-md {
  width: 10rem;
}

.input-group-text-fw-lg {
  width: 12rem;
}

.type-search-input {
  position: relative; /* Ensures the search results are positioned in relation to the search box */
}

.type-search-result {
  left: 5%;
  top: 100%; /* Positions the top of the div right below the search box */
  width: 90%; /* Matches the width of the search box */
  position: absolute;
  z-index: 1050; /* above the form card / panels */
  border-radius: var(--rt-radius-sm);
  background: var(--rt-surface);
  border: 1px solid var(--rt-line);
  box-shadow: var(--rt-shadow);
  max-height: 260px; /* show ~6 rows, then scroll — never clip results */
  overflow-y: auto;
}
/* result rows in the type-ahead dropdown */
.type-search-result .list-group-item {
  border: 0; border-bottom: 1px solid var(--rt-line-soft);
  padding: 9px 13px; font-size: 13.5px; color: var(--rt-ink);
  background: var(--rt-surface); border-radius: 0;
}
.type-search-result .list-group-item:last-child { border-bottom: 0; }
.type-search-result .list-group-item:hover {
  background: color-mix(in srgb, var(--rt-stock) 8%, var(--rt-surface)); color: var(--rt-stock);
}

/* Auto-dismiss alert transition */
.alert.auto-dismiss {
  transition: opacity 0.5s ease-out, max-height 0.5s ease-out, padding 0.5s ease-out, margin 0.5s ease-out;
  opacity: 1;
  max-height: 60px; /* Adjust based on your alert's typical height */
  overflow: hidden;
  padding: 10px; /* Adjust to your alert's default padding */
  margin: 10px 0; /* Adjust to your alert's default margin */
}

.alert.auto-dismiss.hide {
  opacity: 0; /* Fully transparent */
  max-height: 0; /* Collapse the alert */
  padding: 0; /* Remove padding during collapse */
  margin: 0; /* Remove margin during collapse */
}

.alert.auto-dismiss .btn-close {
  display: none; /* Hide the close button */
}

#alerts-container {
  position: fixed; /* or absolute */
  top: 0px;
  left: 25%;
  z-index: 1050;
  width: 50%;
  overflow: auto;
}

.category-text-color {
  color: var(--rt-category);
}
.company-text-color {
  color: var(--rt-company);
}
.delivery-text-color {
  color: var(--rt-delivery);
}
.item-text-color {
  color: var(--rt-item);
}
.stock-text-color {
  color: var(--rt-stock);
}
.inhouse-text-color {
  color: var(--rt-inhouse);
}
.inhousereagent-text-color {
  color: var(--rt-inhouse);
}
.location-text-color {
  color: var(--rt-location);
}
.setting-text-color {
  color: var(--rt-setting);
}
.scan-text-color {
  color: var(--bs-secondary);
}
.search-text-color {
  color: var(--rt-search);
}
.user-text-color {
  color: var(--rt-user);
}
.validation-text-color {
  color: var(--rt-validation);
}
.text-gray-100 {
  color: var(--bs-gray-100);
}
.text-gray-300 {
  color: var(--bs-gray-300);
}
.text-gray-500 {
  color: var(--bs-gray-500);
}
.fushia-text-color {
  color: var(--rt-fushsia);
}
.green20-text-color {
  color: var(--rt-green20);
}
.inhousestock-text-color {
  color: var(--rt-inhousestock);
}

.notice-text-color {
  color: var(--rt-notice);
}
/* width control */

.max-width-25pc {
  max-width: 25% !important;
}

.max-width-50pc {
  max-width: 50% !important;
}

.max-width-75pc {
  max-width: 75% !important;
}

.max-width-100pc {
  max-width: 100% !important;
}

.max-width-50px {
  max-width: 50px !important;
}

.max-width-75px {
  max-width: 75px !important;
}

.max-width-100px {
  max-width: 100px !important;
}

.max-width-150px {
  max-width: 150px !important;
}

.overflow-wrap-hidden {
  overflow: hidden;
  word-wrap: break-word;
}

.overflow-wrap-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* td input control */
.form-control-sm-fh {
  height: calc(1.25rem + 2px);
  font-size: 1rem;
  padding: 0.1rem;
  border-radius: 0.2rem;
  border: 1px solid #ced4da;
  text-align: right;
}

/* Fade-in class */
.fade-in {
  animation: fadeInAnimation ease 0.5s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

@keyframes fadeInAnimation {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Fade-out class */
.fade-out {
  animation: fadeOutAnimation ease 0.5s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

@keyframes fadeOutAnimation {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* callout classes */
.callout-thin {
  padding: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e9ecef;
  border-left-width: 0.25rem;
  border-radius: 0.25rem;
}
.callout {
  padding: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e9ecef;
  border-left-width: 0.5rem;
  border-radius: 0.25rem;
}

.callout-primary {
  border-left-color: var(--bs-primary);
}
.callout-secondary {
  border-left-color: var(--bs-secondary);
}
.callout-success {
  border-left-color: var(--bs-success);
}
.callout-danger {
  border-left-color: var(--bs-danger);
}
.callout-warning {
  border-left-color: var(--bs-warning);
}
.callout-info {
  border-left-color: var(--bs-info);
}
.callout-light {
  border-left-color: var(--bs-light);
}
.callout-dark {
  border-left-color: var(--bs-dark);
}
.callout-item {
  border-left-color: var(--rt-item);
}
.callout-stock {
  border-left-color: var(--rt-stock);
}

/* composite icon classes */
.icon-with-text {
  position: relative;
  display: inline-block;
}
.icon-with-text .icon-with-text-icon {
  font-size: 1.5em;
}
.icon-with-text .icon-with-text-low {
  position: absolute;
  top: 63%;
  left: 48%;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  transform: translate(-50%, -50%);
}

.icon-with-text .icon-with-text-center {
  position: absolute;
  top: 53%;
  left: 48%;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  transform: translate(-50%, -50%);
}
.icon-with-text .icon-with-text-high {
  position: absolute;
  top: 43%;
  left: 48%;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  transform: translate(-50%, -50%);
}

.table-compact td {
  padding-top: 0px;
  padding-bottom: 0px;
}

/* Custom class for small devices (sm) and up */
@media (min-width: 576px) {
  /* Bootstrap 'sm' breakpoint */
  .fs-sm-5 {
    font-size: 1.25rem !important; /* Adjust this value to match Bootstrap's .fs-5 */
  }
}

/* expand the min-vh class */
.min-vh-25 {
  min-height: 25vh !important;
}
.min-vh-50 {
  min-height: 50vh !important;
}
.min-vh-75 {
  min-height: 75vh !important;
}

/* search box related classes */
.search-container {
  display: flex;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-end;
  position: relative;
}
.search-results-panel {
  display: none;
  position: absolute;
  z-index: 1000;
  min-width: 300px;
  max-width: 500px;
  top: 38px;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  margin-top: 0.5rem;
  padding: 10px;
  right: 0;
  background-color: white;
  text-align: left;
  width: 100%;
}

/* =========================================================================
   ReagenTree redesign — design tokens + shell components (D7)
   Added additively; existing rules above are untouched so current pages keep
   working while templates migrate stage by stage.
   ========================================================================= */
:root {
  /* neutral surfaces (light) — deeper ground + firmer lines so white cards
     read with real contrast rather than washing out */
  --rt-ground: #e9edf1;
  --rt-surface: #ffffff;
  --rt-surface-2: #f3f6f9;
  --rt-surface-3: #e7ecf1;
  --rt-line: #cfd8e0;
  --rt-line-soft: #dfe5eb;
  --rt-ink: #18212a;
  --rt-ink-dim: #43505c;
  --rt-muted: #79879a;
  /* state (independent of section colour) */
  --rt-crit: #e5484d;
  --rt-warn: #e0900a;
  --rt-good: #2e9e6b;
  /* per-page accent: pages set --rt-accent to their section colour */
  --rt-accent: var(--rt-stock);
  /* type + shape */
  --rt-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rt-radius: 12px;
  --rt-radius-sm: 8px;
  --rt-shadow: 0 1px 2px rgba(20, 30, 40, 0.06), 0 4px 14px -6px rgba(20, 30, 40, 0.14);
}
[data-theme="dark"] {
  --rt-ground: #12161a;
  --rt-surface: #1a1f25;
  --rt-surface-2: #20262d;
  --rt-surface-3: #272e36;
  --rt-line: #2c343d;
  --rt-line-soft: #232a31;
  --rt-ink: #e8edf1;
  --rt-ink-dim: #b3bec8;
  --rt-muted: #7d8b98;
  --rt-stock: #ff7a3d;      /* lift the darker branch hues for the dark ground */
  --rt-category: #94a3b8;
  --rt-location: #3fd0be;
}

/* section accent helpers — a page/container sets one of these to colour itself */
.accent-stock    { --rt-accent: var(--rt-stock); }
.accent-item,
.accent-reagent  { --rt-accent: var(--rt-item); }
.accent-inhouse  { --rt-accent: var(--rt-inhouse); }
.accent-category { --rt-accent: var(--rt-category); }
.accent-company  { --rt-accent: var(--rt-company); }
.accent-location { --rt-accent: var(--rt-location); }
.accent-validation { --rt-accent: var(--rt-validation); }
.accent-user { --rt-accent: var(--rt-user); }
.accent-info { --rt-accent: var(--rt-company); }   /* blue — general / informational */
.accent-warn { --rt-accent: var(--rt-warn); }      /* amber — needs action */
.accent-recipe { --rt-accent: var(--rt-inhouse); } /* recipe == in-house teal */
.accent-stockentry { --rt-accent: var(--rt-stock); }
.accent-notice { --rt-accent: var(--rt-notice); }

/* tabular figures for lots / quantities / dates */
.rt-num { font-variant-numeric: tabular-nums; }

/* ---- app shell ---- */
.rt-app { background: var(--rt-ground); color: var(--rt-ink); min-height: 100vh; font-family: var(--rt-font); }

/* navbar */
.rt-navbar {
  height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 14px;
  background: var(--rt-surface); border-bottom: 1px solid var(--rt-line);
  position: sticky; top: 0; z-index: 1030;
}
.rt-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; padding-right: 10px; }
.rt-brand .rt-mark {
  width: 27px; height: 27px; border-radius: 7px;
  background: linear-gradient(135deg, var(--rt-stock), var(--rt-notice));
  display: grid; place-items: center; color: #fff;
}
.rt-nav-links { display: flex; align-items: center; gap: 2px; }
.rt-nav-link {
  display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: var(--rt-radius-sm);
  color: var(--rt-ink-dim); font-size: 13.5px; font-weight: 500; cursor: pointer; --c: var(--rt-muted);
}
.rt-nav-link .bi { color: var(--c); }
.rt-nav-link:hover { background: var(--rt-surface-2); color: var(--rt-ink); }
.rt-nav-link.active { color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); font-weight: 600; }
.rt-nav-link.nl-stock    { --c: var(--rt-stock); }
.rt-nav-link.nl-reagent  { --c: var(--rt-item); }
.rt-nav-link.nl-category { --c: var(--rt-category); }
.rt-nav-link.nl-company  { --c: var(--rt-company); }
.rt-nav-link.nl-location { --c: var(--rt-location); }
.rt-nav-spacer { flex: 1; }

/* page header */
.rt-page { padding: 14px 22px 26px; max-width: 1180px; margin: 0 auto; }
.rt-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.rt-page-title { display: flex; align-items: center; gap: 11px; }
.rt-page-title h1 { font-size: 20px; margin: 0; font-weight: 600; }
.rt-page-badge {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--rt-accent) 14%, transparent); color: var(--rt-accent);
}
.rt-tag {
  font-size: 11px; letter-spacing: 0.04em; color: var(--rt-muted);
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-radius: 999px;
  padding: 3px 10px; font-variant-numeric: tabular-nums;
}

/* buttons */
.rt-btn {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--rt-radius-sm); border: 1px solid var(--rt-line);
  background: var(--rt-surface); color: var(--rt-ink); cursor: pointer; text-decoration: none;
}
.rt-btn:hover { border-color: var(--rt-muted); color: var(--rt-ink); }
.rt-btn-primary { background: var(--rt-accent); color: #fff; border-color: var(--rt-accent); font-weight: 600; }
.rt-btn-primary:hover { filter: brightness(1.05); color: #fff; }
.rt-btn-sm { padding: 5px 10px; font-size: 12px; }
.rt-btn-danger { color: var(--rt-crit); border-color: color-mix(in srgb, var(--rt-crit) 40%, var(--rt-line)); }
.rt-btn-danger:hover { background: color-mix(in srgb, var(--rt-crit) 12%, transparent); border-color: var(--rt-crit); color: var(--rt-crit); }

/* expired-lot usage confirmation (inline + QR) */
.rt-expired-confirm { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.rt-expired-msg { color: var(--rt-crit); font-size: 12.5px; font-weight: 500; }
.rt-expired-actions { display: flex; gap: 8px; }
.rt-qr-expired-warn { text-align: center; color: var(--rt-crit); font-weight: 600; font-size: 16px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.rt-qr-confirm-actions { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
/* --- Reports: inventory snapshot --- */
/* "as of" status label — button-shaped to sit with the JSON/Print buttons, but a
   subtle tint and no interactivity (it's a label, not a control). */
.rt-asof {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--rt-radius-sm);
  border: 1px solid var(--rt-line-soft); background: var(--rt-surface-2); color: var(--rt-muted);
}
.rt-asof i { font-size: 12px; }
/* headline stats as two compact grids (not big hero cards): a titled box whose
   cells are small value+label pairs with a colour dot. Reads like data. */
/* report body: match the homepage dashboard's tighter 12px card gap */
.rt-report .rt-detail-body { gap: 12px; }

/* the two short alert strips sit side by side when wide, stack when narrow */
.rt-glance-row { display: flex; flex-wrap: wrap; gap: 12px; }
.rt-glance-row > .rt-glance { flex: 1 1 320px; margin: 0; }

/* --- Shared in-page search box (consumption + list pages) --- */
.rt-cons-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.rt-cons-search, .rt-list-search { position: relative; display: flex; align-items: center; }
.rt-cons-search > .bi-search, .rt-list-search > .bi-search { position: absolute; left: 10px; color: var(--rt-muted); font-size: 13px; pointer-events: none; }
.rt-cons-search input[type="search"], .rt-list-search input[type="search"] { width: 220px; max-width: 100%; padding: 6px 30px 6px 30px; font-size: 13px; color: var(--rt-ink); background: var(--rt-surface); border: 1px solid var(--rt-line); border-radius: 999px; }
.rt-cons-search input[type="search"]:focus, .rt-list-search input[type="search"]:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-accent) 18%, transparent); }
.rt-cons-search input::-webkit-search-cancel-button, .rt-list-search input::-webkit-search-cancel-button { display: none; }
.rt-cons-clear, .rt-list-search-clear { position: absolute; right: 9px; display: flex; color: var(--rt-muted); font-size: 12px; text-decoration: none; }
.rt-cons-clear:hover, .rt-list-search-clear:hover { color: var(--rt-ink); }
.rt-num-h { text-align: right; }
.rt-cons-name { min-width: 0; }
.rt-cons-name a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: bottom; }
.rt-cons-total { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.rt-cons-amt { font-size: 14px; font-weight: 600; color: var(--rt-ink); white-space: nowrap; }
.rt-cons-count { text-align: right; color: var(--rt-ink-dim); }
.rt-cons-dash { color: var(--rt-muted); }
/* runway/trend cells hold a pill/inline value — right-align it under the
   right-aligned header (grid cells default to start otherwise). */
.rt-cons-cell { text-align: right; }
/* Runway — how long current stock lasts. Colour is the whole point: red = reorder now. */
.rt-runway { display: inline-block; font-size: 12.5px; font-weight: 600; white-space: nowrap; padding: 1px 8px; border-radius: 999px; }
.rt-runway-low   { color: var(--rt-crit); background: color-mix(in srgb, var(--rt-crit) 14%, transparent); }
.rt-runway-ok    { color: var(--rt-warn); background: color-mix(in srgb, var(--rt-warn) 15%, transparent); }
.rt-runway-good  { color: var(--rt-good); background: color-mix(in srgb, var(--rt-good) 15%, transparent); }
.rt-runway-empty { color: var(--rt-ink-dim); background: var(--rt-surface-3); }
/* Trend vs previous period — direction and magnitude, quietly. */
.rt-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rt-trend-up   { color: var(--rt-crit); }   /* using more than before — watch it */
.rt-trend-down { color: var(--rt-good); }   /* using less — fine */
.rt-trend-flat { color: var(--rt-muted); font-weight: 500; }

/* --- Stock-take checklist --- */
.rt-stk-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 11px 14px; border: 1px solid var(--rt-line); border-radius: var(--rt-radius); background: var(--rt-surface-2); }
.rt-stk-ctl { display: flex; align-items: center; gap: 8px; }
.rt-stk-ctl select { min-width: 180px; }
.rt-stk-check { cursor: pointer; }
.rt-stk-summary { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--rt-muted); font-variant-numeric: tabular-nums; }
.rt-stk-summary.has-problem { color: var(--rt-crit); }
.rt-stk-summary.done { color: var(--rt-validation); }

/* Stock-take: one checklist LINE per lot (not per bottle). A lot of identical
   bottles collapses to "N × amount"; you tick "all present" and pen in exceptions.
   Print-first — a sheet you walk the shelf with — with light screen interactivity. */
.rt-stk-body { padding: 4px 14px 10px; }
.rt-stk-lot { padding: 1px 0; border-bottom: 1px solid var(--rt-line-soft); }
.rt-stk-lot:last-child { border-bottom: none; }
.rt-stk-name { font-weight: 600; font-size: 14px; }

.rt-stk-lot-row { display: grid; grid-template-columns: 22px minmax(0, 1.9fr) 130px 1fr; align-items: center; gap: 10px; padding: 2px 0; }
.rt-stk-lot-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.rt-stk-qty { text-align: right; white-space: nowrap; color: var(--rt-ink-dim); }
/* hand-written exception slots: "missing ____ · count≠ ____" */
.rt-stk-exc { font-size: 12px; color: var(--rt-muted); white-space: nowrap; text-align: right; }
.rt-stk-write { display: inline-block; min-width: 46px; border-bottom: 1px solid var(--rt-line); vertical-align: baseline; margin: 0 2px; }
.rt-stk-sep { margin: 0 4px; opacity: 0.5; }

/* the tick-box (screen: click/space toggles; print: an empty square to pen) */
.rt-stk-box { display: inline-block; width: 15px; height: 15px; border: 1.5px solid var(--rt-muted); border-radius: 3px; cursor: pointer; flex: none; position: relative; }
.rt-stk-box.small { width: 13px; height: 13px; }
.rt-stk-box:focus-visible { outline: 2px solid var(--rt-accent); outline-offset: 1px; }
.rt-stk-box.on { background: var(--rt-validation); border-color: var(--rt-validation); }
.rt-stk-box.on::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.rt-stk-bottles { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 4px 0 6px 32px; }
.rt-stk-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--rt-ink-dim); white-space: nowrap; }

@media print {
  .rt-stk-controls, .rt-stk-summary { display: none !important; }
  /* pen-tickable boxes; keep the sheet dense and lots unbroken across pages */
  .rt-stk-box { border-color: #000 !important; background: #fff !important; }
  .rt-stk-box.on::after { border-color: #000; }
  .rt-stk-write { border-bottom-color: #000; }
  /* tightest on paper — a shelf-walk sheet fits as many lots per page as it can */
  .rt-stk-lot { break-inside: avoid; padding: 0; border-bottom-color: #d9d9d9; }
  .rt-stk-lot-row { padding: 1px 0; }
  .rt-stk-body { padding: 2px 10px 6px; }
  .rt-stk-bottles { break-inside: avoid; padding: 1px 0 3px 32px; }
  .rt-panel.rt-stk-loc { break-inside: auto; }
}

/* "at a glance" census strip — report scale, presented modestly (inline, wraps) */
.rt-glance {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 11px 14px; font-size: 13px; color: var(--rt-ink-dim);
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius); background: var(--rt-surface-2);
}
.rt-glance-t { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rt-muted); font-weight: 600; margin-right: 2px; }
.rt-glance-i b { color: var(--rt-ink); font-weight: 700; margin-right: 3px; }
.rt-glance-i.muted b { color: var(--rt-muted); }
.rt-glance-sep { width: 1px; align-self: stretch; background: var(--rt-line); margin: 0 2px; }
/* coloured-dot glance items (expired / expiring); links get a hover */
.rt-glance-i.dot-crit, .rt-glance-i.dot-warn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--rt-ink-dim); border-radius: var(--rt-radius-sm); padding: 1px 6px 1px 2px; }
.rt-glance-i.dot-crit::before, .rt-glance-i.dot-warn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rt-glance-i.dot-crit::before { background: var(--rt-crit); }
.rt-glance-i.dot-warn::before { background: var(--rt-warn); }
a.rt-glance-i:hover { background: var(--rt-surface); }
/* the 'needs attention' strip gets a faint red wash so it reads as an alert */
.rt-glance-alert { border-color: color-mix(in srgb, var(--rt-crit) 30%, var(--rt-line)); background: color-mix(in srgb, var(--rt-crit) 6%, var(--rt-surface-2)); }

/* two reference tables side by side; single column on narrow. A min-height keeps
   the pair balanced even when one has only a couple of rows. */
.rt-report-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.rt-report-pair > .rt-panel { min-height: 320px; display: flex; flex-direction: column; margin-bottom: 0; }
.rt-report-pair > .rt-panel > .rt-panel-body { flex: 1; }
@media (max-width: 760px) { .rt-report-pair { grid-template-columns: 1fr; } .rt-report-pair > .rt-panel { min-height: 0; } }

.rt-report-more { font-size: 12.5px; font-weight: 500; color: var(--rt-accent); text-decoration: none; margin-left: auto; }
.rt-panel-body > .rt-report-more { display: inline-block; margin: 10px 0 0; }
.rt-report-more:hover { text-decoration: underline; }

@media print {
  .rt-navbar, .rt-shell-nav, .navbar, .rt-page-actions, footer { display: none !important; }
  .rt-page { padding-top: 0 !important; }
  main#main-content { padding-top: 0 !important; }
  .rt-report-pair { display: block; }
  .rt-panel, .rt-glance { break-inside: avoid; }
  body { background: #fff; }
}

.rt-usage-blocked { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rt-crit); }
.rt-usage-blocked-dismiss { color: var(--rt-muted); text-decoration: none; font-size: 15px; line-height: 1; }
.rt-usage-blocked-dismiss:hover { color: var(--rt-crit); }

/* QR usage: per-lot amount preset chips */
.rt-qr-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.rt-qr-preset {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rt-line);
  background: var(--rt-surface); color: var(--rt-ink); font-size: 14px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.rt-qr-preset:hover { border-color: var(--rt-accent); color: var(--rt-accent); }
.rt-qr-preset.on { background: var(--rt-accent); border-color: var(--rt-accent); color: #fff; }

/* QR usage: 'logged' confirmation screen */
.rt-qr-logged { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 0 4px; }
.rt-qr-logged-tick { color: var(--rt-validation); font-size: 40px; line-height: 1; }
.rt-qr-logged-amount { font-size: 18px; font-weight: 650; color: var(--rt-ink); }
.rt-qr-logged-remaining { font-size: 13px; color: var(--rt-muted); }
.rt-qr-logged-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

/* Receive-delivery stepped mobile flow */
.rt-recv-page { display: flex; justify-content: center; padding: 24px 16px 48px; }
.rt-recv-card { width: 100%; max-width: 460px; border-top: 3px solid var(--rt-accent); padding: 20px 18px 22px; }
.rt-recv-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.rt-recv-dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--rt-surface-3); color: var(--rt-muted);
}
.rt-recv-dot.on { background: var(--rt-accent); color: #fff; }
.rt-recv-title { font-size: 18px; font-weight: 650; color: var(--rt-ink); margin: 0 0 14px; }
.rt-recv-label { display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rt-muted); font-weight: 600; margin: 12px 0 4px; }
.rt-recv-step .rt-control { width: 100%; }
.rt-recv-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.rt-recv-errors { background: color-mix(in srgb, var(--rt-crit) 10%, transparent); color: var(--rt-crit); border-radius: var(--rt-radius-sm); padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.rt-recv-errors > div { display: flex; gap: 6px; align-items: center; }
.rt-recv-review { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.rt-recv-review dt { color: var(--rt-muted); font-size: 13px; }
.rt-recv-review dd { margin: 0; color: var(--rt-ink); font-weight: 500; }
.rt-recv-card .type-search-result { position: relative; z-index: 5; }

/* cards / list rows */
.rt-card {
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius); background: var(--rt-surface);
  box-shadow: var(--rt-shadow); overflow: hidden; margin-bottom: 10px;
}
.rt-card-accent { position: relative; }
.rt-card-accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rt-accent); opacity: 0.55; }

/* pills / state chips */
.rt-pill {
  font-size: 10.5px; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; text-transform: uppercase; font-weight: 600;
}
.rt-pill .rt-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rt-pill-ok { color: var(--rt-validation); background: color-mix(in srgb, var(--rt-validation) 13%, transparent); }
.rt-pill-warn { color: var(--rt-warn); background: color-mix(in srgb, var(--rt-warn) 15%, transparent); }
.rt-pill-crit { color: var(--rt-crit); background: color-mix(in srgb, var(--rt-crit) 13%, transparent); }
.rt-pill-inhouse { color: var(--rt-inhouse); background: color-mix(in srgb, var(--rt-inhouse) 14%, transparent); }

/* fill meter */
.rt-meter { height: 4px; border-radius: 2px; background: var(--rt-surface-3); overflow: hidden; width: 80px; }
.rt-meter > i { display: block; height: 100%; background: var(--rt-accent); }
.rt-meter > i.low { background: var(--rt-warn); }

/* form controls */
.rt-field { margin-bottom: 16px; }
.rt-field > label { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rt-muted); margin-bottom: 6px; }
.rt-control {
  width: 100%; background: var(--rt-surface); border: 1px solid var(--rt-line); border-radius: var(--rt-radius-sm);
  padding: 10px 13px; color: var(--rt-ink); font-size: 14px; font-family: var(--rt-font);
}
.rt-control:focus { outline: none; border-color: var(--rt-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-accent) 20%, transparent); }


/* ---- stock list (D7) ---- */
.rt-page-body { margin-top: 4px; }
.rt-filters { display: inline-flex; gap: 4px; margin-right: 4px; }
.rt-filter { font-size: 12.5px; padding: 6px 13px; border-radius: 999px; color: var(--rt-muted); border: 1px solid transparent; text-decoration: none; }
.rt-filter:hover { color: var(--rt-ink); }
.rt-filter.on { background: color-mix(in srgb, var(--rt-accent) 12%, transparent); border-color: color-mix(in srgb, var(--rt-accent) 30%, transparent); color: var(--rt-accent); }

/* match the item list's rhythm: 8px between cards, no doubled-up margin
   (.rt-card carries a 10px margin-bottom that stacked on top of this gap) */
.rt-stock-list { display: flex; flex-direction: column; gap: 8px; }
.rt-stock-list .rt-card { margin-bottom: 0; }

/* header row: name grows, three fixed data columns, actions */
.rt-stock-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 110px 110px 108px;
  align-items: center; gap: 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--rt-line-soft);
}
.rt-stock-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rt-stock-nm { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rt-ink); text-decoration: none; }
.rt-stock-nm:hover { color: var(--rt-accent); }
.rt-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-kv .rt-k { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rt-muted); }
.rt-kv .rt-v { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; color: var(--rt-ink); }
a.rt-v:hover { color: var(--rt-accent); }
.rt-stock-actions { display: flex; gap: 2px; justify-content: flex-end; }
/* Quiet by default: actions fade in on hover of their card / bottle row.
   On touch devices (no hover) they stay visible so they're always reachable. */
@media (hover: hover) {
  .rt-stock-actions { opacity: 0; transition: opacity 0.12s ease; }
  .rt-card:hover .rt-stock-top .rt-stock-actions,
  .rt-entry:hover .rt-stock-actions,
  .rt-stock-actions:focus-within { opacity: 1; }
}
.rt-icon-btn { width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--rt-muted); text-decoration: none; font-size: 14px; }
.rt-icon-btn:hover { background: var(--rt-surface-2); color: var(--rt-ink); }
.rt-icon-btn.danger:hover { color: var(--rt-crit); }

/* bottle summary / expander */
.rt-bottles { }
.rt-bottles-summary {
  display: flex; align-items: center; gap: 18px; cursor: pointer; list-style: none;
  padding: 9px 18px; font-size: 12.5px; color: var(--rt-ink-dim);
}
.rt-bottles-summary::-webkit-details-marker { display: none; }
.rt-bottles-summary:hover { background: var(--rt-surface-2); }
.rt-bottles-count { font-weight: 600; color: var(--rt-ink); }
.rt-bottles-total { color: var(--rt-muted); font-variant-numeric: tabular-nums; }
.rt-bottles-toggle { margin-left: auto; color: var(--rt-accent); font-size: 12px; font-weight: 500; }
.rt-bottles-toggle .rt-when-open { display: none; }
.rt-bottles[open] .rt-bottles-toggle .rt-when-closed { display: none; }
.rt-bottles[open] .rt-bottles-toggle .rt-when-open { display: inline; }
.rt-bottles[open] .rt-bottles-summary { border-bottom: 1px solid var(--rt-line-soft); }

/* entry table: consistent left-aligned columns, header aligned to data */
.rt-entries { padding: 2px 18px 10px 18px; }
.rt-entries-head,
.rt-entry {
  display: grid;
  grid-template-columns: 54px 96px 130px minmax(0, 1fr) 70px;
  gap: 14px; align-items: center;
}
.rt-entries-head { padding: 6px 0 4px; }
.rt-entries-head span { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rt-muted); text-align: left; }
.rt-entry { padding: 6px 0; border-top: 1px solid var(--rt-line-soft); }
.rt-bottle-chip { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--rt-accent) 16%, transparent); color: var(--rt-accent); font-variant-numeric: tabular-nums; }
.rt-bottle-chip.empty { background: var(--rt-surface-3); color: var(--rt-muted); }
/* remaining: force left-align, overriding the shared usage partial's centering */
.rt-remaining { text-align: left; }
.rt-remaining .d-flex { justify-content: flex-start !important; }
.rt-remaining a { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--rt-ink); text-decoration: none; }
.rt-remaining a:hover { color: var(--rt-accent); }
.rt-qty { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rt-qty.empty { color: var(--rt-muted); text-decoration: line-through; }
.rt-usage-cancel { margin-left: 6px; width: 20px; height: 20px; padding: 0; line-height: 1; border: none; border-radius: 5px; background: var(--rt-surface-3); color: var(--rt-muted); font-size: 15px; cursor: pointer; display: inline-grid; place-items: center; }
.rt-usage-cancel:hover { background: color-mix(in srgb, var(--rt-danger, #dc3545) 16%, transparent); color: var(--rt-danger, #dc3545); }
.rt-loc { color: var(--rt-ink-dim); text-decoration: none; font-size: 12.5px; }
.rt-loc:hover { color: var(--rt-accent); }
.rt-empty { text-align: center; color: var(--rt-muted); padding: 40px 0; }
.rt-inline-edit { margin-left: 8px; color: var(--rt-muted); text-decoration: none; font-size: 12px; }
.rt-inline-edit:hover { color: var(--rt-accent); }

/* --- QR scan usage screen (phone-first, standalone) --- */
.rt-qr-page { display: flex; justify-content: center; padding: 24px 16px 48px; }
.rt-qr-card { width: 100%; max-width: 420px; margin: 0; border-top: 3px solid var(--rt-accent); padding: 0; }
.rt-qr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 4px; }
.rt-qr-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rt-qr-status { display: inline-flex; }
.rt-qr-name { font-size: 17px; font-weight: 650; color: var(--rt-ink); text-decoration: none; word-break: break-word; }
.rt-qr-name:hover { color: var(--rt-accent); }
.rt-qr-bottle { width: 30px; height: 30px; font-size: 14px; flex: none; }
.rt-qr-lot { padding: 0 18px 14px; color: var(--rt-muted); font-size: 12.5px; border-bottom: 1px solid var(--rt-line-soft); }
.rt-qr-body { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 22px 18px 24px; }
.rt-qr-label { display: block; text-align: center; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rt-muted); font-weight: 600; margin-bottom: 6px; }
.rt-qr-remaining { text-align: center; }
.rt-qr-figure { font-size: 28px; font-weight: 700; color: var(--rt-ink); }
.rt-qr-input-row { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.rt-qr-input {
  width: 55%; max-width: 200px; text-align: center; color: var(--rt-accent);
  font-size: 3rem; font-weight: 800; line-height: 1.1; height: 4.5rem;
  border: 0; border-bottom: 3px solid var(--rt-line); background: transparent;
}
.rt-qr-input:focus { outline: none; border-bottom-color: var(--rt-accent); }
/* hide native number spinners — the numeric keypad is used on phones */
.rt-qr-input::-webkit-outer-spin-button,
.rt-qr-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rt-qr-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.rt-qr-input::placeholder { color: var(--rt-muted); }
.rt-qr-unit { font-size: 1.4rem; font-weight: 600; color: var(--rt-ink-dim); white-space: nowrap; }
.rt-qr-submit { justify-content: center; padding: 12px; font-size: 15px; }

@media (max-width: 820px) {
  .rt-stock-top { grid-template-columns: minmax(0,1fr) auto; }
  .rt-stock-top .rt-kv { display: none; }
  .rt-entries-head, .rt-entry { grid-template-columns: 44px 1fr 90px; }
  .rt-entries-head span:nth-child(2), .rt-entries-head span:nth-child(5),
  .rt-entry > :nth-child(2), .rt-entry > :nth-child(5) { display: none; }
}

/* ---- generic list table (D7) — flat list pages (items, companies, etc.) ---- */
.rt-table { display: flex; flex-direction: column; }
.rt-table-head,
.rt-row {
  display: grid; gap: 16px; align-items: center;
  grid-template-columns: var(--rt-cols, 1fr);
}
.rt-table-head {
  padding: 4px 16px 8px; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--rt-muted);
}
.rt-table-head .sort { color: var(--rt-muted); text-decoration: none; }
.rt-table-head .sort:hover { color: var(--rt-ink); }
/* each row is its own card, gapped from the next */
.rt-row {
  padding: 12px 16px; font-size: 13.5px;
  background: var(--rt-surface);
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius);
  box-shadow: var(--rt-shadow); position: relative;
}
.rt-row:hover { border-color: color-mix(in srgb, var(--rt-accent) 35%, var(--rt-line)); }
.rt-row-name { font-weight: 600; color: var(--rt-ink); text-decoration: none; }
.rt-row-name:hover { color: var(--rt-accent); }
.rt-row .muted { color: var(--rt-muted); }
.rt-row a:not(.rt-row-name):not(.rt-icon-btn) { color: var(--rt-ink-dim); text-decoration: none; }
.rt-row a:not(.rt-row-name):not(.rt-icon-btn):hover { color: var(--rt-accent); }
.rt-num { font-variant-numeric: tabular-nums; }
/* container just holds the header + gapped row-cards */
.rt-list-card { display: flex; flex-direction: column; gap: 8px; }
.rt-list-card .rt-table-head { display: grid; }
/* hover-reveal actions on flat rows */
@media (hover: hover) {
  .rt-row .rt-stock-actions { opacity: 0; transition: opacity 0.12s ease; }
  .rt-row:hover .rt-stock-actions,
  .rt-row .rt-stock-actions:focus-within { opacity: 1; }
}
@media (max-width: 820px) {
  .rt-table-head { display: none; }
  .rt-row { grid-template-columns: 1fr auto !important; }
  .rt-row > .rt-hide-sm { display: none; }
}

/* ---- list enrichment (D7): accent edge, count chips, livelier rows ---- */
/* accent edge on each row-card (left stripe) */
.rt-list-card.rt-accented .rt-row { overflow: hidden; }
.rt-list-card.rt-accented .rt-row::before {
  content:""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--rt-accent); opacity: 0.5;
}
.rt-table-head { background: transparent; }
.rt-row-name { font-size: 14px; }
/* count chip: a small pill in the section colour + a preview of contents */
.rt-count { display: inline-flex; align-items: center; gap: 6px; }
.rt-count-chip {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--rt-accent) 14%, transparent); color: var(--rt-accent);
  white-space: nowrap; flex: none;
}
.rt-count-preview { color: var(--rt-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rt-count { min-width: 0; }

/* clearer row separation + let expanded content grow downward, not center the row */
.rt-row { align-items: start; border-bottom: 1px solid var(--rt-line); }
.rt-row > * { align-self: center; }
.rt-row > .rt-expand { align-self: start; }

/* expand/collapse for a many-item list column — the chip IS the toggle,
   with a chevron that reveals on hover and rotates when open */
.rt-expand > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  width: fit-content;
}
.rt-expand > summary::-webkit-details-marker { display: none; }
.rt-expand-chip {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--rt-accent) 14%, transparent); color: var(--rt-accent);
  white-space: nowrap;
}
.rt-expand > summary:hover .rt-expand-chip { background: color-mix(in srgb, var(--rt-accent) 22%, transparent); }
/* caret always faintly visible (discoverable), brightens on hover, rotates open */
.rt-expand-caret {
  color: var(--rt-muted); font-size: 12px; display: inline-flex;
  opacity: 0.6; transition: color 0.12s ease, opacity 0.12s ease, transform 0.15s ease;
}
.rt-expand > summary:hover .rt-expand-caret { color: var(--rt-accent); opacity: 1; }
.rt-expand[open] .rt-expand-caret { color: var(--rt-accent); opacity: 1; transform: rotate(180deg); }

/* expanded content: each item as its own tidy chip, not a run-on blob */
.rt-expand-items {
  margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px;
}
.rt-expand-items a,
.rt-expand-items > span:not(.rt-expand-more) {
  font-size: 12px; line-height: 1.3;
  padding: 3px 9px; border-radius: 6px;
  background: color-mix(in srgb, var(--rt-accent) 8%, var(--rt-surface));
  border: 1px solid color-mix(in srgb, var(--rt-accent) 22%, transparent);
  color: var(--rt-ink-dim) !important; text-decoration: none;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.rt-expand-items a:hover {
  background: color-mix(in srgb, var(--rt-accent) 15%, var(--rt-surface));
  border-color: color-mix(in srgb, var(--rt-accent) 45%, transparent);
  color: var(--rt-accent) !important;
}
.rt-expand-more { color: var(--rt-muted); font-size: 12px; align-self: center; padding-left: 2px; }

/* ---- detail pages (D7) ---- */
.rt-detail { max-width: 1180px; }
.rt-detail-body { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }

/* a panel = a titled sub-card on a detail page */
.rt-panel { border: 1px solid var(--rt-line); border-radius: var(--rt-radius); background: var(--rt-surface); box-shadow: var(--rt-shadow); overflow: hidden; }
.rt-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--rt-line);
  background: color-mix(in srgb, var(--rt-accent) 10%, var(--rt-surface));
}
.rt-panel-head .rt-panel-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.rt-panel-head .rt-panel-title .bi { color: var(--rt-accent); }
.rt-panel-body { padding: 14px 16px; }
/* header-tone modifiers: a softer accent, or a neutral (non-section) header */
.rt-panel.head-soft > .rt-panel-head,
.rt-panel.head-soft > summary.rt-panel-head { background: color-mix(in srgb, var(--rt-accent) 5%, var(--rt-surface)); }
.rt-panel.head-neutral > .rt-panel-head,
.rt-panel.head-neutral > summary.rt-panel-head { background: var(--rt-surface-2); }
.rt-panel.head-neutral .rt-panel-title .bi { color: var(--rt-muted); }

/* collapsible panel (e.g. stock entries) */
.rt-panel-collapse > summary { list-style: none; cursor: pointer; }
.rt-panel-collapse > summary::-webkit-details-marker { display: none; }
.rt-panel-collapse:not([open]) > summary.rt-panel-head { border-bottom: 0; }
.rt-panel-collapse > summary:hover { background: color-mix(in srgb, var(--rt-accent) 9%, var(--rt-surface)); }
.rt-panel-head-right { display: flex; align-items: center; gap: 10px; }
.rt-bottles-total { color: var(--rt-muted); font-size: 12px; font-weight: 400; }
.rt-panel-collapse .rt-expand-caret { opacity: 0.6; }
.rt-panel-collapse[open] .rt-expand-caret { opacity: 1; transform: rotate(180deg); color: var(--rt-accent); }
.rt-panel-collapse > summary:hover .rt-expand-caret { opacity: 1; color: var(--rt-accent); }

/* definition grid: label / value pairs */
.rt-dl { display: grid; grid-template-columns: 150px 1fr 150px 1fr; gap: 10px 14px; align-items: baseline; }
.rt-dl .rt-dt { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rt-muted); }
.rt-dl .rt-dd { font-size: 13.5px; color: var(--rt-ink); min-width: 0; }
.rt-dl .rt-dd.wide { grid-column: 2 / -1; }
.rt-dl a { color: var(--rt-accent); text-decoration: none; }
.rt-dl a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .rt-dl { grid-template-columns: 120px 1fr; }
  .rt-dl .rt-dd.wide { grid-column: 2 / 3; }
}

/* a light sub-table inside a panel (attachments, validations, entries) */
.rt-subtable { display: flex; flex-direction: column; }
.rt-subtable-head, .rt-subrow { display: grid; gap: 12px; align-items: center; grid-template-columns: var(--rt-cols, 1fr); }
.rt-subtable-head { padding: 4px 4px 8px; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rt-muted); }
.rt-subrow { padding: 8px 4px; border-top: 1px solid var(--rt-line-soft); font-size: 13px; }
.rt-subrow:first-of-type { border-top: 0; }
.rt-subrow a { color: var(--rt-ink-dim); text-decoration: none; }
.rt-subrow a:hover { color: var(--rt-accent); }
.rt-subempty { color: var(--rt-muted); font-size: 13px; padding: 6px 4px; }
@media (hover: hover) {
  .rt-subrow .rt-stock-actions { opacity: 0; transition: opacity 0.12s ease; }
  .rt-subrow:hover .rt-stock-actions, .rt-subrow .rt-stock-actions:focus-within { opacity: 1; }
}
@media (max-width: 820px) {
  .rt-subtable-head { display: none; }
  .rt-subrow { grid-template-columns: 1fr auto !important; }
  .rt-subrow > .rt-hide-sm { display: none; }
}

/* ---- forms (D7) ---- */
.rt-form-page { max-width: 640px; }
/* form cards hold type-ahead dropdowns that escape the field — don't clip them */
.rt-form-card { margin-top: 6px; overflow: visible; }
.rt-form-card .rt-panel-body { overflow: visible; }
.rt-form-card .rt-panel-body { padding: 20px 20px 18px; }
.rt-form-foot { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rt-line-soft); }

/* modernise the Bootstrap widgets the form templates already emit */
.rt-form-card .form-control,
.rt-form-card .form-select {
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius-sm);
  padding: 9px 12px; font-size: 14px; color: var(--rt-ink); background: var(--rt-surface);
  box-shadow: none;
}
.rt-form-card .form-control:focus,
.rt-form-card .form-select:focus {
  border-color: var(--rt-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-accent) 20%, transparent);
}
.rt-form-card .form-control::placeholder { color: var(--rt-muted); }

/* label pill on the left of each input-group -> a clean uppercase label */
.rt-form-card .input-group { margin-bottom: 14px; flex-wrap: nowrap; gap: 0; }
/* leading label addon (first child) */
.rt-form-card .input-group > .input-group-text:first-child {
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-right: 0;
  color: var(--rt-ink-dim); font-size: 12px; font-weight: 500;
  border-radius: var(--rt-radius-sm) 0 0 var(--rt-radius-sm);
}
/* the input itself: square inner edges, radius only where it meets a rounded end */
.rt-form-card .input-group > .form-control,
.rt-form-card .input-group > .form-select { border-radius: 0; }
/* if the input is the LAST child, round its right corners */
.rt-form-card .input-group > .form-control:last-child,
.rt-form-card .input-group > .form-select:last-child { border-radius: 0 var(--rt-radius-sm) var(--rt-radius-sm) 0; }
/* trailing addon (e.g. the + add button on search inputs): round its right corners */
.rt-form-card .input-group > .input-group-text:last-child {
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-left: 0;
  border-radius: 0 var(--rt-radius-sm) var(--rt-radius-sm) 0;
}
.rt-form-card .input-group .form-control:focus,
.rt-form-card .input-group .form-select:focus { z-index: 3; }

/* type-ahead search results dropdown: hidden until it actually has results */
.rt-form-card .type-search-result:empty { display: none; }
.type-search-result:empty { display: none; box-shadow: none; }

/* labels emitted via label_tag */
.rt-form-card label { color: var(--rt-ink-dim); font-size: 13px; }

/* form error text */
.rt-form-card .text-danger { color: var(--rt-crit) !important; font-size: 12px; }

/* the type-search dropdown (category/manufacturer/etc.) */
.rt-form-card .type-search-result,
.rt-form-card .search-results-panel { border: 1px solid var(--rt-line); background: var(--rt-surface); border-radius: var(--rt-radius-sm); }

/* ---- navbar restyle (D7): match the app's look ---- */
.rt-shell-nav { padding: 0 14px; }
.rt-shell-nav .navbar-nav { gap: 2px; align-items: center; }
.rt-shell-nav .nav-link {
  border-radius: var(--rt-radius-sm); font-size: 13.5px; font-weight: 500;
  color: var(--rt-ink-dim); padding: 7px 12px !important;
  display: flex; align-items: center; gap: 6px;
}
.rt-shell-nav .nav-link:hover { background: var(--rt-surface-2); color: var(--rt-ink); }
.rt-shell-nav .nav-link.show { background: var(--rt-surface-2); color: var(--rt-ink); }
.rt-shell-nav .dropdown-toggle::after { margin-left: 2px; opacity: 0.5; }
/* section colour on the nav icons */
.rt-shell-nav .stock-text-color,
.rt-shell-nav .item-text-color,
.rt-shell-nav .inhouse-text-color,
.rt-shell-nav .category-text-color,
.rt-shell-nav .company-text-color,
.rt-shell-nav .location-text-color { font-size: 15px; }

/* dropdown menus as clean cards */
.rt-shell-nav .dropdown-menu {
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius);
  box-shadow: var(--rt-shadow); padding: 6px; margin-top: 6px; font-size: 13.5px;
  background: var(--rt-surface);
}
.rt-shell-nav .dropdown-item {
  border-radius: var(--rt-radius-sm); padding: 8px 10px; color: var(--rt-ink-dim);
  display: flex; align-items: center; gap: 8px;
}
.rt-shell-nav .dropdown-item:hover { background: var(--rt-surface-2); color: var(--rt-ink); }
.rt-shell-nav .dropdown-header {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--rt-muted); padding: 8px 10px 4px;
}
.rt-shell-nav .dropdown-divider { border-color: var(--rt-line-soft); margin: 4px 2px; }

/* search box -> pill */
.rt-shell-nav .search-container { flex: 1; max-width: 520px; min-width: 240px; margin: 0 10px; }
.rt-shell-nav .search-container > div { width: 100% !important; max-width: none !important; flex: 1; }
.rt-shell-nav .search-container .input-group {
  background: var(--rt-surface-2); border: 1px solid var(--rt-line);
  border-radius: 999px; overflow: hidden; padding: 1px 4px; width: 100%;
}
.rt-shell-nav .search-container .input-group-text {
  background: transparent !important; border: 0 !important; padding-right: 4px;
}
.rt-shell-nav .search-container .input-group-text .bi { color: var(--rt-muted) !important; }
.rt-shell-nav .search-container .form-control {
  border: 0 !important; background: transparent !important; box-shadow: none !important;
  font-size: 13px; padding: 7px 10px 7px 0; color: var(--rt-ink);
}
.rt-shell-nav .search-container .form-control:focus { box-shadow: none !important; }
.rt-shell-nav .search-container .input-group:focus-within {
  border-color: var(--rt-accent, var(--rt-search));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-search) 18%, transparent);
}
.search-results-panel {
  border: 1px solid var(--rt-line) !important; border-radius: var(--rt-radius) !important;
  box-shadow: var(--rt-shadow) !important; background: var(--rt-surface) !important;
}
/* user avatar-ish + help links keep their icon colours but align nicely */
.rt-shell-nav .navbar-nav.ms-auto .nav-link { color: var(--rt-ink-dim); }

/* ---- homepage dashboard (D7) ---- */
/* A stacked column of full-width, collapsible cards in priority order:
   noticeboard, please-restock, pending-validations, latest-stock. Each shows
   its top 5 rows and can be collapsed to just its header. */
.rt-dash { max-width: 1180px; }
.rt-dash-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.rt-dash-card .rt-panel-head { padding: 13px 18px; }
.rt-dash-card .rt-panel-title { font-size: 15px; }
.rt-dash-card .rt-panel-body { padding: 4px 16px 12px; }
.rt-dash-card .rt-subrow { padding: 10px 6px; font-size: 13.5px; }
.rt-panel-head .rt-head-link { color: var(--rt-muted); font-size: 13px; }
.rt-panel-head .rt-head-link:hover { color: var(--rt-accent); }
.rt-importance-dot { font-size: 10px; }

/* ---- help offcanvas (D7) ---- */
.rt-help { --rt-accent: var(--rt-search); }
.rt-help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--rt-line);
}
.rt-help-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rt-help-title .bi { color: var(--rt-accent); }
.rt-help-body { padding: 14px 18px; overflow-y: auto; font-size: 13.5px; color: var(--rt-ink-dim); }
/* restyle the legacy .panel markup inside help content (all ~30 files) */
.rt-help-body .panel { border: 1px solid var(--rt-line); border-radius: var(--rt-radius); box-shadow: none; margin-bottom: 12px; overflow: hidden; background: var(--rt-surface); }
.rt-help-body .panel-heading { background: color-mix(in srgb, var(--rt-accent) 10%, var(--rt-surface)); box-shadow: none; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--rt-line); }
.rt-help-body .panel-content { padding: 12px 14px; }
.rt-help-body p { margin-bottom: 10px; }
.rt-help-body p:last-child { margin-bottom: 0; }
/* buttons shown as examples in help text -> small neutral chips */
.rt-help-body .btn { pointer-events: none; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); color: var(--rt-ink-dim); }

/* ---- auth pages (login / register) (D7) ---- */
.rt-auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.rt-auth-body #main-content { width: 100%; padding: 24px; }
.rt-auth-wrap { display: flex; justify-content: center; }
.rt-auth-card { width: 100%; max-width: 400px; padding: 32px 28px; }
.rt-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.rt-auth-mark-img { border-radius: 10px; }
.rt-auth-name { font-family: var(--rt-font); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; color: var(--rt-ink); }
.rt-auth-form .input-group { margin-bottom: 14px; }
.rt-auth-submit { width: 100%; justify-content: center; margin-top: 4px; --rt-accent: var(--rt-stock); }
.rt-auth-card .rt-btn-primary { background: var(--rt-stock); border-color: var(--rt-stock); }
.rt-auth-footer, .rt-auth-card .text-center { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--rt-muted); }
.rt-auth-card a { color: var(--rt-stock); text-decoration: none; font-weight: 500; }
.rt-auth-card a:hover { text-decoration: underline; }
/* the auth card reuses .rt-form-card, so form-control/input-group theming applies */

/* ---- HTMX modals (delete confirm, upload, etc.) (D7) ---- */
.modal-content { border: 1px solid var(--rt-line); border-radius: var(--rt-radius); box-shadow: 0 20px 60px -20px rgba(20,30,40,0.35); background: var(--rt-surface); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--rt-line-soft); padding: 14px 18px; }
.modal-title { font-family: var(--rt-font); font-weight: 600; font-size: 15px; }
.modal-body { padding: 16px 18px; color: var(--rt-ink-dim); }
.modal-footer { border-top: 1px solid var(--rt-line-soft); padding: 12px 18px; gap: 8px; }
/* map the Bootstrap buttons inside modals to the rt look */
.modal-footer .btn { font-family: var(--rt-font); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: var(--rt-radius-sm); border: 1px solid var(--rt-line); }
.modal-footer .btn-success, .modal-footer .btn-light { background: var(--rt-surface); color: var(--rt-ink); }
.modal-footer .btn-success:hover, .modal-footer .btn-light:hover { border-color: var(--rt-muted); }
.modal-footer .btn-danger { background: var(--rt-crit); border-color: var(--rt-crit); color: #fff; }
.modal-footer .btn-primary { background: var(--rt-stock); border-color: var(--rt-stock); color: #fff; }

/* ---- misc partials (D7) ---- */
.rt-last-updated { text-align: right; color: var(--rt-muted); font-size: 11.5px; font-style: italic; margin-top: 10px; padding-right: 4px; }

/* pagination -> themed */
.pagination { --bs-pagination-color: var(--rt-ink-dim); --bs-pagination-bg: var(--rt-surface); gap: 4px; }
.pagination .page-link {
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius-sm) !important;
  color: var(--rt-ink-dim); font-size: 13px; padding: 6px 11px; background: var(--rt-surface);
}
.pagination .page-link:hover { background: var(--rt-surface-2); color: var(--rt-ink); border-color: var(--rt-muted); }
.pagination .page-item.active .page-link { background: var(--rt-accent, var(--rt-stock)); border-color: var(--rt-accent, var(--rt-stock)); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--rt-muted); background: var(--rt-surface-2); }

/* form widgets inside modals (delete/upload/watchlist popups) */
.modal-body .form-control, .modal-body .form-select {
  border: 1px solid var(--rt-line); border-radius: var(--rt-radius-sm); padding: 8px 11px;
  font-size: 14px; color: var(--rt-ink); background: var(--rt-surface); box-shadow: none;
}
.modal-body .form-control:focus, .modal-body .form-select:focus {
  border-color: var(--rt-stock); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-stock) 20%, transparent);
}

/* ---- user guide (D7) ---- */
.rt-guide { max-width: 860px; }
.rt-guide-body { line-height: 1.65; color: var(--rt-ink-dim); }
.rt-guide-body h4 { font-size: 18px; margin: 24px 0 8px; color: var(--rt-ink); }
.rt-guide-body h4:first-child { margin-top: 4px; }
.rt-guide-body h5 { font-size: 15px; margin: 18px 0 6px; color: var(--rt-ink); }
.rt-guide-body p { margin-bottom: 12px; }
.rt-guide-body img { max-width: 100%; height: auto; border-radius: var(--rt-radius-sm); border: 1px solid var(--rt-line); }
.rt-guide-body a:not(.btn) { color: var(--rt-search); }

/* input-group label pills inside modals */
.modal-body .input-group > .input-group-text:first-child {
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-right: 0;
  color: var(--rt-ink-dim); font-size: 12px; border-radius: var(--rt-radius-sm) 0 0 var(--rt-radius-sm);
}
.modal-body .input-group > .form-control { border-radius: 0 var(--rt-radius-sm) var(--rt-radius-sm) 0; }

/* ---- site-wide search results popup (D7) ---- */
.rt-search-results { display: flex; flex-direction: column; gap: 14px; }
.rt-search-group { }
.rt-search-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  color: var(--rt-accent); margin-bottom: 7px;
}
.rt-search-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rt-accent); }
.rt-search-count {
  font-size: 10px; font-weight: 600; color: var(--rt-accent);
  background: color-mix(in srgb, var(--rt-accent) 14%, transparent);
  padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.rt-search-items { display: flex; flex-wrap: wrap; gap: 5px; }
.rt-search-chip {
  font-size: 12.5px; line-height: 1.3; padding: 4px 10px; border-radius: 7px;
  background: color-mix(in srgb, var(--rt-accent) 7%, var(--rt-surface));
  border: 1px solid color-mix(in srgb, var(--rt-accent) 22%, transparent);
  color: var(--rt-ink-dim); text-decoration: none; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rt-search-chip:hover {
  background: color-mix(in srgb, var(--rt-accent) 15%, var(--rt-surface));
  border-color: color-mix(in srgb, var(--rt-accent) 45%, transparent);
  color: var(--rt-accent);
}
.rt-search-empty { color: var(--rt-muted); font-size: 13.5px; padding: 4px; }

/* ---- offcanvas panels (label print, help already done) (D7) ---- */
.rt-offcanvas-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--rt-line);
}
.rt-offcanvas-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rt-offcanvas-body { padding: 18px; }
.rt-offcanvas-form .input-group { margin-bottom: 14px; flex-wrap: nowrap; }
.rt-offcanvas-form .input-group > .input-group-text:first-child {
  background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-right: 0;
  color: var(--rt-ink-dim); font-size: 12px; border-radius: var(--rt-radius-sm) 0 0 var(--rt-radius-sm);
}
.rt-offcanvas-form .form-control, .rt-offcanvas-form .form-select {
  border: 1px solid var(--rt-line); border-radius: 0 var(--rt-radius-sm) var(--rt-radius-sm) 0;
  padding: 9px 12px; font-size: 14px; color: var(--rt-ink); background: var(--rt-surface); box-shadow: none;
}
.rt-offcanvas-form .form-control:focus, .rt-offcanvas-form .form-select:focus {
  border-color: var(--rt-stock); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rt-stock) 20%, transparent);
}
/* Amount + Unit side by side. Amount gets the wider cell (a number plus its
   spinner needs room); the label pills size to their text rather than the fixed
   8rem used elsewhere, which had crushed the input in this narrow offcanvas. */
.rt-amount-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.rt-amount-row .input-group { margin-bottom: 0; }
.rt-amount-row .input-group-text { width: auto; white-space: nowrap; }
.rt-amount-row .form-control, .rt-amount-row .form-select { min-width: 0; flex: 1 1 auto; }

/* ---- recipe ingredient toggle (D7) ---- */
.rt-field-label { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rt-muted); margin-bottom: 6px; }
.rt-toggle { display: inline-flex; background: var(--rt-surface-2); border: 1px solid var(--rt-line); border-radius: 999px; padding: 3px; gap: 3px; }
.rt-toggle-btn { font-size: 12.5px; padding: 6px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--rt-muted); cursor: pointer; }
.rt-toggle-btn.on { background: var(--rt-inhouse); color: #fff; font-weight: 600; }

/* ---- make a batch (D7) ---- */
.rt-batch-section { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rt-muted); font-weight: 600; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rt-line); }
.rt-batch-section:first-child { margin-top: 0; }
/* multi-column rows of labelled inputs. Label pills size to their text (not the
   fixed 8rem used on single-column rows), and inputs fill the cell — otherwise
   the label crushes the input in a narrow grid column. */
.rt-batch-grid { display: grid; gap: 12px; }
.rt-batch-grid .input-group-text { width: auto; white-space: nowrap; }
.rt-batch-grid .form-control, .rt-batch-grid .form-select { min-width: 0; flex: 1 1 auto; }
@media (max-width: 620px) { .rt-batch-grid { grid-template-columns: 1fr !important; } }
.rt-batch-ingredient { padding: 12px; border: 1px solid var(--rt-line); border-radius: var(--rt-radius-sm); margin-bottom: 10px; background: var(--rt-surface-2); }
.rt-batch-ing-name { font-size: 13.5px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rt-batch-ing-inputs { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; align-items: center; }
.rt-batch-qty { text-align: right; }
.rt-batch-unit-label { font-size: 13px; }
.rt-form-errors { background: color-mix(in srgb, var(--rt-crit) 8%, var(--rt-surface)); border: 1px solid color-mix(in srgb, var(--rt-crit) 30%, transparent); border-radius: var(--rt-radius-sm); padding: 10px 12px; margin-bottom: 14px; }
@media (max-width: 620px) { .rt-batch-ing-inputs { grid-template-columns: 1fr; } }

/* ---- recipe versioning UI (D9) ---- */
.rt-note-locked { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--rt-ink-dim); background: color-mix(in srgb, var(--rt-warn) 8%, var(--rt-surface)); border: 1px solid color-mix(in srgb, var(--rt-warn) 25%, transparent); border-radius: var(--rt-radius-sm); padding: 9px 12px; margin-bottom: 12px; }
.rt-note-locked .bi { color: var(--rt-warn); }
/* draft-editing note: teal (in-house) tone instead of the warn/locked tone */
.rt-note-draft { background: color-mix(in srgb, var(--rt-inhouse) 8%, var(--rt-surface)); border-color: color-mix(in srgb, var(--rt-inhouse) 30%, transparent); }
.rt-note-draft .bi { color: var(--rt-inhouse); }

/* recipe version switcher — two live tabs (active + draft) + a History dropdown */
.rt-panel-head-wrap { flex-wrap: wrap; row-gap: 8px; }
.rt-version-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-vtab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border: 1px solid var(--rt-line); border-radius: 999px;
  background: var(--rt-surface); color: var(--rt-ink-dim);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.rt-vtab:hover { border-color: var(--rt-muted); color: var(--rt-ink); }
.rt-vtab.is-current { background: var(--rt-inhouse); border-color: var(--rt-inhouse); color: #fff; }
.rt-vtab-tag { font-weight: 500; font-size: 11px; opacity: 0.8; }
.rt-vtab.is-current .rt-vtab-tag { opacity: 0.9; }
.rt-vtab-more { cursor: pointer; }
.rt-vtab-history .dropdown-menu { font-size: 13px; }

/* selected-version bar: what it is on the left, its actions on the right */
.rt-version-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rt-version-bar-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rt-ink-dim); }
.rt-version-bar-actions { display: inline-flex; align-items: center; gap: 8px; }
.rt-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rt-ink-dim); cursor: pointer; }
.rt-check input { width: 15px; height: 15px; }

/* form card holds no clip (dropdowns escape), so round the header itself to match */
.rt-form-card > .rt-panel-head { border-radius: var(--rt-radius) var(--rt-radius) 0 0; }
