/* cyrillic-ext */

/* cyrillic */

/* vietnamese */

/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin-ext.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */

/* cyrillic */

/* vietnamese */

/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin-ext.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */

/* cyrillic */

/* vietnamese */

/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin-ext.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */

/* cyrillic */

/* vietnamese */

/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin-ext.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('https://ioprom.ru/wp-content/uploads/easyfonts/fonts/nunito/nunito-normal-latin.woff2?ver=1781693383') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
    --bg-main: #e8edf4;
    --card-bg: #ffffff;
    --card-bg-soft: #f3f6fb;
    --card-border: rgba(15, 23, 42, 0.1);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --accent-blue: #1d4ed8;
    --accent-teal: #0d9488;
    --accent-green: #059669;
    --accent-amber: #d97706;
    --accent-red: #dc2626;
    --accent-sky: #0284c7;
    --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.08);
    --radius-card: 20px;
}

* {
    box-sizing: border-box;
}

.thermostat-container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 0 24px;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    color: var(--text-main);
}

.thermostat-container h2 {
    margin: 0 0 18px;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
}

.thermostat-card {
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-card);
}

.form-group,
.field-group {
    display: grid;
    gap: 6px;
}

.field-label {
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.field-input {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.thermostat-container .badge,
.badge-success,
.badge-danger,
.badge-warning,
.badge-info,
.badge-secondary,
.badge-primary,
.badge-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.thermostat-container .badge {
    color: #475569;
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.24);
}

.badge-success {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.24);
}

.badge-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.28);
}

.badge-info {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.24);
}

.badge-secondary {
    color: #475569;
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.24);
}

.badge-primary {
    color: #1e40af;
    background: rgba(29, 78, 216, 0.12);
    border-color: rgba(29, 78, 216, 0.2);
}

.badge-dark {
    color: #334155;
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.14);
}

.thermostat-container .blink1,
.thermostat-container .blink2 {
    animation: tcaRuntimeBlink 1.15s ease-in-out infinite;
}

.thermostat-container .blink2 {
    animation-duration: 1.8s;
}

.status-grid-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    background: #ffffff;
    padding: 10px;
    box-shadow: var(--shadow-soft);
}

.btn-mode {
    min-height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all 0.15s ease;
}

.btn-mode.active {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(29, 78, 216, 0.22);
}

.btn-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.15s ease;
}

.btn-control:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.progress-bar-bg,
.power-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.35);
}

.gradient-power,
.power-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(to right, #10b981, #f59e0b, #ef4444);
    transition: width 0.35s ease;
}

.gradient-temp {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(to right, #3b82f6, #10b981, #ef4444);
    transition: width 0.35s ease;
}

.thermostat-selector {
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 18px;
}

.thermostat-selector label {
    margin: 0 0 8px;
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.thermostat-selector-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.thermostat-selector-row--home {
    margin-bottom: 12px;
}

.tca-selector-field {
    flex: 1 1 280px;
    min-width: 220px;
    display: grid;
    gap: 8px;
}

.tca-selector-field label {
    margin: 0;
}

.thermostat-selector select {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    padding: 0 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.thermostat-selector select:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.tca-info-icon,
.tca-delete-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #334155;
    transition: all 0.15s ease;
}

.tca-delete-btn {
    margin-left: auto;
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.36);
}

.tca-home-manage-btn {
    min-height: 40px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tca-home-manage-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.tca-info-icon svg,
.tca-delete-btn svg {
    fill: currentColor;
}

.tca-info-icon:hover,
.tca-delete-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.thermo-data {
    margin-top: 16px;
}

.tca-thermo-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.tca-thermo-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

.tca-thermo-status-badge.online {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.14);
}

.tca-thermo-status-badge.offline {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.12);
}

.tca-group-filter-empty {
    margin-top: 12px;
    border-radius: 14px;
    border: 1px dashed rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.06);
    padding: 12px 14px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

.tca-homes-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.tca-homes-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.tca-homes-modal__dialog {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 48px auto;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.tca-homes-modal__header,
.tca-homes-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.tca-homes-modal__footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: 0;
}

.tca-homes-modal__header h3 {
    margin: 0;
    font-size: 18px;
}

.tca-homes-modal__close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.tca-homes-modal__body {
    padding: 20px;
    max-height: 70vh;
    overflow: auto;
    display: grid;
    gap: 20px;
}

.tca-homes-section {
    display: grid;
    gap: 12px;
}

.tca-homes-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.tca-homes-editor-list,
.tca-homes-devices-list {
    display: grid;
    gap: 10px;
}

.tca-home-editor-row,
.tca-home-device-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #f8fafc;
}

.tca-home-name-input,
.tca-home-device-select {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    padding: 0 12px;
    font-size: 14px;
}

.tca-home-remove-btn {
    min-height: 40px;
    border: 1px solid rgba(185, 28, 28, 0.24);
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border-radius: 12px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 700;
}

.tca-home-device-meta {
    display: grid;
    gap: 4px;
}

.tca-home-device-meta span {
    color: #64748b;
    font-size: 12px;
    word-break: break-all;
}

.tca-homes-feedback {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.tca-homes-feedback.is-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.tca-homes-feedback.is-success {
    background: rgba(34, 197, 94, 0.12);
    color: #047857;
}

body.tca-home-modal-open {
    overflow: hidden;
}

body.tca-history-modal-open {
    overflow: hidden;
}

.thermo-zones-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.thermo-zone-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-card);
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: tcaFadeInUp 0.26s ease;
}

.thermo-zone-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12), 0 3px 10px rgba(15, 23, 42, 0.06);
}

.thermo-zone-card[data-capability="1"] {
    border-left: 4px solid #f97316;
}

.thermo-zone-card[data-capability="2"] {
    border-left: 4px solid #64748b;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.thermo-zone-card[data-capability="3"] {
    border-left: 4px solid #059669;
}

.thermo-zone-card.tz-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.95) 0%, rgba(14, 165, 233, 0.82) 100%);
    opacity: 0.95;
}

.thermo-zone-card.tz-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.88) 0%, rgba(16, 185, 129, 0.88) 100%);
    opacity: 0.92;
}

.card-top-state-on {
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.12), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.card-top-state-off {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
}

.border-left-success::before {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.98) 0%, rgba(16, 185, 129, 0.88) 100%);
}

.border-left-warning::before {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.98) 0%, rgba(249, 115, 22, 0.88) 100%);
}

.border-left-danger::before {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.98) 0%, rgba(220, 38, 38, 0.88) 100%);
}

.border-left-secondary::before {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.98) 0%, rgba(100, 116, 139, 0.86) 100%);
}

.border-left-breathe::before {
    animation: border-left-breathe 3.8s ease-in-out infinite;
}

@keyframes border-left-breathe {
    0%,
    100% {
        filter: saturate(0.92);
        opacity: 0.78;
    }

    50% {
        filter: saturate(1.12);
        opacity: 1;
    }
}

.zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(100, 116, 139, 0.38);
}

.zone-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.power-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    min-height: 24px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.power-status .status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.power-status.on {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.power-status.on .status-icon {
    background: #10b981;
}

.power-status.off {
    color: #475569;
    background: rgba(100, 116, 139, 0.13);
    border: 1px solid rgba(100, 116, 139, 0.25);
}

.power-status.off .status-icon {
    background: #64748b;
}

.zone-main-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 8px;
}

.zone-info-left {
    display: grid;
    gap: 4px;
}

.zone-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.zone-group-badge,
.zone-controller-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zone-group-badge {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.zone-controller-badge {
    color: #0f766e;
    background: rgba(13, 148, 136, 0.11);
    border: 1px solid rgba(13, 148, 136, 0.18);
}

.zone-mode-badge,
.zone-tags .badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.zone-mode-badge {
    color: #475569;
    background: rgba(148, 163, 184, 0.13);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.zone-tags .badge {
    border: 1px solid transparent;
}

.badge-full {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
}

.zone-mode {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    font-weight: 800;
}

.zone-name {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
}

.zone-info-right {
    text-align: right;
}

.sync-status {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.syncing {
    color: #c2410c;
}

.synced {
    color: #047857;
}

.sync-offline {
    color: #b91c1c;
}

.temp-display {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f1f6ff 100%);
    padding: 12px;
    margin: 10px 0;
    display: block;
}

.temp-main {
    display: grid;
    gap: 8px;
}

.temp-current-row {
    position: relative;
    display: inline-block;
    padding-left: 16px;
}

.temp-current {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.temp-current-error {
    color: #dc2626;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    line-height: 1.15;
}

.temp-target {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
}

.tz-target-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    padding: 10px 0 0;
}

.tz-target-inline {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 6px;
    width: fit-content;
    margin-left: auto;
}

.tz-target-inline--readonly {
    min-width: 148px;
    justify-content: center;
    padding-right: 34px;
}

.tz-target-inline--readonly::after {
    content: attr(data-target-unit);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    pointer-events: none;
}

.tz-target-row--readonly .tz-target-step {
    display: none;
}

.tz-target-step {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tz-target-step:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 78, 216, 0.34);
    color: #1d4ed8;
}

.tz-target-step:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    color: #94a3b8;
}

.tz-target-step-icon {
    width: 14px;
    height: 14px;
}

.target-temp-input.tz-target-input {
    width: 108px;
    min-height: 38px;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    border-radius: 10px;
}

.tz-target-input--readonly {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    color: #0f172a;
    text-align: center;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.tz-target-input--readonly::-webkit-outer-spin-button,
.tz-target-input--readonly::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tz-target-input--readonly[type=number] {
    -moz-appearance: textfield;
}

.tz-target-inline .freeze-indicator {
    top: -7px;
    right: -7px;
}

.temp-difference {
    position: absolute;
    left: 0;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    margin: 0;
    background: transparent;
}

.temp-difference.heating {
    color: #b91c1c;
    top: 0;
}

.temp-difference.cooling {
    color: #0369a1;
    bottom: 0;
}

.temp-difference.maintaining {
    color: #047857;
    top: 50%;
    transform: translateY(-50%);
}

.temp-difference.off {
    color: #475569;
    top: 50%;
    transform: translateY(-50%);
}

.power-progress-container {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    margin: 10px 0;
}

.power-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    font-weight: 800;
}

.power-progress-label span:last-child {
    color: #0f172a;
}

.power-progress-fill::after {
    content: "";
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: tcaShine 2.6s linear infinite;
}

.tca-runtime-bar {
    margin: 10px 0 0;
}

.tz-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 800;
}

.tz-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.24);
}

.tz-bar.tz-bar-ovh-alert,
.tz-bar-ovh-alert {
    animation: tcaRuntimeBlink 1.2s ease-in-out infinite;
}

.tz-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.tz-bar-temp {
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 48%, #ef4444 100%);
}

.tz-bar-power {
    background: linear-gradient(90deg, #10b981 0%, #f59e0b 52%, #ef4444 100%);
}

.tz-bar-calib {
    background: linear-gradient(90deg, #60a5fa 0%, #818cf8 100%);
}

.tz-bar-init {
    background: linear-gradient(90deg, #fde047 0%, #eab308 100%);
}

.tca-zone-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 2px;
}

.tca-zone-flags.is-hidden {
    display: none;
}

.tca-zone-flag {
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
}

.tca-zone-flag.active {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
}

.tca-zone-flag.tca-zone-flag-alert {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.tz-status-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tz-status-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tz-status-item {
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    display: grid;
    place-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.tz-status-item.is-hidden {
    display: none;
}

.tz-status-item.active {
    border-color: rgba(15, 23, 42, 0.2);
    color: #0f172a;
}

.tz-status-item.color-blue {
    color: #0369a1;
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.12);
}

.tz-status-item.color-green {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.12);
}

.tz-status-item.color-red {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.12);
}

.tz-status-item.inactive {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
}

.tz-status-icon {
    width: 16px;
    height: 16px;
}

.tz-status-text {
    line-height: 1;
}

.tz-status-item.color-amber {
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.16);
}

.tz-status-item.is-alert-active .tz-status-icon {
    animation: tcaRuntimeBlink 1s ease-in-out infinite;
}

.tz-info {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    padding: 10px 12px;
    display: grid;
    gap: 6px;
}

.tz-info-dynamic,
.tz-info-runtime {
    display: grid;
    gap: 4px;
}

.tz-info-dynamic:empty,
.tz-info-runtime:empty {
    display: none;
}

.tz-info-line {
    display: grid;
    grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    font-size: 12px;
}

.tz-info-line .il {
    color: #64748b;
    white-space: nowrap;
}

.tz-info-line .iv {
    display: block;
    text-align: right;
    line-height: 1.25;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.tz-info-line .iv.color-red {
    color: #dc2626;
}

.tz-info-line .iv.color-blue {
    color: #2563eb;
}

.tz-info-line .iv.color-green {
    color: #059669;
}

.tz-info-line .iv.color-amber {
    color: #d97706;
}

.tz-info-line .iv.color-purple {
    color: #6366f1;
}

.tz-info-line .iv.color-sky {
    color: #0284c7;
}

.tz-info-line .iv.color-muted {
    color: #64748b;
}

.tz-info-blink-slow {
    animation: tcaInfoBlinkSlow 3s ease-in-out infinite;
}

.tz-info-blink-fast {
    animation: tcaRuntimeBlink 1.1s ease-in-out infinite;
}

.tz-ai-weights {
    position: relative;
    min-height: 76px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(226, 232, 240, 0.92) 100%);
    overflow: hidden;
}

.tz-ai-weights.is-inactive {
    opacity: 0.48;
}

.tz-ai-weights-guide {
    position: absolute;
    top: 8px;
    bottom: 10px;
    width: 4px;
    margin-left: -2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(191, 219, 254, 0.92) 0%, rgba(148, 163, 184, 0.28) 100%);
}

.tz-ai-weights-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #93c5fd 35%, #3b82f6 100%);
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.48), 0 4px 12px rgba(59, 130, 246, 0.24);
}

.tz-ai-weights-link {
    position: absolute;
    top: 50%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.24) 0%, rgba(59, 130, 246, 0.42) 100%);
    transform-origin: left center;
}

.tz-pza-online {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.2), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.tz-pza-online.is-inactive {
    opacity: 0.56;
}

.tz-pza-online__head,
.tz-pza-online__head-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.tz-pza-online__head-main {
    flex: 1 1 180px;
    min-width: 0;
}

.tz-pza-online__profile,
.tz-pza-online__summary {
    color: #475569;
    font-size: 12px;
}

.tz-pza-online__profile {
    display: block;
    font-weight: 800;
}

.tz-pza-online__summary {
    font-weight: 700;
}

.tz-pza-online__canvas {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 10px;
}

.tz-pza-online__grid-line {
    stroke: rgba(148, 163, 184, 0.34);
    stroke-width: 1;
}

.tz-pza-online__axis-line {
    stroke: rgba(15, 23, 42, 0.34);
    stroke-width: 1.2;
}

.tz-pza-online__curve {
    fill: none;
    stroke: rgba(245, 158, 11, 0.96);
    stroke-width: 3.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tz-pza-online__curve-point {
    fill: #fff7ed;
    stroke: #f59e0b;
    stroke-width: 2.1;
}

.tz-pza-online__delta-line {
    stroke: rgba(59, 130, 246, 0.84);
    stroke-width: 2;
    stroke-dasharray: 4 4;
}

.tz-pza-online__target-point {
    fill: #facc15;
    stroke: #78350f;
    stroke-width: 2;
}

.tz-pza-online__actual-point {
    fill: #60a5fa;
    stroke: #eff6ff;
    stroke-width: 2;
}

.tz-pza-online__actual-point--live {
    animation: tcaPzaBlink 1s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.tz-pza-online__label {
    fill: #475569;
    font-size: 10px;
    font-weight: 800;
}

.tz-pza-online__label--xmin {
    text-anchor: end;
}

@keyframes tcaPzaBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.28;
    }
}

.tz-valve-card {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tz-valve-card.is-hidden {
    display: none;
}

.tz-valve-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.tz-valve-value {
    color: #0f172a;
}

.tz-valve-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.24);
}

.tz-valve-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa 0%, #22c55e 100%);
    transition: width 0.25s ease;
}

.tz-valve-visual-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
}

.tz-valve-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.tz-valve-svg {
    width: 44px;
    height: 44px;
    display: block;
}

.tz-valve-status-text {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.tz-valve-status-text.is-hidden {
    display: none;
}

.tz-modes {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tz-mode-toggle {
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.14s ease;
    position: relative;
}

.tz-mode-toggle.active {
    color: #ffffff;
    border-color: #1d4ed8;
    background: #1d4ed8;
    box-shadow: 0 6px 12px rgba(29, 78, 216, 0.22);
}

.tz-mode-toggle[data-mode="away"] {
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.tz-mode-toggle[data-mode="away"].active {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff;
}

.tz-mode-toggle.pending-command {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
}

.tz-mode-toggle.command-sent {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

.tz-mode-toggle.error {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.tz-mode-toggle.frozen-value {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.tz-mode-toggle:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.tz-mode-toggle .freeze-indicator {
    width: 16px;
    height: 16px;
    top: -5px;
    right: -5px;
    font-size: 10px;
}

.tca-calibration-block {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.tca-calibration-reset {
    width: 100%;
    justify-content: center;
}

.tca-calibration-reset.is-disabled {
    opacity: 0.55;
    cursor: default;
}

.efficiency-indicator {
    margin: 10px 0;
    display: grid;
}

.efficiency-indicator span {
    border-radius: 12px;
    min-height: 28px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    border: 1px solid transparent;
}

.efficiency-indicator .heating {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.24);
}

.efficiency-indicator .cooling {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(14, 165, 233, 0.25);
}

.efficiency-indicator .maintaining {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.25);
}

.efficiency-indicator .off {
    color: #475569;
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.22);
}

.slave-status-display,
.target-temp-display.slave-temp-display {
    border-radius: 14px;
    border: 1px solid rgba(100, 116, 139, 0.25);
    background: rgba(148, 163, 184, 0.12);
    padding: 12px;
}

.slave-info {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
}

.slave-description,
.slave-note {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.mini-chart-container {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
    padding: 8px 8px 14px;
    margin: 10px 0;
    min-height: 82px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mini-chart-container:hover {
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 8px 16px rgba(29, 78, 216, 0.14);
    transform: translateY(-1px);
}

.mini-chart-container canvas {
    width: 100% !important;
    height: 58px !important;
    pointer-events: none;
}

.chart-overlay {
    position: absolute;
    top: 6px;
    right: 8px;
    border-radius: 999px;
    min-height: 20px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.08);
    pointer-events: none;
}

.chart-click-hint {
    position: absolute;
    left: 8px;
    bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

.target-temp-control {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    margin-top: 8px;
}

.target-temp-control label {
    margin: 0 0 8px;
    display: block;
    font-size: 11px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.temp-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.target-temp-input {
    width: 96px;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    padding: 6px 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.target-temp-input:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.target-temp-input.pending-change {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.42);
}

.target-temp-input.command-sent {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.42);
}

.target-temp-input.error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.45);
}

.target-temp-input.frozen-value {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.45);
}

.temp-unit {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-subtle);
}

.temp-saved-indicator {
    color: #047857;
    font-size: 18px;
    font-weight: 800;
}

.quick-temp-actions {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.quick-temp-btn {
    min-height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.13);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    transition: all 0.14s ease;
}

.quick-temp-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 78, 216, 0.34);
    color: #1d4ed8;
}

.quick-temp-btn:active,
.quick-temp-btn.active {
    background: rgba(29, 78, 216, 0.16);
    border-color: rgba(29, 78, 216, 0.45);
}

.quick-temp-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.zone-controls {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.zone-controls.history-hidden {
    grid-template-columns: 1fr;
}

.power-toggle,
.show-history-btn {
    min-height: 38px;
    border: none;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    position: relative;
}

.power-toggle {
    color: #ffffff;
    background: #1d4ed8;
    box-shadow: 0 6px 12px rgba(29, 78, 216, 0.22);
    width: 100%;
}

.show-history-btn {
    color: #ffffff;
    background: #475569;
    box-shadow: 0 6px 12px rgba(71, 85, 105, 0.18);
    display: none !important;
}

.power-toggle:hover,
.show-history-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
}

.power-toggle:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
    filter: none;
    box-shadow: none;
}

.power-toggle.pending-command {
    background: #f59e0b;
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.22);
}

.power-toggle.command-sent {
    background: #0f766e;
}

.power-toggle.error {
    background: #dc2626;
}

.power-toggle.frozen-value {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.button-icon {
    font-size: 12px;
    line-height: 1;
}

.button-text {
    font-size: 11px;
    line-height: 1;
}

.freeze-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-sky);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92);
    animation: tcaPulseFreeze 1.5s ease infinite;
}

.power-toggle .freeze-indicator {
    top: -7px;
    right: -7px;
}

.value-updated {
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.22) !important;
    transition: background-color 0.5s ease;
}

.thermo-zone-card[data-capability="2"] .power-progress-fill {
    background: linear-gradient(to right, #64748b, #334155);
}

.thermo-zone-card.offline {
    filter: grayscale(0.2);
    opacity: 0.82;
    pointer-events: none;
}

.thermo-zone-card.offline.long-offline {
    border-color: rgba(220, 38, 38, 0.45);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.thermo-zone-card.reconnecting {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
    filter: none;
    opacity: 1;
}

.thermo-data[data-device-status="online"] .thermo-zone-card.offline {
    filter: none;
    opacity: 1;
    pointer-events: auto;
}

.thermo-data[data-device-status="online"] .thermo-zone-card.offline::after,
.thermo-data[data-device-status="online"] .thermo-zone-card.offline::before {
    display: none;
}

.connection-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.connection-indicator.online {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.26);
}

.connection-indicator.offline {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.26);
}

.network-error-notice,
.server-error-notice {
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
}

.temp-error-msg {
    position: absolute;
    top: -34px;
    left: 0;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: #b91c1c;
    color: #ffffff;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 4;
}

#thermo-chart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
    padding: 14px;
    align-items: center;
    justify-content: center;
}

.tca-history-modal {
    width: min(1120px, 100%);
    height: min(90vh, 800px);
    margin: 0 auto;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.tca-history-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.tca-history-modal__title-wrap {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.tca-history-modal__eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.tca-history-modal__title-wrap h3 {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.15;
    color: #0f172a;
}

.tca-history-modal__close {
    min-width: 38px;
    min-height: 38px;
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.tca-history-modal__close:hover {
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.18);
    box-shadow: 0 8px 14px rgba(239, 68, 68, 0.14);
}

.tca-history-modal__toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.tca-history-modal__filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tca-history-field {
    display: grid;
    gap: 6px;
}

.tca-history-field__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.tca-history-summary {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.tca-history-summary__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tca-history-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(148, 163, 184, 0.12);
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tca-history-chip--online {
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.tca-history-chip--offline {
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.tca-history-summary__meta {
    display: grid;
    gap: 4px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.tca-history-modal__chart {
    position: relative;
    flex: 1 1 auto;
    min-height: 380px;
    padding: 8px 6px 2px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

#thermo-chart {
    width: 100% !important;
    height: 100% !important;
}

#chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    color: #334155;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
}

#history-period,
#history-date {
    min-height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
}

#history-period:focus,
#history-date:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.loader {
    width: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #475569;
}

.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: tcaShimmer 1.5s linear infinite;
}

.tca-meta-tabs {
    margin-top: 12px;
}

.tca-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tca-tab-btn {
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tca-tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.tca-tab-btn.is-active {
    border-color: rgba(29, 78, 216, 0.32);
    background: rgba(29, 78, 216, 0.13);
    color: #1d4ed8;
}

.tca-tab-btn.is-disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.tca-tab-btn.has-unread-critical {
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(254, 242, 242, 0.96);
    color: #b91c1c;
}

.tca-tab-btn.has-unread-critical:not(.is-active) {
    animation: tca-journal-alert-pulse 1.2s ease-in-out infinite;
}

.tca-tab-btn.has-unread-critical::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    animation: tca-journal-alert-dot 1.2s ease-in-out infinite;
}

.tca-tab-btn.has-unread-critical.is-active::after {
    animation: none;
}

.tca-tab-btn--settings {
    margin-left: auto;
}

@keyframes tca-journal-alert-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
    }
}

@keyframes tca-journal-alert-dot {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    }

    50% {
        opacity: 0.55;
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.tca-tab-panel {
    display: none;
}

.tca-tab-panel.is-active {
    display: block;
}

.tca-device-panel,
.tca-sensors-panel,
.tca-controls-panel,
.tca-buttons-panel,
.tca-journal-panel,
.tca-settings-panel {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
    padding: 14px;
    margin-top: 0;
}

.tca-device-panel.is-hidden,
.tca-sensors-panel.is-hidden,
.tca-controls-panel.is-hidden,
.tca-buttons-panel.is-hidden,
.tca-journal-panel.is-hidden,
.tca-settings-panel.is-hidden {
    display: none;
}

.tca-controls-panel .thermo-zones-grid {
    margin-top: 0;
}

.tca-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.tca-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    line-height: 1;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.tca-panel-empty,
.tca-panel-note {
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.tca-panel-empty {
    border: 1px dashed rgba(148, 163, 184, 0.5);
    background: #f8fbff;
    color: #475569;
}

.tca-panel-empty--inline {
    padding: 10px 12px;
}

.tca-panel-empty--error {
    border-style: solid;
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.9);
    color: #991b1b;
}

.tca-panel-note {
    border: 1px solid rgba(245, 158, 11, 0.18);
    background: rgba(255, 251, 235, 0.92);
    color: #92400e;
}

.tca-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex: 0 0 auto;
}

.tca-icon-button {
    width: 14px;
    height: 14px;
}

.tca-device-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tca-device-item {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 9px 10px;
    display: grid;
    gap: 4px;
}

.tca-device-item-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 800;
}

.tca-device-item-value {
    font-size: 14px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}

.tca-device-item-value--ram {
    display: block;
}

.tca-device-item-value--meta {
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

.tca-ram-meter {
    display: grid;
    gap: 5px;
}

.tca-ram-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.35);
}

.tca-ram-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e 0%, #0ea5e9 100%);
    transition: width 0.25s ease;
}

.tca-ram-percent {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
}

.tca-device-item-value--with-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.tca-summer-state {
    font-size: 14px;
    font-weight: 800;
}

.tca-summer-state.is-on {
    color: #166534;
}

.tca-summer-state.is-off {
    color: #991b1b;
}

.tca-summer-toggle {
    min-height: 28px;
    border-radius: 10px;
    border: 1px solid rgba(29, 78, 216, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.tca-summer-toggle:hover {
    transform: translateY(-1px);
    background: rgba(29, 78, 216, 0.08);
}

.tca-summer-toggle:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
}

.tca-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.tca-button-card {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 10px;
    display: grid;
    gap: 8px;
    width: min(280px, 100%);
}

.tca-button-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 800;
}

.tca-button-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.tca-journal-sections {
    display: grid;
    gap: 10px;
}

.tca-journal-section {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.tca-journal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tca-journal-section-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
}

.tca-journal-section-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tca-journal-section-count {
    min-width: 30px;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 78, 216, 0.12);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.tca-journal-clear-btn {
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    background: #ffffff;
    color: #b91c1c;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.tca-journal-clear-btn:hover {
    transform: translateY(-1px);
    background: rgba(254, 242, 242, 0.9);
}

.tca-journal-clear-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.tca-journal-entry-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 2px;
}

.tca-journal-entry {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tca-journal-entry--info {
    border-left: 4px solid rgba(37, 99, 235, 0.45);
}

.tca-journal-entry--warning {
    border-left: 4px solid rgba(245, 158, 11, 0.65);
}

.tca-journal-entry--critical {
    border-left: 4px solid rgba(220, 38, 38, 0.65);
}

.tca-journal-entry-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.tca-journal-severity {
    min-height: 22px;
    border-radius: 999px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tca-journal-severity--info {
    background: rgba(29, 78, 216, 0.12);
    color: #1d4ed8;
}

.tca-journal-severity--warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.tca-journal-severity--critical {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.tca-journal-entry-message {
    font-size: 13px;
    line-height: 1.45;
    color: #0f172a;
    font-weight: 700;
}

.tca-journal-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tca-journal-chip {
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.tca-settings-grid {
    display: grid;
    gap: 10px;
}

.tca-settings-card {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 12px;
    display: grid;
    gap: 12px;
}

.tca-settings-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tca-settings-card-copy {
    display: grid;
    gap: 6px;
}

.tca-settings-card-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #0f172a;
    font-weight: 800;
}

.tca-settings-card-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}

.tca-settings-note {
    border-radius: 12px;
    border: 1px solid rgba(29, 78, 216, 0.12);
    background: rgba(239, 246, 255, 0.9);
    color: #1e3a8a;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
}

.tca-online-config-card {
    background: #ffffff;
}

.tca-online-config-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tca-online-config-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.tca-config-pull-btn,
.tca-config-refresh-btn,
.tca-config-draft-save-btn,
.tca-config-draft-apply-btn,
.tca-config-devices-save-btn,
.tca-config-zones-save-btn,
.tca-online-config-add-group-btn,
.tca-online-config-add-device-btn,
.tca-online-config-remove-group-btn,
.tca-online-config-remove-device-btn {
    min-height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(29, 78, 216, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    color: #1d4ed8;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.tca-config-draft-save-btn,
.tca-config-devices-save-btn,
.tca-config-zones-save-btn,
.tca-online-config-add-group-btn,
.tca-online-config-add-device-btn {
    border-color: rgba(22, 163, 74, 0.24);
    color: #166534;
}

.tca-online-config-remove-group-btn,
.tca-online-config-remove-device-btn {
    border-color: rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

.tca-config-draft-apply-btn {
    border-color: rgba(124, 58, 237, 0.24);
    color: #6d28d9;
}

.tca-config-pull-btn:hover,
.tca-config-refresh-btn:hover,
.tca-config-draft-save-btn:hover,
.tca-config-draft-apply-btn:hover,
.tca-config-devices-save-btn:hover,
.tca-config-zones-save-btn:hover,
.tca-online-config-add-group-btn:hover,
.tca-online-config-add-device-btn:hover,
.tca-online-config-remove-group-btn:hover,
.tca-online-config-remove-device-btn:hover {
    transform: translateY(-1px);
    background: rgba(29, 78, 216, 0.08);
}

.tca-config-draft-save-btn:hover,
.tca-config-devices-save-btn:hover,
.tca-config-zones-save-btn:hover,
.tca-online-config-add-group-btn:hover,
.tca-online-config-add-device-btn:hover {
    background: rgba(22, 163, 74, 0.08);
}

.tca-online-config-remove-group-btn:hover,
.tca-online-config-remove-device-btn:hover {
    background: rgba(220, 38, 38, 0.08);
}

.tca-config-draft-apply-btn:hover {
    background: rgba(124, 58, 237, 0.08);
}

.tca-config-pull-btn:disabled,
.tca-config-refresh-btn:disabled,
.tca-config-draft-save-btn:disabled,
.tca-config-draft-apply-btn:disabled,
.tca-config-devices-save-btn:disabled,
.tca-config-zones-save-btn:disabled,
.tca-online-config-add-group-btn:disabled,
.tca-online-config-add-device-btn:disabled,
.tca-online-config-remove-group-btn:disabled,
.tca-online-config-remove-device-btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.tca-online-config-job {
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(255, 251, 235, 0.92);
    color: #92400e;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
}

.tca-online-config-job--error {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.92);
    color: #991b1b;
    flex-wrap: wrap;
}

.tca-online-config-job--error strong,
.tca-online-config-job--error em {
    min-height: 20px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    line-height: 1;
    font-style: normal;
    font-weight: 800;
}

.tca-online-config-progress {
    border-radius: 12px;
    border: 1px solid rgba(29, 78, 216, 0.14);
    background: rgba(239, 246, 255, 0.74);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tca-online-config-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.tca-online-config-progress-head span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tca-online-config-progress-head strong {
    flex: 0 0 auto;
    color: #1d4ed8;
}

.tca-online-config-progress-track {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.3);
}

.tca-online-config-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #1d4ed8 0%, #0d9488 100%);
    transition: width 0.35s ease;
}

.tca-online-config-progress-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.tca-online-config-progress-steps span {
    min-width: 0;
    color: #94a3b8;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
}

.tca-online-config-progress-steps span.is-active {
    color: #1d4ed8;
}

.tca-online-config-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tca-online-config-meta-item {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 9px 10px;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.tca-online-config-meta-item span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tca-online-config-meta-item strong {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.tca-online-config-draft-actions {
    border-radius: 12px;
    border: 1px solid rgba(22, 163, 74, 0.14);
    background: rgba(240, 253, 244, 0.78);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tca-online-config-draft-badge {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    color: #14532d;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.tca-online-config-draft-badge strong {
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.tca-online-config-draft-badge em {
    min-height: 20px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    line-height: 1;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-draft-controls {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.tca-online-config-draft-status {
    min-height: 20px;
    color: #475569;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 800;
}

.tca-online-config-draft-status.is-success {
    color: #166534;
}

.tca-online-config-draft-status.is-error {
    color: #b91c1c;
}

.tca-online-config-draft-status.is-muted {
    color: #64748b;
}

.tca-online-config-history {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tca-online-config-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tca-online-config-history-head h6 {
    margin: 0;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-history-head span {
    min-width: 24px;
    min-height: 22px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.tca-online-config-history-list {
    display: grid;
    gap: 6px;
}

.tca-online-config-history-row {
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: #f8fbff;
    padding: 8px;
    display: grid;
    gap: 6px;
}

.tca-online-config-history-main,
.tca-online-config-history-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tca-online-config-history-main strong {
    min-width: 0;
    color: #0f172a;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.tca-online-config-history-status {
    min-height: 21px;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-history-status.is-applied {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.tca-online-config-history-status.is-failed,
.tca-online-config-history-status.is-expired,
.tca-online-config-history-status.is-conflict {
    background: rgba(220, 38, 38, 0.11);
    color: #b91c1c;
}

.tca-online-config-history-status.is-queued,
.tca-online-config-history-status.is-sent,
.tca-online-config-history-status.is-accepted,
.tca-online-config-history-status.is-downloading,
.tca-online-config-history-status.is-applying {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
}

.tca-online-config-history-meta span {
    min-height: 19px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
}

.tca-online-config-history-meta span.is-error {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.tca-online-config-sections {
    display: grid;
    gap: 8px;
}

.tca-online-config-browser {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.tca-online-config-nav {
    display: grid;
    gap: 6px;
    position: sticky;
    top: 10px;
}

.tca-online-config-nav-btn {
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    background: #f8fbff;
    color: #334155;
    padding: 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tca-online-config-nav-btn:hover,
.tca-online-config-nav-btn.is-active {
    border-color: rgba(29, 78, 216, 0.28);
    background: rgba(239, 246, 255, 0.94);
    color: #1d4ed8;
}

.tca-online-config-nav-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.tca-online-config-nav-btn strong {
    min-width: 24px;
    min-height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.16);
    color: inherit;
    font-size: 10px;
}

.tca-online-config-content {
    min-width: 0;
}

.tca-online-config-group-panel {
    display: none;
    gap: 8px;
}

.tca-online-config-group-panel.is-active {
    display: grid;
}

.tca-online-config-group-head {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px 11px;
    display: grid;
    gap: 4px;
}

.tca-online-config-group-head h6 {
    margin: 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 800;
}

.tca-online-config-group-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.tca-online-config-schema {
    border-radius: 12px;
    border: 1px solid rgba(29, 78, 216, 0.12);
    background: rgba(239, 246, 255, 0.58);
    padding: 10px;
    display: grid;
    gap: 10px;
}

.tca-online-config-schema-head {
    display: grid;
    gap: 4px;
}

.tca-online-config-schema-head h6 {
    margin: 0;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-schema-head p {
    margin: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.tca-online-config-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tca-online-config-field {
    min-width: 0;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
}

.tca-online-config-field.is-missing {
    opacity: 0.72;
}

.tca-online-config-field.is-editable {
    border-color: rgba(22, 163, 74, 0.2);
    background: rgba(255, 255, 255, 0.96);
}

.tca-online-config-field.is-pending {
    border-color: rgba(22, 163, 74, 0.42);
    background: rgba(240, 253, 244, 0.86);
}

.tca-online-config-field-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.tca-online-config-field-label {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 800;
}

.tca-online-config-pending-badge {
    min-height: 18px;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    font-size: 9px;
    line-height: 1;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tca-online-config-field-path {
    color: #64748b;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tca-online-config-field-control {
    min-width: 0;
}

.tca-online-config-field-input {
    width: min(180px, 100%);
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fbff;
    color: #0f172a;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 800;
}

.tca-online-config-field-input:disabled {
    opacity: 1;
}

.tca-online-config-field-switch {
    justify-self: end;
}

.tca-online-config-field-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tca-online-config-field-meta span {
    min-height: 21px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-field-meta span.is-pending {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.tca-online-config-overview {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.tca-online-config-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.tca-online-config-overview-head h6 {
    margin: 0;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tca-online-config-overview-head span {
    min-height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.tca-online-config-device-groups,
.tca-online-config-chip-grid,
.tca-online-config-device-services {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tca-online-config-device-grid,
.tca-online-config-zone-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tca-online-config-device-editor,
.tca-online-config-zone-editor,
.tca-online-config-groups-editor,
.tca-online-config-devices-editor {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.tca-online-config-device-editor,
.tca-online-config-zone-editor {
    border-radius: 12px;
    border: 1px solid rgba(22, 163, 74, 0.14);
    background: rgba(240, 253, 244, 0.46);
    padding: 10px;
}

.tca-online-config-editor-head,
.tca-online-config-subhead {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tca-online-config-editor-head > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.tca-online-config-editor-head strong,
.tca-online-config-subhead span {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tca-online-config-editor-head span,
.tca-online-config-subhead small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
}

.tca-online-config-group-list {
    display: grid;
    gap: 6px;
}

.tca-online-config-group-row {
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 7px;
    display: grid;
    grid-template-columns: minmax(80px, 130px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.tca-online-config-group-id {
    min-width: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.tca-online-config-group-name,
.tca-online-config-editor-grid select,
.tca-online-config-editor-grid input[type="text"],
.tca-online-config-editor-grid input[type="number"],
.tca-online-config-service-row select,
.tca-online-config-service-row input[type="number"] {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #0f172a;
    padding: 0 9px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
}

.tca-online-config-editor-grid label.is-pending select,
.tca-online-config-editor-grid label.is-pending input[type="text"],
.tca-online-config-editor-grid label.is-pending input[type="number"],
.tca-online-config-inline-check.is-pending {
    border-color: rgba(22, 163, 74, 0.42);
    background: rgba(240, 253, 244, 0.86);
}

.tca-online-config-group-name:disabled,
.tca-online-config-editor-grid select:disabled,
.tca-online-config-editor-grid input:disabled,
.tca-online-config-service-row select:disabled,
.tca-online-config-service-row input:disabled {
    opacity: 0.7;
    background: rgba(241, 245, 249, 0.78);
}

.tca-online-config-device-card,
.tca-online-config-zone-card {
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tca-online-config-device-card--editable,
.tca-online-config-zone-card--editable {
    background: #ffffff;
}

.tca-online-config-device-head {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tca-online-config-device-head-actions {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 6px !important;
}

.tca-online-config-device-head > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.tca-online-config-device-head strong {
    min-width: 0;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.tca-online-config-device-head span {
    min-width: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tca-online-config-device-slot {
    flex: 0 0 auto;
    min-width: 28px;
    min-height: 24px;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8 !important;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

.tca-online-config-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tca-online-config-editor-grid label {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.tca-online-config-editor-grid label > span,
.tca-online-config-inline-check span {
    color: #64748b;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tca-online-config-field-note,
.tca-online-config-pza-comment {
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
    font-style: normal;
    font-weight: 700;
}

.tca-online-config-pza-comment {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.tca-online-config-inline-check {
    min-height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 251, 255, 0.9);
    padding: 0 9px;
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 7px !important;
}

.tca-online-config-inline-check input {
    width: 16px;
    height: 16px;
}

.tca-online-config-service-editor {
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
    padding-top: 8px;
    display: grid;
    gap: 6px;
}

.tca-online-config-service-list {
    display: grid;
    gap: 6px;
}

.tca-online-config-service-empty {
    min-height: 30px;
    border-radius: 9px;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    color: #64748b;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
}

.tca-online-config-add-service-btn {
    justify-self: start;
}

.tca-online-config-zone-advanced {
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
    padding-top: 8px;
}

.tca-online-config-zone-advanced summary {
    min-height: 28px;
    color: #475569;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.tca-online-config-zone-advanced .tca-online-config-editor-grid {
    margin-top: 8px;
}

.tca-online-config-service-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.tca-online-config-service-head span {
    color: #0f172a;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tca-online-config-service-head small {
    color: #64748b;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
}

.tca-online-config-service-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.4fr) minmax(70px, 0.7fr) minmax(52px, auto);
    gap: 6px;
    align-items: center;
}

.tca-online-config-readonly-summary {
    border-radius: 10px;
    border: 1px dashed rgba(15, 23, 42, 0.16);
    background: #ffffff;
    padding: 0;
    overflow: hidden;
}

.tca-online-config-readonly-summary summary {
    min-height: 34px;
    padding: 8px 10px;
    color: #475569;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.tca-online-config-readonly-summary .tca-online-config-device-grid {
    padding: 8px;
}

.tca-online-config-chip {
    min-height: 22px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #334155;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.tca-online-config-chip small {
    color: #64748b;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
}

.tca-online-config-chip.is-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.tca-online-config-chip.is-pending {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.tca-online-config-chip.is-muted {
    color: #64748b;
}

.tca-online-config-chip.is-locked {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.tca-online-config-device-services {
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
    padding-top: 8px;
}

.tca-online-config-device-services span {
    min-height: 22px;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
}

.tca-online-config-device-services strong {
    color: #0f172a;
    font-weight: 800;
}

.tca-online-config-section {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    overflow: hidden;
}

.tca-online-config-section summary {
    min-height: 38px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.tca-online-config-section-key {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tca-online-config-section-size {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 11px;
}

.tca-online-config-section-meta {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.tca-online-config-redacted {
    color: #b45309;
}

.tca-online-config-json {
    margin: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #0f172a;
    color: #dbeafe;
    padding: 12px;
    max-height: 420px;
    overflow: auto;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre;
}

.tca-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.tca-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tca-switch-track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.4);
    padding: 3px;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.tca-switch-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s ease;
}

.tca-switch input:checked + .tca-switch-track {
    background: linear-gradient(135deg, #16a34a 0%, #0ea5e9 100%);
}

.tca-switch input:checked + .tca-switch-track .tca-switch-thumb {
    transform: translateX(24px);
}

.tca-switch input:disabled + .tca-switch-track {
    opacity: 0.6;
}

.tca-device-fw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px;
}

.tca-fw-current,
.tca-fw-available {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.tca-fw-current {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.32);
}

.tca-fw-available {
    color: #b45309;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.tca-device-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tca-fw-update-btn,
.tca-device-reboot-btn {
    min-height: 34px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    color: #ffffff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.tca-fw-update-btn {
    background: #1d4ed8;
    box-shadow: 0 6px 12px rgba(29, 78, 216, 0.2);
}

.tca-device-reboot-btn {
    background: #b91c1c;
    box-shadow: 0 6px 12px rgba(185, 28, 28, 0.18);
}

.tca-fw-update-btn:hover,
.tca-device-reboot-btn:hover {
    transform: translateY(-1px);
}

.tca-fw-update-btn:disabled,
.tca-device-reboot-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.tca-fw-meta {
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
}

.tca-fw-target {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.tca-fw-changelog {
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(148, 163, 184, 0.12);
    padding: 8px 10px;
    color: #334155;
    font-size: 12px;
    line-height: 1.35;
}

.tca-fw-progress,
.tca-fw-timeout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
}

.tca-fw-progress {
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.16);
}

.tca-fw-timeout {
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.14);
}

.tca-sensors-grid {
    display: grid;
    gap: 8px;
}

.tca-sensor-group {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    padding: 9px 10px;
}

.tca-sensor-group-title {
    margin: 0 0 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 800;
}

.tca-sensor-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tca-sensor-item {
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    padding: 5px 8px;
    font-size: 11px;
    color: #334155;
    font-weight: 700;
}

.tca-sensor-item.tca-sensor-error {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.09);
}

.tca-panel-muted {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 960px) {
    .tca-selector-field {
        flex-basis: 100%;
    }

    .tca-home-manage-btn {
        width: 100%;
    }

    .tca-homes-modal__dialog {
        margin: 16px;
    }

    .tca-home-editor-row,
    .tca-home-device-row {
        grid-template-columns: 1fr;
    }

    .temp-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .temp-main {
        width: 100%;
    }

    .tz-target-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tz-target-inline {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .target-temp-input.tz-target-input {
        flex: 1;
    }

    .tz-status-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .zone-controls {
        grid-template-columns: 1fr;
    }

    .quick-temp-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-device-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-online-config-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-online-config-browser {
        grid-template-columns: 1fr;
    }

    .tca-online-config-nav {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-online-config-field-grid {
        grid-template-columns: 1fr;
    }

    .tca-online-config-editor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-online-config-group-row {
        grid-template-columns: minmax(72px, 110px) minmax(0, 1fr);
    }

    .tca-online-config-remove-group-btn {
        grid-column: 2;
        justify-self: start;
    }

    .tca-online-config-service-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tca-online-config-device-grid,
    .tca-online-config-zone-grid {
        grid-template-columns: 1fr;
    }

    .tca-tabs-nav {
        gap: 5px;
    }

    .tca-tab-btn {
        flex: 1 1 120px;
    }

    .tca-tab-btn--settings {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .thermostat-container {
        padding-bottom: 18px;
    }

    .thermo-zone-card {
        padding: 12px;
    }

    .tca-thermo-header {
        justify-content: flex-start;
    }

    .tca-device-grid {
        grid-template-columns: 1fr;
    }

    .tca-online-config-head,
    .tca-online-config-actions {
        width: 100%;
    }

    .tca-online-config-actions {
        justify-content: stretch;
    }

    .tca-config-pull-btn,
    .tca-config-refresh-btn,
    .tca-config-draft-save-btn,
    .tca-config-draft-apply-btn,
    .tca-config-devices-save-btn,
    .tca-config-zones-save-btn,
    .tca-online-config-add-group-btn,
    .tca-online-config-add-device-btn {
        flex: 1 1 140px;
    }

    .tca-online-config-meta {
        grid-template-columns: 1fr;
    }

    .tca-online-config-nav {
        grid-template-columns: 1fr;
    }

    .tca-online-config-field {
        grid-template-columns: 1fr;
    }

    .tca-online-config-field-input {
        width: 100%;
    }

    .tca-online-config-editor-grid,
    .tca-online-config-group-row,
    .tca-online-config-service-row {
        grid-template-columns: 1fr;
    }

    .tca-online-config-remove-group-btn {
        grid-column: auto;
    }

    .tca-online-config-device-head-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .tca-online-config-field-switch {
        justify-self: start;
    }

    .tca-button-card {
        width: 100%;
    }

    .tca-journal-section-header,
    .tca-settings-card-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .tca-journal-section-actions {
        width: 100%;
        justify-content: space-between;
    }

    .zone-main-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .zone-info-right {
        text-align: left;
    }

    .tz-mode-toggle {
        font-size: 11px;
        min-height: 34px;
    }

    #thermo-chart-overlay {
        padding: 8px;
    }

    .tca-history-modal {
        height: 92vh;
        padding: 10px;
    }

    .tca-history-modal__toolbar {
        grid-template-columns: 1fr;
    }

    .tca-history-modal__filters {
        grid-template-columns: 1fr;
    }

    .tca-history-modal__chart {
        min-height: 320px;
    }
}

@media (min-width: 1200px) {
    .thermo-zones-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .thermostat-container {
        max-width: 1640px;
    }

    .thermo-zones-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1680px) {
    .thermostat-container {
        max-width: 100%;
    }

    .thermo-zones-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@keyframes tcaRuntimeBlink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.48;
    }
}

@keyframes tcaInfoBlinkSlow {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.72;
    }
}

@keyframes tcaFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tcaPulseFreeze {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes tcaShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes tcaShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}
