/* Client Portal – Stripe-inspired: light gray sidebar, white workspace, hairline borders, blurple accent.
   Change --brand to re-theme everything (e.g. #2563eb for plain blue). */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --canvas: #f6f8fa;
  --surface: #ffffff;
  --ink: #1a1f36;
  --ink-2: #3c4257;
  --muted: #697386;
  --faint: #8792a2;
  --line: #e3e8ee;
  --line-2: #eef1f5;
  --field-line: #d5dbe1;

  --brand: #635bff;
  --brand-strong: #5851ea;
  --brand-hover: #4b45c6;
  --brand-tint: #f1f0ff;
  --brand-soft: #dcd9ff;
  --bar-soft: #cfcbff;
  --focus: rgba(99, 91, 255, 0.4);
  --ok: #0e6245;
  --ok-bg: #d7f7c2;
  --info: #0055bc;
  --info-bg: #cfeaff;
  --warn: #983705;
  --warn-bg: #ffe9b0;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side-w: 248px;
  --shadow: 0 1px 1px rgba(26, 31, 54, 0.04), 0 2px 5px rgba(26, 31, 54, 0.04);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #c1c9d2 transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--brand-soft); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
a { color: inherit; }
:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px;
  font-weight: 600; font-size: 14px; text-decoration: none; background: transparent; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 1px rgba(26, 31, 54, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.1); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--field-line); box-shadow: 0 1px 1px rgba(26, 31, 54, 0.06); }
.btn-outline:hover { background: var(--canvas); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* ---------- badges ---------- */
.tag {
  --b: #e3e8ee; --t: #4f566b;
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  background: var(--b); color: var(--t); border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag.ok { --b: var(--ok-bg); --t: var(--ok); }
.tag.run { --b: var(--info-bg); --t: var(--info); }
.tag.warn { --b: var(--warn-bg); --t: var(--warn); }

/* ---------- app shell ---------- */
.app-body { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--canvas); border-right: 1px solid var(--line); padding: 14px 12px 12px; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; background: var(--brand); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.2; }
.brand-name small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.nav-label-h { padding: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a svg { flex: none; width: 18px; height: 18px; color: var(--faint); }
.nav a:hover { background: #ebeef2; color: var(--ink); }
.nav a[aria-current="page"] { background: #e8ebf0; color: var(--brand-strong); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--brand); }

.side-card { margin-top: auto; margin-bottom: 12px; padding: 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.side-card b { display: block; font-size: 13px; font-weight: 600; }
.side-card span { display: block; margin: 1px 0 8px; font-size: 12px; color: var(--muted); }
.side-meter { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.side-meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.side-foot { padding: 10px 6px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-hover); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.side-user { min-width: 0; line-height: 1.25; }
.side-user b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobilebar { display: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(26, 31, 54, 0.4); }

.main-col { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-search { display: flex; align-items: center; gap: 8px; width: min(380px, 100%); height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--field-line); border-radius: 6px; background: #fff; color: var(--faint); box-shadow: 0 1px 1px rgba(26, 31, 54, 0.04); }
.top-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.top-search input::placeholder { color: var(--faint); }
.top-search kbd { font: 600 11px var(--font); padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--faint); background: var(--canvas); }
.top-acts { display: flex; align-items: center; gap: 10px; }
.plan-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--brand-tint); color: var(--brand-strong); font-size: 12px; font-weight: 600; }

.page { max-width: 1160px; margin: 0 auto; padding: 32px 32px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.lede { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.card-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- KPI strip (Stripe overview style) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; min-width: 0; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-ico { display: none; }
.kpi strong { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi strong small { font-size: 14px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.kpi .d { font-size: 13px; color: var(--muted); }
.kpi.hero { background: var(--brand-tint); }
.kpi.hero .k { color: var(--brand-hover); }
.meter { height: 6px; margin: 6px 0 4px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------- grids ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; margin-bottom: 20px; align-items: start; }

/* ---------- chart ---------- */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .base { stroke: var(--line); }
.chart .ax { font-size: 11px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--bar-soft); transition: fill 0.12s; }
.chart .bar.cur { fill: var(--brand); }
.chart g:hover .bar { fill: var(--brand-hover); }
.chart .avg { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.legend i.prev { background: var(--bar-soft); }

/* ---------- formats list ---------- */
.fmt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.fmt { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.fmt-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.fmt-name { font-weight: 600; }
.fmt-detail { font-size: 13px; color: var(--muted); }
.fmt-avail { text-align: right; line-height: 1.2; }
.fmt-avail b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fmt-avail span { font-size: 12px; color: var(--muted); }
.fmt-bar { grid-column: 2 / -1; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: -6px; }
.fmt-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.fmt-cost { font-variant-numeric: tabular-nums; }
.card-foot-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }

.fmt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fmt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fmt-card .fmt-ico { margin-bottom: 10px; }
.fmt-big { margin-top: 8px; }
.fmt-big b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fmt-big span { font-size: 13px; color: var(--muted); }
.fmt-card .fmt-cost { font-size: 13px; color: var(--muted); }
.fmt-card .btn { margin-top: 12px; width: 100%; }
.fmt-card.off { opacity: 0.55; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--canvas); white-space: nowrap; }
.tbl td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t-title { font-weight: 600; }
.tbl .t-fmt { color: var(--ink-2); }
.tbl .t-when { color: var(--muted); white-space: nowrap; }
.credits-neg { font-weight: 500; }
.tbl a.dl { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.tbl a.dl:hover { text-decoration: underline; }

/* ---------- filters (Stripe pill filters) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: #fff; border: 1px solid var(--field-line); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.filter b { font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.filter:hover { background: var(--canvas); }
.filter[aria-current="true"] { background: var(--brand-tint); border-color: var(--brand-soft); color: var(--brand-hover); }
.filter[aria-current="true"] b { color: var(--brand); }

/* ---------- bar lists ---------- */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.bl-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bl-name { font-weight: 600; }
.bl-val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.bl-val b { color: var(--ink); font-weight: 600; }
.hbar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.hbar.sm { max-width: 260px; height: 4px; }

/* ---------- customer billing portal (Stripe-style) ---------- */
.portal-body { margin: 0; min-height: 100dvh; background: var(--canvas); }
.portal { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr); min-height: 100dvh; }
.portal-side { padding: 56px 56px 40px; display: flex; flex-direction: column; align-items: flex-end; background: var(--canvas); }
.portal-side-in { width: min(300px, 100%); }
.portal-back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; margin-bottom: 40px; }
.portal-back:hover { color: var(--ink); }
.portal-back .brand-mark { width: 24px; height: 24px; border-radius: 6px; }
.portal-back svg { color: var(--faint); }
.portal-side h1 { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.portal-amount { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.portal-amount small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.portal-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.portal-main { background: #fff; padding: 56px 56px 80px; box-shadow: -1px 0 0 var(--line); }
.portal-col { width: min(600px, 100%); }
.p-sec { padding: 0 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line-2); }
.p-sec:last-child { border-bottom: 0; margin-bottom: 0; }
.p-sec h2 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.p-row + .p-row { margin-top: 14px; }
.p-title { font-weight: 600; }
.p-sub { color: var(--muted); font-size: 13px; }
.p-card { display: flex; align-items: center; gap: 12px; }
.p-cardico { width: 38px; height: 26px; border-radius: 4px; background: #1a1f36; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; font-style: italic; }
.p-addr { margin: 0; font-style: normal; color: var(--ink-2); line-height: 1.6; }
.p-sec .meter { margin: 10px 0 6px; }
.p-sec .tbl th, .p-sec .tbl td { padding-left: 0; padding-right: 12px; }
.p-sec .tbl th:last-child, .p-sec .tbl td:last-child { padding-right: 0; }
.p-sec .table-wrap { margin: 0; }
.p-sec .tbl th { background: transparent; border-top: 0; }
.portal-foot { margin-top: 40px; color: var(--faint); font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
  .fmt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .portal { grid-template-columns: 1fr; }
  .portal-side { align-items: flex-start; padding: 28px 24px 8px; }
  .portal-back { margin-bottom: 24px; }
  .portal-main { padding: 24px 24px 56px; box-shadow: none; }
}

@media (max-width: 860px) {
  .app-body { display: block; }
  .topbar { display: none; }
  .mobilebar { position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 10px; display: flex; align-items: center; gap: 6px; background: #fff; border-bottom: 1px solid var(--line); }
  .mobilebar .brand { padding: 0; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-102%); transition: transform 0.28s var(--ease); box-shadow: 8px 0 24px rgba(26, 31, 54, 0.12); }
  body.nav-open .sidebar { transform: none; }
  .page { padding: 20px 14px 80px; }
  .page-head h1 { font-size: 24px; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi { border-left: 0 !important; }
  .kpi + .kpi { border-top: 1px solid var(--line); }
  .fmt-grid { grid-template-columns: 1fr; }
  .card-head { flex-wrap: wrap; }
  .tbl .hide-sm { display: none; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
}

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

/* ---------- sign in ---------- */
.side-out { margin: 0 0 0 auto; }
.form-alert { margin: 0 0 16px; padding: 10px 12px; border-radius: 6px; background: #ffe7ee; color: #a41c4e; font-size: 13px; font-weight: 500; }
.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 15px 35px rgba(26, 31, 54, 0.08), 0 5px 15px rgba(0, 0, 0, 0.06); }
.login-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 28px; }
.login-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 20px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 6px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; box-shadow: 0 1px 1px rgba(26, 31, 54, 0.04); }
.field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.btn-block { width: 100%; margin-top: 4px; }

/* ---------- plan & pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.price-cell { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pc-k { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.pc-k svg { color: var(--brand); }
.price-cell b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pc-d { font-size: 13px; color: var(--muted); }
.sub-h { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; }
.check-list svg { flex: none; margin-top: 2px; color: var(--ok); }
.legend i.avgkey { background: none; border-top: 2px dashed var(--faint); border-radius: 0; height: 0; width: 14px; }
.chart-wrap { position: relative; }
.chart-empty { position: absolute; left: 0; right: 0; top: 38%; margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.empty-row { text-align: center; color: var(--muted); padding: 32px 20px !important; }
.kpi .meter { margin: 6px 0 2px; }
@media (max-width: 560px) { .price-grid { grid-template-columns: 1fr; } }

/* ---------- AI credits ---------- */
.ai-card { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; }
.ai-bal { display: flex; flex-direction: column; gap: 2px; padding-right: 28px; border-right: 1px solid var(--line-2); }
.ai-bal .k { margin-top: 18px; font-size: 13px; font-weight: 500; color: var(--muted); }
.ai-big { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.ai-bal .d { font-size: 13px; color: var(--muted); }
.ai-sum { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.ai-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-days { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; align-items: end; min-height: 190px; }
.ai-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.ai-val { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-track { flex: 1; width: 100%; max-width: 44px; min-height: 110px; display: flex; align-items: flex-end; background: var(--canvas); border-radius: 6px; overflow: hidden; }
.ai-track i { display: block; width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; }
.ai-day { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
@media (max-width: 900px) { .ai-card { grid-template-columns: 1fr; gap: 20px; } .ai-bal { padding-right: 0; border-right: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); } }
@media (max-width: 560px) { .ai-days { gap: 4px; } .ai-val { font-size: 10px; } .ai-day { font-size: 10px; } }

/* ---------- delivered videos link ---------- */
.delivery { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 18px 20px; background: var(--brand-tint); border: 1px solid var(--brand-soft); border-radius: 8px; }
.delivery-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.delivery-txt { flex: 1; min-width: 0; }
.delivery-txt h2 { font-size: 16px; font-weight: 600; }
.delivery-txt p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 640px) { .delivery { flex-wrap: wrap; } .delivery .btn { width: 100%; } }