/* =============================================================================
   Shopigrator - design system (Shopify-style, docs/04-ui-redesign.md → Brand foundation)
   Built on Radzen's "standard" base theme. Dark mode: theme-dark.css. Colours follow Shopify's Polaris look:
   Polaris green #008060 as the primary, charcoal #1A1A1A for the sidebar and auth panel, lime #95BF47 as the accent
   (indicators, focus, never body text), success #29845A, neutral greys #616161 as secondary, amber #FFAF03 for warnings.
   Inter for display and UI type, Roboto Mono for ids and quantities. The logo is Shopigrator's own mark, never
   Shopify's. Class names keep the historical "ts-" prefix, and --ts-blue / --ts-navy / --ts-cyan keep their names.
   ============================================================================= */

:root {
    /* Chart series, categorical slots 1 and 2 (validated for #ffffff; dataviz reference palette). */
    --ts-series-1: #257de0;
    --ts-series-2: #f47230;
    /* Brand */
    --ts-blue: #008060;          /* Polaris green (primary). Name kept for existing rules. */
    --ts-blue-600: #006e52;
    --ts-blue-700: #005e46;
    --ts-blue-400: #2e9c7a;
    --ts-blue-50: #e6f4ef;
    --ts-navy: #1a1a1a;          /* charcoal: sidebar, auth panel, mobile header */
    --ts-navy-2: #303030;
    --ts-cyan: #95bf47;          /* lime: accent only (name kept) */
    --ts-green: #29845a;         /* success */
    --ts-lavender: #616161;
    --ts-amber: #ffaf03;
    --ts-orange: var(--ts-amber); /* legacy alias: warnings/attention */
    --ts-charcoal: #303030;      /* wordmark on light */

    /* Status */
    --ts-ok: #1f7a4d;
    --ts-alert: #c62828;
    --ts-offline: #616161;

    --ts-font-display: "Inter", "Segoe UI", system-ui, sans-serif;
    --ts-font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ts-font-mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --ts-radius: 12px;
    --ts-radius-sm: 8px;
    --ts-shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.05);
    --ts-shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 4px 14px rgba(26, 26, 26, 0.07);
    --ts-sidebar-width: 248px;
    --ts-focus-ring: 0 0 0 2px var(--rz-base-50), 0 0 0 4px var(--ts-cyan);

    /* ---- Radzen token overrides ---- */
    --rz-base-50: #ffffff;
    --rz-base-100: #f1f1f1;
    --rz-base-200: #ebebeb;
    --rz-base-300: #e3e3e3;
    --rz-base-400: #cccccc;
    --rz-base-500: #8a8a8a;
    --rz-base-600: #616161;
    --rz-base-700: #4a4a4a;
    --rz-base-800: #303030;
    --rz-base-900: #1a1a1a;
    --rz-base: var(--rz-base-300);
    --rz-base-light: var(--rz-base-200);
    --rz-base-lighter: var(--rz-base-100);
    --rz-base-dark: var(--rz-base-700);
    --rz-base-darker: var(--rz-base-900);
    --rz-on-base: var(--rz-base-900);

    --rz-primary: var(--ts-blue);
    --rz-primary-light: var(--ts-blue-400);
    --rz-primary-lighter: rgba(0, 128, 96, 0.12);
    --rz-primary-dark: var(--ts-blue-600);
    --rz-primary-darker: var(--ts-blue-700);
    --rz-on-primary-lighter: var(--ts-blue-600);

    --rz-secondary: var(--ts-lavender);
    --rz-secondary-light: #7a7a7a;
    --rz-secondary-lighter: rgba(97, 97, 97, 0.14);
    --rz-secondary-dark: #4f4f4f;
    --rz-secondary-darker: #404040;
    --rz-on-secondary-lighter: #3d3d3d;

    --rz-info: #0072b5;
    --rz-info-light: #4a9fd5;
    --rz-info-lighter: rgba(0, 114, 181, 0.14);
    --rz-info-dark: #005b91;
    --rz-info-darker: #00476f;
    --rz-on-info-lighter: #004c78;

    --rz-success: var(--ts-green);
    --rz-success-light: #4fa77b;
    --rz-success-lighter: rgba(41, 132, 90, 0.14);
    --rz-success-dark: #237a52;
    --rz-success-darker: #1f7a4d;
    --rz-on-success-lighter: #0c5132;

    --rz-warning: var(--ts-amber);
    --rz-warning-light: #ffbf3a;
    --rz-warning-lighter: rgba(255, 175, 3, 0.18);
    --rz-warning-dark: #e09a00;
    --rz-warning-darker: #b57c00;
    --rz-on-warning: #3a2a00;
    --rz-on-warning-lighter: #7a5000;

    --rz-danger: var(--ts-alert);
    --rz-danger-light: #d84a4a;
    --rz-danger-lighter: rgba(198, 40, 40, 0.12);
    --rz-danger-dark: #ad2121;
    --rz-danger-darker: #8f1b1b;
    --rz-on-danger-lighter: #8f1b1b;

    --rz-text-font-family: var(--ts-font-ui);
    --rz-body-font-size: 0.875rem;
    --rz-body-background-color: var(--rz-base-100);
    --rz-text-title-color: var(--rz-base-900);
    --rz-text-color: var(--rz-base-800);
    --rz-text-secondary-color: var(--rz-base-600);
    --rz-text-tertiary-color: var(--rz-base-500);
    --rz-border-radius: var(--ts-radius-sm);

    --rz-layout-body-background-color: var(--rz-base-100);
    --rz-header-background-color: rgba(255, 255, 255, 0.92);
    --rz-header-color: var(--rz-base-900);
    --rz-header-border: 1px solid var(--rz-base-200);
    --rz-header-shadow: none;
    --rz-header-min-height: 3.75rem;

    --rz-card-background-color: #ffffff;
    --rz-card-border: 1px solid var(--rz-base-200);
    --rz-card-border-radius: var(--ts-radius);
    --rz-card-shadow: var(--ts-shadow-sm);
    --rz-card-padding: 1.25rem;

    --rz-button-border-radius: var(--ts-radius-sm);
    --rz-input-border-radius: var(--ts-radius-sm);
    --rz-badge-border-radius: 999px;
    --rz-notification-border-radius: var(--ts-radius);
    --rz-dialog-border-radius: 16px;

    --rz-grid-background-color: #ffffff;
    --rz-grid-border: 1px solid var(--rz-base-200);
    --rz-grid-border-radius: var(--ts-radius);
    --rz-grid-header-background-color: var(--rz-base-100);
    --rz-grid-header-color: var(--rz-base-600);
    --rz-grid-header-font-size: 0.75rem;
    --rz-grid-header-font-weight: 600;
    --rz-grid-cell-font-size: 0.875rem;
    --rz-grid-hover-background-color: var(--ts-blue-50);
    --rz-grid-stripe-background-color: #ffffff;
    --rz-grid-selected-background-color: var(--ts-blue-50);
    --rz-grid-selected-color: var(--rz-base-900);
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--ts-font-ui);
    color: var(--rz-text-color);
    background: var(--rz-base-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Display type */
.rz-text-h1, .rz-text-h2, .rz-text-h3, .rz-text-h4, .rz-text-h5, .rz-text-h6,
.ts-display {
    font-family: var(--ts-font-display);
    letter-spacing: -0.01em;
}

/* FocusOnNavigate moves focus to the page h1 for screen readers; no visible ring for that. */
h1[tabindex="-1"]:focus,
.auth-title:focus {
    outline: none;
}

.ts-num {
    font-variant-numeric: tabular-nums;
}

a {
    color: var(--ts-blue);
}

code {
    font-size: 0.85em;
    background: var(--rz-base-200);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
}

/* =============================================================================
   Shell: header, sidebar, body
   ============================================================================= */
.ts-layout {
    position: relative;
}

.ts-header.rz-header {
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.ts-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 100%;
    padding: 0 1rem 0 0.5rem;
}

.ts-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ts-header-page {
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--rz-base-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}






/* Sidebar */
.ts-sidebar.rz-sidebar {
    width: var(--ts-sidebar-width);
    background: var(--ts-navy);
    border-inline-end: none;
    color: rgba(255, 255, 255, 0.82);
}

.ts-sidebar.ts-sidebar--overlay {
    position: absolute;
    z-index: 4;
    box-shadow: 0 20px 60px rgba(26, 26, 26, 0.35);
}

/* The column grows with its content and the sidebar (overflow: auto) scrolls. A fixed height here made every
   RadzenPanelMenu (flex: 0 1 auto; overflow: auto) shrink on short screens, e.g. a 4K TV at 300-400% scale,
   until only each menu's scrollbar thumb was left. */
.ts-sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.ts-sidebar-inner > * {
    flex-shrink: 0;
}

.ts-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.1rem 1.1rem 1.25rem;
    color: #ffffff;
    text-decoration: none;
}

.ts-brand-logo {
    flex: 0 0 auto;
    display: block;
    height: 2.15rem;
    width: auto;
}

.ts-brand-close {
    margin-inline-start: auto;
    color: rgba(255, 255, 255, 0.7);
}

.ts-brand-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ts-nav-label {
    padding: 0.5rem 1.25rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.ts-sidebar .rz-panel-menu {
    background: transparent;
    padding: 0 0.625rem;
}

.ts-sidebar .rz-panel-menu .rz-navigation-item {
    border: none;
    margin-bottom: 2px;
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-link,
.ts-sidebar .rz-panel-menu .rz-navigation-item-wrapper {
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-link {
    padding: 0.6rem 0.75rem;
    font-weight: 500;
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-icon {
    color: rgba(255, 255, 255, 0.6);
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-wrapper:hover,
.ts-sidebar .rz-panel-menu .rz-navigation-item-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-wrapper-active,
.ts-sidebar .rz-panel-menu .rz-navigation-item-wrapper-active:hover,
.ts-sidebar .rz-panel-menu .rz-navigation-item-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--ts-cyan);
}

.ts-sidebar .rz-panel-menu .rz-navigation-item-wrapper-active .rz-navigation-item-icon,
.ts-sidebar .rz-panel-menu .rz-navigation-item-link.active .rz-navigation-item-icon {
    color: #ffffff;
}

.ts-sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem 1.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.ts-mask {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(26, 26, 26, 0.45);
    animation: ts-fade-in 0.15s ease;
}

@keyframes ts-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ts-body.rz-body {
    background: var(--rz-base-100);
}

/* Desktop: fully hide/collapse the sidebar so content runs full-width (the header hamburger brings
   it back). On tablet/phone the sidebar is already an off-canvas drawer, handled separately. */
.ts-layout--nav-hidden .ts-sidebar.rz-sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

.ts-layout--nav-hidden .ts-body.rz-body {
    margin-inline-start: 0;
}

.page-container {
    /* Up to a 4K screen; prose keeps its own measure (e.g. .ts-page-subtitle at 68ch). */
    max-width: 3840px;
    margin: 0 auto;
    padding: 1.75rem 2rem 3rem;
}

@media (min-width: 2200px) {
    .page-container { padding-left: 3rem; padding-right: 3rem; }
}

/* Short screens: a desktop width with little height, e.g. a 4K TV at 300-400% display scale (about 1280 x 600 or
   960 x 440 CSS px after the browser's own bars). Every other breakpoint looks at width only, so tighten the
   vertical chrome here to bring the content up. */
@media (max-height: 640px) and (min-width: 769px) {
    .page-container { padding-top: 1rem; padding-bottom: 1.5rem; }
    .ts-page-header { margin-bottom: 0.75rem; }
    .ts-page-title.rz-text-h4 { font-size: 1.375rem; }
    .ts-eyebrow { margin-bottom: 0.15rem; }
    .ts-page-subtitle {
        margin-top: 0.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ts-brand { padding: 0.6rem 1.1rem 0.6rem; }
    .ts-nav-label { padding-top: 0.25rem; padding-bottom: 0.2rem; }
    .ts-nav-label.rz-text-overline { margin-top: 0.25rem; }
    .ts-sidebar .rz-panel-menu .rz-navigation-item-link { padding-top: 0.4rem; padding-bottom: 0.4rem; }
    .ts-sidebar-footer { padding-top: 0.5rem; padding-bottom: 0.75rem; }
}

/* The saved-query review grid is wide (9 columns); let that page use the full width of the screen. */
.page-container:has(.ts-review-card) {
    max-width: none;
}

/* Review grid columns are percentages of what each needs at minimum (sums to ~980px), so they all grow in
   proportion on wider screens; below that width the grid scrolls instead of squeezing the narrow columns. */
.ts-review-card .rz-grid-table {
    min-width: 980px;
}

/* =============================================================================
   Page header
   ============================================================================= */
.ts-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.ts-page-header-text {
    flex: 1 1 22rem;
    min-width: 0;
}

.ts-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ts-blue);
}

.ts-page-title {
    margin: 0;
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--rz-base-900);
}

.ts-page-subtitle {
    margin: 0.35rem 0 0;
    max-width: 68ch;
    font-size: 0.9375rem;
    color: var(--rz-base-600);
}

.ts-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ts-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 2rem 0 0.875rem;
}

.ts-section-title h2 {
    margin: 0;
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--rz-base-900);
}

.ts-section-title a {
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}

/* =============================================================================
   Stat cards
   ============================================================================= */
.ts-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.ts-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
    background: var(--rz-base-50);
    box-shadow: var(--ts-shadow-sm);
}

.ts-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ts-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rz-base-600);
}

.ts-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--ts-blue-50);
    color: var(--ts-blue);
}

.ts-stat-icon .rzi {
    font-size: 1.25rem;
}

.ts-stat-value {
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1.875rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--rz-base-900);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.ts-stat-value--sm {
    font-size: 1.125rem;
    line-height: 1.35;
}

.ts-stat-value .ts-unit {
    margin-inline-start: 0.15rem;
    font-size: 0.55em;
    font-weight: 500;
    color: var(--rz-base-600);
}

.ts-stat-foot {
    font-size: 0.8125rem;
    color: var(--rz-base-600);
}

/* Effort confirmation card: the hours snapshot beside "Confirmed", and a hint when 7pace has moved on since. */
.ts-stat-snapshot {
    margin-inline-start: 0.4rem;
    font-family: var(--ts-font-ui);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--rz-base-700);
}

.ts-stat-drift {
    color: var(--rz-warning-darker);
    font-weight: 500;
}

.ts-stat--alert .ts-stat-icon { background: var(--rz-danger-lighter); color: var(--ts-alert); }
.ts-stat--alert .ts-stat-value { color: var(--ts-alert); }
.ts-stat--ok .ts-stat-icon { background: var(--rz-success-lighter); color: var(--ts-ok); }
.ts-stat--warn .ts-stat-icon { background: var(--rz-warning-lighter); color: var(--rz-warning-darker); }
.ts-stat--muted .ts-stat-icon { background: var(--rz-base-200); color: var(--rz-base-600); }

/* =============================================================================
   Status pills (device state, job result, sent/not sent, log level)
   ============================================================================= */
.ts-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--rz-base-200);
    color: var(--rz-base-700);
}

.ts-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.ts-pill--ok { background: var(--rz-success-lighter); color: var(--rz-success-darker); }
.ts-pill--alert { background: var(--rz-danger-lighter); color: var(--rz-danger-darker); }
.ts-pill--warn { background: var(--rz-warning-lighter); color: var(--rz-on-warning-lighter); }
.ts-pill--info { background: var(--rz-primary-lighter); color: var(--ts-blue-700); }
.ts-pill--muted { background: var(--rz-base-200); color: var(--rz-base-700); }
.ts-pill--offline { background: #e6e9f0; color: #4a4a4a; }

.ts-pill--alert .ts-dot {
    animation: ts-pulse 1.6s ease-in-out infinite;
}

@keyframes ts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.45); }
    50% { box-shadow: 0 0 0 4px rgba(198, 40, 40, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ts-pill--alert .ts-dot { animation: none; }
}

/* =============================================================================
   Data grids + responsive record list (desktop grid / mobile cards)
   ============================================================================= */
.rz-data-grid {
    box-shadow: var(--ts-shadow-sm);
}

.rz-data-grid .rz-grid-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rz-data-grid .rz-grid-table td {
    vertical-align: middle;
}

/* Grids whose rows navigate somewhere on click (e.g. Devices -> device detail) */
.clickable-rows .rz-data-row {
    cursor: pointer;
}

/* Update-urgency tints: colour the whole row (desktop grid) or card (mobile) by how soon
   an environment's next update lands. Applied via RecordList's RowRender / CardClass.
   The desktop selectors are scoped to .rz-grid-table … tr.rz-data-row td so they out-specify
   Radzen's own per-cell background (which otherwise leaves the row white). */
.rz-grid-table tbody tr.rz-data-row.ts-row-warn > td { background: var(--rz-warning-lighter); }
.rz-grid-table tbody tr.rz-data-row.ts-row-danger > td { background: var(--rz-danger-lighter); }
.rz-grid-table tbody tr.rz-data-row.ts-row-warn > td:first-child { box-shadow: inset 3px 0 var(--rz-warning); }
.rz-grid-table tbody tr.rz-data-row.ts-row-danger > td:first-child { box-shadow: inset 3px 0 var(--rz-danger); }

/* Keep the clickable cursor and give tinted rows their own (stronger) hover colour, since Radzen's
   neutral hover background would otherwise wash the tint out. */
.clickable-rows .rz-data-row.ts-row-warn,
.clickable-rows .rz-data-row.ts-row-danger { cursor: pointer; }
.rz-grid-table tbody tr.rz-data-row.ts-row-warn:hover > td { background: rgba(255, 175, 3, 0.24); }
.rz-grid-table tbody tr.rz-data-row.ts-row-danger:hover > td { background: rgba(198, 40, 40, 0.22); }

.ts-record-card.ts-row-warn { background: var(--rz-warning-lighter); border-left: 3px solid var(--rz-warning); }
.ts-record-card.ts-row-danger { background: var(--rz-danger-lighter); border-left: 3px solid var(--rz-danger); }

.ts-cell-strong {
    font-weight: 600;
    color: var(--rz-base-900);
}

.ts-cell-muted {
    color: var(--rz-base-600);
}

.ts-cell-mono,
.ts-mono {
    font-family: var(--ts-font-mono);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.ts-cell-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
}

.ts-temp {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--rz-base-900);
}

.ts-temp--alert,
.ts-record-field > .ts-record-field-value.ts-temp--alert {
    color: var(--ts-alert);
}

/* Mobile card list (RecordList) */
.ts-record-list .rz-datalist-data {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.ts-record-list .rz-datalist-data > li,
.ts-record-list .rz-datalist-item {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.ts-record-list.rz-datalist,
.ts-record-list .rz-g {
    background: transparent;
    border: none;
    box-shadow: none;
}

.ts-record-card {
    background: var(--rz-base-50);
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
    padding: 0.875rem 1rem;
    box-shadow: var(--ts-shadow-sm);
}

/* Page content surface: a RadzenCard wrapping a page's main content so it reads as a distinct panel
   rather than floating on the background. On mobile the RecordList already renders item-cards, so the
   wrapper goes transparent to avoid nesting cards inside a card. */
.ts-content-card {
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .ts-content-card.rz-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
}

/* Monaco code viewer: its container div must fill the sized wrapper or the editor renders empty. */
.ts-code-viewer > div,
.ts-code-viewer .monaco-editor-container {
    height: 100%;
    width: 100%;
}

/* --- Skeleton loaders (initial component/data loading) --- */
.ts-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ts-skeleton .ts-skeleton-lines {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ts-skeleton-grid {
    background: var(--rz-base-50);
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
    box-shadow: var(--ts-shadow-sm);
    overflow: hidden;
}

.ts-skeleton-row {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--rz-base-200);
}

.ts-skeleton-row:last-child {
    border-bottom: none;
}

.ts-skeleton-row-head {
    background: var(--rz-base-100);
}

.ts-skeleton-row > div {
    min-width: 0;
}

.ts-record-card-clickable {
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.ts-record-card-clickable:active {
    background: var(--ts-blue-50);
    border-color: var(--rz-primary-lighter);
}

.ts-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ts-card-head > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.ts-card-head > :last-child:not(:first-child) {
    flex: 0 0 auto;
}

.ts-card-head-pills {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

/* Grid header whose title may wrap onto two lines (e.g. "Completed work" in a narrow numeric column). */
.rz-grid-table thead th.ts-col-wrap .rz-column-title-content {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
}

/* Inline P1–P4 priority picker in review rows; outlined amber until the change is saved. */
.ts-priority-select {
    width: 100%;
    min-width: 0;
}

.ts-priority-select .rz-dropdown-label {
    padding-block: 0.2rem;
    /* Radzen reserves two trigger widths and ellipsises the label, which cut the pill to "P4 …". */
    padding-inline-end: var(--rz-dropdown-trigger-icon-width);
    overflow: visible;
    text-overflow: clip;
}

.ts-priority-select--changed {
    border-color: var(--rz-warning);
    box-shadow: 0 0 0 1px var(--rz-warning);
}

.ts-card-head-pills .ts-priority-select {
    width: 6.5rem;
}

.ts-card-title {
    min-width: 0;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--rz-base-900);
    overflow-wrap: anywhere;
}

.ts-card-subtitle {
    margin-top: 0.1rem;
    font-size: 0.8125rem;
    color: var(--rz-base-600);
    overflow-wrap: anywhere;
}

.ts-card-text {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--rz-base-700);
    overflow-wrap: anywhere;
}

.ts-card-error {
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--ts-radius-sm);
    background: var(--rz-danger-lighter);
    color: var(--rz-danger-darker);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

/* Key/value row inside a card */
.ts-record-field {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
    font-size: 0.8125rem;
}

.ts-record-field > .ts-record-field-label {
    color: var(--rz-base-600);
    flex: 0 0 auto;
}

.ts-record-field > .ts-record-field-value {
    text-align: right;
    min-width: 0;
    color: var(--rz-base-900);
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.ts-record-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.ts-record-actions > * {
    flex: 1 1 auto;
}

/* =============================================================================
   Panels, forms, settings
   ============================================================================= */
.ts-panel {
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
    background: var(--rz-base-50);
    box-shadow: var(--ts-shadow-sm);
}

.ts-panel-body {
    padding: 1.25rem;
}

.ts-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rz-base-200);
}

/* Two-column grid of panels (e.g. the environment Update settings tab); full-width rows span both.
   Collapses to a single column on phones. */
.ts-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.ts-panel-grid .ts-span-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .ts-panel-grid {
        grid-template-columns: 1fr;
    }
}

.ts-panel-head h3 {
    margin: 0;
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--rz-base-900);
}

.ts-help {
    margin: 0 0 1.25rem;
    max-width: 78ch;
    font-size: 0.875rem;
    color: var(--rz-base-600);
}

.ts-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: end;
}

.ts-form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 560px;
}

.ts-form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}












.ts-preview {
    padding: 0.75rem 0.9rem;
    border: 1px dashed var(--rz-base-300);
    border-radius: var(--ts-radius-sm);
    background: var(--rz-base-100);
    font-size: 0.875rem;
    color: var(--rz-base-800);
    white-space: pre-wrap;
}

.ts-channel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ts-channel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.ts-channel-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: var(--ts-blue-50);
    color: var(--ts-blue);
}

.ts-channel-name {
    font-weight: 600;
    color: var(--rz-base-900);
    overflow-wrap: anywhere;
}

.ts-channel-meta {
    font-size: 0.8125rem;
    color: var(--rz-base-600);
    overflow-wrap: anywhere;
}

.ts-inline-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Tabs: flat underline style, scrollable on narrow screens */
.rz-tabview .rz-tabview-nav {
    gap: 0.25rem;
    border-bottom: 1px solid var(--rz-base-300);
    background: transparent;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

.rz-tabview .rz-tabview-nav::-webkit-scrollbar {
    display: none;
}

.rz-tabview .rz-tabview-nav li,
.rz-tabview .rz-tabview-nav li.rz-tabview-selected {
    flex: 0 0 auto;
    background: transparent !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0 0 -1px;
}

.rz-tabview .rz-tabview-nav li > button {
    padding: 0.7rem 0.85rem;
    border-bottom: 2px solid transparent;
    background: transparent !important;
    color: var(--rz-base-600);
    font-weight: 500;
}

.rz-tabview .rz-tabview-nav li:hover > button {
    color: var(--rz-base-900);
}

.rz-tabview .rz-tabview-nav li.rz-tabview-selected > button {
    border-bottom-color: var(--ts-blue);
    color: var(--ts-blue);
    font-weight: 600;
}

.rz-tabview .rz-tabview-panels {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 1.5rem 0 0;
}

.rz-tabview .rz-tabview-panel {
    padding: 0;
}

/* Status page definition list */
.ts-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0;
    margin: 0;
}

.ts-dl dt,
.ts-dl dd {
    margin: 0;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rz-base-200);
}

.ts-dl dt {
    padding-right: 2rem;
    font-size: 0.875rem;
    color: var(--rz-base-600);
}

.ts-dl dd {
    text-align: right;
    font-weight: 500;
    color: var(--rz-base-900);
    font-variant-numeric: tabular-nums;
}

.ts-dl > :nth-last-child(-n + 2) {
    border-bottom: none;
}

/* Empty state */
.ts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--rz-base-600);
}

.ts-empty .rzi {
    font-size: 2rem;
    color: var(--rz-base-400);
}

/* Alerts a bit softer; long messages (stack traces, URLs) wrap instead of widening the page */
.rz-alert {
    border-radius: var(--ts-radius);
}

.rz-alert .rz-alert-item,
.rz-alert .rz-alert-content,
.rz-alert .rz-alert-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* =============================================================================
   Auth pages (login / setup)
   ============================================================================= */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--rz-base-50);
}

.auth-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem 3rem;
    background: var(--ts-navy);
    color: #ffffff;
}

.auth-panel-brand { display: flex; align-items: center; gap: 0.7rem; position: relative; }
.auth-panel-copy { position: relative; max-width: 22rem; }
.auth-panel-title.rz-text-h3 { margin: 0; color: #ffffff; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.auth-panel-text.rz-text-body1 { margin-top: 0.75rem; color: #c9c9c9; }
.auth-panel-works.rz-text-caption { position: relative; color: rgba(255, 255, 255, 0.6); letter-spacing: 0.02em; }
.auth-panel-mark { position: absolute; right: -5rem; top: 50%; transform: translateY(-50%); width: 22rem; height: auto; opacity: 0.14; }

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card .auth-brand { display: none; }
.auth-brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.5rem; }
.auth-brand .ts-brand-logo { color: var(--rz-base-900); }

.auth-title.rz-text-h5 { margin: 0; font-weight: 700; color: var(--rz-base-900); }
.auth-subtitle.rz-text-body2 { margin: 0.35rem 0 1.5rem; color: var(--rz-base-600); }
.auth-sso.rz-button { margin-bottom: 1rem; }
.auth-sso.rz-link { display: flex; align-items: center; justify-content: center; gap: 0.6rem; text-decoration: none; color: var(--rz-base-900); }
.auth-sso-logo { width: 1.1rem; height: 1.1rem; }

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-panel { padding: 1.25rem 1.25rem 1.5rem; min-height: 7.5rem; }
    .auth-panel-copy { display: none; }
    .auth-panel-mark { width: 9rem; right: -1.5rem; top: auto; bottom: -3.5rem; transform: none; }
    .auth-main { align-items: flex-start; padding-top: 2rem; }
}

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 1024px) {
    .page-container {
        padding: 1.25rem 1.25rem 2.5rem;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem 1rem 2rem;
    }

    .ts-page-header {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        margin-bottom: 1.1rem;
    }

    /* In the base (row) layout this is the horizontal flex-basis; once the header stacks into a column
       that 22rem basis would apply to HEIGHT, leaving a huge gap above the actions. Reset it. */
    .ts-page-header-text {
        flex: 0 0 auto;
    }

    .ts-page-title {
        font-size: 1.375rem;
    }

    .ts-page-subtitle {
        font-size: 0.875rem;
    }

    .ts-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }

    .ts-stat {
        padding: 0.85rem 0.9rem;
    }

    .ts-stat-icon {
        width: 1.9rem;
        height: 1.9rem;
    }

    .ts-stat-value {
        font-size: 1.5rem;
    }

    .ts-stat-value--sm {
        font-size: 0.9375rem;
    }

    .ts-section-title {
        margin-top: 1.5rem;
    }

    .ts-panel-body,
    .ts-panel-head {
        padding: 1rem;
    }

    .ts-form-grid {
        grid-template-columns: 1fr;
    }

    .ts-form-stack {
        max-width: none;
    }

    .ts-form-actions > .rz-button {
        flex: 1 1 auto;
    }

    .ts-dl {
        grid-template-columns: 1fr;
    }

    .ts-dl dt {
        padding-bottom: 0;
        border-bottom: none;
    }

    .ts-dl dd {
        padding-top: 0.2rem;
        text-align: left;
    }

    .ts-header-hide-sm {
        display: none;
    }

    /* Three settings tabs fit a phone once the icons go */
    .rz-tabview .rz-tabview-nav .rz-tabview-icon {
        display: none;
    }

    .rz-tabview .rz-tabview-nav li > button {
        padding-inline: 0.6rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    /* 16px inputs stop iOS Safari zooming the page on focus */
    .rz-textbox,
    .rz-numeric-input {
        font-size: 16px;
    }
}

/* =============================================================================
   Charts, change lists, health
   ============================================================================= */
.ts-chart-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--rz-base-600);
    font-variant-numeric: tabular-nums;
}

.ts-chart-summary strong {
    color: var(--rz-base-900);
    font-weight: 600;
}

.ts-chart .rz-legend {
    font-size: 0.75rem;
}

.ts-change-list {
    margin: 0 0 0.5rem;
    padding: 0.75rem 1rem 0.75rem 1.75rem;
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius-sm);
    background: var(--rz-base-100);
    font-size: 0.875rem;
    color: var(--rz-base-900);
}

.ts-change-list li + li {
    margin-top: 0.25rem;
}

.ts-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ts-battery {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.ts-battery-bar {
    position: relative;
    width: 2.25rem;
    height: 0.6rem;
    border-radius: 3px;
    background: var(--rz-base-200);
    overflow: hidden;
}

.ts-battery-bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 3px;
    background: var(--ts-ok);
}

.ts-battery-bar--low > span {
    background: var(--ts-alert);
}

/* =============================================================================
   Print (Reports page)
   ============================================================================= */
.ts-print-only {
    display: none;
}

@media print {
    .ts-sidebar,
    .ts-header,
    .ts-mask,
    .ts-no-print,
    .ts-page-header,
    .rz-pager,
    .rz-notification {
        display: none !important;
    }

    .ts-print-only {
        display: block;
    }

    .ts-print-heading h1 {
        margin: 0 0 0.25rem;
        font-family: var(--ts-font-display);
        font-size: 1.25rem;
    }

    .ts-print-heading p {
        margin: 0 0 1rem;
        color: #4a4a4a;
        font-size: 0.8125rem;
    }

    body,
    .ts-body.rz-body,
    .rz-layout {
        background: #ffffff !important;
        overflow: visible !important;
        height: auto !important;
    }

    .page-container {
        max-width: none;
        padding: 0;
    }

    .rz-data-grid {
        box-shadow: none;
    }
}

.ts-switch-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rz-base-700);
}

/* =============================================================================
   Settings > General
   ============================================================================= */
.ts-settings-summary {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 128, 96, 0.2);
    border-radius: var(--ts-radius);
    background: var(--ts-blue-50);
    color: var(--rz-base-800);
    font-size: 0.875rem;
}

.ts-settings-summary-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--ts-blue-700);
}

.ts-settings-summary-title .rzi {
    font-size: 1.1rem;
}

.ts-settings-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.ts-settings-summary li + li {
    margin-top: 0.2rem;
}

.ts-settings-summary strong {
    color: var(--rz-base-900);
}

.ts-settings-group {
    margin: 1.75rem 0 0.75rem;
    font-family: var(--ts-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rz-base-600);
}

.ts-settings-summary + .ts-settings-group {
    margin-top: 0;
}

.ts-settings-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1.5rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.ts-settings-section-head {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.ts-settings-section-head h3 {
    margin: 0.1rem 0 0.25rem;
    font-family: var(--ts-font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--rz-base-900);
}

.ts-settings-section-head p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--rz-base-600);
}

.ts-settings-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--ts-blue-50);
    color: var(--ts-blue);
}

.ts-settings-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem 1.25rem;
    align-items: start;
}

.ts-input-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ts-input-unit > .rz-numeric {
    flex: 0 1 8.5rem;
    min-width: 6rem;
}

.ts-input-unit > span {
    font-size: 0.8125rem;
    color: var(--rz-base-600);
    white-space: nowrap;
}

.ts-savebar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    box-shadow: 0 -4px 16px rgba(26, 26, 26, 0.06);
}

.ts-savebar-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--rz-base-600);
}

.ts-savebar-status .rzi {
    font-size: 1.1rem;
    color: var(--ts-ok);
}

.ts-savebar--dirty {
    border-color: rgba(255, 175, 3, 0.45);
}

.ts-savebar--dirty .ts-savebar-status {
    color: var(--rz-base-900);
    font-weight: 500;
}

.ts-savebar--dirty .ts-savebar-status .rzi {
    color: var(--ts-orange);
}

@media (max-width: 900px) {
    .ts-settings-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
}

/* Clear-history dialog */
.ts-choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ts-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--ts-radius-sm);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ts-choice > span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.875rem;
    color: var(--rz-base-900);
}

.ts-choice input {
    margin-top: 0.2rem;
    accent-color: var(--ts-blue);
}

.ts-choice--active {
    border-color: var(--ts-blue);
    background: var(--ts-blue-50);
}

.ts-clear-preview {
    padding: 0.7rem 0.9rem;
    border-radius: var(--ts-radius-sm);
    background: var(--rz-base-100);
    font-size: 0.875rem;
    color: var(--rz-base-700);
}

.ts-clear-preview--danger {
    background: var(--rz-danger-lighter);
    color: var(--rz-danger-darker);
}

/* Checkboxes (checkbox-list column filters, multiselects): the base palette's lightest border is
   too faint on white, so give unchecked boxes a visible outline. */
.rz-chkbox-box {
    border: 1.5px solid var(--rz-base-500) !important;
    border-radius: 4px;
}

.rz-chkbox-box.rz-state-active {
    border-color: var(--rz-primary) !important;
    background-color: var(--rz-primary) !important;
}

.rz-multiselect-item {
    border-radius: 6px;
}

/* Quick-start steps list on the dashboard */
.ts-steps {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--rz-base-700);
}
.ts-steps li { line-height: 1.5; }

/* Environment detail: label/value grid */
.ts-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-top: 0.5rem;
}
.ts-detail-field { display: flex; flex-direction: column; gap: 0.125rem; }
.ts-detail-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--rz-base-600); }
.ts-detail-value { font-size: 0.95rem; color: var(--rz-base-900); word-break: break-word; }
.ts-detail-value:empty::after { content: "—"; color: var(--rz-base-500); }

/* Mobile-friendly form fields inside inline rows */

/* Auth page divider ("or local account") */
.auth-divider { display:flex; align-items:center; gap:0.75rem; margin:0.25rem 0 1rem; color:var(--rz-base-500); font-size:0.8rem; }
.auth-divider::before, .auth-divider::after { content:""; height:1px; background:var(--rz-base-300); flex:1; }

/* Anchor styled as the submit button (SSO sign-in) - flex-center text like a real button */

/* ---------- Query review (work item approvals) ---------- */




.ts-review-id.rz-link,
.ts-review-id {
    font-weight: 600;
    color: var(--rz-primary);
    text-decoration: none;
    white-space: nowrap;
}

.ts-review-id:hover { text-decoration: underline; }

/* Decision: two toggle buttons joined into one segmented control */
.ts-decision { display: inline-flex; flex-wrap: nowrap; }
.ts-decision .rz-button { border-radius: 0; box-shadow: none; }
.ts-decision .rz-button:first-child { border-radius: var(--ts-radius-sm) 0 0 var(--ts-radius-sm); }
.ts-decision .rz-button:last-child { border-radius: 0 var(--ts-radius-sm) var(--ts-radius-sm) 0; margin-left: -1px; }
.rz-grid-table .ts-decision .rz-button { padding-inline: 0.5rem; }

.ts-review-item { display: flex; align-items: baseline; gap: 0.45rem; }
.ts-review-meta { margin-top: 0.3rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.8125rem; }
.ts-review-parent { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; }
.ts-review-parent .rzi { font-size: 1rem; }
.ts-review-iteration { white-space: nowrap; font-family: var(--ts-font-mono, "Roboto Mono", monospace); font-size: 0.75rem; }

.ts-review-comment { width: 100%; }
.ts-review-comment-row { display: flex; align-items: flex-start; gap: 0.35rem; }
.ts-review-comment-row .ts-review-textarea { flex: 1 1 auto; min-width: 0; }
/* Hidden, not removed, so the row keeps its height and width when there is nothing to save. */
.ts-review-rowsave--idle.rz-button { visibility: hidden; }
.ts-review-textarea.rz-textarea { width: 100%; min-height: 2.6rem; resize: vertical; font-size: 0.8125rem; line-height: 1.4; }
.ts-review-textarea--required.rz-textarea { border-color: var(--ts-alert); background: var(--rz-danger-lighter); }
.ts-review-hint.rz-text-caption { margin: 0; color: var(--ts-alert); }
.ts-review-rowsave.rz-button { align-self: flex-start; }

.ts-review-progress.rz-card { padding: 1rem 1.25rem; }
.ts-review-progress-title.rz-text-h6 { margin: 0; font-weight: 700; }
.ts-review-progress-bar.rz-progressbar { margin-top: 0.75rem; height: 0.5rem; border-radius: 999px; }
.ts-review-progress-bar .rz-progressbar-value { border-radius: 999px; }

.ts-review-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}


/* Work item tree (WorkItemTree): an Azure DevOps style expandable hierarchy */
.ts-tree-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.ts-tree-toolbar > span { margin-left: 0.5rem; font-size: 0.8125rem; }






.ts-wit-type { display: inline-flex; align-items: center; gap: 0.4rem; vertical-align: middle; white-space: nowrap; }
.ts-wit-icon { width: 1rem; height: 1rem; flex: 0 0 auto; }
/* A long state ("Ready for Development") wraps inside its pill instead of widening the column. */

/* Each level indents the title by one toggle width, so children line up under their parent's text. */
.ts-tree-title {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding-left: calc(var(--ts-tree-depth, 0) * 1.5rem);
    min-width: 15rem;
}

.ts-tree-title-text { padding-top: 0.15rem; overflow-wrap: break-word; min-width: 0; }

.ts-tree-toggle,
.ts-tree-toggle-spacer {
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

.ts-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--rz-base-700);
    cursor: pointer;
}

.ts-tree-toggle:hover { background: var(--rz-base-200); }
.ts-tree-toggle .rzi { font-size: 1.25rem; }


@media (max-width: 768px) {
    .ts-tree-title { padding-left: calc(var(--ts-tree-depth, 0) * 0.9rem); min-width: 13rem; }
    /* Long unbroken names (Scanner_Sync_InboundDocuments) may break anywhere here, so they don't widen the table. */
    .ts-tree-title-text { overflow-wrap: anywhere; }
}

/* Review grid: a long state ("Ready for Development") wraps inside its pill instead of being cut off by the
   column, also when the column is dragged narrower. */
.ts-review-card td.ts-col-state .ts-pill {
    white-space: normal;
    overflow-wrap: break-word;
    border-radius: 12px;
    text-align: left;
}

/* Review grid: every header has a filter icon beside it, so titles may wrap instead of being cut off. */
.ts-review-card .rz-grid-table thead th .rz-column-title-content {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
}

/* The idle sort arrow takes room the narrow numeric headers need; it still shows once a column is sorted. */
.ts-review-card .rz-grid-table thead th .rz-sortable-column-icon.rzi-sort { display: none; }

/* Effort this month: month switch on the left, confirmation date on the right, above the grouped time entries. */
.ts-effort-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ts-effort-bar-spacer { flex: 1 1 0; }

.ts-effort-confirmation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
}


.ts-effort-group > td { background: var(--rz-base-50); }

/* ---- List toolbar: search box + optional quick filters (RecordList) ---- */
.ts-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.875rem;
}
.ts-list-search.rz-textbox {
    flex: 0 1 320px;
    min-width: 0;
    padding-left: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1rem;
    background-position: 0.7rem center;
}
@media (max-width: 768px) {
    .ts-list-search.rz-textbox { flex: 1 1 100%; }
}

/* ---- Brand: focus ring, mono figures, mark texture ---- */
a:focus-visible,
button:focus-visible,
.rz-button:focus-visible,
.rz-navigation-item-link:focus-visible,
.rz-tabview-nav li a:focus-visible {
    outline: none;
    box-shadow: var(--ts-focus-ring);
}

/* The Shopigrator mark as a quiet texture (sidebar foot, auth panel, empty states). */
.ts-facets {
    position: absolute;
    pointer-events: none;
    opacity: 0.08;
}

.ts-sidebar-inner { position: relative; overflow: hidden; }
.ts-sidebar .ts-facets { width: 220px; left: -48px; bottom: -64px; }
.ts-sidebar-footer { position: relative; }

/* =============================================================================
   Shell v2: breadcrumb header, global search, profile menu, phone tab bar
   ============================================================================= */
.ts-header.rz-header { background: rgba(255, 255, 255, 0.94); }
.ts-header-tools { flex: none; }

/* Radzen replaces the nav's own class with ours, so style the list and items, not .rz-breadcrumb. */
.ts-breadcrumb { min-width: 0; overflow: hidden; }
.ts-breadcrumb .rz-breadcrumb-list { display: flex; align-items: center; flex-wrap: nowrap; gap: 0; min-width: 0; margin: 0; padding: 0; list-style: none; }
.ts-breadcrumb .rz-breadcrumb-item { display: inline-flex; align-items: center; font-size: 0.9375rem; }
.ts-breadcrumb .rz-breadcrumb-item + .rz-breadcrumb-item::before {
    content: "\203A";
    margin: 0 0.5rem;
    color: var(--rz-base-500);
    font-size: 1.125rem;
    line-height: 1;
}
.ts-breadcrumb .rz-link { display: inline-flex; align-items: center; gap: 0.3rem; }
.ts-breadcrumb .rz-link .rzi { font-size: 1.125rem; }
.ts-breadcrumb .rz-breadcrumb-item { white-space: nowrap; }
.ts-breadcrumb .rz-breadcrumb-item:last-child { min-width: 0; overflow: hidden; }
.ts-breadcrumb .rz-breadcrumb-item:last-child .rz-link-text,
.ts-breadcrumb .rz-breadcrumb-item:last-child > span {
    font-family: var(--ts-font-display);
    font-weight: 700;
    color: var(--rz-base-900);
    overflow: hidden;
    text-overflow: ellipsis;
}
.ts-breadcrumb .rz-link { color: var(--rz-base-600); text-decoration: none; }
.ts-breadcrumb .rz-link:hover { color: var(--ts-blue); }
.ts-header-page { font-weight: 700; }

.ts-sidebar-toggle.rz-sidebar-toggle { color: var(--rz-base-800); }

.ts-global-search.rz-autocomplete { width: 280px; }
.ts-global-search .rz-inputtext {
    height: 2.25rem;
    padding-left: 2.1rem;
    background-color: var(--rz-base-100);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1rem;
    background-position: 0.7rem center;
}
.ts-search-option { display: flex; flex-direction: column; min-width: 0; }
.ts-search-option .ts-cell-muted { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

.ts-profile-menu.rz-profile-menu { background: transparent; }
.ts-profile-menu .rz-navigation-item-wrapper { background: transparent; }
.ts-avatar {
    display: inline-grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 50%;
    background: var(--rz-primary);
    color: #ffffff;
    font: 700 0.75rem var(--ts-font-display);
    letter-spacing: 0.02em;
}
.ts-profile-who, .ts-profile-version { pointer-events: none; }
.ts-profile-theme--on .rz-navigation-item-text { font-weight: 600; }
.ts-profile-theme--on .rz-navigation-item-icon { color: var(--ts-blue); }
.ts-profile-who .rz-navigation-item-text { font-weight: 600; }
.ts-profile-version .rz-navigation-item-text { font-size: 0.75rem; color: var(--rz-base-500); }

.ts-nav-label.rz-text-overline { margin-top: 0.75rem; color: rgba(255, 255, 255, 0.42); font-size: 0.6875rem; }
.ts-sidebar-footer.rz-text-caption { color: rgba(255, 255, 255, 0.45); }
.ts-brand-close.rz-button { margin-inline-start: auto; color: rgba(255, 255, 255, 0.7); }
.ts-brand-close.rz-button:hover:not(.rz-state-disabled) { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

.ts-eyebrow.rz-text-overline { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.35rem; color: var(--ts-blue); font-weight: 700; letter-spacing: 0.1em; }
.ts-eyebrow-icon.rzi { font-size: 1rem; }
.ts-page-title.rz-text-h4 { margin: 0; font-weight: 700; }
.ts-page-subtitle.rz-text-body1 { margin: 0.35rem 0 0; color: var(--rz-base-600); }
.ts-inline-badge.rz-badge { font-family: var(--ts-font-mono); text-transform: none; vertical-align: 1px; }

/* Phone tab bar */
.ts-tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 3;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--rz-base-50);
    border-top: 1px solid var(--rz-base-200);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(26, 26, 26, 0.06);
}
.ts-tabbar-item.rz-link,
.ts-tabbar-item.rz-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 3.5rem;
    border-radius: 0;
    padding: 0.35rem 0;
    color: var(--rz-base-600);
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
}
.ts-tabbar-item .rzi { font-size: 1.35rem; }
.ts-tabbar-item--active.rz-link { color: var(--ts-blue); font-weight: 700; }
.ts-tabbar-item--active .rzi { color: var(--ts-blue); }
.ts-layout--phone .ts-body { padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px)); }
.ts-layout--phone .ts-savebar { bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 768px) {
    /* Title and actions share a row; actions become icon buttons so they never take a full line. */
    .ts-page-header { flex-direction: row; align-items: flex-start; flex-wrap: nowrap; gap: 0.75rem; }
    .ts-page-header-text { flex: 1 1 auto; }
    .ts-page-actions { flex: none; width: auto; }
    .ts-page-actions > .rz-button .rz-button-text { display: none; }
    .ts-page-actions > .rz-button { padding-inline: 0.6rem; }
    .ts-page-title.rz-text-h4 { font-size: 1.375rem; }
    .ts-page-subtitle.rz-text-body1 { font-size: 0.8125rem; }
    .ts-breadcrumb .rz-breadcrumb-item:not(:last-child) { display: none; }
}

.ts-header .rz-sidebar-toggle,
.ts-header .ts-profile-menu,
.ts-header .rz-profile-menu .rz-navigation-item { border: none; }
.ts-header-back.rz-button { color: var(--rz-base-800); }

/* =============================================================================
   Settings: intro + status on the left, fields on the right; one column on phones
   ============================================================================= */
.ts-settings-section {
    display: grid;
    grid-template-columns: minmax(0, 18rem) minmax(0, 40rem);
    gap: 1.5rem 2.5rem;
    align-items: start;
    padding-top: 1.25rem;
}
.ts-settings-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.ts-settings-intro .rz-text-h6 { margin: 0; font-weight: 700; }
.ts-settings-help.rz-text-body2,
.ts-settings-help.rz-text-caption { margin: 0; color: var(--rz-base-600); }
.ts-settings-card.rz-card { padding: 1.5rem; }
.ts-field-label.rz-label { font-size: 0.8125rem; font-weight: 500; color: var(--rz-base-700); }
.rz-form-field-helper { margin-top: 0.3rem; font-size: 0.75rem; line-height: 1.4; color: var(--rz-base-600); }

/* Required fields: a red asterisk after the label ("ts-required" on a RadzenFormField or a ts-field-label caption),
   explained by RequiredLegend at the top of the form. */
.ts-required .rz-form-field-label::after,
.ts-field-label.ts-required::after { content: " *"; color: var(--rz-danger); font-weight: 700; }
.ts-required-legend.rz-text-caption { margin: 0; color: var(--rz-base-600); }
.ts-required-legend::before { content: "* "; color: var(--rz-danger); font-weight: 700; }
@media (max-width: 1100px) {
    .ts-settings-section { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .ts-settings-card.rz-card { padding: 1rem; }
}

/* Tabs that don't fit scroll sideways instead of being cut off (customer page, settings). */
.rz-tabview .rz-tabview-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
}
.rz-tabview .rz-tabview-nav::-webkit-scrollbar { display: none; }
.rz-tabview .rz-tabview-nav > li { flex: none; }

.ts-dialog-form { width: min(520px, 80vw); }
.ts-dialog-form .ts-form-actions { margin-top: 0.25rem; }
.ts-field-skeleton { width: 100%; height: 2.5rem; }

/* Empty / blocked states */
.ts-empty-state {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.ts-empty-state--framed {
    max-width: 32rem;
    margin: 3rem auto;
    background: var(--rz-base-50);
    border: 1px solid var(--rz-base-200);
    border-radius: var(--ts-radius);
}
.ts-empty-state-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--ts-blue-50);
    color: var(--ts-blue);
}
.ts-empty-state-icon .rzi { font-size: 1.5rem; }
.ts-empty-state-title.rz-text-h6 { margin: 0.25rem 0 0; font-weight: 700; }
.ts-empty-state-text.rz-text-body2 { margin: 0 0 0.5rem; max-width: 46ch; color: var(--rz-base-600); }
.ts-empty-state-facets { position: absolute; width: 9rem; right: -2.5rem; bottom: -3rem; opacity: 0.07; pointer-events: none; }
.ts-switch-field .rz-label { white-space: nowrap; }

.ts-col-priority .ts-priority-select.rz-dropdown { width: 100%; min-width: 0; }

/* Trees rendered in RadzenDataGrid (WorkItemTree, EffortTable) */
/* Keeps a tree toggle's click off its row (#151) without adding a box: the button stays the flex item. */
.ts-tree-toggle-stop { display: contents; }
.ts-tree-toggle.rz-button { flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; min-width: 0; padding: 0; }
.ts-tree-toggle.rz-button .rzi { font-size: 1.25rem; }
.ts-tree-count { margin-left: 0.5rem; }
.ts-tree-grid .rz-data-row > td { vertical-align: middle; }
.ts-effort-grid .ts-effort-row-iteration > td { background: var(--rz-base-100); }
.ts-effort-grid .ts-effort-row-item > td { background: #fbfcfe; }
.ts-effort-card-group { background: var(--rz-base-100); }
.ts-effort-confirmation .ts-pill { white-space: nowrap; }
.ts-dialog-form--narrow { width: 100%; }
.ts-tree-grid .ts-tree-title-text { white-space: normal; min-width: 0; }
.ts-tree-title-text > .ts-review-id,
.ts-tree-title-text > div > .ts-review-id,
.ts-card-title > .ts-review-id { margin-right: 0.4rem; }
.rz-dialog-title { font-family: var(--ts-font-display); font-weight: 700; }

.ts-cell-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.ts-quick-filters.rz-selectbar { flex-wrap: wrap; }
@media (max-width: 768px) {
    .ts-quick-filters.rz-selectbar { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .ts-quick-filters .rz-button { flex: none; }
}
.ts-tab-badge.rz-badge { margin-left: 0.4rem; font-size: 0.6875rem; min-width: 1.25rem; }
.ts-customer-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 768px) { .ts-customer-kpis { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
.ts-budget-bar.rz-progressbar { height: 0.375rem; border-radius: 999px; }

/* Approvals: one card per customer */
.ts-approval-customers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.ts-approval-customer.rz-card { padding: 0.9rem 1rem; }
.ts-approval-customer-text { min-width: 0; }
.ts-approval-customer-text .rz-text-subtitle1 { margin: 0; }

/* Dashboard: attention list + integrations side by side, chart below */
.ts-dashboard { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ts-hours-chart { grid-column: 1 / -1; }
.ts-section-heading.rz-text-h6 { margin: 0; font-weight: 700; }
.ts-attention-list .rz-datalist-data { gap: 0; }
.ts-attention-list .rz-datalist-data > li { padding: 0; border: none; background: transparent; box-shadow: none; }
.ts-attention-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--rz-base-200);
    cursor: pointer; border-radius: var(--ts-radius-sm);
}
.ts-attention-item:hover { background: var(--ts-blue-50); }
.ts-attention-item:focus-visible { outline: none; box-shadow: var(--ts-focus-ring); }
.ts-attention-text { flex: 1 1 auto; min-width: 0; }
.ts-attention-text .ts-cell-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-attention-icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; }
.ts-attention-icon--warn { background: var(--rz-warning-lighter); color: var(--rz-on-warning-lighter); }
.ts-attention-icon--alert { background: var(--rz-danger-lighter); color: var(--rz-on-danger-lighter); }
.ts-attention-icon--info { background: var(--ts-blue-50); color: var(--ts-blue); }
.ts-integration { display: flex; align-items: center; gap: 0.75rem; }
.ts-integration-icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--ts-blue-50); color: var(--ts-blue); }
.ts-integration-text { flex: 1 1 auto; min-width: 0; }
.ts-integration-text .ts-cell-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-chart.rz-chart { height: 320px; }
.ts-chart-skeleton.rz-skeleton { width: 100%; height: 320px; }
@media (max-width: 1024px) { .ts-dashboard { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) { .ts-chart.rz-chart { height: 260px; } }
.ts-approval-customer .rz-button { flex: none; }
@media (max-width: 768px) {
    /* Icon-only actions stay beside the title; wider ones (e.g. a labelled switch) wrap below it. */
    .ts-page-header { flex-wrap: wrap; }
    .ts-page-header-text { flex: 1 1 14rem; }
}

/* =============================================================================
   Delivery plans roadmap (docs/05-delivery-plans.md)
   The timeline is a scrolling canvas with a sticky lane column. Positions are inline (computed on the server by
   TimelineBuilder); everything else lives here. Outside factors (our own tracks) are hatched or diamonds, so they
   never look like our own work.
   ============================================================================= */

.ts-rm { padding: 0; overflow: hidden; }
.ts-rm-host { min-width: 0; }
.ts-rm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 0.875rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--rz-base-200); }
.ts-rm-spacer { flex: 1 1 auto; }
.ts-rm-filter { width: 15rem; max-width: 100%; }
.ts-rm-ado-link { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 500; white-space: nowrap; }
.ts-rm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.875rem; padding: 0.625rem 1rem; font-size: 0.75rem; color: var(--rz-base-700); border-bottom: 1px solid var(--rz-base-200); background: var(--rz-base-100); }
.ts-rm-legend-label { font-family: var(--ts-font-display); font-weight: 700; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rz-base-900); }
.ts-rm-sw { display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.ts-rm-sw i { display: inline-block; width: 1.375rem; height: 0.6875rem; border-radius: 3px; border: 1px solid rgba(26, 26, 26, 0.15); }
.ts-rm-sw .ts-rm-sw--none { background: var(--rz-base-50); }
.ts-rm-sw .ts-rm-sw--hatch { background: repeating-linear-gradient(135deg, var(--rz-base-50) 0 4px, #e9c46a 4px 6px); border: 1px dashed #b8892a; }
.ts-rm-sw .ts-rm-sw--dia { width: 0.5625rem; height: 0.5625rem; transform: rotate(45deg); background: #b8892a; border: 0; margin: 0 0.1875rem; }
.ts-rm-sw .ts-rm-sw--hollow { background: var(--rz-base-50); box-shadow: 0 0 0 1.5px #b8892a; }
.ts-rm-sw .ts-rm-sw--mark { width: 2px; height: 0.75rem; border: 0; border-radius: 0; }
.ts-rm-tray { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; background: #fffaf0; border-top: 1px solid #f3e3bd; font-size: 0.8125rem; color: #6b4d00; }
.ts-rm-tray b { color: #4a3500; }
.ts-rm-tray-item { background: var(--rz-base-50); border: 1px dashed #d9b866; border-radius: 6px; padding: 0.0625rem 0.5rem; color: var(--rz-base-900); display: inline-flex; gap: 0.375rem; }
.ts-rm-foot { padding: 0.5rem 1rem; font-size: 0.75rem; color: var(--rz-base-600); border-top: 1px solid var(--rz-base-200); }

.ts-tl { position: relative; font-size: 0.78rem; }
.ts-tl-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.ts-tl-inner { position: relative; }
.ts-tl-head { position: relative; z-index: 4; }
.ts-tl-hrow { display: grid; grid-template-columns: var(--ts-tl-label) 1fr; }
.ts-tl-lab { position: sticky; left: 0; z-index: 3; background: var(--rz-base-50); border-right: 1px solid var(--rz-base-200); min-width: 0; }
.ts-tl-cells { position: relative; }
.ts-tl-cell { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
.ts-tl-hrow--year { height: 2.25rem; }
.ts-tl-hrow--year .ts-tl-cell { background: #a9c7ea; color: #ffffff; font-family: var(--ts-font-display); font-weight: 800; font-size: 1.0625rem; border-left: 1px solid rgba(255, 255, 255, 0.45); text-shadow: 0 1px 0 rgba(26, 26, 26, 0.25); }
.ts-tl-hrow--quarter { height: 1.75rem; }
.ts-tl-hrow--quarter .ts-tl-lab { display: flex; align-items: center; padding-left: 0.75rem; font-weight: 700; color: var(--rz-base-700); font-size: 0.6875rem; }
.ts-tl-hrow--quarter .ts-tl-cell { background: #111827; color: #ffffff; font-family: var(--ts-font-display); font-weight: 700; font-size: 0.75rem; border-left: 1px solid #374151; }
.ts-tl-hrow--month { height: 1.375rem; }
.ts-tl-hrow--month .ts-tl-cell { background: var(--rz-base-100); color: var(--rz-base-700); font-size: 0.6875rem; border-left: 1px solid var(--rz-base-200); border-bottom: 1px solid var(--rz-base-200); }
.ts-tl-hrow--markers { height: 1.375rem; }
.ts-tl-hrow--markers2 { height: 2.5rem; }
.ts-tl-hrow--markers .ts-tl-cells { border-bottom: 1px solid var(--rz-base-200); }
.ts-tl-flag { position: absolute; top: 3px; font-size: 0.625rem; font-weight: 600; color: #ffffff; padding: 0 0.375rem; border-radius: 0 4px 4px 0; white-space: nowrap; line-height: 1rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.ts-tl-flag--today { background: #008aa6 !important; }

.ts-tl-body { position: relative; }
.ts-tl-under { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.ts-tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: #eceff5; }
.ts-tl-grid--q { background: #d9dee8; }
.ts-tl-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed; opacity: 0.7; }
.ts-tl-mark--today { border-left: 2px solid var(--ts-cyan); opacity: 1; }
.ts-tl-group { display: grid; grid-template-columns: var(--ts-tl-label) 1fr; background: #e8f3f1; border-bottom: 1px solid #cfe5e1; position: relative; z-index: 1; }
.ts-tl-group .ts-tl-lab { background: #e8f3f1; display: flex; align-items: center; padding: 0 0.75rem; font-family: var(--ts-font-display); font-weight: 800; font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: #1f5e57; }
.ts-tl-lane { display: grid; grid-template-columns: var(--ts-tl-label) 1fr; border-bottom: 1px solid var(--rz-base-200); position: relative; }
.ts-tl-lane--track, .ts-tl-lane--track .ts-tl-lab { background: #fcfbf7; }
.ts-tl-lane .ts-tl-lab { z-index: 3; }
.ts-tl-lane-head { display: flex; align-items: flex-start; gap: 0.375rem; padding: 0.5rem 0.5rem 0.5rem 0.375rem; height: 100%; }
.ts-tl-lane-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; }
.ts-tl-lane-title { font-weight: 700; color: var(--rz-base-900); font-size: 0.8125rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-tl-lane-sub { color: var(--rz-base-600); font-size: 0.6875rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-tl-src { margin-top: 0.25rem; font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6b4d00; background: #fff3d6; border-radius: 4px; padding: 0 0.375rem; }
.ts-tl-warn { margin-top: 0.25rem; display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; font-weight: 600; color: #8a5a00; background: #fff3d6; border-radius: 999px; padding: 0 0.4375rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-tl-warn .rzi { font-size: 0.75rem; }
.ts-tl-collapse.rz-button, .ts-tl-add.rz-button { flex: none; }
.ts-tl-canvas { position: relative; z-index: 1; }

.ts-tl-bar { --ts-bar-bg: #ffffff; --ts-bar-fg: var(--rz-base-900); position: absolute; height: 1.5rem; display: flex; align-items: center; padding: 0 0.5rem; border-radius: 4px; background: var(--ts-bar-bg); color: var(--ts-bar-fg); border: 1px solid rgba(26, 26, 26, 0.16); box-shadow: 0 1px 2px rgba(26, 26, 26, 0.08); white-space: nowrap; cursor: pointer; font-size: 0.75rem; font-weight: 500; z-index: 2; }
.ts-tl-bar:hover { box-shadow: 0 0 0 2px rgba(0, 128, 96, 0.35); }
.ts-tl-bar:focus-visible { outline: none; box-shadow: var(--ts-focus-ring); }
.ts-tl-bar--sel { box-shadow: 0 0 0 2px var(--ts-blue); }
.ts-tl-bar--done { opacity: 0.72; }
.ts-tl-bar-text { overflow: hidden; text-overflow: ellipsis; }
.ts-tl-bar--out .ts-tl-bar-text { position: absolute; left: calc(100% + 6px); overflow: visible; color: var(--rz-base-900); }
.ts-tl-bar--cl { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 3px double var(--rz-base-500); }
.ts-tl-bar--cr { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 3px double var(--rz-base-500); }
.ts-tl-bar--range { background: repeating-linear-gradient(135deg, var(--rz-base-50) 0 5px, var(--ts-trk) 5px 8px); border: 1.5px dashed var(--ts-trk); }
.ts-tl-bar--ms { padding: 0; border: 0; background: none; box-shadow: none; }
.ts-tl-bar--ms:hover { box-shadow: none; }
.ts-tl-bar--ms .ts-tl-bar-text { left: calc(100% + 4px); }
.ts-tl-diamond { position: absolute; left: 3px; top: 6px; width: 0.6875rem; height: 0.6875rem; transform: rotate(45deg); background: var(--ts-trk); border: 2px solid var(--rz-base-50); box-shadow: 0 0 0 1.5px var(--ts-trk); }
.ts-tl-bar--expected .ts-tl-diamond { background: var(--rz-base-50); }
.ts-tl-bar--ms.ts-tl-bar--sel .ts-tl-diamond { box-shadow: 0 0 0 2.5px var(--ts-blue); }
.ts-tl-internal { margin-left: 0.375rem; font-size: 0.5625rem; font-weight: 700; color: var(--rz-base-700); background: var(--rz-base-200); border-radius: 4px; padding: 0 0.3125rem; }
.ts-tl-bar--out .ts-tl-internal { position: absolute; left: calc(100% + 6px); top: -0.75rem; }
.ts-tl-phase { position: absolute; top: -0.4375rem; width: 0.6875rem; height: 0.625rem; display: block; }
.ts-tl-phase svg { display: block; width: 100%; height: 100%; }
.ts-tl-phase--done { opacity: 0.55; }
.ts-tl-dep { position: absolute; right: -0.375rem; top: -0.375rem; width: 0.8125rem; height: 0.8125rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.5625rem; color: #ffffff; font-weight: 800; background: var(--rz-base-700); }
.ts-tl-dep--bad { background: var(--ts-alert); }
.ts-tl-thin { position: absolute; height: 6px; border-radius: 2px; }
.ts-tl-links { position: absolute; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.ts-tl-link { fill: none; stroke: #5b6377; stroke-width: 1.4; stroke-dasharray: 4 3; }
.ts-tl-link--ours { stroke: #b8892a; }
.ts-tl-link--bad { stroke: var(--ts-alert); stroke-width: 2; stroke-dasharray: none; }
.ts-tl-bar--drag { cursor: grab; }
.ts-tl-grip { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.ts-tl-grip--start { left: -3px; }
.ts-tl-grip--end { right: -3px; }
.ts-tl-bar.ts-tl-dragging { opacity: 0.85; box-shadow: 0 0 0 2px var(--ts-cyan); cursor: grabbing; z-index: 5; }
.ts-tl-drag-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--ts-navy); color: #ffffff; font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 6px; white-space: nowrap; }

/* Side panel */
.ts-panel-body { display: flex; flex-direction: column; gap: 0.875rem; font-size: 0.8125rem; }
.ts-panel-note { background: #eef3fd; border: 1px solid #d5e0f6; border-radius: var(--ts-radius-sm); padding: 0.5rem 0.625rem; color: #24407e; }
.ts-panel-note--ours { background: #fff8e6; border-color: #f1dfae; color: #5c4300; }
.ts-panel-note-dates { font-weight: 700; }
.ts-panel-kv { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.3125rem 0.625rem; margin: 0; }
.ts-panel-kv dt { color: var(--rz-base-600); }
.ts-panel-kv dd { margin: 0; color: var(--rz-base-900); overflow-wrap: anywhere; }
.ts-panel-section { display: flex; flex-direction: column; gap: 0.375rem; }
.ts-panel-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rz-base-600); }
.ts-panel-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ts-panel-row-text { flex: 1 1 8rem; min-width: 0; }
.ts-panel-actions { padding-top: 0.25rem; }
.ts-store { font-size: 0.625rem; font-weight: 700; border-radius: 4px; padding: 0 0.3125rem; white-space: nowrap; }
.ts-store--ado { background: var(--ts-blue-50); color: var(--ts-blue); }
.ts-store--ours { background: #fff3d6; color: #6b4d00; }

/* Phone list */
.ts-rm-phone { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.ts-rm-quarters { overflow-x: auto; max-width: 100%; }
.ts-rm-phone-lane { font-family: var(--ts-font-display); font-weight: 800; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rz-base-700); margin-top: 0.375rem; }
.ts-rm-card { --ts-bar-bg: #cccccc; background: var(--rz-base-50); border: 1px solid var(--rz-base-200); border-left: 5px solid var(--ts-bar-bg); border-radius: 10px; padding: 0.625rem 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; cursor: pointer; }
.ts-rm-card:focus-visible { outline: none; box-shadow: var(--ts-focus-ring); }
.ts-rm-card--ours { border-left-style: dashed; }
.ts-rm-card-title { font-weight: 600; }
.ts-rm-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--rz-base-600); }
.ts-rm-span { position: relative; height: 6px; background: #eef0f5; border-radius: 999px; }
.ts-rm-span i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--ts-bar-bg); filter: saturate(1.4) brightness(0.85); }
.ts-rm-span svg { position: absolute; top: -6px; width: 9px; height: 8px; }

/* Print / PDF (16:9) */
.ts-print { background: #ffffff; padding: 0; }
.ts-print svg { width: 100%; height: auto; display: block; }
@media print {
    @page { size: 338.67mm 190.5mm; margin: 6mm; }
    .ts-print-hide { display: none !important; }
}
.ts-print-bar { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--rz-base-200); background: var(--rz-base-100); }
.ts-print-sheet { padding: 0.5rem; }
.ts-settings-lane { padding: 0.375rem 0; border-top: 1px solid var(--rz-base-200); }
.ts-track-dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; transform: rotate(45deg); flex: none; vertical-align: middle; }
.ts-track-picks .rz-checkbox-list-item { padding: 0.25rem 0; }
.ts-link-choices { display: flex; flex-direction: column; gap: 0.375rem; max-height: 18rem; overflow-y: auto; }
.ts-link-choice { border: 1px solid var(--rz-base-200); border-radius: var(--ts-radius-sm); padding: 0.4375rem 0.625rem; cursor: pointer; font-size: 0.8125rem; }
.ts-link-choice:hover { border-color: var(--rz-base-400); background: var(--rz-base-100); }
.ts-link-choice:focus-visible { outline: none; box-shadow: var(--ts-focus-ring); }
.ts-link-choice--on { border-color: var(--ts-blue); background: var(--ts-blue-50); }
.ts-tl-rollup { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 2px; background: rgba(26, 26, 26, 0.12); border-radius: 2px; overflow: hidden; }
.ts-tl-rollup i { display: block; height: 100%; background: var(--ts-green); }

/* Support Request tab (docs/06-support-requests.md) */
.ts-support-parent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    min-width: 0;
    font-size: 0.875rem;
}
.ts-dialog-form--wide { width: 100%; }
.ts-html-editor { min-height: 180px; }
/* EditorPicturePaste: a wrapper for its paste and drop listeners only, so it takes no part in the layout. */
.ts-editor-paste { display: contents; }
.ts-html-editor .rz-html-editor-content { min-height: 140px; max-height: 360px; }
/* A description too large for the editor, read-only: as high as the editor, so Save stays in reach. */
.ts-rich-text--capped { max-height: 360px; overflow-y: auto; }
.ts-support-item-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.ts-support-item-title.rz-text-h6 { margin: 0; font-weight: 600; }
.ts-support-item-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    font-size: 0.875rem;
}
.ts-support-comments { border-top: 1px solid var(--rz-base-200); padding-top: 0.75rem; }
.ts-comment {
    border: 1px solid var(--rz-base-200);
    border-radius: var(--rz-border-radius);
    padding: 0.6rem 0.75rem;
}
.ts-comment-head { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; margin-bottom: 0.25rem; }
.ts-rich-text { font-size: 0.875rem; overflow-wrap: anywhere; }
.ts-rich-text p { margin: 0 0 0.4rem; }
.ts-rich-text p:last-child { margin-bottom: 0; }
.ts-rich-text img { max-width: 100%; height: auto; }
.ts-rich-text table { display: block; max-width: 100%; overflow-x: auto; }

/* Task Creator */
.ts-task-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.ts-task-card.rz-card { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.ts-task-editor .rz-html-editor-content { min-height: 12rem; max-height: 32rem; }
.ts-task-editor img, .ts-task-original img { max-width: 100%; height: auto; border-radius: var(--ts-radius-sm); }
.ts-task-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 0.75rem; border-top: 1px solid var(--rz-base-200); padding-top: 1rem; }
.ts-task-foot > .rz-text-body2 { margin: 0 auto 0 0; }
.ts-task-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; }
.ts-task-log li { display: flex; align-items: center; gap: 0.5rem; }
.ts-task-log--done .rzi { color: var(--rz-success); }
.ts-task-log--warn .rzi { color: var(--rz-warning); }
.ts-task-log--fail { color: var(--ts-alert); }
.ts-task-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.8125rem; color: var(--rz-text-secondary-color); }
.ts-task-facts b { color: var(--rz-text-color); font-weight: 600; }
.ts-task-focus.rz-checkbox-list-horizontal { flex-wrap: wrap; gap: 0.5rem 1rem; }
.ts-task-extra.rz-textbox { flex: 1 1 16rem; min-width: 0; }
.ts-task-compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; }
@media (max-width: 820px) { .ts-task-compare { grid-template-columns: minmax(0, 1fr); } }
.ts-task-original { border: 1px solid var(--rz-base-200); border-radius: var(--ts-radius-sm); background: var(--rz-base-50); padding: 0.75rem 1rem; max-height: 28rem; overflow: auto; min-width: 0; font-size: 0.875rem; }
.ts-task-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 1rem; border: 1px solid var(--rz-base-200); border-radius: var(--ts-radius-sm); background: var(--rz-base-50); }
.ts-task-result-icon.rzi { color: var(--rz-success); font-size: 2rem; }
.ts-task-result-link { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; font-size: 1rem; }
.ts-task-md { flex-basis: 100%; font-size: 0.75rem; overflow-wrap: anywhere; }


/* ---- Language switcher (LanguageSwitcher.razor) ---- */
.ts-lang { display: flex; align-items: center; gap: 0.5rem; }
.ts-lang-icon.rz-icon { font-size: 1.125rem; color: var(--rz-text-secondary-color); }
.ts-lang .ts-lang-dd.rz-dropdown { flex: 1 1 auto; min-width: 0; width: auto; }
/* In the navy sidebar, above the version line. */
.ts-lang--sidebar { margin: auto 1rem 0.5rem; }
.ts-lang--sidebar + .ts-sidebar-footer { margin-top: 0; padding-top: 0.25rem; }
.ts-lang--sidebar .ts-lang-icon.rz-icon { color: rgba(255, 255, 255, 0.6); }
.ts-lang--sidebar .ts-lang-dd.rz-dropdown {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}
.ts-lang--sidebar .ts-lang-dd.rz-dropdown .rz-dropdown-label,
.ts-lang--sidebar .ts-lang-dd.rz-dropdown .rz-dropdown-trigger { color: rgba(255, 255, 255, 0.85); }
.ts-lang--sidebar .ts-lang-dd.rz-dropdown:hover:not(.rz-state-disabled) { border-color: rgba(255, 255, 255, 0.35); }
/* Focused or open, Radzen paints the input white: keep the navy look so the white label stays readable. */
.ts-lang--sidebar .ts-lang-dd.rz-dropdown:not(.rz-state-disabled):is(:focus, :focus-within, .rz-state-focused, .rz-dropdown-open) {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 2px var(--ts-cyan);
}
/* On the sign-in pages: top right of the form panel. */
.auth-main { position: relative; }
.ts-lang--auth { position: absolute; top: 1rem; inset-inline-end: 1.25rem; }
.ts-lang--links { gap: 0.75rem; font-size: 0.875rem; }
.ts-lang--links .ts-lang-link { color: var(--rz-text-secondary-color); text-decoration: none; }
.ts-lang--links a.ts-lang-link:hover { color: var(--rz-primary); text-decoration: underline; }
.ts-lang--links .ts-lang-link--active.rz-text-body2 { margin: 0; color: var(--rz-text-color); font-weight: 600; }

/* Settings → Queries: the keyword list as removable chips. */
.ts-keyword-chip.rz-stack {
    padding: 0.15rem 0.2rem 0.15rem 0.75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: 999px;
    background: var(--rz-base-100);
}
.ts-keyword-chip .rz-text-body2 { margin: 0; }
.ts-keyword-add.rz-button { flex-shrink: 0; height: 2.5rem; }

/* ---- AI assistant (Components/Ai/AiChatDock + AgentChat), after TexwinOS: a floating button bottom right that opens
   a side panel over the content. ---- */
.ts-ai-fab.rz-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 6px 18px rgba(26, 26, 26, 0.28);
}
.ts-ai-fab.rz-button .rzi { font-size: 1.6rem; }
.ts-layout--phone ~ .ts-ai-fab.rz-button,
.ts-layout--phone .ts-ai-fab.rz-button { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); right: 16px; }

.ts-ai-panel {
    position: fixed;
    top: var(--rz-header-min-height, 3.75rem);
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: var(--rz-base-50);
    border-left: 1px solid var(--rz-base-200);
    box-shadow: -12px 0 32px rgba(26, 26, 26, 0.14);
    z-index: 1001;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
}
.ts-ai-panel--open { transform: none; visibility: visible; transition: transform .2s ease; }
.ts-ai-panel-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border-bottom: 1px solid var(--rz-base-200);
    flex: 0 0 auto;
}
.ts-ai-panel-icon.rzi { color: var(--rz-primary); font-size: 1.25rem; margin-right: 0.35rem; }
.ts-ai-panel-title.rz-text-subtitle1 { margin: 0; font-weight: 600; }
.ts-ai-spacer { flex: 1; }
.ts-ai-panel-body { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; }
.ts-ai-panel-body > * { flex: 1 1 auto; min-width: 0; }

@media (max-width: 600px) {
    .ts-ai-panel { width: 100vw; border-left: none; }
}

.ts-agent-chat { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.ts-agent-drop {
    position: absolute;
    inset: 0.5rem;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px dashed var(--rz-primary);
    border-radius: 12px;
    background: color-mix(in srgb, var(--rz-base-50) 88%, transparent);
    color: var(--ts-blue);
    font-weight: 600;
    pointer-events: none;
}
.ts-agent-drop .rzi { font-size: 2.25rem; }
.ts-agent-chat--drop .ts-agent-drop { display: flex; }
.ts-agent-pending { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.4rem; }
.ts-agent-pending-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.1rem 0.15rem 0.1rem 0.5rem;
    border: 1px solid var(--rz-base-300);
    border-radius: 999px;
    background: var(--rz-base-100);
    font-size: 0.75rem;
}
.ts-agent-pending-item > .rzi { font-size: 1rem; color: var(--ts-blue); }
.ts-agent-pending-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.ts-agent-log { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.ts-agent-msg { max-width: 80%; padding: 0.5rem 0.75rem; border-radius: 6px; overflow-wrap: anywhere; font-size: 0.875rem; line-height: 1.43; }
.ts-agent-msg--user { align-self: flex-end; background: var(--rz-primary); color: var(--rz-on-primary, #fff); white-space: pre-wrap; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.ts-agent-msg--assistant { align-self: flex-start; background: var(--rz-base-50); color: var(--rz-text-color); border: 1px solid var(--rz-base-200); box-shadow: 0 1px 3px rgba(26, 26, 26, 0.1); }
.ts-agent-md > :first-child { margin-top: 0; }
.ts-agent-md > :last-child { margin-bottom: 0; }
.ts-agent-md p { margin: 0 0 0.5em; }
.ts-agent-md ul, .ts-agent-md ol { margin: 0.25em 0 0.5em; padding-left: 1.25em; }
.ts-agent-md li { margin: 0.1em 0; }
.ts-agent-md h1, .ts-agent-md h2, .ts-agent-md h3, .ts-agent-md h4 { font-size: 1em; font-weight: 600; margin: 0.5em 0 0.25em; }
.ts-agent-md a { color: var(--ts-blue); }
.ts-agent-md code, .ts-agent-md pre { background: var(--rz-base-100); border-radius: 4px; font-family: var(--ts-font-mono); font-size: 0.9em; }
.ts-agent-md code { padding: 0.05em 0.3em; }
.ts-agent-md pre { padding: 0.5em 0.6em; overflow-x: auto; }
.ts-agent-md pre code { background: none; padding: 0; }
.ts-agent-md blockquote { margin: 0.4em 0; padding-left: 0.6em; border-left: 3px solid var(--rz-base-300); color: var(--rz-text-secondary-color); }
.ts-agent-tool { align-self: center; display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--rz-text-secondary-color); max-width: 100%; }
.ts-agent-tool .rzi { font-size: 0.95rem; }
.ts-agent-busy { align-self: flex-start; padding: 0.25rem 0.5rem; }
.ts-agent-approval { border: 1px solid var(--rz-warning); border-radius: 6px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ts-agent-approval-icon.rzi { color: var(--rz-warning); }
.ts-agent-approval-args { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.75rem; font-size: 0.8125rem; overflow-wrap: anywhere; }
.ts-agent-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; padding: 0 0.75rem 0.25rem; }
.ts-agent-suggestion.rz-button { border-radius: 999px; text-transform: none; max-width: 100%; white-space: normal; height: auto; }
.ts-agent-footer { padding: 0.5rem 0.75rem 0.75rem; }
.ts-agent-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--rz-base-300);
    border-radius: 26px;
    padding: 4px 8px;
    background: var(--rz-base-50);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ts-agent-bar:focus-within { border-color: var(--rz-primary); box-shadow: 0 0 0 1px var(--rz-primary); }
.ts-agent-bar--disabled { opacity: .55; }
.ts-agent-bar-btn.rz-button { width: 36px; height: 36px; min-width: 36px; padding: 0; border-radius: 50%; flex: 0 0 auto; }
.ts-agent-bar-btn.rz-button .rzi { font-size: 1.25rem; }
.ts-agent-field.rz-textbox { flex: 1; min-width: 0; border: none; box-shadow: none; background: transparent; padding: 6px 4px; }
.ts-agent-field.rz-textbox:focus, .ts-agent-field.rz-textbox:hover { border: none; box-shadow: none; outline: none; }
.ts-agent-listening { animation: ts-agent-pulse 1s ease-in-out infinite; }
@keyframes ts-agent-pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.ts-agent-disclaimer.rz-text-caption { display: block; text-align: center; color: var(--rz-text-secondary-color); opacity: .8; margin: 0.35rem 0 0; }
.ts-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* Customer Dashboard tab (docs/12-customer-dashboard.md): chart and table cards two per row, one on phones. */
.ts-dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.ts-dash-grid > .rz-card { min-width: 0; }
@media (max-width: 1024px) { .ts-dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Project KPI vs Budget tab (customer page, docs/12-customer-dashboard.md) ----
   A quieter, report-style look scoped to .ts-kpi: Aptos throughout (falls back to Segoe UI where Aptos isn't
   installed), flat white panels with hairline borders, small-caps section titles with a navy rule, KPI tiles with a
   tone stripe, and a navy / slate chart palette (--ts-kpi-c*; restated for dark in theme-dark.css). */
.ts-kpi {
    --ts-kpi-font: "Aptos", "Aptos Display", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    --ts-kpi-c1: #008060;   /* billable, tracked, primary series */
    --ts-kpi-c2: #b5b5b5;   /* discounted, planned, secondary series */
    --ts-kpi-c3: #4f6bae;
    --ts-kpi-c4: #1a1a1a;
    --ts-kpi-c5: #616161;
    --ts-kpi-c6: #c5cde0;
    --ts-kpi-rule: var(--ts-blue);
    /* categorical (work item types, age buckets): muted, distinct hues */
    --ts-kpi-t1: #008060;   /* navy */
    --ts-kpi-t2: #2f8f83;   /* teal */
    --ts-kpi-t3: #c9962b;   /* ochre */
    --ts-kpi-t4: #7b5aa6;   /* plum */
    --ts-kpi-t5: #6b7a90;   /* slate */
    --ts-kpi-t6: #b8613f;   /* terracotta */
    --ts-kpi-age5: #9e2a2b; /* oldest bucket */
    --rz-text-font-family: var(--ts-kpi-font);
    font-family: var(--ts-kpi-font);
}
.ts-kpi :where(*:not(.rzi):not(.material-icons)) { font-family: var(--ts-kpi-font); }
.ts-kpi .rz-chart text { font-family: var(--ts-kpi-font); font-size: 0.75rem; fill: var(--rz-base-700); }
.ts-kpi .ts-num, .ts-kpi .ts-stat-value { font-variant-numeric: tabular-nums lining-nums; }

.ts-kpi .ts-content-card {
    border: 1px solid var(--rz-base-200);
    border-radius: 6px;
    box-shadow: none;
    padding: 1.1rem 1.25rem;
}

.ts-kpi-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--rz-base-200);
    border-radius: 6px;
    background: var(--rz-base-50);
}
.ts-kpi-filter { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ts-kpi-filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rz-base-600);
}
.ts-kpi-toolbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 0.5rem; }

/* A reload for a new filter keeps the tab's content in place, dimmed (and `inert` in the markup), with a thin bar in the
   gap under the toolbar (#144): no layout jump, and only opacity, so both themes share it. */
.ts-kpi-body { position: relative; }
.ts-kpi--busy > .ts-kpi-content { opacity: 0.55; transition: opacity 0.15s ease-in; }
.ts-kpi-progress.rz-progressbar { position: absolute; top: -0.65rem; inset-inline: 0; height: 3px; z-index: 1; }

.ts-kpi .ts-section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rz-base-800);
}
.ts-kpi .ts-section-heading::before {
    content: "";
    width: 3px;
    height: 0.95rem;
    border-radius: 2px;
    background: var(--ts-kpi-rule);
}

.ts-kpi .ts-stat {
    border-radius: 6px;
    box-shadow: none;
    padding: 1rem 1.1rem 0.9rem 1.25rem;
    overflow: hidden;
}
.ts-kpi .ts-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--ts-kpi-c1);
}
.ts-kpi .ts-stat--ok::before { background: var(--ts-green); }
.ts-kpi .ts-stat--warn::before { background: var(--ts-amber); }
.ts-kpi .ts-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.ts-kpi .ts-stat-icon { width: 1.9rem; height: 1.9rem; border-radius: 6px; background: transparent; color: var(--rz-base-500); }
.ts-kpi .ts-stat-value { font-weight: 600; font-size: 1.75rem; letter-spacing: -0.01em; }
.ts-kpi .ts-stat-foot { font-size: 0.75rem; }

.ts-kpi .rz-grid-table thead th .rz-column-title-content {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ts-kpi .ts-kpi-year { width: 7.5rem; }
.ts-kpi .ts-kpi-month { width: 10rem; }
.ts-kpi .ts-kpi-date { width: 9.5rem; }
/* The project filter keeps its label beside the dropdown; the dropdown shrinks instead of wrapping below it. */
.ts-kpi .ts-kpi-filter--project { flex-wrap: nowrap; min-width: 0; }
.ts-kpi .ts-kpi-project { flex: 1 1 18rem; width: auto; min-width: 9rem; max-width: 22rem; }
.ts-kpi .ts-chart--clickable .rz-series-item, .ts-kpi .ts-chart--clickable path { cursor: pointer; }
.ts-kpi .ts-kpi-age-bar { flex-wrap: wrap; }
.ts-kpi .ts-dash-wide { grid-column: 1 / -1; }

/* Budget bullet bars: the track is the larger of planned and tracked; billed is the dark part of tracked, the
   planned hours a vertical marker. */
.ts-bullets { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.75rem; }
.ts-bullet-head { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.8125rem; margin-bottom: 0.3rem; }
.ts-bullet-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rz-base-800); }
.ts-bullet-figures { flex: none; color: var(--rz-base-600); }
.ts-bullet-track {
    position: relative;
    display: flex;
    height: 0.85rem;
    border-radius: 3px;
    background: var(--rz-base-200);
    overflow: visible;
}
.ts-bullet-billed { background: var(--ts-kpi-c1); }
.ts-bullet-unbilled { background: var(--ts-kpi-c2); }
.ts-bullet-track > .ts-bullet-billed:first-child { border-radius: 3px 0 0 3px; }
.ts-bullet-plan {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: var(--rz-base-900);
}
.ts-bullet-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.75rem; color: var(--rz-base-600); }
.ts-bullet-legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.ts-bullet-swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; }
.ts-bullet-swatch--plan { width: 2px; height: 0.9rem; border-radius: 0; background: var(--rz-base-900); }

/* Project Dashboard: a taller progressive chart and its tooltip. */
.ts-kpi .ts-chart--tall { height: 380px; }
.ts-kpi-tooltip { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; min-width: 14rem; }
.ts-kpi-tooltip-title { font-weight: 600; color: var(--rz-base-900); }
.ts-kpi-tooltip-grid { display: grid; grid-template-columns: auto auto; gap: 0.15rem 0.75rem; margin-top: 0.25rem; }
.ts-kpi-tooltip-grid--money { grid-template-columns: auto auto auto; }
.ts-kpi-tooltip-grid > .ts-num { text-align: right; }
.ts-kpi-tooltip-head { font-weight: 600; text-align: right; color: var(--rz-base-600); }
.ts-kpi .ts-kpi-refreshed { font-size: 0.75rem; white-space: nowrap; }
/* The toolbar's right side (values toggle, refresh) wraps on narrow screens instead of running past the edge. */
.ts-kpi .ts-kpi-toolbar-end { flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
.ts-kpi .ts-kpi-refresh { flex-wrap: wrap; justify-content: flex-end; }

/* Estimate vs actual: the totals line above the chart. */
.ts-kpi .ts-kpi-compare { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; margin: 0.5rem 0 0.25rem; font-size: 0.8125rem; color: var(--rz-base-600); }
.ts-kpi .ts-kpi-compare b { color: var(--rz-base-900); font-weight: 600; }

/* ---- Frontline (time report, docs/17-frontline.md) ----
   Laid out like the Power BI report it replaces, for people who read it from a distance or with poor vision: large
   tiles for view, year, role, month and day; a single scrolling row of big person / customer tiles; a large table with
   a bold total row. A selected tile is navy with white bold text; weekends are muted; while customers are selected, the
   other customers' logos turn grey. Series colours restated for dark in theme-dark.css. */
.ts-fl-main, .ts-fl-filters { --ts-fl-c1: #008060; --ts-fl-c2: #b5b5b5; }
.ts-fl-filters { display: flex; flex-direction: column; gap: 1rem; }
.ts-fl-toprow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.ts-fl-group { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.ts-fl-group .rz-button.ts-fl-tile { min-width: 6.5rem; min-height: 3rem; padding: 0.5rem 1rem; }
.ts-fl-read { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 0.9375rem; color: var(--rz-text-secondary-color); line-height: 1.3; }
.ts-fl-read strong { font-size: 1.125rem; color: var(--rz-text-color); }
.ts-fl-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.5rem; }
.ts-fl-months .rz-button.ts-fl-tile { min-height: 4.5rem; }
.ts-fl-months .ts-fl-tile-label { font-size: 1.125rem; }
.ts-fl-months .ts-fl-tile-value { font-size: 1.125rem; }
.ts-fl-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.75rem, 1fr)); gap: 0.375rem; }
.ts-fl-days .ts-fl-tile--wide { grid-column: span 2; }
.ts-fl-days .rz-button.ts-fl-tile { min-height: 3.75rem; }
.rz-button.ts-fl-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    height: auto;
    padding: 0.5rem 0.375rem;
    border: 2px solid var(--rz-base-400);
    border-radius: var(--ts-radius-sm);
    line-height: 1.2;
    text-transform: none;
}
.rz-button.ts-fl-tile .rz-button-box { display: contents; }
.ts-fl-tile-label { font-size: 1.0625rem; font-weight: 600; color: var(--rz-text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-fl-tile-value { font-size: 1rem; color: var(--rz-text-secondary-color); white-space: nowrap; min-height: 1.2rem; }
:is(.ts-fl-filters, .ts-fl-strip) .rz-button.ts-fl-tile.ts-fl-tile--weekend:not(.ts-fl-tile--on) { background-color: var(--rz-base-100); }
/* Specific enough to beat Radzen's outlined-button background. */
:is(.ts-fl-filters, .ts-fl-strip) .rz-button.ts-fl-tile.ts-fl-tile--on,
:is(.ts-fl-filters, .ts-fl-strip) .rz-button.ts-fl-tile.ts-fl-tile--on:hover:not(.rz-state-disabled) { background-color: var(--rz-primary); border-color: var(--rz-primary); }
.rz-button.ts-fl-tile--on .ts-fl-tile-label,
.rz-button.ts-fl-tile--on .ts-fl-tile-value,
.rz-button.ts-fl-tile--on .ts-fl-person-name { color: var(--rz-on-primary); font-weight: 700; }
.rz-button.ts-fl-tile--on .ts-fl-avatar { background: var(--rz-on-primary); color: var(--rz-primary); }
.rz-button.ts-fl-tile--on .ts-fl-logo { background: var(--rz-on-primary); }
.rz-button.ts-fl-chip { text-transform: none; }
.rz-button.ts-fl-tile:disabled { border-color: var(--rz-base-200); }
.rz-button.ts-fl-tile:disabled .ts-fl-tile-label { color: var(--rz-text-disabled-color); }

/* One row of big tiles that scrolls sideways, like the Power BI strip; a full-size scrollbar so it is easy to grab. */
.ts-fl-strip { display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; padding: 0.125rem 0.125rem 0.75rem; scrollbar-width: auto; }
.rz-button.ts-fl-pic-tile { flex: none; width: 10rem; justify-content: flex-start; gap: 0.35rem; padding: 0.75rem 0.5rem; }
.ts-fl-person-name { font-size: 1.0625rem; font-weight: 600; color: var(--rz-text-color); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-fl-avatar.ts-avatar { flex: none; width: 5rem; height: 5rem; font-size: 1.5rem; }
.ts-fl-avatar--logo.ts-avatar { border-radius: var(--ts-radius-sm); width: 8rem; max-width: 100%; }
/* Logos are often wide (a wordmark), so their box is wider than the round photos. */
.ts-fl-logo { flex: none; width: 2.75rem; height: 2rem; object-fit: contain; border-radius: 6px; background: var(--rz-base-50); }
.ts-fl-strip .ts-fl-logo { width: 8rem; height: 5rem; max-width: 100%; }
.ts-fl-logo--lg { width: 5rem; height: 5rem; }
.ts-fl-photo { flex: none; width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; background: var(--rz-base-200); }
.ts-fl-tile--dim :is(.ts-fl-logo, .ts-fl-avatar) { filter: grayscale(1); opacity: 0.5; }
/* Balance due (docs/19, docs/20): as in Power BI, hovering (or focusing) a customer tile shows the balance in place of the
   hours, on a grey tile. Only tiles with a balance over 300 get ts-fl-tile--balance. */
.ts-fl-tile-balance { display: none; max-width: 100%; }
.ts-fl-tile-balance > span { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Several currencies: one per line, a little smaller so the tile barely grows. */
.ts-fl-tile-balance--multi { font-size: 0.8125rem; line-height: 1.15; }
.rz-button.ts-fl-tile--balance:is(:hover, :focus-visible) .ts-fl-tile-hours { display: none; }
.rz-button.ts-fl-tile--balance:is(:hover, :focus-visible) .ts-fl-tile-balance { display: block; }
:is(.ts-fl-filters, .ts-fl-strip) .rz-button.ts-fl-tile--balance:not(.ts-fl-tile--on):is(:hover, :focus-visible) { background-color: var(--rz-base-300); }

.ts-fl-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.ts-fl-main--split { grid-template-columns: minmax(0, 2fr) minmax(22rem, 1fr); align-items: start; }
.ts-fl-strip-card { margin-top: 1rem; }
.ts-fl-strip-card .rz-text-subtitle2 { font-size: 1.125rem; }

/* The table: large text, bold headers and group rows, and a large bold total row (the footer). */
.ts-fl-grid { font-size: 1.125rem; --rz-grid-cell-font-size: 1.125rem; }
.ts-fl-grid .rz-data-row > td, .ts-fl-grid .ts-tree-title-text, .ts-fl-grid .ts-tree-title-text .ts-cell-strong { font-size: 1.125rem; }
.ts-fl-grid .rz-grid-table thead th .rz-column-title { font-size: 1.125rem; font-weight: 600; color: var(--rz-text-color); }
.ts-fl-grid .rz-data-row > td { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.ts-fl-grid .ts-num { font-size: 1.125rem; }
.ts-fl-grid .ts-review-id { font-size: 1rem; }
.ts-fl-grid .ts-tree-toggle .rz-button-icon-left { font-size: 1.5rem; }
.ts-fl-grid .rz-grid-table tfoot td { font-size: 1.375rem; font-weight: 700; color: var(--rz-text-color); border-top: 2px solid var(--rz-text-color); }
.ts-fl-grid .rz-grid-table tfoot .ts-num { font-size: 1.375rem; }
/* The summary above the table repeats the total row: only phones (cards, no total row) need it. */
.ts-tree-toolbar > span.ts-fl-summary { display: none; }
/* Cards on phones: half the tree indent, so six levels still leave room for the text. */
.ts-fl-card, .ts-fl-card .ts-tree-title-text, .ts-fl-card .ts-cell-strong { font-size: 1.0625rem; }
.ts-fl-card .ts-tree-title { padding-left: calc(var(--ts-tree-depth, 0) * 0.75rem); min-width: 0; }
.ts-fl-card-figures { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.35rem; padding-left: 1.75rem; font-size: 0.9375rem; color: var(--rz-text-secondary-color); }

/* Twelve full month names fit side by side only on wide screens; elsewhere two rows of six. */
@media (max-width: 1800px) {
    .ts-fl-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .ts-fl-main--split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .ts-fl-read { margin-left: 0; align-items: flex-start; }
    .ts-fl-group .rz-button.ts-fl-tile { min-width: 0; padding: 0.5rem 0.75rem; }
    .ts-fl-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ts-fl-months .rz-button.ts-fl-tile { min-height: 3.75rem; }
    .ts-fl-months .ts-fl-tile-label, .ts-fl-months .ts-fl-tile-value { font-size: 1rem; }
    .ts-fl-days { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; }
    .ts-fl-days .ts-fl-tile--wide { grid-column: span 7; }
    .ts-fl-days .rz-button.ts-fl-tile { min-height: 3.25rem; padding: 0.375rem 0.125rem; }
    .ts-fl-days .ts-fl-tile-value { font-size: 0.8125rem; }
    .rz-button.ts-fl-pic-tile { width: 8.5rem; }
    .ts-tree-toolbar > span.ts-fl-summary { display: inline; font-size: 1rem; font-weight: 600; color: var(--rz-text-color); }
}

/* A form field that takes the free width of its row (e.g. Settings → Business Central company picker). */
.ts-grow {
    flex: 1 1 16rem;
    min-width: 0;
}

/* Settings helper texts can hold long example URLs: let them wrap on phones instead of running past the card or dialog. */
.ts-settings-card .rz-form-field-helper,
.ts-dialog-form .rz-form-field-helper {
    overflow-wrap: anywhere;
}

/* Customers list: the Azure DevOps project picture (or initials) before the name. */
.ts-customer-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.ts-customer-text { min-width: 0; }
.ts-customer-logo { flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--ts-radius-sm); }
img.ts-customer-logo { object-fit: contain; background: var(--rz-base-50); }
.ts-customer-logo--initials.ts-avatar { border-radius: var(--ts-radius-sm); font-size: 0.75rem; }

/* Users list and Edit user: the person's picture (uploaded, Azure DevOps, or initials), round. */
.ts-user-photo { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; }
img.ts-user-photo { object-fit: cover; background: var(--rz-base-50); }
.ts-user-photo--lg, .ts-user-photo--lg.ts-avatar { width: 5rem; height: 5rem; font-size: 1.5rem; }

/* One role's visible customer tabs (CustomerTabChecks): wraps on narrow screens. */
.ts-tab-checks.rz-checkbox-list-horizontal,
.ts-tab-checks {
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

/* Reconnect dialog (ReconnectModal.razor, #153). Blazor sets one components-reconnect-* class per state; each line of
   text and each button shows only in its states. Radzen's tokens, so it follows the theme. */
#components-reconnect-modal {
    box-sizing: border-box;
    width: min(22rem, calc(100vw - 2rem));
    margin: 20vh auto;
    padding: 1.75rem 1.5rem;
    border: 0;
    border-radius: var(--ts-radius);
    background: var(--rz-base-background-color);
    color: var(--rz-text-color);
    box-shadow: var(--ts-shadow);
}
#components-reconnect-modal:focus { outline: none; }
#components-reconnect-modal::backdrop { background-color: rgba(26, 26, 26, 0.4); }
.ts-reconnect-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}
.ts-reconnect-body .rz-text-body1 { margin: 0; }
#components-reconnect-modal .components-reconnect-first-attempt-visible,
#components-reconnect-modal .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal .components-reconnect-failed-visible,
#components-reconnect-modal .components-pause-visible,
#components-reconnect-modal .components-resume-failed-visible,
#components-reconnect-modal .components-rejoining-animation {
    display: none;
}
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible {
    display: block;
}
/* Blazor keeps "show" on while it retries: the first attempt's line gives way to the retry countdown. */
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-first-attempt-visible { display: none; }
#components-reconnect-modal.components-reconnect-failed .rz-button.components-reconnect-failed-visible,
#components-reconnect-modal.components-reconnect-paused .rz-button.components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .rz-button.components-resume-failed-visible {
    display: inline-flex;
}

/* Orders page (docs/30-order-captures.md): the per-day chart, and a capture's order JSON in the side panel. */
.ts-orders-chart {
    width: 100%;
    height: 280px;
}

.ts-json {
    margin: 0;
    padding: 1rem;
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-100);
    color: var(--rz-text-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* The schedule editor's preview of the next runs (docs/31-scheduled-sync.md → Cron). */
.ts-schedule-preview {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--ts-radius-sm);
    background: var(--rz-base-100);
}

.ts-schedule-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

/* Select all, the count and the action above a list with checkboxes (docs/35-bulk-runs-issues.md). */
.ts-selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-height: 2rem; }
.ts-selection-label { cursor: pointer; user-select: none; }
.ts-card-check { display: flex; align-items: flex-start; gap: 0.75rem; }
/* Dashboard shop rows: one line of company and store, pills that wrap with a gap, one run button (docs/04-ui-redesign.md → Dashboard). */
.ts-dash-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ts-dash-pills { display: flex; flex-wrap: wrap; gap: 0.25rem 0.375rem; align-items: center; }
.ts-dash-card-pills { margin: 0.25rem 0 0.5rem; }
.ts-dash-card-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.ts-record-field-value .ts-dash-pills { justify-content: flex-end; }

/* The run page's phase progress (docs/40-run-progress.md): a bar, the line under it, every step with its count and time. */
.ts-phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1rem; }
.ts-phase { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ts-phase-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.ts-phase-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.25rem 1.5rem; margin-top: 0.25rem; }
.ts-phase-step { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.ts-phase-step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-phase-step-count { color: var(--rz-text-secondary-color); white-space: nowrap; }
.ts-phase-step .rzi { font-size: 1.125rem; }
.ts-phase-step.is-done .rzi { color: var(--ts-ok); }
.ts-phase-step.is-running { font-weight: 600; }
.ts-phase-step.is-running .rzi { color: var(--rz-info); animation: ts-spin 1.2s linear infinite; }
.ts-phase-step.is-waiting, .ts-phase-step.is-skipped { color: var(--rz-text-tertiary-color); }
.ts-phase-step.is-stopped .rzi { color: var(--rz-warning); }
/* The Phases tab: the selected phase's row or card, and its steps under the table (docs/44-run-timing.md). */
.rz-grid-table tbody tr.rz-data-row.ts-row-selected > td { background: var(--ts-blue-50); }
.rz-grid-table tbody tr.rz-data-row.ts-row-selected > td:first-child { box-shadow: inset 3px 0 var(--rz-primary); }
.ts-record-card.ts-row-selected { background: var(--ts-blue-50); border-left: 3px solid var(--rz-primary); }
.ts-phase-detail { margin-top: 1rem; }
@media (max-width: 480px) { .ts-phase-step-name { white-space: normal; overflow-wrap: anywhere; } }
@keyframes ts-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ts-phase-step.is-running .rzi { animation: none; } }

/* A confirm whose OK deletes (docs/43-run-deletion.md): Radzen's Confirm has no button style, so its OK is coloured here. */
.ts-confirm-danger .rz-dialog-confirm-buttons .rz-button.rz-primary { background-color: var(--rz-danger); color: var(--rz-on-danger); }
.ts-confirm-danger .rz-dialog-confirm-buttons .rz-button.rz-primary:not(.rz-state-disabled):hover { background-color: var(--rz-danger-dark); }
