/* faff pool: internal console. Dark, restrained, 8px spacing grid. */

:root {
  /* neutrals, tinted slightly blue. Never pure black or white. */
  --bg:            #f5f4ef;
  --bg-sidebar:    #eceae3;
  --surface:       #ffffff;
  --surface-2:     #eef1f5;
  --border:        #d9dde4;
  --border-strong: #b7bfcb;

  --text:   #17202f;
  --text-2: #5e697b;
  --text-3: #7d8797;

  /* state accents, used sparingly */
  --green: oklch(0.760 0.155 160);
  --amber: oklch(0.800 0.135 85);
  --red:   oklch(0.705 0.175 25);
  --blue:  oklch(0.750 0.115 240);

  --accent: var(--blue);

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;

  --r-sm: 6px;
  --r-md: 10px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */
  --t: 150ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: var(--bg);
}
body:not(.gated) .login-gate { display: none; }
body.gated .shell { display: none; }

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.login-brand { margin-bottom: var(--s1); }
.login-card h1 { font-size: 22px; }
.login-card .btn { width: 100%; }
.login-method { display: flex; flex-direction: column; gap: var(--s2); }
.login-method[hidden] { display: none; }
.signed-in-as {
  font-size: 11px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.mono, code { font-family: var(--mono); }

h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; }

/* ============ Shell ============ */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--s3) var(--s2);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  position: sticky;
  top: 0;
  height: 100vh;
}

.main {
  max-width: 1200px;
  width: 100%;
  padding: var(--s5) var(--s6);
  margin: 0 auto;
}

/* ============ Brand & nav ============ */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--s1);
}
.brand-mark {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--accent);
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s1);
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active {
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  color: var(--text);
}
.nav-label { flex: 1; }

.nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 99px;
  background: color-mix(in oklch, var(--green) 18%, transparent);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-badge-blue {
  background: color-mix(in oklch, var(--blue) 18%, transparent);
  color: var(--blue);
}

/* ============ Sidebar footer (token) ============ */

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-top: var(--s2);
  border-top: 1px solid var(--border);
}

.conn { display: flex; align-items: center; gap: 8px; padding: 0 2px var(--s1); }
.conn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  transition: background var(--t) var(--ease);
}
.conn-dot.live { background: var(--green); }
.conn-dot.down { background: var(--red); }
.conn-text { font-size: 12px; color: var(--text-2); }

.token-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.token-row { display: flex; gap: var(--s1); }
.token-row input { flex: 1; min-width: 0; }
.token-hint { font-size: 11px; color: var(--text-2); line-height: 1.45; }

/* ============ Inputs & buttons ============ */

.input, input[type="password"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  outline: none;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.input:focus, input:focus, select:focus {
  border-color: color-mix(in oklch, var(--accent) 55%, var(--border));
  background: var(--surface-2);
}
::placeholder { color: var(--text-3); }

.btn {
  font: inherit;
  font-weight: 550;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: oklch(0.79 0.115 240); border-color: transparent; }

.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.btn-danger { background: transparent; border-color: var(--border); color: var(--red); }
.btn-danger:hover { background: color-mix(in oklch, var(--red) 12%, transparent); }

.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ============ Page head ============ */

.page-head { margin-bottom: var(--s4); }
.page-sub { color: var(--text-2); margin-top: 4px; max-width: 68ch; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--s5) 0 var(--s2);
}
.section-head:first-child { margin-top: 0; }
.section-title { color: var(--text); }

/* ============ Assignment banner ============ */

.assignment {
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--green) 30%, var(--border));
  border-radius: var(--r-md);
  padding: var(--s3);
  margin-bottom: var(--s4);
}
.assignment-top {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-bottom: var(--s2);
}
.assignment-alias { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.assignment-meta { color: var(--text-2); }
.assignment-ttl { color: var(--green); font-variant-numeric: tabular-nums; margin-left: auto; }
.assignment-steps { color: var(--text-2); margin-bottom: var(--s1); }
.assignment-note { color: var(--text-3); font-size: 13px; margin-top: var(--s2); }

.code-chip {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  max-width: 560px;
}
.code-chip code { flex: 1; font-size: 13px; overflow-x: auto; white-space: nowrap; }

/* ============ Platform cards ============ */

.agent-status { margin-bottom: var(--s2); }

.agent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: var(--s2);
  margin-bottom: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.agent-bar p { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.agent-actions { display: flex; gap: var(--s1); flex-wrap: wrap; justify-content: flex-end; }
.setup-result {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: var(--s2);
}
.setup-command {
  max-width: none;
  margin-top: var(--s1);
}
.setup-command code { white-space: normal; overflow-wrap: anywhere; }

.platform-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s2);
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 120px minmax(220px, 1.5fr);
  align-items: center;
  gap: var(--s2);
}
.platform-card:hover {
  border-color: var(--border-strong);
}
.platform-card.inactive { opacity: 0.55; }
.platform-card.inactive:hover { transform: none; box-shadow: none; }

.platform-name { font-weight: 600; font-size: 15px; }

.avail { display: flex; align-items: baseline; gap: 6px; }
.avail-num {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.avail-num.free { color: var(--green); }
.avail-num.full { color: var(--amber); }
.avail-of { color: var(--text-2); }

.avail-meter {
  display: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.avail-meter > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width 250ms var(--ease);
}
.avail-meter.empty > span { background: var(--amber); }

.platform-foot { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: var(--s1); }
.platform-foot .btn { width: 100%; }

/* skeleton loading cards */
.skeleton-card {
  height: 172px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* ============ Chips ============ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-green { background: color-mix(in oklch, var(--green) 14%, transparent); color: var(--green); }
.chip-amber { background: color-mix(in oklch, var(--amber) 14%, transparent); color: var(--amber); }
.chip-red   { background: color-mix(in oklch, var(--red)   14%, transparent); color: var(--red); }
.chip-blue  { background: color-mix(in oklch, var(--blue)  14%, transparent); color: var(--blue); }
.chip-grey  { background: #e7e9ed; color: var(--text-2); }
.muted { color: var(--text-3); }

/* ============ Tables ============ */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px var(--s2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  color: var(--text-3);
  font-weight: 550;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody tr { transition: background var(--t) var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr.needs-human { background: color-mix(in oklch, var(--red) 7%, transparent); }
tbody tr.needs-human:hover { background: color-mix(in oklch, var(--red) 11%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.account-actions { text-align: right; white-space: nowrap; }
.notice-human {
  margin: 0 0 var(--s2);
  padding: 10px var(--s2);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklch, var(--red) 35%, var(--border));
  background: color-mix(in oklch, var(--red) 8%, var(--surface));
  color: var(--text);
  font-size: 13px;
}
td .mono { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.ttl-cell { font-variant-numeric: tabular-nums; color: var(--text-2); }
.ttl-cell.low { color: var(--amber); }

/* ============ Stat cards (activity) ============ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s2);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s2) var(--s3);
}
.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* ============ Panels & empty states ============ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s4);
}
.panel-narrow { max-width: 560px; }
.panel-title { margin-bottom: var(--s1); }
.panel-text { color: var(--text-2); max-width: 62ch; }
.panel-text-sm { color: var(--text-3); font-size: 13px; margin-top: var(--s2); max-width: 62ch; }

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--text-2);
}
.empty-title { font-weight: 600; color: var(--text); margin-bottom: var(--s1); font-size: 15px; }
.empty p { max-width: 52ch; margin: 0 auto; }
.empty .btn { margin-top: var(--s3); }

.notice {
  border: 1px solid color-mix(in oklch, var(--amber) 30%, var(--border));
  background: color-mix(in oklch, var(--amber) 8%, transparent);
  border-radius: var(--r-sm);
  padding: 10px var(--s2);
  color: var(--amber);
  font-size: 13px;
  margin-bottom: var(--s2);
}

/* ============ Queue page ============ */

.queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s5);
  max-width: 480px;
  text-align: center;
}
.queue-pos {
  font-size: 56px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--blue);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.queue-pos-label { color: var(--text-2); margin-bottom: var(--s3); }
.queue-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.queue-live .conn-dot.live { animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

/* ============ Enroll ============ */

.enroll-form {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: var(--s1);
  margin: var(--s3) 0;
}
.enroll-form select { flex: 1; }

/* ============ Toasts ============ */

.toasts {
  position: fixed;
  top: var(--s2);
  right: var(--s2);
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  z-index: 100;
  max-width: 360px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 10px var(--s2);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toast-in 200ms var(--ease);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.toast::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
  background: var(--text-3);
}
.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.info::before { background: var(--blue); }
.toast.leaving { opacity: 0; transform: translateX(8px); transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
}

/* ============ Responsive ============ */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .main { padding: var(--s3) var(--s2); }
  .agent-bar { align-items: flex-start; flex-direction: column; }
  .agent-actions { justify-content: flex-start; }
  .platform-card { grid-template-columns: 1fr 1fr; }
  .platform-foot { grid-column: 1 / -1; }
  .table-wrap { overflow-x: auto; }
}

@media (max-width: 560px) {
  .platform-card { grid-template-columns: 1fr; }
  .platform-foot { grid-column: auto; grid-template-columns: 1fr; }
  .agent-actions { display: grid; width: 100%; }
  .agent-actions .btn { min-height: 44px; text-align: center; }
  .enroll-form { grid-template-columns: 1fr; }
}

/* First-run welcome panel (no token yet) */
.welcome-panel {
  grid-column: 1 / -1;
  max-width: 560px;
  margin: 48px auto;
  padding: 28px 32px;
  text-align: left;
}
.welcome-panel h2 { margin: 0 0 12px; font-size: 22px; }
.welcome-panel .panel-text { margin: 0 0 10px; line-height: 1.55; }

/* Checkout account dropdown */
.account-select {
  width: 100%;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Analytics extends the dispatch console: readable rows, not decorative cards. */
.analytics-controls { display:flex; flex-wrap:wrap; gap:16px; align-items:end; }
.analytics-controls label { display:grid; gap:6px; font-size:12px; font-weight:600; }
.analytics-controls select { min-width:160px; min-height:44px; }
.analytics-controls .btn { min-height:44px; }
.analytics-status { color:var(--text-2); margin:12px 0 24px; }
.analytics-error { color:oklch(0.45 0.16 25); }
.analytics-summary { display:flex; flex-wrap:wrap; gap:20px 32px; padding:20px 0; border-block:1px solid var(--border); }
.analytics-summary dt { font-size:12px; color:var(--text-2); }
.analytics-summary dd { font-size:18px; font-weight:650; margin-top:4px; font-variant-numeric:tabular-nums; }
.analytics-section { margin:32px 0; }
.analytics-section h2 { margin-bottom:10px; font-size:16px; }
.analytics-note { max-width:75ch; color:var(--text-2); margin:8px 0 14px; }
.analytics-detail { display:block; font-size:12px; color:var(--text-2); margin-top:4px; }
.analytics-id { overflow-wrap:anywhere; font-family:var(--mono); font-size:12px; }
.analytics-table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
.analytics-empty { padding:20px; color:var(--text-2); }
@media (max-width:760px) {
  #page-activity .table-wrap { overflow:visible; }
  .analytics-table thead { display:none; }
  .analytics-table, .analytics-table tbody, .analytics-table tr, .analytics-table td { display:block; width:100%; }
  .analytics-table tr { padding:12px; border-bottom:1px solid var(--border); }
  .analytics-table td { display:grid; grid-template-columns:105px minmax(0,1fr); gap:8px; padding:6px 0; border:0; }
  .analytics-table td::before { content:attr(data-label); font-size:12px; color:var(--text-2); font-weight:600; }
  .analytics-table td > .analytics-detail { grid-column:2; }
  .analytics-controls label { flex:1; }
  .analytics-controls select { min-width:0; width:100%; }
}

/* ============ Account health ============
   Green means one thing here: the platform accepted the login on a recent check.
   Text uses darker ink variants of the state hues so it stays readable on white. */
:root {
  --red-ink:   oklch(0.48 0.17 25);
  --amber-ink: oklch(0.50 0.11 75);
}

/* Let the content column shrink below the table's natural width so a wide table
   scrolls inside its card instead of widening the whole page. */
.main { min-width: 0; }

/* Ten columns plus a two-line reason: tight cells, and scroll rather than clip when the
   viewport is still too narrow. The phone layout below stacks rows instead. */
#accounts-table-wrap { overflow-x: auto; }
/* Always-visible scrollbar: an overlay one hides, and the action buttons live at the far end. */
#accounts-table-wrap::-webkit-scrollbar { height: 10px; }
#accounts-table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
#accounts-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.accounts-table th, .accounts-table td { padding: 10px 10px; }
.accounts-table th:first-child, .accounts-table td:first-child { padding-left: var(--s2); }
.accounts-table th:last-child, .accounts-table td:last-child { padding-right: var(--s2); }
.accounts-table td.mono { font-size: 12px; min-width: 78px; }
.accounts-table td.account-actions { white-space: normal; min-width: 150px; max-width: 230px; }
.accounts-table td.account-actions .btn { margin: 0 0 4px 4px; }

.health-cell { min-width: 190px; max-width: 280px; white-space: normal; }
.health-reason {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.health-proven { margin-top: 2px; font-size: 12px; color: var(--text-3); }

/* Platform card with no usable account: red line, never a plain "0 free". */
.platform-card.no-usable {
  border-color: color-mix(in oklch, var(--red) 40%, var(--border));
  background: color-mix(in oklch, var(--red) 5%, var(--surface));
}
.platform-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--red-ink);
}
.platform-warn .chip-dot { background: var(--red); }

/* Admin health banner and recent alerts */
.health-banner {
  margin: 0 0 var(--s2);
  padding: 12px var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13px;
}
.health-banner-red {
  border-color: color-mix(in oklch, var(--red) 35%, var(--border));
  background: color-mix(in oklch, var(--red) 8%, var(--surface));
}
.health-banner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px var(--s2);
}
.health-banner-red .health-banner-head strong { color: var(--red-ink); }
.health-counts { color: var(--text-2); }
.health-mail { font-size: 12px; font-weight: 600; white-space: nowrap; }
.health-mail-on { color: var(--text-2); }
.health-mail-off { color: var(--red-ink); }
.health-note { margin-top: 6px; color: var(--text-2); }
.health-alerts-title {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-weight: 550;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.health-alerts { list-style: none; margin-top: 6px; }
.health-alerts li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 2px 12px;
  padding: 4px 0;
}
.health-alert-time { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.health-alert-subject, .health-alert-error { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-alert-error { grid-column: 2 / -1; font-size: 12px; color: var(--amber-ink); }
.health-alerts .chip-amber { color: var(--amber-ink); }

@media (max-width: 860px) {
  .platform-warn { grid-column: 1 / -1; }
}

/* Phone: each account becomes a stacked card (DESIGN.md: rows stack at 760px and below). */
@media (max-width: 760px) {
  #accounts-table-wrap { overflow: hidden; }
  .accounts-table thead { display: none; }
  .accounts-table, .accounts-table tbody, .accounts-table tr, .accounts-table td { display: block; width: 100%; }
  .accounts-table tr { padding: 12px var(--s2); border-bottom: 1px solid var(--border); }
  .accounts-table tbody tr:last-child { border-bottom: 0; }
  .accounts-table td, .accounts-table td:first-child, .accounts-table td:last-child {
    border: 0;
    padding: 5px 0;
    min-width: 0;
    max-width: none;
  }
  .accounts-table td[data-label] {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }
  .accounts-table td[data-label]::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    font-family: var(--font);
  }
  .accounts-table td.account-alias { display: block; font-size: 15px; padding-bottom: 6px; }
  .accounts-table td.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    padding-top: 10px;
  }
  .accounts-table td.account-actions .btn { min-height: 44px; margin: 0; }
  .accounts-table .deadline-row td { padding: 0; }
  .health-alerts li { grid-template-columns: minmax(0, 1fr) max-content; }
  .health-alert-time { grid-column: 1 / -1; }
  .health-alert-subject { white-space: normal; }
  .health-alert-error { grid-column: 1 / -1; white-space: normal; }
}

/* ============ Home services (Jaeger) ============
   Same table as Accounts, so it shares .accounts-table. Amber ink on a low wallet reads on white. */
#jaeger-section { margin-top: var(--s5); }
#jaeger-section .notice { margin-bottom: var(--s2); }
#jaeger-table-wrap { overflow-x: auto; }
.jaeger-table td.account-actions { min-width: 120px; }
.wallet-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-low { color: var(--amber-ink); }
.jaeger-failed { color: var(--red-ink); }
.jaeger-personal { margin-top: var(--s2); }

/* ============ Delivery (Porter) ============
   Same table as Accounts and the Jaeger section; the wallet colours are shared. */
#porter-section { margin-top: var(--s5); }
#porter-section .notice { margin-bottom: var(--s2); }
#porter-table-wrap { overflow-x: auto; }
.porter-line { margin-top: var(--s2); }
.porter-failed { color: var(--red-ink); }
@media (max-width: 760px) {
  #porter-table-wrap { overflow: hidden; }
}
@media (max-width: 760px) {
  #jaeger-table-wrap { overflow: hidden; }
  .jaeger-table td.account-actions { min-width: 0; }
}
