/* =============================================================================
   themes/bento.css: the "Bento" theme.
   Modelled on a bento-grid dashboard: dark emerald hero card, big rounded white cards on a
   pale grey-green page, soft shadows, a slim dark pill icon rail, pill toggles, data as shapes
   (pill / segmented / tick bars). Emerald family for data and accents; orange ONLY for the
   primary call to action.

   1. Tokens (--brand-*, plus the Primer surface/border/text variables) for light and dark.
      The dark block appears twice, as in github.css: once for "Dark", once inside the
      prefers-color-scheme media query for "System". Keep them identical.
   2. Component styling, every selector scoped to html[data-app-theme=bento].
   Raw colours are allowed here (and in github.css) and nowhere else.
   ============================================================================= */

/* ---------- 1. tokens: mode independent ---------- */
html[data-app-theme=bento][data-color-mode] {
  --brand-name-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --brand-body-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --brand-serif-font: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --brand-mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --brand-radius: 12px;               /* small controls, code blocks */
  --brand-radius-lg: 22px;            /* cards */
  --brand-chart-bar-radius: 8;
  --brand-chart-area: 0.2;
  --brand-chart-line-width: 3;
  --brand-chart-tension: 0.4;

  /* call to action: the ONLY orange in the theme; dark text keeps AA contrast */
  --brand-cta: #f97316;
  --brand-cta-hover: #fb8a3c;
  --brand-cta-active: #ea580c;
  --brand-cta-fg: #1c0f04;

  /* hero card: deep emerald to teal, white text (same in light and dark) */
  --brand-hero-bg: linear-gradient(135deg, #022c22 0%, #064e3b 48%, #0f766e 100%);
  --brand-hero-fg: #ffffff;
  --brand-hero-fg-muted: #e1f9f1;
  --brand-live-bg: rgba(255, 255, 255, .14);
  --brand-live-fg: #ecfdf5;
  --brand-live-dot: #4ade80;
}

/* ---------- 1. tokens: LIGHT ---------- */
html[data-app-theme=bento][data-color-mode=light],
html[data-app-theme=bento][data-color-mode=auto] {
  --brand-primary: #0f766e;
  --brand-primary-hover: #115e59;
  --brand-primary-active: #134e4a;
  --brand-primary-fg: #ffffff;
  --brand-primary-muted: rgba(16, 185, 129, .14);
  --brand-header-bg: #f3f6f4;
  --brand-header-fg: #3b4d46;
  --brand-header-logo: #0b1f1a;
  --brand-page-bg: #f3f6f4;
  --brand-shadow: 0 1px 2px rgba(15, 50, 40, .04), 0 14px 34px -10px rgba(15, 60, 45, .13);
  --brand-shadow-hover: 0 2px 4px rgba(15, 50, 40, .06), 0 28px 50px -14px rgba(15, 60, 45, .28);
  --brand-card-border: transparent;
  --brand-input-border: #7b948a;
  --brand-rail-bg: #0e1f1b;
  --brand-rail-fg: #b4c9c0;
  --brand-rail-hover-bg: rgba(255, 255, 255, .1);
  --brand-rail-active-bg: #34d399;
  --brand-rail-active-fg: #04231a;
  --brand-meter-track: #e3ece7;
  --brand-meter-fill: #10b981;

  /* data visualisation: emerald-first (series 1 = emerald 600, 3:1+ on white) */
  --brand-series-1: #059669;
  --brand-series-2: #134e4a;
  --brand-series-3: #65a30d;
  --brand-series-4: #0891b2;
  --brand-series-5: #dc2626;
  --brand-series-6: #64748b;
  --brand-heat-0: rgba(16, 185, 129, 0);
  --brand-heat-1: rgba(16, 185, 129, .5);
  --brand-heat-2: rgba(101, 163, 13, .65);
  --brand-heat-3: rgba(217, 119, 6, .8);
  --brand-heat-4: rgba(220, 38, 38, .9);

  /* Primer surfaces for this mode (cards white on a light grey-green page) */
  --bgColor-default: #ffffff;
  --bgColor-muted: #f3f6f4;
  --bgColor-inset: #eaf0ed;
  --bgColor-success-muted: rgba(16, 185, 129, .16);
  --bgColor-danger-muted: rgba(220, 38, 38, .1);
  --bgColor-attention-muted: rgba(217, 119, 6, .14);
  --borderColor-default: #dce6e1;
  --borderColor-muted: #e8efeb;
  --fgColor-default: #10231d;
  --fgColor-muted: #4a5e56;
  --fgColor-success: #047857;
  --fgColor-danger: #b91c1c;
  --fgColor-attention: #b45309;
  --button-default-bgColor-rest: #ffffff;
  --button-default-bgColor-hover: #f3f6f4;
  --button-default-bgColor-active: #e8efeb;
  --button-default-borderColor-rest: #cfdcd6;
  --button-default-fgColor-rest: #10231d;
}

/* ---------- 1. tokens: DARK ---------- */
html[data-app-theme=bento][data-color-mode=dark] {
  --brand-primary: #34d399;
  --brand-primary-hover: #6ee7b7;
  --brand-primary-active: #10b981;
  --brand-primary-fg: #04231a;
  --brand-primary-muted: rgba(52, 211, 153, .16);
  --brand-header-bg: #0b1210;
  --brand-header-fg: #a9bdb4;
  --brand-header-logo: #ecf5f1;
  --brand-page-bg: #0b1210;
  --brand-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -12px rgba(0, 0, 0, .6);
  --brand-shadow-hover: 0 2px 4px rgba(0, 0, 0, .5), 0 30px 54px -14px rgba(0, 0, 0, .8);
  --brand-card-border: rgba(255, 255, 255, .06);
  --brand-input-border: #5f7d71;
  --brand-rail-bg: #17241f;
  --brand-rail-fg: #aac0b7;
  --brand-rail-hover-bg: rgba(255, 255, 255, .1);
  --brand-rail-active-bg: #34d399;
  --brand-rail-active-fg: #04231a;
  --brand-meter-track: rgba(255, 255, 255, .09);
  --brand-meter-fill: #34d399;

  --brand-series-1: #34d399;
  --brand-series-2: #99f6e4;
  --brand-series-3: #a3e635;
  --brand-series-4: #22d3ee;
  --brand-series-5: #fb7185;
  --brand-series-6: #94a3b8;
  --brand-heat-0: rgba(52, 211, 153, 0);
  --brand-heat-1: rgba(52, 211, 153, .5);
  --brand-heat-2: rgba(163, 230, 53, .65);
  --brand-heat-3: rgba(251, 191, 36, .8);
  --brand-heat-4: rgba(248, 113, 113, .9);

  --bgColor-default: #111a17;
  --bgColor-muted: #16211d;
  --bgColor-inset: #0e1613;
  --bgColor-success-muted: rgba(52, 211, 153, .16);
  --bgColor-danger-muted: rgba(248, 113, 113, .16);
  --bgColor-attention-muted: rgba(251, 191, 36, .16);
  --borderColor-default: rgba(255, 255, 255, .09);
  --borderColor-muted: rgba(255, 255, 255, .06);
  --fgColor-default: #e8f1ed;
  --fgColor-muted: #9db2a9;
  --fgColor-success: #34d399;
  --fgColor-danger: #f87171;
  --fgColor-attention: #fbbf24;
  --button-default-bgColor-rest: #16211d;
  --button-default-bgColor-hover: #1d2b26;
  --button-default-bgColor-active: #243630;
  --button-default-borderColor-rest: rgba(255, 255, 255, .14);
  --button-default-fgColor-rest: #e8f1ed;
}

@media (prefers-color-scheme: dark) {
  html[data-app-theme=bento][data-color-mode=auto] {
    --brand-primary: #34d399;
    --brand-primary-hover: #6ee7b7;
    --brand-primary-active: #10b981;
    --brand-primary-fg: #04231a;
    --brand-primary-muted: rgba(52, 211, 153, .16);
    --brand-header-bg: #0b1210;
    --brand-header-fg: #a9bdb4;
    --brand-header-logo: #ecf5f1;
    --brand-page-bg: #0b1210;
    --brand-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -12px rgba(0, 0, 0, .6);
    --brand-shadow-hover: 0 2px 4px rgba(0, 0, 0, .5), 0 30px 54px -14px rgba(0, 0, 0, .8);
    --brand-card-border: rgba(255, 255, 255, .06);
    --brand-input-border: #5f7d71;
    --brand-rail-bg: #17241f;
    --brand-rail-fg: #aac0b7;
    --brand-rail-hover-bg: rgba(255, 255, 255, .1);
    --brand-rail-active-bg: #34d399;
    --brand-rail-active-fg: #04231a;
    --brand-meter-track: rgba(255, 255, 255, .09);
    --brand-meter-fill: #34d399;

    --brand-series-1: #34d399;
    --brand-series-2: #99f6e4;
    --brand-series-3: #a3e635;
    --brand-series-4: #22d3ee;
    --brand-series-5: #fb7185;
    --brand-series-6: #94a3b8;
    --brand-heat-0: rgba(52, 211, 153, 0);
    --brand-heat-1: rgba(52, 211, 153, .5);
    --brand-heat-2: rgba(163, 230, 53, .65);
    --brand-heat-3: rgba(251, 191, 36, .8);
    --brand-heat-4: rgba(248, 113, 113, .9);

    --bgColor-default: #111a17;
    --bgColor-muted: #16211d;
    --bgColor-inset: #0e1613;
    --bgColor-success-muted: rgba(52, 211, 153, .16);
    --bgColor-danger-muted: rgba(248, 113, 113, .16);
    --bgColor-attention-muted: rgba(251, 191, 36, .16);
    --borderColor-default: rgba(255, 255, 255, .09);
    --borderColor-muted: rgba(255, 255, 255, .06);
    --fgColor-default: #e8f1ed;
    --fgColor-muted: #9db2a9;
    --fgColor-success: #34d399;
    --fgColor-danger: #f87171;
    --fgColor-attention: #fbbf24;
    --button-default-bgColor-rest: #16211d;
    --button-default-bgColor-hover: #1d2b26;
    --button-default-bgColor-active: #243630;
    --button-default-borderColor-rest: rgba(255, 255, 255, .14);
    --button-default-fgColor-rest: #e8f1ed;
  }
}

/* =============================================================================
   Component styling. EVERY selector is scoped to html[data-app-theme=bento] so the GitHub theme is untouched.
   Colours come from tokens; the few raw values below are theme-independent details
   (white on dark surfaces, shadow tints).
   ============================================================================= */

/* ---------- page + header ---------- */
html[data-app-theme=bento] body.color-bg-default { background-color: var(--app-page-bg) !important; }
html[data-app-theme=bento] .Header { padding: 12px 24px; box-shadow: none; }
html[data-app-theme=bento] .app-header { backdrop-filter: saturate(1.4) blur(8px); }
html[data-app-theme=bento] .app-brand-name { font-weight: 700; letter-spacing: -.02em; }
html[data-app-theme=bento] .Header-link:hover { text-decoration: none; }
html[data-app-theme=bento] h1, html[data-app-theme=bento] .h2 { letter-spacing: -.025em; }
html[data-app-theme=bento] .sitenav-head h1 { font-weight: 700; }
html[data-app-theme=bento] .app-main:has(.hero-intro) .sitenav-head { display: none !important; }
html[data-app-theme=bento] .app-main { padding-top: 12px !important; }
html[data-app-theme=bento] a:focus-visible, html[data-app-theme=bento] button:focus-visible, html[data-app-theme=bento] summary:focus-visible, html[data-app-theme=bento] [tabindex]:focus-visible {
  outline: 2px solid var(--focus-outlineColor); outline-offset: 2px;
}

/* ---------- cards ---------- */
html[data-app-theme=bento] .Box {
  border: 1px solid var(--app-card-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow);
}
html[data-app-theme=bento] .Box-header { background: transparent; border: 0; margin: 0; padding: 22px 24px 6px; border-radius: 0; }
html[data-app-theme=bento] .Box-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
html[data-app-theme=bento] .Box-body { padding: 12px 24px 24px; }
html[data-app-theme=bento] .Box-row { border-top: 1px solid var(--borderColor-muted); margin-top: 0; padding: 12px 24px; }
html[data-app-theme=bento] .Box-row:last-child { border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg); }
html[data-app-theme=bento] .Box-footer { border-top: 1px solid var(--borderColor-muted); margin-top: 0; padding: 14px 24px; border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg); }
html[data-app-theme=bento] .blankslate { padding: 40px 32px; }
html[data-app-theme=bento] code.snippet { border-radius: var(--app-radius); border-color: var(--borderColor-default); }
html[data-app-theme=bento] .note, html[data-app-theme=bento] .flash { border-radius: var(--app-radius); }
html[data-app-theme=bento] .Subhead { border-bottom: 0; padding-bottom: 8px; }
html[data-app-theme=bento] .Subhead-heading { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }

/* hover lift (cards that summarise data); the shadow change stays under reduced motion, the movement does not */
html[data-app-theme=bento] .kpi:hover, html[data-app-theme=bento] .rp-panel:hover, html[data-app-theme=bento] .chart-card:hover, html[data-app-theme=bento] .site-card:hover { box-shadow: var(--app-shadow-hover); }
@media (prefers-reduced-motion: no-preference) {
  html[data-app-theme=bento] .kpi, html[data-app-theme=bento] .rp-panel, html[data-app-theme=bento] .chart-card, html[data-app-theme=bento] .site-card { transition: transform 150ms ease, box-shadow 150ms ease; }
  html[data-app-theme=bento] .kpi:hover, html[data-app-theme=bento] .rp-panel:hover, html[data-app-theme=bento] .chart-card:hover, html[data-app-theme=bento] .site-card:hover { transform: translateY(-4px); }
}

/* ---------- buttons, inputs ---------- */
html[data-app-theme=bento] .btn {
  border-radius: 999px;
  border-color: var(--button-default-borderColor-rest);
  box-shadow: none;
  font-weight: 600;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
html[data-app-theme=bento] .btn:hover { background-color: var(--button-default-bgColor-hover); text-decoration: none; }
html[data-app-theme=bento] .btn-sm { padding: 3px 14px; }
html[data-app-theme=bento] .btn-primary {
  background-color: var(--app-cta);
  color: var(--app-cta-fg);
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(249, 115, 22, .6);
}
html[data-app-theme=bento] .btn-primary:hover { background-color: var(--app-cta-hover); }
html[data-app-theme=bento] .btn-primary:focus-visible { outline: 2px solid var(--focus-outlineColor); outline-offset: 2px; box-shadow: none; }
html[data-app-theme=bento] .btn-danger { background-color: transparent; }
html[data-app-theme=bento] .form-control, html[data-app-theme=bento] .form-select {
  border-radius: 12px;
  border: 1px solid var(--app-input-border);
  background-color: var(--bgColor-default);
  color: var(--fgColor-default);
  box-shadow: none;
}
html[data-app-theme=bento] .form-control:focus, html[data-app-theme=bento] .form-select:focus { border-color: var(--focus-outlineColor); box-shadow: 0 0 0 3px var(--bgColor-accent-muted); outline: none; }

/* ---------- pill toggles (BtnGroup) ---------- */
html[data-app-theme=bento] .BtnGroup { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--app-meter-track); vertical-align: middle; }
html[data-app-theme=bento] .BtnGroup-item {
  float: none; border: 0 !important; border-radius: 999px !important; box-shadow: none;
  background: transparent; color: var(--fgColor-muted);
}
html[data-app-theme=bento] .BtnGroup-item:hover { background: transparent; color: var(--fgColor-default); }
html[data-app-theme=bento] .BtnGroup-item.selected, html[data-app-theme=bento] .BtnGroup-item[aria-pressed=true], html[data-app-theme=bento] .BtnGroup-item[aria-current=true] {
  background: var(--bgColor-default); color: var(--fgColor-default);
  box-shadow: 0 1px 4px rgba(10, 40, 30, .18);
}

/* ---------- labels ---------- */
html[data-app-theme=bento] .Label {
  border: 0; border-radius: 999px; padding: 3px 10px; font-weight: 600;
  background: var(--app-meter-track); color: var(--fgColor-muted) !important;
}
html[data-app-theme=bento] .Label--accent { background: var(--app-accent-muted); color: var(--fgColor-accent) !important; }
html[data-app-theme=bento] .Label.rp-pill-good { background: var(--bgColor-success-muted); color: var(--app-good) !important; }
html[data-app-theme=bento] .Label.rp-pill-warn { background: var(--bgColor-attention-muted); color: var(--app-warn) !important; }
html[data-app-theme=bento] .Label.rp-pill-bad { background: var(--bgColor-danger-muted); color: var(--app-bad) !important; }
html[data-app-theme=bento] .Counter { border-radius: 999px; }

/* ---------- KPI tiles ---------- */
html[data-app-theme=bento] .kpi-grid { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
html[data-app-theme=bento] .kpi {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bgColor-default);
  border: 1px solid var(--app-card-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow);
  padding: 20px 22px;
}
html[data-app-theme=bento] .kpi-label { font-size: 12.5px; font-weight: 500; color: var(--fgColor-muted); }
html[data-app-theme=bento] .kpi-value { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin-top: 2px; }
html[data-app-theme=bento] .kpi-delta-up, html[data-app-theme=bento] .kpi-delta-down {
  align-self: flex-start; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 600;
}
html[data-app-theme=bento] .kpi-delta-up { background: var(--bgColor-success-muted); }
html[data-app-theme=bento] .kpi-delta-down { background: var(--bgColor-danger-muted); }
html[data-app-theme=bento] .kpi .color-fg-muted.f6 { margin-top: 6px; }
html[data-app-theme=bento] .kpi .tooltipped { vertical-align: middle; }

/* KPI mini visuals: pill bar (default), segmented bar (2nd of 3), dense ticks (3rd of 3) */
html[data-app-theme=bento] .kpi-meter {
  display: block; height: 8px; margin-top: auto; border-radius: 999px; overflow: hidden;
  background: var(--app-meter-track); position: relative;
}
html[data-app-theme=bento] .kpi-meter > span { display: block; height: 100%; width: var(--meter, 0%); border-radius: inherit; background: var(--app-meter-fill); }
html[data-app-theme=bento] .kpi:nth-child(3n+2) .kpi-meter, html[data-app-theme=bento] .kpi:nth-child(3n) .kpi-meter { border-radius: 0; }
html[data-app-theme=bento] .kpi:nth-child(3n+2) .kpi-meter {
  height: 10px;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 20px);
  mask-image: repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 20px);
}
html[data-app-theme=bento] .kpi:nth-child(3n) .kpi-meter {
  height: 18px;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  mask-image: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
}
html[data-app-theme=bento] .kpi:nth-child(3n+2) .kpi-meter > span, html[data-app-theme=bento] .kpi:nth-child(3n) .kpi-meter > span { border-radius: 0; }
/* order: label, value, delta, meter (pinned to the bottom of the tile) */
html[data-app-theme=bento] .kpi > .kpi-meter ~ div { order: 3; margin-bottom: 14px; }
html[data-app-theme=bento] .kpi > .kpi-meter { order: 4; }

/* ---------- panels: rows with pill bars ---------- */
html[data-app-theme=bento] .Box-row.bar-row { padding: 10px 24px 18px !important; }
html[data-app-theme=bento] .bar-row .bar { background: var(--app-meter-fill); border-radius: 999px; }
html[data-app-theme=bento] .bar-row .bar[style*="--pct"] {
  inset: auto auto 8px 24px; height: 6px; opacity: .85;
  width: calc((100% - 48px) * var(--pct) / 100) !important;
}
html[data-app-theme=bento] .rp-table td.rp-cell-path .bar { background: var(--app-accent-muted); border-radius: 8px; }
html[data-app-theme=bento] .rp-label { font-size: 14px; }
html[data-app-theme=bento] .num { font-weight: 600; }
html[data-app-theme=bento] .rp-table { width: 100%; }
html[data-app-theme=bento] .rp-table th, html[data-app-theme=bento] .rp-table td { padding: 12px 24px; border-top-color: var(--borderColor-muted); }
html[data-app-theme=bento] .rp-table thead th { background: transparent; border-top: 1px solid var(--borderColor-muted); font-weight: 600; }
html[data-app-theme=bento] .rp-table tbody tr:hover { background: var(--bgColor-muted); }
html[data-app-theme=bento] .rp-selected { background: var(--app-accent-muted); }
html[data-app-theme=bento] .rp-swatch { border-radius: 999px; width: 10px; height: 10px; }
html[data-app-theme=bento] .rp-heat-legend { border-radius: 999px; }

/* ---------- overview: hero + bento grid ---------- */
html[data-app-theme=bento] .hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  background: var(--app-hero-bg); color: var(--app-hero-fg);
  border: 1px solid var(--app-card-border); border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow); padding: 28px 30px;
}
html[data-app-theme=bento] .hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 90% at 100% 0%, rgba(52, 211, 153, .32), transparent 70%);
}
html[data-app-theme=bento] .hero > * { position: relative; }
html[data-app-theme=bento] .hero-intro { display: block; }
html[data-app-theme=bento] .hero-kicker { font-size: 13px; color: var(--app-hero-fg-muted); font-weight: 500; }
html[data-app-theme=bento] .hero-title {
  margin: 8px 0 0; font-family: var(--app-font-display); font-weight: 650; color: var(--app-hero-fg);
  font-size: clamp(30px, 3.3vw, 46px); line-height: 1.04; letter-spacing: -.035em;
}
html[data-app-theme=bento] .hero-em, html[data-app-theme=bento] .login-card .hero-em {
  font-family: var(--app-font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
  font-size: 1.08em; color: #6ee7b7;
}
html[data-app-theme=bento] .hero-controls { flex-direction: column; align-items: flex-start !important; justify-content: flex-start !important; gap: 14px; margin: 0 !important; }
html[data-app-theme=bento] .hero-controls .rp-realtime { order: -1; }
html[data-app-theme=bento] .hero .rp-toolbar { margin: 0 !important; }
html[data-app-theme=bento] .hero .color-fg-muted { color: var(--app-hero-fg-muted) !important; }
html[data-app-theme=bento] .hero .BtnGroup { background: rgba(255, 255, 255, .14); }
html[data-app-theme=bento] .hero .BtnGroup-item { color: #e1f9f1; }
html[data-app-theme=bento] .hero .BtnGroup-item:hover { color: #fff; }
html[data-app-theme=bento] .hero .BtnGroup-item.selected, html[data-app-theme=bento] .hero .BtnGroup-item[aria-current=true] { background: #ffffff; color: #064e3b; box-shadow: none; }
html[data-app-theme=bento] .hero .form-control { background-color: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .55); color: #fff; color-scheme: dark; }
html[data-app-theme=bento] .hero .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .55); color: #fff; }
html[data-app-theme=bento] .hero .btn:hover { background: rgba(255, 255, 255, .24); }
html[data-app-theme=bento] .hero a:focus-visible, html[data-app-theme=bento] .hero button:focus-visible, html[data-app-theme=bento] .hero input:focus-visible { outline-color: #ffffff; }

/* live pill */
html[data-app-theme=bento] .rp-realtime {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--app-live-bg); color: var(--app-live-fg); font-size: 13px;
}
html[data-app-theme=bento] .rp-realtime strong { color: inherit; }
html[data-app-theme=bento] .rp-live-tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; background: var(--app-live-dot); color: #04231a;
}
html[data-app-theme=bento] .rp-dot { background: var(--app-hero-fg-muted); }
html[data-app-theme=bento] .rp-dot-live { background: var(--app-live-dot); box-shadow: 0 0 0 3px rgba(74, 222, 128, .28); }
@media (prefers-reduced-motion: no-preference) {
  html[data-app-theme=bento] .rp-dot-live { animation: bento-pulse 2.2s ease-in-out infinite; }
}
@keyframes bento-pulse { 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } }

html[data-app-theme=bento] .overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; align-items: stretch; }
html[data-app-theme=bento] .overview-grid > * { margin: 0 !important; min-width: 0; }
html[data-app-theme=bento] .overview-grid .kpi-grid, html[data-app-theme=bento] .overview-grid .panel-grid { display: contents; }
html[data-app-theme=bento] .overview-grid .hero, html[data-app-theme=bento] .overview-grid .chart-card, html[data-app-theme=bento] .overview-grid .rp-panel { grid-column: 1 / -1; }
html[data-app-theme=bento] .overview-grid .kpi-grid .kpi { grid-column: auto; }
html[data-app-theme=bento] .chart-card { display: flex; flex-direction: column; }
html[data-app-theme=bento] .chart-card .Box-body { flex: 1; display: flex; flex-direction: column; }
html[data-app-theme=bento] .chart-card .chart-box { flex: 1; height: auto; min-height: 260px; }
html[data-app-theme=bento] .overview-grid .rp-panel { margin: 0 !important; }
@media (min-width: 768px) {
  html[data-app-theme=bento] .overview-grid .rp-panel { grid-column: span 1; }
  html[data-app-theme=bento] .overview-grid .panel-grid > .rp-panel:first-child { grid-column: 1 / -1; }
}
@media (min-width: 1012px) {
  html[data-app-theme=bento] .overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html[data-app-theme=bento] .overview-grid .hero { grid-column: 1 / span 2; grid-row: 1 / span 2; }
  html[data-app-theme=bento] .overview-grid .chart-card { grid-column: 1 / span 3; grid-row: 3 / span 2; }
  html[data-app-theme=bento] .overview-grid .kpi-grid .kpi:nth-child(5) { grid-column: 4; grid-row: 3; }
  html[data-app-theme=bento] .overview-grid .kpi-grid .kpi:nth-child(6) { grid-column: 4; grid-row: 4; }
  html[data-app-theme=bento] .overview-grid .panel-grid > .rp-panel { grid-column: span 1; }
  html[data-app-theme=bento] .overview-grid .panel-grid > .rp-panel:nth-child(1),
  html[data-app-theme=bento] .overview-grid .panel-grid > .rp-panel:nth-child(6),
  html[data-app-theme=bento] .overview-grid .panel-grid > .rp-panel:nth-child(9) { grid-column: span 2; }
}
@media (max-width: 543px) {
  html[data-app-theme=bento] .kpi { padding: 16px 16px; }
  html[data-app-theme=bento] .kpi-value { font-size: 28px; }
  html[data-app-theme=bento] .hero { padding: 22px 20px; }
  html[data-app-theme=bento] .Box-header { padding: 18px 18px 4px; }
  html[data-app-theme=bento] .Box-body, html[data-app-theme=bento] .Box-row, html[data-app-theme=bento] .Box-footer, html[data-app-theme=bento] .rp-table th, html[data-app-theme=bento] .rp-table td { padding-left: 18px; padding-right: 18px; }
  html[data-app-theme=bento] .Box-row.bar-row { padding: 11px 18px 20px !important; }
  html[data-app-theme=bento] .bar-row .bar[style*="--pct"] { left: 18px; width: calc((100% - 36px) * var(--pct) / 100) !important; }
}

/* ---------- site navigation: pills on small screens, dark icon rail on wide ones ---------- */
html[data-app-theme=bento] .UnderlineNav {
  box-shadow: var(--app-shadow); background: var(--bgColor-default); border: 1px solid var(--app-card-border);
  border-radius: 999px; min-height: 0; padding: 4px; width: fit-content; max-width: 100%; justify-content: flex-start;
}
html[data-app-theme=bento] .UnderlineNav-body { gap: 2px; }
html[data-app-theme=bento] .UnderlineNav-item {
  border-radius: 999px; padding: 0 14px; line-height: 34px; gap: 6px; font-weight: 500; color: var(--fgColor-muted);
}
html[data-app-theme=bento] .UnderlineNav-item:hover { background: var(--bgColor-muted); color: var(--fgColor-default); text-decoration: none; }
html[data-app-theme=bento] .UnderlineNav-item[aria-current]:not([aria-current=false]) {
  background: var(--app-rail-active-bg); color: var(--app-rail-active-fg); font-weight: 600;
}
html[data-app-theme=bento] .UnderlineNav-item .nav-ico { display: block; flex: none; width: 16px; height: 16px; }
html[data-app-theme=bento] .UnderlineNav-item::after { display: none; }

@media (min-width: 1012px) {
  html[data-app-theme=bento] .app-main:has(.UnderlineNav) { padding-left: 100px !important; position: relative; }
  html[data-app-theme=bento] .UnderlineNav {
    position: fixed; z-index: 20; top: 92px; left: max(16px, calc((100vw - 1280px) / 2 + 20px));
    width: 60px; padding: 10px 8px; overflow: visible;
    background: var(--app-rail-bg); border-color: var(--app-card-border);
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .45);
  }
  html[data-app-theme=bento] .UnderlineNav-body { flex-direction: column; align-items: center; gap: 6px; }
  html[data-app-theme=bento] .UnderlineNav-item {
    width: 42px; height: 42px; padding: 0; justify-content: center; line-height: 1;
    border-radius: 50%; color: var(--app-rail-fg); position: relative;
  }
  html[data-app-theme=bento] .UnderlineNav-item .nav-ico { width: 20px; height: 20px; }
  html[data-app-theme=bento] .UnderlineNav-item .nav-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  /* an item without an icon (e.g. added later) keeps its text, small, inside the circle */
  html[data-app-theme=bento] .UnderlineNav-item:not(:has(.nav-ico)) { font-size: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  html[data-app-theme=bento] .UnderlineNav-item:hover { background: var(--app-rail-hover-bg); color: #ffffff; }
  html[data-app-theme=bento] .UnderlineNav-item[aria-current]:not([aria-current=false]) { background: var(--app-rail-active-bg); color: var(--app-rail-active-fg); }
  html[data-app-theme=bento] .UnderlineNav-item:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }
  /* tooltip from aria-label, shown on hover and keyboard focus */
  html[data-app-theme=bento] .UnderlineNav-item[aria-label]::after {
    display: block; content: attr(aria-label); position: absolute; left: calc(100% + 14px); top: 50%;
    transform: translateY(-50%); white-space: nowrap; pointer-events: none; opacity: 0;
    background: var(--app-rail-bg); color: #ffffff; padding: 6px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.3; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
  }
  html[data-app-theme=bento] .UnderlineNav-item[aria-label]:hover::after, html[data-app-theme=bento] .UnderlineNav-item[aria-label]:focus-visible::after { opacity: 1; }
}
@media (min-width: 1012px) and (prefers-reduced-motion: no-preference) {
  html[data-app-theme=bento] .UnderlineNav-item { transition: background-color 120ms ease, color 120ms ease; }
  html[data-app-theme=bento] .UnderlineNav-item[aria-label]::after { transition: opacity 120ms ease; }
}
@media (max-width: 1011px) {
  html[data-app-theme=bento] .UnderlineNav { overflow-x: auto; }
}

/* ---------- home: site cards ---------- */
html[data-app-theme=bento] .site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; background: none; border: 0; box-shadow: none; border-radius: 0; }
html[data-app-theme=bento] .site-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bgColor-default); border: 1px solid var(--app-card-border); border-radius: var(--app-radius-lg) !important;
  box-shadow: var(--app-shadow); padding: 20px 22px !important; margin: 0;
}
html[data-app-theme=bento] .site-avatar {
  display: inline-flex; flex: none; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--app-accent-muted); color: var(--fgColor-accent); font-weight: 700; font-size: 18px;
}
html[data-app-theme=bento] .site-card-body { flex: 1; min-width: 0; }
html[data-app-theme=bento] .site-card-body a { font-weight: 650; letter-spacing: -.01em; }
html[data-app-theme=bento] .site-card-body .f6 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
html[data-app-theme=bento] .login-wrap { max-width: 400px; }
html[data-app-theme=bento] .login-card { background: var(--app-hero-bg); color: var(--app-hero-fg); border-color: transparent; }
html[data-app-theme=bento] .login-card .Box-body { padding: 44px 32px; }
html[data-app-theme=bento] .login-card h1 { color: var(--app-hero-fg); font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
html[data-app-theme=bento] .login-card .color-fg-muted { color: var(--app-hero-fg-muted) !important; font-size: 15px; }
html[data-app-theme=bento] .login-card .btn-primary { padding: 9px 16px; font-size: 15px; }
html[data-app-theme=bento] .login-card a:focus-visible { outline-color: #ffffff; }
