:root {
  color-scheme: only light;
  /* Pop Soft + Electric */
  --pri: #2f6bff;
  --ink: #1e1e1c;
  --paper: #d8cbb3; /* marketing only — app chrome uses --background */
  --pop-bg: #eef0f3;
  --pop-raised: #fff;
  --pop-well: #eef0f3;
  --pop-text: #1d1d1f;
  --pop-muted: #6e6e73;
  --pop-body: #515154;
  --pop-rim: rgba(15, 20, 40, 0.08);
  --pop-rim-strong: rgba(15, 20, 40, 0.11);
  --pop-shine: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --pop-lift:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 12px 28px -12px rgba(15, 20, 40, 0.2);
  --pop-lift-sm:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 8px 18px -10px rgba(15, 20, 40, 0.16);
  --pop-lift-modal:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 24px 48px -16px rgba(15, 20, 40, 0.26);
  --ease: 0.18s ease;

  /* Mapped app tokens (prefer these in existing selectors) */
  --background: var(--pop-bg);
  --foreground: var(--pop-text);
  --muted: #e8eaef;
  --muted-foreground: var(--pop-muted);
  --border: #e1e4ea;
  --input: #c9ced8;
  --ring: var(--pri);
  --primary: color-mix(in srgb, var(--pri) 28%, #fff);
  --primary-foreground: var(--pop-text);
  --secondary: var(--pop-raised);
  --secondary-foreground: var(--pop-text);
  /* Keep accessible red for form/field errors; charcoal is only on .btn-destructive */
  --destructive: #dc2626;
  --destructive-foreground: #fafafa;
  --card: var(--pop-raised);
  --card-foreground: var(--pop-text);
  --radius: 0.75rem;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow: var(--pop-lift), var(--pop-shine);
  --shadow-sm: var(--pop-lift-sm), var(--pop-shine);
  /* Floating menus / combobox / modal panels, slightly stronger than page --border */
  --border-dropdown: #d4d8e0;
  --border-dropdown-width: 1px;
  /* Floating menus / combobox panels, strong enough to separate from page chrome */
  --shadow-dropdown:
    0 1px 2px rgba(15, 20, 40, 0.06),
    0 10px 28px -10px rgba(15, 20, 40, 0.22),
    var(--pop-shine);
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 16rem;
  --app-min-width: 320px;
  /* Fixed UI scale, ignore OS/browser accessibility text inflation */
  --font-size-root: 16px;
  --font-size-body: 14px;
  --icon-size: 14px;
  --icon-size-sm: 12px;
  --control-height: 1.85rem;
  --control-font-size: 0.75rem;
  --accent: var(--pri);
  /* Sidebar matches card white. Keep this opaque: a blur on top of it tints iOS green. */
  --sidebar-bg: var(--card);
  --topbar-bg: var(--sidebar-bg);
  --dropdown-bg: var(--card);
  --mobile-bottom-nav-bg: var(--sidebar-bg);
  --control-bg: #ffffff;
  --control-hover: #e8eaef;
  --btn-idle-bg: #ffffff;
  --btn-idle-border: var(--border);
  --btn-idle-fg: var(--pop-text);
  --btn-idle-hover: #e8eaef;
  /*
   * Table headers need a well that is darker than the page ground (--pop-bg /
   * --pop-well are the same gray). Otherwise free-standing tables blend at the top.
   */
  --table-header-bg: #e4e7ec;
  --table-header-fg: var(--pop-muted);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Floor for usable layout (bottom nav, forms, padded cards); scroll if narrower */
  min-width: var(--app-min-width);
  overflow-x: auto;
  color-scheme: only light;
  /*
   * Hard-lock type scale for this internal app.
   * Do not follow OS Dynamic Type / browser “larger text” / Chromium font boosting.
   */
  font-size: var(--font-size-root) !important;
  -webkit-text-size-adjust: none !important;
  text-size-adjust: none !important;
  -moz-text-size-adjust: none !important;
  /* Kill the default mobile blue/gray flash while a finger is down. */
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: var(--app-min-width);
  font-size: var(--font-size-body) !important;
  /* Reduce accidental double-tap / pinch zoom on controls */
  touch-action: manipulation;
  -webkit-text-size-adjust: none !important;
  text-size-adjust: none !important;
  -webkit-tap-highlight-color: transparent;
}

a,
button,
.btn,
input,
select,
textarea,
summary,
label,
[role="button"],
.mobile-bottom-nav a,
.mobile-bottom-nav button,
.mobile-bottom-nav__sell,
.mobile-bottom-nav__actions-item {
  -webkit-tap-highlight-color: transparent;
}

/* Keep controls/copy from inheriting system accessibility font scaling */
button,
input,
select,
textarea,
label,
a,
p,
span,
li,
td,
th,
h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.card,
.nav,
.main {
  -webkit-text-size-adjust: none !important;
  text-size-adjust: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  min-width: var(--app-min-width);
  align-items: start;
}

.mobile-topbar {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-nav-label {
  padding: 0.85rem 0.55rem 0.28rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-foreground);
  line-height: 1.2;
}

.sidebar-primary-nav .sidebar-nav-label:first-child {
  padding-top: 0.1rem;
}

.icon-btn.mobile-nav-close {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--pop-rim);
  padding: 0.85rem 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-sizing: border-box;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  padding: 0.25rem 0.5rem;
}

.brand__icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Circle is baked into favicon.png, no CSS background needed. */
  background: transparent;
}

.brand__mark {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__product,
.brand__sep {
  font-weight: inherit;
}

.brand__org {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Desktop + drawer: icon + org name, username stacked under org. */
.sidebar-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1.05rem 0.9rem;
  column-gap: 0.5rem;
  row-gap: 0.05rem;
  align-items: center;
  align-content: center;
  height: 2rem;
  min-height: 2rem;
  min-width: 0;
  flex: 1;
}

.sidebar-identity .brand {
  display: contents;
  padding: 0;
}

.sidebar-identity .brand__icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 2rem;
  height: 2rem;
}

.sidebar-identity .brand__icon--logo {
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.sidebar-identity .brand__icon--logo .brand__mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-identity[data-org-switch-hit] {
  cursor: pointer;
}

.sidebar-identity .brand__text {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  height: 1.05rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.05rem;
}

.sidebar-identity .brand__product,
.sidebar-identity .brand__sep {
  display: none;
}

.sidebar-identity .brand__org {
  color: var(--foreground);
  font-weight: 600;
}

.sidebar-identity__subtitle {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin: 0;
  height: 0.9rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 450;
  line-height: 0.9rem;
  color: var(--muted-foreground);
}

.sidebar-identity__user {
  display: none;
  align-items: center;
  gap: 0.28rem;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--muted-foreground);
}

.sidebar-identity__user-icon {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--muted-foreground);
}

.sidebar-identity__user .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-weight: 500;
}

.sidebar-identity__user .role-crown {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
}

.sidebar-identity__user .badge {
  font-size: 0.62rem;
  height: 1.05rem;
  padding: 0 0.35rem;
}

.sidebar-header {
  position: relative;
}

.sidebar .org-switch {
  position: absolute;
  top: 0.15rem;
  right: 0;
  width: auto;
  z-index: 1;
}

.sidebar .org-switch .dd-leading-icon,
.sidebar .org-switch .dd-label {
  display: none;
}

.sidebar .org-switch .dd-trigger {
  width: auto;
  min-height: 1.75rem;
  padding: 0.25rem;
}

.brand--compact {
  padding: 0;
  font-size: inherit;
}

.brand--compact .brand__icon {
  width: 1.2rem;
  height: 1.2rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 2.05rem;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.nav a:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

/* Active nav is a flat indicator — not a raised CTA like Create invoice. */
.nav a.is-active,
.nav a.is-active:hover {
  background: color-mix(in srgb, var(--pri) 12%, var(--pop-well));
  color: var(--pri);
  border-color: transparent;
  box-shadow: inset 3px 0 0 var(--pri);
  font-weight: 600;
  text-decoration: none;
}

.nav .icon,
.btn .icon,
.icon {
  display: inline-flex;
  width: var(--icon-size);
  height: var(--icon-size);
  min-width: var(--icon-size);
  min-height: var(--icon-size);
  flex-shrink: 0;
}

.nav .icon svg,
.btn .icon svg,
.icon svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Keep SVG glyphs from picking up OS text metrics */
  vector-effect: non-scaling-stroke;
}

.icon-fill svg,
.btn .icon.icon-fill svg {
  fill: currentColor;
  stroke: none;
}

.sidebar-account {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-primary-nav + .sidebar-account {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: relative;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.sidebar-settings-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  min-height: 2.05rem;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.sidebar-settings-link:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.sidebar-settings-link.is-active,
.sidebar-settings-link.is-active:hover {
  background: color-mix(in srgb, var(--pri) 12%, var(--pop-well));
  color: var(--pri);
  border-color: transparent;
  box-shadow: inset 3px 0 0 var(--pri);
  font-weight: 600;
  text-decoration: none;
}

.sidebar-settings-link .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 0;
}

.sidebar-help-link .icon {
  color: inherit;
}

.support-launcher {
  position: relative;
}

.support-launcher--fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
}

/* Chatwoot opens from Get Support only — hide the floating launcher bubble.
   Do not hide #cw-widget-holder; toggle("open") needs that panel visible. */
body.chatwoot-enabled .woot-widget-bubble {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Sit above the mobile account drawer (z-index 50) and other chrome. */
body.chatwoot-enabled #cw-widget-holder,
body.chatwoot-enabled .woot-widget-holder {
  z-index: 2147483000 !important;
}

/* Unread-message preview: never let a transparent iframe eat page clicks.
   Prefer showUnreadMessagesDialog:false; this is a safety net if it still mounts. */
body.chatwoot-enabled .woot-widget-holder.has-unread-view {
  pointer-events: none !important;
  top: auto !important;
  left: auto !important;
  right: 0 !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.chatwoot-enabled .woot-widget-holder.has-unread-view iframe {
  pointer-events: auto !important;
  width: min(22rem, calc(100vw - 1rem)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 50vh !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
}

/* Freeze the host page while chat is open (JS also captures wheel/touchmove). */
html.paper-chatwoot-open {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}
html.paper-chatwoot-open body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.chatwoot-enabled #cw-widget-holder.paper-chatwoot--vv,
body.chatwoot-enabled .woot-widget-holder.paper-chatwoot--vv {
  border-radius: 0 !important;
  overflow: hidden !important;
}

body.chatwoot-enabled #cw-widget-holder.paper-chatwoot--vv iframe,
body.chatwoot-enabled .woot-widget-holder.paper-chatwoot--vv iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  border: 0;
}

/* In-app agent-reply notice (solid card; does not block the page). */
.chatwoot-agent-notice {
  position: fixed;
  z-index: 2147483640;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  left: auto;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border-dropdown);
  border-radius: calc(var(--radius) + 2px);
  background: #ffffff;
  color: var(--foreground);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.18),
    0 24px 48px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-0.4rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
}
.chatwoot-agent-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.chatwoot-agent-notice__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}
.chatwoot-agent-notice__body {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted-foreground);
  word-break: break-word;
}
.chatwoot-agent-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.chatwoot-agent-notice__actions .btn {
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8125rem;
}

@media (max-width: 667px) {
  .chatwoot-agent-notice {
    top: auto;
    bottom: calc(
      var(--mobile-bottom-nav-height, 3.5rem) + env(safe-area-inset-bottom, 0px) + 0.75rem
    );
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    width: auto;
    transform: translateY(0.4rem);
  }
  .chatwoot-agent-notice.is-visible {
    transform: translateY(0);
  }
}

.support-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.support-fab .icon {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  color: var(--muted-foreground);
}

.support-fab:hover {
  background: var(--muted);
}

.support-fab:focus-visible {
  outline: 2px solid var(--ring, #181818);
  outline-offset: 2px;
}

.support-menu {
  position: absolute;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 16.5rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.35rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: calc(var(--radius) + 2px);
  background: var(--dropdown-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

/* display:flex above beats the UA [hidden] rule, force closed until toggled. */
.support-menu[hidden] {
  display: none !important;
}

.support-launcher--fab .support-menu {
  right: 0;
  bottom: calc(100% + 0.45rem);
}

.support-launcher--sidebar .support-menu {
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  min-width: 0;
  width: 100%;
}

.support-menu__item {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
}

.support-menu__main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.support-menu__main:hover {
  background: var(--muted);
}

.support-menu__icon {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.support-menu__icon--wa {
  color: #25d366;
}

.support-menu__icon.icon-fill svg {
  fill: currentColor;
  stroke: none;
}

.support-menu__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.support-menu__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.support-menu__hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.support-menu__open {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
}

.support-menu__open:hover {
  background: var(--muted);
  color: var(--foreground);
}

.support-menu__open .icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.sidebar-logout-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground);
  text-decoration: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  min-height: 2.05rem;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-logout-link:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.sidebar-logout-link .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 0;
}

.btn.sidebar-create-invoice {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  height: 2.25rem;
  min-height: 2.25rem;
  margin: 0.85rem 0 0.45rem;
  padding: 0 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.sidebar-userbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}

.sidebar-userbar .sidebar-user {
  display: flex;
  flex: 1;
  min-width: 0;
  padding: 0;
}

.sidebar-userbar .sidebar-user-static {
  align-items: center;
  gap: 0.55rem;
  min-height: 0;
  padding: 0.2rem 0.25rem;
}

.sidebar-userbar .sidebar-user-icon {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  background: #efefef;
  color: #3f3f3f;
}

.sidebar-userbar .sidebar-user-icon svg {
  width: 1rem;
  height: 1rem;
}

.sidebar-user-initials {
  display: none;
}

.sidebar-user__meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.sidebar-user__name {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.15;
}

.sidebar-user__name .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-userbar .role-crown {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
}

.sidebar-user__role {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 450;
  line-height: 1.2;
}

.sidebar-userbar .sidebar-logout-link {
  flex: none;
  width: auto;
  min-width: 2rem;
  justify-content: center;
  padding: 0.35rem;
  color: var(--muted-foreground);
}

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

.sidebar-create-invoice .icon {
  width: 1rem;
  height: 1rem;
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.sidebar-user-static {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  font-weight: 500;
  line-height: 1;
  min-height: 2.35rem;
}

.sidebar-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  min-height: 2.35rem;
}

.sidebar-user-trigger:hover,
.sidebar-user[data-user-menu-open] .sidebar-user-trigger {
  background: var(--secondary);
}

.sidebar-user-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.sidebar-user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  line-height: 0;
  color: var(--foreground);
}

.sidebar-user .name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--foreground);
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--btn-idle-fg);
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.icon-btn.is-active,
.icon-btn:hover {
  background: var(--pop-raised);
  border-color: var(--pop-rim);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  text-decoration: none;
}

.role-crown {
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  line-height: 0;
}

.role-crown svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.main {
  padding: 1.75rem 2rem 3rem;
  max-width: 1100px;
  width: 100%;
  min-width: 0;
  margin-inline: auto;
  justify-self: center;
}

.billing-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
}

.billing-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.billing-topbar__brand {
  min-width: 0;
}

.billing-topbar__tagline {
  margin: 0.35rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.billing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.billing-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0 0.55rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--btn-idle-fg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.billing-nav a:hover,
.billing-nav a.is-active {
  color: var(--btn-idle-fg);
  background: var(--btn-idle-hover);
  text-decoration: none;
}

.billing-nav-label {
  display: inline;
}

.billing-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.page-header__lead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.page-header__lead h1 {
  min-width: 0;
}

.product-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.product-detail-actions .product-row-action {
  width: 2.25rem;
  height: 2.25rem;
}

.product-detail-actions .product-row-action .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.product-detail-actions .btn {
  width: auto;
  flex: 0 0 auto;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin: 0 0.35rem 0 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--muted-foreground);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.page-back:hover,
.page-back:focus-visible {
  color: var(--foreground);
  background: none;
  border: none;
  box-shadow: none;
  outline: none;
}

.page-back:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.page-back__icon {
  width: 1.1rem;
  height: 1.1rem;
}

.page-back__label {
  text-transform: lowercase;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.settings-nav__group {
  padding: 0.25rem 0;
  overflow: hidden;
}

.settings-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.95rem 1rem;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--foreground);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.settings-nav__link + .settings-nav__link {
  border-top: 1px solid var(--border);
}

.settings-nav__link:hover,
.settings-nav__link:focus-visible {
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  outline: none;
}

.settings-nav__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.settings-nav__copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.settings-nav__title {
  font-weight: 550;
  line-height: 1.2;
}

.settings-nav__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.settings-nav__chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.settings-nav__badge {
  flex-shrink: 0;
}

.device-sessions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 46rem;
}

.device-sessions__count,
.device-sessions__copy p {
  margin: 0;
  color: var(--muted-foreground);
}

.device-sessions__copy p {
  margin-top: 0.15rem;
}

.device-sessions__meter,
.device-sessions__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.device-sessions__meter {
  justify-content: space-between;
  gap: 1.25rem;
}

.device-sessions__track {
  display: flex;
  flex: 1;
  gap: 0.45rem;
  min-width: 0;
}

.device-sessions__segment {
  flex: 1;
  height: 0.42rem;
  border-radius: 999px;
  background: #e9e9e9;
}

.device-sessions__segment.is-used {
  background: #1e1e1e;
}

.device-sessions__count {
  flex-shrink: 0;
  color: var(--foreground);
}

.device-sessions__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.device-sessions__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted-foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.12);
}

.device-sessions__icon .icon {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
}

.device-sessions__copy {
  min-width: 0;
  flex: 1;
}

.device-sessions__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-weight: 550;
}

.device-sessions__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.5rem 0.12rem 0.4rem;
  border-radius: 999px;
  background: #e8f8ef;
  color: #17803d;
  font-size: 0.78rem;
  font-weight: 600;
}

.device-sessions__pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #22a34a;
}

.device-sessions__card > .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.device-sessions__footer {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 860px) {
  .device-sessions__meter,
  .device-sessions__card {
    flex-wrap: nowrap;
    align-items: center;
  }

  .device-sessions__title {
    flex-wrap: nowrap;
  }

  .device-sessions__title > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.page-header p {
  margin: 0.35rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.925rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack[hidden],
.row[hidden] {
  display: none !important;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--pop-rim);
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition:
    background var(--ease),
    border-color var(--ease),
    opacity var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}

.btn:hover {
  text-decoration: none;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: var(--pop-lift), var(--pop-shine);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    var(--pop-lift-sm),
    var(--pop-shine),
    0 0 0 3px color-mix(in srgb, var(--pri) 25%, transparent);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.member-limit-upsell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.85rem 0 0.15rem;
}

.member-limit-upsell__badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--foreground);
}

.member-limit-upsell__copy {
  margin: 0;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.pricing-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.pricing-intro {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pricing-status {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

/* Flex + sibling margin (not auto-fit grid): soft-nav width can collapse
   auto-fit tracks and leave the two plan cards visually jammed together.
   Margin (not gap) keeps spacing stable across soft-nav swaps. */
.pricing-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 42rem;
}

.pricing-grid > .pricing-card + .pricing-card {
  margin-top: 1.25rem;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.2rem;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.pricing-card__price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.pricing-card__amount {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.pricing-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.pricing-renewal-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pricing-manage .pricing-cancel-form {
  margin-top: 0.75rem;
}

.btn.is-submitting,
button.is-submitting,
.btn.is-busy,
button.is-busy {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.btn.is-submitting .icon,
.btn.is-busy .icon {
  display: none;
}

.btn__spinner {
  display: none;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: 0 0 auto;
  animation: btn-spin 0.7s linear infinite;
}

.btn.is-submitting .btn__spinner,
.btn.is-busy .btn__spinner {
  display: inline-block;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Instant navigation / submit loading, YouTube/Reddit-style top progress line. */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 2147483646;
  width: 100%;
  max-width: none;
  height: 2px;
  margin: 0;
  padding: 0;
  border: none;
  overflow: hidden;
  display: block;
  background: transparent;
  color: inherit;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 80ms ease, visibility 80ms ease;
}

.page-loading:popover-open,
.page-loading.is-visible {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

.page-loading__track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.page-loading__bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--pri);
  box-shadow: 0 0 4px color-mix(in srgb, var(--pri) 35%, transparent);
  transform: translateX(-100%);
  animation: page-loading-bar 1.15s ease-in-out infinite;
  animation-play-state: paused;
}

.page-loading:popover-open .page-loading__bar,
.page-loading.is-visible .page-loading__bar {
  animation-play-state: running;
}

@keyframes page-loading-bar {
  0% {
    transform: translateX(-100%);
    width: 35%;
  }
  45% {
    width: 55%;
  }
  100% {
    transform: translateX(320%);
    width: 35%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading__bar {
    animation: none;
    transform: none;
    width: 40%;
    left: 0;
  }

  .btn,
  .btn:hover,
  .btn:active {
    transition: none;
    transform: none;
  }
}

body.is-page-loading {
  cursor: progress;
}

.btn-primary {
  background: color-mix(in srgb, var(--pri) 28%, #fff);
  color: var(--pop-text);
  border-color: color-mix(in srgb, var(--pri) 28%, var(--pop-rim));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--pri) 36%, #fff);
  border-color: color-mix(in srgb, var(--pri) 32%, var(--pop-rim));
  color: var(--pop-text);
}

/* Amber dot, form behind this Save control has unsaved edits. */
.btn-unsaved-mark {
  display: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.btn.has-unsaved .btn-unsaved-mark {
  display: inline-block;
}

.btn-secondary {
  background: var(--pop-raised);
  color: var(--pop-text);
  border-color: var(--pop-rim);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.btn-secondary:hover {
  background: var(--pop-raised);
  color: var(--pop-text);
  border-color: color-mix(in srgb, var(--pri) 18%, var(--pop-rim));
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--muted);
  color: var(--foreground);
  opacity: 1;
  box-shadow: none;
  transform: none;
}

.btn-tool {
  width: var(--control-height);
  min-width: var(--control-height);
  max-width: var(--control-height);
  padding: 0;
  color: var(--muted-foreground);
}

.btn-tool:hover {
  color: var(--foreground);
}

.page-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.page-header__action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: color-mix(in srgb, var(--card) 88%, var(--muted));
}

.invoice-detail-actions {
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
}

.invoice-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.invoice-detail-actions .btn .icon {
  width: 1rem;
  height: 1rem;
}

.invoice-detail-actions [data-invoice-actions-toggle],
.invoice-actions__toggle {
  color: var(--foreground);
  background: var(--pop-raised);
  border: 1px solid var(--pop-rim);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background var(--ease),
    border-color var(--ease),
    color var(--ease);
}

.invoice-detail-actions [data-invoice-actions-toggle]:hover,
.invoice-detail-actions [data-invoice-actions-toggle]:focus-visible,
.invoice-actions__toggle:hover,
.invoice-actions__toggle:focus-visible {
  color: var(--foreground);
  background: var(--pop-raised);
  border-color: var(--pop-rim);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transform: none;
}

.invoice-detail-actions [data-invoice-actions-toggle]:active,
.invoice-actions__toggle:active {
  transform: translateY(2px) scale(0.94);
  box-shadow: var(--pop-shine);
}

@media (prefers-reduced-motion: reduce) {
  .invoice-detail-actions [data-invoice-actions-toggle],
  .invoice-actions__toggle {
    transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
  }

  .invoice-detail-actions [data-invoice-actions-toggle]:active,
  .invoice-actions__toggle:active {
    transform: none;
  }
}

.invoice-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.invoice-actions__menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 11.5rem;
  padding: 0.3rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
}

.invoice-actions__menu[hidden] {
  display: none !important;
}

.invoice-actions__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  appearance: none;
  box-sizing: border-box;
}

.invoice-actions__item:hover,
.invoice-actions__item:focus-visible {
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  outline: none;
}

.invoice-actions__item .icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--muted-foreground);
}

.page-header__action-group .btn-tool {
  border-radius: calc(var(--radius) - 1px);
}

.page-header__action-group .btn-split__main {
  border-top-left-radius: calc(var(--radius) - 1px);
  border-bottom-left-radius: calc(var(--radius) - 1px);
}

.page-header__action-group .btn-split__caret {
  border-top-right-radius: calc(var(--radius) - 1px);
  border-bottom-right-radius: calc(var(--radius) - 1px);
}

.btn-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.btn-split__main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 0.5rem;
}

.btn-split__caret {
  width: 1.5rem;
  min-width: 1.5rem;
  max-width: 1.5rem;
  padding: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-split__caret.btn-secondary {
  border-left-color: var(--border);
}

.btn-split__caret--lead {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

.btn-split__caret--lead.btn-secondary {
  border-right-color: var(--border);
}

.btn-split__caret .icon {
  width: 0.8rem;
  height: 0.8rem;
  transition: transform 0.12s ease;
}

.btn-split.is-open .btn-split__caret .icon {
  transform: rotate(180deg);
}

.btn-split__menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 40;
  min-width: 100%;
  padding: 0.2rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
}

.btn-split__menu[hidden] {
  display: none;
}

.btn-split__option {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.btn-split__option--subtle {
  color: var(--muted-foreground);
  font-weight: 500;
}

.btn-split__option:hover,
.btn-split__option.is-selected {
  background: var(--muted);
  color: var(--foreground);
}

.btn-logout {
  background: var(--btn-idle-bg);
  color: var(--btn-idle-fg);
  border: 1px solid var(--btn-idle-border);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.btn-logout:hover {
  background: var(--btn-idle-hover);
}

.btn-destructive {
  background: linear-gradient(160deg, #1d1d1f 0%, #2c2c30 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--pop-lift-sm);
}

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--pop-rim);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lift), var(--pop-shine);
  padding: 1.25rem;
}

.card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.card-desc {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.period-tabs .btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
}

.billing-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.billing-period-tabs a {
  min-height: 2rem;
  padding: 0 0.7rem;
}

.billing-template-picker__list {
  display: grid;
  gap: 0.75rem;
}

.billing-template-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.billing-template-option:hover,
.billing-template-option.is-active {
  border-color: var(--foreground);
  background: var(--muted);
}

.billing-template-option__title {
  font-weight: 600;
}

.billing-template-option__desc,
.billing-template-option__meta {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.invoice-pdf-template-list {
  display: grid;
  gap: 0.45rem;
}

.invoice-pdf-template-option {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.invoice-pdf-template-option:hover,
.invoice-pdf-template-option.is-selected,
.invoice-pdf-template-option:has(input:checked) {
  border-color: var(--foreground);
  background: var(--muted);
}

.invoice-pdf-template-option > input[type="radio"] {
  margin: 0;
  accent-color: var(--foreground);
  flex-shrink: 0;
}

.invoice-pdf-template-option__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.invoice-pdf-template-option__head input {
  margin: 0;
  accent-color: var(--foreground);
  flex-shrink: 0;
}

.invoice-pdf-template-option__name {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.invoice-pdf-template-settings {
  border-top: 1px solid var(--border);
  background: var(--card);
}

.invoice-pdf-template-settings__summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.invoice-pdf-template-settings__summary::-webkit-details-marker {
  display: none;
}

.invoice-pdf-template-settings__summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid var(--muted-foreground);
  border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.invoice-pdf-template-settings[open] .invoice-pdf-template-settings__summary::before {
  transform: rotate(45deg);
}

.invoice-pdf-template-settings__body {
  display: grid;
  gap: 0.65rem;
  padding: 0 0.75rem 0.75rem;
}

.invoice-pdf-template-settings__empty {
  margin: 0;
  font-size: 0.8rem;
}

.invoice-pdf-bos-settings .image-picker {
  max-width: 16rem;
}

.invoice-pdf-bos-settings .image-picker__label {
  /* Section summary already says "Background". */
  display: none;
}

.invoice-pdf-bos-settings__clear {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  cursor: pointer;
}

.invoice-pdf-bos-settings__opacity {
  display: grid;
  gap: 0.25rem;
  max-width: 16rem;
  margin-top: 0.75rem;
}

.invoice-pdf-bos-settings__opacity label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.invoice-pdf-bos-settings__opacity input[type="range"] {
  width: 100%;
  accent-color: var(--foreground);
}

.invoice-pdf-bos-settings [data-opacity-value] {
  margin-left: 0.25rem;
  font-weight: 600;
  color: var(--foreground);
}

.invoice-pdf-bos-settings .error {
  font-size: 0.8rem;
  color: var(--destructive);
  width: 100%;
}

.operations-activity-card,
.analytics-revenue-card,
.analytics-rank-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.analytics-chart-wrap,
.operations-chart-wrap {
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.analytics-chart-wrap {
  height: 280px;
  margin-top: 0.75rem;
}

.operations-chart-wrap {
  height: 9.5rem;
  margin-top: 0.55rem;
}

.analytics-chart-track {
  position: relative;
  height: 100%;
  width: 100%;
  min-width: 100%;
}

.analytics-chart-header {
  display: block;
}

.analytics-series-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
  max-width: 100%;
  min-width: 0;
}

.analytics-series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.85rem;
  max-width: 100%;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition:
    background var(--ease),
    border-color var(--ease),
    opacity var(--ease),
    box-shadow var(--ease);
}

.analytics-series-toggle:hover {
  border-color: color-mix(in srgb, var(--pri) 35%, var(--border));
}

.analytics-series-toggle:focus-visible {
  outline: none;
  box-shadow:
    var(--pop-lift-sm),
    var(--pop-shine),
    0 0 0 3px color-mix(in srgb, var(--pri) 25%, transparent);
}

.analytics-series-toggle.is-on {
  border-color: color-mix(in srgb, var(--pri) 40%, var(--border));
  background: color-mix(in srgb, var(--pri) 8%, var(--card));
}

.analytics-series-toggle:not(.is-on) {
  opacity: 0.72;
}

.analytics-series-toggle__swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.12);
}

.analytics-series-toggle:not(.is-on) .analytics-series-toggle__swatch {
  opacity: 0.45;
}

.analytics-series-toggle__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-series-toggle__state {
  margin-left: 0.05rem;
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.analytics-series-toggle.is-on .analytics-series-toggle__state {
  background: color-mix(in srgb, var(--pri) 16%, transparent);
  color: var(--pri);
}

.analytics-chart-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.15rem;
  margin-top: 0.65rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.analytics-chart-total {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
}

.analytics-chart-total .icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.analytics-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.analytics-chart-wrap--rank {
  /* Extra height for vertical category labels on mobile. */
  height: 18.5rem;
}

@media (max-width: 860px) {
  .analytics-rank-grid {
    grid-template-columns: 1fr;
  }

  .analytics-chart-wrap--rank {
    height: 20rem;
  }

  /* Keep the card on-screen; scroll the chart track inside. */
  .analytics-chart-track {
    min-width: max(100%, 22rem);
  }

  .analytics-chart-wrap--rank .analytics-chart-track {
    min-width: max(100%, 26rem);
  }
}

.profit-positive {
  color: var(--success, #15803d);
}

.profit-negative {
  color: var(--destructive, #b91c1c);
}

.profit-zero {
  color: var(--foreground);
}

.profit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 1.5rem;
}

.profit-tag__amount:not([hidden]) {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 0.92rem;
  line-height: 1.2;
}

.profit-tag__mask {
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
  font-weight: 600;
}

.profit-tag__eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.profit-tag__eye:hover {
  background: color-mix(in srgb, var(--muted) 75%, transparent);
  color: var(--foreground);
}

.profit-tag__eye .icon {
  width: 1rem;
  height: 1rem;
}

/* .icon { display: inline-flex } beats the browser's [hidden] rule. */
.profit-tag__eye .icon[hidden] {
  display: none;
}

/* Sell ≤ buy / cost. Beat table.data td and detail-list color. */
table.data td.sell-price--at-or-below-cost,
table.data.table-analytics td.sell-price--at-or-below-cost,
td.col-sell.sell-price--at-or-below-cost,
.detail-list__row dd .sell-price--at-or-below-cost,
input.sell-price--at-or-below-cost,
input.sell-lines__price.sell-price--at-or-below-cost {
  color: var(--destructive, #b91c1c);
}

.modal-sell input.sell-lines__price.is-attention,
.modal-sell #sell-form #id_received_amount.is-attention {
  background: #fff;
  background-color: #fff;
  border-color: #d0d0d0;
  animation: sell-field-bright-pulse 1.6s ease-in-out infinite;
}

.modal-sell input.sell-lines__price.is-invalid,
.modal-sell #sell-form #id_received_amount.is-invalid {
  background: #fff;
  background-color: #fff;
  border-color: var(--destructive, #b91c1c);
  animation: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive, #b91c1c) 22%, transparent);
}

@keyframes sell-invalid-flash {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--destructive, #b91c1c) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--destructive, #b91c1c) 45%, transparent);
  }
}

.modal-sell .is-flash,
.modal-sell input.sell-lines__price.is-invalid.is-flash,
.modal-sell #sell-form #id_received_amount.is-invalid.is-flash,
.modal-sell .supplier-combo.is-attention .sell-dash.is-flash,
.modal-sell .sell-lines__add-btn.is-attention.is-flash,
.modal-sell .sell-customer-gap__fill.is-flash,
.modal-sell .form-field.is-flash .input,
.modal-sell .form-field.is-flash .address-fields__control input,
.modal-sell .form-field.is-flash .dd-trigger,
.modal-sell .form-field.is-flash .image-picker__frame {
  animation: sell-invalid-flash 0.42s ease-in-out 3;
}

@keyframes sell-field-bright-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  }
  50% {
    box-shadow: 0 0 0 4px #fff, 0 4px 14px rgba(0, 0, 0, 0.14);
  }
}

.public-page {
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  background: var(--background);
}

.public-page-inner {
  max-width: 720px;
  margin: 0 auto;
}

.public-intake {
  --public-ink: var(--foreground, #1d1d1f);
  --public-muted: var(--muted-foreground, #6e6e73);
  --public-surface: var(--card, #ffffff);
  --public-border: var(--border, #e1e4ea);
  position: relative;
  min-height: 100vh;
  padding: 2.25rem 1.1rem 3.5rem;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, color-mix(in srgb, var(--pri) 12%, transparent), transparent 55%),
    var(--pop-bg, #eef0f3);
}

.public-intake__glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: none;
  background-size: auto;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 70%);
  opacity: 0.55;
}

.public-intake__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
}

.public-intake__hero {
  margin-bottom: 1.35rem;
  animation: public-intake-rise 0.55s ease-out both;
}

.public-intake__brand {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  letter-spacing: -0.03em;
  color: var(--public-ink);
  line-height: 1.1;
}

.public-intake__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--public-ink);
  letter-spacing: -0.01em;
}

.public-intake__lede {
  margin: 0;
  max-width: 36rem;
  color: var(--public-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.public-intake__card {
  background: var(--public-surface);
  border: 1px solid var(--pop-rim, var(--public-border));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--pop-lift, var(--shadow)), var(--pop-shine, none);
  animation: public-intake-rise 0.6s ease-out 0.06s both;
}

.public-intake__form {
  padding: 1.25rem 1.2rem 1.35rem;
}

.public-intake__card--notice,
.public-intake__card--success {
  padding: 1.75rem 1.35rem;
  text-align: left;
}

.public-intake__card--success .public-intake__brand {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.public-intake__notice-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.public-intake__notice-body {
  margin: 0;
  color: var(--public-muted);
  line-height: 1.5;
}

.public-intake__alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: color-mix(in srgb, #b91c1c 8%, transparent);
  border: 1px solid color-mix(in srgb, #b91c1c 22%, transparent);
  color: #991b1b;
  font-size: 0.9rem;
}

.public-intake__fields {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.public-intake__section-label {
  margin: 1.15rem 0 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--public-border);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--public-muted);
}

.public-intake__section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.public-intake__supplier {
  margin-top: 0.35rem;
}

.public-intake__supplier-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 1rem 0 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--pri) 28%, var(--public-border));
  border-radius: var(--radius-md, 14px);
  background: color-mix(in srgb, var(--pri) 10%, var(--public-surface));
  box-shadow: var(--pop-shine, none);
}

.public-intake__supplier-banner[hidden] {
  display: none !important;
}

.public-intake__supplier-banner-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--public-ink);
}

.public-intake__supplier-banner-meta {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--public-muted);
  line-height: 1.35;
}

.public-intake__supplier-body[hidden] {
  display: none !important;
}

.public-intake__supplier.is-collapsed .public-intake__section-label {
  display: none;
}

.public-intake__imei {
  margin-bottom: 0.15rem;
}

.public-intake__form .form-field {
  margin-bottom: 1rem;
}

.public-intake__form .form-field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.public-intake__form .help {
  font-size: 0.8rem;
  line-height: 1.4;
}

.public-intake__form .input,
.public-intake__form .select,
.public-intake__form .textarea,
.public-intake__form input[type="text"],
.public-intake__form input[type="email"],
.public-intake__form input[type="number"],
.public-intake__form input[type="tel"],
.public-intake__form input[type="url"],
.public-intake__form select,
.public-intake__form textarea {
  height: 2.65rem;
  font-size: 1rem;
  border-radius: 10px;
  padding: 0 0.85rem;
}

.public-intake__form input[type="file"] {
  height: 2.65rem;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 0 0.55rem;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.public-intake__form input[type="file"]::file-selector-button,
.public-intake__form input[type="file"]::-webkit-file-upload-button {
  height: 1.9rem;
  margin: 0 0.65rem 0 0;
  padding: 0 0.75rem;
  border: 1px solid var(--public-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--public-ink) 5%, var(--public-surface));
  color: var(--public-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.public-intake__form textarea {
  height: auto;
  min-height: 5.5rem;
  padding: 0.7rem 0.85rem;
}

.public-intake__form .imei-field__control input {
  height: 2.65rem;
  border-radius: 10px;
}

.public-intake__form .imei-field__camera {
  width: 2rem;
  height: 2rem;
}

.public-intake__form .imei-field__camera .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.public-intake__actions {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--public-border);
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--public-surface) 18%);
  padding-bottom: 0.15rem;
}

.public-intake__actions .btn-lg {
  width: 100%;
  min-height: 2.85rem;
  font-size: 1.05rem;
  border-radius: 10px;
}

.public-intake__actions--wizard {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.public-intake__actions--wizard .btn-secondary {
  width: 100%;
  min-height: 2.5rem;
  border-radius: 10px;
  order: 2;
}

.public-intake__actions--wizard .btn-lg {
  order: 1;
}

.public-intake__actions--wizard .public-intake__footnote {
  order: 3;
}

.public-intake__form[data-intake-step="2"] .public-intake__supplier {
  margin-top: 0;
}

.public-intake__form[data-intake-step="2"] .public-intake__section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.public-intake__footnote {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.4;
}

.public-intake__product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin: 0 0 1.1rem;
  color: var(--public-muted);
  font-size: 0.9rem;
}

.public-intake__product-meta code {
  font-size: 0.85em;
}

.public-intake__detail-list {
  display: grid;
  gap: 0.95rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-intake__detail-list dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--public-muted);
}

.public-intake__detail-list dd {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--public-ink);
  word-break: break-word;
}

.public-intake__detail-list img,
.public-intake__detail-list video {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin-top: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--public-border);
}

.public-intake__buy-intro {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.public-pdp__inner {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
}

.public-pdp__top {
  margin-bottom: 1.5rem;
  animation: public-intake-rise 0.55s ease-out both;
}

.public-pdp__layout {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  animation: public-intake-rise 0.6s ease-out 0.05s both;
}

.public-pdp__gallery {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.public-pdp__stage {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: color-mix(in srgb, var(--public-surface) 70%, #e2e2e2);
  border: 1px solid color-mix(in srgb, var(--public-border) 70%, transparent);
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--public-ink) 4%, transparent),
    0 22px 48px -30px color-mix(in srgb, var(--public-ink) 30%, transparent);
  aspect-ratio: 1 / 1;
  min-width: 0;
  width: 100%;
  touch-action: pan-y;
}

.public-pdp__stage:empty {
  display: none;
}

.public-pdp__media {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: color-mix(in srgb, var(--public-surface) 70%, #e2e2e2);
  border: 1px solid color-mix(in srgb, var(--public-border) 70%, transparent);
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--public-ink) 4%, transparent),
    0 22px 48px -30px color-mix(in srgb, var(--public-ink) 30%, transparent);
  aspect-ratio: 1 / 1;
}

.public-pdp__stage .public-pdp__media {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
  background: transparent;
}

.public-pdp__media[hidden] {
  display: none !important;
}

.public-pdp__media img,
.public-pdp__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.public-pdp__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 0.7rem;
}

.public-pdp__dots[hidden] {
  display: none !important;
}

.public-pdp__dot {
  width: 0.45rem;
  height: 0.45rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--public-ink, #111) 22%, transparent);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, width 0.15s ease;
}

.public-pdp__dot.is-active {
  width: 1rem;
  background: var(--public-ink, #111);
}

.public-pdp__dot:focus-visible {
  outline: 2px solid var(--public-ink, #111);
  outline-offset: 2px;
}

.public-pdp__media--placeholder {
  position: relative;
  inset: auto;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 16rem;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--pop-rim, var(--public-border));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--pri) 10%, #eef0f3), #eef0f3 55%, #f7f8fa);
  box-shadow: var(--pop-lift, var(--shadow)), var(--pop-shine, none);
}

.public-pdp__placeholder-mark {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: color-mix(in srgb, var(--public-ink) 18%, transparent);
  text-transform: uppercase;
  user-select: none;
}

.public-pdp__summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.public-pdp__eyebrow {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--public-muted);
}

.public-pdp__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--public-ink);
}

.public-pdp__price {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--public-ink);
  line-height: 1.1;
}

.public-pdp__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--public-muted);
  font-size: 0.9rem;
}

.public-pdp__meta code {
  font-size: 0.85em;
}

.public-pdp__stock {
  color: var(--pri);
  font-weight: 600;
}

.public-pdp__cta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 0.65rem;
  width: 100%;
}

.public-pdp__cta .btn-lg {
  min-height: 2.85rem;
  padding-inline: 1.35rem;
  border-radius: 10px;
  font-size: 1.05rem;
}

.public-pdp__cta-note {
  margin: 0;
  max-width: 28rem;
  color: var(--public-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.public-pdp__notice {
  margin-top: 0.75rem;
  width: 100%;
}

.public-pdp__section-title {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--public-muted);
}

.public-pdp__specs {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--public-surface);
  border: 1px solid color-mix(in srgb, var(--public-border) 80%, transparent);
  border-radius: 14px;
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--public-ink) 4%, transparent),
    0 18px 40px -28px color-mix(in srgb, var(--public-ink) 22%, transparent);
  animation: public-intake-rise 0.6s ease-out 0.1s both;
}

.public-pdp__spec-grid {
  display: grid;
  gap: 0.9rem 1.25rem;
  margin: 0;
  padding: 0;
}

.public-pdp__spec dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--public-muted);
}

.public-pdp__spec dd {
  margin: 0.28rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--public-ink);
  word-break: break-word;
}

.public-pdp__buy-panel {
  padding: 1.25rem 1.2rem 1.35rem;
  margin-bottom: 1rem;
  animation: public-intake-rise 0.45s ease-out both;
}

.public-pdp__buy-panel[hidden] {
  display: none !important;
}

.public-pdp__buy-form {
  padding: 0;
}

.public-pdp__buy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

@keyframes public-intake-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .public-intake {
    padding: 3rem 1.5rem 4rem;
  }

  .public-intake__form {
    padding: 1.5rem 1.5rem 1.6rem;
  }

  .public-intake__actions .btn-lg {
    width: auto;
    min-width: 12rem;
  }

  .public-intake__footnote {
    text-align: left;
  }

  .public-pdp__spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .public-pdp__layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.25rem;
    align-items: start;
  }

  .public-pdp__summary {
    position: sticky;
    top: 1.5rem;
    padding-top: 0.35rem;
  }

  .public-pdp__cta .btn-lg {
    width: auto;
    min-width: 14rem;
  }

  .public-pdp__stage {
    aspect-ratio: 1 / 1;
  }
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.notification-list li.is-unread a {
  font-weight: 600;
}

.share-link-url {
  min-width: 0;
  max-width: 100%;
}

.share-links-section {
  padding: 0;
  overflow: hidden;
}

.share-links-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.share-links-summary::-webkit-details-marker {
  display: none;
}

.capabilities-panel {
  padding: 0;
  overflow: hidden;
}

.capabilities-panel__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.capabilities-panel__summary::-webkit-details-marker {
  display: none;
}

.capabilities-panel__summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.capabilities-panel[open] > .capabilities-panel__summary::before {
  transform: rotate(45deg);
}

.capabilities-panel__body {
  padding: 0 1.15rem 1.15rem;
}

.checkbox-row.is-disabled,
.checkbox-row.is-locked {
  opacity: 0.72;
  cursor: default;
}

.checkbox-row.is-disabled input,
.checkbox-row.is-locked input[type="checkbox"] {
  cursor: not-allowed;
}

.share-links-summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.share-links-section[open] .share-links-summary::before {
  transform: rotate(45deg);
}

.share-links-summary-title {
  font-weight: 600;
  font-size: 1rem;
}

.share-links-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
}

.share-links-body .card-desc {
  margin-top: 0.75rem;
}

.share-links-create {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.share-link-create-panel[hidden] {
  display: none;
}

.share-link-copy-btn {
  white-space: nowrap;
}

.share-link-copy-btn .icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

table.data tr.is-disabled td {
  opacity: 0.58;
}

table.data tr.is-disabled {
  color: var(--muted-foreground);
}

.table-wrap-share-links {
  overflow-x: hidden;
  margin-top: 0.75rem;
  border: none;
  background: transparent;
  padding: 0;
}

table.data.table-share-links {
  table-layout: fixed;
  width: 100%;
}

table.data.table-share-links th,
table.data.table-share-links td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

table.data.table-share-links-4 th,
table.data.table-share-links-4 td {
  width: 25%;
}

table.data.table-share-links-5 th,
table.data.table-share-links-5 td {
  width: 20%;
}

table.data.table-share-links th.col-copy,
table.data.table-share-links td.col-copy {
  text-align: center;
}

table.data.table-share-links th.col-actions,
table.data.table-share-links td.col-actions {
  text-align: right;
  overflow: visible;
}

table.data.table-share-links td.col-copy {
  overflow: visible;
}

.buy-request-panel[hidden],
.buy-request-intro[hidden] {
  display: none !important;
}

.buy-request-actions {
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.icon-btn-sm.is-copied,
.share-link-copy-btn.is-copied {
  color: var(--accent);
  border-color: var(--accent);
}

.external-links-create-card {
  padding: 1.25rem 1.35rem 1.35rem;
}

.external-links-create-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.external-links-type-fieldset {
  border: none;
  padding: 0 0 1.1rem;
  margin: 0;
}

.external-links-type-fieldset .stock-toggle {
  width: fit-content;
  max-width: 100%;
}

.external-links-section {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.external-links-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
  align-items: start;
}

.external-links-access-grid .form-field label,
.external-links-section .form-field label {
  font-size: 0.8125rem;
  font-weight: 500;
}

.external-links-access-grid .input,
.external-links-access-grid .select,
.external-links-access-grid .dd-dropdown,
.external-links-access-grid select {
  width: 100%;
  max-width: none;
}

.external-links-access-grid input[type="number"] {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.external-links-create-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.external-links-target[data-single-template="1"] {
  display: block;
}

@media (max-width: 720px) {
  .external-links-access-grid {
    grid-template-columns: 1fr;
  }
}

table.data.table-external-links th.col-copy,
table.data.table-external-links td.col-copy {
  width: 6.5rem;
}

table.data.table-external-links th.col-actions,
table.data.table-external-links td.col-actions {
  width: 5.5rem;
  text-align: right;
}

.dashboard-inbox-search {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
}

.dashboard-inbox-search .input {
  width: 100%;
}

.dashboard-inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dashboard-customer-comms {
  margin-bottom: 1.25rem;
}

.dashboard-customer-comms > .row {
  margin-bottom: 0.45rem !important;
}

.dashboard-customer-comms__list {
  padding: 0;
  /* Hug content — never use full-viewport .chat-inbox height here */
  height: auto;
  min-height: 0;
  max-height: calc(5 * 2.55rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.dashboard-customer-comms__list .chat-inbox__badge {
  background: #0f3d2e;
}

.dashboard-customer-comms__list .dashboard-customer-comms__row.chat-inbox__row {
  min-height: 0;
  padding: 0.35rem 0.65rem;
  gap: 0.5rem;
}

.dashboard-customer-comms__list .chat-inbox__avatar {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  max-width: 1.75rem;
}

.dashboard-customer-comms__list .chat-inbox__avatar .icon {
  --icon-size: 0.95rem;
}

.dashboard-customer-comms__list .chat-inbox__row-title {
  font-size: 0.84rem;
  line-height: 1.2;
}

.dashboard-customer-comms__list .chat-inbox__row-preview {
  font-size: 0.74rem;
  line-height: 1.2;
}

.dashboard-customer-comms__list .dashboard-customer-comms__row:last-child {
  border-bottom: none;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
}

.form-field .help {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.form-field .error {
  font-size: 0.8rem;
  color: var(--destructive);
}

.form-field input[readonly],
.form-field input[readonly]:focus {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: default;
  caret-color: transparent;
  box-shadow: none;
  user-select: none;
}

.form-field.is-attention > input,
.form-field.is-attention > select,
.form-field.is-attention > textarea,
.form-field.is-attention .input,
.form-field.is-attention .auth-field__control > input,
.form-field.is-attention .address-fields__control input,
.form-field.is-attention .money-input,
.form-field.is-attention .money-input input,
.form-field.is-attention .supplier-combo__trigger,
.form-field.is-attention .supplier-combo__trigger--btn,
.form-field.is-attention .imei-field__control input,
.form-field.is-attention .image-picker__frame,
.form-field.is-attention .field-measure__amount,
.form-field.is-attention .dd-trigger,
.supplier-combo.is-attention .supplier-combo__trigger,
.supplier-combo.is-attention .supplier-combo__trigger--btn {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

/* Unit dropdown is not the missing value — highlight the amount input only. */
.form-field.is-attention .field-measure__unit .dd-trigger,
.form-field.is-attention .field-measure__unit .dd-trigger:hover,
.form-field.is-attention .field-measure__unit .dd-trigger:focus-visible,
.form-field.is-attention .field-measure__unit select {
  border-color: var(--border);
  box-shadow: none;
  animation: none;
}

.form-field--owner-hidden {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

.form-field--owner-hidden.is-attention {
  border-left-color: var(--destructive);
}

@keyframes field-attention-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--destructive) 35%, transparent);
  }
  70% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--destructive) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  }
}

.form-field.external-links-expires,
.form-field.external-links-max-products {
  margin-bottom: 0;
}

.address-fields {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 55%, transparent);
}

.address-fields__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0;
}

.address-fields__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
}

.address-fields__locate {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.address-fields__locate:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.address-fields__locate:disabled {
  opacity: 0.55;
  cursor: wait;
  text-decoration: none;
}

.address-fields__locate .icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--muted-foreground);
}

.address-fields__locate:hover .icon {
  color: var(--foreground);
}

.address-fields__pin-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 0.75rem;
}

@media (min-width: 640px) {
  .address-fields__pin-line {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: start;
  }
}

.address-fields__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 0.75rem;
}

@media (min-width: 640px) {
  .address-fields__row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

.address-fields .form-field {
  margin-bottom: 0.75rem;
}

.address-fields__status {
  margin: -0.25rem 0 0.65rem;
}

.address-fields__control {
  position: relative;
}

.address-fields__control input {
  width: 100%;
  padding-right: 2rem;
}

.address-fields__control--with-toggle input {
  padding-right: 2.35rem;
}

.address-fields.has-locality .address-fields__control--with-toggle input {
  padding-right: 4.1rem;
}

.address-fields__spinner {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: -0.45rem;
  border: 2px solid var(--border);
  border-top-color: var(--foreground, currentColor);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 1;
}

.address-fields.is-loading .address-fields__spinner {
  opacity: 1;
  animation: address-spin 0.7s linear infinite;
}

.address-fields.has-locality.is-loading .address-fields__control--with-toggle .address-fields__spinner {
  right: 2.35rem;
}

.address-fields__line1-shell {
  position: relative;
}

.address-fields__locality-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  z-index: 2;
}

.address-fields__locality-toggle:hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
}

.address-fields__locality-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.address-fields__locality-toggle[hidden] {
  display: none;
}

.address-fields__locality-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 20;
  max-height: 12rem;
  overflow: auto;
  margin: 0;
  padding: 0.25rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius, 6px);
  background: var(--card);
  box-shadow: var(--shadow-dropdown);
}

.address-fields__locality-menu[hidden] {
  display: none;
}

.address-fields__locality-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.address-fields__locality-option:hover,
.address-fields__locality-option.is-selected {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

@keyframes address-spin {
  to {
    transform: rotate(360deg);
  }
}

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  border: 1px solid var(--pop-rim-strong);
  border-radius: var(--radius-md);
  background-color: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  box-shadow: var(--pop-shine);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.input:focus,
.select:focus,
.textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--pri) 40%, var(--pop-rim));
  box-shadow:
    var(--pop-shine),
    0 0 0 3px color-mix(in srgb, var(--pri) 22%, transparent);
}

/* Native select chevron inset, avoids flush-right arrows on narrow dropdowns */
select:not([multiple]),
.select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.85rem;
  background-color: var(--control-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem 0.9rem;
}

select:not([multiple]):disabled,
.select:not([multiple]):disabled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Custom single-select dropdown (replaces native system menus) */
.dd-dropdown {
  position: relative;
  width: 100%;
  display: block;
}

.dd-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  appearance: none !important;
  background: none !important;
  box-shadow: none !important;
}

.dd-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.dd-trigger:hover {
  border-color: var(--border);
}

.dd-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.form-field.is-attention .dd-trigger,
.form-field.is-attention .dd-trigger:hover,
.form-field.is-attention .dd-trigger:focus-visible {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

.form-field.is-attention .field-measure__unit .dd-trigger,
.form-field.is-attention .field-measure__unit .dd-trigger:hover,
.form-field.is-attention .field-measure__unit .dd-trigger:focus-visible {
  border-color: var(--border);
  box-shadow: none;
  animation: none;
}

.form-field.is-attention .field-measure__amount {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

.dd-dropdown.is-disabled .dd-trigger {
  opacity: 0.55;
  cursor: not-allowed;
}

.dd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-label.is-placeholder {
  color: var(--muted-foreground);
}

.dd-caret {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  stroke: var(--muted-foreground);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.dd-dropdown[data-dd-open] .dd-caret {
  transform: rotate(180deg);
}

.dd-dropdown[data-dd-open] .dd-caret--swap {
  transform: none;
}

.dd-leading-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted-foreground);
}

.dd-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.3rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
}

.dd-panel[hidden] {
  display: none;
}

.dd-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.dd-option-main {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-option-sub {
  display: block;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted-foreground);
  line-height: 1.2;
}

.dd-search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.2rem 0.2rem 0.35rem;
  background: var(--card);
}

.dd-search {
  width: 100%;
  height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: 0.8125rem;
}

.dd-search:focus {
  outline: 2px solid var(--ring);
  outline-offset: 0;
  border-color: var(--ring);
}

.dd-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.15rem;
}

.dd-empty {
  padding: 0.55rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.dd-option:hover:not(:disabled),
.dd-option:focus-visible {
  background: #e4e4e4;
  border-color: #d4d4d4;
  outline: none;
}

.dd-option:active:not(:disabled) {
  background: #e4e4e4;
  border-color: #d4d4d4;
  box-shadow: none;
}

.dd-option.is-selected {
  background: #e4e4e4;
  border-color: #d4d4d4;
  font-weight: 550;
}

.dd-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dd-dropdown--sm .dd-trigger {
  height: var(--control-height);
  min-height: var(--control-height);
  min-width: 4.5rem;
  width: auto;
  padding: 0 0.55rem;
  font-size: var(--control-font-size);
}

.dd-dropdown--sm {
  width: auto;
  display: inline-block;
}

/* Sidebar org switcher, borderless trigger */
.org-switch {
  margin: 0;
  width: 100%;
}

.org-switch .dd-dropdown--org {
  width: 100%;
  max-width: 100%;
}

.org-switch .dd-dropdown--org .dd-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 2.35rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  gap: 0.55rem;
}

.org-switch .dd-dropdown--org .dd-trigger:hover {
  background: var(--secondary);
}

.org-switch .dd-dropdown--org .dd-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.org-switch .dd-dropdown--org .dd-leading-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin: 0;
  color: var(--foreground);
}

.org-switch .dd-dropdown--org .dd-label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.org-switch .dd-dropdown--org .dd-caret {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  flex-shrink: 0;
}

.sidebar .org-switch .dd-dropdown--org {
  width: auto;
  max-width: none;
}

.sidebar .org-switch .dd-dropdown--org .dd-leading-icon,
.sidebar .org-switch .dd-dropdown--org .dd-label {
  display: none;
}

.sidebar .org-switch .dd-dropdown--org .dd-trigger {
  width: 1.7rem;
  max-width: none;
  height: 1.7rem;
  min-height: 1.7rem;
  padding: 0;
  justify-content: center;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted-foreground);
}

.sidebar .org-switch .dd-dropdown--org .dd-caret {
  width: 1.4rem;
  height: 1.4rem;
  stroke-width: 1.2;
}

.sidebar-header:has(.org-switch) .sidebar-identity {
  padding-right: 2rem;
}

.org-switch .dd-dropdown--org .dd-panel,
.dd-panel.dd-panel--org {
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 1rem));
  max-height: none;
  overflow: visible;
  padding: 0.3rem;
}

/* Ported to <body> while open so sidebar transform can't clip / mis-position it. */
.dd-panel[data-dd-ported] {
  margin: 0;
}

.org-switch .dd-dropdown--org .dd-option {
  padding: 0.5rem 0.55rem;
}

.org-switch .dd-dropdown--org .dd-option.is-selected .dd-option-main {
  font-weight: 550;
}

.pagination-row__size .dd-dropdown {
  width: auto;
}

table.data.table-org-members .member-role-form .dd-dropdown {
  width: auto;
  min-width: 6.5rem;
  max-width: 8rem;
}

input[type="file"] {
  height: 2.35rem;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  height: 1.65rem;
  margin: 0 0.55rem 0 0;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

textarea,
.textarea {
  height: auto;
  min-height: 5rem;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

select[multiple],
.select[multiple] {
  height: auto;
  min-height: 8rem;
  padding: 0.4rem 0.5rem;
  overflow-y: auto;
}

select[multiple] option,
.select[multiple] option {
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius);
}

/* Dropdown multi-select */
.ms-dropdown {
  position: relative;
  width: 100%;
}

.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.ms-trigger:hover {
  border-color: var(--border);
}

.ms-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.ms-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-summary.is-placeholder {
  color: var(--muted-foreground);
}

.ms-caret {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--muted-foreground);
  border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  flex-shrink: 0;
}

.ms-panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
}

.ms-panel[hidden] {
  display: none;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--foreground);
}

.ms-option:hover {
  background: var(--muted);
}

.ms-option input {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: var(--foreground);
}

.supplier-combo__control {
  position: relative;
}

.supplier-combo__control > .input,
.supplier-combo__control > input[type="search"] {
  padding-right: 2.35rem;
}

.supplier-combo__trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  margin: 0;
  padding: 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.supplier-combo__trigger:hover {
  border-color: var(--border);
}

.supplier-combo__trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

/* Single-line picker button (Sell / Add items), label lives on the button. */
.form-field--combo-btn {
  gap: 0;
}

.supplier-combo__trigger--btn {
  position: relative;
  justify-content: center;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0 2.25rem;
  border: 1px solid var(--border-dropdown);
  background: var(--btn-idle-bg);
  color: var(--btn-idle-fg);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  box-shadow: none;
}

.supplier-combo__trigger--btn:hover {
  background: var(--btn-idle-hover);
  border-color: #c4c4c4;
}

.supplier-combo__trigger--btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.supplier-combo.is-open .supplier-combo__trigger--btn,
.sell-product-picker.is-open .supplier-combo__trigger--btn {
  border-color: #c4c4c4;
}

.supplier-combo.is-attention .supplier-combo__trigger--btn,
.supplier-combo.is-attention.is-open .supplier-combo__trigger--btn,
.supplier-combo.is-attention .supplier-combo__trigger--btn:hover,
.supplier-combo.is-attention .supplier-combo__trigger--btn:focus-visible {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

.supplier-combo__trigger--btn .supplier-combo__caret {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.supplier-combo.is-open .supplier-combo__trigger--btn .supplier-combo__caret,
.sell-product-picker.is-open .supplier-combo__trigger--btn .supplier-combo__caret {
  transform: translateY(-50%) rotate(180deg);
}

.supplier-combo__trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-combo__trigger--btn .supplier-combo__trigger-label {
  flex: 0 1 auto;
  max-width: 100%;
  text-align: center;
}

.supplier-combo__trigger-label.is-placeholder {
  color: var(--foreground);
  font-weight: 600;
}

.supplier-combo__trigger--btn .supplier-combo__trigger-label:not(.is-placeholder) {
  font-weight: 550;
}

.supplier-combo__caret {
  display: inline-flex;
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: transform 140ms ease;
}

.supplier-combo__control > .input + .supplier-combo__caret,
.supplier-combo__control > input[type="search"] + .supplier-combo__caret {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.supplier-combo__caret svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supplier-combo__control:has(input[aria-expanded="true"]) > .supplier-combo__caret,
.supplier-combo.is-open .supplier-combo__trigger:not(.supplier-combo__trigger--btn) .supplier-combo__caret,
.sell-product-picker.is-open .supplier-combo__trigger:not(.supplier-combo__trigger--btn) .supplier-combo__caret {
  transform: rotate(180deg);
}

.supplier-combo__control:has(input[aria-expanded="true"]) > input + .supplier-combo__caret {
  transform: translateY(-50%) rotate(180deg);
}

.supplier-combo__panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(70vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.4rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: calc(var(--radius) + 2px);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
  isolation: isolate;
}

.supplier-combo__panel:has(.supplier-combo__search) {
  padding-top: 0;
}

.supplier-combo__search {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 -0.4rem 0;
  padding: 0.45rem 0.4rem 0.35rem;
  background: var(--card);
  /* Solid bar at the top of the panel so rows cannot show above the search field. */
  box-shadow: 0 1px 0 var(--border);
}

.supplier-combo__search .input {
  width: 100%;
}

[data-device-label-combo] .supplier-combo__panel {
  max-height: min(75vh, 32rem);
}

[data-device-label-combo] .supplier-combo__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
}

[data-device-label-combo] .supplier-combo__search .input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

[data-device-label-combo] .supplier-combo__search .input.is-attention {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

[data-device-label-combo] .device-label-combo__add {
  flex: 0 0 auto;
  width: auto;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  white-space: nowrap;
}

[data-device-label-combo] .device-label-combo__confirm {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(100% - 0.75rem);
  height: var(--control-height);
  min-height: var(--control-height);
  margin-top: 0.15rem;
  padding: 0 0.9rem;
  font-size: var(--control-font-size);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pop-text, var(--foreground));
  background: color-mix(in srgb, var(--pri) 28%, #fff);
  border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pop-rim, var(--border)));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

[data-device-label-combo] .device-label-combo__confirm:hover {
  color: var(--pop-text, var(--foreground));
  background: color-mix(in srgb, var(--pri) 36%, #fff);
  border-color: color-mix(in srgb, var(--pri) 28%, var(--pop-rim, var(--border)));
  box-shadow: var(--pop-lift), var(--pop-shine);
}

[data-device-label-combo] .device-label-combo__confirm[hidden] {
  display: none;
}

.device-label-combo__msg {
  margin: 0;
  font-size: 0.8rem;
}

.device-label-combo__msg[hidden] {
  display: none;
}

.supplier-combo__options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Create / “already exists” flow needs more room so the suggestion isn’t clipped. */
.supplier-combo__panel:has([data-device-label-create]:not([hidden])),
.supplier-combo__panel:has([data-device-label-create-existing]:not([hidden])) {
  max-height: min(75vh, 36rem);
}

.supplier-combo__panel[hidden] {
  display: none;
}

.supplier-combo__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.45rem 0 0;
  padding: 0 0.05rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.supplier-combo__actions--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Single shortcut (e.g. Name → Add New) spans the full dropdown width. */
.supplier-combo__actions:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.supplier-combo__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 1.5px solid var(--border-dropdown);
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.supplier-combo__action:hover:not(:disabled) {
  border-color: var(--foreground);
  background: var(--muted);
  color: var(--foreground);
}

.supplier-combo__action:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.supplier-combo__action.is-selected {
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pop-rim, var(--border)));
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  color: var(--pop-text, var(--foreground));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.supplier-combo__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* display:inline-flex above beats the UA [hidden] rule. */
.supplier-combo__action[hidden] {
  display: none;
}

/* While creating a new label, hide the Add New row entirely. */
.supplier-combo__panel:has([data-device-label-create]:not([hidden])) .supplier-combo__actions {
  display: none;
}

.supplier-combo__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.supplier-combo__option:hover,
.supplier-combo__option:focus-visible {
  background: #e4e4e4;
  border-color: #d4d4d4;
  outline: none;
}

.supplier-combo__option:active {
  background: #e4e4e4;
  border-color: #d4d4d4;
  box-shadow: none;
}

.supplier-combo__option--add {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
}

.supplier-combo__option-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.supplier-combo__option-add {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--muted-foreground);
}

.supplier-combo__option-add svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supplier-combo__option--add:hover .supplier-combo__option-add,
.supplier-combo__option--add:focus-visible .supplier-combo__option-add {
  color: var(--foreground);
}

.supplier-combo__option--add.is-selected {
  border-color: color-mix(in srgb, #16a34a 40%, var(--border));
  background: color-mix(in srgb, #16a34a 14%, #ffffff);
  box-shadow: none;
}

.supplier-combo__option--add.is-selected:hover,
.supplier-combo__option--add.is-selected:focus-visible {
  border-color: color-mix(in srgb, #16a34a 55%, var(--border));
  background: color-mix(in srgb, #16a34a 18%, #ffffff);
}

.supplier-combo__option--add.is-selected .supplier-combo__option-add {
  color: #16a34a;
}

.supplier-combo__option--add.is-unavailable {
  color: var(--muted-foreground);
  cursor: pointer;
}

.supplier-combo__option--add.is-unavailable .product-line {
  width: 100%;
}

.supplier-combo__option--add.is-unavailable .product-line__body {
  flex: 1 1 auto;
  min-width: 0;
  align-items: stretch;
}

.supplier-combo__option--add.is-unavailable .product-info-btn,
.supplier-combo__option--add.is-unavailable .supplier-combo__option-title,
.supplier-combo__option--add.is-unavailable .supplier-combo__option-meta {
  opacity: 0.75;
}

.supplier-combo__option--add.is-unavailable .supplier-combo__option-add {
  visibility: hidden;
}

.supplier-combo__option-gap {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0.12rem;
  overflow: hidden;
  color: color-mix(in srgb, var(--destructive, #b91c1c) 58%, var(--muted-foreground));
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.modal-sell .sell-sheet .supplier-combo__option--add.is-unavailable:hover,
.modal-sell .sell-sheet .supplier-combo__option--add.is-unavailable:focus-visible,
.modal-sell .sell-sheet .supplier-combo__option--add.is-unavailable:active {
  background: var(--card);
  border-color: var(--border-dropdown);
  box-shadow: none;
}

.supplier-combo__option[hidden] {
  display: none;
}

.supplier-combo__option-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 550;
}

.supplier-combo__kind-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted-foreground);
}

/* Align meta (IMEI / price) with the product name text, not the leading stock icon. */
.supplier-combo__option-title:has(.supplier-combo__kind-icon) + .supplier-combo__option-meta,
.sell-lines__product-name:has(.supplier-combo__kind-icon) + .muted,
.product-list-name:has(.product-list-name__icon) + .product-list-imei,
.product-list-name:has(.product-list-name__icon) ~ .product-list-imei {
  margin-left: calc(0.95rem + 0.4rem);
}

.supplier-combo__option-title:has(.product-info) + .supplier-combo__option-meta,
.sell-lines__product-name:has(.product-info) + .muted,
.sell-lines__product-name:has(.product-info) + .product-list-imei,
.product-list-name:has(.product-info) + .product-list-imei,
.product-list-name:has(.product-info) ~ .product-list-imei {
  margin-left: calc(1.65rem + 0.4rem);
}

.supplier-combo__kind-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supplier-combo__shop-badge {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 550;
  background: color-mix(in srgb, var(--foreground) 6%, var(--muted));
}

.supplier-list__name {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  min-width: max-content;
}

.page-header__lead h1 {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.page-header__lead h1 .supplier-combo__kind-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.page-header__lead h1 .supplier-combo__shop-badge {
  margin-left: 0.1rem;
  vertical-align: middle;
}

/* Match tray option title weight/size (avoid <strong> / browser bold). */
#sell-lines-table .sell-lines__product-name,
.sell-lines__product-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 550;
  font-size: inherit;
  line-height: inherit;
}

.supplier-combo__option-meta,
.sell-lines__col-product .muted {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1.25;
}

.sell-meta-sep {
  flex: none;
  line-height: 1;
  opacity: 0.85;
}

.sell-stock-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  line-height: 1;
}

.sell-stock-meta .icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  min-width: var(--icon-size-sm);
  min-height: var(--icon-size-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.supplier-combo__option {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.imei-in-stock-modal__product {
  border: 1px solid var(--border);
  background: var(--card, var(--background));
  border-radius: var(--radius);
}

.imei-in-stock-modal__product:hover,
.imei-in-stock-modal__product:focus-visible {
  border-color: var(--ring, var(--foreground));
  background: var(--muted);
}

.supplier-combo__panel [data-device-label-list],
.supplier-combo__panel [data-device-label-create-existing] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem;
}

.supplier-combo__panel [data-device-label-list][hidden],
.supplier-combo__panel [data-device-label-create-existing][hidden] {
  display: none;
}

/* Manufacturer / model names reuse .supplier-combo__action (same as Add New). */
[data-device-label-combo] [data-device-label-list] .supplier-combo__action,
[data-device-label-combo] [data-device-label-create-existing] .supplier-combo__action {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-label-combo__prompt {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1.35;
}

.device-label-combo__create {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
}

.device-label-combo__create[hidden] {
  display: none;
}

.device-label-combo__create .supplier-combo__option--existing,
.supplier-combo__panel [data-device-label-create-existing] .supplier-combo__option--existing {
  border-color: color-mix(in srgb, #16a34a 40%, var(--border));
  background: color-mix(in srgb, #16a34a 14%, #ffffff);
}

.device-label-combo__create .supplier-combo__option--existing:hover,
.device-label-combo__create .supplier-combo__option--existing:focus-visible,
.supplier-combo__panel [data-device-label-create-existing] .supplier-combo__option--existing:hover,
.supplier-combo__panel [data-device-label-create-existing] .supplier-combo__option--existing:focus-visible {
  border-color: color-mix(in srgb, #16a34a 55%, var(--border));
  background: color-mix(in srgb, #16a34a 18%, #ffffff);
}

.device-label-combo__create-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

.device-label-combo__create-actions .btn {
  width: 100%;
  justify-content: center;
}

.device-label-combo__create .help,
.device-label-combo__create .error {
  margin: 0;
  font-size: 0.8rem;
}

.product-type-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.product-type-picker__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.product-type-picker__empty {
  margin: 0;
  font-size: 0.875rem;
}

.product-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.product-type-card[hidden] {
  display: none;
}

.product-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.product-type-card:hover,
.product-type-card.is-selected {
  border-color: var(--foreground);
  background: var(--muted);
}

.product-type-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.product-type-card--new {
  border-style: dashed;
  color: var(--muted-foreground);
}

.product-type-card__icon {
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  color: var(--foreground);
}

.product-type-card__icon svg {
  stroke-width: 0.9;
}

.product-type-card--new .product-type-card__icon {
  color: var(--muted-foreground);
}

.product-type-card__name {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (min-width: 720px) {
  .product-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  }
}

.supplier-combo__empty {
  margin: 0;
  padding: 0.55rem 0.5rem;
  font-size: 0.85rem;
}

.product-field-pair {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-field-pair__item {
  min-width: 0;
}

.product-field-pair__item .form-field {
  margin-bottom: 1rem;
}

@media (min-width: 720px) {
  .product-field-pair {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .product-field-pair__item {
    flex: 1 1 0;
  }
}

.product-form-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-form-section {
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.product-form-section__summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.product-form-section__summary::-webkit-details-marker {
  display: none;
}

.product-form-section__chevron {
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid var(--muted-foreground);
  border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.75;
}

.product-form-section[open] > .product-form-section__summary .product-form-section__chevron {
  transform: rotate(45deg);
}

.product-form-section__title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  color: inherit;
}

.product-form-section__incomplete {
  margin-left: 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  height: 1.2rem;
  padding: 0 0.4rem;
  text-transform: lowercase;
}

.product-form-section__autofill {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

.product-form-section__autofill:hover {
  text-decoration: underline;
}

/* .badge { display: inline-flex } wins over the UA [hidden] rule. */
.badge.product-form-section__incomplete[hidden] {
  display: none !important;
}

.product-form-section__body {
  padding: 0.45rem 0 0.1rem;
  border-top: none;
  background: transparent;
}

.product-form-section__body > .form-field:first-child,
.product-form-section__body > .product-field-pair:first-child,
.product-form-section__body > [data-imei-fields]:first-child,
.product-form-section__body > .seller-field:first-child,
.product-form-section__body > .gov-id-pair:first-child {
  margin-top: 0.35rem;
}

.imei-field__control {
  position: relative;
  display: block;
  width: 100%;
}

.imei-field__control input {
  width: 100%;
  padding-right: 2.5rem;
}

.imei-field__camera {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transform: translateY(-50%);
}

.imei-field__camera:hover {
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  color: var(--foreground);
}

.imei-field__camera .icon {
  width: 1rem;
  height: 1rem;
}

/* Legacy row wrapper (kept for older markup) */
.imei-field__row {
  display: block;
}

.imei-field__input {
  min-width: 0;
}

.imei-field__add {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.imei-field__add:hover {
  text-decoration: underline;
}

.form-field[hidden],
.imei-field__add[hidden] {
  display: none !important;
}

.photo-capture-modal {
  /* Stay within the app/viewport floor — never wider than --app-min-width chrome. */
  width: min(100%, 520px, calc(100vw - 1.5rem));
  max-width: min(520px, calc(100vw - 1.5rem));
  min-width: 0;
  padding: 1rem;
  box-sizing: border-box;
}

.photo-capture-modal__video-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a0a;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  /* Prefer aspect ratio; avoid a tall min-height that forces overflow width. */
  min-height: 0;
}

.photo-capture-modal__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a0a;
}

.photo-capture-modal__video-wrap.is-square .photo-capture-modal__video {
  inset: auto;
  top: 0;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 1;
  max-width: 100%;
  transform: translateX(-50%);
  object-fit: cover;
}

.photo-capture-modal__video[hidden] {
  display: none !important;
}

.photo-capture-modal__video.is-live {
  display: block !important;
}

.photo-capture-modal__aspect {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.62);
  color: #fff;
  cursor: pointer;
}

.photo-capture-modal__aspect-icon {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-sizing: border-box;
}

.photo-capture-modal__aspect-icon[hidden] {
  display: none !important;
}

.photo-capture-modal__aspect-icon--full {
  width: 1.05rem;
  height: 0.7rem;
}

.photo-capture-modal__aspect-icon--square {
  width: 0.85rem;
  height: 0.85rem;
}

.photo-capture-modal__status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.photo-capture-modal__status[hidden] {
  display: none !important;
}

.photo-capture-modal__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0.35rem;
}

.photo-capture-modal__shutter {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}

.photo-capture-modal__shutter .icon {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  min-height: 1.45rem;
}

.photo-capture-modal__shutter:disabled {
  opacity: 0.4;
  cursor: default;
}

.imei-scan-modal {
  /* Match photo-capture: never exceed viewport / app usable width. */
  width: min(100%, 520px, calc(100vw - 1.5rem));
  max-width: min(520px, calc(100vw - 1.5rem));
  min-width: 0;
  padding: 1rem;
  box-sizing: border-box;
}

.imei-scan-modal__heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.3;
}

.imei-scan-modal__subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.imei-scan-modal__video-wrap {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: calc(var(--radius) + 2px);
  background: #ededed;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  /* Prefer aspect ratio; avoid a tall min-height that forces overflow width. */
  min-height: 0;
}

.imei-scan-modal__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
}

.imei-scan-modal__video[hidden] {
  display: none !important;
}

.imei-scan-modal__freeze {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
}

.imei-scan-modal__freeze[hidden] {
  display: none !important;
}

.imei-scan-modal__beam {
  position: absolute;
  left: 8%;
  right: 8%;
  z-index: 3;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  animation: imei-scan-beam 1.35s ease-in-out infinite;
}

.imei-scan-modal__beam[hidden] {
  display: none !important;
}

@keyframes imei-scan-beam {
  0% { top: 16%; }
  50% { top: 72%; }
  100% { top: 16%; }
}

@media (prefers-reduced-motion: reduce) {
  .imei-scan-modal__beam {
    animation: none;
    top: 46%;
  }
}

.imei-scan-modal__guide {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 46%;
  height: 32%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
  background:
    linear-gradient(#fff, #fff) left top / 16px 2px no-repeat,
    linear-gradient(#fff, #fff) left top / 2px 16px no-repeat,
    linear-gradient(#fff, #fff) right top / 16px 2px no-repeat,
    linear-gradient(#fff, #fff) right top / 2px 16px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 16px 2px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 2px 16px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 16px 2px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 2px 16px no-repeat;
}

.imei-scan-modal__hint {
  display: none;
}

.imei-scan-modal__status {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  color: var(--foreground);
  font-size: 0.8125rem;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
  pointer-events: none;
}

.imei-scan-modal__status::before {
  content: "";
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #a1a1a1;
}

.imei-scan-modal__scanned {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 550;
}

.imei-scan-modal__scanned[hidden] {
  display: none !important;
}

.imei-scan-modal__clear {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted-foreground);
  font: inherit;
  font-weight: 450;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.imei-scan-modal .modal__footer {
  justify-content: flex-end;
}

.imei-scan-modal__list {
  display: grid;
  gap: 0.4rem;
  max-height: 10rem;
  overflow: auto;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.imei-scan-modal__list > li {
  margin: 0;
  padding: 0;
  border: none;
}

.imei-scan-modal__item {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  box-shadow: none;
  transition: background 0.15s ease;
}

.imei-scan-modal__item:hover {
  background: color-mix(in srgb, var(--muted) 82%, var(--foreground));
}

.imei-scan-modal__item:focus,
.imei-scan-modal__item:focus-within {
  outline: none;
  box-shadow: none;
}

.imei-scan-modal__item.is-selected {
  background: var(--muted);
  box-shadow: none;
}

.imei-scan-modal__item input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 1.05rem;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--border);
  accent-color: var(--accent);
  outline: none !important;
}

.imei-scan-modal__item input:checked {
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.72rem 0.72rem;
  box-shadow: none;
}

.imei-scan-modal__item input:focus,
.imei-scan-modal__item input:focus-visible {
  outline: none !important;
  border: none;
  box-shadow: inset 0 0 0 1px var(--border);
}

.imei-scan-modal__item input:checked:focus,
.imei-scan-modal__item input:checked:focus-visible {
  box-shadow: none;
}

.imei-scan-modal__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.imei-scan-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.imei-scan-modal__photo {
  cursor: pointer;
  margin: 0;
}

.imei-scan-modal__photo input[type="file"] {
  display: none;
}

.imei-scan-modal__video.is-live {
  display: block !important;
}

.scan-camera-switch {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  max-width: calc(100% - 0.9rem);
}

.scan-camera-switch[hidden] {
  display: none !important;
}

.scan-camera-switch__toggle,
.scan-camera-switch__option {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.62);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
}

.scan-camera-switch__toggle {
  padding: 0.35rem 0.7rem;
}

.scan-camera-switch.is-busy .scan-camera-switch__toggle {
  opacity: 0.6;
}

.scan-camera-switch__menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  min-width: 7.5rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(10, 10, 10, 0.88);
}

.scan-camera-switch__menu[hidden] {
  display: none !important;
}

.scan-camera-switch__option {
  padding: 0.4rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  text-align: left;
}

.scan-camera-switch__option.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Stronger rim than cards so the top edge stays visible over page gray */
  border: 1px solid var(--pop-rim-strong);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

/* Horizontal overflow cues, gradient strip + chevron hugging the table edge. */
.table-scroll {
  position: relative;
  display: block;
  min-width: 0;
}

.table-scroll__edge {
  position: absolute;
  /* Cover the wrap border box so content cannot peek at the seam. */
  top: 0;
  bottom: 0;
  width: 1.65rem;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s linear;
}

.table-scroll__cue {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  margin-top: -0.75rem; /* pair with JS top = visible-center */
  pointer-events: none;
}

.table-scroll__cue svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: color-mix(in srgb, var(--foreground) 72%, var(--muted-foreground));
  filter: drop-shadow(0 0 1px color-mix(in srgb, var(--card) 85%, transparent));
}

.table-scroll__edge--left {
  left: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  /* Soft fade → solid outer 20%; darker than card so the cue reads clearly. */
  --table-scroll-edge-fill: color-mix(in srgb, var(--card) 81%, var(--foreground) 19%);
  background: linear-gradient(
    to left,
    transparent 0%,
    color-mix(in srgb, var(--table-scroll-edge-fill) 45%, transparent) 45%,
    var(--table-scroll-edge-fill) 80%,
    var(--table-scroll-edge-fill) 100%
  );
}

.table-scroll__edge--right {
  right: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  --table-scroll-edge-fill: color-mix(in srgb, var(--card) 81%, var(--foreground) 19%);
  background: linear-gradient(
    to right,
    transparent 0%,
    color-mix(in srgb, var(--table-scroll-edge-fill) 45%, transparent) 45%,
    var(--table-scroll-edge-fill) 80%,
    var(--table-scroll-edge-fill) 100%
  );
}

.table-scroll.is-scroll-left .table-scroll__edge--left,
.table-scroll.is-scroll-right .table-scroll__edge--right {
  opacity: 1;
}

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

.billing-doc-list {
  display: none;
}

.billing-doc-card {
  display: grid;
  gap: 0.75rem;
}

.billing-doc-card__top,
.billing-doc-card__bottom {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.billing-doc-card__meta {
  min-width: 0;
}

.billing-doc-card__meta p,
.billing-doc-card__amount p {
  margin: 0.2rem 0 0;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.pagination-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  font-size: 0.7rem; /* 80% of prior 0.875rem */
  line-height: 1.35;
}

.pagination-row__meta .muted {
  font-size: inherit;
}

.pagination-row__size {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: inherit;
}

.pagination-row__size .select,
.select.select-sm {
  width: auto;
  min-width: 4.5rem;
  padding: 0.3rem 1.75rem 0.3rem 0.55rem;
  font-size: 0.875rem;
}

/* Underline page-size control, no button chrome */
.pagination-row__size .select.select-sm,
.pagination-row__size .dd-dropdown--page-size .dd-trigger,
.pagination-row__size .dd-dropdown--sm.dd-dropdown--page-size .dd-trigger {
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  font-weight: 400;
  gap: 0.15rem;
}

.pagination-row__size .dd-dropdown {
  width: auto;
}

.pagination-row__size .dd-dropdown--page-size .dd-label {
  flex: 0 0 auto;
  font-size: inherit;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

.pagination-row__size .dd-dropdown--page-size .dd-caret {
  width: 0.7rem;
  height: 0.7rem;
  opacity: 0.7;
}

.pagination-row__size .dd-dropdown--page-size .dd-trigger:hover,
.pagination-row__size .dd-dropdown--page-size .dd-trigger:focus-visible {
  background: transparent;
  box-shadow: none;
}

.pagination-row__size .dd-dropdown--page-size .dd-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.pagination-row__size .dd-dropdown--page-size .dd-panel {
  min-width: 4.5rem;
  width: max-content;
}

.pagination-row__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-row__due {
  font-size: 0.875rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.table-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0 0 0.65rem;
}

.table-summary__due {
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}

.table-summary__due:hover strong,
.table-summary__due.is-active strong {
  text-decoration: underline;
}

.table-summary__due:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.export-history-section {
  padding: 0;
  overflow: hidden;
}

.card.export-history-section {
  padding: 0;
}

.export-history-section__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  min-height: 2.35rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.export-history-section__summary::-webkit-details-marker {
  display: none;
}

.export-history-section__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.export-history-section__label::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.export-history-section[open] > .export-history-section__summary .export-history-section__label::before {
  transform: rotate(45deg);
}

.export-history-section__title {
  font-weight: 600;
  font-size: 0.925rem;
  line-height: 1.2;
}

.export-history-section__summary .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.export-history-section__body {
  padding: 0;
  border-top: 1px solid var(--border);
}

.export-history-section__body .table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.export-history-section__body > .muted {
  margin: 0;
  padding: 0.65rem 0.75rem 0.75rem;
}

.export-history-section__hint {
  margin: 0;
  padding: 0.75rem 0.85rem 0.55rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--foreground);
}

.export-history-section__hint + .table-wrap {
  border-top: 1px solid var(--border);
}

.export-history-section__hint + .muted {
  padding-top: 0.35rem;
}

.export-history-section__body .card-desc {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
}

.export-history-table__dl {
  width: 2.25rem;
  padding-left: 0.45rem !important;
  padding-right: 0.15rem !important;
  text-align: center;
  vertical-align: middle;
}

.export-history-table__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  padding: 0;
  border: 1px solid #e4e4e4;
  border-radius: 0.4rem;
  background: #fff;
  color: #3f3f3f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.export-history-table__download:hover,
.export-history-table__download:focus-visible {
  color: var(--foreground);
  background: #fff;
  border-color: #d4d4d4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.export-history-table__download:active {
  background: #f4f4f4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.export-history-table__download .icon {
  width: 1rem;
  height: 1rem;
}

.export-history-table__download .btn__spinner {
  width: 0.85rem;
  height: 0.85rem;
}

.export-history-table__download.is-busy {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.export-history-table__download.is-busy .icon {
  display: none;
}

.export-history-table__download.is-busy .btn__spinner {
  display: inline-block;
}

.pagination-row__page {
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Shared image upload (logo, signature, gov ID, etc.) */
.image-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  text-align: left;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.image-picker__label {
  font-size: 0.875rem;
  font-weight: 500;
}

.image-picker .error {
  font-size: 0.8rem;
  color: var(--destructive);
}

.image-picker__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 9rem;
  padding: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 40%, transparent);
  box-sizing: border-box;
  /* Keep visible so the edit menu can open outside the card. */
  overflow: visible;
}

.image-picker__frame.has-image {
  border-style: solid;
  background: color-mix(in srgb, var(--muted, #f4f4f4) 22%, transparent);
}

.image-picker__preview {
  display: block;
  max-width: calc(100% - 0.25rem);
  max-height: calc(9rem - 1rem);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.image-picker__empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem;
  box-sizing: border-box;
}

.image-picker__frame.has-image .image-picker__empty {
  display: none;
}

.image-picker__placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: calc(var(--radius, 6px) - 1px);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 70%, transparent);
  color: var(--muted-foreground);
}

.image-picker__placeholder .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.image-picker__empty-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.image-picker__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  background: var(--background, #fff);
  color: var(--foreground);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  text-decoration: none;
  box-shadow: 0 1px 2px color-mix(in srgb, #000 6%, transparent);
}

.image-picker__chip .icon {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
}

.image-picker__chip:hover {
  background: color-mix(in srgb, var(--muted, #f4f4f4) 55%, var(--background, #fff));
}

.image-picker__enhance {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0.32rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--foreground) 12%, transparent);
  border-radius: var(--radius-pill, 999px);
  background: color-mix(in srgb, var(--background, #fff) 92%, transparent);
  color: var(--foreground);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  box-shadow: var(--pop-lift-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(8px);
}

.image-picker__frame.has-image .image-picker__enhance {
  display: inline-flex;
}

.image-picker__enhance .icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--pri, #3b82f6);
}

.image-picker__enhance:hover {
  border-color: color-mix(in srgb, var(--pri, #3b82f6) 40%, var(--border));
  background: var(--background, #fff);
}

.image-picker__enhance:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri, #3b82f6) 25%, transparent);
}

.image-picker__edit {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  display: none;
}

.image-picker__frame.has-image .image-picker__edit {
  display: block;
}

.image-picker__edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  appearance: none;
  box-shadow: none;
}

.image-picker__edit-btn .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.image-picker__edit-btn:hover,
.image-picker__edit-btn[aria-expanded="true"] {
  background: transparent;
  color: var(--muted-foreground);
}

.image-picker__menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 4;
  min-width: 8.5rem;
  padding: 0.25rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius, 6px);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
}

.image-picker__menu[hidden] {
  display: none !important;
}

.image-picker__menu-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: calc(var(--radius, 6px) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  appearance: none;
  text-decoration: none;
  box-sizing: border-box;
}

.image-picker__menu-item .icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  color: var(--muted-foreground);
}

.image-picker__menu-item:hover {
  background: color-mix(in srgb, var(--muted, #f4f4f4) 70%, transparent);
}

dialog.modal.image-refine-modal .modal__shell {
  width: min(40rem, calc(100vw - 1.5rem));
  max-width: 100%;
}

dialog.modal.image-refine-modal .modal__footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

dialog.modal.image-refine-modal .modal__footer .btn .icon {
  width: 0.95rem;
  height: 0.95rem;
}

dialog.modal.image-refine-modal .image-refine-modal__compare {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

dialog.modal.image-refine-modal .image-refine-modal__pane {
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: var(--radius, 6px);
  background: var(--card, #fff);
  min-width: 0;
}

dialog.modal.image-refine-modal .image-refine-modal__pane figcaption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
}

dialog.modal.image-refine-modal .image-refine-modal__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
  border-radius: calc(var(--radius, 6px) - 2px);
  overflow: hidden;
  background:
    linear-gradient(45deg, #ececec 25%, transparent 25%),
    linear-gradient(-45deg, #ececec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececec 75%),
    linear-gradient(-45deg, transparent 75%, #ececec 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #fafafa;
}

dialog.modal.image-refine-modal .image-refine-modal__pane img {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
}

dialog.modal.image-refine-modal .image-refine-modal__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  pointer-events: none;
}

dialog.modal.image-refine-modal .image-refine-modal__placeholder[hidden] {
  display: none !important;
}

dialog.modal.image-refine-modal .image-refine-modal__loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
  padding: 1rem;
  background: color-mix(in srgb, var(--background, #fff) 72%, transparent);
  backdrop-filter: blur(2px);
  color: var(--foreground);
  font-size: 0.85rem;
  font-weight: 500;
}

dialog.modal.image-refine-modal .image-refine-modal__loader[hidden] {
  display: none !important;
}

dialog.modal.image-refine-modal .image-refine-modal__spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid color-mix(in srgb, var(--pri, #3b82f6) 35%, transparent);
  border-top-color: var(--pri, #3b82f6);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

dialog.modal.image-refine-modal .image-refine-modal__media.is-busy img {
  opacity: 0.45;
}

dialog.modal.image-refine-modal .image-refine-modal__stages {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

dialog.modal.image-refine-modal .image-refine-modal__stages-label {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

dialog.modal.image-refine-modal .image-refine-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: var(--radius, 6px);
  background: var(--card, #fff);
  cursor: pointer;
  transition:
    border-color var(--ease, 0.15s ease),
    background var(--ease, 0.15s ease),
    box-shadow var(--ease, 0.15s ease);
}

dialog.modal.image-refine-modal .image-refine-stage:hover {
  border-color: color-mix(in srgb, var(--pri, #3b82f6) 30%, var(--border));
}

dialog.modal.image-refine-modal .image-refine-stage:has(input:checked) {
  border-color: color-mix(in srgb, var(--pri, #3b82f6) 42%, var(--border));
  background: color-mix(in srgb, var(--pri, #3b82f6) 6%, var(--card, #fff));
  box-shadow: var(--pop-lift-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

dialog.modal.image-refine-modal .image-refine-stage__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius, 6px) - 1px);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 80%, transparent);
  color: var(--foreground);
}

dialog.modal.image-refine-modal .image-refine-stage__icon .icon {
  width: 1.05rem;
  height: 1.05rem;
}

dialog.modal.image-refine-modal .image-refine-stage__copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

dialog.modal.image-refine-modal .image-refine-stage__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
}

dialog.modal.image-refine-modal .image-refine-stage__help {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

dialog.modal.image-refine-modal .image-refine-stage__switch {
  position: relative;
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted-foreground) 28%, transparent);
  flex: 0 0 auto;
  transition: background var(--ease, 0.15s ease);
}

dialog.modal.image-refine-modal .image-refine-stage__switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform var(--ease, 0.15s ease);
}

dialog.modal.image-refine-modal .image-refine-stage:has(input:checked) .image-refine-stage__switch {
  background: var(--pri, #3b82f6);
}

dialog.modal.image-refine-modal .image-refine-stage:has(input:checked) .image-refine-stage__switch::after {
  transform: translateX(1rem);
}

dialog.modal.image-refine-modal .image-refine-modal__status {
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  dialog.modal.image-refine-modal .image-refine-modal__compare {
    grid-template-columns: 1fr;
  }
}

/* Fullscreen zoomable image viewer */
.image-viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #0a0a0a;
  color: #fafafa;
}

.image-viewer::backdrop {
  background: #000;
}

.image-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.image-viewer__title {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer__tools {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.image-viewer__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: #fafafa;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.image-viewer__tool:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-viewer__close {
  font-size: 1.15rem;
  line-height: 1;
}

.image-viewer__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 3.35rem);
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
}

.image-viewer__stage.is-zoomed {
  cursor: grab;
}

.image-viewer__stage.is-zoomed:active {
  cursor: grabbing;
}

.image-viewer__img {
  max-width: min(100%, 1200px);
  max-height: calc(100vh - 5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

/* Legacy aliases */
.logo-picker-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  text-align: left;
  padding: 0;
}

.logo-picker-card > label:not(.logo-picker-action) {
  font-size: 0.875rem;
  font-weight: 500;
}

.logo-picker-card .error {
  font-size: 0.8rem;
  color: var(--destructive);
}

.logo-picker-card__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 6.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 40%, transparent);
  text-align: center;
  box-sizing: border-box;
}

.logo-picker-card__preview img {
  display: block;
  max-width: 100%;
  max-height: 5.5rem;
  object-fit: contain;
}

.logo-picker-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.logo-picker-action:hover {
  color: var(--foreground);
}

/* Organization information, calm grouped layout */
.org-info-form {
  gap: 0;
}

.settings-form-group {
  padding: 0.9rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border, #e4e4e4) 85%, transparent);
}

.settings-form-group:first-of-type {
  border-top: none;
  padding-top: 0.15rem;
}

.settings-form-group .address-fields {
  margin-bottom: 0;
}

.org-info-basics {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  max-width: 100%;
}

.org-info-basics__fields {
  min-width: 0;
  max-width: 100%;
}

.org-info-basics__fields .form-field {
  margin-bottom: 0;
  min-width: 0;
  max-width: 100%;
}

.org-info-basics__fields .form-field input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.org-info-basics__images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.org-info-basics__images .image-picker {
  min-width: 0;
  max-width: 100%;
}

.org-info-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 0.75rem;
}

@media (min-width: 640px) {
  .org-info-contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.org-info-contact-grid .form-field {
  margin-bottom: 0.75rem;
}

.org-info-form__actions {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #e4e4e4) 85%, transparent);
}

table.data {
  /* Fill the card; grow past 100% when columns need it (wrap scrolls). */
  width: 100%;
  min-width: max-content;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
  /*
   * Body row floor = product list (name + IMEI stack + cell padding).
   * Single-line tables inherit this height; taller content can grow past it.
   */
  --data-row-min-height: 2.7rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 1.25;
}

/* Product-list header height is the project default for every data table. */
table.data th,
table.data thead th {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  background: var(--table-header-bg);
  color: var(--table-header-fg);
  border-bottom: 1px solid var(--pop-rim-strong);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Bare tables (no .table-wrap) still need a top edge against page gray */
table.data thead tr:first-child th {
  border-top: 1px solid var(--pop-rim-strong);
}

.table-wrap table.data thead tr:first-child th {
  border-top: none;
}

table.data tbody td {
  height: var(--data-row-min-height);
  color: var(--foreground);
}

table.data td a {
  color: inherit;
}

/* Analytics sales table: no ellipsis truncation. */
table.data.table-analytics {
  table-layout: auto;
}

table.data.table-analytics th,
table.data.table-analytics td {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

table.data td.col-imei .col-imei__value {
  display: block;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/*
 * Auto layout so Name shrink-wraps to the IMEI line (no leftover gap).
 * Other columns take the remaining width of the 100% table.
 * Floor keeps narrow viewports scrollable instead of crushing columns.
 */
table.data.table-products {
  table-layout: auto;
  min-width: max(max-content, 40rem);
}

table.data.table-products .table-products__col-sku {
  width: 8.5rem;
}

table.data.table-products .table-products__col-stock {
  width: 5.5rem;
}

table.data.table-products .table-products__col-buy {
  width: 6.5rem;
}

table.data.table-products th.col-product-buy,
table.data.table-products td.col-product-buy {
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  row-gap: 0.65rem;
  align-items: center;
}

.stock-layout > .stock-toggle {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.stock-layout > #product-results {
  display: contents;
}

.stock-layout .product-stock-value {
  grid-column: 1;
  grid-row: 1;
}

.stock-layout #product-results > :not(.product-stock-value) {
  grid-column: 1 / -1;
}

.stock-layout #product-results > script {
  display: none;
}

.product-stock-value {
  margin: 0;
  font-size: 0.9rem;
  color: var(--foreground);
  font-weight: 500;
}

html[data-stock-view="icons"] [data-stock-table],
html[data-stock-view="icons"] .product-results-skeleton__table {
  display: none;
}

html[data-stock-view="icons"] .pagination-row {
  display: none;
}

html:not([data-stock-view="icons"]) [data-stock-cards],
html:not([data-stock-view="icons"]) .product-results-skeleton__cards {
  display: none;
}

.stock-cards__infinite {
  grid-column: 1 / -1;
  min-height: 1px;
}

.stock-cards__infinite-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 0 0.35rem;
  font-size: 0.8rem;
}

.stock-cards__infinite-status[hidden] {
  display: none;
}

.stock-cards__infinite-skel {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
}

.stock-cards__infinite-sentinel {
  width: 100%;
  height: 1px;
}

.stock-toggle--icons .stock-toggle__option {
  gap: 0;
  padding: 0.28rem 0.5rem;
}

.stock-toggle--icons .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.stock-cards__toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
}

.stock-cards__select-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.stock-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.75rem, 1fr));
  gap: 0.75rem;
}

.stock-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.stock-card.is-selected {
  border-color: var(--pri);
  box-shadow: 0 0 0 1px var(--pri);
}

.stock-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.stock-card__link:hover,
.stock-card__link:focus,
.stock-card__link:focus-visible {
  color: inherit;
  text-decoration: none;
}

.stock-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.stock-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stock-card.is-out .stock-card__media img {
  opacity: 0.55;
}

.stock-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--muted);
  color: var(--muted-foreground);
}

.stock-card__placeholder .icon {
  width: 1.75rem;
  height: 1.75rem;
}

.stock-card__stock {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  min-width: 1.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(20, 20, 18, 0.86);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stock-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.6rem 0.55rem;
}

.stock-card__name {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stock-card__body .product-list-imei {
  width: auto;
}

.stock-card__sku,
.stock-card__created {
  margin: 0;
  font-size: 0.72rem;
}

.stock-card__select,
.stock-card__info {
  position: absolute;
  z-index: 2;
  top: 0.35rem;
}

.stock-card__select {
  left: 0.35rem;
}

.stock-card__info {
  right: 0.35rem;
}

.stock-card__info .product-info-btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.stock-card__info .product-info-btn svg {
  stroke-width: 1.15;
}

.stock-card__select button.product-row-action {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.4rem !important;
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}

.stock-cards button.product-row-select[aria-pressed="true"] svg rect,
.stock-cards [data-stock-select-all][data-state="all"] svg rect {
  fill: var(--pri);
  stroke: var(--pri);
}

.stock-cards button.product-row-select[aria-pressed="true"] svg path,
.stock-cards [data-stock-select-all][data-state="all"] svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  vector-effect: none;
}

.stock-card-skel {
  aspect-ratio: 1.15;
  border-radius: var(--radius);
}

.product-type-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

/* Joined type filter + add — reads as one control for the selected type. */
.product-type-combo {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  max-width: min(16rem, 58vw);
  border: 1px solid var(--pop-rim);
  border-radius: var(--radius-pill);
  background: var(--pop-raised);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  overflow: hidden;
}

.product-type-combo .select,
.product-type-combo .dd-dropdown {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  width: auto;
  max-width: none;
  height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Fill the stretched combo half so the label isn't top-pinned with empty space below. */
.product-type-combo .dd-dropdown {
  display: flex;
  align-items: stretch;
}

.product-type-combo .dd-trigger {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: calc(var(--control-height) - 2px);
  align-self: stretch;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0.55rem 0 0.75rem;
  line-height: 1;
}

.product-type-combo .dd-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}

.product-type-combo .dd-caret {
  display: block;
  margin: 0;
  flex-shrink: 0;
}

.product-type-combo .dd-trigger:hover,
.product-type-combo .dd-trigger:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--pop-well) 55%, transparent);
}

.product-type-combo__add {
  flex: none;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: auto;
  min-height: calc(var(--control-height) - 2px);
  margin: 0;
  padding: 0 0.7rem 0 0.55rem;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--pop-rim);
  border-radius: 0;
  box-shadow: none;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1;
}

.product-type-combo__add .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.product-type-combo__add:hover {
  transform: none;
  filter: brightness(1.03);
  box-shadow: none;
}

.product-type-toolbar__templates {
  flex: none;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .product-type-combo {
    max-width: min(12.75rem, 54vw);
  }

  .product-type-combo .dd-trigger {
    font-size: 0.85rem;
    padding-left: 0.65rem;
  }

  .product-type-combo__add {
    padding: 0 0.55rem 0 0.4rem;
  }

  .product-type-toolbar__templates {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    font-size: 0.72rem;
    max-width: 5.75rem;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
  }
}

.product-results-skeleton__value {
  margin: 0 0 0.65rem;
  height: 0.95rem;
}

.product-results-skeleton__table {
  margin-bottom: 0;
}

#product-results.is-loading {
  min-height: 16rem;
}

table.data.table-products .table-products__col-actions {
  width: 2rem;
}

table.data.table-products .table-products__col-created {
  width: 7.5rem;
}

table.data.table-products td {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

table.data.table-products th.col-product-name,
table.data.table-products td.col-product-name {
  width: auto;
  white-space: normal;
  overflow: visible;
  vertical-align: middle;
}

.product-list-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  white-space: nowrap;
}

.product-list-name__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  min-width: 0.95rem;
  min-height: 0.95rem;
  color: var(--muted-foreground);
}

.product-list-name__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.product-line__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.product-line .product-list-imei,
.product-line .supplier-combo__option-meta,
.product-line .muted {
  margin-left: 0;
}

.product-info {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
}

.product-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  padding: 0;
  border: 1px solid #e4e4e4;
  border-radius: 0.4rem;
  background: #fff;
  color: #3f3f3f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.product-info-btn:hover,
.product-info-btn:focus-visible {
  color: var(--foreground);
  background: #fff;
  border-color: #d4d4d4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.product-info-btn:active {
  background: #f4f4f4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.product-info-btn .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.product-info-btn svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-info-section-title {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.product-info-section-title + .detail-list {
  margin-top: 0.35rem;
}

.product-info-images {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-info-images:not(:last-child) {
  margin-bottom: 0.85rem;
}

.product-info-image {
  margin: 0;
}

.product-info-image img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--muted);
  cursor: zoom-in;
}

.product-info-image figcaption {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Left sheet. A step wider than the mobile account drawer (18rem). */
.modal.product-info-modal {
  --product-info-drawer-inset: 1.15rem;
  --product-info-drawer-shift: calc(100% + var(--product-info-drawer-inset) + 0.5rem);
  position: fixed;
  inset: auto;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  left: var(--product-info-drawer-inset);
  right: auto;
  margin: 0;
  width: min(22rem, calc(100vw - var(--product-info-drawer-inset) - 2.5rem));
  max-width: none;
  height: auto;
  max-height: none;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: none;
  scrollbar-width: none;
  transform: translateX(calc(-1 * var(--product-info-drawer-shift)));
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.modal.product-info-modal[open] {
  transform: translateX(0);
  box-shadow: 10px 8px 36px rgba(0, 0, 0, 0.16);
}

.modal.product-info-modal.is-closing {
  transform: translateX(calc(-1 * var(--product-info-drawer-shift)));
  box-shadow: none;
}

@starting-style {
  .modal.product-info-modal[open] {
    transform: translateX(calc(-1 * var(--product-info-drawer-shift)));
  }
}

.product-info-modal::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .modal.product-info-modal,
  .modal.product-info-modal[open],
  .modal.product-info-modal.is-closing {
    transition: none;
  }
}

.product-info-modal .modal__shell {
  height: 100%;
}

.product-info-modal .modal__body {
  overflow: hidden;
  scrollbar-width: none;
}

.product-info-modal .modal__body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.product-info-modal__body > .stock-toggle {
  align-self: flex-start;
  flex: 0 0 auto;
}

.product-info-modal__body > [data-product-info-panel] {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.product-info-modal__body > [data-product-info-panel]::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.product-list-imei {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: max-content;
  max-width: 100%;
  margin-top: 0.15rem;
  white-space: nowrap;
  font-size: 0.7rem;
  line-height: 1.3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.product-list-imei__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  min-width: 0.85rem;
  min-height: 0.85rem;
  color: var(--muted-foreground);
}

.product-list-imei__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-list-imei__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data.table-products th.col-product-actions,
table.data.table-products td.col-product-actions {
  width: 2rem;
  padding-left: 0.45rem;
  padding-right: 0;
  text-align: left;
  overflow: visible;
  vertical-align: middle;
}

table.data.table-products th.col-product-name,
table.data.table-products td.col-product-name {
  padding-left: 0.15rem;
}

table.data.table-products .product-line {
  gap: 0.2rem;
}

table.data.table-products .product-info-btn .icon,
table.data.table-invoice-lines .product-info-btn .icon,
table.data.table-invoice-returns .product-info-btn .icon,
.modal-sell .product-info-btn .icon {
  width: 1.1rem;
  height: 1.1rem;
}

table.data.table-products .product-info-btn svg,
table.data.table-invoice-lines .product-info-btn svg,
table.data.table-invoice-returns .product-info-btn svg,
.modal-sell .product-info-btn svg {
  stroke-width: 1.15;
}

/* Flat icon controls, match <a> icons; strip <button> UA chrome (border + fill). */
table.data.table-products td.col-product-actions .product-row-action,
table.data.table-products td.col-product-actions button.product-row-action,
table.data.table-products td.col-product-actions .product-invoice-icon,
table.data.table-products td.col-product-actions button.product-invoice-icon,
.product-row-action,
button.product-row-action,
.product-invoice-icon,
button.product-invoice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  outline: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--muted-foreground);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}

.product-row-action .icon,
.product-invoice-icon .icon {
  width: 1.05rem;
  height: 1.05rem;
  pointer-events: none;
}

.product-row-action:hover,
.product-row-action:focus,
.product-row-action:focus-visible,
.product-row-action:active,
button.product-row-action:hover,
button.product-row-action:focus,
button.product-row-action:focus-visible,
button.product-row-action:active,
.product-invoice-icon:hover,
.product-invoice-icon:focus,
.product-invoice-icon:focus-visible,
.product-invoice-icon:active {
  color: var(--foreground);
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.product-row-action--delete:hover,
.product-row-action--delete:focus,
.product-row-action--delete:focus-visible,
.product-row-action--delete:active,
button.product-row-action--delete:hover,
button.product-row-action--delete:focus,
button.product-row-action--delete:focus-visible,
button.product-row-action--delete:active {
  color: var(--destructive, #dc2626);
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.product-delete-modal {
  width: min(100%, 420px);
}

.product-row-select [data-icon] {
  display: none;
}

.product-row-select[aria-pressed="false"] [data-icon="off"],
.product-row-select[aria-pressed="true"] [data-icon="on"],
[data-stock-select-all][data-state="none"] [data-icon="none"],
[data-stock-select-all][data-state="some"] [data-icon="some"],
[data-stock-select-all][data-state="all"] [data-icon="all"],
[data-line-select-all][data-state="none"] [data-icon="none"],
[data-line-select-all][data-state="some"] [data-icon="some"],
[data-line-select-all][data-state="all"] [data-icon="all"],
[data-return-select-all][data-state="none"] [data-icon="none"],
[data-return-select-all][data-state="some"] [data-icon="some"],
[data-return-select-all][data-state="all"] [data-icon="all"],
[data-storefront-select-all][data-state="none"] [data-icon="none"],
[data-storefront-select-all][data-state="some"] [data-icon="some"],
[data-storefront-select-all][data-state="all"] [data-icon="all"] {
  display: inline-flex;
}

table.data.table-products button.product-row-select[aria-pressed="true"] svg rect,
table.data.table-products button.product-row-select[aria-pressed="true"]:hover svg rect,
table.data.table-products button.product-row-select[aria-pressed="true"]:focus svg rect,
table.data.table-products button.product-row-select[aria-pressed="true"]:active svg rect,
table.data.table-products [data-stock-select-all][data-state="all"] svg rect,
table.data.table-products [data-stock-select-all][data-state="all"]:hover svg rect,
table.data.table-products [data-stock-select-all][data-state="all"]:focus svg rect,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"] svg rect,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:hover svg rect,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:focus svg rect,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:active svg rect,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"] svg rect,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"]:hover svg rect,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"]:focus svg rect {
  fill: var(--pri);
  stroke: var(--pri);
}

table.data.table-products button.product-row-select[aria-pressed="true"] svg path,
table.data.table-products button.product-row-select[aria-pressed="true"]:hover svg path,
table.data.table-products button.product-row-select[aria-pressed="true"]:focus svg path,
table.data.table-products button.product-row-select[aria-pressed="true"]:active svg path,
table.data.table-products [data-stock-select-all][data-state="all"] svg path,
table.data.table-products [data-stock-select-all][data-state="all"]:hover svg path,
table.data.table-products [data-stock-select-all][data-state="all"]:focus svg path,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"] svg path,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:hover svg path,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:focus svg path,
table.data.storefront-manage-table button.product-row-select[aria-pressed="true"]:active svg path,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"] svg path,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"]:hover svg path,
table.data.storefront-manage-table [data-storefront-select-all][data-state="all"]:focus svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  vector-effect: none;
}

table.data tr.is-selected td {
  background: color-mix(in srgb, var(--pri) 10%, #fff);
}

.stock-selection-bar {
  position: fixed;
  z-index: 36;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: #1e1e1c;
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--pop-lift-modal);
}

.stock-selection-bar[hidden] {
  display: none;
}

.stock-selection-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.stock-selection-bar__btn .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.stock-selection-bar__btn:hover,
.stock-selection-bar__btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.stock-review-list {
  display: grid;
  gap: 0.35rem;
  max-height: min(50dvh, 18rem);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.stock-review-row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

li > .stock-review-row {
  cursor: pointer;
}

.stock-review-row.is-blocked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: #fef3c7;
  color: #92400e;
  cursor: default;
}

.stock-review-row__flag {
  flex: 0 0 auto;
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 600;
}

.stock-sell-review__footer {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .stock-selection-bar {
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 0.65rem);
  }
}

.product-invoices-modal {
  width: min(100%, 420px);
  padding: 1rem;
}

.product-invoices-modal__subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.product-invoices-modal__list {
  display: grid;
  gap: 0.4rem;
  max-height: min(50dvh, 20rem);
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-invoices-modal__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.product-invoices-modal__item:hover {
  background: color-mix(in srgb, var(--muted) 82%, var(--foreground));
}

.product-invoices-modal__number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 500;
}

.product-invoices-modal__meta {
  font-size: 0.78rem;
}

.product-invoices-modal__empty {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

table.data th {
  font-weight: 550;
  color: var(--table-header-fg);
  background: var(--table-header-bg);
}

table.data thead th {
  background: var(--table-header-bg);
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tr.is-clickable {
  cursor: pointer;
}

table.data tr.is-clickable:hover td {
  background: var(--muted);
}

table.data tr.is-clickable:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

table.data th.col-actions,
table.data td.col-actions {
  width: 4.75rem;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* Form templates list fills its card. Name takes leftover width; Version and Fields stay compact. */
table.data.table-templates {
  width: 100%;
  min-width: 0;
}

table.data.table-templates th.col-actions,
table.data.table-templates td.col-actions,
table.data.table-templates th.col-shrink,
table.data.table-templates td.col-shrink {
  width: 1%;
  white-space: nowrap;
}

table.data.table-templates th.col-actions,
table.data.table-templates td.col-actions {
  padding-left: 0.35rem;
  padding-right: 0.15rem;
}

table.data.table-templates th,
table.data.table-templates td {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.template-row-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
}

.template-row-actions form {
  margin: 0;
  display: inline-flex;
}

.template-row-actions .icon-btn-sm,
.template-row-actions .icon-btn-sm:hover,
.template-row-actions .icon-btn-sm:focus,
.template-row-actions .icon-btn-sm:focus-visible {
  border: none;
  background: transparent;
  box-shadow: none;
  width: 1.65rem;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  color: var(--muted-foreground);
}

.template-row-actions .icon-btn-sm:hover,
.template-row-actions .icon-btn-sm:focus-visible {
  color: var(--foreground);
}

/* Org members / invites (Settings → Members)
 * Full-width when content fits; otherwise horizontal scroll (no ellipsis). */
.settings-section .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data.table-org-invites,
table.data.table-org-members {
  table-layout: auto;
}

table.data.table-org-invites th,
table.data.table-org-invites td,
table.data.table-org-members th,
table.data.table-org-members td {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

table.data.table-org-invites th.col-invite-actions,
table.data.table-org-invites td.col-invite-actions {
  width: 1%;
  padding-left: 0.35rem;
  padding-right: 0.25rem;
}

table.data.table-org-invites .invite-row-actions {
  justify-content: flex-start;
  gap: 0.15rem;
}

table.data.table-org-invites .invite-row-actions form {
  margin: 0;
  display: inline-flex;
}

table.data.table-org-invites .invite-row-actions .icon-btn-sm {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

table.data.table-org-invites .invite-row-actions .icon-btn-sm:hover:not(:disabled):not(.is-cooling) {
  background: transparent;
  color: var(--foreground);
}

table.data.table-org-invites .invite-resend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  min-width: 2rem;
  padding: 0 0.2rem;
}

table.data.table-org-invites .invite-resend-btn__cd {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1;
}

table.data.table-org-invites .invite-resend-btn.is-cooling,
table.data.table-org-invites .invite-resend-btn:disabled {
  min-width: 3.25rem;
  color: var(--muted-foreground);
  opacity: 0.45;
  cursor: default;
}

table.data.table-org-invites .invite-resend-btn.is-cooling:hover,
table.data.table-org-invites .invite-resend-btn:disabled:hover {
  background: transparent;
  color: var(--muted-foreground);
}

table.data.table-org-invites th:nth-child(3),
table.data.table-org-invites td:nth-child(3),
table.data.table-org-invites th:nth-child(4),
table.data.table-org-invites td:nth-child(4) {
  width: 1%;
}

table.data.table-org-members th.col-member-actions,
table.data.table-org-members td.col-member-actions {
  width: 1%;
  padding-left: 0.35rem;
  padding-right: 0.25rem;
}

table.data.table-org-members .member-remove-btn,
table.data.table-org-members .member-save-btn {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

table.data.table-org-members .member-remove-btn:hover:not(:disabled):not(.is-disabled),
table.data.table-org-members .member-save-btn:hover:not(:disabled):not(.is-disabled) {
  background: transparent;
  color: var(--foreground);
}

table.data.table-org-members .member-remove-btn:disabled,
table.data.table-org-members .member-remove-btn.is-disabled,
table.data.table-org-members .member-save-btn:disabled,
table.data.table-org-members .member-save-btn.is-disabled {
  color: var(--muted-foreground);
  opacity: 0.4;
  cursor: default;
}

table.data.table-org-members td.col-role {
  overflow: visible;
}

table.data.table-org-members .member-role-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

table.data.table-org-members .member-role-form .select,
table.data.table-org-members .member-role-form select,
table.data.table-org-members .member-role-form .dd-dropdown {
  width: auto;
  min-width: 5.5rem;
  max-width: 7rem;
  margin: 0;
}

table.data.table-org-members .member-role-form--locked .select,
table.data.table-org-members .member-role-form--locked select,
table.data.table-org-members .member-role-form--locked .dd-dropdown {
  opacity: 0.55;
  pointer-events: none;
}

/* Invoice detail: section title sits close to its table; more space between sections. */
.invoice-detail-section {
  gap: 0.3rem;
}

.stack > .invoice-detail-section + .invoice-detail-section {
  margin-top: 0.85rem;
}

/* Invoice detail lines: wrap scrolls horizontally when needed. */
table.data.table-invoice-lines {
  table-layout: auto;
}

table.data.table-invoice-lines tbody tr[data-select-row],
table.data.table-invoice-returns tbody tr[data-select-row] {
  cursor: pointer;
}

/* Multi-line name/IMEI cells: tight padding; row height comes from --data-row-min-height. */
table.data.table-invoice-lines td {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

table.data.table-invoice-lines col.col-line-select,
table.data.table-invoice-lines th.col-line-select,
table.data.table-invoice-lines td.col-line-select,
table.data.table-invoice-returns col.col-line-select,
table.data.table-invoice-returns th.col-line-select,
table.data.table-invoice-returns td.col-line-select {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0;
  text-align: left;
  vertical-align: middle;
  overflow: visible;
}

table.data.table-invoice-lines th.col-product,
table.data.table-invoice-lines td.col-product,
table.data.table-invoice-returns th.col-return-name,
table.data.table-invoice-returns td.col-return-name {
  padding-left: 0.15rem;
}

table.data.table-invoice-returns th.col-return-name:first-child,
table.data.table-invoice-returns td.col-return-name:first-child {
  padding-left: 0.75rem;
}

table.data.table-invoice-lines .product-line,
table.data.table-invoice-returns .product-line {
  gap: 0.2rem;
}

table.data.table-invoice-lines button.product-row-select[aria-pressed="true"] svg rect,
table.data.table-invoice-lines button.product-row-select[aria-pressed="true"]:hover svg rect,
table.data.table-invoice-lines button.product-row-select[aria-pressed="true"]:focus svg rect,
table.data.table-invoice-lines [data-line-select-all][data-state="all"] svg rect,
table.data.table-invoice-lines [data-line-select-all][data-state="all"]:hover svg rect,
table.data.table-invoice-lines [data-line-select-all][data-state="all"]:focus svg rect,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"] svg rect,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"]:hover svg rect,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"]:focus svg rect,
table.data.table-invoice-returns [data-return-select-all][data-state="all"] svg rect,
table.data.table-invoice-returns [data-return-select-all][data-state="all"]:hover svg rect,
table.data.table-invoice-returns [data-return-select-all][data-state="all"]:focus svg rect {
  fill: #181818;
  stroke: #181818;
}

table.data.table-invoice-lines button.product-row-select[aria-pressed="true"] svg path,
table.data.table-invoice-lines button.product-row-select[aria-pressed="true"]:hover svg path,
table.data.table-invoice-lines button.product-row-select[aria-pressed="true"]:focus svg path,
table.data.table-invoice-lines [data-line-select-all][data-state="all"] svg path,
table.data.table-invoice-lines [data-line-select-all][data-state="all"]:hover svg path,
table.data.table-invoice-lines [data-line-select-all][data-state="all"]:focus svg path,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"] svg path,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"]:hover svg path,
table.data.table-invoice-returns button.product-row-select[aria-pressed="true"]:focus svg path,
table.data.table-invoice-returns [data-return-select-all][data-state="all"] svg path,
table.data.table-invoice-returns [data-return-select-all][data-state="all"]:hover svg path,
table.data.table-invoice-returns [data-return-select-all][data-state="all"]:focus svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  vector-effect: none;
}

.invoice-bulk-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.invoice-bulk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  background: var(--muted);
}

.invoice-bulk-row__copy {
  min-width: 0;
}

.invoice-bulk-row__name {
  font-weight: 550;
}

.invoice-bulk-row__buy {
  margin-top: 0.1rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.invoice-bulk-row .input {
  width: 6.5rem;
  flex: 0 0 auto;
}

.invoice-remove {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.invoice-remove__items {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 0 1 auto;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.invoice-remove__pinned {
  flex: 0 0 auto;
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.invoice-remove__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  background: var(--muted);
}

.invoice-remove__copy {
  min-width: 0;
}

.invoice-remove__name {
  font-weight: 550;
}

.invoice-remove__meta {
  margin-top: 0.1rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.invoice-remove__amount {
  font-weight: 600;
  white-space: nowrap;
}

.invoice-remove__facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.invoice-remove__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.invoice-remove__facts dt {
  margin: 0;
  color: var(--muted-foreground);
  font-weight: 400;
}

.invoice-remove__facts dd {
  margin: 0;
  text-align: right;
  font-weight: 550;
}

.invoice-remove__before {
  color: var(--muted-foreground);
  font-weight: 500;
}

.invoice-remove__arrow {
  margin: 0 0.2rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.invoice-remove__refund {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.invoice-remove__refund[hidden] {
  display: none !important;
}

.invoice-remove__refund legend {
  margin: 0 0 0.1rem;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
}

.invoice-remove__choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: var(--control-font-size);
  cursor: pointer;
}

.invoice-remove__choice:has(input:checked) {
  border-color: var(--foreground);
  background: var(--muted);
}

.invoice-remove__choice > span {
  flex: none;
  white-space: nowrap;
}

.invoice-remove__choice input[type="radio"] {
  margin: 0;
  accent-color: var(--foreground);
  flex: none;
}

.invoice-remove__choice input.invoice-remove__refund-input {
  display: none;
  width: 7.25rem;
  max-width: 100%;
  flex: 0 1 7.25rem;
  min-width: 5.5rem;
  height: calc(var(--control-height) - 2px);
  min-height: 0;
  padding: 0 0.45rem;
  text-align: right;
  background: #fff;
}

.invoice-remove__choice:has(input[type="radio"]:checked) input.invoice-remove__refund-input {
  display: block;
}

table.data.table-invoice-lines col.col-return {
  width: 4.2rem;
}

table.data.table-invoice-lines th.col-return,
table.data.table-invoice-lines td.col-return {
  width: 4.2rem;
  padding-left: 0.2rem;
  padding-right: 0.1rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
}

.invoice-line-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
}

.invoice-line-return {
  display: inline-flex;
  margin: 0;
}

.invoice-line-return__btn {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

.invoice-line-return__btn:hover:not(:disabled):not(.is-disabled) {
  border: none;
  background: transparent;
  color: var(--foreground);
}

.invoice-line-return__btn:disabled,
.invoice-line-return__btn.is-disabled {
  color: #c6c6c6;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

table.data.table-invoice-lines tr.is-returned td {
  color: var(--foreground);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 70%, transparent);
}

table.data.table-invoice-lines tr.is-returned td.sell-price--at-or-below-cost {
  color: var(--destructive, #b91c1c);
}

table.data.table-invoice-lines tr.is-returned a {
  color: inherit;
}

.invoice-line-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.invoice-line-qty__mark {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted-foreground);
}

.modal.modal-confirm {
  width: min(100%, 26rem);
  height: fit-content;
  max-height: none;
}

.modal.modal-confirm[open] {
  display: block;
}

.modal.modal-confirm .modal__shell {
  flex: none;
  max-height: none;
  height: auto;
  overflow: visible;
}

.modal.modal-confirm .modal__body {
  flex: none;
  overflow: visible;
}

.modal.modal-confirm .modal__footer {
  justify-content: flex-end;
}

/* Return confirm: hug content; scroll the item list only when needed. */
#invoice-return-modal.modal.modal-confirm {
  max-height: min(92vh, 760px);
  height: fit-content;
}

#invoice-return-modal.modal.modal-confirm[open] {
  display: flex;
  flex-direction: column;
}

#invoice-return-modal .modal__shell {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  height: auto;
  overflow: hidden;
}

#invoice-return-modal .modal__body.invoice-remove {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}

#invoice-return-modal .invoice-remove__items {
  max-height: min(40vh, 16rem);
}

.modal.invite-email-mismatch {
  width: min(100%, 22rem);
}

.invite-mismatch-header {
  align-items: center;
}

.invite-mismatch-org {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.invite-mismatch-org__logo {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--muted);
}

.invite-mismatch-org__logo--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.invite-mismatch-org__text {
  min-width: 0;
}

.invite-mismatch-org__name {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-foreground);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-mismatch-org__text .card-title {
  margin: 0;
  color: var(--foreground);
}

.invite-mismatch-details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.invite-mismatch-details__row {
  margin: 0;
}

.invite-mismatch-details__row dt {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.invite-mismatch-details__row dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--foreground);
  word-break: break-word;
  line-height: 1.35;
}

.modal.invite-email-mismatch .modal__footer {
  gap: 0.5rem;
}

.modal.invite-email-mismatch .modal__footer form {
  margin: 0;
}

/*
 * Fixed layout, full card width.
 * Name gets the largest share (IMEI); price/qty/sku share the rest.
 */
table.data.table-invoice-lines col.col-product {
  width: 34%;
}

table.data.table-invoice-lines col.col-sell,
table.data.table-invoice-lines col.col-list,
table.data.table-invoice-lines col.col-total {
  width: 13%;
}

table.data.table-invoice-lines col.col-qty {
  width: 7%;
}

table.data.table-invoice-lines col.col-sku {
  width: 14%;
}

table.data.table-invoice-lines th.col-sku,
table.data.table-invoice-lines td.col-sku {
  white-space: nowrap;
}

table.data.table-invoice-lines th.col-product,
table.data.table-invoice-lines td.col-product {
  white-space: normal;
  vertical-align: middle;
  overflow: visible;
}

table.data.table-invoice-lines td.col-product > a,
table.data.table-invoice-lines td.col-product > .product-list-name {
  display: flex;
  white-space: nowrap;
}

table.data.table-invoice-lines td.col-product .product-list-imei {
  display: flex;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
}

table.data.table-invoice-lines th.col-qty,
table.data.table-invoice-lines td.col-qty {
  white-space: nowrap;
  text-align: left;
}

table.data.table-invoice-lines th.col-list,
table.data.table-invoice-lines td.col-list,
table.data.table-invoice-lines th.col-sell,
table.data.table-invoice-lines td.col-sell,
table.data.table-invoice-lines th.col-total,
table.data.table-invoice-lines td.col-total {
  white-space: nowrap;
}

.invoice-line-imei {
  display: block;
  width: max-content;
  font-size: 0.7rem;
  line-height: 1.3;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: visible;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Invoice list: show full invoice numbers, widen table instead of trimming. */
table.data.table-invoices {
  table-layout: auto;
}

table.data.table-invoices th,
table.data.table-invoices td {
  overflow: visible;
  text-overflow: clip;
}

table.data.table-invoices th:first-child,
table.data.table-invoices td:first-child {
  width: 1%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.data.table-invoices th.col-customer {
  position: relative;
  overflow: visible;
}

.table-wrap.is-filter-open {
  overflow: visible;
}

.th-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  max-width: 100%;
}

.th-filter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  appearance: none;
  vertical-align: middle;
}

.th-filter__btn .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.th-filter__btn:hover,
.th-filter__btn[aria-expanded="true"] {
  color: var(--foreground);
  background: color-mix(in srgb, var(--muted) 88%, var(--foreground));
}

.th-filter__btn.is-active {
  color: var(--foreground);
  background: color-mix(in srgb, var(--muted) 70%, var(--foreground));
}

.th-filter__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(18rem, 70vw);
  max-height: 18rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.4rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-dropdown);
  font-weight: 400;
  color: var(--foreground);
  white-space: normal;
}

.th-filter__panel[hidden] {
  display: none;
}

.th-filter__search {
  margin: 0 0 0.3rem;
}

.th-filter__search .input {
  width: 100%;
  min-height: 2rem;
  font-size: 0.8rem;
}

.th-filter__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.th-filter__option:hover,
.th-filter__option:focus-visible {
  background: var(--muted);
  outline: none;
}

.th-filter__option.is-selected {
  background: color-mix(in srgb, var(--muted) 82%, var(--foreground));
}

.th-filter__option[hidden] {
  display: none;
}

.th-filter__option-title {
  font-weight: 550;
}

.th-filter__option-meta {
  font-size: 0.75rem;
}

.th-filter__empty {
  margin: 0.35rem 0.35rem 0.15rem;
  font-size: 0.8rem;
}

table.data.table-invoices .table-empty-row td {
  text-align: center;
  white-space: normal;
  color: var(--muted-foreground);
}

table.data.table-invoice-payments {
  table-layout: auto;
}

/* Payments ledger fits the card. Notes wrap, so a short row does not scroll sideways. */
table.data.table-invoice-payments:not(.table-invoice-returns) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.invoice-detail-section .table-wrap:has(> table.table-invoice-payments:not(.table-invoice-returns)) {
  overflow-x: hidden;
}

/* Empty state: keep full wrap width so text-align:center is viewport-centered. */
table.data.table-invoice-payments:has(.table-empty-row) {
  min-width: 100%;
  width: 100%;
}

table.data.table-invoice-payments .col-when {
  width: 9.5rem;
  white-space: nowrap;
}

table.data.table-invoice-payments:not(.table-invoice-returns) .col-when {
  width: 38%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data.table-invoice-payments .col-amount {
  width: 9rem;
  white-space: nowrap;
}

table.data.table-invoice-payments:not(.table-invoice-returns) .col-amount {
  width: 26%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data.table-invoice-payments .col-note {
  width: auto;
  min-width: 10rem;
}

table.data.table-invoice-payments:not(.table-invoice-returns) .col-note {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

table.data.table-invoice-payments:not(.table-invoice-returns) .payment-add-section,
table.data.table-invoice-payments:not(.table-invoice-returns) .payment-add-section__body,
table.data.table-invoice-payments:not(.table-invoice-returns) tfoot .input,
table.data.table-invoice-payments:not(.table-invoice-returns) tfoot input {
  min-width: 0;
  max-width: 100%;
}

table.data.table-invoice-payments .table-empty-row td {
  text-align: center;
  white-space: normal;
  padding: 0.85rem 0.75rem;
  font-size: 0.875rem;
}

/* Returns: same non-truncating Name/IMEI treatment as invoice lines. */
table.data.table-invoice-returns {
  table-layout: auto;
}

table.data.table-invoice-returns th.col-return-action,
table.data.table-invoice-returns td.col-return-action {
  width: 2.75rem;
  text-align: center;
  overflow: visible;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

table.data.table-invoice-returns th.col-return-name,
table.data.table-invoice-returns td.col-return-name {
  width: auto;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
}

table.data.table-invoice-returns th.col-qty,
table.data.table-invoice-returns td.col-qty {
  white-space: nowrap;
}

table.data.table-invoice-payments tfoot td {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 65%, transparent);
}

table.data.table-invoice-payments tfoot tr.payment-add-row td {
  padding: 0.65rem 0.75rem;
  background: var(--card);
  white-space: normal;
  overflow: visible;
}

table.data.table-invoice-payments tfoot tr.payment-add-row--muted td {
  color: var(--muted-foreground);
}

.invoice-payments-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.invoice-payments-header .card-title {
  margin: 0;
}

.invoice-summary {
  padding: 0.9rem 1rem 1rem;
}

.invoice-summary .card-title {
  margin: 0 0 0.85rem;
}

.invoice-summary__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 1.25rem;
  margin: 0;
}

@media (max-width: 860px) {
  .invoice-summary__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 0.65rem;
  }

  .invoice-summary dd {
    font-size: 0.95rem;
  }

  .invoice-summary__item--total dd {
    font-size: 1.05rem;
  }
}

.invoice-summary__grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.invoice-summary dt {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-summary dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.invoice-summary__item--total dd {
  font-size: 1.25rem;
}

.invoice-summary__due-date dd {
  font-size: 0.95rem;
  white-space: nowrap;
}

.invoice-summary__item--refunded {
  grid-column: 3;
  grid-row: 3;
}

.payment-amount {
  position: relative;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Hang the minus left of the figure so ₹ stays column-aligned with payments. */
.payment-amount__sign {
  position: absolute;
  right: 100%;
  top: 0;
  padding-right: 0.05rem;
  color: inherit;
}

table.data.table-invoice-payments tr.is-refund td.col-amount {
  color: var(--muted-foreground);
  overflow: visible;
}

.payment-amount__control {
  position: relative;
}

.payment-amount__control .input {
  width: 100%;
  padding-right: 4.75rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

.payment-amount__control .input::-webkit-outer-spin-button,
.payment-amount__control .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.payment-amount__due {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  height: 1.45rem;
  padding: 0 0.5rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.payment-amount__due:hover {
  background: color-mix(in srgb, var(--muted) 70%, var(--foreground) 8%);
}

.payment-add-section {
  margin: 0;
  max-width: none;
  border: none;
  background: transparent;
  overflow: visible;
}

.payment-add-section__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  min-height: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.payment-add-section__summary::-webkit-details-marker {
  display: none;
}

.payment-add-section__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.925rem;
  line-height: 1.2;
  color: var(--foreground);
}

.payment-add-section__label::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.payment-add-section[open] > .payment-add-section__summary .payment-add-section__label::before {
  transform: rotate(45deg);
}

.payment-add-section__body {
  padding: 0.75rem 0 0;
  max-width: 28rem;
}

#invoice-payment-form.stack {
  gap: 0.65rem;
}

#invoice-payment-form > .form-field {
  margin-bottom: 0;
}

#payment-add-note {
  margin: 0;
  align-self: flex-start;
}

#payment-add-note[hidden],
#payment-note-field[hidden] {
  display: none !important;
}

table.data .row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--pri) 16%, var(--pop-rim));
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pop-text);
  text-transform: lowercase;
  box-shadow: var(--pop-shine);
}

.toast-region {
  /* Popover top-layer above normal page content. */
  position: fixed;
  inset: unset;
  top: auto;
  left: 50%;
  right: auto;
  bottom: max(6.5rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
  z-index: 2147483645;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.4rem;
  width: min(22.5rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: none;
  color: inherit;
}

.toast-region:popover-open {
  display: flex !important;
}

/* Hosted inside an open modal dialog so toasts are not inert. */
.toast-region.toast-region--in-dialog {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 4.5rem;
  z-index: 400;
  width: min(22.5rem, calc(100% - 1.25rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  --toast-bg: #000;
  --toast-fg: #f4f4f4;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  min-height: 1.85rem;
  padding: 0.3rem 0.4rem 0.3rem 0.55rem;
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--toast-bg);
  color: var(--toast-fg);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 16px 40px rgba(0, 0, 0, 0.28);
  font-size: 0.8125rem;
  line-height: 1.25;
  cursor: grab;
  opacity: 0;
  transform: translateY(0.55rem);
  transition: opacity 180ms ease, transform 180ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.toast.is-dragging {
  cursor: grabbing;
  transition: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-leaving {
  opacity: 0;
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--toast-icon, #e4e4e4);
}

.toast__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast__body {
  margin: 0;
  padding: 0;
  word-break: break-word;
  color: var(--toast-fg);
}

.toast__meta {
  display: flex;
  align-items: center;
}

.toast__close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toast__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 1px;
}

.toast__timer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.toast__timer-track {
  stroke: currentColor;
  stroke-opacity: 0.28;
  stroke-width: 2.5;
}

.toast__timer-progress {
  stroke: currentColor;
  stroke-opacity: 0.9;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: none;
}

.toast__close-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 0.7rem;
  height: 0.7rem;
  color: inherit;
  opacity: 0.8;
}

.toast__close:hover .toast__close-icon {
  opacity: 1;
}

.toast__close-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast--success {
  --toast-icon: #86efac;
}

.toast--error {
  --toast-icon: #fca5a5;
}

.toast--warning {
  --toast-icon: #fcd34d;
}

.toast--info {
  --toast-icon: #93c5fd;
}

.btn-lg {
  height: 2.4rem;
  padding: 0 1.1rem;
  font-size: 0.9rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(100%, 420px);
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.auth-card .sub {
  margin: 0 0 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.workspace-chooser {
  width: min(100%, 58rem);
}

.workspace-chooser__heading {
  text-align: center;
}

.workspace-chooser__title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.workspace-chooser__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.workspace-card {
  margin: 0;
  min-height: 11rem;
  border: 1px solid var(--pop-rim, var(--border));
  border-radius: var(--radius-lg, 20px);
  background: var(--card);
  box-shadow: var(--pop-lift, var(--shadow)), var(--pop-shine, none);
  overflow: hidden;
}

.workspace-card__hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 11rem;
  margin: 0;
  padding: 1.75rem 1.25rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.workspace-card__hit:hover {
  background: color-mix(in srgb, var(--muted, #f4f4f4) 70%, transparent);
}

.workspace-card__hit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 25%, transparent);
}

.workspace-card__name {
  display: block;
  font-size: clamp(1.65rem, 3.2vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--foreground);
}

.workspace-card__desc {
  display: block;
  max-width: 16rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

/* --- Landing (marketing) --- */
/* Welcome page styles live in ui/css/landing-tpb.css (loaded from the template). */

@keyframes landing-rise {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes landing-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.55rem);
  }
}

/* --- Auth split layout --- */
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.auth-visual {
  position: relative;
  background:
    radial-gradient(ellipse 70% 55% at 20% 15%, color-mix(in srgb, var(--pri) 38%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, #1e1e1c 0%, #2a2a28 55%, #1e1e1c 100%);
  color: #f4f4f4;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.auth-visual-inner {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  animation: landing-rise 0.65s ease-out both;
}

.auth-visual-brand {
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  margin-bottom: 0.85rem;
}

.auth-visual-brand .brand {
  padding: 0;
  font-size: inherit;
  font-weight: 700;
  color: inherit;
  letter-spacing: inherit;
}

.auth-visual-brand .brand__icon {
  width: 1.15em;
  height: 1.15em;
}

.auth-visual-line {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(244, 244, 245, 0.78);
}

.auth-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.auth-orb-1 {
  width: 18rem;
  height: 18rem;
  top: -4rem;
  right: -3rem;
  animation: landing-float 9s ease-in-out infinite;
}

.auth-orb-2 {
  width: 10rem;
  height: 10rem;
  bottom: 18%;
  right: 18%;
  background: color-mix(in srgb, var(--pri) 28%, transparent);
  animation: landing-float 7s ease-in-out 0.5s infinite;
}

.auth-orb-3 {
  width: 4.5rem;
  height: 4.5rem;
  top: 35%;
  left: 12%;
  background: rgba(255, 255, 255, 0.06);
  animation: landing-float 6s ease-in-out 0.2s infinite;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--pri) 8%, transparent) 0%, transparent 50%),
    var(--pop-bg, #eef0f3);
}

.auth-panel-inner {
  width: min(100%, 24rem);
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--pop-rim, var(--border));
  border-radius: var(--radius-xl, 28px);
  box-shadow: var(--pop-lift-modal, var(--shadow)), var(--pop-shine, none);
  animation: landing-rise 0.55s ease-out 0.05s both;
}

.auth-panel-inner h1 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.auth-panel-inner .sub {
  margin: 0 0 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.auth-mobile-brand .brand {
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.auth-footer {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.auth-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-invite-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
  min-width: 0;
}

.auth-invite-header__logo {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--muted);
}

.auth-invite-header__logo--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.auth-invite-header__text {
  min-width: 0;
}

.auth-invite-header__eyebrow {
  margin: 0 0 0.1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.auth-invite-header__org {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-footer--invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.auth-text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.auth-text-btn:hover {
  color: var(--foreground);
}

.form-field .help .auth-text-btn {
  font-size: 0.8rem;
}

.invite-wrong-email__copy {
  margin: 0;
  color: var(--foreground);
  line-height: 1.45;
}

.invite-verify-gate {
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.auth-panel-inner .sub strong {
  font-weight: 600;
  color: var(--foreground);
  word-break: break-word;
}

.invite-verify-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

#invite-resend-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-google-block {
  margin: 0 0 1rem;
}

.auth-google {
  width: 100%;
  color: var(--foreground);
}

.auth-google:hover {
  color: var(--foreground);
}

.auth-panel-inner .stack > .btn {
  width: 100%;
}

.auth-panel-inner .auth-ghost-btn {
  border-color: var(--border);
  color: var(--foreground);
}

.auth-panel-inner .auth-ghost-btn:hover {
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-forgot {
  margin: -0.35rem 0 0;
  font-size: 0.85rem;
  text-align: right;
}

.auth-forgot a {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot a:hover {
  color: var(--foreground);
}

.auth-footer--switch {
  margin-top: 1.1rem;
  text-align: center;
}

.auth-footer--switch a {
  font-weight: 600;
  color: var(--foreground);
}

/* Auth forms: shared field spacing (signup + login). */
[data-signup-form].stack,
[data-login-form].stack {
  gap: 0.85rem;
}

[data-signup-form] .form-field,
[data-login-form] .form-field {
  margin-bottom: 0;
  gap: 0.3rem;
}

[data-signup-form] .legal-consent {
  margin: 0.2rem 0 0.1rem;
}

[data-login-form] .auth-forgot {
  margin: -0.15rem 0 0;
}

.auth-field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0;
}

.auth-field__label-row label {
  margin: 0;
}

.auth-field__hint {
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--muted-foreground);
  font-weight: 500;
}

.auth-field__hint--status.is-warn {
  color: #c2410c;
}

.auth-field__hint--status.is-ok {
  color: #15803d;
}

.auth-field__control {
  position: relative;
  display: block;
}

.auth-field__control > input {
  padding-right: 2.15rem;
}

.auth-field__control--with-eye > input {
  padding-right: 2.35rem;
}

.auth-field__control--password > input {
  padding-right: 4.1rem;
}

.auth-field__status {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  color: #15803d;
  pointer-events: none;
}

/* display:inline-flex above beats the UA [hidden] rule. */
.auth-field__status[hidden] {
  display: none !important;
}

.auth-field__status .icon {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  min-height: 1.05rem;
}

.auth-field__status--spin {
  right: 2.35rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid color-mix(in srgb, #c2410c 35%, transparent);
  border-top-color: #c2410c;
  border-radius: 50%;
  color: transparent;
  /* Keep vertical centering while rotating (btn-spin alone drops translateY). */
  animation: auth-field-spin 0.7s linear infinite;
}

@keyframes auth-field-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.auth-field__eye {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm, 10px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.auth-field__eye:hover,
.auth-field__eye:focus-visible {
  color: var(--foreground);
  outline: none;
}

.auth-field__eye .icon {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
}

/* .icon { display: inline-flex } beats the browser's [hidden] rule. */
.auth-field__eye .icon[hidden] {
  display: none !important;
}

.auth-field__inline-help {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  margin: 0;
  white-space: nowrap;
}

.auth-pass-reqs {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
  padding: 0;
}

.auth-pass-reqs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: var(--pop-well, #eef0f3);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.auth-pass-reqs__item.is-met {
  background: color-mix(in srgb, #16a34a 14%, #ffffff);
  color: #15803d;
}

.auth-pass-reqs__icon {
  position: relative;
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
}

.auth-pass-reqs__dot {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0.15rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.7;
}

.auth-pass-reqs__check {
  display: none;
  width: 0.85rem;
  height: 0.85rem;
  min-width: 0.85rem;
  min-height: 0.85rem;
}

.auth-pass-reqs__item.is-met .auth-pass-reqs__dot {
  display: none;
}

.auth-pass-reqs__item.is-met .auth-pass-reqs__check {
  display: inline-flex;
}

.email-verify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--border));
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.4;
}

.email-verify-banner__text {
  flex: 1 1 12rem;
  min-width: 0;
}

.email-verify-banner__addr {
  font-weight: 600;
  word-break: break-all;
}

.email-verify-banner__action {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-mobile-brand {
    display: block;
  }

  .auth-panel {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    overflow-y: auto;
    padding: 1.25rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  }

  .auth-panel-inner {
    margin-block: auto;
  }
}

.muted {
  color: var(--muted-foreground);
}

.field-grid {
  display: grid;
  gap: 0.75rem;
}

.gov-id-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gov-id-pair {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.field-row-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  background: var(--card);
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.field-row-card.is-collapsed {
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.field-row-card.is-collapsed:hover {
  background: color-mix(in srgb, var(--muted, #f4f4f4) 55%, var(--card));
}

.field-row-card.is-collapsed .field-row-head {
  margin-bottom: 0;
  min-height: 1.6rem;
  gap: 0.25rem;
}

.field-row-card.is-collapsed .field-row-collapse,
.field-row-card.is-collapsed .field-row-remove.icon-btn-sm,
.field-row-card.is-collapsed .field-row-drag-handle {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  margin: 0;
}

.field-row-card.is-collapsed .field-row-title {
  font-size: 0.8125rem;
}

.field-row-card.is-dragging {
  position: fixed;
  z-index: 60;
  margin: 0;
  opacity: 0.96;
  pointer-events: none;
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.28);
  border-color: var(--ring, var(--foreground));
  cursor: grabbing;
}

.field-row-placeholder {
  box-sizing: border-box;
  border: 1.5px dashed var(--ring, var(--foreground));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--muted, #f4f4f4) 70%, transparent);
  pointer-events: none;
}

/* Prevent page scroll while reordering on touch. */
body.is-field-row-dragging {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grabbing;
}

body.is-field-row-dragging * {
  cursor: grabbing !important;
}

.field-row-card.is-collapsed .field-row-body {
  display: none;
}

.field-row-head__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  flex-shrink: 0;
}

.field-row-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.2rem 0;
  padding: 0;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  flex-shrink: 0;
}

.field-row-collapse:hover {
  color: var(--foreground);
  background: var(--muted, rgba(0, 0, 0, 0.04));
}

.field-row-collapse .icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  /* Open = ^ ; collapsed = v (single transform, avoid nested svg rotate flicker). */
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.field-row-collapse .icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
}

.field-row-card.is-collapsed .field-row-collapse .icon {
  transform: rotate(180deg);
}

.field-row-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-row-title.is-placeholder {
  color: var(--muted-foreground);
  font-weight: 400;
}

.field-row-remove.icon-btn-sm {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

.field-row-remove.icon-btn-sm:hover {
  color: var(--destructive, #b91c1c);
  background: var(--muted, rgba(0, 0, 0, 0.04));
  border: none;
}

.field-row-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--muted-foreground);
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
  cursor: grab;
  /* Required so touch can drag instead of scrolling the page. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.field-row-drag-handle:hover {
  color: var(--foreground);
  background: var(--muted, rgba(0, 0, 0, 0.04));
}

.field-row-card.is-dragging .field-row-drag-handle {
  cursor: grabbing;
}

.field-row-drag-handle .icon,
.field-row-drag-handle svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: currentColor;
}

.field-row-help {
  margin-top: 0.65rem;
}

.field-row-help > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  user-select: none;
  width: fit-content;
}

.field-row-help > summary::-webkit-details-marker {
  display: none;
}

.field-row-help > summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  translate: 0 -0.05rem;
}

.field-row-help[open] > summary::before {
  transform: rotate(45deg);
  translate: 0 -0.15rem;
}

.field-row-help[open] > summary {
  margin-bottom: 0.4rem;
  color: var(--foreground);
}

.field-row-help .form-field {
  margin-bottom: 0;
}

.field-row-advanced {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field-measure {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.field-measure__amount {
  flex: 1 1 auto;
  min-width: 0;
}

.field-measure__unit {
  flex: 0 0 5.75rem;
}

.field-measure__unit .dd-dropdown,
.field-measure__unit select {
  width: 100%;
}

.field-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: start;
}

.field-row-fields > .form-field {
  margin-bottom: 0;
}

.field-row-fields > .form-field--grow {
  flex: 1 1 11rem;
  min-width: 10rem;
}

.field-row-fields > .form-field--compact {
  flex: 0 0 auto;
  /* Room for longest FieldType label ("multiselect") + caret. */
  min-width: 10.75rem;
}

.field-row-fields > .form-field--compact select,
.field-row-fields > .form-field--compact .select,
.field-row-fields > .form-field--compact .dd-dropdown {
  width: 100%;
  min-width: 10.75rem;
  max-width: none;
  field-sizing: content;
}

.field-row-fields > .form-field--compact .dd-panel {
  min-width: 100%;
  width: max-content;
}

.field-row-fields > .form-field--compact input[type="number"] {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 5.5rem;
  field-sizing: content;
}

.field-row-fields > .form-field--checkbox {
  flex: 0 0 auto;
  /* Skip sibling label row, then center beside the control height */
  padding-top: calc(0.875rem * 1.25 + 0.35rem);
}

.field-row-fields > .form-field--checkbox .checkbox-row {
  height: 2rem;
}

/* Legacy grid checkbox alignment (other forms) */
.field-row-card .field-grid > .form-field:has(.checkbox-row) {
  padding-top: calc(0.875rem * 1.25 + 0.35rem);
}

.field-row-card .field-grid > .form-field:has(.checkbox-row) .checkbox-row {
  height: 2rem;
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(244, 244, 245, 0.8);
  font-size: 0.875rem;
  line-height: 1.4;
}

.empty--with-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.75rem 1.25rem;
}

.empty--with-action .empty__message {
  margin: 0;
}

.empty--with-action .btn-lg {
  min-width: min(100%, 14rem);
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0 1.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input {
  width: auto;
  height: auto;
}

.modal.modal-org-setup {
  width: min(560px, calc(100% - 1.5rem));
  max-width: calc(100% - 1.5rem);
  /* fit-content keeps inset:0 from stretching the dialog to the viewport. */
  height: fit-content;
  max-height: min(92vh, 720px);
  border: none;
  border-radius: 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

.modal.modal-org-setup .modal__shell,
.modal.modal-org-setup .modal__body,
.modal.modal-org-setup .modal__footer {
  flex: none;
  height: auto;
  max-height: none;
}

.modal.modal-org-setup .modal__header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  border-bottom: none;
  padding: 1.35rem 1.5rem 0.25rem;
}

.modal.modal-org-setup .org-setup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal.modal-org-setup .org-setup-heading .card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--pop-body);
}

.modal.modal-org-setup .org-setup-meter {
  display: flex;
  gap: 0.4rem;
}

.modal.modal-org-setup .org-setup-meter[hidden] {
  display: none !important;
}

.modal.modal-org-setup .org-setup-meter > span {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: #e6e6e6;
}

.modal.modal-org-setup .org-setup-meter > span.is-filled {
  background: var(--foreground);
}

.modal.modal-org-setup .modal__body {
  overflow: visible;
  padding: 1rem 1.5rem 0.35rem;
}

.modal.modal-org-setup .modal__footer {
  justify-content: space-between;
  align-items: center;
  border-top: none;
  padding: 1rem 1.5rem 1.35rem;
  gap: 0.75rem;
}

.modal.modal-org-setup .org-setup-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.modal.modal-org-setup #org-setup-back[hidden] {
  display: none !important;
}

.modal.modal-org-setup .org-setup-step {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
}

.modal.modal-org-setup .org-setup-locked {
  margin: 0;
  line-height: 1.45;
}

.modal.modal-org-setup .org-setup-viewport[hidden],
.modal.modal-org-setup .org-setup-slide[hidden] {
  display: none !important;
}

.modal.modal-org-setup .org-setup-viewport {
  position: relative;
}

.modal.modal-org-setup .org-setup-viewport.is-sliding {
  overflow: hidden;
}

.modal.modal-org-setup .org-setup-slide.is-leaving {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
}

.modal.modal-org-setup .org-setup-slide.is-incoming {
  transform: translateX(105%);
}

.modal.modal-org-setup .org-setup-slide.is-incoming.is-from-left {
  transform: translateX(-105%);
}

.modal.modal-org-setup .org-setup-slide.is-leaving.is-off-left {
  transform: translateX(-105%);
}

.modal.modal-org-setup .org-setup-slide.is-leaving.is-off-right {
  transform: translateX(105%);
}

.modal.modal-org-setup .org-setup-slide.is-incoming.is-on,
.modal.modal-org-setup .org-setup-slide.is-leaving.is-off-left,
.modal.modal-org-setup .org-setup-slide.is-leaving.is-off-right {
  transition: transform 0.4s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.modal.modal-org-setup .org-setup-slide {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.35rem;
}

.modal.modal-org-setup .org-setup-slide--done {
  align-items: center;
}

.modal.modal-org-setup .org-setup-copy {
  display: grid;
  gap: 0.4rem;
}

.modal.modal-org-setup .org-setup-question {
  margin: 0;
  font-size: clamp(1.25rem, 3.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--pop-text);
}

.modal.modal-org-setup .org-setup-lead {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--pop-muted);
}

.modal.modal-org-setup .org-setup-slide__control {
  min-width: 0;
  display: grid;
  gap: 0.85rem;
}

.modal.modal-org-setup .org-setup-slide__control > .form-field,
.modal.modal-org-setup .org-setup-slide__control > .address-fields,
.modal.modal-org-setup .org-setup-slide__control > .org-setup-gov-image {
  margin-bottom: 0;
}

.modal.modal-org-setup .org-setup-slide__control > .form-field > label,
.modal.modal-org-setup .org-setup-gov-grid .form-field > label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--pop-muted);
}

.modal.modal-org-setup .org-setup-gov-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 520px) {
  .modal.modal-org-setup .org-setup-gov-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.modal.modal-org-setup .org-setup-gov-grid .form-field[hidden] {
  display: none !important;
}

.modal.modal-org-setup .org-setup-gov-image[hidden] {
  display: none !important;
}

.modal.modal-org-setup .org-setup-gov-image .image-picker {
  margin: 0;
}

.modal.modal-org-setup .org-setup-gov-image .image-picker__label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--pop-muted);
}

.modal.modal-org-setup .address-fields {
  margin: 0;
}

.modal.modal-org-setup .address-fields .form-field > label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--pop-muted);
}

.modal.modal-org-setup .form-field.is-attention > input,
.modal.modal-org-setup .form-field.is-attention > select,
.modal.modal-org-setup .form-field.is-attention > textarea,
.modal.modal-org-setup .form-field.is-attention .dd-trigger,
.modal.modal-org-setup .address-fields__control input.is-invalid,
.modal.modal-org-setup input.is-invalid,
.modal.modal-org-setup select.is-invalid,
.modal.modal-org-setup .image-picker.is-attention .image-picker__frame {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
}

.modal.modal-org-setup .org-setup-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.25rem 0.75rem 0.85rem;
  max-width: 22rem;
}

.modal.modal-org-setup.is-done .org-setup-heading .card-title {
  visibility: hidden;
}

.modal.modal-org-setup.is-done .org-setup-meter,
.modal.modal-org-setup.is-done .org-setup-step {
  display: none !important;
}

.modal.modal-org-setup.is-done .modal__footer {
  justify-content: center;
}

.modal.modal-org-setup.is-done .org-setup-nav {
  margin-left: 0;
}

@media (max-width: 720px) {
  .modal.modal-org-setup {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    height: fit-content;
    max-height: min(92vh, 720px);
    border-radius: 1.35rem;
  }

  .modal.modal-org-setup .modal__header {
    padding: 1.15rem 1.15rem 0.2rem;
  }

  .modal.modal-org-setup .modal__body {
    padding: 0.85rem 1.15rem 0.25rem;
  }

  .modal.modal-org-setup .modal__footer {
    padding: 0.85rem 1.15rem 1.15rem;
  }

  .modal.modal-org-setup .org-setup-slide {
    gap: 1.1rem;
  }

  .modal.modal-org-setup .org-setup-question {
    font-size: 1.25rem;
  }

  .modal.modal-org-setup .image-picker__frame {
    height: 6.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal.modal-org-setup .org-setup-slide.is-incoming.is-on,
  .modal.modal-org-setup .org-setup-slide.is-leaving.is-off-left,
  .modal.modal-org-setup .org-setup-slide.is-leaving.is-off-right {
    transition: none;
  }
}

.modal.modal-org-setup .org-setup-done__mark {
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  margin-bottom: 0.55rem;
  border-radius: 999px;
  background: #d8f3e3;
  color: #1f7a4c;
}

.modal.modal-org-setup .org-setup-done__mark .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.modal.modal-org-setup .org-setup-done__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--pop-text);
}

.modal.modal-org-setup .org-setup-done__body {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 450;
  line-height: 1.45;
  color: var(--pop-muted);
}

.modal {
  border: 1px solid var(--pop-rim);
  border-radius: var(--radius-xl);
  padding: 0;
  width: min(100%, 440px);
  max-width: calc(100vw - 1.5rem);
  min-width: 0;
  max-height: min(92vh, 760px);
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--pop-lift-modal), var(--pop-shine);
  background: var(--card);
  color: var(--card-foreground);
}

.modal[open],
.modal:popover-open {
  display: flex;
  flex-direction: column;
}

/* Freeze the page behind any open modal dialog (sell, confirm, etc.). */
html.modal-scroll-locked,
html.modal-scroll-locked body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.modal-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

/* Stack IMEI scan above an already-open sell dialog (Popover top layer). */
.modal.imei-scan-modal:popover-open {
  position: fixed;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  min-width: 0;
}

.modal.imei-scan-modal:popover-open::backdrop {
  background: rgba(24, 24, 27, 0.4);
}

.modal__shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  max-width: 100%;
  max-height: inherit;
  overflow: hidden;
}

.modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  z-index: 2;
}

.modal__header .card-title,
.modal__header h2 {
  margin: 0;
}

.modal__header .card-desc {
  margin-top: 0.3rem;
}

.modal__close {
  flex-shrink: 0;
  margin: -0.15rem -0.2rem 0 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.modal__close:hover {
  border: none;
  background: var(--muted);
}

.modal__body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal__body.stack {
  gap: 0.85rem;
}

.modal__footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--card);
  z-index: 2;
}

@keyframes sell-sheet-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sell-sheet-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.86);
  }
}

.modal-sell {
  width: min(100%, 520px);
  height: min(92vh, 760px);
  max-height: min(92vh, 760px);
  position: relative;
}

/* Stay centered: scale up into the front, then scale down through the screen. */
.modal.modal-sell[open]:not(.is-closing) {
  transform-origin: center center;
  animation: sell-sheet-in 0.22s linear both;
}

.modal.modal-sell[open].is-closing {
  transform-origin: center center;
  animation: sell-sheet-out 0.1s linear both;
  pointer-events: none;
}

/* Invoice preview hosted inside the still-open sale dialog (no close/reopen). */
.modal.modal-sell.is-showing-invoice[open]:not(.is-closing) {
  animation: none;
}

.modal.modal-sell.is-showing-invoice > #sell-form {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .modal.modal-sell[open]:not(.is-closing),
  .modal.modal-sell[open].is-closing {
    animation: none !important;
  }
}

.sell-inline-scan {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--card-foreground);
}

.sell-inline-scan[hidden] {
  display: none !important;
}

.sell-inline-scan__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.sell-inline-scan__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.sell-inline-scan__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem;
}

@media (min-width: 768px) {
  .modal-sell {
    width: min(820px, 94vw);
  }
}

.modal-sell .modal__shell {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.modal-sell .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--card);
}

.modal-sell [hidden] {
  display: none !important;
}

.modal-sell .sell-inline-scan.is-open {
  display: flex !important;
}

.modal-sell .modal__header,
.modal-sell .modal__footer {
  background: var(--card);
}

.sell-flow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sell-card {
  background: var(--card);
  border: 1px solid var(--pop-rim, var(--border));
  border-radius: var(--radius-lg, calc(var(--radius) + 2px));
  padding: 0.7rem 0.75rem 0.75rem;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

/* Collapsed steps: compact raised rows on the modal surface. */
.modal-sell .sell-card {
  background: var(--pop-raised, var(--card));
  border-color: var(--pop-rim, var(--border));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition:
    background var(--ease, 0.18s ease),
    border-color var(--ease, 0.18s ease),
    box-shadow var(--ease, 0.18s ease),
    padding var(--ease, 0.18s ease);
}

/*
 * Open step: soft well/tray (not another raised card).
 * Modal (raised) → open step (well) → line items (raised).
 */
.modal-sell .sell-card.is-step-open {
  background: var(--pop-well, #eef0f3);
  border-color: var(--pop-rim, var(--border));
  box-shadow: var(--pop-shine);
  padding: 0.75rem 0.8rem 0.85rem;
}

.modal-sell .sell-card.is-step-error:not(.is-step-open) {
  border-color: var(--destructive, #b91c1c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive, #b91c1c) 22%, transparent);
}

.modal-sell .sell-card.is-locked:not(.is-step-error) {
  opacity: 0.45;
}

.modal-sell .sell-card.is-locked .sell-card__head {
  cursor: not-allowed;
}

/* Summary: always-open info card (not a numbered sell step). */
.modal-sell .sell-card.sell-summary {
  opacity: 1;
  background: color-mix(in srgb, var(--pri) 6%, var(--pop-raised, var(--card)));
  border-style: dashed;
  border-color: color-mix(in srgb, var(--pri) 28%, var(--pop-rim, var(--border)));
  box-shadow: none;
  padding: 0.85rem 0.9rem 0.95rem;
  transition:
    opacity var(--ease, 0.18s ease),
    background var(--ease, 0.18s ease),
    border-color var(--ease, 0.18s ease),
    filter var(--ease, 0.18s ease);
}

/* Soft / secondary until payment is unlocked — not the same as locked steps. */
.modal-sell .sell-card.sell-summary.is-quiet {
  opacity: 0.55;
  filter: saturate(0.55);
  background: color-mix(in srgb, var(--muted) 35%, var(--pop-raised, var(--card)));
  border-color: color-mix(in srgb, var(--pop-rim, var(--border)) 80%, transparent);
  pointer-events: none;
}

.sell-summary__head {
  display: flex;
  align-items: center;
  margin: 0 0 0.65rem;
  padding: 0 0 0.45rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--pri) 22%, var(--pop-rim, var(--border)));
}

.sell-summary__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.sell-summary__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.sell-summary__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  min-width: 0;
}

.sell-summary__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sell-summary__meta-item .sell-pay__summary-label {
  font-size: 0.72rem;
  font-weight: 500;
}

.sell-summary__meta-item .sell-pay__summary-value {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sell-summary .sell-pay__summary {
  gap: 0.4rem 1rem;
  margin-top: 0;
}

.sell-summary .sell-pay__summary-col {
  gap: 0.2rem;
}

.sell-summary .sell-pay__summary-item {
  font-size: 0.82rem;
}

.sell-summary .sell-pay__summary-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sell-summary .sell-pay__summary-value {
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--foreground);
}

.sell-summary .sell-pay__summary-item--total .sell-pay__summary-label,
.sell-summary .sell-pay__summary-item--total .sell-pay__summary-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--foreground);
}

.sell-summary .sell-upi {
  margin-top: 0.15rem;
}

.sell-card__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.modal-sell .sell-card__head {
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.modal-sell .sell-card.is-step-open .sell-card__head {
  cursor: pointer;
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--pop-rim, var(--border)) 85%, transparent);
}

.modal-sell .sell-card:not(.is-step-open) {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.modal-sell .sell-card:not(.is-step-open) .sell-card__head {
  margin-bottom: 0;
}

.modal-sell .sell-card:not(.is-step-open):not(.is-always-open) > :not(.sell-card__head) {
  display: none !important;
}

.sell-card__chevron {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: auto;
  color: var(--muted-foreground);
  transition: transform 0.16s ease;
}

.sell-card__aside:not([hidden]) {
  margin-left: auto;
}

.sell-card__aside:not([hidden]) + .sell-card__chevron {
  margin-left: 0.35rem;
}

.modal-sell .sell-card.is-step-open .sell-card__chevron {
  transform: rotate(180deg);
  color: var(--pri);
}

.sell-card__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 600;
  flex: none;
  border: 1px solid transparent;
}

.modal-sell .sell-card.is-step-open .sell-card__step {
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  color: var(--pop-text, var(--foreground));
  border-color: color-mix(in srgb, var(--pri) 18%, var(--pop-rim, var(--border)));
  box-shadow: var(--pop-shine);
}

.modal-sell .sell-card.is-step-open .sell-card__title {
  color: var(--pop-text, var(--foreground));
}

.sell-card__title {
  margin: 0;
}

.sell-card__aside {
  min-width: 0;
  max-width: 55%;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--control-font-size);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-sell .sell-dash {
  width: 100%;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pop-rim, var(--border-dropdown)));
  background: var(--pop-raised, var(--card));
  color: var(--foreground);
  box-shadow: var(--pop-shine);
}

.modal-sell .sell-dash.is-attention,
.modal-sell .supplier-combo.is-attention .sell-dash {
  border-color: var(--destructive);
}

.sell-add-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.sell-line-list:empty + .sell-add-row,
.sell-line-list:not(:empty) {
  margin-top: 0;
}

.sell-line-list:not(:empty) + .sell-add-row {
  margin-top: 0.55rem;
}

.modal-sell .sell-scan {
  width: var(--control-height);
  min-width: var(--control-height);
  padding: 0;
  flex: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  box-shadow: none;
}

.sell-picked {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-md, var(--radius));
  background: var(--pop-raised, #fff);
  border: 1px solid var(--pop-rim, #d4d4d4);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.sell-picked__avatar {
  background: var(--muted);
}

.sell-picked__avatar,
.sell-person__avatar,
.sell-line__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--muted);
  flex: none;
}

.sell-line__avatar {
  background: var(--muted);
}

.sell-picked__copy,
.sell-person__copy,
.sell-line__copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.sell-picked__name,
.sell-line__name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 600;
}

.sell-picked__name > span:first-child,
.sell-line__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sell-picked__meta,
.sell-line__meta,
.modal-sell .sell-person .supplier-combo__option-meta {
  font-size: var(--control-font-size);
}

.sell-picked .badge[hidden] {
  display: none !important;
}

.sell-customer-rules {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sell-customer-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sell-customer-inline {
  margin-top: 0.55rem;
}

.sell-customer-inline[hidden] {
  display: none;
}

.sell-customer-inline:not([hidden]) + [data-buyer-empty] {
  margin-top: 0.75rem;
}

.sell-customer-inline .stack {
  gap: 0;
}

.sell-customer-inline .form-field {
  margin-bottom: 0.75rem;
}

.sell-customer-inline .address-fields {
  margin-bottom: 0.75rem;
}

.sell-customer-inline .stack > :last-child,
.sell-customer-inline .stack > :last-child.form-field,
.sell-customer-inline .stack > :last-child .form-field {
  margin-bottom: 0;
}

.sell-customer-gap {
  margin-top: 0.45rem;
}

.sell-customer-gap[hidden] {
  display: none;
}

.sell-customer-gap__fill {
  width: 100%;
  height: auto;
  min-height: var(--control-height);
  padding: 0.4rem 0.65rem;
  border: 1px dotted var(--destructive);
  background: #fff;
  color: var(--destructive);
  white-space: normal;
  text-align: center;
}

.modal-sell .sell-customer-gap__fill.is-flash {
  transition: none;
}

.sell-change {
  flex: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.sell-line-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sell-line {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--pop-rim, #d4d4d4);
  border-radius: var(--radius-md, var(--radius));
  background: var(--pop-raised, #fff);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.sell-line__top {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.sell-line .product-line {
  align-items: center;
}

.sell-line .product-info-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--muted);
}

.sell-line .sell-lines__remove,
.sell-line .sell-lines__remove:hover,
.sell-line .sell-lines__remove:focus,
.sell-line .sell-lines__remove:focus-visible,
.sell-line .sell-lines__remove:active {
  border: none;
  background: transparent;
  box-shadow: none;
}

.sell-line__controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sell-money {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.sell-money__prefix {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-size: var(--control-font-size);
  pointer-events: none;
}

.sell-money .input,
.sell-money input[type="number"] {
  width: 100%;
  padding-left: 1.35rem;
  background: var(--card);
}

.sell-stepper {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: var(--control-height);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
}

.sell-stepper__btn {
  width: var(--control-height);
  height: var(--control-height);
  border: none;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  cursor: pointer;
}

.sell-stepper input[type="number"].sell-lines__qty {
  width: 1.5rem;
  min-width: 1.5rem;
  height: var(--control-height);
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
  box-shadow: none;
}

.sell-pay {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sell-pay > .sell-pay__adjust {
  margin-top: 0.45rem;
}

.sell-pay__advanced {
  margin: 0;
  border: none;
  background: transparent;
}

.sell-pay__advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pri);
  line-height: 1.2;
}

.sell-pay__advanced-toggle::-webkit-details-marker {
  display: none;
}

.sell-pay__advanced-toggle::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.sell-pay__advanced[open] > .sell-pay__advanced-toggle::before {
  transform: rotate(45deg);
}

.sell-pay__advanced[open] > .sell-pay__adjust-inputs {
  margin-top: 0.55rem;
}

.sell-pay__amount {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.sell-pay__received {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sell-pay__amount .sell-money.sell-received__control {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.sell-pay__adjust {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.sell-pay__adjust-inputs {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.sell-pay__field-label {
  display: block;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--muted-foreground);
  line-height: 1.2;
}

.sell-pay__discount {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 0;
  min-width: 0;
}

.sell-pay__discount .sell-money.sell-discount__control {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.sell-pay__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.75rem 1rem;
  margin-top: 0.35rem;
  min-width: 0;
}

.sell-pay__summary-col {
  display: grid;
  gap: 0.28rem;
  justify-items: start;
  min-width: 0;
}

.sell-pay__summary-col--end {
  /* Sit in the right half, left-aligned within that half. */
  text-align: left;
}

.sell-pay__summary-col--end .sell-pay__summary-item {
  justify-content: flex-start;
}

.sell-pay__summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sell-pay__summary-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.sell-pay__summary-value {
  font-weight: 600;
  color: var(--foreground);
}

.sell-pay__summary-item--total .sell-pay__summary-label,
.sell-pay__summary-item--total .sell-pay__summary-value {
  font-weight: 700;
  color: var(--foreground);
}

.modal-sell .sell-pay.is-waiting .sell-received__control .input,
.modal-sell .sell-pay.is-waiting .sell-discount__control .input,
.modal-sell .sell-pay.is-waiting .sell-gst__picker .dd-trigger,
.modal-sell .sell-pay.is-waiting .sell-gst__custom,
.modal-sell .sell-pay.is-waiting .sell-due__btn {
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

.sell-due {
  position: relative;
  flex: 0 0 auto;
}

.sell-due__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.6rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: #fff;
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08), 0 0 0 1px rgba(24, 24, 27, 0.04);
}

.sell-due__btn:hover {
  border-color: var(--border);
}

.sell-due__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.sell-due__btn .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted-foreground);
  flex: 0 0 auto;
}

.sell-due__panel.date-range-panel {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  box-sizing: border-box;
  min-width: 0;
  width: min(17.5rem, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  z-index: 40;
}

.sell-due__panel .date-range-days button.is-today:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--border);
}

.modal-sell input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.modal-sell input[type="number"]::-webkit-outer-spin-button,
.modal-sell input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none;
  width: 0;
  height: 0;
}

.sell-pay .sell-received__full {
  z-index: 1;
}

.sell-gst__picker {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sell-gst__picker .dd-dropdown,
.sell-gst__picker .select {
  width: 100%;
}

.sell-gst__custom {
  width: 100%;
}

.sell-upi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.sell-upi__qr {
  width: 10.5rem;
  height: 10.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.sell-upi__qr[hidden] {
  display: none !important;
}

.sell-upi__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sell-upi__caption {
  margin: 0;
  max-width: 18rem;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  line-height: 1.35;
}

.sell-upi__qr-btn.btn {
  width: 100%;
  max-width: 18rem;
  justify-content: center;
}

.sell-upi__qr-btn.btn[hidden] {
  display: none !important;
}

.sell-upi__set {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 22rem;
  margin-top: 0.15rem;
}

.sell-upi__set[hidden] {
  display: none !important;
}

.sell-upi__entry {
  flex: 1 1 auto;
  min-width: 0;
}

.sell-upi__entry input {
  text-align: left;
}

.sell-upi__set > .btn {
  flex: 0 0 auto;
}

.sell-footer__total-value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Lift the product card only while its sheet is open, so the closed card's
   shadow stays under the payment card that follows it. */
.modal-sell .sell-product-picker.is-open {
  z-index: 6;
}

@keyframes sell-tray-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sell-tray-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

.modal-sell [data-buyer-combo-panel].sell-sheet:not([hidden]),
.modal-sell [data-buyer-combo-panel].sell-sheet.is-closing,
.modal-sell .sell-product-picker__tray.is-open,
.modal-sell .sell-product-picker__tray.is-closing {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: flex !important;
  flex-direction: column;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: var(--card);
  overflow: hidden;
  transform-origin: center bottom;
}

.modal-sell [data-buyer-combo-panel].sell-sheet:not([hidden]):not(.is-closing),
.modal-sell .sell-product-picker__tray.is-open:not(.is-closing) {
  animation: sell-tray-in 0.26s cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.modal-sell [data-buyer-combo-panel].sell-sheet.is-closing,
.modal-sell .sell-product-picker__tray.is-closing {
  animation: sell-tray-out 0.16s ease-in both;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .modal-sell [data-buyer-combo-panel].sell-sheet:not([hidden]):not(.is-closing),
  .modal-sell [data-buyer-combo-panel].sell-sheet.is-closing,
  .modal-sell .sell-product-picker__tray.is-open:not(.is-closing),
  .modal-sell .sell-product-picker__tray.is-closing {
    animation: none !important;
  }
}

.modal-sell .sell-product-picker__tray-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sell-sheet__header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.sell-sheet__header .card-title {
  margin: 0;
}

.sell-sheet__tabs {
  flex: none;
  padding: 0.75rem 1.1rem 0;
  background: var(--card);
}

.sell-buyer-pane__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.sell-sheet__footer.sell-buyer-pane__actions {
  margin-top: 0;
}

.sell-buyer-pane__actions .btn {
  width: 100%;
}

.sell-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1.1rem 1rem;
}

.sell-sheet__footer {
  flex: none;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.sell-sheet__footer .btn {
  width: 100%;
}

.sell-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--pop-rim, var(--border));
  border-radius: var(--radius-pill, 999px);
  background: var(--pop-well, var(--muted));
  box-shadow: var(--pop-shine, none);
}

.sell-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill, 999px);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.sell-tab.is-selected {
  background: var(--pop-raised, #fff);
  color: var(--pop-text, var(--foreground));
  border-color: var(--pop-rim, var(--border));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.sell-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sell-sheet__search {
  position: relative;
  margin-bottom: 0.85rem;
}

.sell-sheet__search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.modal-sell .sell-sheet .sell-product-picker__search .input {
  padding-left: 0.65rem;
}

.modal-sell .sell-sheet .supplier-combo__options {
  gap: 0.55rem;
  padding: 0.25rem 0.35rem 0.65rem;
  box-sizing: border-box;
}

.modal-sell .sell-sheet .supplier-combo__option {
  background: var(--pop-raised, #fff);
  border: 1px solid var(--pop-rim, #d4d4d4);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.modal-sell .sell-sheet .supplier-combo__option:hover,
.modal-sell .sell-sheet .supplier-combo__option:focus-visible,
.modal-sell .sell-sheet .supplier-combo__option:active {
  background: var(--pop-raised, #fff);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pop-rim, #d4d4d4));
  box-shadow: var(--pop-lift), var(--pop-shine);
}

.modal-sell .sell-sheet .sell-person {
  background: var(--pop-raised, #fff);
}

.modal-sell .sell-sheet .sell-person:hover,
.modal-sell .sell-sheet .sell-person:focus-visible,
.modal-sell .sell-sheet .sell-person:active {
  background: var(--pop-raised, #fff);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pop-rim, #d4d4d4));
  box-shadow: var(--pop-lift), var(--pop-shine);
}

.modal-sell .sell-person {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: inherit;
}

.modal-sell .sell-sheet .sell-product-picker__list {
  max-height: none;
  flex: 1 1 auto;
  gap: 0.55rem;
  /* Keep room for card lift shadows; overflow-x:hidden otherwise clips them. */
  padding: 0.4rem 0.75rem 1rem;
  margin-inline: -0.35rem;
  box-sizing: border-box;
}

.modal-sell .sell-sheet .supplier-combo__option-add {
  border: 1px solid var(--border-dropdown);
  border-radius: 999px;
  background: var(--card);
}

.modal-sell .sell-sheet .supplier-combo__option--add.is-selected .supplier-combo__option-add {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.sell-modal__footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.sell-footer__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sell-footer__bar .btn {
  flex: 1 1 auto;
  width: 100%;
  justify-content: center;
}

.modal-sell [data-sell-create]:disabled {
  background: #d4d4d4;
  color: #fff;
  opacity: 1;
  border-color: transparent;
}

.modal-sell .sell-product-picker,
.modal-invoice-add .invoice-add-footer {
  justify-content: flex-end;
}

.modal-invoice-add .sell-product-picker {
  flex-shrink: 0;
  position: relative;
}

.modal-invoice-add .sell-product-picker__search .input {
  padding-right: 0.75rem;
}

/* Manual customer entry, full-modal panel (covers chrome + sell flow). */
.sell-buyer-manual {
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  color: var(--card-foreground);
}

.sell-buyer-manual[hidden] {
  display: none !important;
}

.modal-sell.is-buyer-manual-focus .sell-buyer-manual {
  display: flex !important;
  position: absolute;
  inset: 0;
  z-index: 25;
}

.sell-buyer-manual__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.sell-buyer-manual__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sell-buyer-manual__back {
  flex-shrink: 0;
  margin: -0.15rem -0.2rem 0 0;
}

.sell-buyer-manual__footer .btn-secondary {
  background: var(--card);
  color: var(--muted-foreground);
  border-color: var(--border);
}

.sell-buyer-manual__footer .btn-secondary:hover {
  background: var(--muted);
  color: var(--foreground);
}

.sell-buyer-manual__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 1rem 1.1rem;
}

.sell-buyer-manual__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.sell-buyer-manual__footer .btn {
  width: 100%;
  justify-content: center;
}

/* Add Stock supplier picker uses the same page chrome as New supplier. */
body.is-supplier-sheet-open [data-product-page-chrome] {
  display: none !important;
}

#product-form.is-supplier-sheet-open {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
}

#product-form.is-supplier-sheet-open > :not([data-supplier-combo]) {
  display: none !important;
}

#product-form.is-supplier-sheet-open [data-supplier-combo],
#product-form.is-supplier-sheet-open [data-supplier-combo] > .supplier-combo__control {
  display: contents;
}

#product-form.is-supplier-sheet-open [data-supplier-combo] > :not(.supplier-combo__control),
#product-form.is-supplier-sheet-open .supplier-combo__control > :not([data-supplier-combo-panel]) {
  display: none !important;
}

#product-form [data-supplier-combo-panel].supplier-picker:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

#product-form .supplier-picker__card {
  gap: 0.85rem;
}

#product-form .supplier-picker__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

#product-form .supplier-picker__search {
  margin-bottom: 0.85rem;
}

#product-form .supplier-picker__search .input {
  width: 100%;
}

#product-form .supplier-picker .supplier-combo__options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0.25rem 0.15rem 0.35rem;
  border: none;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

#product-form .supplier-picker .supplier-combo__option,
#product-form .supplier-picker .sell-person {
  width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: inherit;
  background: var(--pop-raised, #fff);
  border: 1px solid var(--pop-rim, #d4d4d4);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

#product-form .supplier-picker .supplier-combo__option:hover,
#product-form .supplier-picker .supplier-combo__option:focus-visible,
#product-form .supplier-picker .supplier-combo__option:active,
#product-form .supplier-picker .sell-person:hover,
#product-form .supplier-picker .sell-person:focus-visible,
#product-form .supplier-picker .sell-person:active {
  background: var(--pop-raised, #fff);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pop-rim, #d4d4d4));
  box-shadow: var(--pop-lift), var(--pop-shine);
}

#product-form .supplier-picker .sell-person .supplier-combo__option-meta {
  font-size: var(--control-font-size);
}

#product-form .supplier-picker .sell-person__avatar .icon {
  width: 0.95rem;
  height: 0.95rem;
}

#product-form [data-supplier-form-actions][hidden],
#product-form [data-supplier-continue][hidden],
#product-form [data-supplier-save][hidden],
#product-form [data-supplier-pane][hidden] {
  display: none !important;
}

#product-form .supplier-picker .page-back {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.sell-modal__footer {
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.sell-received {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 18rem;
  margin-left: auto;
}

.sell-received__total {
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
  line-height: 1.15;
}

.sell-received__total-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sell-received__total-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  white-space: nowrap;
}

.sell-received__control {
  position: relative;
  flex: 1 1 8.5rem;
  min-width: 6.5rem;
  max-width: 11rem;
}

.sell-product-lines .table-wrap {
  overflow: hidden;
  margin: 0;
}

.modal-sell .supplier-combo__trigger--btn,
.modal-sell .sell-lines__add-btn,
.modal-sell .sell-lines__scan-btn,
.modal-sell .sell-received__control .input,
.modal-sell .sell-discount__control .input {
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08), 0 0 0 1px rgba(24, 24, 27, 0.04);
}

.sell-received__control .input {
  width: 100%;
  padding-right: 3.1rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

.sell-discount__control .input {
  width: 100%;
  appearance: textfield;
  -moz-appearance: textfield;
}

.sell-received__control .input::-webkit-outer-spin-button,
.sell-received__control .input::-webkit-inner-spin-button,
.sell-discount__control .input::-webkit-outer-spin-button,
.sell-discount__control .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sell-received__full {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  height: 1.45rem;
  padding: 0 0.45rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.sell-received__full:hover {
  background: color-mix(in srgb, var(--muted) 70%, var(--foreground) 8%);
}

#sell-lines-table,
#invoice-add-lines-table {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
}

#sell-lines-table th,
#sell-lines-table td,
#invoice-add-lines-table th,
#invoice-add-lines-table td {
  white-space: nowrap;
}

#sell-lines-table .sell-lines__col-remove,
#invoice-add-lines-table .sell-lines__col-remove {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  padding-left: 0.2rem;
  padding-right: 0.1rem;
  text-align: center;
  vertical-align: middle;
}

#sell-lines-table .sell-lines__col-product,
#invoice-add-lines-table .sell-lines__col-product {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

#sell-lines-table .product-info-btn {
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
}

#sell-lines-table .sell-lines__remove .icon,
#sell-lines-table .product-info-btn .icon {
  width: 0.95rem;
  height: 0.95rem;
}

#sell-lines-table .product-line {
  gap: 0.2rem;
}

#sell-lines-table .sell-lines__col-qty {
  width: 3.15rem;
  min-width: 3.15rem;
  max-width: 3.15rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
  text-align: center;
}

#sell-lines-table .sell-lines__col-price,
#invoice-add-lines-table .sell-lines__col-price {
  width: 5.35rem;
  min-width: 5.35rem;
  max-width: 5.35rem;
  padding-left: 0.25rem;
  padding-right: 0.35rem;
}

#sell-lines-table .sell-lines__qty,
#sell-lines-table .sell-lines__price,
#invoice-add-lines-table .sell-lines__price {
  width: 100%;
  min-width: 0;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

#sell-lines-table .sell-lines__qty::-webkit-outer-spin-button,
#sell-lines-table .sell-lines__qty::-webkit-inner-spin-button,
#sell-lines-table .sell-lines__price::-webkit-outer-spin-button,
#sell-lines-table .sell-lines__price::-webkit-inner-spin-button,
#invoice-add-lines-table .sell-lines__price::-webkit-outer-spin-button,
#invoice-add-lines-table .sell-lines__price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#sell-lines-table .sell-lines__remove,
#invoice-add-lines-table .sell-lines__remove {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

#sell-lines-table .sell-lines__remove:hover,
#invoice-add-lines-table .sell-lines__remove:hover {
  border: none;
  background: transparent;
  color: var(--destructive, #b91c1c);
}

.sell-product-picker {
  position: relative;
}

.sell-product-picker__control {
  width: 100%;
}

.sell-product-picker__search {
  width: 100%;
  padding: 0.4rem 0.4rem 0.25rem;
  box-sizing: border-box;
}

.sell-product-picker__search .input {
  padding-right: 3.6rem;
}

.sell-product-picker__search .filter-search__actions {
  gap: 0;
}

.sell-product-picker__search .input-affix-btn {
  width: 1.55rem;
  min-width: 1.55rem;
  max-width: 1.55rem;
  height: 1.55rem;
  min-height: 1.55rem;
}

.sell-product-picker__search .input-affix-btn .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.sell-product-picker__search .input-affix-btn.is-active {
  color: var(--foreground);
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

.sell-product-picker__panel {
  position: relative;
  top: auto;
  left: auto;
  z-index: 2;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 0.45rem;
  box-sizing: border-box;
}

.sell-product-picker__months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.15rem 0 0.35rem;
}

.sell-product-picker__month-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  margin: 0;
  padding: 0.35rem 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.sell-product-picker__month-btn:hover {
  background: var(--muted);
}

.sell-product-picker__month-btn.is-selected {
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  color: var(--pop-text, var(--foreground));
  border-color: color-mix(in srgb, var(--pri) 18%, var(--pop-rim, var(--border)));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.sell-product-picker__tray {
  display: none;
  margin-top: 0.3rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: calc(var(--radius) + 2px);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow-dropdown);
  overflow: hidden;
}

.sell-product-picker__tray.is-open {
  display: block;
}

.sell-product-picker__tray-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sell-product-picker__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 12rem;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.55rem 0.5rem 0.65rem;
  overscroll-behavior: contain;
}

.sell-product-picker__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 55%, var(--card));
}

.sell-product-picker__footer .btn {
  width: 100%;
  justify-content: center;
}

.sell-product-lines {
  margin-top: 0;
}

.sell-product-lines.sell-product-picker {
  position: relative;
}

#sell-lines-table .sell-lines__add-row > td,
#invoice-add-lines-table .sell-lines__add-row > td {
  padding: 0.55rem 0 0.75rem;
  border-top: none;
  vertical-align: top;
  white-space: normal;
}

#sell-lines-table .sell-lines__add-row > td {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

#sell-lines-table .sell-lines__add-row .sell-product-picker__control,
#invoice-add-lines-table .sell-lines__add-row .sell-product-picker__control {
  width: 100%;
}

.sell-lines__add-actions {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}

.sell-lines__add-btn,
.sell-lines__scan-btn {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border-dropdown);
  box-shadow: none;
  font-weight: 550;
}

.sell-lines__add-btn {
  flex: 1 1 auto;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  height: 2.35rem;
  min-height: 2.35rem;
}

.sell-lines__add-btn .icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.sell-lines__scan-btn {
  flex: 0 0 2.35rem;
  width: 2.35rem;
  min-width: 2.35rem;
  max-width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  color: var(--muted-foreground);
}

.sell-lines__scan-btn .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.sell-lines__add-btn:hover,
.sell-lines__scan-btn:hover {
  background: var(--muted);
  border-color: #c4c4c4;
  color: var(--foreground);
}

.sell-lines__add-btn:focus-visible,
.sell-lines__scan-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.sell-product-picker.is-open .sell-lines__add-btn {
  background: var(--muted);
  border-color: #c4c4c4;
}

.sell-lines__add-btn.is-attention,
.sell-lines__add-btn.is-attention:hover,
.sell-lines__add-btn.is-attention:focus-visible,
.sell-product-picker.is-open .sell-lines__add-btn.is-attention {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent);
  animation: field-attention-pulse 1.1s ease-out 2;
}

.sell-lines-empty {
  margin: 0;
  text-align: center;
}

.gov-id-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.gov-id-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.gov-id-view-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.gov-id-view-btn .icon svg {
  width: 1rem;
  height: 1rem;
}

.modal-image {
  width: min(100%, 520px);
  max-height: min(92vh, 760px);
}

@media (min-width: 768px) {
  .modal-image {
    width: min(640px, 92vw);
  }
}

/*
 * Soft-nav can briefly leave dialogs inside #app-main. An open <dialog> that
 * falls out of the top layer keeps [open] and paints inline in the page.
 * Never show non-top-layer dialogs as page content.
 */
#app-main dialog.modal:not(:modal) {
  display: none !important;
}

.modal-invoice-ready {
  width: min(92vw, 42rem);
  max-width: min(92vw, 42rem);
  height: min(88dvh, 88vh);
  max-height: min(88dvh, 88vh);
  margin: auto;
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-invoice-ready .modal__shell {
  height: 100%;
  min-height: 0;
}

.modal-invoice-ready .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: var(--muted);
  align-items: stretch;
  display: flex;
  flex-direction: column;
}

.invoice-ready-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.6rem;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}

.invoice-ready-stage.is-zoomed {
  cursor: grab;
}

.invoice-ready-stage.is-zoomed:active {
  cursor: grabbing;
}

.invoice-ready-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.invoice-ready-stage img[hidden] {
  display: none;
}

.invoice-ready-preview__status {
  margin: 0;
  padding: 0.75rem 0.5rem;
  text-align: center;
  flex: 0 0 auto;
}

.invoice-ready-skeleton {
  width: 100%;
  padding: 0.95rem;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
}

.invoice-ready-skeleton[hidden] {
  display: none;
}

.invoice-ready-skeleton__page {
  background: #fff;
  border-radius: calc(var(--radius) - 2px);
  padding: 1.25rem 1.1rem 1.5rem;
  min-height: min(52vh, 28rem);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.invoice-ready-skeleton__brand {
  height: 1.1rem;
}

.invoice-ready-skeleton__rule {
  height: 1px;
  margin: 1.15rem 0;
  background: color-mix(in srgb, var(--border) 85%, transparent);
}

.invoice-ready-skeleton__row {
  height: 2.35rem;
  margin-top: 0.55rem;
}

.invoice-ready-skeleton__row:first-of-type {
  margin-top: 0;
}

.invoice-ready-actions {
  justify-content: stretch;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.invoice-ready-actions .btn {
  flex: 1 1 0;
  justify-content: center;
}

.invoice-ready-actions .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.invoice-ready-share-group {
  display: flex;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
}

.invoice-ready-share-group > .btn[data-invoice-ready-share] {
  flex: 1 1 auto;
  min-width: 0;
}

.invoice-ready-actions [data-invoice-share-sent] {
  display: none;
}

.invoice-ready-actions .is-email-sent:not(.is-busy) [data-invoice-share-icon] {
  display: none;
}

.invoice-ready-actions .is-email-sent:not(.is-busy) [data-invoice-share-sent] {
  display: inline-flex;
}

.invoice-ready-share-group.has-email > .btn[data-invoice-ready-share] {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.invoice-ready-actions .btn-split {
  flex: 0 0 auto;
}

.invoice-ready-actions .btn-split__caret {
  flex: 0 0 1.5rem;
  align-self: stretch;
  height: auto;
}

.invoice-ready-actions .btn-split__menu {
  top: auto;
  right: auto;
  left: 0;
  bottom: calc(100% + 0.25rem);
  min-width: 8rem;
}

@media (min-width: 768px) {
  .invoice-ready-actions {
    justify-content: flex-end;
  }

  .invoice-ready-actions .btn {
    flex: 0 0 auto;
  }

  .invoice-ready-share-group {
    flex: 0 0 auto;
  }
}

.form-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.85rem 0 0.1rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 18px -14px rgba(0, 0, 0, 0.18);
}

.form-actions-bar .btn {
  width: 100%;
  justify-content: center;
}

.form-actions-bar.product-form-actions .product-form-actions__row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
}

.form-actions-bar.product-form-actions .product-form-actions__row > .btn {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
  height: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.modal.stock-created-modal {
  width: min(24rem, calc(100vw - 2rem));
  max-width: min(24rem, calc(100vw - 2rem));
  height: fit-content;
  max-height: min(92vh, 760px);
  margin: auto;
}

.stock-created-modal .modal__shell {
  width: 100%;
  flex: none;
  max-height: none;
  height: auto;
  overflow: visible;
}

.stock-created-modal__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
}

.stock-created-modal__details {
  margin: 0.35rem 0 0;
}

.stock-created-modal__link {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
}

.stock-created-modal__footer {
  justify-content: stretch;
}

.stock-created-modal__footer > .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}

.card > .form-actions-bar,
.card.stack > .form-actions-bar {
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  margin-bottom: -1.25rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.form-sticky-actions > .form-actions-bar {
  margin-left: -0.05rem;
  margin-right: -0.05rem;
  padding: 0.85rem 0.15rem 0.25rem;
  background: var(--background);
}

.gov-id-image-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
}

.gov-id-image-frame img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Smooth dim, avoid first-frame full opacity flicker on dialog open. */
.modal::backdrop {
  background: rgba(15, 20, 40, 0.28);
  opacity: 0;
  transition: opacity 0.18s linear;
}

.modal[open]::backdrop {
  opacity: 1;
}

.modal.is-closing::backdrop {
  opacity: 0;
  transition: opacity 0.2s linear;
}

@starting-style {
  .modal[open]::backdrop {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal::backdrop,
  .modal[open]::backdrop,
  .modal.is-closing::backdrop {
    transition: none;
  }
}

.icon-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--btn-idle-border);
  background: var(--btn-idle-bg);
  color: var(--btn-idle-fg);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.icon-btn-sm:hover {
  background: var(--btn-idle-hover);
  text-decoration: none;
}

.icon-btn-sm .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.icon-btn-sm.modal__close,
.icon-btn-sm.sell-buyer-manual__back {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}

.icon-btn-sm.modal__close:hover,
.icon-btn-sm.modal__close:focus,
.icon-btn-sm.modal__close:focus-visible,
.icon-btn-sm.modal__close:active,
.icon-btn-sm.sell-buyer-manual__back:hover,
.icon-btn-sm.sell-buyer-manual__back:focus,
.icon-btn-sm.sell-buyer-manual__back:focus-visible,
.icon-btn-sm.sell-buyer-manual__back:active {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}

/* Soft hover wash only when a real pointer is available */
@media (hover: hover) and (pointer: fine) {
  .icon-btn-sm.modal__close:hover,
  .icon-btn-sm.sell-buyer-manual__back:hover {
    background: var(--muted) !important;
  }
}

.icon-btn-sm.invoice-line-return__btn {
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

.icon-btn-sm.invoice-line-return__btn:hover:not(:disabled):not(.is-disabled) {
  border: none;
  background: transparent;
  color: var(--foreground);
}

.icon-btn-sm.invoice-line-return__btn:disabled,
.icon-btn-sm.invoice-line-return__btn.is-disabled {
  color: #c6c6c6;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.label-hint {
  cursor: help;
  border-bottom: 1px dotted var(--muted-foreground);
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section--compact {
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.settings-section-header--inline {
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.settings-section-header--inline .card-title {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.settings-section-header--inline .btn {
  flex: 0 0 auto;
}

.settings-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--foreground);
  font: inherit;
  font-size: 0.925rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.settings-text-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.settings-text-link .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted-foreground);
}

.settings-text-link:hover .icon {
  color: var(--foreground);
}

.settings-collapsible {
  padding: 0;
  overflow: hidden;
}

.settings-collapsible__summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.65rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.settings-collapsible__summary::-webkit-details-marker {
  display: none;
}

.settings-collapsible__summary-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 1.5rem;
}

.settings-collapsible__summary-top::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.settings-collapsible[open] > .settings-collapsible__summary .settings-collapsible__summary-top::before {
  transform: rotate(45deg);
}

.settings-collapsible__icon {
  width: 1rem;
  height: 1rem;
  color: var(--foreground);
  flex-shrink: 0;
}

.settings-collapsible__summary .card-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.settings-collapsible__meta {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.875rem;
}

.settings-collapsible__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  padding-top: 0.75rem;
}

.badge-warn {
  background: color-mix(in srgb, #b45309 14%, transparent);
  color: #92400e;
  border: 1px solid color-mix(in srgb, #b45309 28%, transparent);
}

.party-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 0 1.15rem;
}

@media (min-width: 720px) {
  .party-grid {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .party-grid .party-section {
    flex: 1 1 0;
    width: auto;
    max-width: 22rem;
    min-width: 0;
  }
}

.party-grid .card,
.party-grid .party-section {
  margin: 0;
  width: min(100%, 28rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.party-section .product-form-section__summary {
  gap: 0.5rem;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  min-height: 2.05rem;
}

.party-section .product-form-section__chevron {
  width: 0.4rem;
  height: 0.4rem;
  border-right-width: 2px;
  border-bottom-width: 2px;
  border-right-color: var(--foreground);
  border-bottom-color: var(--foreground);
  opacity: 0.85;
}

.party-section[open] > .product-form-section__summary {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 55%, var(--card));
}

.party-section .product-form-section__body {
  padding: 0;
}

.party-section__name {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--foreground);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.party-detail__id-image {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
  cursor: pointer;
  line-height: 0;
}

.party-detail__id-image img {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  object-position: center;
  background: var(--muted);
}

.party-detail__id-image:hover img {
  opacity: 0.96;
}

.party-detail__info {
  padding: 0.75rem 1rem 0.9rem;
}

.party-detail-line {
  margin: 0.2rem 0;
}

.party-detail-line--address {
  white-space: pre-wrap;
}

.invoice-detail-total {
  margin: 0.75rem 0 0;
  text-align: right;
  font-weight: 400;
  color: inherit;
}

.invoice-sheet__meta {
  margin-bottom: 1rem;
}

.invoice-sheet__number {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.invoice-sheet__date {
  margin: 0.2rem 0 0;
  color: var(--foreground);
  font-size: 0.92rem;
  opacity: 0.72;
}

.invoice-sheet__parties {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.invoice-sheet__parties-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(10rem, 0.9fr);
  gap: 1.25rem;
  align-items: start;
  flex: 1;
  min-width: 0;
}

.invoice-sheet__logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.invoice-sheet__shop-copy {
  min-width: 0;
}

.invoice-sheet__shop-name {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.invoice-sheet__bill-to {
  min-width: 0;
  text-align: left;
  justify-self: end;
  width: min(100%, 18rem);
}

.invoice-sheet__label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foreground);
}

.invoice-sheet__kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.4rem;
  row-gap: 0.2rem;
  align-items: start;
}

.invoice-sheet__field-label {
  font-weight: 550;
  color: var(--foreground);
  white-space: nowrap;
}

.invoice-sheet__field-label::after {
  content: ":";
}

.invoice-sheet__kv > span:nth-child(even) {
  color: var(--foreground);
  font-weight: 400;
  min-width: 0;
}

.invoice-line-desc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.invoice-line-desc__model {
  color: var(--foreground);
  font-weight: 550;
}

.invoice-line-desc__imei {
  color: var(--muted-foreground);
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.invoice-sheet__line {
  margin: 0.2rem 0 0;
}

.invoice-sheet__pre {
  white-space: pre-wrap;
}

.invoice-sheet__table {
  margin-top: 1rem;
  border: none;
  box-shadow: none;
}

.invoice-sheet__section {
  margin-top: 1rem;
}

.invoice-sheet__section .invoice-sheet__label {
  margin-bottom: 0.35rem;
}

.invoice-sheet__section .invoice-sheet__pre,
.invoice-sheet__footer {
  color: var(--foreground);
  opacity: 0.78;
}

.invoice-sheet__total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 1rem;
  text-align: right;
}

.invoice-sheet__total-value {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.invoice-sheet__footer {
  margin: 1rem 0 0;
}

@media (max-width: 700px) {
  .invoice-sheet__parties {
    flex-direction: column;
  }

  .invoice-sheet__parties-main {
    grid-template-columns: 1fr;
  }

  .invoice-sheet__bill-to {
    justify-self: start;
    width: 100%;
  }
}

/* Product filter bar */
.filters-bar {
  display: grid;
  grid-template-columns: minmax(10rem, 1.4fr) repeat(3, minmax(8.5rem, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.filters-card {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
}

.filters-bar-products,
.filters-bar-invoice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.filters-bar-products .filter-search,
.filters-bar-invoice .filter-search {
  flex: 1 1 auto;
  min-width: 0;
}

.filters-bar-products .filter-search .input,
.filters-bar-invoice .filter-search .input {
  width: 100%;
}

.filters-bar-products .date-range,
.filters-bar-invoice .date-range,
.filters-bar-products .product-date-filters {
  flex: 0 0 auto;
}

.product-date-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  position: relative;
}

.product-date-filters .date-range {
  position: relative;
}

.filters-bar-products .filter-actions,
.filters-bar-invoice .filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Quiet icon tools in filter bars, not full bordered chicklets */
.filters-bar .filter-actions .btn-icon,
.filters-bar .date-range-trigger--icon:not(.is-active) {
  width: 1.75rem;
  min-width: 1.75rem;
  max-width: 1.75rem;
  height: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

.filters-bar .filter-actions .btn-icon .icon,
.filters-bar .date-range-trigger--icon:not(.is-active) .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: inherit;
}

.filters-bar .filter-actions .btn-icon:hover,
.filters-bar .date-range-trigger--icon:not(.is-active):hover {
  border-color: transparent;
  background: var(--muted);
  color: var(--foreground);
  opacity: 1;
}

.filters-bar .date-range-trigger--icon.is-active {
  height: var(--control-height);
  min-height: var(--control-height);
  min-width: var(--control-height);
  padding: 0 0.55rem;
  font-size: var(--control-font-size);
  box-shadow: none;
}

.filters-bar-directory {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.filters-bar-directory .filter-search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.filters-bar-directory .filter-actions {
  flex: 0 0 auto;
}

.filter-search--inline-actions {
  position: relative;
  display: block;
  width: 100%;
}

.filter-search--inline-actions .input {
  width: 100%;
  padding-right: 0.75rem;
}

.filter-search--inline-actions input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.filter-search--inline-actions:has([data-product-imei-scan-open]) .input,
.filter-search--inline-actions:has([data-invoice-scan-open]) .input,
.filter-search--inline-actions:has([data-clear-search]:not([hidden])) .input,
.filter-search--inline-actions.has-value .input {
  padding-right: 2.4rem;
}

.filter-search--inline-actions:has([data-product-imei-scan-open]):has([data-clear-search]:not([hidden])) .input,
.filter-search--inline-actions:has([data-invoice-scan-open]):has([data-clear-search]:not([hidden])) .input,
.filter-search--inline-actions.has-value:has([data-product-imei-scan-open]) .input,
.filter-search--inline-actions.has-value:has([data-invoice-scan-open]) .input {
  padding-right: 4rem;
}

.filter-search__actions {
  position: absolute;
  top: 50%;
  right: 0.2rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  transform: translateY(-50%);
}

.filter-search__actions .btn-tool,
.filter-search__actions .input-affix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  min-width: 1.65rem;
  max-width: 1.65rem;
  height: 1.65rem;
  min-height: 1.65rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
}

.filter-search__actions .btn-tool:hover,
.filter-search__actions .input-affix-btn:hover {
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  color: var(--foreground);
  border: none;
  opacity: 1;
}

.filter-search__actions .input-affix-btn .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.filter-search__actions .input-affix-btn[hidden] {
  display: none !important;
}

.date-range__control {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  max-width: 100%;
}

.date-range__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  min-width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  cursor: pointer;
  flex-shrink: 0;
}

.date-range__clear:hover {
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  color: var(--foreground);
}

.date-range__clear .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.date-range__clear[hidden] {
  display: none !important;
}

.page-header--analytics {
  width: 100%;
  align-items: center;
}

.page-header--analytics .analytics-filters {
  margin-bottom: 0;
  margin-left: auto;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
}

.analytics-filters {
  margin-bottom: 1rem;
}

.filters-bar.filters-bar-analytics {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
  grid-template-columns: none;
  width: auto;
}

.filters-bar-analytics__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.filters-bar-analytics .filter-period {
  flex: 0 0 auto;
  width: auto;
}

.filters-bar-analytics .filter-period .select,
.filters-bar-analytics .filter-period .dd-dropdown {
  width: auto;
  min-width: 9rem;
  max-width: none;
}

.filters-bar-analytics .filter-period .select,
.filters-bar-analytics .filter-period .dd-trigger,
.filters-bar-analytics .date-range-trigger,
.filters-bar-analytics .date-range-trigger--icon,
.filters-bar-analytics .date-range-trigger--icon.is-active,
.filters-bar-analytics .date-range-trigger--month {
  height: var(--control-height);
  min-height: var(--control-height);
  font-size: var(--control-font-size);
  box-shadow: none;
}

.filters-bar-analytics .filter-period .dd-trigger {
  width: auto;
  padding: 0 0.55rem;
}

.filters-bar-analytics .filter-period .dd-caret {
  order: -1;
}

.filters-bar-analytics .date-range {
  flex: 0 0 auto;
  width: auto;
}

.filters-bar-analytics .date-range-trigger--icon {
  width: var(--control-height);
  min-width: var(--control-height);
  max-width: var(--control-height);
}

.filters-bar-analytics .date-range-trigger--icon.is-active {
  width: auto;
  min-width: var(--control-height);
  max-width: min(100%, 18rem);
  padding: 0 0.55rem;
}

.filters-bar-analytics .date-range-trigger--month {
  width: auto;
  min-width: 0;
  max-width: min(100%, 14rem);
  padding: 0 0.55rem;
  gap: 0.35rem;
}

.filters-bar-analytics .date-range-trigger--month > .icon {
  order: -1;
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
}

.filters-bar-analytics .date-range-trigger--month .value {
  white-space: nowrap;
}

.filters-bar-analytics [data-month-filter] .date-range-panel {
  right: 0;
  left: auto;
}

/* Keep analytics pickers near their triggers (mobile .date-range-panel centers). */
@media (max-width: 860px) {
  .filters-bar-analytics .date-range-panel {
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: min(19rem, calc(100vw - 1.5rem));
    min-width: min(17.5rem, calc(100vw - 1.5rem));
    max-height: min(24rem, calc(100dvh - 2rem));
  }
}

.btn-icon {
  width: var(--control-height);
  min-width: var(--control-height);
  max-width: var(--control-height);
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
}

.stock-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--pop-rim);
  border-radius: var(--radius-pill);
  background: var(--pop-well);
  box-shadow: var(--pop-shine);
  overflow: hidden;
}

.stock-toggle__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.2rem 0.55rem;
  min-height: 1.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.7rem;
  font-weight: 550;
  line-height: 1.1;
  color: var(--muted-foreground);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-right: none;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}

.stock-toggle__option:last-child {
  border-right: none;
}

.stock-toggle__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Selected look follows the radio only — avoids dual-highlight when an
   AJAX filter leaves a stale .is-active class on the previous option. */
.stock-toggle__option:has(input:checked) {
  background: var(--pop-raised);
  color: var(--pop-text);
  border-color: var(--pop-rim);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  font-weight: 600;
}

.date-range-trigger--icon {
  width: var(--control-height);
  min-width: var(--control-height);
  max-width: var(--control-height);
  padding: 0;
  justify-content: center;
  gap: 0;
}

.date-range-trigger--icon .value {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.date-range-trigger--icon.is-active {
  width: auto;
  max-width: min(100%, 18rem);
  min-width: var(--control-height);
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.55rem;
  justify-content: flex-start;
  gap: 0.35rem;
  border-color: var(--input);
  background: var(--control-bg);
  color: var(--foreground);
  box-shadow: none;
  font-weight: inherit;
  font-size: var(--control-font-size);
}

.date-range-trigger--icon.is-active:hover {
  border-color: var(--border);
  background: var(--control-bg);
}

.date-range-trigger--icon.is-active .icon {
  color: var(--muted-foreground);
  opacity: 1;
}

.date-range-trigger--icon.is-active .value {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: auto;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

@media (max-width: 900px) {
  .filters-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .filters-bar-products {
    flex-wrap: wrap;
  }

  .filters-bar-products .filter-search {
    flex: 1 1 100%;
  }

  .filters-bar-directory {
    flex-wrap: nowrap;
  }

  .filters-bar-directory .filter-search {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .filters-bar-invoice,
  .filters-bar-products:not(.filters-bar-directory) {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  .filters-bar-invoice .filter-search,
  .filters-bar-products:not(.filters-bar-directory) .filter-search {
    flex: 1 1 100%;
  }

  .filters-bar-invoice .date-range,
  .filters-bar-invoice .stock-toggle,
  .filters-bar-invoice .filter-actions,
  .filters-bar-products .date-range,
  .filters-bar-products .product-date-filters,
  .filters-bar-products .stock-toggle,
  .filters-bar-products .filter-actions {
    flex: 0 0 auto;
  }

  .stock-toggle {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .stock-toggle__option {
    flex: 0 0 auto;
    padding: 0.15rem 0.45rem;
    min-height: 1.35rem;
    font-size: 0.65rem;
  }

  .dashboard-inbox-toolbar .stock-toggle {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .dashboard-inbox-toolbar .stock-toggle__option {
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
  }

  .dashboard-inbox-search {
    flex: 1 1 100%;
  }

  .filters-bar .filter-actions .btn-icon,
  .filters-bar .date-range-trigger--icon:not(.is-active) {
    width: 1.65rem;
    min-width: 1.65rem;
    max-width: 1.65rem;
    height: 1.65rem;
    min-height: 1.65rem;
  }
}

@media (max-width: 520px) {
  .filters-bar {
    grid-template-columns: 1fr;
  }
}

.date-range {
  position: relative;
  overflow: visible;
}

.date-range-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--control-font-size);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.date-range-trigger:hover {
  border-color: var(--border);
}

.date-range-trigger:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}

.date-range-trigger .icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.date-range-trigger .value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-trigger .value.is-placeholder {
  color: var(--muted-foreground);
}

.date-range-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 17.5rem;
  padding: 0.75rem;
  border: var(--border-dropdown-width) solid var(--border-dropdown);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-dropdown);
}

.date-range-panel[hidden] {
  display: none;
}

.date-range-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.date-range-nav .month-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.date-range-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.date-range-weekdays,
.date-range-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.date-range-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  padding: 0.2rem 0;
}

.date-range-days button {
  height: 1.85rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.date-range-days button:hover:not(:disabled) {
  background: var(--muted);
}

.date-range-days button:disabled {
  color: transparent;
  cursor: default;
}

.date-range-days button.in-range {
  background: rgba(24, 24, 27, 0.06);
  border-radius: 0;
}

.date-range-days button.range-start,
.date-range-days button.range-end,
.date-range-days button.selected {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
}

.date-range-days button.range-start.range-end {
  border-radius: var(--radius);
}

.date-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.field-row-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
}

.field-row-card:not(.is-collapsed) .field-row-head {
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.field-row-card:not(.is-collapsed) .field-row-head__actions {
  cursor: default;
}

.btn-sm {
  height: 1.5rem;
  padding: 0 0.45rem;
  font-size: 0.7rem;
}

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

/* --- Smartphone / small screens --- */
@media (max-width: 860px) {
  :root {
    --mobile-bottom-nav-height: 3.75rem;
    --mobile-sidebar-inset: 1.15rem;
  }

  /* Slightly denser rem base, locked; ignore system text size */
  :root {
    --font-size-root: 15px;
    --font-size-body: 13px;
    --icon-size: 13px;
    --icon-size-sm: 11px;
    --control-height: 1.7rem;
    --control-font-size: 0.7rem;
  }

  html {
    font-size: var(--font-size-root) !important;
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
  }

  body {
    font-size: var(--font-size-body) !important;
    line-height: 1.45;
  }

  /* Hide vertical (and horizontal) scrollbars on mobile; scrolling still works. */
  *,
  *::before,
  *::after {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  body.nav-locked {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 30;
    height: 3.25rem;
    padding: 0 0.75rem;
    padding-top: env(safe-area-inset-top, 0);
    background: transparent;
    border-bottom: none;
  }

  .mobile-brand {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
  }

  .mobile-brand .product-switch {
    max-width: 100%;
  }

  .icon-btn.mobile-account-toggle {
    margin-left: auto;
    width: 2.45rem;
    height: 2.45rem;
    color: #0a0a0a;
    background: var(--pop-raised);
    border-color: var(--pop-rim);
    box-shadow: var(--pop-lift-sm), var(--pop-shine);
    transition:
      transform 140ms ease,
      box-shadow 140ms ease,
      background var(--ease),
      border-color var(--ease);
  }

  .icon-btn.mobile-account-toggle:hover,
  .icon-btn.mobile-account-toggle.is-active {
    background: var(--pop-raised);
    border-color: var(--pop-rim);
    box-shadow: var(--pop-lift-sm), var(--pop-shine);
  }

  .icon-btn.mobile-account-toggle:active {
    transform: translateY(2px) scale(0.94);
    box-shadow: var(--pop-shine);
  }

  @media (prefers-reduced-motion: reduce) {
    .icon-btn.mobile-account-toggle {
      transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
    }

    .icon-btn.mobile-account-toggle:active {
      transform: none;
    }
  }

  .icon-btn.mobile-account-toggle .icon {
    width: 1.2rem;
    height: 1.2rem;
    min-width: 1.2rem;
    min-height: 1.2rem;
  }

  .icon-btn.mobile-account-toggle .icon svg {
    stroke-width: 1.5;
  }

  .desktop-only {
    display: none !important;
  }

  .icon-btn.mobile-nav-close {
    display: inline-flex;
  }

  /* Invoice create lives in the bottom nav Sell control on mobile. */
  .page-header__actions--desktop-create {
    display: none !important;
  }

  .sidebar-mobile-extra {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    z-index: 40;
    width: max(100vw, var(--app-min-width));
    min-width: var(--app-min-width);
    background: rgba(24, 24, 27, 0.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.18s linear,
      visibility 0.18s linear;
  }

  .app-shell.nav-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

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

  /* Account / org drawer, inset sheet (Chrome-style), not edge-to-edge */
  .sidebar {
    position: fixed;
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    right: var(--mobile-sidebar-inset);
    left: auto;
    bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
    z-index: 50;
    width: min(18rem, calc(100vw - (var(--mobile-sidebar-inset) * 2) - 2.5rem));
    min-width: 15rem;
    height: auto;
    max-height: none;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    transform: translateX(calc(100% + var(--mobile-sidebar-inset) + 0.5rem));
    transition: transform 0.22s ease;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: -10px 8px 36px rgba(0, 0, 0, 0.16);
  }

  .sidebar-primary-nav {
    display: none;
  }

  .btn.sidebar-create-invoice {
    display: none;
  }

  .sidebar-header {
    padding-bottom: 0.7rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-top {
    align-items: center;
  }

  .sidebar-identity {
    height: auto;
    min-height: 2rem;
    grid-template-rows: auto auto;
  }

  .sidebar-identity .brand__text,
  .sidebar-identity__subtitle,
  .sidebar-identity__user {
    height: auto;
    line-height: 1.15;
  }

  .sidebar .org-switch {
    position: absolute;
    top: 50%;
    right: 2.45rem;
    width: auto;
    transform: translateY(-50%);
  }

  .sidebar .org-switch .dd-dropdown--org {
    width: auto;
    max-width: none;
  }

  .sidebar .org-switch .dd-dropdown--org .dd-leading-icon,
  .sidebar .org-switch .dd-dropdown--org .dd-label {
    display: none;
  }

  .sidebar .org-switch .dd-dropdown--org .dd-trigger {
    width: 1.7rem;
    max-width: none;
    height: 1.7rem;
    min-height: 1.7rem;
    padding: 0;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
  }

  .sidebar-footer {
    margin-top: auto;
  }

  .sidebar-userbar {
    margin-top: 0.45rem;
    padding: 0.28rem 0.2rem 0.28rem 0.35rem;
    border-radius: 0.75rem;
    background: #f4f4f4;
  }

  .sidebar-userbar .sidebar-user-icon svg {
    display: none;
  }

  .sidebar-user-initials {
    display: block;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1;
    color: #3f3f3f;
  }

  .mobile-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.35rem;
    position: fixed;
    left: 0;
    right: auto;
    bottom: 0;
    z-index: 35;
    width: max(100vw, var(--app-min-width));
    min-width: var(--app-min-width);
    height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--mobile-bottom-nav-bg);
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
    transform: translateY(0);
    transition: transform 0.22s ease;
    box-sizing: border-box;
    overflow: visible;
  }

  .mobile-bottom-nav.is-collapsed {
    transform: translateY(100%);
    pointer-events: none;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav__sell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.25rem 0.2rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  .mobile-bottom-nav a:focus,
  .mobile-bottom-nav a:focus-visible,
  .mobile-bottom-nav__sell:focus,
  .mobile-bottom-nav__sell:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .mobile-bottom-nav a .icon {
    width: 1.2rem;
    height: 1.2rem;
  }

  .mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav a:hover {
    color: var(--foreground);
    background: var(--muted);
    text-decoration: none;
  }

  .mobile-bottom-nav a.is-active {
    position: relative;
    color: var(--pri);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
  }

  .mobile-bottom-nav a.is-active::before {
    content: "";
    position: absolute;
    /* Cancel .mobile-bottom-nav top padding so the bar sits flush on the nav edge. */
    top: -0.35rem;
    left: 0;
    right: 0;
    width: 100%;
    height: 0.22rem;
    border-radius: 0 0 999px 999px;
    background: var(--pri);
    pointer-events: none;
  }

  .mobile-bottom-nav a.is-active .icon {
    color: var(--pri);
  }

  /* Center + control stays inside the bar (not a raised FAB). */
  .mobile-bottom-nav__actions {
    position: relative;
    z-index: 2;
    flex: 0 0 3.6rem;
    flex-grow: 0;
    flex-shrink: 0;
    width: 3.6rem;
    min-width: 3.6rem;
    max-width: 3.6rem;
    margin-top: 0;
    padding: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
  }

  .mobile-bottom-nav a.mobile-bottom-nav__sell,
  .mobile-bottom-nav button.mobile-bottom-nav__sell,
  .mobile-bottom-nav__sell {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0;
    padding: 0.2rem;
    gap: 0;
    justify-content: center;
    align-items: center;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    color: var(--foreground);
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }

  .mobile-bottom-nav__sell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.85rem;
    width: 2.85rem;
    height: 2.85rem;
    min-width: 2.85rem;
    min-height: 2.85rem;
    max-width: 2.85rem;
    max-height: 2.85rem;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pri) 28%, #fff);
    color: var(--pop-text, #1d1d1f);
    box-shadow: var(--pop-lift-sm), var(--pop-shine);
    border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pop-rim, rgba(15, 20, 40, 0.08)));
    box-sizing: border-box;
    transition: background 0.12s ease, color 0.12s ease, transform 0.18s ease, box-shadow 0.12s ease;
  }

  .mobile-bottom-nav__sell-icon .icon,
  .mobile-bottom-nav a.mobile-bottom-nav__sell .mobile-bottom-nav__sell-icon .icon {
    width: 1.35rem;
    height: 1.35rem;
    transition: transform 0.18s ease;
  }

  .mobile-bottom-nav__actions.is-open .mobile-bottom-nav__sell-icon {
    background: var(--pop-raised, #fff);
    color: var(--pop-text, #1d1d1f);
    border-color: var(--pop-rim, rgba(15, 20, 40, 0.08));
    box-shadow: var(--pop-lift-sm), var(--pop-shine);
  }

  .mobile-bottom-nav__actions.is-open .mobile-bottom-nav__sell-icon .icon {
    transform: rotate(45deg);
  }

  /* Press feedback only while the finger/mouse is down, avoids sticky mobile “hover”. */
  .mobile-bottom-nav__sell:active .mobile-bottom-nav__sell-icon {
    background: color-mix(in srgb, var(--pri) 36%, #fff);
    color: var(--pop-text, #1d1d1f);
    box-shadow: var(--pop-lift-sm), var(--pop-shine);
  }

  /* True hover devices only (mouse/trackpad). Never style :focus, mobile leaves focus after tap. */
  @media (hover: hover) and (pointer: fine) {
    .mobile-bottom-nav__sell:hover .mobile-bottom-nav__sell-icon {
      background: color-mix(in srgb, var(--pri) 36%, #fff);
      color: var(--pop-text, #1d1d1f);
      box-shadow: var(--pop-lift), var(--pop-shine);
    }
  }

  .mobile-bottom-nav__sell:focus,
  .mobile-bottom-nav__sell:focus-visible {
    outline: none;
  }

  .mobile-bottom-nav__actions-menu {
    position: absolute;
    left: 50%;
    bottom: calc(50% + 2.55rem);
    z-index: 5;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.2rem 0.25rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    box-shadow: none;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
    transform: translateX(-50%) scale(0.22);
    transform-origin: center calc(100% + 2.55rem);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.2s ease;
  }

  .mobile-bottom-nav__actions.is-open .mobile-bottom-nav__actions-menu {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-bottom-nav__actions-menu::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.32rem;
    width: 0.72rem;
    height: 0.72rem;
    background: #fff;
    border-radius: 0.18rem;
    transform: translateX(-50%) rotate(45deg);
    z-index: 0;
  }

  .mobile-bottom-nav__actions-menu[hidden] {
    display: none !important;
  }

  .mobile-bottom-nav__actions-divider {
    align-self: stretch;
    width: 1px;
    margin: 0.72rem 0.15rem;
    background: #e6e6e6;
    position: relative;
    z-index: 1;
  }

  /* Beat `.mobile-bottom-nav a` column/flex rules for menu entries. */
  .mobile-bottom-nav a.mobile-bottom-nav__actions-item,
  .mobile-bottom-nav button.mobile-bottom-nav__actions-item,
  .mobile-bottom-nav__actions-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #2a2a2a;
    box-shadow: none;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
  }

  .mobile-bottom-nav a.mobile-bottom-nav__actions-item:active,
  .mobile-bottom-nav button.mobile-bottom-nav__actions-item:active,
  .mobile-bottom-nav__actions-item:active {
    background: #f2f2f2;
    border-color: transparent;
    box-shadow: none;
    color: #111;
    text-decoration: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .mobile-bottom-nav a.mobile-bottom-nav__actions-item:hover,
    .mobile-bottom-nav button.mobile-bottom-nav__actions-item:hover,
    .mobile-bottom-nav__actions-item:hover {
      background: #f4f4f4;
      border-color: transparent;
      color: #111;
      text-decoration: none;
    }
  }

  .mobile-bottom-nav__actions-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #6b6b6b;
    box-shadow: none;
  }

  .mobile-bottom-nav__actions-item-icon .icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .mobile-bottom-nav__actions-item-icon .icon svg {
    stroke-width: 1.5;
  }

  .mobile-bottom-nav__actions-item-label {
    flex: 0 0 auto;
    min-width: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav__actions-menu {
      transition: none;
      transform: translateX(-50%);
      opacity: 1;
    }
  }

  .main {
    padding: 1rem 0.85rem;
    padding-bottom: calc(1.25rem + var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  .billing-topbar {
    padding: calc(0.85rem + env(safe-area-inset-top, 0)) 0.85rem 0.85rem;
    flex-direction: row;
    align-items: center;
  }

  .billing-topbar__brand {
    flex: 1;
  }

  .billing-nav {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .billing-nav a {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
  }

  .billing-nav-label {
    display: none;
  }

  .billing-main {
    padding: 1rem 0.85rem 2.5rem;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0));
  }

  .page-header {
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: nowrap;
    align-items: center;
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  .page-header p,
  .card-desc {
    font-size: 0.8rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .form-field label {
    font-size: 0.8rem;
  }

  .form-field .help,
  .help {
    font-size: 0.72rem;
  }

  .page-header .row,
  .page-header > .btn,
  .page-header > a.btn,
  .page-header__actions {
    width: auto;
    flex: 0 0 auto;
  }

  .page-header .row .btn,
  .page-header > a.btn,
  .page-header__actions .btn {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
  }

  .page-header .row .btn.btn-icon,
  .page-header__actions .btn-icon,
  .page-header__actions .btn-tool {
    flex: 0 0 1.65rem;
    width: 1.65rem;
    min-width: 1.65rem;
    max-width: 1.65rem;
    height: 1.65rem;
    padding: 0;
  }

  .btn-split__caret {
    width: 1.35rem;
    min-width: 1.35rem;
    max-width: 1.35rem;
  }

  .page-header--inline-actions {
    flex-wrap: nowrap;
    align-items: center;
  }

  .page-header--inline-actions > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .page-header--inline-actions > .btn,
  .page-header--inline-actions > a.btn {
    width: auto;
    flex: 0 0 auto;
  }

  .card {
    padding: 1rem;
  }

  .card.export-history-section {
    padding: 0;
  }

  .card.settings-collapsible {
    padding: 0;
  }

  .card.settings-section--compact {
    padding: 0.55rem 0.85rem;
  }

  .settings-collapsible__summary {
    padding: 0.5rem 0.85rem;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .billing-doc-list {
    display: grid;
    gap: 0.75rem;
  }

  .billing-doc-list + .table-wrap {
    display: none;
  }

  .filters-bar {
    grid-template-columns: 1fr;
  }

  .filters-bar-products {
    display: flex;
  }

  .filters-bar .row {
    width: 100%;
  }

  .filters-bar .row .btn {
    flex: 1;
  }

  .filters-bar-products .filter-actions .btn,
  .filters-bar-invoice .filter-actions .btn {
    flex: 0 0 auto;
  }

  .filters-bar .filter-actions .btn-icon,
  .filters-bar .date-range-trigger--icon:not(.is-active) {
    width: 1.65rem;
    min-width: 1.65rem;
    max-width: 1.65rem;
    height: 1.65rem;
    min-height: 1.65rem;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .filters-bar .date-range-trigger--icon.is-active {
    height: 1.65rem;
    min-height: 1.65rem;
  }

  /* Bleed on the scroll shell so edge cues stay flush with the table border. */
  .table-scroll {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .table-wrap,
  .table-wrap-share-links {
    -webkit-overflow-scrolling: touch;
    /* Keep swipe scroll; never reserve/show a horizontal scrollbar that covers rows. */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .table-wrap-share-links {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .table-wrap::-webkit-scrollbar,
  .table-wrap-share-links::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  table.data {
    min-width: 36rem;
    font-size: 0.8rem;
    --data-row-min-height: 2.9rem;
  }

  table.data.table-templates {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  table.data.table-templates th,
  table.data.table-templates td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  table.data th,
  table.data td {
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
    line-height: 1.35;
  }

  /* Keep every table header at the product-list height on mobile too. */
  table.data th,
  table.data thead th,
  table.data th.col-actions {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  table.data.table-products td {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  table.data.table-invoice-lines td {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  table.data.table-invoice-payments:has(.table-empty-row) {
    min-width: 100%;
  }

  table.data.table-invoice-payments .table-empty-row td {
    text-align: center;
    white-space: normal;
  }

  table.data.table-products td.col-product-name {
    white-space: normal;
  }

  table.data.table-products th.col-product-actions,
  table.data.table-products td.col-product-actions {
    padding-left: 0.45rem;
    padding-right: 0;
  }

  table.data.table-products th.col-product-name,
  table.data.table-products td.col-product-name,
  table.data.table-invoice-lines th.col-product,
  table.data.table-invoice-lines td.col-product,
  table.data.table-invoice-returns th.col-return-name,
  table.data.table-invoice-returns td.col-return-name {
    padding-left: 0.15rem;
  }

  table.data.table-invoice-lines th.col-line-select,
  table.data.table-invoice-lines td.col-line-select,
  table.data.table-invoice-returns th.col-line-select,
  table.data.table-invoice-returns td.col-line-select {
    padding-left: 0.45rem;
    padding-right: 0;
  }

  table.data td.col-actions {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .btn {
    height: 1.7rem;
    min-height: 1.7rem;
    padding: 0 0.55rem;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 550;
  }

  .btn .icon {
    width: 0.8rem;
    height: 0.8rem;
  }

  .btn-icon,
  .btn-tool {
    width: 1.7rem;
    min-width: 1.7rem;
    max-width: 1.7rem;
    height: 1.7rem;
    min-height: 1.7rem;
  }

  .btn-sm {
    height: 1.4rem;
    min-height: 1.4rem;
    padding: 0 0.4rem;
    font-size: 0.65rem;
  }

  .btn-lg,
  .public-intake__actions .btn-lg,
  .public-pdp__cta .btn-lg {
    height: 2.15rem;
    min-height: 2.15rem;
    font-size: 0.85rem;
  }

  .icon-btn,
  .mobile-nav-toggle {
    width: 2.15rem;
    height: 2.15rem;
  }

  .icon-btn-sm {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
  }

  .input,
  .select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="url"],
  input[type="search"],
  input[type="file"],
  select,
  .ms-trigger,
  .dd-trigger,
  .date-range-trigger,
  .date-range-trigger--icon,
  .date-range-trigger--icon.is-active,
  .filters-bar-analytics .filter-period .dd-trigger,
  .filters-bar-analytics .date-range-trigger--month {
    height: var(--control-height);
    min-height: var(--control-height);
    font-size: var(--control-font-size);
  }

  .textarea,
  textarea {
    min-height: 4.5rem;
    height: auto;
    font-size: 0.75rem;
  }

  .input::placeholder,
  input::placeholder,
  textarea::placeholder {
    font-size: 0.75rem;
  }

  .select:not([multiple]),
  select:not([multiple]) {
    font-size: 0.75rem;
  }

  .period-tabs .btn,
  .supplier-combo__option,
  .address-fields__locate,
  .settings-text-link {
    font-size: 0.75rem;
  }

  .stock-toggle__option {
    font-size: 0.65rem;
  }

  .filters-bar-products .filter-actions .btn,
  .filters-bar-invoice .filter-actions .btn {
    flex: 0 0 auto;
  }

  .pagination-row__size .dd-dropdown--page-size .dd-trigger {
    min-height: 0;
    height: auto;
    font-size: inherit;
    font-weight: 400;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .sidebar-nav-label,
  .mobile-bottom-nav__label,
  label,
  .stat-label,
  .card-desc,
  .field label {
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
  }

  .org-switch .dd-dropdown--org {
    max-width: 100%;
    width: 100%;
  }

  .modal {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    min-width: 0;
    max-height: calc(100dvh - 1.25rem);
    margin: auto;
    overflow: hidden;
  }

  .modal.stock-created-modal {
    width: min(24rem, calc(100vw - 2rem));
    max-width: min(24rem, calc(100vw - 2rem));
    height: fit-content;
    max-height: min(92dvh, 760px);
    margin: auto;
  }

  .modal.photo-capture-modal,
  .modal.imei-scan-modal {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    min-width: 0;
  }

  .card > .form-actions-bar,
  .card.stack > .form-actions-bar {
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -1rem;
    padding: 0.85rem 1rem;
  }

  .form-actions-bar {
    bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.22s ease;
  }

  .form-actions-bar.product-form-actions .product-form-actions__row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .form-actions-bar.product-form-actions .product-form-actions__row > .btn {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: auto;
    min-height: 1.7rem;
    white-space: normal;
  }

  /* When the bottom nav hides on scroll, pin actions to the true viewport bottom. */
  body.mobile-nav-collapsed .form-actions-bar {
    bottom: env(safe-area-inset-bottom, 0px);
  }

  .date-range-panel {
    /* Parent is only ~2.1rem wide (icon trigger); don't bind panel width to it */
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(19rem, calc(100vw - 1.5rem));
    min-width: min(17.5rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    z-index: 70;
  }

  .date-range-days button {
    height: 2rem;
    font-size: 0.75rem;
  }

  .pagination-row .row {
    width: 100%;
  }

  .pagination-row .row .btn {
    flex: 1;
  }

  .field-grid {
    grid-template-columns: 1fr !important;
  }

  .auth-shell {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  }

  .auth-card {
    width: 100%;
  }

  .toast-region {
    top: auto;
    bottom: calc(var(--mobile-bottom-nav-height) + 5rem + env(safe-area-inset-bottom, 0px));
    width: min(22.5rem, calc(100vw - 1.5rem));
    transition: bottom 0.22s ease;
  }

  body.mobile-nav-collapsed .toast-region {
    bottom: max(6.25rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
  }

  .toast {
    font-size: 0.78rem;
    min-height: 1.7rem;
    padding: 0.28rem 0.35rem 0.28rem 0.5rem;
  }
}

@media (max-width: 420px) {
  :root {
    --font-size-root: 14px;
    --font-size-body: 12px;
    --icon-size: 12px;
    --icon-size-sm: 10px;
    --control-height: 1.6rem;
    --control-font-size: 0.68rem;
  }

  html {
    font-size: var(--font-size-root) !important;
  }

  body {
    font-size: var(--font-size-body) !important;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 1.05rem;
  }

  .btn {
    height: 1.6rem;
    min-height: 1.6rem;
    padding: 0 0.5rem;
    font-size: 0.68rem;
  }

  .btn-icon,
  .btn-tool {
    width: 1.6rem;
    min-width: 1.6rem;
    max-width: 1.6rem;
    height: 1.6rem;
    min-height: 1.6rem;
  }

  .btn-split__caret {
    width: 1.25rem;
    min-width: 1.25rem;
    max-width: 1.25rem;
  }

  .input,
  .select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="url"],
  input[type="search"],
  input[type="file"],
  select,
  .ms-trigger,
  .dd-trigger,
  .date-range-trigger,
  .date-range-trigger--icon,
  .date-range-trigger--icon.is-active,
  .filters-bar-analytics .filter-period .dd-trigger,
  .filters-bar-analytics .date-range-trigger--month {
    height: var(--control-height);
    min-height: var(--control-height);
    font-size: var(--control-font-size);
  }

  .billing-topbar__brand {
    min-width: 0;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .billing-topbar,
  .billing-nav,
  .app-shell > .sidebar,
  .app-shell > .mobile-topbar,
  .app-shell > .mobile-bottom-nav,
  .sidebar-backdrop,
  .toast-region,
  .page-loading,
  .no-print {
    display: none !important;
  }

  .billing-shell,
  .billing-main,
  .main,
  .app-shell {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    background: #fff !important;
  }

  .invoice-sheet-wrap {
    margin: 0 !important;
  }

  .invoice-sheet,
  .invoice-sheet .card {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .invoice-sheet {
    padding: 0 !important;
  }

  table.data {
    min-width: 0 !important;
  }
}

.product-detail-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 1rem;
}

.product-detail-toolbar .stock-toggle {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
}

.product-detail-toolbar .stock-toggle__option {
  flex: 0 0 auto;
}

.product-detail-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.35rem 0 0;
}

.badge-stock {
  font-size: 0.75rem;
  font-weight: 600;
  height: auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: none;
}

.badge-stock--in {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-stock--out {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.product-detail-panel[hidden] {
  display: none !important;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.product-detail-layout--no-media {
  grid-template-columns: 1fr;
}

.product-detail-media.card {
  padding: 0.85rem;
}

.product-detail-facts .card-title {
  margin-bottom: 0.85rem;
}

.product-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-carousel__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--muted);
  overflow: hidden;
}

.product-carousel__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-carousel__slide[hidden] {
  display: none !important;
}

.product-carousel__slide img,
.product-carousel__slide video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.product-carousel__file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 80%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--card);
  color: var(--foreground);
  text-align: center;
  word-break: break-word;
}

.product-carousel__fullscreen {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--foreground);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.product-carousel__fullscreen:hover {
  background: var(--card);
}

.product-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--foreground);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.product-carousel__nav:hover {
  background: var(--card);
}

.product-carousel__nav--prev {
  left: 0.65rem;
}

.product-carousel__nav--next {
  right: 0.65rem;
}

.product-carousel__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem;
  font-size: 0.875rem;
}

.product-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #0a0a0a;
  color: #fafafa;
}

.product-lightbox::backdrop {
  background: #000;
}

.product-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.product-lightbox__bar .muted {
  margin-left: 0.5rem;
  color: rgba(255, 255, 255, 0.65);
}

.product-lightbox__bar .modal__close {
  color: #fafafa;
  border: none;
  background: transparent;
}

.product-lightbox__bar .modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.product-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 3.5rem);
  padding: 1.25rem 4rem;
  box-sizing: border-box;
}

.product-lightbox__stage img,
.product-lightbox__stage video {
  max-width: min(100%, 1200px);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-lightbox__stage .product-carousel__nav {
  background: rgba(24, 24, 27, 0.85);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fafafa;
}

.product-lightbox__stage .product-carousel__nav--prev {
  left: 1rem;
}

.product-lightbox__stage .product-carousel__nav--next {
  right: 1rem;
}

.detail-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-list__row {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 0.75rem 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.detail-list__row:first-child {
  border-top: none;
  padding-top: 0;
}

.detail-list__row:last-child {
  padding-bottom: 0;
}

.detail-list__row dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.detail-list__row dd {
  margin: 0;
  font-size: 0.925rem;
  color: var(--foreground);
  word-break: break-word;
}

.detail-list__value {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.detail-list__text {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-list__text--pre {
  white-space: pre-wrap;
}

.detail-list__row--gov {
  align-items: center;
}

.detail-list__row--gov .detail-list__value {
  align-items: center;
}

.gov-id-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1 1 auto;
}

.gov-id-card__photo {
  flex: 0 0 auto;
  width: 5.4rem;
  height: 3.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px);
  background: var(--muted);
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
}

.gov-id-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gov-id-card__photo:hover {
  border-color: var(--foreground);
}

.gov-id-card__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
}

.gov-id-card__type {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.2;
}

.gov-id-card__number {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.3;
  word-break: break-word;
}

.detail-list__value--sku {
  align-items: center;
}

.sku-barcode-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: fit-content;
  max-width: 100%;
}

.sku-barcode-row__value {
  align-self: stretch;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--muted-foreground);
}

.sku-barcode {
  display: block;
  color: var(--foreground);
  line-height: 0;
}

.sku-barcode svg {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 100%;
}

.sku-barcode svg rect {
  fill: currentColor;
  stroke: none;
}

.sku-print {
  flex: none;
}

.detail-list__edit {
  flex: 0 0 auto;
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  margin: -0.15rem 0 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
}

.detail-list__edit:hover {
  border: none;
  background: transparent;
  color: var(--foreground);
}

.detail-list__edit .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.product-field-edit-modal {
  width: min(100%, 420px);
}

.product-field-edit-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .detail-list__row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .detail-list__value {
    align-items: center;
  }

  .detail-list__edit {
    margin-top: 0;
  }

  .product-lightbox__stage {
    padding: 1rem 3rem;
  }
}




.legal-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.legal-page__header {
  margin-bottom: 1.75rem;
}

.legal-page__brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.legal-page__brand a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
}

.legal-page__brand .brand {
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.legal-page__header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  line-height: 1.2;
}

.legal-page__meta {
  margin: 0;
  font-size: 0.85rem;
}

.legal-page__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.legal-page__body h2 {
  margin: 1.1rem 0 0;
  font-size: 1.05rem;
}

.legal-page__body p,
.legal-page__body ul {
  margin: 0;
}

.legal-page__body ul {
  padding-left: 1.2rem;
}

.legal-page__body li + li {
  margin-top: 0.35rem;
}

.legal-page__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page__footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.legal-page__footer a {
  color: var(--muted-foreground);
}

.legal-consent {
  margin: 0.35rem 0 0.75rem;
}

.legal-consent__row {
  align-items: flex-start;
}

.legal-consent__text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--foreground);
}

.legal-consent__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-consent.has-error .legal-consent__row {
  outline: 1px solid color-mix(in srgb, var(--destructive, #b91c1c) 55%, transparent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

/* -- Shell soft-nav skeletons (HTMX primary tabs) -- */
.shell-skeleton {
  padding-bottom: 1rem;
}

.shell-skeleton__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.shell-skeleton__card {
  margin-bottom: 1rem;
}

.shell-skeleton__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.skel {
  display: block;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--border) 70%, var(--card)) 0%,
    color-mix(in srgb, var(--border) 35%, var(--card)) 45%,
    color-mix(in srgb, var(--border) 70%, var(--card)) 100%
  );
  background-size: 200% 100%;
  animation: shell-skel-shimmer 1.15s ease-in-out infinite;
}

.skel--title {
  height: 1.75rem;
  width: 9rem;
}

.skel--btn {
  height: 2.25rem;
  width: 6.5rem;
  border-radius: var(--radius);
}

.skel--input {
  height: 2.5rem;
  flex: 1 1 12rem;
  min-width: 10rem;
  border-radius: var(--radius);
}

.skel--chip {
  height: 2.25rem;
  width: 5.5rem;
  border-radius: var(--radius);
}

.skel--line {
  height: 0.85rem;
}

.skel--w-24 { width: 24%; }
.skel--w-32 { width: 32%; }
.skel--w-40 { width: 40%; }

.skel--chart {
  height: 11rem;
  width: 100%;
  border-radius: var(--radius);
}

.skel--row {
  height: 3rem;
  width: 100%;
  margin-top: 0.65rem;
  border-radius: var(--radius);
}

.skel--row:first-child {
  margin-top: 0;
}

#app-main.is-shell-loading {
  min-height: 60vh;
}

@keyframes shell-skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}

/* -- Public storefront catalog -- */
.storefront-catalog__inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 3rem;
}

.storefront-catalog__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.storefront-catalog__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.storefront-catalog__mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.storefront-catalog__title {
  margin: 0;
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--public-ink, var(--foreground));
  line-height: 1.15;
}

.storefront-catalog__dashboard {
  flex-shrink: 0;
}

.storefront-catalog__lede {
  margin: 0 0 1.15rem;
  color: var(--public-muted, var(--muted-foreground));
  font-size: 0.98rem;
  line-height: 1.45;
  max-width: 36rem;
}

.storefront-catalog__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.75rem;
  margin: 0 0 1.35rem;
}

.storefront-filter {
  position: relative;
}

.storefront-filter__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.storefront-filter__trigger .icon {
  width: 1rem;
  height: 1rem;
}

.storefront-filter__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  min-width: 10.5rem;
  padding: 0.35rem;
  border: 1px solid var(--public-border, var(--border));
  border-radius: 10px;
  background: var(--public-surface, var(--card));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--foreground) 12%, transparent);
}

.storefront-filter__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--public-ink, var(--foreground));
  font: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.storefront-filter__option:hover,
.storefront-filter__option:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}

.storefront-brand-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.storefront-brand-crumb {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--public-border, var(--border));
  border-radius: 999px;
  background: var(--public-surface, var(--card));
  color: var(--public-ink, var(--foreground));
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
}

.storefront-brand-crumb:hover,
.storefront-brand-crumb:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--public-border, var(--border)));
  outline: none;
}

.storefront-brand-crumb.is-active {
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  border-color: color-mix(in srgb, var(--pri) 18%, var(--pop-rim, var(--border)));
  color: var(--pop-text, var(--foreground));
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.storefront-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.storefront-gallery-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 1rem 1.1rem;
  align-items: start;
}

.storefront-gallery-slot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.storefront-gallery-slot .image-picker {
  min-width: 0;
  max-width: 100%;
}

.storefront-gallery-slot__clear {
  margin: 0;
  font-size: 0.85rem;
}

.storefront-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--public-border, var(--border));
  border-radius: 999px;
  background: var(--public-surface, var(--card));
  color: var(--public-ink, var(--foreground));
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
}

.storefront-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--public-border, var(--border)));
}

.storefront-filter-modal {
  width: min(100%, 420px);
}

.storefront-filter-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 14rem;
}

.storefront-filter-modal__search .input {
  width: 100%;
}

.storefront-filter-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(48vh, 22rem);
  overflow: auto;
  border: 1px solid var(--public-border, var(--border));
  border-radius: 10px;
}

.storefront-filter-modal__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--public-border, var(--border));
  background: transparent;
  color: var(--public-ink, var(--foreground));
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.storefront-filter-modal__item:last-child {
  border-bottom: 0;
}

.storefront-filter-modal__item:hover,
.storefront-filter-modal__item:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}

.storefront-filter-modal__empty {
  margin: 0.5rem 0 0;
  text-align: center;
}

.storefront-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.storefront-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pop-rim, var(--public-border, var(--border)));
  border-radius: var(--radius-lg, 20px);
  background: var(--public-surface, var(--card));
  color: inherit;
  overflow: hidden;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition: border-color var(--ease, 0.18s ease), box-shadow var(--ease, 0.18s ease), transform var(--ease, 0.18s ease);
}

.storefront-card:hover {
  border-color: color-mix(in srgb, var(--pri) 28%, var(--pop-rim, var(--border)));
  box-shadow: var(--pop-lift), var(--pop-shine);
  transform: translateY(-2px);
}

.storefront-card__hit {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.storefront-card__hit:hover,
.storefront-card__hit:focus,
.storefront-card__hit:focus-visible {
  color: inherit;
  text-decoration: none;
}

.storefront-card__media {
  margin: 0.65rem 0.65rem 0;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--public-ink, var(--foreground)) 5%, var(--public-surface, var(--card)));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.storefront-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.storefront-card__placeholder {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--public-muted, var(--muted-foreground));
  opacity: 0.45;
}

.storefront-card__body {
  padding: 0.75rem 0.95rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
  min-width: 0;
}

.storefront-card__location {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--public-ink, var(--foreground));
  opacity: 0.72;
}

.storefront-card__store-name,
.storefront-card__store-loc {
  font-weight: 400;
}

.storefront-card__name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--public-ink, var(--foreground));
  min-width: 0;
}

.storefront-card__price {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--public-ink, var(--foreground));
  opacity: 0.85;
}

.storefront-card__contact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 1.9rem);
  margin: 0.55rem 0.95rem 0.95rem;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-radius: var(--radius);
  background: #181818;
  color: #fafafa;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-underline-offset: 0;
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.storefront-card__contact:disabled,
.storefront-card__contact[aria-disabled="true"] {
  background: #181818;
  color: #fafafa;
  opacity: 0.42;
  text-decoration: none;
  cursor: not-allowed;
  pointer-events: none;
}

.storefront-catalog__empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--public-muted, var(--muted-foreground));
  border: 1px dashed var(--public-border, var(--border));
  border-radius: var(--radius);
}

/* -- Paper View homepage (Pop Soft + Electric) -- */
/* Sheet/scrim sit outside .pv in the DOM, so share the same tokens. */
.pv,
.pv-sheet,
.pv-scrim {
  --pri: #2f6bff;
  --pv-bg: #eef0f3;
  --pv-ink: #1d1d1f;
  --pv-muted: #6e6e73;
  --pv-body: #515154;
  --pv-line: rgba(15, 20, 40, 0.08);
  --pv-edge: 1px solid rgba(15, 20, 40, 0.08);
  --pv-raised: #fff;
  --pv-well: #eef0f3;
  --pv-shine: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --pv-lift:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 12px 28px -12px rgba(15, 20, 40, 0.2);
  --pv-lift-sm:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 8px 18px -10px rgba(15, 20, 40, 0.16);
  --pv-lift-hover:
    0 2px 4px rgba(15, 20, 40, 0.06),
    0 16px 36px -12px rgba(15, 20, 40, 0.24);
  --pv-btn: color-mix(in srgb, var(--pri) 28%, #fff);
  --pv-new: #0f9d58;
  --pv-used: #b45309;
  --ease: 0.18s ease;
}

.pv {
  position: relative;
  min-height: 100vh;
  color: var(--pv-ink);
  background: var(--pv-bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.pv-wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px calc(48px + env(safe-area-inset-bottom, 0px));
}

.pv-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  box-sizing: border-box;
  height: 3.25rem;
  margin-inline: calc(0.75rem - 16px);
  padding: env(safe-area-inset-top, 0px) 0 0;
}

.pv-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  background: color-mix(in srgb, var(--pri) 18%, #fff);
  border: var(--pv-edge);
  border-radius: 999px;
  padding: 0.22rem 0.7rem 0.22rem 0.28rem;
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-logo {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.pv-brand h1 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.2;
}

/* Shared Paper Bill / Paper View mark + switcher */
.product-switch {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  z-index: 40;
}

.product-switch__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  height: 2.05rem;
  min-height: 2.05rem;
  margin: 0;
  padding: 0 0.55rem 0 0.28rem;
  border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pop-rim, #d4d4d4));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pri) 18%, #fff);
  box-shadow: var(--pop-lift-sm, 0 1px 2px rgba(15, 20, 40, 0.05)),
    var(--pop-shine, inset 0 1px 0 rgba(255, 255, 255, 0.95));
  color: var(--foreground, #1d1d1f);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.product-switch__trigger:hover,
.product-switch__trigger:focus-visible {
  border-color: color-mix(in srgb, var(--pri) 34%, var(--pop-rim, #d4d4d4));
  outline: none;
}

.product-switch.is-open .product-switch__trigger {
  border-color: color-mix(in srgb, var(--pri) 40%, var(--pop-rim, #d4d4d4));
}

.product-switch__mark {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  display: block;
}

.product-switch__label {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  /* Inter caps sit high next to the filled mark; nudge down to match the mark center. */
  transform: translateY(1px);
}

.product-switch__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  min-width: 0.9rem;
  min-height: 0.9rem;
  color: var(--muted-foreground, #6e6e73);
  transform: translateY(1px);
  transition: transform 0.15s ease;
}

.product-switch.is-open .product-switch__caret {
  transform: translateY(1px) rotate(180deg);
}

.product-switch__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 12.5rem;
  padding: 0.35rem;
  border: 1px solid var(--pop-rim, #d4d4d4);
  border-radius: calc(var(--radius, 0.75rem) + 4px);
  background: var(--pop-raised, #fff);
  box-shadow: var(--pop-lift, 0 8px 24px rgba(15, 20, 40, 0.12)),
    var(--pop-shine, inset 0 1px 0 rgba(255, 255, 255, 0.95));
}

.product-switch__menu[hidden] {
  display: none !important;
}

.product-switch__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius, 0.75rem);
  color: inherit;
  text-decoration: none;
}

.product-switch__option:hover,
.product-switch__option:focus-visible {
  background: color-mix(in srgb, var(--pri) 10%, #fff);
  outline: none;
  text-decoration: none;
}

.product-switch__option.is-current {
  background: color-mix(in srgb, var(--pri) 16%, #fff);
}

.product-switch__option .product-switch__mark {
  width: 1.35rem;
  height: 1.35rem;
}

.product-switch__option-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.product-switch__option-title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
}

.product-switch__option-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground, #6e6e73);
  line-height: 1.2;
}

.pv .product-switch__trigger {
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pv-line, #d4d4d4));
  background: color-mix(in srgb, var(--pri) 18%, #fff);
  box-shadow: var(--pv-lift-sm, var(--pop-lift-sm)), var(--pv-shine, var(--pop-shine));
}

.pv-dash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pv-line));
  background: var(--pv-btn);
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  color: var(--pv-ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--ease), box-shadow var(--ease);
}

.pv-dash:hover,
.pv-dash:focus,
.pv-dash:focus-visible,
.pv-dash:active {
  background: color-mix(in srgb, var(--pri) 34%, #fff);
  color: var(--pv-ink);
  text-decoration: none;
}

.pv-stats,
.pv-chips {
  display: none;
}

.pv-stat {
  font-size: 13px;
  background: var(--pv-raised);
  border: 1px solid var(--pv-line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--pv-body);
  box-shadow: var(--pv-shine);
}

.pv-stat b {
  color: var(--pv-ink);
  font-weight: 600;
}

.pv-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--pv-bg) 92%, #fff);
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
}

.pv-bar.is-stuck {
  border-bottom-color: var(--pv-line);
}

.pv-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pv-search {
  flex: 1;
  position: relative;
  min-width: 0;
}

.pv-search .icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pv-muted);
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.pv-search input {
  width: 100%;
  height: 30px;
  min-height: 30px;
  border-radius: 12px;
  border: var(--pv-edge);
  background: var(--pv-raised);
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
  padding: 0 0.7rem 0 1.85rem;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--pv-ink);
  transition: box-shadow var(--ease), border-color var(--ease);
}

.pv-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--pri) 35%, var(--pv-line));
  box-shadow:
    var(--pv-lift-sm),
    var(--pv-shine),
    0 0 0 3px color-mix(in srgb, var(--pri) 22%, transparent);
}

.pv-search input::placeholder {
  color: var(--pv-muted);
  font-weight: 400;
}

.pv-fbtn {
  height: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 12px;
  border-radius: 12px;
  border: var(--pv-edge);
  background: var(--pv-raised);
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--pv-ink);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}

.pv-fbtn .icon {
  width: 15px;
  height: 15px;
}

.pv-dot {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--pri) 28%, #fff);
  color: var(--pv-ink);
  border: 1px solid color-mix(in srgb, var(--pri) 18%, var(--pv-line));
  font-size: 11px;
  font-weight: 600;
  display: none;
  place-items: center;
  padding: 0 5px;
}

.pv-dot.is-on {
  display: grid;
}

.pv-chips {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pv-chips::-webkit-scrollbar {
  display: none;
}

.pv-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: var(--control-height);
  border: 1px solid var(--pv-line);
  background: var(--pv-raised);
  border-radius: 999px;
  padding: 0 0.7rem;
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 550;
  color: var(--pv-ink);
  cursor: pointer;
  box-shadow: var(--pv-shine);
  transition: border-color var(--ease), background var(--ease), color var(--ease), box-shadow var(--ease);
}

.pv-chip small {
  color: var(--pv-muted);
  font-weight: 400;
  margin-left: 0.35rem;
  font-size: 0.65rem;
}

.pv-chip:hover {
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pv-line));
}

.pv-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  color: var(--pv-ink);
  border-color: color-mix(in srgb, var(--pri) 18%, var(--pv-line));
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-chip[aria-pressed="true"] small {
  color: var(--pv-body);
}

.pv-adv {
  display: none;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.pv-adv .dd-dropdown {
  width: auto;
  min-width: 11.5rem;
  flex: 0 1 auto;
}

.pv-adv .dd-trigger,
.pv-sheet .dd-trigger {
  border-radius: 12px;
  border-color: var(--pv-line);
  background: var(--pv-raised);
  height: var(--control-height);
  min-height: var(--control-height);
  font-size: var(--control-font-size);
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 14px 0 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.pv-meta:not(:has(.pv-tag)) {
  display: none;
}

.pv-active {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pv-tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: color-mix(in srgb, var(--pri) 18%, #fff);
  border: 1px solid color-mix(in srgb, var(--pri) 14%, var(--pv-line));
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
  box-shadow: var(--pv-shine);
}

.pv-tag button,
.pv-clear {
  font: inherit;
  cursor: pointer;
}

.pv-tag button {
  border: 1px solid var(--pv-line);
  background: var(--pv-raised);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  color: var(--pv-body);
  box-shadow: var(--pv-shine);
}

.pv-clear {
  border: 0;
  background: none;
  color: var(--pv-muted);
  font-size: 13px;
  text-decoration: underline;
  padding: 4px;
}

.pv .pagination-row {
  display: none;
}

.pv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.pv-infinite {
  min-height: 1px;
}

.pv-infinite__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 0 0.2rem;
  font-size: 0.8rem;
  color: var(--pv-muted, var(--muted-foreground));
}

.pv-infinite__status[hidden] {
  display: none;
}

.pv-infinite__skel {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
}

.pv-infinite__sentinel {
  width: 100%;
  height: 1px;
}

.pv-card {
  position: relative;
  background: var(--pv-raised);
  border: var(--pv-edge);
  border-radius: 20px;
  padding: 0 0 10px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--pv-lift), var(--pv-shine);
  transition: box-shadow var(--ease), transform var(--ease);
  overflow: hidden;
}

.pv-card:hover {
  box-shadow: var(--pv-lift-hover), var(--pv-shine);
  transform: translateY(-2px);
}

.pv-hit {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pv-hit:hover,
.pv-hit:focus,
.pv-hit:focus-visible {
  color: inherit;
  text-decoration: none;
}

.pv-media {
  position: relative;
  aspect-ratio: 238 / 242;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
  border: 0;
  box-shadow: none;
}

.pv-media img {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  margin: auto;
  object-fit: contain;
  object-position: center;
}

.pv-phone {
  width: 39%;
  height: auto;
  aspect-ratio: 93 / 188;
  border-radius: 0.7rem;
  background: var(--pv-phone, #8d6b5c);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.pv-phone::before {
  content: "";
  position: absolute;
  top: 7%;
  left: 50%;
  width: 8%;
  aspect-ratio: 1;
  height: auto;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
}

.pv-model {
  position: relative;
  z-index: 1;
  font-size: clamp(26px, 6.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-align: center;
  line-height: 1;
  padding: 0 8px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.pv-brandname {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

.pv-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pri) 22%, #fff);
  color: var(--pv-ink);
  border: 1px solid color-mix(in srgb, var(--pri) 16%, var(--pv-line));
  box-shadow: var(--pv-shine);
}

.pv-body {
  padding: 8px 10px 2px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pv-store {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--pv-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.pv-store .icon {
  width: 12px;
  height: 12px;
  flex: none;
}

.pv-store b {
  font-weight: 500;
  color: var(--pv-body);
}

.pv-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
  color: var(--pv-ink);
}

.pv-spec {
  font-size: 12px;
  font-weight: 400;
  color: var(--pv-muted);
  margin-top: 2px;
  line-height: 1.2;
}

.pv-price {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 8px 0 0;
  line-height: 1.2;
  color: var(--pv-ink);
}

.pv-price.is-none {
  font-size: 12px;
  font-weight: 400;
  color: var(--pv-muted);
}

.pv-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--control-height);
  min-height: var(--control-height);
  text-align: center;
  text-decoration: none;
  background: var(--pv-btn);
  color: var(--pv-ink);
  border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pv-line));
  border-radius: 999px;
  padding: 0 0.65rem;
  font-weight: 600;
  font-size: var(--control-font-size);
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
}

.pv-card:hover .pv-cta,
.pv-cta:hover {
  background: color-mix(in srgb, var(--pri) 34%, #fff);
  color: var(--pv-ink);
}

.pv-empty {
  text-align: center;
  padding: 56px 16px;
  background: var(--pv-raised);
  border: 1px solid var(--pv-line);
  border-radius: 20px;
  box-shadow: var(--pv-lift), var(--pv-shine);
}

.pv-empty h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.pv-empty h3:last-child {
  margin-bottom: 0;
}

.pv-empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pv-btn);
  color: var(--pv-ink);
  border: 1px solid color-mix(in srgb, var(--pri) 22%, var(--pv-line));
  border-radius: 999px;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 0.75rem;
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-foot {
  margin-top: 40px;
  text-align: center;
  color: var(--pv-muted);
  font-size: 13px;
}

.pv .pagination-row {
  margin-top: 22px;
}

.pv .pagination-row .btn {
  background: var(--pv-btn);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pv-line));
  color: var(--pv-ink);
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
}

.pv-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pv-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: #fff;
  background: var(--pv-raised, #fff);
  color: var(--pv-ink, #1d1d1f);
  border: 1px solid var(--pv-line, rgba(15, 20, 40, 0.08));
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 24px 48px -16px rgba(15, 20, 40, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 85vh;
  overflow: auto;
}

.pv-sheet.is-open {
  transform: none;
}

.pv-grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--pv-muted) 35%, #fff);
  margin: 0 auto 14px;
}

.pv-sheet h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--pv-ink);
}

.pv-field {
  margin-bottom: 16px;
}

.pv-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--pv-body);
}

.pv-acts {
  display: flex;
  gap: 0.5rem;
  margin-top: 8px;
}

.pv-acts button {
  flex: 1;
  height: var(--control-height);
  min-height: var(--control-height);
  border-radius: 999px;
  font: inherit;
  font-size: var(--control-font-size);
  font-weight: 600;
  border: 1px solid var(--pv-line);
  background: var(--pv-raised);
  color: var(--pv-ink);
  cursor: pointer;
  box-shadow: var(--pv-lift-sm), var(--pv-shine);
}

.pv-acts .pv-go {
  background: var(--pv-btn);
  color: var(--pv-ink);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--pv-line));
}

@media (min-width: 640px) {
  .pv-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .pv-wrap {
    padding: 0 24px 64px;
  }

  .pv-top {
    margin-inline: calc(0.75rem - 24px);
  }

  .pv-bar {
    margin: 0 -24px;
    padding: 10px 24px;
  }
}

@media (min-width: 861px) {
  .pv-top {
    margin-inline: 0;
  }
}

@media (min-width: 960px) {
  .pv-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .pv-adv {
    display: flex;
  }

  .pv-fbtn {
    display: none;
  }

  .pv-card {
    padding: 0 0 12px;
  }

  .pv-body {
    padding: 10px 12px 2px;
  }
}

@media (max-width: 639px) {
  .pv-dash {
    height: 26px;
    min-height: 26px;
    padding: 0 12px;
  }

  .pv-stat:nth-child(n + 3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pv-card,
  .pv-cta,
  .pv-chip,
  .pv-sheet,
  .pv-scrim {
    transition: none !important;
  }
}

.storefront-pdp__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.storefront-pdp__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: calc(1.1 * clamp(1.15rem, 2.8vw, 1.45rem)); /* match store-name line */
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--public-muted, var(--muted-foreground));
  text-decoration: none;
}

.storefront-pdp__back .icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.storefront-pdp__back:hover {
  color: var(--public-ink, var(--foreground));
}

.storefront-pdp__store {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  min-width: 0;
  text-align: right;
}

.storefront-pdp__store-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--public-ink, var(--foreground));
}

.storefront-pdp__store-location {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--public-ink, var(--foreground));
  opacity: 0.55;
}

.storefront-pdp__summary {
  gap: 0.4rem;
}

.storefront-pdp__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
}

.storefront-pdp__title {
  margin: 0;
  font-size: clamp(1.45rem, 3.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
  color: var(--public-ink, var(--foreground));
}

.storefront-pdp__stock {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pri);
  white-space: nowrap;
  text-align: right;
}

.storefront-pdp__stock.is-out {
  color: var(--public-muted, var(--muted-foreground));
  font-weight: 500;
}

.storefront-pdp__price {
  margin: 0.2rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--public-ink, var(--foreground));
  opacity: 0.85;
}

.storefront-pdp__facts {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 1.5rem;
  padding: 0.15rem 0;
  border-top: 1px solid color-mix(in srgb, var(--public-border, var(--border)) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--public-border, var(--border)) 80%, transparent);
  animation: public-intake-rise 0.6s ease-out 0.1s both;
}

.storefront-pdp__fact {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--public-border, var(--border)) 70%, transparent);
}

.storefront-pdp__fact:last-child {
  border-bottom: none;
}

.storefront-pdp__fact-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  color: var(--public-muted, var(--muted-foreground));
}

.storefront-pdp__fact-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.storefront-pdp__fact-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--public-muted, var(--muted-foreground));
}

.storefront-pdp__fact-value {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--public-ink, var(--foreground));
  word-break: break-word;
}

.storefront-pdp__contact {
  display: flex;
  justify-content: stretch;
  margin: 0 0 1.75rem;
  animation: public-intake-rise 0.6s ease-out 0.12s both;
}

.storefront-pdp__contact-btn {
  width: 100%;
  justify-content: center;
  min-height: 2.75rem;
  font-weight: 600;
}

.storefront-pdp__contact-btn .icon {
  width: 1.05rem;
  height: 1.05rem;
}

@media (min-width: 768px) {
  .storefront-pdp__contact {
    justify-content: flex-start;
  }

  .storefront-pdp__contact-btn {
    width: auto;
    min-width: 12rem;
  }
}

/* Paper View PDP — Pop Soft + Electric (scoped; leave intake pages alone) */
.public-intake.storefront-pdp {
  --pri: #2f6bff;
  --public-ink: #1d1d1f;
  --public-muted: #6e6e73;
  --public-surface: #fff;
  --public-border: rgba(15, 20, 40, 0.08);
  --pop-shine: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --pop-lift:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 12px 28px -12px rgba(15, 20, 40, 0.2);
  --pop-lift-sm:
    0 1px 2px rgba(15, 20, 40, 0.05),
    0 8px 18px -10px rgba(15, 20, 40, 0.16);
  background: #eef0f3;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.public-intake.storefront-pdp .public-intake__glow {
  display: none;
}

.storefront-pdp__back {
  color: var(--public-muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  background: #fff;
  border: 1px solid var(--public-border);
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.storefront-pdp__back:hover {
  color: var(--pri);
  border-color: color-mix(in srgb, var(--pri) 22%, var(--public-border));
}

.storefront-pdp .public-pdp__media,
.storefront-pdp .public-pdp__media--placeholder {
  border-radius: 20px;
  border: 1px solid var(--public-border);
  background: #fff;
  box-shadow: var(--pop-lift), var(--pop-shine);
}

.storefront-pdp .public-pdp__media--placeholder {
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--pri) 10%, #eef0f3),
      #eef0f3 55%,
      #f7f8fa
    );
}

.storefront-pdp .public-pdp__dot.is-active {
  background: var(--pri);
}

.storefront-pdp .public-pdp__dot:focus-visible {
  outline-color: var(--pri);
}

.storefront-pdp__stock {
  color: var(--pri);
}

.storefront-pdp__facts {
  background: #fff;
  border: 1px solid var(--public-border);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  box-shadow: var(--pop-lift), var(--pop-shine);
}

.storefront-pdp__fact {
  border-bottom-color: rgba(15, 20, 40, 0.07);
}

.storefront-pdp__contact {
  gap: 0.65rem;
  flex-wrap: wrap;
}

.storefront-pdp__contact-btn.btn-primary {
  background: color-mix(in srgb, var(--pri) 28%, #fff);
  color: #1d1d1f;
  border: 1px solid color-mix(in srgb, var(--pri) 22%, rgba(15, 20, 40, 0.08));
  border-radius: 999px;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.storefront-pdp__contact-btn.btn-primary:hover {
  background: color-mix(in srgb, var(--pri) 36%, #fff);
  color: #1d1d1f;
}

.storefront-pdp__contact-btn.btn-secondary {
  background: #fff;
  color: #1d1d1f;
  border: 1px solid rgba(15, 20, 40, 0.08);
  border-radius: 999px;
  box-shadow: var(--pop-lift-sm), var(--pop-shine);
}

.storefront-toggle-form {
  display: inline;
  margin: 0;
}

.storefront-manage-table td {
  vertical-align: middle;
}

/* Always fill the card; Product absorbs leftover width, Stock stays compact.
   Override mobile `table.data { min-width: 36rem }` so short content cannot
   leave a blank strip beside the table inside .table-wrap. */
table.data.storefront-manage-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

table.data.storefront-manage-table th.col-product-actions,
table.data.storefront-manage-table td.col-product-actions {
  width: 2rem;
  padding-left: 0.45rem;
  padding-right: 0;
  text-align: left;
  overflow: visible;
  vertical-align: middle;
}

table.data.storefront-manage-table th.col-storefront-listing,
table.data.storefront-manage-table td.col-storefront-listing {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.75rem;
  vertical-align: middle;
}

table.data.storefront-manage-table th.col-storefront-product,
table.data.storefront-manage-table td.col-storefront-product {
  width: auto;
}

table.data.storefront-manage-table th.col-storefront-stock,
table.data.storefront-manage-table td.col-storefront-stock {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.75rem;
  text-align: left;
}

.storefront-listed-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.storefront-listed-switch__track {
  position: relative;
  display: block;
  width: 2.15rem;
  height: 1.2rem;
  border-radius: 999px;
  background: var(--pop-well);
  border: 1px solid var(--pop-rim);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.storefront-listed-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0.12rem;
  width: 0.88rem;
  height: 0.88rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition: left 0.15s ease;
}

/* Same soft primary blue as .btn-primary / Share. */
.storefront-listed-switch.is-on .storefront-listed-switch__track {
  background: color-mix(in srgb, var(--pri) 28%, #fff);
  border-color: color-mix(in srgb, var(--pri) 28%, var(--pop-rim));
}

.storefront-listed-switch.is-on .storefront-listed-switch__thumb {
  left: calc(100% - 1rem);
}

.storefront-listed-switch:hover .storefront-listed-switch__track,
.storefront-listed-switch:focus-visible .storefront-listed-switch__track {
  filter: brightness(0.97);
}

.storefront-listed-switch:focus-visible {
  outline: none;
}

.storefront-listed-switch:focus-visible .storefront-listed-switch__track {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pri) 25%, transparent);
}

/* Unlisted product tour (/n/<slug>/). A reading column, not an app screen. */
body:has(.essay) .support-launcher {
  display: none;
}

.essay {
  min-height: 100vh;
  background: var(--pop-bg, #eef0f3);
  color: var(--pop-text, #1d1d1f);
}

.essay__sheet {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4.5rem;
}

.essay__brand {
  margin: 0 0 2.25rem;
}

.essay__brand .brand {
  padding: 0;
  color: var(--foreground);
}

.essay__kicker {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.essay__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.essay__dek {
  margin: 1rem 0 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: #3f3f3f;
}

.essay__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 1.15rem 0 0;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.essay__meta-dot {
  color: #c4c4c4;
}

.essay__body {
  margin-top: 1.75rem;
}

.essay__body p {
  margin: 0 0 1.05rem;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.essay__lede {
  font-size: 1.15rem;
  line-height: 1.65;
}

.essay h2 {
  margin: 2.75rem 0 0.85rem;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.essay__pull {
  margin: 1.75rem 0 1.85rem;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 2px solid var(--ink);
}

.essay__pull p {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.essay__figure {
  margin: 1.85rem 0 2rem;
}

.essay__plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  aspect-ratio: 16 / 10;
  margin: 0;
  padding: 1.15rem 1.2rem;
  border: 1px dashed #c8c8c8;
  border-radius: 0.7rem;
  background: var(--muted);
  text-align: center;
}

.essay__plate--video {
  gap: 0.15rem;
}

.essay__play {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

.essay__play svg {
  display: block;
  margin-left: 2px;
}

.essay__plate-kicker {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.essay__plate-title {
  margin: 0;
  max-width: 18rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.essay__caption {
  margin-top: 0.7rem;
}

.essay__caption p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #3f3f3f;
}

.essay__caption-note {
  margin-top: 0.35rem !important;
  font-size: 0.8125rem !important;
  line-height: 1.5 !important;
  color: var(--muted-foreground) !important;
}

.essay__close {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.essay__close p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

@media (min-width: 840px) {
  .essay {
    background: transparent;
  }

  .essay__sheet {
    margin: 2.5rem auto 3rem;
    padding: 3rem 3.15rem 3.5rem;
    background: var(--card);
    border-radius: 0.85rem;
    box-shadow: var(--shadow);
  }

  .essay__title {
    font-size: 2.45rem;
  }
}

@media (max-width: 420px) {
  .essay__title {
    font-size: 1.7rem;
  }

  .essay__body p,
  .essay__lede {
    font-size: 1.02rem;
  }
}

/* Stock scan (Add Stock box OCR) */
.stock-scan-modal__experimental {
  font-weight: 500;
  color: var(--muted-foreground);
}

dialog.modal.stock-scan-modal {
  width: min(100%, 28rem);
  max-width: calc(100vw - 1.5rem);
}

.stock-scan-modal .modal__shell {
  width: 100%;
  max-width: 100%;
  max-height: min(92vh, 40rem);
  display: flex;
  flex-direction: column;
  margin-inline: auto;
}

.stock-scan-modal .modal__body.stock-scan-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.stock-scan-modal__thumbs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  width: 100%;
}

.stock-scan-modal__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.45rem;
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 0;
  box-sizing: border-box;
}

.stock-scan-modal__thumb--empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: transparent;
  color: var(--muted-foreground);
}

.stock-scan-modal__thumb--empty.is-clickable {
  cursor: pointer;
}

.stock-scan-modal__thumb--empty.is-clickable:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

.stock-scan-modal__thumb--empty .icon,
.stock-scan-modal__thumb-empty-icon {
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.7;
  display: inline-flex;
  line-height: 0;
}

.stock-scan-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stock-scan-modal__thumb-remove {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.stock-scan-modal__thumb-remove:hover {
  background: rgba(0, 0, 0, 0.88);
}

.stock-scan-modal__stage {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  box-sizing: border-box;
}

.stock-scan-modal__camera {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  justify-content: center;
}

.stock-scan-modal__camera[hidden],
.stock-scan-modal__progress[hidden],
.stock-scan-modal__review[hidden] {
  display: none !important;
}

.stock-scan-modal__video-wrap {
  position: relative;
  /* Full body width — avoids aspect-ratio + max-height shrinking left-aligned */
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  margin-inline: auto;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  box-sizing: border-box;
}

.stock-scan-modal__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
}

.stock-scan-modal__video[hidden] {
  display: none !important;
}

.stock-scan-modal__video.is-live {
  display: block !important;
}

.stock-scan-modal__cam-status {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  margin: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #fff;
  pointer-events: none;
}

.stock-scan-modal__cam-status[hidden] {
  display: none !important;
}

.stock-scan-modal__shutter {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin: 0;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.stock-scan-modal__shutter .icon {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  min-height: 1.45rem;
}

.stock-scan-modal__shutter:disabled {
  opacity: 0.45;
  cursor: default;
}

.stock-scan-modal__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 14rem;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  box-sizing: border-box;
}

.stock-scan-modal__progress p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.stock-scan-modal__review {
  width: 100%;
  min-height: 14rem;
  max-height: min(58vh, 28rem);
  overflow: auto;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  box-sizing: border-box;
}

.stock-scan-modal__review-lede {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
}

.stock-scan-modal__review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.stock-scan-modal__review-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--card);
}

.stock-scan-modal__review-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: capitalize;
}

.stock-scan-modal__review-value {
  font-size: 0.875rem;
  word-break: break-word;
}

.stock-scan-modal__review-empty {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  text-align: center;
}

.stock-scan-modal__footer {
  justify-content: center;
}

.stock-scan-modal__footer[hidden] {
  display: none !important;
}

.stock-scan-modal__footer .btn[hidden] {
  display: none !important;
}
