/* ============================================================
   DMlytics — Apple-inspired dashboard theme
   Light-first, SF Pro system font, hairline borders,
   soft layered shadows, single blue accent. Dark mode via
   prefers-color-scheme. All class names preserved from the
   previous theme so markup/JS keep working.
   ============================================================ */

:root {
  /* Canvas + surfaces */
  --bg: #f5f5f7;                       /* Apple light gray canvas */
  --bg-2: #ffffff;                     /* sticky headers / popovers */
  --surface: #ffffff;                  /* cards */
  --surface-2: #f5f5f7;                /* inset rows / subtle fills */
  --surface-3: #ececf0;

  /* Hairlines */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  /* Text */
  --text: #1d1d1f;                     /* Apple near-black */
  --muted: #6e6e73;                    /* Apple secondary */
  --faint: #8e8e93;

  /* Accent (Apple blue) + semantic (Apple system colors) */
  --primary: #0071e3;
  --primary-press: #0160c0;
  --primary-2: #0a84ff;
  --accent: #0071e3;
  --green: #30a46c;
  --green-bg: rgba(48, 164, 108, 0.14);
  --yellow: #c77700;
  --yellow-bg: rgba(255, 159, 10, 0.16);
  --red: #e5484d;
  --red-bg: rgba(229, 72, 77, 0.12);
  --purple-bg: rgba(0, 113, 227, 0.10);
  --blue-bg: rgba(0, 113, 227, 0.10);

  /* Shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  /* Soft, layered shadows (Apple-like) */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -14px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.06), 0 24px 56px -28px rgba(0, 0, 0, 0.30);

  --gradient: linear-gradient(135deg, #0a84ff 0%, #0071e3 100%);
  --sidebar-w: 272px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f5f7;
    --muted: #98989d;
    --faint: #8e8e93;
    --primary: #0a84ff;
    --primary-press: #0a6fd6;
    --primary-2: #409cff;
    --accent: #0a84ff;
    --green: #30d158;
    --green-bg: rgba(48, 209, 88, 0.16);
    --yellow: #ffd60a;
    --yellow-bg: rgba(255, 214, 10, 0.16);
    --red: #ff453a;
    --red-bg: rgba(255, 69, 58, 0.16);
    --purple-bg: rgba(10, 132, 255, 0.16);
    --blue-bg: rgba(10, 132, 255, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 28px 60px -28px rgba(0, 0, 0, 0.9);
    --gradient: linear-gradient(135deg, #0a84ff 0%, #0060df 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.47;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: var(--bg-2);
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--gradient);
  box-shadow: 0 4px 12px -4px rgba(10, 132, 255, 0.55);
  font-size: 20px;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: var(--radius-xs);
  color: var(--text); text-decoration: none;
  font-weight: 500; font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(0, 113, 227, 0.5);
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; opacity: 0.95; }

.connector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  display: flex; flex-direction: column; gap: 9px;
  box-shadow: var(--shadow);
}
.connector-title { font-weight: 600; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.connector-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.connector-row > span:nth-child(2) { flex: 1; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.14);
}
.dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); animation: pulse 2.4s infinite; }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-bg); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-bg); }
  50% { box-shadow: 0 0 0 6px rgba(48, 164, 108, 0.05); }
}

/* ---------------- Content ---------------- */
.content { padding: 0 40px 64px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
  padding: 22px 0 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; }
.title { margin: 5px 0 0; font-size: 28px; letter-spacing: -0.025em; font-weight: 700; }
.topbar-actions { display: flex; gap: 10px; align-items: flex-end; }
.range { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 500; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 980px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 500;
  cursor: pointer; transition: background 0.15s ease, transform 0.08s ease, border-color 0.15s ease;
  font-family: inherit; font-size: 13.5px;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(0, 113, 227, 0.5);
}
.btn.primary:hover { background: var(--primary-press); }
.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn.ghost:hover { background: var(--surface-2); color: var(--primary); }
.btn.danger-ghost {
  background: transparent;
  color: var(--red);
  border-color: transparent;
}
.btn.danger-ghost:hover { background: var(--red-bg); }
.btn.tiny { padding: 4px 11px; font-size: 12px; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

.select, .input {
  padding: 9px 12px; border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: inherit; font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 160px;
}
.select:focus, .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

/* ---------------- Chips ---------------- */
.chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 980px;
  font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.chip.small { padding: 2px 9px; font-size: 11px; }
.chip.red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.chip.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.chip.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }
.chip.purple { background: var(--purple-bg); color: var(--primary); border-color: transparent; }
.chip.blue { background: var(--blue-bg); color: var(--primary); border-color: transparent; }
.chip.positive { background: var(--green-bg); color: var(--green); border-color: transparent; }
.chip.negative { background: var(--red-bg); color: var(--red); border-color: transparent; }
.chip.neutral { background: var(--blue-bg); color: var(--primary); border-color: transparent; }
.chip.mixed { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }

/* ---------------- Tabbed sections ---------------- */
.panel-section { display: none; margin-bottom: 24px; }
.panel-section.active { display: block; animation: sectionIn 0.28s cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes sectionIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section-header { margin-bottom: 18px; }
.section-header h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.02em; font-weight: 600; }
.muted { color: var(--muted); }
.muted.small { font-size: 12px; }
.small { font-size: 12px; }

/* ---------------- KPI ---------------- */
.kpi-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  margin-bottom: 26px;
}
.kpi-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-card::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--primary);
}
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 32px; font-weight: 700; margin: 10px 0 4px; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.kpi-delta.up::before { content: "▲"; color: var(--green); font-size: 9px; }
.kpi-delta.down::before { content: "▼"; color: var(--red); font-size: 9px; }
.kpi-delta.neutral::before { content: "●"; color: var(--faint); font-size: 7px; }
.kpi-card.sentiment::before { background: var(--green); }
.kpi-card.complaints::before { background: var(--red); }
.kpi-card.features::before { background: var(--primary); }
.kpi-card.bugs::before { background: var(--yellow); }

/* ---------------- Card / Chart ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-header h3 { margin: 0; font-size: 16px; letter-spacing: -0.015em; font-weight: 600; }
.chart-wrap { height: 260px; position: relative; }
.chart-wrap.tall { height: 340px; }
.chart-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.chart-grid .wide { grid-column: 1 / -1; }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

/* ---------------- Lists + tables ---------------- */
.list-table { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow: auto; }
.list-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.list-row:hover { background: var(--surface-3); border-color: var(--border); }
.list-count {
  width: 40px; display: grid; place-items: center;
  background: var(--primary); color: #fff;
  border-radius: 10px; font-weight: 700;
  align-self: start;
  min-height: 40px;
}
.list-name { font-weight: 600; margin-bottom: 4px; }
.list-examples { display: flex; flex-direction: column; gap: 6px; }
.quote {
  padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 13px;
}
.quote:hover { border-color: var(--primary); }
.empty {
  padding: 28px; text-align: center; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
}

.mt24 { margin-top: 24px; }
.mb16 { margin-bottom: 16px; }

.table-wrap { overflow: auto; max-height: 520px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  position: sticky; top: 0;
  background: var(--bg-2); z-index: 1;
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border-strong);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600;
}
.table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------------- Brief ---------------- */
.brief-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.brief-card { padding: 30px; }
.brief-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brief-head h3 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -0.02em; font-weight: 600; }
.brief-stats { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.brief-body.markdown h4 { margin: 24px 0 10px; font-size: 12px; color: var(--primary); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.brief-body.markdown h4:first-child { margin-top: 0; }
.brief-body.markdown p { margin: 0 0 12px; color: var(--text); }
.brief-body.markdown ul { margin: 0 0 16px 20px; padding: 0; }
.brief-body.markdown li { margin: 4px 0; }
.brief-body.markdown strong { background: var(--purple-bg); padding: 1px 5px; border-radius: 5px; font-weight: 600; }
.brief-body .empty-brief { color: var(--muted); text-align: center; padding: 44px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

/* ---------------- Pipeline ---------------- */
.pipeline-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.form-grid label.span-2 { grid-column: span 2; }
.form-grid .input, .form-grid .select { min-width: 0; }
.action-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.footer {
  margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 99;
  padding: 13px 18px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  max-width: 360px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
.toast.error { background: var(--red-bg); border-color: transparent; color: var(--red); }
.toast.success { background: var(--green-bg); border-color: transparent; color: var(--green); }

/* ---------------- Spinner ---------------- */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.spinner.inline { vertical-align: -3px; }
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .pipeline-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .content { padding: 0 20px 40px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Instagram connection gate / notices ---------- */
.notice { border-radius: var(--radius-xs); padding: 11px 13px; font-size: 13px; line-height: 1.45; margin-bottom: 16px; }
.notice.warn { background: var(--yellow-bg); color: var(--yellow); }
.notice.error { background: var(--red-bg); color: var(--red); }
.notice.info { background: var(--blue-bg); color: var(--primary); }
.notice.ok { background: var(--green-bg); color: var(--green); }
.ig-gate { max-width: 720px; }
.ig-gate h2 { margin: 4px 0 8px; font-weight: 600; letter-spacing: -0.02em; }
.ig-gate.problem { border-color: var(--red); }
.code-input { font-size: 20px; letter-spacing: 0.3em; text-align: center; }
.form-grid .span-2 { grid-column: span 2; }
.btn.small-btn { padding: 6px 12px; font-size: 12px; }
body.ig-not-connected .panel-section,
body.ig-not-connected .topbar-actions,
body.ig-not-connected .nav { display: none !important; }
.gate-section { margin-bottom: 24px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.ig-alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.ig-alt h3 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.ig-howto { margin: 10px 0 14px; font-size: 13px; color: var(--muted); }
.ig-howto summary { cursor: pointer; color: var(--text); font-weight: 600; }
.ig-howto ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.6; }
.ig-challenge img { width: 100%; max-height: 420px; object-fit: contain; border-radius: var(--radius-xs); border: 1px solid var(--border); background: #fff; margin-bottom: 10px; }
.ig-challenge-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.ig-challenge-options .btn { padding: 6px 12px; font-size: 13px; }
#ig-challenge-texts div { margin: 2px 0; }
#ig-challenge-shot { cursor: crosshair; }
#ig-shot-hint { margin-bottom: 8px; color: var(--text); }

/* ---------- Strategy ---------- */
.strat-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.strat-item:last-child { border-bottom: 0; }
.strat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.strat-item p { margin: 6px 0; font-size: 13px; }
.strat-item .small { font-size: 12px; margin-top: 3px; }
.mt16 { margin-top: 16px; }

.nav-item.active { position: relative; }
.row-review td { background: rgba(229, 72, 77, 0.07); }
.dm-cat-edit { padding: 3px 6px; font-size: 12px; min-width: 120px; }

/* ---------- Connection method switch ---------- */
.method-switch { display: flex; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.method-btn {
  flex: 1; min-width: 160px; padding: 10px 12px; border-radius: var(--radius-xs); cursor: pointer;
  background: var(--surface); color: var(--muted); font: inherit; font-weight: 500;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.method-btn:hover { color: var(--text); border-color: var(--border-strong); }
.method-btn.active { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.16); }

/* ---------- Inbox ---------- */
.inbox-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.inbox-filters .input { max-width: 220px; }
.inbox-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inbox-cat { padding: 3px 6px; font-size: 12px; min-width: 120px; }
.row-done td { opacity: 0.5; }

/* ---------- Usage bar ---------- */
.usage-bar { height: 12px; border-radius: 980px; background: var(--surface-2); overflow: hidden; }
.usage-fill { height: 100%; background: var(--primary); width: 0; transition: width .3s; border-radius: 980px; }
.usage-fill.over { background: var(--red); }

/* Ensure the hidden attribute always wins (fixes role-gated nav items) */
[hidden] { display: none !important; }

/* ---------- Usage & billing ---------- */
.bill-hero { display: grid; grid-template-columns: 1fr 1.25fr; gap: 32px; align-items: center; padding: 26px 28px; }
.bill-plan-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 6px; }
.bill-plan-row h3 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.bill-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; font-size: 14px; }
.bill-meter-top b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bill-meter-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 9px; }
.plan-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: stretch; padding-top: 10px; }
.plan-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px 18px; box-shadow: var(--shadow); transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.plan-badge {
  position: absolute; top: -10px; left: 16px; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 980px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.plan-card.popular .plan-badge, .plan-badge.current { background: var(--primary); color: #fff; border-color: transparent; }
.plan-card h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.plan-price { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-tag { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; min-height: 36px; }
.plan-feats { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 7px; font-size: 13px; }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats li::before { content: "✓"; color: var(--green); font-weight: 700; }
.plan-card .btn { margin-top: auto; justify-content: center; width: 100%; }
@media (max-width: 900px) { .bill-hero { grid-template-columns: 1fr; gap: 20px; } }
