:root {
    --bg: #111827;
    --top: #0f172a;
    --panel: #ffffff;
    --soft: #f3f6fa;
    --line: #d6dde8;
    --text: #111827;
    --muted: #64748b;
    --accent: #0b6bcb;
    --accent-strong: #084f99;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --success: #087443;
    --success-soft: #dcfae6;
    --warn: #b54708;
    --warn-soft: #fef0c7;
    --offline: #475467;
    --touch: #f97316;
    --app-pad: clamp(6px, 1.35vmin, 14px);
    --app-gap: clamp(6px, 1.25vmin, 12px);
    --top-icon-size: clamp(46px, 13.4vmin, 72px);
    --topbar-height: calc(var(--top-icon-size) + clamp(18px, 4vmin, 28px));
    --title-size: clamp(28px, 8.75vmin, 48px);
    --card-title-size: clamp(26px, 8.2vmin, 44px);
    --card-icon-size: clamp(50px, 14vmin, 74px);
    --phase-u-size: clamp(32px, 10.5vw, 52px);
    --phase-i-size: clamp(28px, 8.8vw, 44px);
    --phase-p-size: clamp(24px, 7.4vw, 36px);
    --total-value-size: clamp(28px, 9vw, 48px);
    --detail-value-size: clamp(26px, 7.6vw, 42px);
    --phase-strip-height: clamp(24px, 6.4vmin, 34px);
    --detail-phase-strip-height: clamp(24px, 5.4vw, 34px);
    --detail-phase-label-size: clamp(18px, 4.2vw, 24px);
    --detail-phase-main-size: clamp(38px, 9.4vw, 46px);
    --detail-phase-sub-size: var(--detail-phase-main-size);
    --ui-text-size: var(--detail-phase-label-size);
    --ui-scale: 1;
    --scaled-width: 100vw;
    --scaled-height: 100dvh;
}

/* Template-driven device settings and protection summaries.
 * Device-specific labels, values, ordering and visibility are supplied by the
 * selected JSON template. These classes only define a readable panel layout. */
.device-settings-template,
.device-settings-groups,
.device-protection-detail,
.device-protection-groups {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.device-settings-template:empty {
    display: none;
}

.device-settings-group {
    display: grid;
    min-width: 0;
    gap: 10px;
    border: 1px solid #cfdbea;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
}

.device-settings-group-head {
    display: flex;
    min-width: 0;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.device-settings-group-heading {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.device-settings-group-icon,
.device-protection-overview-icon {
    display: grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 9px;
    background: #eaf3ff;
    color: var(--accent-strong);
}

.device-settings-group-icon svg,
.device-protection-overview-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.device-settings-group-title {
    min-width: 0;
    overflow: visible;
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.device-settings-group-state {
    display: inline-flex;
    min-height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f1f5f9;
    padding: 6px 12px;
    color: var(--offline);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.device-settings-group-state.is-on {
    border-color: #9fdab7;
    background: var(--success-soft);
    color: var(--success);
}

.device-settings-group-state.is-off {
    border-color: #d7dee8;
    background: #f5f7fa;
    color: var(--offline);
}

.device-settings-group-state.is-warning,
.device-settings-group-state.is-unknown {
    border-color: #efc66c;
    background: #fff7df;
    color: #805400;
}

.device-setting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 8px;
}

.device-setting-item {
    display: grid;
    min-width: 0;
    min-height: 72px;
    align-content: center;
    gap: 4px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 9px 10px;
}

.device-setting-item.is-switch {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.device-setting-item.is-readonly {
    border-color: #d7dee8;
    background: #f1f4f8;
}

.device-setting-item.is-readonly input:disabled {
    opacity: 1;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.device-setting-label {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.12;
}

.device-setting-value {
    overflow: hidden;
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.device-setting-control input,
.device-setting-control select {
    width: 100%;
    min-height: 56px;
    font-size: 24px;
    font-weight: 850;
}

.device-setting-item.is-stepper {
    align-content: stretch;
    gap: 7px;
}

.device-setting-item.is-stepper .device-setting-control {
    display: grid;
    gap: 6px;
}

.device-setting-stepper {
    display: grid;
    grid-template-columns: 64px minmax(92px, 1fr) 64px;
    gap: 7px;
}

.device-setting-step-button,
.device-setting-step-value {
    min-height: 60px;
    border: 2px solid #9bc3e9;
    border-radius: 9px;
    background: #ffffff;
    color: var(--accent-strong);
    font-weight: 900;
}

.device-setting-step-button {
    padding: 0;
    font-size: 38px;
    line-height: 1;
}

.device-setting-step-value {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    padding: 6px 10px;
}

.device-setting-step-value strong {
    font-size: 30px;
    font-variant-numeric: tabular-nums;
}

.device-setting-step-value span {
    color: var(--muted);
    font-size: 20px;
}

.device-setting-step-button:disabled,
.device-setting-step-value:disabled {
    border-color: #cbd5e1;
    background: #eef2f6;
    color: #667085;
    opacity: 1;
}

.device-setting-step-button:focus-visible,
.device-setting-step-value:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.device-setting-readback-warning {
    border: 1px solid #efc66c;
    border-radius: 7px;
    background: #fff7df;
    padding: 7px 9px;
    color: #704b00;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
}

.device-setting-item.has-readback-warning {
    border-color: #efc66c;
    background: #fffaf0;
}

.device-setting-switch {
    position: relative;
    display: inline-flex;
    width: 76px;
    min-height: 44px;
    flex: 0 0 76px;
    align-items: center;
    border: 2px solid #aab7c7;
    border-radius: 999px;
    background: #e9eef4;
    padding: 3px;
}

.device-setting-item.is-switch .device-setting-control {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.device-setting-control .device-setting-switch-input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.device-setting-switch-knob {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
    transition: transform 120ms ease-out;
}

.device-setting-switch.is-on,
.device-setting-switch-input:checked + .device-setting-switch {
    border-color: var(--success);
    background: var(--success);
}

.device-setting-switch.is-on .device-setting-switch-knob,
.device-setting-switch-input:checked + .device-setting-switch .device-setting-switch-knob {
    transform: translateX(32px);
}

.device-setting-switch-input:disabled + .device-setting-switch {
    opacity: 0.72;
}

.device-settings-message {
    display: grid;
    min-height: 72px;
    place-items: center;
    border: 1px dashed #b9c5d4;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    color: var(--offline);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.device-settings-empty {
    display: grid;
    min-height: 72px;
    place-items: center;
    border: 1px dashed #b9c5d4;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    color: var(--offline);
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.device-protection-overview {
    display: grid;
    min-width: 0;
    min-height: 76px;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #c7d9ed;
    border-radius: 10px;
    background: #f2f7fd;
    padding: 10px 12px;
}

.device-protection-overview-copy {
    min-width: 0;
}

.device-protection-overview-copy strong,
.device-protection-overview-copy span {
    display: block;
}

.device-protection-overview-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-protection-overview-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.12;
}

.breaker-card.has-protection-summary {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.breaker-live-summary {
    display: none;
}

.breaker-protection-summary {
    display: grid;
    min-width: 0;
    gap: 6px;
    margin-top: var(--app-gap);
    border: 1px solid #c8daee;
    border-radius: 8px;
    background: #f1f7fd;
    padding: 7px;
    color: #173f69;
}

.breaker-protection-summary-title {
    overflow: hidden;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-protection-items {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
    gap: 6px;
}

.breaker-protection-item,
.breaker-protection-more {
    display: grid;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    border: 1px solid #c7d9ed;
    border-radius: 7px;
    background: #ffffff;
    padding: 5px 7px;
}

.breaker-protection-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
}

.breaker-protection-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: var(--accent-strong);
}

.breaker-protection-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.breaker-protection-copy {
    min-width: 0;
}

.breaker-protection-label,
.breaker-protection-value {
    display: block;
    overflow: hidden;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-protection-label {
    color: var(--muted);
    font-size: 20px;
    font-weight: 800;
}

.breaker-protection-value {
    margin-top: 2px;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.breaker-protection-more {
    place-items: center;
    color: var(--accent-strong);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.breaker-protection-summary.is-empty,
.breaker-protection-summary.is-loading,
.breaker-protection-summary.is-stale {
    border-color: #d4dde8;
    background: #f7f9fb;
    color: var(--offline);
}

.breaker-protection-summary.is-warning {
    border-color: #edc66f;
    background: #fff8e4;
    color: #7a5000;
}

.breaker-protection-message {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: currentColor;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.15;
}

/* XIOT-TP4: retain full labels and use scrolling instead of reducing type. */
@media (orientation: landscape) and (max-width: 849px) {
    html:not(.remote-client) .breaker-protection-summary-title,
    html:not(.remote-client) .breaker-protection-label,
    html:not(.remote-client) .breaker-protection-message,
    html:not(.remote-client) .device-setting-label,
    html:not(.remote-client) .device-settings-message {
        font-size: 20px;
    }

    html:not(.remote-client) .breaker-protection-value,
    html:not(.remote-client) .breaker-protection-more {
        font-size: 22px;
    }

    html:not(.remote-client) .breaker-protection-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .device-settings-groups,
    html:not(.remote-client) .device-protection-groups {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (orientation: landscape) and (max-width: 620px) {
    html:not(.remote-client) .breaker-protection-items,
    html:not(.remote-client) .device-setting-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* XIOT-TP8: density changes the amount and arrangement of information, never
 * the type below the 18 px readability floor. */
@media (orientation: landscape) and (min-width: 850px) and (max-width: 1050px) {
    html:not(.remote-client) .device-settings-groups,
    html:not(.remote-client) .device-protection-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    html:not(.remote-client) .device-protection-groups {
        align-items: start;
    }

    html:not(.remote-client) #breakerSettingsGroups {
        align-items: start;
    }

    html:not(.remote-client) #breakerSettingsGroups > .device-settings-group {
        align-content: start;
        align-self: start;
    }

    html:not(.remote-client) .device-protection-detail .device-settings-group {
        align-content: start;
        align-self: start;
    }

    html:not(.remote-client) .device-protection-detail .device-setting-item.is-switch {
        grid-template-columns: minmax(0, 1fr);
        align-content: center;
        align-items: start;
        gap: 4px;
    }

    html:not(.remote-client) .device-protection-detail .device-setting-label {
        overflow-wrap: normal;
        word-break: normal;
    }

    html:not(.remote-client) .device-settings-group {
        gap: 8px;
        padding: 9px;
    }

    html:not(.remote-client) .device-settings-group-title {
        font-size: 24px;
        overflow-wrap: normal;
        word-break: normal;
    }

    html:not(.remote-client) .device-settings-group-state,
    html:not(.remote-client) .device-setting-label,
    html:not(.remote-client) .device-settings-message,
    html:not(.remote-client) .device-protection-overview-copy span {
        font-size: 20px;
    }

    html:not(.remote-client) .device-settings-group-state {
        padding-right: 9px;
        padding-left: 9px;
        font-size: 18px;
    }

    html:not(.remote-client) .device-setting-value,
    html:not(.remote-client) .device-protection-overview-copy strong {
        font-size: 26px;
    }

    html:not(.remote-client) .breaker-list[data-layout="one"] .breaker-protection-items,
    html:not(.remote-client) .breaker-list[data-layout="two"] .breaker-protection-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-list[data-layout="one"] .breaker-protection-summary,
    html:not(.remote-client) .breaker-list[data-layout="two"] .breaker-protection-summary {
        padding: 7px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-summary {
        position: relative;
        min-height: 40px;
        gap: 0;
        margin-top: 5px;
        padding: 3px 4px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-summary-title {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-items {
        display: flex;
        align-items: stretch;
        gap: 4px;
        padding-right: 0;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-item,
    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-more {
        min-height: 34px;
        padding: 2px 4px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-item {
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        text-align: center;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-icon,
    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-icon svg {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-label {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-value {
        margin-top: 0;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-more {
        position: absolute;
        top: 3px;
        right: 3px;
        width: 34px;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-card.has-protection-summary,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card.has-protection-summary,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary {
        grid-template-rows: auto minmax(0, 1fr) auto auto;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-card.has-protection-summary .breaker-totals,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card.has-protection-summary .breaker-totals,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary .breaker-totals {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-card.has-protection-summary .breaker-live-summary,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card.has-protection-summary .breaker-live-summary,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary .breaker-live-summary {
        display: flex;
        min-width: 0;
        min-height: 30px;
        align-items: center;
        justify-content: space-around;
        gap: 5px;
        margin-top: 4px;
        border: 1px solid #d9e1ec;
        border-radius: 7px;
        background: #f8fafc;
        padding: 2px 5px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-protection-message {
        min-height: 34px;
    }

    html:not(.remote-client) .breaker-live-item {
        display: flex;
        min-width: 0;
        align-items: baseline;
        justify-content: center;
        gap: 4px;
        font-size: 18px;
        line-height: 1;
        white-space: nowrap;
    }

    html:not(.remote-client) .breaker-live-label {
        overflow: hidden;
        color: var(--muted);
        font-size: 18px;
        font-weight: 800;
        text-overflow: ellipsis;
    }

    html:not(.remote-client) .breaker-live-value {
        overflow: hidden;
        color: var(--text);
        font-size: 20px;
        font-weight: 900;
        text-overflow: ellipsis;
        font-variant-numeric: tabular-nums;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card.has-protection-summary .phase-block {
        min-height: 70px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary .phase-block {
        min-height: 26px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-summary,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-summary {
        min-height: 64px;
        gap: 0;
        margin-top: 4px;
        padding: 3px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-summary-title,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-summary-title {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-items,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 3px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-item,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-item,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-more,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-more {
        min-height: 27px;
        padding: 1px 3px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-item,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-item {
        grid-template-columns: 21px minmax(0, 1fr);
        gap: 3px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-icon,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-icon svg,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-icon,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-icon svg {
        width: 20px;
        height: 20px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-label,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-label {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-value,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-value,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-protection-more,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-more {
        margin-top: 0;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-live-label {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-item {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-icon {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary .phase-grid {
        margin-top: 2px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-protection-summary .breaker-live-summary {
        min-height: 27px;
        margin-top: 2px;
        padding-top: 1px;
        padding-bottom: 1px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-summary {
        min-height: 59px;
        margin-top: 2px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-item,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-protection-more {
        min-height: 24px;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.section-title-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.bus-setup-overlay {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(8, 17, 34, 0.82);
    padding: 10px;
    user-select: none;
    -webkit-user-select: none;
}

.bus-setup-dialog {
    display: grid;
    width: min(980px, 100%);
    height: min(700px, 100%);
    min-height: 0;
    grid-template-rows: auto 10px minmax(0, 1fr) auto;
    overflow: hidden;
    border: 2px solid #d5e0ef;
    border-radius: 18px;
    background: #f4f7fb;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    color: var(--text);
}

.bus-setup-header {
    display: flex;
    min-width: 0;
    min-height: 86px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #dbe3ef;
    background: #ffffff;
    padding: 10px 18px;
}

.bus-setup-heading {
    min-width: 0;
}

.bus-setup-heading > span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: 800;
    line-height: 1;
}

.bus-setup-heading h2 {
    overflow: visible;
    margin: 0;
    font-size: clamp(28px, 4.2vw, 42px);
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bus-setup-close {
    flex: 0 0 auto;
    min-width: 126px;
    min-height: 62px;
}

.bus-setup-progress {
    position: relative;
    overflow: hidden;
    background: #dce5f0;
}

.bus-setup-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 0 8px 8px 0;
    background: var(--accent);
    transition: width 180ms ease;
}

.bus-setup-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
}

.bus-setup-lead {
    display: grid;
    max-width: 880px;
    min-height: 100%;
    margin: 0 auto;
    grid-template-columns: 138px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 22px;
}

.bus-setup-symbol {
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    border: 3px solid #94b9e8;
    border-radius: 34px;
    background: #e9f3ff;
    color: #1264b2;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
}

.bus-setup-copy h3 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.06;
}

.bus-setup-copy p {
    margin: 0;
    color: #334155;
    font-size: clamp(21px, 2.8vw, 28px);
    font-weight: 700;
    line-height: 1.24;
}

.bus-setup-copy p + p {
    margin-top: 10px;
}

.bus-setup-choices {
    display: grid;
    max-width: 900px;
    min-height: 100%;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 14px;
}

.bus-setup-choice {
    display: grid;
    min-height: 210px;
    align-content: start;
    gap: 8px;
    border: 2px solid #cbd8e8;
    border-radius: 14px;
    background: #ffffff;
    padding: 20px;
    color: var(--text);
    text-align: left;
}

.bus-setup-choice.primary-choice {
    border-color: #68a8eb;
    background: #edf6ff;
}

.bus-setup-choice strong {
    font-size: clamp(26px, 3.2vw, 34px);
    line-height: 1.08;
}

.bus-setup-choice span {
    color: #475569;
    font-size: clamp(19px, 2.4vw, 24px);
    font-weight: 700;
    line-height: 1.22;
}

.bus-setup-choice-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 16px;
    background: #d8ebff;
    color: #1264b2;
    font-size: 32px;
    font-weight: 900;
}

.bus-setup-scan {
    display: grid;
    min-height: 100%;
    place-content: center;
    justify-items: center;
    gap: 16px;
    text-align: center;
}

.bus-setup-spinner {
    width: 92px;
    height: 92px;
    border: 11px solid #d9e6f4;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: bus-setup-spin 900ms linear infinite;
}

@keyframes bus-setup-spin {
    to { transform: rotate(360deg); }
}

.bus-setup-scan strong {
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
}

.bus-setup-scan span {
    max-width: 780px;
    color: #475569;
    font-size: clamp(21px, 2.7vw, 28px);
    font-weight: 750;
    line-height: 1.2;
}

.bus-setup-results {
    display: grid;
    gap: 12px;
}

.bus-setup-summary {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid #cbd8e8;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 14px;
}

.bus-setup-summary strong {
    font-size: clamp(25px, 3.2vw, 34px);
    line-height: 1.05;
}

.bus-setup-summary span {
    color: #475569;
    font-size: clamp(19px, 2.2vw, 23px);
    font-weight: 800;
    text-align: right;
}

.bus-setup-device-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bus-setup-device {
    display: grid;
    min-width: 0;
    min-height: 112px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: center;
    gap: 4px 12px;
    border: 2px solid #cbd8e8;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px 14px;
}

.bus-setup-device strong {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(23px, 2.7vw, 29px);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bus-setup-device > span {
    grid-column: 1 / -1;
    overflow: hidden;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 750;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bus-setup-device > .bus-setup-device-spec {
    color: #184a78;
    font-weight: 850;
}

.bus-setup-device > .bus-setup-device-number {
    color: #475569;
}

.bus-setup-device-serial {
    display: flex;
    min-width: 0;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    border-top: 1px solid #dbe3ef;
    margin-top: 4px;
    padding-top: 7px;
}

.bus-setup-device-serial span {
    flex: 0 0 auto;
    color: #475569;
    font-size: clamp(18px, 1.9vw, 21px);
    font-weight: 800;
}

.bus-setup-device-serial b {
    min-width: 0;
    color: #111827;
    font-size: clamp(19px, 2.1vw, 23px);
    font-weight: 900;
    letter-spacing: 0.025em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.bus-setup-address {
    display: grid;
    min-width: 72px;
    min-height: 52px;
    place-items: center;
    border-radius: 12px;
    background: #dff7e8;
    color: #087a43;
    font-size: 25px;
    font-weight: 900;
}

.bus-setup-notice {
    border: 2px solid #dfb82f;
    border-radius: 12px;
    background: #fff8d7;
    padding: 12px 14px;
    color: #634900;
    font-size: clamp(20px, 2.4vw, 25px);
    font-weight: 800;
    line-height: 1.22;
}

.bus-setup-notice.success {
    border-color: #5cc38a;
    background: #e5f8ed;
    color: #08653a;
}

.bus-setup-notice.danger {
    border-color: #ee7a84;
    background: #fff0f1;
    color: #9b1c2b;
}

.bus-setup-device-form {
    display: grid;
    max-width: 900px;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
    gap: 14px;
}

.bus-setup-device-form .bus-setup-device {
    grid-column: 1 / -1;
    min-height: 164px;
}

.bus-setup-field {
    display: grid;
    align-content: end;
    gap: 5px;
    color: #334155;
    font-size: 20px;
    font-weight: 850;
}

.bus-setup-field input {
    min-height: 62px;
    font-size: 25px;
    font-weight: 850;
}

.bus-setup-field input[type="number"] {
    text-align: center;
}

.bus-setup-session-list {
    display: grid;
    gap: 8px;
}

.bus-setup-session-row {
    display: grid;
    min-height: 60px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #dbe3ef;
    padding: 6px 4px;
}

.bus-setup-session-row > b {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: #dff7e8;
    color: #087a43;
    font-size: 24px;
}

.bus-setup-session-row strong {
    overflow: hidden;
    font-size: 23px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bus-setup-session-row span {
    color: #475569;
    font-size: 20px;
    font-weight: 800;
}

.bus-setup-actions {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #dbe3ef;
    background: #ffffff;
    padding: 10px 18px;
}

.bus-setup-actions button {
    min-width: 190px;
    min-height: 64px;
    font-size: clamp(21px, 2.5vw, 27px);
}

.bus-setup-actions .bus-setup-action-wide {
    min-width: 300px;
}

@media (max-width: 620px) {
    .section-title-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .section-title-actions button {
        flex: 1 1 190px;
    }

    .bus-setup-overlay {
        padding: 0;
    }

    .bus-setup-dialog {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    .bus-setup-header {
        min-height: 76px;
        padding: 8px 10px;
    }

    .bus-setup-close {
        min-width: 100px;
        min-height: 58px;
    }

    .bus-setup-body {
        padding: 12px;
    }

    .bus-setup-lead {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
        text-align: center;
    }

    .bus-setup-symbol {
        width: 90px;
        height: 90px;
        border-radius: 24px;
        font-size: 48px;
    }

    .bus-setup-choices,
    .bus-setup-device-list,
    .bus-setup-device-form {
        grid-template-columns: 1fr;
    }

    .bus-setup-choice {
        min-height: 150px;
    }

    .bus-setup-device-form .bus-setup-device {
        grid-column: 1;
    }

    .bus-setup-actions {
        min-height: 78px;
        overflow-x: auto;
        padding: 8px 10px;
    }

    .bus-setup-actions button,
    .bus-setup-actions .bus-setup-action-wide {
        min-width: 160px;
        min-height: 60px;
    }
}

@media (orientation: landscape) and (min-width: 850px) and (max-width: 1050px) {
    html:not(.remote-client) .section-title-actions button {
        min-height: 58px;
        padding-inline: 18px;
    }

    html:not(.remote-client) .bus-setup-overlay {
        padding: 0;
    }

    html:not(.remote-client) .bus-setup-dialog {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    html:not(.remote-client) .bus-setup-header {
        min-height: 76px;
    }

    html:not(.remote-client) .bus-setup-body {
        padding: 12px 18px;
    }

    html:not(.remote-client) .bus-setup-lead {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    html:not(.remote-client) .bus-setup-symbol {
        width: 106px;
        height: 106px;
        border-radius: 28px;
        font-size: 54px;
    }

    html:not(.remote-client) .bus-setup-choice {
        min-height: 184px;
        padding: 16px;
    }

    html:not(.remote-client) .bus-setup-actions {
        min-height: 78px;
        padding-block: 7px;
    }

    html:not(.remote-client) .bus-setup-actions button {
        min-height: 60px;
    }
}

* {
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    min-height: 42px;
    border: 1px solid #b8c3d3;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    padding: 0 12px;
    cursor: pointer;
    font-size: var(--ui-text-size);
    -webkit-user-select: none;
    user-select: none;
}

button:active {
    transform: translateY(1px);
}

button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

button.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

button.success {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

button.warning {
    border-color: var(--warn);
    background: var(--warn);
    color: #ffffff;
}

button:disabled {
    opacity: 0.55;
    cursor: default;
}

input,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #b8c3d3;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    padding: 0 9px;
    font-size: var(--ui-text-size);
}

label {
    display: grid;
    gap: 5px;
    min-width: 0;
}

label span {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.app-shell {
    display: grid;
    grid-template-rows: var(--topbar-height) minmax(0, 1fr);
    width: var(--scaled-width);
    height: var(--scaled-height);
    min-height: 0;
    transform: scale(var(--ui-scale));
    transform-origin: top left;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-gap);
    min-width: 0;
    min-height: var(--topbar-height);
    padding: max(var(--app-pad), env(safe-area-inset-top, 0px)) max(var(--app-pad), env(safe-area-inset-right, 0px)) var(--app-pad) max(var(--app-pad), env(safe-area-inset-left, 0px));
    background: var(--top);
    color: #ffffff;
    border-bottom: 1px solid #26374f;
}

.topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px 6px;
    cursor: pointer;
}

.title {
    overflow: hidden;
    font-size: var(--title-size);
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-icons {
    display: grid;
    grid-template-columns: repeat(4, var(--top-icon-size));
    gap: var(--app-gap);
    align-items: center;
    justify-content: end;
}

.breaker-topbar {
    display: none;
    width: 100%;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.app-shell.breaker-mode .topbar-title,
.app-shell.breaker-mode .topbar-icons {
    display: none;
}

.app-shell.login-mode .topbar-icons {
    display: none;
}

.app-shell.breaker-mode .breaker-topbar {
    display: grid;
}

.topbar-back-button {
    display: inline-flex;
    min-width: 82px;
    min-height: var(--top-icon-size);
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 8px;
    font-size: clamp(19px, 4.6vw, 23px);
    font-weight: 900;
}

.topbar-back-button::before {
    content: "←";
    font-size: 24px;
    line-height: 1;
}

.breaker-topbar-copy {
    display: flex;
    min-width: 0;
    min-height: var(--top-icon-size);
    align-items: center;
}

.breaker-topbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-topbar-title {
    color: #ffffff;
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 900;
    line-height: 1.05;
}

.breaker-topbar-section {
    min-width: 0;
}

.breaker-section-trigger {
    display: flex;
    width: clamp(170px, 36vw, 184px);
    min-height: var(--top-icon-size);
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 7px 0 10px;
}

.breaker-section-trigger strong {
    overflow: hidden;
    font-size: clamp(18px, 4.2vw, 21px);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-section-arrow {
    flex: 0 0 auto;
    color: #7dd3fc;
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-2px);
}

.top-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--top-icon-size);
    height: var(--top-icon-size);
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 0;
}

.top-icon svg,
.status-pill svg {
    fill: currentColor;
}

.top-icon svg {
    width: calc(var(--top-icon-size) * 0.74);
    height: calc(var(--top-icon-size) * 0.74);
}

.status-pill svg {
    width: calc(var(--card-icon-size) * 0.7);
    height: calc(var(--card-icon-size) * 0.7);
}

.top-icon.status-ok {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.top-icon.status-alarm {
    border-color: rgba(248, 113, 113, 0.58);
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.top-icon.status-warning {
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.top-icon.status-disabled,
.top-icon.status-unknown {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.top-icon::after {
    content: "";
    position: absolute;
    top: clamp(4px, 1.3vmin, 7px);
    right: clamp(4px, 1.3vmin, 7px);
    width: clamp(8px, 2.5vmin, 13px);
    height: clamp(8px, 2.5vmin, 13px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: var(--touch);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.45);
}

.top-icon.is-pulsing::after {
    opacity: 1;
    transform: scale(1);
}

.icon-badge {
    display: inline-grid;
    place-items: center;
    min-width: clamp(26px, 6.5vmin, 34px);
    height: clamp(26px, 6.5vmin, 34px);
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: var(--ui-text-size);
    font-weight: 800;
    line-height: 1;
}

.icon-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    border: 2px solid var(--top);
}

.workspace {
    position: relative;
    min-height: 0;
    background: #eef2f7;
}

.view {
    display: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.view.active {
    display: grid;
}

#dashboardView {
    grid-template-rows: auto 1fr;
    gap: var(--app-gap);
    padding: var(--app-pad);
}

#loginView {
    align-content: start;
    justify-content: center;
    padding: var(--app-pad);
}

.remote-login {
    width: min(430px, 100%);
}

.login-user-fixed,
.readonly-field {
    display: grid;
    gap: 6px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px 14px;
}

.login-user-fixed span,
.readonly-field span {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.login-user-fixed strong,
.readonly-field strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.breaker-card,
.settings-section,
.detail-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.metric-tile > span,
.event-row span,
.status-banner span {
    display: block;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.metric-tile > span {
    font-size: clamp(22px, 4.8vw, 26px);
    font-weight: 900;
    line-height: 1.05;
}

.breaker-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
    grid-auto-rows: auto;
    gap: var(--app-gap);
    align-content: start;
    min-height: 0;
    overflow: auto;
    padding-bottom: max(3px, env(safe-area-inset-bottom, 0px));
}

.push-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-gap);
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: clamp(8px, 2vmin, 12px);
}

.push-panel > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.push-panel strong {
    overflow: hidden;
    color: var(--text);
    font-size: var(--ui-text-size);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.push-panel span {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.push-panel button {
    flex: 0 0 auto;
    min-width: 132px;
}

.breaker-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    min-width: 0;
    min-height: clamp(310px, calc(100vh - var(--topbar-height) - var(--app-pad) * 2), 430px);
    min-height: clamp(310px, calc(100dvh - var(--topbar-height) - var(--app-pad) * 2), 430px);
    border-width: 2px;
    padding: var(--app-pad);
    text-align: left;
}

.breaker-card-open {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    padding: 0;
}

.breaker-card-open:focus-visible,
.card-journal:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.breaker-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(11, 107, 203, 0.14);
}

.breaker-card.status-alarm {
    border-color: #f5a5a0;
    background: #fff7f6;
}

.breaker-card.status-warning {
    border-color: #f8c56d;
    background: #fffaf0;
}

.breaker-card.status-offline {
    border-color: #c5ccd8;
    background: #f7f8fb;
}

.breaker-card.status-ok {
    border-color: #a9e8c1;
}

.breaker-top,
.section-title-row,
.detail-head,
.settings-head,
.inline-actions,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.breaker-heading {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
    align-content: center;
}

.breaker-name {
    overflow: hidden;
    font-size: var(--card-title-size);
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-state {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: clamp(19px, 4.5vw, 23px);
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-state-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.breaker-drive-mode {
    display: inline-flex;
    min-height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #8abceb;
    border-radius: 999px;
    background: #eef6ff;
    padding: 3px 10px;
    color: var(--accent-strong);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.breaker-drive-mode.is-manual {
    border-color: #efc66c;
    background: #fff7df;
    color: #805400;
}

.breaker-drive-mode.is-unknown {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: var(--offline);
}

.breaker-state > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-state-compact {
    display: none !important;
}

.breaker-card.status-ok .breaker-state {
    color: var(--success);
}

.breaker-card.status-alarm .breaker-state {
    color: var(--danger);
}

.breaker-card.status-warning .breaker-state {
    color: var(--warn);
}

.breaker-card.status-offline .breaker-state,
.breaker-card.status-off .breaker-state,
.breaker-card.status-disabled .breaker-state,
.breaker-card.status-unknown .breaker-state {
    color: var(--offline);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--card-icon-size);
    height: var(--card-icon-size);
    min-height: var(--card-icon-size);
    border-radius: 8px;
    padding: 0;
    background: #edf2f7;
    color: #344054;
    font-size: var(--ui-text-size);
    font-weight: 700;
    white-space: nowrap;
}

.card-journal {
    position: absolute;
    top: var(--app-pad);
    right: calc(var(--app-pad) + var(--card-icon-size) + 8px);
    z-index: 2;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: var(--card-icon-size);
    height: var(--card-icon-size);
    border: 2px solid #bbd2ff;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--accent);
    padding: 0;
}

.breaker-card.has-card-journal .breaker-heading {
    padding-right: calc(var(--card-icon-size) + 8px);
}

.card-journal svg {
    width: calc(var(--card-icon-size) * 0.68);
    height: calc(var(--card-icon-size) * 0.68);
    fill: currentColor;
}

.card-journal span {
    position: absolute;
    top: -10px;
    right: -10px;
    display: inline-grid;
    place-items: center;
    min-width: clamp(26px, 6.5vmin, 34px);
    height: clamp(26px, 6.5vmin, 34px);
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.card-journal.has-critical {
    border-color: #f5a5a0;
    background: var(--danger-soft);
    color: var(--danger);
}

.card-journal.has-critical span {
    background: var(--danger);
}

.status-pill.status-ok {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.status-alarm {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill.status-warning {
    background: var(--warn-soft);
    color: var(--warn);
}

.status-pill.status-offline,
.status-pill.status-off,
.status-pill.status-disabled,
.status-pill.status-unknown {
    background: #edf2f7;
    color: var(--offline);
}

.operator-empty-state {
    display: grid;
    min-height: min(330px, 100%);
    place-content: center;
    justify-items: center;
    gap: 12px;
    border: 2px dashed #b8c3d3;
    border-radius: 12px;
    background: #ffffff;
    padding: 24px;
    text-align: center;
}

.operator-empty-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 50%;
    background: #eaf3ff;
    color: var(--accent);
}

.operator-empty-icon svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
}

.operator-empty-state h2 {
    margin: 0;
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.05;
}

.operator-empty-state p {
    max-width: 430px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(20px, 4.8vw, 25px);
    font-weight: 800;
    line-height: 1.2;
}

.operator-empty-action {
    min-width: min(300px, 100%);
    min-height: 64px;
    font-size: clamp(21px, 5vw, 26px);
    font-weight: 900;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--app-gap);
    margin-top: var(--app-gap);
}

.phase-grid.phase-count-1 {
    grid-template-columns: minmax(0, 1fr);
}

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

.phase-block {
    position: relative;
    min-width: 0;
    min-height: clamp(132px, 35vmin, 180px);
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #ffffff;
    padding: calc(var(--phase-strip-height) + clamp(6px, 1.7vmin, 10px)) clamp(5px, 1.5vmin, 9px) clamp(6px, 1.7vmin, 10px);
}

.phase-block::before {
    display: none;
    content: "";
}

.phase-l1::before,
.detail-phase-block.phase-l1::before,
.phase-l1 .phase-name,
.detail-phase-block.phase-l1 .detail-phase-title {
    background: #ffd600;
    color: #111827;
}

.phase-l2::before,
.detail-phase-block.phase-l2::before,
.phase-l2 .phase-name,
.detail-phase-block.phase-l2 .detail-phase-title {
    background: #00a651;
    color: #ffffff;
}

.phase-l3::before,
.detail-phase-block.phase-l3::before,
.phase-l3 .phase-name,
.detail-phase-block.phase-l3 .detail-phase-title {
    background: #d71920;
    color: #ffffff;
}

.phase-name {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    height: var(--phase-strip-height);
    border-radius: 7px 7px 0 0;
    padding: 0 clamp(6px, 1.7vmin, 10px);
    color: #ffffff;
    font-size: var(--ui-text-size);
    font-weight: 900;
    line-height: 1;
}

.phase-voltage,
.phase-current,
.phase-power {
    display: block;
    overflow: hidden;
    margin-top: clamp(4px, 1.2vmin, 7px);
    color: var(--text);
    font-size: var(--phase-u-size);
    font-style: normal;
    font-weight: 900;
    line-height: 0.95;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phase-current {
    color: #334155;
    font-size: var(--phase-i-size);
}

.phase-power {
    color: var(--muted);
    font-size: var(--phase-p-size);
    font-weight: 900;
}

.breaker-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--app-gap);
    margin-top: var(--app-gap);
}

.breaker-totals.single {
    grid-template-columns: 1fr;
}

.breaker-totals div {
    min-width: 0;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #f8fafc;
    padding: 7px;
}

.breaker-totals span {
    display: block;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 800;
}

.breaker-totals strong {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    font-size: var(--total-value-size);
    line-height: 0.95;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#breakerView {
    grid-template-rows: 1fr;
    padding: var(--app-pad);
}

#journalView {
    grid-template-rows: auto auto 1fr;
    gap: var(--app-gap);
    padding: var(--app-pad);
}

.detail-head,
.journal-head,
.settings-head {
    min-height: 54px;
    padding: var(--app-pad);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.journal-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
}

.detail-head > div,
.journal-head > div,
.settings-head > div {
    min-width: 0;
}

.journal-test {
    min-width: 78px;
    min-height: 46px;
    font-size: var(--ui-text-size);
}

.journal-filters {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
}

.journal-filter {
    min-width: 96px;
    min-height: 46px;
    border-color: #cad3df;
    background: #ffffff;
    font-size: var(--ui-text-size);
    font-weight: 800;
    white-space: nowrap;
}

.journal-filter.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.journal-content {
    min-height: 0;
    overflow: auto;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 112px;
    min-height: 58px;
    font-size: clamp(22px, 5.2vw, 28px);
    font-weight: 900;
}

.back-button::before {
    content: "←";
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.detail-title {
    overflow: hidden;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-subtitle {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: var(--ui-text-size);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-content {
    min-height: 0;
    overflow: auto;
}

.operator-detail-status {
    display: grid;
    min-height: 76px;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: var(--app-gap);
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 9px 12px;
}

.operator-detail-status-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    background: #edf2f7;
    color: var(--offline);
}

.operator-detail-status-icon svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.operator-detail-status > div:last-child {
    min-width: 0;
}

.operator-detail-status strong,
.operator-detail-status span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operator-detail-status strong {
    font-size: clamp(22px, 5.2vw, 28px);
    font-weight: 900;
    line-height: 1.05;
}

.operator-detail-status span {
    margin-top: 3px;
    color: var(--muted);
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 800;
}

.operator-detail-status.status-alarm,
.operator-detail-status.status-offline {
    border-color: #f5a5a0;
    background: #fff7f6;
}

.operator-detail-status.status-alarm .operator-detail-status-icon,
.operator-detail-status.status-offline .operator-detail-status-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.operator-detail-status.status-warning,
.operator-detail-status.status-unknown {
    border-color: #f5cf8c;
    background: #fffbeb;
}

.operator-detail-status.status-warning .operator-detail-status-icon,
.operator-detail-status.status-unknown .operator-detail-status-icon {
    background: var(--warn-soft);
    color: var(--warn);
}

.detail-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: var(--app-gap);
}

.detail-card {
    padding: var(--app-pad);
}

.detail-card > .section-label:first-child {
    margin-top: 0;
}

.measurement-stack {
    display: grid;
    gap: calc(var(--app-gap) * 0.7);
}

.detail-phase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(var(--app-gap) * 0.65);
}

.detail-phase-grid.phase-count-1 {
    grid-template-columns: minmax(0, 1fr);
}

.detail-phase-grid.phase-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-phase-block {
    position: relative;
    min-width: 0;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #ffffff;
    padding: calc(var(--detail-phase-strip-height) + clamp(6px, 1.4vmin, 10px)) clamp(4px, 1.2vmin, 8px) clamp(4px, 1.1vmin, 8px);
}

.detail-phase-block::before {
    display: none;
    content: "";
}

.detail-phase-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    height: var(--detail-phase-strip-height);
    border-radius: 7px 7px 0 0;
    padding: 0 clamp(6px, 1.6vw, 10px);
    color: #ffffff;
    font-size: var(--ui-text-size);
    font-weight: 900;
    line-height: 1;
}

.detail-phase-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    margin-top: 7px;
}

.detail-phase-list div {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.detail-phase-label {
    display: block;
    overflow-wrap: break-word;
    color: var(--muted);
    font-size: var(--detail-phase-label-size);
    font-weight: 900;
    line-height: 1.05;
}

.detail-phase-list strong {
    display: flex;
    align-items: baseline;
    overflow: hidden;
    margin-top: 2px;
    color: var(--text);
    font-size: var(--detail-phase-sub-size);
    font-weight: 900;
    line-height: 0.94;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reading-number {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-size: 1em;
    line-height: inherit;
    text-overflow: ellipsis;
}

.reading-unit {
    flex: 0 0 auto;
    margin-left: 3px;
    color: #7b8797;
    font-size: 0.7em;
    font-weight: 900;
    line-height: 1;
}

strong .reading-number,
strong .reading-unit {
    display: inline-block;
}

@media (max-width: 340px) {
    .detail-phase-grid,
    .detail-phase-grid.phase-count-2,
    .detail-phase-grid.phase-count-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.status-banner {
    min-height: 128px;
    border-radius: 8px;
    padding: 13px;
    background: #f8fafc;
}

.status-banner strong {
    display: block;
    margin-top: 7px;
    font-size: 36px;
    line-height: 1;
}

.status-banner em {
    display: block;
    margin-top: 10px;
    color: #334155;
    font-size: var(--ui-text-size);
    font-style: normal;
    line-height: 1.25;
}

.status-banner.status-ok strong {
    color: var(--success);
}

.status-banner.status-alarm strong {
    color: var(--danger);
}

.status-banner.status-warning strong {
    color: var(--warn);
}

.status-banner.status-offline strong,
.status-banner.status-off strong {
    color: var(--offline);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: calc(var(--app-gap) * 0.65);
}

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

.metric-tile {
    min-height: 76px;
    border: 1px solid #e0e6ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 7px;
}

.metric-tile strong {
    display: flex;
    align-items: baseline;
    overflow: hidden;
    margin-top: 5px;
    font-size: var(--detail-value-size);
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-grid.energy-grid .metric-tile strong {
    font-size: clamp(26px, 6.2vw, 36px);
    text-overflow: clip;
}

.history-stack {
    display: grid;
    gap: calc(var(--app-gap) * 0.7);
}

.history-controls-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    gap: var(--app-gap);
    padding: 10px;
}

.history-control {
    display: grid;
    gap: 4px;
}

.history-control > span {
    font-size: clamp(18px, 4.1vw, 21px);
    font-weight: 900;
}

.history-picker-trigger {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-color: #cad3df;
    background: #ffffff;
    color: var(--text);
    padding: 0 10px;
    text-align: left;
}

.history-picker-trigger strong {
    overflow: hidden;
    font-size: clamp(21px, 4.8vw, 25px);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-picker-arrow {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-3px);
}

.history-picker-trigger:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.18);
    outline: none;
}

.fullscreen-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    width: 100vw;
    height: 100dvh;
    background: #f3f6fa;
}

.fullscreen-picker-dialog {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    background: #f3f6fa;
}

.fullscreen-picker-head {
    display: grid;
    min-height: 76px;
    grid-template-columns: minmax(0, 1fr) 62px;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #d8e0ea;
    background: #ffffff;
    padding: 8px 10px 8px 14px;
}

.fullscreen-picker-head h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(27px, 6.6vw, 34px);
    font-weight: 900;
    line-height: 1.05;
}

.fullscreen-picker-close {
    width: 62px;
    min-height: 60px;
    border: 0;
    border-radius: 10px;
    background: #e8edf4;
    color: var(--text);
    padding: 0;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
}

.fullscreen-picker-options {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: 9px;
    overflow-y: auto;
    padding: 12px;
}

.fullscreen-picker-option {
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid #b8c5d6;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    padding: 8px 16px;
    text-align: left;
}

.fullscreen-picker-option span {
    font-size: clamp(25px, 6vw, 31px);
    font-weight: 900;
}

.fullscreen-picker-option strong {
    flex: 0 0 40px;
    font-size: 34px;
    text-align: center;
}

.fullscreen-picker-option.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.history-card {
    min-height: 330px;
}

.history-chart-wrap {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.history-chart-stage {
    min-width: 0;
}

.history-point-panel {
    display: grid;
    gap: 7px;
    border: 2px solid #c9def5;
    border-radius: 9px;
    background: #eef6ff;
    padding: 8px;
}

.history-point-time {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(20px, 4.6vw, 24px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-point-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr));
    gap: 6px;
}

.history-point-value {
    display: grid;
    min-width: 0;
    min-height: 45px;
    grid-template-columns: 7px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 6px;
    border: 1px solid #d6e2ef;
    border-radius: 6px;
    background: #ffffff;
    padding: 5px 7px;
}

.history-point-value i {
    width: 7px;
    height: 32px;
    grid-row: 1 / 3;
    border-radius: 999px;
}

.history-point-value b {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-point-value strong {
    overflow: hidden;
    color: var(--text);
    font-size: clamp(18px, 4vw, 21px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-chart {
    width: 100%;
    height: clamp(220px, 36vh, 340px);
    border: 1px solid #e0e6ef;
    border-radius: 8px;
    background: #ffffff;
    cursor: crosshair;
    touch-action: pan-y;
}

.history-chart:focus {
    outline: 3px solid rgba(11, 107, 203, 0.24);
    outline-offset: 2px;
}

.history-grid-line {
    stroke: #e5ebf3;
    stroke-width: 2;
}

.history-line {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-touch-zone {
    fill: transparent;
    pointer-events: all;
}

.history-cursor-line {
    stroke: #101828;
    stroke-width: 2;
    stroke-dasharray: 7 6;
    vector-effect: non-scaling-stroke;
}

.history-cursor-point {
    stroke: #ffffff;
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.history-navigator {
    display: grid;
    gap: 7px;
    border-top: 1px solid #d8e0ea;
    padding-top: 8px;
}

.history-navigator-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text);
    font-size: clamp(19px, 4.3vw, 22px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    white-space: nowrap;
}

.history-navigator-range span {
    color: var(--muted);
}

.history-navigator-track {
    position: relative;
    height: 54px;
    overflow: hidden;
    border: 2px solid #b9c8da;
    border-radius: 10px;
    background:
        linear-gradient(to right, transparent 24.5%, #cbd5e1 24.5%, #cbd5e1 25%, transparent 25%),
        linear-gradient(to right, transparent 49.5%, #cbd5e1 49.5%, #cbd5e1 50%, transparent 50%),
        linear-gradient(to right, transparent 74.5%, #cbd5e1 74.5%, #cbd5e1 75%, transparent 75%),
        #e8eef5;
    touch-action: none;
}

.history-navigator-track:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.18);
    outline: none;
}

.history-navigator-window {
    position: absolute;
    top: 5px;
    bottom: 5px;
    display: grid;
    min-width: 56px;
    place-items: center;
    border: 2px solid #0759aa;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: 0 3px 8px rgba(11, 107, 203, 0.28);
    pointer-events: none;
}

.history-navigator-window i {
    width: 18px;
    height: 24px;
    border-right: 3px solid rgba(255, 255, 255, 0.9);
    border-left: 3px solid rgba(255, 255, 255, 0.9);
}

.history-navigator.disabled {
    opacity: 0.64;
}

.history-navigator.disabled .history-navigator-window {
    width: 100% !important;
    left: 0 !important;
    transform: none !important;
}

.history-axis,
.history-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-gap);
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 900;
}

.history-axis strong {
    color: var(--text);
    text-align: center;
}

.history-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.history-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.history-legend i {
    display: inline-block;
    width: 24px;
    height: 8px;
    border-radius: 999px;
}

.history-note {
    display: grid;
    place-items: center;
    min-height: 190px;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 900;
    text-align: center;
}

.history-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: calc(var(--app-gap) * 0.65);
}

.history-summary-tile {
    min-height: 112px;
}

.history-summary-tile em {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
}

.event-list {
    display: grid;
    gap: 6px;
}

.journal-list {
    padding-bottom: 3px;
}

.journal-pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--app-gap);
    align-items: center;
    margin-bottom: var(--app-gap);
}

.journal-pager + .journal-list {
    margin-top: 0;
}

.journal-pager span {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 900;
    white-space: nowrap;
}

.journal-list + .journal-pager {
    margin-top: var(--app-gap);
    margin-bottom: 3px;
}

.event-row {
    min-height: 60px;
    border: 1px solid #e0e6ef;
    border-radius: 7px;
    background: #ffffff;
    padding: 7px 9px;
}

.journal-event {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 88px;
    gap: 8px;
    align-items: center;
    border-left-width: 6px;
}

.journal-event.has-ack {
    grid-template-columns: 44px minmax(0, 1fr) 44px 88px;
}

.journal-event.has-details {
    grid-template-columns: 44px minmax(0, 1fr) 32px 88px;
    cursor: pointer;
}

.journal-event.has-ack.has-details {
    grid-template-columns: 44px minmax(0, 1fr) 44px 32px 88px;
}

.journal-event.event-alarm,
.journal-event.event-error {
    border-left-color: var(--danger);
    background: #fff7f6;
}

.journal-event.event-warning {
    border-left-color: var(--warn);
    background: #fffaf0;
}

.journal-event.event-info {
    border-left-color: var(--accent);
}

.journal-event.unread {
    box-shadow: inset 0 0 0 2px rgba(211, 47, 47, 0.14);
}

.event-time {
    min-width: 88px;
    justify-self: end;
    color: #344054;
    font-size: clamp(19px, 4.6vw, 23px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -0.4px;
    text-align: right;
    white-space: nowrap;
}

.journal-event .event-type-icon {
    display: grid;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
}

.journal-event .event-type-command {
    background: var(--success);
}

.journal-event .event-type-settings {
    background: var(--offline);
}

.journal-event.event-alarm .event-type-icon,
.journal-event.event-error .event-type-icon {
    background: var(--danger);
}

.journal-event.event-warning .event-type-icon {
    background: var(--warn);
}

.event-type-icon svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
}

.event-message {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(20px, 4.8vw, 24px);
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-row strong {
    display: block;
    margin-top: 0;
    font-size: var(--ui-text-size);
    line-height: 1.25;
}

.event-ack {
    width: 44px;
    min-height: 44px;
    border: 2px solid var(--success);
    border-radius: 50%;
    background: #ffffff;
    padding: 0;
    color: var(--success);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.event-details-open {
    display: grid;
    width: 32px;
    min-width: 32px;
    height: 42px;
    min-height: 42px;
    align-items: center;
    justify-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--accent-strong);
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
}

.event-details-open:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
}

.journal-event.has-details:active {
    transform: scale(0.995);
}

.fault-list {
    display: grid;
    gap: 8px;
}

.fault-item {
    min-height: 46px;
    border: 1px solid #e0e6ef;
    border-radius: 7px;
    padding: 9px 10px;
    background: #ffffff;
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.fault-item.alarm {
    border-color: #f5a5a0;
    background: #fff7f6;
    color: var(--danger);
}

.fault-item.warning {
    border-color: #f8c56d;
    background: #fffaf0;
    color: var(--warn);
}

.control-state-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 4px;
    align-items: center;
    min-height: 64px;
    margin-bottom: var(--app-gap);
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 12px;
}

.control-state-card span {
    grid-column: 1 / -1;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: clamp(20px, 4.8vw, 24px);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-state-card strong {
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 900;
}

.control-drive-mode {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 2px solid #8abceb;
    border-radius: 999px;
    background: #eef6ff;
    padding: 5px 12px;
    color: var(--accent-strong);
    font-size: clamp(19px, 4.5vw, 23px);
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.control-drive-mode.is-manual {
    border-color: #efc66c;
    background: #fff7df;
    color: #805400;
}

.control-drive-mode.is-unknown {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: var(--offline);
}

.control-state-card.on {
    border-color: #72c89d;
    background: var(--success-soft);
    color: var(--success);
}

.control-state-card.off {
    border-color: #f0a09a;
    background: var(--danger-soft);
    color: var(--danger);
}

.control-state-card.unknown {
    color: var(--offline);
}

.control-permission {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    margin-bottom: var(--app-gap);
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 12px;
}

.control-permission > strong {
    font-size: clamp(21px, 5vw, 26px);
    font-weight: 900;
    line-height: 1.1;
}

.control-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 88px;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    background: #98a2b3;
    padding: 4px;
    box-shadow: inset 0 0 0 2px rgba(17, 24, 39, 0.08);
    transition: background 160ms ease;
}

.control-toggle.is-on {
    background: var(--success);
}

.control-toggle.is-off {
    background: var(--danger);
}

.control-toggle.is-unknown {
    background: #98a2b3;
}

.control-toggle-knob {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.34);
    transform: translateX(0);
    transition: transform 160ms ease;
}

.control-toggle.is-on .control-toggle-knob {
    transform: translateX(38px);
}

.control-toggle:active .control-toggle-knob {
    width: 46px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--app-gap);
}

.control-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 82px;
    padding: 8px 12px;
    font-size: clamp(21px, 5vw, 26px);
    font-weight: 900;
}

.control-button svg {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    fill: currentColor;
}

.control-button.warning {
    border-color: var(--warn);
    background: var(--warn);
    color: #ffffff;
}

.control-mode-note {
    border-color: #efc66c;
    background: #fff7df;
    color: #704b00;
    font-weight: 800;
}

.action-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(2px);
}

.action-confirm-dialog {
    width: min(440px, 100%);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.42);
    text-align: center;
    animation: action-confirm-in 140ms ease-out;
}

@keyframes action-confirm-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.action-confirm-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    color: #ffffff;
}

.action-confirm-icon.success {
    background: var(--success);
}

.action-confirm-icon.danger {
    background: var(--danger);
}

.action-confirm-icon.warning {
    background: var(--warn);
}

.action-confirm-icon.info {
    background: var(--accent);
}

.action-confirm-icon svg {
    width: 44px;
    height: 44px;
    fill: currentColor;
}

.action-confirm-dialog h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(28px, 7vw, 34px);
    font-weight: 900;
    line-height: 1.08;
}

.action-confirm-dialog p {
    margin: 10px 0 16px;
    color: var(--muted);
    font-size: clamp(21px, 5.2vw, 26px);
    font-weight: 800;
    line-height: 1.15;
}

.action-confirm-dialog p.is-multiline {
    max-height: 40vh;
    overflow-y: auto;
    border: 1px solid #d7e0eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px 12px;
    white-space: pre-line;
    text-align: left;
}

.action-confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.action-confirm-actions.single {
    grid-template-columns: minmax(0, 1fr);
}

.action-confirm-actions button {
    min-height: 70px;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: clamp(22px, 5.5vw, 27px);
    font-weight: 900;
}

.action-confirm-cancel {
    border: 2px solid #98a2b3;
    background: #ffffff;
    color: var(--text);
}

.action-confirm-submit.warning {
    border-color: var(--warn);
    background: var(--warn);
    color: #ffffff;
}

.action-confirm-submit.success {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.action-confirm-submit.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

.action-confirm-submit.info {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

#settingsView {
    grid-template-rows: auto 1fr;
    gap: var(--app-gap);
    padding: var(--app-pad);
}

.settings-login {
    align-self: start;
    justify-self: center;
    display: grid;
    width: min(360px, 100%);
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 14px;
}

.form-error {
    min-height: 18px;
    color: var(--danger);
    font-size: var(--ui-text-size);
}

.settings-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: var(--app-gap);
    min-height: 0;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hidden {
    display: none !important;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: var(--app-gap);
    padding-bottom: 3px;
}

.settings-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--app-gap);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: var(--app-pad);
}

.settings-tab {
    min-height: 52px;
    border-color: #d7dfeb;
    background: #f8fafc;
    font-size: var(--ui-text-size);
    font-weight: 800;
}

.settings-tab.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.settings-section {
    display: grid;
    align-content: start;
    gap: var(--app-gap);
    min-width: 0;
    padding: var(--app-pad);
}

.wide-section {
    grid-column: 1 / -1;
}

.settings-section h2 {
    margin: 0;
    font-size: 21px;
}

.settings-section .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.settings-section .inline-actions button,
.settings-section .inline-actions select {
    flex: 0 1 auto;
}

.settings-section .inline-actions select {
    width: min(210px, 100%);
}

.system-settings-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--app-gap);
}

.system-settings-actions button {
    min-height: 62px;
    border: 2px solid var(--accent);
    background: #ffffff;
    color: var(--accent-strong);
    font-size: clamp(20px, 4.8vw, 24px);
    font-weight: 900;
}

.panel-info-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 96px;
    border: 1px solid #dbe3ef;
    border-radius: 9px;
    background: #ffffff;
    padding: 14px 16px;
}

.panel-info-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.panel-info-name,
.panel-info-specs,
.panel-info-status-text {
    display: block;
}

.panel-info-name {
    overflow: hidden;
    font-size: clamp(26px, 6vw, 34px);
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-info-specs {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.panel-info-status {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    max-width: 330px;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
    color: var(--offline);
    font-size: var(--ui-text-size);
    font-weight: 800;
    line-height: 1.15;
}

.panel-info-status-dot {
    width: 16px;
    height: 16px;
    border: 3px solid currentColor;
    border-radius: 50%;
    background: #ffffff;
}

.panel-info-status.is-working {
    border-color: #a6e4bf;
    background: var(--success-soft);
    color: var(--success);
}

.panel-info-status.is-working .panel-info-status-dot {
    background: currentColor;
}

.service-note {
    border: 1px solid #e0e6ef;
    border-radius: 7px;
    background: #f8fafc;
    padding: 9px 10px;
    color: #334155;
    font-size: var(--ui-text-size);
    line-height: 1.35;
}

.service-adb-card {
    display: grid;
    gap: 12px;
    border: 1px solid #cfd9e7;
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
}

.service-adb-head {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.service-adb-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 800;
}

.service-adb-head h3 {
    margin: 0;
    font-size: clamp(27px, 6vw, 34px);
    line-height: 1;
}

.service-adb-badge {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f1f5f9;
    padding: 7px 14px;
    color: #475569;
    font-size: var(--ui-text-size);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.service-adb-badge.is-guarded {
    border-color: #9fdab7;
    background: var(--success-soft);
    color: var(--success);
}

.service-adb-badge.is-active {
    border-color: #76b3ed;
    background: #eaf4ff;
    color: var(--accent-strong);
}

.service-adb-badge.is-warning {
    border-color: #f2c45d;
    background: #fff7dc;
    color: #8a5a00;
}

.service-adb-badge.is-error {
    border-color: #eea0a6;
    background: #fff0f1;
    color: var(--danger);
}

.service-adb-transports {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.service-adb-transport {
    display: grid;
    min-width: 0;
    min-height: 70px;
    align-content: center;
    gap: 4px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
}

.service-adb-transport span,
.service-adb-transport strong {
    display: block;
}

.service-adb-transport span {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 750;
}

.service-adb-transport strong {
    overflow: hidden;
    color: var(--text);
    font-size: clamp(21px, 5vw, 27px);
    font-weight: 900;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.service-adb-transport.is-locked strong {
    color: var(--success);
}

.service-adb-transport.is-risk {
    border-color: #e9a2a8;
    background: #fff1f2;
}

.service-adb-transport.is-risk strong {
    color: #9b1c2b;
}

.service-adb-message {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-weight: 800;
}

.service-adb-message.is-active {
    border-color: #a8caec;
    background: #eef6ff;
    color: #184a78;
}

.service-adb-message.is-warning {
    border-color: #ebc45e;
    background: #fff8df;
    color: #704b00;
}

.service-adb-message.is-error {
    border-color: #e9a2a8;
    background: #fff1f2;
    color: #9b1c2b;
}

.service-adb-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.service-adb-actions button {
    min-width: 0;
    min-height: 62px;
    padding: 8px 12px;
    font-size: clamp(20px, 4.8vw, 24px);
    font-weight: 900;
    line-height: 1.08;
    white-space: normal;
}

.service-adb-overlay {
    position: fixed;
    inset: 0;
    z-index: 6500;
    display: grid;
    place-items: center;
    overflow: auto;
    background: rgba(15, 23, 42, 0.8);
    padding: 16px;
    backdrop-filter: blur(3px);
}

.service-adb-dialog {
    display: grid;
    width: min(680px, 100%);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    gap: 16px;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 18px;
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.46);
    animation: action-confirm-in 140ms ease-out;
}

.service-adb-dialog-head {
    display: grid;
    gap: 5px;
    text-align: center;
}

.service-adb-dialog-head > span {
    color: var(--accent-strong);
    font-size: var(--ui-text-size);
    font-weight: 900;
}

.service-adb-dialog-head h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(29px, 7vw, 38px);
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.service-adb-dialog-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: clamp(20px, 4.8vw, 25px);
    font-weight: 750;
    line-height: 1.2;
}

.service-adb-form {
    display: grid;
    gap: 12px;
}

.service-adb-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 10px;
}

.service-adb-fields label {
    align-content: end;
}

.service-adb-fields label > span {
    font-size: clamp(18px, 4.2vw, 22px);
}

.service-adb-fields input {
    min-height: 58px;
    font-size: clamp(21px, 5vw, 26px);
}

.service-adb-dialog-error {
    min-height: 28px;
    font-size: clamp(18px, 4.2vw, 22px);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.service-adb-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.service-adb-dialog-actions button {
    min-width: 0;
    min-height: 66px;
    padding: 8px 12px;
    font-size: clamp(21px, 5vw, 26px);
    font-weight: 900;
    line-height: 1.08;
    white-space: normal;
}

html.remote-client #serviceAdbCard,
html.remote-client #serviceAdbOverlay {
    display: none !important;
}

.settings-breakers {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--app-gap);
    min-height: 0;
}

.settings-breaker-overview,
.breaker-editor,
.remote-overview,
.remote-user-editor {
    display: grid;
    align-content: start;
    gap: var(--app-gap);
    min-height: 0;
}

.remote-access-switches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: var(--app-gap);
}

.remote-access-switches .check-row {
    min-height: 58px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
}

.remote-access-switches .check-row span {
    font-size: 19px;
    font-weight: 800;
}

.remote-user-editor > .section-title-row {
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start;
}

.remote-user-editor > .section-title-row h2 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remote-qr-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.remote-qr-code {
    display: grid;
    place-items: center;
    width: 186px;
    height: 186px;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #ffffff;
}

.remote-qr-code svg {
    display: block;
    width: 174px;
    height: 174px;
}

.remote-qr-card strong,
.remote-qr-card span {
    display: block;
}

.remote-qr-card strong {
    font-size: 20px;
}

.remote-qr-card span {
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: var(--ui-text-size);
    line-height: 1.3;
}

.remote-user-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--app-gap);
    min-width: 0;
}

.remote-user-form label:first-of-type,
.remote-rights,
.remote-user-form .form-actions {
    grid-column: 1 / -1;
}

.remote-rights {
    display: grid;
    gap: var(--app-gap);
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.remote-rights-title {
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 800;
}

.settings-breaker-list.remote-user-list {
    max-height: min(520px, calc(100vh - 310px));
}

.settings-breaker-list.remote-user-list .settings-breaker-item {
    min-height: 64px;
}

.settings-breaker-list {
    display: grid;
    align-content: start;
    gap: var(--app-gap);
    max-height: 390px;
    overflow: auto;
}

.settings-breaker-item {
    min-height: 50px;
    border: 1px solid #e0e6ef;
    border-radius: 7px;
    background: #ffffff;
    padding: 8px 9px;
    text-align: left;
}

.settings-breaker-item[data-breaker-id] {
    display: grid;
    min-height: 112px;
    grid-template-columns: minmax(0, 1fr) 142px;
    align-items: stretch;
    gap: 12px;
    padding: 10px 12px;
}

.settings-breaker-item .settings-breaker-main,
.settings-breaker-item .settings-breaker-aside {
    display: grid !important;
    min-width: 0;
    overflow: visible;
    margin: 0;
    color: inherit;
    font-size: inherit;
    text-overflow: clip;
    white-space: normal;
}

.settings-breaker-item .settings-breaker-main {
    align-content: center;
    gap: 5px;
}

.settings-breaker-item .settings-breaker-aside {
    align-content: center;
    gap: 7px;
}

.settings-breaker-item .settings-breaker-name {
    overflow: hidden;
    color: var(--text);
    font-size: clamp(23px, 5.4vw, 29px);
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-breaker-item .settings-breaker-spec {
    overflow: hidden;
    margin: 0;
    color: #334155;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-breaker-item .settings-breaker-serial {
    overflow: visible;
    margin: 0;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.12;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.settings-breaker-item .settings-breaker-address,
.settings-breaker-item .settings-breaker-state {
    display: flex !important;
    overflow: hidden;
    margin: 0;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.settings-breaker-item .settings-breaker-address {
    min-height: 48px;
    border: 2px solid #86b8eb;
    background: #eef6ff;
    color: var(--accent-strong);
    font-size: 21px;
}

.settings-breaker-item .settings-breaker-state {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: var(--offline);
    font-size: 18px;
}

.settings-breaker-item .settings-breaker-state.status-ok {
    border-color: #9fdab7;
    background: var(--success-soft);
    color: var(--success);
}

.settings-breaker-item .settings-breaker-state.status-warning,
.settings-breaker-item .settings-breaker-state.status-unknown {
    border-color: #efc66c;
    background: var(--warn-soft);
    color: #805400;
}

.settings-breaker-item .settings-breaker-state.status-alarm {
    border-color: #efaaa5;
    background: var(--danger-soft);
    color: var(--danger);
}

.settings-breaker-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(11, 107, 203, 0.12);
}

.settings-breaker-item strong,
.settings-breaker-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-breaker-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: var(--ui-text-size);
}

.breaker-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--app-gap);
    min-width: 0;
}

.breaker-device-hero,
.breaker-advanced-settings,
.breaker-editor-actions {
    grid-column: 1 / -1;
}

.breaker-device-hero {
    display: grid;
    min-height: 112px;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 2px solid #a8cbea;
    border-radius: 12px;
    background: #eef6ff;
    padding: 12px 14px;
    color: var(--accent-strong);
}

.breaker-device-hero.status-ok {
    border-color: #86d1a7;
    background: #edfdf3;
    color: var(--success);
}

.breaker-device-hero.status-alarm {
    border-color: #efaaa5;
    background: #fff4f3;
    color: var(--danger);
}

.breaker-device-hero.status-warning,
.breaker-device-hero.status-unknown {
    border-color: #efc66c;
    background: #fff9e8;
    color: #805400;
}

.breaker-device-hero.status-offline,
.breaker-device-hero.status-off,
.breaker-device-hero.status-disabled {
    border-color: #cbd5e1;
    background: #f4f6f8;
    color: var(--offline);
}

.breaker-device-hero.is-unconfirmed {
    border-style: dashed;
    color: var(--offline);
}

.breaker-device-hero-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 12px;
    background: currentColor;
}

.breaker-device-hero-icon svg {
    width: 38px;
    height: 38px;
    fill: #ffffff;
}

.breaker-device-hero-copy,
.breaker-device-hero-copy strong,
.breaker-device-hero-copy span,
.breaker-device-hero-aside,
.breaker-device-hero-address small,
.breaker-device-hero-address b {
    display: block;
}

.breaker-device-hero-copy {
    min-width: 0;
    color: var(--text);
}

.breaker-device-hero-copy strong {
    overflow: hidden;
    font-size: clamp(25px, 5.8vw, 32px);
    font-weight: 900;
    line-height: 1.04;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-device-hero-spec {
    margin-top: 5px;
    color: #334155;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.1;
}

.breaker-device-hero-serial {
    margin-top: 5px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.breaker-device-hero-aside {
    min-width: 132px;
    text-align: center;
}

.breaker-device-hero-address {
    display: grid;
    min-height: 62px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 10px;
    background: #ffffff;
    padding: 5px 12px;
}

.breaker-device-hero-address small {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.breaker-device-hero-address b {
    margin-top: 2px;
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.breaker-device-hero-state {
    margin-top: 6px;
    color: currentColor;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.05;
}

.breaker-advanced-settings {
    border: 1px solid #cbd7e6;
    border-radius: 10px;
    background: #ffffff;
}

.breaker-advanced-settings > summary {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #334155;
    cursor: pointer;
    font-size: 21px;
    font-weight: 900;
    list-style: none;
}

.breaker-advanced-settings > summary::-webkit-details-marker {
    display: none;
}

.breaker-advanced-settings > summary::after {
    content: "+";
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
}

.breaker-advanced-settings[open] > summary {
    border-bottom: 1px solid #dbe3ef;
}

.breaker-advanced-settings[open] > summary::after {
    content: "−";
}

.breaker-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--app-gap);
    padding: 12px;
}

.breaker-address-field input[readonly] {
    border-color: #cbd5e1;
    background: #eef2f6;
    color: #334155;
    -webkit-text-fill-color: #334155;
}

.breaker-field-note {
    color: var(--muted);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.15;
}

.breaker-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid #cbd7e6;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.13);
    backdrop-filter: blur(8px);
}

.breaker-pending-changes {
    display: flex;
    min-height: 44px;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    border: 1px solid #efc66c;
    border-radius: 9px;
    background: var(--warn-soft);
    padding: 7px 12px;
    color: #704900;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}

.breaker-editor-actions button {
    min-width: 0;
    min-height: 60px;
    padding: 8px 12px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.08;
    white-space: normal;
}

.breaker-config-panel {
    display: grid;
    grid-column: 1 / -1;
    gap: var(--app-gap);
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.breaker-config-panel h3 {
    margin: 0;
    font-size: clamp(22px, 5.2vw, 28px);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--app-gap);
}

.protection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--app-gap);
}

.breaker-form label:first-of-type,
.form-actions {
    grid-column: 1 / -1;
}

.settings-breaker-item strong {
    font-size: clamp(22px, 5.2vw, 28px);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: 20px;
    min-height: 20px;
}

.check-row span {
    color: var(--text);
    font-size: var(--ui-text-size);
}

.form-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.section-label {
    margin: 8px 0 6px;
    color: var(--muted);
    font-size: var(--ui-text-size);
    font-weight: 700;
}

.touch-active,
button.touch-active,
input.touch-active,
select.touch-active {
    border-color: var(--touch) !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.34) !important;
}

@media (max-width: 760px) {
    .detail-layout,
    .settings-grid,
    .settings-breakers {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .panel-info-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel-info-status {
        max-width: none;
    }

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

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

    .service-adb-transports,
    .service-adb-actions,
    .service-adb-dialog-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .service-adb-head {
        align-items: flex-start;
    }

    .service-adb-badge {
        min-height: 38px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .service-adb-dialog {
        gap: 12px;
        padding: 14px;
    }

    .remote-qr-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .config-grid,
    .protection-grid,
    .breaker-form,
    .remote-user-form {
        grid-template-columns: 1fr;
    }

    .breaker-form label {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    :root {
        --app-gap: 5px;
        --app-pad: 6px;
        --top-icon-size: clamp(42px, 13vw, 46px);
        --title-size: clamp(24px, 7.8vw, 30px);
    }

    .topbar-title {
        padding-right: 2px;
        padding-left: 2px;
    }

    .journal-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .journal-test {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 420px) {
    .journal-event {
        grid-template-columns: 40px minmax(0, 1fr) 76px;
        gap: 5px;
        padding-right: 6px;
        padding-left: 7px;
    }

    .journal-event.has-ack {
        grid-template-columns: 40px minmax(0, 1fr) 40px 76px;
    }

    .event-time {
        min-width: 76px;
        font-size: 19px;
    }

    .journal-event .event-type-icon {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 459px) {
    html.remote-client .app-shell {
        grid-template-rows: auto minmax(0, 1fr);
    }

    html.remote-client .topbar {
        display: grid;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        align-content: center;
        gap: 7px;
    }

    html.remote-client .topbar-title {
        width: 100%;
        padding: 2px 4px;
    }

    html.remote-client .title {
        display: -webkit-box;
        overflow: hidden;
        font-size: clamp(28px, 8.2vw, 36px);
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html.remote-client .topbar-icons {
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    html.remote-client .top-icon {
        width: 100%;
        height: 52px;
    }

    html.remote-client .top-icon svg {
        width: 39px;
        height: 39px;
    }

    html.remote-client .breaker-topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 7px 10px;
    }

    html.remote-client .breaker-topbar-copy {
        min-height: 54px;
    }

    html.remote-client .breaker-topbar-title {
        display: -webkit-box;
        overflow: hidden;
        font-size: clamp(23px, 6.4vw, 29px);
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html.remote-client .breaker-topbar-section {
        grid-column: 1 / -1;
        width: 100%;
    }

    html.remote-client .breaker-section-trigger {
        width: 100%;
        min-height: 56px;
        padding-right: 12px;
        padding-left: 14px;
    }

    html.remote-client .breaker-section-trigger strong {
        font-size: clamp(21px, 5.6vw, 25px);
    }

    html.remote-client .detail-phase-grid,
    html.remote-client .detail-phase-grid.phase-count-2,
    html.remote-client .detail-phase-grid.phase-count-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    html.remote-client .detail-phase-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
    }

    html.remote-client .breaker-name {
        display: -webkit-box;
        overflow: hidden;
        line-height: 1.02;
        text-overflow: ellipsis;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html.remote-client .breaker-top {
        align-items: flex-start;
    }

    html.remote-client .phase-grid,
    html.remote-client .phase-grid.phase-count-1,
    html.remote-client .phase-grid.phase-count-2,
    html.remote-client .phase-grid.phase-count-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    html.remote-client .phase-block {
        display: grid;
        min-height: 96px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        gap: 6px;
        padding: calc(var(--phase-strip-height) + 8px) 8px 8px;
    }

    html.remote-client .phase-voltage,
    html.remote-client .phase-current,
    html.remote-client .phase-power {
        margin-top: 0;
        font-variant-numeric: tabular-nums;
        text-align: center;
    }

    html.remote-client .phase-voltage {
        font-size: clamp(28px, 7.5vw, 32px);
    }

    html.remote-client .phase-current {
        font-size: clamp(26px, 7vw, 30px);
    }

    html.remote-client .phase-power {
        font-size: clamp(24px, 6.5vw, 28px);
    }

    html.remote-client .detail-phase-list strong {
        font-size: clamp(32px, 9vw, 38px);
    }

    html.remote-client .history-controls-card {
        grid-template-columns: minmax(0, 1fr);
    }

    html.remote-client .history-point-values {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    }

    html.remote-client .history-axis {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 4px;
    }

    html.remote-client .history-axis > span {
        white-space: nowrap;
    }

    html.remote-client .history-axis strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html.remote-client .history-navigator-range {
        justify-content: space-between;
        gap: 4px;
        white-space: normal;
        text-align: center;
    }

    html.remote-client .history-navigator-range time {
        white-space: nowrap;
    }

    html.remote-client .history-chart {
        height: clamp(240px, 36dvh, 320px);
    }

    html.remote-client .journal-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    html.remote-client .journal-test {
        grid-column: 1 / -1;
        width: 100%;
    }

    html.remote-client .journal-event.has-ack {
        grid-template-columns: 40px minmax(0, 1fr) 48px 76px;
    }

    html.remote-client .event-ack {
        width: 48px;
        min-height: 48px;
    }

    html.remote-client .journal-filter,
    html.remote-client .journal-pager button {
        min-height: 50px;
    }

    html.remote-client .push-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    html.remote-client .push-panel strong,
    html.remote-client .push-panel span {
        white-space: normal;
    }

    html.remote-client .push-panel button {
        width: 100%;
        min-width: 0;
        min-height: 52px;
    }

    html.remote-client .fullscreen-picker-head {
        min-height: 84px;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        padding-right: max(10px, env(safe-area-inset-right, 0px));
        padding-left: max(14px, env(safe-area-inset-left, 0px));
    }

    html.remote-client .fullscreen-picker-options {
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
    }

    html.remote-client .action-confirm-overlay {
        padding-top: max(16px, env(safe-area-inset-top, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left, 0px));
    }

    html.remote-client .action-confirm-dialog {
        max-height: 100%;
    }

    html.remote-client #dashboardView,
    html.remote-client #settingsView {
        padding-right: max(var(--app-pad), env(safe-area-inset-right, 0px));
        padding-left: max(var(--app-pad), env(safe-area-inset-left, 0px));
    }

    html.remote-client #breakerView,
    html.remote-client #journalView,
    html.remote-client #loginView {
        padding-right: max(var(--app-pad), env(safe-area-inset-right, 0px));
        padding-bottom: max(var(--app-pad), env(safe-area-inset-bottom, 0px));
        padding-left: max(var(--app-pad), env(safe-area-inset-left, 0px));
    }
}

/* XIOT-TP8: 1280x800 physical, approximately 931x582 CSS px at 220 dpi. */
@media (orientation: landscape) and (min-width: 850px) and (max-width: 1050px) {
    html:not(.remote-client) {
        --app-pad: 8px;
        --app-gap: 8px;
        --top-icon-size: 56px;
        --topbar-height: 76px;
        --title-size: 38px;
        --card-title-size: 34px;
        --card-icon-size: 56px;
        --phase-u-size: 40px;
        --phase-i-size: 34px;
        --phase-p-size: 28px;
        --total-value-size: 36px;
        --detail-value-size: 32px;
        --phase-strip-height: 28px;
        --detail-phase-strip-height: 28px;
        --detail-phase-label-size: 19px;
        --detail-phase-main-size: 34px;
        --detail-phase-sub-size: 34px;
        --ui-text-size: 20px;
    }

    html:not(.remote-client) button {
        min-height: 48px;
    }

    html:not(.remote-client) input,
    html:not(.remote-client) select {
        min-height: 50px;
    }

    html:not(.remote-client) .topbar {
        padding: 8px 10px;
    }

    html:not(.remote-client) .topbar-title {
        padding: 2px 4px;
    }

    html:not(.remote-client) .topbar-icons {
        gap: 8px;
    }

    html:not(.remote-client) .icon-badge {
        top: -7px;
        right: -7px;
        min-width: 28px;
        height: 28px;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-topbar {
        grid-template-columns: auto minmax(0, 1fr) 280px;
        gap: 16px;
    }

    html:not(.remote-client) .topbar-back-button {
        min-width: 96px;
        font-size: 20px;
    }

    html:not(.remote-client) .breaker-topbar-title {
        font-size: 30px;
    }

    html:not(.remote-client) .breaker-section-trigger {
        width: 280px;
        padding-right: 12px;
        padding-left: 14px;
    }

    html:not(.remote-client) .breaker-section-trigger strong {
        font-size: 20px;
    }

    html:not(.remote-client) .breaker-list {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }

    html:not(.remote-client) .breaker-card {
        min-height: min(440px, calc(100dvh - var(--topbar-height) - var(--app-pad) * 2));
        grid-template-rows: auto minmax(0, 1fr) auto;
        align-content: stretch;
        padding: 10px;
    }

    html:not(.remote-client) .breaker-state {
        font-size: 20px;
    }

    html:not(.remote-client) .phase-grid {
        height: 100%;
        margin-top: 8px;
    }

    html:not(.remote-client) .phase-block {
        display: grid;
        height: 100%;
        min-height: 150px;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        align-items: center;
        padding: 36px 10px 8px;
    }

    html:not(.remote-client) .phase-voltage,
    html:not(.remote-client) .phase-current,
    html:not(.remote-client) .phase-power {
        align-self: center;
        margin-top: 0;
    }

    html:not(.remote-client) .breaker-totals {
        margin-top: 8px;
    }

    html:not(.remote-client) .operator-detail-status {
        min-height: 64px;
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 7px 10px;
    }

    html:not(.remote-client) .operator-detail-status-icon {
        width: 44px;
        height: 44px;
    }

    html:not(.remote-client) .operator-detail-status-icon svg {
        width: 29px;
        height: 29px;
    }

    html:not(.remote-client) .operator-detail-status strong {
        font-size: 23px;
    }

    html:not(.remote-client) .operator-detail-status span {
        font-size: 18px;
    }

    html:not(.remote-client) .measurement-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:first-child {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:last-child {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .detail-phase-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:not(:first-child) .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .measurement-stack > .detail-card:last-child .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .metric-tile {
        min-height: 68px;
        padding: 6px;
    }

    html:not(.remote-client) .metric-tile > span {
        font-size: 19px;
    }

    html:not(.remote-client) .metric-grid.energy-grid .metric-tile strong {
        font-size: 32px;
    }

    html:not(.remote-client) .control-state-card {
        min-height: 58px;
    }

    html:not(.remote-client) .control-permission {
        min-height: 60px;
    }

    html:not(.remote-client) .control-toggle {
        width: 80px;
        min-height: 44px;
    }

    html:not(.remote-client) .control-toggle-knob {
        width: 36px;
        height: 36px;
    }

    html:not(.remote-client) .control-toggle.is-on .control-toggle-knob {
        transform: translateX(36px);
    }

    html:not(.remote-client) .control-toggle:active .control-toggle-knob {
        width: 40px;
    }

    html:not(.remote-client) .control-button {
        min-height: 68px;
        font-size: 22px;
    }

    html:not(.remote-client) .control-button svg {
        width: 34px;
        height: 34px;
    }

    html:not(.remote-client) .history-card {
        min-height: 0;
        padding: 8px;
    }

    html:not(.remote-client) .history-point-panel {
        grid-template-columns: 210px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
    }

    html:not(.remote-client) .history-point-time {
        font-size: 20px;
    }

    html:not(.remote-client) .history-point-values {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    html:not(.remote-client) .history-point-value {
        min-height: 42px;
    }

    html:not(.remote-client) .history-point-value b {
        font-size: 18px;
    }

    html:not(.remote-client) .history-point-value strong {
        font-size: 20px;
    }

    html:not(.remote-client) .history-chart {
        height: 220px;
        touch-action: none;
    }

    html:not(.remote-client) .history-navigator-track {
        height: 48px;
    }

    html:not(.remote-client) .history-controls-card {
        padding: 8px;
    }

    html:not(.remote-client) .history-control > span {
        font-size: 19px;
    }

    html:not(.remote-client) .history-picker-trigger {
        min-height: 52px;
    }

    html:not(.remote-client) .history-picker-trigger strong {
        font-size: 22px;
    }

    html:not(.remote-client) .history-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .history-summary-tile {
        min-height: 78px;
    }

    html:not(.remote-client) .journal-head {
        min-height: 52px;
        padding: 6px 8px;
    }

    html:not(.remote-client) .back-button {
        min-width: 100px;
        min-height: 50px;
        font-size: 20px;
    }

    html:not(.remote-client) .detail-title {
        font-size: 26px;
    }

    html:not(.remote-client) .detail-subtitle {
        font-size: 18px;
    }

    html:not(.remote-client) .journal-filter {
        min-height: 48px;
        font-size: 19px;
    }

    html:not(.remote-client) .event-row {
        min-height: 56px;
    }

    html:not(.remote-client) .journal-event {
        grid-template-columns: 42px minmax(0, 1fr) 96px;
    }

    html:not(.remote-client) .journal-event.has-ack {
        grid-template-columns: 42px minmax(0, 1fr) 48px 96px;
    }

    html:not(.remote-client) .journal-event.has-details {
        grid-template-columns: 42px minmax(0, 1fr) 30px 96px;
    }

    html:not(.remote-client) .journal-event.has-ack.has-details {
        grid-template-columns: 42px minmax(0, 1fr) 48px 30px 96px;
    }

    html:not(.remote-client) .event-message {
        font-size: 20px;
    }

    html:not(.remote-client) .event-time {
        min-width: 96px;
        font-size: 19px;
    }

    html:not(.remote-client) .settings-panel {
        grid-template-columns: 210px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        overflow: hidden;
    }

    html:not(.remote-client) .settings-tabs {
        position: static;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        overflow: auto;
        padding: 8px;
    }

    html:not(.remote-client) .settings-tab {
        min-height: 58px;
        padding: 0 14px;
        text-align: left;
    }

    html:not(.remote-client) .settings-grid {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        overflow: auto;
    }

    html:not(.remote-client) .settings-section {
        gap: 8px;
        padding: 10px;
    }

    html:not(.remote-client) .settings-section h2 {
        font-size: 26px;
    }

    html:not(.remote-client) .service-adb-card {
        gap: 8px;
        padding: 10px;
    }

    html:not(.remote-client) .service-adb-head h3 {
        font-size: 29px;
    }

    html:not(.remote-client) .service-adb-transport {
        min-height: 62px;
        padding: 7px 10px;
    }

    html:not(.remote-client) .service-adb-message {
        min-height: 50px;
        padding: 7px 9px;
    }

    html:not(.remote-client) .service-adb-actions button {
        min-height: 56px;
        font-size: 21px;
    }

    html:not(.remote-client) .service-adb-dialog {
        width: min(720px, 100%);
    }

    html:not(.remote-client) .settings-section[data-settings-section="object"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .settings-section[data-settings-section="object"] > h2,
    html:not(.remote-client) .settings-section[data-settings-section="object"] > .section-label,
    html:not(.remote-client) .settings-section[data-settings-section="object"] > .inline-actions,
    html:not(.remote-client) #saveObjectSettings {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) #saveObjectSettings {
        min-width: 220px;
        justify-self: start;
    }

    html:not(.remote-client) .check-row input {
        width: 28px;
        min-height: 28px;
    }

    html:not(.remote-client) .settings-breaker-list {
        max-height: none;
    }

    html:not(.remote-client) .remote-qr-code {
        width: 160px;
        height: 160px;
    }

    html:not(.remote-client) .remote-qr-code svg {
        width: 150px;
        height: 150px;
    }

    html:not(.remote-client) .fullscreen-picker-head {
        min-height: 66px;
    }

    html:not(.remote-client) .fullscreen-picker-head h2 {
        font-size: 30px;
    }

    html:not(.remote-client) .fullscreen-picker-close {
        width: 56px;
        min-height: 54px;
        font-size: 40px;
    }

    html:not(.remote-client) .fullscreen-picker-options {
        width: min(720px, 100%);
        justify-self: center;
        gap: 8px;
        padding: 12px;
    }

    html:not(.remote-client) .setting-value-picker .fullscreen-picker-options {
        width: min(900px, 100%);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .fullscreen-picker-option {
        min-height: 60px;
    }

    html:not(.remote-client) .fullscreen-picker-option span {
        font-size: 24px;
    }

    html:not(.remote-client) .action-confirm-dialog {
        width: min(520px, 100%);
        padding: 20px;
    }

    html:not(.remote-client) .action-confirm-icon {
        width: 64px;
        height: 64px;
    }

    html:not(.remote-client) .action-confirm-dialog h2 {
        font-size: 30px;
    }

    html:not(.remote-client) .action-confirm-dialog p {
        font-size: 22px;
    }

    html:not(.remote-client) .action-confirm-actions button {
        min-height: 64px;
        font-size: 23px;
    }
}

/* XIOT-TP8 dense landscape layout. Kept separate from TP4 and the phone PWA. */
@media (orientation: landscape) and (min-width: 850px) and (max-width: 1050px) {
    html:not(.remote-client) #dashboardView {
        grid-template-rows: minmax(0, 1fr);
    }

    html:not(.remote-client) .breaker-list {
        width: 100%;
        height: 100%;
        grid-auto-flow: row;
        align-content: stretch;
        overflow-y: auto;
        padding-bottom: 0;
    }

    html:not(.remote-client) .breaker-list[data-layout="empty"] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }

    html:not(.remote-client) .breaker-list[data-layout="one"],
    html:not(.remote-client) .breaker-list[data-layout="two"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: calc((100% - var(--app-gap)) / 2);
        align-content: start;
    }

    html:not(.remote-client) .breaker-list .operator-empty-state {
        grid-column: 1 / -1;
        min-height: 100%;
    }

    html:not(.remote-client) .breaker-list .breaker-card {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    html:not(.remote-client) .breaker-list[data-layout="one"] .phase-block,
    html:not(.remote-client) .breaker-list[data-layout="two"] .phase-block {
        min-height: 0;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-card,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card {
        grid-template-rows: auto minmax(0, 1fr) auto;
        padding: 6px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-top,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-top,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-top {
        position: relative;
        min-height: 44px;
        gap: 5px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-name {
        font-size: 26px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-name {
        font-size: 23px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-name {
        font-size: 22px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-state,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-state,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-state {
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-state-full,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-state-full,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-state-full {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-state-compact,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-state-compact,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-state-compact {
        display: block !important;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .status-pill,
    html:not(.remote-client) .breaker-list[data-layout="six"] .status-pill,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .status-pill {
        width: 44px;
        height: 44px;
        min-height: 44px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .status-pill svg,
    html:not(.remote-client) .breaker-list[data-layout="six"] .status-pill svg,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .status-pill svg {
        width: 31px;
        height: 31px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .card-journal,
    html:not(.remote-client) .breaker-list[data-layout="six"] .card-journal,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .card-journal {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 2;
        width: 48px;
        height: 48px;
        min-height: 48px;
        border-color: transparent;
        background: transparent;
        border-radius: 50%;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-card.has-card-journal .breaker-heading,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-card.has-card-journal .breaker-heading,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-card.has-card-journal .breaker-heading {
        padding-right: 0;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .card-journal svg,
    html:not(.remote-client) .breaker-list[data-layout="six"] .card-journal svg,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .card-journal svg {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .card-journal span,
    html:not(.remote-client) .breaker-list[data-layout="six"] .card-journal span,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .card-journal span {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 27px;
        height: 27px;
        border: 2px solid #ffffff;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-grid,
    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-grid,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-grid {
        height: auto;
        min-height: 0;
        gap: 4px;
        margin-top: 5px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-block,
    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-block {
        height: auto;
        min-height: 91px;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        padding: 29px 5px 4px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-name,
    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-name {
        height: 25px;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-voltage {
        font-size: 26px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-current {
        font-size: 22px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-voltage {
        font-size: 23px;
    }

    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-current {
        font-size: 20px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .phase-power,
    html:not(.remote-client) .breaker-list[data-layout="six"] .phase-power,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-power {
        display: none;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-grid.phase-count-1 {
        grid-template-rows: minmax(0, 1fr);
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-grid.phase-count-2 {
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-block {
        display: grid;
        height: 100%;
        min-height: 30px;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        grid-template-rows: minmax(0, 1fr);
        align-items: center;
        column-gap: 4px;
        padding: 2px 4px 2px 34px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-name {
        top: 0;
        right: auto;
        bottom: 0;
        width: 30px;
        height: auto;
        justify-content: center;
        border-radius: 7px 0 0 7px;
        padding: 0;
        font-size: 18px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-voltage,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-current {
        align-self: center;
        margin: 0;
        text-align: center;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-voltage {
        font-size: 22px;
    }

    html:not(.remote-client) .breaker-list[data-layout="eight"] .phase-current {
        font-size: 19px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-totals,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-totals,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-totals {
        gap: 4px;
        margin-top: 5px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-totals div,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-totals div,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-totals div {
        min-height: 43px;
        padding: 3px 5px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-totals span,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-totals span,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-totals span {
        overflow: hidden;
        font-size: 18px;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-totals strong,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-totals strong,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-totals strong {
        margin-top: 1px;
        font-size: 23px;
    }

    html:not(.remote-client) .breaker-list[data-layout="four"] .breaker-totals.single div,
    html:not(.remote-client) .breaker-list[data-layout="six"] .breaker-totals.single div,
    html:not(.remote-client) .breaker-list[data-layout="eight"] .breaker-totals.single div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
    }

    html:not(.remote-client) .measurement-stack {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
    }

    html:not(.remote-client) .measurement-stack > .detail-card {
        min-width: 0;
        padding: 6px;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:first-child {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:nth-child(2) {
        grid-column: 1 / 8;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:nth-child(3) {
        grid-column: 8 / -1;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:last-child {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .measurement-stack .section-label {
        margin: 2px 0 4px;
        font-size: 18px;
        line-height: 1.05;
    }

    html:not(.remote-client) .detail-phase-grid {
        gap: 5px;
    }

    html:not(.remote-client) .detail-phase-block {
        padding: 31px 5px 5px;
    }

    html:not(.remote-client) .detail-phase-title {
        height: 26px;
        font-size: 18px;
    }

    html:not(.remote-client) .detail-phase-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px 7px;
        margin-top: 3px;
    }

    html:not(.remote-client) .detail-phase-label {
        overflow: hidden;
        font-size: 18px;
        letter-spacing: 0;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html:not(.remote-client) .detail-phase-list strong {
        margin-top: 1px;
        font-size: 26px;
        line-height: 0.96;
    }

    html:not(.remote-client) .measurement-stack > .detail-card:nth-child(2) .metric-grid,
    html:not(.remote-client) .measurement-stack > .detail-card:nth-child(3) .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .measurement-stack > .detail-card:nth-child(3) .metric-grid.energy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .measurement-stack > .detail-card:last-child .metric-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    html:not(.remote-client) .measurement-stack .metric-grid {
        gap: 5px;
    }

    html:not(.remote-client) .measurement-stack .metric-tile {
        min-height: 62px;
        padding: 5px;
    }

    html:not(.remote-client) .measurement-stack .metric-tile > span {
        font-size: 18px;
        line-height: 1.04;
    }

    html:not(.remote-client) .measurement-stack .metric-tile strong,
    html:not(.remote-client) .measurement-stack .metric-grid.energy-grid .metric-tile strong {
        margin-top: 2px;
        font-size: 26px;
    }

    html:not(.remote-client) .detail-layout {
        grid-template-columns: minmax(285px, 0.8fr) minmax(0, 1.65fr);
        align-items: start;
    }

    html:not(.remote-client) .detail-layout > .detail-card:last-child .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .detail-layout .metric-tile {
        min-height: 66px;
    }

    html:not(.remote-client) .control-card {
        display: grid;
        width: min(790px, 100%);
        min-height: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: center;
        justify-self: center;
        gap: 8px;
        padding: 10px;
    }

    html:not(.remote-client) .operator-detail-status + .control-card {
        min-height: calc(100% - 72px);
    }

    html:not(.remote-client) .control-card .control-state-card,
    html:not(.remote-client) .control-card .control-permission {
        min-width: 0;
        margin-bottom: 0;
    }

    html:not(.remote-client) .control-card .control-grid,
    html:not(.remote-client) .control-card .service-note {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .history-stack {
        gap: 6px;
    }

    html:not(.remote-client) .history-card {
        padding: 6px;
    }

    html:not(.remote-client) .history-card > .section-label:first-child {
        display: none;
    }

    html:not(.remote-client) .history-chart-wrap {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 4px;
        column-gap: 10px;
    }

    html:not(.remote-client) .history-point-panel,
    html:not(.remote-client) .history-chart-stage,
    html:not(.remote-client) .history-navigator {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .history-axis {
        grid-column: 1;
    }

    html:not(.remote-client) .history-legend {
        grid-column: 2;
    }

    html:not(.remote-client) .history-point-panel {
        grid-template-columns: 228px minmax(0, 1fr);
        padding: 4px 8px;
    }

    html:not(.remote-client) .history-point-value {
        min-height: 40px;
        padding: 4px 6px;
    }

    html:not(.remote-client) .history-chart-stage {
        line-height: 0;
    }

    html:not(.remote-client) .history-chart {
        height: 196px;
    }

    html:not(.remote-client) .history-axis,
    html:not(.remote-client) .history-legend {
        font-size: 18px;
    }

    html:not(.remote-client) .history-navigator {
        gap: 4px;
        padding-top: 5px;
    }

    html:not(.remote-client) .history-navigator-range {
        font-size: 20px;
    }

    html:not(.remote-client) .history-navigator-track {
        height: 48px;
    }

    html:not(.remote-client) .history-controls-card {
        padding: 6px 8px;
    }

    html:not(.remote-client) .history-control {
        gap: 3px;
    }

    html:not(.remote-client) .history-picker-trigger {
        min-height: 50px;
    }

    html:not(.remote-client) .history-summary-tile {
        min-height: 72px;
    }

    html:not(.remote-client) .journal-head {
        min-height: 52px;
        padding: 3px 6px;
    }

    html:not(.remote-client) .journal-head > div {
        display: flex;
        min-width: 0;
        align-items: baseline;
        gap: 12px;
    }

    html:not(.remote-client) .journal-head .detail-subtitle {
        margin-top: 0;
    }

    html:not(.remote-client) .event-row {
        min-height: 52px;
        padding: 4px 8px;
    }

    html:not(.remote-client) .journal-list + .journal-pager {
        display: none;
    }

    html:not(.remote-client) #settingsView > .settings-login {
        align-self: center;
        width: min(500px, 100%);
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    html:not(.remote-client) .form-error {
        min-height: 24px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    html:not(.remote-client) .settings-section[data-settings-section="object"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-editor > .section-title-row {
        min-width: 0;
        justify-content: flex-start;
    }

    html:not(.remote-client) .breaker-editor > .section-title-row > button {
        flex: 0 0 auto;
        min-width: 112px;
    }

    html:not(.remote-client) .breaker-editor > .section-title-row > h2 {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html:not(.remote-client) .breaker-device-hero {
        display: grid;
        min-height: 108px;
        grid-template-columns: 58px minmax(0, 1fr) 134px;
        padding: 10px 12px;
    }

    html:not(.remote-client) .breaker-advanced-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    html:not(.remote-client) .breaker-advanced-grid input,
    html:not(.remote-client) .breaker-advanced-grid select {
        min-height: 56px;
    }

    html:not(.remote-client) .breaker-editor-actions {
        grid-template-columns: 1.15fr 1.15fr 1.05fr 0.75fr;
    }

    html:not(.remote-client) .breaker-editor-actions button {
        min-height: 64px;
        font-size: 20px;
    }

    html:not(.remote-client) .breaker-form > label.check-row,
    html:not(.remote-client) .protection-grid > label.check-row,
    html:not(.remote-client) .remote-user-form > label.check-row,
    html:not(.remote-client) .remote-rights > label.check-row {
        min-height: 50px;
        border: 1px solid #dbe3ef;
        border-radius: 7px;
        background: #ffffff;
        padding: 6px 8px;
    }

    html:not(.remote-client) .check-row input {
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        min-height: 28px;
    }

    html:not(.remote-client) .breaker-form > label:not(.check-row),
    html:not(.remote-client) .remote-user-form > label:not(.check-row) {
        align-self: end;
    }

    html:not(.remote-client) .remote-rights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html:not(.remote-client) .remote-rights-title,
    html:not(.remote-client) .remote-rights > .event-row {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) .settings-breaker-list.remote-user-list {
        max-height: none;
        overflow: visible;
    }

    html:not(.remote-client) .settings-breaker-list .settings-breaker-item strong {
        display: -webkit-box;
        white-space: normal;
        line-height: 1.08;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    html:not(.remote-client) .settings-breaker-list .settings-breaker-item .settings-breaker-name {
        display: block;
        overflow: hidden;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
        -webkit-line-clamp: initial;
    }

    html:not(.remote-client) .remote-user-list .settings-breaker-item span {
        white-space: normal;
        line-height: 1.15;
    }

    html:not(.remote-client) .settings-breaker-list > .event-row,
    html:not(.remote-client) .remote-rights > .event-row,
    html:not(.remote-client) .fault-list > .event-row,
    html:not(.remote-client) .journal-list > .event-row:not(.journal-event) {
        display: grid;
        min-height: 72px;
        place-items: center;
        border-style: dashed;
        color: var(--muted);
        text-align: center;
    }

    html:not(.remote-client) #remoteStatus {
        border-color: #c9def5;
        background: #eef6ff;
        font-weight: 800;
    }

    html:not(.remote-client) .fullscreen-picker-options {
        width: min(760px, 100%);
        grid-auto-rows: minmax(60px, auto);
        align-content: safe center;
    }

    html:not(.remote-client) .action-confirm-dialog h2,
    html:not(.remote-client) .action-confirm-dialog p,
    html:not(.remote-client) .fullscreen-picker-option span {
        overflow-wrap: anywhere;
    }

    html:not(.remote-client) .action-confirm-actions button {
        min-width: 0;
        white-space: normal;
    }

    /* Independent columns avoid empty rows when protection groups have very
     * different heights (for example voltage next to leakage). */
    html:not(.remote-client) .device-settings-groups,
    html:not(.remote-client) .device-protection-groups {
        display: block;
        column-count: 2;
        column-gap: 8px;
        column-fill: balance;
    }

    html:not(.remote-client) .device-settings-groups > .device-settings-group,
    html:not(.remote-client) .device-protection-groups > .device-settings-group {
        width: 100%;
        margin: 0 0 8px;
        break-inside: avoid-column;
        -webkit-column-break-inside: avoid;
    }
}

/* The address is encoded in the QR code, but is intentionally not repeated as
 * text in the operator interface. */
#remoteQrUrl {
    display: none !important;
}

/* XIOT-TP8 settings: compact controls without reducing the operator-facing
 * interface elsewhere or changing the phone/PWA layout. */
@media (orientation: landscape) and (min-width: 850px) and (max-width: 1050px) {
    html:not(.remote-client) #settingsView {
        gap: 6px;
        padding: 6px 8px;
    }

    html:not(.remote-client) #settingsView > .settings-head {
        min-height: 50px;
        padding: 3px 8px;
    }

    html:not(.remote-client) #settingsView > .settings-head .detail-title {
        font-size: 28px;
    }

    html:not(.remote-client) #settingsView #closeSettings {
        min-height: 48px;
        padding-inline: 14px;
        font-size: 20px;
    }

    html:not(.remote-client) #settingsView #settingsPanel {
        grid-template-columns: 185px minmax(0, 1fr);
        gap: 6px;
    }

    html:not(.remote-client) #settingsView #settingsTabs {
        gap: 6px;
        padding: 6px;
    }

    html:not(.remote-client) #settingsView .settings-tab {
        min-height: 50px;
        padding: 0 10px;
        font-size: 19px;
        line-height: 1.08;
    }

    html:not(.remote-client) #settingsView .settings-grid {
        gap: 6px;
        scroll-padding-bottom: 130px;
    }

    html:not(.remote-client) #settingsView .settings-section {
        gap: 6px;
        padding: 8px;
    }

    html:not(.remote-client) #settingsView .settings-section h2 {
        font-size: 24px;
    }

    html:not(.remote-client) #settingsView label {
        gap: 3px;
    }

    html:not(.remote-client) #settingsView label > span,
    html:not(.remote-client) #settingsView .section-label,
    html:not(.remote-client) #settingsView .remote-rights-title {
        font-size: 18px;
        line-height: 1.1;
    }

    html:not(.remote-client) #settingsView input:not([type="checkbox"]):not([type="hidden"]),
    html:not(.remote-client) #settingsView select {
        min-height: 48px;
        padding-inline: 8px;
        font-size: 20px;
    }

    html:not(.remote-client) #settingsView button {
        font-size: 20px;
    }

    html:not(.remote-client) #settingsView .settings-section[data-settings-section="object"] {
        column-gap: 6px;
        row-gap: 6px;
    }

    html:not(.remote-client) #settingsView #saveObjectSettings {
        min-width: 205px;
        min-height: 48px;
    }

    html:not(.remote-client) #settingsView .inline-actions {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .settings-section[data-settings-section="breakers"] > .section-title-row,
    html:not(.remote-client) #settingsView .section-title-actions {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .settings-section[data-settings-section="breakers"]:has(#settingsBreakerEditor:not(.hidden)) > .section-title-row,
    html:not(.remote-client) #settingsView .settings-section[data-settings-section="remote"]:has(#remoteUserEditor:not(.hidden)) > .section-title-row {
        display: none;
    }

    html:not(.remote-client) #settingsView .section-title-actions button {
        min-height: 50px;
        padding-inline: 12px;
        font-size: 19px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-list {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item[data-breaker-id] {
        min-height: 96px;
        grid-template-columns: minmax(0, 1fr) 126px;
        gap: 8px;
        padding: 8px 10px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-main {
        gap: 3px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-aside {
        gap: 5px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-name {
        font-size: 24px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-spec {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-serial {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-address {
        min-height: 44px;
        font-size: 20px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-item .settings-breaker-state {
        min-height: 34px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-editor,
    html:not(.remote-client) #settingsView .settings-breaker-overview,
    html:not(.remote-client) #settingsView .remote-overview,
    html:not(.remote-client) #settingsView .remote-user-editor {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .breaker-editor > .section-title-row > button {
        min-width: 100px;
        min-height: 48px;
    }

    html:not(.remote-client) #settingsView .breaker-form {
        grid-template-columns: minmax(250px, 1.4fr) minmax(150px, 0.7fr) minmax(170px, 0.8fr);
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .breaker-form > label:first-of-type {
        grid-column: auto;
    }

    html:not(.remote-client) #settingsView .breaker-form > label.check-row,
    html:not(.remote-client) #settingsView .protection-grid > label.check-row,
    html:not(.remote-client) #settingsView .remote-user-form > label.check-row,
    html:not(.remote-client) #settingsView .remote-rights > label.check-row {
        min-height: 48px;
        padding: 5px 7px;
    }

    html:not(.remote-client) #settingsView .check-row input {
        flex-basis: 26px;
        width: 26px;
        height: 26px;
        min-height: 26px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero {
        min-height: 80px;
        grid-template-columns: 46px minmax(0, 1fr) 116px;
        gap: 8px;
        padding: 7px 10px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-icon {
        width: 44px;
        height: 44px;
        border-radius: 9px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-icon svg {
        width: 30px;
        height: 30px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-copy strong {
        font-size: 26px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-spec,
    html:not(.remote-client) #settingsView .breaker-device-hero-serial {
        margin-top: 3px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-aside {
        min-width: 116px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-address {
        min-height: 52px;
        padding: 4px 8px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-address small,
    html:not(.remote-client) #settingsView .breaker-device-hero-state {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-device-hero-address b {
        font-size: 26px;
    }

    html:not(.remote-client) #settingsView .breaker-config-panel {
        gap: 6px;
        padding: 8px;
    }

    html:not(.remote-client) #settingsView .breaker-config-panel h3 {
        font-size: 24px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups {
        column-gap: 6px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups > .device-settings-group {
        margin-bottom: 6px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group {
        gap: 6px;
        padding: 7px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-head {
        min-height: 42px;
        gap: 7px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-heading {
        gap: 7px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-icon {
        width: 40px;
        height: 40px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-icon svg {
        width: 27px;
        height: 27px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-title {
        font-size: 22px;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-settings-group-state {
        min-height: 34px;
        padding: 4px 8px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
        gap: 6px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-item {
        min-height: 60px;
        gap: 3px;
        padding: 6px 7px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-item.is-switch {
        grid-column: 1 / -1;
        min-height: 48px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-label {
        font-size: 18px;
        line-height: 1.08;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-value {
        font-size: 24px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-control input,
    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-control select {
        min-height: 48px;
        font-size: 21px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-stepper {
        grid-template-columns: 48px minmax(58px, 1fr) 48px;
        gap: 5px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-button,
    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-value {
        min-height: 50px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-button {
        font-size: 32px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-value {
        gap: 4px;
        padding: 4px 6px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-value strong {
        font-size: 26px;
    }

    html:not(.remote-client) #settingsView #breakerSettingsGroups .device-setting-step-value span {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .device-settings-message,
    html:not(.remote-client) #settingsView .device-settings-empty {
        min-height: 52px;
        padding: 7px 8px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-advanced-settings > summary {
        min-height: 50px;
        padding: 6px 10px;
        font-size: 19px;
    }

    html:not(.remote-client) #settingsView .breaker-advanced-settings > summary::after {
        font-size: 30px;
    }

    html:not(.remote-client) #settingsView .breaker-advanced-grid {
        gap: 6px;
        padding: 8px;
    }

    html:not(.remote-client) #settingsView .breaker-advanced-grid input,
    html:not(.remote-client) #settingsView .breaker-advanced-grid select {
        min-height: 48px;
    }

    html:not(.remote-client) #settingsView .breaker-field-note {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-editor-actions {
        gap: 6px;
        padding: 4px;
    }

    html:not(.remote-client) #settingsView .breaker-pending-changes {
        min-height: 40px;
        padding: 5px 9px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .breaker-editor-actions button {
        min-height: 52px;
        padding: 6px 8px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView [data-settings-section="panel"] .panel-info-card {
        min-height: 76px;
        gap: 10px;
        padding: 8px 11px;
    }

    html:not(.remote-client) #settingsView [data-settings-section="panel"] .panel-info-name {
        font-size: 28px;
    }

    html:not(.remote-client) #settingsView [data-settings-section="panel"] .panel-info-specs,
    html:not(.remote-client) #settingsView [data-settings-section="panel"] .panel-info-status {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView [data-settings-section="panel"] .panel-info-status {
        padding: 7px 9px;
    }

    html:not(.remote-client) #settingsView .system-settings-actions {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .system-settings-actions button {
        min-height: 50px;
        font-size: 21px;
    }

    html:not(.remote-client) #settingsView .service-note {
        min-height: 42px;
        padding: 6px 8px;
        font-size: 18px;
        line-height: 1.2;
    }

    html:not(.remote-client) #settingsView .service-adb-card {
        gap: 6px;
        padding: 8px;
    }

    html:not(.remote-client) #settingsView .service-adb-head {
        gap: 8px;
    }

    html:not(.remote-client) #settingsView .service-adb-kicker {
        margin-bottom: 1px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .service-adb-head h3 {
        font-size: 25px;
    }

    html:not(.remote-client) #settingsView .service-adb-badge {
        min-height: 36px;
        padding: 5px 11px;
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .service-adb-transports {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .service-adb-transport {
        min-height: 50px;
        gap: 2px;
        padding: 5px 8px;
    }

    html:not(.remote-client) #settingsView .service-adb-transport span {
        font-size: 18px;
    }

    html:not(.remote-client) #settingsView .service-adb-transport strong {
        font-size: 21px;
    }

    html:not(.remote-client) #settingsView .service-adb-message {
        min-height: 42px;
        padding: 5px 8px;
    }

    html:not(.remote-client) #settingsView .service-adb-actions {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .service-adb-actions button {
        min-height: 50px;
        padding: 6px 9px;
        font-size: 19px;
    }

    html:not(.remote-client) #settingsView .remote-access-switches {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .remote-access-switches .check-row {
        min-height: 48px;
        padding: 5px 8px;
    }

    html:not(.remote-client) #settingsView .remote-access-switches .check-row span {
        font-size: 19px;
    }

    html:not(.remote-client) #settingsView .settings-breaker-list.remote-user-list .settings-breaker-item {
        min-height: 54px;
    }

    html:not(.remote-client) #settingsView .remote-user-editor {
        grid-template-columns: 170px minmax(0, 1fr);
        align-items: start;
    }

    html:not(.remote-client) #settingsView .remote-user-editor > .section-title-row {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) #settingsView .remote-qr-card {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 6px;
        padding: 7px;
        text-align: center;
    }

    html:not(.remote-client) #settingsView .remote-qr-code {
        width: 140px;
        height: 140px;
    }

    html:not(.remote-client) #settingsView .remote-qr-code svg {
        width: 132px;
        height: 132px;
    }

    html:not(.remote-client) #settingsView .remote-qr-card strong {
        font-size: 18px;
        line-height: 1.1;
    }

    html:not(.remote-client) #settingsView .remote-user-form {
        grid-column: 2;
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .remote-qr-card.hidden + .remote-user-form {
        grid-column: 1 / -1;
    }

    html:not(.remote-client) #settingsView .remote-rights {
        gap: 6px;
        padding: 7px;
    }

    html:not(.remote-client) #settingsView .form-actions {
        gap: 6px;
    }

    html:not(.remote-client) #settingsView .form-actions button {
        min-height: 50px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog {
        gap: 10px;
        padding: 14px 16px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog-head h2 {
        font-size: 31px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog-head p,
    html:not(.remote-client) #serviceAdbOverlay .service-adb-fields label > span,
    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog-error {
        font-size: 19px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-form,
    html:not(.remote-client) #serviceAdbOverlay .service-adb-fields,
    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog-actions {
        gap: 8px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-fields input {
        min-height: 52px;
        font-size: 22px;
    }

    html:not(.remote-client) #serviceAdbOverlay .service-adb-dialog-actions button {
        min-height: 58px;
        font-size: 21px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-dialog {
        grid-template-rows: auto 8px minmax(0, 1fr) auto;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-header {
        min-height: 66px;
        gap: 12px;
        padding: 7px 14px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-heading > span {
        font-size: 18px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-heading h2 {
        font-size: 29px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-close {
        min-height: 52px;
        padding-inline: 14px;
        font-size: 20px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-body {
        padding: 10px 14px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-lead {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 14px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-symbol {
        width: 86px;
        height: 86px;
        border-radius: 22px;
        font-size: 44px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-copy h3 {
        font-size: 30px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-copy p {
        font-size: 20px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-choices {
        gap: 8px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-choice {
        min-height: 154px;
        gap: 6px;
        padding: 12px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-choice-mark {
        width: 48px;
        height: 48px;
        border-radius: 13px;
        font-size: 28px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-choice strong {
        font-size: 27px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-choice span {
        font-size: 19px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-spinner {
        width: 72px;
        height: 72px;
        border-width: 9px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-scan strong {
        font-size: 32px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-scan span {
        font-size: 21px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-results {
        gap: 8px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-summary {
        min-height: 58px;
        padding: 7px 10px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-summary strong {
        font-size: 26px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-summary span,
    html:not(.remote-client) #busSetupOverlay .bus-setup-device > span,
    html:not(.remote-client) #busSetupOverlay .bus-setup-device-serial span {
        font-size: 18px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device-list {
        gap: 7px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device {
        min-height: 92px;
        gap: 3px 8px;
        padding: 8px 10px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device strong {
        font-size: 23px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device-serial {
        gap: 3px 7px;
        margin-top: 3px;
        padding-top: 5px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device-serial b {
        font-size: 19px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-address {
        min-width: 64px;
        min-height: 48px;
        font-size: 23px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-notice {
        padding: 8px 10px;
        font-size: 19px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device-form {
        gap: 8px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-device-form .bus-setup-device {
        min-height: 120px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-field {
        gap: 3px;
        font-size: 18px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-field input {
        min-height: 52px;
        font-size: 22px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-session-row {
        min-height: 52px;
        gap: 8px;
        padding-block: 4px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-session-row > b {
        width: 40px;
        height: 40px;
        font-size: 21px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-session-row strong {
        font-size: 21px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-session-row span {
        font-size: 18px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-actions {
        min-height: 68px;
        gap: 8px;
        padding: 6px 14px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-actions button {
        min-width: 170px;
        min-height: 54px;
        font-size: 20px;
    }

    html:not(.remote-client) #busSetupOverlay .bus-setup-actions .bus-setup-action-wide {
        min-width: 270px;
    }

    html:not(.remote-client) .fullscreen-picker-overlay.setting-value-picker .fullscreen-picker-head {
        min-height: 58px;
    }

    html:not(.remote-client) .fullscreen-picker-overlay.setting-value-picker .fullscreen-picker-head h2 {
        font-size: 27px;
    }

    html:not(.remote-client) .fullscreen-picker-overlay.setting-value-picker .fullscreen-picker-options {
        gap: 6px;
        padding: 8px;
    }

    html:not(.remote-client) .fullscreen-picker-overlay.setting-value-picker .fullscreen-picker-option {
        min-height: 52px;
    }

    html:not(.remote-client) .fullscreen-picker-overlay.setting-value-picker .fullscreen-picker-option span {
        font-size: 22px;
    }
}
