/* PhoneGrid Services Central — dashboard styles.
   PhoneGrid brand (phonegrid.id): emerald accent on cool navy-slate neutrals, Instrument Sans.
   Every colour comes from the tokens below — components never use raw hex values.
   Hand-written so the app needs no build step. */

:root {
  /* brand — emerald, as on phonegrid.id */
  --brand-50: #ecfdf5; --brand-100: #d1fae5; --brand-200: #a7f3d0; --brand-300: #6ee7b7; --brand-400: #34d399;
  --brand-500: #10b981; --brand-600: #059669; --brand-700: #047857; --brand-800: #065f46; --brand-900: #064e3b;
  /* neutrals — the site's navy-slate (ink #0b1220, text #3f4a5c, muted #6b7688, border #e7ebf1) */
  --gray-50: #f6f8fb; --gray-100: #eef1f6; --gray-200: #e3e8ef; --gray-300: #cfd6e1; --gray-400: #98a3b5;
  --gray-500: #6b7688; --gray-600: #4f5a6c; --gray-700: #3f4a5c; --gray-800: #1c2942; --gray-900: #0b1220; --gray-950: #070b14;
  /* status colours */
  --emerald-50: var(--brand-50); --emerald-500: var(--brand-500); --emerald-600: var(--brand-600); --emerald-700: var(--brand-700); --emerald-800: var(--brand-800);
  --red-50: #fef2f2; --red-100: #fee2e2; --red-500: #ef4444; --red-600: #dc2626; --red-700: #b91c1c; --red-800: #991b1b;
  --amber-50: #fffbeb; --amber-300: #fcd34d; --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-600: #d97706; --amber-700: #b45309; --amber-800: #92400e; --amber-900: #78350f;
  --orange-50: #fff7ed; --orange-500: #f97316; --orange-700: #c2410c;
  --blue-50: #eff6ff; --blue-500: #3b82f6; --blue-600: #2563eb; --blue-700: #1d4ed8;
  --sky-50: #f0f9ff; --sky-500: #0ea5e9; --sky-700: #0369a1; --sky-800: #075985;
  --violet-50: #f5f3ff; --violet-500: #8b5cf6; --violet-600: #7c3aed; --violet-700: #6d28d9;
  --slate-100: #f1f5f9; --slate-400: #94a3b8; --slate-700: #334155;
  /* live-monitor levels on the dark console */
  --con-new: #93c5fd; --con-run: #c4b5fd; --con-err: #fca5a5; --con-report: #67e8f9;
  /* surfaces */
  --white: #fff;
  --bg: #f1f4f8; --surface: var(--white); --border: var(--gray-200);
  --sidebar-bg: var(--gray-900); --sidebar-line: var(--gray-800);
  --ring: 0 0 0 1px var(--border);
  --shadow-sm: 0 1px 2px 0 rgb(11 18 32 / .05);
  --shadow-lg: 0 12px 32px rgb(11 18 32 / .12), 0 2px 6px rgb(11 18 32 / .06);
  --glow: 0 0 0 1px rgb(16 185 129 / .25), 0 6px 18px rgb(16 185 129 / .22);
  --focus: 0 0 0 3px rgb(16 185 129 / .22);
  --radius: .5rem; --radius-lg: .75rem;
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --sidebar-w: 16rem;
}

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--gray-200); }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--gray-900); font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ol, ul, pre, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; background: transparent; padding: 0; }
img, svg { display: block; }
table { border-collapse: collapse; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -.02em; }

/* ── icons ── */
.ic { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.ic-3 { width: .75rem; height: .75rem; } .ic-35 { width: .875rem; height: .875rem; } .ic-4 { width: 1rem; height: 1rem; }
.ic-45 { width: 1.125rem; height: 1.125rem; } .ic-5 { width: 1.25rem; height: 1.25rem; } .ic-6 { width: 1.5rem; height: 1.5rem; } .ic-8 { width: 2rem; height: 2rem; }

/* ── layout shell ── */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-w); display: flex; flex-direction: column; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-line);
  transform: translateX(-100%); transition: transform .2s ease; }
.sidebar.open { transform: none; }
.sidebar-overlay { position: fixed; inset: 0; z-index: 40; background: rgb(11 18 32 / .6); }
@media (min-width: 1024px) { .sidebar { transform: none; } .sidebar-overlay { display: none; } .shell { padding-left: var(--sidebar-w); } .lg-hidden { display: none !important; } }
/* The menu can be hidden on a big screen too (☰ in the top bar / ✕ in the menu), remembered per browser. */
@media (min-width: 1024px) {
  .shell { transition: padding-left .2s ease; }
  .nav-collapsed .sidebar { transform: translateX(-100%); }
  .nav-collapsed .shell { padding-left: 0; }
  .nav-collapsed .topbar .nav-logo.lg-hidden { display: block !important; }
}
.brand { display: flex; align-items: center; gap: .625rem; height: 4rem; flex-shrink: 0; padding: 0 1.25rem; }
.brand-mark { display: block; width: auto; height: 2rem; max-width: 6.5rem; flex-shrink: 0; object-fit: contain; }   /* custom logos keep their own shape */
.brand-name { color: var(--white); font-size: .9375rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--gray-400); font-size: 11px; }
.brand-close { margin-left: auto; color: var(--gray-400); border-radius: .375rem; padding: .25rem; }
.brand-close:hover { color: var(--white); }
.nav { flex: 1; overflow-y: auto; padding: 0 .75rem 1.5rem; scrollbar-width: thin; scrollbar-color: var(--gray-800) transparent; }
.nav-group { margin-top: 1.25rem; }
.nav-group:first-child { margin-top: .5rem; }
.nav-heading { margin-bottom: .375rem; padding: 0 .5rem; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-500); }
.nav-list > li + li { margin-top: .125rem; }
/* Folding groups (app.js renderNav): the heading is a button with a chevron; groups sit close together. */
.nav-group + .nav-group { margin-top: .25rem; }
button.nav-heading { display: flex; align-items: center; gap: .5rem; width: 100%; margin: 0; padding: .5rem; border-radius: .5rem; text-align: left; cursor: pointer; }
button.nav-heading:hover { background: rgb(255 255 255 / .04); color: var(--gray-300); }
.nav-heading .nav-hl { flex: 1; min-width: 0; }
.nav-heading .nav-chev { width: .875rem; height: .875rem; flex: 0 0 auto; transition: transform .15s; }
.nav-heading[aria-expanded="false"] .nav-chev { transform: rotate(-90deg); }
.nav-group.fold .nav-list { margin-bottom: .375rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .625rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--gray-300); transition: background-color .15s, color .15s; }
.nav-item .ic { width: 1.125rem; height: 1.125rem; color: var(--gray-500); }
.nav-item:hover { background: rgb(255 255 255 / .05); color: var(--white); }
.nav-item:hover .ic { color: var(--gray-300); }
.nav-item.active { background: rgb(16 185 129 / .12); color: var(--white); box-shadow: inset 2px 0 0 var(--brand-400); }
.nav-item.active .ic { color: var(--brand-400); }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { border-radius: 9999px; background: rgb(251 191 36 / .15); padding: .125rem .5rem; font-size: 11px; font-weight: 600; color: var(--amber-300); }
.nav-ext { width: .875rem; height: .875rem; color: var(--gray-600); }
.sidebar-user { border-top: 1px solid var(--sidebar-line); padding: .75rem; }
.sidebar-user a { display: flex; align-items: center; gap: .75rem; border-radius: .5rem; padding: .5rem; }
.sidebar-user a:hover { background: rgb(255 255 255 / .05); }
.sidebar-user .avatar { background: rgb(16 185 129 / .16); color: var(--brand-300); }
.sidebar-user .name { display: block; color: var(--white); font-size: .875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .role { display: block; color: var(--gray-400); font-size: .75rem; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; height: 4rem; padding: 0 1rem;
  border-bottom: 1px solid var(--border); background: rgb(255 255 255 / .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (min-width: 640px) { .topbar { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .topbar { padding: 0 2rem; } }
.topbar-menu { margin-left: -.25rem; border-radius: .375rem; padding: .375rem; color: var(--gray-500); }
.topbar-menu:hover { background: var(--gray-100); }
.topbar-search { position: relative; display: none; flex: 1; max-width: 28rem; }
@media (min-width: 768px) { .topbar-search { display: block; } }
.topbar-search .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--gray-400); pointer-events: none; }
.topbar-search .input { padding-left: 2.25rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.farm-pill { display: none; align-items: center; gap: .375rem; margin-right: .25rem; border-radius: 9999px; padding: .25rem .625rem; font-size: .75rem; font-weight: 500;
  background: var(--gray-100); color: var(--gray-600); box-shadow: inset 0 0 0 1px rgb(107 114 128 / .2); white-space: nowrap; }
@media (min-width: 640px) { .farm-pill { display: inline-flex; } }
.farm-pill .dot { width: .375rem; height: .375rem; border-radius: 9999px; background: var(--gray-400); }
.farm-pill.ok { background: var(--emerald-50); color: var(--emerald-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .2); }
.farm-pill.ok .dot { background: var(--emerald-500); }
.farm-pill.bad { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px rgb(220 38 38 / .2); }
.farm-pill.bad .dot { background: var(--red-500); }
.user-btn { display: flex; align-items: center; gap: .5rem; border-radius: .5rem; padding: .375rem .5rem; font-size: .875rem; }
.user-btn:hover { background: var(--gray-100); }
.user-btn .avatar { width: 1.75rem; height: 1.75rem; background: var(--brand-600); color: var(--white); }
.user-btn .uname { display: none; font-weight: 500; color: var(--gray-700); }
@media (min-width: 640px) { .user-btn .uname { display: block; } }
.main { padding: 1.5rem 1rem; }
@media (min-width: 640px) { .main { padding: 1.5rem 1.5rem; } }
@media (min-width: 1024px) { .main { padding: 1.5rem 2rem; } }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; flex-shrink: 0; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; margin-top: .5rem; width: 13rem; border-radius: .75rem; background: var(--white); padding: .375rem 0;
  box-shadow: var(--shadow-lg), var(--ring); z-index: 60; }
.dropdown-menu .head { border-bottom: 1px solid var(--gray-100); padding: .25rem 1rem .5rem; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: .5rem; padding: .5rem 1rem; font-size: .875rem; color: var(--gray-700); text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--gray-50); }
.dropdown-menu .ic { width: 1rem; height: 1rem; color: var(--gray-400); }

/* ── page header ── */
/* Title block + actions share a line at every width (the actions only drop below when there really is no room), instead of
   the actions sitting alone on a line of their own on a narrow screen. */
.page-header { margin-bottom: 1.5rem; display: flex; flex-flow: row wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; }
.page-header > .min-w-0 { flex: 1 1 14rem; }
.page-header .page-actions { flex: 0 0 auto; }
@media (min-width: 640px) { .page-header { flex-wrap: nowrap; } }
.page-header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.025em; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .page-header h1 { font-size: 1.5rem; line-height: 2rem; } }
.page-header .subtitle { margin-top: .25rem; font-size: .875rem; color: var(--gray-500); }
.page-header .back { margin-bottom: .25rem; display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 500; color: var(--gray-500); }
.page-header .back:hover { color: var(--gray-700); }
.page-header .meta { margin-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .875rem; color: var(--gray-500); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; white-space: nowrap; border-radius: var(--radius); padding: .5rem .875rem;
  font-size: .875rem; font-weight: 600; line-height: 1.25rem; transition: background-color .15s, color .15s, box-shadow .15s; }
.btn:disabled, .btn.disabled { cursor: not-allowed; opacity: .5; pointer-events: none; }
.btn-sm { padding: .375rem .625rem; font-size: .75rem; line-height: 1rem; }
.btn-xs { padding: .25rem .375rem; }
.btn-lg { padding: .625rem 1rem; }
.btn-primary { background: var(--brand-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-500); box-shadow: var(--glow); }
.btn-secondary { background: var(--surface); color: var(--gray-700); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); color: var(--gray-900); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--gray-400); }
.btn-success { background: var(--emerald-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-success:hover { background: var(--emerald-500); }
.btn-danger { background: var(--red-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: var(--red-500); }
.btn-warning { background: var(--violet-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-warning:hover { background: var(--violet-500); }
.btn-ghost { color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-ghost.danger { color: var(--red-600); }
.btn-ghost.danger:hover { background: var(--red-50); color: var(--red-700); }
.btn-ghost.muted-danger { color: var(--gray-400); }
.btn-ghost.muted-danger:hover { color: var(--red-600); background: var(--gray-100); }
.btn-current { background: var(--brand-600); color: var(--white); }
.btn .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── forms ── */
.input { display: block; width: 100%; border-radius: var(--radius); background: var(--surface); padding: .5rem .75rem; font-size: .875rem; line-height: 1.25rem; color: var(--gray-900);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--gray-300); outline: none; transition: box-shadow .15s; }
.input::placeholder { color: var(--gray-400); }
.input:focus { box-shadow: inset 0 0 0 1px var(--brand-500), var(--focus); }
.input:disabled, .input[readonly] { background: var(--gray-50); color: var(--gray-500); }
.input-sm { padding-top: .375rem; padding-bottom: .375rem; font-size: .75rem; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7688' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right .5rem center; background-repeat: no-repeat; background-size: 1.25em 1.25em; }
textarea.input { resize: vertical; min-height: 2.5rem; }
input[type="color"].swatch { height: 2.25rem; width: 3rem; cursor: pointer; border-radius: .5rem; border: 0; background: transparent; padding: 0; }
input[type="file"].file { display: block; width: 100%; font-size: .875rem; color: var(--gray-600); }
input[type="file"].file::file-selector-button { margin-right: .75rem; border: 0; border-radius: .5rem; background: var(--gray-100); padding: .5rem .75rem; font-size: .875rem; font-weight: 500; cursor: pointer; }
input[type="file"].file::file-selector-button:hover { background: var(--gray-200); }
.label { display: block; margin-bottom: .25rem; font-size: .875rem; font-weight: 500; color: var(--gray-700); }
.label .opt { font-weight: 400; color: var(--gray-400); }
.mini-label { font-size: 11px; font-weight: 500; color: var(--gray-500); }
.hint { margin-top: .25rem; font-size: .75rem; color: var(--gray-500); }
.error { margin-top: .25rem; font-size: .75rem; font-weight: 500; color: var(--red-600); }
.checkbox { width: 1rem; height: 1rem; flex-shrink: 0; border-radius: .25rem; accent-color: var(--brand-600); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .875rem; color: var(--gray-700); cursor: pointer; }
.check .checkbox { margin-top: .125rem; }
.check.center { align-items: center; }
.check.center .checkbox { margin-top: 0; }
.has-error .input { box-shadow: inset 0 0 0 1px var(--red-500); }
.input-group { display: flex; align-items: center; gap: .5rem; }
.input-group .suffix { font-size: .75rem; color: var(--gray-500); white-space: nowrap; }

/* ── cards ── */
.card { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm), var(--ring); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--gray-100); padding: .875rem 1.25rem; }
.card-title { font-size: .875rem; font-weight: 600; color: var(--gray-900); display: flex; align-items: center; gap: .5rem; }
.card-sub { font-size: .75rem; color: var(--gray-500); }
.card-body { padding: 1.25rem; }
.card-body-lg { padding: 1.5rem; }
.card-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); padding: 1rem 1.5rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-section + .card-section { border-top: 1px solid var(--gray-100); }
a.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-sm), 0 0 0 1px var(--brand-300); }
.card.selected { box-shadow: 0 0 0 2px var(--brand-500); }
.divide-y > * + * { border-top: 1px solid var(--gray-100); }

/* ── stat ── */
.stat { display: block; padding: 1.25rem; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.stat-label { font-size: .875rem; font-weight: 500; color: var(--gray-500); }
.stat-value { margin-top: .5rem; font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -.025em; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.stat-hint { margin-top: .75rem; font-size: .75rem; color: var(--gray-500); }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--radius); flex-shrink: 0; }
.accent-brand { background: var(--brand-50); color: var(--brand-700); } .accent-blue { background: var(--blue-50); color: var(--blue-600); }
.accent-amber { background: var(--amber-50); color: var(--amber-600); } .accent-green { background: var(--emerald-50); color: var(--emerald-600); }
.accent-violet { background: var(--violet-50); color: var(--violet-600); } .accent-red { background: var(--red-50); color: var(--red-600); }
.accent-sky { background: var(--sky-50); color: var(--sky-700); }

/* ── tables ── */
.table-wrap { overflow-x: auto; }
/* .stack-sm: on a phone each row is a block, each cell labelled from data-label (editable rows). */
@media (max-width: 639px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { padding: .625rem 1rem; border-bottom: 1px solid var(--gray-100); }
  .table.stack-sm td { padding: .25rem 0; border: 0; text-align: left; white-space: normal; }
  .table.stack-sm td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .125rem; font-size: .6875rem; font-weight: 500; color: var(--gray-500); }
  .table.stack-sm td .input { width: 100%; min-width: 0 !important; }
}
.table { min-width: 100%; font-size: .875rem; }
.table thead th { background: var(--gray-50); padding: .625rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .025em; white-space: nowrap; color: var(--gray-500); text-transform: uppercase; border-bottom: 1px solid var(--gray-200); }
.table thead th.normal-case { text-transform: none; }
.table tbody tr + tr td { border-top: 1px solid var(--gray-100); }
.table tbody td { padding: .75rem 1rem; vertical-align: middle; color: var(--gray-700); }
.table tbody tr:hover td { background: var(--gray-50); }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover td { background: var(--brand-50); }
.table.text-xs, .table.text-xs tbody td { font-size: .75rem; }
.table tr.align-top td { vertical-align: top; }
.table tr.dim td { opacity: .5; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-inner { border-radius: .5rem; box-shadow: inset 0 0 0 1px var(--gray-200); overflow: auto; max-height: 14rem; }

/* ── badges ── */
.badge { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; border-radius: 9999px; padding: .125rem .5rem; font-size: .75rem; font-weight: 500; line-height: 1rem; }
.badge .dot { width: .375rem; height: .375rem; border-radius: 9999px; }
.tone-gray { background: var(--gray-100); color: var(--gray-700); box-shadow: inset 0 0 0 1px rgb(107 118 136 / .2); } .tone-gray .dot { background: var(--gray-400); }
.tone-slate { background: var(--slate-100); color: var(--slate-700); box-shadow: inset 0 0 0 1px rgb(100 116 139 / .2); } .tone-slate .dot { background: var(--slate-400); }
.tone-green { background: var(--emerald-50); color: var(--emerald-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .2); } .tone-green .dot { background: var(--emerald-500); }
.tone-red { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px rgb(220 38 38 / .2); } .tone-red .dot { background: var(--red-500); }
.tone-amber { background: var(--amber-50); color: var(--amber-800); box-shadow: inset 0 0 0 1px rgb(217 119 6 / .25); } .tone-amber .dot { background: var(--amber-500); }
.tone-orange { background: var(--orange-50); color: var(--orange-700); box-shadow: inset 0 0 0 1px rgb(234 88 12 / .2); } .tone-orange .dot { background: var(--orange-500); }
.tone-blue { background: var(--blue-50); color: var(--blue-700); box-shadow: inset 0 0 0 1px rgb(37 99 235 / .2); } .tone-blue .dot { background: var(--blue-500); }
.tone-sky { background: var(--sky-50); color: var(--sky-700); box-shadow: inset 0 0 0 1px rgb(2 132 199 / .2); } .tone-sky .dot { background: var(--sky-500); }
.tone-violet { background: var(--violet-50); color: var(--violet-700); box-shadow: inset 0 0 0 1px rgb(124 58 237 / .2); } .tone-violet .dot { background: var(--violet-500); }
.tone-brand { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .2); } .tone-brand .dot { background: var(--brand-500); }
.chip { display: inline-flex; align-items: center; gap: .25rem; border-radius: .375rem; padding: .125rem .375rem; font-size: 11px; font-weight: 500; background: var(--gray-100); color: var(--gray-600); }
.chip.req { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .2); }
.chip.mono { font-family: var(--mono); }
.tag { border-radius: .25rem; padding: .125rem .375rem; font-size: 10px; font-weight: 600; letter-spacing: .025em; text-transform: uppercase; }
.tag.core { background: var(--gray-100); color: var(--gray-500); }
.tag.custom { background: var(--brand-50); color: var(--brand-600); }
.code-pill { border-radius: 9999px; padding: .25rem .625rem; font-size: .75rem; font-weight: 500; font-family: var(--mono); background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px rgb(220 38 38 / .2); }
.code-pill:hover { background: var(--red-100); }

/* ── platform icon ── */
.pi { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600; color: var(--white); object-fit: cover; }
.pi-sm { width: 1.5rem; height: 1.5rem; font-size: 10px; border-radius: .375rem; }
.pi-md { width: 2rem; height: 2rem; font-size: .75rem; border-radius: .5rem; }
.pi-lg { width: 3rem; height: 3rem; font-size: 1rem; border-radius: .75rem; }
img.pi { box-shadow: var(--ring); background: var(--white); }

/* ── description list ── */
.dl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: .625rem 1.25rem; font-size: .875rem; }
.dl-row dt { color: var(--gray-500); }
.dl-row dd { grid-column: span 2 / span 2; overflow-wrap: anywhere; color: var(--gray-900); }

/* ── tabs ── */
.tabs { display: flex; gap: .25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--gray-200); margin-bottom: 1rem; }
.tabs::-webkit-scrollbar { display: none; }
.tab { margin-bottom: -1px; display: flex; align-items: center; gap: .5rem; border-bottom: 2px solid transparent; padding: .625rem .75rem; font-size: .875rem; font-weight: 500; white-space: nowrap; color: var(--gray-500); }
.tab:hover { border-color: var(--gray-300); color: var(--gray-700); }
.tab .count { border-radius: 9999px; padding: .125rem .5rem; font-size: .75rem; background: var(--gray-100); color: var(--gray-600); }
.tab.active { border-color: var(--brand-600); color: var(--brand-700); }
.tab.active .count { background: var(--brand-100); color: var(--brand-700); }
.side-tabs { display: flex; gap: .25rem; overflow-x: auto; }
@media (min-width: 1024px) { .side-tabs { flex-direction: column; width: 13rem; flex-shrink: 0; } }
.side-tab { border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; font-weight: 500; white-space: nowrap; color: var(--gray-600); }
.side-tab:hover { background: rgb(255 255 255 / .6); color: var(--gray-900); }
.side-tab.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm), var(--ring); }

/* ── filters + bulk bar ── */
/* Filter toolbars (every list page): one wrapping row — the search grows, selects keep a sensible
   width, buttons stay compact. */
.filters, .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border-bottom: 1px solid var(--border); padding: .875rem 1rem; }
.filters > .input, .filter-row > .input { flex: 1 1 9.5rem; width: auto; min-width: 8rem; }
.filters > .wide, .filters > input[type="search"]:first-child, .filter-row > input[type="search"]:first-child { flex: 3 1 12rem; }
.filters > select.input, .filter-row > select.input { flex: 0 1 10.5rem; }
.filters > input[type="date"].input { flex: 0 1 10rem; }
.filters > .full { flex-basis: 100%; }
.filters > .btn, .filter-row > .btn, .filters > .flex { flex: none; }
.filters .flex > .btn.flex-1 { flex: none; }
@media (max-width: 639px) { .filters > .input, .filters > select.input, .filter-row > .input, .filter-row > select.input { flex: 1 1 100%; } }
/* A filter that is on or off ("only with proof"). */
.toggle-chip { display: inline-flex; flex: none; align-items: center; gap: .375rem; height: 2.25rem; border-radius: 9999px; padding: 0 .875rem; font-size: .8125rem; font-weight: 500;
  color: var(--gray-600); background: var(--surface); box-shadow: inset 0 0 0 1px var(--gray-300); cursor: pointer; user-select: none; white-space: nowrap; }
.toggle-chip input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-chip:hover { color: var(--gray-900); }
.toggle-chip:has(input:checked) { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-300); }
.toggle-chip:has(input:focus-visible) { outline: 2px solid var(--brand-500); outline-offset: 2px; }
/* Status tabs right above a list card read as the card's own header. */
.tabs:has(+ .card) { margin-bottom: 0; padding: 0 1rem; border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface); box-shadow: var(--shadow-sm), var(--ring); }
.tabs + .card { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border-bottom: 1px solid var(--brand-100); background: rgb(236 253 245 / .6); padding: .625rem 1rem; font-size: .875rem; }
.bulkbar .count { font-weight: 500; color: var(--brand-900); }
.bulkbar .input { width: 100%; }
@media (min-width: 640px) { .bulkbar .input { width: 16rem; } }

/* ── pagination ── */
.pager-wrap { border-top: 1px solid var(--gray-100); padding: 1rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.pager .info { display: none; font-size: .875rem; color: var(--gray-500); }
.pager .info b { font-weight: 500; color: var(--gray-900); }
@media (min-width: 640px) { .pager .info { display: block; } }
.pager .pages { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.pager .page-num { display: none; }
@media (min-width: 640px) { .pager .page-num { display: inline-flex; } }
.pager .gap { padding: 0 .5rem; font-size: .875rem; color: var(--gray-400); }

/* ── empty state ── */
.empty { padding: 3.5rem 1rem; text-align: center; }
.table-wrap td > .empty, .table-wrap td > .loading { position: sticky; left: 0; max-width: calc(100vw - 3rem); }   /* a table wider than a phone: the message stays in view */
.empty .ic { margin: 0 auto; width: 2rem; height: 2rem; color: var(--gray-300); }
.empty .t { margin-top: .5rem; font-size: .875rem; font-weight: 500; color: var(--gray-900); }
.empty .b { margin-top: .25rem; font-size: .875rem; color: var(--gray-500); }

/* ── alerts / toasts ── */
.alert { display: flex; align-items: flex-start; gap: .75rem; border-radius: .75rem; padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1.25rem; }
.alert .ic { margin-top: .125rem; width: 1.125rem; height: 1.125rem; }
.alert.green { background: var(--emerald-50); color: var(--emerald-800); box-shadow: inset 0 0 0 1px rgb(5 150 105 / .2); }
.alert.red { background: var(--red-50); color: var(--red-800); box-shadow: inset 0 0 0 1px rgb(220 38 38 / .2); }
.alert.amber { background: var(--amber-50); color: var(--amber-900); box-shadow: inset 0 0 0 1px rgb(217 119 6 / .2); }
.alert.sky { background: var(--sky-50); color: var(--sky-800); box-shadow: inset 0 0 0 1px rgb(2 132 199 / .2); }
.alert ul { margin-top: .25rem; padding-left: 1.25rem; list-style: disc; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; display: flex; flex-direction: column; gap: .5rem; max-width: min(26rem, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: .625rem; border-radius: .75rem; background: var(--white); padding: .75rem 1rem; font-size: .875rem; color: var(--gray-800);
  box-shadow: var(--shadow-lg), var(--ring); animation: toastIn .18s ease-out; }
.toast .ic { width: 1.125rem; height: 1.125rem; margin-top: .0625rem; }
.toast.green .ic { color: var(--emerald-600); } .toast.red .ic { color: var(--red-600); } .toast.amber .ic { color: var(--amber-600); }
.toast p { flex: 1; }
.toast button { color: var(--gray-400); } .toast button:hover { color: var(--gray-700); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── modal / lightbox ── */
.modal-back { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgb(11 18 32 / .55); animation: fade .15s; }
.modal { width: 100%; max-width: 28rem; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 40rem; }
/* A long list (phones, runs, files) scrolls inside the window instead of running off the screen. The viewer (.mv-fit) and the
   .xl window size and scroll themselves. */
.modal:not(.xl):not(.mv-fit) { max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.modal.xl { max-width: 60rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.modal.xl .modal-scroll { overflow: auto; }
.modal-head { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); }
.modal-head h3 { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); border-radius: 0 0 .75rem .75rem; }
.result-pop { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .result-pop { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .result-pop .proof-side { border-left: 1px solid var(--gray-100); } }
.result-pop .proof-side { padding: 1rem 1.25rem; text-align: center; }
.result-pop .proof-side img { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; object-fit: contain; border-radius: .5rem; box-shadow: 0 0 0 1px var(--gray-200); cursor: zoom-in; }
.table tbody tr[data-result] { cursor: pointer; }
.table tbody tr[data-result]:hover td { background: var(--brand-50); }
.modal-body { padding: 1.5rem; }
.modal-body h3 { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.modal-body p { margin-top: .5rem; font-size: .875rem; color: var(--gray-600); }
.lightbox { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgb(7 11 20 / .92); animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: .5rem; object-fit: contain; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .5); }
.lightbox .lb-close { position: absolute; top: 1rem; right: 1rem; border-radius: 9999px; background: rgb(255 255 255 / .1); padding: .5rem; color: var(--white); }
.lightbox .lb-open { position: absolute; top: 1rem; left: 1rem; display: inline-flex; align-items: center; gap: .375rem; border-radius: 9999px; background: rgb(255 255 255 / .1); padding: .375rem .75rem; font-size: .75rem; font-weight: 500; color: var(--white); }
.lightbox .lb-close:hover, .lightbox .lb-open:hover { background: rgb(255 255 255 / .2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* proofs */
.thumb { display: block; height: 3rem; width: 2.25rem; border-radius: .25rem; object-fit: cover; box-shadow: 0 0 0 1px var(--gray-200); background: var(--gray-100); }
button:hover > .thumb { box-shadow: 0 0 0 1px var(--brand-400); }
.proof-frame { display: block; width: 100%; overflow: hidden; border-radius: .5rem; background: var(--gray-100); box-shadow: 0 0 0 1px var(--gray-200); }
.proof-frame img { margin: 0 auto; max-height: 70vh; width: auto; max-width: 100%; object-fit: contain; }

/* code blocks */
.code { position: relative; overflow-x: auto; border-radius: .5rem; background: var(--gray-900); padding: 1rem; font-size: .75rem; line-height: 1.625; color: var(--gray-100); white-space: pre; font-family: var(--mono); }
.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: .5rem; right: .5rem; }
.pre-light { overflow-x: auto; border-radius: .5rem; background: var(--gray-50); padding: .75rem; font-size: .75rem; font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
code.inline { border-radius: .25rem; background: var(--gray-100); padding: .0625rem .3125rem; font-size: .8125em; color: var(--gray-800); }

/* progress */
.progress { display: flex; align-items: center; gap: .5rem; min-width: 7rem; }
.progress .bar { position: relative; flex: 1; height: .375rem; overflow: hidden; border-radius: 9999px; background: var(--gray-100); }
.progress .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 9999px; background: var(--emerald-500); }
.progress .bar i.fail { background: var(--red-500); }
.progress .txt { font-size: .75rem; color: var(--gray-600); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { display: block; height: .375rem; flex: 1; overflow: hidden; border-radius: 9999px; background: var(--gray-100); }
.meter > span { display: block; height: 100%; border-radius: 9999px; background: var(--brand-500); }

/* timeline */
.timeline { padding: 1rem 1.25rem; }
.timeline li { position: relative; display: flex; gap: .75rem; padding-bottom: 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; top: 1.25rem; left: 5px; height: 100%; width: 1px; background: var(--gray-200); }
.timeline .node { position: relative; margin-top: .375rem; width: 11px; height: 11px; flex-shrink: 0; border-radius: 9999px; box-shadow: 0 0 0 2px var(--white); }
.node.green { background: var(--emerald-500); } .node.red { background: var(--red-500); } .node.violet { background: var(--violet-500); }
.node.amber { background: var(--amber-500); } .node.slate { background: var(--slate-400); } .node.sky { background: var(--sky-500); } .node.gray { background: var(--gray-400); }

/* live monitor console */
.console { height: 18rem; overflow-y: auto; padding: .5rem 0; font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--gray-950); border-radius: 0 0 .75rem .75rem; }
.console .line { display: flex; gap: .75rem; padding: .0625rem 1rem; color: var(--gray-300); }
.console .ts { color: var(--gray-500); flex-shrink: 0; }
.console .lvl { width: 3.5rem; flex-shrink: 0; font-weight: 600; }
.console .msg { flex: 1; overflow-wrap: anywhere; }
.lvl-new { color: var(--con-new); } .lvl-run { color: var(--con-run); } .lvl-ok { color: var(--brand-300); } .lvl-err { color: var(--con-err); }
.lvl-hook { color: var(--amber-300); } .lvl-report { color: var(--con-report); } .lvl-info { color: var(--gray-400); }
.console .waiting { padding: 1rem; color: var(--gray-500); }
.live-dot { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 500; }
.live-dot::before { content: ''; width: .5rem; height: .5rem; border-radius: 9999px; background: var(--gray-400); }
.live-dot.on { color: var(--emerald-700); } .live-dot.on::before { background: var(--emerald-500); box-shadow: 0 0 0 3px rgb(16 185 129 / .2); animation: pulse 2s infinite; }
.live-dot.off { color: var(--red-700); } .live-dot.off::before { background: var(--red-500); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgb(16 185 129 / .05); } }

/* api docs */
.endpoint { border-radius: .75rem; box-shadow: inset 0 0 0 1px var(--gray-200); overflow: hidden; }
.endpoint + .endpoint { margin-top: .75rem; }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--gray-50); cursor: pointer; user-select: none; }
.ep-method { border-radius: .375rem; padding: .125rem .5rem; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--white); }
.m-get { background: var(--sky-500); } .m-post { background: var(--emerald-600); } .m-put { background: var(--amber-500); } .m-delete { background: var(--red-600); } .m-patch { background: var(--violet-600); }
.ep-path { font-family: var(--mono); font-size: .8125rem; font-weight: 600; color: var(--gray-900); }
.ep-desc { font-size: .8125rem; color: var(--gray-500); }
.ep-body { display: grid; gap: .75rem; padding: 1rem; border-top: 1px solid var(--gray-200); }
.ep-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-500); }
.param-table td { padding: .375rem .75rem .375rem 0; font-size: .8125rem; vertical-align: top; }
.param-table td:first-child { font-family: var(--mono); font-weight: 600; color: var(--gray-900); white-space: nowrap; }

/* role picker */
.role-option { display: flex; cursor: pointer; align-items: flex-start; gap: .75rem; border-radius: .5rem; padding: .75rem; box-shadow: inset 0 0 0 1px var(--gray-200); }
.role-option:has(input:checked) { background: rgb(236 253 245 / .6); box-shadow: inset 0 0 0 1px var(--brand-500); }
.role-option input { margin-top: .25rem; accent-color: var(--brand-600); }

/* field builder */
.fb-row { padding: 1rem 1.25rem; }
.fb-row.off { background: rgb(249 250 251 / .7); }
.fb-grid { display: grid; gap: .75rem; margin-top: .75rem; }
@media (min-width: 640px) { .fb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 1.5rem; } .fb-grid .full { grid-column: 1 / -1; } }

/* auth screen: brand panel + form (app.js authScreen) */
.auth { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1.15fr) minmax(28rem, 1fr); grid-template-rows: none; } }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2rem; padding: 1.5rem 1.25rem 4.5rem; color: #e5e7eb;
  background: radial-gradient(42rem 30rem at 0% 0%, rgb(16 185 129 / .38), transparent 62%), radial-gradient(36rem 28rem at 100% 100%, rgb(37 99 235 / .3), transparent 60%), #0b1220; }
.auth-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px); background-size: 2.5rem 2.5rem;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: .75rem; min-width: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.auth-brand .brand-mark { height: 2.5rem; max-width: 10rem; }
.auth-brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-wall { position: relative; z-index: 1; display: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; width: min(30rem, 80%); margin: auto; transform: perspective(60rem) rotateX(14deg) rotateZ(-6deg); }
.auth-wall i { position: relative; aspect-ratio: 9 / 18; border-radius: .75rem; background: linear-gradient(160deg, rgb(255 255 255 / .1), rgb(255 255 255 / .02)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 1rem 2rem rgb(0 0 0 / .35); overflow: hidden; }
.auth-wall i::before { content: ''; position: absolute; inset: 14% 12% auto; height: 34%; border-radius: .375rem; background: linear-gradient(135deg, rgb(16 185 129 / .55), rgb(37 99 235 / .45)); animation: auth-glow 3s ease-in-out infinite; animation-delay: var(--d); }
.auth-wall i b { position: absolute; left: 12%; right: 30%; bottom: 18%; height: .375rem; border-radius: 9999px; background: rgb(255 255 255 / .18); box-shadow: 0 .75rem 0 rgb(255 255 255 / .1); }
.auth-wall i::after { content: ''; position: absolute; top: .375rem; right: .375rem; width: .375rem; height: .375rem; border-radius: 9999px; background: var(--brand-400); box-shadow: 0 0 .5rem var(--brand-400); animation: auth-blink 2.4s ease-in-out infinite; animation-delay: var(--d); }
@keyframes auth-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes auth-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auth-wall i::before, .auth-wall i::after { animation: none; } }
.auth-copy { position: relative; z-index: 1; display: none; margin: 0; font-size: .75rem; color: rgb(229 231 235 / .55); }
.auth-main { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: center; padding: 0 1rem 2.5rem; margin-top: -3rem; }
.auth-inner { width: 100%; max-width: 25rem; }
.auth-card { display: flex; flex-direction: column; gap: 1.125rem; padding: 1.5rem 1.25rem; border-radius: 1rem; background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1.25rem 2.5rem -1rem rgb(16 24 40 / .25); }
.auth-title h1 { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -.025em; color: var(--gray-900); }
.auth-title p { margin: .375rem 0 0; font-size: .8125rem; color: var(--gray-500); }
.auth-input { position: relative; }
.auth-input > .ic-4 { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.auth-input .input { height: 2.875rem; padding-left: 2.5rem; border-radius: .625rem; font-size: .9375rem; }
.auth-input:has(.auth-eye) .input { padding-right: 2.75rem; }
.auth-eye { position: absolute; right: .375rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2.125rem; height: 2.125rem; border: 0; border-radius: .5rem; background: none; color: var(--gray-400); cursor: pointer; }
.auth-eye:hover { background: var(--gray-100); color: var(--gray-700); }
.auth-submit { height: 2.875rem; border-radius: .625rem; gap: .5rem; justify-content: center; }
.auth-alt { margin: 0; text-align: center; font-size: .8125rem; color: var(--gray-500); }
@media (min-width: 960px) {
  .auth-hero { padding: 2.5rem; }
  .auth-wall { display: grid; }
  .auth-copy { display: block; }
  .auth-main { align-items: center; margin-top: 0; padding: 2.5rem; }
  .auth-card { padding: 2.25rem 2rem; box-shadow: none; background: none; }
  .auth-title h1 { font-size: 1.875rem; line-height: 2.25rem; }
}

/* skeleton/loading */
.loading { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 4rem 1rem; color: var(--gray-400); font-size: .875rem; }
.loading .ic { animation: spin .8s linear infinite; }
.skel { border-radius: .375rem; background: linear-gradient(90deg, var(--gray-100), var(--gray-200), var(--gray-100)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* chart */
.chart-box { position: relative; height: 16rem; }
details.table-toggle { margin-top: .75rem; font-size: .75rem; color: var(--gray-500); }
details.table-toggle summary { cursor: pointer; user-select: none; }
details.table-toggle summary:hover { color: var(--gray-700); }

/* ── utilities ── */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; grid-template-columns: minmax(0, 1fr); } .block { display: block; } .hidden { display: none; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.flex-1 { flex: 1 1 0%; } .flex-wrap { flex-wrap: wrap; } .flex-col { flex-direction: column; } .shrink-0 { flex-shrink: 0; } .min-w-0 { min-width: 0; }
.gap-1 { gap: .25rem; } .gap-15 { gap: .375rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; }
.mt-05 { margin-top: .125rem; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; } .ml-1 { margin-left: .25rem; } .mx-auto { margin-left: auto; margin-right: auto; }
.p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .px-5 { padding-left: 1.25rem; padding-right: 1.25rem; } .py-3 { padding-top: .75rem; padding-bottom: .75rem; } .py-4 { padding-top: 1rem; padding-bottom: 1rem; } .py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.space-y-1 > * + * { margin-top: .25rem; } .space-y-15 > * + * { margin-top: .375rem; } .space-y-2 > * + * { margin-top: .5rem; } .space-y-3 > * + * { margin-top: .75rem; } .space-y-4 > * + * { margin-top: 1rem; } .space-y-5 > * + * { margin-top: 1.25rem; } .space-y-6 > * + * { margin-top: 1.5rem; }
.text-xs { font-size: .75rem; line-height: 1rem; } .text-11 { font-size: 11px; } .text-sm { font-size: .875rem; line-height: 1.25rem; } .text-base { font-size: 1rem; }
.text-right { text-align: right; } .text-center { text-align: center; }
.font-normal { font-weight: 400; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.muted { color: var(--gray-500); } .faint { color: var(--gray-400); } .text-gray-600 { color: var(--gray-600); } .text-gray-700 { color: var(--gray-700); } .text-gray-900 { color: var(--gray-900); }
.text-red { color: var(--red-700); } .text-red-600 { color: var(--red-600); } .text-green { color: var(--emerald-700); } .text-green-600 { color: var(--emerald-600); } .text-amber { color: var(--amber-700); } .text-brand { color: var(--brand-700); }
.tabular { font-variant-numeric: tabular-nums; } .uppercase { text-transform: uppercase; } .normal-case { text-transform: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nowrap { white-space: nowrap; } .break-all { word-break: break-all; } .pre-line { white-space: pre-line; }
.mono { font-size: 13px; } .mono.text-xs, .text-xs .mono { font-size: .75rem; } .mono.text-11 { font-size: 11px; }
.link { font-weight: 500; color: var(--brand-700); cursor: pointer; } .link:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
.hover-brand:hover { color: var(--brand-700); }
.link > svg { display: inline-block; vertical-align: -.125em; margin-right: .125rem; }
.w-full { width: 100%; } .max-w-xs { max-width: 20rem; } .max-w-sm { max-width: 24rem; } .max-w-md { max-width: 28rem; } .max-w-2xl { max-width: 42rem; } .max-w-3xl { max-width: 48rem; } .max-w-4xl { max-width: 56rem; }
.max-w-40 { max-width: 10rem; } .max-w-48 { max-width: 12rem; } .max-w-56 { max-width: 14rem; } .min-w-56 { min-width: 14rem; } .w-10 { width: 2.5rem; } .w-24 { width: 6rem; } .w-14 { width: 3.5rem; }
.relative { position: relative; } .rounded-lg { border-radius: .5rem; } .opacity-50 { opacity: .5; }
.dot-status { width: .5rem; height: .5rem; border-radius: 9999px; background: var(--gray-300); flex-shrink: 0; } .dot-status.on { background: var(--emerald-500); }
.cursor-pointer { cursor: pointer; } .select-none { user-select: none; }
.span-full { grid-column: 1 / -1; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .sm-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sm-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sm-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sm-span-2 { grid-column: span 2 / span 2; } .sm-span-3 { grid-column: span 3 / span 3; } .sm-span-4 { grid-column: span 4 / span 4; } .sm-span-full { grid-column: 1 / -1; }
  .sm-flex-row { flex-direction: row; } .sm-items-end { align-items: flex-end; } .sm-inline-flex { display: inline-flex; } .sm-block { display: block; }
}
@media (min-width: 768px) { .md-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .md-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .md-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .md-span-2 { grid-column: span 2 / span 2; } }
@media (min-width: 1024px) { .lg-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lg-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lg-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .lg-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .lg-flex-row { flex-direction: row; } }
@media (min-width: 1280px) {
  .xl-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xl-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .xl-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .xl-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .xl-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .xl-span-2 { grid-column: span 2 / span 2; } .xl-span-3 { grid-column: span 3 / span 3; }
}
@media (min-width: 1536px) { .xxl-cell { display: table-cell; } }
.xxl-only { display: none; }
@media (min-width: 1536px) { .xxl-only { display: table-cell; } }
.form-errors:empty { display: none; }
.card.fill { display: flex; flex-direction: column; }
/* height 0 + grow: the console takes the row height set by its neighbour card and scrolls,
   instead of growing the row with every new line. */
.card.fill > .console { flex: 1 1 0; height: 0; min-height: 18rem; }
.form-errors:empty + * { margin-top: 0 !important; }

/* ─── New order ─── */
.order-head { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--gray-100); padding: 1.25rem 1.5rem; }
.order-head h2 { font-size: 1.125rem; font-weight: 600; color: var(--gray-900); }
.order-head p { font-size: .8125rem; color: var(--gray-500); }
.seg { display: flex; gap: .25rem; border-radius: .625rem; background: var(--gray-100); padding: .25rem; }
.seg-btn { flex: 1 1 0; border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; font-weight: 500; color: var(--gray-600); transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--gray-900); }
.seg-btn.active { background: var(--brand-600); color: var(--white); box-shadow: var(--shadow-sm); }
.input-icon { position: relative; }
.input-icon > .pi, .input-icon > .ic, .input-icon > .ic-4 { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--gray-400); }
.input-icon > .input { padding-left: 2.5rem; }
.order-sum { border-radius: .75rem; background: var(--gray-50); padding: 1rem 1.25rem; box-shadow: inset 0 0 0 1px var(--gray-200); }
.order-sum .row { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--gray-600); }
.order-sum .row + .row { margin-top: .375rem; }
.order-sum .total { margin-top: .625rem; border-top: 1px dashed var(--gray-300); padding-top: .625rem; font-size: 1rem; font-weight: 600; color: var(--gray-900); }

/* ─── shared helpers (replace inline styles in the pages) ─── */
.m-0 { margin: 0 !important; }
.list-disc { list-style: disc; padding-left: 1rem; }
.tabs.in-card { padding: 0 1.25rem; margin: 0; }
.avatar.sm { width: 1.75rem; height: 1.75rem; }
.avatar.brand { background: var(--brand-50); color: var(--brand-700); }
.step-num { display: inline-flex; align-items: center; justify-content: center; height: 1.5rem; width: 1.75rem; padding: 0; flex-shrink: 0; }
.panel-soft { border-radius: var(--radius); background: var(--gray-50); padding: .75rem 1rem; box-shadow: inset 0 0 0 1px var(--border); }

/* ─── New order: platform tiles, platform switcher, service cards ─── */
/* --pc = the platform's colour (set inline per element from the catalog). */
.plat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.plat-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .875rem; min-height: 9.5rem;
  border-radius: var(--radius-lg); background: var(--surface); padding: 1.125rem; box-shadow: var(--shadow-sm), var(--ring); transition: box-shadow .15s, transform .15s; }
.plat-tile::after { content: ''; position: absolute; right: -2.5rem; top: -2.5rem; width: 7rem; height: 7rem; border-radius: 9999px; background: var(--pc); opacity: .1; transition: transform .3s; }
.plat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--brand-300); }
.plat-tile:hover::after { transform: scale(1.35); }
.plat-tile .pt-name { display: block; font-weight: 700; color: var(--gray-900); }
.plat-tile .pt-sub { display: block; margin-top: .125rem; font-size: .75rem; color: var(--gray-500); }
.plat-tile .pt-go { position: absolute; z-index: 1; right: 1rem; top: 1rem; display: flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 9999px;
  background: var(--gray-100); color: var(--gray-500); transition: background .15s, color .15s; }
.plat-tile:hover .pt-go { background: var(--brand-600); color: var(--white); }

.plat-switch { display: flex; gap: .5rem; overflow-x: auto; margin: 0 0 1rem; padding: .125rem .125rem .375rem; scroll-snap-type: x proximity; scrollbar-width: none; }
.plat-switch::-webkit-scrollbar { display: none; }
.plat-chip { display: inline-flex; flex-shrink: 0; align-items: center; gap: .5rem; scroll-snap-align: start; border-radius: 9999px; background: var(--surface);
  padding: .3125rem .875rem .3125rem .375rem; font-size: .8125rem; font-weight: 600; color: var(--gray-700); white-space: nowrap; box-shadow: var(--shadow-sm), var(--ring); transition: box-shadow .15s, color .15s; }
.plat-chip > .ic-4 { margin-left: .375rem; color: var(--gray-400); }
.plat-chip:hover { color: var(--gray-900); box-shadow: var(--shadow-sm), 0 0 0 1px var(--brand-300); }
.plat-chip.on { background: var(--gray-900); color: var(--white); box-shadow: var(--shadow-sm); }
.plat-chip .pi { border-radius: 9999px; }
.plat-chip .n { border-radius: 9999px; background: var(--gray-100); padding: 0 .4375rem; font-size: .6875rem; font-weight: 600; color: var(--gray-500); }
.plat-chip.on .n { background: rgb(255 255 255 / .14); color: var(--gray-300); }

.pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1rem; }
.pick-head h2 { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.pick-head p { margin-top: .125rem; font-size: .8125rem; color: var(--gray-500); }
.pick-head .search { margin-left: auto; width: 100%; max-width: 18rem; }
.svc-tile .pt-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plat-tile .pt-price { display: block; margin-top: .5rem; font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.plat-tile .pt-price small { font-size: .75rem; font-weight: 500; color: var(--gray-500); letter-spacing: 0; }

@media (max-width: 639px) {
  .plat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .plat-tile { min-height: 8.5rem; padding: 1rem; }
  .pick-head .search { max-width: none; margin-left: 0; }
}

/* ─── New order: two columns — the app's form, then the order summary (sticky on wide screens) ─── */
.order-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .order-layout { grid-template-columns: minmax(0, 1fr) 21rem; } .order-side { position: sticky; top: 5rem; } }
.side-block { border-radius: var(--radius); background: var(--gray-50); padding: .875rem 1rem; box-shadow: inset 0 0 0 1px var(--border); }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--gray-500); }
.side-big { margin-top: .25rem; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.side-big span { font-size: .8125rem; font-weight: 500; color: var(--gray-500); }
.side-big.text-red { color: var(--red-700); }
.pc-list { margin-top: .625rem; display: grid; gap: .375rem; }
.pc-list li { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--gray-700); }
.pc-list li.off { color: var(--gray-400); }
@media (max-width: 639px) { .order-head { gap: .75rem; padding: 1rem 1.25rem; } .order-head .pi-lg { width: 2.5rem; height: 2.5rem; } }

/* ─── Test run (sandbox) ─── */
.test-log { height: 16rem; border-radius: var(--radius); }
.test-proof { display: block; max-width: 100%; max-height: 18rem; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); cursor: zoom-in; }
.table tbody tr.is-current td { background: var(--brand-50); }
.side-col { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.phone-pick { max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.pp-filter { padding: .75rem .75rem .5rem; border-bottom: 1px solid var(--border); }
.pp-group + .pp-group { border-top: 1px solid var(--border); }
.pp-head { position: sticky; top: 0; z-index: 1; gap: .625rem; background: var(--gray-50); padding: .5rem .75rem; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.pp-row { gap: .625rem; padding: .4375rem .75rem; font-size: .8125rem; }
.pp-row:hover { background: var(--gray-50); }
.pp-row.off { color: var(--gray-400); cursor: default; }
.test-rows { display: grid; gap: .375rem; max-height: 26rem; overflow-y: auto; }
.test-rows li { display: flex; align-items: center; gap: .375rem; border-radius: var(--radius); padding: .5rem .625rem; box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.test-rows li:hover { background: var(--gray-50); box-shadow: inset 0 0 0 1px var(--brand-300); }

/* ─── All PCs & devices ─── */
.fleet-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid var(--border); }
.fleet-bar .input { height: 2.25rem; font-size: .8125rem; }
.fleet-bar #fView { margin-left: auto; }
/* Devices page: a one-line header, the counts as chips (they filter by state), then the controller */
.dev-head { display: flex; align-items: center; gap: .625rem; margin-bottom: .75rem; }
/* The counters and the live / refresh controls share one row (the controls used to sit alone on a line above). */
.dev-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.dev-top .dev-stats { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.dev-top .dev-head { flex: 0 0 auto; margin-bottom: 0; }
.dev-head h1 { margin: 0 auto 0 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: var(--gray-900); }
.dev-stats { display: flex; gap: .5rem; margin-bottom: .75rem; overflow-x: auto; scrollbar-width: none; }
.dev-stats::-webkit-scrollbar { display: none; }
.dev-stat { display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; height: 2.125rem; padding: 0 .875rem; border: 1px solid var(--border); border-radius: 9999px; background: var(--surface); color: var(--gray-600); font: inherit; font-size: .8125rem; white-space: nowrap; cursor: pointer; }
.dev-stat b { color: var(--gray-900); font-weight: 700; font-variant-numeric: tabular-nums; }
.dev-stat i { width: .5rem; height: .5rem; flex-shrink: 0; border-radius: 9999px; background: var(--gray-300); }
.dev-stat i.t-green { background: var(--brand-500); } .dev-stat i.t-amber { background: var(--amber-500); } .dev-stat i.t-red { background: var(--red-500, #ef4444); }
.dev-stat:not(.static):hover { border-color: var(--gray-300); }
.dev-stat.active { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-800); }
.dev-stat.static { cursor: default; }
.fleet-bar .fb-search { flex: 1 1 12rem; min-width: 10rem; }
.fleet-bar .fb-select { width: auto; flex: 0 1 12rem; min-width: 9rem; }
.fleet-bar .fb-seg { flex: 0 0 auto; }
.fleet-bar .fb-seg .seg-btn { flex: 0 0 auto; padding: .375rem .75rem; font-size: .8125rem; }
.pc-block { padding-bottom: 1rem; }
.pc-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem .75rem; cursor: pointer; user-select: none; }
.pc-head:hover .pc-name { color: var(--brand-700); }
.pc-chev { display: flex; color: var(--gray-400); transition: transform .15s; }
.pc-block.folded .pc-chev { transform: rotate(-90deg); }
.pc-block.folded { padding-bottom: 0; }
.pc-block.folded .dev-grid, .pc-block.folded > p { display: none; }
.accent-gray { background: var(--gray-100); color: var(--gray-500); }
.pc-name { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--gray-900); }
.pc-counts { font-size: .8125rem; color: var(--gray-500); white-space: nowrap; }
.dev-grid { display: grid; gap: .625rem; padding: 0 1.25rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.dev-tile { position: relative; display: flex; flex-direction: column; gap: .25rem; min-width: 0; border-radius: var(--radius); background: var(--surface); padding: .625rem .75rem .625rem .875rem;
  box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow .15s, transform .15s; }
.dev-tile::before { content: ''; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--gray-300); }
.dev-tile:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--brand-300), var(--shadow-sm); }
.dev-tile .dt-top { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.dev-tile .dt-dot { width: .5rem; height: .5rem; flex-shrink: 0; border-radius: 9999px; background: var(--gray-300); }
.dev-tile .dt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 600; color: var(--gray-900); }
.dev-tile .dt-conn { font-size: 10px; font-weight: 600; color: var(--violet-600); }
.dev-tile .dt-serial { font-family: var(--mono); font-size: 11px; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-tile .dt-state { display: flex; align-items: center; gap: .25rem; min-width: 0; font-size: .75rem; color: var(--gray-600); white-space: nowrap; }
.dev-tile .dt-stats { display: flex; gap: .5rem; font-size: 11px; font-variant-numeric: tabular-nums; }
.dev-tile.s-online::before, .dev-tile.s-online .dt-dot { background: var(--brand-500); }
.dev-tile.s-busy::before, .dev-tile.s-busy .dt-dot { background: var(--amber-500); }
.dev-tile.s-busy .dt-state { color: var(--amber-700); font-weight: 600; }
.dev-tile.s-off { background: var(--gray-50); }
.dev-tile.s-off .dt-name, .dev-tile.s-off .dt-state { color: var(--gray-400); }
.text-violet { color: var(--violet-600); }
@media (max-width: 639px) {
  .fleet-bar { gap: .375rem; padding: .5rem; }
  .fleet-bar .fb-search { flex: 1 1 calc(100% - 8.5rem); min-width: 0; }   /* leaves room for the view buttons only */
  .fleet-bar #fView { order: 1; margin-left: 0; }   /* row 1: search + view; row 2: PC / group / screen size */
  .fleet-bar .fb-select, .fleet-bar .fb-zoom { order: 2; }
  .fleet-bar .fb-select { flex: 1 1 0; min-width: 0; }
  .fleet-bar .fb-label { display: none; }   /* Stream off / on: the icon (+ title) is enough on a phone */
  .fleet-bar .fb-zoom [data-zoom] { display: none; }   /* the slider is enough; keeps the filters on one row */
  .fleet-bar .fb-select { min-width: 5.5rem; }
  .dev-head h1 { font-size: 1.125rem; }
  .dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 1rem; }
  .pc-head { padding: .875rem 1rem .625rem; }
}
.report-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .375rem; }

/* ─── Live screens (PhoneGrid stream) ─── */
.screen-wall { --tile-w: 8.5rem; display: grid; gap: .75rem; padding: 1rem 1.25rem 1.25rem; grid-template-columns: repeat(auto-fill, min(var(--tile-w), 100%)); justify-content: start; }
.screen-wall.st-tiny { gap: .375rem; }
.screen-wall.st-tiny .st-label .faint, .screen-wall.st-tiny .st-status { display: none; }
.screen-wall.st-tiny .st-label { font-size: .625rem; }
.fleet-bar .fb-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; flex: 0 0 auto; }
.fleet-bar .fb-zoom[hidden] { display: none; }
.fleet-bar .fb-zoom input[type=range] { width: 7rem; accent-color: var(--brand-600); }
.fleet-bar .fb-zoom [data-zoom] { min-width: 2rem; justify-content: center; font-size: 1.125rem; font-weight: 600; line-height: 1; color: var(--gray-700); }
.screen-tile { display: flex; flex-direction: column; gap: .375rem; min-width: 0; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; }
.screen-tile .st-screen { position: relative; display: block; aspect-ratio: var(--tile-ar, 9 / 19.5);   /* same shape for every tile: the tallest phone (farm.js uniformShape) */
  border-radius: .625rem; overflow: hidden; background: #0b0f17; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); transition: box-shadow .15s; }
.screen-tile:hover .st-screen, .screen-tile:focus-visible .st-screen { box-shadow: 0 0 0 2px var(--brand-500); }
.screen-tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* Rotate (farm.js rotateTile): the picture turns inside its frame. At 90° / 270° the canvas is as wide as the
   frame is tall (container units), so once turned it fills the frame again. */
.screen-tile .st-screen { container-type: size; }
.screen-tile .st-screen[data-rot="90"] canvas, .screen-tile .st-screen[data-rot="270"] canvas { inset: auto; left: 50%; top: 50%; width: 100cqh; height: 100cqw; }
.screen-tile .st-screen[data-rot="90"] canvas { transform: translate(-50%, -50%) rotate(90deg); }
.screen-tile .st-screen[data-rot="180"] canvas { transform: rotate(180deg); }
.screen-tile .st-screen[data-rot="270"] canvas { transform: translate(-50%, -50%) rotate(270deg); }
.screen-tile .st-status { position: absolute; inset: auto .5rem .5rem; padding: .25rem .375rem; border-radius: .375rem; background: rgb(0 0 0 / .55); color: #e5e7eb; font-size: .6875rem; text-align: center; }
.screen-tile .st-label { display: flex; align-items: center; gap: .375rem; min-width: 0; font-size: .75rem; color: var(--gray-700); }
.screen-tile .st-label .truncate { flex: 1 1 auto; min-width: 0; }
.dt-dot { width: .5rem; height: .5rem; flex-shrink: 0; border-radius: 9999px; background: var(--gray-300); }
.dt-dot.s-online { background: var(--brand-500); }
.dt-dot.s-busy { background: var(--amber-500); }
/* Phone viewer (mirror.js openViewer): a header; the phone and, on the right, a tools panel (one per
   row) that hides behind a ‹ tab; Recents / Home / Back under the panel. */
.mirror-view { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; min-height: 0; }
.modal.mv-fit { width: auto; max-width: calc(100vw - 2rem); }
.mirror-view .mv-head { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.mirror-view .mv-grow { flex: 1 1 auto; }
.mirror-view .mv-q { width: auto; flex: 0 0 auto; padding: .1875rem 1.5rem .1875rem .5rem; font-size: .75rem; }
/* Pinned (big screens): the viewer is a column on the right of the page instead of a window over it, so the
   screens stay usable beside it (a click on another phone takes its place). --mv-dock-w: set by mirror.js fit. */
.mirror-view .mv-pin { display: none; }
.mirror-view .mv-pin.on { background: var(--brand-50); color: var(--brand-700); }
@media (min-width: 1024px) {
  .mirror-view .mv-pin { display: inline-flex; }
  html.mv-pinned .shell { padding-right: var(--mv-dock-w, 32rem); }
  .modal-back.mv-back.mv-docked { inset: 0 0 0 auto; z-index: 60; width: var(--mv-dock-w, 32rem); padding: 0; background: none; align-items: stretch; animation: none; }
  .modal-back.mv-docked .modal.mv-fit { width: 100%; max-width: none; max-height: none; overflow: auto; border-radius: 0; border-left: 1px solid var(--gray-200); }
}
.mirror-view .mv-body { position: relative; display: grid; grid-template-columns: auto; grid-template-areas: "screen"; gap: .5rem 1rem; min-height: 0; }
.mirror-view.controls .mv-body { grid-template-columns: auto 13.5rem; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "screen side" "nav side"; }   /* 13.5rem = SIDE_W in mirror.js */
.mirror-view.controls.side-hidden .mv-body { grid-template-columns: auto; grid-template-areas: "screen" "nav"; }
.mirror-view.side-hidden .mv-side { display: none; }
/* Run log: terminal text in its own column beside the tools (20rem = LOG_W in mirror.js). */
.mirror-view.controls.log-open .mv-body { grid-template-columns: auto 13.5rem 20rem; grid-template-areas: "screen side log" "nav side log"; }
.mirror-view.controls.log-open.side-hidden .mv-body { grid-template-columns: auto 20rem; grid-template-areas: "screen log" "nav log"; }
.mirror-view .mv-log { grid-area: log; display: none; flex-direction: column; min-height: 0; contain: size; background: #0b0f17; color: #d1d5db; border-radius: .75rem; overflow: hidden;
  font: 11.5px/1.5 ui-monospace, SFMono-Regular, Consolas, 'Cascadia Mono', monospace; }
.mirror-view.log-open .mv-log { display: flex; }
.mirror-view.full .mv-log { display: none; }   /* full screen: just the phone */
.mirror-view.full.log-open .mv-body { grid-template-columns: auto 13.5rem; grid-template-areas: "screen side" "nav side"; }
.mirror-view.full.log-open.side-hidden .mv-body { grid-template-columns: auto; grid-template-areas: "screen" "nav"; }
.mirror-view .mvl-head { display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem .375rem .75rem; border-bottom: 1px solid #1f2937; color: #e5e7eb; }
.mirror-view .mvl-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mirror-view .mvl-dot { width: .5rem; height: .5rem; flex: 0 0 auto; border-radius: 50%; background: #4b5563; }
.mirror-view .mvl-dot.on { background: #34d399; box-shadow: 0 0 0 3px rgb(52 211 153 / .2); }
.mirror-view .mvl-dot.err { background: #f87171; }
.mirror-view .mvl-x { display: flex; padding: .25rem; border: 0; border-radius: .375rem; background: none; color: #9ca3af; cursor: pointer; }
.mirror-view .mvl-x:hover { background: #1f2937; color: #fff; }
.mirror-view .mvl-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: .5rem .75rem; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: #374151 transparent; }
.mirror-view .mvl-ts { color: #6b7280; }
.mirror-view .mvl-err { color: #f87171; }
.mirror-view .mvl-warn { color: #fbbf24; }
.mirror-view .mvl-act { color: #7dd3fc; }
.mirror-view .mvl-dim { color: #6b7280; }
.mirror-view .mv-act.on { background: var(--brand-50); color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-300); }
.mirror-view .mv-screen { grid-area: screen; position: relative; background: #0b0f17; border-radius: .75rem; overflow: hidden; }   /* width/height set from the phone aspect (mirror.js fit) */
.mirror-view .mv-canvas { width: 100%; height: 100%; object-fit: contain; display: block; outline: none; touch-action: none; }
.mirror-view .mv-canvas.controlling { cursor: crosshair; }
.mirror-view .mv-status a, .screen-tile .st-status a { color: #6ee7b7; font-weight: 600; text-decoration: underline; }
.secure-bar { display: flex; align-items: center; gap: .5rem; margin: .75rem 1rem 0; padding: .625rem .875rem; border-radius: .625rem; background: var(--amber-50, #fffbeb); box-shadow: inset 0 0 0 1px var(--amber-200, #fde68a); color: var(--amber-800, #92400e); font-size: .8125rem; }
.secure-bar .ic-4 { flex-shrink: 0; }
.mirror-view .mv-status { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); max-width: 90%; padding: .375rem .625rem; border-radius: .5rem; background: rgb(0 0 0 / .6); color: #e5e7eb; font-size: .8125rem; text-align: center; }
.mirror-view .mv-side { grid-area: side; display: flex; flex-direction: column; gap: .5rem; min-height: 0; overflow: auto; contain: size; }   /* size: the phone sets the height, the panel scrolls */
.mirror-view .mv-drop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .5rem; background: rgb(16 185 129 / .28); border: 2px dashed var(--brand-500); border-radius: inherit; color: #fff; font-weight: 600; pointer-events: none; }
.mirror-view .mv-drop[hidden] { display: none; }
.mirror-view .mv-xfer { font-size: .75rem; color: var(--gray-600); word-break: break-word; }
.mirror-view .mv-xfer[data-tone=green] { color: #047857; }
.mirror-view .mv-xfer[data-tone=red] { color: #dc2626; }
.mirror-view .mv-files { display: flex; flex-direction: column; gap: .375rem; min-height: 0; }
.mirror-view .mv-files[hidden] { display: none; }
.mirror-view .mvf-bar { display: flex; align-items: center; gap: .25rem; }
.mirror-view .mvf-bar .input { flex: 1 1 auto; min-width: 0; font-size: .75rem; padding: .375rem .5rem; }
.mirror-view .mvf-list { list-style: none; margin: 0; padding: .25rem 0; overflow: auto; max-height: 45vh; border: 1px solid var(--border); border-radius: .5rem; }
.mirror-view .mvf-list li { font-size: .8125rem; }
.mirror-view .mvf-list li.muted, .mirror-view .mvf-list li.text-red { padding: .5rem .625rem; }
.mirror-view .mvf-item { display: flex; align-items: center; gap: .5rem; width: 100%; min-width: 0; padding: .375rem .625rem; text-align: left; background: none; border: 0; cursor: pointer; color: var(--gray-700); }
.mirror-view .mvf-item:hover { background: var(--gray-50); }
.mirror-view .mvf-item .truncate { min-width: 0; }
.mirror-view .mv-acts { display: flex; flex-direction: column; gap: .25rem; }
.mirror-view .mv-act { display: flex; align-items: center; gap: .5rem; width: 100%; min-width: 0; padding: .4375rem .5rem; border: 0; border-radius: .5rem; background: var(--gray-50);
  box-shadow: inset 0 0 0 1px var(--border); color: var(--gray-700); font-size: .75rem; font-weight: 500; text-align: left; cursor: pointer; }
.mirror-view .mv-act span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mirror-view .mv-act:hover { background: var(--brand-50); color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-300); }
.mirror-view .mv-act.danger:hover { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px var(--red-100); }
.mirror-view .mv-paste { grid-area: paste; display: none; }   /* a phone's keyboard needs it; a PC types on the screen */
.mirror-view .mv-nav { grid-area: nav; display: grid; grid-template-columns: repeat(3, 1fr); gap: .375rem; }
.mirror-view .mv-nav .btn { justify-content: center; height: 2.25rem; padding-left: 0; padding-right: 0; }
.mirror-view .mv-tab { position: absolute; right: -1rem; top: 50%; z-index: 4; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 1.375rem; height: 3.5rem; border: 0; border-radius: .625rem 0 0 .625rem; background: rgb(15 23 42 / .7); color: #fff; cursor: pointer; }
.mirror-view .mv-tab[hidden] { display: none; }
.mirror-view .mv-sm-only { display: none; }
.mirror-view.full .mv-head { display: none; }
.modal-back.mv-back:fullscreen { padding: 0; background: #000; }
.modal-back.mv-back:fullscreen .modal.mv-fit { max-width: none; max-height: none; border-radius: 0; }
/* Phone-sized: the whole window — header, the phone with the tools as a rail of icons on its right,
   Recents / Home / Back at the bottom (thumb reach, above the home indicator). */
@media (max-width: 760px) {
  .screen-wall { padding: .75rem 1rem 1rem; }
  .modal-back.mv-back { padding: 0; }
  .modal.mv-fit { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .mirror-view { height: 100%; padding: 0; gap: 0; }
  .mirror-view .mv-head { padding: .5rem .75rem; padding-top: max(.5rem, env(safe-area-inset-top)); border-bottom: 1px solid var(--gray-100); }
  .mirror-view .mv-body { flex: 1 1 auto; gap: 0; }
  .mirror-view.controls .mv-body { grid-template-columns: minmax(0, 1fr) 3.5rem; grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "screen side" "paste paste" "nav nav"; }
  .mirror-view.controls.side-hidden .mv-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "screen" "paste" "nav"; }
  /* phone-sized: the log is a strip under the phone, above Recents / Home / Back */
  .mirror-view.controls.log-open .mv-body { grid-template-columns: minmax(0, 1fr) 3.5rem; grid-template-rows: minmax(0, 1fr) auto auto auto; grid-template-areas: "screen side" "log log" "paste paste" "nav nav"; }
  .mirror-view.controls.log-open.side-hidden .mv-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "screen" "log" "paste" "nav"; }
  .mirror-view .mv-log { contain: none; height: 28vh; border-radius: 0; }
  .mirror-view.side-hidden .mv-nav { grid-template-columns: repeat(3, 1fr); }
  .mirror-view .mv-screen { place-self: center; border-radius: .5rem; }
  .mirror-view .mv-side { gap: .125rem; padding: .375rem .25rem; border-left: 1px solid var(--gray-100); background: var(--surface); scrollbar-width: none; }
  .mirror-view .mv-acts { gap: .125rem; }
  .mirror-view .mv-act { flex-direction: column; justify-content: center; gap: .1875rem; padding: .4375rem 0 .375rem; background: none; box-shadow: none; color: var(--gray-600); font-size: .5625rem; line-height: 1; text-align: center; -webkit-tap-highlight-color: transparent; }
  .mirror-view .mv-act span { display: none; }
  .mirror-view .mv-act::after { content: attr(data-s); }
  .mirror-view .mv-act .ic-4 { width: 1.25rem; height: 1.25rem; }
  .mirror-view .mv-sm-only { display: flex; }
  .mirror-view .mv-paste { display: none; padding: .5rem .75rem; border-top: 1px solid var(--gray-100); }
  .mirror-view.typing .mv-paste { display: flex; }
  .mirror-view.typing [data-type-toggle] { background: var(--brand-50); color: var(--brand-700); }
  .mirror-view .mv-files { position: absolute; inset: 0; z-index: 5; padding: .625rem; background: var(--surface); }
  .mirror-view .mv-files[hidden] { display: none; }
  .mirror-view .mvf-list { flex: 1 1 auto; max-height: none; }
  .mirror-view .mv-xfer:not([hidden]) { position: absolute; top: .5rem; left: .5rem; right: 4rem; z-index: 4; padding: .375rem .625rem; border-radius: .5rem; background: var(--surface); box-shadow: var(--shadow-lg); }
  .mirror-view .mv-nav { gap: 0; padding: .125rem .5rem; padding-bottom: max(.125rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--gray-100); }
  .mirror-view .mv-nav .btn { height: 2.25rem; min-height: 0; border: 0; background: none; box-shadow: none; color: var(--gray-700); }   /* a slim system-style bar */
  .mirror-view .mv-nav .btn:active { background: var(--gray-100); }
  .mirror-view .mv-tab { right: 0; }
}

/* Branding preview (Settings → General) */
.brand-preview { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: .5rem; background: var(--gray-50); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.brand-preview img { width: 100%; height: 100%; object-fit: contain; }

/* ─── PhoneGrid farm control (Devices actions, pickers, Tasks / Schedules / Runs) ─── */
.w-8 { width: 2rem; }
.block { display: block; }
.text-sky { color: var(--sky-700); }
.dev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; padding: .5rem 1rem; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.dev-actions.has-picks { background: rgb(236 253 245 / .6); border-bottom-color: var(--brand-100); }
.dev-actions .da-all { display: inline-flex; align-items: center; gap: .375rem; margin-right: .25rem; font-weight: 500; color: var(--gray-700); cursor: pointer; white-space: nowrap; }
.dev-actions.has-picks .da-all { color: var(--brand-900); }
.dev-actions .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 639px) {   /* one row that scrolls sideways instead of three wrapped rows */
  .fleet-bar .fb-zoom input[type=range] { width: 4.5rem; }
  .dev-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: .375rem .5rem; }
  .dev-actions::-webkit-scrollbar { display: none; }
  .dev-actions > * { flex: 0 0 auto; }
}
/* A pick box on tiles: faint until hovered, always shown once something is picked. */
.pick-box { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.125rem; height: 1.125rem; margin-left: auto; border-radius: .3125rem;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--gray-300); color: transparent; cursor: pointer; opacity: 0; transition: opacity .12s; }
.dev-tile:hover .pick-box, .screen-tile:hover .pick-box, .picking .pick-box, .pick-box:focus-visible { opacity: 1; }
.pick-box.on { opacity: 1; background: var(--brand-600); box-shadow: none; color: #fff; }
.dev-tile:has(.pick-box.on) { box-shadow: inset 0 0 0 2px var(--brand-500); }
.screen-tile:has(.pick-box.on) .st-screen { box-shadow: 0 0 0 2px var(--brand-500); }
/* Drag a box over the phones to pick them (farm.js). */
.sel-box { position: fixed; z-index: 70; border: 1px solid var(--brand-500); border-radius: .25rem; background: rgb(16 185 129 / .12); pointer-events: none; }
.selecting, .selecting * { user-select: none; cursor: crosshair; }
/* Viewer: controlling the picked phones together; text copied on the phone. */
.mirror-view .mv-together { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; background: var(--surface); box-shadow: inset 0 0 0 1px var(--gray-300); color: var(--gray-700); }
.mirror-view .mv-together.on { background: var(--brand-600); box-shadow: none; color: #fff; }
.mirror-view .mv-clip { position: absolute; left: .5rem; right: .5rem; bottom: .5rem; z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem .375rem .75rem;
  border-radius: .5rem; background: var(--surface); box-shadow: var(--shadow-lg); font-size: .75rem; color: var(--gray-700); }
.mirror-view .mv-clip[hidden] { display: none; }
.mirror-view .mv-clip-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.mirror-view .mv-clip-x { flex-shrink: 0; padding: .125rem; border: 0; background: none; color: var(--gray-500); cursor: pointer; }
.dt-grp { flex-shrink: 0; max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .375rem; border-radius: 9999px; background: var(--sky-50); color: var(--sky-700); font-size: 10px; font-weight: 600; line-height: 1.125rem; }
/* Stream off: no video on the wall; the last picture stays as a dimmed still. */
.screen-tile .st-off { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; color: #9ca3af; font-size: .6875rem; }
.screen-wall.stream-off .screen-tile .st-off { display: flex; }
.screen-wall.stream-off .screen-tile .st-still:not([hidden]) ~ .st-off { background: rgb(0 0 0 / .35); color: #e5e7eb; }
.screen-wall.stream-off .screen-tile .st-still { filter: saturate(.6); }
.screen-wall.st-tiny .st-off span { display: none; }
/* Phone picker inside dialogs */
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-bottom: .375rem; }
.pick-bar .input-icon { min-width: 10rem; }
.pick-bar .pick-grp { width: auto; }
.pick-list { max-height: 15rem; overflow: auto; border: 1px solid var(--border); border-radius: .5rem; }
.pick-row { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .375rem .625rem; font-size: .8125rem; cursor: pointer; }
.pick-row + .pick-row { border-top: 1px solid var(--gray-100); }
.pick-row:hover { background: var(--gray-50); }
.pick-row.disabled { cursor: default; opacity: .6; }
.pick-row .truncate { min-width: 0; }
.chips-pick { display: flex; flex-wrap: wrap; gap: .375rem; }
/* ADB command output */
.shell-out { display: flex; flex-direction: column; gap: .5rem; max-height: 50vh; overflow: auto; }
.shell-out .so-head { margin: 0 0 .25rem; font-size: .75rem; font-weight: 600; color: var(--gray-700); }
.shell-out .code { max-height: 14rem; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .75rem; }
/* Run log */
.run-log { max-height: 60vh; overflow: auto; padding: .5rem .75rem; border-radius: .5rem; background: #0b1220; color: #d1d5db; font-family: var(--mono); font-size: .75rem; line-height: 1.5; }
.run-log .rl-line { display: flex; gap: .625rem; white-space: pre-wrap; word-break: break-word; }
.run-log .rl-ts { flex-shrink: 0; color: #6b7280; }
.run-log .text-red { color: #fca5a5; } .run-log .text-amber { color: #fcd34d; } .run-log .text-sky { color: #7dd3fc; }
.run-log .muted { color: #9ca3af; }
/* On / off switch (schedules) */
.switch { position: relative; display: inline-flex; width: 2.25rem; height: 1.25rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 9999px; background: var(--gray-300); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: .125rem; left: .125rem; width: 1rem; height: 1rem; border-radius: 9999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + span { background: var(--brand-600); }
.switch input:checked + span::after { transform: translateX(1rem); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ─── PC remote control (pcview.js): the whole window, on every screen size ─── */
html.pcv-open, html.pcv-open body { overflow: hidden; }
.pcv { position: fixed; left: 0; right: 0; top: var(--pcv-top, 0); z-index: 75; height: var(--pcv-h, 100dvh); display: flex; flex-direction: column; background: #05080f; overscroll-behavior: none; }
.pcv-top { display: flex; align-items: center; gap: .375rem; min-width: 0; padding: .375rem .5rem; padding-top: max(.375rem, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); }
.pcv-top .pcv-pc { display: inline-flex; align-items: center; gap: .375rem; min-width: 0; color: var(--gray-900); }
.pcv-top .pcv-pc .input { width: auto; max-width: 11rem; min-width: 0; font-weight: 600; }
.pcv-top .pcv-q { width: auto; flex-shrink: 0; }
.pcv-grow { flex: 1 1 auto; }
.pcv.top-hidden .pcv-top { display: none; }
.pcv-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.pcv-stage { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pcv-scroll { position: absolute; inset: 0; display: flex; overflow: hidden; touch-action: none; }
.pcv-scroll.zoomed { overflow: auto; }   /* zoomed: the screen is larger than the stage — scrollbars, two fingers */
.pcv-screen { position: relative; flex: 0 0 auto; margin: auto; background: #0b0f17; }   /* margin auto: centred while it fits, scrollable from 0 when it does not */
.pcv-canvas { width: 100%; height: 100%; display: block; outline: none; cursor: default; touch-action: none; }
.pcv-ptr { position: absolute; left: 50%; top: 50%; z-index: 1; width: 22px; height: 22px; margin: -2px 0 0 -3px; pointer-events: none; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.pcv-ptr[hidden] { display: none; }
.pcv-ripple { position: absolute; z-index: 1; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid rgb(37 99 235 / .9); background: rgb(37 99 235 / .18); pointer-events: none; animation: pcv-ripple .45s ease-out forwards; }
.pcv-ripple.right { border-color: rgb(217 119 6 / .95); background: rgb(217 119 6 / .18); }
@keyframes pcv-ripple { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pcv-ripple { animation-duration: .01s; } }
.pcv-status { position: absolute; left: 50%; bottom: 1rem; z-index: 2; transform: translateX(-50%); max-width: 90%; padding: .375rem .625rem; border-radius: .5rem; background: rgb(0 0 0 / .7); color: #e5e7eb; font-size: .8125rem; text-align: center; pointer-events: none; }
.pcv-status[hidden] { display: none; }
.pcv-note { position: absolute; top: .5rem; left: 50%; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; max-width: min(30rem, calc(100% - 1rem)); padding: .3125rem .375rem .3125rem .625rem; border-radius: .625rem; background: var(--surface); color: var(--gray-800); box-shadow: var(--shadow-lg); font-size: .8125rem; }
.pcv-note[hidden] { display: none; }
.pcv-note .truncate { min-width: 0; }
/* "Control blocked" banner: Windows is refusing our input into a higher-integrity window. */
.pcv-blocked { position: absolute; top: .5rem; left: 50%; z-index: 4; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; max-width: min(34rem, calc(100% - 1rem)); padding: .375rem .375rem .375rem .75rem; border-radius: .625rem; background: #78350f; color: #fde68a; box-shadow: var(--shadow-lg); font-size: .8125rem; line-height: 1.3; }
.pcv-blocked[hidden] { display: none; }
.pcv-blocked .btn { color: #fde68a; }
.pcv-pad { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; z-index: 3; display: flex; justify-content: space-between; pointer-events: none; }
.pcv-pad[hidden] { display: none; }
.pcv-pad button { pointer-events: auto; width: 4.5rem; height: 3rem; border-radius: .75rem; border: 1px solid rgb(255 255 255 / .25); background: rgb(15 23 42 / .55); color: #fff; font-weight: 600; touch-action: none; -webkit-tap-highlight-color: transparent; }
.pcv-pad button.down { background: rgb(37 99 235 / .75); }
.pcv-tab { position: absolute; z-index: 4; display: flex; align-items: center; justify-content: center; border: 0; background: rgb(15 23 42 / .7); color: #fff; cursor: pointer; }
.pcv-tab[hidden] { display: none; }
.pcv-tab-top { top: 0; left: 50%; transform: translateX(-50%); width: 3.5rem; height: 1.375rem; border-radius: 0 0 .625rem .625rem; }
.pcv-tab-rail { right: 0; top: 50%; transform: translateY(-50%); width: 1.375rem; height: 3.5rem; border-radius: .625rem 0 0 .625rem; }
.pcv-rail { display: flex; flex-direction: column; align-items: center; gap: .125rem; width: 3.75rem; flex-shrink: 0; padding: .375rem .25rem; padding-bottom: max(.375rem, env(safe-area-inset-bottom)); background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; scrollbar-width: none; }
.pcv-rail button { display: flex; flex-direction: column; align-items: center; gap: .1875rem; width: 3.25rem; flex-shrink: 0; padding: .4375rem 0 .375rem; border: 0; border-radius: .5rem; background: none; color: var(--gray-600); font-size: .625rem; font-weight: 500; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pcv-rail button:hover { background: var(--gray-50); color: var(--gray-900); }
.pcv-rail button.on { background: var(--brand-50); color: var(--brand-700); }
.pcv-rail button:disabled { opacity: .4; cursor: default; }
.pcv-rail-end { flex: 1 1 auto; min-height: .25rem; }
.pcv.rail-hidden .pcv-rail { display: none; }
.pcv-rail .pcv-mob { display: none; }   /* Keyboard / Keys: phones and tablets (a PC has its own keyboard) */
.pcv.touch .pcv-rail .pcv-mob { display: flex; }
.pcv-keys { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; padding: .375rem .5rem; padding-bottom: max(.375rem, env(safe-area-inset-bottom)); overflow-x: auto; background: var(--surface); border-top: 1px solid var(--border); scrollbar-width: thin; }
.pcv-keys[hidden] { display: none; }
.pcv-keys button { flex: 0 0 auto; min-width: 2.5rem; height: 2.25rem; padding: 0 .625rem; border: 0; border-radius: .5rem; background: var(--gray-100); color: var(--gray-800); font-size: .8125rem; font-weight: 500; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pcv-keys button:hover { background: var(--gray-200); }
.pcv-keys button.on { background: var(--brand-600); color: #fff; }
.pcv-keys .sep { flex: 0 0 1px; align-self: stretch; margin: .25rem .125rem; background: var(--border); }
/* On-screen QWERTY keyboard (phones / tablets) */
.pcv-vkb { flex-shrink: 0; display: flex; flex-direction: column; gap: .3125rem; padding: .375rem .25rem; padding-bottom: max(.375rem, env(safe-area-inset-bottom)); background: #d1d5db; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pcv-vkb[hidden] { display: none; }
.vkb-row { display: flex; gap: .25rem; }
.pcv-vkb button { flex: 1 1 0; min-width: 0; height: 2.625rem; padding: 0; border: 0; border-radius: .375rem; background: #fff; color: #111827; box-shadow: 0 1px 0 rgb(0 0 0 / .25); font: 500 1rem/1 var(--font, inherit); display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pcv-vkb button.down, .pcv-vkb button:active { background: #e5e7eb; }
.pcv-vkb .w15 { flex-grow: 1.5; } .pcv-vkb .w17 { flex-grow: 1.75; } .pcv-vkb .w2 { flex-grow: 2; } .pcv-vkb .w5 { flex-grow: 5; }
.pcv-vkb .mod, .pcv-vkb .caps, .pcv-vkb [data-v=Escape], .pcv-vkb [data-v=Tab], .pcv-vkb [data-v=Enter], .pcv-vkb [data-v=Backspace], .pcv-vkb [data-v=native], .pcv-vkb .rep { background: #aeb4bf; font-size: .8125rem; }
.pcv-vkb .mod.on, .pcv-vkb .caps.on { background: var(--brand-600); color: #fff; }
.pcv-vkb .s { display: none; }
.pcv-vkb.shift .n { display: none; } .pcv-vkb.shift .s { display: inline; }
.pcv-vkb.upper .ltr { text-transform: uppercase; }
@media (min-width: 900px) { .pcv-vkb { padding-left: 15%; padding-right: 15%; } }
.pcv-kbd { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; font-size: 16px; }   /* 16px: iOS does not zoom into it */
.pcv-sink { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.pcv-panel { position: absolute; top: .5rem; right: 4.25rem; bottom: .5rem; z-index: 5; width: min(21rem, calc(100% - 5rem)); display: flex; flex-direction: column; gap: .375rem; padding: .625rem; border-radius: .625rem; background: var(--surface); color: var(--gray-800); box-shadow: var(--shadow-lg), var(--ring); overflow: auto; }
.pcv.rail-hidden .pcv-panel { right: .5rem; width: min(21rem, calc(100% - 1rem)); }
.pcv-panel[hidden] { display: none; }
.pcv-clipbox { min-height: 5.5rem; resize: vertical; font-size: .8125rem; }
.pcvf-wrap { flex-wrap: wrap; }
.pcv-drop { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: .5rem; background: rgb(16 185 129 / .28);
  border: 2px dashed var(--brand-500); color: #fff; font-weight: 600; pointer-events: none; }
.pcv-drop[hidden] { display: none; }
@media (max-width: 640px) {
  .pcv-panel, .pcv.rail-hidden .pcv-panel { inset: 0; width: auto; border-radius: 0; padding-bottom: max(.625rem, env(safe-area-inset-bottom)); }
  .pcv-rail { width: 3.375rem; }
  .pcv-rail button { width: 3rem; }
}
.pcvf-head { display: flex; align-items: center; gap: .5rem; }
.pcvf-bar { display: flex; align-items: center; gap: .25rem; }
.pcvf-bar .input { flex: 1 1 auto; min-width: 0; font-size: .75rem; }
.pcvf-list { flex: 1 1 auto; min-height: 4rem; overflow: auto; list-style: none; margin: 0; padding: .25rem 0; border: 1px solid var(--border); border-radius: .5rem; }
.pcvf-list li { font-size: .8125rem; }
.pcvf-list li.muted, .pcvf-list li.text-red { padding: .5rem .625rem; }
.pcvf-item { display: flex; align-items: center; gap: .5rem; width: 100%; min-width: 0; padding: .3125rem .625rem; text-align: left; background: none; border: 0; cursor: pointer; color: var(--gray-700); }
.pcvf-item:hover { background: var(--gray-50); }
.pcvf-item .truncate { min-width: 0; }
.pcvf-foot { display: flex; gap: .375rem; }
.pcvf-xfers { display: flex; flex-direction: column; gap: .375rem; max-height: 35%; overflow: auto; }
.pcvf-xfer { padding: .375rem .5rem; border-radius: .5rem; background: var(--gray-50); font-size: .75rem; }
.pcvf-bar-track { height: 4px; margin: .25rem 0; border-radius: 9999px; background: var(--gray-200); overflow: hidden; }
.pcvf-bar-track i { display: block; height: 100%; width: 0; background: var(--brand-600); transition: width .2s; }

/* PCs page: pairing a PC (Add PC) and the old direct connections, folded away */
.pair-steps { margin: 0; padding-left: 1.25rem; list-style: decimal; display: flex; flex-direction: column; gap: .625rem; font-size: .875rem; color: var(--gray-700); }
.pair-addrs { display: inline-flex; flex-wrap: wrap; gap: .375rem; vertical-align: middle; }
.pair-chip { padding: .1875rem .5rem; border: 1px solid var(--border); border-radius: .375rem; background: var(--gray-50); color: var(--gray-800); font-size: .8125rem; cursor: pointer; }
.pair-chip:hover { border-color: var(--brand-400); background: var(--brand-50); }
.pair-code { padding: .375rem .75rem; border: 1px dashed var(--brand-400); border-radius: .5rem; background: var(--brand-50); color: var(--brand-800); font-size: 1.25rem; font-weight: 700; letter-spacing: .12em; cursor: pointer; }
.direct-box > summary { cursor: pointer; list-style: none; }
.direct-box > summary::-webkit-details-marker { display: none; }
.direct-box:not([open]) > summary { border-bottom: 0; }
.pair-chip.pub { border-color: var(--brand-400); }
.pub-row { gap: .5rem; flex-wrap: wrap; }
.pub-row > span:first-child { display: inline-flex; align-items: center; gap: .35rem; }

/* ─── Proxies page ─── */
.px-tabbar { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem .875rem; }
.px-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; flex: 1 1 22rem; min-width: 0; }
.px-tools .fb-search { flex: 1 1 13rem; min-width: 10rem; max-width: 24rem; }
.px-tools .fb-select { flex: 0 0 auto; width: auto; min-width: 8.5rem; }
.px-name { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.px-type { display: inline-flex; align-items: center; height: 1.125rem; padding: 0 .4375rem; border-radius: 9999px; background: var(--gray-100); color: var(--gray-600); font-size: .625rem; font-weight: 700; letter-spacing: .04em; }
.px-login { display: flex; align-items: center; gap: .25rem; }
.px-addr { margin-left: .5rem; font-size: .75rem; }
.px-select { min-width: 11rem; max-width: 16rem; }
.px-note { padding: 2.5rem 1rem; text-align: center; color: var(--gray-500); font-size: .875rem; }
.px-plan .table-wrap { max-height: 20rem; overflow: auto; }
.px-plan p { margin: .5rem 0 0; }
@media (max-width: 639px) { .px-tools { justify-content: stretch; } .px-tools .fb-search { max-width: none; flex-basis: 100%; } }
/* header of the Proxies page: PC picker + buttons stay on one row; on a phone the buttons keep only their icons */
.page-actions .px-pcsel { width: auto; min-width: 6.5rem; max-width: 12rem; flex: 0 1 auto; }
@media (max-width: 639px) { .page-actions .px-lbl { display: none; } .page-actions { flex-wrap: nowrap; } }

/* ─── Trends ─── */
.tr-body { padding: 1rem; }
.tr-country { width: auto; min-width: 9rem; }
.tr-meta { margin-bottom: .75rem; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: 1rem; align-items: start; }
.tr-src { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: .875rem 1rem; min-width: 0; }
.tr-src.tr-wide { grid-column: 1 / -1; }
.tr-src > header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .625rem; }
.tr-src h3 { font-size: .9375rem; font-weight: 600; color: var(--gray-900); margin: 0; }
.tr-list, .tr-news { list-style: none; margin: 0; padding: 0; }
.tr-list li { display: flex; align-items: flex-start; gap: .625rem; padding: .4375rem 0; border-top: 1px solid var(--border); }
.tr-list li:first-child, .tr-news li:first-child { border-top: 0; }
.tr-n { flex: 0 0 1.25rem; color: var(--gray-400); font-size: .75rem; font-variant-numeric: tabular-nums; padding-top: .125rem; }
.tr-main { flex: 1 1 auto; min-width: 0; }
.tr-term { color: var(--gray-900); font-weight: 500; font-size: .875rem; overflow-wrap: anywhere; text-decoration: none; }
a.tr-term:hover { color: var(--brand-600); text-decoration: underline; }
.tr-sub { margin-top: .125rem; overflow-wrap: anywhere; }
.tr-sub a { color: inherit; text-decoration: underline; text-decoration-color: var(--gray-300); }
.tr-val { flex: 0 0 auto; text-align: right; font-size: .75rem; color: var(--gray-600); font-variant-numeric: tabular-nums; max-width: 11rem; }
.tr-spark { display: block; width: 4.5rem; height: 1.25rem; margin: .125rem 0 0 auto; color: var(--brand-600); }
.tr-chart { display: block; width: 100%; height: 6.5rem; color: var(--brand-600); fill: var(--brand-500); }
.tr-spark .tr-chart { height: 1.25rem; }
.tr-axis { display: flex; justify-content: space-between; margin-top: .25rem; }
.tr-err { display: flex; gap: .375rem; align-items: flex-start; color: var(--red-600); font-size: .8125rem; margin: 0; }
.tr-news li { padding: .5rem 0; border-top: 1px solid var(--border); }
.tr-sum { color: var(--gray-600); margin-top: .125rem; overflow-wrap: anywhere; }
.tr-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.tr-chip { border: 1px solid var(--border); border-radius: 9999px; padding: .25rem .75rem; font-size: .8125rem; color: var(--gray-700); text-decoration: none; }
.tr-chip:hover { border-color: var(--brand-500); color: var(--brand-600); }
.tr-kwform { display: flex; gap: .5rem; align-items: center; }
.tr-url { overflow-wrap: anywhere; max-width: 28rem; }
.tr-latest { padding: 1rem 1rem 0; }
.tr-latest h3 { font-size: .9375rem; font-weight: 600; margin: 0 0 .5rem; }
.tr-pick { margin: .25rem .25rem 0 0; }
.tr-foot { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .tr-grid { grid-template-columns: minmax(0, 1fr); } .tr-body { padding: .75rem; } .tr-val { max-width: 8rem; } }
.tr-feedname { display: flex; align-items: center; gap: .375rem; }
.tr-ico { width: 1rem; height: 1rem; flex: 0 0 1rem; border-radius: .1875rem; object-fit: contain; }

.tr-saved { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.tr-bm { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.tr-bmbtn { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; align-items: center; text-align: left; padding: .5rem .625rem; border-radius: .5rem; border: 1px solid var(--border); background: var(--surface); }
.tr-bmbtn:hover { border-color: var(--gray-400); }
.tr-bmbtn.active { border-color: var(--brand-500); box-shadow: inset 0 0 0 1px var(--brand-500); }
.tr-bmq { font-weight: 500; color: var(--gray-900); overflow-wrap: anywhere; }
.tr-bmbtn .badge { grid-row: 1 / 3; grid-column: 2; }
.tr-detail { min-width: 0; }
.tr-dhead { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tr-dhead h3 { margin: 0; font-size: 1.125rem; }
.tr-dact { display: flex; gap: .375rem; align-items: center; flex-wrap: wrap; }
.tr-periods { width: fit-content; margin-bottom: .875rem; }
.tr-periods .seg-btn { flex: 0 0 auto; white-space: nowrap; }
.tr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .625rem; margin-bottom: .875rem; }
.tr-kpi { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .625rem .75rem; display: flex; flex-direction: column; gap: .125rem; }
.tr-kpi span { font-size: .75rem; color: var(--gray-500); }
.tr-kpi b { font-size: 1.5rem; line-height: 1.75rem; font-variant-numeric: tabular-nums; }
.tr-kpi b small { font-size: .75rem; color: var(--gray-400); font-weight: 500; }
.tr-kpi b.t-red { color: var(--red-600); } .tr-kpi b.t-amber { color: #b45309; }
.tr-kpi em { font-style: normal; font-size: .6875rem; color: var(--gray-500); }
.tr-kpi em.up { color: var(--emerald-600); } .tr-kpi em.down { color: var(--red-600); }
.tr-parts { display: grid; gap: .375rem; margin-bottom: 1rem; }
.tr-part { display: grid; grid-template-columns: 11rem 1fr 3.5rem; gap: .5rem; align-items: center; font-size: .8125rem; }
.tr-part em { grid-column: 2 / 4; font-style: normal; font-size: .6875rem; margin-top: -.25rem; }
.tr-part b small { color: var(--gray-400); font-weight: 500; }
.tr-bar { display: block; height: .5rem; border-radius: 9999px; background: var(--gray-100); overflow: hidden; }
.tr-bar u { display: block; height: 100%; background: var(--brand-600); text-decoration: none; }
.tr-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tr-charts h4, .tr-an-head + p + p + .tr-sent, .tr-h4, .tr-analysis h4, .tr-aibar h4 { font-size: .8125rem; font-weight: 600; margin: .75rem 0 .375rem; color: var(--gray-700); }
.tr-cv { position: relative; height: 13rem; }
.tr-aibox { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .75rem 1rem; }
.tr-aibar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .tr-aibar h4 { margin: 0 auto 0 0; }
.tr-prov { width: auto; }
.tr-an-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .5rem; }
.tr-an-sum { margin: .5rem 0; line-height: 1.5; font-size: .875rem; }
.tr-sent { display: flex; height: .875rem; border-radius: 9999px; overflow: hidden; background: var(--gray-100); }
.tr-sent i, .tr-sentl i { display: inline-block; } .tr-sent i { height: 100%; }
.s-p { background: var(--emerald-600, #059669); } .s-n { background: var(--gray-400); } .s-g { background: var(--red-500, #ef4444); }
.tr-sentl { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .375rem; } .tr-sentl i { width: .625rem; height: .625rem; border-radius: 50%; margin-right: .3rem; }
.tr-themes { margin: 0; padding-left: 1.1rem; display: grid; gap: .375rem; }
.tr-cav { margin: 0; padding-left: 1.1rem; }
.tr-hl { margin-top: .75rem; } .tr-hl summary { cursor: pointer; font-size: .8125rem; color: var(--gray-600); }
.tr-tone { display: inline-block; font-size: .625rem; font-weight: 600; padding: .0625rem .375rem; border-radius: 9999px; margin-right: .375rem; text-transform: uppercase; letter-spacing: .02em; }
.tr-tone.t-green { background: #d1fae5; color: #065f46; } .tr-tone.t-gray { background: var(--gray-100); color: var(--gray-600); } .tr-tone.t-red { background: #fee2e2; color: #991b1b; }
.tr-aikey { border: 1px solid var(--border); border-radius: .625rem; padding: .625rem .75rem; display: grid; gap: .375rem; }
.tr-aihead { display: flex; gap: .5rem; align-items: center; }
.tr-airow { display: grid; grid-template-columns: 1fr 11rem auto auto; gap: .375rem; }
@media (max-width: 820px) { .tr-saved { grid-template-columns: minmax(0, 1fr); } .tr-part { grid-template-columns: 8rem 1fr 3rem; } .tr-airow { grid-template-columns: minmax(0, 1fr); } }

/* ─── Trends: colours, loading, modern cards ─── */
.h-red { background: #ef4444; color: #fff; } .h-amber { background: #f59e0b; color: #fff; } .h-green { background: #10b981; color: #fff; } .h-gray { background: #9ca3af; color: #fff; }
.tr-heat { display: block; height: .3125rem; border-radius: 9999px; background: var(--gray-100); overflow: hidden; margin-top: .25rem; min-width: 4.5rem; }
.tr-heat u { display: block; height: 100%; border-radius: 9999px; text-decoration: none; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tr-bar u.h-red, .tr-bar u.h-amber, .tr-bar u.h-green, .tr-bar u.h-gray { transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tr-pill { display: inline-block; font-size: .6875rem; font-weight: 600; padding: .0625rem .4375rem; border-radius: 9999px; font-variant-numeric: tabular-nums; }
.tr-kpi b.t-green { color: #059669; } .tr-kpi b.t-gray { color: var(--gray-600); }
.tr-src { box-shadow: 0 1px 2px rgba(17,24,39,.04); transition: box-shadow .2s, transform .2s; }
.tr-src:hover { box-shadow: 0 6px 18px rgba(17,24,39,.08); }
.tr-n { background: var(--gray-100); border-radius: .375rem; text-align: center; padding: .125rem 0; font-weight: 600; }
.tr-list li:nth-child(-n+3) .tr-n { background: #fee2e2; color: #b91c1c; }
.tr-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tr-qlist li { display: grid; grid-template-columns: 1.5rem 1fr auto; column-gap: .5rem; align-items: center; }
.tr-qlist .tr-heat { grid-column: 2 / 4; margin-top: 0; }
.tr-qv { font-size: .75rem; font-variant-numeric: tabular-nums; }
.tr-cv-lg { height: 17rem; }
.tr-legend { display: flex; gap: 1rem; justify-content: flex-end; color: var(--gray-500); margin-top: .25rem; } .tr-legend i { display: inline-block; width: .625rem; height: .625rem; border-radius: 50%; margin-right: .3rem; }
.tr-range { width: auto; }
.tr-mhead { display: flex; flex-direction: column; gap: .25rem; padding: 0 0 .75rem; }
.tr-keyin { letter-spacing: .15em; }
.tr-airow-2 { grid-template-columns: 1fr auto auto; }
/* loading: a spinner and shimmering placeholders */
@keyframes tr-spin { to { transform: rotate(360deg); } }
@keyframes tr-shimmer { 0% { background-position: -30rem 0; } 100% { background-position: 30rem 0; } }
.tr-loading { display: flex; align-items: center; gap: .625rem; padding: 1rem; color: var(--gray-500); font-size: .875rem; }
.tr-spinner { width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2.5px solid var(--gray-200); border-top-color: var(--brand-600); animation: tr-spin .8s linear infinite; flex: 0 0 auto; }
.sk { display: block; height: .75rem; border-radius: .375rem; margin-top: .625rem; background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%); background-size: 60rem 100%; animation: tr-shimmer 1.4s linear infinite; }
.sk-h { height: 1rem; width: 45%; margin-top: 0; } .sk-s { width: 62%; }
.tr-skel { pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-top-color: #fff; animation: tr-spin .7s linear infinite; }
.btn-secondary.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--gray-300); border-top-color: var(--brand-600); }
@media (prefers-reduced-motion: reduce) { .tr-spinner, .sk, .btn.is-busy::after { animation-duration: 2.5s; } .tr-heat u { transition: none; } }
.tr-bar u.h-red { background: #ef4444; } .tr-bar u.h-amber { background: #f59e0b; } .tr-bar u.h-green { background: #10b981; } .tr-bar u.h-gray { background: #9ca3af; }
.tr-warn { display: flex; gap: .5rem; align-items: flex-start; background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: .5rem; padding: .5rem .75rem; font-size: .8125rem; margin: 0 0 .75rem; }
.tr-alerthelp { display: flex; gap: .5rem; align-items: flex-start; background: var(--gray-50); border: 1px solid var(--border); border-radius: .5rem; padding: .5rem .75rem; margin: .5rem 0 0; }
.tr-alerthelp a { color: var(--brand-600); text-decoration: underline; }
.tr-site td { background: var(--gray-50); }
.tr-sitebtn { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--gray-900); text-align: left; }
.tr-chev { display: inline-flex; transition: transform .2s; transform: rotate(-90deg); color: var(--gray-500); } .tr-chev.open { transform: rotate(0); }
.tr-count { background: var(--gray-200); color: var(--gray-700); }
.tr-cats { display: inline-flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.tr-child td:first-child { border-left: 3px solid var(--brand-500); }
.tr-child td:nth-child(2) { padding-left: 2.25rem; }
.tr-mtable .tr-chip { padding: .0625rem .5rem; font-size: .6875rem; }
.tr-mtable .tr-url { max-width: 16rem; } .tr-mtable td { vertical-align: middle; } .tr-mtable .tr-sitebtn b { white-space: nowrap; } .tr-count { white-space: nowrap; }
.tr-srclist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: .25rem 1.5rem; }
.tr-srclist li { display: flex; align-items: flex-start; gap: .625rem; padding: .4375rem 0; border-top: 1px solid var(--border); }
.tr-feeds { margin-top: .25rem; } .tr-feeds summary { cursor: pointer; font-size: .6875rem; color: var(--brand-600); }
.tr-feeds ul { list-style: none; margin: .25rem 0 0; padding: 0 0 0 .75rem; border-left: 2px solid var(--gray-200); display: grid; gap: .125rem; }
.tr-feeds li { display: flex; justify-content: space-between; gap: .75rem; font-size: .75rem; color: var(--gray-600); border: 0; padding: 0; }
.tr-feeds li b { color: var(--gray-900); font-variant-numeric: tabular-nums; }
.tr-kwfull { margin: 1rem 0; }
.tr-soc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 1rem; margin-bottom: .75rem; }
.tr-soc { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .75rem .875rem; min-width: 0; }
.tr-soc-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.tr-soclist { list-style: none; margin: .5rem 0 0; padding: 0; } .tr-soclist li { display: flex; gap: .625rem; padding: .4375rem 0; border-top: 1px solid var(--border); }
.tr-sparkbars { display: flex; align-items: flex-end; gap: 3px; height: 2.5rem; margin: .375rem 0; } .tr-sparkbars i { flex: 1; background: var(--brand-500); border-radius: 3px 3px 0 0; }
.intg { display: grid; gap: .5rem; } .intg-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .intg-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: .375rem; }
.intg-result { font-size: .75rem; } .intg-result.ok { color: var(--emerald-600); } .intg-result.bad { color: var(--red-600); }
@media (max-width: 640px) { .intg-row { grid-template-columns: 1fr; } }
/* ─── Places ─── */
.pl-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pl-form .fb-search { min-width: 14rem; flex: 1 1 14rem; } .pl-zoom { width: auto; }
.pl-star { color: #f59e0b; } .pl-count:not(:empty) { margin-left: .25rem; background: rgba(255,255,255,.22); border-radius: 9999px; padding: 0 .4rem; font-size: .6875rem; }
.pl-addr { max-width: 20rem; font-size: .8125rem; color: var(--gray-700); } .pl-wa { margin-left: .25rem; color: #16a34a; font-weight: 700; }
.pl-more { padding: .75rem 0 0; text-align: center; } .pl-export { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 .75rem; padding: .625rem .75rem; background: var(--gray-50); border: 1px solid var(--border); border-radius: .5rem; }
.pl-st, .pl-bst { width: auto; } .pl-note { background: none; border: 0; padding: 0; font: inherit; font-size: .8125rem; color: var(--gray-700); text-align: left; cursor: pointer; max-width: 14rem; overflow-wrap: anywhere; }
.pl-note:hover { text-decoration: underline; }
.pl-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 .625rem; } .pl-filters .input { width: auto; }
.pl-cat { display: inline-block; margin-top: .25rem; }
.pl-pick { cursor: pointer; border: 1px solid var(--border); background: var(--surface); } .pl-pick:hover { border-color: var(--brand-500); color: var(--brand-600); }

/* ─── equal-height cards, numbered single-line rows ─── */
.tr-grid { align-items: stretch; }
.tr-src { display: flex; flex-direction: column; }
.tr-rows { list-style: none; margin: 0; padding: 0; flex: 1; align-content: start; }
.tr-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; grid-template-rows: 1.375rem .875rem; column-gap: .5rem; align-items: center; height: 3rem; padding: .125rem 0; border-top: 1px solid var(--border); box-sizing: border-box; }
.tr-row:first-child { border-top: 0; }
.tr-row .tr-n { grid-row: 1 / 3; align-self: center; }
.tr-row .tr-rt { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 500; color: var(--gray-900); text-decoration: none; min-width: 0; }
a.tr-row .tr-rt:hover, .tr-row a.tr-rt:hover { color: var(--brand-600); text-decoration: underline; }
.tr-row .tr-rv { grid-column: 3; grid-row: 1; font-size: .75rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.tr-row .tr-b { grid-column: 2 / 4; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6875rem; color: var(--gray-500); }
.tr-row .tr-b .tr-heat { margin-top: .125rem; min-width: 0; }
.tr-qlist li, .tr-soclist li { border-top: 1px solid var(--border); }
.tr-soc { display: flex; flex-direction: column; } .tr-soc .tr-rows { margin-top: .5rem; }
/* the media list: the site with its icon, its feeds listed under it */
.tr-srclist li { align-items: flex-start; }
.tr-sitehead { display: flex; align-items: center; gap: .5rem; } .tr-sitehead .tr-ico { width: 1.125rem; height: 1.125rem; flex: 0 0 1.125rem; }
.tr-feeds { list-style: none; margin: .25rem 0 0; padding: 0 0 0 .75rem; border-left: 2px solid var(--gray-200); display: grid; gap: .125rem; }
.tr-feeds li { display: flex; justify-content: space-between; gap: .75rem; font-size: .75rem; color: var(--gray-600); border: 0; padding: 0; } .tr-feeds li b { color: var(--gray-900); font-variant-numeric: tabular-nums; }
/* Places: a bar of equal fields, sortable headers, numeric columns */
.pl-bar { padding: .875rem 1rem 0; }
.pl-bar .pl-form { display: grid; grid-template-columns: minmax(12rem, 1.4fr) minmax(12rem, 1.4fr) minmax(11rem, 1fr) auto; gap: .5rem; align-items: center; }
.pl-bar-grid, .pl-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .5rem; align-items: center; }
.pl-bar .input, .pl-filters .input { width: 100%; height: 2.375rem; padding-top: 0; padding-bottom: 0; }
.pl-bar .fb-search { min-width: 0; } .pl-bar .btn { height: 2.375rem; }
.pl-showing { grid-column: 1 / -1; }
.pl-th { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.pl-th:hover, .pl-th.on { color: var(--brand-600); } .pl-arrow { font-size: .75rem; opacity: .7; }
.pl-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .pl-table th:nth-child(4) { text-align: right; }
@media (max-width: 820px) { .pl-bar .pl-form { grid-template-columns: 1fr 1fr; } }

/* Places tables: one tidy line per field, rows of an even height */
.pl-bar-grid, .pl-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 820px) { .pl-bar-grid, .pl-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pl-table td { vertical-align: middle; }
.pl-table td:nth-child(2) { max-width: 16rem; }
.pl-table .font-medium { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-table td .text-11 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-table .mono { white-space: nowrap; }
.pl-addr { max-width: 18rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
td.pl-addr { display: table-cell; } td.pl-addr { overflow: hidden; text-overflow: ellipsis; }
.pl-addr { line-height: 1.3; max-height: 2.8em; }
.pl-cat { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; margin-top: .25rem; }
.pl-note { display: block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-st { min-width: 8.5rem; }
/* the articles of a site: hide / show, a limited height that scrolls */
.tr-arts { margin-top: .375rem; } .tr-arts summary { cursor: pointer; font-size: .75rem; color: var(--brand-600); user-select: none; }
.tr-artlist { list-style: none; margin: .375rem 0 0; padding: 0 .5rem 0 .75rem; border-left: 2px solid var(--gray-200); max-height: 13rem; overflow-y: auto; display: block; }
.tr-artlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: baseline; padding: .3125rem 0; border-top: 1px solid var(--border); font-size: .8125rem; }
.tr-artlist li:first-child { border-top: 0; }
.tr-artt { color: var(--gray-900); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } .tr-artt:hover { color: var(--brand-600); text-decoration: underline; }
.tr-artm { font-size: .6875rem; color: var(--gray-500); white-space: nowrap; }

/* ─── phone layout of Trends / Places (≤ 640 px) ─── */
@media (max-width: 640px) {
  .px-tabbar { align-items: stretch; } .px-tabbar .px-tools { width: 100%; }
  .tr-kwform { flex-wrap: wrap; width: 100%; gap: .5rem; }
  .tr-kwform .fb-search { flex: 1 1 100%; min-width: 0; }
  .tr-kwform .tr-range { flex: 1 1 100%; width: 100%; }
  .tr-kwform .btn { flex: 1 1 0; min-width: 0; justify-content: center; }
  .tr-body { padding: .75rem; }
  /* something to tap: at least 40 px high */
  .tr-body .btn-sm, .pl-table .btn-sm, .bulkbar .btn-sm, .pl-export .btn-sm, .pl-bar .btn-sm, .tr-kwform .btn-sm, .tr-body .input-sm, .bulkbar .input-sm, .pl-table .input-sm, .intg .btn-sm { min-height: 2.5rem; }
  .pl-table .pl-wa { min-width: 2.75rem; justify-content: center; }
  .pl-bar { padding: .75rem .75rem 0; } .pl-bar .pl-form { grid-template-columns: 1fr; }
  .pl-export { gap: .5rem; } .pl-export .btn { flex: 1 1 100%; justify-content: center; }
  .bulkbar { flex-wrap: wrap; gap: .5rem; }
  .pl-st { width: 100%; }
  .tr-chips { gap: .5rem; }
  .tr-srclist li { gap: .5rem; } .tr-srclist .tr-main { min-width: 0; flex: 1 1 0; } .tr-srclist .tr-val { flex: 0 0 auto; max-width: 6rem; } .tr-srclist .tr-heat { min-width: 0; }
  .tr-artlist { padding-right: .25rem; }
}
