/* bidauction24 Office. Same visual language as the site's sign-in page:
   neutral brand, teal accent, light + dark themes via :root[data-theme]. */
:root,
:root[data-theme="light"] {
  --bg-side:#f4f8f7; --bg-main:#ffffff; --text:#1f2937; --text-sub:#6b7280; --label:#4b5563;
  --border:#d1d5db; --border-focus:#0d9488; --accent:#0d9488; --accent-hover:#0f766e; --err:#dc2626;
  --toggle-bg:#f3f4f6; --divider:#e5e7eb; --focus-ring:rgba(13,148,136,.18);
  --side-grad:linear-gradient(160deg,#f0fbf8 0%,#f4f8f7 52%,#e8f5f2 100%); --side-glow:rgba(13,148,136,.14);
  --brand-fg:#0f172a; --card-bg:#ffffff; --card-hover:#f7fdfc;
  --card-border:#e5e7eb; --card-shadow:0 1px 2px rgba(15,23,42,.04), 0 2px 8px -4px rgba(15,23,42,.08);
  --card-shadow-hover:0 10px 28px -12px rgba(13,148,136,.38), 0 2px 6px -2px rgba(15,23,42,.08);
  --tile-bg:#ffffff; --tile-border:rgba(15,23,42,.09); --chip-bg:#f3f4f6; --ok:#10b981;
  --err-bg:#fef2f2; --err-bd:#fecaca; --err-ring:rgba(220,38,38,.14); --warn:#b45309; --warn-bg:#fffbeb; --warn-bd:#fde68a;
  --side-glow2:rgba(13,148,136,.10); --side-accent2:#0e7490; --side-line:rgba(15,23,42,.08); --side-dot:rgba(15,23,42,.10); --side-art:rgba(13,148,136,.30);
  --side-chip-bg:#ffffff; --side-chip-border:rgba(13,148,136,.18); --side-chip-shadow:0 1px 2px rgba(15,23,42,.04), 0 4px 12px -6px rgba(13,148,136,.25);
  /* office additions */
  --ok-fg:#047857; --info:#2563eb; --info-fg:#1d4ed8; --line:#edf0f2; --thead-bg:#f8fafa; --row-hover:#f6fbfa;
  --nav-hover:#eef2f4; --nav-on:#d9f1ed; --nav-on-fg:#0b6b63;
  --accent-soft:rgba(13,148,136,.10); --sk:#eceff1; --sk-hi:#f7f8f9; --backdrop:rgba(15,23,42,.42);
  --dlg-shadow:0 24px 60px -20px rgba(15,23,42,.35), 0 4px 14px -6px rgba(15,23,42,.18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-side:#0f1419; --bg-main:#1a1f29; --text:#e5e7eb; --text-sub:#9ca3af; --label:#9ca3af;
  --border:#374151; --border-focus:#14b8a6; --accent:#14b8a6; --accent-hover:#0d9488; --err:#f87171;
  --toggle-bg:#262d3a; --divider:#1f2937; --focus-ring:rgba(20,184,166,.25);
  --side-grad:linear-gradient(160deg,#0d1a1a 0%,#0f1419 52%,#101f1e 100%); --side-glow:rgba(20,184,166,.16);
  --brand-fg:#f1f5f9; --card-bg:#1f2531; --card-hover:#1d2b30;
  --card-border:#2d3544; --card-shadow:0 1px 2px rgba(0,0,0,.25);
  --card-shadow-hover:0 12px 30px -12px rgba(20,184,166,.35), 0 2px 6px -2px rgba(0,0,0,.4);
  --tile-bg:#f4f6f8; --tile-border:rgba(255,255,255,.06); --chip-bg:#262d3a; --ok:#34d399;
  --err-bg:rgba(248,113,113,.10); --err-bd:rgba(248,113,113,.32); --err-ring:rgba(248,113,113,.20); --warn:#fbbf24; --warn-bg:rgba(251,191,36,.09); --warn-bd:rgba(251,191,36,.30);
  --side-glow2:rgba(20,184,166,.08); --side-accent2:#5eead4; --side-line:rgba(255,255,255,.07); --side-dot:rgba(255,255,255,.07); --side-art:rgba(20,184,166,.24);
  --side-chip-bg:rgba(20,184,166,.08); --side-chip-border:rgba(20,184,166,.22); --side-chip-shadow:none;
  /* office additions */
  --ok-fg:#34d399; --info:#60a5fa; --info-fg:#93c5fd; --line:#293040; --thead-bg:#1b212c; --row-hover:#232b38;
  --nav-hover:#262e3b; --nav-on:#143a3a; --nav-on-fg:#5eead4;
  --accent-soft:rgba(20,184,166,.13); --sk:#2a3140; --sk-hi:#343c4d; --backdrop:rgba(3,7,12,.62);
  --dlg-shadow:0 24px 60px -20px rgba(0,0,0,.7), 0 4px 14px -6px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.45;
  background: var(--bg-side); color: var(--text); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.skip:focus { top: 12px; }
.muted { color: var(--text-sub); }
.nowrap { white-space: nowrap; }
/* icons: Ant Design outlined glyphs, filled, sized by the font size unless a rule below gives them a size */
.ai { width: 1em; height: 1em; flex: none; fill: currentColor; vertical-align: -.125em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .01em; }

/* ---------- wordmark ---------- */
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.brand-name { font-size: 18px; font-weight: 700; line-height: 1.15; letter-spacing: -.035em; color: var(--brand-fg); white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--accent); }
.wordmark-tag { font-size: 11px; font-weight: 600; line-height: 1.1; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.wordmark-lg .brand-name { font-size: 22px; }
.ro-tag {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 3px 9px 3px 7px; align-self: flex-start;
  border: 1px dashed var(--border); border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--text-sub); cursor: help;
}
.ro-tag svg { width: 13px; height: 13px; opacity: .85; }

/* ---------- shared controls (from the sign-in page) ---------- */
.theme-toggle {
  width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: var(--toggle-bg); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, border-color .15s; padding: 0;
}
.theme-toggle:hover { border-color: var(--text-sub); }
.theme-toggle svg { width: 17px; height: 17px; }
/* the button shows what it switches to: the moon in the light theme, the sun in the dark one */
.theme-toggle .ai-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ai-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ai-moon { display: none; }

h1 { font-size: 27px; font-weight: 700; letter-spacing: -.025em; color: var(--text); }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--label); }
.field { margin-bottom: 18px; }
input {
  width: 100%; padding: 11px 13px; background: var(--bg-main); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }

/* select: a trigger that looks and focuses exactly like a text input, and a list in our card style */
.sel { position: relative; display: block; min-width: 0; }
.sel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 36px 11px 13px; background: var(--bg-main); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font: inherit; font-size: 14px; line-height: normal; text-align: left; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s;
}
.sel-btn:hover { border-color: var(--text-sub); }
.sel-btn:focus, .sel-btn:focus-visible, .sel-btn[aria-expanded="true"] { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.sel-btn[aria-invalid="true"], .sel-btn[aria-invalid="true"]:focus { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-ring); }
.sel-btn:disabled { opacity: .7; cursor: default; border-color: var(--border); }
.sel-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-note { flex: none; display: inline-flex; }
.sel-note:empty { display: none; }
.sel-btn > .ai { position: absolute; right: 13px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; color: var(--text-sub); transition: transform .15s; }
.sel-btn[aria-expanded="true"] > .ai { transform: rotate(180deg); color: var(--accent); }
.sel-pop {
  position: fixed; z-index: 60; padding: 4px; border: 1px solid var(--card-border); border-radius: 10px; background: var(--bg-main);
  box-shadow: var(--dlg-shadow); animation: err-in .12s ease-out;
}
.sel-list { margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.sel-opt {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 6px; font-size: 13.5px; color: var(--text);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.sel-opt-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sel-opt-note { flex: none; display: inline-flex; }
.sel-opt > .ai { flex: none; width: 13px; height: 13px; margin-left: auto; padding-left: 0; color: var(--accent); }
.sel-opt-note + .ai, .sel-opt-text + .ai { margin-left: auto; }
.sel-opt.is-active { background: var(--nav-on); }
.sel-opt.is-selected { color: var(--nav-on-fg); font-weight: 600; }
.sel-opt.is-disabled { color: var(--text-sub); opacity: .6; cursor: default; }
input::placeholder { color: var(--text-sub); opacity: .8; }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer;
  color: var(--text-sub); padding: 6px; display: flex; border-radius: 4px;
}
.pwd-toggle:hover, .pwd-toggle[aria-pressed="true"] { color: var(--text); }
.pwd-toggle svg { width: 18px; height: 18px; }

button.submit {
  width: 100%; padding: 12px; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, box-shadow .15s, opacity .15s;
}
button.submit:hover { background: var(--accent-hover); }
button.submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring), 0 0 0 1px var(--bg-main) inset; }
button.submit:disabled { opacity: .75; cursor: progress; }
.spinner {
  display: none; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
button.submit.loading .spinner { display: block; }
.spinner-accent { display: block; border-color: var(--divider); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-main); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--text-sub); }
.btn:disabled { opacity: .5; cursor: default; border-color: var(--border); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: var(--chip-bg); border-color: transparent; color: var(--text); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--text-sub); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--chip-bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }

/* error / notice box */
.err {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--err-bd); background: var(--err-bg); color: var(--err); font-size: 13.5px; line-height: 1.4;
  animation: err-in .22s ease-out;
}
.err:empty { display: none; }
.err svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.err-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.err-text strong { font-weight: 600; }
.err-text span { color: var(--text-sub); font-size: 12.5px; }
.err-warn { color: var(--warn); border-color: var(--warn-bd); background: var(--warn-bg); }
.err-info { color: var(--text-sub); border-color: var(--card-border); background: var(--chip-bg); }
.err-info strong { color: var(--text); }
input[aria-invalid="true"], input[aria-invalid="true"]:focus { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-ring); }
form.shake .field { animation: shake .36s cubic-bezier(.36,.07,.19,.97); }
@keyframes err-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.who {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; max-width: 100%;
  border: 1px solid var(--card-border); border-radius: 999px; background: var(--card-bg); font-size: 12.5px; color: var(--text-sub); white-space: nowrap;
}
.who strong { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who-dot { width: 7px; height: 7px; flex: none; margin-right: 2px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }

.logo-tile {
  width: 84px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px;
  border-radius: 10px; background: var(--tile-bg); border: 1px solid var(--tile-border);
}
.logo-tile img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-fallback {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-color: transparent; color: #fff;
  font-size: 20px; font-weight: 700; text-transform: uppercase;
}
.logo-sm { width: 46px; height: 24px; padding: 3px 6px; border-radius: 6px; }
.logo-sm.logo-fallback { font-size: 12px; }
.logo-off { filter: grayscale(1); opacity: .5; }

/* ---------- boot + sign-in ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot .spinner { width: 22px; height: 22px; }
.noscript { margin: 16px; }
/* Sign-in: the split layout of the market's public sign-in page. Brand side on the left (brand on top, headline
   and points in the middle, footer at the bottom), the form on the right.
   Decoration of the brand side = soft glows (::before) + masked dot grid (::after) + ring line-art (.side-art). */
.signin { display: flex; min-height: 100vh; background: var(--bg-main); }
.side {
  flex: 1; position: relative; display: flex; justify-content: center; padding: 44px 48px;
  background: var(--bg-side); background-image: var(--side-grad); border-right: 1px solid var(--divider); overflow: hidden;
}
.side::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px circle at -6% 108%, var(--side-glow) 0%, transparent 70%),
    radial-gradient(460px circle at 92% 8%, var(--side-glow2) 0%, transparent 70%);
}
.side::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--side-dot) 1px, transparent 1.6px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 30% 42%, #000 0%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 55% at 30% 42%, #000 0%, transparent 100%);
}
.side-art {
  position: absolute; right: -40px; top: -40px; width: min(560px, 88%); height: auto; aspect-ratio: 1; color: var(--side-art); pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 20%, transparent 62%);
          mask-image: radial-gradient(circle at 100% 0, #000 20%, transparent 62%);
}
.side-inner { position: relative; z-index: 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; }
.side-inner > .wordmark { align-self: flex-start; }
.side-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; }
.side-eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.side-eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: currentColor; opacity: .85; }
.side-title { font-size: 34px; line-height: 1.16; font-weight: 700; letter-spacing: -.03em; color: var(--brand-fg); text-wrap: balance; }
.side-title em {
  display: block; font-style: normal; color: var(--accent);
  background: linear-gradient(90deg, var(--accent), var(--side-accent2)); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.side-tag { margin: 16px 0 32px; font-size: 15px; line-height: 1.6; color: var(--text-sub); text-wrap: pretty; }
.side-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.side-points li { display: flex; align-items: flex-start; gap: 14px; }
.side-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--side-chip-bg); border: 1px solid var(--side-chip-border); color: var(--accent); box-shadow: var(--side-chip-shadow);
}
.side-ico .ai { width: 18px; height: 18px; }
.side-pt { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; font-size: 13.5px; line-height: 1.5; color: var(--text-sub); text-wrap: pretty; }
.side-pt strong { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; color: var(--brand-fg); }
.side-foot {
  padding-top: 20px; border-top: 1px solid var(--side-line); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 12.5px; color: var(--text-sub);
}
.side-foot-lock { display: inline-flex; align-items: center; gap: 6px; }
.side-foot-lock .ai { width: 13px; height: 13px; opacity: .8; }
@media (max-height: 760px) {
  .side { padding-top: 36px; padding-bottom: 32px; }
  .side-body { padding: 32px 0; }
  .side-title { font-size: 30px; }
  .side-tag { margin-bottom: 24px; }
  .side-points { gap: 14px; }
}
/* side-art motion: dots orbit along the rings, two dashed rings turn slowly.
   All rings share the centre (600,0) = the art's top-right corner. */
.side-art .spin, .side-art .orbit { transform-box: view-box; transform-origin: 600px 0; animation: side-spin 60s linear infinite; }
.side-art .spin-a { animation-duration: 120s; }
.side-art .spin-b { animation-duration: 180s; animation-direction: reverse; }
.side-art .o1 { animation-duration: 36s; }
.side-art .o2 { animation-duration: 64s; animation-direction: reverse; }
.side-art .o3 { animation-duration: 96s; }
@keyframes side-spin { to { transform: rotate(360deg); } }

/* form side */
.signin-main { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 24px; background: var(--bg-main); }
.signin-panel { width: 100%; max-width: 380px; }
.signin-brand { display: none; margin-bottom: 26px; }
.signin-theme { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; }
.signin-panel h1 { margin-bottom: 8px; }
.sub { margin: 0 0 24px; font-size: 14px; line-height: 1.5; color: var(--text-sub); }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 0 12px 16px;
  background: var(--bg-main); border-right: 1px solid var(--card-border); box-shadow: 1px 0 0 rgba(15,23,42,.02), 6px 0 18px -14px rgba(15,23,42,.18);
  overflow-y: auto; z-index: 1;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 61px; margin: 0 -12px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--divider); }
.sidebar-close { display: none; }
.sidebar .ro-tag { margin: 12px 8px 0; }
/* the menu: full-contrast items in labelled groups, the open section clearly marked */
.nav { display: flex; flex-direction: column; margin-top: 12px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label { padding: 0 12px 5px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-sub); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 9px;
  color: var(--text); font-size: 14.5px; font-weight: 500; letter-spacing: -.005em; transition: background .15s, color .15s;
}
.nav-link .ai { width: 17px; height: 17px; color: var(--label); transition: color .15s; }
.nav-link:hover { background: var(--nav-hover); text-decoration: none; }
.nav-link:hover .ai { color: var(--text); }
.nav-link[aria-current="page"] { background: var(--nav-on); color: var(--nav-on-fg); font-weight: 650; }
.nav-link[aria-current="page"] .ai { color: var(--nav-on-fg); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 14px 4px 0; display: none; }
.scrim { position: fixed; inset: 0; z-index: 39; background: var(--backdrop); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 61px; padding: 9px 24px;
  background: color-mix(in srgb, var(--bg-main) 92%, transparent); border-bottom: 1px solid var(--divider);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
}
.menu-btn, .topbar-wordmark { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
/* account control: avatar, login and chevron in one pill; a small menu under it */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 4px; border: 1px solid var(--card-border); border-radius: 999px;
  background: var(--card-bg); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { background: var(--nav-hover); border-color: var(--border); }
.acct-avatar {
  width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--nav-on); color: var(--nav-on-fg); font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.acct-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn > .ai { width: 10px; height: 10px; color: var(--text-sub); transition: transform .15s; }
.acct-btn[aria-expanded="true"] > .ai { transform: rotate(180deg); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 252px; padding: 6px; border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--bg-main); box-shadow: var(--dlg-shadow); animation: err-in .14s ease-out; overflow-y: auto; overscroll-behavior: contain;
}
.acct-who { padding: 6px 10px 8px; font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-who strong { color: var(--text); font-weight: 600; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 4px 10px; font-size: 13.5px; font-weight: 500; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--card-border); border-radius: 9px; background: var(--chip-bg); }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text-sub); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-checked="true"] { background: var(--accent); color: #fff; }
.seg-btn .ai { width: 14px; height: 14px; }
label.with-icon { display: flex; align-items: center; gap: 5px; }
label.with-icon .ai { width: 13px; height: 13px; color: var(--text-sub); }
.badge[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-sep { height: 1px; margin: 6px 0; background: var(--line); }
.acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.acct-item:hover, .acct-item:focus-visible { background: var(--nav-hover); }
.acct-item .ai { width: 15px; height: 15px; color: var(--label); }

/* platform filter: segmented control */
.pf-scroll { position: relative; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.pf-scroll::-webkit-scrollbar { display: none; }
.pf { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 11px; background: var(--chip-bg); border: 1px solid var(--card-border); }
.pf-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 5px; border: 0; border-radius: 8px; background: none;
  color: var(--text-sub); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.pf-chip svg { width: 16px; height: 16px; margin-left: 6px; }
button.pf-chip:hover { color: var(--text); }
.pf-chip[aria-pressed="true"] { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.10), 0 0 0 1px var(--card-border); }
.pf-chip[aria-pressed="true"] svg { color: var(--accent); }
.pf-off { cursor: default; padding-right: 5px; }
.pf-off .pf-name { opacity: .75; font-weight: 500; }
.pf-off.is-current { background: var(--card-bg); box-shadow: 0 0 0 1px var(--card-border); }
.pf-status { padding: 3px 9px; border-radius: 999px; border: 1px dashed var(--border); font-size: 11.5px; font-weight: 500; color: var(--text-sub); }
.pf-status.is-warn { border-style: solid; border-color: var(--warn-bd); background: var(--warn-bg); color: var(--warn); }
.pf-connect {
  height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft);
  color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.pf-connect:hover { background: var(--accent); color: #fff; }

/* ---------- view ---------- */
.view { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 26px 24px 48px; outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.view-head > div { min-width: 0; }
.view-head h1 { font-size: 23px; }
.panel { position: relative; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-bg); box-shadow: var(--card-shadow); overflow: hidden; }
.panel + .panel, .cards + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; }
.search input { padding: 8px 12px 8px 33px; border-radius: 8px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.select-wrap { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.select-wrap label { margin: 0; font-size: 12.5px; }
.select-wrap .sel-btn { min-width: 168px; padding: 8px 34px 8px 12px; border-radius: 8px; }
.toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.count { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.count strong { color: var(--text); font-weight: 600; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap; max-width: 100%;
}
.fchip span { overflow: hidden; text-overflow: ellipsis; }
.fchip button { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.fchip button:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fchip svg { width: 13px; height: 13px; }

.notices { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notices:empty { display: none; }
.notice { margin: 0; padding: 8px 12px; align-items: center; font-size: 13px; animation: none; }
.notice svg { margin-top: 0; }
.notice .err-text { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.notice .err-text strong { font-weight: 500; }
.notice .btn { margin-left: auto; }

/* ---------- tables ---------- */
/* position: relative keeps the visually hidden labels inside the scroll box */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; transition: opacity .15s; }
.table-wrap.is-loading { opacity: .5; pointer-events: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.tbl th {
  padding: 9px 12px; text-align: left; white-space: nowrap; background: var(--thead-bg); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .wrap { white-space: normal; min-width: 180px; max-width: 320px; }
.tbl .strong { font-weight: 600; color: var(--text); }
.tbl .col-pf { width: 1%; }
.cell-2 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badges { display: flex; align-items: center; gap: 6px; }
.cell-sub.cell-sub-1 { display: block; max-width: 230px; white-space: nowrap; text-overflow: ellipsis; }
.cell-sub:not(.cell-sub-1) { min-width: 190px; }
.cell-sub { max-width: 290px; font-size: 12px; line-height: 1.35; color: var(--text-sub); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot-empty { color: var(--text-sub); opacity: .55; }
.cur { margin-left: 5px; font-size: 11px; font-weight: 600; color: var(--text-sub); letter-spacing: .03em; }
.cur-alt { color: var(--info-fg); }
.t-err-text { color: var(--err); font-weight: 600; }
.t-warn-text { color: var(--warn); font-weight: 600; }
.t-ok-text { color: var(--ok-fg); font-weight: 600; }
time { font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; background: var(--chip-bg); color: var(--text-sub);
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge svg { width: 12px; height: 12px; }
.tag .ai { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }

/* tooltip */
.tip {
  position: fixed; z-index: 80; max-width: min(320px, calc(100vw - 12px)); padding: 6px 9px; border-radius: 7px; background: #111827; color: #f9fafb;
  font-size: 12px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none; text-align: left; white-space: pre-line; overflow-wrap: anywhere;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); pointer-events: none; animation: tip-in .12s ease-out;
}
:root[data-theme="dark"] .tip { background: #e5e7eb; color: #111827; }
@keyframes tip-in { from { opacity: 0; } }
.has-tip { text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 3px; cursor: help; }
.tbl th[data-tip] { cursor: help; }
.tag[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.t-ok { color: var(--ok-fg); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.t-err { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }
.t-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.t-info { color: var(--info-fg); background: color-mix(in srgb, var(--info) 13%, transparent); }
.t-accent { color: var(--accent); background: var(--accent-soft); }

/* health summary lines under a master's session: "1252m", "www: authed $", "src: scrape.do" */
.sline { display: block; font-size: 11.5px; line-height: 1.4; color: var(--text-sub); white-space: nowrap; }

/* rows with details open them in a dialog: the whole row is the target, plus a small button at its end */
.tbl tbody tr.is-clickable { cursor: pointer; }
.tbl tbody tr.is-clickable a, .tbl tbody tr.is-clickable button, .tbl tbody tr.is-clickable summary { cursor: pointer; }
.tbl .col-acts { width: 1%; }
.h-short { display: none; }
/* the wrapper is a size container: the masters table switches to its tight form by the card width */
.table-wrap { container-type: inline-size; }
.dpanel { padding: 2px 0 10px; }
.tags.tags-row { flex-direction: row; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.dgroup-note { margin-top: 10px; font-size: 12px; color: var(--text-sub); }
.tags-end { align-items: flex-end; }
.tags-label { font-size: 12px; font-weight: 600; color: var(--text-sub); align-self: center; }
.tags-row > .tags { flex-direction: row; gap: 5px 10px; }
.twofa-part { display: inline-flex; align-items: center; gap: 5px; }
.dgroup + .dgroup { margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dgroup-title { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 22px; margin: 0; }
.ditem { min-width: 0; }
.ditem-wide { grid-column: 1 / -1; }
.ditem dt { font-size: 11.5px; line-height: 1.35; color: var(--text-sub); }
.ditem dd { margin: 1px 0 0; font-size: 13px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }
.ditem dd.t-ok-text, .ditem dd.t-warn-text, .ditem dd.t-err-text { font-weight: 500; }
.ditem dd.t-ok-text { color: var(--ok-fg); } .ditem dd.t-warn-text { color: var(--warn); } .ditem dd.t-err-text { color: var(--err); }
.ditem-exact { color: var(--text-sub); font-size: 12px; font-weight: 400; white-space: nowrap; }

/* masters: eleven columns of the product office pages plus the expander, kept inside the card */
.tbl-masters th { padding: 8px; white-space: normal; line-height: 1.25; vertical-align: bottom; letter-spacing: .04em; }
.tbl-masters td { padding: 9px 8px; vertical-align: top; }
.tbl-masters .badges { flex-wrap: wrap; gap: 3px 6px; }
.tbl-masters .col-name { white-space: normal; }
.tbl-masters .col-name .cell-2 { min-width: 124px; }
.tbl-masters .cell-sub:not(.cell-sub-1) { min-width: 0; max-width: 250px; -webkit-line-clamp: 3; }
.tbl-masters .cell-1 { display: block; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-masters .col-session { white-space: normal; }
.tbl-masters .col-session .tags { flex-direction: row; flex-wrap: wrap; gap: 3px 4px; width: 236px; max-width: 100%; }
.tbl-masters .col-session .tag { max-width: 100%; }
.tbl-masters .col-transport .tag { max-width: 150px; }
.tbl-masters td.col-acts { padding-top: 5px; padding-bottom: 5px; }
/* tight (any window narrower than about 1780px with the sidebar): shorter headers (the full ones stay for
   screen readers and as tooltips), slimmer gutters */
@container (max-width: 1500px) {
  .tbl-masters { font-size: 12.5px; }
  .tbl-masters th, .tbl-masters td { padding-left: 4px; padding-right: 4px; }
  .tbl-masters .cell-1 { max-width: 206px; }
  .tbl-masters .acts { gap: 0; }
  .tbl-masters .col-last { white-space: normal; }
  .tbl-masters .tag .ai { margin-right: 3px; }
  .tbl-masters th:first-child, .tbl-masters td:first-child { padding-left: 12px; }
  .tbl-masters th:last-child, .tbl-masters td:last-child { padding-right: 10px; }
  .tbl-masters .act { width: 22px; height: 24px; }
  .tbl-masters .tag { padding: 0 5px; font-size: 11px; }
  .tbl-masters .col-session .tags { width: 164px; }
  .tbl-masters .col-transport .tag { max-width: 112px; }
  .tbl-masters .logo-sm { width: 36px; height: 20px; padding: 3px 4px; }
  .tbl-masters .col-name .cell-2 { min-width: 112px; }
  .tbl-masters .h-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .tbl-masters .h-short { display: inline; }
  .tbl-masters .badge { padding: 2px 7px; }
}
@container (max-width: 1040px) {
  .tbl-masters .cell-1 { max-width: 150px; }
  .tbl-masters .col-name .cell-2 { min-width: 104px; }
  .tbl-masters .col-session .tags { width: 190px; }
}

/* sub-accounts: one row per login, a column per platform, row actions */
.tbl-subs th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.tbl-subs th.col-acc { vertical-align: middle; }
.tbl-subs th, .tbl-subs td { padding-left: 8px; padding-right: 8px; }
.tbl-subs .col-text { white-space: normal; overflow-wrap: anywhere; min-width: 92px; max-width: 200px; }
.tbl-subs .cell-sub { min-width: 0; max-width: 200px; }
.tbl-subs .col-acc .cell-2 { gap: 4px; }
.tbl-subs .col-acc .badges { flex-wrap: wrap; gap: 3px 5px; }
.tbl-subs a.tag:hover { text-decoration: none; filter: brightness(.94); }
.tbl-subs a.badge:hover { text-decoration: none; filter: brightness(.94); }
.acts { display: inline-flex; align-items: center; gap: 2px; }
.acts .btn { margin-left: 4px; }
.act {
  width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--text-sub); cursor: pointer; transition: background .15s, color .15s;
}
.act:hover { background: var(--chip-bg); color: var(--accent); text-decoration: none; }
.act:disabled { opacity: .45; cursor: progress; }
.act svg { width: 15px; height: 15px; }
.col-acc .act { width: 24px; height: 24px; margin: -2px 0; }
.dgroup-title .logo-tile { margin-right: 8px; vertical-align: middle; }
.dgroup-title span:not(.logo-tile) { vertical-align: middle; }
.view-head .btn { flex: none; }
.view-head .btn svg { width: 16px; height: 16px; }

/* egress IPs of a master, listed in a dialog */
.ip-list { margin: 0; padding: 0 0 6px; list-style: none; }
.ip-list li { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.ip-list li:last-child { border-bottom: 0; }
.ip-addr { font-size: 13px; color: var(--text); }
.ip-label { font-size: 12.5px; color: var(--text-sub); }
.ip-list .act { margin-left: auto; }
.act.is-done, .btn.is-done { color: var(--ok-fg); }
button.tag-btn { min-width: 30px; padding: 0 9px; border-radius: 999px; text-align: center; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button.tag-btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); }
.pager-info { font-size: 12.5px; color: var(--text-sub); }
.pager-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pager-page { min-width: 92px; text-align: center; font-size: 12.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.pager-page strong { color: var(--text); font-weight: 600; }

/* empty / error / loading states */
.state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 54px 20px 58px; text-align: center; }
.state-ico { width: 46px; height: 46px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--chip-bg); color: var(--text-sub); }
.state-ico svg { width: 21px; height: 21px; }
.state-err .state-ico { background: var(--err-bg); color: var(--err); }
.state-ok .state-ico { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok-fg); }
.state-title { font-size: 15px; font-weight: 650; color: var(--text); }
.state-text { max-width: 420px; font-size: 13.5px; color: var(--text-sub); }
.state .btn, .state .logo-tile { margin-top: 12px; }
.state .logo-tile { margin: 0 0 10px; }
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--sk) 25%, var(--sk-hi) 45%, var(--sk) 65%); background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk-w1 { width: 34%; } .sk-w2 { width: 58%; } .sk-w3 { width: 76%; } .sk-w4 { width: 46%; }
.sk-lg { height: 22px; width: 56px; }
.stat .sk + .sk { margin-top: 8px; }
.sk-tile { width: 84px; height: 44px; border-radius: 10px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tbl-sk td { padding-top: 14px; padding-bottom: 14px; }
.tbl-sk tr:hover td { background: none; }

/* ---------- overview ---------- */
/* connected cards share one structure (head, stats, two panels, links) and stretch to the same height */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: stretch; }
.pcard-foot { margin-top: auto; }
.pcard { border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-bg); box-shadow: var(--card-shadow); display: flex; flex-direction: column; min-width: 0; animation: rise .35s cubic-bezier(.2,.8,.2,1) backwards; }
.pcard-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; padding: 16px 16px 14px; }
.pcard-head .logo-tile { grid-row: 1 / 3; }
.pcard-name { align-self: end; font-size: 16px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-head .badge { align-self: end; }
.pcard-user { grid-column: 2 / 4; align-self: start; font-size: 12.5px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-head-1 .pcard-name, .pcard-head-1 .badge { grid-row: 1 / 3; align-self: center; }
.pcard-body { padding: 0 16px 16px; }
.pcard-body .notice + .stats { margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px 12px; background: var(--card-bg); min-width: 0; }
.stat-wide { grid-column: span 2; }
a.stat-link { color: inherit; cursor: pointer; transition: background .15s; }
a.stat-link:hover { background: var(--row-hover); text-decoration: none; }
a.stat-link:hover .stat-label { color: var(--accent); }
a.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--row-hover); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-value small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-sub); }
.stat-value.is-warn { color: var(--warn); }
.stat-value.is-ok { color: var(--ok-fg); }
.stat-sub { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-foot { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.pcard-foot a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.pcard-foot a svg { width: 13px; height: 13px; transition: transform .15s; }
.pcard-foot a:hover svg { transform: translateX(2px); }
.pcard-off { background: transparent; box-shadow: none; border-style: dashed; }
.pcard-off .pcard-name { color: var(--text-sub); }
.pcard-off .pcard-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px 24px; font-size: 13.5px; line-height: 1.5; color: var(--text-sub); text-align: center; }
.pcard-off .pcard-foot { border-top-style: dashed; }
.foot-off { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text-sub); opacity: .5; }
.foot-off svg { width: 13px; height: 13px; }

/* ---------- platform panels: title, badge, note, a row of tiles ---------- */
/* masters summary strip: four figures across the full width */
.mstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.mstrip:empty { display: none; }
.mtile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; padding: 11px 14px 12px; border: 1px solid var(--card-border); border-radius: 14px;
  background: var(--card-bg); box-shadow: var(--card-shadow); font: inherit; color: var(--text); text-align: left;
}
button.mtile { cursor: pointer; transition: border-color .15s, background .15s; }
button.mtile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--card-border)); background: var(--row-hover); }
.mtile-label { font-size: 12px; font-weight: 500; color: var(--text-sub); }
.mtile-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; min-height: 29px; display: flex; align-items: baseline; }
.mtile-value small { margin-left: 5px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-sub); }
.mtile-value .sk { align-self: center; }
.mtile.is-warn .mtile-value { color: var(--warn); }
.mtile-na { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--text-sub); }
.mtile-split { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.mtile-split .mtile-na { font-size: 12px; }
/* sortable column headers */
.th-sort { display: inline-flex; align-items: center; gap: 3px; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.th-sort .ai { width: 9px; height: 9px; opacity: .35; }
.th-sort:hover, .th-sort.is-on { color: var(--text); }
.th-sort.is-on .ai { opacity: 1; color: var(--accent); }
.toolbar .seg { flex: none; }
.toolbar .seg-btn { height: 28px; }

/* Above the Masters table the panels of all shown platforms share one row and fill it. */
.ipanels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.ipanels:empty { display: none; }
.ipanels > .ipanel { border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.ipanels .ipanel-in { padding: 10px 14px 12px; }
/* A panel sizes its inside by its own width: tiles 2 per row when narrow, 3 per row, then all six in one row;
   very wide, title and tiles become one strip. The body height follows the tile rows, so a panel that is
   not available has exactly the footprint of one that is. */
.ipanel { --tile-h: 46px; min-width: 0; container-type: inline-size; }
.ipanel-head { display: flex; align-items: center; gap: 8px; height: 24px; white-space: nowrap; }
.ipanel-head > * { flex: none; }
.ipanel-title { font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; color: var(--text); }
.ipanel-head .ipanel-note { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--text-sub); }
.ipanel-body { margin-top: 8px; height: calc(3 * var(--tile-h) + 12px); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: var(--tile-h); gap: 6px; margin: 0; height: 100%; overflow: hidden; }
.tile { min-width: 0; overflow: hidden; padding: 4px 8px; border-radius: 8px; background: var(--thead-bg); border: 1px solid var(--line); }
.tile dt { font-size: 11.5px; line-height: 16px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile dd {
  margin: 0; font-size: 14.5px; font-weight: 650; line-height: 20px; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile dd.t-ok-text { color: var(--ok-fg); } .tile dd.t-warn-text { color: var(--warn); } .tile dd.t-err-text { color: var(--err); }
.ipanel-off {
  display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 14px; border: 1px dashed var(--border); border-radius: 8px;
  font-size: 12.5px; line-height: 1.35; color: var(--text-sub); text-align: center;
}
.ipanel-sk { width: 100%; height: 100%; border-radius: 8px; }
@container (min-width: 330px) {
  .ipanel-body { height: calc(2 * var(--tile-h) + 6px); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (min-width: 690px) {
  .ipanel-body { height: var(--tile-h); }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@container (min-width: 940px) {
  .ipanel-in { display: flex; align-items: center; gap: 18px; }
  .ipanel-head { flex: none; max-width: 34%; }
  .ipanel-body { flex: 1; min-width: 0; margin-top: 0; }
}
.pcard-panels { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 14px; }
.pcard-panels .ipanel-in { padding-top: 12px; border-top: 1px dashed var(--line); }

/* tags: one small fact each, coloured by tone (session lines of a master, counts) */
.tags { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.tag {
  display: inline-block; max-width: 100%; padding: 0 7px; border: 1px solid var(--card-border); border-radius: 4px; background: var(--chip-bg); color: var(--label);
  font-size: 11.5px; font-weight: 500; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-variant-numeric: tabular-nums;
}
.tag-ok { color: var(--ok-fg); background: color-mix(in srgb, var(--ok) 11%, transparent); border-color: color-mix(in srgb, var(--ok) 38%, transparent); }
.tag-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, transparent); border-color: color-mix(in srgb, var(--warn) 38%, transparent); }
.tag-err { color: var(--err); background: color-mix(in srgb, var(--err) 9%, transparent); border-color: color-mix(in srgb, var(--err) 36%, transparent); }
.tag-info { color: var(--info-fg); background: color-mix(in srgb, var(--info) 10%, transparent); border-color: color-mix(in srgb, var(--info) 36%, transparent); }
a.tag-link { min-width: 30px; padding: 0 9px; border-radius: 999px; text-align: center; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
a.tag-link:hover { text-decoration: none; background: var(--accent); border-color: var(--accent); color: #fff; }

/* scrape.do spend of this market: one compact full-width card above the platform cards, a tile per window */
.usage-slot:empty { display: none; }
.ucard { margin-bottom: 18px; padding: 12px 16px 12px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.ucard .ipanel-off { height: 62px; margin-top: 9px; }
.ucard .ipanel-head .tag { font-weight: 500; }
.utiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.utile {
  position: relative; min-width: 0; padding: 8px 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--thead-bg);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.utile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--row-hover); }
.utile-label { padding-right: 26px; font-size: 12px; line-height: 16px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utile-value { margin-top: 1px; font-size: 20px; font-weight: 700; line-height: 26px; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.utile-unit { margin-left: 5px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-sub); }
.utile-split { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.utile-part { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.logo-xs { width: 34px; height: 18px; padding: 2px 4px; border-radius: 5px; }
.logo-xs.logo-fallback { font-size: 10px; }
.utile-info { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; }
.ucard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-top: 9px; font-size: 12px; color: var(--text-sub); }
/* the dialog behind a tile: items per platform, subtotal, total */
.spend-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.spend-tbl th, .spend-tbl td { padding: 6px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: middle; }
.spend-tbl thead th { padding-top: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub); }
.spend-tbl .num { width: 1%; padding-left: 22px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spend-tbl .spend-count { color: var(--text-sub); }
.spend-tbl .spend-name .tag { margin-left: 8px; }
.spend-tbl tfoot th, .spend-tbl tfoot td { border-bottom: 0; font-weight: 650; }
.spend-total { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.spend-total strong { font-weight: 700; font-variant-numeric: tabular-nums; }

.attn { list-style: none; margin: 0; padding: 0; }
.attn li { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.attn li:hover { background: var(--row-hover); }
/* the whole row is the link of its master */
.attn-name::after { content: ""; position: absolute; inset: 0; }
.attn-name:focus-visible { outline: none; }
.attn-name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.attn li:last-child, .attn li:last-child .attn-name::after { border-radius: 0 0 14px 14px; }
.attn li:last-child { border-bottom: 0; }
.attn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.attn-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attn-name { font-weight: 600; }
.attn-text { font-size: 12.5px; color: var(--text-sub); }
.attn-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; color: var(--text-sub); text-align: right; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- dialog ---------- */
.dlg {
  width: min(410px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--card-border); border-radius: 16px;
  background: var(--bg-main); color: var(--text); box-shadow: var(--dlg-shadow);
}
.dlg::backdrop { background: var(--backdrop); }
.dlg[open] { animation: pop .2s cubic-bezier(.2,.8,.2,1); }
.dlg-head { display: flex; align-items: center; gap: 14px; padding: 18px 14px 6px 22px; }
.dlg-titles { flex: 1; min-width: 0; }
.dlg-titles h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.dlg-sub { margin-top: 2px; font-size: 13px; color: var(--text-sub); }
.dlg-close { align-self: flex-start; }
.dlg-body { padding: 16px 22px 0; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 4px 22px 22px; }
.dlg-foot .btn { height: 42px; padding: 0 18px; font-size: 14px; }
.dlg-foot .submit { width: auto; min-width: 124px; height: 42px; margin: 0; padding: 0 20px; font-size: 14px; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.dlg-text { margin-bottom: 18px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.dlg-titles h2 { overflow-wrap: anywhere; }

/* forms of the smaller dialogs (masters: add, edit, delete, product actions, egress IPs) */
#formDlg:not(.dlg-wide) .dlg-foot { padding-top: 6px; }
#formDlg .dlg-body { padding-bottom: 8px; }
.mform .form-grid .field, .mform > .field { margin-bottom: 14px; }
.mform .notice { margin-bottom: 14px; align-items: flex-start; }
.mform .notice svg { margin-top: 2px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--label); }
.field-switch .switch { min-height: 30px; }
.seg-wide { display: flex; width: 100%; }
.seg-wide .seg-btn { flex: 1; justify-content: center; height: 32px; }
.seg-btn:disabled { opacity: .6; cursor: default; }
button.submit.is-danger { background: var(--err); }
button.submit.is-danger:hover { background: var(--err); filter: brightness(.93); }
.btn-danger-ghost { color: var(--err); }
.btn-danger-ghost:hover { border-color: var(--err); }
.sel-lead { flex: none; display: inline-flex; }
.sel-lead:empty { display: none; }
.sel-opt-lead { flex: none; display: inline-flex; }
.sel-why { font-size: 12px; color: var(--text-sub); }
.mform-ips { margin-top: 4px; }
.mform-steps:empty { display: none; }
.steps { margin: 0 0 16px; padding: 10px 12px; list-style: none; border: 1px solid var(--card-border); border-radius: 10px; background: var(--thead-bg); display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.step-mark { width: 18px; height: 18px; flex: none; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--border); color: var(--text-sub); }
.step-mark .ai { width: 12px; height: 12px; }
.step-mark .spinner { width: 12px; height: 12px; }
.step.is-done .step-mark { border-color: transparent; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok-fg); }
.step.is-failed .step-mark { border-color: transparent; background: var(--err-bg); color: var(--err); }
.step.is-running .step-mark { border-color: transparent; }
.step-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.step-text { font-weight: 600; color: var(--text); }
.step.is-pending .step-text { font-weight: 500; color: var(--text-sub); }
.step-note { font-size: 12.5px; color: var(--text-sub); overflow-wrap: anywhere; }
.step.is-failed .step-note { color: var(--err); }
/* egress IP picker */
.ipp-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ipp-bar .search { flex: 1; max-width: none; }
.ipp-count { flex: none; font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ipp-list { margin: 0; padding: 0; list-style: none; max-height: 208px; overflow-y: auto; border: 1px solid var(--card-border); border-radius: 8px; background: var(--bg-main); }
.ipp-row { border-bottom: 1px solid var(--line); }
.ipp-row:last-child { border-bottom: 0; }
.ipp-row label, .ipp-line { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; padding: 4px 12px; font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer; }
.ipp-line { cursor: default; }
.ipp-row label:hover { background: var(--row-hover); }
.ipp-row input[type="checkbox"], .ipp-ack input { width: 16px; height: 16px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.ipp-row.is-off label { cursor: default; color: var(--text-sub); }
.ipp-row.is-off label:hover { background: none; }
.ipp-row .tag { margin-left: auto; }
.ipp-owner { margin-left: auto; font-size: 12.5px; color: var(--text-sub); }
.ipp-none { padding: 10px 2px; font-size: 13px; color: var(--text-sub); }
.ipp-used { margin-top: 8px; }
.ipp-used summary { padding: 4px 2px; font-size: 12.5px; font-weight: 600; color: var(--label); cursor: pointer; }
.ipp-used .ipp-list { margin-top: 6px; max-height: 150px; }
.ipp-warn { margin-top: 10px; }
.ipp-warn .notice { margin-bottom: 8px; }
.ipp-ack { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
/* admin history of a sub-account; delete confirmation */
.hist + .hist { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.hist-sk { height: 64px; border-radius: 8px; }
.hist-off { padding: 6px 0; font-size: 13px; color: var(--text-sub); }
.hist-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist-more { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--chip-bg); font-size: 11.5px; font-weight: 600; color: var(--label); cursor: help; }
.hist-pager { margin-top: 10px; justify-content: flex-end; }
.linkish { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.del-list { display: flex; flex-direction: column; margin-bottom: 14px; border: 1px solid var(--card-border); border-radius: 10px; }
.del-row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text); cursor: pointer; }
.del-row:last-child { border-bottom: 0; }
.del-row input { width: 16px; height: 16px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.del-name { font-weight: 600; }
.del-result { margin-left: auto; font-size: 12.5px; color: var(--text-sub); text-align: right; }
.del-result.is-ok { color: var(--ok-fg); font-weight: 600; }
.del-result.is-err { color: var(--err); }
/* row menu */
.menu-pop { min-width: 190px; overflow-y: auto; overscroll-behavior: contain; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px 0 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text); font: inherit; font-size: 13.5px; text-align: left; white-space: nowrap; cursor: pointer;
}
.menu-item:hover, .menu-item:focus { background: var(--nav-on); outline: none; }
.menu-item .ai, .menu-gap { width: 14px; height: 14px; flex: none; color: var(--label); }
.menu-item.is-danger, .menu-item.is-danger .ai { color: var(--err); }
.menu-item.is-danger:hover, .menu-item.is-danger:focus { background: var(--err-bg); }

/* master statistics: a large dialog, sections in a grid, charts as SVG */
.dlg.dlg-full { width: min(1180px, calc(100vw - 32px)); height: calc(100vh - 32px); height: calc(100dvh - 32px); max-height: none; }
.dlg-full .dlg-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); align-items: center; }
.dlg-full .dlg-body { padding-top: 16px; padding-bottom: 22px; background: var(--bg-side); }
.stats-days { display: flex; align-items: center; gap: 8px; flex: none; }
.stats-days label { margin: 0; font-size: 12.5px; }
.stats-days .sel-btn { min-width: 150px; padding: 8px 34px 8px 12px; border-radius: 8px; }
.stats-at { margin-bottom: 10px; font-size: 12px; color: var(--text-sub); }
.stats-sk { display: flex; flex-direction: column; gap: 14px; }
.stats-sk .sk { height: 120px; border-radius: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.stats-sec { min-width: 0; padding: 12px 14px 14px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.stats-sec.kind-series, .stats-sec.kind-kv { grid-column: 1 / -1; }
.stats-sec-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.stats-sec-head h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; }
.stats-hint { display: inline-flex; color: var(--text-sub); cursor: help; border-radius: 50%; }
.stats-hint .ai { width: 14px; height: 14px; }
.stats-note { margin: -4px 0 8px; font-size: 12px; color: var(--text-sub); }
.stats-empty { padding: 14px 0 6px; font-size: 13px; color: var(--text-sub); }
.stats-facts { padding: 2px 0 0; }
.stats-tbl-wrap { overflow-x: auto; }
.stats-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-tbl th, .stats-tbl td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.stats-tbl th { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub); white-space: nowrap; }
.stats-tbl tbody tr:last-child td { border-bottom: 0; }
.stats-tbl .num { padding: 6px 0 6px 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(64px, auto) minmax(60px, 1fr) auto; gap: 7px 10px; align-items: center; font-size: 12.5px; }
.bars li { display: contents; }
.bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; color: var(--text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { width: 100%; height: 8px; display: block; }
.bar-track { fill: var(--line); }
.bar-fill { fill: currentColor; }
/* series colours: by position, or by tone when the platform gives one */
.c0 { color: var(--accent); } .c1 { color: var(--info); } .c2 { color: #8b5cf6; } .c3 { color: #d97706; } .c4 { color: #db2777; }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-err { color: var(--err); }
.chart { position: relative; border-radius: 8px; outline-offset: 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; font-size: 12px; }
.chart-key { display: inline-flex; align-items: center; gap: 6px; }
.chart-key, .chart-tip-row { color: inherit; }
.chart-swatch { width: 10px; height: 10px; flex: none; border-radius: 3px; background: currentColor; }
.chart-key.c0 .chart-swatch, .chart-tip-row.c0 .chart-swatch { background: var(--accent); } .chart-key.c1 .chart-swatch, .chart-tip-row.c1 .chart-swatch { background: var(--info); }
.chart-key.c2 .chart-swatch, .chart-tip-row.c2 .chart-swatch { background: #8b5cf6; } .chart-key.c3 .chart-swatch, .chart-tip-row.c3 .chart-swatch { background: #d97706; }
.chart-key.c4 .chart-swatch, .chart-tip-row.c4 .chart-swatch { background: #db2777; } .chart-key.c-ok .chart-swatch, .chart-tip-row.c-ok .chart-swatch { background: var(--ok); }
.chart-key.c-warn .chart-swatch, .chart-tip-row.c-warn .chart-swatch { background: var(--warn); } .chart-key.c-err .chart-swatch, .chart-tip-row.c-err .chart-swatch { background: var(--err); }
.chart-key, .chart-tip-row { color: var(--text); }
.chart-svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--text-sub); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: currentColor; opacity: .12; stroke: none; }
.chart-guide { stroke: var(--text-sub); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-dot { fill: currentColor; stroke: var(--card-bg); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 26px; z-index: 2; min-width: 132px; padding: 7px 9px; border: 1px solid var(--card-border); border-radius: 8px; background: var(--bg-main);
  box-shadow: var(--dlg-shadow); font-size: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 3px;
}
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-weight: 650; margin-bottom: 1px; white-space: nowrap; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip-value { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* sub-account editor: common fields, then one block per platform */
.dlg-wide { width: min(660px, calc(100vw - 20px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; }
.dlg-wide[open] { display: flex; }
.dlg-wide > form, .dlg-wide > .dlg-form { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.dlg-sheet { width: min(860px, calc(100vw - 20px)); }
.dlg-sheet.dlg-narrow { width: min(460px, calc(100vw - 20px)); }
/* "Discard changes?" takes the place of the footer buttons of a form dialog */
.dlg-confirm { display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: 100%; }
.dlg-confirm-text { margin-right: auto; font-size: 14px; font-weight: 600; color: var(--text); }
.dlg-foot.is-confirming > :not(.dlg-confirm) { display: none; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { border-color: var(--err); filter: brightness(.94); }
.dlg-sheet .dlg-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dlg-sheet .dlg-head .logo-tile { align-self: flex-start; }
.dlg-foot .dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
.dlg-foot .dlg-actions .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.dlg-foot a.btn:hover { text-decoration: none; }
.dlg-wide .dlg-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 6px; }
.dlg-wide .dlg-foot { padding-top: 14px; border-top: 1px solid var(--line); }
fieldset.plain { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .field { margin-bottom: 14px; }
.field-hint { margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--text-sub); }
.pwd-row { display: flex; gap: 8px; }
.pwd-row .pwd-wrap { flex: 1; min-width: 0; }
.pwd-row .btn { height: auto; }
input[readonly] { background: var(--chip-bg); color: var(--text-sub); }
.pfs-title { margin: 4px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub); }
.pfs-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pfs { border: 1px solid var(--card-border); border-radius: 10px; background: var(--card-bg); }
.pfs.is-on { border-color: color-mix(in srgb, var(--accent) 45%, var(--card-border)); }
.pfs-head { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; }
.pfs-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfs-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; padding: 10px 12px 0; border-top: 1px solid var(--line); }
.pfs-field { margin-bottom: 12px; min-width: 0; }
.pfs-field label { margin-bottom: 5px; font-size: 12px; }
.pfs-field .sel-btn { padding: 8px 32px 8px 10px; }
.pfs-field .sel-btn > .ai { right: 11px; }
.pfs-field .field-hint { margin-top: 5px; font-size: 11.5px; }
.pfs-note { grid-column: 1 / -1; padding: 0 12px 10px; font-size: 12.5px; line-height: 1.45; color: var(--text-sub); }
.pfs-body .pfs-note { padding: 0 0 10px; }
.pfs-result { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; font-size: 13px; font-weight: 500; }
.pfs-result svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.pfs-result.is-ok { color: var(--ok-fg); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.pfs-result.is-err { color: var(--err); background: var(--err-bg); }
.pfs-result.is-wait { color: var(--text-sub); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; margin: 0; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; user-select: none; }
.switch input { position: absolute; left: 0; top: 50%; width: 34px; height: 20px; margin: 0; padding: 0; transform: translateY(-50%); opacity: 0; cursor: pointer; }
.switch-track { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--border); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled ~ * { opacity: .55; }
input:disabled { opacity: .7; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .acct-name { max-width: 96px; }
}
@media (max-width: 980px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .side { display: none; }
  .signin-brand { display: inline-flex; }
  .signin-main { padding: 72px 22px 40px; }
  .app { display: block; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(284px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden;
    transition: transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s linear .22s; box-shadow: var(--dlg-shadow);
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
  body.nav-open { overflow: hidden; }
  .sidebar-close { display: inline-flex; }
  .sidebar-foot { display: block; }
  .menu-btn { display: inline-flex; margin-left: -8px; }
  .topbar-wordmark { display: inline-flex; margin-right: auto; gap: 1px; }
  .topbar-wordmark .wordmark-tag { font-size: 10px; }
  .topbar-wordmark .brand-name { font-size: 16.5px; }
  .topbar { flex-wrap: wrap; gap: 8px 6px; padding: 8px 14px 10px; }
  .topbar-right { margin-left: 0; gap: 4px; }
  .acct-btn { padding: 0 4px; gap: 0; }
  .acct-name, .acct-btn > .ai { display: none; }
  .pf-scroll { order: 5; flex: 1 0 100%; }
  .view { padding: 18px 14px 40px; }
  .view-head h1 { font-size: 21px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .search { max-width: none; flex-basis: 100%; }
  .attn li { align-items: flex-start; }
  .attn-side { display: none; }
  .ipanels { grid-auto-flow: row; }
  .mstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mtile-value { font-size: 20px; }
  .dgrid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 9px 16px; }
}
@media (pointer: coarse) {
  .act { width: 32px; height: 32px; }
}
@media (min-width: 861px) { .scrim { display: none !important; } }
@media (max-width: 560px) {
  /* phones: panel tiles always 2 per row, whatever the panel width */
  .ipanel .ipanel-body { height: calc(3 * var(--tile-h) + 12px); }
  .ipanel .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ucard { padding: 12px 12px 12px; }
  .utiles { gap: 6px; }
  .utile { padding: 7px 7px 8px; }
  .utile-label { padding-right: 20px; font-size: 11.5px; }
  .utile-info { top: 3px; right: 1px; }
  .utile-value { font-size: 17px; }
  .utile-unit { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dlg-wide .dlg-head { padding-left: 16px; }
  .dlg-wide .dlg-body { padding-left: 16px; padding-right: 16px; }
  .dlg-wide .dlg-foot { padding: 12px 16px 16px; }
  .dlg.dlg-full { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .dlg-full .dlg-head { flex-wrap: wrap; row-gap: 10px; }
  .dlg-full .dlg-head .logo-tile { display: none; }
  .stats-days { order: 5; flex-basis: 100%; }
  .stats-days .sel { flex: 1; }
  /* details on a phone: a sheet from the bottom edge, full width, scrolling inside */
  .dlg-sheet { width: 100vw; max-width: 100vw; max-height: 88vh; max-height: 88dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .dlg-sheet .dlg-foot { flex-wrap: wrap; }
  .view-head { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-wide { grid-column: span 2; }
  .pager-info { flex-basis: 100%; }
  .pager-nav { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- roles and users (contract v3) ---------- */
.acct-who { display: flex; align-items: center; gap: 8px; }
.acct-who-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acct-role { flex: none; margin-left: auto; cursor: help; }
.acct-roles { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0 10px 8px; list-style: none; }
.acct-roles li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.acct-pf { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-locked { display: inline-flex; align-items: center; gap: 6px; }
.user-locked .ai { width: 13px; height: 13px; flex: none; color: var(--text-sub); }
.tbl-users .col-acc .badges { flex-wrap: wrap; gap: 3px 5px; }
.act-danger:hover { color: var(--err); background: var(--err-bg); }
.uform .pfs-title { margin-top: 6px; }
.uform > .ipp-warn { margin: -4px 0 16px; }
.pfs-body.ufs-body { display: block; padding-bottom: 2px; }
.ufs-body .ufs-hint { padding: 0 0 10px; }
.ufs-body.is-lacking { padding-bottom: 0; }
.ufs-body.is-lacking .pfs-field { display: none; }
.ufs-body .seg-wide .seg-btn { height: 30px; }
.ufs-all { margin-top: 7px; }
.ufs-pick { margin-top: 8px; }
.msel { display: block; }
.sel-placeholder { color: var(--text-sub); }
.sel-pop.pop { padding: 10px; overflow-y: auto; overscroll-behavior: contain; }
.msel-pop { width: 340px; }
.msel-box .search { max-width: none; margin-bottom: 8px; }
.msel-list { max-height: 216px; }
.msel-list label .ai { width: 14px; height: 14px; flex: none; color: var(--text-sub); }
.msel-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-num { flex: none; font-size: 12px; color: var(--text-sub); }
.msel-list .badge, .msel-list .tag { flex: none; margin-left: auto; }
.msel-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.msel-foot .ipp-count { margin-right: auto; }

/* ---------- ledgers with the product's own columns, CSV export (contract v1.9) ---------- */
.tbl-cols .cell-text { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tbl-cols th.col-stick, .tbl-cols td.col-stick { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.tbl-cols td.col-stick { background: var(--card-bg); }
.tbl-cols tbody tr:hover td.col-stick { background: var(--row-hover); }
.exp-pop { width: 300px; }
.exp-title { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: var(--text); }
.exp-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field.exp-field { margin-bottom: 0; min-width: 0; }
.exp-field label { margin-bottom: 5px; font-size: 12px; }
.exp-field input { padding: 7px 8px; font-size: 13px; }
.exp-hint { margin: 8px 0 10px; }
.exp .notice { margin-bottom: 10px; }
.exp-rows { display: flex; flex-direction: column; gap: 8px; }
.exp-row { display: flex; align-items: center; gap: 10px; }
.exp-row .btn { margin-left: auto; }
.exp-name { font-size: 13.5px; font-weight: 600; }
.exp-row .btn[aria-busy="true"] { opacity: .6; cursor: progress; }

/* ---------- audit log: tabs, a table that always fits (contract v3.1) ---------- */
.tabs { display: flex; gap: 2px; margin: -4px 0 16px; border-bottom: 1px solid var(--card-border); }
.tab {
  position: relative; height: 38px; padding: 0 14px; border: 0; border-radius: 8px 8px 0 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-sub); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--nav-on-fg); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.toolbar-note { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-audit { table-layout: fixed; }
.tbl-audit th, .tbl-audit td { padding-left: 8px; padding-right: 8px; overflow: hidden; text-overflow: ellipsis; }
.tbl-audit .col-time { width: 128px; }
.tbl-audit .col-pf { width: 60px; }
.tbl-audit td.col-pf { text-overflow: clip; }
.tbl-audit .col-who { width: 15%; }
.tbl-audit .col-action { width: 17%; }
.tbl-audit .col-target { width: 13%; }
.tbl-audit .col-ip { width: 116px; }
.tbl-audit .col-ip .mono { font-size: 11.5px; letter-spacing: 0; }
.who-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-width: 0; } /* the role tag goes under a name that needs the width */
.who-cell .clip { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.who-cell .tag { flex: none; padding: 0 5px; font-size: 10.5px; line-height: 16px; }
/* the short text of an event may take two lines before it is cut */
.tbl-audit .col-det .clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.act-fail .ai { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }
.act-fail:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.det-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.det-text { flex: 1; min-width: 0; }
.det-cell .act { flex: none; }
@media (max-width: 1099px) {
  .tbl-audit { min-width: 880px; } /* narrower than that the table scrolls inside its card */
}

/* ---------- purchase tools and settings (contract v4) ---------- */
.req { color: var(--err); font-weight: 600; }
.pform-req { margin: -2px 0 10px; }
/* the actions of a ledger row stay in sight while the other columns scroll under them; a row without one of
   them keeps its place empty, so that the same action is in the same spot on every row */
.act-none { visibility: hidden; cursor: default; }
/* a ledger that carries actions gives the room for them back by tighter cells, like the sub-accounts table */
.tbl-acts th, .tbl-acts td { padding-left: 8px; padding-right: 8px; }
.tbl-acts .wrap { min-width: 150px; }
.tbl-acts .acts { vertical-align: middle; }
@media (min-width: 861px) {
  .tbl-acts th.col-acts, .tbl-acts td.col-acts { position: sticky; right: 0; z-index: 1; box-shadow: -1px 0 0 var(--line); }
  .tbl-acts td.col-acts { background: var(--card-bg); }
  .tbl-acts tbody tr:hover td.col-acts { background: var(--row-hover); }
}
/* a searchable list of sub-accounts to pick one from: in the Reassign dialog, and behind the field of a form */
.sublist .search { max-width: none; margin-bottom: 8px; }
.sublist-list { max-height: 264px; }
.msel-pop .sublist-list { max-height: 216px; }
.ipp-row input[type="radio"] { width: 16px; height: 16px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.ipp-row.is-off input { cursor: default; }
.sublist-head {
  position: sticky; top: 0; z-index: 1; padding: 6px 12px; background: var(--thead-bg); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sub);
}
.sublist-login { flex: 0 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sublist-name { flex: 0 10 auto; min-width: 0; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sublist-master { flex: 0 10 auto; min-width: 0; margin-left: auto; font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sublist .tag { flex: none; }
.sublist-master + .tag { margin-left: 0; }
.sublist-foot { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--text-sub); }
.sublist .ipp-none { padding: 14px 2px; }
.rsg-now { margin-bottom: 12px; }
.rsg .ipp-warn { margin-top: 12px; }
/* further exports of a page in the Export panel */
.exp-more { display: flex; flex-direction: column; gap: 10px; }
.exp-rows + .exp-more { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.exp-kind { display: flex; align-items: flex-start; gap: 10px; }
.exp-kind-text { flex: 1; min-width: 0; }
.exp-kind-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.exp-kind .field-hint { margin-top: 3px; }
.exp-kind .btn { flex: none; }
.exp-kind .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
/* Settings: one card per platform */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px; align-items: start; }
.settings .panel + .panel { margin-top: 0; }
.bcard-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bcard-pf { font-size: 12.5px; color: var(--text-sub); }
.bcard .panel-head .tag { flex: none; }
.bcard-body { padding: 14px 16px 6px; }
.bcard-hint { margin-bottom: 12px; font-size: 13px; line-height: 1.5; color: var(--text-sub); }
.bcard-body .notice { margin-bottom: 12px; }
.bcard-list { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.bcard-row { display: flex; align-items: center; gap: 6px; }
.bcard-row input, .bcard-add input { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bcard-row .act { flex: none; }
.bcard-empty { padding: 2px 0 12px; font-size: 13px; color: var(--text-sub); }
.bcard-add { display: flex; align-items: center; gap: 8px; }
.bcard-add .btn { flex: none; height: 38px; }
.bcard-note { min-height: 17px; margin-bottom: 6px; }
.bcard-note:not(:empty) { color: var(--err); }
.bcard-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.bcard-foot .count { margin-right: auto; }
.bcard-sk { height: 36px; margin-bottom: 6px; border-radius: 8px; }
.bcard .state { padding: 24px 16px 30px; }
.bdiff-box { margin-bottom: 12px; }
.bdiff { margin: 0; padding: 8px 12px; list-style: none; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--card-border); border-radius: 8px; }
.bdiff li { overflow-wrap: anywhere; }
.bdiff.is-added li.mono::before { content: "+ "; font-weight: 700; color: var(--ok-fg); }
.bdiff.is-removed li.mono::before { content: "- "; font-weight: 700; color: var(--err); }
.bdiff-more { font-size: 12.5px; color: var(--text-sub); }
@media (max-width: 560px) {
  /* a toolbar with two buttons (Reconcile, Export): the counter takes its own line above them */
  .toolbar-end { flex-wrap: wrap; justify-content: flex-end; }
  .toolbar-end:has(.btn:not([hidden]) ~ .btn:not([hidden])) .count { flex-basis: 100%; text-align: right; }
}

/* ---------- contract v4.1: product filters, lot links, health period, IP pool, quarantine ---------- */
/* the lot of a row as a link to its page on the auction site (always a new tab) */
a.lot-link { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
a.lot-link:hover { text-decoration-color: currentColor; }
/* the sub-account filter of a ledger: a picker in the toolbar, with a small "clear" next to it once one is chosen */
.sub-filter .sel-btn { min-width: 156px; max-width: 230px; }
.fclear { width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center; margin-left: -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-sub); cursor: pointer; }
.fclear:hover { background: var(--chip-bg); color: var(--text); }
.fclear svg { width: 13px; height: 13px; }
/* the filters of the logs: a row of its own under the toolbar */
.fbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--thead-bg); }
.fbar .fgroup { min-width: 0; }
.fbar input { width: 152px; padding: 7px 10px; border-radius: 8px; }
.fbar input[id^="f-from-"], .fbar input[id^="f-to-"] { width: 122px; font-variant-numeric: tabular-nums; }
.fbar .sel-btn { min-width: 210px; max-width: 300px; }
.fbar-reset { margin-left: auto; }
.fbar-reset svg { width: 11px; height: 11px; }
/* the period of the health figures, above the summary strip of Masters */
.select-wrap.mstrip-tools { display: flex; justify-content: flex-end; margin: -8px 0 10px; }
.mstrip-tools .sel-btn { min-width: 150px; padding: 6px 32px 6px 11px; font-size: 13px; }
/* a tag that is also the switch for what it says ("Subs login" of a master) */
button.tag-switch { font-family: inherit; cursor: pointer; transition: box-shadow .15s; }
button.tag-switch:hover { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 22%, transparent); }
button.tag-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-hint-warn { color: var(--warn); }
/* IP picker: why a blocked address cannot be ticked, and until when */
.ipp-note { margin: -4px 12px 8px 38px; font-size: 12px; line-height: 1.4; color: var(--text-sub); overflow-wrap: anywhere; }
.ipp-taken .ipp-note { margin-left: 12px; }
.ipp-lost { margin-top: 8px; }
/* IP pool page: a card per platform, the whole pool in a table that scrolls inside the card */
.ippool { display: flex; flex-direction: column; gap: 18px; }
.ippool .panel + .panel { margin-top: 0; }
.ipc-tools { gap: 10px 14px; }
.ipc-tools .search { margin-left: auto; flex: 0 1 300px; }
.ipc-totals { display: flex; flex-wrap: wrap; gap: 6px; }
.ipc-total {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid var(--card-border); border-radius: 8px; background: var(--card-bg);
  color: var(--text-sub); font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s;
}
.ipc-total strong { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ipc-total:hover { border-color: var(--text-sub); }
.ipc-total[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--nav-on-fg); }
.ipc-total.is-blocked strong { color: var(--err); }
.ipc-total.is-free strong { color: var(--ok-fg); }
.ipc-scroll { max-height: 452px; overflow-y: auto; }
.ipc-scroll thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.tbl-pool .wrap { min-width: 220px; max-width: 460px; }
.tbl-pool .ip-label { font-size: 12px; }
.ipc-fail { padding: 12px 14px; }
.ipc .state { padding: 26px 16px 30px; }
.ipc-quar { border-top: 1px solid var(--line); }
.ipc-quar-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.ipc-quar-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.ipc-quar-head .count { flex: none; }
.tbl-quar .wrap { min-width: 200px; max-width: 420px; }
.tbl-quar .acts { gap: 2px; }
.tbl-quar .acts .btn { margin-left: 0; margin-right: 4px; }
.tab { flex: none; white-space: nowrap; }
@media (max-width: 560px) {
  .sub-filter { flex: 1 1 100%; }
  .sub-filter .sel { flex: 1; min-width: 0; }
  .sub-filter .sel-btn { max-width: none; }
  .fbar .fgroup { flex: 1 1 100%; }
  .fbar .fgroup label { flex: none; width: 46px; }
  .fbar .fgroup input, .fbar .fgroup .sel { flex: 1; width: auto; min-width: 0; }
  .fbar .sel-btn { min-width: 0; max-width: none; }
  .fbar-reset { margin-left: 0; }
  .select-wrap.mstrip-tools { margin-top: -4px; }
  .mstrip-tools .sel { flex: 1; }
  .ipc-tools .search { flex: 1 1 100%; margin-left: 0; }
  .ipc-totals { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ipc-total { flex-direction: column; justify-content: center; gap: 0; height: 46px; padding: 0 4px; font-size: 12px; }
  .ipc-quar-head { flex-wrap: wrap; }
  /* three tabs on a phone: one line, scrolling sideways when they do not fit */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 0 10px; }
  .tab[aria-selected="true"]::after { bottom: 0; }
}

/* iOS zooms the page when a focused input has a font smaller than 16px */
@media (pointer: coarse), (max-width: 760px) {
  input, .sel-btn { font-size: 16px; }
  .sel-opt { height: 44px; font-size: 15px; }
  .menu-item { height: 44px; font-size: 15px; }
  .ipp-row label, .ipp-line { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .err, form.shake .field, .pcard, .dlg[open], .sk, .side-art .spin, .side-art .orbit { animation: none; }
  .spinner, .icon-btn.spinning svg { animation-duration: 1.6s; }
  .acct-menu, .sel-pop, .tip { animation: none; }
  .sel-btn > .ai, .acct-btn > .ai { transition: none; }
  .sidebar, body.nav-open .sidebar, .table-wrap, a.stat-link, .attn li, .pcard-foot a svg, .switch-track, .switch-track::after { transition: none; }
}

/* ---------- contract v5 (WP3): accounts and audit parity ---------- */
textarea {
  display: block; width: 100%; min-height: 64px; padding: 10px 13px; resize: vertical; background: var(--bg-main); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 14px; line-height: 1.45; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }
textarea::placeholder { color: var(--text-sub); opacity: .8; }
textarea[aria-invalid="true"], textarea[aria-invalid="true"]:focus { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-ring); }
textarea[readonly] { background: var(--chip-bg); color: var(--text); }
input::placeholder, textarea::placeholder { text-overflow: ellipsis; }
.form-grid .field-full { grid-column: 1 / -1; }
.field-count { display: flex; justify-content: space-between; gap: 12px; }
.field-count .count-of { flex: none; font-variant-numeric: tabular-nums; }
.field-count .count-of.is-over { color: var(--err); font-weight: 600; }
.err-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: inherit; }
.err-list li + li { margin-top: 2px; }
.pfs-apply { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.pfs-apply-text { font-size: 12px; color: var(--text-sub); }
.pfs-changes { margin: 0; padding: 0 12px 10px; font-size: 12.5px; font-weight: 500; color: var(--accent); }
.pfs-changes.is-none { font-weight: 400; color: var(--text-sub); }
.pfs-body + .pfs-changes { padding-top: 0; }
.mfilter .sel-btn { min-width: 156px; max-width: 240px; }
.mcell { min-width: 84px; max-width: 120px; }
.mcell-name { display: inline-flex; align-items: flex-start; gap: 5px; min-width: 0; max-width: 100%; font-weight: 500; line-height: 1.35; }
.mcell-name .ai { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--text-sub); }
.mcell-name .clip { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
.col-mail .cell-2 { max-width: 108px; }
.tbl-subs:has(.col-mail) .col-text { min-width: 86px; }
.tbl-subs th.col-mail, .tbl-subs td.col-mail, .tbl-subs td.col-master, .tbl-subs th.col-master, .tbl-subs td.col-ip, .tbl-subs th.col-ip { padding-left: 6px; padding-right: 6px; }
.tbl-subs .col-ip .mono { font-size: 11.5px; letter-spacing: 0; }
.col-mail .clip { font-size: 11.5px; letter-spacing: 0; }
.col-mail .tag { align-self: flex-start; }
.count-hidden { color: var(--text-sub); font-weight: 400; }
.count .count-hidden { cursor: help; border-bottom: 1px dotted currentColor; }
.count-sep { color: var(--text-sub); }
.tbl-audit .col-time-s { width: 150px; }
.log-note { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--text-sub); }
.cookie-field { margin: 14px 0 0; }
.cookie-label { margin-bottom: 6px; }
.cookie-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.ufs-stale { grid-column: 1 / -1; }
.ufs-stale .field-hint { margin: 0 0 6px; }
.hist-who .who-cell { flex-wrap: wrap; }
.profile .hist + .hist { margin-top: 16px; }
.profile .notice, .profile .err { margin-top: 16px; }
@media (max-width: 560px) {
  .mfilter { flex: 1 1 100%; }
  .mfilter .sel { flex: 1; min-width: 0; }
  .mfilter .sel-btn { max-width: none; }
}
.col-target .cell-2 .tag, .col-mail .cell-2 .tag { align-self: flex-start; max-width: 100%; }
.tbl-users .cell-2 > .tag, .mcell .tag { align-self: flex-start; }
.subs-hidden { align-items: flex-end; }

/* ---------- contract v5 (wp1): ledgers and purchase tools at parity with the old product pages ---------- */
.view-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-sub); }
/* tag and text colours of the old pages: info (blue) and violet next to ok / warn / err */
.tag-violet { color: #6d28d9; background: color-mix(in srgb, #8b5cf6 11%, transparent); border-color: color-mix(in srgb, #8b5cf6 38%, transparent); }
:root[data-theme="dark"] .tag-violet { color: #c4b5fd; }
.t-info-text { color: var(--info-fg); }
.t-violet-text { color: #6d28d9; }
:root[data-theme="dark"] .t-violet-text { color: #c4b5fd; }
/* a cell with its marks: tags after the value, short second lines under it */
.cell-marks { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.cell-top { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
.cell-badge { flex: none; padding: 0 5px; font-size: 10.5px; line-height: 16px; }
.cell-line { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; line-height: 1.35; font-weight: 500; }
.cell-line.muted { color: var(--text-sub); }
.cell-line[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.tbl-cols td .cell-marks .cell-text { max-width: 240px; }
/* a row action that is more needed than usual (no vehicle yet, an invoice that may not exist) */
.act.act-warn { color: var(--warn); }
/* the list stays a table when it is empty: the state sits in its only row */
.tbl-empty .empty-row td { padding: 0; white-space: normal; }
.tbl-empty tbody tr:hover td { background: none; }
.empty-cell .state { position: sticky; left: 0; max-width: min(100%, 100vw - 80px); }
.state-note { max-width: 460px; margin-top: 4px; font-size: 13px; color: var(--text-sub); }
/* page numbers and page size */
.pager-nums { display: inline-flex; align-items: center; gap: 2px; }
.pager-num { min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: none; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.pager-num:hover { background: var(--chip-bg); }
.pager-num.is-on { border-color: var(--accent); color: var(--accent); font-weight: 650; cursor: default; }
.pager-num:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pager-gap { padding: 0 3px; color: var(--text-sub); }
.pager-nav .pager-page { display: none; }
.pager-size .sel-btn { min-width: 0; padding: 5px 30px 5px 10px; font-size: 12.5px; }
@media (max-width: 640px) {
  .pager-nums { display: none; }
  .pager-nav .pager-page { display: inline; }
  .pager-nav { flex-wrap: wrap; }
}
/* the master control and the typed account of the ledgers' toolbar */
.sub-typed { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.msel-box > .sub-typed:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sub-typed .field-label { display: block; margin-bottom: 5px; font-size: 12px; }
.sub-typed-row { display: flex; gap: 8px; }
.sub-typed-row input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px; }
.sub-typed .field-hint { margin-top: 5px; }
/* the platforms' own columns under "All" */
.th-pf { display: inline-flex; align-items: center; gap: 5px; }
.cols-hint { margin: 0 0 8px; }
.cols-box .sublist-head { display: flex; align-items: center; gap: 6px; }
/* a small month calendar next to a date field */
.date-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.date-wrap > input { flex: 1; min-width: 0; padding-right: 34px; }
.cal-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-sub); cursor: pointer; }
.cal-btn:hover { background: var(--chip-bg); color: var(--accent); }
.cal-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.cal-btn svg { width: 15px; height: 15px; }
.fbar .date-wrap > input { width: 132px; padding-right: 30px; }
.fbar .fgroup .sel-btn { min-width: 186px; }
.fbar .cal-btn { right: 2px; width: 26px; }
.sel-pop.cal-pop { width: 252px; padding: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-size: 13px; font-weight: 650; color: var(--text); }
.cal-nav { width: 28px; height: 28px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { padding: 3px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-sub); }
.cal-day { height: 30px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--chip-bg); }
.cal-day.is-today { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cal-day.is-on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
/* a moment: a date and a time side by side */
.dt-wrap { display: flex; gap: 8px; min-width: 0; }
.dt-wrap > .date-wrap { flex: 1; }
.dt-wrap > input { flex: none; width: 84px; font-variant-numeric: tabular-nums; }
/* a product form's lookup next to its field */
.lookup-wrap { display: flex; gap: 8px; min-width: 0; }
.lookup-wrap > input { flex: 1; min-width: 0; }
.lookup-btn { flex: none; }
/* the export panel: an extra export's summary and its options */
.exp-pop.exp-pop-wide { width: 420px; }
.exp-kind-btns { display: flex; flex: none; align-items: flex-start; gap: 6px; }
.exp-opt-btn svg { width: 13px; height: 13px; }
.exp-sum { margin-top: 3px; }
.exp-opts { margin: -2px 0 2px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--thead-bg); }
.exp-opts-hint { margin: 0 0 10px; }
.exp-opts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.exp-opts-grid .field { margin-bottom: 0; min-width: 0; }
.exp-opts-grid .field label, .exp-opts-grid .field-label { margin-bottom: 5px; font-size: 12px; }
.exp-opts-grid .sel-btn { width: 100%; min-width: 0; }
.exp-mfield { grid-column: 1 / -1; }
.exp-mall .msel-name { font-weight: 600; }
.exp-mitems { max-height: 150px; margin-top: 4px; }
@media (max-width: 480px) { .exp-pop.exp-pop-wide { width: auto; } .exp-opts-grid { grid-template-columns: minmax(0, 1fr); } }
/* reassignment history */
.rsg-hist { margin-top: 14px; }
.rsg-hist-list { max-height: 150px; overflow: auto; margin: 6px 0 0; padding: 8px 10px; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--thead-bg); font-size: 12.5px; }
.rsg-hist-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 0; }
.rsg-hist-time { color: var(--text-sub); font-variant-numeric: tabular-nums; }
.rsg-hist-move { font-weight: 600; color: var(--text); }
.rsg-hist-by { color: var(--text-sub); }
/* the invoice search */
.isearch-out { margin-top: 4px; }
.isearch-out > .notice { margin-bottom: 10px; }
.isearch-count { margin: 0 0 6px; font-size: 12.5px; color: var(--text-sub); }
.isearch-table { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.isearch-out .err.notice { margin-top: 10px; }
.tbl td.num .cell-marks { align-items: flex-end; }
.exp-opts-grid .sel-btn { padding: 7px 30px 7px 10px; font-size: 13px; border-radius: 8px; }
@media (max-width: 480px) { .exp-kind { flex-wrap: wrap; } .exp-kind-btns { margin-left: auto; } }
/* the colour of a log event, from its code (as on the old log pages) */
.act-tone-ok { color: var(--ok-fg); } .act-tone-err { color: var(--err); } .act-tone-info { color: var(--info-fg); }
.act-tone-warn { color: var(--warn); } .act-tone-gold { color: #a16207; } .act-tone-violet { color: #6d28d9; }
:root[data-theme="dark"] .act-tone-gold { color: #facc15; } :root[data-theme="dark"] .act-tone-violet { color: #c4b5fd; }

/* ---------- v5 (wp2): masters views, auto refresh, access, density, quarantine figures ---------- */
@media (min-width: 861px) { .mstrip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mtile.is-err .mtile-value { color: var(--err); }
.mtile.is-accent .mtile-value { color: var(--accent); }
.toolbar .mview .seg-btn { padding: 0 10px; }
.upd { font-size: 12px; color: var(--text-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upd:empty { display: none; }
.auto-btn { gap: 5px; color: var(--text-sub); }
.auto-btn .ai { width: 13px; height: 13px; }
.auto-btn[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.mfoot:empty { display: none; }
.mfoot { padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.mfoot-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; color: var(--text-sub); }
.mfoot-line + .mfoot-line { margin-top: 6px; }
.mfoot-line .logo-tile { margin-right: 4px; }
.fig { min-width: 86px; }
.fig-main { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig-main small { margin-left: 3px; font-size: 11.5px; font-weight: 500; color: var(--text-sub); }
.fig-main small.t-ok-text { color: var(--ok-fg); } .fig-main small.t-warn-text { color: var(--warn); } .fig-main small.t-err-text { color: var(--err); }
.fig-bar { display: block; width: 72px; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fig-bar-in { display: block; height: 100%; background: var(--accent); }
.tbl-mstats .col-bneck .cell-1 { max-width: 118px; font-size: 11.5px; }
.tbl-mstats .col-diag { white-space: normal; }
.tbl-mstats .col-diag .tags { flex-direction: row; flex-wrap: wrap; gap: 3px; max-width: 150px; }
.tbl-mstats .col-diag .tag { white-space: normal; }
.tbl-mstats .col-session .tags { width: 140px; }
.tbl-mstats .col-name .cell-2 { max-width: 168px; }
.tbl-mstats .col-name .cell-sub-1 { max-width: 162px; font-size: 11.5px; }
.tbl-mstats .fig .cell-sub-1 { white-space: normal; max-width: 128px; display: block; }
.tbl-mstats td { white-space: normal; }
.tbl-maccess .col-access { white-space: normal; }
.tags.tags-wrap { flex-direction: row; flex-wrap: wrap; gap: 3px 4px; max-width: 420px; }
.tr-cell { display: inline-block; }
.sel-cell { width: auto; padding: 2px 22px 2px 7px; font-size: 11.5px; border-radius: 5px; max-width: 128px; }
.sel-cell > .ai { right: 7px; width: 9px; height: 9px; margin-top: -4.5px; }
.sel-cell .sel-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 20px; border-radius: 4px; color: var(--text-sub); }
.icon-link:hover { color: var(--accent); background: var(--chip-bg); text-decoration: none; }
.icon-link svg { width: 13px; height: 13px; }
.kind-ask { margin-top: 10px; }
.kind-ask .notice { margin-bottom: 8px; }
.field-err { margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--err); }
input.is-readonly { color: var(--text-sub); background: var(--chip-bg); cursor: default; }
.acc-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.acc-list li + li { border-top: 1px solid var(--line); }
.acc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; padding: 9px 12px; font-size: 13.5px; cursor: pointer; }
.acc-row input[type="checkbox"] { width: 16px; height: 16px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.acc-row input[type="checkbox"]:disabled { cursor: default; }
.acc-row input:disabled + .strong { color: var(--text-sub); }
.acc-why { flex: 1 1 100%; padding-left: 22px; font-size: 12px; color: var(--text-sub); }
.ipc-facts:empty { display: none; }
.ipc-facts { padding: 10px 16px 0; }
.ipc-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-sub); max-width: 980px; }
.ipc-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; font-size: 12.5px; color: var(--text-sub); }
.ipc-meta .mono { color: var(--text); }
.qtiles { padding: 10px 16px 0; }
.ipc-quar .qtiles + .table-wrap { margin-top: 10px; }
div.ipc-total { cursor: default; }
div.ipc-total:hover { border-color: var(--card-border); }
.ipc-total.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--nav-on-fg); }
.ipc-total.is-ok strong { color: var(--ok-fg); }
.ipc-total.is-warn strong { color: var(--warn); }
.ipc-dens .ipc-note { padding: 10px 16px 0; }
.dens-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; padding: 12px 16px 16px; }
.dens-part { min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dens-title { margin: 0; padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-sub); border-bottom: 1px solid var(--line); }
.dens-part .state { padding: 18px 12px; }
.tbl-quar td.nowrap, .tbl-quar .nowrap { white-space: nowrap; }
.tbl-quar td .num { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .toolbar .mview { flex: 1 1 100%; }
  .toolbar .mview .seg-btn { flex: 1; justify-content: center; }
  .upd { display: none; }
}
.tbl-masters .col-name .cell-sub-1 { max-width: 180px; }
.tbl-masters .col-name .cell-sub.sub-wrap { display: -webkit-box; max-width: 150px; white-space: normal; -webkit-line-clamp: 2; }
@container (max-width: 1500px) { .tbl-masters .col-name .cell-sub-1 { max-width: 132px; } .tbl-masters .col-name .cell-sub.sub-wrap { max-width: 124px; } }
/* merge (wp2 + wp3): the "+N hidden" line under a master's sub-account count keeps the masters table inside its card */
@container (max-width: 1500px) { .tbl-masters .subs-hidden .sline { font-size: 10.5px; white-space: normal; max-width: 46px; text-align: right; } }
/* ---------- contract v5: the old panels' Monitoring and Settings, the shell ---------- */
/* sign-in: keep me signed in */
.remember { display: flex; align-items: center; gap: 9px; margin: -4px 0 18px; font-size: 13.5px; color: var(--text-sub); cursor: pointer; user-select: none; }
.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* the sidebar folds to its icons on wide screens (remembered); in the drawer it is always open */
.sidebar-collapse { flex: none; }
.sidebar-collapse svg { width: 16px; height: 16px; }
@media (min-width: 861px) {
  body.nav-collapsed .app { grid-template-columns: 68px minmax(0, 1fr); }
  body.nav-collapsed .sidebar { padding: 0 10px 16px; overflow-x: hidden; }
  body.nav-collapsed .sidebar-head { justify-content: center; margin: 0 -10px; padding: 0; }
  body.nav-collapsed .sidebar-head .wordmark { display: none; }
  body.nav-collapsed .ro-tag { justify-content: center; margin: 12px 0 0; padding: 6px 0; font-size: 0; }
  body.nav-collapsed .ro-tag svg { margin: 0; }
  body.nav-collapsed .nav-label { height: 1px; margin: 0 6px 8px; padding: 0; overflow: hidden; background: var(--divider); color: transparent; }
  body.nav-collapsed .nav-link { justify-content: center; gap: 0; padding: 0; }
  body.nav-collapsed .nav-link > span:not(.ai) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.nav-collapsed .nav-link[aria-current="page"]::before { left: -10px; }
}
@media (max-width: 860px) { .sidebar-collapse { display: none; } }
/* the header: role tag next to the name */
.acct-tag { flex: none; margin-left: 2px; padding: 0 6px; font-size: 11px; line-height: 18px; }
@media (max-width: 860px) { .acct-tag { display: none; } }
/* "Access denied" / "Page not found" */
.state-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.state-acts .btn { margin-top: 0; }
/* Settings: the further cards; the wide ones take the whole row */
.settings .v5-wide { grid-column: 1 / -1; }
.v5-head-extra { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.v5-head-extra:empty { display: none; }
.v5-card .panel-head .icon-btn { flex: none; }
.v5-sub { margin: 16px 0 8px; font-size: 13px; font-weight: 650; color: var(--text); }
.v5-sub:first-child { margin-top: 2px; }
.v5-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin: 0 0 6px; }
.v5-tiles .tile { padding: 6px 9px; }
.v5-tiles .tile dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v5-remark { margin: 8px 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--text-sub); }
.v5-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 12px; }
.v5-tools .sel-btn { min-width: 220px; max-width: 100%; }
.v5-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 8px; }
.v5-actions .count { margin-right: auto; }
.v5-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.v5-card .table-wrap { margin: 0 -16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.v5-card .bcard-body { padding-bottom: 14px; }
.v5-card .notice, .v5-card [data-base="notice"] { margin-bottom: 10px; }
.v5-tbl { table-layout: auto; }
.v5-cookies { table-layout: fixed; min-width: 640px; }
.v5-cookies .v5-cname { width: 26%; }
.v5-cookies .v5-cval { width: 40%; }
.v5-cookies .v5-cdom { width: 20%; }
.v5-cookies .col-acts { width: 104px; }
.v5-cookies td { overflow: hidden; text-overflow: ellipsis; }
.v5-events { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.v5-more { margin-top: 6px; }
.v5-ev { position: relative; padding: 7px 0 7px 16px; border-bottom: 1px solid var(--line); }
.v5-ev:last-child { border-bottom: 0; }
.v5-ev::before { content: ""; position: absolute; left: 2px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--divider); }
.v5-ev.is-ok::before { background: var(--ok); }
.v5-ev.is-err::before { background: var(--err); }
.v5-ev.is-info::before { background: var(--accent); }
.v5-ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.v5-ev-master { font-weight: 600; color: var(--text); }
.v5-ev-step { color: var(--text-sub); }
.v5-ev-time { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.v5-ev-err { margin: 3px 0 0; font-size: 12px; color: var(--err); overflow-wrap: anywhere; }
.v5-progress { min-height: 90px; }
.v5-progress .v5-events { margin-top: 10px; }
.v5-wait { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-sub); }
.v5-wait .spinner { display: inline-block; width: 16px; height: 16px; }
.v5-pre { max-height: 46vh; margin: 0; padding: 10px 12px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--thead-bg); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.v5-textarea { width: 100%; min-height: 96px; padding: 8px 11px; border-radius: 8px; resize: vertical; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.v5-pattern { flex: 1; min-width: 0; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--thead-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.v5-off .bcard-body { padding-bottom: 14px; }
/* MONITORING > Activity monitor */
.v5-which { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; font-size: 13px; color: var(--text-sub); }
.v5-which + .panel { margin-top: 0; }
.v5-reqtiles { margin-bottom: 14px; }
.v5-reqtiles-in { padding: 10px 12px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.v5-reqtiles .v5-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.v5-reqtiles .tile dd { font-size: 18px; line-height: 26px; }
.v5-reqtiles-sk { display: block; height: 70px; border-radius: 14px; }
.v5-bar-title { font-size: 14px; font-weight: 650; }
.v5-dt { display: inline-flex; gap: 6px; }
.fbar .v5-dt input[id$="-d"] { width: 132px; font-variant-numeric: tabular-nums; }
.fbar .v5-dt input[id$="-t"] { width: 72px; font-variant-numeric: tabular-nums; }
.fbar input#rq-path { width: 190px; }
.fbar #rq-method, .fbar #rq-status { min-width: 132px; }
.tbl-req .col-time { width: 146px; }
.tbl-req .col-verb { width: 76px; }
.tbl-req .col-path { width: 30%; }
.tbl-req .col-st { width: 64px; }
.tbl-req .col-dur { width: 82px; }
.tbl-req .col-who { width: 14%; }
.tbl-req .col-ip { width: 112px; }
@media (max-width: 1099px) { .tbl-req { min-width: 900px; } }
@media (max-width: 860px) { .v5-reqtiles .v5-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* browser events: the win-attribution columns (short headers, the full name in the tooltip) */
.tbl-audit:has(th.col-be-amt) .col-who { width: 9%; }
.tbl-audit:has(th.col-be-amt) .col-action { width: 9%; }
.tbl-audit:has(th.col-be-amt) .col-target { width: 7%; }
.tbl-audit:has(th.col-be-amt) .col-be-amt { width: 82px; }
.tbl-audit:has(th.col-be-amt) .col-be-no { width: 84px; }
.tbl-audit:has(th.col-be-amt) .col-be-match { width: 68px; }
.tbl-audit:has(th.col-be-amt) .col-be-src { width: 8%; }
.tbl-audit:has(th.col-be-amt) .col-be-sale { width: 60px; }
.tbl-audit:has(th.col-be-amt) .col-ip { width: 122px; }
.tbl-audit:has(th.col-be-amt) .h-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.tbl-audit:has(th.col-be-amt) .h-short { display: inline; }
@media (max-width: 1399px) { .tbl-audit:has(th.col-be-amt) { min-width: 1120px; } }
/* a ledger row action that is a link (a recording) looks like the others */
a.act { color: var(--text-sub); }
a.act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
