/* ============================================================================
   Session Replay Viewer — MudBlazor overrides + feature styles
   Everything here reads the --kt-* tokens from app.css (current KidsTime web standard), so
   light <-> dark flips with html[data-theme]. MudBlazor components are mapped onto the KidsTime
   building blocks: outlined cards with a light shadow, pill buttons (Filled Primary = the one yellow
   action, Outlined = tonal secondary, Error = red), tinted status tags, segmented filters, pill tabs,
   and tables rendered as list-row cards.
   ============================================================================ */

/* --- Typography ----------------------------------------------------------- */
body, .mud-typography, .mud-input, .mud-button-root, input, textarea, select, button {
    font-family: "Poppins", sans-serif;
}
.mud-typography-h3, .mud-typography-h4, .mud-typography-h5, .mud-typography-h6 { font-weight: 600; letter-spacing: -0.01em; }
.mud-typography-subtitle2 { font-weight: 600; }
.mud-typography-caption { color: var(--kt-muted); }
/* Yellow / bright green / bright red fail contrast as text — coloured text uses the deeper inks. */
.mud-typography.mud-primary-text, .mud-link.mud-primary-text { color: var(--kt-action-text) !important; }
.mud-typography.mud-success-text, .mud-success-text { color: var(--kt-green-text) !important; }
.mud-typography.mud-warning-text, .mud-warning-text { color: var(--kt-yellow-ink) !important; }
.mud-typography.mud-error-text, td.mud-error-text, span.mud-error-text { color: var(--kt-red-text) !important; }
.mud-typography.mud-info-text { color: var(--kt-blue-ink) !important; }
.mud-typography.mud-secondary-text { color: var(--kt-purple-ink) !important; }
/* Headline numbers stay ink (the accent as text is reserved for links). */
.mud-typography-h3.mud-primary-text, .mud-typography-h4.mud-primary-text, .mud-typography-h5.mud-primary-text { color: var(--kt-ink) !important; }
.mud-link { font-weight: 600; text-underline-offset: 3px; }

/* Expansion panels (Organizations) == stacked cards. */
.mud-expand-panel { background: var(--kt-surface) !important; border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg) !important; box-shadow: var(--kt-card-shadow) !important; margin-bottom: 12px; }
.mud-expand-panel::before { display: none; }
.mud-expand-panel .mud-expand-panel-header { padding: 14px 20px; min-height: 56px; }

/* --- Cards: MudPaper Outlined == .kt-card ------------------------------------------------------ */
.mud-paper.mud-paper-outlined {
    background: var(--kt-surface);
    border: 1px solid var(--kt-border);
    border-radius: var(--kt-radius-lg);
    box-shadow: var(--kt-card-shadow);
}
.mud-paper.mud-paper-outlined .mud-paper.mud-paper-outlined { box-shadow: none; border-radius: var(--kt-radius-md); }

/* --- Dialogs: one centred semibold title, close in the corner, text Cancel + one yellow action ---- */
.mud-dialog { border-radius: var(--kt-radius-lg); border: 1px solid var(--kt-border); box-shadow: var(--kt-shadow-pop); }
.mud-dialog .mud-dialog-title { padding: 20px 56px 4px 24px; }
.mud-dialog .mud-dialog-title .mud-typography { font-weight: 600; font-size: 18px; }
.mud-dialog .mud-dialog-content { padding: 12px 24px; }
.mud-dialog .mud-dialog-actions { padding: 12px 24px 20px; gap: 8px; }
.mud-overlay-dark, .mud-overlay .mud-overlay-scrim.mud-overlay-dark { background-color: rgba(11, 16, 32, .5); }
.mud-popover.mud-paper { border-radius: var(--kt-radius-md); border: 1px solid var(--kt-border); box-shadow: var(--kt-shadow-pop); }
.mud-popover .mud-list-item { min-height: 40px; }
.mud-popover .mud-list-item:hover, .mud-popover .mud-list-item:focus-visible { background: var(--kt-tonal); }
.mud-popover .mud-list-item .mud-list-item-icon { min-width: 36px; color: var(--kt-muted); }
.mud-snackbar { border-radius: var(--kt-radius-md); font-weight: 500; }
.mud-tooltip { border-radius: var(--kt-radius-sm); background: var(--kt-navy); color: #fff; font-weight: 500; }

/* --- Buttons --------------------------------------------------------------------------------------
   Pill, semibold, sentence case, flat. Filled Primary = the view's single yellow action; Outlined (any
   colour) = tonal secondary; Filled/Text Error = destructive red with white text; Text = quiet link. */
.mud-button-root.mud-button {
    border-radius: var(--kt-button-radius);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    min-height: var(--kt-button-height);
    padding: 8px 20px;
    box-shadow: none !important;
}
.mud-button-root.mud-button[class*="-size-small"] { font-size: 12.5px; min-height: 32px; padding: 5px 14px; }
.mud-button-root.mud-button[class*="-size-large"] { font-size: 16px; min-height: 48px; padding: 10px 28px; }
.mud-button-root.mud-button .mud-button-icon-start { margin-left: 0; margin-right: 8px; }
.mud-button-root.mud-button .mud-button-icon-start .mud-icon-root,
.mud-button-root.mud-button .mud-button-icon-end .mud-icon-root { font-size: 1em; }

.mud-button-filled.mud-button-filled-primary { background-color: var(--kt-yellow); color: var(--kt-on-primary); }
.mud-button-filled.mud-button-filled-primary:hover { background-color: var(--kt-yellow-dark); }
.mud-button-filled.mud-button-filled-error { background-color: var(--kt-red); color: #fff; }
.mud-button-filled.mud-button-filled-error:hover { background-color: var(--kt-red-pressed); }
.mud-button-filled.mud-button-filled-default { background-color: var(--kt-tonal); color: var(--kt-ink); }
.mud-button-filled.mud-button-filled-default:hover { background-color: var(--kt-tonal-pressed); }

/* Outlined == tonal. A secondary yellow (Filled Primary next to the main action) opts in with .kt-tonal. */
.mud-button-outlined,
.mud-button-root.mud-button.kt-tonal {
    background-color: var(--kt-tonal);
    border-color: transparent !important;
    color: var(--kt-ink);
}
.mud-button-outlined:hover,
.mud-button-root.mud-button.kt-tonal:hover { background-color: var(--kt-tonal-pressed); }
.mud-button-outlined.mud-button-outlined-default,
.mud-button-outlined.mud-button-outlined-primary,
.mud-button-outlined.mud-button-outlined-secondary { color: var(--kt-ink); }
.mud-button-outlined.mud-button-outlined-success { background-color: var(--kt-green-bg); color: var(--kt-green-text); }
.mud-button-outlined.mud-button-outlined-warning { background-color: var(--kt-yellow-bg); color: var(--kt-yellow-ink); }
.mud-button-outlined.mud-button-outlined-info { background-color: var(--kt-blue-bg); color: var(--kt-blue-ink); }
.mud-button-outlined.mud-button-outlined-error,
.mud-button-text.mud-button-text-error { background-color: var(--kt-red); color: #fff; }
.mud-button-outlined.mud-button-outlined-error:hover,
.mud-button-text.mud-button-text-error:hover { background-color: var(--kt-red-pressed); }
.mud-button-outlined.mud-button-outlined-success:hover,
.mud-button-outlined.mud-button-outlined-warning:hover,
.mud-button-outlined.mud-button-outlined-info:hover { filter: brightness(.96); }

/* Toggle buttons (Fit, heatmap size buckets): the selected one is filled navy like a selected tab —
   a state, not an action, so it does not take the yellow fill. */
.mud-button-root.mud-button.kt-toggle.mud-button-filled-primary,
.mud-button-root.mud-button.kt-toggle.mud-button-filled-primary:hover { background-color: var(--kt-brand-fill); color: var(--kt-on-brand); }
.mud-button-root.mud-button.kt-toggle.mud-button-filled-primary .mud-typography { color: inherit !important; opacity: .85; }

.mud-button-text { color: var(--kt-ink); }
.mud-button-text:hover { background-color: var(--kt-tonal); }
.mud-button-text.mud-button-text-primary { color: var(--kt-action-text); }
.mud-button-text.mud-button-text-default { color: var(--kt-ink); }

.mud-button-root.mud-button.mud-disabled,
.mud-button-root.mud-button:disabled { background-color: var(--kt-grey-bg) !important; color: var(--kt-muted) !important; opacity: .65; }
.mud-button-text.mud-disabled, .mud-button-text:disabled { background-color: transparent !important; }

/* Icon buttons are round; in rows they are 36px tiles (KidsTime RowActionButton): tonal, red tint for delete. */
.mud-button-root.mud-icon-button { border-radius: 50%; }
.mud-button-root.mud-icon-button.mud-icon-button-size-small { min-width: 36px; min-height: 36px; font-size: 14px; }
.mud-button-root.mud-icon-button.mud-icon-button-size-small .mud-icon-root { font-size: 14px; }
.mud-button-root.mud-icon-button.mud-icon-button-size-small:not(.mud-button-filled) { border-radius: 12px; background: var(--kt-tonal); color: var(--kt-ink); }
.mud-button-root.mud-icon-button.mud-icon-button-size-small:not(.mud-button-filled):hover { background: var(--kt-tonal-pressed); }
.mud-button-root.mud-icon-button.mud-icon-button-size-small.mud-error-text { background: var(--kt-red-bg); color: var(--kt-red-text) !important; }
.mud-button-root.mud-icon-button.mud-icon-button-size-small.mud-error-text:hover { background: var(--kt-red-border); }
.mud-button-root.mud-icon-button.mud-disabled { opacity: .45; }
.mud-input-adornment .mud-button-root.mud-icon-button.mud-icon-button-size-small { background: transparent; min-width: 32px; min-height: 32px; }

/* --- Status tags (MudChip): pill, tinted background + darker text; never white on a bright fill ----- */
.mud-chip { border-radius: 999px; font-weight: 600; letter-spacing: 0; }
.mud-chip.mud-chip-size-small { font-size: 11.5px; height: 24px; }
.mud-chip-filled.mud-chip-color-primary { background: var(--kt-yellow); color: var(--kt-on-primary); }
.mud-chip-text.mud-chip-color-primary, .mud-chip-text.mud-chip-color-warning,
.mud-chip-filled.mud-chip-color-warning { background: var(--kt-yellow-bg); color: var(--kt-yellow-ink); }
.mud-chip-text.mud-chip-color-success, .mud-chip-text.mud-chip-color-tertiary,
.mud-chip-filled.mud-chip-color-success, .mud-chip-filled.mud-chip-color-tertiary { background: var(--kt-green-bg); color: var(--kt-green-text); }
.mud-chip-text.mud-chip-color-error, .mud-chip-filled.mud-chip-color-error { background: var(--kt-red-bg); color: var(--kt-red-text); }
.mud-chip-text.mud-chip-color-info, .mud-chip-filled.mud-chip-color-info { background: var(--kt-blue-bg); color: var(--kt-blue-ink); }
.mud-chip-text.mud-chip-color-secondary, .mud-chip-filled.mud-chip-color-secondary { background: var(--kt-purple-bg); color: var(--kt-purple-ink); }
.mud-chip-text.mud-chip-color-default, .mud-chip-text:not([class*="mud-chip-color-"]),
.mud-chip-filled.mud-chip-color-default, .mud-chip-filled.mud-chip-color-dark { background: var(--kt-grey-bg); color: var(--kt-grey-ink); }
/* Outlined chips: quiet outlined pills (labels / removable filters). */
.mud-chip.mud-chip-outlined { border: 1px solid var(--kt-border); background: var(--kt-surface); color: var(--kt-ink); font-weight: 500; }
.mud-chip.mud-chip-outlined.mud-chip-color-error { color: var(--kt-red-text); border-color: var(--kt-red-border); }
.mud-chip.mud-chip-outlined.mud-chip-color-warning { color: var(--kt-yellow-ink); border-color: var(--kt-yellow-border); }
.mud-chip.mud-chip-outlined.mud-chip-color-success { color: var(--kt-green-text); border-color: var(--kt-green-border); }
.mud-chip.mud-chip-outlined.mud-chip-color-info { color: var(--kt-blue-ink); }
.mud-chip.mud-chip-outlined.mud-clickable:hover { background: var(--kt-surface-hover); }
.mud-chip .mud-chip-close-button, .mud-chip .mud-button-root.mud-icon-button.mud-icon-button-size-small { color: inherit; opacity: .7; background: transparent !important; min-width: 0; min-height: 0; border-radius: 50%; }

/* --- Segmented filters: MudChipSet (single choice) and MudToggleGroup ------------------------------
   KidsTime SegmentedFilter: tonal track, the selected segment is a raised surface pill with ink text.
   A filter is not an action, so it never takes the yellow fill. */
.mud-chipset { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 20px; background: var(--kt-tonal); vertical-align: middle; }
.mud-chipset .mud-chip,
.mud-chipset .mud-chip.mud-chip-outlined {
    margin: 0; height: 32px; padding: 0 14px; border: 0 !important; background: transparent !important;
    color: var(--kt-muted) !important; font-size: 13px; font-weight: 500; text-transform: none;
}
.mud-chipset .mud-chip.mud-clickable:hover { color: var(--kt-ink) !important; }
.mud-chipset .mud-chip.mud-chip-selected,
.mud-chipset .mud-chip.mud-chip-outlined.mud-chip-selected {
    background: var(--kt-surface) !important; color: var(--kt-ink) !important; font-weight: 600; box-shadow: var(--kt-card-shadow);
}
.mud-chipset .mud-chip .mud-chip-icon { display: none; }

.mud-toggle-group { border: 0 !important; border-radius: 999px !important; background: var(--kt-tonal); padding: 4px; gap: 2px; display: inline-grid; min-width: 0; }
.mud-toggle-group .mud-toggle-item {
    border: 0 !important; border-radius: 999px !important; background: transparent; color: var(--kt-muted);
    text-transform: none; font-weight: 500; font-size: 13px; min-height: 32px; padding: 4px 16px;
}
.mud-toggle-group .mud-toggle-item:hover { color: var(--kt-ink); background: transparent; }
.mud-toggle-group .mud-toggle-item.mud-toggle-item-selected,
.mud-toggle-group .mud-toggle-item.mud-toggle-item-selected:hover {
    background: var(--kt-surface) !important; color: var(--kt-ink) !important; font-weight: 600; box-shadow: var(--kt-card-shadow);
}
.mud-toggle-group .mud-toggle-item .mud-button-label { color: inherit; }
.mud-toggle-group .mud-toggle-item-check-icon { display: none; }

/* --- Inputs ------------------------------------------------------------------ */
.mud-input.mud-input-outlined { background: var(--kt-surface); border-radius: var(--kt-radius-md); }
.mud-input.mud-input-outlined .mud-input-outlined-border { border-radius: var(--kt-radius-md); border-color: var(--kt-input-border); }
.mud-input.mud-input-outlined:hover .mud-input-outlined-border { border-color: var(--kt-border-strong); }
/* Focus: ink outline + yellow halo (yellow alone is 1.6:1 against the field — not a visible focus). */
.mud-input.mud-input-outlined.mud-focused .mud-input-outlined-border { border-color: var(--kt-ink); border-width: 2px; }
.mud-input.mud-input-outlined.mud-focused { box-shadow: 0 0 0 3px color-mix(in srgb, var(--kt-yellow) 45%, transparent); }
.mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border { border-color: var(--kt-red-text); }
.mud-input-label.mud-input-label-outlined { background: transparent; }
.mud-input-label { color: var(--kt-muted); }
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol.mud-focused { color: var(--kt-ink); }
.mud-input > input.mud-input-root::placeholder, .mud-input > textarea.mud-input-root::placeholder { color: var(--kt-icon-muted); opacity: 1; }
.mud-input-helper-text { color: var(--kt-muted); }
.mud-input-helper-text.mud-input-error, .mud-input-control.mud-input-error .mud-input-helper-text { color: var(--kt-red-text) !important; }
.mud-input-adornment .mud-icon-root { color: var(--kt-muted); }
.mud-switch .mud-switch-base.mud-checked.mud-primary-text + .mud-switch-track { opacity: 1; }
.mud-switch .mud-switch-track { background-color: var(--kt-icon-muted); opacity: .6; }
.mud-switch .mud-switch-base.mud-checked .mud-switch-thumb { background: var(--kt-yellow); }
.mud-checkbox .mud-icon-root.mud-primary-text, .mud-radio .mud-icon-root.mud-primary-text { color: var(--kt-ink) !important; }

/* --- Tabs: pill tabs, the active one filled navy (KidsTime settings tabs) ------------------------- */
.mud-tabs-tabbar { background: transparent !important; }
.mud-tabs-tabbar .mud-tabs-tabbar-wrapper { gap: 4px; }
.mud-tab { text-transform: none; font-weight: 500; font-size: 14px; letter-spacing: 0; min-height: 40px; min-width: 0; padding: 6px 18px; border-radius: 999px; color: var(--kt-muted); }
.mud-tab:hover { background: var(--kt-tonal); color: var(--kt-ink); }
.mud-tab.mud-tab-active, .mud-tab.mud-tab-active:hover { background: var(--kt-brand-fill); color: var(--kt-on-brand) !important; font-weight: 600; }
.mud-tab-slider { display: none !important; }
.mud-tabs-panels { padding-top: 12px; }

/* --- Alerts: tinted like status tags -------------------------------------------------------------- */
.mud-alert { border-radius: var(--kt-radius-md); font-weight: 500; }
.mud-alert.mud-alert-text-error, .mud-alert.mud-alert-outlined-error, .mud-alert.mud-alert-filled-error { background: var(--kt-red-bg); color: var(--kt-red-text); border-color: var(--kt-red-border); }
.mud-alert.mud-alert-text-warning, .mud-alert.mud-alert-outlined-warning, .mud-alert.mud-alert-filled-warning { background: var(--kt-yellow-bg); color: var(--kt-yellow-ink); border-color: var(--kt-yellow-border); }
.mud-alert.mud-alert-text-success, .mud-alert.mud-alert-outlined-success, .mud-alert.mud-alert-filled-success { background: var(--kt-green-bg); color: var(--kt-green-text); border-color: var(--kt-green-border); }
.mud-alert.mud-alert-text-info, .mud-alert.mud-alert-outlined-info, .mud-alert.mud-alert-filled-info,
.mud-alert.mud-alert-text-normal, .mud-alert.mud-alert-outlined-normal { background: var(--kt-blue-bg); color: var(--kt-blue-ink); border-color: transparent; }
.mud-alert .mud-alert-icon { color: inherit !important; }

/* --- Tables: MudTable == list-row cards (≥600px; below that MudTable stacks rows itself) ---------- */
@media (min-width: 600px) {
    .mud-table:not(.kt-plain) { background: transparent; box-shadow: none; border: 0; }
    .mud-table:not(.kt-plain) > .mud-table-container > .mud-table-root { border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
    .mud-table:not(.kt-plain).mud-table-dense > .mud-table-container > .mud-table-root { border-spacing: 0 6px; margin-top: -6px; }
    .mud-table:not(.kt-plain) .mud-table-head .mud-table-cell {
        background: transparent; border: 0; padding: 8px 16px 2px;
        font-size: 12px; font-weight: 600; color: var(--kt-muted); white-space: nowrap;
    }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell {
        background: var(--kt-surface); border: 0; border-top: 1px solid var(--kt-border); border-bottom: 1px solid var(--kt-border);
        padding: 12px 16px; font-size: 14px; font-weight: 500; vertical-align: middle;
    }
    .mud-table:not(.kt-plain).mud-table-dense .mud-table-body .mud-table-row .mud-table-cell { padding: 8px 10px; font-size: 13.5px; }
    .mud-table:not(.kt-plain).mud-table-dense .mud-table-head .mud-table-cell { padding-left: 10px; padding-right: 10px; }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid var(--kt-border); }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid var(--kt-border); }
    .mud-table:not(.kt-plain).mud-table-hover .mud-table-body .mud-table-row:hover .mud-table-cell { background: var(--kt-surface-hover); border-color: var(--kt-border-strong); }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row.mud-table-row-clickable { cursor: pointer; }
    .mud-table:not(.kt-plain) .mud-table-pagination { border: 0; }
}
@media (max-width: 599.98px) {
    /* MudTable's stacked phone layout: each row becomes one outlined list-row card — the first cell is the
       title line, the remaining cells flow as "label value" pairs instead of a right-aligned column. */
    .mud-table:not(.kt-plain) { background: transparent; box-shadow: none; border: 0; }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row {
        display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 14px; margin-bottom: 8px;
        background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-md);
    }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell {
        display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; width: auto; min-width: 0; max-width: 100%;
        border: 0; padding: 0; font-size: 13.5px; text-align: left !important;
    }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell:first-child { flex: 1 0 100%; }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell:empty { display: none; }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell::before { color: var(--kt-muted); font-weight: 500; font-size: 12px; padding: 0; float: none; }
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell:not([data-label])::before,
    .mud-table:not(.kt-plain) .mud-table-body .mud-table-row .mud-table-cell[data-label=""]::before { display: none; }
}
.mud-table-sort-label { font-weight: 600; }

.session-detail .mud-simple-table td:last-child, .session-detail .mud-simple-table th:last-child { white-space: nowrap; }

/* "Details" card body: label–value list (KidsTime detail pages). Markup:
   <dl class="kt-details"><div><dt>Label</dt><dd>Value</dd></div>…</dl> — values wrap, never truncate. */
.kt-details { margin: 0; display: flex; flex-direction: column; }
.kt-details > div { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--kt-border); align-items: baseline; }
.kt-details > div:first-child { border-top: 0; padding-top: 2px; }
.kt-details dt { font-size: 13px; font-weight: 400; color: var(--kt-muted); }
.kt-details dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--kt-ink); overflow-wrap: anywhere; min-width: 0; }
.kt-details dd.mono { font-size: 12.5px; font-weight: 500; }

/* List-row lead (KidsTime ListRow / "Grupy dziś" first column): an avatar-like platform tile, then a title
   line with a caption; two-line column headers; a quiet chevron saying the row opens. */
.kt-row-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kt-plat { width: 40px; height: 40px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--kt-grey-bg); color: var(--kt-grey-ink); }
.kt-plat.ios { background: var(--kt-tonal); color: var(--kt-ink); }
.kt-plat.android { background: var(--kt-green-bg); color: var(--kt-green-text); }
.kt-plat.web { background: var(--kt-blue-bg); color: var(--kt-blue-ink); }
/* Sessions list: tight cells and single-line clipped org / device so every column fits next to the menu panel. */
.kt-clip { display: block; max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 600px) {
    .mud-table.kt-sessions .mud-table-body .mud-table-row .mud-table-cell, .mud-table.kt-sessions .mud-table-head .mud-table-cell { padding-left: 8px; padding-right: 8px; }
    .mud-table.kt-sessions .mud-table-body .mud-table-row .mud-table-cell:first-child, .mud-table.kt-sessions .mud-table-head .mud-table-cell:first-child { padding-left: 12px; }
    .mud-table.kt-sessions .mud-table-body .mud-table-row .mud-table-cell:last-child, .mud-table.kt-sessions .mud-table-head .mud-table-cell:last-child { padding-right: 14px; }
}
.kt-th { display: inline-block; line-height: 1.25; text-align: inherit; }
.kt-th small { display: block; font-size: 11px; font-weight: 400; color: var(--kt-muted); }
.mud-table-cell.kt-row-go { width: 28px; padding-left: 0 !important; color: var(--kt-icon-muted); font-size: 12px; text-align: right; }
.mud-table-row:hover .kt-row-go { color: var(--kt-ink); }
@media (max-width: 599.98px) { .mud-table-cell.kt-row-go { display: none !important; } }
.mud-table-pagination .mud-table-pagination-toolbar { color: var(--kt-muted); }

/* MudSimpleTable (inside cards, panels, dialogs): plain, airy rows with the same header type. */
.mud-simple-table table thead th {
    font-size: 12px; font-weight: 600;
    color: var(--kt-muted); border-bottom: 1px solid var(--kt-border); background: transparent; white-space: nowrap;
}
.mud-simple-table table tbody td { border-bottom: 1px solid var(--kt-border); font-size: 13.5px; color: var(--kt-ink); }
.mud-simple-table table tbody tr:last-child td { border-bottom: 0; }
.mud-simple-table.mud-table-hover table tbody tr:hover { background: var(--kt-surface-hover); }
.mud-simple-table { background: transparent !important; }

/* --- Misc ------------------------------------------------------------------ */
.mud-progress-linear { border-radius: 999px; overflow: hidden; height: 4px; }
.mud-progress-linear.mud-progress-linear-color-primary:not(.mud-progress-linear-buffer) { background: var(--kt-tonal); }
.mud-progress-linear.mud-progress-linear-color-primary .mud-progress-linear-bar { background-color: var(--kt-yellow); }
.mud-progress-linear.mud-progress-linear-color-primary::before, .mud-progress-linear.mud-progress-linear-color-primary .mud-progress-linear-bars::before { background: transparent; }
.mud-divider { border-color: var(--kt-border); }
.mud-avatar.mud-avatar-filled-primary { color: var(--kt-on-primary); font-weight: 600; }
.mud-skeleton { background-color: var(--kt-tonal); }
.mud-slider .mud-slider-input { color: var(--kt-ink); }

/* Card header used inside MudPaper cards (matches .kt-card-title, slightly smaller for dense pages). */
.kt-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 16px; font-weight: 600; color: var(--kt-ink); }
.kt-card-head > i, .kt-card-head .mud-icon-root { color: var(--kt-action-text); }

/* Code / stack-trace box (was an inline background:#1e1e1e on the Issues page
   and the in-session exception dialog). Now palette-aware. */
/* Rendered like Push's pre.snippet: navy code block with light text, in both modes. */
.stack-trace, .mud-paper.stack-trace {
    background: var(--kt-code-bg);
    box-shadow: none;
    border-radius: 12px;
    max-height: 340px;
    overflow: auto;
}
.stack-trace pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--kt-mono);
    font-size: 0.8rem;
    color: var(--kt-code-fg);
}

/* --- Session context panel (recursive JSON key/value tree) ---------------- */
.ctx-json-scroll { max-height: 360px; overflow: auto; }
.ctx-section { margin-bottom: 12px; }
.ctx-section-head {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
    color: var(--kt-muted);
    margin-bottom: 4px; padding-bottom: 2px;
    border-bottom: 1px solid var(--kt-border);
}
.ctx-tree { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--kt-border); }
.ctx-tree-branch { padding: 1px 0; }
.ctx-tree-row { display: flex; gap: 10px; align-items: baseline; padding: 1px 0; }
.ctx-tree-key {
    color: var(--kt-muted); white-space: nowrap;
    font-family: var(--kt-mono); font-size: 0.74rem;
}
.ctx-tree-val {
    color: var(--kt-ink); word-break: break-word;
    font-family: var(--kt-mono); font-size: 0.74rem;
}
.ctx-raw {
    margin: 0; white-space: pre-wrap; word-break: break-word;
    font-family: var(--kt-mono); font-size: 0.76rem;
    color: var(--kt-ink);
}

/* --- InfoBlock ------------------------------------------------------------ */
.info-block { display: flex; gap: 10px; align-items: flex-start; }
.info-icon { margin-top: 2px; color: var(--kt-action-text) !important; }
.info-body { min-width: 0; flex: 1; }
.info-label { font-size: 12px; font-weight: 500; color: var(--kt-muted); margin-bottom: 2px; }

/* --- StatChip ------------------------------------------------------------- */
.stat-accent { border-left: 4px solid var(--kt-yellow) !important; }

/* --- AppSettings: SDK remote-config rows (label · Override toggle · value) ------------------------- */
.cfg-row {
    display: grid; grid-template-columns: 1fr 130px 240px; gap: 16px; align-items: center;
    padding: 10px 0; border-top: 1px solid var(--kt-border);
}
.cfg-row:first-of-type { border-top: none; }
.cfg-label { min-width: 0; }
.cfg-group-head {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
    color: var(--kt-muted); margin: 14px 0 2px;
}
.cfg-group-head:first-child { margin-top: 0; }
.cond-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
@media (max-width: 760px) {
    .cfg-row { grid-template-columns: 1fr; gap: 4px; }
}

/* --- NetworkRequests: list scrolls within itself; footer pinned, always visible --------------------- */
/* The table area is capped so it never pushes the pager off-screen and the rows don't slide under it. */
.netreq-scroll { max-height: calc(100vh - 250px); min-height: 200px; overflow: auto; }
.netreq-scroll table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--kt-bg);
}
/* Phones: the pager row wraps and nothing wider than the screen can push the page sideways. */
@media (max-width: 767.98px) {
    .netreq-footer, .netreq-footer .mud-stack-row { flex-wrap: wrap; row-gap: 6px; }
    html, body, .kt-body { overflow-x: clip; }
}
.netreq-footer {
    position: sticky; bottom: 0; z-index: 2;
    background: var(--kt-bg) !important;
}

/* --- SessionDetail: heavier type on this screen (semibold labels/values, bold stat numbers; no regular) */
.session-detail .mud-typography-caption,
.session-detail .info-label { font-weight: 600 !important; }                                   /* labels → semibold */
.session-detail .info-body,
.session-detail .info-body .mud-typography { font-weight: 600 !important; }                    /* info values → semibold */
.session-detail .mud-typography-h6 { font-weight: 600 !important; }                            /* stat numbers → bold */

/* --- App cards (Apps page) ------------------------------------------------ */
.app-card { cursor: pointer; margin-bottom: 0; height: 100%; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.app-card:hover { border-color: var(--kt-border-strong); background: var(--kt-surface-hover); box-shadow: var(--kt-shadow-hover); }
.app-card-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--kt-blue-bg); color: var(--kt-blue-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 18px; }
.app-card-stats { display: flex; gap: 22px; }
.app-card-stats > div { display: flex; flex-direction: column; }
.app-card-stats b { font-size: 22px; font-weight: 600; color: var(--kt-ink); line-height: 1.2; }
.app-card-stats span { font-size: 12px; font-weight: 500; color: var(--kt-muted); }
.app-card-stats .bad b { color: var(--kt-red-ink); }
.template-selected { border-color: var(--kt-ink) !important; box-shadow: 0 0 0 1px var(--kt-ink), 0 0 0 4px color-mix(in srgb, var(--kt-yellow) 45%, transparent) !important; }

/* --- Dashboard widget drag-and-drop reordering ---------------------------- */
.widget-tile { height: 100%; border-radius: var(--kt-radius-lg); }
/* The whole editable tile is the drag source; buttons (cursor:pointer) and chart hovers still win
   over this on their own elements, so clicks and tooltips keep working — only a real drag reorders. */
.widget-draggable { cursor: grab; }
.widget-draggable:active { cursor: grabbing; }
.widget-dragover { outline: 2px dashed var(--kt-focus); outline-offset: -2px; border-radius: var(--kt-radius-lg); }

/* --- ExceptionContextCards ------------------------------------------------ */
.ctx-card { overflow: hidden; }
.ctx-card-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-weight: 600; font-size: 0.82rem;
    background: var(--kt-bg);
    border-bottom: 1px solid var(--kt-border);
}
.ctx-table { width: 100%; border-collapse: collapse; font-family: var(--kt-mono); font-size: 0.78rem; }
.ctx-table tr:nth-child(even) { background: color-mix(in srgb, var(--kt-ink) 3%, transparent); }
.ctx-table td { padding: 4px 12px; vertical-align: top; }
.ctx-key { color: var(--kt-muted); white-space: nowrap; width: 46%; }
.ctx-val { color: var(--kt-ink); word-break: break-word; }
.ctx-val.token { color: var(--kt-blue-ink); }
.ctx-val.muted { color: var(--kt-muted); }

/* --- Event / span kind palette (SessionDetail, EventTimeline, TraceWaterfall) ------------------
   --k: solid marker colour on the timeline track; --k-bg/--k-fg: chip tint + text, AA in both modes. */
.k-tap   { --k: var(--kt-green);  --k-bg: var(--kt-green-bg);  --k-fg: var(--kt-green-text); }
.k-rage  { --k: var(--kt-red);    --k-bg: var(--kt-red-bg);    --k-fg: var(--kt-red-text); }
.k-dead  { --k: var(--kt-muted);  --k-bg: var(--kt-grey-bg);   --k-fg: var(--kt-grey-ink); }
.k-page  { --k: var(--kt-blue);   --k-bg: var(--kt-blue-bg);   --k-fg: var(--kt-blue-ink); }
.k-info  { --k: var(--kt-purple); --k-bg: var(--kt-purple-bg); --k-fg: var(--kt-purple-ink); }
.k-meta  { --k: #B5BDCC;          --k-bg: var(--kt-grey-bg);   --k-fg: var(--kt-grey-ink); }
.k-form  { --k: var(--kt-navy);   --k-bg: var(--kt-tonal); --k-fg: var(--kt-ink); }
.k-perf  { --k: var(--kt-yellow-dark); --k-bg: var(--kt-yellow-bg); --k-fg: var(--kt-yellow-ink); }
.k-error { --k: var(--kt-red);    --k-bg: var(--kt-red-bg);    --k-fg: var(--kt-red-text); }
html[data-theme="dark"] .k-form { --k: #C8D2EA; }
html[data-theme="dark"] .k-meta { --k: #6E7FA6; }

/* --- EventTimeline -------------------------------------------------------- */
.timeline-host { padding: 2px 6px 8px; }
.timeline-track { position: relative; height: 38px; background: var(--kt-bg); border-radius: 10px; cursor: pointer; border: 1px solid var(--kt-border); overflow: hidden; }
.frame-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--kt-ink) 8%, transparent); }
.event-marker { position: absolute; top: 8px; height: 22px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--k); }
.playhead { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: var(--kt-ink); box-shadow: 0 0 0 2px var(--kt-yellow); border-radius: 2px; }

/* --- Heatmap (HeatmapView) ------------------------------------------------ */
/* Representative page underlay + a canvas onto which heatmap.js paints the
   kernel-density field. The density ramp itself (blue->red) lives in heatmap.js;
   it is a perceptual data encoding and is deliberately theme-independent. */
.heat-canvas-host { width: 100%; display: flex; justify-content: center; align-items: flex-start; }
.heat-canvas { position: relative; width: 100%; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--kt-bg); border: 1px solid var(--kt-border); box-shadow: var(--kt-row-shadow); }
.heat-bg { width: 100%; height: 100%; display: block; object-fit: contain; filter: grayscale(0.5) brightness(0.8); }
.heat-bg-empty { width: 100%; height: 100%; background: var(--kt-bg); }
.heat-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* --- SessionDetail: frame canvas + tap markers ---------------------------- */
.frame-canvas-host { width: 100%; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; }
.frame-canvas { position: relative; width: 100%; max-width: 100%; max-height: 100%; border-radius: 14px; overflow: hidden; background: var(--kt-bg); border: 1px solid var(--kt-border); box-shadow: var(--kt-row-shadow); }
.frame-canvas img { width: 100%; height: 100%; display: block; object-fit: contain; }
.heatmap-overlay { position: absolute; inset: 0; pointer-events: none; }
/* Tap markers: KidsTime teal-green for normal taps, critical red for rage taps. */
.tap-dot {
    position: absolute; width: 22px; height: 22px; margin-left: -11px; margin-top: -11px; border-radius: 50%;
    background: radial-gradient(circle, rgba(44, 192, 156, 0.85) 0%, rgba(44, 192, 156, 0.35) 50%, rgba(44, 192, 156, 0) 80%);
    box-shadow: 0 0 8px rgba(44, 192, 156, 0.55);
}
.tap-dot.rage {
    background: radial-gradient(circle, rgba(220, 39, 37, 0.95) 0%, rgba(220, 39, 37, 0.55) 50%, rgba(220, 39, 37, 0) 85%);
    box-shadow: 0 0 10px rgba(220, 39, 37, 0.7); width: 30px; height: 30px; margin-left: -15px; margin-top: -15px;
}

/* --- SessionDetail: player controls ---------------------------------------- */
.mud-icon-button.player-play { width: 48px; height: 48px; border-radius: 50%; }
.mud-icon-button.player-play.mud-button-filled-primary { background: var(--kt-yellow); color: var(--kt-on-primary); }
.mud-icon-button.player-play.mud-button-filled-primary:hover { background: var(--kt-yellow-dark); }

/* --- SessionDetail: event list -------------------------------------------- */
.event-row { padding: 7px 10px; border-radius: 10px; cursor: pointer; border-left: 3px solid transparent; margin-bottom: 4px; }
.event-row:hover { background: var(--kt-bg); }
.event-row.near { background: color-mix(in srgb, var(--kt-yellow) 10%, transparent); border-left-color: color-mix(in srgb, var(--kt-yellow) 70%, transparent); }
.event-row.selected { background: var(--kt-yellow-bg); border-left-color: var(--kt-yellow); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kt-yellow) 55%, transparent); }
.event-row.exception { border-left-color: var(--kt-red); }
.event-row.exception:hover { background: var(--kt-red-bg); }
.event-kind { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; margin-right: 6px; font-weight: 600; background: var(--k-bg); color: var(--k-fg); }
.event-ts { font-size: 11px; color: var(--kt-muted); font-variant-numeric: tabular-nums; }
.event-route { font-size: 12px; color: var(--kt-ink); margin-top: 2px; }
.event-payload { flex: 1; min-width: 0; font-size: 11px; color: var(--kt-muted); font-family: var(--kt-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Expandable payload (EventPayload): chevron button + one-line preview; expanded = message, fields, raw JSON. */
.event-payload-line { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.event-expand {
    width: 28px; height: 28px; margin: -2px 0 -2px -6px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--kt-muted);
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer;
}
.event-expand:hover { background: var(--kt-tonal); color: var(--kt-ink); }
.event-level { flex: none; padding: 0 8px; font-size: 10.5px; }
.event-payload-caption { font-size: 11px; color: var(--kt-muted); }
.event-details { margin: 6px 0 4px; padding: 10px 12px; border-radius: var(--kt-radius-md); background: var(--kt-surface); border: 1px solid var(--kt-border); cursor: auto; min-width: 0; }
.event-message { font-size: 13px; line-height: 1.5; color: var(--kt-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.event-details-bar { display: flex; justify-content: flex-end; gap: 4px; margin: 4px 0; }
.event-link { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border: 0; border-radius: 999px; background: var(--kt-tonal); color: var(--kt-ink); font: 600 11.5px "Poppins", sans-serif; cursor: pointer; }
.event-link:hover { background: var(--kt-tonal-pressed); }
.event-fields { margin: 0; display: grid; grid-template-columns: minmax(64px, max-content) minmax(0, 1fr); gap: 4px 12px; font-family: var(--kt-mono); font-size: 11.5px; line-height: 1.5; }
.event-fields dt { color: var(--kt-muted); font-weight: 400; overflow-wrap: anywhere; }
.event-fields dd { margin: 0; color: var(--kt-ink); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.event-json { margin: 0; font-family: var(--kt-mono); font-size: 11.5px; line-height: 1.5; color: var(--kt-ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.event-fields { max-height: 420px; overflow-y: auto; }
@media (max-width: 767.98px) {
    .event-fields { grid-template-columns: 1fr; gap: 0; }
    .event-fields dd { margin-bottom: 6px; }
}

/* --- Issues page: distribution bars + sparkline --------------------------- */
.dist-card { overflow: hidden; }
.dist-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-weight: 600; font-size: 0.82rem;
    background: var(--kt-bg);
    border-bottom: 1px solid var(--kt-border);
}
.dist-body { padding: 8px 12px; }
.dist-row {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    padding: 5px 8px; margin-bottom: 4px; border-radius: 8px;
    background: color-mix(in srgb, var(--kt-ink) 4%, transparent); overflow: hidden;
}
/* Neutral data viz: blue Info fill (gold Primary at low opacity read as washed-out beige). */
.dist-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--kt-blue) 24%, transparent); z-index: 0; }
.dist-label {
    position: relative; z-index: 1; font-family: var(--kt-mono); font-size: 0.78rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 8px;
}
.dist-meta { position: relative; z-index: 1; font-size: 0.72rem; color: var(--kt-muted); white-space: nowrap; }
.spark {
    display: flex; align-items: flex-end; gap: 2px; height: 56px;
    padding: 4px 2px; background: color-mix(in srgb, var(--kt-ink) 3%, transparent); border-radius: 8px;
}
.spark-bar {
    flex: 1; min-height: 2px; border-radius: 2px 2px 0 0;
    background: var(--kt-blue); opacity: 0.8; transition: opacity .1s;
}
.spark-bar:hover { opacity: 1; }
.spark-bar.empty { background: var(--kt-muted); opacity: 0.25; }
.spark-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--kt-muted); margin-top: 2px; }

/* --- SessionDetail: trace waterfall --------------------------------------- */
/* The trace list scrolls within itself (capped height) instead of growing the whole page. */
.wf-host { max-height: 56vh; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.wf-trace { margin-bottom: 12px; }
.wf-trace-head { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--kt-muted); padding: 4px 6px; }
.wf-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.wf-row:hover { background: color-mix(in srgb, var(--kt-ink) 4%, transparent); }
.wf-selected { background: var(--kt-yellow-bg); }
.wf-label { width: 42%; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.wf-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--kt-ink); }
.wf-name.wf-error { color: var(--kt-red-text); }
.wf-kind { font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; flex: none; background: var(--k-bg); color: var(--k-fg); }
.wf-track { position: relative; flex: 1; height: 14px; background: color-mix(in srgb, var(--kt-ink) 5%, transparent); border-radius: 4px; overflow: hidden; }
.wf-bar { position: absolute; top: 2px; bottom: 2px; min-width: 2px; background: var(--kt-blue); border-radius: 3px; }
.wf-bar.wf-bar-error { background: var(--kt-red); }
.wf-dur { width: 74px; text-align: right; font-size: 11px; color: var(--kt-muted); flex: none; font-variant-numeric: tabular-nums; }
.wf-attrs { margin: 2px 6px 8px; padding: 8px 12px; background: color-mix(in srgb, var(--kt-ink) 3%, transparent); border-radius: 8px; }
.wf-attr { display: flex; gap: 12px; font-family: var(--kt-mono); font-size: 0.72rem; padding: 2px 0; }
.wf-attr-k { color: var(--kt-muted); min-width: 160px; word-break: break-all; }
.wf-attr-v { color: var(--kt-ink); word-break: break-all; }

/* --- Network overview: tiles, trend chart (small multiples, one time axis), top tables -------------- */
/* Chart colors = the validated categorical slots 1–3 (dataviz reference palette): light on the white card,
   the dark steps validated against the dark card surface (#1A2540): CVD ΔE ≥ 8.4 adjacent, all ≥ 3:1.
   WidgetCard (ApexCharts) uses the same slots, in the same fixed order. */
.viz-root {
    --viz-s1: #2a78d6; --viz-s2: #eb6834; --viz-s3: #1baf7a;
    --viz-grid: var(--kt-border); --viz-tick: var(--kt-muted); --viz-cross: var(--kt-ink);
}
html[data-theme="dark"] .viz-root { --viz-s1: #3987e5; --viz-s2: #d95926; --viz-s3: #199e70; }

.nt-stats .kt-stat .value small { color: var(--kt-muted); }
.nt-delta { margin-top: 4px; font-size: 12px; color: var(--kt-muted); }
.nt-chg { font-weight: 600; color: var(--kt-ink); }
.nt-chg.bad { color: var(--kt-red-text); }
.nt-chg.good { color: var(--kt-green-text); }
.nt-split { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--kt-ink); }
.nt-split > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

.nt-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--viz-s1); vertical-align: middle; margin: 0 4px 0 10px; }
.nt-key.bar { width: 9px; height: 9px; border-radius: 2px; margin-left: 0; }
.nt-legend .nt-key.bar { margin-left: 12px; }
.nt-legend .nt-key:first-child { margin-left: 0; }
.nt-split .nt-key, .nt-tt-row .nt-key { margin-left: 0; }
.nt-key.s1 { background: var(--viz-s1); } .nt-key.s2 { background: var(--viz-s2); } .nt-key.s3 { background: var(--viz-s3); }

.nt-chart { position: relative; user-select: none; transition: opacity .15s; }
.nt-dimmed { opacity: .55; transition: opacity .15s; }
.nt-panel-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; font-size: 12.5px; color: var(--kt-muted); }
.nt-panel-head:first-of-type { margin-top: 0; }
.nt-panel-title { font-weight: 600; color: var(--kt-ink); }
.nt-legend { margin-left: auto; display: inline-flex; align-items: center; color: var(--kt-ink); font-size: 12px; }
.nt-svg { display: block; width: 100%; height: auto; overflow: visible; }
.nt-grid { stroke: var(--viz-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.nt-tick, .nt-end { fill: var(--viz-tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.nt-end { fill: var(--kt-ink); font-weight: 600; }
.nt-fill.s1 { fill: var(--viz-s1); } .nt-fill.s2 { fill: var(--viz-s2); } .nt-fill.s3 { fill: var(--viz-s3); }
.nt-fill.hot { filter: brightness(1.15); }
.nt-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.nt-line.s1 { stroke: var(--viz-s1); } .nt-line.s2 { stroke: var(--viz-s2); }
.nt-dot { stroke: var(--kt-surface); stroke-width: 2; }
.nt-dot.s1 { fill: var(--viz-s1); } .nt-dot.s2 { fill: var(--viz-s2); }
.nt-cross { stroke: var(--viz-cross); stroke-width: 1; opacity: .45; vector-effect: non-scaling-stroke; }
.nt-hits { position: absolute; top: 0; bottom: 0; display: flex; z-index: 1; }
.nt-hit { flex: 1 1 0; min-width: 0; cursor: crosshair; }
.nt-tooltip {
    position: absolute; top: 18px; z-index: 3; pointer-events: none; min-width: 170px;
    background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: 10px; box-shadow: var(--kt-card-shadow);
    padding: 8px 12px; font-size: 12px; color: var(--kt-muted);
}
.nt-tt-when { font-weight: 600; color: var(--kt-ink); margin-bottom: 4px; white-space: nowrap; }
.nt-tt-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; white-space: nowrap; }
.nt-tt-row strong { color: var(--kt-ink); font-variant-numeric: tabular-nums; min-width: 52px; }
.nt-tt-row.sub { padding-left: 12px; }
.nt-tt-row .nt-key:not(.s1):not(.s2):not(.s3) { background: transparent; }
.nt-tt-row .nt-key { flex: none; }

.nt-card-table th.num, .nt-card-table td.num, .nt-table-scroll th.num, .nt-table-scroll td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nt-click { cursor: pointer; }
.nt-ep { min-width: 220px; overflow-wrap: anywhere; font-size: 12.5px; }
.nt-card-table { overflow-x: auto; }
.nt-card-table .mud-simple-table table th, .nt-card-table .mud-simple-table table td { padding-left: 8px; padding-right: 8px; }
.nt-method { display: inline-block; min-width: 42px; font-weight: 600; color: var(--kt-muted); }
.nt-table-scroll { max-height: 420px; overflow: auto; }

/* --- Native crashes: symbolicated stack (own code highlighted, OS frames dimmed) --------------- */
.native-thread { border: 1px solid var(--kt-border); border-radius: 12px; margin-top: 10px; overflow: hidden; background: var(--kt-surface); }
.native-thread.crashed { border-color: var(--kt-red-border); }
.native-thread-head { font-weight: 600; font-size: 0.8rem; padding: 6px 12px; background: var(--kt-grey-bg); color: var(--kt-grey-ink); }
.native-thread.crashed .native-thread-head { background: var(--kt-red-bg); color: var(--kt-red-text); }
.native-frame { display: grid; grid-template-columns: 2.2rem minmax(7rem, 13rem) 1fr auto; gap: 10px; align-items: baseline;
    padding: 4px 12px; font-family: var(--kt-mono); font-size: 0.78rem; border-top: 1px solid var(--kt-border); }
.native-frame .idx { color: var(--kt-muted); text-align: right; }
.native-frame .bin { color: var(--kt-grey-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-frame .fn { word-break: break-all; }
.native-frame .off, .native-frame .loc { color: var(--kt-muted); }
.native-frame .loc { white-space: nowrap; }
.native-frame .unsym { color: var(--kt-muted); }
.native-frame .tag { margin-left: 6px; font-size: 0.68rem; padding: 0 7px; border-radius: 999px; background: var(--kt-purple-bg); color: var(--kt-purple-ink); }
.native-frame.system { opacity: 0.55; }
.native-frame.inapp { background: transparent; }
.native-frame.own { background: var(--kt-yellow-bg); border-left: 3px solid var(--kt-yellow); font-weight: 600; }
.native-frame.own .bin, .native-frame.own .loc { color: var(--kt-yellow-ink); }
.native-frame.inlined .idx { opacity: 0.4; }
.native-missing { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--kt-yellow-bg); border: 1px solid var(--kt-yellow-border); color: var(--kt-yellow-ink); font-size: 0.85rem; }
.native-missing .head { font-weight: 600; }
.native-missing .sub { margin: 2px 0 6px; }
.native-missing table { border-collapse: collapse; font-family: var(--kt-mono); font-size: 0.78rem; }
.native-missing td { padding: 2px 14px 2px 0; }
.native-missing .uuid { user-select: all; }
/* Warning outline in the softer border token (kept apart from the rule at the end of the file, which a
   parallel branch extends). */
.native-symver.native-symver.warn { border-color: var(--kt-yellow-border); }
.native-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; color: var(--kt-grey-ink); margin: 6px 0 2px; word-break: break-word; }
.native-meta b { color: var(--kt-ink); font-weight: 600; margin-right: 4px; }
.native-row-active td { background: var(--kt-blue-bg); }
@media (max-width: 640px) {
    .native-frame { grid-template-columns: 1.6rem 1fr; }
    .native-frame .bin { grid-column: 2; }
    .native-frame .fn, .native-frame .loc { grid-column: 2; }
}

/* ── Debug symbols per version ─────────────────────────────────────────── */
.sym-release { background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-card-shadow); margin-bottom: 12px; overflow: hidden; }
.sym-release.latest { border-color: var(--kt-blue-ink); }
.sym-release.unversioned { border-style: dashed; }
.sym-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; }
.sym-head:hover { background: var(--kt-surface-hover); }
.sym-head .chevron { color: var(--kt-muted); width: 14px; }
.sym-title { flex: 1 1 260px; min-width: 0; }
.sym-title .label-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sym-title .label { font-weight: 600; font-size: 1.02rem; color: var(--kt-ink); }
.sym-title .sub { font-size: 0.78rem; color: var(--kt-muted); margin-top: 2px; }
.sym-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sym-count { font-size: 0.78rem; color: var(--kt-grey-ink); padding: 0 4px; white-space: nowrap; }
.sym-body { padding: 4px 16px 14px; border-top: 1px solid var(--kt-border); }
.sym-assign { margin: 4px 0 12px; padding: 12px; border-radius: 12px; background: var(--kt-blue-bg); }
.sym-table-wrap { overflow-x: auto; }
.sym-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 0.82rem; }
.sym-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--kt-muted); padding: 6px 8px; border-bottom: 1px solid var(--kt-border); white-space: nowrap; }
.sym-table td { padding: 6px 8px; border-bottom: 1px solid var(--kt-border); vertical-align: middle; }
.sym-table .num { text-align: right; white-space: nowrap; }
.sym-table .uuid { font-family: var(--kt-mono); font-size: 0.74rem; user-select: all; white-space: nowrap; }
.sym-table .bin { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.sym-table .bin .kt-status-chip { padding: 0 8px; font-size: 10.5px; }
.sym-table .cap { font-size: 0.74rem; color: var(--kt-muted); white-space: nowrap; }
.sym-table .also { font-size: 0.76rem; color: var(--kt-grey-ink); }
.sym-table tr.missing td { color: var(--kt-muted); }
.native-symver { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 0.82rem; background: var(--kt-blue-bg); color: var(--kt-blue-ink); }
.native-symver.warn { background: var(--kt-yellow-bg); color: var(--kt-yellow-ink); border: 1px solid var(--kt-yellow); }
.native-fold { cursor: pointer; font-style: italic; }
.native-fold:hover { opacity: 0.85; }
