:root {
  color-scheme: dark;
  --ink: #f2f5f5;
  --ink-soft: #b7c1c2;
  --ink-dim: #869294;
  --ground: #0a0f14;
  --ground-soft: #0f161c;
  --surface: #121a21;
  --surface-raised: #19232b;
  --surface-hover: #213039;
  --line: rgba(218, 233, 232, .12);
  --line-strong: rgba(218, 233, 232, .22);
  --mint: #8ce6c9;
  --mint-strong: #b2f5de;
  --mint-ink: #10201d;
  --blue: #8ab9ff;
  --amber: #f5cb83;
  --red: #ff9d9d;
  --display: clamp(2.25rem, 4.2vw, 4.4rem);
  --text: 15px;
  --sidebar: 256px;
  --topbar: 72px;
  --radius: 14px;
  --radius-small: 9px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ground); }
body { margin: 0; min-width: 320px; background: var(--ground); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
::selection { color: var(--mint-ink); background: var(--mint); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; background: #0b0f14; border-right: 1px solid var(--line); }
.brand-lockup { display: flex; flex-direction: column; gap: 17px; padding: 0 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; width: 22px; height: 21px; }
.brand-mark span { display: block; width: 5px; border-radius: 4px 4px 2px 2px; background: var(--mint); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 21px; opacity: .82; }
.brand-name { color: var(--ink); font-size: 16px; font-weight: 680; letter-spacing: -.04em; }
.brand-name span { color: var(--mint); }
.environment-tag { width: fit-content; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-dim); font-size: 12px; letter-spacing: .03em; }
.nav-stack { margin-top: 58px; }
.nav-heading, .eyebrow { margin: 0 0 11px; color: var(--ink-dim); font-size: 12px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.nav-heading { padding: 0 12px; }
.nav-heading-workspace { margin-top: 26px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 12px; margin: 3px 0; color: var(--ink-soft); background: transparent; border-radius: 9px; text-align: left; transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.nav-item svg { width: 17px; height: 17px; color: var(--ink-dim); transition: color .2s var(--ease); }
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.04); transform: translateX(2px); }
.nav-item.is-active { color: var(--ink); background: #1a242b; }
.nav-item.is-active svg { color: var(--mint); }
.nav-count { margin-left: auto; color: var(--ink-dim); font-size: 12px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 18px; }
.connection-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(255,255,255,.02); }
.connection-card > div { min-width: 0; display: grid; gap: 2px; flex: 1; }
.connection-card strong, .profile-copy strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.connection-card span:not(.status-dot), .profile-copy span { color: var(--ink-dim); font-size: 12px; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.profile-copy { min-width: 0; display: grid; gap: 1px; flex: 1; }
.icon-button { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; padding: 0; color: var(--ink-dim); background: transparent; border-radius: 50%; transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.icon-button:hover { color: var(--ink); background: var(--surface-hover); transform: translateY(-1px); }
.icon-button svg { width: 16px; height: 16px; }
.status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 7px; border-radius: 50%; background: var(--ink-dim); }
.status-dot.is-live { background: var(--mint); box-shadow: 0 0 0 3px rgba(140, 230, 201, .09); }
.status-dot.is-muted { background: #586367; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: var(--mint-ink); background: var(--mint); border-radius: 50%; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.avatar-small { width: 28px; height: 28px; flex-basis: 28px; font-size: 9px; }
.workspace { flex: 1; min-width: 0; }
.topbar { height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 4.2vw; border-bottom: 1px solid var(--line); }
.breadcrumb { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-dim); font-size: 12px; }
.breadcrumb strong { color: var(--ink-soft); font-weight: 550; }
.breadcrumb-slash { color: #445056; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.preview-chip, .heading-note { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12px; }
.mobile-brand { display: none; }
.main-content { width: min(1260px, calc(100% - 8.4vw)); margin: 0 auto; padding: 72px 0 96px; }
.view[hidden] { display: none; }
.view.is-visible { animation: view-in .45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.page-heading-overview { margin-bottom: 51px; }
.page-heading h1 { max-width: 740px; margin: 0; color: var(--ink); font-size: var(--display); font-weight: 560; letter-spacing: -.065em; line-height: .99; }
.heading-copy { max-width: 530px; margin: 19px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 44px; padding: 0 17px; border-radius: 8px; font-size: 12px; font-weight: 650; white-space: nowrap; transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.button svg { width: 15px; height: 15px; }
.button:hover { transform: translateY(-2px); }
.button-dark { color: #09120f; background: var(--mint); }
.button-dark:hover { background: var(--mint-strong); }
.button-quiet { justify-content: space-between; width: 100%; padding: 0; color: var(--ink-soft); background: none; border-radius: 0; text-align: left; }
.button-quiet:hover { color: var(--mint); transform: none; }
.text-button { padding: 3px 0; color: var(--ink-soft); background: none; font-size: 12px; transition: color .2s var(--ease); }
.text-button:hover { color: var(--mint); }
.text-button span { margin-left: 5px; color: var(--mint); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 56px; }
.stat-card { min-height: 154px; display: flex; flex-direction: column; justify-content: space-between; padding: 21px 22px 19px; background: var(--surface); border-radius: var(--radius); transition: background .2s var(--ease), transform .2s var(--ease); }
.stat-card:hover { background: var(--surface-raised); transform: translateY(-2px); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card-label { color: var(--ink-soft); font-size: 12px; }
.stat-card-icon { display: grid; place-items: center; width: 27px; height: 27px; color: var(--mint); background: rgba(140,230,201,.08); border-radius: 50%; }
.stat-card-icon svg { width: 14px; height: 14px; }
.stat-card-value { margin: auto 0 4px; color: var(--ink); font-size: 39px; font-weight: 560; letter-spacing: -.065em; line-height: 1; }
.stat-card-meta { color: var(--ink-dim); font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: 1.48fr 1fr; gap: 12px; }
.panel { background: var(--surface); border-radius: var(--radius); }
.activity-panel, .health-panel { min-height: 370px; padding: 26px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.panel-heading h2, .table-heading h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 580; letter-spacing: -.035em; }
.activity-list { display: grid; }
.activity-item { width: 100%; display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 9px 0; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.activity-item:last-child { border-bottom: 0; }
.activity-item:hover { background: linear-gradient(90deg, rgba(140,230,201,.06), transparent 78%); }
.activity-item:focus-visible { border-radius: 8px; }
.activity-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; color: var(--mint); background: rgba(140,230,201,.08); border-radius: 50%; }
.activity-icon.is-pending { color: var(--amber); background: rgba(245,203,131,.08); }
.activity-icon svg { width: 15px; height: 15px; }
.activity-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.activity-copy strong { overflow: hidden; color: var(--ink-soft); font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy span { overflow: hidden; color: var(--ink-dim); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-amount { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.health-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(140,230,201,.07); }
.health-summary { display: grid; gap: 4px; padding: 5px 0 22px; }
.health-summary strong { color: var(--mint); font-size: 22px; font-weight: 570; letter-spacing: -.045em; }
.health-summary span { color: var(--ink-dim); font-size: 12px; }
.health-list { display: grid; padding: 5px 0 24px; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 36px; color: var(--ink-soft); font-size: 12px; border-bottom: 1px solid var(--line); }
.health-row:last-child { border-bottom: 0; }
.health-value { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.health-value.is-muted { color: var(--ink-dim); }
.health-value .status-dot { width: 6px; height: 6px; flex-basis: 6px; }

.catalog-toolbar, .orders-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 19px; padding: 17px 19px; margin-bottom: 14px; }
.field { display: grid; gap: 7px; min-width: 150px; color: var(--ink-dim); font-size: 12px; }
.field-search { position: relative; flex: 1; min-width: 220px; }
.field-search > svg { position: absolute; left: 12px; bottom: 11px; width: 15px; height: 15px; color: var(--ink-dim); pointer-events: none; }
.field-search input, .field select { width: 100%; height: 38px; padding: 0 12px; color: var(--ink); background: var(--surface-raised); border: 1px solid transparent; border-radius: 7px; outline: 0; font-size: 12px; transition: border-color .2s var(--ease), background .2s var(--ease); }
.field-search input { padding-left: 36px; }
.field input::placeholder { color: #667176; }
.field-search input:focus, .field select:focus { background: var(--surface-hover); border-color: rgba(140, 230, 201, .45); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8d999c 50%), linear-gradient(135deg, #8d999c 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 11px) 16px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.field-country { width: 190px; }
.field-currency { width: 144px; }
.field-rail { width: 168px; }
.field-sort { width: 150px; }
.field-sort-direction {
  align-self: end; width: 38px; height: 38px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; color: var(--ink-soft); background: var(--surface-raised);
  border: 1px solid transparent; border-radius: 7px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.field-sort-direction > svg { width: 15px; height: 15px; }
.field-sort-direction:hover { color: var(--ink); background: var(--surface-hover); }
.field-sort-direction[aria-pressed="true"] { color: var(--mint); }
.field-rail-info {
  align-self: end; display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 12px; white-space: nowrap;
  color: var(--ink-soft); text-decoration: none; font-size: 12px;
  border: 1px solid transparent; border-radius: 7px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.field-rail-info > svg { width: 13px; height: 13px; color: var(--ink-dim); }
.field-rail-info:hover { color: var(--ink); background: var(--surface-hover); }
.field-rail-info:hover > svg { color: var(--mint); }
.rail-chosen { display: flex; align-items: center; gap: 12px; }
.rail-chosen img { max-width: 78px; max-height: 38px; object-fit: contain; }
.rail-chosen span { color: var(--ink); font-size: 13px; font-weight: 550; }
.field-receipt { margin-top: 14px; min-width: 0; }
.field-receipt select { height: 34px; }
.payment-methods-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  color: var(--mint); font-size: 12px; text-decoration: none;
}
.payment-methods-link > svg { width: 13px; height: 13px; }
.payment-methods-link:hover { text-decoration: underline; }
.catalog-summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 3px 15px; color: var(--ink-soft); font-size: 12px; }
.catalog-summary-note { color: var(--ink-dim); }
.plan-list { display: grid; gap: 8px; }
.catalog-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 3px 0; }
.catalog-pager[hidden] { display: none; }
.page-count { color: var(--ink-dim); font-size: 12px; }
.page-button { width: auto; justify-content: center; padding: 0 14px; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; }
.page-button:hover:not([disabled]) { color: var(--mint); border-color: rgba(140, 230, 201, .4); }
.plan-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(120px, .75fr) minmax(100px, .55fr) auto; align-items: center; gap: 20px; padding: 19px 21px; background: var(--surface); border-radius: var(--radius-small); transition: background .2s var(--ease), transform .2s var(--ease); }
.plan-row:hover { background: var(--surface-raised); transform: translateX(3px); }
.plan-name { display: grid; gap: 4px; min-width: 0; }
.plan-name strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.plan-name span { color: var(--ink-dim); font-size: 12px; }
.plan-detail { display: grid; gap: 3px; }
.plan-detail span:first-child { color: var(--ink-dim); font-size: 12px; }
.plan-detail strong { color: var(--ink-soft); font-size: 12px; font-weight: 550; }
.plan-price { color: var(--mint); font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.plan-action { justify-self: end; padding: 0; color: var(--ink-soft); background: none; font-size: 12px; font-weight: 600; transition: color .2s var(--ease); }
.plan-action:hover { color: var(--mint); }

.toolbar-result { padding-bottom: 10px; margin-left: auto; color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.table-panel { overflow: hidden; }
.table-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px 18px; }
.table-heading > span { color: var(--ink-dim); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; text-align: left; }
th { padding: 0 26px 11px; color: var(--ink-dim); font-size: 12px; font-weight: 500; }
td { padding: 16px 26px; color: var(--ink-soft); font-size: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .2s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
.order-primary { display: grid; gap: 3px; }
.order-primary strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.order-primary span { color: var(--ink-dim); font-size: 12px; }
.status-badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: var(--mint); background: rgba(140,230,201,.08); font-size: 12px; font-weight: 600; }
.status-badge.is-pending { color: var(--amber); background: rgba(245,203,131,.08); }
.status-badge .status-dot { width: 5px; height: 5px; flex-basis: 5px; background: currentColor; box-shadow: none; }
.row-open { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--ink-dim); background: transparent; border-radius: 50%; transition: color .2s var(--ease), background .2s var(--ease); }
.row-open:hover { color: var(--mint); background: rgba(140,230,201,.08); }
.row-open svg { width: 14px; height: 14px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.row-delete { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--ink-dim); background: transparent; border-radius: 50%; transition: color .2s var(--ease), background .2s var(--ease); }
.row-delete:hover { color: var(--red); background: rgba(255,157,157,.1); }
.row-delete svg { width: 14px; height: 14px; }
.empty-state { display: grid; place-items: center; gap: 8px; padding: 62px 24px; color: var(--ink-dim); text-align: center; }
.empty-state strong { color: var(--ink-soft); font-size: 13px; font-weight: 550; }
.empty-state span { font-size: 12px; }

.account-overview { display: grid; grid-template-columns: 1.6fr .7fr .7fr; gap: 12px; margin-bottom: 42px; }
.account-intro, .account-stat { min-height: 122px; padding: 22px; }
.account-intro { display: flex; align-items: flex-start; gap: 15px; }
.account-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: var(--mint); background: rgba(140,230,201,.08); border-radius: 50%; }
.account-icon svg { width: 17px; height: 17px; }
.account-intro strong { color: var(--ink); font-size: 13px; font-weight: 580; }
.account-intro p { max-width: 280px; margin: 5px 0 0; color: var(--ink-dim); font-size: 12px; }
.account-stat { display: grid; align-content: space-between; }
.account-stat span { color: var(--ink-dim); font-size: 12px; }
.account-stat strong { color: var(--ink); font-size: 31px; font-weight: 560; letter-spacing: -.06em; line-height: 1; }
.account-stat:last-child strong { color: var(--ink-dim); }
.account-signup { display: grid; align-content: space-between; gap: 10px; justify-items: start; }
.account-signup .button { min-height: 38px; }
.operator-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 22px 26px; }
.operator-copy .eyebrow { margin: 0 0 7px; }
.operator-copy h2 { margin: 0 0 6px; color: var(--ink); font-size: 15px; font-weight: 580; letter-spacing: -.03em; }
.operator-copy p { max-width: 500px; margin: 0; color: var(--ink-dim); font-size: 11px; line-height: 1.5; }
.operator-control { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.operator-control .field { min-width: 250px; }
.operator-control .button { min-height: 38px; }
.usage-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 22px 26px; }.usage-control { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.usage-control .field { min-width: 200px; }
.usage-control .field input { height: 38px; padding: 0 12px; color: var(--ink); background: var(--surface-raised); border: 1px solid transparent; border-radius: 7px; outline: 0; font-size: 12px; }
.usage-control .field input:focus { background: var(--surface-hover); border-color: rgba(140, 230, 201, .45); }
.usage-control .button { min-height: 38px; }
.usage-head { display: flex; flex-wrap: wrap; gap: 26px; padding: 0 0 16px; }
.usage-head > div { display: grid; gap: 4px; }
.usage-label { color: var(--ink-dim); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
.usage-head strong { color: var(--ink); font-size: 13px; font-weight: 550; }
.usage-kb { color: var(--ink-dim); font-size: 11px; }
.key-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 22px 26px; }
.key-panel[hidden] { display: none; }
.key-note { margin-top: 8px; color: var(--amber); font-size: 12px; }
.key-note[hidden] { display: none; }
.toggle-row { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.toggle-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--mint); flex: 0 0 16px; }
.toggle-label { display: grid; gap: 3px; }
.toggle-label strong { color: var(--ink); font-size: 12px; font-weight: 550; }
.toggle-label span { color: var(--ink-dim); font-size: 11px; line-height: 1.45; }
.drawer-actions .button-quiet { padding: 0; }
/* The reseller's two actions are ordinary buttons, not the borderless
   link-style quiet button the drawer uses elsewhere. */
.drawer-actions .button-quiet:not(.is-link) {
  justify-content: center; padding: 0 17px; width: 100%;
  color: var(--ink-soft); background: var(--surface-raised);
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.drawer-actions .button-quiet:not(.is-link):hover { color: var(--mint); background: var(--surface-hover); transform: translateY(-1px); }
.redeem-mark { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.redeem-mark.is-ready { color: var(--mint); }
.redeem-mark.is-done { color: var(--ink-soft); }
.redeem-mark.is-done .status-dot { background: var(--mint); }
.activation-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.activation-copy { display: grid; gap: 4px; }
.activation-state { color: var(--ink-soft); font-size: 12px; }
.activation-state.is-awaiting { color: var(--amber); }
.activation-state.is-activated { color: var(--mint); }
.activation-state.is-unreported { color: var(--ink-dim); }
.activation-state.is-unavailable { color: var(--amber); }
.activation-detail { color: var(--ink-dim); font-size: 11px; }
.receipt-frame { margin: 0 0 14px; }
.receipt-image {
  display: block; max-width: 100%; max-height: 300px; width: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.image-button {
  display: block; padding: 0; cursor: zoom-in; background: none;
  border: 0; border-radius: 10px; line-height: 0;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.image-button:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .32); }
.image-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.qr-block { display: grid; gap: 14px; justify-items: start; margin-bottom: 20px; }.qr-frame { margin: 0; display: grid; gap: 9px; justify-items: center; }
.qr-image { width: 220px; height: 220px; display: block; padding: 12px; background: #ffffff; border-radius: 12px; image-rendering: pixelated; }
.qr-pending {
  display: grid; place-items: center; width: 220px; height: 220px;
  color: var(--ink-dim); font-size: 12px; background: var(--surface-raised);
  border-radius: 12px;
}
.receipt-pending {
  display: grid; place-items: center; width: 100%; max-width: 300px;
  min-height: 90px; padding: 12px; color: var(--ink-dim); font-size: 12px;
  background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: 8px;
}
.qr-frame figcaption { color: var(--ink-dim); font-size: 11px; letter-spacing: .02em; }
.qr-note { margin: 0; max-width: 300px; color: var(--ink-dim); font-size: 11px; line-height: 1.5; }
.button[disabled] { opacity: .55; cursor: progress; transform: none; }
/* A .button sets its own display, which would otherwise beat the
   hidden attribute. */
.button[hidden] { display: none; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(1, 4, 6, .68); animation: fade-in .25s ease both; }
.detail-drawer { position: fixed; z-index: 11; top: 0; right: 0; width: min(460px, 100%); height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-strong); animation: drawer-in .38s var(--ease) both; }
.detail-drawer[hidden], .drawer-backdrop[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  background: rgba(4, 8, 11, .93); backdrop-filter: blur(3px);
  animation: fade-in .2s ease both;
}
.lightbox[hidden] { display: none; }
.lightbox-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; padding: 24px 30px 18px; color: #eef3f5;
}
.lightbox-bar h2 { margin: 0; font-size: 22px; font-weight: 560; letter-spacing: -.04em; }
.lightbox-bar .eyebrow { color: rgba(238, 243, 245, .55); }
.lightbox-actions { display: flex; align-items: center; gap: 10px; }
.lightbox-actions .button { color: #eef3f5; border-color: rgba(238, 243, 245, .22); }
.lightbox-actions .button:hover { background: rgba(238, 243, 245, .1); }
.lightbox-actions .icon-button { color: #eef3f5; border-color: rgba(238, 243, 245, .22); }
.lightbox-actions .icon-button:hover { background: rgba(238, 243, 245, .1); }
.lightbox-body {
  flex: 1; overflow: auto; display: grid; place-items: center;
  padding: 10px 30px 40px; min-height: 0;
}
.lightbox-body img {
  max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain;
  border-radius: 10px; background: #fff;
}
/* A phone screenshot is tall, so it is scaled to the height that is
   left over rather than only to the width. */
.lightbox-body img.tall { width: auto; }
.lightbox-body img[src=""] { display: none; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 32px 30px 24px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; color: var(--ink); font-size: 25px; font-weight: 560; letter-spacing: -.05em; line-height: 1.1; }
.drawer-content { overflow-y: auto; padding: 28px 30px 40px; }
.drawer-lead { padding-bottom: 25px; }
.drawer-lead strong { display: block; color: var(--mint); font-size: 27px; font-weight: 560; letter-spacing: -.05em; }
.drawer-lead span { color: var(--ink-dim); font-size: 12px; }
.drawer-section { padding: 21px 0; border-top: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; font-weight: 620; letter-spacing: .02em; }
.detail-list { display: grid; gap: 11px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; min-width: 0; color: var(--ink-dim); font-size: 12px; }
.detail-row strong { max-width: 62%; min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.copy-field { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 9px 8px 12px; background: var(--surface-raised); border-radius: 7px; }
.copy-field code { overflow: hidden; flex: 1 1 auto; min-width: 0; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; color: var(--ink-dim); background: transparent; border-radius: 5px; }
.copy-button:hover { color: var(--mint); background: rgba(140,230,201,.08); }
.copy-button svg { width: 14px; height: 14px; }
.preview-callout { display: flex; gap: 10px; padding: 13px; color: var(--ink-soft); background: rgba(140,230,201,.06); border-radius: 8px; font-size: 12px; }
.preview-callout svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--mint); }
.drawer-actions { display: grid; gap: 8px; margin-top: 24px; }
.drawer-actions .button { width: 100%; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 320px; padding: 11px 14px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.24); font-size: 12px; animation: toast-in .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav { display: none; }
/* The bar is laid out by .mobile-nav-fixed, but it only shows on the
   narrow layouts, so the default hides it. */
.mobile-nav-item { display: grid; place-items: center; gap: 3px; min-height: 48px; color: var(--ink-dim); background: transparent; border-radius: 8px; font-size: 9px; }
.mobile-nav-item svg { width: 17px; height: 17px; }
.mobile-nav-item.is-active { color: var(--mint); background: rgba(140,230,201,.07); }
/* The bar itself, shared by the phone and tablet-portrait breakpoints.
   It stays hidden until one of those layouts turns it on. */
.mobile-nav-fixed {
  position: fixed; right: 0; bottom: 0; left: 0; z-index: 5;
  grid-template-columns: repeat(6, 1fr);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11,15,20,.96); border-top: 1px solid var(--line);
}

@media (max-width: 1200px) {
  /* A wide screen can afford every column; a narrower one drops the
     least useful first. */
  .plan-row { grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(84px, .7fr)) auto; }
  .plan-row .plan-detail:nth-of-type(2) { display: none; }
  table { min-width: 620px; }
  th { padding-left: 20px; padding-right: 20px; }
  td { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 1000px) {
  :root { --sidebar: 220px; }
  .main-content { width: min(900px, calc(100% - 7vw)); }
  .topbar { padding: 0 3.5vw; }
  .plan-row { grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(84px, .7fr)) auto; }
  .plan-row .plan-detail:nth-of-type(2) { display: none; }
  .page-heading h1 { font-size: clamp(2.4rem, 5.6vw, 3.6rem); }
  .detail-drawer { width: min(420px, 100%); }
}

/* A tablet. Below 900px the sidebar costs too much of the width, so it
   goes and the bottom bar comes back; the toolbar wraps into two rows
   and the plan rows go compact. */
@media (max-width: 900px) and (min-width: 761px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .app-shell { display: block; padding-bottom: 72px; }
  .mobile-brand { display: block; }
  .breadcrumb { display: none; }
  .main-content { width: auto; margin: 0; padding: 40px 28px 52px; }
  .mobile-nav-fixed { display: grid; }
  .catalog-toolbar, .orders-toolbar {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end; gap: 14px 18px; padding: 16px;
  }
  .field-search { grid-column: 1 / -1; min-width: 0; }
  .field-country, .field-currency, .field-rail,
  .field-sort, .field-rail-info { width: auto; min-width: 0; }
  .field-sort-direction { align-self: end; }
  .plan-row { grid-template-columns: minmax(160px, 1.3fr) repeat(2, minmax(76px, .6fr)) auto; }
  .plan-row .plan-detail:nth-of-type(2) { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .account-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-panel, .key-panel, .operator-panel {
    display: grid; gap: 16px; grid-template-columns: 1fr;
    padding: 18px;
  }
  .usage-control, .operator-control { grid-template-columns: 1fr auto; }
  .detail-drawer { width: min(460px, 100%); }
  .drawer-content { padding: 24px 24px 36px; }
  .drawer-section { padding: 19px 0; }
  .qr-image, .qr-pending { width: 200px; height: 200px; }
}

/* A wide desktop: the ledger gets its full width and the plan rows get
   their columns back. */
@media (min-width: 1400px) {
  .main-content { width: min(1400px, calc(100% - 8.4vw)); }
  .plan-row { grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(120px, .75fr)) minmax(100px, .55fr) auto; }
  .plan-row .plan-detail:nth-of-type(2) { display: grid; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --display: clamp(2.55rem, 11vw, 4rem); }
  .app-shell { display: block; padding-bottom: 72px; }
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 20px; }
  .mobile-brand { display: block; }
  .mobile-brand .brand-name { font-size: 14px; }
  .breadcrumb { display: none; }
  .topbar-actions { gap: 8px; }
  .preview-chip { display: none; }
  .topbar-help { display: none; }
  .main-content { width: auto; margin: 0; padding: 46px 20px 55px; }
  .page-heading, .page-heading-overview { display: block; margin-bottom: 36px; }
  .page-heading h1 { max-width: 550px; }
  .heading-copy { margin-top: 16px; font-size: 14px; }
  .page-heading .button { margin-top: 25px; }
  .heading-note { margin-top: 22px; }
  .stat-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 37px; }
  .stat-card { min-height: 112px; padding: 17px 18px; }
  .stat-card-value { margin-top: 14px; font-size: 33px; }
  .overview-grid, .account-overview { grid-template-columns: 1fr; gap: 8px; }
  .activity-panel, .health-panel { min-height: auto; padding: 20px 18px; }
  .panel-heading { margin-bottom: 17px; }
  .catalog-toolbar, .orders-toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; padding: 14px; }
  .field-search { grid-column: 1 / -1; min-width: 0; }
  .field-country, .field-currency, .field-rail { width: auto; min-width: 0; }
  .field-sort { width: auto; min-width: 0; }
  .field-rail-info { min-width: 0; }
  .catalog-summary { padding-top: 9px; }
  .plan-row { grid-template-columns: 1fr auto; gap: 14px; padding: 17px; }
  .plan-row .plan-detail { display: none; }
  .plan-action { grid-column: 2; grid-row: 1; }
  .plan-price { grid-column: 1; grid-row: 2; }
  .table-heading { padding: 20px 18px 15px; }
  td { padding: 14px 18px; }
  th { padding-left: 18px; padding-right: 18px; }
  /* A seven-column table cannot fit a phone, so each row becomes a card
     instead of scrolling sideways. */
  .table-scroll { overflow-x: visible; }
  .table-scroll table { min-width: 0; display: block; }
  .table-scroll thead { display: none; }
  .table-scroll tbody { display: block; }
  .table-scroll tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
    padding: 14px 18px; border-top: 1px solid var(--line);
  }
  .table-scroll tbody tr td {
    display: block; border-top: 0; padding: 0; font-size: 13px;
  }
  .table-scroll tbody tr td:first-child { grid-column: 1; }
  /* The last cell is the row's actions on the orders and accounts
     tables, and those belong beside the name at the top of the card.
     The reseller's last cell is a plain value - "Redeemed" - which is
     hoisted above the order it belongs to if it is pinned to the first
     row, so it takes a full row of its own instead. */
  .table-scroll tbody tr td:last-child { grid-column: 2; grid-row: 1 / span 9; align-self: center; }
  .table-scroll tbody tr td:nth-child(2),
  .table-scroll tbody tr td:nth-child(3),
  .table-scroll tbody tr td:nth-child(4),
  .table-scroll tbody tr td:nth-child(5),
  .table-scroll tbody tr td:nth-child(6) { grid-column: 1; }
  #reseller-table-body tr td:last-child { grid-column: 1 / -1; grid-row: auto; align-self: auto; }
  .table-scroll tbody tr td:empty { display: none; }
  .table-scroll tbody tr td:nth-child(2)::before,
  .table-scroll tbody tr td:nth-child(3)::before,
  .table-scroll tbody tr td:nth-child(4)::before,
  .table-scroll tbody tr td:nth-child(5)::before,
  .table-scroll tbody tr td:nth-child(6)::before {
    content: attr(data-label) " ";
    color: var(--ink-dim); font-size: 11px; margin-right: 8px;
  }
  .table-scroll tbody tr td .order-primary { display: inline-flex; gap: 10px; align-items: baseline; }
  .table-scroll tbody tr td .order-primary span { font-size: 11px; }
  .table-scroll .empty-state { grid-column: 1 / -1; }
  .row-actions { justify-content: flex-end; }
  .toolbar-result { grid-column: 1 / -1; padding: 0 2px; margin: 0; }
  .orders-toolbar .field-status { grid-column: 1 / -1; }
  .account-intro, .account-stat { min-height: 105px; padding: 18px; }
  .account-overview { margin-bottom: 32px; }
  .operator-panel { display: grid; gap: 16px; margin-bottom: 12px; padding: 18px; }
  .operator-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .operator-control .field { min-width: 0; }
  .usage-panel { display: grid; gap: 16px; margin-bottom: 12px; padding: 18px; }
  .usage-control { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .usage-control .field { min-width: 0; }
  .key-panel { display: grid; gap: 16px; margin-bottom: 12px; padding: 18px; }
  .mobile-nav-fixed { display: grid; }
  .detail-drawer { width: 100%; max-height: 92vh; height: auto; top: auto; bottom: 0; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0; animation: sheet-in .3s var(--ease) both; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .drawer-header { padding: 22px 20px 18px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
  .drawer-header h2 { font-size: 22px; }
  .drawer-content { padding: 20px 20px 40px; }
  .drawer-section { padding: 17px 0; }
  .qr-image { width: 190px; height: 190px; }
  .qr-pending { width: 190px; height: 190px; }
  .receipt-image { max-height: 210px; }
  .drawer-actions .button { min-height: 44px; }
  .toast-region { right: 16px; bottom: 88px; left: 16px; }
  .toast { max-width: none; }
  /* An activation string is longer than a phone is wide, so the label and
     the value stack and the value takes the whole width. */
  .detail-row { display: grid; gap: 2px; }
  .detail-row strong { max-width: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
