  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 2rem;
  }
  header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
    border-bottom: 1px solid #1a1a2e;
    padding-bottom: 1rem;
  }
  h1 { font-size: 1.4rem; font-weight: 600; color: #f0f0f0; }
  .updated { font-size: 0.8rem; color: #666; }
  .empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.8;
  }
  .empty code {
    background: #151520;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #8b8bcd;
  }
  .accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1.5rem; }
  .account {
    background: #111118;
    border: 1px solid #1e1e30;
    border-radius: 10px;
    padding: 1.5rem;
  }
  .account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
  }
  .account-name { font-size: 1.1rem; font-weight: 600; }
  .account-email { font-size: 0.75rem; color: #666; }
  .last-seen { font-size: 0.7rem; color: #555; }
  .section { margin-bottom: 1.5rem; }
  .section:last-child { margin-bottom: 0; }
  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
  }
  .section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
  }
  .section-actions { display: flex; gap: 0.4rem; }
  .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #2a2a40;
    background: #15151f;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn:hover { border-color: #444; color: #ccc; background: #1a1a2a; }
  .btn.new-window { border-color: #1a4a3a; color: #4a9; }
  .btn.new-window:hover { background: #1a3a2a; color: #6db; }
  .btn.hit-limit { border-color: #4a2a1a; color: #c86; }
  .btn.hit-limit:hover { background: #3a2a1a; color: #ea8; }
  .btn.calibrate { border-color: #2a2a5a; color: #88b; }
  .btn.calibrate:hover { background: #1f1f3a; color: #acd; }
  .btn.flash { animation: btnflash 0.4s ease; }
  @keyframes btnflash {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
  }
  .stats-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
  }
  .stat-pct {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
  }
  .stat-pct.low { color: #2ecc71; }
  .stat-pct.mid { color: #f0c040; }
  .stat-pct.high { color: #e74c3c; }
  .stat-pct.unknown { color: #555; }
  .stat-tokens {
    font-size: 1.1rem;
    color: #888;
    font-weight: 500;
  }
  .stat-limit {
    font-size: 0.85rem;
    color: #555;
  }
  .bar-wrap {
    background: #1a1a28;
    border-radius: 6px;
    height: 10px;
    position: relative;
    overflow: hidden;
  }
  .bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease, background 0.6s ease;
    min-width: 2px;
  }
  .bar-fill.low { background: linear-gradient(90deg, #1a6b3c, #2ecc71); }
  .bar-fill.mid { background: linear-gradient(90deg, #b8860b, #f0c040); }
  .bar-fill.high { background: linear-gradient(90deg, #c0392b, #e74c3c); }
  .bar-fill.unknown { background: #333; width: 100% !important; }
  .meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: #555;
  }
  .cost { color: #6a6aad; }
  .reset-time { color: #555; }
  .breakdown {
    display: flex;
    gap: 1rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: #666;
  }
  .breakdown .up { color: #7a9ec2; }
  .breakdown .down { color: #c29a7a; }
  .model-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
    margin-top: 0.3rem;
    font-size: 0.65rem;
    color: #555;
  }
  .model-breakdown span { white-space: nowrap; }
  .model-breakdown .model-name { color: #8b8bcd; }
  .model-breakdown .model-pct { color: #666; }
  .override-badge {
    font-size: 0.6rem;
    background: #1f1f3a;
    color: #88b;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.3rem;
    vertical-align: middle;
    cursor: help;
  }
  .est-badge, .pin-badge {
    font-size: 0.6rem;
    background: #2a2a3a;
    color: #777;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.3rem;
    vertical-align: middle;
    font-style: normal;
    text-transform: none;
    letter-spacing: 0;
  }
  .plan-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
    font-weight: 500;
  }
  .plan-max_20x { background: #2a2a5a; color: #9b9bdd; }
  .plan-max { background: #2a2a4a; color: #8b8bcd; }
  .plan-team_premium { background: #2a4a2a; color: #7b7; }
  .plan-team_pro { background: #2a3a2a; color: #6a6; }
  .plan-free { background: #2a2a2a; color: #888; }
  .plan-unknown { background: #1a1a1a; color: #555; }
  .pin-badge { background: #2a3a2a; color: #6a6; cursor: pointer; }
  .pin-badge:hover { background: #3a4a3a; color: #8c8; }
  .pin-badge.unpinned { background: #3a2a2a; color: #a66; }
  .pin-badge.unpinned:hover { background: #4a3a3a; color: #c88; }
  .btn-delete {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #3a1a1a;
    background: #1a1012;
    color: #744;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-delete:hover { border-color: #5a2a2a; color: #a66; background: #2a1518; }
  .btn-delete.confirming { border-color: #a33; color: #e55; background: #3a1520; animation: pulse-delete 0.6s ease infinite alternate; }
  @keyframes pulse-delete { from { opacity: 0.8; } to { opacity: 1; } }
  .timeline-wrap {
    margin-top: 0.8rem;
    background: #0e0e16;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 0.8rem;
    display: none;
  }
  .timeline-wrap.open { display: block; }
  .timeline-toggle {
    font-size: 0.65rem;
    color: #555;
    cursor: pointer;
    margin-top: 0.4rem;
    text-align: center;
  }
  .timeline-toggle:hover { color: #888; }
  .timeline-canvas { width: 100%; height: 120px; }
  .toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1a1a2e;
    border: 1px solid #2a2a44;
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    font-size: 0.82rem;
    color: #ccc;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
  }
  .toast.show { opacity: 1; transform: translateY(0); }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: #13131f;
    border: 1px solid #2a2a44;
    border-radius: 10px;
    padding: 1.4rem 1.6rem;
    min-width: 340px;
    max-width: 460px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }
  .modal h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.3rem;
  }
  .modal .sub {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 1rem;
  }
  .modal .field { margin-bottom: 1rem; }
  .modal .field label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
  }
  .modal .field input[type=number] {
    width: 100%;
    padding: 0.5rem 0.6rem;
    background: #0d0d15;
    border: 1px solid #2a2a40;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 0.95rem;
  }
  .modal .field input[type=number]:focus {
    outline: none;
    border-color: #4a4a8a;
  }
  .modal .preview {
    background: #0d0d15;
    border: 1px solid #1f1f30;
    border-radius: 5px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    color: #aaa;
    line-height: 1.5;
  }
  .modal .preview .preview-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
  .modal .preview .preview-label { color: #666; }
  .modal .preview .preview-value { color: #ccd; font-variant-numeric: tabular-nums; }
  .modal .preview .preview-value.new { color: #88b; font-weight: 600; }
  .modal .preview .preview-value.error { color: #e55; }
  .modal .actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    align-items: center;
  }
  .modal input[type=password], .modal input[type=text].token-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    background: #0d0d15;
    border: 1px solid #2a2a40;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  }
  .modal input[type=password]:focus { outline: none; border-color: #4a4a8a; }
  .modal .auth-error {
    color: #e55;
    font-size: 0.78rem;
    background: #1a1010;
    border: 1px solid #3a1a1a;
    border-radius: 4px;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.8rem;
    display: none;
  }
  .modal .auth-error.shown { display: block; }
  .modal .link-btn {
    background: none;
    border: none;
    color: #6a6acd;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    margin-right: auto;
  }
  .modal .link-btn:hover { color: #8b8bcd; }
  .ctx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.8rem;
  }
  .ctx-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #aaa;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
  }
  .ctx-item.ctx-other { grid-column: 1 / -1; }
  .ctx-item input[type=number],
  .ctx-item input[type=text] {
    flex: 1;
    padding: 0.35rem 0.5rem;
    background: #0d0d15;
    border: 1px solid #2a2a40;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.82rem;
  }
  .ctx-item input[type=number]:focus,
  .ctx-item input[type=text]:focus { outline: none; border-color: #4a4a8a; }
  .ctx-item input[type=checkbox] { accent-color: #88b; }
  .toolbar {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
  }
  .toolbar select, .toolbar input {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #2a2a40;
    background: #15151f;
    color: #aaa;
    outline: none;
  }
  .toolbar select:focus, .toolbar input:focus { border-color: #444; }
  .toolbar label {
    font-size: 0.68rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .toolbar .count { font-size: 0.7rem; color: #444; margin-left: auto; }
  .settings-toggle {
    font-size: 0.6rem;
    color: #444;
    cursor: pointer;
    text-align: center;
    margin-top: 0.6rem;
    padding: 0.2rem;
  }
  .settings-toggle:hover { color: #888; }
  .settings-panel {
    display: none;
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: #0e0e16;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
  }
  .settings-panel.open { display: block; }
  .settings-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .settings-row:last-child { margin-bottom: 0; }
  .settings-row label {
    font-size: 0.68rem;
    color: #555;
    min-width: 3.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .settings-row input, .settings-row select {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #2a2a40;
    background: #15151f;
    color: #aaa;
    outline: none;
    flex: 1;
  }
  .settings-row input:focus, .settings-row select:focus { border-color: #444; }
  .settings-row .btn { margin-left: auto; }
  .account.hidden-account { opacity: 0.45; }
  .account.ignored-account { opacity: 0.3; border-style: dashed; }
  .health-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.25rem; }
  .health-badge {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
    line-height: 1.3;
  }
  .health-ok { background: #1a2a1a; color: #4a8; }
  .health-warn { background: #2a2a1a; color: #aa8; }
  .health-error { background: #2a1a1a; color: #a66; }

  /* --- Nav / tabs --- */
  nav.tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #1a1a2e;
    flex-wrap: wrap;
  }
  nav.tabs button {
    font: inherit;
    font-size: 0.82rem;
    padding: 0.55rem 1rem;
    background: transparent;
    color: #666;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
  }
  nav.tabs button:hover { color: #bbb; }
  nav.tabs button.active { color: #e0e0e0; border-bottom-color: #6a6acd; }
  nav.tabs .nav-spacer { flex: 1; }
  nav.tabs .conn-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #555;
    margin-right: 0.4rem;
    vertical-align: middle;
  }
  nav.tabs .conn-dot.connected { background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
  nav.tabs .conn-dot.error { background: #e74c3c; }
  .tab { display: none; }
  .tab.active { display: block; }

  /* --- Generic card / section styles for new tabs --- */
  .card {
    background: #111118;
    border: 1px solid #1e1e30;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .card h2 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b8bcd;
    margin-bottom: 1rem;
  }
  .card h2 .hint {
    text-transform: none;
    letter-spacing: 0;
    color: #555;
    font-weight: 400;
    font-size: 0.78rem;
    margin-left: 0.8rem;
  }
  .card .caveat {
    font-size: 0.72rem;
    color: #888;
    background: #1a1a1a;
    border-left: 2px solid #4a4a1a;
    padding: 0.5rem 0.8rem;
    margin-bottom: 1rem;
    border-radius: 3px;
    line-height: 1.5;
  }
  .card .loading, .card .empty-inline {
    color: #555;
    font-size: 0.85rem;
    padding: 1rem 0;
    text-align: center;
  }
  .card .error-msg {
    color: #c86;
    font-size: 0.8rem;
    padding: 0.6rem;
    background: #1a1010;
    border-radius: 4px;
    border: 1px solid #3a1a1a;
  }

  /* Grid for exec summary metrics */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
  }
  .kpi {
    background: #0e0e16;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    padding: 0.9rem 1rem;
  }
  .kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 0.3rem;
  }
  .kpi-value {
    font-size: 1.45rem;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.2;
  }
  .kpi-sub {
    font-size: 0.72rem;
    color: #777;
    margin-top: 0.25rem;
  }
  .kpi-trend.up { color: #e74c3c; }
  .kpi-trend.down { color: #2ecc71; }
  .kpi-trend.flat { color: #777; }

  /* Tables */
  table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
  }
  table.data th, table.data td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #1a1a2e;
  }
  table.data th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
    font-weight: 500;
    background: #0c0c14;
  }
  table.data td { color: #bbb; }
  table.data td.num { text-align: right; font-variant-numeric: tabular-nums; color: #999; }
  table.data tr:hover td { background: #15151f; }
  table.data .rec-icon { display: inline-block; margin-right: 0.3rem; font-weight: 700; }
  table.data .rec-down { color: #2ecc71; }
  table.data .rec-up { color: #e6a850; }
  table.data .rec-same { color: #666; }
  table.data .rec-na { color: #555; }

  /* Gauge bars */
  .gauge-row {
    display: grid;
    grid-template-columns: 80px 1fr 110px;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
  }
  .gauge-row .g-label { color: #888; text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.08em; }
  .gauge-row .g-bar-wrap {
    background: #1a1a28;
    height: 14px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }
  .gauge-row .g-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a3a5a, #6a8acd);
    border-radius: 4px;
    transition: width 0.4s ease;
  }
  .gauge-row .g-val { color: #bbb; text-align: right; font-variant-numeric: tabular-nums; }

  /* Sessions-per-day bar chart */
  .spd-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    height: 120px;
    border-bottom: 1px solid #1e1e30;
    padding-bottom: 0.2rem;
  }
  .spd-chart .spd-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    height: 100%;
  }
  .spd-chart .spd-bar {
    width: 70%;
    background: linear-gradient(180deg, #6a6acd, #3a3a7a);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
    position: relative;
  }
  .spd-chart .spd-count { font-size: 0.62rem; color: #888; }
  .spd-labels {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
    font-size: 0.6rem;
    color: #555;
  }
  .spd-labels span { flex: 1; text-align: center; }

  /* Heatmap */
  .heatmap-wrap { overflow-x: auto; }
  table.heatmap { border-collapse: separate; border-spacing: 1px; font-size: 0.62rem; }
  table.heatmap th {
    font-weight: 400;
    color: #555;
    padding: 0.15rem 0.25rem;
    text-align: center;
    min-width: 18px;
  }
  table.heatmap td.dayname {
    color: #888;
    padding-right: 0.6rem;
    text-align: right;
    font-weight: 500;
  }
  table.heatmap td.cell {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background: #0e0e16;
    cursor: default;
    transition: transform 0.1s;
  }
  table.heatmap td.cell:hover { transform: scale(1.5); z-index: 10; position: relative; outline: 1px solid #6a6acd; }
  .heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.8rem;
    font-size: 0.65rem;
    color: #666;
    justify-content: flex-end;
  }
  .heatmap-legend .lg-box { width: 14px; height: 14px; border-radius: 2px; }

  /* Live events feed */
  .sse-feed {
    max-height: 600px;
    overflow-y: auto;
    background: #0a0a11;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 0.5rem;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 0.75rem;
  }
  .sse-item {
    display: grid;
    grid-template-columns: 90px 160px 1fr;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #141420;
    align-items: start;
  }
  .sse-item:last-child { border-bottom: none; }
  .sse-time { color: #555; white-space: nowrap; }
  .sse-type {
    font-size: 0.62rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-align: center;
    background: #2a2a3a;
    color: #bbb;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: inherit;
    align-self: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sse-type.ingest { background: #1a2a3a; color: #7aa; }
  .sse-type.limit_hit { background: #3a1a1a; color: #e55; }
  .sse-type.limit_approaching { background: #3a2a0a; color: #eb6; }
  .sse-type.window_reset { background: #1a3a2a; color: #6c8; }
  .sse-type.calibration_rejected, .sse-type.calibration_accepted { background: #2a1a3a; color: #b9d; }
  .sse-type.telemetry_stale { background: #2a2a1a; color: #cc8; }
  .sse-details { color: #999; word-break: break-word; white-space: pre-wrap; }

  /* Team cards */
  .team-row {
    background: #0e0e16;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
  }
  .team-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
  }
  .team-head:hover { background: #131320; }
  .team-head .team-name { font-weight: 600; color: #e0e0e0; }
  .team-head .team-count { font-size: 0.72rem; color: #666; margin-left: 0.6rem; }
  .team-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid #1a1a2e;
    display: none;
  }
  .team-row.open .team-body { display: block; }
  .team-actions { display: flex; gap: 0.4rem; align-items: center; }

  /* Forms */
  .form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
  }
  .form-row input[type=text], .form-row input[type=url], .form-row input[type=email], .form-row input[type=number], .form-row select {
    font-size: 0.78rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #2a2a40;
    background: #15151f;
    color: #ccc;
    outline: none;
    min-width: 200px;
  }
  .form-row input:focus, .form-row select:focus { border-color: #444; }
  .form-row label.chk {
    font-size: 0.72rem;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: none;
    letter-spacing: 0;
  }
  .btn-primary {
    font-size: 0.78rem;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    border: 1px solid #3a3a6a;
    background: #1a1a3a;
    color: #b8b8ff;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-primary:hover { background: #25254a; border-color: #5a5a8a; color: #ccf; }

  @media (max-width: 600px) {
    body { padding: 0.8rem; }
    header { margin-bottom: 1rem; padding-bottom: 0.6rem; }
    h1 { font-size: 1.1rem; }
    .accounts { grid-template-columns: 1fr; gap: 1rem; }
    .account { padding: 1rem; }
    .account-name { font-size: 0.95rem; }
    .stat-pct { font-size: 1.5rem; }
    .stat-tokens { font-size: 0.9rem; }
    .btn, .btn-delete { font-size: 0.7rem; padding: 0.35rem 0.6rem; min-height: 32px; }
    .section-head { flex-wrap: wrap; gap: 0.4rem; }
    .section-actions { width: 100%; justify-content: flex-end; }
    .toolbar { gap: 0.4rem; }
    .toolbar select, .toolbar input { font-size: 0.8rem; padding: 0.4rem 0.5rem; min-height: 36px; }
    .toast { bottom: 1rem; right: 1rem; left: 1rem; text-align: center; }
    nav.tabs { gap: 0; overflow-x: auto; }
    nav.tabs button { font-size: 0.75rem; padding: 0.5rem 0.6rem; white-space: nowrap; }
    .sse-item { grid-template-columns: 1fr; gap: 0.2rem; }
    .gauge-row { grid-template-columns: 60px 1fr 90px; font-size: 0.7rem; }
    table.data { font-size: 0.72rem; }
    table.data th, table.data td { padding: 0.35rem 0.4rem; }
  }

/* Prompts & tools viewer (UL-CO student-org) */
.prompts-clickable { cursor: pointer; }
table.data tr.prompts-clickable:hover td { background: #1a1a2a; }
.prompts-turn {
  border-left: 2px solid #2a2a4a;
  padding: 0.2rem 0 0.2rem 0.8rem;
  margin: 0.9rem 0;
}
.prompts-prompt-text {
  background: #0e0e16;
  border: 1px solid #1a1a2e;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.3rem;
  color: #d6d6e6;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
}
.prompts-tools { margin: 0.4rem 0 0 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; }
.prompts-tool {
  border: 1px solid #1a1a2e;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  background: #0c0c14;
  font-size: 0.78rem;
}
.prompts-tool-name { color: #88b; font-weight: 600; margin-right: 0.4rem; }
.prompts-cmd {
  margin: 0.35rem 0 0;
  padding: 0.4rem 0.6rem;
  background: #08080e;
  border-radius: 4px;
  color: #9a9; 
  font-size: 0.74rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
