﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: #e8edf2;
    font-family: var(--font-sans);
    font-feature-settings: "tnum" 1;
    font-optical-sizing: auto;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

strong,
b {
    font-weight: 500;
}

h1 {
    font-weight: 500;
}

:root {
    color-scheme: dark;
    --font-sans: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    --app-bg:
        radial-gradient(circle at 14% 0%, rgba(20, 202, 232, .14), transparent 30%),
        radial-gradient(circle at 86% 10%, rgba(63, 139, 196, .1), transparent 34%),
        linear-gradient(180deg, #08233a 0%, #071a2c 44%, #041321 100%);
    --surface: linear-gradient(180deg, rgba(13, 43, 67, .92), rgba(6, 24, 42, .96));
    --surface-soft: rgba(7, 34, 55, .86);
    --surface-field: rgba(3, 20, 34, .92);
    --border: rgba(76, 151, 190, .46);
    --border-active: rgba(32, 216, 255, .52);
    --accent: #20d8ff;
    --accent-soft: rgba(32, 216, 255, .16);
    --success: #5ee23f;
    --warning: #ffd226;
    --danger: #d20f37;
    --danger-soft: rgba(210, 15, 55, .16);
    --control-surface: var(--surface);
    --control-border: var(--border);
    --control-radius: 8px;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    min-height: 42px;
    padding: 9px 11px;
    color: #e7f8ff;
    caret-color: var(--accent);
    background-color: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
    outline: none;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

select option {
    color: #e7f8ff;
    background: #061a2b;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .08);
}

input:disabled,
select:disabled,
textarea:disabled {
    color: #7893a1;
    background-color: rgba(3, 17, 28, .78);
    border-color: rgba(79, 126, 148, .24);
    opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

input[type="file"] {
    color: #9fc3d1;
}

input[type="file"]::file-selector-button {
    min-height: 38px;
    margin-right: 10px;
    padding: 8px 12px;
    color: #e7f8ff;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #e7f8ff;
    box-shadow: 0 0 0 1000px #031422 inset;
    transition: background-color 9999s ease-out 0s;
}

input::placeholder,
textarea::placeholder {
    color: #9fc3d1;
    opacity: 1;
}

.lock-body {
    min-height: 100vh;
    background: var(--app-bg);
}

.pin-shell {
    min-height: 100vh;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 58px 12px 28px;
}

.pin-panel {
    display: flex;
    flex-direction: column;
    width: min(390px, 100%);
    min-height: 680px;
    padding: 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.pin-panel.pin-error {
    animation: pinShake .22s linear 0s 2;
}

.pin-brand {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 24px;
    overflow: hidden;
}

.pin-brand img {
    display: block;
    width: min(257px, 92%);
    max-width: 257px;
    height: auto;
    object-fit: contain;
}

.auth-pane {
    display: none;
}

.auth-pane.active {
    display: block;
}

#pinForm.active {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

#registerForm.active {
    display: grid;
}

.pin-panel h1 {
    margin: 6px 0 0;
    font-size: 25px;
    font-weight: 400;
    text-align: center;
}

.pin-subtitle {
    margin-top: 6px;
    color: #9aabb8;
    font-size: 14px;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 10px;
}

.pin-dots span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #223140;
    border: 1px solid #3b5061;
    transition:
        background .08s ease,
        border-color .08s ease,
        box-shadow .08s ease,
        transform .08s ease;
}

.pin-dots span.filled {
    background: #27e06d;
    border-color: #6ff0a0;
    box-shadow: 0 0 12px rgba(39, 224, 109, .86);
    transform: scale(1.08);
}

.pin-message {
    min-height: 18px;
    color: #9aabb8;
    text-align: center;
    font-size: 13px;
}

.pin-error .pin-message {
    color: #ff8f8f;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 18px;
}

.pin-key {
    position: relative;
    overflow: hidden;
    height: 56px;
    border-radius: 8px;
    border: 1px solid #33495b;
    background:
        linear-gradient(180deg, #223445 0%, #182735 100%);
    color: #f2f8fb;
    font-size: 22px;
    font-weight: 500;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .02),
        0 12px 28px rgba(0, 0, 0, .2);
    transition:
        box-shadow .12s ease,
        background .07s ease,
        border-color .07s ease;
}

.pin-key::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background:
        radial-gradient(ellipse at center, rgba(255, 244, 145, .95) 0%, rgba(255, 205, 63, .74) 42%, rgba(255, 155, 39, .28) 72%, rgba(255, 194, 64, 0) 100%);
    transform: scaleX(.2);
    pointer-events: none;
}

.pin-key:hover {
    background:
        linear-gradient(180deg, #2a4052 0%, #203242 100%);
    border-color: #4d7188;
}

.pin-key:active {
    box-shadow:
        inset 0 0 22px rgba(255, 202, 74, .14),
        0 0 28px rgba(255, 194, 64, .18);
}

.pin-key.flash::after {
    animation: sunFlash .5s ease-out;
}

.pin-clear,
.pin-back {
    color: #c7d7e2;
    font-size: 18px;
}

#registerForm {
    display: none;
    gap: 10px;
}

#registerForm label {
    display: grid;
    gap: 5px;
}

#registerForm label span {
    color: #9cc6d8;
    font-size: 13px;
}

#registerForm input,
#registerForm textarea {
    width: 100%;
    padding: 10px;
    color: #e8edf2;
    font: inherit;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 8px;
}

#registerForm button[type="submit"] {
    margin-top: 4px;
    min-height: 44px;
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 58%),
        var(--surface);
}

.auth-switch-line {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    color: #8fa7b7;
    text-align: center;
    font-size: 14px;
}

.auth-switch-line button {
    min-height: 0;
    padding: 0;
    color: #ffffff;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: inherit;
    text-decoration: none;
}

.auth-switch-line button:hover {
    color: #9fe9ff;
    background: transparent;
}

.register-error {
    padding: 9px 10px;
    color: #ffd8df;
    background: rgba(210, 15, 55, .12);
    border: 1px solid rgba(210, 15, 55, .48);
    border-radius: 8px;
}

@keyframes pinShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(7px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@keyframes sunFlash {
    0% {
        opacity: 0;
        transform: scaleX(.18);
    }
    28% {
        opacity: 1;
        transform: scaleX(1);
    }
    100% {
        opacity: 0;
        transform: scaleX(1.08);
    }
}

.app-header,
.header {
    min-height: 84px;
    padding: 18px clamp(18px, 4vw, 52px);
    background:
        radial-gradient(circle at 18% 0%, rgba(32, 216, 255, .08), transparent 34%),
        rgba(5, 20, 34, .92);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 22px;
    font-weight: 500;
}

.brand-home {
    display: block;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
}

.brand-home:hover,
.brand-home:active {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    filter: drop-shadow(0 0 12px rgba(84, 214, 240, .18));
}

.brand-logo {
    display: block;
    width: 218px;
    height: auto;
}

.subtitle {
    margin-top: 2px;
    color: #9aabb8;
    font-size: 13px;
}

.top-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #b9c8d3;
    font-size: 13px;
}

.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.profile-text-button {
    width: auto;
    min-width: 58px;
    height: 52px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.mobile-menu-button {
    display: none;
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    place-items: center;
    gap: 5px;
    border-radius: 12px;
}

.mobile-menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
}

body.menu-open .mobile-menu-button {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.profile-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, #8ed8ff, #2a789c);
    box-shadow: 0 0 0 3px rgba(142, 216, 255, .12);
}

.profile-menu {
    position: absolute;
    top: 48px;
    right: 0;
    z-index: 20;
    min-width: 190px;
    padding: 12px;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
}

.profile-menu.open {
    display: block;
}

.profile-title {
    font-weight: 500;
}

.profile-row {
    margin-top: 6px;
    color: #9aabb8;
    font-size: 13px;
}

.profile-menu a {
    display: block;
    margin-top: 12px;
    color: #8ed8ff;
    text-decoration: none;
}

body.account-open {
    overflow: hidden;
}

.account-overlay {
    position: fixed;
    inset: 86px 0 0;
    z-index: 80;
    display: none;
}

body.account-open .account-overlay {
    display: block;
}

.account-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 9, 15, .72);
    backdrop-filter: blur(10px);
}

.account-shell {
    position: relative;
    display: grid;
    grid-template-rows: 1fr;
    width: calc(100% - 128px);
    max-width: none;
    height: calc(100vh - 110px);
    min-height: 0;
    max-height: calc(100vh - 110px);
    margin: 24px 64px;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 216, 255, .1), transparent 32%),
        linear-gradient(155deg, rgba(9, 39, 61, .98), rgba(4, 18, 32, .99));
    border: 1px solid rgba(69, 164, 205, .34);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .44);
}

h3,
.panel-title,
.device-title,
.control-title,
.account-card p {
    margin: 0;
}

h3,
.panel-title,
.device-title,
.control-title {
    color: #f2f7fb;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
}

.account-content {
    display: grid;
    grid-template-columns: minmax(0, 780px);
    justify-content: center;
    align-content: start;
    gap: 16px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 20px 24px 24px;
}

.profile-text-button.account-close-state {
    font-size: 25px;
    line-height: 1;
}

.account-card {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
    min-height: 0;
    padding: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .07), transparent 34%),
        linear-gradient(145deg, rgba(12, 49, 73, .92), rgba(5, 25, 42, .96));
    border: 1px solid rgba(64, 151, 190, .3);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.account-profile-card {
    grid-row: auto;
    width: 100%;
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 216, 255, .13), transparent 32%),
        linear-gradient(145deg, rgba(13, 56, 82, .96), rgba(5, 26, 44, .98));
}

.account-support-card {
    grid-column: 2;
}

.account-profile-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-profile-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.account-profile-top > div {
    min-width: 0;
}

.account-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 94px;
    height: 94px;
    border: 2px solid rgba(55, 219, 247, .86);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 5px rgba(31, 188, 215, .12);
}

.account-avatar-placeholder {
    color: #54d6f0;
    font-size: 34px;
    font-weight: 500;
    background:
        radial-gradient(circle at 35% 22%, rgba(84, 214, 240, .28), transparent 42%),
        linear-gradient(145deg, #102a38, #0a141d);
}

.account-support-card {
    min-height: 0;
}

.account-engineer-card {
    position: relative;
    gap: 14px;
    min-height: 0;
    padding: 18px 22px;
    background:
        radial-gradient(circle at 86% 50%, rgba(36, 143, 108, .11), transparent 28%),
        linear-gradient(135deg, rgba(16, 55, 65, .94), rgba(8, 23, 37, .96));
    border-color: var(--control-border);
    border-radius: 18px;
}

.account-support-person {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.account-support-avatar {
    width: 78px;
    height: 78px;
    border: 2px solid #1fbcd7;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 4px rgba(31, 188, 215, .12);
}

.account-support-person h3,
.account-support-person span {
    display: block;
}

.account-support-person h3 {
    color: #dff7ff;
    font-size: 18px;
    font-weight: 500;
}

.account-support-person span {
    margin-top: 5px;
    color: #9bc7da;
    font-size: 14px;
    line-height: 1.35;
}

.account-support-actions {
    margin-top: 0;
}

.account-support-actions button {
    justify-self: start;
}

.account-card > h3,
.account-notify-panel h3,
.account-profile-top h3 {
    margin: 0;
    color: #f1fbff;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.015em;
}

.account-profile-top h3 {
    font-size: clamp(21px, 2.5vw, 27px);
}

.account-profile-top span,
.account-profile-top small,
.account-profile-top p {
    display: block;
    overflow-wrap: anywhere;
}

.account-profile-view {
    display: grid;
    gap: 14px;
}

.account-profile-flash {
    padding: 10px 12px;
    color: #bff7d4;
    background: rgba(72, 218, 133, .1);
    border: 1px solid rgba(72, 218, 133, .25);
    border-radius: 10px;
    font-size: 13px;
}

.account-profile-top span,
.account-profile-top small,
.account-card small {
    color: #8fb8c9;
}

.account-profile-top p,
.account-card p {
    color: #bfe7f3;
    line-height: 1.4;
}

.account-profile-top p {
    margin: 7px 0 0;
    color: #9cc8da;
    font-size: 14px;
}

.account-contact-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 18px;
}

.account-contact-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 44px;
    padding: 2px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    transition: color .16s ease;
}

a.account-contact-row:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.account-contact-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #43dcfa;
    background: rgba(32, 216, 255, .1);
    border: 1px solid rgba(32, 216, 255, .22);
    border-radius: 11px;
}

.account-contact-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-contact-row strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-contact-row strong {
    color: #dbf5ff;
    font-size: 14px;
    font-weight: 500;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-actions.account-profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 7px;
}

.account-profile-actions button {
    width: 100%;
    min-width: 0;
}

.account-card button:not(.automation-switch),
.account-card .button-soft {
    min-height: 42px;
    color: #dff7ff;
    background: linear-gradient(180deg, rgba(18, 59, 82, .9), rgba(8, 35, 55, .96));
    border-color: rgba(77, 158, 194, .38);
    border-radius: 11px;
    font-size: 13px;
    font-weight: 500;
}

.account-card button.account-action-primary {
    color: #edfcff;
    background:
        radial-gradient(circle at 50% 0%, rgba(32, 216, 255, .22), transparent 62%),
        linear-gradient(180deg, rgba(13, 78, 104, .94), rgba(6, 45, 67, .98));
    border-color: rgba(32, 216, 255, .5);
}

.account-card button.account-action-secondary {
    color: #bfe9f7;
}

.account-notify-panel {
    display: grid;
    gap: 10px;
}

.account-notify-panel h3 {
    font-size: 16px;
}

.account-notify-list {
    display: grid;
    gap: 2px;
}

.account-notify-list label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 4px 0;
}

.account-notify-list label > span:first-child {
    color: #bfe7f3;
    font-size: 13px;
    font-weight: 400;
}

.account-actions a,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    color: #ffd8df;
    text-decoration: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(210, 15, 55, .18), transparent 58%),
        linear-gradient(180deg, rgba(88, 24, 43, .72), rgba(44, 11, 27, .86));
    border: 1px solid rgba(210, 15, 55, .46);
    border-radius: 11px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .05),
        0 12px 24px rgba(0, 0, 0, .14);
}

.account-edit-form {
    display: none;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.account-profile-card.is-editing .account-profile-view {
    display: none;
}

.account-profile-card.is-editing .account-edit-form {
    display: grid;
}

.account-profile-card.is-pin-editing .account-profile-view {
    display: none;
}

.account-profile-card.is-pin-editing .account-pin-form {
    display: grid;
}

.account-edit-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(76, 139, 181, .2);
}

.account-edit-head h3,
.account-edit-head small {
    display: block;
    margin: 0;
}

.account-edit-head h3 {
    color: #effaff;
    font-size: 19px;
    font-weight: 500;
}

.account-edit-head small {
    margin-bottom: 3px;
    color: #79a9bd;
    font-size: 11px;
}

.account-card button.account-edit-back {
    display: grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    color: #a8eaff;
    background: rgba(3, 22, 37, .66);
    border-color: rgba(75, 158, 194, .32);
    border-radius: 11px;
}

.account-edit-back svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-edit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.account-edit-wide {
    grid-column: 1 / -1;
}

.account-edit-form label {
    display: grid;
    gap: 6px;
}

.account-pin-form {
    display: none;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
}

.account-pin-fields {
    display: grid;
    gap: 11px;
}

.account-pin-form label {
    display: grid;
    gap: 6px;
}

.account-edit-form span {
    color: #9cc6d8;
    font-size: 13px;
}

.account-pin-form span {
    color: #9cc6d8;
    font-size: 13px;
}

.account-edit-form input,
.account-edit-form textarea,
.account-pin-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #e8edf2;
    font: inherit;
    background: rgba(2, 16, 29, .82);
    border: 1px solid rgba(74, 150, 184, .34);
    border-radius: 10px;
}

.account-edit-form input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.account-logout {
    width: 100%;
}

.account-big {
    color: #54d6f0;
    font-size: 48px;
    line-height: 1;
}

.account-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.account-stat-grid span {
    display: grid;
    gap: 3px;
    min-height: 76px;
    place-items: center;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.account-stat-grid b {
    color: #54d6f0;
    font-size: 28px;
}

.account-stat-grid small {
    color: #8fb8c9;
    font-size: 12px;
}

.app-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 22px 64px 42px;
}

.side-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.nav-item {
    width: auto;
    min-width: 124px;
    min-height: 58px;
    text-align: center;
    padding: 0 22px;
    border-radius: 12px;
    color: #d7e3ea;
    font-size: 16px;
    font-weight: 500;
}

.nav-item.active {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 0%, rgba(32, 216, 255, .22), transparent 58%),
        linear-gradient(180deg, rgba(20, 75, 101, .92), rgba(9, 45, 72, .96));
    color: #ffffff;
    box-shadow: inset 0 0 22px rgba(32, 216, 255, .14), 0 0 22px rgba(32, 216, 255, .08);
}

.content-shell {
    min-width: 0;
}

.content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 0 8px;
}

.content-head > div {
    min-width: 0;
}

.content-head h1 {
    font-size: 25px;
    font-weight: 500;
}

.content-head p {
    margin: 6px 0 0;
    color: #9aabb8;
    font-size: 14px;
}

.dashboard-mode .content-head {
    display: none;
}

.dashboard-mode .log-panel {
    display: none;
}

.action-detail-mode .content-head {
    display: none;
}

.section-content {
    min-width: 0;
}

.simple-dashboard {
    display: grid;
    gap: 18px;
}

.calm-overview {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 18px 24px;
    overflow: hidden;
    padding: 24px;
    background:
        radial-gradient(circle at 88% 20%, rgba(94, 226, 63, .12), transparent 28%),
        radial-gradient(circle at 18% 0%, rgba(32, 216, 255, .09), transparent 34%),
        linear-gradient(145deg, rgba(13, 49, 68, .96), rgba(4, 24, 40, .98));
    border: 1px solid rgba(62, 167, 180, .34);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

.calm-overview::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, .025) 48%, transparent 72%);
}

.calm-overview.needs-attention {
    background:
        radial-gradient(circle at 88% 20%, rgba(255, 210, 38, .1), transparent 28%),
        radial-gradient(circle at 18% 0%, rgba(32, 216, 255, .07), transparent 34%),
        linear-gradient(145deg, rgba(15, 46, 64, .96), rgba(5, 24, 40, .98));
    border-color: rgba(255, 210, 38, .32);
}

.calm-copy {
    position: relative;
    z-index: 1;
    align-self: center;
}

.calm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8cc9d9;
    font-size: 12px;
    letter-spacing: .02em;
}

.calm-eyebrow i {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(94, 226, 63, .7);
}

.needs-attention .calm-eyebrow i {
    background: var(--warning);
    box-shadow: 0 0 12px rgba(255, 210, 38, .58);
}

.calm-copy h2 {
    margin: 0;
    color: #f3fbfd;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 500;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.calm-copy p {
    max-width: 620px;
    margin: 10px 0 0;
    color: #a2c6d4;
    font-size: 15px;
    line-height: 1.45;
}

.calm-symbol {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    align-self: center;
    justify-self: end;
    color: #71e890;
    background: rgba(6, 34, 45, .56);
    border: 1px solid rgba(94, 226, 63, .28);
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(94, 226, 63, .035), 0 14px 34px rgba(0, 0, 0, .18);
}

.needs-attention .calm-symbol {
    color: var(--warning);
    border-color: rgba(255, 210, 38, .28);
    box-shadow: 0 0 0 8px rgba(255, 210, 38, .03), 0 14px 34px rgba(0, 0, 0, .18);
}

.calm-symbol svg {
    width: 68px;
    height: 68px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calm-facts {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-top: 4px;
}

.calm-automation-feature {
    display: grid;
    gap: 9px;
}

.calm-automation-feature > small {
    padding-left: 2px;
    color: #78a8bf;
    font-size: 12px;
    line-height: 1.25;
}

.calm-overview.has-inbox-alert {
    grid-template-columns: minmax(0, 1fr);
    min-height: 238px;
    background:
        radial-gradient(circle at 88% 18%, rgba(181, 140, 255, .16), transparent 34%),
        radial-gradient(circle at 10% 0%, rgba(32, 216, 255, .12), transparent 38%),
        linear-gradient(145deg, rgba(14, 50, 73, .98), rgba(5, 24, 42, .99));
    border-color: rgba(116, 187, 220, .42);
}

.calm-overview.has-inbox-alert > .calm-copy,
.calm-overview.has-inbox-alert > .calm-symbol,
.calm-overview.has-inbox-alert > .calm-facts {
    display: none;
}

.dashboard-inbox-alert {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    min-height: 188px;
    padding: 20px 22px;
    background:
        linear-gradient(110deg, rgba(6, 35, 55, .82), rgba(10, 39, 61, .58)),
        radial-gradient(circle at 90% 30%, rgba(181, 140, 255, .12), transparent 36%);
    border: 1px solid rgba(92, 173, 208, .28);
    border-radius: 13px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 16px 34px rgba(0, 0, 0, .16);
}

.dashboard-inbox-alert[hidden] {
    display: none;
}

.dashboard-inbox-alert::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 16%, rgba(255, 255, 255, .035) 48%, transparent 76%);
    border-radius: inherit;
}

.dashboard-inbox-alert.is-arriving {
    animation: inboxAlertArrive .72s cubic-bezier(.2, .75, .25, 1);
}

@keyframes inboxAlertArrive {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(.985);
        box-shadow: 0 0 0 rgba(32, 216, 255, 0);
    }

    62% {
        box-shadow: 0 0 34px rgba(32, 216, 255, .12);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.inbox-alert-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    overflow: hidden;
    color: #dff9ff;
    background: rgba(4, 25, 41, .92);
    border: 1px solid rgba(84, 214, 240, .42);
    border-radius: 14px;
    box-shadow: 0 0 0 5px rgba(32, 216, 255, .035), 0 12px 28px rgba(0, 0, 0, .22);
    font-size: 24px;
    font-weight: 500;
}

.inbox-alert-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inbox-alert-copy {
    position: relative;
    min-width: 0;
}

.inbox-alert-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #65dff2;
    font-size: 12px;
    line-height: 1.25;
}

.inbox-alert-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #ff536e;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 83, 110, .62);
}

.inbox-alert-copy h2 {
    margin: 8px 0 0;
    color: #f2f9fc;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 500;
    letter-spacing: -.025em;
    line-height: 1.08;
}

.inbox-alert-copy p {
    display: -webkit-box;
    max-width: 760px;
    margin: 11px 0 0;
    overflow: hidden;
    color: #c4dce7;
    font-size: 16px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.inbox-alert-copy time {
    display: block;
    margin-top: 10px;
    color: #6f9caf;
    font-size: 11px;
    line-height: 1.2;
}

.inbox-alert-open {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 190px;
    min-height: 46px;
    padding: 0 16px;
    color: #eafcff;
    background: linear-gradient(155deg, rgba(12, 113, 143, .92), rgba(6, 65, 91, .98));
    border: 1px solid rgba(72, 216, 241, .48);
    border-radius: 9px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 10px 22px rgba(0, 0, 0, .18);
    font-size: 13px;
    font-weight: 500;
}

.inbox-alert-open svg,
.inbox-alert-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inbox-alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #87aebe;
    background: rgba(3, 24, 39, .72);
    border: 1px solid rgba(87, 151, 181, .25);
    border-radius: 8px;
}

.dashboard-inbox-alert.is-notification {
    border-color: rgba(255, 210, 38, .3);
}

.dashboard-inbox-alert.is-notification .inbox-alert-kicker {
    color: #f2cd64;
}

.nav-item,
.mobile-menu-button {
    position: relative;
}

.nav-item.has-unread-message::after,
.mobile-menu-button.has-unread-message::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    background: #ff536e;
    border: 2px solid #071d30;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 83, 110, .68);
}

.nav-item.has-unread-message::after {
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
}

.mobile-menu-button.has-unread-message::after {
    top: 4px;
    right: 4px;
}

@media (max-width: 720px) {
    .calm-overview.has-inbox-alert {
        min-height: 286px;
        padding: 12px;
    }

    .dashboard-inbox-alert {
        grid-template-columns: 64px minmax(0, 1fr);
        align-items: start;
        gap: 14px;
        min-height: 260px;
        padding: 20px 16px 16px;
    }

    .inbox-alert-avatar {
        width: 64px;
        height: 64px;
        border-radius: 11px;
        font-size: 18px;
    }

    .inbox-alert-copy {
        padding-right: 28px;
    }

    .inbox-alert-copy h2 {
        margin-top: 6px;
        font-size: 22px;
    }

    .inbox-alert-copy p {
        grid-column: 1 / -1;
        margin-top: 12px;
        font-size: 14px;
        -webkit-line-clamp: 4;
    }

    .inbox-alert-open {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        margin-top: 2px;
    }
}

.calm-fact {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 68px;
    padding: 11px 13px;
    background: rgba(3, 22, 36, .55);
    border: 1px solid rgba(77, 145, 176, .22);
    border-radius: 11px;
}

.calm-fact-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #61d9ee;
    background: rgba(32, 216, 255, .07);
    border: 1px solid rgba(32, 216, 255, .24);
    border-radius: 10px;
}

.calm-fact-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calm-fact > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.calm-fact small,
.calm-fact span {
    overflow: hidden;
    color: #719bae;
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calm-fact strong {
    overflow: hidden;
    color: #e6f4f8;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.engineer-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 118px;
    padding: 18px 22px;
    background:
        radial-gradient(circle at 85% 50%, rgba(36, 143, 108, .11), transparent 24%),
        linear-gradient(135deg, rgba(16, 55, 65, .94), rgba(8, 23, 37, .96));
    border: 1px solid rgba(0, 201, 232, .34);
    border-radius: 18px;
}

.engineer-avatar {
    width: 78px;
    height: 78px;
    min-width: 78px;
    object-fit: cover;
    border: 1px solid #4f91aa;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(84, 199, 240, .08), 0 8px 24px rgba(0, 0, 0, .28);
}

.engineer-copy {
    min-width: 0;
    flex: 1;
}

.engineer-note.hidden {
    display: none;
}

.engineer-note h3,
.engineer-note span {
    display: block;
}

.engineer-note h3 {
    color: #dff7ff;
    font-size: 18px;
    font-weight: 500;
}

.engineer-note span {
    margin-top: 4px;
    color: #9bc7da;
    font-size: 14px;
    line-height: 1.35;
}

.engineer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.engineer-actions button {
    min-width: 92px;
    height: 38px;
    border-color: rgba(84, 214, 240, .46);
    background:
        linear-gradient(180deg, rgba(32, 66, 84, .82), rgba(18, 43, 58, .88));
    font-weight: 500;
}

.engineer-actions button:first-child {
    border-color: rgba(49, 216, 121, .48);
    background:
        radial-gradient(circle at 50% 0%, rgba(49, 216, 121, .18), transparent 58%),
        linear-gradient(180deg, rgba(23, 69, 46, .82), rgba(14, 48, 33, .9));
}

.engineer-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    font-size: 20px;
}

.system-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.system-chip {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    gap: 12px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.system-chip .card-status {
    position: static;
    width: 13px;
    height: 13px;
}

.system-chip h3 {
    font-size: 16px;
    font-weight: 500;
    white-space: normal;
}

.quick-controls,
.weather-panel,
.scenes-strip {
    padding: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .08), transparent 36%),
        var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.dashboard-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-title h2 {
    color: #f2f9fc;
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -.02em;
}

.dashboard-title h3 {
    color: #f2f9fc;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -.015em;
}

.dashboard-title span {
    color: #78a8bf;
    font-size: 13px;
}

.support-team {
    display: grid;
    gap: 16px;
    padding: 18px;
    background:
        radial-gradient(circle at 92% 2%, rgba(151, 95, 255, .09), transparent 30%),
        radial-gradient(circle at 8% 100%, rgba(32, 216, 255, .07), transparent 36%),
        linear-gradient(155deg, rgba(9, 42, 64, .97), rgba(3, 21, 36, .99));
    border: 1px solid rgba(67, 146, 186, .32);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .16);
}

.support-team-head {
    align-items: center;
    margin: 0;
}

.support-team-head > div {
    display: grid;
    gap: 4px;
    width: 100%;
}

.support-team-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.support-team-status {
    width: 13px;
    min-width: 13px;
    height: 13px;
    margin-left: auto;
    background: #25d366;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(37, 211, 102, .8);
}

.support-team-head > div > span {
    font-size: 14px;
    line-height: 1.35;
}

.support-team-head h2 {
    font-size: 24px;
}

.specialist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.specialist-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 114px;
    align-items: center;
    gap: 12px;
    min-height: 158px;
    overflow: hidden;
    padding: 13px;
    background: linear-gradient(150deg, rgba(13, 59, 84, .98), rgba(5, 31, 50, .99));
    border: 1px solid rgba(76, 170, 207, .48);
    border-radius: 12px;
}

.specialist-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -34px auto;
    width: 94px;
    height: 94px;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(32, 216, 255, .05);
    filter: blur(4px);
}

.specialist-agronom {
    border-color: rgba(73, 212, 125, .48);
}

.specialist-agronom::after {
    background: rgba(73, 212, 125, .08);
}

.specialist-anna {
    border-color: rgba(180, 135, 255, .54);
}

.specialist-anna::after {
    background: rgba(166, 111, 255, .09);
}

.specialist-portrait {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 114px;
    height: 114px;
    overflow: hidden;
    color: #42dffc;
    background:
        radial-gradient(circle at 50% 28%, rgba(32, 216, 255, .18), transparent 42%),
        rgba(2, 22, 36, .78);
    border: 1px solid rgba(72, 178, 211, .35);
    border-radius: 10px;
    grid-column: 2;
    grid-row: 1;
}

.specialist-agronom .specialist-portrait {
    color: #62dc8b;
    border-color: rgba(73, 212, 125, .34);
}

.specialist-anna .specialist-portrait {
    border-color: rgba(166, 111, 255, .38);
}

.specialist-anna .specialist-portrait img {
    object-position: 50% 50%;
}

.specialist-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 6%;
    transform: scale(1.2);
    transform-origin: center;
}

.specialist-card > div {
    position: relative;
    z-index: 1;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.specialist-card h3 {
    margin: 0;
    color: #eef9fc;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.2;
}

.specialist-card p {
    margin: 7px 0 0;
    color: #78a8bf;
    font-size: 14px;
    line-height: 1.42;
}

.support-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 17px;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 210, 38, .16), transparent 34%),
        linear-gradient(160deg, rgba(10, 42, 64, .96), rgba(4, 24, 40, .99));
    border: 1px solid rgba(68, 145, 185, .3);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}

.support-composer-copy h2 {
    margin: 0;
    color: #f1f9fc;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.support-composer-copy {
    display: grid;
    gap: 4px;
    padding: 0;
    text-align: left;
}

.support-composer-copy p {
    margin: 0;
    color: #afd0dc;
    font-size: 13px;
    line-height: 1.4;
}

.support-voice-stage {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: auto 58px;
    align-items: center;
    gap: 4px 28px;
    min-height: 132px;
    padding: 8px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.support-voice-stage button.support-voice-trigger {
    position: relative;
    width: 88px;
    min-width: 88px;
    height: 88px;
    min-height: 88px;
    grid-column: 1;
    grid-row: 1 / 3;
    justify-self: center;
    color: #f1fff6;
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(150deg, #35e779, #0b9a50 68%, #08703d);
    border: 1px solid rgba(117, 255, 172, .82);
    border-radius: 50%;
    box-shadow:
        0 0 0 7px rgba(46, 238, 121, .08),
        0 0 30px rgba(46, 238, 121, .34),
        0 14px 26px rgba(0, 0, 0, .28),
        inset 0 1px rgba(255, 255, 255, .28);
}

.support-voice-trigger svg {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    stroke-width: 1.55;
}

.support-voice-ring {
    position: absolute;
    inset: -9px;
    z-index: 1;
    pointer-events: none;
    border: 1px solid rgba(84, 255, 156, .34);
    border-radius: 50%;
}

.support-voice-trigger:hover,
.support-voice-trigger:focus-visible {
    color: #fff;
    border-color: #a3ffc5;
    box-shadow:
        0 0 0 8px rgba(46, 238, 121, .11),
        0 0 38px rgba(46, 238, 121, .46),
        0 16px 28px rgba(0, 0, 0, .3),
        inset 0 1px rgba(255, 255, 255, .32);
    transform: translateY(-1px);
}

.support-voice-stage button.support-voice-trigger.is-recording,
.support-voice-stage button.support-voice-trigger.is-recording:hover,
.support-voice-stage button.support-voice-trigger.is-recording:active {
    color: #fff;
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, .22), transparent 24%),
        linear-gradient(150deg, #ff6d81, #d93658 66%, #951f3d);
    border-color: rgba(255, 142, 158, .92);
    box-shadow:
        0 0 0 8px rgba(255, 83, 110, .12),
        0 0 44px rgba(255, 83, 110, .48),
        0 16px 30px rgba(0, 0, 0, .3),
        inset 0 1px rgba(255, 255, 255, .32);
    animation: supportMicPulse 1.4s ease-in-out infinite;
}

.support-voice-stage button.support-voice-trigger:active:not(.is-recording) {
    color: #fff;
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(150deg, #35e779, #0b9a50 68%, #08703d);
    border-color: rgba(117, 255, 172, .9);
}

.support-voice-trigger.is-recording .support-voice-ring {
    border-color: rgba(255, 123, 145, .46);
}

@keyframes supportMicPulse {
    50% {
        box-shadow:
            0 0 0 13px rgba(255, 83, 110, .05),
            0 0 54px rgba(255, 83, 110, .58),
            0 16px 30px rgba(0, 0, 0, .3),
            inset 0 1px rgba(255, 255, 255, .32);
    }
}

.support-wave {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    height: 64px;
    padding: 0;
    grid-column: 2;
    grid-row: 2;
}

.support-wave i {
    width: 3px;
    height: calc(10px + (var(--wave-index, 1) * 2px));
    max-height: 46px;
    background: linear-gradient(180deg, #6cf5f7, #26d879);
    border-radius: 3px;
    opacity: .38;
    transform: scaleY(.45);
    transform-origin: center;
}

.support-wave i:nth-child(3n + 1) {
    height: 32px;
}

.support-wave i:nth-child(3n + 2) {
    height: 48px;
}

.support-wave i:nth-child(3n) {
    height: 22px;
}

.support-voice-trigger.is-recording + .support-wave i {
    opacity: .92;
    animation: supportWave 900ms ease-in-out infinite alternate;
}

.support-voice-trigger.is-recording + .support-wave i:nth-child(2n) {
    animation-delay: -360ms;
}

.support-voice-trigger.is-recording + .support-wave i:nth-child(3n) {
    animation-delay: -620ms;
}

@keyframes supportWave {
    from {
        transform: scaleY(.28);
    }

    to {
        transform: scaleY(1);
    }
}

.support-voice-prompt {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
    align-self: end;
    padding-top: 12px;
}

.support-voice-prompt strong {
    color: #eafff2;
    font-size: 15px;
    font-weight: 500;
}

.support-voice-prompt span {
    color: #abd0db;
    font-size: 12px;
    line-height: 1.4;
}

.support-text-or {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px 0 16px;
    color: #78a8bf;
    font-size: 13px;
    line-height: 1;
}

.support-text-or::before,
.support-text-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(75, 160, 187, .24);
}

.support-compose-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    margin-top: 0;
    padding-top: 0;
}

.support-voice-stage > .voice-recorder {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    padding: 2px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.support-voice-stage > .voice-recorder.is-recording,
.support-voice-stage > .voice-recorder.is-ready,
.support-voice-stage > .voice-recorder.is-error {
    border: 0;
    box-shadow: none;
}

.support-voice-stage .voice-preview-player {
    background:
        radial-gradient(circle at 20px 50%, rgba(43, 223, 249, .1), transparent 35%),
        rgba(3, 27, 43, .72);
    border: 0;
    box-shadow: none;
}

.support-composer.is-voice-mode .support-text-or,
.support-composer.is-voice-mode .support-compose-row {
    display: none;
}

.support-compose-row textarea {
    width: 100%;
    min-height: 54px;
    max-height: 108px;
    padding: 15px 14px;
    color: #eaf5f8;
    font: inherit;
    resize: none;
    background: rgba(2, 23, 39, .98);
    border: 1px solid rgba(80, 175, 213, .62);
    border-radius: 10px;
    outline: none;
}

.support-compose-row textarea:focus {
    border-color: rgba(32, 216, 255, .72);
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .08);
}

.voice-trigger:not(.support-voice-trigger),
.support-send {
    min-height: 48px;
    border-radius: 10px;
}

.voice-trigger:not(.support-voice-trigger) {
    display: grid;
    place-items: center;
    width: 48px;
    min-width: 48px;
    padding: 0;
    color: #69e6fb;
    background: linear-gradient(155deg, rgba(11, 63, 86, .96), rgba(4, 31, 51, .98));
    border-color: rgba(32, 216, 255, .45);
}

.voice-trigger svg,
.support-send svg,
.message-voice-tool svg,
.message-voice-icon svg,
.voice-delete svg,
.voice-approve svg,
.voice-preview-toggle svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.voice-trigger:not(.support-voice-trigger) svg {
    width: 24px;
    height: 24px;
}

.voice-trigger:not(.support-voice-trigger).is-recording,
.message-voice-tool.is-recording {
    color: #fff;
    background: linear-gradient(155deg, #d53e58, #8c1833);
    border-color: #ff6a7e;
    box-shadow: 0 0 0 4px rgba(255, 83, 110, .1), 0 0 20px rgba(255, 83, 110, .25);
}

.voice-trigger:not(.support-voice-trigger).has-recording,
.message-voice-tool.has-recording {
    color: #7af2a1;
    border-color: rgba(94, 226, 63, .58);
}

.support-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 132px;
    padding: 0 16px;
    color: #eafff2;
    font-weight: 500;
    background: linear-gradient(155deg, rgba(20, 135, 76, .96), rgba(8, 82, 48, .98));
    border-color: rgba(94, 226, 63, .55);
}

.support-send svg {
    width: 19px;
    height: 19px;
}

.support-send-result {
    display: grid;
    grid-column: 1;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 8px 11px;
    padding: 12px;
    color: #a9d1de;
    background:
        radial-gradient(circle at 18px 18px, rgba(40, 221, 246, .11), transparent 32%),
        linear-gradient(145deg, rgba(7, 41, 59, .94), rgba(3, 24, 39, .98));
    border: 1px solid rgba(58, 190, 220, .3);
    border-radius: 10px;
}

.support-send-result[hidden] {
    display: none;
}

.support-send-result-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #76ebff;
    background: rgba(32, 216, 255, .08);
    border: 1px solid rgba(60, 211, 239, .34);
    border-radius: 10px;
    grid-column: 1;
    grid-row: 1;
}

.support-send-result-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.support-send-result > div {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    gap: 3px;
    min-width: 0;
    position: static;
}

.support-send-result strong {
    color: #edfaff;
    font-size: 13px;
    font-weight: 500;
}

.support-send-result > div > span {
    color: #8ebacb;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.support-send-result > button {
    display: inline-flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    gap: 6px;
    min-height: 35px;
    padding: 0 11px;
    color: #a9effa;
    background: rgba(11, 68, 89, .55);
    border-color: rgba(66, 197, 225, .38);
    border-radius: 8px;
}

.support-send-result > button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.support-send-result.button-only {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.support-send-result.button-only .support-send-result-icon,
.support-send-result.button-only > div {
    display: none;
}

.support-send-result.button-only > button {
    width: 100%;
    min-height: 52px;
    color: #effcff;
    font-size: 14px;
    font-weight: 500;
    background:
        radial-gradient(circle at 50% 0%, rgba(54, 224, 255, .2), transparent 62%),
        linear-gradient(155deg, rgba(11, 111, 144, .98), rgba(5, 66, 94, .98));
    border-color: rgba(80, 220, 245, .62);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, .2),
        inset 0 1px 0 rgba(255, 255, 255, .08);
}

.support-send-result.button-only > button svg {
    width: 19px;
    height: 19px;
}

.support-send-result.ok {
    border-color: rgba(70, 220, 128, .34);
}

.support-send-result.ok .support-send-result-icon {
    color: #6cf09c;
    background: rgba(48, 217, 119, .08);
    border-color: rgba(73, 224, 135, .34);
}

.support-send-result.wait .support-send-result-icon {
    animation: voicePulse 1.15s ease-in-out infinite;
}

.support-send-result.error {
    border-color: rgba(255, 94, 121, .34);
}

.support-send-result.error .support-send-result-icon {
    color: #ff8c9e;
    background: rgba(255, 83, 110, .08);
    border-color: rgba(255, 94, 121, .34);
}

.voice-recorder {
    display: grid;
    grid-column: 1;
    gap: 11px;
    padding: 13px;
    background:
        radial-gradient(circle at 0 0, rgba(32, 216, 255, .08), transparent 36%),
        linear-gradient(145deg, rgba(5, 35, 52, .96), rgba(2, 20, 34, .98));
    border: 1px solid rgba(68, 163, 195, .32);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

.voice-recorder[hidden] {
    display: none;
}

.voice-recorder.is-recording {
    border-color: rgba(255, 83, 110, .48);
}

.voice-recorder.is-ready {
    border-color: rgba(61, 196, 226, .38);
}

.voice-recorder.is-error {
    border-color: rgba(255, 83, 110, .4);
}

.voice-recorder-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 3px 8px;
}

.voice-recorder-status strong {
    color: #e6f7fb;
    font-size: 13px;
    font-weight: 500;
}

.voice-recorder-status > span:last-child {
    grid-column: 2;
    color: #7faabd;
    font-size: 11px;
    line-height: 1.35;
}

.voice-recorder-pulse {
    width: 9px;
    height: 9px;
    background: #4d7b8f;
    border-radius: 50%;
}

.voice-recorder.is-recording .voice-recorder-pulse {
    background: #ff536e;
    box-shadow: 0 0 12px rgba(255, 83, 110, .7);
    animation: voicePulse 1.15s ease-in-out infinite;
}

.voice-recorder.is-ready .voice-recorder-pulse {
    background: #43def5;
    box-shadow: 0 0 10px rgba(42, 218, 244, .48);
}

@keyframes voicePulse {
    50% {
        opacity: .42;
        transform: scale(.72);
    }
}

.voice-recorder-progress {
    height: 4px;
    overflow: hidden;
    background: rgba(95, 135, 153, .2);
    border-radius: 4px;
}

.voice-recorder-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #20d8ff, #ff536e);
    border-radius: inherit;
    transition: width .18s linear;
}

.voice-recorder.is-ready .voice-recorder-progress {
    display: none;
}

.voice-recorder audio {
    display: none;
}

.voice-preview-player {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
        "play seek seek"
        "play current duration";
    align-items: center;
    gap: 5px 10px;
    min-height: 58px;
    padding: 8px 10px;
    color: #bce8f2;
    background:
        radial-gradient(circle at 20px 50%, rgba(43, 223, 249, .11), transparent 34%),
        linear-gradient(145deg, rgba(7, 45, 62, .9), rgba(3, 25, 41, .98));
    border: 1px solid rgba(57, 187, 219, .3);
    border-radius: 10px;
}

.voice-preview-player[hidden] {
    display: none;
}

.voice-preview-player > span {
    min-width: 32px;
    color: #9bc8d6;
    font: 500 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.voice-preview-player > span:first-of-type {
    grid-area: current;
    text-align: left;
}

.voice-preview-player > span:last-of-type {
    grid-area: duration;
    text-align: right;
}

.voice-preview-toggle {
    grid-area: play;
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    color: #dcfbff;
    background: linear-gradient(155deg, rgba(17, 134, 163, .96), rgba(7, 71, 99, .98));
    border-color: rgba(79, 222, 247, .48);
    border-radius: 9px;
    box-shadow: 0 0 14px rgba(32, 216, 255, .14);
}

.voice-preview-player button.voice-preview-toggle:hover,
.voice-preview-player button.voice-preview-toggle:focus-visible,
.voice-preview-player button.voice-preview-toggle:active,
.voice-preview-toggle.is-playing {
    color: #fff;
    background: linear-gradient(155deg, rgba(26, 174, 202, .98), rgba(7, 89, 119, .98));
    border-color: rgba(103, 235, 255, .7);
}

.voice-preview-toggle svg {
    width: 21px;
    height: 21px;
}

.voice-preview-pause {
    display: none;
}

.voice-preview-toggle.is-playing .voice-preview-play {
    display: none;
}

.voice-preview-toggle.is-playing .voice-preview-pause {
    display: block;
}

.voice-preview-player input[type="range"] {
    --voice-progress: 0%;
    grid-area: seek;
    width: 100%;
    height: 4px;
    margin: 0;
    padding: 0;
    appearance: none;
    background: linear-gradient(
        to right,
        #35dff8 0,
        #35dff8 var(--voice-progress),
        rgba(111, 151, 169, .34) var(--voice-progress),
        rgba(111, 151, 169, .34) 100%
    );
    border: 0;
    border-radius: 999px;
}

.voice-preview-player input[type="range"]::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    appearance: none;
    background: #57e9ff;
    border: 2px solid #0a3c51;
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(53, 223, 248, .48);
}

.voice-preview-player input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: #57e9ff;
    border: 2px solid #0a3c51;
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(53, 223, 248, .48);
}

.voice-recorder-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.voice-delete,
.voice-approve {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    color: #ff9bab;
    background: rgba(99, 20, 39, .22);
    border-color: rgba(255, 83, 110, .3);
    border-radius: 8px;
}

.voice-approve {
    color: #eaffff;
    background: linear-gradient(155deg, rgba(13, 130, 153, .94), rgba(6, 76, 101, .98));
    border-color: rgba(72, 216, 241, .48);
}

.voice-delete svg,
.voice-approve svg {
    width: 16px;
    height: 16px;
}

.voice-delete[hidden],
.voice-approve[hidden] {
    display: none;
}

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

.quick-button {
    min-height: 142px;
    height: auto;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    align-items: start;
    justify-items: start;
    gap: 8px;
    padding: 18px;
    text-align: left;
    background: var(--control-surface);
    border-color: var(--control-border);
    border-radius: var(--control-radius);
}

.quick-button::before,
.quick-slider::before {
    display: none;
}

.quick-button h3 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
}

.quick-button span:last-child {
    grid-column: 1;
    color: #9aabb8;
    font-size: 13px;
}

.quick-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c8d4dc;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
}

.quick-state .quick-led,
.quick-slider-title em .quick-led {
    width: 12px;
    height: 12px;
    min-width: 12px;
    flex: 0 0 12px;
    aspect-ratio: 1;
}

.quick-state span:last-child {
    color: inherit;
}

.quick-button.on {
    border-color: rgba(94, 226, 63, .48);
    background:
        radial-gradient(circle at 12% 0%, rgba(94, 226, 63, .12), transparent 38%),
        linear-gradient(180deg, rgba(13, 55, 43, .92), rgba(7, 35, 29, .96));
}

.quick-button.action-quick {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 12% 0%, rgba(32, 216, 255, .14), transparent 38%),
        var(--surface);
}

.quick-led {
    width: 12px;
    height: 12px;
    min-width: 12px;
    flex: 0 0 12px;
    aspect-ratio: 1;
}

.quick-slider {
    --pwm-color: var(--accent);
    --pwm-glow: var(--accent-soft);
    min-height: 142px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    align-items: start;
    gap: 8px;
    padding: 18px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.pwm-light {
    --pwm-color: var(--warning);
    --pwm-glow: rgba(255, 210, 38, .2);
}

.pwm-fan,
.pwm-generic {
    --pwm-color: var(--accent);
    --pwm-glow: var(--accent-soft);
}

.quick-slider > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
}

.quick-slider-title {
    display: grid;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.quick-slider-title em {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c8d4dc;
    font-style: normal;
    font-size: 14px;
    line-height: 1.25;
}

.quick-slider h3 {
    font-size: 16px;
    font-weight: 500;
    color: #edf7fb;
    line-height: 1.25;
}

.quick-slider span {
    color: inherit;
}

.quick-slider-title em span:last-child {
    color: #c8d4dc;
}

.quick-slider b {
    color: #54c7f0;
    font-size: 34px;
    line-height: 1;
}

.range-shell {
    display: grid;
    gap: 0;
}

.quick-slider > .range-shell {
    grid-column: 1;
    display: grid;
    align-items: stretch;
    justify-content: normal;
    gap: 0;
}

.pwm-preset-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(95, 184, 220, .12);
}

.pwm-preset-row > span {
    color: #8fb8ca;
    font-size: 12px;
}

.pwm-preset-row button {
    width: auto;
    min-width: 92px;
    min-height: 32px;
    height: 32px;
    padding: 0 12px;
    color: var(--pwm-color);
    border-color: color-mix(in srgb, var(--pwm-color) 42%, transparent);
    border-radius: var(--control-radius);
    box-shadow: none;
    font-size: 12px;
}

.quick-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 48px;
    margin: 4px 0 0;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.quick-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -10px;
    border: 0;
    border-radius: 50%;
    background: var(--pwm-color);
    box-shadow: 0 0 0 5px var(--pwm-glow), 0 4px 12px rgba(0, 0, 0, .35);
}

.quick-slider input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: var(--pwm-color);
    box-shadow: 0 0 0 5px var(--pwm-glow), 0 4px 12px rgba(0, 0, 0, .35);
}

.quick-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pwm-color) 0 var(--range-percent, 0%), #52606d var(--range-percent, 0%) 100%);
    box-shadow: inset 0 0 0 1px rgba(229, 236, 241, .22);
}

.quick-slider input[type="range"]::-moz-range-track {
    height: 10px;
    border-radius: 999px;
    background: #52606d;
    box-shadow: inset 0 0 0 1px rgba(229, 236, 241, .22);
}

.quick-slider input[type="range"]::-moz-range-progress,
.pwm-control input[type="range"]::-moz-range-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--pwm-color);
}

.pwm-control input[type="range"]::-moz-range-progress {
    height: 8px;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 1px;
    color: #9ab2c0;
    font-size: 12px;
    line-height: 1.1;
}

.range-scale span {
    color: #9ab2c0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    --metric-color: #54d5ff;
    --metric-glow: rgba(84, 213, 255, .16);
    position: relative;
    display: grid;
    align-content: space-between;
    min-width: 0;
    min-height: 142px;
    overflow: hidden;
    padding: 14px;
    background:
        radial-gradient(circle at 88% 8%, var(--metric-glow), transparent 42%),
        linear-gradient(155deg, rgba(10, 39, 60, .96), rgba(3, 20, 35, .98));
    border: 1px solid rgba(84, 171, 207, .24);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .035),
        0 12px 28px rgba(0, 0, 0, .12);
}

.metric-hum {
    --metric-color: #5ae0c2;
    --metric-glow: rgba(90, 224, 194, .15);
}

.metric-press {
    --metric-color: #ffd75a;
    --metric-glow: rgba(255, 215, 90, .14);
}

.metric-top {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.metric-icon {
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    color: var(--metric-color);
    background: color-mix(in srgb, var(--metric-color) 10%, rgba(5, 25, 41, .9));
    border: 1px solid color-mix(in srgb, var(--metric-color) 28%, transparent);
    border-radius: 11px;
    box-shadow: 0 0 18px var(--metric-glow);
}

.metric-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric-name {
    overflow: hidden;
    color: #b8d4e0;
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-reading {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    margin-top: 12px;
}

.metric-reading strong {
    color: var(--metric-color);
    font-size: clamp(29px, 4vw, 38px);
    font-weight: 500;
    letter-spacing: -.04em;
    line-height: 1;
    text-shadow: 0 0 22px var(--metric-glow);
}

.metric-reading em {
    min-width: 0;
    color: #91b1c0;
    font-size: 12px;
    font-style: normal;
    line-height: 1.25;
}

.metric > small {
    margin-top: 8px;
    color: #688ea2;
    font-size: 11px;
    line-height: 1.2;
}

.scene-pills {
    display: grid;
    gap: 12px;
}

.scene-pill {
    --scene-color: #54d6f0;
    position: relative;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    overflow: hidden;
    padding: 15px 16px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--scene-color) 8%, transparent), transparent 38%),
        linear-gradient(150deg, rgba(10, 40, 61, .94), rgba(4, 23, 39, .98));
    border: 1px solid rgba(79, 152, 187, .22);
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
    cursor: pointer;
    transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.scene-pill:hover {
    border-color: color-mix(in srgb, var(--scene-color) 44%, transparent);
    transform: translateY(-1px);
}

.scene-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    color: var(--scene-color);
    background: color-mix(in srgb, var(--scene-color) 10%, rgba(5, 25, 41, .9));
    border: 1px solid color-mix(in srgb, var(--scene-color) 30%, transparent);
    border-radius: 14px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--scene-color) 14%, transparent);
    font-size: 22px;
}

.scene-copy {
    min-width: 0;
}

.scene-copy > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scene-pill h3 {
    min-width: 0;
    overflow: hidden;
    color: #f2f7fb;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-copy p {
    margin: 8px 0 0;
    overflow: hidden;
    color: #7faabd;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-copy p b {
    color: #456f83;
    font-weight: 400;
}

.scene-copy p em {
    color: inherit;
    font-style: normal;
}

.scene-copy p em.is-live,
.scene-pill.is-running .scene-copy p em {
    color: #73ef98;
    font-weight: 500;
    text-shadow: 0 0 12px rgba(94, 226, 63, .28);
}

.scene-status {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    color: #89afc0;
    font-size: 11px;
    white-space: nowrap;
}

.scene-status i {
    width: 6px;
    height: 6px;
    background: #607d8b;
    border-radius: 50%;
}

.scene-pill.is-enabled .scene-status i,
.scene-pill.is-running .scene-status i {
    background: #5ee23f;
    box-shadow: 0 0 9px rgba(94, 226, 63, .55);
}

.scene-pill.is-running {
    background:
        radial-gradient(circle at 100% 0%, rgba(94, 226, 63, .16), transparent 42%),
        linear-gradient(150deg, rgba(9, 52, 49, .96), rgba(4, 27, 40, .99));
    border-color: rgba(94, 226, 63, .58);
    box-shadow:
        inset 0 0 0 1px rgba(94, 226, 63, .08),
        0 0 24px rgba(94, 226, 63, .08);
}

.scene-pill.is-disabled {
    opacity: 1;
    filter: none;
    background: linear-gradient(150deg, rgba(20, 42, 54, .96), rgba(8, 26, 37, .98));
    border-color: rgba(132, 158, 170, .36);
    box-shadow: none;
}

.scene-pill.is-disabled::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    background: #718993;
    border-radius: 0 4px 4px 0;
}

.scene-pill.is-disabled:hover {
    border-color: rgba(154, 180, 191, .52);
}

.scene-pill.is-disabled .scene-icon {
    color: #91a7b0;
    background: rgba(100, 126, 137, .13);
    border-color: rgba(137, 164, 175, .3);
    box-shadow: none;
}

.scene-pill.is-disabled h3,
.scene-pill.is-disabled .scene-copy p,
.scene-pill.is-disabled .scene-arrow {
    color: #8fa5ae;
}

.scene-pill.is-disabled h3 {
    color: #c0ccd1;
}

.scene-pill.is-disabled .scene-copy p {
    color: #8da3ad;
}

.scene-arrow {
    color: #5c879a;
    font-size: 24px;
    line-height: 1;
}

.loading,
.empty-state {
    padding: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #9aabb8;
}

.section-stack {
    display: grid;
    gap: 14px;
}

.onboarding-empty {
    display: grid;
    justify-items: start;
    gap: 12px;
    padding: 24px;
    background:
        radial-gradient(circle at 88% 0%, rgba(32, 216, 255, .13), transparent 38%),
        linear-gradient(155deg, rgba(9, 48, 72, .98), rgba(4, 25, 42, .99));
    border: 1px solid rgba(67, 167, 207, .38);
    border-radius: var(--control-radius);
}

.onboarding-empty-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: #55e4ff;
    background: rgba(7, 43, 64, .86);
    border: 1px solid rgba(58, 196, 231, .42);
    border-radius: 12px;
}

.onboarding-empty-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.onboarding-empty h2,
.onboarding-empty p {
    margin: 0;
}

.onboarding-empty p {
    max-width: 580px;
    color: #8fc4d9;
    line-height: 1.5;
}

.onboarding-empty > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.places-screen,
.place-detail {
    display: grid;
    gap: 14px;
}

.places-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.places-intro h2,
.places-intro p {
    margin: 0;
}

.places-intro h2 {
    font-size: 20px;
    font-weight: 500;
}

.places-intro p {
    margin-top: 5px;
    color: #86bdd4;
    line-height: 1.45;
}

.places-intro > span {
    flex: 0 0 auto;
    padding: 6px 10px;
    color: #8deaff;
    background: rgba(10, 49, 70, .8);
    border: 1px solid rgba(57, 157, 196, .34);
    border-radius: 8px;
    font-size: 13px;
}

.places-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 11px;
}

.place-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 12px;
    min-height: 94px;
    padding: 14px;
    color: #edfaff;
    text-align: left;
    background: linear-gradient(145deg, rgba(8, 47, 70, .98), rgba(4, 28, 46, .99));
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--place-color) 16%, transparent), transparent 46%),
        linear-gradient(145deg, rgba(8, 47, 70, .98), rgba(4, 28, 46, .99));
    border: 1px solid rgba(48, 117, 151, .54);
    border-color: color-mix(in srgb, var(--place-color) 48%, rgba(48, 117, 151, .54));
    border-radius: var(--control-radius);
}

.place-card:hover,
.place-card:focus-visible {
    border-color: var(--place-color);
    transform: translateY(-1px);
}

.place-card.child {
    min-height: 86px;
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--place-color) 10%, transparent), transparent 42%),
        linear-gradient(145deg, rgba(6, 37, 56, .96), rgba(3, 24, 40, .99));
}

.place-card-icon,
.place-editor-head > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--place-color, #55e4ff);
    background: rgba(3, 28, 45, .82);
    border: 1px solid currentColor;
    border-radius: 11px;
}

.place-card-icon svg,
.place-editor-head svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.place-card-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.place-card-copy strong {
    overflow: hidden;
    font-size: 17px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-card-copy small,
.place-card-copy em {
    overflow: hidden;
    color: #88b8cc;
    font-size: 12px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-card-copy em {
    color: #5fd2ed;
}

.place-card-count {
    display: grid;
    justify-items: center;
    color: #dff9ff;
    font-size: 18px;
    font-weight: 500;
}

.place-card-count small {
    color: #6fa3b9;
    font-size: 10px;
    font-weight: 400;
}

.place-card-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #5facc5;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.place-editor-card {
    padding: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .06), transparent 34%),
        linear-gradient(150deg, rgba(7, 39, 59, .94), rgba(3, 25, 42, .98));
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.place-equipment {
    display: grid;
    gap: 12px;
}

.place-equipment-head h2,
.place-equipment-head p {
    margin: 0;
}

.place-equipment-head h2 {
    color: #eefaff;
    font-size: 20px;
    font-weight: 500;
}

.place-equipment-head p {
    margin-top: 4px;
    color: #78adc3;
    font-size: 13px;
}

.context-page-head {
    display: grid;
    gap: 7px;
}

.context-page-head > p {
    margin: 0;
    color: #78b9d0;
    font-size: 12px;
    letter-spacing: .02em;
}

.context-page-toolbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.context-page-head.has-actions .context-page-toolbar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
}

.context-page-head h1 {
    overflow: hidden;
    margin: 0;
    color: #f2fbff;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 500;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-detail-mode .content-head {
    display: none;
}

.place-children-mode .content-head {
    display: none;
}

.device-detail-mode .content-head {
    display: none;
}

.context-page-actions {
    display: flex;
    gap: 8px;
}

.context-page-actions button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #72e5ff;
    background: rgba(3, 28, 45, .86);
    border: 1px solid rgba(61, 157, 194, .56);
    border-radius: var(--control-radius);
}

.device-claim-screen {
    display: grid;
    gap: 14px;
}

.device-claim-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .09), transparent 34%),
        var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.device-claim-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
}

.device-claim-head > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #55e4ff;
    background: rgba(3, 28, 45, .82);
    border: 1px solid rgba(32, 216, 255, .46);
    border-radius: 11px;
}

.device-claim-head svg {
    width: 26px;
    height: 26px;
}

.device-claim-head small,
.device-claim-head h2,
.device-claim-head p {
    display: block;
    margin: 0;
}

.device-claim-head small {
    color: #6fc6e0;
    font-size: 12px;
}

.device-claim-head h2 {
    margin-top: 3px;
    font-size: 22px;
    font-weight: 500;
}

.device-claim-head p {
    margin-top: 5px;
    color: #86bdd4;
    line-height: 1.4;
}

.device-claim-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.device-claim-form label {
    display: grid;
    gap: 7px;
    color: #83bdd3;
    font-size: 13px;
}

.device-claim-form label:first-child,
.device-claim-actions,
.device-claim-form .form-result {
    grid-column: 1 / -1;
}

.device-claim-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.context-page-actions svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.onboarding-empty.compact {
    min-height: 230px;
}

.place-editor-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 17px;
}

.place-editor-head small {
    color: #6fc6e0;
}

.place-editor-head h2 {
    margin: 3px 0 0;
    font-size: 22px;
    font-weight: 500;
}

.place-editor-form,
.device-details-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.place-editor-form label,
.device-details-form label {
    display: grid;
    gap: 7px;
    color: #83bdd3;
    font-size: 13px;
}

.place-editor-form input:not([type="color"]),
.place-editor-form select,
.device-claim-form input,
.device-claim-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #e7f8ff;
    font: inherit;
    background: rgba(2, 18, 31, .88);
    border: 1px solid rgba(71, 151, 187, .4);
    border-radius: 10px;
    outline: none;
}

.place-editor-form input:focus,
.place-editor-form select:focus,
.device-claim-form input:focus,
.device-claim-form select:focus {
    border-color: rgba(32, 216, 255, .7);
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .08);
}

.place-editor-form input[type="color"] {
    width: 68px;
    height: 44px;
    padding: 4px;
    background: rgba(2, 18, 31, .88);
    border: 1px solid rgba(71, 151, 187, .4);
    border-radius: 10px;
}

.place-editor-form .wide {
    grid-column: 1 / -1;
}

.place-timezone-inherited {
    display: grid;
    grid-column: 1 / -1;
    gap: 7px;
    padding: 13px 14px;
    color: #83bdd3;
    background: rgba(5, 31, 48, .72);
    border: 1px solid rgba(54, 124, 153, .35);
    border-radius: 9px;
    font-size: 13px;
}

.place-timezone-inherited strong {
    color: #dff7ff;
    font-weight: 500;
}

.place-timezone-field[hidden],
.place-timezone-inherited[hidden] {
    display: none !important;
}

.place-editor-form label > small {
    color: #648da0;
    line-height: 1.4;
}

.place-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-details-form {
    align-items: end;
    padding: 15px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.device-details-form button {
    justify-self: start;
}

.device-details-form .form-result {
    align-self: center;
}

.section-stack h2 {
    margin-top: 6px;
    font-size: 18px;
}

.mobile-product-screen {
    display: grid;
    gap: 12px;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(32, 216, 255, .13), transparent 38%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
}

.mobile-screen-top {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    min-height: 44px;
}

.mobile-screen-top h2 {
    margin: 0;
    color: #edf7fb;
    font-size: 22px;
    font-weight: 500;
    text-align: center;
}

.mobile-screen-top button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    color: #9feaff;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 30px;
}

.schedule-tabs,
.settings-device-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.schedule-tabs button,
.settings-device-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    color: #bdd4e2;
    background: var(--surface-field);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-tabs button.active,
.settings-device-tabs button.active {
    color: #e9fbff;
    background:
        radial-gradient(circle at 50% 100%, rgba(84, 214, 240, .18), transparent 45%),
        rgba(23, 69, 106, .92);
}

.schedule-tabs span {
    color: #2dd8f0;
    font-size: 18px;
}

.schedule-tabs em {
    min-width: 18px;
    color: #71eaff;
    font-size: 12px;
    font-style: normal;
}

.schedule-list,
.settings-groups {
    display: grid;
    gap: 8px;
}

.schedule-card,
.schedule-general,
.settings-group {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

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

.schedule-card-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.schedule-card-head span:first-child {
    color: #27d5ee;
    font-size: 23px;
}

.schedule-card h3,
.schedule-general h3,
.settings-group h3 {
    margin: 0;
    color: #edf7fb;
    font-size: 17px;
    font-weight: 400;
}

.schedule-card h3 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-switch {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    cursor: pointer;
}

.ui-switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.ios-switch,
.ui-switch-track {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #405066;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .35);
    transition: background .22s ease, box-shadow .22s ease;
}

.ios-switch i,
.ui-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #eef4f8;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .28);
    transition: left .22s ease, transform .22s ease, background .22s ease;
}

.ios-switch.on,
.ui-switch input:checked + .ui-switch-track {
    background: #26c94d;
    box-shadow: 0 0 16px rgba(38, 201, 77, .32);
}

.ios-switch.on i,
.ui-switch input:checked + .ui-switch-track::before {
    left: 21px;
}

.ui-switch input:active + .ui-switch-track::before {
    transform: scale(.92);
}

.schedule-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(120, 160, 184, .14);
}

.schedule-card-grid div {
    display: grid;
    gap: 7px;
    padding-top: 12px;
}

.schedule-card-grid div + div {
    padding-left: 18px;
    border-left: 1px solid rgba(120, 160, 184, .14);
}

.schedule-card small,
.settings-row small {
    color: #7f9eb1;
    font-size: 13px;
}

.schedule-card strong {
    color: #f6fbff;
    font-size: 24px;
    font-weight: 500;
}

.schedule-card p {
    margin: 0;
    color: #9bc7da;
    font-size: 13px;
}

.schedule-general {
    margin-top: 2px;
}

.automations-screen {
    display: grid;
    gap: 14px;
}

.automations-toolbar {
    display: block;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.automations-top,
.automation-builder-preview,
.automation-templates {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.automations-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    gap: 16px;
}

.automations-top h2,
.automation-section-head h3 {
    margin: 0;
    color: #edf7fb;
    font-size: 22px;
    font-weight: 400;
}

.automations-top p,
.automation-section-head span {
    display: block;
    margin-top: 5px;
    color: #9bc7da;
    font-size: 14px;
}

.entity-add-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: #8cecff;
    border-color: rgba(32, 216, 255, .46);
    border-radius: 11px;
    background:
        radial-gradient(circle at 50% 0%, rgba(32, 216, 255, .18), transparent 58%),
        linear-gradient(180deg, rgba(13, 65, 88, .96), rgba(6, 38, 58, .98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 9px 22px rgba(0, 0, 0, .18);
    flex: 0 0 auto;
}

.entity-add-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.entity-add-button:hover,
.entity-add-button:focus-visible {
    color: #d8faff;
    border-color: rgba(83, 229, 255, .78);
    background:
        radial-gradient(circle at 50% 0%, rgba(32, 216, 255, .26), transparent 62%),
        linear-gradient(180deg, rgba(15, 78, 103, .98), rgba(7, 45, 67, .98));
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .1), 0 10px 24px rgba(0, 0, 0, .22);
}

.automation-tabs {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.automation-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
    color: #d8edf7;
}

.automation-tabs button.active,
.automation-tabs button:hover {
    border-color: var(--border-active);
}

.automation-tabs i {
    color: var(--automation-color, var(--accent));
    font-style: normal;
}

.automation-tabs em {
    min-width: 20px;
    padding: 1px 6px;
    color: #7ee7ff;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-style: normal;
    text-align: center;
}

.automations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.actions-screen {
    display: grid;
    gap: 14px;
}

.actions-toolbar {
    display: flex;
    justify-content: flex-end;
}

.section-add-button {
    flex: 0 0 auto;
}

.section-add-button[hidden] {
    display: none;
}

.actions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.action-card {
    display: grid;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.action-card:hover {
    border-color: var(--border-active);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.action-card.ack-wait,
.action-quick.ack-wait {
    border-color: rgba(255, 212, 112, .48);
}

.action-card.ack-ok .action-dot,
.action-quick.ack-ok .action-dot {
    animation: actionAckOk .78s ease-out 1;
}

.action-card.ack-fail .action-dot,
.action-quick.ack-fail .action-dot {
    background: var(--danger);
    border-color: rgba(210, 15, 55, .95);
    box-shadow: 0 0 18px rgba(210, 15, 55, .7);
    animation: actionAckFail .95s ease-in-out 1;
}

.action-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.action-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.action-dot {
    width: 13px;
    min-width: 13px;
    height: 13px;
    background: #536979;
    border: 1px solid rgba(196, 220, 232, .22);
    border-radius: 50%;
}

.action-dot.on {
    background: var(--success);
    border-color: rgba(94, 226, 63, .8);
    box-shadow: 0 0 16px rgba(49, 216, 121, .52);
}

@keyframes actionAckOk {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 14px rgba(49, 216, 121, .48);
    }

    35%,
    72% {
        transform: scale(1.38);
        box-shadow: 0 0 30px rgba(49, 216, 121, .95);
    }
}

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

    12%,
    42% {
        opacity: 1;
        transform: scale(1.36);
        box-shadow: 0 0 28px rgba(210, 15, 55, .95);
    }

    26%,
    56% {
        opacity: .24;
        transform: scale(.88);
    }
}

.action-title h3 {
    margin: 0;
    color: #f2fbff;
    font-size: 18px;
    font-weight: 400;
}

.action-title p {
    margin: 6px 0 0;
    color: #a6cfe0;
    font-size: 14px;
    line-height: 1.35;
}

.action-title .action-state {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.action-flow div {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.action-flow small,
.action-card-footer span {
    color: #7f9eb1;
    font-size: 12px;
}

.action-flow h3 {
    color: #eaf8ff;
    font-size: 15px;
    font-weight: 400;
}

.action-flow span {
    color: #9bc7da;
    font-size: 13px;
}

.action-flow i {
    display: grid;
    place-items: center;
    color: var(--accent);
    font-style: normal;
    font-size: 22px;
}

.action-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 2px;
}

.action-v2-targets {
    display: grid;
    gap: 6px;
    margin: 2px 0 0;
}

.action-v2-target-row {
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    color: #dff7ff;
    font-size: 14px;
    line-height: 1.25;
}

.action-v2-target-row strong {
    overflow: hidden;
    color: #f3fbff;
    font-size: 14px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-v2-target-row small {
    color: #83c5dd;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.action-v2-run-state {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding-top: 8px;
    color: #8fb8ca;
    border-top: 1px solid rgba(95, 184, 220, .12);
    font-size: 12px;
}

.action-run-status-dot {
    width: 7px;
    height: 7px;
    background: #617d8c;
    border-radius: 50%;
}

.action-v2-run-state[data-run-status="ack"] .action-run-status-dot {
    background: #65df4a;
    box-shadow: 0 0 9px rgba(101, 223, 74, .55);
}

.action-v2-run-state[data-run-status="error"] .action-run-status-dot,
.action-v2-run-state[data-run-status="partial"] .action-run-status-dot,
.action-v2-run-state[data-run-status="timeout"] .action-run-status-dot {
    background: #ff6f7f;
}

.action-run-button {
    width: auto;
    min-width: 116px;
}

.action-edit-button {
    width: auto;
    min-width: 116px;
}

.action-edit-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.action-dashboard-link {
    margin-left: auto;
    padding: 6px 0;
    color: rgba(158, 208, 230, .48);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
}

.action-dashboard-link.is-visible {
    color: #bcecff;
}

.action-dashboard-link.is-saving {
    opacity: .72;
}

.action-dashboard-link:hover,
.action-dashboard-link:focus-visible {
    color: var(--accent);
    background: transparent;
    box-shadow: none;
}

.action-editor-summary {
    margin: 0;
    padding: 12px;
    color: #9ed0e6;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.35;
}

.action-name-block .automation-description input {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    color: #edf7fb;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
}

.action-pult-grid {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
}

.action-save-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.action-delete-button {
    width: 100%;
    min-height: 46px;
}

.action-editor {
    display: grid;
    gap: 14px;
}

.automation-card {
    display: grid;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.automation-card:hover {
    border-color: var(--border-active);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.automation-card.is-enabled {
    border-color: var(--border-active);
}

.automation-card.is-running {
    border-color: rgba(92, 240, 128, .68);
    box-shadow:
        inset 0 0 0 1px rgba(92, 240, 128, .12),
        0 0 28px rgba(92, 240, 128, .08);
}

.automation-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.automation-switch {
    min-width: 0;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

.automation-switch:hover,
.automation-switch:active {
    background: transparent;
    box-shadow: none;
}

.automation-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.automation-title > span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--automation-color, var(--accent));
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    font-size: 21px;
}

.automation-title h3,
.automation-template-card h4,
.automation-step-card h4 {
    margin: 0;
    color: #f2fbff;
    font-size: 17px;
    font-weight: 400;
}

.automation-title p {
    margin: 3px 0 0;
    color: #94b6c8;
    font-size: 13px;
}

.automation-card-grid {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(120, 160, 184, .12);
}

.automation-card-flow {
    display: grid;
    border-top: 1px solid rgba(120, 160, 184, .12);
}

.automation-card-step {
    display: grid;
    gap: 5px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(120, 160, 184, .12);
}

.automation-card-step > span {
    color: #7f9eb1;
    font-size: 12px;
}

.automation-card-step > strong {
    color: #eaf8ff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.automation-card-step > small {
    color: #87aabd;
    font-size: 12px;
}

.automation-card-if ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.automation-card-if li {
    position: relative;
    padding-left: 14px;
    color: #c7dce8;
    font-size: 13px;
    line-height: 1.35;
}

.automation-card-if li::before {
    content: "";
    position: absolute;
    top: .55em;
    left: 0;
    width: 5px;
    height: 5px;
    background: var(--automation-color, var(--accent));
    border-radius: 50%;
}

.automation-card-grid div,
.automation-action-line {
    display: grid;
    gap: 5px;
}

.automation-card-grid small,
.automation-action-line span,
.automation-summary small {
    color: #7f9eb1;
    font-size: 12px;
}

.automation-card-grid h3,
.automation-action-line h3 {
    color: #eaf8ff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
}

.automation-runtime {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 11px;
    color: #b7d3e2;
    background: rgba(2, 22, 36, .54);
    border: 1px solid rgba(78, 145, 176, .2);
    border-radius: 9px;
    font-size: 13px;
}

.automation-runtime .lamp {
    width: 12px;
    height: 12px;
}

.automation-runtime strong {
    color: #dff7ff;
    font-weight: 400;
}

.automation-runtime small {
    margin-left: auto;
    color: #7f9eb1;
}

.automation-card.is-running .automation-runtime {
    color: #caffd5;
    background: linear-gradient(135deg, rgba(15, 82, 60, .58), rgba(3, 35, 39, .72));
    border-color: rgba(94, 226, 63, .42);
    box-shadow: inset 0 0 18px rgba(94, 226, 63, .04);
}

.automation-card.is-running .automation-runtime strong {
    color: #73ef98;
    font-weight: 500;
}

.automation-summary {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.automation-summary ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.automation-summary li {
    position: relative;
    padding-left: 14px;
    color: #c7dce8;
    font-size: 13px;
}

.automation-summary li::before {
    content: "";
    position: absolute;
    top: .58em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--automation-color, var(--accent));
}

.automation-error {
    padding: 8px 10px;
    color: #ffd7df;
    background: rgba(210, 15, 55, .13);
    border: 1px solid rgba(210, 15, 55, .32);
    border-radius: 9px;
    font-size: 13px;
}

.automation-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.automation-step-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.automation-step-card,
.automation-template-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.automation-step-card > span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #062011;
    background: linear-gradient(180deg, #83e94c, var(--success));
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
}

.automation-step-card p,
.automation-template-card p {
    margin: 0;
    color: #9ebacc;
    font-size: 13px;
    line-height: 1.35;
}

.automation-templates-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.button-soft {
    justify-self: start;
    min-height: 34px;
}

.automation-editor {
    display: grid;
    gap: 14px;
    width: min(100%, 980px);
    margin: 0 auto;
}

.automation-editor-top {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 48px;
}

.automation-editor-top.compact {
    grid-template-columns: 44px minmax(0, 1fr);
}

.automation-editor-top h2 {
    margin: 0;
    color: #edf7fb;
    font-size: 22px;
    font-weight: 400;
    justify-self: start;
    text-align: left;

    margin-left: 16px;
}

.automation-editor-top button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    color: #dff7ff;
    background: var(--surface-soft);
    border-radius: 12px;
    font-size: 24px;
}

.automation-edit-form {
    display: grid;
    gap: 14px;
}

.automation-active-row,
.automation-editor-block {
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.automation-active-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    transition: border-color .2s ease, background .2s ease;
}

.automation-active-row h3 {
    margin: 0;
    color: #edf7fb;
    font-size: 16px;
    font-weight: 500;
}

.automation-active-row.is-enabled {
    border-color: rgba(72, 218, 133, .3);
}

.automation-active-row.is-disabled {
    border-color: rgba(116, 151, 171, .22);
    background: linear-gradient(180deg, rgba(10, 38, 59, .82), rgba(5, 23, 39, .9));
}

.automation-active-row.is-disabled h3 {
    color: #9db3bf;
}

.automation-active-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.automation-active-copy p {
    margin: 0;
    color: #7f9eae;
    font-size: 12px;
    line-height: 1.35;
}

.automation-editor-block {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.automation-edit-form [hidden] {
    display: none !important;
}

.automation-editor-block h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    color: #edf7fb;
    font-size: 20px;
    font-weight: 400;
}

.automation-editor-block h3 small {
    color: #86a9bc;
    font-size: 13px;
    font-weight: 400;
}

.automation-field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.automation-field-grid label,
.automation-local-toggle,
.automation-description,
.automation-inline-select,
.automation-edit-row label {
    display: grid;
    gap: 6px;
}

.automation-field-grid span,
.automation-local-toggle span,
.automation-description span,
.automation-inline-select span,
.automation-edit-row span {
    color: #8cb3c8;
    font-size: 12px;
}

.automation-field-grid input,
.automation-field-grid select,
.automation-description input,
.automation-description textarea,
.automation-inline-select select,
.automation-edit-row input,
.automation-edit-row select {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    color: #edf7fb;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
    font-size: 14px;
}

.automation-edit-form input:-webkit-autofill,
.automation-edit-form input:-webkit-autofill:hover,
.automation-edit-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #edf7fb;
    box-shadow: 0 0 0 1000px #041321 inset;
    caret-color: #edf7fb;
}

.action-target-value-field {
    position: relative;
}

.action-target-value-field[data-pwm-value]::after {
    content: attr(data-pwm-value);
    position: absolute;
    right: 10px;
    bottom: 12px;
    color: #62d7ff;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.automation-edit-row input.action-target-pwm-range {
    min-height: 42px;
    padding: 0;
    background: linear-gradient(
        90deg,
        #56d7ff 0,
        #56d7ff var(--range-percent, 0%),
        rgba(132, 151, 165, .72) var(--range-percent, 0%),
        rgba(132, 151, 165, .72) 100%
    );
    background-size: 100% 6px;
    background-position: center;
    background-repeat: no-repeat;
    border-color: transparent;
    border-radius: 999px;
    appearance: none;
}

.automation-edit-row input.action-target-pwm-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    background: #56d7ff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(86, 215, 255, .16);
    appearance: none;
}

.automation-edit-row input.action-target-pwm-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #56d7ff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(86, 215, 255, .16);
}

.automation-field-grid label:focus-within,
.automation-edit-row label:focus-within,
.automation-inline-select:focus-within,
.automation-description:focus-within {
    border-color: var(--border-active);
}

.automation-description textarea {
    min-height: 84px;
    resize: vertical;
}

.automation-inline-select {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    align-items: center;
}

.automation-days-field {
    display: grid;
    grid-column: 1 / -1;
    align-content: start;
    gap: 9px;
}

.automation-days-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #8fc4db;
    font-size: 13px;
}

.automation-all-days {
    min-height: 0;
    padding: 2px 0;
    color: #75cde9;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 13px;
}

.automation-all-days:hover,
.automation-all-days:focus-visible,
.automation-all-days.active {
    color: #c8f7ff;
    background: transparent;
    border-bottom-color: rgba(85, 220, 255, .68);
    box-shadow: none;
}

.automation-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 6px;
}

.automation-days button {
    min-width: 0;
    min-height: 42px;
    padding: 0;
    color: #a8c9d8;
    border-color: rgba(61, 146, 183, .44);
    background: rgba(2, 23, 39, .78);
    border-radius: 9px;
}

.automation-days button.active {
    color: #ffffff;
    border-color: rgba(91, 242, 88, .94);
    background:
        radial-gradient(circle at 50% 0%, rgba(91, 242, 88, .3), transparent 68%),
        linear-gradient(180deg, rgba(16, 84, 57, .96), rgba(5, 45, 41, .98));
    box-shadow: inset 0 0 0 1px rgba(125, 255, 125, .12), 0 0 14px rgba(65, 231, 91, .14);
}

.automation-editor-block[hidden] {
    display: none !important;
}

@media (max-width: 620px) {
    .places-grid,
    .place-editor-form,
    .device-details-form {
        grid-template-columns: 1fr;
    }

    .place-editor-form .wide {
        grid-column: auto;
    }

    .place-card {
        grid-template-columns: 44px minmax(0, 1fr) 22px;
        gap: 10px;
        padding: 12px;
    }

    .place-card-count {
        display: none;
    }

    .place-card-icon {
        width: 44px;
        height: 44px;
    }

    .automation-days {
        gap: 5px;
    }

    .automation-days button {
        min-height: 40px;
        font-size: 12px;
    }
}

.automation-edit-list {
    display: grid;
    gap: 10px;
}

.automation-edit-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) repeat(4, minmax(92px, 1fr));
    gap: 10px;
    padding: 12px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.automation-action-edit-row {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
}

.automation-ready-action-field {
    min-width: 0;
}

.action-editor-note,
.action-usage-note {
    margin: 0;
    padding: 10px 12px;
    color: #9fc7d8;
    background: rgba(18, 67, 91, .28);
    border: 1px solid rgba(91, 186, 224, .18);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.action-usage-note {
    color: #a9eb91;
    border-color: rgba(94, 225, 76, .2);
}

.automation-condition-edit-row {
    grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(84px, .6fr) minmax(96px, .7fr) auto;
}

.action-target-edit-row {
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(110px, .7fr) minmax(105px, .55fr) minmax(115px, .65fr) auto;
}

.automation-add-line {
    justify-self: stretch;
    color: #86e44c;
    border-color: rgba(92, 200, 47, .32);
}

.automation-delete-line {
    align-self: end;
    min-width: 92px;
    color: #ffd8df;
    border-color: rgba(210, 15, 55, .42);
    background:
        radial-gradient(circle at 50% 0%, var(--danger-soft), transparent 58%),
        var(--surface);
}

.automation-local-toggle {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.automation-save-row {
    position: static;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.action-runs-list {
    display: grid;
    gap: 10px;
}

.action-run-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 10px;
    overflow: hidden;
    padding: 12px 14px 12px 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .08), transparent 38%),
        var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: 12px;
}

.action-run-row::before,
.automation-log-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #607f90;
}

.action-run-row.status-ack::before,
.action-run-row.status-done::before,
.action-run-row.status-success::before,
.automation-log-row.status-finished::before,
.automation-log-row.status-ack::before,
.automation-log-row.status-done::before,
.automation-log-row.status-success::before {
    background: #5ee23f;
    box-shadow: 0 0 14px rgba(94, 226, 63, .42);
}

.action-run-row.status-running::before,
.action-run-row.status-active::before,
.automation-log-row.status-running::before,
.automation-log-row.status-active::before {
    background: #20d8ff;
    box-shadow: 0 0 14px rgba(32, 216, 255, .42);
}

.action-run-row.status-error::before,
.action-run-row.status-failed::before,
.action-run-row.status-timeout::before,
.action-run-row.status-partial::before,
.automation-log-row.status-error::before,
.automation-log-row.status-failed::before,
.automation-log-row.status-timeout::before,
.automation-log-row.status-partial::before {
    background: #ff6f7f;
    box-shadow: 0 0 14px rgba(255, 111, 127, .34);
}

.action-run-row strong {
    color: #e9f8ff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
}

.action-run-row span,
.action-run-row em {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    color: #a8def0;
    background: rgba(47, 112, 143, .16);
    border: 1px solid rgba(99, 183, 218, .18);
    border-radius: 999px;
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
}

.action-run-row em {
    color: #8eea78;
    background: rgba(64, 156, 72, .12);
    border-color: rgba(94, 226, 63, .18);
}

.action-run-row small {
    grid-column: 1 / -1;
    position: relative;
    padding-left: 14px;
    color: #a8cddd;
    font-size: 12px;
    line-height: 1.5;
}

.action-run-row small::before {
    content: "";
    position: absolute;
    top: .62em;
    left: 1px;
    width: 5px;
    height: 5px;
    background: #4dbddf;
    border-radius: 50%;
}

.automation-log-list {
    display: grid;
    gap: 10px;
}

.automation-log-row {
    position: relative;
    display: grid;
    gap: 7px;
    overflow: hidden;
    padding: 12px 14px 12px 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .08), transparent 38%),
        var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: 12px;
}

.automation-log-row.status-active {
    border-color: rgba(92, 240, 128, .44);
}

.automation-log-row.status-error {
    border-color: rgba(210, 15, 55, .44);
}

.automation-log-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.automation-log-row strong {
    color: #edf7fb;
    font-size: 13px;
    font-weight: 500;
}

.automation-log-row span,
.automation-log-row p,
.automation-log-row small {
    margin: 0;
    color: #a8cddd;
    font-size: 13px;
    line-height: 1.45;
}

.automation-log-row .run-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    color: #b9eaff;
    background: rgba(47, 112, 143, .16);
    border: 1px solid rgba(99, 183, 218, .2);
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.automation-log-row.status-finished .run-status-badge,
.automation-log-row.status-ack .run-status-badge,
.automation-log-row.status-success .run-status-badge {
    color: #a9f596;
    background: rgba(64, 156, 72, .12);
    border-color: rgba(94, 226, 63, .2);
}

.automation-log-row.status-error .run-status-badge,
.automation-log-row.status-failed .run-status-badge,
.automation-log-row.status-timeout .run-status-badge,
.automation-log-row.status-partial .run-status-badge {
    color: #ffb8c2;
    background: rgba(210, 15, 55, .12);
    border-color: rgba(255, 111, 127, .22);
}

.automation-log-row em {
    color: #ff9ead;
    font-size: 13px;
    font-style: normal;
}

.automation-save-row button {
    min-width: 180px;
}

.form-result {
    color: #9bc7da;
    font-size: 13px;
}

.form-result.ok {
    color: #5ff08c;
}

.form-result.error {
    color: #ff9ead;
}

.form-result.wait {
    color: #ffe18d;
}

.empty-state.compact {
    padding: 12px;
    min-height: 0;
}

.settings-screen {
    display: grid;
    gap: 14px;
}

.settings-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background:
        radial-gradient(circle at 0 0, rgba(32, 216, 255, .14), transparent 38%),
        linear-gradient(145deg, rgba(13, 54, 80, .94), rgba(5, 23, 39, .98));
    border: 1px solid rgba(58, 174, 218, .34);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(1, 10, 20, .2);
}

.device-passport-summary {
    grid-template-columns: minmax(0, 1fr);
}

.settings-fact-icon {
    display: grid;
    place-items: center;
    color: #45ddff;
    background: rgba(32, 216, 255, .1);
    border: 1px solid rgba(32, 216, 255, .26);
}

.settings-fact-icon svg,
.settings-truth-note svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-device-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 7px;
    margin-top: 0;
    color: #83a9bd;
    font-size: 12px;
}

.settings-device-identity strong {
    color: #cdeaf7;
    font-size: 12px;
    font-weight: 500;
}

.settings-device-identity i {
    width: 1px;
    height: 12px;
    margin: 0 4px;
    background: rgba(125, 184, 211, .28);
}

.settings-source-badge {
    min-width: 0;
}

.settings-passport-runtime {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(120px, 1fr));
    gap: 10px 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(92, 153, 186, .18);
}

.settings-passport-runtime > div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

.settings-passport-runtime span {
    color: #78a9bd;
    font-size: 10px;
}

.settings-passport-runtime strong {
    overflow: hidden;
    color: #dff8ff;
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-source-badge time {
    color: #77cde7;
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
}

.settings-device-tabs {
    display: flex;
    grid-template-columns: none;
    gap: 7px;
    padding: 7px;
    overflow-x: auto;
    background: rgba(4, 22, 37, .72);
    border: 1px solid rgba(76, 139, 181, .22);
    border-radius: 13px;
    scrollbar-width: thin;
}

.settings-device-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: 130px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 9px;
}

.settings-device-tabs button.active {
    border-color: rgba(32, 216, 255, .42);
    box-shadow: inset 0 -2px 0 #20d8ff;
}

.settings-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.settings-fact {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 92px;
    padding: 14px;
    background: linear-gradient(155deg, rgba(10, 43, 66, .92), rgba(4, 22, 38, .96));
    border: 1px solid rgba(76, 139, 181, .25);
    border-radius: 14px;
}

.settings-fact-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.settings-fact > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.settings-fact small,
.settings-fact em {
    overflow: hidden;
    color: #7fa4b8;
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-fact strong {
    overflow: hidden;
    color: #f0f9fd;
    font-size: 18px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-fact.good .settings-fact-icon,
.settings-row.good strong,
.settings-row.active strong {
    color: #58e73d;
}

.settings-fact.warn .settings-fact-icon,
.settings-row.warn strong {
    color: #ffd34d;
}

.settings-fact.bad .settings-fact-icon,
.settings-row.bad strong {
    color: #ff758e;
}

.settings-fact.unknown .settings-fact-icon,
.settings-row.muted strong,
.settings-row.empty strong {
    color: #7f9bab;
}

.settings-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
}

.settings-group {
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(8, 36, 57, .94), rgba(4, 20, 35, .97));
    border: 1px solid rgba(76, 139, 181, .25);
    border-radius: 14px;
}

.settings-group h3 {
    margin: 0;
    padding: 14px 16px 10px;
    color: #dff5fd;
    font-size: 15px;
    font-weight: 500;
}

.settings-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(120px, 1.1fr) auto;
    grid-template-areas:
        "label value arrow"
        "sub sub arrow";
    align-items: center;
    gap: 4px 12px;
    min-height: 54px;
    padding: 10px 16px;
    border-top: 1px solid rgba(120, 160, 184, .11);
}

.settings-row span {
    grid-area: label;
    color: #cfe1e9;
    font-size: 13px;
}

.settings-row strong {
    grid-area: value;
    min-width: 0;
    color: #a9c0cf;
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
    text-align: right;
}

.settings-row small {
    grid-area: sub;
    color: #6f91a4;
    font-size: 11px;
}

.settings-row em {
    grid-area: arrow;
    color: #6fa4bf;
    font-size: 22px;
    font-style: normal;
}

.settings-truth-note {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    margin: 12px;
    padding: 12px;
    color: #8fb4c7;
    background: rgba(32, 216, 255, .07);
    border: 1px solid rgba(32, 216, 255, .16);
    border-radius: 11px;
}

.settings-truth-note > span {
    display: grid;
    place-items: center;
    color: #37d8fa;
}

.settings-truth-note p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
}

.settings-truth-note strong {
    color: #dff7ff;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0 12px 12px;
}

.settings-actions button {
    min-height: 38px;
}

.equipment-list {
    display: grid;
    gap: 12px;
}

.equipment-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) minmax(80px, .35fr) minmax(190px, .8fr) 34px;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 104px;
    padding: 16px 18px;
    overflow: hidden;
    color: #dff7ff;
    text-align: left;
    background:
        radial-gradient(circle at 0 0, rgba(32, 216, 255, .11), transparent 34%),
        linear-gradient(150deg, rgba(10, 48, 73, .96), rgba(4, 22, 38, .98));
    border: 1px solid rgba(67, 157, 196, .3);
    border-radius: 15px;
    box-shadow: 0 14px 34px rgba(1, 10, 20, .16);
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.equipment-card:hover,
.equipment-card:focus-visible {
    border-color: rgba(46, 215, 250, .62);
    box-shadow: 0 18px 38px rgba(1, 10, 20, .24), inset 0 0 24px rgba(32, 216, 255, .04);
    transform: translateY(-1px);
}

.equipment-child-icon {
    display: grid;
    place-items: center;
    color: #46dcfa;
    background: rgba(32, 216, 255, .09);
    border: 1px solid rgba(32, 216, 255, .27);
}

.equipment-child-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.equipment-card-copy,
.equipment-card-runtime,
.equipment-card-meta {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.equipment-card-copy strong {
    overflow: hidden;
    color: #f2fbff;
    font-size: 18px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equipment-card-copy small,
.equipment-card-copy em,
.equipment-card-runtime small,
.equipment-card-runtime em,
.equipment-card-meta small {
    overflow: hidden;
    color: #7fa9bd;
    font-size: 12px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equipment-card-copy em {
    color: #65c9e5;
}

.equipment-card-meta {
    justify-items: center;
    padding: 8px 12px;
    border-right: 1px solid rgba(117, 167, 191, .15);
    border-left: 1px solid rgba(117, 167, 191, .15);
}

.equipment-card-meta strong {
    color: #d9f5ff;
    font-size: 22px;
    font-weight: 500;
}

.equipment-card-runtime strong {
    color: #91aeba;
    font-size: 14px;
    font-weight: 500;
}

.equipment-card.is-online .equipment-card-runtime strong {
    color: #56e87c;
}

.equipment-card-arrow,
.equipment-child-card > svg {
    display: grid;
    place-items: center;
    color: #5caac8;
}

.equipment-card-arrow svg,
.equipment-child-card > svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-hero-kicker,
.detail-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #62cfe9;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.equipment-children {
    padding: 15px;
    background: linear-gradient(155deg, rgba(9, 39, 61, .94), rgba(4, 21, 36, .97));
    border: 1px solid rgba(76, 139, 181, .25);
    border-radius: 14px;
}

.equipment-children-head h3,
.equipment-children-head p {
    margin: 0;
}

.equipment-children-head h3 {
    color: #e2f7ff;
    font-size: 16px;
    font-weight: 500;
}

.equipment-children-head p {
    margin-top: 4px;
    color: #789caf;
    font-size: 12px;
}

.equipment-children-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.equipment-child-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 22px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    color: #e7f8ff;
    text-align: left;
    background: rgba(4, 24, 40, .7);
    border: 1px solid rgba(74, 141, 176, .23);
    border-radius: 11px;
}

.equipment-child-card:hover,
.equipment-child-card:focus-visible {
    border-color: rgba(48, 210, 243, .5);
    background: rgba(7, 35, 55, .86);
}

.equipment-child-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
}

.equipment-child-card > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.equipment-child-card strong {
    overflow: hidden;
    color: #eafaff;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equipment-child-card small,
.equipment-child-card em,
.equipment-child-card time {
    overflow: hidden;
    color: #759db1;
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equipment-child-card em {
    color: #62c6e0;
}

.equipment-child-card time {
    color: #8fb4c6;
}

.device-config-editor .detail-hero {
    background:
        radial-gradient(circle at 0 0, rgba(32, 216, 255, .12), transparent 36%),
        linear-gradient(145deg, rgba(13, 54, 80, .94), rgba(5, 23, 39, .98));
}

.device-config-editor .detail-cfg.active strong {
    color: #57e77f;
}

.device-config-editor .detail-cfg.warn strong {
    color: #ffd05c;
}

.device-config-editor .detail-cfg.bad strong {
    color: #ff8296;
}

.config-editor-note {
    margin: 0;
}

.config-push-panel p,
.config-section-head p {
    margin: 4px 0 0;
    color: #789caf;
    font-size: 12px;
    line-height: 1.4;
}

.config-section select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    color: #e8edf2;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 7px;
    font: inherit;
}

.config-history {
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.config-history h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 500;
}

@media (max-width: 860px) {
    .equipment-card {
        grid-template-columns: minmax(0, 1fr) 34px;
        grid-template-rows: auto auto;
        gap: 11px;
        padding: 14px;
    }

    .equipment-card-copy {
        grid-column: 1;
        grid-row: 1;
    }

    .equipment-card-meta,
    .equipment-card-runtime {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        justify-items: start;
        padding: 8px 0 0;
        border: 0;
        border-top: 1px solid rgba(117, 167, 191, .13);
    }

    .equipment-card-meta {
        display: none;
    }

    .equipment-card-arrow {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    .equipment-card-runtime small,
    .equipment-card-runtime em {
        justify-self: end;
    }

    .equipment-children-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .equipment-card {
        min-height: 96px;
        border-radius: 12px;
    }

    .equipment-card-copy strong {
        font-size: 16px;
    }

    .equipment-card-runtime {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .equipment-card-runtime small,
    .equipment-card-runtime em {
        justify-self: start;
    }

    .equipment-child-card {
        grid-template-columns: 42px minmax(0, 1fr) 20px;
    }

    .equipment-child-card time {
        display: none;
    }

    .settings-hero-kicker {
        display: none;
    }
}

.history-panel {
    display: grid;
    gap: 14px;
}

.history-toolbar,
.history-presets,
.history-status,
.history-chart-wrap {
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .06), transparent 34%),
        var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: 12px;
}

.history-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
}

.history-toolbar label {
    display: grid;
    gap: 6px;
}

.history-toolbar label span {
    color: #9aabb8;
    font-size: 12px;
}

.history-toolbar select,
.history-toolbar input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-field);
    color: #e8edf2;
    font: inherit;
}

.time-wide-field,
.time-wide-field input[type="time"] {
    cursor: pointer;
}

.history-toolbar button {
    min-width: 110px;
    height: 38px;
}

.history-presets {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.history-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-period-buttons button {
    min-width: 120px;
}

.history-status {
    position: relative;
    overflow: hidden;
    padding: 12px 14px;
    color: #a8cddd;
    font-size: 13px;
    line-height: 1.45;
}

.history-status::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #607f90;
}

.history-status.ok {
    color: #7bdca2;
}

.history-status.ok::before {
    background: #5ee23f;
}

.history-status.error {
    color: #ff8f8f;
}

.history-status.error::before {
    background: #ff6f7f;
}

.history-status.wait {
    color: #f1c84c;
}

.history-status.wait::before {
    background: #f1c84c;
}

.history-chart-wrap {
    height: min(58vh, 520px);
    min-height: 330px;
    padding: 14px;
}

.history-series {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
    color: #7f98a5;
    background: rgba(4, 23, 39, .54);
    border: 1px solid rgba(88, 126, 145, .2);
    border-radius: 8px;
    cursor: pointer;
}

.history-toggle span {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 3px;
    background: var(--series-color);
    opacity: .24;
    box-shadow: none;
}

.history-toggle strong {
    min-width: 0;
    color: #829aa6;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.history-toggle.active {
    color: #e7f7fd;
    background: rgba(8, 39, 58, .86);
    border-color: color-mix(in srgb, var(--series-color) 36%, transparent);
}

.history-toggle.active span {
    opacity: 1;
    box-shadow: 0 0 10px color-mix(in srgb, var(--series-color) 42%, transparent);
}

.history-toggle.active strong {
    color: #e7f7fd;
}

.firmware-screen {
    display: grid;
    gap: 14px;
}

.firmware-hero {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    background:
        radial-gradient(circle at 8% 0, rgba(32, 216, 255, .17), transparent 40%),
        linear-gradient(145deg, rgba(14, 55, 82, .96), rgba(4, 21, 37, .98));
    border: 1px solid rgba(47, 174, 220, .35);
    border-radius: 17px;
    box-shadow: 0 18px 48px rgba(0, 8, 17, .22);
}

.firmware-section-head > div > span {
    color: #49dfff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.firmware-hero p,
.firmware-section-head h2 {
    margin: 0;
}

.firmware-hero-summary {
    max-width: 650px;
    color: #b9d7e5;
    font-size: 14px;
    line-height: 1.4;
}

.firmware-hero code,
.firmware-safety-note code {
    color: #aeefff;
    font-family: var(--font-mono);
    font-size: .92em;
}

.firmware-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    overflow: hidden;
    background: rgba(2, 17, 30, .62);
    border: 1px solid rgba(86, 148, 179, .24);
    border-radius: 13px;
}

.firmware-hero-stats article {
    display: grid;
    gap: 2px;
    min-width: 90px;
    padding: 11px 13px;
    border-left: 1px solid rgba(86, 148, 179, .18);
}

.firmware-hero-stats article:first-child {
    border-left: 0;
}

.firmware-hero-stats strong {
    color: #ecfaff;
    font-size: 21px;
}

.firmware-hero-stats span {
    color: #789caf;
    font-size: 10px;
    white-space: nowrap;
}

.firmware-box {
    display: grid;
    gap: 14px;
    padding: 17px;
    background:
        radial-gradient(circle at 100% 0, rgba(32, 216, 255, .055), transparent 34%),
        linear-gradient(155deg, rgba(9, 38, 60, .94), rgba(4, 20, 35, .98));
    border: 1px solid rgba(76, 139, 181, .25);
    border-radius: 15px;
}

.firmware-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.firmware-section-head h2 {
    margin-top: 2px;
    color: #edf9fd;
    font-size: 18px;
}

.firmware-section-head > small {
    max-width: 440px;
    color: #789caf;
    font-size: 11px;
    text-align: right;
}

.firmware-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.firmware-device-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 15px;
    background: rgba(3, 20, 34, .64);
    border: 1px solid rgba(79, 142, 178, .22);
    border-radius: 13px;
}

.firmware-device-card.ready {
    border-color: rgba(72, 218, 133, .28);
    box-shadow: inset 0 0 24px rgba(72, 218, 133, .035);
}

.firmware-device-copy,
.firmware-device-copy > div:first-child {
    min-width: 0;
}

.firmware-device-copy > div:first-child,
.firmware-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.firmware-device-copy strong {
    color: #e5f4fa;
    font-size: 14px;
}

.firmware-device-copy p,
.firmware-device-copy small {
    margin: 2px 0 0;
    color: #718fa1;
    font-size: 10px;
}

.firmware-device-copy dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0 8px;
}

.firmware-device-copy dl div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.firmware-device-copy dt {
    color: #6e91a3;
    font-size: 10px;
}

.firmware-device-copy dd {
    margin: 0;
    overflow: hidden;
    color: #bcd1dc;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.firmware-pill {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    color: #90a9b6;
    background: rgba(103, 132, 148, .11);
    border: 1px solid rgba(103, 132, 148, .2);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.firmware-pill.ready {
    color: #70eca6;
    background: rgba(72, 218, 133, .1);
    border-color: rgba(72, 218, 133, .22);
}

.firmware-pill.wait,
.firmware-pill.progress {
    color: #ffe077;
    background: rgba(255, 210, 38, .1);
    border-color: rgba(255, 210, 38, .2);
}

.firmware-pill.error {
    color: #ff91a5;
    background: rgba(235, 73, 103, .1);
    border-color: rgba(235, 73, 103, .22);
}

.firmware-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.firmware-safety-note {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    color: #7e9fb1;
    background: rgba(32, 216, 255, .06);
    border: 1px solid rgba(32, 216, 255, .14);
    border-radius: 10px;
    font-size: 11px;
}

.firmware-safety-note strong {
    color: #bfe9f5;
}

.firmware-build-list,
.firmware-job-list {
    display: grid;
    gap: 9px;
}

.firmware-build-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    background: rgba(3, 20, 34, .66);
    border: 1px solid rgba(78, 139, 172, .2);
    border-radius: 13px;
}

.firmware-build-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #4fe1ff;
    background: rgba(32, 216, 255, .09);
    border: 1px solid rgba(32, 216, 255, .2);
    border-radius: 12px;
    font-size: 20px;
    font-weight: 500;
}

.firmware-build-main,
.firmware-card-head > div {
    min-width: 0;
}

.firmware-card-head span:first-child {
    display: block;
    overflow: hidden;
    color: #63dff9;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.firmware-card-head h3 {
    margin: 2px 0 0;
    color: #edf9fd;
    font-size: 17px;
}

.firmware-card-head h3 b {
    color: #4fe1ff;
    font-weight: 500;
}

.firmware-build-main > p {
    margin: 8px 0;
    color: #a7bdc9;
    font-size: 12px;
}

.firmware-build-main > code {
    display: block;
    margin-top: 9px;
    overflow: hidden;
    color: #6f94a7;
    font-family: var(--font-mono);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.firmware-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    color: #7899aa;
    font-size: 10px;
}

.firmware-inline-warning {
    margin: 8px 0;
    padding: 8px 10px;
    color: #ffc1ca;
    background: rgba(235, 73, 103, .09);
    border: 1px solid rgba(235, 73, 103, .17);
    border-radius: 9px;
    font-size: 11px;
}

.firmware-job-card {
    display: grid;
    gap: 12px;
    padding: 15px;
    background: rgba(3, 20, 34, .66);
    border: 1px solid rgba(78, 139, 172, .22);
    border-left: 3px solid #6b8999;
    border-radius: 13px;
}

.firmware-job-card.ready {
    border-left-color: #51df91;
}

.firmware-job-card.wait,
.firmware-job-card.progress {
    border-left-color: #ffd226;
}

.firmware-job-card.error {
    border-left-color: #eb4967;
}

.firmware-job-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.firmware-job-progress > span {
    position: relative;
    display: grid;
    gap: 5px;
    justify-items: center;
    color: #638293;
    text-align: center;
}

.firmware-job-progress > span::before {
    position: absolute;
    top: 5px;
    right: 50%;
    width: 100%;
    height: 1px;
    background: rgba(95, 132, 152, .24);
    content: "";
}

.firmware-job-progress > span:first-child::before {
    display: none;
}

.firmware-job-progress i {
    z-index: 1;
    width: 11px;
    height: 11px;
    background: #213c4b;
    border: 2px solid #547486;
    border-radius: 50%;
}

.firmware-job-progress span.done i,
.firmware-job-progress span.current i {
    background: #23d8ff;
    border-color: #23d8ff;
    box-shadow: 0 0 10px rgba(35, 216, 255, .46);
}

.firmware-job-progress span.done::before,
.firmware-job-progress span.current::before {
    background: rgba(35, 216, 255, .48);
}

.firmware-job-progress small {
    font-size: 9px;
}

.firmware-cancel {
    justify-self: start;
    min-height: 34px;
}

.config-tools {
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.config-tools h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.config-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.config-tool {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.config-tool h3,
.config-tool span,
.config-tool small {
    display: block;
}

.config-tool h3 {
    font-size: 14px;
    font-weight: 400;
}

.config-tool span,
.config-tool small {
    color: #9cc6d8;
    font-size: 12px;
}

.config-tool button {
    min-height: 38px;
    padding: 0 12px;
}

.config-tool small {
    grid-column: 1 / -1;
    min-height: 16px;
}

.config-tool small.ok {
    color: #4ff083;
}

.config-tool small.error {
    color: #ff8585;
}

.config-tool small.wait {
    color: #ffd764;
}

.config-blueprint {
    display: grid;
    gap: 14px;
}

.config-blueprint-hero,
.config-local-engine,
.config-bindings-preview,
.config-blueprint-boundary {
    padding: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(32, 216, 255, .08), transparent 34%),
        linear-gradient(150deg, rgba(10, 45, 68, .96), rgba(4, 21, 36, .98));
    border: 1px solid rgba(61, 151, 190, .3);
    border-radius: 15px;
}

.config-blueprint-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.config-blueprint-hero > div:first-child > span,
.config-blueprint-section-head > div > span {
    color: #6fc9e2;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.config-blueprint-hero h2,
.config-blueprint-hero p,
.config-blueprint-section-head h2,
.config-blueprint-card h3,
.config-blueprint-card p,
.config-blueprint-boundary h2,
.config-blueprint-boundary p {
    margin: 0;
}

.config-blueprint-hero h2 {
    margin-top: 4px;
    color: #f1fbff;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 500;
}

.config-blueprint-hero p {
    max-width: 760px;
    margin-top: 7px;
    color: #8fb5c7;
    font-size: 13px;
    line-height: 1.5;
}

.config-blueprint-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    overflow: hidden;
    background: rgba(2, 17, 30, .64);
    border: 1px solid rgba(90, 157, 187, .22);
    border-radius: 12px;
}

.config-blueprint-stats article {
    display: grid;
    gap: 2px;
    padding: 11px 13px;
    border-left: 1px solid rgba(90, 157, 187, .18);
}

.config-blueprint-stats article:first-child {
    border-left: 0;
}

.config-blueprint-stats strong {
    color: #ebfaff;
    font-size: 20px;
    font-weight: 500;
}

.config-blueprint-stats small {
    color: #7398aa;
    font-size: 10px;
    white-space: nowrap;
}

.config-blueprint-principles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.config-blueprint-principles article {
    display: grid;
    gap: 5px;
    min-height: 92px;
    padding: 14px;
    background: rgba(4, 27, 44, .78);
    border: 1px solid rgba(67, 139, 174, .24);
    border-radius: 12px;
}

.config-blueprint-principles strong {
    color: #dff6ff;
    font-size: 14px;
    font-weight: 500;
}

.config-blueprint-principles span {
    color: #779daf;
    font-size: 12px;
    line-height: 1.45;
}

.config-blueprint-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.config-blueprint-section-head h2 {
    margin-top: 3px;
    color: #edf9fd;
    font-size: 19px;
    font-weight: 500;
}

.config-blueprint-section-head > small {
    max-width: 520px;
    color: #769bad;
    font-size: 11px;
    line-height: 1.4;
    text-align: right;
}

.config-local-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr) 22px) minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.config-local-flow article {
    display: grid;
    gap: 5px;
    min-height: 92px;
    padding: 13px;
    background: rgba(3, 23, 38, .7);
    border: 1px solid rgba(49, 191, 224, .23);
    border-radius: 11px;
}

.config-local-flow strong {
    color: #e4f8ff;
    font-size: 13px;
    font-weight: 500;
}

.config-local-flow span {
    color: #75a0b4;
    font-size: 11px;
    line-height: 1.4;
}

.config-local-flow i {
    color: #4acbe9;
    font-size: 20px;
    font-style: normal;
    text-align: center;
}

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

.config-blueprint-card {
    display: grid;
    gap: 11px;
    min-width: 0;
    padding: 15px;
    background:
        radial-gradient(circle at 100% 0, rgba(32, 216, 255, .055), transparent 34%),
        rgba(4, 25, 41, .82);
    border: 1px solid rgba(65, 138, 175, .24);
    border-radius: 13px;
}

.config-blueprint-card.focus {
    border-color: rgba(74, 225, 153, .38);
    box-shadow: inset 0 0 30px rgba(38, 209, 126, .035);
}

.config-blueprint-card.ready {
    border-color: rgba(74, 202, 241, .34);
}

.config-blueprint-card-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.config-blueprint-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #53dffc;
    background: rgba(32, 216, 255, .08);
    border: 1px solid rgba(32, 216, 255, .2);
    border-radius: 11px;
}

.config-blueprint-card.focus .config-blueprint-icon {
    color: #58e99b;
    background: rgba(70, 224, 146, .08);
    border-color: rgba(70, 224, 146, .22);
}

.config-blueprint-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.config-blueprint-card-head > div {
    min-width: 0;
}

.config-blueprint-card-head small {
    color: #5fa4bc;
    font-family: var(--font-mono);
    font-size: 10px;
}

.config-blueprint-card h3 {
    margin-top: 2px;
    color: #eaf9ff;
    font-size: 16px;
    font-weight: 500;
}

.config-blueprint-card-head em {
    padding: 4px 7px;
    color: #8fa9b6;
    background: rgba(97, 128, 145, .1);
    border: 1px solid rgba(97, 128, 145, .18);
    border-radius: 999px;
    font-size: 9px;
    font-style: normal;
    white-space: nowrap;
}

.config-blueprint-card.ready .config-blueprint-card-head em,
.config-blueprint-card.focus .config-blueprint-card-head em {
    color: #65e89c;
    background: rgba(68, 218, 137, .09);
    border-color: rgba(68, 218, 137, .2);
}

.config-blueprint-card.partial .config-blueprint-card-head em {
    color: #ffe078;
    background: rgba(255, 210, 38, .08);
    border-color: rgba(255, 210, 38, .18);
}

.config-blueprint-card > p {
    color: #789eaf;
    font-size: 12px;
    line-height: 1.45;
}

.config-blueprint-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-top: 9px;
    border-top: 1px solid rgba(100, 151, 176, .13);
}

.config-blueprint-card dl > div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px;
}

.config-blueprint-card dt {
    color: #6590a5;
    font-size: 10px;
}

.config-blueprint-card dd {
    margin: 0;
    color: #a9c5d2;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.config-binding-list {
    display: grid;
    gap: 8px;
}

.config-binding-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    background: rgba(3, 23, 38, .68);
    border: 1px solid rgba(65, 138, 175, .2);
    border-radius: 10px;
}

.config-binding-list article > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.config-binding-list strong {
    color: #e5f8ff;
    font-size: 13px;
    font-weight: 500;
}

.config-binding-list span {
    color: #729bad;
    font-size: 11px;
}

.config-binding-list em {
    color: #66e89c;
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.config-blueprint-boundary {
    border-color: rgba(255, 205, 75, .22);
}

.config-blueprint-boundary h2 {
    color: #f2f8fa;
    font-size: 17px;
    font-weight: 500;
}

.config-blueprint-boundary p {
    margin-top: 6px;
    color: #8aa9b7;
    font-size: 12px;
    line-height: 1.5;
}

.device-configuration-overview {
    display: grid;
    gap: 13px;
    margin-top: 16px;
    padding: 18px;
    background:
        radial-gradient(circle at 92% 8%, rgba(32, 196, 225, .1), transparent 30%),
        linear-gradient(155deg, rgba(8, 39, 57, .98), rgba(4, 24, 39, .98));
    border: 1px solid rgba(55, 188, 221, .28);
    border-radius: var(--control-radius);
}

.device-configuration-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.device-configuration-head h2,
.device-configuration-head p,
.device-configuration-card h3,
.device-configuration-card p,
.device-configuration-card dl,
.device-configuration-card footer p {
    margin: 0;
}

.device-configuration-head h2 {
    color: #f4fbff;
    font-size: 23px;
    font-weight: 500;
}

.device-configuration-head p {
    margin-top: 5px;
    color: #7fc3dc;
    font-size: 13px;
    line-height: 1.45;
}

.device-configuration-head > span {
    padding: 7px 10px;
    color: #9de9ff;
    font-size: 12px;
    white-space: nowrap;
    background: rgba(21, 112, 140, .18);
    border: 1px solid rgba(71, 207, 241, .28);
    border-radius: 8px;
}

.device-configuration-note {
    padding: 11px 13px;
    color: #a8c7d3;
    font-size: 12px;
    line-height: 1.5;
    background: rgba(2, 22, 35, .62);
    border-left: 3px solid #25c6e8;
    border-radius: 7px;
}

.device-role-contract {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(0, 1.35fr);
    gap: 14px;
    padding: 13px;
    background:
        radial-gradient(circle at 0 0, rgba(45, 211, 240, .09), transparent 36%),
        rgba(2, 22, 35, .68);
    border: 1px solid rgba(66, 175, 207, .25);
    border-radius: 9px;
}

.device-role-contract > div {
    display: grid;
    align-content: start;
    gap: 4px;
}

.device-role-contract small {
    color: #51cde7;
    font-family: var(--font-mono);
    font-size: 9px;
}

.device-role-contract h3,
.device-role-contract p,
.device-role-contract dl,
.device-role-contract dt,
.device-role-contract dd {
    margin: 0;
}

.device-role-contract h3 {
    color: #effaff;
    font-size: 15px;
    font-weight: 500;
}

.device-role-contract p {
    color: #82aebf;
    font-size: 11px;
    line-height: 1.45;
}

.device-role-contract dl {
    display: grid;
    gap: 0;
}

.device-role-contract dl > div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 9px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(75, 137, 159, .13);
}

.device-role-contract dl > div:last-child {
    border-bottom: 0;
}

.device-role-contract dt {
    color: #6998ac;
    font-size: 10px;
}

.device-role-contract dd {
    color: #c9e5ee;
    font-size: 10px;
    line-height: 1.4;
}

.config-output-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 13px;
    background: linear-gradient(145deg, rgba(10, 49, 68, .72), rgba(3, 24, 38, .86));
    border: 1px solid rgba(67, 171, 201, .25);
    border-radius: 9px;
}

.config-output-guide > div:first-child {
    display: grid;
    gap: 3px;
}

.config-output-guide strong,
.device-configuration-packet strong {
    color: #edfaff;
    font-size: 13px;
    font-weight: 500;
}

.config-output-guide > div:first-child span,
.device-configuration-packet > div span {
    color: #7fa8b9;
    font-size: 11px;
    line-height: 1.4;
}

.config-output-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.config-output-types span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 8px;
    color: #a9d4e3;
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(2, 20, 32, .72);
    border: 1px solid rgba(67, 152, 181, .24);
    border-radius: 7px;
}

.config-output-types i {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #071827;
    font-size: 12px;
    font-style: normal;
    background: #46d9f5;
    border-radius: 5px;
}

.device-configuration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.device-configuration-card {
    display: grid;
    align-content: start;
    gap: 11px;
    min-width: 0;
    padding: 14px;
    background: linear-gradient(145deg, rgba(10, 50, 70, .88), rgba(4, 28, 44, .94));
    border: 1px solid rgba(69, 158, 189, .3);
    border-radius: 10px;
}

.device-configuration-card.ready {
    border-color: rgba(66, 222, 132, .38);
}

.device-configuration-card.partial,
.device-configuration-card.focus {
    border-color: rgba(55, 203, 236, .45);
}

.device-configuration-card.planned {
    background: linear-gradient(145deg, rgba(8, 38, 55, .82), rgba(4, 24, 37, .9));
    border-color: rgba(104, 137, 151, .25);
}

.config-blueprint-card.section-local,
.device-configuration-card.section-local {
    grid-column: 1 / -1;
}

.device-configuration-card-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.device-configuration-card-head .config-blueprint-icon {
    width: 38px;
    height: 38px;
}

.device-configuration-card-head small,
.device-configuration-card footer > span {
    color: #46d9f5;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: lowercase;
}

.device-configuration-card h3 {
    margin-top: 2px;
    color: #effaff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
}

.device-configuration-card-head em {
    align-self: start;
    padding: 4px 7px;
    color: #a6c5d1;
    font-size: 10px;
    font-style: normal;
    white-space: nowrap;
    background: rgba(2, 22, 34, .68);
    border: 1px solid rgba(112, 168, 190, .22);
    border-radius: 6px;
}

.device-configuration-card.ready .device-configuration-card-head em {
    color: #69ee99;
    border-color: rgba(73, 223, 132, .3);
}

.device-configuration-card.partial .device-configuration-card-head em,
.device-configuration-card.focus .device-configuration-card-head em {
    color: #75e9ff;
    border-color: rgba(68, 207, 236, .32);
}

.device-configuration-card > p {
    color: #82aebf;
    font-size: 12px;
    line-height: 1.45;
}

.device-configuration-card dl {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(75, 137, 159, .18);
}

.device-configuration-card dl > div {
    display: grid;
    grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(75, 137, 159, .13);
}

.device-configuration-card dt,
.device-configuration-card dd {
    margin: 0;
    font-size: 11px;
    line-height: 1.38;
}

.local-config-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.local-config-block {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 11px;
    background: rgba(2, 22, 35, .68);
    border: 1px solid rgba(70, 180, 207, .22);
    border-radius: 8px;
}

.local-config-block > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 9px;
}

.local-config-block small {
    grid-column: 1;
    color: #5fa4bc;
    font-family: var(--font-mono);
    font-size: 9px;
}

.local-config-block strong {
    grid-column: 1;
    color: #eafaff;
    font-size: 14px;
    font-weight: 500;
}

.local-config-block em {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: #73ddf2;
    font-size: 9px;
    font-style: normal;
    text-align: right;
}

.local-config-block p {
    margin: 0;
    color: #7fa9b9;
    font-size: 11px;
    line-height: 1.4;
}

.local-config-block code,
.local-config-examples code {
    display: block;
    min-width: 0;
    padding: 8px 9px;
    color: #a8eec8;
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1.45;
    white-space: pre-wrap;
    background: rgba(1, 15, 25, .7);
    border: 1px solid rgba(71, 204, 139, .16);
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.local-config-examples {
    display: grid;
    gap: 7px;
    padding-top: 2px;
}

.local-config-examples > span {
    color: #5fa4bc;
    font-size: 10px;
}

.local-config-examples > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.local-config-examples article {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 10px;
    background: linear-gradient(145deg, rgba(8, 43, 58, .84), rgba(2, 24, 38, .92));
    border: 1px solid rgba(67, 175, 201, .22);
    border-radius: 8px;
}

.local-config-examples article > div {
    display: grid;
    gap: 2px;
}

.local-config-examples small {
    color: #58cfe7;
    font-family: var(--font-mono);
    font-size: 9px;
}

.local-config-examples strong {
    color: #effaff;
    font-size: 13px;
    font-weight: 500;
}

.local-config-examples p {
    margin: 0;
    color: #7fa9b9;
    font-size: 10px;
    line-height: 1.4;
}

.device-configuration-card dt {
    color: #729caf;
}

.device-configuration-card dd {
    color: #d6edf5;
    overflow-wrap: anywhere;
}

.device-configuration-card footer {
    display: grid;
    gap: 9px;
    padding-top: 1px;
}

.device-configuration-card footer > div,
.config-blueprint-card footer {
    display: grid;
    gap: 5px;
}

.device-configuration-card footer code,
.config-blueprint-card footer code,
.device-configuration-packet code {
    display: block;
    min-width: 0;
    padding: 9px 10px;
    color: #a9e9f8;
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(1, 15, 25, .72);
    border: 1px solid rgba(70, 149, 177, .18);
    border-radius: 7px;
    overflow-wrap: anywhere;
}

.config-blueprint-card footer > span,
.device-configuration-card footer span {
    color: #5fa4bc;
    font-size: 10px;
}

.device-configuration-packet {
    display: grid;
    gap: 10px;
    padding: 13px;
    background:
        radial-gradient(circle at 100% 0, rgba(75, 227, 151, .08), transparent 32%),
        rgba(2, 21, 34, .76);
    border: 1px solid rgba(71, 204, 139, .25);
    border-radius: 9px;
}

.device-configuration-packet > div {
    display: grid;
    gap: 3px;
}

.device-configuration-packet code {
    color: #a8eec8;
    border-color: rgba(71, 204, 139, .18);
}

.device-configuration-admin {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-configuration-admin span {
    color: #7fa8b8;
    font-size: 11px;
}

.device-detail {
    display: grid;
    gap: 14px;
}

.back-button {
    justify-self: start;
}

.detail-hero,
.config-push-panel,
.config-section {
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.detail-hero h2,
.detail-hero p,
.config-section h3,
.config-push-panel h3 {
    margin: 0;
}

.detail-hero p,
.detail-cfg span,
.config-field em {
    color: #9aabb8;
    font-size: 13px;
}

.detail-cfg {
    display: grid;
    gap: 3px;
    min-width: 120px;
    text-align: right;
}

.config-alert {
    padding: 12px 14px;
    color: #ff9292;
    background: var(--danger-soft);
    border: 1px solid rgba(210, 15, 55, .42);
    border-radius: 8px;
}

.config-push-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.config-push-panel code {
    display: block;
    margin-top: 8px;
    color: #9fe6ff;
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
}

.config-push-panel small,
.config-section small {
    color: #9cc6d8;
    font-size: 12px;
}

.config-push-panel small.ok,
.config-section small.ok {
    color: #4ff083;
}

.config-push-panel small.error,
.config-section small.error {
    color: #ff8585;
}

.config-push-panel small.wait,
.config-section small.wait {
    color: #ffd764;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

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

.config-section {
    display: grid;
    gap: 14px;
}

.config-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.config-fields {
    display: grid;
    gap: 12px;
}

.config-field {
    display: grid;
    gap: 7px;
}

.config-field > label:first-child {
    font-size: 13px;
    color: #9cc6d8;
}

.config-field input:not([type="checkbox"]) {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-field);
    color: #e8edf2;
    font: inherit;
}

.config-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b9c8d3;
    font-size: 12px;
}

.config-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--success);
}

.messages-panel {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    min-height: min(720px, calc(100vh - 210px));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.messages-warning {
    grid-column: 1 / -1;
    padding: 10px 14px;
    color: #ffd470;
    background: rgba(255, 212, 112, .08);
    border-bottom: 1px solid rgba(255, 212, 112, .18);
}

.messages-dialogs {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    border-right: 1px solid var(--border);
}

.messages-dialogs-head,
.message-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.messages-dialogs-head {
    justify-content: space-between;
}

.messages-dialogs-head h2,
.message-chat-head h2,
.message-item p {
    margin: 0;
}

.messages-dialogs-head h2,
.message-chat-head h2 {
    font-size: 18px;
    font-weight: 400;
}

.messages-dialogs-head button {
    min-height: 34px;
    padding: 0 12px;
}

.messages-dialog-list {
    display: grid;
    align-content: start;
    gap: 2px;
    overflow-y: auto;
}

.message-dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    padding: 14px;
    color: #dff8ff;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(38, 56, 71, .72);
    border-radius: 0;
}

.message-dialog:hover,
.message-dialog.active {
    background: var(--surface-soft);
}

.message-dialog-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.message-dialog-main strong,
.message-dialog-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-dialog-main strong {
    font-size: 15px;
    font-weight: 400;
}

.message-dialog-main small,
.message-dialog-side time,
.message-chat-head span {
    color: #8fb8c9;
    font-size: 12px;
}

.message-dialog-side {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.message-dialog-side b {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    color: #062113;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    background: #32d879;
    border-radius: 999px;
}

.message-chat {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    min-height: 0;
}

.message-back {
    display: none;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
}

.message-chat-head > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.message-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background:
        radial-gradient(circle at 12% 18%, rgba(31, 188, 215, .07), transparent 30%),
        var(--surface-field);
}

.message-item {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: min(680px, 78%);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.message-item.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-item.theirs {
    align-self: flex-start;
}

.message-avatar {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(84, 214, 240, .55);
    border-radius: 50%;
    object-fit: cover;
}

.message-bubble {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.message-item.mine .message-bubble {
    background: linear-gradient(180deg, rgba(21, 68, 47, .9), rgba(12, 47, 34, .96));
    border-color: rgba(94, 226, 63, .4);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 14px;
}

.message-item.theirs .message-bubble::before,
.message-item.mine .message-bubble::before {
    content: "";
    position: absolute;
    bottom: -1px;
    width: 12px;
    height: 12px;
    background: inherit;
    border: inherit;
    transform: rotate(45deg);
}

.message-item.theirs .message-bubble::before {
    left: -5px;
    border-top: 0;
    border-right: 0;
    border-bottom-left-radius: 3px;
}

.message-item.mine .message-bubble::before {
    right: -5px;
    border-bottom: 0;
    border-left: 0;
    border-top-right-radius: 3px;
}

.message-item.new {
    animation: messageAppear 900ms ease;
}

@keyframes messageAppear {
    0% {
        transform: translateY(8px);
        border-color: #32d879;
        background: #0f2b24;
    }

    100% {
        transform: translateY(0);
    }
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #8fa4b2;
    font-size: 12px;
}

.message-photo-preview,
.message-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
}

.message-photo-preview:not(.visible) {
    display: none;
}

.message-photo-thumb,
.message-file {
    position: relative;
    overflow: hidden;
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-field);
}

.message-photo-thumb img,
.message-file img {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
}

.message-photo-thumb button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 7px;
}

.message-file {
    display: grid;
    color: #bfeeff;
    text-decoration: none;
}

.message-file span {
    overflow: hidden;
    padding: 6px 8px;
    color: #9cc6d8;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-item p {
    color: #c8d7e0;
    line-height: 1.45;
}

.message-composer {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.message-composer input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.message-compose-row {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.message-tool,
.message-send {
    height: 42px;
    border-radius: 999px;
}

.message-tool {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.message-voice-tool {
    display: grid;
    place-items: center;
    color: #67dff4;
}

.message-voice-tool svg {
    width: 21px;
    height: 21px;
}

.message-composer > .voice-recorder {
    grid-column: 1;
}

.message-voice {
    display: grid;
    grid-template-columns: 34px minmax(180px, 1fr);
    align-items: center;
    gap: 9px;
    min-width: min(290px, 68vw);
    padding: 8px;
    background: rgba(2, 18, 30, .4);
    border: 1px solid rgba(71, 154, 185, .2);
    border-radius: 10px;
}

.message-voice-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #66e5fa;
    background: rgba(32, 216, 255, .08);
    border: 1px solid rgba(32, 216, 255, .28);
    border-radius: 9px;
}

.message-voice-icon svg {
    width: 19px;
    height: 19px;
}

.message-voice > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.message-voice-player {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 9px;
    background:
        radial-gradient(circle at 12% 50%, rgba(45, 224, 255, .13), transparent 42%),
        linear-gradient(135deg, rgba(7, 39, 58, .96), rgba(3, 23, 38, .96));
    border: 1px solid rgba(61, 195, 226, .28);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.message-voice-play {
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    color: #73edff;
    background:
        radial-gradient(circle at 50% 38%, rgba(61, 225, 255, .22), transparent 62%),
        rgba(4, 32, 49, .96);
    border: 1px solid rgba(67, 215, 244, .52);
    border-radius: 10px;
    box-shadow: 0 0 16px rgba(32, 216, 255, .08);
}

.message-voice-play:hover,
.message-voice-play:focus-visible,
.message-voice-player button.message-voice-play:active,
.message-voice-player.is-playing .message-voice-play {
    color: #d9fbff;
    background:
        radial-gradient(circle at 50% 38%, rgba(69, 235, 255, .34), transparent 64%),
        rgba(5, 48, 68, .98);
    border-color: rgba(86, 232, 255, .78);
    box-shadow: 0 0 20px rgba(32, 216, 255, .18);
}

.message-voice-player.is-error .message-voice-play {
    color: #ff91a1;
    border-color: rgba(255, 96, 122, .58);
}

.message-voice-play svg {
    width: 20px;
    height: 20px;
    overflow: visible;
}

.message-voice-play-icon {
    fill: currentColor;
    stroke: none;
}

.message-voice-pause-icon {
    display: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
}

.message-voice-player.is-playing .message-voice-play-icon {
    display: none;
}

.message-voice-player.is-playing .message-voice-pause-icon {
    display: block;
}

.message-voice-timeline {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.message-voice-seek {
    --voice-progress: 0%;
    width: 100%;
    height: 4px;
    margin: 0;
    appearance: none;
    cursor: pointer;
    background: linear-gradient(
        to right,
        #35dff8 0,
        #35dff8 var(--voice-progress),
        rgba(111, 151, 169, .34) var(--voice-progress),
        rgba(111, 151, 169, .34) 100%
    );
    border: 0;
    border-radius: 999px;
    outline: 0;
}

.message-voice-seek::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    appearance: none;
    background: #57e9ff;
    border: 2px solid #0a3c51;
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(53, 223, 248, .48);
}

.message-voice-seek::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: #57e9ff;
    border: 2px solid #0a3c51;
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(53, 223, 248, .48);
}

.message-voice-time {
    display: flex;
    justify-content: space-between;
    color: #8fc9dc;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.message-voice-player audio {
    display: none;
}

.message-voice small {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    color: #82afc1;
    font-size: 10px;
}

.message-voice-stt {
    color: #72bfd9;
}

.message-voice.stt-queued .message-voice-stt,
.message-voice.stt-processing .message-voice-stt {
    color: #42d9f5;
}

.message-voice.stt-processing .message-voice-icon {
    box-shadow: 0 0 16px rgba(32, 216, 255, .2);
    animation: voicePulse 1.35s ease-in-out infinite;
}

.message-voice.stt-ready .message-voice-stt {
    color: #53e98d;
}

.message-voice.stt-failed .message-voice-stt {
    color: #ff8798;
}

.message-send {
    padding: 0 16px;
    background: #0b8d50;
    border-color: #32d879;
}

.message-composer textarea {
    width: 100%;
    min-height: 42px;
    max-height: 130px;
    padding: 11px 14px;
    color: #e8edf2;
    font: inherit;
    resize: vertical;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 21px;
}

.message-emoji-panel {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.message-emoji-panel.open {
    display: flex;
}

.message-emoji-panel button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    font-size: 18px;
    border-radius: 10px;
}

.firmware-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 11px;
    align-items: end;
}

.firmware-form label {
    display: grid;
    gap: 6px;
}

.firmware-form label.wide {
    grid-column: 1 / -1;
}

.firmware-form span {
    color: #9aabb8;
    font-size: 12px;
}

.firmware-form input,
.firmware-form select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-field);
    color: #e8edf2;
    font: inherit;
}

.firmware-form select:disabled {
    color: #668596;
    opacity: .78;
}

.firmware-form input[type="file"] {
    height: auto;
    min-height: 38px;
    padding: 8px 10px;
}

.firmware-form button {
    grid-column: 1 / -1;
    min-width: 150px;
    min-height: 40px;
    justify-self: start;
}

.firmware-form button:disabled {
    cursor: not-allowed;
    filter: saturate(.35);
    opacity: .55;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 36px;
}

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

h1,
h2 {
    margin: 0;
}

.toolbar h1 {
    font-size: 25px;
}

.toolbar p {
    margin: 6px 0 0;
    color: #9aabb8;
    font-size: 14px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
    gap: 14px;
}

.device-groups {
    display: grid;
    gap: 18px;
}

.device-group {
    padding: 14px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.device-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.device-group-head .card-status {
    position: static;
}

.device-group-head h2 {
    font-size: 18px;
}

.device-group-head p {
    margin: 3px 0 0;
    color: #8fa4b2;
    font-size: 12px;
}

.card {
    position: relative;
    min-height: 230px;
    padding: 16px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.device-open-card {
    cursor: pointer;
}

.device-open-card:hover {
    border-color: #3b647d;
}

.card.health-online {
    border-color: #2f6f4d;
}

.card.health-idle {
    border-color: #806f33;
}

.card.health-offline {
    border-color: #703b3b;
}

.card-status {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4a5561;
}

.card-status.online {
    background: #25d366;
    box-shadow: 0 0 10px rgba(37, 211, 102, .8);
}

.card-status.idle {
    background: #f1c84c;
    box-shadow: 0 0 8px rgba(241, 200, 76, .6);
}

.card-status.offline {
    background: #cc4d4d;
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-right: 18px;
}

.card h2 {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.25;
}

.card h3,
.point h3,
.config-tool h3 {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.25;
}

.meta,
.device-meta,
.section-label {
    color: #95a7b4;
    font-size: 12px;
}

.device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.device-meta span {
    padding: 3px 6px;
    background: var(--surface-field);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.points {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.point {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
}

.point h3 {
    display: block;
    font-size: 15px;
    font-weight: 400;
}

.point span {
    display: inline-block;
    color: #9aabb8;
    font-size: 12px;
}

.point-value,
.relay-state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 48px;
}

.relay-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pwm-point {
    --pwm-color: #54c7f0;
    --pwm-glow: rgba(84, 199, 240, .16);
    grid-template-columns: 1fr;
}

.pwm-readout {
    justify-self: stretch;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    min-height: 38px;
    padding-right: 2px;
}

.pwm-readout span:first-child {
    color: var(--pwm-color);
    font-size: 34px;
    font-weight: 500;
    line-height: 1;
}

.pwm-readout span:last-child {
    color: #9bc7da;
    font-size: 15px;
}

.pwm-control {
    display: grid;
    gap: 2px;
}

.pwm-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pwm-head div {
    min-width: 0;
}

.pwm-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 44px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.pwm-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    margin-top: -9px;
    border: 0;
    border-radius: 50%;
    background: var(--pwm-color);
    box-shadow: 0 0 0 4px var(--pwm-glow), 0 4px 12px rgba(0, 0, 0, .32);
}

.pwm-control input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: var(--pwm-color);
    box-shadow: 0 0 0 4px var(--pwm-glow), 0 4px 12px rgba(0, 0, 0, .32);
}

.pwm-control input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pwm-color) 0 var(--range-percent, 0%), #52606d var(--range-percent, 0%) 100%);
    box-shadow: inset 0 0 0 1px rgba(229, 236, 241, .22);
}

.pwm-control input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: #52606d;
    box-shadow: inset 0 0 0 1px rgba(229, 236, 241, .22);
}

button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
    color: #eef6fb;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        inset 0 -1px 0 rgba(0, 0, 0, .18),
        0 10px 24px rgba(0, 0, 0, .16);
    transition:
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease,
        color .16s ease,
        filter .16s ease;
}

button:hover {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 58%),
        var(--surface);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        0 0 0 1px rgba(84, 214, 240, .08),
        0 12px 30px rgba(0, 0, 0, .2);
}

button:active {
    border-color: color-mix(in srgb, var(--warning) 52%, transparent);
    background:
        radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--warning) 20%, transparent), transparent 54%),
        var(--surface);
    box-shadow:
        inset 0 0 18px rgba(255, 211, 83, .12),
        inset 0 1px 0 rgba(255, 255, 255, .04),
        0 0 24px rgba(255, 200, 70, .08);
}

button[type="submit"] {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 58%),
        var(--surface);
}

button.button-primary,
.button-primary {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 58%),
        var(--surface);
}

button:disabled,
button.disabled {
    opacity: .45;
    cursor: not-allowed;
}

button.ghost {
    min-width: 112px;
    background: var(--surface-soft);
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.lamp {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #48525c;
    border: 1px solid #6a7680;
    vertical-align: middle;
}

.lamp.on {
    background: #27e06d;
    box-shadow: 0 0 10px rgba(39, 224, 109, .9);
}

.lamp.off {
    background: #48525c;
}

.health-offline .relay-point .lamp.on {
    background: #7f8d72;
    box-shadow: none;
}

.health-offline .relay-state::after {
    content: "offline";
    color: #cc8b8b;
    font-size: 12px;
}

.health-idle .relay-state::after {
    content: "stale";
    color: #d8be68;
    font-size: 12px;
}

.actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.action-button {
    width: 100%;
    margin-top: 7px;
    text-align: left;
    padding: 0 10px;
}

.action-button span {
    display: block;
    margin-top: 2px;
    color: #8cb3c8;
    font-size: 12px;
    font-weight: 400;
}

.result-line {
    min-height: 18px;
    margin-top: 12px;
    color: #9aabb8;
    font-size: 12px;
}

.result-line.ok {
    color: #39d98a;
}

.result-line.error {
    color: #ff7c7c;
}

.result-line.wait {
    color: #f1c84c;
}

.log-panel {
    margin-top: 22px;
    padding: 12px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .06), transparent 38%),
        rgba(4, 20, 34, .58);
    border: 1px solid rgba(76, 139, 181, .2);
    border-radius: 12px;
}

.log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.log-head h3 {
    margin: 0;
    color: #e9f8ff;
    font-size: 16px;
    font-weight: 500;
}

.log-head .log-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    color: #a9c6d4;
    border-color: rgba(96, 163, 193, .24);
    border-radius: 999px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
}

.log-clear-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#log {
    width: 100%;
    height: 148px;
    min-height: 112px;
    max-height: 42vh;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid rgba(76, 139, 181, .24);
    border-radius: 9px;
    outline: 0;
    background: rgba(1, 11, 20, .78);
    color: #7cebad;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
    scrollbar-color: rgba(80, 171, 205, .42) transparent;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .05), transparent 32%),
        var(--control-surface);
    border: 1px solid var(--control-border);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
    scrollbar-color: rgba(80, 171, 205, .42) transparent;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.45;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(76, 139, 181, .17);
    text-align: left;
    vertical-align: top;
    max-width: 320px;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(4, 22, 37, .96);
    color: #99c4d7;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.data-table td {
    color: #dce7ee;
    word-break: break-word;
}

.data-table tbody tr:nth-child(even) td {
    background: rgba(15, 48, 70, .16);
}

.data-table tr:hover td {
    background: var(--surface-soft);
}

.records-panel {
    overflow: hidden;
    border: 1px solid var(--control-border);
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .07), transparent 30%),
        rgba(4, 20, 34, .72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .14);
}

.records-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(76, 139, 181, .2);
    background: rgba(8, 35, 56, .72);
}

.records-counter {
    display: grid;
    gap: 2px;
    color: #d7e7ef;
    font-size: 13px;
}

.records-counter strong {
    color: #5ee8ff;
}

.records-counter small {
    color: #77a9c0;
    font-size: 11.5px;
}

.records-filter {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: min(300px, 100%);
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid rgba(55, 169, 211, .34);
    border-radius: var(--control-radius);
    background: rgba(2, 15, 27, .7);
    color: #66dff9;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.records-filter:focus-within {
    border-color: rgba(32, 216, 255, .72);
    background: rgba(3, 20, 34, .88);
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .1);
}

.records-filter svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.records-filter input {
    min-width: 0;
    height: 36px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #eef8fb;
    font-size: 13px;
}

.records-filter input::placeholder {
    color: #6f9aae;
}

.records-filter input:disabled {
    opacity: .55;
}

.records-list {
    display: grid;
    gap: 1px;
    background: rgba(76, 139, 181, .16);
}

.record-card {
    display: grid;
    grid-template-columns: 164px minmax(180px, .8fr) minmax(260px, 1.4fr) minmax(120px, auto);
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 14px;
    background: rgba(5, 24, 40, .96);
    transition: background .16s ease;
}

.record-card:hover {
    background: rgba(9, 39, 61, .98);
}

.record-card[hidden] {
    display: none;
}

.record-card-top,
.record-card-main,
.record-card-value,
.journal-data,
.journal-signal {
    min-width: 0;
}

.record-card-top,
.record-card-main,
.record-card-value,
.journal-data,
.journal-signal {
    display: grid;
    gap: 4px;
}

.record-card-top time {
    color: #b9d7e5;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.record-badge {
    justify-self: start;
    padding: 3px 7px;
    border: 1px solid rgba(32, 216, 255, .24);
    border-radius: 5px;
    background: rgba(32, 216, 255, .08);
    color: #72ddf3;
    font-size: 10.5px;
    line-height: 1.2;
}

.record-badge.is-success {
    border-color: rgba(94, 226, 63, .28);
    background: rgba(94, 226, 63, .08);
    color: #7bea68;
}

.record-badge.is-warning {
    border-color: rgba(255, 210, 38, .28);
    background: rgba(255, 210, 38, .08);
    color: #ffe066;
}

.record-badge.is-error {
    border-color: rgba(255, 92, 120, .36);
    background: rgba(210, 15, 55, .14);
    color: #ff9aae;
}

.record-badge.is-muted {
    border-color: rgba(139, 167, 181, .2);
    background: rgba(139, 167, 181, .07);
    color: #90a8b4;
}

.record-card-main strong,
.record-card-value strong {
    overflow: hidden;
    color: #f2f8fb;
    font-size: 14px;
    text-overflow: ellipsis;
}

.record-card-main span,
.record-card-value small,
.journal-data small,
.journal-signal small {
    color: #75a8bf;
    font-size: 11px;
}

.record-card-value strong {
    color: #65e8ff;
}

.event-record {
    grid-template-columns: 164px minmax(220px, 1fr) minmax(140px, auto);
}

.event-record .record-card-value {
    justify-self: end;
    min-width: 140px;
    padding-left: 14px;
    border-left: 1px solid rgba(76, 139, 181, .2);
}

.command-record {
    grid-template-columns: 164px minmax(180px, 1fr) minmax(170px, .78fr) minmax(190px, .9fr);
}

.command-operation,
.command-source {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.command-operation small,
.command-source small {
    color: #75a8bf;
    font-size: 11px;
}

.command-operation strong {
    overflow: hidden;
    color: #65e8ff;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
}

.command-source {
    align-self: stretch;
    align-content: center;
    padding-left: 14px;
    border-left: 1px solid rgba(76, 139, 181, .2);
}

.command-source span {
    color: #d4e5ed;
    font-size: 12.5px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.command-error {
    grid-column: 2 / -1;
    padding-top: 9px;
    color: #ff9aae;
    border-top: 1px solid rgba(255, 92, 120, .22);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.command-record.is-error {
    box-shadow: inset 3px 0 rgba(255, 92, 120, .72);
}

.command-record.is-success {
    box-shadow: inset 3px 0 rgba(94, 226, 63, .5);
}

.command-record.is-waiting {
    box-shadow: inset 3px 0 rgba(255, 210, 38, .48);
}

.event-badge.event-button {
    color: #78e9ff;
}

.event-badge.event-relay {
    border-color: rgba(94, 226, 63, .28);
    background: rgba(94, 226, 63, .08);
    color: #87eb73;
}

.event-badge.event-pwm {
    border-color: rgba(255, 210, 38, .28);
    background: rgba(255, 210, 38, .08);
    color: #ffe16c;
}

.journal-data span,
.journal-signal span {
    color: #d4e5ed;
    font-size: 12.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.journal-signal {
    align-self: stretch;
    align-content: center;
    padding-left: 14px;
    border-left: 1px solid rgba(76, 139, 181, .2);
}

.journal-record.is-error {
    box-shadow: inset 3px 0 rgba(255, 92, 120, .7);
}

.records-filter-empty,
.records-empty {
    padding: 28px 16px;
    background: rgba(5, 24, 40, .96);
    color: #83aabd;
    font-size: 13px;
    text-align: center;
}

.records-filter-empty[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .record-card,
    .event-record {
        grid-template-columns: 150px minmax(160px, .75fr) minmax(230px, 1.25fr);
    }

    .command-record {
        grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr);
    }

    .command-source,
    .command-error {
        grid-column: 2 / -1;
        padding: 8px 0 0;
        border-top: 1px solid rgba(76, 139, 181, .16);
        border-left: 0;
    }

    .journal-signal {
        grid-column: 2 / -1;
        padding: 8px 0 0;
        border-top: 1px solid rgba(76, 139, 181, .16);
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .pin-shell {
        align-items: start;
        padding: 38px 6px 18px;
    }

    .pin-panel {
        width: 100%;
        min-height: calc(100vh - 56px);
        padding: 18px;
        border-radius: 0;
    }

    .pin-brand img {
        width: min(238px, 88%);
    }

    .pin-panel h1 {
        font-size: 24px;
    }

    .pin-key {
        height: 54px;
    }

    .app-header,
    .header,
    .toolbar {
        align-items: center;
        flex-direction: row;
    }

    .toolbar {
        gap: 10px;
    }

    button.ghost {
        width: 100%;
    }

    .log-head .log-clear-button {
        width: 32px;
    }

    .app-header {
        position: sticky;
        top: 0;
        z-index: 40;
        padding: 12px 10px;
    }

    .brand {
        font-size: 21px;
    }

    .brand-logo {
        width: 146px;
        height: auto;
    }

    .subtitle {
        font-size: 12px;
    }

    .top-status {
        min-height: 36px;
        padding: 0 9px;
    }

    .header-actions {
        gap: 8px;
    }

    .profile-text-button {
        min-width: 42px;
        height: 42px;
        padding: 0 10px;
        border-radius: 11px;
    }

    .mobile-menu-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .side-nav {
        display: none;
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        grid-template-columns: 1fr;
        align-content: start;
        max-height: none;
        overflow-y: auto;
        margin: 0;
        gap: 0;
        padding: 10px 18px 28px;
        background:
            linear-gradient(180deg, rgba(7, 17, 27, .96), rgba(8, 15, 24, .99)),
            var(--surface-field);
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: 0 -22px 70px rgba(0, 0, 0, .42);
    }

    body.menu-open .side-nav {
        display: grid;
    }

    .nav-item {
        display: flex;
        align-items: center;
        width: 100%;
        min-width: 0;
        min-height: 54px;
        justify-content: flex-start;
        text-align: left;
        padding: 0 4px;
        border: 0;
        border-bottom: 1px solid rgba(116, 160, 184, .18);
        border-radius: 0;
        background: transparent;
        color: #d7e3ea;
        font-size: 17px;
        font-weight: 500;
    }

    .nav-item.active {
        border-color: rgba(116, 160, 184, .18);
        border-bottom-color: rgba(116, 160, 184, .18);
        background: transparent;
        color: #54d6f0;
        box-shadow: none;
    }

    .nav-item.active::after {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin-left: auto;
        background: #42f178;
        box-shadow: 0 0 12px rgba(66, 241, 120, .44);
    }

    .simple-dashboard {
        gap: 8px;
    }

    .mobile-product-screen {
        width: 100%;
        padding: 10px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .mobile-screen-top {
        min-height: 40px;
        grid-template-columns: 38px 1fr 38px;
    }

    .mobile-screen-top h2 {
        font-size: 18px;
    }

    .mobile-screen-top button {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .schedule-tabs button,
    .settings-device-tabs button {
        min-height: 40px;
        padding: 0 8px;
        font-size: 12px;
    }

    .schedule-card,
    .schedule-general,
    .settings-group {
        border-radius: 10px;
    }

    .schedule-card {
        padding: 13px;
    }

    .schedule-card h3 {
        font-size: 16px;
    }

    .schedule-card strong {
        font-size: 21px;
    }

    .automations-screen {
        gap: 10px;
    }

    .automations-top,
    .automation-builder-preview,
    .automation-templates {
        padding: 14px;
        border-radius: 12px;
    }

    .automations-top {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .automations-top h2,
    .automation-section-head h3 {
        font-size: 20px;
    }

    .automations-top p,
    .automation-section-head span {
        font-size: 13px;
    }

    .entity-add-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }

    .automation-tabs {
        margin-right: -10px;
        padding-right: 10px;
    }

    .automations-list,
    .actions-list,
    .automation-step-grid,
    .automation-templates-grid {
        grid-template-columns: 1fr;
    }

    .automation-card {
        min-height: 0;
        padding: 14px;
    }

    .action-card {
        min-height: 0;
        padding: 14px;
    }

    .action-flow {
        grid-template-columns: 1fr;
    }

    .action-flow i {
        display: none;
    }

    .automation-card-grid {
        grid-template-columns: 1fr 1fr;
    }

    .automation-title > span {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 19px;
    }

    .automation-section-head {
        display: grid;
        gap: 4px;
        margin-bottom: 10px;
    }

    .automation-editor {
        gap: 10px;
        width: 100%;
    }

    .automation-editor-top {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        min-height: 44px;
    }

    .automation-editor-top button {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .automation-active-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 11px 12px;
        border-radius: 12px;
    }

    .automation-editor-block {
        padding: 14px;
        border-radius: 12px;
    }

    .automation-editor-block h3 {
        font-size: 18px;
    }

    .automation-field-grid,
    .automation-edit-row,
    .automation-action-edit-row {
        grid-template-columns: 1fr;
    }

    .automation-inline-select {
        grid-template-columns: 1fr;
    }

    .automation-save-row {
        bottom: 6px;
        display: grid;
        grid-template-columns: 1fr;
    }

    .automation-save-row button {
        width: 100%;
        min-width: 0;
    }

    .settings-hero {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 14px;
    }

    .settings-source-badge {
        min-width: 0;
    }

    .settings-passport-runtime {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .settings-source-badge {
        grid-column: 1 / -1;
    }

    .settings-facts,
    .settings-groups {
        grid-template-columns: 1fr;
    }

    .settings-fact {
        min-height: 78px;
    }

    .settings-device-tabs {
        margin-right: -10px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .settings-row {
        grid-template-columns: minmax(0, .9fr) minmax(90px, 1.1fr) auto;
        min-height: 46px;
        padding: 9px 12px;
    }

    .settings-row strong {
        max-width: none;
    }

    .engineer-note {
        align-items: flex-start;
        gap: 10px;
        min-height: 0;
        padding: 12px;
    }

    .engineer-avatar {
        width: 58px;
        height: 58px;
        min-width: 58px;
    }

    .engineer-note strong {
        font-size: 16px;
    }

    .engineer-note span {
        font-size: 13px;
        line-height: 1.25;
    }

    .engineer-actions {
        margin-top: 8px;
    }

    .engineer-actions button {
        min-width: 88px;
        height: 36px;
    }

    .engineer-close {
        width: 36px;
        min-width: 36px;
        height: 36px;
    }

    .system-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .system-chip {
        min-width: 0;
        min-height: 44px;
        padding: 8px 10px;
        border-radius: 11px;
    }

    .system-chip .card-status {
        width: 11px;
        height: 11px;
    }

    .system-chip h3 {
        min-width: 0;
        font-size: 14px;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .quick-controls,
    .weather-panel,
    .scenes-strip,
    .history-toolbar,
    .history-chart-wrap {
        padding: 8px;
    }

    .weather-panel,
    .scenes-strip {
        padding: 15px;
        border-radius: 15px;
    }

    .quick-controls {
        border-color: var(--border);
        background: var(--surface);
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .quick-button {
        min-height: 104px;
        grid-template-columns: 1fr;
        gap: 5px 9px;
        padding: 10px;
        border-radius: 8px;
    }

    .quick-button h3 {
        align-self: start;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.25;
    }

    .quick-button span:last-child {
        grid-column: 1;
        font-size: 13px;
    }

    .quick-state {
        gap: 7px;
        font-size: 13px;
    }

    .quick-state .quick-led,
    .quick-slider-title em .quick-led {
        width: 10px;
        height: 10px;
        min-width: 10px;
        flex: 0 0 10px;
        aspect-ratio: 1;
    }

    .quick-slider {
        min-height: 104px;
        grid-template-columns: 1fr;
        gap: 5px 9px;
        padding: 10px;
        border-radius: 8px;
    }

    .control-pwm-card.action-quick {
        min-height: 148px;
    }

    .pwm-preset-row {
        padding-top: 8px;
    }

    .quick-slider > .range-shell {
        grid-column: 1;
    }

    .quick-slider h3 {
        font-size: 16px;
        font-weight: 400;
        line-height: 1.25;
    }

    .quick-slider b {
        font-size: 28px;
    }

    .quick-slider input[type="range"] {
        height: 34px;
        margin-top: 0;
    }

    .quick-slider input[type="range"]::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
        margin-top: -8px;
        box-shadow: 0 0 0 4px var(--pwm-glow), 0 3px 8px rgba(0, 0, 0, .28);
    }

    .quick-slider input[type="range"]::-moz-range-thumb {
        width: 26px;
        height: 26px;
        box-shadow: 0 0 0 4px var(--pwm-glow), 0 3px 8px rgba(0, 0, 0, .28);
    }

    .quick-slider input[type="range"]::-webkit-slider-runnable-track,
    .quick-slider input[type="range"]::-moz-range-track {
        height: 8px;
    }

    .quick-slider input[type="range"]::-moz-range-progress {
        height: 8px;
    }

    .quick-slider-title em {
        font-size: 13px;
        font-weight: 400;
        line-height: 1.25;
    }

    .range-scale {
        font-size: 12px;
        margin-top: 8px;
        padding: 0 2px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric {
        min-height: 132px;
        padding: 11px;
    }

    .metric-press {
        grid-column: 1 / -1;
        min-height: 116px;
    }

    .metric-icon {
        width: 33px;
        min-width: 33px;
        height: 33px;
    }

    .metric-icon svg {
        width: 19px;
        height: 19px;
    }

    .metric-name {
        font-size: 12px;
    }

    .metric-reading strong {
        font-size: 30px;
    }

    .metric-press .metric-reading strong {
        font-size: 32px;
    }

    .scene-pill {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        min-height: 88px;
        gap: 12px;
        padding: 13px 14px;
    }

    .scene-icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        font-size: 20px;
    }

    .scene-copy > div {
        display: block;
    }

    .scene-copy p {
        font-size: 13px;
    }

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

    .history-presets {
        display: grid;
    }

    .history-period-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .history-period-buttons button {
        min-width: 0;
        padding: 0 7px;
        font-size: 12px;
    }

    .history-chart-wrap {
        height: 380px;
        min-height: 380px;
    }

    .history-series {
        display: flex;
    }

    .firmware-hero {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .firmware-hero-stats {
        grid-column: 1 / -1;
        width: 100%;
    }

    .firmware-hero-stats article {
        min-width: 0;
        padding: 9px 8px;
    }

    .firmware-hero-stats span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .firmware-workspace {
        grid-template-columns: 1fr;
    }

    .firmware-section-head {
        display: grid;
        gap: 4px;
    }

    .firmware-section-head > small {
        text-align: left;
    }

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

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

    .firmware-form label.wide {
        grid-column: auto;
    }

    .firmware-form button {
        grid-column: auto;
        width: 100%;
    }

    .log-head h3 {
        font-size: 16px;
    }

    .log-panel {
        padding: 10px;
    }

    #log {
        height: 132px;
        min-height: 104px;
        font-size: 11.5px;
    }

    .action-run-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .action-run-row em {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .automation-log-row > div {
        align-items: flex-start;
    }

    .data-table {
        min-width: 680px;
        font-size: 12px;
    }

    .records-panel {
        border-radius: 11px;
    }

    .records-toolbar {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .records-filter {
        width: 100%;
    }

    .record-card,
    .event-record {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 11px 14px;
        padding: 13px 12px;
    }

    .command-record {
        grid-template-columns: 1fr;
    }

    .command-record .record-card-main,
    .command-operation,
    .command-source,
    .command-error {
        grid-column: 1 / -1;
    }

    .command-operation,
    .command-source {
        padding: 9px 0 0;
        border-top: 1px solid rgba(76, 139, 181, .16);
        border-left: 0;
    }

    .record-card-top {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .record-card-main {
        grid-column: 1 / 2;
    }

    .record-card-value {
        grid-column: 2 / 3;
    }

    .event-record .record-card-value {
        min-width: 0;
        padding-left: 12px;
    }

    .journal-data,
    .journal-signal {
        grid-column: 1 / -1;
    }

    .journal-signal {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding-top: 9px;
    }

    .journal-signal span {
        text-align: right;
    }

    .messages-panel {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 168px);
        border-radius: 10px;
    }

    .messages-dialogs {
        min-height: calc(100vh - 168px);
        border-right: 0;
    }

    .message-chat {
        display: none;
        min-height: calc(100vh - 168px);
    }

    .messages-panel.dialog-open .messages-dialogs {
        display: none;
    }

    .messages-panel.dialog-open .message-chat {
        display: grid;
    }

    .message-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .message-feed {
        padding: 12px;
    }

    .message-item {
        max-width: 88%;
    }

    .message-compose-row {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .message-send {
        grid-column: 1 / -1;
        width: 100%;
    }

    .account-overlay {
        inset: 76px 0 0;
        overflow: hidden;
    }

    .account-shell {
        width: 100%;
        min-height: 0;
        max-height: calc(100vh - 76px);
        height: calc(100vh - 76px);
        margin: 0;
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        border-radius: 0;
    }

    .account-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
        height: 100%;
        min-height: 0;
        max-height: calc(100vh - 76px);
        padding: 14px 14px 44px;
        padding-bottom: max(44px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .account-card {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto;
        min-height: 0 !important;
        height: auto !important;
        padding: 14px;
        border-radius: var(--control-radius);
        gap: 10px;
        overflow: visible;
    }

    .account-card p {
        line-height: 1.35;
    }

    .account-profile-card {
        grid-row: auto;
    }

    .account-support-card {
        grid-column: auto;
    }

    .account-profile-top {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .account-avatar {
        width: 76px;
        height: 76px;
    }

    .account-support-avatar {
        width: 64px;
        height: 64px;
    }

    .account-support-person {
        gap: 12px;
    }

    .account-profile-top h3 {
        font-size: 18px;
    }

    .account-contact-list {
        grid-template-columns: 1fr;
    }

    .account-edit-fields {
        grid-template-columns: 1fr;
    }

    .account-edit-wide {
        grid-column: auto;
    }

    .account-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

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

    .account-big {
        font-size: 42px;
    }

    .account-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .account-stat-grid span {
        min-height: 64px;
        padding: 8px 4px;
    }

    .account-stat-grid b {
        font-size: 24px;
        line-height: 1;
    }

    .account-stat-grid small {
        max-width: 100%;
        overflow-wrap: anywhere;
        text-align: center;
        line-height: 1.15;
    }

    .account-pin-form,
    .device-claim-form,
    .account-edit-form.open {
        gap: 9px;
    }

    .account-pin-form input,
    .device-claim-form input,
    .account-edit-form input,
    .account-edit-form textarea {
        min-height: 42px;
    }

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

    .device-claim-form label:first-child,
    .device-claim-actions,
    .device-claim-form .form-result {
        grid-column: auto;
    }
}

@media (min-width: 641px) and (max-width: 860px) {
    .app-layout {
        display: block;
        padding: 12px;
    }

    .side-nav {
        position: static;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-bottom: 14px;
        padding: 8px;
        scrollbar-width: thin;
    }

    .nav-item {
        width: auto;
        min-width: max-content;
        padding: 0 14px;
    }

    .content-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .content-head.has-section-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 0 8px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .profile-menu {
        left: 0;
        right: auto;
    }

    .account-overlay {
        inset: 76px 0 0;
        overflow: hidden;
    }

    .account-shell {
        width: 100%;
        min-height: 0;
        max-height: calc(100vh - 76px);
        height: calc(100vh - 76px);
        margin: 0;
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        border-radius: 0;
    }

    .account-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
        height: 100%;
        min-height: 0;
        max-height: calc(100vh - 76px);
        padding: 14px 14px 44px;
        padding-bottom: max(44px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .account-card {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto;
        min-height: 0 !important;
        height: auto !important;
        padding: 14px;
        border-radius: var(--control-radius);
        gap: 10px;
        overflow: visible;
    }

    .account-profile-card {
        grid-row: auto;
    }

    .account-support-card {
        grid-column: auto;
    }

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

    .account-profile-top {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .account-avatar {
        width: 76px;
        height: 76px;
    }

    .account-profile-top h3 {
        font-size: 18px;
    }

    .account-contact-list {
        grid-template-columns: 1fr;
    }

    .account-edit-fields {
        grid-template-columns: 1fr;
    }

    .account-edit-wide {
        grid-column: auto;
    }

    .account-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .account-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .app-layout {
        display: block;
        width: 100%;
        padding: 6px;
    }

    .section-content,
    .simple-dashboard,
    .quick-controls,
    .quick-grid {
        width: 100%;
    }

    .detail-hero,
    .config-push-panel,
    .config-section-head {
        display: grid;
        grid-template-columns: 1fr;
        text-align: left;
    }

    .detail-cfg {
        text-align: left;
    }

    .detail-grid,
    .detail-grid.two {
        grid-template-columns: 1fr;
    }

    .config-blueprint-hero {
        grid-template-columns: 1fr;
        gap: 13px;
        padding: 15px;
    }

    .config-blueprint-stats {
        width: 100%;
    }

    .config-blueprint-stats article {
        min-width: 0;
        padding: 9px 8px;
    }

    .config-blueprint-principles,
    .config-blueprint-grid,
    .device-configuration-grid,
    .local-config-blocks,
    .local-config-examples > div,
    .device-role-contract {
        grid-template-columns: 1fr;
    }

    .device-role-contract dl > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .device-configuration-overview {
        margin-top: 12px;
        padding: 14px;
    }

    .device-configuration-head,
    .device-configuration-admin {
        display: grid;
        justify-items: start;
    }

    .config-output-guide {
        grid-template-columns: 1fr;
    }

    .config-output-types {
        justify-content: flex-start;
    }

    .device-configuration-card-head {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .device-configuration-card-head em {
        grid-column: 2;
        justify-self: start;
    }

    .device-configuration-card dl > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .config-blueprint-principles article {
        min-height: 0;
    }

    .config-blueprint-section-head {
        display: grid;
        gap: 5px;
    }

    .config-blueprint-section-head > small {
        text-align: left;
    }

    .config-local-flow {
        grid-template-columns: 1fr;
    }

    .config-local-flow article {
        min-height: 0;
    }

    .config-local-flow i {
        line-height: 14px;
        transform: rotate(90deg);
    }

    .config-blueprint-card-head {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .config-blueprint-card-head em {
        grid-column: 2;
        justify-self: start;
    }

    .config-binding-list article {
        grid-template-columns: 1fr;
    }

    .config-binding-list em {
        justify-self: start;
    }
}

@media (min-width: 1500px) {
    .cards {
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    }
}

.content-head h1 {
    line-height: 1.08;
    white-space: pre-line;
}

.message-detail-mode .content-head {
    display: none;
}

button.ui-back-button,
.account-card button.ui-back-button,
.automation-editor-top button.ui-back-button,
.message-chat-head button.ui-back-button {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: #a9ecff;
    background:
        radial-gradient(circle at 30% 18%, rgba(32, 216, 255, .12), transparent 48%),
        linear-gradient(160deg, rgba(9, 43, 67, .96), rgba(3, 23, 39, .98));
    border: 1px solid rgba(68, 167, 204, .4);
    border-radius: 10px;
    box-shadow: 0 9px 20px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .03);
    font-size: 0;
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

button.ui-back-button:hover,
button.ui-back-button:focus-visible,
.account-card button.ui-back-button:hover,
.account-card button.ui-back-button:focus-visible,
.automation-editor-top button.ui-back-button:hover,
.automation-editor-top button.ui-back-button:focus-visible {
    color: #effdff;
    border-color: rgba(32, 216, 255, .72);
    background: linear-gradient(160deg, rgba(12, 62, 88, .98), rgba(4, 31, 50, .99));
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .09), 0 10px 24px rgba(0, 0, 0, .2);
    transform: translateY(-1px);
}

button.ui-back-button:active {
    transform: translateY(0);
}

button.ui-back-button svg,
.account-card button.ui-back-button svg,
.automation-editor-top button.ui-back-button svg,
.message-chat-head button.ui-back-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.device-detail-back {
    display: flex;
}

.messages-panel {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    min-height: min(720px, calc(100vh - 210px));
    background:
        radial-gradient(circle at 100% 0%, rgba(32, 216, 255, .07), transparent 34%),
        linear-gradient(160deg, rgba(9, 40, 62, .97), rgba(3, 18, 31, .99));
    border-color: rgba(68, 145, 185, .32);
    border-radius: 14px;
    box-shadow: 0 22px 54px rgba(0, 0, 0, .2);
}

.messages-dialogs {
    grid-template-rows: 1fr;
    border-right-color: rgba(68, 145, 185, .24);
    background: rgba(4, 22, 37, .56);
}

.messages-dialog-list {
    gap: 9px;
    padding: 10px;
    scrollbar-color: rgba(80, 171, 205, .42) transparent;
}

.message-dialog {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 76px;
    padding: 11px 12px;
    background: linear-gradient(150deg, rgba(10, 43, 66, .9), rgba(4, 25, 42, .96));
    border: 1px solid rgba(67, 146, 186, .25);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .1);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.message-dialog:hover,
.message-dialog.active {
    border-color: rgba(32, 216, 255, .55);
    background: linear-gradient(150deg, rgba(14, 61, 88, .96), rgba(5, 31, 50, .98));
    transform: translateY(-1px);
}

.message-dialog.active {
    box-shadow: inset 3px 0 #20d8ff, 0 12px 28px rgba(0, 0, 0, .16);
}

.message-user-avatar {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at 32% 25%, rgba(111, 235, 255, .32), transparent 38%),
        linear-gradient(145deg, #0b6684, #07334f);
    border: 1px solid rgba(82, 221, 247, .58);
    border-radius: 50%;
    color: #eaffff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 0 0 3px rgba(32, 216, 255, .07), 0 8px 18px rgba(0, 0, 0, .2);
}

.message-user-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-dialog-avatar {
    width: 46px;
    height: 46px;
}

.message-dialog-main strong {
    color: #f2f9fc;
    font-weight: 500;
}

.message-dialog-main small {
    color: #83b0c3;
}

.message-dialog-side svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #4ba7c4;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.message-chat-head {
    min-height: 68px;
    padding: 11px 14px;
    border-bottom-color: rgba(68, 145, 185, .24);
    background: rgba(7, 31, 50, .72);
}

.message-chat-head h2 {
    color: #f1f8fb;
    font-size: 17px;
    font-weight: 500;
}

.message-chat-avatar {
    width: 42px;
    min-width: 42px;
    height: 42px;
}

.message-chat-avatar[hidden] {
    display: none;
}

.message-chat-head button.message-back {
    display: none;
}

.message-avatar {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

.message-meta strong {
    color: #8fe7f8;
    font-size: 12px;
    font-weight: 500;
}

.message-file.is-missing {
    display: grid;
    place-items: center;
    min-width: 130px;
    min-height: 96px;
    padding-top: 30px;
    background:
        radial-gradient(circle at 50% 32%, rgba(32, 216, 255, .12), transparent 28%),
        rgba(3, 20, 34, .9);
}

.message-file.is-missing::before {
    content: "Фото";
    position: absolute;
    top: 24px;
    color: #74cfe5;
    font-size: 12px;
}

.message-tool,
.message-send,
.message-composer textarea {
    border-radius: 10px;
}

@media (max-width: 640px) {
    .support-team {
        gap: 13px;
        padding: 14px;
    }

    .support-team-head {
        align-items: flex-start;
    }

    .specialist-grid {
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
        padding-bottom: 0;
    }

    .specialist-card {
        grid-template-columns: minmax(0, 1fr) 102px;
        min-height: 148px;
    }

    .specialist-portrait {
        width: 102px;
        height: 102px;
    }

    .support-composer {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .support-voice-stage {
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-rows: auto 54px;
        gap: 3px 22px;
        min-height: 132px;
        padding: 8px 0 0;
    }

    .support-wave {
        gap: 3px;
        padding: 0;
    }

    .support-text-or {
        margin: 16px 0 14px;
    }

    .support-voice-prompt {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
    }

    .support-compose-row {
        grid-template-columns: minmax(0, 1fr) 54px;
    }

    .support-compose-row textarea {
        grid-column: 1;
    }

    .support-send {
        width: 54px;
        min-width: 54px;
        padding: 0;
    }

    .support-send span {
        display: none;
    }

    .support-send svg {
        width: 22px;
        height: 22px;
    }

    .support-send-result,
    .support-composer > .voice-recorder {
        grid-column: 1;
    }

    .voice-recorder-status {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .voice-recorder-status > span:last-child {
        grid-column: 2;
    }

    .messages-panel {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 168px);
        border-radius: 11px;
    }

    .message-detail-mode .messages-panel,
    .message-detail-mode .messages-dialogs,
    .message-detail-mode .message-chat {
        min-height: calc(100vh - 92px);
    }

    .messages-dialogs {
        min-height: calc(100vh - 168px);
        border-right: 0;
    }

    .message-chat {
        display: none;
        min-height: calc(100vh - 168px);
    }

    .messages-panel.dialog-open .messages-dialogs {
        display: none;
    }

    .messages-panel.dialog-open .message-chat {
        display: grid;
    }

    .message-dialog {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        min-height: 74px;
    }

    .message-chat-head button.ui-back-button,
    .automation-editor-top button.ui-back-button,
    .account-card button.ui-back-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .message-chat-head button.message-back {
        display: grid;
    }

    .message-compose-row {
        grid-template-columns: repeat(3, 42px) minmax(0, 1fr);
    }

    .message-composer textarea {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .message-send {
        grid-column: 4;
        grid-row: 2;
        justify-self: end;
    }

    .message-voice {
        grid-template-columns: 30px minmax(150px, 1fr);
        min-width: min(260px, 70vw);
    }
}

body.quick-actions-open {
    overflow: hidden;
}

.quick-actions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 240;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    background: rgba(1, 10, 18, .72);
    border: 0;
    border-radius: 0;
    backdrop-filter: blur(3px);
    transition: opacity .26s ease;
}

.quick-actions-open .quick-actions-backdrop {
    pointer-events: auto;
    opacity: 1;
}

.quick-actions-sheet {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 250;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(520px, 100vw);
    height: 100vh;
    height: 100dvh;
    padding:
        max(10px, env(safe-area-inset-top))
        12px
        max(12px, env(safe-area-inset-bottom));
    overflow: hidden;
    color: #eaf6fb;
    background:
        radial-gradient(circle at 80% 3%, rgba(32, 216, 255, .1), transparent 28%),
        radial-gradient(circle at 12% 86%, rgba(32, 216, 255, .05), transparent 34%),
        linear-gradient(180deg, #08243a 0%, #061a2c 52%, #041522 100%);
    border-left: 1px solid rgba(68, 145, 185, .34);
    box-shadow: -24px 0 60px rgba(0, 0, 0, .38);
    transform: translateX(104%);
    transition: transform .3s cubic-bezier(.22, .8, .24, 1);
}

.quick-actions-sheet[aria-hidden="true"] {
    pointer-events: none;
}

.quick-actions-open .quick-actions-sheet {
    transform: translateX(0);
}

.quick-actions-handle {
    justify-self: center;
    width: 54px;
    height: 5px;
    margin: 0 0 9px;
    background: rgba(157, 184, 198, .52);
    border-radius: 999px;
}

.quick-actions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 66px;
    margin-bottom: 8px;
    padding: 2px 2px 10px;
    border-bottom: 1px solid rgba(68, 145, 185, .2);
}

.quick-actions-head h2 {
    margin: 0;
    color: #f2f9fc;
    font-size: 23px;
    font-weight: 500;
    letter-spacing: -.02em;
}

.quick-actions-head p {
    margin: 4px 0 0;
    color: #78a8bf;
    font-size: 12px;
}

.quick-actions-head > button {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: #a9ecff;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.quick-actions-head > button:hover,
.quick-actions-head > button:focus-visible {
    color: #fff;
    border-color: var(--border-active);
}

.quick-actions-head > button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.quick-command-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding: 4px 1px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 153, 190, .48) transparent;
}

.quick-command-tile {
    --quick-command-color: var(--accent);
    display: grid;
    grid-template-rows: 52px minmax(38px, 1fr) auto;
    place-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 150px;
    padding: 14px 8px 11px;
    color: #e9f4f8;
    text-align: center;
    background:
        radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--quick-command-color) 8%, transparent), transparent 48%),
        linear-gradient(160deg, rgba(10, 42, 64, .94), rgba(4, 24, 40, .98));
    border: 1px solid rgba(68, 145, 185, .28);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
    transition: border-color .16s ease, background .16s ease, transform .16s ease, opacity .16s ease;
}

.quick-command-tile:hover,
.quick-command-tile:focus-visible {
    border-color: color-mix(in srgb, var(--quick-command-color) 58%, var(--border));
    transform: translateY(-1px);
}

.quick-command-tile:active {
    transform: scale(.98);
}

.quick-command-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: var(--quick-command-color);
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--quick-command-color) 28%, transparent));
}

.quick-command-icon svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick-command-tile > strong {
    align-self: center;
    max-width: 100%;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.24;
    text-overflow: ellipsis;
}

.quick-command-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 15px;
    color: #789caf;
    font-size: 10px;
    line-height: 1;
}

.quick-command-state .action-dot {
    width: 10px;
    min-width: 10px;
    height: 10px;
}

.quick-actions-levels {
    grid-column: 1 / -1;
    display: grid;
    gap: 11px;
    margin-top: 6px;
    padding: 16px 1px 2px;
    border-top: 1px solid rgba(68, 145, 185, .24);
}

.quick-actions-levels-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.quick-actions-levels-head h3 {
    margin: 0;
    color: #eef8fb;
    font-size: 18px;
    font-weight: 500;
}

.quick-actions-levels-head p {
    margin: 4px 0 0;
    color: #789fb1;
    font-size: 11px;
}

.quick-actions-levels-head > span {
    color: #69d8ed;
    font-size: 12px;
}

.quick-actions-level-list {
    display: grid;
    gap: 10px;
}

.quick-actions-level-card {
    min-height: 164px;
    padding: 15px;
    background:
        radial-gradient(circle at 100% 0%, var(--pwm-glow), transparent 34%),
        linear-gradient(160deg, rgba(10, 42, 64, .96), rgba(4, 24, 40, .99));
    border-color: rgba(68, 145, 185, .3);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}

.quick-actions-level-card .pwm-preset-row {
    margin-top: 2px;
}

.quick-command-tile.on .quick-command-state,
.quick-command-tile.ack-ok .quick-command-state {
    color: #9fe5b4;
}

.quick-command-tile.ack-wait {
    border-color: rgba(32, 216, 255, .58);
}

.quick-command-tile.ack-wait .action-dot {
    background: var(--warning);
    border-color: rgba(255, 210, 38, .78);
    box-shadow: 0 0 12px rgba(255, 210, 38, .46);
}

.quick-command-tile.ack-fail {
    border-color: rgba(210, 15, 55, .62);
}

.quick-command-tile.is-demo {
    background: linear-gradient(160deg, rgba(9, 35, 54, .9), rgba(4, 22, 36, .96));
}

.quick-command-tile.demo-tapped {
    border-color: var(--border-active);
    background:
        radial-gradient(circle at 50% 12%, rgba(32, 216, 255, .13), transparent 46%),
        linear-gradient(160deg, rgba(11, 49, 72, .96), rgba(4, 25, 41, .98));
}

.quick-actions-footer {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 1px 0;
    border-top: 1px solid rgba(68, 145, 185, .2);
}

.quick-actions-footer button.quick-actions-back {
    grid-column: 1;
}

.quick-actions-pages {
    grid-column: 2;
    display: flex;
    justify-content: center;
    gap: 9px;
}

.quick-actions-pages i {
    width: 9px;
    height: 9px;
    background: #41596a;
    border: 1px solid rgba(182, 211, 224, .18);
    border-radius: 50%;
}

.quick-actions-pages i.active {
    background: var(--accent);
    border-color: rgba(32, 216, 255, .86);
    box-shadow: 0 0 10px rgba(32, 216, 255, .38);
}

@media (max-width: 640px) {
    .calm-overview {
        grid-template-columns: minmax(0, 1fr) 74px;
        gap: 16px 10px;
        padding: 19px 17px;
    }

    .calm-symbol {
        width: 70px;
        height: 70px;
    }

    .calm-symbol svg {
        width: 49px;
        height: 49px;
    }

    .calm-copy h2 {
        font-size: 29px;
    }

    .calm-copy p {
        font-size: 13px;
    }

    .calm-facts {
        grid-template-columns: 1fr;
    }

    .quick-actions-sheet {
        width: 100vw;
        padding-right: 10px;
        padding-left: 10px;
        border-left: 0;
    }

    .quick-command-grid {
        gap: 8px;
    }

    .quick-command-tile {
        min-height: 143px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .quick-actions-level-card {
        min-height: 158px;
        padding: 14px;
    }
}

@media (max-width: 370px) {
    .quick-command-grid {
        gap: 6px;
    }

    .quick-command-tile {
        grid-template-rows: 44px minmax(34px, 1fr) auto;
        min-height: 132px;
        padding: 11px 4px 9px;
    }

    .quick-command-icon,
    .quick-command-icon svg {
        width: 43px;
        height: 43px;
    }

    .quick-command-tile > strong {
        font-size: 11.5px;
    }

    .quick-command-state {
        gap: 4px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-actions-backdrop,
    .quick-actions-sheet,
    .quick-command-tile {
        transition: none;
    }
}
