/*
 * ToolSystem theme: layered on top of Filament without a build step.
 * Filament ships its styles in cascade layers, so these unlayered rules win.
 */

:root {
    --ts-bg: #EEF0F4;
    --ts-card: #FFFFFF;
    --ts-ink: #16181D;
    --ts-muted: #5B6270;
    --ts-line: #E6E8EE;
    --ts-line-soft: #F0F1F5;
    --ts-soft: #F6F7FA;
    --ts-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .04);
    --ts-accent: #2F5BEA;
    --ts-accent-ink: #1E40AF;
    --ts-ok: #0F766E;
    --ts-ok-ink: #0F5F58;
    --ts-ok-soft: #E0F2EF;
    --ts-warn: #C2410C;
    --ts-warn-ink: #9A3412;
    --ts-warn-soft: #FFF6EF;
    --ts-blue-soft: #E3E9FD;
    --ts-purple-soft: #ECE7FB;
    --ts-purple-ink: #5B21B6;
    --ts-gray-soft: #E5E7EB;
    --ts-gray-ink: #374151;
    /* Light mode: white sidebar */
    --ts-sidebar: #FFFFFF;
    --ts-sidebar-ink: #3A404C;
    --ts-sidebar-muted: #6B7280;
    --ts-sidebar-title: #16181D;
    --ts-sidebar-hover: #F1F3F7;
    --ts-sidebar-line: #E6E8EE;
    --ts-sidebar-tool-bg: #F1F3F7;
    --ts-tool-active-bg: #16181D;
    --ts-tool-active-ink: #FFFFFF;
}

.dark {
    --ts-bg: #0E1014;
    --ts-card: #181B22;
    --ts-ink: #E8EAEF;
    --ts-muted: #9AA3B2;
    --ts-line: #2A2E38;
    --ts-line-soft: #23262F;
    --ts-soft: #20232B;
    --ts-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --ts-accent-ink: #9DB4FF;
    --ts-ok-ink: #5EEAD4;
    --ts-ok-soft: rgba(15, 118, 110, .22);
    --ts-warn-ink: #FDBA74;
    --ts-warn-soft: rgba(194, 65, 12, .16);
    --ts-blue-soft: rgba(47, 91, 234, .22);
    --ts-purple-soft: rgba(91, 33, 182, .28);
    --ts-purple-ink: #C4B5FD;
    --ts-gray-soft: #2A2E38;
    --ts-gray-ink: #C9CDD6;
    /* Dark mode: dark sidebar */
    --ts-sidebar: #14161C;
    --ts-sidebar-ink: #C9CDD6;
    --ts-sidebar-muted: #8A92A3;
    --ts-sidebar-title: #FFFFFF;
    --ts-sidebar-hover: rgba(255, 255, 255, .06);
    --ts-sidebar-line: rgba(255, 255, 255, .08);
    --ts-sidebar-tool-bg: rgba(255, 255, 255, .06);
    --ts-tool-active-bg: #FFFFFF;
    --ts-tool-active-ink: #14161C;
}

body, .fi-body {
    font-family: 'Manrope', 'Noto Sans SC', sans-serif;
}

.fi-body {
    background: var(--ts-bg);
}

/* ---------- Sidebar ---------- */

.fi-sidebar,
.fi-sidebar-header {
    background: var(--ts-sidebar) !important;
    border-color: var(--ts-sidebar-line) !important;
    box-shadow: none !important;
}

.fi-sidebar .fi-logo,
.fi-sidebar-header a {
    color: var(--ts-sidebar-title);
    font-weight: 800;
}

.fi-sidebar-group-label {
    color: var(--ts-sidebar-muted) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fi-sidebar-item-btn {
    border-radius: 10px;
}

.fi-sidebar-item-label,
.fi-sidebar-item-icon,
.fi-sidebar-group-collapse-btn,
.fi-sidebar .fi-icon-btn {
    color: var(--ts-sidebar-ink) !important;
}

.fi-sidebar-item-btn:hover,
.fi-sidebar-item-btn:focus-visible {
    background: var(--ts-sidebar-hover) !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--ts-accent) !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: #FFFFFF !important;
}

/* ---------- Topbar ---------- */

.fi-topbar,
.fi-topbar-ctn > nav {
    background: var(--ts-bg);
    box-shadow: none;
    border-color: transparent;
}

/* Account name and role, top right */

.ts-account {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-account-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ts-blue-soft);
    color: var(--ts-accent-ink);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-account-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.ts-account-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ts-ink);
}

.ts-account-role {
    font-size: 12px;
    color: var(--ts-muted);
}

/* ---------- Sidebar tools: language, theme, logout ---------- */

/*
 * Same horizontal rhythm as Filament's nav items: 16px from the sidebar edge,
 * 8px button padding, 20px icon, 12px gap before the label.
 */
.ts-sidebar-tools {
    margin-top: auto;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--ts-sidebar-line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ts-sidebar-tools form {
    margin: 0;
}

.ts-tool-group {
    display: flex;
    background: var(--ts-sidebar-tool-bg);
    border-radius: 10px;
    padding: 3px;
}

.ts-tool-group > form,
.ts-tool-group > .ts-tool-btn {
    flex: 1;
}

.ts-tool-btn {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ts-sidebar-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.ts-tool-btn:hover {
    background: var(--ts-sidebar-hover);
}

.ts-tool-btn.ts-tool-active {
    background: var(--ts-tool-active-bg);
    color: var(--ts-tool-active-ink);
}

.ts-tool-short {
    display: none;
}

.ts-logout {
    width: 100%;
    border: 0;
    border-radius: var(--radius-lg, 8px);
    background: transparent;
    color: var(--ts-sidebar-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    cursor: pointer;
}

.ts-logout svg {
    flex: none;
}

.ts-logout:hover {
    background: var(--ts-sidebar-hover);
    color: var(--ts-sidebar-title);
}

/* ---------- Collapsed sidebar: icon with a small title underneath ---------- */

@media (min-width: 1024px) {
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-btn {
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 10px 4px;
    }

    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-label {
        display: block !important;
        max-width: 100%;
        font-size: 11px;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fi-sidebar:not(.fi-sidebar-open) .ts-sidebar-tools {
        padding-inline: 10px;
    }

    .fi-sidebar:not(.fi-sidebar-open) .ts-tool-label {
        display: none;
    }

    .fi-sidebar:not(.fi-sidebar-open) .ts-tool-short {
        display: inline;
    }

    .fi-sidebar:not(.fi-sidebar-open) .ts-tool-btn {
        padding: 0 4px;
        font-size: 12px;
    }

    .fi-sidebar:not(.fi-sidebar-open) .ts-logout {
        flex-direction: column;
        gap: 4px;
        padding: 10px 4px;
        font-size: 11px;
    }
}

/* ---------- Page heading ---------- */

.fi-header-heading {
    font-weight: 800;
    letter-spacing: -.01em;
}

/* ---------- Building blocks ---------- */

.ts-card {
    background: var(--ts-card);
    border-radius: 18px;
    box-shadow: var(--ts-shadow);
    color: var(--ts-ink);
}

.ts-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
}

.ts-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ts-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ts-h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--ts-ink);
}

.ts-muted { color: var(--ts-muted); }
.ts-small { font-size: 12px; }
.ts-strong { font-weight: 700; font-size: 14px; }
.ts-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.ts-nowrap { white-space: nowrap; }
.ts-ml { margin-inline-start: 14px; }
.ts-text-ok { color: var(--ts-ok-ink); font-weight: 600; }
.ts-text-warn { color: var(--ts-warn-ink); font-weight: 700; }

.ts-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ts-link {
    color: var(--ts-accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
}

.dark .ts-link { color: #9DB4FF; }
.ts-link:hover { text-decoration: underline; }

.ts-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--ts-accent);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ts-btn:hover { background: #2449C8; }

.ts-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ts-chip {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.ts-chip-blue, .ts-chip-module-tg { background: var(--ts-blue-soft); color: var(--ts-accent-ink); }
.ts-chip-teal, .ts-chip-module-checker { background: var(--ts-ok-soft); color: var(--ts-ok-ink); }
.ts-chip-module-landing { background: var(--ts-purple-soft); color: var(--ts-purple-ink); }
.ts-chip-gray { background: var(--ts-gray-soft); color: var(--ts-gray-ink); }
.ts-chip-solid-orange { background: var(--ts-warn); color: #FFFFFF; }

.ts-demo-note {
    margin: 8px 0 0;
    text-align: end;
    font-size: 11px;
    color: var(--ts-muted);
}

/* ---------- Stat cards ---------- */

.ts-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ts-stat {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ts-stat-head,
.ts-stat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ts-stat-foot {
    align-items: flex-end;
    font-size: 13px;
    font-weight: 600;
}

.ts-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-muted);
}

.ts-stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.ts-stat-alert {
    background: var(--ts-warn-soft);
    color: var(--ts-warn-ink);
}

.ts-stat-alert .ts-stat-label { color: var(--ts-warn-ink); }

.ts-spark {
    stroke: var(--ts-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ts-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--ts-ok);
    margin-inline-end: 6px;
}

/* ---------- Tables ---------- */

.ts-table-wrap { overflow-x: auto; }

.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 620px;
}

.ts-table th {
    text-align: start;
    font-weight: 600;
    color: var(--ts-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--ts-line);
}

.ts-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ts-line-soft);
}

.ts-status {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.ts-status-ok { background: var(--ts-ok-soft); color: var(--ts-ok-ink); }
.ts-status-blocked { background: var(--ts-warn); color: #FFFFFF; }
.ts-status-down { background: var(--ts-gray-soft); color: var(--ts-gray-ink); }

.ts-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ts-muted);
}

.ts-legend > span { display: flex; align-items: center; gap: 6px; }
.ts-swatch { width: 10px; height: 10px; border-radius: 3px; }
.ts-swatch-ok { background: var(--ts-ok); }
.ts-swatch-blocked { background: var(--ts-warn); }
.ts-swatch-down { background: #6B7280; }

/* ---------- Alerts timeline ---------- */

.ts-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ts-timeline li {
    display: flex;
    gap: 12px;
}

.ts-timeline-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    margin-top: 5px;
    background: #6B7280;
}

.ts-timeline-blocked { background: var(--ts-warn); }
.ts-timeline-recovered { background: var(--ts-accent); }
.ts-timeline-title { font-size: 14px; font-weight: 600; }

/* ---------- Telegram bots ---------- */

.ts-bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.ts-bot {
    border: 1px solid var(--ts-line);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ts-bot-id { display: flex; align-items: center; gap: 10px; }

.ts-bot-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ts-muted);
}

.ts-bot-stats strong { color: var(--ts-ink); font-size: 14px; }

.ts-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.ts-avatar-blue { background: var(--ts-blue-soft); color: var(--ts-accent-ink); }
.ts-avatar-teal { background: var(--ts-ok-soft); color: var(--ts-ok-ink); }
.ts-avatar-orange { background: var(--ts-warn-soft); color: var(--ts-warn-ink); }

.ts-progress-box {
    background: var(--ts-soft);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}

.ts-progress-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.ts-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--ts-line);
    overflow: hidden;
}

.ts-progress > div {
    height: 100%;
    border-radius: 4px;
    background: var(--ts-accent);
}

/* ---------- Locked module ---------- */

.ts-locked {
    height: 100%;
    box-sizing: border-box;
    border: 2px dashed var(--ts-line);
    border-radius: 18px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    color: var(--ts-ink);
}

.ts-locked p { margin: 0; font-size: 14px; line-height: 1.6; }

.ts-locked-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--ts-purple-soft);
    color: var(--ts-purple-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Devices ---------- */

.ts-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ts-device {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ts-device-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ts-device-carrier { font-weight: 800; font-size: 15px; }

.ts-battery {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}

.ts-battery-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--ts-line);
    overflow: hidden;
}

.ts-battery-bar > div {
    height: 100%;
    border-radius: 3px;
    background: var(--ts-ok);
}

.ts-battery-bar > div.ts-low { background: #B45309; }

/* ---------- Lists ---------- */

.ts-list-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ts-line-soft);
}

.ts-list-row:last-child { border-bottom: 0; }

@media (min-width: 1024px) {
    .fi-sidebar {
        border-inline-end: 1px solid var(--ts-sidebar-line);
    }
}

/* ---------- Empty states and clickable cards ---------- */

.ts-empty {
    border: 2px dashed var(--ts-line);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

a.ts-bot {
    color: inherit;
    text-decoration: none;
    transition: border-color .15s;
}

a.ts-bot:hover {
    border-color: var(--ts-accent);
}

.ts-avatar-gray { background: var(--ts-gray-soft); color: var(--ts-gray-ink); }

/* ---------- Bot simulator (Telegram-style chat) ---------- */

.ts-sim {
    --ts-sim-bg: #DCE6EE;
    --ts-sim-bot: #FFFFFF;
    --ts-sim-user: #DCF8C6;
    --ts-sim-user-ink: #16181D;
    display: flex;
    flex-direction: column;
    height: 640px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--ts-card);
    box-shadow: var(--ts-shadow);
    color: var(--ts-ink);
    position: sticky;
    top: 16px;
}

.dark .ts-sim {
    --ts-sim-bg: #0F1419;
    --ts-sim-bot: #1F2630;
    --ts-sim-user: #2B5278;
    --ts-sim-user-ink: #FFFFFF;
}

.ts-sim-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ts-line);
}

.ts-sim-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.3;
}

.ts-sim-title span {
    font-size: 12px;
    color: var(--ts-muted);
}

.ts-sim-restart {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ts-line);
    background: transparent;
    color: var(--ts-ink);
    border-radius: 10px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ts-sim-restart:hover { border-color: var(--ts-accent); }

.ts-sim-body {
    flex: 1;
    overflow-y: auto;
    background: var(--ts-sim-bg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ts-sim-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}

.ts-sim-user {
    align-self: flex-end;
    background: var(--ts-sim-user);
    color: var(--ts-sim-user-ink);
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}

.ts-sim-bot-wrap {
    align-self: flex-start;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-sim-bot {
    max-width: 100%;
    background: var(--ts-sim-bot);
    border-bottom-left-radius: 4px;
}

.ts-sim-bot a { color: var(--ts-accent); }
.dark .ts-sim-bot a { color: #9DB4FF; }

.ts-sim-rule {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--ts-muted);
    text-align: end;
}

.ts-sim-inline-row {
    display: flex;
    gap: 4px;
}

.ts-sim-inline {
    flex: 1;
    border: 0;
    border-radius: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, .7);
    color: var(--ts-accent-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.dark .ts-sim-inline { background: rgba(255, 255, 255, .1); }
.ts-sim-inline:hover { background: #FFFFFF; }
.dark .ts-sim-inline:hover { background: rgba(255, 255, 255, .18); }

.ts-sim-system {
    align-self: center;
    font-size: 12px;
    color: var(--ts-muted);
    background: rgba(255, 255, 255, .6);
    padding: 3px 10px;
    border-radius: 999px;
    text-align: center;
}

.dark .ts-sim-system { background: rgba(255, 255, 255, .08); }

.ts-sim-empty {
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--ts-muted);
}

.ts-sim-empty p { margin: 0; max-width: 260px; }

.ts-sim-empty .ts-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

.ts-sim-menu {
    border-top: 1px solid var(--ts-line);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ts-soft);
}

.ts-sim-menu-row {
    display: flex;
    gap: 4px;
}

.ts-sim-menu-row button {
    flex: 1;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--ts-card);
    color: var(--ts-ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}

.ts-sim-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--ts-line);
    margin: 0;
}

.ts-sim-input input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--ts-line);
    border-radius: 999px;
    padding: 9px 14px;
    background: var(--ts-card);
    color: var(--ts-ink);
    font: inherit;
    font-size: 14px;
}

.ts-sim-input input:focus {
    outline: 2px solid var(--ts-accent);
    outline-offset: -1px;
}

.ts-sim-input button {
    width: 40px;
    height: 40px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--ts-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* A bot message that appears or is switched in place fades in, as on Telegram. */
.ts-sim-bot-wrap {
    animation: ts-sim-in .18s ease-out;
}

@keyframes ts-sim-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ts-sim-bot-wrap { animation: none; }
}

/* Bot overview: admins and recent broadcasts side by side */
.ts-overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1024px) {
    .ts-overview-grid { grid-template-columns: 1fr 1fr; }
}

.ts-overview-grid .ts-list-row { align-items: center; gap: 12px; }
.ts-overview-grid .ts-nowrap { text-align: end; }

.ts-panel code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--ts-line-soft);
}

.ts-broadcast {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ts-line-soft);
}

.ts-broadcast:last-child { border-bottom: 0; }

.ts-broadcast-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

a.ts-stat-link { color: inherit; text-decoration: none; transition: border-color .15s; }
a.ts-stat-link:hover { box-shadow: 0 0 0 2px var(--ts-accent); }

.ts-locked-panel { box-shadow: inset 4px 0 0 var(--ts-warn); }
.ts-locked-panel .ts-list-row { align-items: center; gap: 12px; }

.ts-stat-breakdown { border-top: 1px solid var(--ts-line-soft); padding-top: 6px; }
.ts-stat-breakdown .ts-list-row { padding: 4px 0; color: inherit; text-decoration: none; }
.ts-stat-breakdown .ts-list-row:hover { color: var(--ts-accent); }

/* Resit Proof: the code customers copy to their website */
.ts-proof-snippet pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: var(--ts-soft);
    border: 1px solid var(--ts-line);
    border-radius: 10px;
    color: var(--ts-ink);
    font: 500 12.5px/1.6 'JetBrains Mono', ui-monospace, monospace;
    white-space: pre;
}
.ts-proof-snippet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.ts-proof-snippet-foot .ts-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
