/* RTC Cloud dashboard — self-hosted, no build step, no CDN (CSP: style-src 'self'). */
:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #f0f2f8; --border: #e4e7f0; --border-strong: #d3d8e6;
  --text: #121528; --muted: #5f6680; --faint: #8a90a6;
  --primary: #5b4cf0; --primary-2: #9a4cf0; --primary-ink: #ffffff; --primary-soft: #eeebff;
  --grad: linear-gradient(135deg, #5b4cf0 0%, #8b4cf0 55%, #e0479e 100%);
  --grad-soft: linear-gradient(135deg, rgba(91,76,240,.10), rgba(224,71,158,.08));
  --ok: #10865a; --ok-soft: #e2f6ed; --warn: #a15c00; --warn-soft: #fdf0d9; --bad: #c22b3a; --bad-soft: #fde7ea;
  --info: #2563eb; --info-soft: #e5edff;
  --side-bg: #0e1024; --side-text: #c9cbe0; --side-muted: #7d80a3; --side-hover: rgba(255,255,255,.06); --side-active: rgba(122,107,255,.18);
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18,21,40,.04), 0 6px 18px -8px rgba(18,21,40,.10);
  --shadow-lg: 0 20px 40px -18px rgba(70,50,200,.35);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 58px; --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d1a; --surface: #14172a; --surface-2: #1b1f36; --border: #262b47; --border-strong: #333a5c;
    --text: #e9ebf7; --muted: #a2a7c2; --faint: #747a99;
    --primary: #8b7dff; --primary-2: #b47dff; --primary-ink: #0b0d1a; --primary-soft: #231f4d;
    --grad-soft: linear-gradient(135deg, rgba(139,125,255,.16), rgba(224,71,158,.10));
    --ok: #4fd39a; --ok-soft: #12291f; --warn: #f5b759; --warn-soft: #2e2412; --bad: #ff7d8a; --bad-soft: #351820;
    --info: #7aa5ff; --info-soft: #172344;
    --side-bg: #080a16;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 40px -18px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 0 0 .3rem; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; letter-spacing: -.01em; font-weight: 680; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
code, pre, .mono { font-family: var(--mono); font-size: .84em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre { background: #0e1024; color: #d8dbf5; border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; line-height: 1.6; margin: 0 0 12px; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); padding: 18px 14px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.06rem; letter-spacing: -.01em; color: #fff; padding: 4px 8px 20px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(139,76,240,.8); }
.brand-mark .icon { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--side-muted); letter-spacing: .02em; }
.nav-group { margin: 16px 10px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); font-weight: 650; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--side-text); font-weight: 520; font-size: .93rem; margin-bottom: 2px; }
.nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #8b7dff; }
.nav a .icon { opacity: .85; }
.side-foot { margin-top: auto; padding-top: 18px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; color: var(--side-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--side-hover); }
.side-switch { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 9px; color: var(--side-text); font-size: .88rem; border: 1px dashed rgba(255,255,255,.14); }
.side-switch:hover { color: #fff; text-decoration: none; background: var(--side-hover); }

.main { padding: 30px 36px 70px; min-width: 0; max-width: 1360px; width: 100%; }
.mobilebar, .tabbar, .drawer-toggle, .scrim, .close-drawer { display: none; }

/* ---------- Page header ---------- */
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 6px; }
.topbar p { margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; background: var(--grad); color: #fff; margin-bottom: 22px; box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 70%); }
.hero::before { content: ""; position: absolute; right: 120px; bottom: -120px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), rgba(255,255,255,0) 70%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 1.75rem; }
.hero p { color: rgba(255,255,255,.86); max-width: 640px; }
.hero .row { margin-top: 16px; }
.hero .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255,255,255,.26); }
.hero .btn.light { background: #fff; color: #3b2bd6; border-color: #fff; }
.hero .btn.light:hover { filter: brightness(.97); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; margin-bottom: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #5cf2a8; box-shadow: 0 0 0 0 rgba(92,242,168,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(92,242,168,0); } 100% { box-shadow: 0 0 0 0 rgba(92,242,168,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mb { margin-bottom: 20px; }

.stat { position: relative; padding: 18px 18px 16px; margin: 0; overflow: hidden; }
.stat .stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; background: var(--primary-soft); color: var(--primary); }
.stat.c2 .stat-icon { background: var(--info-soft); color: var(--info); }
.stat.c3 .stat-icon { background: var(--ok-soft); color: var(--ok); }
.stat.c4 .stat-icon { background: var(--bad-soft); color: #e0479e; }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 550; }
.stat .value { font-size: 1.75rem; font-weight: 760; letter-spacing: -.03em; margin-top: 2px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--faint); font-size: .8rem; margin-top: 2px; }
.meter { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.meter > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.meter.hot > span { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* Quick actions */
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.action { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: transform .12s ease, box-shadow .12s ease, border-color .12s; }
.action:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.action .stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--primary); flex: none; }
.action b { display: block; font-size: .92rem; }
.action span { display: block; color: var(--muted); font-size: .8rem; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 40px; font-size: .9rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 650; color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px !important; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
a.badge:hover { text-decoration: none; border-color: var(--border-strong); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.badge.ok::before, .badge.warn::before, .badge.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.field { margin-bottom: 15px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  transition: border-color .12s, box-shadow .12s;
}
@media (min-width: 861px) { input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font-size: .93rem; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[disabled] { background: var(--surface-2); color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { font-weight: 500; display: flex; align-items: center; gap: 7px; margin: 0; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.error { color: var(--bad); font-size: .82rem; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.inline { display: inline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 620; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: filter .12s, background .12s, transform .06s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(91,76,240,.9); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn.sm { min-height: 32px; padding: 6px 11px; font-size: .8rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 12px; margin-bottom: 18px; border: 1px solid transparent; font-size: .92rem; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--surface); color: var(--text); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 11px 13px; word-break: break-all; font-family: var(--mono); font-size: .85rem; }

/* ---------- Guest / auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: radial-gradient(circle, rgba(255,255,255,.25), rgba(255,255,255,0) 68%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 780; color: #fff; }
.auth-art p { color: rgba(255,255,255,.85); font-size: 1.02rem; max-width: 440px; }
.feature-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: center; font-weight: 550; }
.feature-list .stat-icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.auth-foot { font-size: .82rem; color: rgba(255,255,255,.7); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .panel { width: 100%; max-width: 410px; }
.auth-form h1 { font-size: 1.6rem; }
.auth-form .lead { color: var(--muted); margin-bottom: 22px; }
.auth-mobile-brand { display: none; }

/* ---------- Plans ---------- */
.plan { display: flex; flex-direction: column; position: relative; }
.plan.current { border-color: transparent; box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg); }
.plan .price { font-size: 2rem; font-weight: 780; letter-spacing: -.03em; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; color: var(--muted); font-size: .88rem; flex: 1; display: grid; gap: 7px; }
.plan ul li { display: flex; gap: 8px; align-items: flex-start; }
.plan ul li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.plan-flag { position: absolute; top: -11px; right: 18px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars span { flex: 1; background: var(--grad); border-radius: 4px 4px 1px 1px; min-height: 3px; opacity: .9; transition: opacity .12s; }
.bars span:hover { opacity: 1; filter: brightness(1.1); }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--faint); margin-top: 8px; }
.pagination { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 26px 24px 64px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 30; height: var(--topbar-h); align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 0 14px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
  .mobilebar .brand { color: var(--text); padding: 0; font-size: 1rem; }
  .mobilebar .brand-mark { width: 30px; height: 30px; }
  .mobilebar .icon-btn { width: 42px; height: 42px; color: var(--text); border: 1px solid var(--border); background: var(--surface); }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(86vw, 310px); height: 100%; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px -20px rgba(0,0,0,.5); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .drawer-toggle:checked ~ .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8,10,22,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer-toggle:checked ~ .scrim { opacity: 1; pointer-events: auto; }
  .sidebar .close-drawer { display: inline-grid; }
  .main { padding: 18px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: .68rem; font-weight: 620; margin: 0; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a.active .icon { stroke-width: 2.2; }

  h1 { font-size: 1.4rem; }
  .topbar { margin-bottom: 18px; align-items: flex-start; }
  .hero { padding: 22px 20px; border-radius: 16px; }
  .hero h1 { font-size: 1.4rem; }
  .card { padding: 16px; border-radius: 13px; margin-bottom: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; }
  .stat .value { font-size: 1.35rem; }

  /* Tables become stacked cards; labels are copied from the header row by app.js */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child:has(th), table.stack thead { display: none; }
  table.stack tr { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; margin-bottom: 10px; background: var(--surface); }
  table.stack tr:hover td { background: none; }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); text-align: right; min-height: 40px; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); text-align: left; flex: none; }
  table.stack td:not([data-label])::before, table.stack td[data-label=""]::before { display: none; }
  table.stack td[data-label=""] { justify-content: flex-end; }
  table.stack td.empty { justify-content: center; border: 0; }
  table.stack td.num { text-align: right; }
  table.stack td > div, table.stack td form { text-align: right; }
  table.stack td form.row { justify-content: flex-end; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 26px; }
  .auth-mobile-brand .brand { color: var(--text); padding: 0; }
  .auth-form { align-items: start; padding: 36px 18px; }
  .row .btn { flex: 0 1 auto; }
}
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .auth { grid-template-columns: 1fr 1fr; }
  .auth-art { padding: 36px; }
  .auth-art h2 { font-size: 1.7rem; }
}
