:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-muted: #f8faf9;
  --ink: #18201d;
  --ink-soft: #53605b;
  --muted: #7c8984;
  --line: #dfe5e2;
  --line-strong: #cbd5d0;
  --sidebar: #17201d;
  --sidebar-soft: #212c28;
  --sidebar-text: #edf3f0;
  --accent: #087b63;
  --accent-dark: #08604f;
  --accent-soft: #e7f4ef;
  --amber: #bd6d13;
  --amber-soft: #fff2df;
  --red: #bb4239;
  --red-soft: #fcecea;
  --purple: #7255a5;
  --purple-soft: #f2edf9;
  --blue: #2c66a0;
  --blue-soft: #eaf2fa;
  --shadow: 0 1px 2px rgba(18, 29, 24, 0.04), 0 10px 28px rgba(18, 29, 24, 0.05);
  --sidebar-width: 248px;
  --topbar-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px;
  background: #eef2f0;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.auth-brand > div {
  display: flex;
  flex-direction: column;
}

.auth-brand strong {
  font-size: 16px;
}

.auth-brand small,
.auth-heading p {
  color: var(--muted);
}

.auth-heading {
  padding: 28px 0 22px;
}

.auth-heading h1 {
  margin: 5px 0 8px;
  font-size: 24px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-error {
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #f1c8c4;
  border-radius: 6px;
}

.user-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.user-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.user-button svg,
.user-button i {
  width: 16px;
  height: 16px;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="radio"],
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(8, 123, 99, 0.18);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: var(--sidebar-text);
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-block {
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 20px;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  font-size: 16px;
  font-weight: 800;
}

.brand-block > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.brand-block strong {
  font-size: 15px;
}

.brand-block span {
  color: #9aaba4;
  font-size: 11px;
}

.sidebar-close {
  display: none;
  color: var(--sidebar-text);
}

.main-nav {
  display: flex;
  overflow-y: auto;
  flex: 1;
  flex-direction: column;
  padding: 20px 12px;
}

.nav-label {
  display: block;
  padding: 0 11px 8px;
  color: #74867f;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 24px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  color: #aebdb7;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-item:hover {
  color: #f8fbfa;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.is-active {
  color: #fff;
  background: var(--sidebar-soft);
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  background: #39b99b;
  border-radius: 0 2px 2px 0;
  content: "";
}

.nav-item > svg,
.nav-item > i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  font-size: 10px;
  font-style: normal;
}

.nav-state,
.nav-count {
  margin-left: auto;
  padding: 2px 6px;
  color: #75d4ba;
  background: rgba(25, 156, 122, 0.14);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.nav-state.is-off {
  color: #98a7a1;
  background: rgba(255, 255, 255, 0.07);
}

.nav-count {
  min-width: 20px;
  color: #d7e0dc;
  background: rgba(255, 255, 255, 0.09);
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-state {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.system-state > div {
  display: flex;
  flex-direction: column;
}

.system-state strong {
  font-size: 12px;
  font-weight: 650;
}

.system-state span:not(.status-dot) {
  color: #83958d;
  font-size: 10px;
}

.version {
  display: block;
  margin: 12px 0 0 18px;
  color: #60726a;
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 6px;
  background: #28b58f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(40, 181, 143, 0.12);
}

.main-area {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.topbar-title,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-title {
  gap: 12px;
}

.topbar-title > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-actions {
  gap: 10px;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sync-status .status-dot {
  margin: 0;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.icon-button svg,
.icon-button i {
  width: 17px;
  height: 17px;
  font-style: normal;
}

.balance-button {
  display: flex;
  min-width: 140px;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.balance-button:hover {
  border-color: var(--accent);
}

.balance-button span {
  color: var(--muted);
  font-size: 10px;
}

.balance-button strong {
  font-size: 14px;
}

.mobile-menu {
  display: none;
}

.content-wrap {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px 30px 54px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 170ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice-strip {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.notice-strip > svg,
.notice-strip > i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--accent);
  font-style: normal;
}

.notice-strip > div {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.notice-strip strong {
  white-space: nowrap;
}

.notice-strip span {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.text-button:hover {
  color: var(--accent-dark);
}

.text-button svg,
.text-button i {
  width: 14px;
  height: 14px;
  font-style: normal;
}

.section-heading,
.surface-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin: 30px 0 14px;
}

.section-heading > div,
.surface-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.surface-heading > div:has(.step-index) {
  flex-direction: row;
  align-items: center;
  gap: 9px;
}

.section-meta,
.muted {
  color: var(--muted);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.balance-card {
  position: relative;
  overflow: hidden;
  min-height: 134px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(18, 29, 24, 0.02);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-color, var(--accent));
  content: "";
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.metric-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--metric-color, var(--accent));
  background: color-mix(in srgb, var(--metric-color, var(--accent)) 10%, white);
  border-radius: 6px;
}

.metric-icon svg,
.metric-icon i {
  width: 16px;
  height: 16px;
  font-style: normal;
}

.metric-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 13px;
}

.metric-number strong {
  font-size: 28px;
  line-height: 1;
}

.metric-number span {
  color: var(--ink-soft);
  font-size: 12px;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.metric-foot .good {
  color: var(--accent);
}

.skeleton-card {
  background: linear-gradient(90deg, #fff 0%, #f6f8f7 46%, #fff 100%);
  background-size: 220% 100%;
  animation: skeleton 1.2s ease infinite;
}

@keyframes skeleton {
  to { background-position: -220% 0; }
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.capacity-surface,
.inventory-surface,
.recent-surface,
.form-surface,
.trigger-surface,
.delivery-surface,
.orders-surface,
.ledger-surface,
.api-section,
.support-topics,
.support-contact {
  padding: 20px;
}

.health-badge {
  padding: 3px 7px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #cde8df;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.health-badge.warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #f1d6ae;
}

.health-badge.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f1c9c5;
}

.health-badge.neutral {
  color: var(--ink-soft);
  background: var(--surface-muted);
  border-color: var(--line);
}

.capacity-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0 17px;
}

.capacity-value {
  display: flex;
  align-items: baseline;
}

.capacity-value strong {
  font-size: 42px;
  line-height: 0.9;
}

.capacity-value span {
  color: var(--ink-soft);
  font-size: 16px;
}

.capacity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capacity-copy strong {
  font-size: 16px;
}

.capacity-copy span {
  color: var(--muted);
  font-size: 10px;
}

.progress-track {
  position: relative;
  height: 8px;
  overflow: visible;
  background: #edf1ef;
  border-radius: 3px;
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 350ms ease;
}

.progress-track > i {
  position: absolute;
  top: -4px;
  left: 82%;
  width: 2px;
  height: 16px;
  background: var(--ink-soft);
  border: 2px solid var(--surface);
  border-top: 0;
  border-bottom: 0;
  transform: translateX(-1px);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.forecast-bars {
  display: flex;
  height: 56px;
  align-items: end;
  gap: 5px;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.forecast-bars span {
  min-width: 4px;
  flex: 1;
  height: var(--height);
  max-height: 44px;
  background: #dcebe6;
  border-radius: 2px 2px 0 0;
}

.forecast-bars span:nth-last-child(-n+4) {
  background: #85c5b5;
}

.inventory-list {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}

.inventory-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.inventory-item:first-child {
  border-top: 0;
}

.inventory-copy {
  display: flex;
  flex-direction: column;
}

.inventory-copy strong {
  font-size: 13px;
}

.inventory-copy span {
  color: var(--muted);
  font-size: 10px;
}

.inventory-count {
  text-align: right;
}

.inventory-count strong {
  display: block;
  font-size: 19px;
  line-height: 1;
}

.inventory-count span {
  color: var(--muted);
  font-size: 9px;
}

.stock-meter {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: #edf1ef;
  border-radius: 2px;
}

.stock-meter span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.recent-surface {
  margin-top: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 11px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.align-right {
  text-align: right;
}

.mono {
  color: var(--ink);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
}

.status-badge::before {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.status-badge.preparing,
.status-badge.waiting_stock {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.ready {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-badge.delivered {
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-row td {
  height: 96px;
  color: var(--muted);
  text-align: center;
}

.page-intro {
  margin: 4px 0 24px;
}

.page-intro h2 {
  margin: 3px 0 6px;
}

.page-intro p {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 12px;
}

.split-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.master-switch,
.toggle-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

.master-switch > span,
.toggle-line > span {
  display: flex;
  flex-direction: column;
}

.master-switch strong,
.toggle-line strong {
  font-size: 12px;
}

.master-switch small,
.toggle-line small {
  color: var(--muted);
  font-size: 9px;
}

.master-switch input,
.toggle-line input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.master-switch > i,
.toggle-line > i {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  background: #cbd4d0;
  border-radius: 11px;
  transition: background-color 150ms ease;
}

.master-switch > i::after,
.toggle-line > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 150ms ease;
}

.master-switch input:checked + i,
.toggle-line input:checked + i {
  background: var(--accent);
}

.master-switch input:checked + i::after,
.toggle-line input:checked + i::after {
  transform: translateX(18px);
}

.master-switch input:focus-visible + i,
.toggle-line input:focus-visible + i {
  outline: 3px solid rgba(8, 123, 99, 0.18);
  outline-offset: 2px;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-surface,
.trigger-surface,
.delivery-surface {
  box-shadow: 0 1px 2px rgba(18, 29, 24, 0.03);
}

.step-index,
.form-section-title > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  gap: 14px;
}

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

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
  margin-top: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.field > span,
.field legend,
.redeem-card label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.field small,
.redeem-card small {
  color: var(--muted);
  font-size: 9px;
}

.field input,
.field select,
.field textarea,
.redeem-input input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.redeem-input input:hover {
  border-color: #aebcb6;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.redeem-input input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(8, 123, 99, 0.08);
}

.input-suffix {
  display: flex;
  min-width: 0;
  align-items: stretch;
}

.input-suffix input {
  border-radius: 5px 0 0 5px;
}

.input-suffix > span {
  display: grid;
  min-width: 38px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 5px 5px 0;
  font-size: 10px;
}

.inline-note,
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 15px;
  padding: 10px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border-left: 2px solid var(--line-strong);
  border-radius: 3px;
  font-size: 10px;
}

.connection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.connection-actions .secondary-button {
  min-height: 34px;
}

.connection-result {
  overflow: hidden;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-result.is-success {
  color: var(--accent);
}

.connection-result.is-error {
  color: var(--red);
}

.inline-note svg,
.inline-note i,
.privacy-note svg,
.privacy-note i {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--accent);
  font-style: normal;
}

.choice-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.source-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.source-choice:first-child {
  border-top: 0;
}

.source-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.source-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.source-check::after {
  width: 8px;
  height: 4px;
  border: 2px solid currentColor;
  border-top: 0;
  border-right: 0;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.source-choice input:checked + .source-check {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.source-copy {
  display: flex;
  flex-direction: column;
}

.source-copy strong {
  font-size: 12px;
}

.source-copy small {
  color: var(--muted);
  font-size: 9px;
}

.source-stock {
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
}

.source-stock strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.trigger-surface,
.delivery-surface {
  margin-top: 14px;
}

.plan-surface {
  margin-top: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(18, 29, 24, 0.03);
}

.plan-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.plan-summary > div {
  display: flex;
  flex-direction: column;
}

.plan-summary strong {
  font-size: 12px;
}

.plan-summary small {
  color: var(--muted);
  font-size: 9px;
}

.plan-state-dot {
  display: block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(8, 123, 99, 0.1);
}

.plan-summary.is-action {
  background: var(--accent-soft);
  border-color: #cde8df;
}

.plan-summary.is-action .plan-state-dot {
  background: var(--accent);
}

.plan-summary.is-blocked {
  background: var(--amber-soft);
  border-color: #f1d6ae;
}

.plan-summary.is-blocked .plan-state-dot,
.plan-state-dot.is-blocked {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(189, 109, 19, 0.1);
}

.plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 13px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.plan-detail-grid > div {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plan-detail-grid span {
  color: var(--muted);
  font-size: 9px;
}

.plan-detail-grid strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simulation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.simulation-strip > span {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.simulation-strip > span > svg,
.simulation-strip > span > i {
  width: 15px;
  height: 15px;
  color: var(--purple);
  font-style: normal;
}

.simulation-strip strong {
  font-size: 10px;
}

.simulation-strip small {
  color: var(--muted);
  font-size: 9px;
}

.simulation-strip > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.simulation-button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid #ded2f0;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 650;
}

.simulation-button:hover {
  background: #e9e0f6;
}

.trigger-list {
  margin-top: 12px;
}

.trigger-row {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(160px, 1fr) minmax(185px, auto) 18px;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.trigger-row:first-child {
  border-top: 0;
}

.trigger-row > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.trigger-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}

.trigger-icon.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.trigger-icon.purple {
  color: var(--purple);
  background: var(--purple-soft);
}

.trigger-icon svg,
.trigger-icon i {
  width: 17px;
  height: 17px;
  font-style: normal;
}

.trigger-copy {
  display: flex;
  flex-direction: column;
}

.trigger-copy strong {
  font-size: 12px;
}

.trigger-copy small {
  color: var(--muted);
  font-size: 10px;
}

.trigger-control {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.trigger-control input {
  width: 64px;
  height: 34px;
  margin: 0 4px;
  padding: 0 8px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.check-visual {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.trigger-row > input:checked ~ .check-visual {
  background: var(--accent);
  border-color: var(--accent);
}

.trigger-row > input:checked ~ .check-visual::after {
  width: 8px;
  height: 4px;
  border: 2px solid white;
  border-top: 0;
  border-right: 0;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.trigger-row:has(> input:not(:checked)) .trigger-control {
  opacity: 0.42;
}

.trigger-row:has(> input:not(:checked)) .trigger-control input {
  pointer-events: none;
}

.trigger-row.is-disabled {
  opacity: 0.52;
  pointer-events: none;
}

.delivery-grid {
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 0.8fr);
  align-items: center;
}

.delivery-grid .toggle-line {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.delivery-grid .toggle-line > span {
  flex: 1;
}

.sticky-actions {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 28px rgba(20, 31, 26, 0.11);
}

.sticky-actions > div {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.sticky-actions .status-dot {
  margin: 0;
  background: #a7b2ad;
  box-shadow: none;
}

.sticky-actions.is-dirty .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(189, 109, 19, 0.1);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.primary-button {
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.secondary-button {
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: #aebcb6;
}

.primary-button svg,
.primary-button i,
.secondary-button svg,
.secondary-button i {
  width: 15px;
  height: 15px;
  font-style: normal;
}

.wide-button {
  width: 100%;
}

.pickup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  align-items: start;
  gap: 14px;
}

.pickup-form,
.quote-panel {
  padding: 22px;
}

.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-section-title h3 {
  margin-top: 1px;
}

.form-section-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.form-section.bordered {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.product-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.product-option {
  position: relative;
  display: flex;
  min-height: 104px;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.product-option:hover {
  border-color: #aebcb6;
}

.product-option:has(input:checked) {
  background: #fbfdfc;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.product-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.product-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-option-top strong {
  font-size: 13px;
}

.radio-mark {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.product-option input:checked ~ .product-option-top .radio-mark {
  border: 5px solid var(--accent);
}

.product-option p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.product-option-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.product-option-foot span {
  color: var(--muted);
  font-size: 9px;
}

.product-option-foot strong {
  color: var(--accent);
  font-size: 11px;
}

fieldset.field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
}

.stepper button,
.stepper input {
  height: 40px;
  border: 1px solid var(--line-strong);
}

.stepper button {
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  font-size: 18px;
}

.stepper button:first-child {
  border-radius: 5px 0 0 5px;
}

.stepper button:last-child {
  border-radius: 0 5px 5px 0;
}

.stepper input {
  padding: 0 8px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 40px;
  padding: 3px;
  background: #edf1ef;
  border-radius: 6px;
}

.segmented label {
  position: relative;
  display: grid;
  place-items: center;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  border-radius: 4px;
  font-size: 10px;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18, 29, 24, 0.09);
}

.pickup-form > .wide-button {
  margin-top: 20px;
}

.quote-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
}

.quote-live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 9px;
}

.quote-live .status-dot {
  margin: 0;
}

.quote-empty {
  display: flex;
  min-height: 285px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  text-align: center;
}

.quote-empty svg,
.quote-empty i {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--line-strong);
  font-style: normal;
}

.quote-empty strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.quote-empty span {
  margin-top: 3px;
  font-size: 10px;
}

.quote-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.quote-product > div {
  display: flex;
  flex-direction: column;
}

.quote-product span {
  font-size: 12px;
  font-weight: 700;
}

.quote-product small {
  color: var(--muted);
  font-size: 9px;
}

.quote-product > strong {
  font-size: 14px;
}

.quote-breakdown {
  margin: 8px 0 0;
}

.quote-breakdown div {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-breakdown dt {
  color: var(--muted);
  font-size: 10px;
}

.quote-breakdown dd {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
}

.quote-breakdown .quote-total {
  min-height: 48px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.quote-breakdown .quote-total dd {
  color: var(--accent);
  font-size: 16px;
}

.stock-warning {
  margin: 0 0 12px;
  padding: 9px;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 4px;
  font-size: 10px;
}

.billing-note {
  display: flex;
  gap: 7px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 9px;
}

.billing-note svg,
.billing-note i {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  font-style: normal;
}

.balance-grid {
  display: grid;
  grid-template-columns: 0.85fr 0.85fr 0.85fr 1.45fr;
  gap: 12px;
}

.balance-card {
  display: flex;
  min-height: 124px;
  flex-direction: column;
  justify-content: center;
  box-shadow: none;
}

.balance-card > span,
.balance-card > label {
  color: var(--muted);
  font-size: 10px;
}

.balance-card > strong {
  margin: 6px 0 2px;
  font-size: 24px;
  line-height: 1;
}

.balance-card > small {
  color: var(--muted);
  font-size: 9px;
}

.primary-balance {
  color: white;
  background: var(--sidebar-soft);
  border-color: var(--sidebar-soft);
}

.primary-balance > span,
.primary-balance > small {
  color: #9fb0a9;
}

.redeem-card {
  justify-content: center;
}

.redeem-input {
  display: flex;
  margin: 7px 0 4px;
}

.redeem-input input {
  min-width: 0;
  border-radius: 5px 0 0 5px;
  text-transform: uppercase;
}

.redeem-input button {
  display: grid;
  width: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0 5px 5px 0;
}

.redeem-input svg,
.redeem-input i {
  width: 16px;
  height: 16px;
  font-style: normal;
}

.orders-surface,
.ledger-surface {
  margin-top: 14px;
}

.filter-row {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #edf1ef;
  border-radius: 6px;
}

.filter-button {
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
}

.filter-button.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 2px rgba(18, 29, 24, 0.08);
}

.orders-table td {
  height: 54px;
}

.order-id-cell {
  display: flex;
  flex-direction: column;
}

.order-id-cell small,
.money-cell small {
  color: var(--muted);
  font-size: 9px;
}

.money-cell {
  display: flex;
  flex-direction: column;
}

.table-action {
  min-height: 30px;
  padding: 0 9px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
}

.table-action:hover {
  background: var(--accent-soft);
  border-color: #b9ddd2;
}

.ledger-list {
  margin-top: 10px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) minmax(120px, auto) minmax(100px, auto);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.ledger-row:first-child {
  border-top: 0;
}

.ledger-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}

.ledger-row.is-debit .ledger-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.ledger-icon svg,
.ledger-icon i {
  width: 15px;
  height: 15px;
  font-style: normal;
}

.ledger-copy {
  display: flex;
  flex-direction: column;
}

.ledger-copy strong {
  font-size: 11px;
}

.ledger-copy small,
.ledger-reference {
  color: var(--muted);
  font-size: 9px;
}

.ledger-amount {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.ledger-row.is-debit .ledger-amount {
  color: var(--ink);
}

.api-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.api-index {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  box-shadow: none;
}

.api-index-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  text-align: left;
}

.api-index-link:hover,
.api-index-link.is-active {
  color: var(--ink);
  background: var(--surface-muted);
}

.method {
  display: inline-block;
  min-width: 34px;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.method.get {
  color: var(--blue);
  background: var(--blue-soft);
}

.method.post {
  color: var(--accent);
  background: var(--accent-soft);
}

.api-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.api-section {
  scroll-margin-top: calc(var(--topbar-height) + 14px);
}

.api-section > p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 11px;
}

.endpoint-line {
  display: grid;
  grid-template-columns: auto 1fr 36px;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.endpoint-line > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

code,
pre {
  font-family: "Cascadia Code", Consolas, monospace;
}

.endpoint-line code {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.flow-steps > div {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 0 8px;
}

.flow-steps > div > span {
  display: grid;
  width: 26px;
  height: 26px;
  grid-row: 1 / 3;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
}

.flow-steps strong {
  font-size: 10px;
}

.flow-steps small {
  color: var(--muted);
  font-size: 8px;
}

.flow-steps > svg,
.flow-steps > i {
  width: 14px;
  height: 14px;
  color: var(--line-strong);
  font-style: normal;
}

.api-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.api-title > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.api-title code {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.api-section pre {
  overflow-x: auto;
  margin: 16px 0 0;
  padding: 16px;
  color: #d8e4df;
  background: #1c2723;
  border: 1px solid #2b3833;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.65fr);
  align-items: start;
  gap: 14px;
}

.support-topics details {
  border-top: 1px solid var(--line);
}

.support-topics details:first-of-type {
  margin-top: 12px;
}

.support-topics summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.support-topics summary::-webkit-details-marker {
  display: none;
}

.support-topics summary svg,
.support-topics summary i {
  width: 15px;
  height: 15px;
  color: var(--muted);
  font-style: normal;
  transition: transform 150ms ease;
}

.support-topics details[open] summary svg,
.support-topics details[open] summary i {
  transform: rotate(180deg);
}

.support-topics details p {
  max-width: 780px;
  padding: 0 28px 16px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.surface-heading > svg,
.surface-heading > i {
  width: 18px;
  height: 18px;
  color: var(--muted);
  font-style: normal;
}

.support-contact {
  text-align: center;
}

.contact-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 2px auto 14px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
}

.contact-icon svg,
.contact-icon i {
  width: 23px;
  height: 23px;
  font-style: normal;
}

.support-contact h3 {
  margin-top: 4px;
}

.support-contact > p {
  margin: 7px 0 16px;
  color: var(--ink-soft);
  font-size: 10px;
}

.support-hours {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.support-hours span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.support-hours svg,
.support-hours i {
  width: 14px;
  height: 14px;
  font-style: normal;
}

.support-hours strong {
  font-size: 10px;
}

.support-contact .privacy-note {
  text-align: left;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  color: #edf5f1;
  background: #202a26;
  border: 1px solid #35423d;
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(17, 25, 22, 0.22);
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  background: #3a2220;
  border-color: #62332f;
}

.toast > svg,
.toast > i {
  width: 18px;
  height: 18px;
  color: #59cbae;
  font-style: normal;
}

.toast.is-error > svg,
.toast.is-error > i {
  color: #ed8178;
}

.toast-copy {
  display: flex;
  flex-direction: column;
}

.toast-copy strong {
  font-size: 11px;
}

.toast-copy span {
  color: #aebdb7;
  font-size: 9px;
}

.toast button {
  color: #aebdb7;
  background: transparent;
  border: 0;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.delivery-dialog {
  width: min(640px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  overflow-y: auto;
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 25, 21, 0.28);
}

.delivery-dialog::backdrop {
  background: rgba(15, 23, 20, 0.52);
}

.dialog-heading,
.dialog-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-heading > div > div {
  display: flex;
  flex-direction: column;
}

.dialog-heading h2 {
  font-size: 19px;
}

.success-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
}

.success-icon svg,
.success-icon i {
  width: 18px;
  height: 18px;
  font-style: normal;
}

.delivery-dialog > p {
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 11px;
}

.delivery-payload {
  overflow: auto;
  max-height: 280px;
  margin: 16px 0 0;
  padding: 14px;
  color: #dce7e2;
  background: #17201d;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.delivery-units {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.delivery-unit {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}

.delivery-unit code {
  font-size: 10px;
}

.delivery-unit span {
  color: var(--muted);
  font-size: 9px;
}

.delivery-unit strong {
  color: var(--accent);
  font-size: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .flow-steps > svg,
  .flow-steps > i {
    display: none;
  }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 14px 0 42px rgba(15, 24, 20, 0.24);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(12, 20, 17, 0.42);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
  }

  .sidebar-close {
    border-color: rgba(255, 255, 255, 0.12);
  }

  .main-area {
    margin-left: 0;
  }

  .settings-layout,
  .overview-grid,
  .pickup-layout,
  .support-layout {
    grid-template-columns: 1fr;
  }

  .quote-panel {
    position: static;
  }

  .api-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 64px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-title .eyebrow,
  .sync-status {
    display: none;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .balance-button {
    min-width: 0;
    height: 36px;
    padding: 0 9px;
  }

  .balance-button span {
    display: none;
  }

  .content-wrap {
    padding: 18px 14px 40px;
  }

  .notice-strip {
    align-items: flex-start;
  }

  .notice-strip > div {
    flex-direction: column;
    gap: 1px;
  }

  .notice-strip span {
    white-space: normal;
  }

  .notice-strip .text-button {
    display: none;
  }

  .section-heading {
    margin-top: 24px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .metric-card {
    min-height: 124px;
    padding: 14px;
  }

  .metric-number strong {
    font-size: 24px;
  }

  .capacity-surface,
  .inventory-surface,
  .recent-surface,
  .form-surface,
  .trigger-surface,
  .delivery-surface,
  .pickup-form,
  .quote-panel,
  .orders-surface,
  .ledger-surface,
  .api-section,
  .support-topics,
  .support-contact {
    padding: 16px;
  }

  .split-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-intro .master-switch {
    width: 100%;
    justify-content: space-between;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .two-cols,
  .three-cols,
  .delivery-grid,
  .product-choice-grid {
    grid-template-columns: 1fr;
  }

  .trigger-row {
    grid-template-columns: 36px 1fr 18px;
    min-height: 86px;
  }

  .trigger-control {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .check-visual {
    grid-column: 3;
    grid-row: 1;
  }

  .sticky-actions {
    bottom: 8px;
    flex-wrap: wrap;
  }

  .sticky-actions > div {
    width: 100%;
    flex-basis: 100%;
  }

  .sticky-actions .secondary-button,
  .sticky-actions .primary-button {
    flex: 1;
  }

  .balance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .balance-card {
    min-height: 112px;
    padding: 14px;
  }

  .redeem-card {
    grid-column: 1 / -1;
  }

  .ledger-row {
    grid-template-columns: 34px 1fr auto;
  }

  .ledger-reference {
    display: none;
  }

  .api-layout {
    grid-template-columns: 1fr;
  }

  .api-index {
    position: static;
    display: flex;
    overflow-x: auto;
    flex-direction: row;
    padding: 8px;
    white-space: nowrap;
  }

  .api-index .nav-label {
    display: none;
  }

  .api-index-link {
    flex: 0 0 auto;
  }

  .flow-steps {
    grid-template-columns: 1fr;
  }

  .flow-steps > div {
    min-height: 38px;
  }

  .api-title > div {
    flex-wrap: wrap;
  }

  .delivery-unit {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 8px 0;
  }

  .delivery-unit span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 440px) {
  .topbar-actions .icon-button {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 116px;
  }

  .capacity-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-meta {
    display: none;
  }

  .balance-grid {
    grid-template-columns: 1fr;
  }

  .redeem-card {
    grid-column: auto;
  }

  .filter-row {
    width: 100%;
  }

  .filter-button {
    flex: 1;
  }

  .orders-surface .surface-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
