/* =========================================================================
   HSB Feature Showcase
   =========================================================================
   Clickable feature cards + the reusable demo modal they open. Everything
   here is built from the existing theme tokens, so light and dark mode come
   for free and the modal reads as part of the landing page.
   ========================================================================= */

/* ---- Clickable feature card -------------------------------------------- */

.hsb-bento-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.82rem;
  color: var(--hsb-text-subtle);
}

.hsb-feature-interactive { cursor: pointer; }

/* The label is a real button; its ::after stretches over the whole card so
   the entire tile is clickable while the heading keeps its semantics. */
.hsb-feature-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hsb-link);
  cursor: pointer;
}
/* Sits above the card's decorative visuals (the PDF stack raises its own
   pages), so every part of the tile activates the demo. */
.hsb-feature-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
}
.hsb-feature-arrow {
  transition: transform var(--hsb-dur) var(--hsb-ease);
}

.hsb-feature-interactive:hover .hsb-feature-arrow { transform: translateX(4px); }
.hsb-feature-interactive:hover {
  border-color: var(--hsb-brand);
  box-shadow: var(--hsb-shadow-lg), 0 0 0 4px var(--hsb-brand-soft);
}

/* Keyboard focus lands on the trigger; the ring is drawn on the whole card. */
.hsb-feature-interactive:focus-within {
  outline: 2px solid var(--hsb-brand);
  outline-offset: 3px;
}
.hsb-feature-trigger:focus-visible { outline: none; }

@supports selector(:has(*)) {
  .hsb-feature-interactive:focus-within { outline: none; }
  .hsb-feature-interactive:has(.hsb-feature-trigger:focus-visible) {
    outline: 2px solid var(--hsb-brand);
    outline-offset: 3px;
  }
}

/* ---- Modal shell -------------------------------------------------------- */

.hsb-modal-open { overflow: hidden; }

dialog.hsb-fx-modal {
  width: min(1080px, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  border: 1px solid var(--hsb-border-strong);
  border-radius: var(--hsb-r-xl);
  background: var(--hsb-surface);
  color: var(--hsb-text);
  box-shadow: var(--hsb-shadow-lg);
  overflow: hidden;
}
dialog.hsb-fx-modal::backdrop {
  background: rgba(2, 8, 20, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
dialog.hsb-fx-modal[open] {
  animation: hsb-fx-in 240ms var(--hsb-ease-out) both;
}
@keyframes hsb-fx-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.hsb-fx-panel {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 920px);
}

/* ---- Header ------------------------------------------------------------- */

.hsb-fx-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--hsb-border);
  background: var(--hsb-surface-2);
}
.hsb-fx-head-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--hsb-r-md);
  background: var(--hsb-brand-soft);
  border: 1px solid var(--hsb-brand-ring);
  color: var(--hsb-brand);
  font-size: 1.15rem;
}
.hsb-fx-head-icon svg { width: 22px; height: 22px; }
.hsb-fx-head-text { flex: 1; min-width: 0; }
.hsb-fx-head-text h2 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0 0 0.15rem;
  letter-spacing: -0.015em;
}
.hsb-fx-head-text p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--hsb-text-muted);
}
.hsb-fx-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface);
  color: var(--hsb-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--hsb-dur-fast) var(--hsb-ease),
              border-color var(--hsb-dur-fast) var(--hsb-ease);
}
.hsb-fx-close:hover { color: var(--hsb-text); border-color: var(--hsb-brand); }

/* ---- Body --------------------------------------------------------------- */

.hsb-fx-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.35rem;
  padding: 1.35rem;
}
.hsb-fx-body.is-swapping > * {
  animation: hsb-fx-swap 280ms var(--hsb-ease-out) both;
}
.hsb-fx-body.is-swapping > *:last-child { animation-delay: 60ms; }
@keyframes hsb-fx-swap {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hsb-fx-about p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--hsb-text-muted);
  margin: 0 0 0.9rem;
}
.hsb-fx-about h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hsb-brand);
  margin: 0 0 0.5rem;
}
.hsb-fx-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.hsb-fx-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--hsb-text);
}
.hsb-fx-benefits span {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--hsb-success-bg);
  color: var(--hsb-success);
  font-size: 0.68rem;
  font-weight: 800;
}

.hsb-fx-demo {
  min-width: 0;
  padding: 1rem;
  border-radius: var(--hsb-r-lg);
  border: 1px solid var(--hsb-border);
  background: var(--hsb-bg-elev);
}

/* ---- Footer ------------------------------------------------------------- */

.hsb-fx-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--hsb-border);
  background: var(--hsb-surface-2);
}
.hsb-fx-counter {
  flex: 1;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--hsb-text-subtle);
}

/* ---- Shared demo primitives -------------------------------------------- */

.hsb-fx-label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--hsb-text-subtle);
}
.hsb-fx-note {
  margin: 0.7rem 0 0;
  font-size: 0.73rem;
  line-height: 1.5;
  color: var(--hsb-text-subtle);
}
.hsb-fx-muted { color: var(--hsb-text-muted); }
.hsb-fx-mono { font-variant-numeric: tabular-nums; }
.hsb-fx-empty {
  margin: 0;
  padding: 0.9rem;
  border-radius: var(--hsb-r-sm);
  border: 1px dashed var(--hsb-border-strong);
  font-size: 0.8rem;
  color: var(--hsb-text-subtle);
  text-align: center;
}
.hsb-fx-scroll { overflow-x: auto; }

.hsb-fx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.9rem;
  margin-bottom: 0.85rem;
}
.hsb-fx-toolbar .hsb-fx-note { margin: 0; }
.hsb-fx-seg {
  padding: 0.4rem 0.75rem;
  border-radius: var(--hsb-r-pill);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface);
  color: var(--hsb-text-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--hsb-dur-fast) var(--hsb-ease),
              color var(--hsb-dur-fast) var(--hsb-ease),
              border-color var(--hsb-dur-fast) var(--hsb-ease);
}
.hsb-fx-seg:hover { border-color: var(--hsb-brand); color: var(--hsb-text); }
.hsb-fx-seg[aria-pressed="true"] {
  background: var(--hsb-brand-soft);
  border-color: var(--hsb-brand);
  color: var(--hsb-brand);
}

.hsb-fx-field {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hsb-text-muted);
}
.hsb-fx-field > span { display: block; margin-bottom: 0.25rem; }
.hsb-fx-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface);
  color: var(--hsb-text);
  font: inherit;
  font-size: 0.8rem;
}
.hsb-fx-input:focus-visible {
  outline: 2px solid var(--hsb-brand);
  outline-offset: 1px;
}

.hsb-fx-kpis,
.hsb-fx-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.hsb-fx-kpi {
  padding: 0.6rem 0.7rem;
  border-radius: var(--hsb-r-md);
  border: 1px solid var(--hsb-border);
  background: var(--hsb-surface);
}
.hsb-fx-kpi small {
  display: block;
  font-size: 0.68rem;
  color: var(--hsb-text-subtle);
  margin-bottom: 0.15rem;
}
.hsb-fx-kpi strong {
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  color: var(--hsb-text);
}
.hsb-fx-kpi strong.is-warn { color: var(--hsb-warning); }

.hsb-fx-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: var(--hsb-r-pill);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.hsb-fx-badge.is-ok { background: var(--hsb-success-bg); color: var(--hsb-success); }
.hsb-fx-badge.is-warn { background: var(--hsb-warning-bg); color: var(--hsb-warning); }
.hsb-fx-badge.is-bad { background: var(--hsb-danger-bg); color: var(--hsb-danger); }
.hsb-fx-badge.is-muted { background: var(--hsb-surface-2); color: var(--hsb-text-subtle); }

.hsb-fx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.hsb-fx-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hsb-text-subtle);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--hsb-border-strong);
  white-space: nowrap;
}
.hsb-fx-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--hsb-border);
  color: var(--hsb-text);
  white-space: nowrap;
}
.hsb-fx-table tbody tr:last-child td { border-bottom: 0; }
.hsb-fx-table tr.is-flash td {
  background: var(--hsb-brand-soft);
  transition: background var(--hsb-dur-slow) var(--hsb-ease);
}
.hsb-fx-table[data-refreshing] tbody { opacity: 0.35; transition: opacity var(--hsb-dur-fast) linear; }
.hsb-fx-row-in { animation: hsb-fx-row 320ms var(--hsb-ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes hsb-fx-row {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Demo: dashboard ---------------------------------------------------- */

.hsb-fx-chart-wrap { margin-top: 0.2rem; }
.hsb-fx-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  padding: 0.5rem 0.4rem 0;
  border-radius: var(--hsb-r-md);
  background: var(--hsb-surface);
  border: 1px solid var(--hsb-border);
}
.hsb-fx-chart span {
  flex: 1;
  height: var(--h, 40%);
  border-radius: 4px 4px 0 0;
  background: var(--hsb-grad-brand);
  opacity: 0.9;
  animation: hsb-fx-grow 460ms var(--hsb-ease-out) both;
  animation-delay: var(--d, 0ms);
  transform-origin: bottom;
}
@keyframes hsb-fx-grow {
  from { transform: scaleY(0.04); opacity: 0.35; }
  to   { transform: scaleY(1); opacity: 0.9; }
}
.hsb-fx-axis {
  display: flex;
  gap: 6px;
  margin-top: 0.3rem;
}
.hsb-fx-axis span {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  color: var(--hsb-text-subtle);
}

/* ---- Demo: point of sale ------------------------------------------------ */

.hsb-fx-pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.9rem;
}
.hsb-fx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.hsb-fx-prod {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.5rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border);
  background: var(--hsb-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--hsb-dur-fast) var(--hsb-ease),
              transform var(--hsb-dur-fast) var(--hsb-ease);
}
.hsb-fx-prod:hover { border-color: var(--hsb-brand); transform: translateY(-1px); }
.hsb-fx-prod-name { font-size: 0.78rem; font-weight: 600; color: var(--hsb-text); }
.hsb-fx-prod-sku { grid-column: 1; font-size: 0.66rem; color: var(--hsb-text-subtle); }
.hsb-fx-prod-price {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.78rem; font-weight: 700;
  color: var(--hsb-brand);
  font-variant-numeric: tabular-nums;
}

.hsb-fx-cart { display: grid; gap: 0.3rem; margin-bottom: 0.7rem; }
.hsb-fx-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--hsb-r-sm);
  background: var(--hsb-surface);
  border: 1px solid var(--hsb-border);
}
.hsb-fx-line-name { font-size: 0.76rem; color: var(--hsb-text); }
.hsb-fx-line-total { font-size: 0.76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hsb-fx-qty { display: inline-flex; align-items: center; gap: 0.25rem; }
.hsb-fx-qty button {
  width: 24px; height: 24px;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface-2);
  color: var(--hsb-text);
  font: inherit; font-size: 0.85rem; line-height: 1;
  cursor: pointer;
}
.hsb-fx-qty button:hover { border-color: var(--hsb-brand); color: var(--hsb-brand); }
.hsb-fx-qty b { min-width: 1.4rem; text-align: center; font-size: 0.78rem; font-variant-numeric: tabular-nums; }

.hsb-fx-totals { margin: 0.7rem 0 0; display: grid; gap: 0.2rem; }
.hsb-fx-total-row {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.78rem; color: var(--hsb-text-muted);
}
.hsb-fx-total-row dt, .hsb-fx-total-row dd { margin: 0; }
.hsb-fx-total-row dd { font-variant-numeric: tabular-nums; }
.hsb-fx-total-row.is-strong { color: var(--hsb-text); font-weight: 700; }
.hsb-fx-total-row.is-strong dd { color: var(--hsb-brand); }

/* ---- Demo: roles -------------------------------------------------------- */

.hsb-fx-role-blurb { margin: 0 0 0.7rem; font-size: 0.8rem; color: var(--hsb-text-muted); }
.hsb-fx-perms { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.hsb-fx-perm {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border);
  background: var(--hsb-surface);
  font-size: 0.79rem;
  color: var(--hsb-text-muted);
  transition: border-color var(--hsb-dur-fast) var(--hsb-ease);
}
.hsb-fx-perm.is-on { color: var(--hsb-text); border-color: var(--hsb-brand-ring); }
.hsb-fx-perm .hsb-fx-check {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: var(--hsb-r-sm);
  background: var(--hsb-danger-bg); color: var(--hsb-danger);
  font-size: 0.7rem; font-weight: 800;
}
.hsb-fx-perm.is-on .hsb-fx-check { background: var(--hsb-success-bg); color: var(--hsb-success); }
.hsb-fx-perm-state { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Demo: subscriptions ------------------------------------------------ */

.hsb-fx-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.hsb-fx-plan {
  padding: 0.7rem 0.8rem;
  border-radius: var(--hsb-r-md);
  border: 1px solid var(--hsb-brand-ring);
  background: var(--hsb-surface);
}
.hsb-fx-plan.is-muted { border-color: var(--hsb-border); opacity: 0.75; }
.hsb-fx-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hsb-fx-plan-top strong { font-size: 0.85rem; }
.hsb-fx-plan-price {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.05rem; font-weight: 800;
  color: var(--hsb-brand);
  font-variant-numeric: tabular-nums;
}
.hsb-fx-plan-price small { font-size: 0.68rem; font-weight: 600; color: var(--hsb-text-subtle); }
.hsb-fx-meta { margin: 0; display: grid; gap: 0.15rem; }
.hsb-fx-meta > div { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.72rem; }
.hsb-fx-meta dt { margin: 0; color: var(--hsb-text-subtle); }
.hsb-fx-meta dd { margin: 0; color: var(--hsb-text); font-weight: 600; }

.hsb-fx-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.hsb-fx-method {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--hsb-r-md);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--hsb-dur-fast) var(--hsb-ease),
              background var(--hsb-dur-fast) var(--hsb-ease);
}
.hsb-fx-method strong { font-size: 0.8rem; color: var(--hsb-text); }
.hsb-fx-method small { font-size: 0.68rem; color: var(--hsb-text-subtle); }
.hsb-fx-method[aria-pressed="true"] { border-color: var(--hsb-brand); background: var(--hsb-brand-soft); }

/* ---- Demo: reports ------------------------------------------------------ */

.hsb-fx-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 0.6rem;
  margin-bottom: 0.4rem;
}

/* ---- Demo: offline ------------------------------------------------------ */

.hsb-fx-conn { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.85rem; }
.hsb-fx-switch {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0; border: 0; background: none;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  color: var(--hsb-text); cursor: pointer;
}
.hsb-fx-switch-track {
  position: relative;
  width: 42px; height: 24px;
  border-radius: var(--hsb-r-pill);
  background: var(--hsb-success);
  transition: background var(--hsb-dur) var(--hsb-ease);
}
.hsb-fx-switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--hsb-dur) var(--hsb-ease);
}
.hsb-fx-switch[aria-pressed="true"] .hsb-fx-switch-track { background: var(--hsb-warning); }
.hsb-fx-switch[aria-pressed="true"] .hsb-fx-switch-knob { transform: translateX(18px); }

.hsb-fx-pending { font-size: 0.78rem; color: var(--hsb-text-muted); }
.hsb-fx-pending b { color: var(--hsb-text); font-variant-numeric: tabular-nums; }

.hsb-fx-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.hsb-fx-queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--hsb-r-sm);
  border: 1px solid var(--hsb-border);
  background: var(--hsb-surface);
  font-size: 0.76rem;
  animation: hsb-fx-row 300ms var(--hsb-ease-out) both;
}
.hsb-fx-queue-item.is-syncing { border-color: var(--hsb-warning); }
.hsb-fx-queue-item.is-synced { border-color: var(--hsb-success); }

/* ---- Demo: PDF preview -------------------------------------------------- */

.hsb-fx-checks { display: flex; flex-wrap: wrap; gap: 1.1rem; margin: 0.35rem 0 0.85rem; align-items: center; }
.hsb-fx-check {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; color: var(--hsb-text-muted); cursor: pointer;
  width: auto; height: auto;
  user-select: none;
}
.hsb-fx-check input { accent-color: var(--hsb-brand); width: 15px; height: 15px; margin: 0; cursor: pointer; }

.hsb-fx-paper {
  position: relative;
  padding: 1rem;
  margin-bottom: 0.9rem;
  border-radius: var(--hsb-r-md);
  border: 1px solid var(--hsb-border-strong);
  background: var(--hsb-surface);
  box-shadow: var(--hsb-shadow-sm);
}
.hsb-fx-paper-stamp {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--hsb-r-sm);
  border: 1px dashed var(--hsb-danger);
  color: var(--hsb-danger);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hsb-fx-paper-head {
  display: grid; gap: 0.1rem;
  padding-bottom: 0.6rem; margin-bottom: 0.7rem;
  border-bottom: 2px solid var(--hsb-brand);
}
.hsb-fx-paper-head strong { font-size: 0.86rem; }
.hsb-fx-paper-head span { font-size: 0.78rem; font-weight: 600; color: var(--hsb-brand); }
.hsb-fx-paper-head small { font-size: 0.68rem; color: var(--hsb-text-subtle); }
.hsb-fx-paper-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.hsb-fx-paper-summary div {
  padding: 0.4rem 0.5rem;
  border-radius: var(--hsb-r-sm);
  background: var(--hsb-surface-2);
}
.hsb-fx-paper-summary small { display: block; font-size: 0.64rem; color: var(--hsb-text-subtle); }
.hsb-fx-paper-summary b { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.hsb-fx-table-paper { font-size: 0.72rem; }
.hsb-fx-paper-foot {
  margin-top: 0.7rem; padding-top: 0.5rem;
  border-top: 1px solid var(--hsb-border);
  font-size: 0.64rem; color: var(--hsb-text-subtle);
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 900px) {
  .hsb-fx-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem;
  }
  .hsb-fx-pos { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  dialog.hsb-fx-modal {
    width: 100vw;
    max-width: 100vw;
    border: 0;
    border-radius: 0;
    margin: 0;
  }
  .hsb-fx-panel { max-height: 100dvh; height: 100dvh; }
  .hsb-fx-head { padding: 0.9rem 1rem; position: sticky; top: 0; z-index: 2; }
  .hsb-fx-body { padding: 1rem; }
  .hsb-fx-foot { padding: 0.75rem 1rem; flex-wrap: wrap; }
  .hsb-fx-foot .hsb-btn { flex: 1 1 auto; }
  .hsb-fx-counter { order: -1; flex-basis: 100%; }
  /* Touch-friendly demo controls */
  .hsb-fx-seg { padding: 0.5rem 0.85rem; font-size: 0.8rem; }
  .hsb-fx-qty button { width: 30px; height: 30px; }
  .hsb-fx-input { padding: 0.55rem 0.65rem; font-size: 0.85rem; }
  .hsb-fx-prod { padding: 0.6rem; }
  .hsb-fx-check input { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.hsb-fx-modal[open],
  .hsb-fx-body.is-swapping > *,
  .hsb-fx-chart span,
  .hsb-fx-row-in,
  .hsb-fx-queue-item {
    animation: none;
  }
  .hsb-feature-arrow,
  .hsb-fx-switch-knob { transition: none; }
}
