/* TSC Connected Care — aligned with system-dashboard.thelma-portal.io */
:root {
    --tsc-beige: #f9f1f2;
    --tsc-almond: #e2b7af;
    --tsc-almond-deep: #d4a89f;
    --tsc-almond-light: #edd5cf;
    --tsc-text: #1e2a30;
    --tsc-heading: #2a5f7a;
    --tsc-accent: #c97d8f;
    --tsc-accent-dark: #b86f81;
    --tsc-brown-muted: #6b534c;
    --tsc-page-title: #5c483f;
    --tsc-body-soft: #5a4f4a;
    --tsc-page-bg: var(--tsc-beige);
    --tsc-table-header-bg: #e8d9d4;
    --tsc-table-row-alt: rgba(252, 247, 246, 0.92);
    --tsc-table-border: rgba(115, 78, 68, 0.14);
    --tsc-table-hover: rgba(226, 183, 175, 0.28);
    --tsc-ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --tsc-ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
    --tsc-duration: 0.28s;
    --bs-primary: var(--tsc-accent);
    --bs-primary-rgb: 201, 125, 143;
    --bs-link-color: var(--tsc-heading);
    --bs-link-hover-color: #234f66;
    --bs-body-color: var(--tsc-text);
    --bs-body-bg: var(--tsc-beige);
    --bs-border-color: var(--tsc-table-border);
    --bs-secondary-color: var(--tsc-body-soft);
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: linear-gradient(168deg, #f3ebe8 0%, var(--tsc-beige) 42%, #faf4f2 88%);
    color: var(--tsc-text);
    line-height: 1.58;
    letter-spacing: 0.01em;
}

a, .btn-link {
    color: var(--tsc-heading);
}

.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(185deg, var(--tsc-almond-light) 0%, var(--tsc-almond) 48%, var(--tsc-almond-deep) 100%);
    color: var(--tsc-text);
    box-shadow: 3px 0 28px rgba(62, 40, 35, 0.07);
    flex-shrink: 0;
    width: 270px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background: linear-gradient(180deg, #fefcfb 0%, var(--tsc-beige) 38%, #f7f0ee 100%);
}

.content {
    padding-top: 1.75rem;
    padding-bottom: 2.25rem;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header__lead {
    margin: 0.35rem 0 0;
    color: var(--tsc-body-soft);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 42rem;
}

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-grid {
    --page-grid-gap: 1.5rem;
}

.form-stack {
    max-width: 26rem;
}

.form-stack .form-control,
.form-stack .form-select {
    max-width: 100%;
}

/* Create device page */
.device-create-page .page-header {
    margin-bottom: 1.25rem;
}

.device-create-form .card-body {
    padding: 1.25rem 1.35rem 1.1rem;
}

.device-create-form__stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.device-create-form__stack .form-field {
    width: 100%;
}

.device-create-form__stack .form-field--name {
    max-width: 18rem;
}

.device-create-form__stack .form-field--imei {
    max-width: 13.5rem;
}

.device-create-form__stack .form-field--select {
    max-width: 22rem;
}

.device-create-form__stack .form-control,
.device-create-form__stack .form-select {
    width: 100%;
}

.device-create-form__stack .form-field--imei .form-control {
    letter-spacing: 0.06em;
}

.device-create-form__modes {
    width: 100%;
    max-width: 26rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(249, 241, 242, 0.55);
    border: 1px solid var(--tsc-table-border);
}

.device-create-form__modes-legend {
    float: none;
    width: auto;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.device-create-form__modes .form-check {
    margin-bottom: 0.45rem;
}

.device-create-form__modes .form-check:last-child {
    margin-bottom: 0;
}

.device-create-form__stack .form-field--stream-id {
    max-width: 26rem;
}

.device-create-form__register {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    max-width: 26rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(249, 241, 242, 0.55);
    border: 1px solid var(--tsc-table-border);
}

.device-create-form__register-input {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.2rem 0 0 0;
}

.device-create-form__register-label {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
    font-weight: 500;
    cursor: pointer;
}

.device-create-page__env .env-context-card {
    min-width: 16rem;
}

.device-create-form__stack .alert {
    max-width: 22rem;
}

.device-create-form__stack .form-actions {
    width: 100%;
    max-width: 22rem;
    border-top: 1px solid var(--tsc-table-border);
    padding-top: 1rem;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
}

.form-actions .btn-link {
    padding-inline: 0.25rem;
    text-decoration: none;
}

.form-actions .btn-link:hover {
    text-decoration: underline;
}

.home-hero {
    max-width: 36rem;
    margin-bottom: 1.75rem;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.empty-state {
    max-width: 32rem;
}

.context-panel--sticky {
    position: sticky;
    top: 1.5rem;
}

.env-context-card {
    padding: 1.15rem 1.2rem 1.1rem;
    border-radius: 14px;
    background: rgba(255, 252, 252, 0.92);
    border: 1px solid var(--tsc-table-border);
    box-shadow: 0 8px 28px rgba(62, 40, 35, 0.06);
}

.env-context-card__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.env-context-card__eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tsc-brown-muted);
}

.env-context-card__body {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--tsc-body-soft);
}

.env-context-card__meta {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--tsc-table-border);
}

.env-context-card__meta dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tsc-brown-muted);
    margin-bottom: 0.25rem;
}

.env-context-card__meta dd {
    margin: 0;
    color: var(--tsc-body-soft);
    word-break: break-all;
}

.env-context-card__missing {
    font-size: 0.9rem;
    color: var(--tsc-body-soft);
}

.device-meta {
    margin: 0;
    font-size: 0.95rem;
    color: var(--tsc-body-soft);
}

.device-meta code {
    font-size: 0.88em;
    color: var(--tsc-heading);
    background: rgba(232, 217, 212, 0.45);
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
}

.pre-scroll {
    max-height: 220px;
    overflow: auto;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--tsc-body-soft);
    background: rgba(249, 241, 242, 0.5);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: end;
}

.alert-warning {
    border-radius: 12px;
}

.alert-danger,
.alert-success {
    border-radius: 12px;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: 0.008em;
    color: var(--tsc-page-title);
    margin: 0 0 0.85rem;
}

.page-title--compact {
    font-size: 1.35rem;
    margin-bottom: 0.65rem;
}

.tsc-lead,
.content .lead {
    color: var(--tsc-body-soft);
    font-size: 1.02rem;
    line-height: 1.62;
    letter-spacing: 0.015em;
}

.content p {
    color: var(--tsc-body-soft);
}

.content .text-muted {
    color: var(--tsc-body-soft) !important;
}

.card.tsc-card,
.auth-card {
    border: 1px solid var(--tsc-table-border);
    border-radius: 14px;
    background: rgba(255, 252, 252, 0.88);
    box-shadow: 0 6px 28px rgba(62, 40, 35, 0.045);
}

.card.tsc-card .card-header {
    background: rgba(232, 217, 212, 0.45);
    border-bottom: 1px solid var(--tsc-table-border);
    color: var(--tsc-heading);
    font-weight: 600;
}

.btn-primary,
.btn-outline-primary {
    border-radius: 999px;
    padding-inline: 1.25rem;
    padding-block: 0.48rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition:
        background-color var(--tsc-duration) var(--tsc-ease-out),
        color var(--tsc-duration) var(--tsc-ease-out),
        border-color var(--tsc-duration) var(--tsc-ease-out),
        box-shadow var(--tsc-duration) var(--tsc-ease-out),
        transform var(--tsc-duration) var(--tsc-ease-soft);
}

.btn-primary {
    color: #fff;
    background-color: var(--tsc-accent);
    border-color: var(--tsc-accent-dark);
    box-shadow: 0 4px 16px rgba(180, 110, 125, 0.22);
}

.btn-outline-primary {
    color: var(--tsc-heading);
    border-color: rgba(42, 95, 122, 0.38);
    background-color: rgba(255, 252, 252, 0.88);
    box-shadow: 0 2px 12px rgba(42, 95, 122, 0.06);
}

.btn-primary:hover,
.btn-outline-primary:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 6px 20px rgba(180, 110, 125, 0.2);
}

.btn-primary:hover {
    background-color: var(--tsc-accent-dark);
    border-color: var(--tsc-accent-dark);
    color: #fff;
}

.btn-outline-primary:hover {
    background-color: rgba(226, 183, 175, 0.32);
    color: var(--tsc-heading);
}

.btn-success,
.btn-warning {
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.btn-outline-secondary {
    border-radius: 999px;
    color: var(--tsc-brown-muted);
    border-color: rgba(115, 78, 68, 0.32);
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 252, 252, 0.95), 0 0 0 4px rgba(42, 95, 122, 0.2);
}

.alert-info {
    background: linear-gradient(145deg, rgba(232, 200, 208, 0.35) 0%, rgba(245, 232, 228, 0.75) 100%);
    color: #5c3e44;
    border: 1px solid rgba(180, 120, 132, 0.22);
    border-radius: 12px;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 4px 22px rgba(62, 40, 35, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: var(--tsc-table-header-bg);
    color: var(--tsc-heading);
    font-weight: 600;
    font-size: 0.93rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--tsc-table-border);
}

.table tbody td {
    color: var(--tsc-body-soft);
    border-bottom: 1px solid var(--tsc-table-border);
}

.table tbody tr {
    background: #fffefd;
    transition: background var(--tsc-duration) var(--tsc-ease-out);
}

.table-hover tbody tr:hover {
    background: var(--tsc-table-hover);
}

.table tbody tr:nth-child(even) {
    background: var(--tsc-table-row-alt);
}

.table tbody tr:nth-child(even):hover {
    background: var(--tsc-table-hover);
}

.badge.text-bg-success {
    background-color: rgba(42, 95, 122, 0.85) !important;
}

.badge.text-bg-secondary {
    background-color: rgba(107, 83, 76, 0.55) !important;
}

/* Status pills (device detail, lists) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.82rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(62, 40, 35, 0.04);
    transition: box-shadow var(--tsc-duration) var(--tsc-ease-out);
}

.status-pill__text {
    color: inherit;
}

.status-pill__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.9;
}

.status-pill--with-dot.status-pill--live .status-pill__dot {
    animation: status-pill-pulse 2.4s var(--tsc-ease-soft) infinite;
}

@keyframes status-pill-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.status-pill--neutral {
    color: var(--tsc-heading);
    background: rgba(255, 252, 252, 0.92);
    border-color: rgba(42, 95, 122, 0.2);
}

.status-pill--muted {
    color: var(--tsc-brown-muted);
    background: rgba(249, 241, 242, 0.85);
    border-color: rgba(107, 83, 76, 0.18);
}

.status-pill--live {
    color: #2a5f7a;
    background: linear-gradient(135deg, rgba(232, 240, 245, 0.9) 0%, rgba(255, 252, 252, 0.95) 100%);
    border-color: rgba(42, 95, 122, 0.28);
}

.status-pill--success {
    color: #3d6b52;
    background: linear-gradient(135deg, rgba(232, 245, 236, 0.85) 0%, rgba(255, 252, 252, 0.95) 100%);
    border-color: rgba(61, 107, 82, 0.22);
}

.status-pill--warning {
    color: #7a5a2a;
    background: linear-gradient(135deg, rgba(255, 248, 232, 0.9) 0%, rgba(255, 252, 250, 0.95) 100%);
    border-color: rgba(180, 130, 60, 0.25);
}

.status-pill--danger {
    color: #8b3a42;
    background: linear-gradient(135deg, rgba(249, 236, 233, 0.92) 0%, rgba(255, 252, 252, 0.95) 100%);
    border-color: rgba(201, 125, 143, 0.32);
}

.status-pill--compact {
    padding: 0.22rem 0.55rem;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.spinner-border.text-primary {
    color: var(--tsc-heading) !important;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

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

.auth-page .auth-card .card-body {
    padding: 1.75rem 1.5rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-brand img {
    max-height: 40px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
}

.auth-brand__tagline {
    display: block;
    margin-top: 0.85rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--tsc-brown-muted);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #faf6e8;
    color: #4a4235;
    box-shadow: 0 -4px 24px rgba(62, 40, 35, 0.08);
    display: none;
}

/* Global fallbacks if scoped component CSS fails to load */
.app-sidebar-brand__logo {
    height: auto;
    max-height: 52px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
}

/* Sidebar nav icons (global — always available) */
.sidebar .nav-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.sidebar .bi-house-door-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath d='M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z'/%3E%3C/svg%3E");
}

.sidebar .bi-list-check-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3.146 2.146a.5.5 0 0 1 .708 0l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 1 1-.708-.708L4.293 4 3.146 2.854a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.sidebar .bi-plus-circle-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3E%3Cpath d='M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4'/%3E%3C/svg%3E");
}

.sidebar .bi-box-arrow-in-right-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M6 3.5a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-1 0v2A1.5 1.5 0 0 0 6.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-8A1.5 1.5 0 0 0 5 3.5v2a.5.5 0 0 0 1 0z'/%3E%3Cpath fill-rule='evenodd' d='M11.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H1.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708z'/%3E%3C/svg%3E");
}

.sidebar .bi-person-plus-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath d='M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H1s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z'/%3E%3Cpath fill-rule='evenodd' d='M13.5 5a.5.5 0 0 1 .5.5V7h1.5a.5.5 0 0 1 0 1H14v1.5a.5.5 0 0 1-1 0V8h-1.5a.5.5 0 0 1 0-1H13V5.5a.5.5 0 0 1 .5-.5'/%3E%3C/svg%3E");
}

.sidebar .bi-shield-check-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath d='M8 0c-.663 0-1.334.144-2 .431l-4 1.538c-.276.106-.476.388-.476.69v6.5c0 3.314 2.862 6.248 6.238 7.14 1.5.35 3.062.35 4.476 0C13.138 14.857 16 11.923 16 8.609v-6.5c0-.302-.2-.584-.476-.69L10 0.43C9.334.144 8.663 0 8 0m3.379 5.886-3.5 3.5a.5.5 0 0 1-.707 0l-1.5-1.5a.5.5 0 1 1 .707-.707L7.5 8.086l3.146-3.147a.5.5 0 0 1 .733.947'/%3E%3C/svg%3E");
}

.admin-stats {
    max-width: 48rem;
}

.admin-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: rgba(255, 252, 252, 0.92);
    border: 1px solid var(--tsc-table-border);
    box-shadow: 0 4px 18px rgba(62, 40, 35, 0.05);
}

.admin-stat-card__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--tsc-heading);
}

.admin-stat-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tsc-brown-muted);
}

.sidebar .bi-box-arrow-right-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a5f7a' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z'/%3E%3Cpath fill-rule='evenodd' d='M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708z'/%3E%3C/svg%3E");
}

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal:not([open]) {
    display: none !important;
    pointer-events: none;
}

/* Environment badge (sidebar + context panel) */
.sidebar-env {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: auto;
    max-width: 100%;
    padding: 0.15rem 0;
}

.sidebar-env__label {
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tsc-brown-muted);
}

.env-pill.env-pill--name-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 252, 252, 0.92);
    border: 1px solid rgba(42, 95, 122, 0.22);
    box-shadow: 0 1px 5px rgba(62, 40, 35, 0.05);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--tsc-heading);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.env-pill--context.env-pill--name-only {
    padding: 0.45rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.env-pill--sidebar.env-pill--name-only {
    min-width: 3.25rem;
}

.env-pill--test {
    border-color: rgba(42, 95, 122, 0.32);
    background: linear-gradient(135deg, rgba(255, 252, 252, 0.95) 0%, rgba(232, 240, 245, 0.55) 100%);
}

.env-pill--acc {
    border-color: rgba(201, 125, 143, 0.38);
    background: linear-gradient(135deg, rgba(255, 252, 252, 0.95) 0%, rgba(249, 236, 233, 0.65) 100%);
}

.env-pill--cdemo {
    border-color: rgba(107, 83, 76, 0.28);
    background: linear-gradient(135deg, rgba(255, 252, 252, 0.95) 0%, rgba(237, 213, 207, 0.5) 100%);
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--tsc-heading);
    margin-bottom: 0.35rem;
}

.form-text {
    margin-top: 0.3rem;
    font-size: 0.82rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: rgba(115, 78, 68, 0.22);
    background-color: rgba(255, 253, 253, 0.95);
}

@media (max-width: 991.98px) {
    .context-panel--sticky {
        position: static;
    }

    .page-grid .context-panel {
        order: -1;
    }

    .env-context-card {
        margin-bottom: 0.25rem;
    }

    .device-create-form__stack .form-field--name,
    .device-create-form__stack .form-field--imei,
    .device-create-form__stack .form-field--select,
    .device-create-form__modes,
    .device-create-form__register,
    .device-create-form__stack .alert,
    .device-create-form__stack .form-actions {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn-primary:hover,
    .btn-outline-primary:hover {
        transform: none;
    }

    .status-pill--with-dot.status-pill--live .status-pill__dot {
        animation: none;
    }
}
