:root {
  --ink: #17171c;
  --muted: #74747d;
  --line: #e8e8eb;
  --soft: #f4f4f2;
  --white: #fff;
  --black: #09090a;
  --brand: #6f5cff;
  --brand2: #4d3dd0;
  --cyan: #8edce4;
  --cyan-soft: #dff7f8;
  --success: #087a55;
  --warn: #9a5a00;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 20px 65px rgba(0, 0, 0, .16);
}

.credit-products { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:20px; }
.credit-product { display:flex; flex-direction:column; gap:9px; padding:20px; border:1px solid #dfe3eb; border-radius:16px; background:#fff; }
.credit-product.selected { border-color:#111; box-shadow:0 0 0 2px #111; }
.credit-product small { color:#697386; font-weight:700; }
.credit-product h3,.credit-product p { margin:0; }
.credit-product > strong { font-size:28px; }
.credit-product p { min-height:44px; color:#697386; }
.credit-product button { margin-top:auto; }
.credit-order-details { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:18px; }
.credit-order-details textarea { resize:vertical; }
.record-item .text-danger { color:#b42318; }
@media(max-width:1000px) { .credit-products { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:640px) { .credit-products,.credit-order-details { grid-template-columns:1fr; } }

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--ink); background: var(--soft); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { min-height: 42px; padding: 0 17px; color: #fff; background: var(--black); border: 0; border-radius: 10px; font-weight: 750; cursor: pointer; }
button:hover { background: #28282c; }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { color: var(--ink); background: #fff; border: 1px solid #d5d5db; }
.secondary:hover { background: #f6f6f7; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-size: 19px; font-weight: 850; text-decoration: none; }
.logo-mark { display: inline-flex; line-height: 0; cursor: default; user-select: none; }
.brand-logo { display: block; width: 146px; height: 37px; background: #111; -webkit-mask: url('/assets/logoanticells.png?v=20260714-2') center / contain no-repeat; mask: url('/assets/logoanticells.png?v=20260714-2') center / contain no-repeat; }
.eyebrow, .step { margin: 0; color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin: 7px 0; font-size: 25px; letter-spacing: -.025em; }
.muted { color: var(--muted); }

/* Passwordless entry layout lives in account-auth-black.css. */
form { display: grid; gap: 17px; margin-top: 25px; }
label, fieldset { display: grid; gap: 7px; font-weight: 700; }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 8px; }
input, select { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid #ceced5; border-radius: 10px; outline: 0; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #ebe8ff; }
.text-button { min-height: 28px; padding: 0; color: var(--brand); background: transparent; }
.text-button:hover { color: var(--brand2); background: transparent; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; padding: 13px; align-items: flex-start; gap: 9px; border: 1px solid #2a2a2e; border-radius: 5px; cursor: pointer; }
.choice:has(input:checked) { background: rgba(229,38,53,.1); border-color: #e52635; }
.choice input { width: 16px; height: 16px; margin-top: 3px; }
.choice span { display: grid; }
.choice small { color: var(--muted); font-weight: 500; }
.plan-note { margin: 0; padding: 11px; color: #96969c; background: #151517; border: 1px solid #252529; border-radius: 5px; font-size: 11px; }
.code-input { text-align: center; font-size: 28px; font-weight: 850; letter-spacing: .3em; }
.form-notice { min-height: 21px; margin: 16px 0 0; color: #ff5b66; font-size: 12px; }

/* Customer application frame */
.customer-shell { height: 100vh; padding: 8px; overflow: hidden; background: var(--black); }
.portal-nav { position: fixed; z-index: 30; top: 8px; right: 8px; left: 8px; display: flex; height: 66px; padding: 0 22px; align-items: center; gap: 28px; color: #fff; background: rgba(9,9,10,.98); }
.portal-brand { flex: 0 0 auto; color: #fff; }
.portal-brand .brand-logo { width: 146px; height: 37px; background: #fff; }
.portal-nav nav { display: flex; align-items: center; gap: 4px; }
.portal-nav nav a { padding: 9px 11px; color: #85858d; border-radius: 9px; font-size: 12px; font-weight: 700; text-decoration: none; }
.portal-nav nav a:hover, .portal-nav nav a.active { color: #fff; background: #202024; }
.portal-user { position: relative; display: flex; min-width: 0; align-items: center; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: #101014; background: #f1d9c8; border: 2px solid #2d2d31; border-radius: 50%; font-weight: 850; }
.avatar-button { min-height: 38px; padding: 0; background: transparent; border-radius: 50%; }
.avatar-button:hover { background: transparent; box-shadow: 0 0 0 3px #2c2c31; }
.account-menu { position: absolute; z-index: 40; top: 48px; right: 0; width: 230px; padding: 8px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 20px 55px #0005; }
.account-menu-identity { display: grid; min-width: 0; padding: 10px 11px 12px; border-bottom: 1px solid var(--line); }
.account-menu-identity strong, .account-menu-identity small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-menu-identity small { color: var(--muted); font-size: 11px; }
.account-menu a, .account-menu > button { display: flex; width: 100%; min-height: 39px; margin-top: 4px; padding: 0 11px; align-items: center; color: var(--ink); background: transparent; border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; }
.account-menu a:hover, .account-menu > button:hover { background: #f3f3f4; }
.account-menu > button { color: var(--danger); }
.menu-button, .mobile-close { display: none; }
.workspace { position: fixed; top: 74px; right: 8px; bottom: 8px; left: 8px; overflow: hidden; background: #fff; border: 1px solid #343438; border-radius: 20px; box-shadow: var(--shadow); }
.credit-banner { max-width: 420px; margin-left: auto; padding: 7px 11px; overflow: hidden; color: #bcebdc; background: #10261f; border: 1px solid #244a3e; border-radius: 999px; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.credit-banner.warn { color: #805000; background: #fff8e8; border-color: #eed49e; }
.credit-banner.danger { color: #92281f; background: #fff0ee; border-color: #efc8c3; }
.page-content { height: 100%; padding: 28px 34px 42px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }

/* Reference-inspired overview */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 0; border-top: 1px solid var(--line); }
.dashboard-column { min-width: 0; padding: 28px 34px 10px 6px; }
.dashboard-column + .dashboard-column { padding-right: 0; padding-left: 38px; border-left: 1px solid var(--line); }
.section-heading { display: flex; margin-bottom: 24px; align-items: center; justify-content: space-between; gap: 15px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading h2 { font-size: 23px; }
.section-heading h3 { font-size: 19px; }
.quiet-link { color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.usage-total { display: flex; margin-bottom: 10px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.usage-total strong { display: block; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.05em; }
.usage-total small { color: var(--muted); }
.delta-pill { padding: 4px 9px; color: #fff; background: var(--black); border-radius: 999px; font-size: 11px; font-weight: 850; }
.chart-shell { position: relative; min-height: 230px; padding: 8px 0 0; }
.chart-shell::before { position: absolute; inset: 18px 0 28px; content: ""; background-image: radial-gradient(#d9d9de 1px, transparent 1px); background-size: 10px 10px; opacity: .55; }
.usage-chart { position: relative; display: block; width: 100%; height: 205px; overflow: visible; }
.chart-line { fill: none; stroke: #17171c; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#usageArea); opacity: .18; }
.chart-point { fill: #17171c; stroke: #fff; stroke-width: 3; }
.chart-labels { display: flex; margin-top: -4px; justify-content: space-between; color: #9a9aa2; font-size: 10px; }
.range-chips { display: flex; margin: 12px 0 28px; gap: 8px; }
.range-chips span { padding: 5px 11px; color: #9999a1; border-radius: 7px; font-size: 10px; font-weight: 800; }
.range-chips .active { color: #fff; background: var(--black); }
.key-list { display: grid; gap: 2px; }
.key-row { display: grid; padding: 11px 0; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; border-bottom: 1px solid #f0f0f2; }
.key-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.key-orb { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; color: #111; background: var(--cyan-soft); border-radius: 50%; font-size: 12px; font-weight: 900; }
.key-identity > span { display: grid; min-width: 0; }
.key-identity strong, .key-identity small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.key-identity small { color: #9a9aa2; font-size: 10px; }
.key-numbers { text-align: right; }
.key-numbers strong, .key-numbers small { display: block; }
.key-numbers small { color: #9a9aa2; font-size: 10px; }
.mini-button { min-height: 28px; padding: 0 10px; color: #101014; background: var(--cyan); border-radius: 6px; font-size: 10px; text-decoration: none; line-height: 28px; font-weight: 850; }
.workspace-balance { margin: 3px 0 22px; }
.workspace-balance small { display: block; color: var(--muted); }
.workspace-balance strong { display: block; margin: 3px 0; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.05em; }
.workspace-balance code { color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 700; }
.metric-tiles { display: grid; margin: 26px 0 30px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric-tile { min-height: 132px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; background: #dedee4; border-radius: 9px; }
.metric-tile:nth-child(2) { color: #fff; background: #0a0a0b; }
.metric-tile:nth-child(3) { background: var(--cyan); }
.metric-tile span { display: grid; width: 31px; height: 31px; margin-bottom: auto; place-items: center; background: rgba(255,255,255,.6); border-radius: 50%; font-size: 14px; }
.metric-tile:nth-child(2) span { background: #28282c; }
.metric-tile small { opacity: .72; font-size: 10px; }
.metric-tile strong { margin-top: 3px; font-size: 22px; line-height: 1.05; letter-spacing: -.025em; }
.allocation-list { display: grid; gap: 15px; }
.allocation-row { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(120px, 1.3fr) 42px; align-items: center; gap: 12px; font-size: 12px; }
.allocation-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.allocation-bar { height: 12px; overflow: hidden; background: repeating-linear-gradient(90deg, #eff5f5 0 14px, #fff 14px 17px); border-radius: 2px; }
.allocation-bar span { display: block; height: 100%; background: linear-gradient(90deg, #78d1d9, #d5f2f3); }
.allocation-row > strong { text-align: right; font-size: 11px; }
.overview-note { margin-top: 24px; padding: 14px 16px; color: var(--muted); background: #f7f7f5; border-radius: 10px; font-size: 12px; }

/* Shared routed pages */
.page-head { display: flex; margin-bottom: 20px; align-items: end; justify-content: space-between; gap: 20px; }
.page-head h2 { margin: 0; }
.page-head p { margin: 3px 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card, .panel { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card small { color: var(--muted); font-weight: 650; }
.card strong { display: block; margin-top: 8px; font-size: 26px; }
.panel { margin-top: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 17px; }
.progress { height: 9px; overflow: hidden; background: #e9e9ed; border-radius: 9px; }
.progress span { display: block; height: 100%; background: var(--cyan); }
.progress-copy { display: flex; margin-top: 8px; justify-content: space-between; color: var(--muted); }
.status { display: inline-flex; padding: 4px 8px; color: #565660; background: #eeeef1; border-radius: 99px; font-size: 11px; font-weight: 850; }
.status.active, .status.paid, .status.grandfathered, .status.trialing, .status.extended { color: #06704f; background: #e7f7f1; }
.status.pending, .status.invited { color: #875100; background: #fff2d8; }
.status.failed, .status.suspended, .status.disabled, .status.revoked { color: #9c271d; background: #ffebe8; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; background: #fff; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid #eeeef1; }
th { color: var(--muted); background: #fafafa; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-action { min-height: 32px; padding: 0 10px; font-size: 12px; }
.danger-button { color: var(--danger); background: #fff; border: 1px solid #efc5c1; }
.danger-button:hover { color: #fff; background: var(--danger); }
.inline-form { display: flex; margin: 0; align-items: end; gap: 10px; }
.inline-form label { flex: 1; }
.inline-form button { flex: 0 0 auto; }
.filters { display: flex; margin: 0 0 16px; align-items: end; gap: 10px; }
.empty { padding: 42px 20px; color: var(--muted); text-align: center; }
.danger-zone { margin-top: 28px; padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff7f6; border: 1px solid #f0c8c4; border-radius: var(--radius); }
.danger-zone h3 { margin: 0 0 4px; color: #8e2118; }
.danger-zone p { max-width: 650px; margin: 0; color: #815b57; }
.delete-account-button { flex: 0 0 auto; color: #fff; background: var(--danger); }
.delete-account-button:hover { background: #8f1d15; }
.secret { display: block; margin: 15px 0; padding: 15px; overflow-wrap: anywhere; color: #dfe8ff; background: #101014; border-radius: 10px; }
.dialog-content { max-width: 580px; padding: 28px; }
dialog { padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 80px #10182840; }
dialog::backdrop { background: #0b1220aa; }
.dialog-actions { display: flex; gap: 10px; }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 17px; color: #fff; background: #17171c; border-radius: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--danger); }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skeleton-grid i { height: 130px; background: linear-gradient(90deg, #ececef 25%, #f8f8f8 50%, #ececef 75%); background-size: 200% 100%; border-radius: 16px; animation: shine 1.3s infinite; }
@keyframes shine { to { background-position: -200% 0; } }

@media (max-width: 1050px) {
  .portal-nav { gap: 12px; }
  .portal-nav nav a { padding: 8px 7px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-column, .dashboard-column + .dashboard-column { padding: 24px 0; border-left: 0; }
  .dashboard-column + .dashboard-column { border-top: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .customer-shell { padding: 0; }
  .portal-nav { top: 0; right: 0; left: 0; height: 64px; padding: 0 16px; }
  .portal-brand .brand-logo { width: 122px; height: 32px; }
  .portal-nav nav { position: absolute; top: 64px; right: 10px; left: 10px; display: none; padding: 10px; background: #111113; border: 1px solid #2b2b30; border-radius: 12px; box-shadow: 0 18px 50px #0008; }
  .portal-nav.open nav { display: grid; }
  .portal-nav nav a { padding: 11px 12px; }
  .portal-nav .credit-banner { display: none; }
  .portal-nav .portal-user { margin-left: auto; }
  .menu-button { display: block; width: 38px; min-height: 38px; padding: 0; color: #fff; background: #1c1c20; border: 1px solid #323237; }
  .mobile-close { display: none; }
  .portal-nav.open .mobile-close { position: absolute; z-index: 2; right: 18px; bottom: -50px; display: block; width: 32px; min-height: 32px; padding: 0; color: #aaa; background: transparent; font-size: 21px; }
  .workspace { top: 64px; right: 0; bottom: 0; left: 0; border: 0; border-radius: 18px 18px 0 0; }
  .page-content { padding: 24px 18px 36px; }
  .dashboard-column { padding: 22px 0; }
  .usage-total strong, .workspace-balance strong { font-size: 37px; }
  .chart-shell { min-height: 190px; }
  .usage-chart { height: 170px; }
  .metric-tiles { grid-template-columns: 1fr; }
  .metric-tile { min-height: 105px; }
  .key-row { grid-template-columns: minmax(0, 1fr) auto; }
  .key-row .mini-button { display: none; }
  .allocation-row { grid-template-columns: minmax(80px, .8fr) 1.2fr 36px; }
  .cards { grid-template-columns: 1fr; }
  .page-head, .inline-form, .filters { align-items: stretch; flex-direction: column; }
  .inline-form button { width: 100%; }
  .dialog-actions { flex-direction: column; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .delete-account-button { width: 100%; }
}
.referral-share{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:18px;align-items:end}.referral-share>div{display:grid;gap:7px}.referral-share code{overflow-wrap:anywhere}.referral-actions{display:flex;gap:10px;flex-wrap:wrap}
@media(max-width:720px){.referral-share{grid-template-columns:1fr}.referral-share button{justify-self:start}}
