/* GGSELL Control — app.css (unslop pass, asset v76)
   tokens -> aliases -> @layer legacy (normalized original) -> components.
   Unlayered rules beat the legacy layer at any specificity: keep new rules unlayered. */

/* ===== tokens.css ===== */
/* ==========================================================================
   GGSELL Control — tokens (unslop pass)
   One neutral ramp, three text roles, graphite accent, status hues only.
   ========================================================================== */
:root {
  color-scheme: dark;
  /* surfaces */
  --bg-deep: #0f0f10;
  --bg: #141415;
  --surface: #19191b;
  --raised: #232325;
  --raised-2: #2c2c2f;
  --nav-active: #232325;
  /* text */
  --text: #ededed;
  --text-2: #a1a1a6;
  --text-3: #85858b;
  /* fills and lines: text colour at low alpha */
  --fill: rgba(237, 237, 237, 0.05);
  --fill-2: rgba(237, 237, 237, 0.09);
  --fill-3: rgba(237, 237, 237, 0.14);
  --line: rgba(237, 237, 237, 0.08);
  --line-strong: rgba(237, 237, 237, 0.14);
  --focus: rgba(237, 237, 237, 0.4);
  /* accent: graphite, no hue */
  --accent: #ededed;
  --accent-hover: #ffffff;
  --on-accent: #0f0f10;
  /* status */
  --pos: #4cc38a;
  --warn: #e5a440;
  --neg: #e5484d;
  --pos-tint: rgba(76, 195, 138, 0.12);
  --warn-tint: rgba(229, 164, 64, 0.12);
  --neg-tint: rgba(229, 72, 77, 0.12);
  --pos-line: rgba(76, 195, 138, 0.4);
  --warn-line: rgba(229, 164, 64, 0.4);
  --neg-line: rgba(229, 72, 77, 0.4);
  /* controls */
  --scrim: rgba(0, 0, 0, 0.5);
  --knob: #ffffff;
  --track: #3a3a3d;
  --seg-active: var(--raised-2);
  --shadow-small: none;
  --shadow-float: 0 0 0 1px var(--line);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  /* frame */
  --navbar-h: 56px;
  --tabbar-h: 56px;
  --sidebar-w: 240px;
  --content-max: 1180px;
  --content-gutter: 16px;
  /* radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --r-pill: 999px;
  --r-card: 14px;
  --r-field: 10px;
  --r-inner: 10px;
  --r-icon: 8px;
  /* control heights */
  --btn-h-lg: 44px;
  --btn-h-md: 36px;
  --btn-h-sm: 32px;
  --btn-h-xs: 28px;
  /* motion */
  --motion-fast: 160ms;
  --motion-base: 200ms;
  --ease-out: var(--ease);

  /* names used by inline styles that never had a definition */
  --text-secondary: var(--text-2);
  --hint-color: var(--text-3);
  --tgui--hint_color: var(--text-3);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-deep: #f4f4f5;
  --bg: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --raised-2: #e9e9eb;
  --nav-active: #ffffff;
  --text: #171717;
  --text-2: #525252;
  --text-3: #737373;
  --fill: rgba(23, 23, 23, 0.04);
  --fill-2: rgba(23, 23, 23, 0.07);
  --fill-3: rgba(23, 23, 23, 0.11);
  --line: rgba(23, 23, 23, 0.09);
  --line-strong: rgba(23, 23, 23, 0.15);
  --focus: rgba(23, 23, 23, 0.35);
  --accent: #171717;
  --accent-hover: #2a2a2a;
  --on-accent: #ffffff;
  --pos: #15803d;
  --warn: #b45309;
  --neg: #dc2626;
  --pos-tint: rgba(21, 128, 61, 0.09);
  --warn-tint: rgba(180, 83, 9, 0.09);
  --neg-tint: rgba(220, 38, 38, 0.08);
  --pos-line: rgba(21, 128, 61, 0.35);
  --warn-line: rgba(180, 83, 9, 0.35);
  --neg-line: rgba(220, 38, 38, 0.35);
  --scrim: rgba(0, 0, 0, 0.32);
  --knob: #ffffff;
  --track: #d4d4d8;
  --seg-active: var(--surface);
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* base */
html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
body {
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
b,
strong {
  font-weight: 600;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: var(--fill-3);
  color: var(--text);
}
@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* ===== aliases.css ===== */
:root {
  --accent-grad: var(--accent);
  --amber: var(--warn);
  --amber-soft: var(--warn-tint);
  --bg-2: var(--surface);
  --bg-3: var(--raised);
  --bg-4: var(--raised-2);
  --bg-card: var(--surface);
  --blue: var(--text);
  --blue-2: var(--text);
  --blue-glow: transparent;
  --blue-soft: var(--fill-2);
  --border: var(--line);
  --border-2: var(--line);
  --border-3: var(--line-strong);
  --c-accent: var(--text);
  --c-accent-soft: var(--fill-2);
  --c-accent-soft-2: var(--fill-2);
  --c-accent-strong: var(--text);
  --c-accent-text: var(--text);
  --c-bad-soft: var(--neg-tint);
  --c-bad-soft-2: var(--neg-tint);
  --c-btn-shadow: 0 0 0 0 transparent;
  --c-card-shadow: 0 0 0 0 transparent;
  --c-field: var(--raised);
  --c-fill: var(--fill);
  --c-fill-2: var(--fill-2);
  --c-ok-soft: var(--pos-tint);
  --c-ring: 0 0 0 3px var(--focus);
  --c-seg-active: var(--seg-active);
  --c-track: var(--track);
  --c-warn-soft: var(--warn-tint);
  --cyan: var(--text);
  --cyan-soft: var(--fill-2);
  --elevated: var(--surface);
  --elevated-2: var(--raised);
  --glass-bg: var(--surface);
  --glass-bg-2: var(--surface);
  --green: var(--pos);
  --green-2: var(--pos);
  --green-glow: transparent;
  --green-soft: var(--pos-tint);
  --hero-grad: var(--surface);
  --hero-shadow: 0 0 0 0 transparent;
  --purple: var(--text);
  --purple-soft: var(--fill-2);
  --red: var(--neg);
  --red-soft: var(--neg-tint);
  --shadow-lg: 0 0 0 0 transparent;
  --shadow-md: 0 0 0 0 transparent;
  --shadow-sm: 0 0 0 0 transparent;
  --shadow-xl: 0 0 0 0 transparent;
  --tabbar-bg: var(--bg);
  --text-muted: var(--text-3);
  --tgui--accent: var(--text);
  --tgui--amber: var(--warn);
  --tgui--bg_color: var(--bg);
  --tgui--blue: var(--text);
  --tgui--button_color: var(--accent);
  --tgui--button_text_color: var(--on-accent);
  --tgui--divider: var(--line);
  --tgui--elevated: var(--surface);
  --tgui--green: var(--pos);
  --tgui--hint_color: var(--text-2);
  --tgui--link_color: var(--text);
  --tgui--outline: var(--line);
  --tgui--purple: var(--text);
  --tgui--red: var(--neg);
  --tgui--secondary_bg_color: var(--surface);
  --tgui--subtitle_text_color: var(--text-2);
  --tgui--tertiary_bg_color: var(--raised);
  --tgui--text_color: var(--text);
}

/* ===== legacy.css ===== */
@layer legacy {
  /* ==========================================================================

   GGSELL Control - Premium Dark SaaS Design System
   Inspired by Linear, Arc, Vercel & Apple Vision Pro aesthetic
   Mobile-first + PC Adaptive | v44
   ========================================================================== */
  /* ==========================================================================

   Design Tokens & Custom Properties
   ========================================================================== */
  :root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --tgui--font-family: var(--font);
    --tgui--font-mono: var(--font-mono);
    --tgui--safe_area_top: var(--sat);
    --tgui--safe_area_bottom: var(--sab);
    --tgui--navbar_height: var(--navbar-h);
    --tgui--tabbar_height: var(--tabbar-h);
  }
  /* ==========================================================================

   Reset & Base
   ========================================================================== */
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  /* Sleek dark scrollbars */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--knob);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--knob);
  }
  *:focus {
    outline: none;
  }
  main, .tgui-content, [tabindex="-1"], [tabindex] {
    outline: none;
  }
  main:focus, main:focus-visible, .tgui-content:focus, .tgui-content:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible {
    outline: none;
    box-shadow: transparent;
  }
  html {
    scroll-behavior: smooth;
    background: var(--bg);
    scroll-padding-top: calc(var(--navbar-h) + var(--sat) + 12px);
    scroll-padding-bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
  }
  body.tgui-root {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    font-size: 15px;
    overflow-x: hidden;
    user-select: text;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  /* Background - clean quiet obsidian */
  body.tgui-root::before {
    display: none;
  }
  /* ==========================================================================

   App Layout
   ========================================================================== */
  .tgui-app-layout {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
  }
  /* ==========================================================================

   Navigation Bar
   ========================================================================== */
  .tgui-navbar {
    position: relative;
    top: 0;
    z-index: 100;
    height: calc(var(--navbar-h) + var(--sat));
    padding-top: var(--sat);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 12px;
  }
  .tgui-navbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--navbar-h);
  }
  .tgui-page-back {
    width: 44px;
    height: 44px;
    margin-left: -8px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .tgui-page-back:hover {
    background: var(--fill);
  }
  .tgui-page-back:active {
    background: var(--fill-2);
  }
  .tgui-page-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    transform: rotate(180deg);
  }
  .tgui-nav-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
  }
  /* Online status - clean inline text */
  .tgui-nav-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--pos);
    line-height: 1;
  }
  .tgui-nav-status.offline {
    color: var(--neg);
  }
  /* Pulsing online dot */
  .pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pos);
    flex-shrink: 0;
  }
  .pulse-dot.red {
    background: var(--neg);
  }
  .status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    vertical-align: middle;
    flex-shrink: 0;
    margin-right: 4px;
  }
  .status-dot.green {
    background: var(--pos);
    box-shadow: 0 0 0 2px var(--pos-line);
  }
  .status-dot.amber {
    background: var(--warn);
    box-shadow: 0 0 0 2px var(--warn-line);
  }
  .status-dot.red {
    background: var(--neg);
    box-shadow: 0 0 0 2px var(--neg-line);
  }
  .status-dot.blue {
    background: var(--text-2);
    box-shadow: 0 0 0 2px var(--line);
  }
  .tgui-navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--navbar-h);
  }
  /* Balance pill in navbar */
  .tgui-pill-balance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--fill);
    border: 1px solid var(--line);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
  }
  .tgui-pill-balance strong {
    color: var(--text);
    font-weight: 500;
    font-size: 11px;
  }
  .pill-rub-parens {
    color: var(--text-2);
    font-size: 11px;
    margin-left: 1px;
  }
  /* Icon buttons in navbar */
  .tgui-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 160ms var(--ease), transform 120ms var(--ease), border-color 160ms var(--ease);
  }
  .tgui-nav-btn:hover {
    background: var(--fill-2);
    border-color: var(--line);
  }
  .tgui-nav-btn:active {
    transform: scale(0.98);
  }
  .tgui-nav-btn .icon {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
  }
  /* ==========================================================================

   Content Area & Views
   ========================================================================== */
  .tgui-content {
    padding-top: 12px;
    padding-bottom: calc(var(--tabbar-h) + var(--sab) + 28px);
    min-height: 100vh;
    min-height: 100dvh;
  }
  .tgui-view {
    display: none;
    animation: viewFadeIn 200ms var(--ease) both;
  }
  .tgui-view.active {
    display: block;
  }
  /* ==========================================================================

   Grouped List (Section, Cell)
   ========================================================================== */
  .tgui-section-header {
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-2);
    margin: 20px 16px 8px;
  }
  .tgui-section-footer {
    font-size: 12px;
    color: var(--text-2);
    margin: 8px 16px 16px;
    line-height: 1.4;
  }
  .tgui-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin: 0 16px 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: none;
    transition: border-color 160ms var(--ease);
  }
  .tgui-cell {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    min-height: 60px;
    transition: background-color 160ms var(--ease);
  }
  .tgui-cell.clickable {
    cursor: pointer;
  }
  .tgui-cell.clickable:active, .tgui-cell.clickable:hover {
    background: var(--fill);
  }
  .tgui-cell + .tgui-cell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 56px;
    right: 0;
    height: 0.5px;
    background: var(--fill);
  }
  .tgui-cell.highlight {
    background: var(--pos-tint);
    border-left: 3px solid var(--pos-line);
  }
  .tgui-cell-before {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Icon badges - quiet refined indicators */
  .tgui-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text-2);
    flex-shrink: 0;
    transition: color 160ms var(--ease), background-color 160ms var(--ease);
  }
  .tgui-icon-badge svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.75px;
    fill: none;
  }
  .bg-blue, .bg-indigo {
    color: var(--text);
    background: var(--fill-2);
    border-color: var(--line);
  }
  .bg-green, .bg-emerald {
    color: var(--pos);
    background: var(--pos-tint);
    border-color: var(--pos-line);
  }
  .bg-amber, .bg-yellow {
    color: var(--warn);
    background: var(--warn-tint);
    border-color: var(--warn-line);
  }
  .bg-red {
    color: var(--neg);
    background: var(--neg-tint);
    border-color: var(--neg-line);
  }
  .bg-purple {
    color: var(--text);
    background: var(--fill-2);
    border-color: var(--line);
  }
  .bg-cyan {
    color: var(--text);
    background: var(--fill-2);
    border-color: var(--line);
  }
  .bg-gray {
    color: var(--text-2);
    background: var(--fill);
    border-color: var(--line);
  }
  .tgui-cell-middle {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .cell-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cell-sub {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.3;
  }
  .tgui-cell-after {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .badge-value {
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-2);
  }
  .badge-value-accent {
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--pos);
  }
  /* Status badges */
  .badge-status-green {
    font-size: 11px;
    font-weight: 500;
    color: var(--pos);
    background: var(--pos-tint);
    border: 1px solid var(--pos-line);
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .badge-status-amber {
    font-size: 11px;
    font-weight: 500;
    color: var(--warn);
    background: var(--warn-tint);
    border: 1px solid var(--warn-line);
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .badge-status-red {
    font-size: 11px;
    font-weight: 500;
    color: var(--neg);
    background: var(--neg-tint);
    border: 1px solid var(--neg-line);
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .badge-status-neutral {
    font-size: 11px;
    font-weight: 500;
    color: var(--tg-hint, var(--text-2));
    background: var(--fill);
    border: 1px solid var(--line);
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .status-dot.grey {
    background: var(--tg-hint, var(--fill-3));
    box-shadow: none;
  }
  .chevron {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2px;
    flex-shrink: 0;
  }
  /* ==========================================================================

   Hero Balance Banner
   ========================================================================== */
  .tgui-hero-banner {
    position: relative;
    text-align: center;
    padding: 24px 20px 20px;
    margin: 2px 16px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
    overflow: hidden;
  }
  .tgui-hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: none;
    pointer-events: none;
  }
  .hero-top-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-2);
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .hero-status-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pos);
    display: inline-block;
    box-shadow: 0 0 0 2px var(--pos-line);
  }
  .hero-amount {
    font-size: 40px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' on, 'cv02' on;
    line-height: 1.15;
  }
  .hero-amount .currency {
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
  }
  .hero-sub-usd {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    margin-left: 4px;
  }
  .hero-freeze-row {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--warn);
    background: var(--warn-tint);
    border: 1px solid var(--warn-line);
    padding: 4px 16px;
    border-radius: 16px;
  }
  .hero-freeze-row .icon-sm {
    width: 16px;
    height: 16px;
    stroke: var(--warn);
  }
  /* ==========================================================================

   Quick Actions Row
   ========================================================================== */
  .tgui-quick-actions-bar {
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 20px;
    gap: 8px;
  }
  .tgui-circle-action {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0;
    flex: 1;
  }
  .circle-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fill);
    border: 1px solid var(--line);
    box-shadow: none;
    transition: transform 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  .tgui-circle-action:hover .circle-icon, .tgui-circle-action:focus-visible .circle-icon {
    background: var(--fill-2);
    border-color: var(--focus);
  }
  .tgui-circle-action:active .circle-icon {
    transform: scale(0.98);
  }
  .circle-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.75px;
    fill: none;
    transition: stroke 160ms var(--ease);
  }
  .tgui-circle-action:hover .circle-icon svg, .tgui-circle-action:focus-visible .circle-icon svg {
    stroke: currentColor;
  }
  .circle-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    text-align: center;
    letter-spacing: 0;
    transition: color 160ms var(--ease);
  }
  .tgui-circle-action:hover .circle-label, .tgui-circle-action:focus-visible .circle-label {
    color: var(--text);
  }
  /* ==========================================================================

   Dashboard 2-col grid (mobile = single col via display: contents)
   ========================================================================== */
  .tgui-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .tgui-dash-col {
    display: contents;
  }
  /* ==========================================================================

   iOS-style Toggle Switch
   ========================================================================== */
  .tgui-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 44px;
    flex-shrink: 0;
    cursor: pointer;
  }
  .tgui-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }
  .tgui-switch-slider {
    position: absolute;
    inset: 6.5px 0;
    background: var(--fill-2);
    border-radius: 16px;
    transition: background-color 200ms var(--ease);
  }
  .tgui-switch-slider::before {
    content: "";
    position: absolute;
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background: var(--knob);
    border-radius: 50%;
    box-shadow: none;
    transition: transform 200ms var(--ease);
  }
  .tgui-switch input:checked + .tgui-switch-slider {
    background: var(--pos-tint);
    color: var(--pos);
  }
  .tgui-switch input:checked + .tgui-switch-slider::before {
    transform: translateX(20px);
  }
  /* Compact switch (for filter rows) */
  .tgui-switch-row-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 44px;
  }
  .tgui-switch-row-compact input {
    display: none;
  }
  .switch-ui-compact {
    width: 32px;
    height: 18px;
    background: var(--fill-2);
    border-radius: 16px;
    position: relative;
    transition: background-color 160ms var(--ease);
  }
  .switch-ui-compact::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: var(--knob);
    border-radius: 50%;
    transition: transform 160ms var(--ease);
  }
  .tgui-switch-row-compact input:checked + .switch-ui-compact {
    background: var(--pos-tint);
    color: var(--pos);
  }
  .tgui-switch-row-compact input:checked + .switch-ui-compact::before {
    transform: translateX(14px);
  }
  .switch-txt {
    font-size: 12px;
    color: var(--text-2);
  }
  /* ==========================================================================

   Segmented Control
   ========================================================================== */
  .tgui-segmented-control {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px;
    display: flex;
    margin: 0 16px 12px;
    position: relative;
  }
  .tgui-segmented-control.compact {
    margin: 0;
    padding: 2px;
  }
  .tgui-segmented-control.compact .seg-btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
  }
  .tgui-segmented-control.scrollable {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tgui-segmented-control.scrollable::-webkit-scrollbar {
    display: none;
  }
  .seg-btn {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    padding: 12px 12px;
    min-height: 44px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .seg-btn:hover {
    color: var(--text-2);
  }
  .seg-btn.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
    border: 1px solid var(--line);
    box-shadow: none;
  }
  /* ==========================================================================

   Sticky Search Bar
   ========================================================================== */
  .tgui-sticky-bar {
    position: relative;
    top: auto;
    z-index: 50;
    background: var(--bg);
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }
  .tgui-search-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    height: 48px;
    margin-bottom: 8px;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  .tgui-search-field:focus-within {
    border-color: var(--focus);
    background: var(--fill);
    box-shadow: 0 0 0 3px var(--focus);
  }
  .tgui-search-field .search-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2px;
    margin-right: 8px;
    flex-shrink: 0;
  }
  .tgui-search-field input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    outline: none;
    font-family: inherit;
    height: 100%;
    min-height: 44px;
  }
  .tgui-search-field input::placeholder {
    color: var(--text-2);
  }
  /* Filter chips scroller */
  .tgui-chips-scroller {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .tgui-chips-scroller::-webkit-scrollbar {
    display: none;
  }
  .tgui-chip {
    white-space: nowrap;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 16px;
    cursor: pointer;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .tgui-chip:hover {
    background: var(--fill);
    color: var(--text);
  }
  .tgui-chip.active {
    background: var(--fill-2);
    color: var(--text);
    border-color: var(--line-strong);
    font-weight: 500;
    box-shadow: none;
  }
  .tgui-sub-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: nowrap;
  }
  .sub-label {
    font-size: 11px;
    color: var(--text-2);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .tgui-btn-pill-action {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .tgui-btn-pill-action:hover {
    opacity: 0.88;
  }
  .tgui-btn-pill-action:active {
    opacity: 0.75;
    transform: scale(0.98);
  }
  .spacer {
    flex: 1;
  }
  /* ==========================================================================

   Feed Cards
   ========================================================================== */
  .tgui-cards-feed {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .tgui-feed-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 16px;
    border: 1px solid var(--line);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 160ms var(--ease), transform 160ms var(--ease);
  }
  .tgui-feed-card:active {
    border-color: var(--line);
    transform: scale(0.98);
  }
  .feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .feed-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
  }
  .feed-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  .meta-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .meta-pill.price {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
    background: var(--fill-2);
    border-color: var(--line);
  }
  .feed-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    margin-top: 2px;
  }
  /* ==========================================================================

   Action Buttons
   ========================================================================== */
  .btn-cell-action {
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    padding: 12px 12px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .btn-cell-action:hover {
    background: var(--fill-2);
    border-color: var(--line);
  }
  .btn-cell-action:active {
    transform: scale(0.98);
  }
  .btn-cell-action.danger {
    color: var(--neg);
    background: var(--neg-tint);
    border-color: var(--neg-line);
  }
  .btn-cell-action.danger:hover {
    background: var(--neg-tint);
  }
  .btn-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2px;
    vertical-align: middle;
    flex-shrink: 0;
  }
  /* Filled button variants */
  .tgui-btn-filled {
    height: 44px;
    min-height: 44px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    transition: transform 160ms var(--ease), opacity 160ms var(--ease);
  }
  .tgui-btn-filled:active {
    transform: scale(0.98);
    opacity: 0.88;
  }
  .tgui-btn-filled.primary {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-sm);
    box-shadow: none;
  }
  .tgui-btn-filled.primary:hover {
    background: var(--accent);
    color: var(--on-accent);
  }
  .tgui-btn-filled.secondary {
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-sm);
  }
  .tgui-btn-filled.secondary:hover {
    background: var(--fill-2);
    border-color: var(--line);
  }
  .tgui-btn-filled.emerald {
    background: var(--pos-tint);
    color: var(--pos);
    font-weight: 500;
    border-radius: var(--radius-sm);
    box-shadow: none;
  }
  .tgui-btn-filled.emerald:hover {
    background: var(--pos-tint);
    color: var(--pos);
  }
  .tgui-btn-filled.danger {
    background: var(--neg-tint);
    border: 1px solid var(--neg-line);
    color: var(--neg);
  }
  .tgui-btn-filled.danger:hover {
    background: var(--neg-tint);
  }
  .tgui-btn-filled:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: transparent;
  }
  .tgui-btn-plain.danger {
    background: none;
    border: none;
    color: var(--neg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background-color 160ms var(--ease);
    min-height: 44px;
  }
  .tgui-btn-plain.danger:hover {
    background: var(--neg-tint);
  }
  .tgui-link-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    padding: 8px;
  }
  /* ==========================================================================

   Repricer Hero Card
   ========================================================================== */
  .tgui-repricer-card {
    margin: 0 16px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
  }
  .tgui-repricer-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: none;
  }
  .repricer-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }
  .repricer-title {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
  }
  .repricer-sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
  }
  .tgui-progress-wrapper {
    margin: 12px 0;
  }
  .tgui-progress-track {
    width: 100%;
    height: 6px;
    background: var(--fill-2);
    border-radius: 6px;
    overflow: hidden;
  }
  .tgui-progress-fill {
    height: 100%;
    background: var(--text-2);
    border-radius: 6px;
    box-shadow: none;
    transition: none;
  }
  .tgui-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-2);
    font-family: var(--font-mono);
  }
  .tgui-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
  }
  .grid-cell {
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 4px;
    text-align: center;
  }
  .cell-val {
    display: block;
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text);
  }
  .cell-val.highlight {
    color: var(--pos);
  }
  .cell-lbl {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    margin-top: 4px;
  }
  .current-task-pill {
    font-size: 12px;
    background: var(--fill);
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    min-width: 0;
  }
  .current-task-pill .label {
    color: var(--text-2);
    margin-right: 4px;
  }
  .current-task-pill strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .repricer-actions-row {
    display: flex;
    gap: 8px;
  }
  .repricer-actions-row button {
    flex: 1;
  }
  /* ==========================================================================

   Presets Grid
   ========================================================================== */
  .tgui-param-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .param-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }
  .param-highlight {
    font-size: 15px;
    font-family: var(--font-mono);
    color: var(--text);
  }
  .tgui-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }
  .tgui-preset-pill {
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
    min-height: 44px;
  }
  .tgui-preset-pill:hover {
    background: var(--fill-2);
    color: var(--text);
    border-color: var(--line);
  }
  .tgui-preset-pill.active {
    background: var(--fill-2);
    color: var(--text);
    border-color: var(--line-strong);
    box-shadow: none;
  }
  .tgui-preset-pill.custom {
    border-style: dashed;
  }
  /* ==========================================================================

   Settings Subviews
   ========================================================================== */
  .tgui-subview {
    display: none;
  }
  .tgui-subview.active {
    display: block;
  }
  /* ==========================================================================

   Spoiler / Details
   ========================================================================== */
  details.tgui-spoiler {
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 8px 0 12px;
    overflow: hidden;
  }
  details.tgui-spoiler summary {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    min-height: 44px;
  }
  details.tgui-spoiler summary::-webkit-details-marker {
    display: none;
  }
  details.tgui-spoiler summary .chevron {
    transition: transform 160ms var(--ease);
  }
  details.tgui-spoiler[open] summary .chevron {
    transform: rotate(90deg);
  }
  .spoiler-content {
    padding: 12px 16px 12px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
    border-top: 1px solid var(--line);
  }
  /* ==========================================================================

   Form Inputs
   ========================================================================== */
  .tgui-input, .tgui-native-select, .tgui-textarea {
    width: 100%;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    padding: 12px 16px;
    font-size: 15px;
    min-height: 48px;
    outline: none;
    font-family: inherit;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  .tgui-input:focus, .tgui-textarea:focus, .tgui-native-select:focus {
    border-color: var(--focus);
    background: var(--fill);
    box-shadow: 0 0 0 3px var(--focus);
  }
  .tgui-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 4px;
  }
  .tgui-chip-code {
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 160ms var(--ease);
    min-height: 44px;
  }
  .tgui-chip-code:hover {
    background: var(--fill-2);
  }
  /* ==========================================================================

   Bottom Sheet Modal
   ========================================================================== */
  dialog.tgui-bottom-sheet {
    border: none;
    background: transparent;
    width: 100%;
    max-width: 520px;
    margin: auto auto 0;
    padding: 0;
    color: var(--text);
    outline: none;
  }
  dialog.tgui-bottom-sheet::backdrop {
    background: var(--scrim);
  }
  .sheet-container {
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--line);
    box-shadow: none;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: sheetSlideUp 300ms var(--ease) both;
  }
  .sheet-drag-handle {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--fill-3);
    margin: 12px auto 8px;
  }
  .sheet-header {
    padding: 8px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }
  .sheet-header h3 {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
  }
  .sheet-close-btn {
    background: var(--fill-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .sheet-close-btn:hover {
    background: var(--fill-2);
    color: var(--text);
  }
  .sheet-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
  }
  .sheet-actions button {
    flex: 1;
  }
  .sheet-actions button, .repricer-actions-row button {
    min-height: 44px;
    flex-shrink: 0;
  }
  /* Wizard Steps */
  .tgui-wizard-steps {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
  }
  .w-step {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
  }
  .w-step.active {
    color: var(--text);
    font-weight: 500;
  }
  .wizard-page {
    display: none;
  }
  .wizard-page.active {
    display: block;
  }
  .eco-summary-card {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .eco-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
  }
  .eco-row.highlight {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    font-weight: 500;
    color: var(--pos);
  }
  /* ==========================================================================

   Bottom Tabbar
   ========================================================================== */
  .tgui-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: calc(var(--tabbar-h) + var(--sab));
    padding-bottom: var(--sab);
    background: var(--bg);
    border-top: 1px solid var(--line);
    box-shadow: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .tgui-tabbar-item {
    position: relative;
    flex: 1;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-2);
    cursor: pointer;
    padding: 8px 0 8px;
    transition: color 160ms var(--ease);
    min-width: 44px;
    min-height: 48px;
    touch-action: manipulation;
  }
  .tgui-sidebar-brand {
    display: none;
  }
  /* Active indicator line */
  .tgui-tabbar-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 24px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: var(--raised-2);
    box-shadow: none;
  }
  .tab-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.8px;
    transition: transform 160ms var(--ease), stroke 160ms var(--ease);
  }
  .tab-label {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tgui-tabbar-item.active {
    color: var(--text);
  }
  .tgui-tabbar-item.active .tab-icon {
    transform: translateY(-2px);
  }
  .tgui-tabbar-item.active .tab-label {
    font-weight: 500;
  }
  /* ==========================================================================

   Toast Notification (Elevated Stage 3)
   ========================================================================== */
  .tgui-toast {
    position: fixed;
    bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--text);
    padding: 8px 20px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: toastFadeUp 200ms var(--ease) both;
  }
  @media (min-width: 860px) {
    .tgui-toast {
      bottom: 24px;
      right: 24px;
      left: auto;
      transform: none;
      animation: toastFadeInRight 200ms var(--ease) both;
    }
  }
  /* ==========================================================================

   Skeleton Shimmer System (Stage 3 Craft)
   ========================================================================== */
  .tgui-skeleton-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    border: 1px solid var(--line);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 170px;
    position: relative;
    overflow: hidden;
  }
  .tgui-shimmer {
    background: var(--fill);
    background-size: 200% 100%;
    border-radius: 6px;
  }
  .tgui-shimmer-title {
    height: 18px;
    width: 70%;
    border-radius: 6px;
  }
  .tgui-shimmer-pill {
    height: 24px;
    border-radius: 6px;
  }
  .tgui-shimmer-btn {
    height: 40px;
    border-radius: var(--radius-sm);
  }
  .tgui-shimmer-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  /* ==========================================================================

   Empty State System (Stage 3 Craft)
   ========================================================================== */
  .tgui-empty-state {
    grid-column: 1 / -1;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 20px;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
    margin: 8px 0;
  }
  .empty-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--fill);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--text-2);
  }
  .empty-icon-badge svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.75px;
    fill: none;
  }
  .empty-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
  }
  .empty-desc {
    font-size: 13px;
    color: var(--text-2);
    max-width: 320px;
    line-height: 1.4;
  }
  /* ==========================================================================

   Loading, Pagination, Error
   ========================================================================== */
  .tgui-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-2);
    font-size: 13px;
  }
  .tgui-pagination-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 12px 28px;
    margin-top: 12px;
  }
  .tgui-btn-page {
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
    min-height: 44px;
  }
  .tgui-btn-page:hover {
    background: var(--fill-2);
    border-color: var(--line);
  }
  .tgui-btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
  .sup-catalog-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 12px;
    font-size: 13px;
    color: var(--text-3);
    font-weight: 500;
  }
  .sup-catalog-summary-bar .summary-badge {
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
  }
  .page-counter {
    font-size: 12px;
    color: var(--text-2);
    font-family: var(--font-mono);
  }
  .tgui-error-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .tgui-error-screen[hidden] {
    display: none !important;
  }
  .error-card {
    text-align: center;
    max-width: 320px;
  }
  .error-icon {
    font-size: 40px;
    margin-bottom: 16px;
  }
  .error-card h2 {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
  }
  .error-card p {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.5;
  }
  /* ==========================================================================

   Catalog & Supplier Cards
   ========================================================================== */
  .feed-card-with-thumb {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .feed-card-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--knob);
    border: 1px solid var(--line);
    flex-shrink: 0;
  }
  .feed-card-thumb-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--knob);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
  }
  .feed-card-thumb-placeholder svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
  }
  .cell-link {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    min-height: 44px;
    padding-block: 8px;
  }
  .cell-link:hover {
    text-decoration: underline;
  }
  .code-preview-box {
    background: var(--scrim);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 110px;
    overflow-y: auto;
    line-height: 1.4;
    margin-top: 8px;
  }
  .price-highlight {
    font-size: 20px;
    font-weight: 500;
    color: var(--pos);
  }
  .clickable-card {
    cursor: pointer;
    transition: transform 160ms var(--ease), border-color 160ms var(--ease);
  }
  .clickable-card:hover {
    border-color: var(--line);
  }
  .clickable-card:active {
    transform: scale(0.98);
  }
  /* Supplier filter layout */
  .sup-filter-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  .sup-filter-row-cats {
    display: flex;
    gap: 8px;
  }
  .sup-filter-row-cats select {
    flex: 1;
    min-width: 0;
  }
  .sup-filter-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sup-filter-row-bottom select {
    flex: 1;
    min-width: 0;
  }
  /* ==========================================================================

   Supplier URL Resolve Card
   ========================================================================== */
  .resolve-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin: 4px 16px 20px;
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: none;
  }
  .resolve-card-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
  }
  .resolve-card-title .resolve-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--fill-2);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-size: 15px;
    flex-shrink: 0;
  }
  .resolve-card-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.45;
    margin-bottom: 16px;
  }
  .resolve-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
  }
  .resolve-input-group .tgui-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
  }
  .resolve-input-group .tgui-btn-filled {
    height: 48px;
    padding: 0 20px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .resolve-sources-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .resolve-sources-label {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
  }
  .resolve-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  .dot-green {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pos);
  }
  .dot-blue {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-2);
  }
  .dot-purple {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-2);
  }
  .dot-orange {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warn);
  }
  .resolve-preview-box {
    margin-top: 16px;
  }
  .resolve-product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: none;
  }
  .resolve-product-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .resolve-product-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--fill);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
  }
  .resolve-product-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .resolve-product-info {
    flex: 1;
    min-width: 0;
  }
  .resolve-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
  }
  .resolve-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
  }
  .badge-green {
    background: var(--pos-tint);
    color: var(--pos);
    border: 1px solid var(--pos-line);
  }
  .badge-blue {
    background: var(--fill-2);
    color: var(--text);
    border: 1px solid var(--line);
  }
  .badge-purple {
    background: var(--fill-2);
    color: var(--text);
    border: 1px solid var(--line);
  }
  .badge-orange {
    background: var(--warn-tint);
    color: var(--warn);
    border: 1px solid var(--warn-line);
  }
  .badge-stock-in {
    background: var(--pos-tint);
    color: var(--pos);
    border: 1px solid var(--pos-line);
    text-transform: none;
  }
  .badge-stock-out {
    background: var(--neg-tint);
    color: var(--neg);
    border: 1px solid var(--neg-line);
    text-transform: none;
  }
  .resolve-product-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 8px;
  }
  .resolve-product-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .resolve-product-price {
    font-size: 17px;
    font-weight: 500;
    color: var(--pos);
  }
  .resolve-product-hours {
    font-size: 12px;
    color: var(--text-2);
  }
  .resolve-product-cats {
    font-size: 12px;
    color: var(--text-2);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--fill);
    border-radius: 8px;
  }
  .resolve-product-actions {
    margin-top: 4px;
  }
  .w-full {
    width: 100%;
  }
  .resolve-error-card {
    background: var(--neg-tint);
    border: 1px solid var(--neg-line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .resolve-error-icon {
    font-size: 20px;
    flex-shrink: 0;
  }
  .resolve-error-content {
    flex: 1;
  }
  .resolve-error-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--neg);
    margin-bottom: 4px;
  }
  .resolve-error-desc {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
  }
  /* ==========================================================================

   Lot & Order Cards
   ========================================================================== */
  .tgui-lot-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--line);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .tgui-order-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 16px;
    border: 1px solid var(--line);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  /* ==========================================================================

   PC & Tablet Responsive Adaptation
   ========================================================================== */
  @media (min-width: 768px) {
    /* Ambient body background on PC */
    body.tgui-root {
      background: var(--bg);
      min-height: 100vh;
      display: flex;
      justify-content: center;
    }
    body.tgui-root::before {
      display: none;
    }
    /* Centered app canvas */
    .tgui-app-layout {
      width: 100%;
      max-width: 1080px;
      min-height: 100vh;
      background: var(--bg);
      box-shadow: 0 0 0 1px var(--line);
      position: relative;
    }
    /* Navbar spans full layout width */
    .tgui-navbar {
      max-width: 1080px;
      left: auto;
      border-left: 1px solid var(--line);
      border-right: 1px solid var(--line);
      padding-left: 24px;
      padding-right: 20px;
    }
    /* Extra spacing in content */
    .tgui-content {
      padding-bottom: 100px;
    }
    /* Hero banner centered and wider */
    .tgui-hero-banner {
      max-width: 660px;
      margin: 20px auto 24px;
      padding: 32px 40px;
    }
    .hero-amount {
      font-size: 40px;
    }
    /* Quick actions bar centered */
    .tgui-quick-actions-bar {
      max-width: 560px;
      margin: 0 auto 28px;
      gap: 32px;
      justify-content: center;
    }
    .tgui-circle-action {
      width: 88px;
      cursor: pointer;
    }
    .circle-icon {
      width: 60px;
      height: 60px;
    }
    .circle-icon svg {
      width: 24px;
      height: 24px;
    }
    .circle-label {
      font-size: 12px;
    }
    /* 2-column dashboard grid */
    .tgui-dashboard-grid {
      display: grid !important;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: start;
      padding: 0 24px;
    }
    .tgui-dash-col {
      display: flex !important;
      flex-direction: column;
      gap: 12px;
    }
    .tgui-dash-col .tgui-section-header {
      margin-top: 0;
      padding-left: 2px;
    }
    .tgui-dash-col .tgui-section {
      margin-bottom: 0;
    }
    /* Cards feed - 2 columns */
    .tgui-cards-feed, #mappings-container, #supplier-items-container, #lots-container, #orders-container {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 16px !important;
      padding: 0 20px !important;
    }
    .tgui-feed-card, .tgui-lot-card, .tgui-order-card {
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      cursor: default;
    }
    .tgui-feed-card:hover, .tgui-lot-card:hover, .tgui-order-card:hover {
      border-color: var(--line);
      box-shadow: none;
    }
    /* Sticky bars style on PC */
    .tgui-sticky-bar {
      padding: 12px 24px 16px;
      border-radius: var(--radius-lg);
      margin: 12px 20px 16px;
      border: 1px solid var(--line);
      top: auto;
    }
    /* Section margins */
    .tgui-section {
      margin-left: 0;
      margin-right: 0;
    }
    .tgui-section-header {
      margin-left: 2px;
      margin-right: 2px;
    }
    /* Clickable cells with hover */
    .tgui-cell.clickable:hover {
      background: var(--fill);
      cursor: pointer;
    }
    /* Preset pills hover */
    /* Buttons */
    .btn-cell-action:hover, .tgui-btn-filled:hover {
      cursor: pointer;
    }
    /* Floating dock tabbar */
    .tgui-tabbar {
      max-width: 640px;
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      bottom: 20px;
      height: 64px;
      padding: 0 16px;
      border-radius: 16px;
      border: 1px solid var(--line);
      background: var(--bg);
      box-shadow: 0 0 0 1px var(--line);
    }
    .tgui-tabbar-item {
      border-radius: 16px;
      padding: 8px 16px;
      cursor: pointer;
      transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
    }
    .tgui-tabbar-item:hover {
      background: var(--fill-2);
      color: var(--text-2);
    }
    .tgui-tabbar-item.active {
      background: var(--fill-2);
      color: var(--text);
    }
    .tgui-tabbar-item.active::before {
      display: none;
    }
    /* Desktop modal dialogs (centered, not bottom sheet) */
    dialog.tgui-bottom-sheet {
      max-width: 640px;
      margin: auto;
      padding: 24px;
    }
    dialog.tgui-bottom-sheet[open] {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    dialog.tgui-bottom-sheet .sheet-container {
      border-radius: 16px;
      border: 1px solid var(--line);
      box-shadow: none;
      max-height: 88vh;
      animation: modalPop 200ms var(--ease) both;
    }
    dialog.tgui-bottom-sheet .sheet-drag-handle {
      display: none;
    }
    /* Repricer card centered */
    .tgui-repricer-card {
      max-width: 740px;
      margin: 16px auto 24px;
    }
    /* Settings subviews centered */
    .tgui-subview {
      max-width: 740px;
      margin: 0 auto;
    }
    /* Pagination row spacing */
    .tgui-pagination-row {
      padding: 12px 24px;
    }
  }
  /* Wide desktop - wider canvas & 3-col catalog */
  @media (min-width: 1280px) {
    .tgui-app-layout {
      max-width: 1200px;
    }
    .tgui-navbar {
      max-width: 1200px;
    }
    /* 3 columns for supplier catalog on wide screens */
    #supplier-items-container {
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
    .tgui-quick-actions-bar {
      max-width: 620px;
      gap: 40px;
    }
  }
  /* Tablet portrait tweaks */
  @media (min-width: 768px) and (max-width: 1024px) {
    .tgui-app-layout {
      max-width: 900px;
    }
    .tgui-tabbar {
      max-width: 540px;
    }
  }
  /* ==========================================================================

   v44 Adaptive Workspace Overrides
   Phone: compact Telegram navigation | Desktop: persistent operations rail
   ========================================================================== */
  button, select, input, textarea, summary, [role="button"] {
    font: inherit;
    touch-action: manipulation;
  }
  [hidden] {
    display: none !important;
  }
  .flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .tgui-field-group + .tgui-field-group {
    margin-top: 16px;
  }
  .tgui-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cat-results-scroller {
    max-height: min(48dvh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .selected-cat-pill {
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--fill-2);
  }
  .cat-fees {
    margin-top: 4px;
    color: var(--text-2);
    font-size: 12px;
  }
  button, summary, .tgui-tabbar-item, .tgui-circle-action, .clickable-card, .tgui-cell.clickable {
    user-select: none;
  }
  a, button, input, select, textarea, summary, main, .tgui-content, [tabindex] {
    outline: none;
  }
  main:focus, main:focus-visible, .tgui-content:focus, .tgui-content:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible {
    outline: none;
    box-shadow: transparent;
  }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    box-shadow: 0 0 0 3px var(--focus), 0 0 0 5px var(--focus);
    border-radius: 10px;
  }
  dialog.tgui-bottom-sheet:not([open]) {
    display: none !important;
  }
  .mobile-secondary {
    display: none;
  }
  .loading-state, .empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    color: var(--text-2);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--fill);
  }
  .tgui-toast.success {
    border-color: var(--pos-line);
  }
  .tgui-toast.error {
    border-color: var(--neg-line);
  }
  .error-icon svg {
    width: 44px !important;
    height: 44px !important;
    fill: none;
    stroke: var(--neg);
  }
  .order-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 2px 16px;
  }
  .order-detail-name {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .order-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .order-metric {
    min-width: 0;
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--fill);
  }
  .order-metric span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
  }
  .order-metric strong {
    display: block;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .order-metric.accent strong {
    color: var(--pos);
  }
  .order-diagnosis-card {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--fill);
  }
  .order-diagnosis-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 14px;
  }
  .order-diagnosis-card p, .confirm-dialog-message {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }
  .order-error-text {
    padding: 8px 12px;
    border: 1px solid var(--neg-line);
    border-radius: 10px;
    background: var(--neg-tint);
    color: var(--neg);
  }
  .confirm-dialog-message {
    margin: 0;
    white-space: pre-line;
  }
  .loading-state::before {
    content: "";
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border: 2px solid var(--line);
    border-top-color: var(--line-strong);
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
  }
  @keyframes loadingSpin {
    to {
      transform: rotate(360deg);
    }
  }
  /* Phone-specific density and safe-area behavior */
  @media (max-width: 767px) {
    .tgui-navbar {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(8px, env(safe-area-inset-right));
    }
    .tgui-navbar-left {
      min-width: 0;
      flex: 1;
    }
    .tgui-nav-title {
      font-size: 15px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .tgui-pill-balance {
      min-height: 36px;
      padding-inline: 8px;
    }
    .tgui-content {
      padding-top: 8px;
      padding-bottom: calc(var(--tabbar-h) + var(--sab) + 20px);
    }
    .tgui-tabbar {
      padding-left: max(4px, env(safe-area-inset-left));
      padding-right: max(4px, env(safe-area-inset-right));
    }
    .tgui-tabbar-item {
      padding: 8px 2px 8px;
    }
    .tab-icon {
      width: 20px;
      height: 20px;
    }
    .tab-label {
      font-size: 11px;
    }
    .tgui-hero-banner {
      margin: 4px 12px 16px;
      padding: 24px 16px 20px;
    }
    .hero-amount {
      font-size: clamp(28px, 9vw, 40px);
      flex-wrap: wrap;
    }
    .tgui-quick-actions-bar {
      padding: 0 12px;
      gap: 8px;
    }
    .tgui-circle-action {
      flex: 1;
    }
    .circle-icon {
      width: 52px;
      height: 52px;
    }
    .tgui-section, .tgui-repricer-card, .resolve-card {
      margin-left: 12px;
      margin-right: 12px;
    }
    .tgui-section-header {
      margin-left: 16px;
      margin-right: 16px;
    }
    .tgui-cards-feed {
      padding-inline: 12px;
    }
    .tgui-sticky-bar {
      padding-inline: 12px;
    }
    .feed-card-header {
      align-items: flex-start;
    }
    .feed-actions-row > * {
      flex: 1 1 calc(50% - 4px);
      text-align: center;
    }
    .tgui-cell {
      padding: 12px;
      gap: 12px;
    }
    .cell-title {
      font-size: 14px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .cell-sub {
      font-size: 12px;
    }
    .tgui-cell-after {
      gap: 4px;
    }
    .badge-value, .badge-value-accent {
      font-size: 13px;
      white-space: nowrap;
    }
    .tgui-sub-filter-row {
      align-items: stretch;
      flex-wrap: wrap;
    }
    .tgui-sub-filter-row .spacer {
      display: none;
    }
    .tgui-sub-filter-row .tgui-segmented-control {
      flex: 1 1 auto;
    }
    .tgui-sub-filter-row .tgui-btn-pill-action {
      min-height: 44px;
    }
    .tgui-segmented-control.main-tabs {
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      scrollbar-width: none;
      scroll-snap-type: x proximity;
      -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
      mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
    }
    .tgui-segmented-control.main-tabs::-webkit-scrollbar {
      display: none;
    }
    .tgui-segmented-control.main-tabs .seg-btn {
      flex: 0 0 auto;
      min-width: max-content;
      scroll-snap-align: start;
    }
    .tgui-actions-group > * {
      flex: 1 1 100%;
    }
    body.secondary-mobile-view .tgui-nav-status, body.secondary-mobile-view .tgui-pill-balance {
      display: none;
    }
    .service-cell {
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .service-cell .tgui-cell-middle {
      flex: 1 1 calc(100% - 54px);
    }
    .service-cell .tgui-cell-after {
      width: 100%;
      padding-left: 44px;
      justify-content: flex-end;
    }
    .sup-filter-row-cats, .sup-filter-row-bottom, .resolve-input-group {
      align-items: stretch;
    }
    .sheet-container {
      max-height: min(90dvh, 820px);
    }
    .sheet-body {
      padding: 16px 16px calc(20px + var(--sab));
    }
    .tgui-wizard-steps {
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .w-step {
      flex: 0 0 auto;
    }
  }
  @media (max-width: 420px) {
    .tgui-nav-status, .pill-rub-parens {
      display: none;
    }
    .tgui-navbar-right {
      gap: 4px;
    }
    .tgui-grid-4 {
      grid-template-columns: repeat(2, 1fr);
    }
    .repricer-actions-row, .sheet-actions {
      flex-direction: column;
    }
    .repricer-actions-row button, .sheet-actions button {
      width: 100%;
      min-height: 44px;
      flex: 0 0 44px;
    }
    .sup-filter-row-cats, .resolve-input-group {
      flex-direction: column;
    }
  }
  /* Tablet keeps touch navigation, but uses the available canvas. */
  @media (min-width: 768px) and (max-width: 859px) {
    body.tgui-root {
      display: block;
    }
    .tgui-app-layout {
      width: 100%;
      max-width: none;
      box-shadow: transparent;
    }
    .tgui-navbar {
      max-width: none;
      padding-inline: 24px;
    }
    .tgui-content {
      padding-bottom: 92px;
    }
    .tgui-tabbar {
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      max-width: none;
      height: calc(var(--tabbar-h) + var(--sab));
      padding: 0 12px var(--sab);
      transform: none;
      border-width: 1px 0 0;
      border-radius: 0;
    }
    .tgui-tabbar-item {
      padding-inline: 12px;
    }
    .tgui-sticky-bar {
      top: auto;
    }
  }
  /* Desktop workspace: persistent sidebar, wide content, dense data grids. */
  @media (min-width: 860px) {
    body.tgui-root {
      display: block;
      min-height: 100dvh;
      background: var(--bg);
    }
    .tgui-app-layout {
      width: min(100%, 1480px);
      max-width: 1480px;
      min-height: 100dvh;
      margin: 0 auto;
      display: grid;
      grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
      grid-template-rows: auto 1fr;
      background: var(--bg);
      border-inline: 1px solid var(--line);
      box-shadow: none;
      overflow: visible;
    }
    .tgui-navbar {
      position: sticky;
      top: 0;
      z-index: 50;
      grid-column: 2;
      grid-row: 1;
      width: 100%;
      max-width: none;
      height: var(--navbar-h);
      padding: 0 28px;
      border: 0;
      border-bottom: 1px solid var(--line);
      background: var(--bg);
    }
    .tgui-nav-title {
      font-size: 17px;
    }
    .tgui-nav-status {
      padding: 4px 8px;
      border: 1px solid var(--pos-line);
      border-radius: 999px;
      background: var(--pos-tint);
    }
    .tgui-pill-balance {
      min-height: 40px;
      padding-inline: 16px;
      font-size: 12px;
    }
    .tgui-pill-balance strong {
      font-size: 13px;
    }
    .tgui-tabbar {
      position: sticky;
      top: 0;
      left: auto;
      right: auto;
      bottom: auto;
      grid-column: 1;
      grid-row: 1 / span 2;
      width: var(--sidebar-w);
      max-width: none;
      height: 100vh;
      height: 100dvh;
      align-self: start;
      padding: 20px 12px;
      transform: none;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: stretch;
      gap: 4px;
      border: 0;
      border-right: 1px solid var(--line);
      border-radius: 0;
      background: var(--surface);
      box-shadow: transparent;
      overflow-y: auto;
    }
    .tgui-sidebar-brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 52px;
      margin: 0 8px 20px;
      padding: 4px 8px 16px;
      border-bottom: 1px solid var(--line);
    }
    .sidebar-brand-mark {
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      border-radius: 10px;
      color: var(--text);
      font-size: 17px;
      font-weight: 500;
      background: var(--surface);
      box-shadow: none;
    }
    .sidebar-brand-copy {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }
    .sidebar-brand-copy strong {
      font-size: 14px;
    }
    .sidebar-brand-copy small {
      margin-top: 4px;
      color: var(--text-2);
      font-size: 11px;
    }
    .mobile-secondary {
      display: flex;
    }
    .tgui-tabbar-item {
      flex: 0 0 auto;
      width: 100%;
      min-height: 48px;
      padding: 0 12px;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      gap: 12px;
      border: 1px solid transparent;
      border-radius: 12px;
      color: var(--text-2);
    }
    .tgui-tabbar-item:hover {
      color: var(--text);
      background: var(--fill);
      border-color: var(--line);
    }
    .tgui-tabbar-item.active {
      color: var(--text);
      background: var(--fill);
      border-color: var(--line);
      box-shadow: none;
    }
    .tgui-tabbar-item.active::before {
      display: block;
      top: 50%;
      left: -1px;
      width: 3px;
      height: 24px;
      transform: translateY(-50%);
      border-radius: 0 4px 4px 0;
    }
    .tgui-tabbar-item.active .tab-icon {
      transform: none;
    }
    .tab-icon {
      width: 20px;
      height: 20px;
    }
    .tab-label {
      font-size: 14px;
      font-weight: 500;
    }
    .tgui-content {
      grid-column: 2;
      grid-row: 2;
      min-width: 0;
      min-height: calc(100dvh - var(--navbar-h));
      padding: 24px 28px 48px;
    }
    .tgui-view {
      width: 100%;
      max-width: var(--content-max);
      margin-inline: auto;
    }
    #view-dashboard.active {
      display: block;
    }
    .tgui-segmented-control.main-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 8px;
      margin: 0 0 20px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }
    .tgui-segmented-control.main-tabs .seg-btn {
      flex: 1 1 auto;
      min-width: 110px;
      padding: 8px 16px;
      font-size: 13px;
      text-align: center;
    }
    .tgui-hero-banner {
      max-width: none;
      min-height: 180px;
      margin: 0;
      padding: 28px 36px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .hero-amount {
      font-size: 40px;
      font-weight: 500;
    }
    .tgui-quick-actions-bar {
      max-width: none;
      min-height: 180px;
      margin: 0;
      padding: 12px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: var(--surface);
      box-shadow: none;
    }
    .tgui-circle-action {
      width: auto;
      min-height: 72px;
      padding: 12px 16px;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--fill);
      transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
    }
    .tgui-circle-action:hover, .tgui-circle-action:focus-visible {
      background: var(--fill);
      border-color: var(--focus);
    }
    .circle-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      flex: 0 0 auto;
    }
    .circle-icon svg {
      width: 18px;
      height: 18px;
    }
    .tgui-circle-action:hover .circle-icon, .tgui-circle-action:focus-visible .circle-icon {
      transform: none;
    }
    .circle-label {
      color: var(--text);
      font-size: 13px;
      font-weight: 500;
      text-align: left;
    }
    .tgui-dashboard-grid {
      grid-column: 1 / -1;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 20px;
      padding: 0;
    }
    .tgui-dash-col {
      gap: 12px;
    }
    .tgui-section, .tgui-dash-col .tgui-section {
      margin-inline: 0;
    }
    .tgui-sticky-bar {
      top: auto;
      margin: 0 0 20px;
      padding: 16px;
      border-radius: var(--radius-lg);
    }
    .tgui-sticky-bar .tgui-search-field {
      max-width: 520px;
    }
    .tgui-cards-feed, #mappings-container, #supplier-items-container, #lots-container, #orders-container {
      padding: 0 !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 16px !important;
    }
    #supplier-items-container {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .tgui-feed-card, .tgui-lot-card, .tgui-order-card {
      min-height: 190px;
    }
    .resolve-card {
      margin: 0 0 20px;
    }
    .tgui-repricer-card {
      max-width: none;
      margin: 0 0 24px;
      padding: 28px;
    }
    #view-services > .tgui-section, #view-services > .tgui-section-header {
      max-width: 900px;
      margin-inline: auto;
    }
    .tgui-segmented-control.main-tabs {
      margin: 0 0 20px;
    }
    .tgui-subview {
      max-width: 820px;
    }
    .tgui-pagination-row {
      padding-inline: 0;
    }
    dialog.tgui-bottom-sheet[open] {
      display: flex;
      width: 100%;
      max-width: 720px;
      align-items: center;
      justify-content: center;
    }
    dialog.tgui-bottom-sheet .sheet-container {
      width: 100%;
    }
  }
  @media (min-width: 1320px) {
    .tgui-content {
      padding-inline: 36px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 120ms !important;
    }
  }
  /* ========================================================================== */
  /* KOSELL LOT & COVER STUDIO STYLES                                           */
  /* ========================================================================== */
  /* --- Banner --- */
  .candidates-banner {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    border-radius: 16px;
    padding: 20px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
  }
  .candidates-banner-info {
    flex: 1;
    min-width: 220px;
  }
  .candidates-banner-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
  }
  .candidates-banner-desc {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 8px;
    line-height: 1.5;
    max-width: 560px;
  }
  /* Search bar in banner */
  .candidates-search-bar {
    margin-top: 12px;
  }
  .candidates-search-bar input, .candidates-search-bar .tgui-input {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  .candidates-search-bar input:focus, .candidates-search-bar .tgui-input:focus {
    border-color: var(--focus);
    background: var(--fill-2);
  }
  /* Banner actions (sync-all button) */
  .candidates-banner-actions {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .candidates-banner-actions .tgui-btn-filled {
    white-space: nowrap;
    font-size: 13px;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
  }
  /* --- Pulsing dot --- */
  .pulse-dot-cyan {
    width: 8px;
    height: 8px;
    margin-top: 8px;
    flex-shrink: 0;
    background: var(--text-2);
    border-radius: 50%;
    box-shadow: none;
  }
  /* --- Card grid --- */
  .candidates-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin-top: 8px;
  }
  /* --- Candidate cards (Uniform, proportional containers) --- */
  .candidate-lot-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: none;
    transition: transform 160ms var(--ease), border-color 160ms var(--ease);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
  }
  .candidate-lot-card:hover {
    border-color: var(--line-strong);
    box-shadow: none;
  }
  /* --- Card Header: Square Cover + Info --- */
  .candidate-lot-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex: 1;
  }
  /* --- Cover Thumbnail: EXACT LOCKED SQUARE --- */
  .candidate-cover-wrap {
    width: 124px;
    height: 124px;
    min-width: 124px;
    min-height: 124px;
    max-width: 124px;
    max-height: 124px;
    aspect-ratio: 1 / 1;
    flex: 0 0 124px;
    align-self: flex-start;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
  }
  .candidate-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--fill);
    z-index: 0;
  }
  .candidate-cover-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.6;
  }
  .candidate-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
  }
  .candidate-cover-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--bg);
    color: var(--text);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    padding: 12px 4px 4px;
    line-height: 1.2;
  }
  /* --- Card Body: Title, Chips & Details --- */
  .candidate-lot-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .candidate-lot-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .candidate-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
  }
  .meta-pill.highlight {
    color: var(--text);
    background: var(--fill);
    border-color: var(--line);
    font-weight: 500;
  }
  .candidate-lot-desc {
    font-size: 11px;
    color: var(--text-2);
    line-height: 1.45;
  }
  /* --- Action Buttons: Full Width at Bottom --- */
  .candidate-actions-bar {
    display: flex;
    gap: 8px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    align-items: center;
  }
  .candidate-actions-bar .btn-create-single-lot {
    font-size: 12px;
    font-weight: 500;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    flex: 1 1 auto;
    border-radius: 8px;
    white-space: nowrap;
  }
  .candidate-actions-bar .btn-open-cand-wizard {
    font-size: 12px;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    flex: 0 0 auto;
    border-radius: 8px;
    white-space: nowrap;
  }
  /* --- Full-width mode when candidates are shown --- */
  #supplier-items-container.candidates-mode {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
  }
  /* --- Mobile tweaks --- */
  @media (max-width: 580px) {
    .candidates-grid {
      grid-template-columns: 1fr !important;
    }
    .candidate-cover-wrap {
      width: 96px;
      height: 96px;
      min-width: 96px;
      min-height: 96px;
      max-width: 96px;
      max-height: 96px;
      flex: 0 0 96px;
    }
    .candidate-lot-header {
      gap: 12px;
    }
    .candidate-lot-title {
      font-size: 14px;
    }
    .candidate-actions-bar {
      flex-direction: column;
      gap: 8px;
    }
    .candidate-actions-bar .btn-create-single-lot, .candidate-actions-bar .btn-open-cand-wizard {
      width: 100%;
      justify-content: center;
    }
    .candidates-banner {
      flex-direction: column;
      gap: 12px;
    }
    .candidates-banner-actions {
      width: 100%;
    }
    .candidates-banner-actions .tgui-btn-filled {
      width: 100%;
      justify-content: center;
    }
    .candidates-search-bar input, .candidates-search-bar .tgui-input {
      max-width: 100%;
    }
  }
  /* --- Desktop refinements for KOSell studio --- */
  @media (min-width: 860px) {
    .candidates-grid {
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
      gap: 16px !important;
    }
    .candidates-banner {
      padding: 20px 24px;
    }
    .candidates-banner-desc {
      font-size: 13px;
    }
  }
  /* ==========================================================================

   UI / UX Polish: Universal Base SVGs, Wizard Cards, Mobile Order & Filters
   ========================================================================== */
  /* Universal SVG Icon Sizing */
  .icon, svg.icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.75px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    vertical-align: middle;
  }
  .icon-sm, svg.icon-sm {
    width: 16px;
    height: 16px;
    stroke-width: 1.75px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    vertical-align: middle;
  }
  .icon-lg, svg.icon-lg {
    width: 24px;
    height: 24px;
    stroke-width: 1.75px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    vertical-align: middle;
  }
  /* Wizard Source Preview Card */
  #wiz-source-preview {
    margin: 0 0 16px 0 !important;
    padding: 16px 16px !important;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
  }
  #wiz-source-preview .item-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
  }
  #wiz-source-preview .item-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  #wiz-source-preview .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: var(--fill);
    color: var(--text-2);
  }
  #wiz-source-preview .meta-chip.provider-darkstore {
    background: var(--fill-2);
    color: var(--text);
    border: 1px solid var(--line);
  }
  #wiz-source-preview .meta-chip.provider-kosell {
    background: var(--fill-2);
    color: var(--text);
    border: 1px solid var(--line);
  }
  #wiz-source-preview .meta-chip.provider-approute {
    background: var(--pos-tint);
    color: var(--pos);
    border: 1px solid var(--pos-line);
  }
  #wiz-source-preview .meta-chip.price {
    font-family: var(--font-mono);
    background: var(--fill-2);
    color: var(--text);
    font-weight: 500;
  }
  /* Wizard Cover Non-Kosell Notice Banner & Dropzone */
  .wiz-notice-banner {
    padding: 12px 12px;
    margin-bottom: 12px;
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-2);
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }
  .wiz-notice-banner .icon-sm {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin-top: 1px;
    stroke: currentColor;
  }
  .wiz-upload-dropzone {
    padding: 24px 16px;
    text-align: center;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--fill);
    transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .wiz-upload-dropzone:hover {
    border-color: var(--line-strong);
    background: var(--fill);
  }
  .wiz-upload-dropzone:active {
    transform: scale(0.98);
  }
  .wiz-upload-dropzone .icon {
    width: 32px !important;
    height: 32px !important;
    stroke: currentColor;
    opacity: 0.85;
  }
  /* Catalog Filter Rows */
  .tgui-filter-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .tgui-filter-actions-row .tgui-native-select {
    flex: 1 1 180px;
    min-width: 140px;
  }
  .tgui-filter-actions-row .tgui-switch-row-compact {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* Mobile Dashboard Order Normalization */
  @media (max-width: 859px) {
    .tgui-dashboard-grid {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .tgui-dash-col {
      display: contents;
    }
    #dash-hero-banner {
      order: 1;
    }
    #dash-quick-actions {
      order: 2;
    }
    #dash-sec-sales-head {
      order: 3;
    }
    #dash-sec-sales-body {
      order: 4;
    }
    #dash-sec-suppliers-head {
      order: 5;
    }
    #dash-sec-suppliers-body {
      order: 6;
    }
    #dash-sec-services-head {
      order: 7;
    }
    #dash-sec-services-body {
      order: 8;
    }
  }
  /* ===================================================================
   v69 layer - Telegram theme sync, light theme, safe areas, a11y
   =================================================================== */
  :root {
    --sat: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
    --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  }
  html {
    color-scheme: dark;
    background: var(--bg);
  }
  html[data-theme="light"] {
    color-scheme: light;
  }
  /* light theme - chrome */
  html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--fill-3);
  }
  html[data-theme="light"] .tgui-navbar {
    background: var(--bg);
    border-bottom-color: var(--line);
  }
  html[data-theme="light"] .tgui-tabbar {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme="light"] .tgui-nav-btn, html[data-theme="light"] .btn-cell-action, html[data-theme="light"] .meta-pill {
    background: var(--raised);
  }
  html[data-theme="light"] .meta-pill.price {
    background: var(--raised-2);
  }
  html[data-theme="light"] .tgui-nav-btn:hover, html[data-theme="light"] .btn-cell-action:hover {
    background: var(--raised-2);
  }
  html[data-theme="light"] .tgui-toast {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
  }
  html[data-theme="light"] .tgui-hero-banner {
    background: var(--bg);
    border-color: var(--line);
    box-shadow: none;
  }
  html[data-theme="light"] .tgui-page-back:hover {
    background: var(--fill);
  }
  html[data-theme="light"] .tgui-page-back:active {
    background: var(--fill-2);
  }
  /* a11y: visible keyboard focus */
  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  /* money: digits do not jump when values update */
  .hero-amount, .price, .price-highlight, .badge-value, .badge-value-accent, .tgui-pill-balance, .resolve-product-price, .meta-pill.price {
    font-variant-numeric: tabular-nums;
  }
  /* cards: solid surfaces instead of blur - cheaper scrolling on low-end Android */
  .tgui-feed-card {
    background: var(--surface);
  }
  .tgui-feed-card:hover {
    border-color: var(--line);
  }
  /* mobile: readable minimum font sizes + pill indicator in the tab bar */
  @media (max-width: 859px) {
    .tab-label {
      font-size: 11px;
    }
    .cell-lbl, .order-metric span, .pill-rub-parens {
      font-size: 11px;
    }
    .candidate-cover-badge {
      font-size: 11px;
    }
    .tgui-tabbar-item.active::before {
      top: 5px;
      left: 50%;
      width: 56px;
      height: 28px;
      border-radius: 14px;
      background: var(--fill-2);
      transform: translateX(-50%);
    }
    .tab-icon {
      position: relative;
      z-index: 1;
    }
    .tgui-tabbar-item.active .tab-icon {
      transform: none;
    }
  }
  /* v69 light theme - toolbars, segmented controls, chips, sheets */
  html[data-theme="light"] .tgui-sticky-bar {
    background: var(--bg);
  }
  html[data-theme="light"] .tgui-segmented-control {
    background: var(--raised);
  }
  html[data-theme="light"] .seg-btn.active {
    background: var(--surface);
    box-shadow: none;
  }
  html[data-theme="light"] .tgui-chip {
    background: var(--surface);
  }
  html[data-theme="light"] .tgui-chip.active {
    background: var(--fill);
    color: var(--text);
    border-color: var(--line-strong);
  }
  html[data-theme="light"] .tgui-search-field {
    background: var(--surface);
  }
  html[data-theme="light"] .sheet-container {
    background: var(--surface);
  }
  html[data-theme="light"] .resolve-product-card, html[data-theme="light"] .candidate-lot-card {
    background: var(--surface);
    border-color: var(--line);
  }
  @media (min-width: 768px) {
    html[data-theme="light"] body.tgui-root {
      background: var(--bg);
    }
    html[data-theme="light"] .tgui-tabbar {
      background: var(--surface);
    }
  }
  @media (min-width: 860px) {
    html[data-theme="light"] .tgui-app-layout {
      background: var(--bg);
    }
    html[data-theme="light"] .tgui-navbar {
      background: var(--bg);
    }
    html[data-theme="light"] .tgui-segmented-control.main-tabs {
      background: var(--surface);
    }
  }
  /* v69 light theme - desktop sidebar active item contrast */
  @media (min-width: 860px) {
    html[data-theme="light"] .tgui-tabbar-item.active, html[data-theme="light"] .tgui-tabbar-item.active .tab-icon, html[data-theme="light"] .tgui-tabbar-item.active .tab-label {
      color: var(--text);
    }
  }
  /* ==========================================================================
   v70 layer - "Nebula" redesign
   New visual language: violet->cyan aurora accent, gradient hero, tinted
   squircle icons, floating island tabbar, pill stepper, glass sheets.
   Pure CSS override: every JS selector / id stays untouched.
   ========================================================================== */
  /* ---------- canvas ---------- */
  html[data-theme] body.tgui-root {
    font-family: var(--font);
    background: var(--bg);
    background-attachment: fixed;
  }
  html[data-theme="light"] body.tgui-root {
    background: var(--bg);
  }
  html[data-theme] .tgui-app-layout {
    background: transparent;
  }
  html[data-theme] ::selection {
    background: var(--fill-2);
    color: var(--text);
  }
  html[data-theme] .hero-amount, html[data-theme] .price, html[data-theme] .price-highlight, html[data-theme] .badge-value, html[data-theme] .badge-value-accent, html[data-theme] .tgui-pill-balance, html[data-theme] .resolve-product-price, html[data-theme] .page-counter {
    font-variant-numeric: tabular-nums;
  }
  /* ---------- navbar ---------- */
  html[data-theme] .tgui-navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  html[data-theme="light"] .tgui-navbar {
    background: var(--bg);
  }
  /* ---------- hero balance card ---------- */
  html[data-theme] .tgui-hero-banner {
    isolation: isolate;
    text-align: left;
    color: var(--on-accent);
    padding: 24px 24px 20px;
    margin: 8px var(--content-gutter) 20px;
    background: var(--accent);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: none;
  }
  html[data-theme] .tgui-hero-banner::before {
    top: auto;
    left: auto;
    right: -46px;
    bottom: -70px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: none;
    z-index: -1;
  }
  html[data-theme] .tgui-hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: none;
    pointer-events: none;
    z-index: -1;
  }
  html[data-theme] .tgui-hero-banner .hero-top-label {
    color: var(--text);
    font-size: 11px;
    font-weight: 500;
  }
  html[data-theme] .tgui-hero-banner .hero-amount {
    justify-content: flex-start;
    text-align: left;
    color: var(--text);
    font-size: clamp(32px, 10vw, 40px);
    font-weight: 500;
  }
  html[data-theme] .tgui-hero-banner .hero-amount .currency, html[data-theme] .tgui-hero-banner .hero-sub-usd, html[data-theme] .tgui-hero-banner .hero-sub-usd * {
    color: var(--text);
  }
  html[data-theme] .tgui-hero-banner .hero-freeze-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text);
    background: var(--fill-3);
    border: 1px solid var(--line-strong);
  }
  html[data-theme] .tgui-hero-banner .hero-freeze-row * {
    color: var(--text);
  }
  /* ---------- sections & cells ---------- */
  html[data-theme] .tgui-section-header {
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
  }
  html[data-theme] .tgui-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
  }
  html[data-theme="light"] .tgui-section {
    background: var(--surface);
  }
  html[data-theme] .tgui-cell {
    transition: background-color 160ms var(--ease);
  }
  html[data-theme] .tgui-cell.clickable:active, html[data-theme] .tgui-cell.clickable:hover {
    background: var(--fill-2);
  }
  html[data-theme] .tgui-cell .cell-title {
    font-weight: 500;
  }
  html[data-theme] .tgui-cell .cell-sub {
    color: var(--text-2);
  }
  html[data-theme] .tgui-icon-badge {
    border-radius: 12px;
    color: var(--text);
    box-shadow: none;
  }
  html[data-theme] .tgui-icon-badge.bg-blue {
    background: var(--surface);
  }
  html[data-theme] .tgui-icon-badge.bg-purple {
    background: var(--surface);
  }
  html[data-theme] .tgui-icon-badge.bg-green {
    background: var(--pos-tint);
    color: var(--pos);
  }
  html[data-theme] .tgui-icon-badge.bg-emerald {
    background: var(--pos-tint);
    color: var(--pos);
  }
  html[data-theme] .tgui-icon-badge.bg-yellow {
    background: var(--warn-tint);
    color: var(--warn);
  }
  html[data-theme] .tgui-icon-badge.bg-red {
    background: var(--neg-tint);
    color: var(--neg);
  }
  /* ---------- buttons ---------- */
  html[data-theme] .tgui-btn-filled {
    border-radius: 14px;
    font-weight: 500;
    transition: transform 120ms var(--ease), background-color 160ms var(--ease);
  }
  html[data-theme] .tgui-btn-filled:active {
    transform: scale(0.98);
  }
  html[data-theme] .tgui-btn-filled.primary {
    color: var(--on-accent);
    background: var(--accent);
    border-color: transparent;
    box-shadow: none;
  }
  html[data-theme] .tgui-btn-filled.primary:hover {
    background: var(--accent);
    color: var(--on-accent);
  }
  html[data-theme] .tgui-btn-filled.secondary {
    color: var(--text);
    background: var(--raised);
    border: 1px solid var(--line);
  }
  html[data-theme] .tgui-btn-filled.secondary:hover {
    background: var(--raised);
  }
  html[data-theme] .tgui-btn-filled.emerald {
    color: var(--pos);
    background: var(--pos-tint);
    box-shadow: none;
  }
  html[data-theme] .tgui-btn-filled.emerald:hover {
    background: var(--pos-tint);
    color: var(--pos);
  }
  html[data-theme] .tgui-btn-filled.danger {
    color: var(--neg);
    background: var(--neg-tint);
    border: 1px solid var(--neg-line);
    box-shadow: transparent;
  }
  html[data-theme] .tgui-btn-filled.danger:hover {
    background: var(--neg-tint);
  }
  html[data-theme] .tgui-btn-filled:disabled, html[data-theme] .tgui-btn-filled[disabled] {
    opacity: 0.48;
    box-shadow: transparent;
    transform: none;
  }
  html[data-theme] .tgui-circle-action {
    background: transparent;
    border: 0;
    box-shadow: transparent;
  }
  html[data-theme] .tgui-circle-action .circle-icon {
    border-radius: 16px;
    color: var(--text);
    background: var(--fill-2);
    border: 1px solid var(--line);
    box-shadow: none;
    transition: transform 120ms var(--ease), background-color 160ms var(--ease);
  }
  html[data-theme] .tgui-circle-action:active .circle-icon {
    transform: scale(0.98);
  }
  html[data-theme] .tgui-circle-action .circle-label {
    color: var(--text-2);
    font-weight: 500;
  }
  /* ---------- segmented / chips / pills ---------- */
  html[data-theme] .tgui-segmented-control {
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  html[data-theme] .seg-btn {
    border-radius: 10px;
    font-weight: 500;
  }
  html[data-theme] .seg-btn.active {
    color: var(--text);
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  html[data-theme="light"] .seg-btn.active {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  html[data-theme] .tgui-chip, html[data-theme] .tgui-preset-pill {
    border-radius: 999px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 500;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
  }
  html[data-theme] .tgui-chip.active, html[data-theme] .tgui-preset-pill.active {
    color: var(--text);
    background: var(--surface);
    border-color: transparent;
    box-shadow: none;
  }
  html[data-theme] .tgui-chip-code, html[data-theme] .meta-pill {
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  html[data-theme] .badge-value-accent {
    color: var(--text);
  }
  /* ---------- form controls ---------- */
  html[data-theme] .tgui-input, html[data-theme] .tgui-textarea, html[data-theme] .tgui-native-select {
    border-radius: 14px;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  html[data-theme] .tgui-input:focus, html[data-theme] .tgui-textarea:focus, html[data-theme] .tgui-native-select:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 4px var(--focus);
  }
  html[data-theme] .tgui-search-field {
    border-radius: 14px;
  }
  html[data-theme] .tgui-search-field:focus-within {
    box-shadow: 0 0 0 4px var(--focus);
  }
  html[data-theme] .tgui-switch input:checked + .tgui-switch-slider {
    background: var(--surface);
    box-shadow: none;
  }
  /* ---------- wizard stepper ---------- */
  html[data-theme] .w-step {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
  }
  html[data-theme] .w-step.done {
    color: var(--pos);
    background: var(--pos-tint);
    border-color: var(--pos-line);
  }
  html[data-theme] .w-step.active {
    color: var(--text);
    background: var(--surface);
    border-color: transparent;
    font-weight: 500;
    box-shadow: none;
  }
  /* ---------- bottom sheets ---------- */
  html[data-theme] .sheet-container {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
  }
  html[data-theme] .sheet-drag-handle {
    background: var(--fill-3);
    border-radius: 999px;
  }
  html[data-theme] .tgui-toast {
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: none;
  }
  html[data-theme] .tgui-sticky-bar {
    background: var(--surface);
  }
  /* ---------- tabbar: shared ---------- */
  html[data-theme] .tgui-tabbar-item {
    color: var(--text-2);
  }
  html[data-theme] .tgui-tabbar-item.active {
    color: var(--text);
  }
  html[data-theme] .tgui-tabbar-item.active .tab-label {
    color: var(--text);
  }
  /* ---------- phone: floating island tabbar ---------- */
  @media (max-width: 767px) {
    html[data-theme] .tgui-tabbar {
      left: 10px;
      right: 10px;
      bottom: calc(8px + var(--sab));
      height: var(--tabbar-h);
      padding: 0 4px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--surface);
      box-shadow: none;
    }
    html[data-theme="light"] .tgui-tabbar {
      background: var(--surface);
      border-color: var(--line);
      box-shadow: none;
    }
    html[data-theme] .tgui-tabbar-item.active::before {
      top: 6px;
      left: 50%;
      width: 48px;
      height: 28px;
      transform: translateX(-50%);
      border-radius: 999px;
      background: var(--fill-2);
      box-shadow: inset 0 0 0 1px var(--line);
    }
    html[data-theme] .tgui-tabbar-item.active .tab-icon {
      transform: none;
    }
    html[data-theme] .tgui-content {
      padding-bottom: calc(var(--tabbar-h) + var(--sab) + 40px);
    }
    html[data-theme] .tgui-toast {
      bottom: calc(var(--tabbar-h) + var(--sab) + 24px);
    }
    html[data-theme] .sheet-container {
      border-bottom: 0;
      border-radius: 16px 16px 0 0;
    }
  }
  /* ---------- desktop sidebar ---------- */
  @media (min-width: 860px) {
    html[data-theme] .tgui-tabbar {
      background: var(--fill);
    }
    html[data-theme="light"] .tgui-tabbar {
      background: var(--surface);
    }
    html[data-theme] .sidebar-brand-mark {
      color: var(--text);
      background: var(--surface);
      box-shadow: none;
    }
    html[data-theme] .tgui-tabbar-item {
      border-radius: 12px;
    }
    html[data-theme] .tgui-tabbar-item:hover {
      background: var(--surface);
      color: var(--text);
    }
    html[data-theme] .tgui-tabbar-item.active {
      color: var(--text);
      background: var(--fill-2);
      box-shadow: inset 0 0 0 1px var(--line);
    }
  }
  /* ---------- motion ---------- */
  html[data-theme] .tgui-view.active {
    animation: v70ViewIn 200ms var(--ease) both;
  }
  @media (prefers-reduced-motion: reduce) {
    html[data-theme] .tgui-view.active {
      animation: none;
    }
    html[data-theme] .tgui-btn-filled, html[data-theme] .tgui-cell {
      transition: none;
    }
  }
  /* =====================================================================
   v71 layer - live dashboard, honest data states, copy chips
   ===================================================================== */
  .dash-health[hidden], .net-banner[hidden] {
    display: none !important;
  }
  html[data-theme] .hero-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
  }
  html[data-theme] .hero-refresh {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--fill-2);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 160ms var(--ease), background-color 160ms var(--ease);
  }
  html[data-theme] .hero-refresh svg {
    width: 18px;
    height: 18px;
  }
  html[data-theme] .hero-refresh:hover {
    background: var(--fill-3);
  }
  html[data-theme] .hero-refresh:active {
    transform: scale(0.98);
  }
  html[data-theme] .hero-refresh.is-spinning svg {
    animation: v71spin .8s linear infinite;
  }
  @keyframes v71spin {
    to {
      transform: rotate(360deg);
    }
  }
  html[data-theme] .hero-updated {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
  }
  html[data-theme] .hero-updated::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pos-tint);
    box-shadow: 0 0 0 3px var(--pos-line);
    color: var(--pos);
  }
  html[data-theme] .hero-updated.is-stale::before {
    background: var(--warn-tint);
    box-shadow: 0 0 0 3px var(--warn-line);
    animation: none;
    color: var(--warn);
  }
  html[data-theme] .dash-health {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    background: var(--warn-tint);
    border: 1px solid var(--warn-line);
  }
  html[data-theme] .dash-health .icon-sm {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    color: var(--warn);
  }
  html[data-theme] .net-banner {
    position: fixed;
    left: 50%;
    top: calc(10px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 1000;
    max-width: calc(100% - 24px);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--neg);
    background: var(--neg-tint);
    box-shadow: none;
    animation: v71drop 200ms var(--ease) both;
  }
  html[data-theme] .badge-value.is-low {
    color: var(--neg);
    background: var(--neg-tint);
    border-radius: 10px;
    padding: 4px 8px;
  }
  html[data-theme] .badge-value.is-unavailable {
    opacity: .55;
  }
  html[data-theme] .low-chip {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    color: var(--text);
    background: var(--surface);
  }
  html[data-theme] .copy-chip {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0 4px;
    border-radius: 6px;
    cursor: copy;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    text-decoration-color: var(--text-2);
    transition: background-color 160ms var(--ease);
  }
  html[data-theme] .copy-chip:hover, html[data-theme] .copy-chip:focus-visible {
    background: var(--fill-2);
    outline: none;
  }
  html[data-theme] .copyable {
    cursor: copy;
  }
  html[data-theme] .copyable::after {
    content: "";
    display: inline-block;
    width: .72em;
    height: .72em;
    margin-left: 8px;
    opacity: .5;
    vertical-align: middle;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") no-repeat center / contain;
  }
  /* icon badges that had no v70 colour (DarkStore/AppRoute/KOSell looked washed out) */
  html[data-theme] .tgui-icon-badge.bg-amber {
    background: var(--warn-tint);
    color: var(--warn);
  }
  html[data-theme] .tgui-icon-badge.bg-cyan {
    background: var(--surface);
    color: var(--text);
  }
  html[data-theme] .tgui-icon-badge.bg-indigo {
    background: var(--surface);
    color: var(--text);
  }
  html[data-theme] .tgui-icon-badge.bg-gray {
    background: var(--fill-3);
    color: var(--text);
  }
  html.is-offline[data-theme] .hero-refresh {
    opacity: .5;
    pointer-events: none;
  }
  @media (prefers-reduced-motion: reduce) {
    html[data-theme] .hero-updated::before, html[data-theme] .hero-refresh.is-spinning svg, html[data-theme] .net-banner {
      animation: none;
    }
  }
  /* v71 repricer light: the card had a hard-coded dark gradient, so in the light theme its title and counters were almost invisible */
  html[data-theme="light"] .tgui-repricer-card {
    background: var(--bg);
    border-color: var(--line);
    box-shadow: none;
  }
  html[data-theme="light"] .tgui-repricer-card::before {
    background: none;
  }
  html[data-theme="light"] .tgui-repricer-card .tgui-progress-track {
    background: var(--fill-2);
  }
  html[data-theme="light"] .tgui-repricer-card .grid-cell {
    background: var(--fill);
    border-color: var(--line);
  }
  html[data-theme="light"] .tgui-repricer-card .cell-val {
    color: var(--text);
  }
  html[data-theme="light"] .tgui-repricer-card .cell-val.highlight {
    color: var(--pos);
  }
  html[data-theme="light"] .tgui-repricer-card .cell-lbl, html[data-theme="light"] .tgui-repricer-card .tgui-progress-labels {
    color: var(--text-2);
  }
  /* ==========================================================================
   v72 layer - lot detail sheet + lot copy flow
   ========================================================================== */
  html[data-theme] #modal-lot-detail [hidden], html[data-theme] #modal-lot-copy [hidden] {
    display: none !important;
  }
  html[data-theme] .lot-det-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
  }
  html[data-theme] .lot-det-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
  }
  html[data-theme] .lot-det-name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
  }
  html[data-theme] .lot-det-category {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-2);
  }
  html[data-theme] #lot-det-title[data-copy] {
    cursor: copy;
  }
  html[data-theme] .lot-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 16px;
  }
  html[data-theme] .lot-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  html[data-theme] .lot-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
  }
  html[data-theme] .lot-stat-val {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }
  html[data-theme] .lot-sec-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
  }
  html[data-theme] .lot-det-mappings {
    margin-bottom: 16px;
  }
  html[data-theme] .lot-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
  }
  html[data-theme] .lot-actions-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  html[data-theme] .lot-actions-grid .tgui-btn-filled {
    width: 100%;
    min-height: 44px;
  }
  html[data-theme] .lot-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
  }
  html[data-theme] .tgui-btn-filled.is-loading {
    opacity: .72;
    pointer-events: none;
  }
  html[data-theme] .lot-copy-source {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  html[data-theme] .lot-copy-source .lot-det-name {
    margin-top: 4px;
    font-size: 15px;
  }
  html[data-theme] .lot-copy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
  }
  html[data-theme] .lot-chip {
    appearance: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }
  html[data-theme] .lot-chip.is-active {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--fill-2);
  }
  html[data-theme] .lot-copy-preview {
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--fill-2);
    border: 1px solid var(--line-strong);
  }
  html[data-theme] .lot-copy-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  html[data-theme] .lot-copy-counter {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
  }
  html[data-theme] .lot-copy-counter.is-cut {
    color: var(--warn);
  }
  html[data-theme] .lot-copy-preview-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    word-break: break-word;
  }
  html[data-theme] .lot-copy-notes {
    margin: 12px 0 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
  }
  html[data-theme] .lot-copy-notes li + li {
    margin-top: 4px;
  }
  html[data-theme] .lot-copy-error {
    margin-top: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    background: var(--neg-tint);
    border: 1px solid var(--neg-line);
  }
  html[data-theme] .lot-copy-error.is-warn {
    background: var(--warn-tint);
    border-color: var(--warn-line);
  }
  html[data-theme] .lot-copy-result {
    padding: 8px 0 2px;
    text-align: center;
  }
  html[data-theme] .lot-copy-ok-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 4px auto 12px;
    border-radius: 16px;
    font-size: 28px;
    font-weight: 500;
    color: var(--pos);
    background: var(--pos-tint);
    box-shadow: none;
  }
  html[data-theme] .lot-copy-result-title {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
  }
  html[data-theme] .lot-copy-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px auto 0;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px dashed var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    cursor: copy;
  }
  html[data-theme] .lot-copy-result .lot-copy-notes {
    text-align: left;
  }
  html[data-theme] .lot-copy-result .lot-actions-grid {
    margin-top: 16px;
  }
  html[data-theme] .feed-actions-row .btn-cell-action[data-action="copy-lot"] {
    flex: 0 0 auto;
  }
  /* ==========================================================================
   v73 layer - button size scale
   L 48px: main actions in sheets, forms, services screen
   M 38px: card actions, pagination, toolbar pills
   S 34px: filter chips, segmented tabs (compact: 30px)
   Icon buttons 36-40px; ::after extends the tap area to 44px
   ========================================================================== */
  /* L */
  html[data-theme] body .tgui-btn-filled, html[data-theme] body .lot-actions-grid .tgui-btn-filled {
    height: auto;
    min-height: var(--btn-h-lg);
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 14px;
  }
  /* M */
  html[data-theme] body .btn-cell-action, html[data-theme] body .tgui-btn-page {
    min-height: var(--btn-h-md);
    padding: 8px 16px;
    font-size: 13px;
    line-height: 20px;
    font-weight: 500;
    border-radius: 10px;
  }
  html[data-theme] body .tgui-btn-pill-action, html[data-theme] body .tgui-sub-filter-row .tgui-btn-pill-action {
    height: var(--btn-h-md);
    min-height: var(--btn-h-md);
    align-self: center;
    padding: 0 16px;
    font-size: 13px;
    gap: 4px;
    border-radius: 999px;
  }
  /* S */
  html[data-theme] body .tgui-chip, html[data-theme] body .lot-chip {
    min-height: var(--btn-h-sm);
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }
  html[data-theme] body .seg-btn {
    min-height: var(--btn-h-sm);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
  }
  html[data-theme] body .tgui-segmented-control.compact .seg-btn {
    min-height: var(--btn-h-xs);
    padding: 0 12px;
    font-size: 12px;
  }
  /* Icon buttons */
  html[data-theme] body .tgui-nav-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    position: relative;
  }
  html[data-theme] body .sheet-close-btn, html[data-theme] body .hero-refresh {
    width: 36px;
    height: 36px;
    min-height: 36px;
    position: relative;
  }
  html[data-theme] body .tgui-nav-btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
  }
  html[data-theme] body .sheet-close-btn::after, html[data-theme] body .hero-refresh::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 14px;
  }
  /* Order number chip: 20px -> 26px tap height, line box unchanged */
  html[data-theme] body .copy-chip {
    padding: 4px 8px;
    margin: -4px 0;
    border-radius: 6px;
  }
  /* ==========================================================================
   v74 layer - compact layout
   Buttons: weight 500, no glow, width by content; scale 42 / 32 / 30 / 28 px
   Cards: 2-line titles, flat meta, one row of actions, delete as text button
   Filters: one row on mobile; search + filters in one bar from 860px
   ========================================================================== */
  /* ---------- buttons ---------- */
  html[data-theme] body .tgui-btn-filled, html[data-theme] body .lot-actions-grid .tgui-btn-filled {
    min-height: var(--btn-h-lg);
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
  }
  html[data-theme] body .tgui-btn-filled.secondary, html[data-theme] body .tgui-btn-filled.danger {
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-btn-filled.primary, html[data-theme] body .tgui-btn-filled.emerald {
    font-weight: 500;
  }
  html[data-theme] body .btn-cell-action, html[data-theme] body .tgui-btn-page {
    height: var(--btn-h-md);
    min-height: var(--btn-h-md);
    padding: 0 12px;
    font-size: 12px;
    line-height: 1;
    font-weight: 500;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  html[data-theme] body .tgui-btn-pill-action, html[data-theme] body .tgui-sub-filter-row .tgui-btn-pill-action {
    height: var(--btn-h-md);
    min-height: var(--btn-h-md);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-cell-after .tgui-btn-pill-action {
    height: 28px;
    min-height: 28px;
    padding: 0 12px;
    font-size: 12px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
  }
  html[data-theme] body .tgui-chip, html[data-theme] body .lot-chip {
    min-height: var(--btn-h-sm);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
  }
  html[data-theme] body .tgui-chip.active, html[data-theme] body .lot-chip.is-active {
    font-weight: 500;
  }
  html[data-theme] body .seg-btn {
    min-height: var(--btn-h-sm);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
  }
  html[data-theme] body .seg-btn.active {
    font-weight: 500;
  }
  html[data-theme] body .tgui-segmented-control.compact .seg-btn {
    min-height: var(--btn-h-xs);
    padding: 0 8px;
    font-size: 12px;
  }
  html[data-theme] body .tgui-nav-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
  html[data-theme] body .tgui-nav-btn::after {
    inset: -4px;
  }
  html[data-theme] body .sheet-close-btn, html[data-theme] body .hero-refresh {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }
  html[data-theme] body .sheet-close-btn::after, html[data-theme] body .hero-refresh::after {
    inset: -6px;
  }
  /* ---------- cards ---------- */
  html[data-theme] body .tgui-feed-card {
    padding: 12px 16px;
    border-radius: 16px;
    gap: 8px;
  }
  html[data-theme] body .feed-card-header {
    gap: 8px;
    margin-bottom: 0;
  }
  html[data-theme] body .feed-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  html[data-theme] body .feed-card-header [class*="badge-status"] {
    font-size: 11px;
    padding: 2px 8px;
    flex-shrink: 0;
  }
  html[data-theme] body .tgui-feed-card .cell-sub {
    font-size: 12px;
    margin-top: 2px;
  }
  html[data-theme] body .feed-meta-row {
    gap: 4px;
  }
  html[data-theme] body .meta-pill {
    font-size: 11px;
    line-height: 18px;
    padding: 1px 8px;
    border-radius: 6px;
    border-color: transparent;
    background: var(--fill);
  }
  html[data-theme="light"] body .meta-pill {
    background: var(--fill);
  }
  html[data-theme] body .meta-pill.price {
    font-weight: 500;
    border-color: transparent;
  }
  html[data-theme] body .feed-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
  }
  html[data-theme] body .feed-actions-row > .btn-cell-action, html[data-theme] body .feed-actions-row > button {
    flex: 0 0 auto;
    width: auto;
  }
  html[data-theme] body .feed-actions-row > .btn-cell-action.danger {
    margin-left: auto;
    padding: 0 8px;
    background: transparent;
    border-color: transparent;
    color: var(--neg);
  }
  /* ---------- filter rows ---------- */
  html[data-theme] body .tgui-sub-filter-row {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 8px;
  }
  html[data-theme] body .tgui-sub-filter-row .tgui-segmented-control {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html[data-theme] body .tgui-sub-filter-row .spacer {
    display: block;
    flex: 1 1 0;
    min-width: 0;
  }
  html[data-theme] body .tgui-sub-filter-row .tgui-btn-pill-action {
    flex: 0 0 auto;
  }
  /* ---------- lot detail sheet ---------- */
  html[data-theme] body .lot-actions-grid {
    gap: 8px;
  }
  html[data-theme] body .lot-actions-grid .tgui-btn-filled {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }
  @media (max-width: 600px) {
    html[data-theme] body .tgui-sub-filter-row .sub-label {
      display: none;
    }
  }
  /* ---------- desktop ---------- */
  @media (min-width: 860px) {
    html[data-theme] body .tgui-sticky-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px 12px;
    }
    html[data-theme] body .tgui-sticky-bar > .tgui-search-field {
      flex: 1 1 280px;
      max-width: 420px;
      margin: 0;
    }
    html[data-theme] body .tgui-sticky-bar > .tgui-sub-filter-row {
      flex: 1 1 auto;
      margin: 0;
    }
    html[data-theme] body .tgui-sticky-bar > .tgui-chips-scroller {
      order: 5;
      flex: 1 1 100%;
      margin: 0;
    }
    html[data-theme] body .tgui-feed-card {
      padding: 16px 16px;
    }
  }
  /* v74b: card grid by width - 1 col at 1024, 2 at 1366, 3 at 1440, 4 at 1920 */
  @media (min-width: 860px) {
    html[data-theme] body .tgui-cards-feed, html[data-theme] body #mappings-container, html[data-theme] body #lots-container, html[data-theme] body #orders-container {
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
      gap: 12px !important;
    }
  }
  /* v74c: services screen - row without wrap, 4 repricer stats in one row */
  html[data-theme] body .tgui-cell.service-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
  }
  html[data-theme] body .tgui-cell.service-cell .tgui-cell-before {
    grid-column: 1;
  }
  html[data-theme] body .tgui-cell.service-cell .tgui-cell-middle {
    grid-column: 2;
    min-width: 0;
    flex: none;
  }
  html[data-theme] body .tgui-cell.service-cell .tgui-cell-after {
    grid-column: 3;
    width: auto;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
  }
  html[data-theme] body .tgui-cell.service-cell .tgui-cell-after .btn-cell-action {
    height: 28px;
    min-height: 28px;
    padding: 0 12px;
    font-size: 12px;
  }
  html[data-theme] body .tgui-repricer-card .tgui-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  html[data-theme] body .tgui-repricer-card .grid-cell {
    padding: 8px 4px;
    min-width: 0;
  }
  html[data-theme] body .tgui-repricer-card .cell-val {
    font-size: 15px;
  }
  html[data-theme] body .tgui-repricer-card .cell-lbl {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  html[data-theme] body .repricer-actions-row {
    flex-direction: row;
    gap: 8px;
  }
  html[data-theme] body .repricer-actions-row button {
    width: auto;
    min-height: 40px;
  }
  html[data-theme] body .repricer-actions-row #btn-run-repricer {
    flex: 1 1 auto;
    white-space: nowrap;
  }
  html[data-theme] body .repricer-actions-row #btn-cancel-repricer {
    flex: 0 0 auto;
    padding: 0 16px;
  }
  /* ==========================================================================
   v75 layer - neat & rounded UI
   - Shapes: every button, chip, tab, badge and pill is fully rounded;
     cards 20px, fields 14px, icon buttons and switch knobs are circles
   - Color: flat brand accent instead of the 3-stop gradient on controls
   - Type: UI font with tabular digits instead of monospace numbers
   - Dashboard: "На контроле" block, KPI tiles, richer service rows
   ========================================================================== */
  html[data-theme] {
    --c-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a9a7bd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  }
  html[data-theme="light"] {
    --c-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2357546d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  }
  /* ---------- type ---------- */
  html[data-theme] body {
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  html[data-theme] body code, html[data-theme] body kbd, html[data-theme] body pre, html[data-theme] body .tgui-chip-code, html[data-theme] body #tmpl-content-textarea {
    font-family: var(--font-mono);
  }
  /* ---------- 1. one radius scale ---------- */
  html[data-theme] body .tgui-btn-filled, html[data-theme] body .btn-cell-action, html[data-theme] body .tgui-btn-page, html[data-theme] body .tgui-btn-pill-action, html[data-theme] body .tgui-link-btn, html[data-theme] body .tgui-btn-plain, html[data-theme] body .lot-link-btn, html[data-theme] body .btn-icon, html[data-theme] body .tgui-chip, html[data-theme] body .lot-chip, html[data-theme] body .tgui-preset-pill, html[data-theme] body .tgui-segmented-control, html[data-theme] body .seg-btn, html[data-theme] body .meta-pill, html[data-theme] body .low-chip, html[data-theme] body .summary-badge, html[data-theme] body .tgui-pill-balance, html[data-theme] body .tgui-nav-status, html[data-theme] body .hero-freeze-row, html[data-theme] body .w-step, html[data-theme] body .copy-chip, html[data-theme] body .badge-status-green, html[data-theme] body .badge-status-amber, html[data-theme] body .badge-status-red, html[data-theme] body .badge-status-neutral {
    border-radius: var(--r-pill);
  }
  html[data-theme] body .tgui-nav-btn, html[data-theme] body .hero-refresh, html[data-theme] body .sheet-close-btn, html[data-theme] body .circle-icon, html[data-theme] body .empty-icon-badge {
    border-radius: 50%;
  }
  html[data-theme] body .tgui-nav-btn::after, html[data-theme] body .hero-refresh::after, html[data-theme] body .sheet-close-btn::after {
    border-radius: 50%;
  }
  html[data-theme] body .tgui-section, html[data-theme] body .tgui-feed-card, html[data-theme] body .tgui-quick-actions-bar, html[data-theme] body .tgui-repricer-card, html[data-theme] body .eco-summary-card, html[data-theme] body .tgui-empty-state, html[data-theme] body .tgui-skeleton-card, html[data-theme] body .tgui-spoiler, html[data-theme] body .code-preview-box, html[data-theme] body .resolve-preview-box, html[data-theme] body .resolve-card, html[data-theme] body .resolve-error-card, html[data-theme] body .resolve-product-card, html[data-theme] body .candidate-lot-card, html[data-theme] body .candidates-banner, html[data-theme] body .order-diagnosis-card, html[data-theme] body .wiz-notice-banner, html[data-theme] body .lot-copy-preview, html[data-theme] body .lot-copy-result, html[data-theme] body .dash-health {
    border-radius: var(--r-card);
  }
  html[data-theme] body .tgui-hero-banner {
    border-radius: 16px;
  }
  html[data-theme] body .eco-row, html[data-theme] body .lot-stat, html[data-theme] body .order-metric, html[data-theme] body .tgui-param-top-row, html[data-theme] body .wiz-upload-dropzone, html[data-theme] body .candidate-cover-wrap, html[data-theme] body .feed-card-thumb, html[data-theme] body .feed-card-thumb-placeholder, html[data-theme] body .tgui-repricer-card .grid-cell {
    border-radius: var(--r-inner);
  }
  html[data-theme] body .tgui-input, html[data-theme] body .tgui-textarea, html[data-theme] body .tgui-native-select, html[data-theme] body .tgui-search-field, html[data-theme] body .tgui-switch-row-compact {
    border-radius: var(--r-field);
  }
  html[data-theme] body .tgui-icon-badge {
    border-radius: var(--r-icon);
  }
  html[data-theme] body .tgui-toast {
    border-radius: 16px;
  }
  html[data-theme] body #wiz-cover-container, html[data-theme] body .wiz-cover-box {
    border-radius: 16px;
  }
  html[data-theme] body .wiz-cover-box img, html[data-theme] body .wiz-cover-placeholder {
    border-radius: 14px;
  }
  /* ---------- 2. buttons ---------- */
  /* L - main actions */
  html[data-theme] body .tgui-btn-filled, html[data-theme] body .lot-actions-grid .tgui-btn-filled {
    min-height: 48px;
    padding: 0 20px;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 160ms var(--ease), transform 120ms var(--ease), opacity 160ms var(--ease);
  }
  html[data-theme] body .lot-actions-grid .tgui-btn-filled {
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
  }
  html[data-theme] body .tgui-btn-filled.primary {
    box-shadow: none;
  }
  html[data-theme] body .tgui-btn-filled.secondary {
    background: var(--fill);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-btn-filled.secondary:hover {
    background: var(--fill-2);
  }
  html[data-theme] body .tgui-btn-filled.danger {
    background: var(--neg-tint);
    color: var(--neg);
    border: 1px solid transparent;
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-btn-filled.danger:hover {
    background: var(--neg-tint);
  }
  html[data-theme] body .tgui-btn-filled:active:not(:disabled) {
    transform: scale(0.98);
  }
  html[data-theme] body .tgui-btn-filled:disabled, html[data-theme] body .tgui-btn-filled[aria-disabled="true"] {
    opacity: 0.45;
    box-shadow: transparent;
    cursor: not-allowed;
  }
  /* M - card and row actions */
  html[data-theme] body .btn-cell-action, html[data-theme] body .feed-actions-row > .btn-cell-action {
    height: 36px;
    min-height: 36px;
    padding: 0 16px;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
  }
  html[data-theme] body .btn-cell-action.danger, html[data-theme] body .feed-actions-row > .btn-cell-action.danger {
    padding: 0 16px;
    background: var(--neg-tint);
    border-color: transparent;
    color: var(--neg);
  }
  html[data-theme] body .btn-cell-action.danger:hover, html[data-theme] body .feed-actions-row > .btn-cell-action.danger:hover {
    background: var(--neg-tint);
  }
  html[data-theme] body .btn-cell-action:active:not(:disabled) {
    transform: scale(0.98);
  }
  html[data-theme] body .btn-cell-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  html[data-theme] body .tgui-cell.service-cell .tgui-cell-after .btn-cell-action {
    height: 32px;
    min-height: 32px;
    min-width: 66px;
    padding: 0 16px;
    font-size: 12px;
  }
  /* toolbar actions: "+ Добавить", "Обновить" */
  html[data-theme] body .tgui-btn-pill-action, html[data-theme] body .tgui-sub-filter-row .tgui-btn-pill-action {
    height: 36px;
    min-height: 36px;
    padding: 0 16px;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--fill-2);
    color: var(--text);
    border: 1px solid transparent;
    box-shadow: transparent;
    white-space: nowrap;
  }
  html[data-theme] body .tgui-btn-pill-action:hover, html[data-theme] body .tgui-sub-filter-row .tgui-btn-pill-action:hover {
    background: var(--fill-2);
  }
  html[data-theme] body .tgui-cell-after .tgui-btn-pill-action {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    background: var(--fill-2);
    color: var(--text);
    border-color: transparent;
  }
  /* pagination */
  html[data-theme] body .tgui-pagination-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  html[data-theme] body .tgui-pagination-row[hidden] {
    display: none;
  }
  html[data-theme] body .tgui-btn-page {
    height: 36px;
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-btn-page:hover:not(:disabled) {
    background: var(--fill-2);
  }
  html[data-theme] body .tgui-btn-page:disabled {
    opacity: 0.38;
    cursor: default;
  }
  html[data-theme] body .tgui-pagination-row .page-counter {
    padding: 0 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-align: center;
  }
  html[data-theme] body #supplier-pagination #sup-page-info {
    order: -1;
    flex: 1 0 100%;
  }
  /* ---------- 3. chips, segments, presets ---------- */
  html[data-theme] body .tgui-chip, html[data-theme] body .lot-chip {
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text-2);
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-chip:hover, html[data-theme] body .lot-chip:hover {
    background: var(--fill-2);
    color: var(--text);
  }
  html[data-theme] body .tgui-chip.active, html[data-theme] body .lot-chip.is-active, html[data-theme] body .tgui-preset-pill.active {
    background: var(--raised-2);
    border-color: transparent;
    color: var(--text);
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-preset-pill {
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
  }
  html[data-theme] body .tgui-segmented-control {
    padding: 4px;
    gap: 2px;
    background: var(--fill);
    border: 1px solid var(--line);
    box-shadow: transparent;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html[data-theme] body .tgui-segmented-control::-webkit-scrollbar {
    display: none;
  }
  html[data-theme] body .seg-btn {
    min-height: 32px;
    padding: 0 16px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    background: transparent;
    border: 0;
    box-shadow: transparent;
    white-space: nowrap;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
  }
  html[data-theme] body .seg-btn:hover {
    color: var(--text);
  }
  html[data-theme] body .seg-btn.active {
    background: var(--fill-2);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  html[data-theme] body .tgui-segmented-control.compact .seg-btn {
    min-height: 28px;
    padding: 0 12px;
    font-size: 12px;
  }
  /* ---------- 4. fields and selects ---------- */
  html[data-theme] body .tgui-input, html[data-theme] body .tgui-textarea, html[data-theme] body .tgui-native-select {
    background-color: var(--fill);
    border: 1px solid var(--line);
    color: var(--text);
  }
  html[data-theme] body .tgui-input:hover, html[data-theme] body .tgui-textarea:hover, html[data-theme] body .tgui-native-select:hover {
    border-color: var(--line-strong);
  }
  html[data-theme] body .tgui-input:focus, html[data-theme] body .tgui-textarea:focus, html[data-theme] body .tgui-native-select:focus {
    outline: none;
    border-color: var(--focus);
    background-color: var(--fill);
    box-shadow: 0 0 0 4px var(--focus);
  }
  html[data-theme] body .tgui-input::placeholder, html[data-theme] body .tgui-textarea::placeholder {
    color: var(--text-2);
    opacity: 1;
  }
  html[data-theme] body .tgui-native-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: none;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  html[data-theme] body .tgui-native-select option {
    background-color: var(--surface);
    color: var(--text);
  }
  html[data-theme] body .tgui-input:disabled, html[data-theme] body .tgui-native-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  html[data-theme] body .tgui-search-field {
    height: 48px;
    padding: 0 16px;
    background: var(--fill);
    border: 1px solid var(--line);
  }
  html[data-theme] body .tgui-search-field:hover {
    border-color: var(--line-strong);
  }
  html[data-theme] body .tgui-search-field:focus-within {
    border-color: var(--focus);
    background: var(--fill);
    box-shadow: 0 0 0 4px var(--focus);
  }
  html[data-theme] body .tgui-search-field input {
    background: transparent;
    border: 0;
    box-shadow: transparent;
    outline: none;
    font-size: 15px;
    color: var(--text);
  }
  /* ---------- 5. switches ---------- */
  html[data-theme] body .tgui-switch-slider {
    background: var(--fill-2);
    box-shadow: transparent;
    border-radius: var(--r-pill);
    transition: background-color 200ms var(--ease);
  }
  html[data-theme] body .tgui-switch-slider::before {
    border-radius: 50%;
    background: var(--knob);
    box-shadow: 0 0 0 0.5px var(--line);
  }
  html[data-theme] body .tgui-switch input:checked + .tgui-switch-slider {
    background: var(--raised-2);
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-switch input:focus-visible + .tgui-switch-slider {
    box-shadow: 0 0 0 4px var(--focus);
  }
  html[data-theme] body .tgui-switch input:disabled + .tgui-switch-slider {
    opacity: 0.5;
  }
  html[data-theme] body .tgui-switch-row-compact, html[data-theme] body .tgui-filter-actions-row .tgui-switch-row-compact {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    background: var(--fill);
    border: 1px solid var(--line);
    -webkit-user-select: none;
    user-select: none;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
  }
  html[data-theme] body .tgui-switch-row-compact:hover {
    border-color: var(--line-strong);
  }
  html[data-theme] body .switch-ui-compact {
    width: 40px;
    height: 24px;
    flex: 0 0 38px;
    background: var(--fill-2);
    border-radius: var(--r-pill);
  }
  html[data-theme] body .switch-ui-compact::before {
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    box-shadow: none;
  }
  html[data-theme] body .tgui-switch-row-compact input:checked + .switch-ui-compact {
    background: var(--raised-2);
  }
  html[data-theme] body .tgui-switch-row-compact input:checked + .switch-ui-compact::before {
    transform: translateX(16px);
  }
  html[data-theme] body .tgui-switch-row-compact .switch-txt {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
  }
  /* ---------- 6. containers, cells, cards ---------- */
  html[data-theme] body .tgui-section {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    overflow: hidden;
  }
  html[data-theme] body .tgui-section-header {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
  }
  html[data-theme] body .tgui-cell[data-nav] {
    cursor: pointer;
    transition: background-color 160ms var(--ease);
  }
  html[data-theme] body .tgui-cell[data-nav]:hover {
    background-color: var(--fill);
  }
  html[data-theme] body .tgui-cell[data-nav]:active {
    background-color: var(--fill-2);
  }
  html[data-theme] body .tgui-feed-card {
    padding: 16px 16px;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    transition: border-color 160ms var(--ease), transform 120ms var(--ease);
  }
  html[data-theme] body .tgui-feed-card.clickable-card, html[data-theme] body .tgui-feed-card[data-action] {
    cursor: pointer;
  }
  html[data-theme] body .tgui-feed-card.clickable-card:hover, html[data-theme] body .tgui-feed-card[data-action]:hover {
    border-color: var(--line);
  }
  html[data-theme] body .feed-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
  }
  html[data-theme] body .feed-meta-row {
    gap: 8px;
  }
  html[data-theme] body .meta-pill {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    background: var(--fill);
    border: 0;
    color: var(--text-2);
  }
  html[data-theme] body .meta-pill.price {
    background: var(--fill-2);
    color: var(--text);
    font-weight: 500;
  }
  html[data-theme] body .feed-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  /* buttons share the row evenly - no ragged gaps */
  html[data-theme] body .feed-actions-row > .btn-cell-action {
    flex: 1 1 auto;
    margin-left: 0;
  }
  html[data-theme] body .feed-actions-row > .btn-cell-action[data-action="copy-lot"] {
    flex: 1 1 auto;
  }
  @media (max-width: 420px) {
    html[data-theme] body .feed-actions-row {
      gap: 8px;
    }
    html[data-theme] body .feed-actions-row > .btn-cell-action {
      padding: 0 8px;
      font-size: 12px;
    }
  }
  /* repricer: run + stop always fit inside the card */
  html[data-theme] body .repricer-actions-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  html[data-theme] body .repricer-actions-row #btn-run-repricer {
    flex: 2 1 auto;
    min-width: 0;
    padding: 0 16px;
    font-size: 13px;
    white-space: nowrap;
  }
  html[data-theme] body .repricer-actions-row #btn-cancel-repricer {
    flex: 1 0 auto;
    padding: 0 16px;
    font-size: 13px;
    white-space: nowrap;
  }
  html[data-theme] body .badge-status-green, html[data-theme] body .badge-status-amber, html[data-theme] body .badge-status-red, html[data-theme] body .badge-status-neutral, html[data-theme] body .feed-card-header [class*="badge-status"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
  }
  html[data-theme] body .tgui-empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: transparent;
  }
  html[data-theme] body .empty-icon-badge {
    background: var(--fill-2);
    color: var(--text);
  }
  /* ---------- 7. sheets and wizard ---------- */
  html[data-theme] body .sheet-drag-handle {
    width: 40px;
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--fill-3);
  }
  html[data-theme] body .sheet-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fill);
    color: var(--text-2);
    border: 0;
  }
  html[data-theme] body .sheet-close-btn:hover {
    background: var(--fill-2);
    color: var(--text);
  }
  html[data-theme] body .w-step {
    padding: 8px 12px;
    font-size: 12px;
  }
  html[data-theme] body .w-step.active {
    background: var(--raised-2);
    border-color: transparent;
    color: var(--text);
    box-shadow: transparent;
  }
  /* ---------- 8. navigation ---------- */
  @media (max-width: 859px) {
    html[data-theme] body .tgui-tabbar .tab-label {
      max-width: none;
      overflow: visible;
      text-overflow: clip;
      white-space: nowrap;
      font-size: 11px;
    }
  }
  @media (max-width: 767px) {
    html[data-theme] body .tgui-tabbar-item.active::before {
      background: var(--fill-2);
      box-shadow: transparent;
    }
  }
  @media (min-width: 860px) {
    html[data-theme] body .tgui-tabbar-item.active {
      background: var(--fill-2);
      box-shadow: transparent;
    }
  }
  /* ---------- 9. dashboard ---------- */
  html[data-theme] body .hero-chips-row {
    display: block;
    margin-top: 8px;
  }
  html[data-theme] body .hero-chips-row .hero-freeze-row {
    margin: 8px 8px 0 0;
    vertical-align: middle;
    white-space: nowrap;
  }
  html[data-theme] body .hero-chips-row .hero-freeze-row:last-child {
    margin-right: 0;
  }
  html[data-theme] body .hero-chips-row .hero-freeze-row .icon-sm {
    width: 16px;
    height: 16px;
    flex: 0 0 13px;
  }
  html[data-theme] body .tgui-quick-actions-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
    padding: 16px 8px 12px;
  }
  @media (max-width: 767px) {
    html[data-theme] body .tgui-quick-actions-bar {
      margin: 0 12px 16px;
    }
    html[data-theme] body .tgui-spoiler {
      margin-left: 12px;
      margin-right: 12px;
    }
  }
  html[data-theme] body .tgui-circle-action .circle-icon {
    width: 48px;
    height: 48px;
    background: var(--fill-2);
    color: var(--text);
    border: 0;
    box-shadow: transparent;
  }
  html[data-theme] body .tgui-circle-action .circle-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text);
    stroke: currentColor;
  }
  html[data-theme] body .tgui-circle-action:hover .circle-icon, html[data-theme] body .tgui-circle-action:focus-visible .circle-icon {
    background: var(--fill-2);
  }
  html[data-theme] body .tgui-circle-action .circle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
  }
  html[data-theme] body #dash-sec-sales-body.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    background: var(--fill-2);
  }
  html[data-theme] body .dash-kpi {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 16px 16px;
    background: var(--surface);
  }
  html[data-theme] body .dash-kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 4px;
  }
  html[data-theme] body .dash-kpi-top .tgui-icon-badge {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 8px;
  }
  html[data-theme] body .dash-kpi-top .tgui-icon-badge svg {
    width: 16px;
    height: 16px;
  }
  html[data-theme] body .dash-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html[data-theme] body .dash-kpi-value {
    font-size: 24px;
    line-height: 1.15;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html[data-theme] body .dash-kpi-value small {
    margin-left: 4px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-2);
  }
  html[data-theme] body .dash-kpi.is-profit .dash-kpi-value {
    color: var(--pos);
  }
  html[data-theme] body .dash-kpi-sub {
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-2);
  }
  html[data-theme] body .dash-att-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 8px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    background: var(--neg-tint);
    color: var(--neg);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    vertical-align: 1px;
  }
  html[data-theme] body .dash-att-count[hidden] {
    display: none !important;
  }
  html[data-theme] body .dash-att-item .att-ico {
    background: var(--fill-2);
    color: var(--text);
  }
  html[data-theme] body .dash-att-item .att-ico svg {
    color: inherit;
    stroke: currentColor;
  }
  html[data-theme] body .dash-att-item.tone-ok .att-ico {
    background: var(--pos-tint);
    color: var(--pos);
  }
  html[data-theme] body .dash-att-item.tone-warn .att-ico {
    background: var(--warn-tint);
    color: var(--warn);
  }
  html[data-theme] body .dash-att-item.tone-bad .att-ico {
    background: var(--neg-tint);
    color: var(--neg);
  }
  html[data-theme] body .dash-att-item .cell-sub {
    white-space: normal;
  }
  html[data-theme] body .dash-att-item .tgui-cell-after {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  html[data-theme] body .dash-att-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    background: var(--fill-2);
    color: var(--text);
  }
  html[data-theme] body .dash-att-item.tone-ok .dash-att-badge {
    background: var(--pos-tint);
    color: var(--pos);
  }
  html[data-theme] body .dash-att-item.tone-warn .dash-att-badge {
    background: var(--warn-tint);
    color: var(--warn);
  }
  html[data-theme] body .dash-att-item.tone-bad .dash-att-badge {
    background: var(--neg-tint);
    color: var(--neg);
  }
  html[data-theme] body .dash-att-item.is-link {
    cursor: pointer;
    transition: background-color 160ms var(--ease);
  }
  html[data-theme] body .dash-att-item.is-link:hover {
    background-color: var(--fill);
  }
  @media (max-width: 859px) {
    html[data-theme] body #dash-hero-banner {
      order: 1;
    }
    html[data-theme] body #dash-sec-attention-head {
      order: 2;
    }
    html[data-theme] body #dash-attention {
      order: 3;
    }
    html[data-theme] body #dash-quick-actions {
      order: 4;
    }
    html[data-theme] body #dash-sec-sales-head {
      order: 5;
    }
    html[data-theme] body #dash-sec-sales-body {
      order: 6;
    }
    html[data-theme] body #dash-sec-suppliers-head {
      order: 7;
    }
    html[data-theme] body #dash-sec-suppliers-body {
      order: 8;
    }
    html[data-theme] body #dash-sec-services-head {
      order: 9;
    }
    html[data-theme] body #dash-sec-services-body {
      order: 10;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    html[data-theme] body .dash-att-item.is-loading .att-ico {
      animation: none;
    }
    html[data-theme] body .tgui-btn-filled, html[data-theme] body .btn-cell-action, html[data-theme] body .tgui-feed-card {
      transition: none;
    }
  }
}

/* ===== components-a.css ===== */
/* ==========================================================================
   GGSELL Control — components, part A: frame and dashboard (unslop pass)
   Unlayered on purpose: beats the legacy layer without !important.
   ========================================================================== */

/* ---------- navbar ---------- */
.tgui-navbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tgui-nav-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}
.tgui-nav-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--text-2);
}
.tgui-nav-status:has(.pulse-dot.red) {
  color: var(--neg);
}
.pulse-dot {
  width: 6px;
  height: 6px;
  margin: 0;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: none;
  animation: none;
}
.pulse-dot.red {
  background: var(--neg);
}
.pulse-dot::before,
.pulse-dot::after {
  content: none;
}

/* balance ticker: plain text, no capsule */
.tgui-pill-balance {
  gap: 6px;
  min-height: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
}
.tgui-pill-balance strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pill-rub-parens {
  color: var(--text-3);
}

.tgui-nav-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
  transition: background-color 120ms var(--ease), color 120ms var(--ease), transform 120ms var(--ease);
}
.tgui-nav-btn .icon {
  width: 20px;
  height: 20px;
}
@media (max-width: 767px) {
  .tgui-nav-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---------- tab bar (up to 859px) and sidebar (860px+) ---------- */
.tgui-tabbar-item::before,
.tgui-tabbar-item.active::before {
  content: none;
}
.tgui-tabbar-item .tab-icon {
  filter: none;
  transform: none;
}
@media (max-width: 859px) {
  .tgui-tabbar {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: calc(var(--tabbar-h) + var(--sab, 0px));
    margin: 0;
    padding: 0 4px var(--sab, 0px);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
    transform: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .tgui-tabbar-item {
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 6px 2px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--text-3);
  }
  .tgui-tabbar-item.active {
    background: none;
    color: var(--text);
  }
  .tgui-tabbar-item .tab-icon {
    width: 22px;
    height: 22px;
  }
  .tgui-tabbar-item .tab-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 14px;
    letter-spacing: 0;
  }
}
@media (min-width: 860px) {
  .tgui-tabbar {
    gap: 2px;
    padding: 16px 12px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg-deep);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .tgui-sidebar-brand {
    min-height: 0;
    margin: 0 0 12px;
    padding: 4px 10px 16px;
    border-bottom: 1px solid var(--line);
  }
  .tgui-sidebar-brand strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text);
  }
  .tgui-tabbar-item {
    gap: 10px;
    height: auto;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    box-shadow: none;
    color: var(--text-2);
  }
  .tgui-tabbar-item.active {
    border-color: var(--line);
    background: var(--nav-active);
    box-shadow: var(--shadow-small);
    color: var(--text);
  }
  .tgui-tabbar-item .tab-icon {
    width: 18px;
    height: 18px;
  }
  .tgui-tabbar-item .tab-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0;
  }
}
.sidebar-brand-mark {
  display: none;
}

/* ---------- sections, headers, cells ---------- */
.tgui-section-header {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.tgui-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.tgui-cell {
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
}
.tgui-cell + .tgui-cell::before {
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--line);
}
.tgui-cell + .tgui-cell:has(> .tgui-cell-before)::before {
  left: 56px;
}
.cell-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--text);
}
.cell-sub {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--text-2);
}
.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.tgui-icon-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--fill-2);
  box-shadow: none;
  color: var(--text-2);
}
.tgui-icon-badge svg {
  width: 18px;
  height: 18px;
}

/* ---------- hero: one quiet surface, the number carries it ---------- */
.tgui-hero-banner {
  margin: 8px 12px 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.tgui-hero-banner::before,
.tgui-hero-banner::after {
  content: none;
}
/* two-column dashboard (the legacy grid starts at 768px): shared edges, headers sit
   closer to the block they label than to the block above */
@media (min-width: 768px) {
  .tgui-hero-banner {
    margin: 0;
  }
  .tgui-dash-col .tgui-section-header {
    margin: 16px 2px 0;
  }
  .tgui-dash-col > .tgui-section-header:first-child {
    margin-top: 0;
  }
}
@media (min-width: 860px) {
  .tgui-hero-banner {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    padding: 24px;
    text-align: left;
  }
}
.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-top-label {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.hero-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px 6px;
  margin: 8px 0 0;
  font-size: 34px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.hero-amount .currency {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-2);
}
.hero-sub-usd {
  margin-left: 6px;
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  color: var(--text-2);
}
@media (max-width: 767px) {
  .hero-amount {
    font-size: 30px;
    line-height: 36px;
  }
}
.hero-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 16px;
  margin-top: 12px;
}
.hero-freeze-row {
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--text-2);
}
.hero-freeze-row .icon-sm {
  display: none;
}
.hero-freeze-row strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.hero-updated {
  justify-content: flex-start;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--text-3);
}
.hero-updated::before {
  content: none;
}
.hero-refresh {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color 120ms var(--ease), color 120ms var(--ease), transform 120ms var(--ease);
}
.hero-refresh svg {
  width: 18px;
  height: 18px;
}

/* ---------- KPI: one grouped surface with hairline dividers ---------- */
.dash-kpi-grid {
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--line);
}
.dash-kpi {
  gap: 4px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.dash-kpi-top {
  gap: 6px;
  margin: 0;
}
.dash-kpi-top .tgui-icon-badge {
  display: none;
}
.dash-kpi-label {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.dash-kpi-value {
  font-size: 24px;
  font-weight: 500;
  line-height: 30px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.dash-kpi-value small {
  margin-left: 2px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
}
.dash-kpi-sub {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-3);
}

/* ---------- "На контроле": tone lives in one small dot ---------- */
.dash-att-item .tgui-cell-before {
  justify-content: center;
  width: 16px;
  min-width: 16px;
}
.dash-att-item .att-ico {
  width: 8px;
  height: 8px;
  min-width: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: none;
}
.dash-att-item .att-ico svg {
  display: none;
}
.dash-att-item.tone-ok .att-ico {
  background: var(--pos);
}
.dash-att-item.tone-warn .att-ico {
  background: var(--warn);
}
.dash-att-item.tone-bad .att-ico {
  background: var(--neg);
}
.tgui-cell + .tgui-cell.dash-att-item:has(> .tgui-cell-before)::before {
  left: 44px;
}

/* ---------- quick actions: one row of quiet tiles ---------- */
.tgui-quick-actions-bar {
  display: grid;
  flex: none;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.tgui-circle-action {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: auto;
  min-height: 72px;
  padding: 12px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
  transition: border-color 120ms var(--ease), transform 120ms var(--ease);
}
.tgui-circle-action::before,
.tgui-circle-action::after,
.tgui-circle-action .circle-icon::before,
.tgui-circle-action .circle-icon::after {
  content: none;
}
.tgui-circle-action .circle-icon {
  width: 24px;
  height: 24px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--text-2);
}
.tgui-circle-action .circle-icon svg {
  width: 20px;
  height: 20px;
}
.tgui-circle-action .circle-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
  color: var(--text);
}

/* ---------- supplier balances ---------- */
.low-chip {
  background: var(--neg-tint);
  color: var(--neg);
}

/* amounts use the UI face with tabular figures; the code face stays for codes */
.badge-value,
.badge-value-accent,
.cell-val,
.meta-pill.price,
.param-highlight,
.page-counter,
.order-metric strong,
.tgui-progress-labels,
#wiz-source-preview .meta-chip.price {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* ===== components-b.css ===== */
/* ==========================================================================
   GGSELL Control — components, part B: cards, controls, overlays, motion
   Unlayered on purpose: beats the legacy layer without !important.
   ========================================================================== */

/* ---------- feed cards: orders, lots, mappings ---------- */
.tgui-feed-card {
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  transition: border-color 120ms var(--ease);
}
.tgui-feed-card::before,
.tgui-feed-card::after {
  content: none;
}
@media (min-width: 860px) {
  .tgui-feed-card {
    min-height: 0;
  }
}
.feed-card-header {
  align-items: flex-start;
  gap: 12px;
}
.feed-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--text);
}
.feed-meta-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.meta-pill {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.meta-pill.price {
  font-weight: 500;
  color: var(--text);
}
.meta-pill.highlight {
  color: var(--text);
}
.feed-meta-row > .meta-pill + .meta-pill::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
}
.copy-chip {
  margin: 0;
  padding: 1px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-3);
}
.copy-chip:focus-visible {
  background: var(--fill-2);
  color: var(--text-2);
}
.feed-actions-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.btn-cell-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease);
}
.btn-cell-action svg {
  width: 16px;
  height: 16px;
}
.btn-cell-action.danger {
  margin-left: auto;
  background: transparent;
  color: var(--neg);
}
.btn-cell-action.primary,
.btn-cell-action.is-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}
.btn-cell-action:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ---------- buttons ---------- */
.tgui-btn-filled {
  min-height: 44px;
  gap: 8px;
  padding: 0 16px;
  border-radius: 10px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease);
}
.tgui-btn-filled.primary,
.tgui-btn-filled.emerald {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
}
.tgui-btn-filled.secondary {
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
}
.tgui-btn-filled:disabled,
.tgui-btn-filled[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
.tgui-btn-pill-action {
  height: 32px;
  min-height: 32px;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 1;
}
@media (max-width: 767px) {
  .btn-cell-action,
  .tgui-btn-pill-action {
    height: 36px;
    min-height: 36px;
  }
}

/* ---------- fields ---------- */
.tgui-input,
.tgui-textarea,
.tgui-native-select,
.tgui-search-field {
  border-radius: 10px;
  box-shadow: none;
}

/* ---------- segmented control ---------- */
.tgui-segmented-control {
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  box-shadow: none;
}
.tgui-segmented-control::before,
.tgui-segmented-control::after {
  content: none;
}
.seg-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.seg-btn.active,
.seg-btn[aria-selected="true"] {
  border-color: var(--line);
  background: var(--seg-active);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.tgui-segmented-control.compact .seg-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* ---------- switches: graphite when on ---------- */
.tgui-switch-slider {
  border-radius: 999px;
  background: var(--track);
  box-shadow: none;
  opacity: 1;
  transition: background-color 160ms var(--ease);
}
.tgui-switch-slider::before {
  background: var(--knob);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  transform: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.tgui-switch input:checked + .tgui-switch-slider {
  background: var(--accent);
}
.tgui-switch input:checked + .tgui-switch-slider::before {
  background: var(--on-accent);
  transform: translateX(20px);
}
.tgui-switch input:focus-visible + .tgui-switch-slider {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
}
.tgui-switch input:disabled + .tgui-switch-slider {
  opacity: 0.45;
}
.switch-ui-compact {
  background: var(--track);
  box-shadow: none;
  transition: background-color 160ms var(--ease);
}
.switch-ui-compact::before {
  background: var(--knob);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  transform: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.tgui-switch-row-compact input:checked + .switch-ui-compact {
  background: var(--accent);
}
.tgui-switch-row-compact input:checked + .switch-ui-compact::before {
  background: var(--on-accent);
  transform: translateX(16px);
}

/* ---------- sheets and dialogs ---------- */
.sheet-container {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
@media (max-width: 767px) {
  .sheet-container {
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }
}
@media (min-width: 768px) {
  .sheet-container {
    border-radius: 16px;
  }
}
.sheet-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}
.sheet-header {
  border-bottom: 1px solid var(--line);
}
.sheet-header h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}
.sheet-close-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}
/* ::backdrop does not inherit custom properties in older engines: raw values */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-theme="light"] dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
}

/* ---------- toast ---------- */
.tgui-toast {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--raised);
  box-shadow: var(--shadow-float);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tgui-toast.success {
  border-color: var(--pos-line);
}
.tgui-toast.error {
  border-color: var(--neg-line);
}

/* ---------- no lift on hover anywhere; press feedback only ---------- */
.tgui-feed-card:hover,
.tgui-circle-action:hover,
.tgui-hero-banner:hover,
.tgui-section:hover {
  box-shadow: var(--shadow-small);
  transform: none;
}
.tgui-cell:hover,
.btn-cell-action:hover,
.tgui-btn-filled:hover,
.tgui-btn-pill-action:hover,
.tgui-nav-btn:hover,
.hero-refresh:hover {
  transform: none;
}
@media (hover: hover) {
  .tgui-nav-btn:hover,
  .hero-refresh:hover,
  .sheet-close-btn:hover {
    background: var(--fill);
    color: var(--text);
  }
  .tgui-feed-card.clickable-card:hover,
  .tgui-circle-action:hover {
    border-color: var(--line-strong);
  }
  .btn-cell-action:hover,
  .tgui-btn-pill-action:hover,
  .tgui-btn-filled.secondary:hover {
    background: var(--raised-2);
    color: var(--text);
  }
  .btn-cell-action.danger:hover {
    border-color: var(--neg-line);
    background: var(--neg-tint);
    color: var(--neg);
  }
  .btn-cell-action.primary:hover,
  .btn-cell-action.is-primary:hover,
  .tgui-btn-filled.primary:hover,
  .tgui-btn-filled.emerald:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
  }
  .seg-btn:not(.active):hover {
    color: var(--text);
  }
}
@media (hover: hover) and (min-width: 860px) {
  .tgui-tabbar-item:not(.active):hover {
    background: var(--fill);
    color: var(--text);
  }
}
.tgui-nav-btn:active,
.hero-refresh:active,
.tgui-circle-action:active,
.btn-cell-action:active:not(:disabled),
.tgui-btn-filled:active:not(:disabled),
.tgui-btn-pill-action:active {
  opacity: 1;
  transform: scale(0.97);
}

/* ---------- entrances: short, translate-based (keeps element transforms) ---------- */
@keyframes viewFadeIn {
  from {
    opacity: 0;
    translate: 0 6px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes v70ViewIn {
  from {
    opacity: 0;
    translate: 0 6px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes sheetSlideUp {
  from {
    opacity: 0;
    translate: 0 32px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes modalPop {
  from {
    opacity: 0;
    scale: 0.98;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes toastFadeUp {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes toastFadeInRight {
  from {
    opacity: 0;
    translate: 8px 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes v71drop {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tgui-nav-btn,
  .hero-refresh,
  .tgui-circle-action,
  .tgui-feed-card,
  .btn-cell-action,
  .tgui-btn-filled,
  .seg-btn,
  .tgui-switch-slider,
  .tgui-switch-slider::before,
  .switch-ui-compact,
  .switch-ui-compact::before,
  .th-fill {
    transition: none;
  }
  .tgui-nav-btn:active,
  .hero-refresh:active,
  .tgui-circle-action:active,
  .btn-cell-action:active:not(:disabled),
  .tgui-btn-filled:active:not(:disabled),
  .tgui-btn-pill-action:active {
    transform: none;
  }
}

/* ===== v77-unified.css ===== */
/* ==========================================================================
   GGSELL Control — v77: one visual language for every window.
   Reference: the dashboard ("Обзор"). Grouped graphite surfaces with 1px
   hairlines, 14px radius, no shadows or gradients, 13px sentence-case
   headers, graphite icon squares, tinted status pills, quiet 8px controls.
   Tokens only, so the dark and light themes both follow automatically.
   Unlayered and last: wins over the legacy layer and parts A/B.
   ========================================================================== */

/* ---------- 0. the hidden attribute must win inside sheets and the navbar ---------- */
.tgui-bottom-sheet [hidden],
.tgui-navbar [hidden] {
  display: none !important;
}

/* ---------- 1. navbar: back button for secondary mobile views ---------- */
.tgui-navbar-left {
  min-width: 0;
}
.tgui-nav-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 2px 0 -6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.tgui-nav-back svg {
  width: 20px;
  height: 20px;
}
.tgui-nav-back:active {
  background: var(--fill-2);
}
.tgui-nav-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus);
}

/* ---------- 2. status pills everywhere = dashboard pills (tint, no border, no dot) ---------- */
.badge-status-green,
.badge-status-amber,
.badge-status-red,
.badge-status-neutral,
.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.badge-status-green {
  background: var(--pos-tint);
  color: var(--pos);
}
.badge-status-amber {
  background: var(--warn-tint);
  color: var(--warn);
}
.badge-status-red {
  background: var(--neg-tint);
  color: var(--neg);
}
.badge-status-neutral,
.summary-badge {
  background: var(--fill-2);
  color: var(--text-2);
}
.badge-status-green .status-dot,
.badge-status-amber .status-dot,
.badge-status-red .status-dot,
.badge-status-neutral .status-dot {
  display: none;
}

/* ---------- 3. filter bars: chips, presets and sub-labels share the segmented language ---------- */
.tgui-chip,
.tgui-preset-pill,
.lot-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}
.tgui-chip::before,
.tgui-chip::after,
.tgui-preset-pill::before,
.tgui-preset-pill::after {
  content: none;
}
.tgui-chip.active,
.tgui-chip[aria-pressed="true"],
.tgui-preset-pill.active,
.lot-chip.active,
.lot-chip.selected,
.lot-chip[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--seg-active);
  color: var(--text);
}
.lot-chip {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.sub-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.tgui-sub-filter-row {
  flex-wrap: wrap;
  row-gap: 8px;
}
.tgui-chip-code {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--fill);
  box-shadow: none;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---------- 4. fields ---------- */
.tgui-input,
.tgui-textarea,
.tgui-native-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--fill);
  box-shadow: none;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}
.tgui-input,
.tgui-native-select {
  min-height: 44px;
}
.tgui-search-field {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--fill);
  box-shadow: none;
}
.tgui-search-field .search-icon {
  color: var(--text-3);
}
.tgui-input:focus,
.tgui-textarea:focus,
.tgui-native-select:focus,
.tgui-search-field:focus-within {
  border-color: var(--focus);
  outline: none;
  box-shadow: none;
}
.tgui-input::placeholder,
.tgui-textarea::placeholder,
.tgui-search-field input::placeholder {
  color: var(--text-3);
}
.tgui-native-select.full {
  width: 100%;
}
.tgui-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.tgui-field-group {
  margin-bottom: 14px;
}
.tgui-field-group > .flex-between {
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.flex-between > .tgui-label {
  margin-bottom: 0;
}
.param-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tgui-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
}
.tgui-link-btn svg {
  width: 14px;
  height: 14px;
  color: var(--text-2);
  stroke: currentColor;
}

/* ---------- 5. buttons: one danger style, links never underlined ---------- */
.tgui-btn-filled.danger {
  border: 1px solid var(--neg-line);
  background: var(--neg-tint);
  box-shadow: none;
  color: var(--neg);
}
.tgui-btn-plain.danger {
  color: var(--neg);
}
a.tgui-btn-filled,
a.btn-cell-action,
a.tgui-btn-pill-action {
  text-decoration: none;
}
.btn-icon {
  width: 18px;
  height: 18px;
}

/* ---------- 6. pagination ---------- */
.tgui-btn-page {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.tgui-btn-page:disabled {
  opacity: 0.45;
  cursor: default;
}
.page-counter {
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- 7. catalog: thumbs, summary bar, link resolver ---------- */
.feed-card-thumb {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}
.feed-card-thumb-placeholder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill-2);
  box-shadow: none;
  color: var(--text-3);
}
.sup-catalog-summary-bar {
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text-2);
  font-size: 13px;
}
.resolve-hint {
  margin: 0 16px 12px;
}
.resolve-preview-box,
.resolve-product-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.resolve-error-icon {
  color: var(--neg);
  font-size: 0;
}
.resolve-error-icon svg {
  width: 24px;
  height: 24px;
}

/* ---------- 8. KOSell novelties: banner and cards as dashboard surfaces ---------- */
.candidates-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.candidates-banner::before,
.candidates-banner::after,
.candidate-lot-card::before,
.candidate-lot-card::after {
  content: none;
}
.candidates-banner-info {
  flex: 1 1 320px;
  min-width: 0;
}
.candidates-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  overflow-wrap: anywhere;
}
.pulse-dot-cyan {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: none;
  animation: none;
}
.candidates-banner-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.candidates-search-bar {
  margin-top: 12px;
}
.candidates-search-bar input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--fill);
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.candidates-search-bar input:focus {
  border-color: var(--focus);
}
.candidates-search-bar input::placeholder {
  color: var(--text-3);
}
.candidates-banner-actions {
  flex: 0 0 auto;
  min-width: 0;
}
@media (max-width: 767px) {
  .candidates-banner-actions,
  .candidates-banner-actions .tgui-btn-filled {
    width: 100%;
  }
}
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.candidate-lot-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.candidate-lot-header,
.candidate-lot-body {
  min-width: 0;
}
.candidate-cover-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  box-shadow: none;
}
.candidate-cover-img {
  border-radius: 0;
  box-shadow: none;
}
.candidate-cover-placeholder {
  color: var(--text-3);
}
.candidate-cover-badge {
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: none;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.candidate-lot-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.candidate-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 8px;
}
.candidate-meta-chips > .meta-pill + .meta-pill::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
}
.candidate-lot-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.candidate-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.candidate-actions-bar .tgui-btn-filled {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 36px;
  font-size: 14px;
  white-space: normal;
}

/* ---------- 9. services: repricer card = dashboard surface + KPI hairline grid ---------- */
.tgui-repricer-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.tgui-repricer-card::before,
.tgui-repricer-card::after {
  content: none;
}
.repricer-header-row {
  align-items: flex-start;
  gap: 12px;
}
.repricer-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0;
  color: var(--text);
}
.repricer-sub {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--text-2);
}
.tgui-progress-track {
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: var(--fill-2);
  box-shadow: none;
}
.tgui-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  box-shadow: none;
}
.tgui-progress-labels {
  font-size: 12px;
  color: var(--text-3);
}
.tgui-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
@media (max-width: 767px) {
  .tgui-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.tgui-grid-4 .grid-cell {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  text-align: left;
}
.grid-cell .cell-val {
  font-size: 22px;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: 0;
  color: var(--text);
}
.grid-cell .cell-val.highlight {
  color: var(--text);
}
.grid-cell .cell-lbl {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.current-task-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  color: var(--text-2);
}
.current-task-pill .label {
  flex: none;
  color: var(--text-2);
}
.current-task-pill strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
@media (min-width: 768px) {
  .repricer-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* ---------- 10. settings: param blocks, spoilers, templates ---------- */
.tgui-section.tgui-param-block {
  padding: 14px 16px;
}
.tgui-param-block + .tgui-param-block {
  margin-top: 12px;
}
.param-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
}
.param-highlight {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}
.tgui-presets-grid {
  gap: 8px;
}
.tgui-icon-badge[class*="bg-"] {
  background: var(--fill-2);
  color: var(--text-2);
}
.tgui-spoiler > summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  list-style: none;
  cursor: pointer;
}
.tgui-spoiler > summary::-webkit-details-marker {
  display: none;
}
.tgui-spoiler > summary .chevron {
  transition: transform 160ms var(--ease);
}
.tgui-spoiler[open] > summary .chevron {
  transform: rotate(90deg);
}
.tgui-spoiler .spoiler-content {
  font-size: 13px;
  line-height: 19px;
  color: var(--text-2);
}
.tgui-spoiler .spoiler-content b {
  font-weight: 500;
  color: var(--text);
}
.tmpl-tabs {
  margin-bottom: 12px;
}
.tmpl-insert-row {
  padding-bottom: 8px;
}
.tmpl-actions {
  margin-top: 12px;
}

/* ---------- 11. sheets: every dialog is a small dashboard page ---------- */
.sheet-container {
  background: var(--bg);
}
.sheet-header h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0;
  color: var(--text);
}
.sheet-close-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--fill-2);
  box-shadow: none;
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
}
.sheet-close-btn:focus {
  outline: none;
}
.sheet-close-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--focus);
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.sheet-actions > .tgui-btn-filled {
  flex: 1 1 0;
  min-width: 0;
}
.sheet-hint {
  margin: 0 0 12px;
}
.confirm-dialog-message {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
  color: var(--text-2);
  white-space: pre-line;
}

/* shared detail layout: lot, mapping and order sheets */
.lot-det-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.lot-det-link {
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.lot-det-link:hover {
  color: var(--text);
}
.lot-det-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.lot-det-category {
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.lot-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}
.lot-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.lot-stat-label {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.lot-stat-val {
  overflow: hidden;
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.lot-sec-title {
  margin: 20px 4px 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.lot-det-mappings {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.lot-det-mappings:empty {
  display: none;
}
.lot-map-empty {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.lot-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.lot-actions-grid > .tgui-btn-filled {
  min-width: 0;
}
.lot-actions-grid > .span-2 {
  grid-column: 1 / -1;
}
.kv-row.tgui-cell {
  min-height: 48px;
}
.kv-row .tgui-cell-after {
  min-width: 0;
  max-width: 60%;
}
.kv-val {
  overflow: hidden;
  font-size: 14px;
  color: var(--text-2);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.kv-val.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.map-det-template-preview {
  max-height: 132px;
  margin-top: 8px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 17px;
  white-space: pre-wrap;
  word-break: break-word;
}
.order-det-diag .cell-sub {
  margin: 0 0 2px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-3);
}
.order-det-diag .cell-title {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.order-det-error,
.lot-copy-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--neg-line);
  border-radius: 10px;
  background: var(--neg-tint);
  color: var(--neg);
  font-size: 13px;
  line-height: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* lot copy */
.lot-copy-source,
.lot-copy-preview {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.lot-copy-source {
  margin-bottom: 16px;
}
.lot-copy-source .lot-det-name {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}
.lot-copy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 16px;
}
.lot-copy-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.lot-copy-counter {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.lot-copy-preview-text {
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.lot-copy-notes {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 19px;
  color: var(--text-2);
}
.lot-copy-notes b {
  font-weight: 500;
  color: var(--text);
}
.lot-copy-result {
  text-align: center;
}
.lot-copy-ok-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 8px auto 12px;
  border: 0;
  border-radius: 12px;
  background: var(--pos-tint);
  box-shadow: none;
  color: var(--pos);
}
.lot-copy-ok-icon svg {
  width: 22px;
  height: 22px;
}
.lot-copy-result-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.lot-copy-id-chip {
  height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  box-shadow: none;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- 12. lot wizard ---------- */
.tgui-wizard-steps {
  display: flex;
  gap: 2px;
  margin: 0 0 16px;
  padding: 2px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  box-shadow: none;
  scrollbar-width: none;
}
.tgui-wizard-steps::-webkit-scrollbar {
  display: none;
}
.w-step {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.w-step.done {
  color: var(--text-2);
}
.w-step.active {
  border-color: var(--line);
  background: var(--seg-active);
  box-shadow: var(--shadow-small);
  color: var(--text);
}
.preview-box {
  padding: 12px 16px;
}
.wiz-cover-box {
  margin-top: 12px;
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.wiz-cover-head {
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.wiz-cover-title {
  margin: 0;
}
.wiz-cover-preview-wrapper,
#wiz-custom-preview-wrapper {
  text-align: center;
}
.wiz-cover-img {
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}
#wiz-custom-img {
  max-width: 200px;
}
.wiz-cover-placeholder,
.wiz-upload-dropzone {
  padding: 20px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--fill);
  box-shadow: none;
  color: var(--text-2);
  text-align: center;
}
.wiz-upload-dropzone {
  cursor: pointer;
}
.wiz-ph-icon {
  width: 28px;
  height: 28px;
  color: var(--text-3);
}
.wiz-ph-title {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--text);
}
.wiz-ph-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-2);
}
.wiz-cover-details {
  margin-top: 12px;
}
.wiz-cover-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.wiz-cover-meta .meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.wiz-cover-meta .meta-pill.highlight {
  color: var(--text);
}
.wiz-cover-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.wiz-cover-actions .btn-cell-action.danger {
  margin-left: 0;
}
.wiz-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  box-shadow: none;
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
}
.wiz-notice-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--text-3);
}
.wiz-ai-card {
  margin-bottom: 14px;
}
.wiz-ai-card .tgui-cell-middle {
  min-width: 0;
}
.wiz-ai-card .btn-cell-action {
  white-space: nowrap;
}
.wiz-inst-spoiler {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.wiz-inst-spoiler > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
}
.wiz-inst-spoiler .spoiler-content {
  padding: 4px 16px 2px;
  border-top: 1px solid var(--line);
}
.wiz-inst-spoiler .spoiler-content .tgui-field-group:first-child {
  margin-top: 10px;
}
.wiz-cat-box {
  padding: 14px 16px 2px;
}
.wiz-cat-box .tgui-native-select {
  margin-bottom: 12px;
}
.wiz-divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  font-size: 12px;
  color: var(--text-3);
}
.wiz-divider-text::before,
.wiz-divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.wiz-cat-search {
  margin-bottom: 10px;
}
.cat-results-scroller {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.cat-results-scroller:empty {
  display: none;
}
.cat-item {
  padding: 10px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.cat-item + .cat-item {
  border-top: 1px solid var(--line);
}
.cat-item:active,
.cat-item.active {
  background: var(--fill);
}
.cat-item .cat-tree {
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.cat-item .cat-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.cat-item .subtext {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}
.selected-cat-pill {
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
}
.selected-cat-pill strong {
  font-weight: 500;
}
.selected-cat-pill .cat-fees {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
}
.eco-summary-card {
  margin-bottom: 14px;
  padding: 0;
}
.eco-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--text-2);
}
.eco-row + .eco-row {
  border-top: 1px solid var(--line);
}
.eco-row > :last-child {
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.eco-row.highlight {
  color: var(--text);
}
.eco-row.highlight > :last-child {
  font-weight: 600;
}
.wiz-qty-head .tgui-switch-row-compact {
  flex: none;
}

/* ---------- 13. empty, error and loading states ---------- */
.tgui-empty-state {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.empty-icon-badge {
  border: 0;
  border-radius: 10px;
  background: var(--fill-2);
  box-shadow: none;
  color: var(--text-2);
}
.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.empty-desc {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.tgui-loading {
  padding: 28px 16px;
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}
.tgui-error-screen {
  background: var(--bg);
}
.error-card {
  max-width: 360px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
  text-align: center;
}
.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--neg-tint);
  color: var(--neg);
  font-size: 0;
}
.error-icon svg {
  width: 22px;
  height: 22px;
}
.error-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}
.error-card p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-2);
}

/* ---------- 14. layout fixes found in screenshot QA ---------- */
/* sections inside sheets align with the sheet padding, like fields and preview boxes */
.sheet-body .tgui-section {
  margin-left: 0;
  margin-right: 0;
}
/* legacy switches the banner to a column on phones; a 320px flex-basis then became height */
@media (max-width: 767px) {
  .candidates-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .candidates-banner-info {
    flex: none;
  }
}
/* same for the card buttons: legacy column layout at <=580px turned the 200px basis into height */
@media (max-width: 580px) {
  .candidate-actions-bar .tgui-btn-filled {
    flex: none;
    width: 100%;
  }
}

/* ---------- 15. Wizard 1-Screen Express Publishing ---------- */
.wiz-express-card {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
}
.wiz-express-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wiz-express-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #10b981;
}
.wiz-express-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wiz-express-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wiz-express-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tgui--hint_color, #8b95a5);
}
.wiz-express-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--tgui--text_color, #fff);
  word-break: break-word;
}
.wiz-express-val.accent {
  color: #10b981;
}
.wiz-express-val.path {
  font-size: 12px;
  font-weight: 500;
  color: var(--tgui--link_color, #38bdf8);
}
.wiz-express-eco {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.wiz-express-eco-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wiz-express-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-wiz-quick-pub {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-wiz-quick-pub:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}
.btn-wiz-quick-pub:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-wiz-manual-link {
  background: transparent;
  border: none;
  color: var(--tgui--hint_color, #8b95a5);
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s ease;
}
.btn-wiz-manual-link:hover {
  color: var(--tgui--text_color, #fff);
}

