/* eStreamly AI Hub — Scout design system ("rd-" classes).
 *
 * Tokens, type, shell and components shared with Content Scout, so the
 * two apps look and behave the same. Written from the Hub redesign handoff
 * (tokens, radii, spacing and shadows are the ones Scout's redesign.css
 * uses); keep this file in step with Scout's when either changes.
 */

:root {
  --rd-bg: #f5f6fa;
  --rd-surface: #fff;
  --rd-surface-2: #fafbfc;
  --rd-surface-hover: #fafbfd;
  --rd-border: #e9ecef;
  --rd-border-soft: #eef0f3;
  --rd-border-dash: #d9dde3;
  --rd-ink: #1f2430;
  --rd-ink-2: #2d3436;
  --rd-ink-3: #636e72;
  --rd-muted: #7a8290;
  --rd-muted-2: #8e99a1;
  --rd-primary: #4f46e5;
  --rd-primary-hover: #4338ca;
  --rd-primary-soft: #eef0fb;
  --rd-primary-soft-hover: #e2e5f9;
  --rd-primary-border: #c7cbf3;
  --rd-ok: #00b894;
  --rd-ok-bg: #d1f6ea;
  --rd-ok-ink: #00906f;
  --rd-warn-bg: #fde8c3;
  --rd-warn-ink: #b3690a;
  --rd-warn-banner-bg: #fdf3e2;
  --rd-warn-banner-border: #f4d9a6;
  --rd-warn-banner-ink: #8a5a0a;
  --rd-bad: #d63031;
  --rd-bad-bg: #f9d5d4;
  --rd-bad-ink: #b02122;
  --rd-bad-soft: #fdf1f1;
  --rd-neutral-bg: #f0f1f5;
  --rd-hover: #f3f4f8;
  --rd-track: #eef0f5;
  --rd-switch-off: #d5d8e0;
  --rd-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --rd-shadow-pop: 0 10px 28px rgba(14, 20, 34, .14);
  --rd-shadow-toast: 0 8px 24px rgba(14, 20, 34, .25);
  --rd-shadow-card: 0 4px 12px rgba(14, 20, 34, .08);
  --rd-ring: 0 0 0 3px rgba(79, 70, 229, .12);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.rd-app, body.rd-auth {
  margin: 0;
  background: var(--rd-bg);
  color: var(--rd-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--rd-primary); text-decoration: none; }
a:hover { color: var(--rd-primary-hover); }
input, select, textarea, button { font-family: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.rd-mono { font-family: var(--rd-mono); }
.rd-muted { color: var(--rd-muted); }
.rd-ink3 { color: var(--rd-ink-3); }
.rd-ok-text { color: var(--rd-ok-ink); }
.rd-bad-text { color: var(--rd-bad-ink); }
.rd-right { text-align: right; }
.rd-center { text-align: center; }
.rd-nowrap { white-space: nowrap; }
.rd-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-hidden { display: none !important; }
.rd-mt-8 { margin-top: 8px; } .rd-mt-12 { margin-top: 12px; } .rd-mt-16 { margin-top: 16px; }
.rd-mt-20 { margin-top: 20px; } .rd-mt-24 { margin-top: 24px; }
.rd-mb-12 { margin-bottom: 12px; } .rd-mb-16 { margin-bottom: 16px; }
.rd-mb-20 { margin-bottom: 20px; } .rd-mb-24 { margin-bottom: 24px; } .rd-mb-28 { margin-bottom: 28px; }
.rd-flex { display: flex; align-items: center; gap: 8px; }
.rd-flex-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rd-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rd-grow { flex: 1; min-width: 0; }
.rd-divider { border-top: 1px solid var(--rd-border-soft); margin-top: 24px; padding-top: 20px; }
.rd-divider-sm { border-top: 1px solid var(--rd-border-soft); margin-top: 20px; padding-top: 16px; }

/* ── Shell ─────────────────────────────────────────────────── */
.rd-shell { display: flex; min-height: 100vh; }
.rd-sidebar {
  width: 248px; flex: none;
  background: var(--rd-surface); border-right: 1px solid var(--rd-border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  position: sticky; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 41;
  transition: transform .2s ease;
}
.rd-scrim { display: none; position: fixed; inset: 0; background: rgba(31, 36, 48, .4); z-index: 40; }
.rd-main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.rd-content { max-width: 1200px; }

.rd-brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; position: relative; }
.rd-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--rd-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none;
}
.rd-mark-sm { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; }
.rd-mark-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.rd-brand-text { line-height: 1.2; min-width: 0; flex: 1; }
.rd-brand-name { font-weight: 700; font-size: 15px; color: var(--rd-ink); }
.rd-brand-sub { font-size: 12px; color: var(--rd-muted); }
.rd-iconbtn {
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--rd-border); border-radius: 7px;
  background: var(--rd-surface); color: var(--rd-ink-3);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.rd-iconbtn:hover { background: var(--rd-hover); }
/* The app switcher (hub/static/shell/app-switcher.js) mounts here. */
.rd-appswitch { flex: none; display: inline-flex; }
.rd-appswitch .esw-btn { width: 30px; height: 30px; border: 1px solid var(--rd-border); border-radius: 7px; background: var(--rd-surface); color: var(--rd-ink-3); opacity: 1; }
.rd-appswitch .esw-btn:hover, .rd-appswitch .esw-btn[aria-expanded="true"] { background: var(--rd-hover); border-color: var(--rd-border); }
.rd-appswitch > a { font-size: 12px; font-weight: 600; }

.rd-brandpick { position: relative; margin: 0 0 16px; }
.rd-brandpick-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px;
  border: 1px solid var(--rd-border); border-radius: 10px; background: var(--rd-surface);
  text-align: left; font: inherit; color: var(--rd-ink);
}
.rd-brandpick-btn:hover { background: var(--rd-hover); }
.rd-brandpick-btn[aria-expanded="true"] { border-color: var(--rd-primary); }
.rd-brandpick-static .rd-brandpick-btn { cursor: default; }
.rd-brandpick-static .rd-brandpick-btn:hover { background: var(--rd-surface); }
.rd-brandpick-text { min-width: 0; flex: 1; line-height: 1.25; }
.rd-brandpick-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); }
.rd-brandpick-name { display: block; font-size: 13px; font-weight: 600; color: var(--rd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-brandpick-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45;
  background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 10px;
  box-shadow: var(--rd-shadow-pop); padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.rd-brandpick-menu[hidden] { display: none; }
.rd-brandpick-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px;
  font: inherit; font-size: 13px; border: none; text-align: left; width: 100%;
  background: transparent; color: var(--rd-ink-2);
}
.rd-brandpick-item:hover { box-shadow: inset 0 0 0 999px rgba(31, 36, 48, .04); }
.rd-brandpick-item.is-current { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-brandpick-item .rd-avatar { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.rd-brandpick-item.is-current .rd-avatar { background: var(--rd-primary); color: #fff; }
.rd-brandpick-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-brandpick-item-role { font-size: 11px; color: var(--rd-muted); }
.rd-brandpick-empty { padding: 8px; font-size: 12px; color: var(--rd-muted); }

.rd-avatar {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  background: var(--rd-primary-soft); color: var(--rd-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.rd-avatar-round { border-radius: 50%; font-weight: 600; }
.rd-avatar-30 { width: 30px; height: 30px; border-radius: 8px; }
.rd-avatar-32 { width: 32px; height: 32px; font-size: 12px; }
.rd-avatar-40 { width: 40px; height: 40px; font-size: 14px; }
.rd-apptile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  color: #fff; font-weight: 700; border-radius: 9px;
}

.rd-navlabel { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); padding: 0 8px 8px; }
.rd-navlabel-gap { padding-top: 20px; }
.rd-nav { display: flex; flex-direction: column; gap: 2px; }
.rd-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: none;
  text-align: left; font: inherit; font-weight: 500; font-size: 14px; width: 100%;
  background: transparent; color: var(--rd-ink-2);
}
.rd-nav-item:hover { background: var(--rd-hover); color: var(--rd-ink-2); }
.rd-nav-item.is-active { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-nav-item.is-active:hover { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-nav-item svg { flex: none; }
.rd-nav-item > span { flex: 1; }
.rd-count { flex: none !important; font-size: 11px; font-weight: 600; background: var(--rd-bad-bg); color: var(--rd-bad-ink); border-radius: 999px; padding: 1px 7px; }
.rd-reward { flex: none !important; font-size: 11px; font-weight: 700; background: var(--rd-ok); color: #fff; border-radius: 999px; padding: 2px 8px; }
.rd-spacer { flex: 1; min-height: 12px; }

.rd-userbox {
  margin-top: 8px; border: 1px solid var(--rd-border); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.rd-userbox-text { flex: 1; min-width: 0; line-height: 1.3; }
.rd-userbox-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-userbox-balance { font-size: 12px; color: var(--rd-muted); display: inline-flex; align-items: center; gap: 5px; }
.rd-userbox-balance:hover { color: var(--rd-ink-3); }
.rd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rd-primary); display: inline-block; flex: none; }

.rd-mobilebar {
  display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--rd-surface);
  border-bottom: 1px solid var(--rd-border); margin: 0 -16px 20px; position: sticky; top: 0; z-index: 30;
}
.rd-burger {
  width: 36px; height: 36px; border: 1px solid var(--rd-border); border-radius: 8px; background: var(--rd-surface);
  color: var(--rd-ink-2); display: flex; align-items: center; justify-content: center; flex: none; padding: 0;
}
.rd-mobilebar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Flash toasts ──────────────────────────────────────────── */
.rd-flashes { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); pointer-events: none; }
.rd-flash {
  display: flex; align-items: center; gap: 10px; background: var(--rd-ink); color: #fff; border-radius: 10px;
  padding: 10px 14px 10px 12px; font-size: 13px; box-shadow: var(--rd-shadow-toast); pointer-events: auto;
  transition: opacity .25s ease, transform .25s ease;
}
.rd-flash.is-leaving { opacity: 0; transform: translateY(-6px); }
.rd-flash-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--rd-ok); }
.rd-flash-danger .rd-flash-dot, .rd-flash-error .rd-flash-dot { background: var(--rd-bad); }
.rd-flash-warning .rd-flash-dot { background: #f4b942; }
.rd-flash-info .rd-flash-dot, .rd-flash-message .rd-flash-dot { background: #8f88f0; }
.rd-flash-close { background: transparent; border: none; color: #c9cdd4; font-size: 14px; line-height: 1; padding: 2px 0 2px 6px; }
.rd-flash-close:hover { color: #fff; }

/* ── Banner ────────────────────────────────────────────────── */
.rd-banner-warn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: 10px; padding: 10px 16px; margin-bottom: 20px; font-size: 13px;
  background: var(--rd-warn-banner-bg); border: 1px solid var(--rd-warn-banner-border); color: var(--rd-warn-banner-ink);
}
.rd-banner-actions { display: flex; gap: 8px; align-items: center; }
.rd-banner-link { background: transparent; color: var(--rd-warn-banner-ink); border: none; font: inherit; font-size: 13px; font-weight: 600; padding: 0; }
.rd-banner-link:hover { color: var(--rd-warn-banner-ink); text-decoration: underline; }

/* ── Page header & type ────────────────────────────────────── */
.rd-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.rd-page-head-text { min-width: 0; }
.rd-page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rd-h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.rd-h1-sm { font-size: 22px; }
.rd-sub { color: var(--rd-muted); font-size: 13px; margin-top: 2px; }
.rd-h2 { font-size: 17px; font-weight: 600; margin: 0; }
.rd-h3 { font-size: 15px; font-weight: 600; margin: 0; }
.rd-section-sub { color: var(--rd-muted); font-size: 13px; margin: 2px 0 14px; }
.rd-caps { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); }
.rd-label { display: block; font-size: 12px; font-weight: 500; color: var(--rd-ink-3); margin-bottom: 6px; }
.rd-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rd-label-row .rd-label { margin-bottom: 6px; }
.rd-hint { font-size: 12px; color: var(--rd-muted); }
.rd-hint-top { margin-top: 5px; }
.rd-text { font-size: 13px; color: var(--rd-ink-2); }
.rd-small { font-size: 12px; }
.rd-strong { font-weight: 600; }
.rd-linkbtn { background: none; border: none; font: inherit; font-size: 13px; color: var(--rd-muted); padding: 0; }
.rd-linkbtn:hover { color: var(--rd-ink-3); }
.rd-linkbtn-primary { color: var(--rd-primary); font-size: 12px; }
.rd-linkbtn-primary:hover { color: var(--rd-primary-hover); }

/* ── Cards & grids ─────────────────────────────────────────── */
.rd-card { background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; padding: 20px; }
.rd-card-auth { padding: 28px; }
.rd-card-title { font-weight: 600; margin-bottom: 14px; }
.rd-card-inline { border-color: var(--rd-primary-border); margin-bottom: 20px; }
.rd-card-reveal { border-color: var(--rd-ok); box-shadow: 0 0 0 3px rgba(0, 184, 148, .1); margin-bottom: 20px; }
.rd-card-bordered { border: 1px solid var(--rd-border); border-radius: 12px; padding: 18px; }
.rd-panel { background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; padding: 24px; flex: 999 1 480px; min-width: 0; }
.rd-grid { display: grid; gap: 16px; }
.rd-grid-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 24px; }
.rd-grid-apps { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 32px; }
.rd-grid-packages { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rd-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.rd-grid-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rd-appcard {
  background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px; color: var(--rd-ink); transition: box-shadow .15s;
}
.rd-appcard:hover { box-shadow: var(--rd-shadow-card); color: var(--rd-ink); }
.rd-appcard-open { font-size: 12px; font-weight: 600; color: var(--rd-primary); }
.rd-appcard-name { font-weight: 600; font-size: 15px; }
.rd-appcard-desc { font-size: 13px; color: var(--rd-ink-3); margin-top: 2px; }
.rd-summarybar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px;
}
.rd-empty-card {
  background: var(--rd-surface); border: 1px dashed var(--rd-border-dash); border-radius: 12px;
  padding: 48px 24px; text-align: center; color: var(--rd-muted); font-size: 13px;
}
.rd-empty-title { font-weight: 600; color: var(--rd-ink); font-size: 15px; margin-bottom: 4px; }
.rd-empty-inline { padding: 40px 24px; text-align: center; font-size: 13px; color: var(--rd-muted); }
.rd-note { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 8px; background: var(--rd-warn-banner-bg); color: var(--rd-warn-banner-ink); font-size: 13px; margin-top: 16px; }
.rd-note-plain { background: var(--rd-surface-hover); border: 1px solid var(--rd-border-soft); color: var(--rd-ink-2); }

/* ── KPIs ──────────────────────────────────────────────────── */
.rd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.rd-kpis-sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 24px; }
.rd-kpis-xs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.rd-kpi { background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; padding: 16px 18px; color: var(--rd-ink); display: flex; flex-direction: column; align-items: stretch; text-align: left; font: inherit; }
a.rd-kpi:hover { border-color: var(--rd-primary-border); color: var(--rd-ink); }
.rd-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); }
.rd-kpi-value { font-size: 30px; font-weight: 700; font-family: var(--rd-mono); margin: 6px 0 2px; line-height: 1.15; }
.rd-kpis-sm .rd-kpi-value { font-size: 26px; }
.rd-kpis-xs .rd-kpi-value { font-size: 24px; margin-bottom: 0; }
.rd-kpi-hint { font-size: 12px; color: var(--rd-muted); }
.rd-kpi-link { font-size: 12px; color: var(--rd-primary); }
.rd-kpi-filled { background: var(--rd-primary); border-color: var(--rd-primary); color: #fff; }
.rd-kpi-filled .rd-kpi-label, .rd-kpi-filled .rd-kpi-hint { color: #fff; opacity: .85; }

.rd-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.rd-statgrid-2 { grid-template-columns: 1fr 1fr; }
.rd-statgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.rd-stat { background: var(--rd-surface-2); border: 1px solid var(--rd-border-soft); border-radius: 8px; padding: 12px; text-align: center; }
.rd-stat-soft { background: var(--rd-primary-soft); border-color: var(--rd-primary-soft); }
.rd-stat-value { font-weight: 700; font-family: var(--rd-mono); font-size: 18px; }
.rd-stat-lg .rd-stat-value { font-size: 20px; }
.rd-stat-label { font-size: 11px; color: var(--rd-muted); }
.rd-stat-primary { color: var(--rd-primary); }
.rd-stat-ok { color: var(--rd-ok-ink); }

.rd-progress { height: 6px; border-radius: 999px; background: var(--rd-track); overflow: hidden; }
.rd-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--rd-primary); }

/* ── Buttons ───────────────────────────────────────────────── */
.rd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 500; font-size: 14px; color: var(--rd-ink-2);
  white-space: nowrap; flex: none; text-decoration: none; line-height: 1.3;
}
.rd-btn:hover { background: var(--rd-hover); color: var(--rd-ink-2); }
.rd-btn-primary { background: var(--rd-primary); border-color: var(--rd-primary); color: #fff; font-weight: 600; padding: 10px 16px; }
.rd-btn-primary:hover { background: var(--rd-primary-hover); border-color: var(--rd-primary-hover); color: #fff; }
.rd-btn-ok { background: var(--rd-ok); border-color: var(--rd-ok); color: #fff; font-weight: 600; }
.rd-btn-ok:hover { background: #00a383; border-color: #00a383; color: #fff; }
.rd-btn-danger { color: var(--rd-bad); }
.rd-btn-danger:hover { background: var(--rd-bad-soft); color: var(--rd-bad); }
.rd-btn-soft { background: var(--rd-primary-soft); border-color: transparent; color: var(--rd-primary); font-weight: 600; }
.rd-btn-soft:hover { background: var(--rd-primary-soft-hover); color: var(--rd-primary); }
.rd-btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.rd-btn-sm.rd-btn-primary { padding: 6px 12px; }
.rd-btn-md { padding: 8px 12px; font-size: 13px; }
.rd-btn-block { width: 100%; display: flex; }
.rd-btn-plus { font-size: 16px; line-height: 1; }
.rd-btn:disabled, .rd-btn[aria-disabled="true"] { color: var(--rd-muted-2); cursor: default; background: var(--rd-surface); }
.rd-minibtn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 5px 9px;
  border: 1px solid var(--rd-border); border-radius: 6px; color: var(--rd-ink-2); background: var(--rd-surface); font-family: inherit; white-space: nowrap;
}
.rd-minibtn:hover { background: var(--rd-hover); color: var(--rd-ink-2); }
.rd-minibtn-danger { color: var(--rd-bad); }
.rd-minibtn-danger:hover { background: var(--rd-bad-soft); color: var(--rd-bad); }
.rd-minibtn-ok { color: var(--rd-ok-ink); }
.rd-minibtn-xs { padding: 3px 8px; }
.rd-inline-form { display: inline; }
.rd-inline-form-flex { display: inline-flex; gap: 8px; align-items: center; }

/* ── Pills, tags, code ─────────────────────────────────────── */
.rd-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px; background: var(--rd-neutral-bg); color: var(--rd-ink-3); white-space: nowrap;
}
.rd-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.rd-pill-nodot::before { display: none; }
.rd-pill-ok { background: var(--rd-ok-bg); color: var(--rd-ok-ink); }
.rd-pill-warn { background: var(--rd-warn-bg); color: var(--rd-warn-ink); }
.rd-pill-bad { background: var(--rd-bad-bg); color: var(--rd-bad-ink); }
.rd-pill-info { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-pill-sm { font-size: 11px; padding: 2px 8px; }
.rd-pill-mono { font-family: var(--rd-mono); font-weight: 600; padding: 2px 8px; }
.rd-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--rd-neutral-bg); color: var(--rd-ink-3); white-space: nowrap; }
.rd-tag-info { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-tag-ok { background: var(--rd-ok-bg); color: var(--rd-ok-ink); }
.rd-tag-sm { font-size: 11px; padding: 1px 8px; }
.rd-tag-micro { font-size: 10px; font-weight: 600; padding: 1px 7px; }
.rd-tag-mono { font-family: var(--rd-mono); font-size: 11px; padding: 2px 7px; }
.rd-code { font-family: var(--rd-mono); font-size: 12px; background: var(--rd-neutral-bg); color: var(--rd-ink-3); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.rd-code-strong { color: var(--rd-ink-2); font-weight: 600; }
.rd-codebox { flex: 1 1 260px; font-family: var(--rd-mono); font-size: 13px; padding: 10px 12px; background: var(--rd-surface-2); border: 1px solid var(--rd-border-soft); border-radius: 8px; word-break: break-all; }
.rd-pre { background: var(--rd-surface-2); border: 1px solid var(--rd-border-soft); border-radius: 8px; padding: 12px; overflow-x: auto; font-family: var(--rd-mono); font-size: 12px; margin: 0; }
.rd-amount-plus { color: var(--rd-ok-ink); }
.rd-amount-minus { color: var(--rd-bad-ink); }

/* ── Tables (grid rows) ────────────────────────────────────── */
.rd-tablecard { background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px; overflow-x: auto; }
.rd-tablecard-inner { min-width: 560px; }
.rd-scroll { overflow-x: auto; }
.rd-thead, .rd-row, .rd-listhead, .rd-listrow { display: grid; gap: 16px; align-items: center; }
.rd-thead { padding: 12px 20px; background: var(--rd-surface-2); border-bottom: 1px solid var(--rd-border); font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); }
.rd-row { padding: 14px 20px; border-bottom: 1px solid var(--rd-border-soft); font-size: 13px; color: var(--rd-ink); }
.rd-row:last-child { border-bottom: none; }
.rd-listhead { padding: 0 0 10px; border-bottom: 1px solid var(--rd-border); font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--rd-muted); }
.rd-listrow { padding: 11px 0; border-bottom: 1px solid var(--rd-border-soft); font-size: 13px; color: var(--rd-ink); }
.rd-row-tight { padding-top: 12px; padding-bottom: 12px; }
.rd-gap-12 { gap: 12px; }
.rd-gap-14 { gap: 14px; }
a.rd-row, a.rd-listrow { color: var(--rd-ink); }
a.rd-row:hover, a.rd-listrow:hover, .rd-row-click:hover, .rd-listrow-click:hover { background: var(--rd-surface-hover); color: var(--rd-ink); }
.rd-row-click, .rd-listrow-click { cursor: pointer; }
.rd-cell-date { color: var(--rd-muted); font-size: 12px; }
.rd-cell-muted { color: var(--rd-ink-3); }
.rd-cell-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rd-cell-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rd-cell-email { font-size: 12px; color: var(--rd-muted); }
.rd-cell-link { font-weight: 600; color: var(--rd-primary); }
.rd-cell-mono { font-family: var(--rd-mono); }
.rd-cell-amount { text-align: right; font-family: var(--rd-mono); font-weight: 600; }
.rd-cell-after { text-align: right; font-family: var(--rd-mono); font-size: 12px; color: var(--rd-muted); }
.rd-cell-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.rd-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--rd-muted); }
.rd-pager .rd-btn { padding: 7px 12px; font-size: 13px; }

/* ── Split layout, sub-nav, segmented, chips ───────────────── */
.rd-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.rd-subnav {
  flex: 1 1 200px; max-width: 220px; background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px;
}
.rd-subnav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: none; text-align: left;
  font: inherit; font-weight: 500; font-size: 14px; flex: 1 1 auto; background: transparent; color: var(--rd-ink-2);
}
.rd-subnav-item:hover { background: var(--rd-hover); color: var(--rd-ink-2); }
.rd-subnav-item.is-active { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-subnav-item.is-active:hover { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-subnav-item svg { flex: none; }
.rd-subnav-item > span { flex: 1; white-space: nowrap; }
.rd-seg { display: inline-flex; flex: none; background: var(--rd-surface); border: 1px solid var(--rd-border); border-radius: 8px; padding: 3px; flex-wrap: nowrap; max-width: 100%; }
.rd-seg-wrap { flex-wrap: wrap; width: fit-content; }
.rd-seg-block { display: flex; width: 100%; margin-bottom: 20px; }
.rd-seg-block .rd-seg-item { flex: 1; padding: 7px 12px; }
.rd-seg-item { border: none; font: inherit; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 6px; white-space: nowrap; background: transparent; color: var(--rd-ink-3); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.rd-seg-item:hover { color: var(--rd-ink); }
.rd-seg-item.is-active { background: var(--rd-primary-soft); color: var(--rd-primary); }
.rd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rd-border); border-radius: 999px; padding: 5px 11px;
  font: inherit; font-size: 12px; font-weight: 500; background: var(--rd-surface); color: var(--rd-ink-3); text-decoration: none; white-space: nowrap;
}
.rd-chip:hover { background: var(--rd-hover); color: var(--rd-ink-3); }
.rd-chip.is-active { background: var(--rd-primary-soft); color: var(--rd-primary); border-color: var(--rd-primary-border); }
.rd-chip-count { font-family: var(--rd-mono); font-size: 11px; opacity: .8; }
.rd-appchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rd-border); background: var(--rd-surface); color: var(--rd-ink-2); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 12px; font-weight: 500; }
.rd-appchip-dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.rd-crumbs { font-size: 13px; color: var(--rd-muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.rd-crumbs a { color: var(--rd-muted); }
.rd-crumbs a:hover { color: var(--rd-ink-3); }
.rd-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── Forms ─────────────────────────────────────────────────── */
.rd-input, .rd-select, .rd-textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--rd-border); border-radius: 8px;
  background: var(--rd-surface); color: var(--rd-ink); margin: 0;
}
.rd-select { appearance: auto; }
.rd-input:focus, .rd-select:focus, .rd-textarea:focus { outline: none; border-color: var(--rd-primary-border); box-shadow: var(--rd-ring); }
.rd-input-sm, .rd-select-sm { font-size: 13px; padding: 7px 10px; }
.rd-input-mono { font-family: var(--rd-mono); }
.rd-input-right { text-align: right; }
.rd-input-center { text-align: center; }
.rd-input-ro { background: var(--rd-surface-2); color: var(--rd-ink-3); border-color: var(--rd-border-soft); }
.rd-input-code { font-size: 22px; padding: 10px 12px; font-family: var(--rd-mono); letter-spacing: .4em; text-align: center; }
.rd-input-auth { padding: 10px 12px; }
.rd-select-inline { width: auto; font-size: 13px; padding: 6px 8px; border-radius: 7px; }
.rd-fields { display: flex; flex-direction: column; gap: 14px; }
.rd-fieldrow { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.rd-fieldrow-top { align-items: flex-start; }
.rd-field { min-width: 0; }
.rd-field-grow { flex: 1 1 260px; }
.rd-field-grow-2 { flex: 2 1 220px; }
.rd-field-md { flex: 1 1 200px; }
.rd-field-sm { flex: 0 1 160px; }
.rd-field-xs { flex: 0 1 130px; }
.rd-field-fixed { flex: 0 0 160px; }
.rd-field-actions { display: flex; gap: 8px; }
.rd-field-narrow { max-width: 380px; }
.rd-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rd-check input { accent-color: var(--rd-primary); margin: 0; }
.rd-optioncard {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--rd-border); background: var(--rd-surface); color: var(--rd-ink-2);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.rd-optioncard input { accent-color: var(--rd-primary); margin: 0; }
.rd-optioncard:hover { background: var(--rd-hover); }
.rd-optioncard.is-active, .rd-optioncard:has(input:checked) { background: var(--rd-primary-soft); border-color: var(--rd-primary-border); color: var(--rd-primary); }
.rd-optioncard-lg { align-items: flex-start; gap: 10px; padding: 10px 12px; white-space: normal; font-weight: 400; }
.rd-optioncard-lg input { margin-top: 3px; }
.rd-optioncard-title { font-size: 13px; font-weight: 600; display: block; color: var(--rd-ink-2); }
.rd-optioncard-hint { font-size: 11px; color: var(--rd-muted); display: block; }
.rd-defs { display: grid; grid-template-columns: 140px 1fr; row-gap: 12px; column-gap: 16px; font-size: 14px; max-width: 620px; align-items: center; }
.rd-defs-wide { grid-template-columns: 180px 1fr; row-gap: 14px; max-width: 720px; }
.rd-defs > dt { color: var(--rd-muted); margin: 0; }
.rd-defs > dd { margin: 0; min-width: 0; }
.rd-settingrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rd-border-soft); flex-wrap: wrap; }
.rd-settingrow-lg { padding: 16px 0; }
.rd-settingrow-title { font-weight: 500; }
.rd-settingrow-hint { font-size: 12px; color: var(--rd-muted); }
.rd-settingrow .rd-input-num { width: 100px; font-size: 14px; padding: 8px 10px; font-family: var(--rd-mono); text-align: right; }
.rd-switchrow {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--rd-surface); border: 1px solid var(--rd-border);
  border-radius: 10px; padding: 12px 14px; cursor: pointer; width: 100%; text-align: left; color: var(--rd-ink-2); font: inherit;
}
.rd-switchrow-title { font-size: 14px; font-weight: 600; display: block; }
.rd-switchrow-sm .rd-switchrow-title { font-size: 13px; }
.rd-switchrow-hint { font-size: 12px; color: var(--rd-muted); display: block; }
.rd-switch { position: relative; display: inline-flex; align-items: center; width: 34px; height: 20px; border-radius: 999px; padding: 2px; flex: none; background: var(--rd-switch-off); transition: background .15s; }
.rd-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; left: 0; top: 0; }
.rd-switch-knob { width: 16px; height: 16px; border-radius: 50%; background: #fff; display: block; transition: transform .15s; }
.rd-switch:has(input:checked) { background: var(--rd-primary); }
.rd-switch:has(input:checked) .rd-switch-knob { transform: translateX(14px); }
.rd-switch.is-on { background: var(--rd-primary); }
.rd-switch.is-on .rd-switch-knob { transform: translateX(14px); }
.rd-disclosure { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 0; font: inherit; color: var(--rd-ink); }
.rd-disclosure-sm { font-size: 13px; color: var(--rd-ink-3); gap: 8px; }
.rd-chev { font-size: 12px; color: var(--rd-muted); display: inline-block; transition: transform .15s; }
.rd-disclosure-sm .rd-chev { font-size: 11px; }
.rd-disclosure[aria-expanded="true"] .rd-chev { transform: rotate(90deg); }
.rd-bullets { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding: 14px 16px; background: var(--rd-surface-hover); border: 1px solid var(--rd-border-soft); border-radius: 8px; }
.rd-bullets > div { font-size: 13px; color: var(--rd-ink-2); line-height: 1.55; }
.rd-steps { padding-left: 20px; line-height: 1.8; margin: 0; font-size: 13px; }
.rd-steps ul { padding-left: 20px; }

/* ── Auth layout ───────────────────────────────────────────── */
.rd-authwrap { max-width: 420px; margin: 0 auto; padding: 56px 16px 32px; }
.rd-authwrap-wide { max-width: 560px; }
.rd-authbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.rd-authbrand .rd-brand-name { font-size: 17px; }
.rd-authfoot { text-align: center; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rd-border); font-size: 12px; color: var(--rd-muted); display: flex; flex-direction: column; gap: 6px; }
.rd-authfoot-links { display: flex; justify-content: center; gap: 12px; }
.rd-authfoot a { color: var(--rd-muted); }
.rd-authfoot a:hover { color: var(--rd-ink-3); }
.rd-authapps { margin-top: 20px; }
.rd-authapps .rd-caps { display: block; margin-bottom: 10px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .rd-sidebar { position: fixed; transform: translateX(-100%); }
  body.rd-nav-open .rd-sidebar { transform: none; }
  body.rd-nav-open .rd-scrim { display: block; }
  .rd-main { padding: 0 16px 40px; }
  .rd-mobilebar { display: flex; }
  .rd-subnav { max-width: none; flex-direction: row; flex-wrap: wrap; position: static; }
  .rd-subnav-item { flex: 1 1 auto; }
  .rd-defs, .rd-defs-wide { grid-template-columns: 1fr; row-gap: 4px; }
  .rd-defs > dt { margin-top: 8px; }
  .rd-statgrid-3 { grid-template-columns: 1fr; }
  .rd-page-head { flex-direction: column; }
  .rd-seg { overflow-x: auto; }
}
