﻿body[data-page="live_demo"] {
    background:
        radial-gradient(circle at top right, rgba(27, 152, 224, 0.08), transparent 30%),
        radial-gradient(circle at bottom left, rgba(0, 201, 167, 0.08), transparent 28%),
        #ffffff;
    color: var(--gray-700);
}

body[data-page="live_demo"] .navbar {
    background: transparent;
    backdrop-filter: none;
}

body[data-page="live_demo"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

body[data-page="live_demo"] .nav-links a,
body[data-page="live_demo"] .lang-toggle,
body[data-page="live_demo"] .lang-select-icon {
    color: var(--white);
}

body[data-page="live_demo"] .navbar.scrolled .nav-links a,
body[data-page="live_demo"] .navbar.scrolled .lang-toggle,
body[data-page="live_demo"] .navbar.scrolled .lang-select-icon {
    color: var(--dark);
}

.ha-demo-page {
    position: relative;
    overflow: hidden;
}

.ha-hero,
.ha-stage-wrap {
    position: relative;
}

.ha-hero {
    padding: 118px 0 56px;
    min-height: 74vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 52%, #0d2137 100%);
    overflow: hidden;
}

.ha-hero::before {
    content: '';
    position: absolute;
    top: -45%;
    right: -16%;
    width: 760px;
    height: 760px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27, 152, 224, 0.16) 0%, transparent 68%);
}

.ha-hero::after {
    content: '';
    position: absolute;
    bottom: -28%;
    left: -10%;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.12) 0%, transparent 68%);
}

.ha-hero-noise {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.9px, transparent 0.9px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0.25;
    pointer-events: none;
}

.ha-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
}

.ha-hero-copy h1 {
    color: var(--white);
    font-size: clamp(2.75rem, 4.1vw, 3.1rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 620px;
}

.ha-hero-copy p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.02rem;
    margin-bottom: 26px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

.ha-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.ha-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #eaf3ff;
    font-size: 0.84rem;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.hero-mini-panel {
    padding: 18px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(18, 29, 49, 0.96), rgba(16, 26, 44, 0.98));
    border: 1px solid rgba(132, 187, 255, 0.10);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(16px);
}

.hero-mini-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hero-mini-badge,
.hero-mini-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.hero-mini-badge {
    color: #8fcbff;
    background: rgba(95, 160, 255, 0.12);
}

.hero-mini-live {
    color: #f4f8ff;
    background: rgba(255, 255, 255, 0.07);
}

.hero-mini-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00c9a7;
    box-shadow: 0 0 14px rgba(0, 201, 167, 0.45);
}

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

.hero-mini-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(31, 43, 67, 0.96), rgba(25, 36, 58, 0.96));
    border: 1px solid rgba(132, 187, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 26px rgba(5, 10, 24, 0.18);
}

.hero-mini-card-warm {
    background:
        radial-gradient(circle at top right, rgba(95, 160, 255, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(34, 58, 92, 0.98), rgba(28, 48, 76, 0.98));
}

.hero-mini-card-wide {
    grid-column: 1 / -1;
}

.hero-mini-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8fcbff;
    background: linear-gradient(135deg, rgba(95,160,255,0.16), rgba(0,201,167,0.12));
    margin-bottom: 10px;
}

.hero-mini-label {
    display: block;
    color: rgba(220, 232, 255, 0.68);
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.hero-mini-value {
    display: block;
    color: #f5f9ff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.14rem;
    line-height: 1.1;
    margin-bottom: 4px;
}

.hero-mini-card small {
    color: rgba(220, 232, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.4;
}

.hero-mini-title {
    display: block;
    color: #f5f9ff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.hero-mini-scene-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.hero-mini-scene {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(236, 244, 255, 0.76);
    font-size: 0.76rem;
    font-weight: 600;
}

.hero-mini-scene.active {
    background: linear-gradient(135deg, rgba(95, 160, 255, 0.22), rgba(0, 201, 167, 0.20));
    color: #f4f8ff;
}

.ha-stage-wrap {
    padding: 0 0 72px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

body[data-page="live_demo"] .ha-stage-wrap .container {
    max-width: 1740px;
    padding: 0 14px;
}

.ha-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 20%),
        linear-gradient(180deg, #b8b1aa 0%, #aca59f 100%);
    border: 1px solid rgba(25, 28, 38, 0.10);
    box-shadow: 0 22px 54px rgba(10, 12, 24, 0.14);
    max-width: 1200px;
    margin: 0 auto;
}

.ha-stage[data-mode="day"] {
    --mode-accent: rgba(27, 152, 224, 0.12);
    --mode-outline: rgba(27, 152, 224, 0.18);
    --mode-highlight: linear-gradient(135deg, #1B98E0, #00C9A7);
}

.ha-stage[data-mode="evening"] {
    --mode-accent: rgba(255, 155, 84, 0.14);
    --mode-outline: rgba(255, 155, 84, 0.22);
    --mode-highlight: linear-gradient(135deg, #ff9b54, #ff6f61);
}

.ha-stage[data-mode="secure"] {
    --mode-accent: rgba(0, 201, 167, 0.14);
    --mode-outline: rgba(0, 201, 167, 0.18);
    --mode-highlight: linear-gradient(135deg, #00C9A7, #1B98E0);
}

.ha-sidebar,
.ha-card {
    background: linear-gradient(180deg, rgba(58, 51, 65, 0.98), rgba(48, 43, 58, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 18px rgba(8, 10, 18, 0.14);
}

.ha-sidebar {
    position: sticky;
    top: 96px;
    padding: 14px;
    border-radius: 16px;
}

.ha-sidebar-block + .ha-sidebar-block {
    margin-top: 20px;
}

.ha-sidebar-block:has(.ha-mode-list) {
    margin-top: 22px;
}

.ha-kicker,
.ha-card-label,
.ha-story-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(82, 112, 186, 0.26);
    color: #9fc5ff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.ha-sidebar .ha-kicker {
    margin-bottom: 14px;
}

.ha-sidebar-block:has(.ha-mode-list) .ha-kicker {
    margin-bottom: 16px;
}

.ha-sidebar p,
.ha-story-card p,
.ha-guidance-list li,
.ha-activity-list li,
.ha-overview-card p,
.ha-context-pill span,
.ha-tile small {
    color: rgba(220, 232, 255, 0.74);
}

.ha-sidebar-block > p {
    margin-bottom: 16px;
    line-height: 1.55;
    font-size: 0.88rem;
}

.ha-room-list,
.ha-mode-list,
.ha-guidance-actions,
.ha-context-grid,
.ha-canvas-grid,
.ha-tile-grid {
    display: grid;
}

.ha-room-list,
.ha-mode-list {
    gap: 10px;
}

.ha-room,
.ha-mode {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(63, 56, 72, 0.98), rgba(53, 49, 65, 0.98));
    color: #edf5ff;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 14px rgba(5, 10, 24, 0.12);
}

.ha-room {
    padding: 8px 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
    text-align: left;
    min-height: 50px;
    font-size: 0.92rem;
}

.ha-room-icon {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(82, 112, 186, 0.24);
    color: #8fcbff;
    flex-shrink: 0;
}

.ha-room-icon svg {
    width: 12px;
    height: 12px;
}

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

.ha-mode {
    padding: 7px 8px;
    border-radius: 13px;
    font: inherit;
    font-weight: 600;
    min-height: 38px;
    font-size: 0.88rem;
}

.ha-room.active,
.ha-mode.active,
.ha-room:hover,
.ha-mode:hover {
    transform: translateY(-1px);
    border-color: var(--mode-outline);
    background: linear-gradient(180deg, rgba(63, 92, 136, 0.98), rgba(52, 77, 115, 0.98));
    box-shadow: 0 8px 18px rgba(6, 12, 26, 0.14), 0 0 0 1px var(--mode-accent);
}

.ha-story-card {
    margin-top: 20px;
    padding: 12px;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(82, 112, 186, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(57, 69, 103, 0.96), rgba(44, 48, 67, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 24px rgba(4, 10, 24, 0.16);
}

.ha-story-card h2,
.ha-overview-card h2,
.ha-guidance-card h3,
.ha-tile strong,
.ha-context-pill strong {
    color: #f5f9ff;
}

.ha-story-card h2 {
    font-size: 0.84rem;
    line-height: 1.35;
    margin: 12px 0 8px;
}

.ha-story-card p {
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0;
}

.ha-canvas {
    min-width: 0;
}

.ha-card {
    padding: 12px;
    border-radius: 16px;
}

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

.ha-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(115, 156, 128, 0.14);
    color: #f1f7ff;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ha-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00d3a8;
    box-shadow: 0 0 14px rgba(0, 211, 168, 0.42);
}

.ha-overview-card {
    position: relative;
    overflow: hidden;
    padding-bottom: 16px;
}

.ha-overview-card::before {
    display: none;
}

.ha-overview-card h2 {
    position: relative;
    z-index: 1;
    font-size: clamp(1.02rem, 1.35vw, 1.22rem);
    line-height: 1.18;
    margin-bottom: 10px;
    max-width: none;
}

.ha-overview-card p {
    position: relative;
    z-index: 1;
    max-width: none;
    font-size: 0.74rem;
    line-height: 1.45;
}

.ha-context-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.ha-context-pill,
.ha-tile {
    padding: 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(56, 50, 67, 0.98), rgba(50, 45, 61, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 18px rgba(6, 12, 26, 0.12);
}

.ha-context-pill {
    position: relative;
    overflow: hidden;
}

.ha-context-pill::after {
    content: '';
    position: absolute;
    inset: auto 14px 12px 14px;
    height: 3px;
    border-radius: 999px;
    background: var(--mode-highlight);
    opacity: 0.2;
}

.ha-context-pill strong,
.ha-tile strong {
    display: block;
    margin-top: 6px;
    font-size: 0.84rem;
}

.ha-canvas-grid {
    margin-top: 14px;
    grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.74fr);
    gap: 12px;
}

.ha-main-stack {
    display: grid;
    gap: 12px;
}

.ha-side-stack {
    display: grid;
    gap: 12px;
    align-content: start;
}

.ha-controls-card {
    position: relative;
    overflow: hidden;
}

.ha-controls-card::before {
    display: none;
}

.ha-device-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ha-device-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(63, 57, 74, 0.98), rgba(53, 48, 64, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 18px rgba(5, 10, 24, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ha-device-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 34px rgba(5, 10, 24, 0.24);
}

.ha-device-card.is-on {
    border-color: rgba(101, 156, 232, 0.22);
    box-shadow: 0 12px 26px rgba(95, 160, 255, 0.12);
    background:
        radial-gradient(circle at right center, rgba(101, 156, 232, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(69, 82, 120, 0.98), rgba(53, 66, 96, 0.98));
}

.ha-device-top {
    display: contents;
}

.ha-device-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8fcbff;
    background: linear-gradient(135deg, rgba(101,156,232,0.16), rgba(114,191,165,0.10));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ha-device-icon svg {
    width: 13px;
    height: 13px;
}

.ha-device-card.is-on .ha-device-icon {
    color: #f5f9ff;
    background: linear-gradient(135deg, rgba(95,160,255,0.22), rgba(0,201,167,0.16));
    border-color: rgba(132, 187, 255, 0.18);
}

.ha-device-label {
    display: block;
    grid-column: 2;
    grid-row: 1;
    color: rgba(220, 232, 255, 0.68);
    font-size: 0.72rem;
    margin-bottom: 0;
}

.ha-device-value {
    display: block;
    grid-column: 2;
    grid-row: 2;
    color: #f5f9ff;
    font-size: 0.96rem;
    line-height: 1.1;
    margin-bottom: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.ha-device-sub {
    display: block;
    grid-column: 2 / -1;
    grid-row: 3;
    color: rgba(220, 232, 255, 0.62);
    font-size: 0.7rem;
    margin-top: 2px;
}

.ha-chip-mini {
    display: inline-flex;
    align-items: center;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 20px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(95, 160, 255, 0.12);
    color: #8fcbff;
    font-size: 0.62rem;
    font-weight: 700;
}

.ha-toggle {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.ha-toggle-track {
    width: 52px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, 0.10);
    transition: background 0.25s ease;
}

.ha-toggle-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(10, 22, 40, 0.16);
    transform: translateX(0);
    transition: transform 0.25s ease;
}

.ha-toggle[aria-pressed="true"] .ha-toggle-track {
    background: linear-gradient(135deg, #1B98E0, #00C9A7);
}

.ha-toggle[aria-pressed="true"] .ha-toggle-thumb {
    transform: translateX(22px);
}

.ha-icon-action {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(132, 187, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: #f5f9ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s ease;
}

.ha-icon-action.is-active {
    color: #6be9cf;
    border-color: rgba(0, 201, 167, 0.22);
    background: rgba(0, 201, 167, 0.10);
}

.ha-range-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-column: 2 / -1;
    grid-row: 3;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.ha-range-label {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    color: rgba(220, 232, 255, 0.64);
}

.ha-range {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1B98E0 0%, #00C9A7 60%, rgba(255,255,255,0.12) 60%, rgba(255,255,255,0.12) 100%);
    outline: none;
}

.ha-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(10,22,40,0.18);
    cursor: pointer;
}

.ha-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(10,22,40,0.18);
    cursor: pointer;
}

.ha-range-value {
    min-width: 34px;
    text-align: right;
    color: #f5f9ff;
    font-weight: 700;
    font-size: 0.72rem;
}

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

.ha-tile {
    position: relative;
    min-height: 92px;
    overflow: hidden;
    border-radius: 16px;
}

.ha-tile::before {
    content: '';
    position: absolute;
    inset: 10px 10px auto 10px;
    width: calc(100% - 20px);
    height: 6px;
    border-radius: 999px;
    background: var(--mode-highlight);
    opacity: 0.72;
}

.ha-tile span,
.ha-tile small {
    display: block;
}

.ha-tile span {
    color: #8fcbff;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 8px;
}

.ha-tile small {
    margin-top: 5px;
    font-size: 0.68rem;
    line-height: 1.45;
}

.ha-activity-list,
.ha-guidance-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.ha-activity-list li,
.ha-guidance-list li {
    position: relative;
    padding-left: 18px;
    line-height: 1.45;
    font-size: 0.76rem;
}

.ha-activity-list li::before,
.ha-guidance-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #47a6ff, #6be9cf);
    box-shadow: 0 0 0 6px var(--mode-accent);
}

.ha-guidance-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.ha-guidance-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 15px 18px;
    white-space: nowrap;
    text-align: center;
}

.ha-snapshot-grid,
.ha-zones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ha-snapshot-item,
.ha-zone-item,
.ha-flow-item {
    padding: 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(56, 50, 67, 0.98), rgba(50, 45, 61, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 18px rgba(6, 12, 26, 0.12);
}

.ha-snapshot-item span,
.ha-zone-item span,
.ha-flow-step,
.ha-flow-time {
    display: block;
    color: #9fc5ff;
    font-size: 0.66rem;
    font-weight: 600;
}

.ha-snapshot-item strong,
.ha-zone-item strong,
.ha-flow-item strong {
    display: block;
    color: #f5f9ff;
    font-size: 0.86rem;
    margin-top: 8px;
}

.ha-snapshot-item small,
.ha-zone-item small,
.ha-flow-item small {
    display: block;
    color: rgba(220, 232, 255, 0.68);
    font-size: 0.66rem;
    line-height: 1.45;
    margin-top: 6px;
}

.ha-zone-item {
    position: relative;
    overflow: hidden;
}

.ha-zone-item::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--mode-highlight);
    opacity: 0.7;
}

.ha-demo-outline-link {
    color: #f4f8ff;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.ha-demo-outline-link:hover {
    border-color: rgba(95, 160, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.ha-sidebar,
.ha-overview-card,
.ha-controls-card,
.ha-states-card,
.ha-activity-card,
.ha-guidance-card,
.ha-story-card,
.ha-context-pill,
.ha-device-card,
.ha-tile {
    backdrop-filter: blur(18px);
}

html[dir="rtl"] .ha-activity-list li,
html[dir="rtl"] .ha-guidance-list li {
    padding-left: 0;
    padding-right: 22px;
}

html[dir="rtl"] .ha-activity-list li::before,
html[dir="rtl"] .ha-guidance-list li::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .ha-room {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .ha-card-head {
    flex-direction: row-reverse;
}

html[dir="rtl"] .ha-guidance-actions {
    direction: rtl;
}

@media (max-width: 1180px) {
    .ha-hero-grid {
        grid-template-columns: 1fr;
    }

    .ha-stage {
        max-width: 1080px;
    }
}

@media (max-width: 980px) {
    .ha-stage,
    .ha-canvas-grid {
        grid-template-columns: 1fr;
    }

    .ha-sidebar {
        position: relative;
        top: 0;
    }

    .ha-stage {
        padding: 16px;
    }
}

@media (max-width: 992px) {
    .ha-hero-grid {
        text-align: center;
    }

    .ha-hero-copy h1 {
        font-size: 2.7rem;
        margin-left: auto;
        margin-right: auto;
    }

    .ha-hero-copy p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .ha-hero-chips {
        justify-content: center;
    }
}

@media (max-width: 980px) {
    .ha-device-grid,
    .hero-mini-grid {
        grid-template-columns: 1fr;
    }

    .ha-device-grid > .ha-device-card:first-child,
    .ha-device-grid > .ha-device-card:last-child,
    .ha-device-grid > .ha-device-card:first-child .ha-device-top,
    .ha-device-grid > .ha-device-card:first-child .ha-range-wrap,
    .ha-device-grid > .ha-device-card:first-child .ha-device-label,
    .ha-device-grid > .ha-device-card:first-child .ha-device-value {
        grid-column: auto;
    }

    .ha-device-grid > .ha-device-card:first-child {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .ha-hero {
        padding-top: 132px;
        padding-bottom: 72px;
    }

    .ha-context-grid,
    .ha-guidance-actions {
        grid-template-columns: 1fr;
    }

    .ha-tile-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ha-snapshot-grid,
    .ha-zones-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .ha-hero-copy h1 {
        font-size: 2.15rem;
        line-height: 1.2;
    }

    .ha-hero-copy p {
        font-size: 1rem;
    }

    .ha-mode-list,
    .ha-tile-grid {
        grid-template-columns: 1fr;
    }

    .ha-card,
    .ha-sidebar,
    .hero-mini-panel {
        padding: 20px;
        border-radius: 24px;
    }

    .ha-stage {
        border-radius: 28px;
    }

    .ha-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ha-room {
        padding: 13px 14px;
    }

    .ha-overview-card h2 {
        font-size: 1.8rem;
    }

    /* Fix device card text squeezing on mobile */
    .ha-device-card {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 6px 10px;
    }

    .ha-device-card .ha-icon-action,
    .ha-device-card .ha-toggle,
    .ha-device-card .ha-chip-mini {
        grid-column: 2;
        justify-self: start;
    }

    .ha-device-sub {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .ha-hero-copy h1 {
        font-size: 1.85rem;
    }

    .ha-room-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ha-room {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .ha-room-button-icon {
        width: 32px;
        height: 32px;
    }
}

.ha-stage.ha-tablet-board {
    --ha-tablet-scale: 0.95;
    display: block;
    padding: 7px;
    width: min(100%, 1680px);
    height: min(calc(100svh - 188px), 606px);
    max-width: none;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 18%),
        linear-gradient(180deg, #b5aea7 0%, #aaa39d 100%);
    border-radius: 30px;
    border: 1px solid rgba(18, 22, 30, 0.12);
    box-shadow: 0 18px 44px rgba(9, 12, 20, 0.16);
}

.ha-tablet-board .ha-tablet-fit {
    display: grid;
    grid-template-columns: minmax(195px, 0.72fr) minmax(0, 1.98fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    width: calc(100% / var(--ha-tablet-scale));
    height: calc(100% / var(--ha-tablet-scale));
    transform: scale(var(--ha-tablet-scale));
    transform-origin: top left;
}

.ha-tablet-board .ha-tablet-topbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.1fr 1fr auto;
    gap: 8px;
    align-items: center;
    min-height: 24px;
    padding: 0 3px;
    color: rgba(240, 242, 246, 0.92);
    font-size: 0.66rem;
}

.ha-tablet-board .ha-topbar-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ha-tablet-board .ha-topbar-weather {
    justify-content: center;
}

.ha-tablet-board .ha-topbar-clock {
    justify-content: flex-end;
    gap: 8px;
}

.ha-tablet-board .ha-toolbar-label {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    white-space: nowrap;
}

.ha-tablet-board .ha-toolbar-metrics {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.ha-tablet-board .ha-clock {
    color: #ffffff;
    font: 700 0.84rem/1 'Poppins', sans-serif;
}

.ha-tablet-board .ha-date {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.62rem;
    white-space: nowrap;
}

.ha-tablet-board .ha-tablet-left,
.ha-tablet-board .ha-tablet-center,
.ha-tablet-board .ha-tablet-right,
.ha-tablet-board .ha-main-stack,
.ha-tablet-board .ha-tablet-center-stack {
    min-height: 0;
}

.ha-tablet-board .ha-tablet-left {
    display: grid;
    grid-template-rows: repeat(4, auto);
    gap: 5px;
    align-content: start;
}

.ha-tablet-board .ha-tablet-center {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
    align-content: start;
}

.ha-tablet-board .ha-tablet-center-stack {
    display: grid;
    grid-template-columns: minmax(0, 1.34fr) minmax(220px, 0.76fr);
    gap: 6px;
    min-height: 0;
    align-items: start;
}

.ha-tablet-board .ha-main-stack {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    grid-template-rows: auto;
    gap: 6px;
    align-content: start;
}

.ha-tablet-board .ha-tablet-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 5px;
    align-content: start;
}

.ha-tablet-board .ha-panel,
.ha-tablet-board .ha-card {
    background: linear-gradient(180deg, rgba(46, 43, 56, 0.98), rgba(40, 37, 49, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 10px 22px rgba(8, 10, 18, 0.14);
}

.ha-tablet-board .ha-panel-headline,
.ha-tablet-board .ha-card-head {
    margin-bottom: 5px;
}

.ha-tablet-board .ha-card-label,
.ha-tablet-board .ha-story-tag {
    padding: 3px 8px;
    font-size: 0.69rem;
    background: rgba(86, 122, 198, 0.24);
}

.ha-tablet-board .ha-room-list,
.ha-tablet-board .ha-mode-list,
.ha-tablet-board .ha-climate-zone-list,
.ha-tablet-board .ha-utility-list {
    display: grid;
    gap: 4px;
}

.ha-tablet-board .ha-mode-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ha-tablet-board .ha-room,
.ha-tablet-board .ha-mode {
    min-height: 28px;
    padding: 4px 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(58, 63, 84, 0.98), rgba(48, 50, 69, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    font-size: 0.88rem;
}

.ha-tablet-board .ha-room-icon {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(126, 160, 225, 0.16);
}

.ha-tablet-board .ha-room-icon svg {
    width: 9px;
    height: 9px;
}

.ha-tablet-board .ha-room.active,
.ha-tablet-board .ha-mode.active {
    background: linear-gradient(180deg, rgba(56, 87, 137, 0.98), rgba(46, 72, 116, 0.98));
    border-color: rgba(112, 177, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(92, 157, 237, 0.18);
}

.ha-tablet-board .ha-story-panel h2,
.ha-tablet-board .ha-overview-card h2 {
    margin: 8px 0 5px;
    color: #f5f8ff;
    font-family: 'Poppins', sans-serif;
}

.ha-tablet-board .ha-story-panel h2 {
    font-size: 0.94rem;
    line-height: 1.18;
}

.ha-tablet-board .ha-story-panel p,
.ha-tablet-board .ha-overview-card p,
.ha-tablet-board .ha-climate-row small,
.ha-tablet-board .ha-activity-list li,
.ha-tablet-board .ha-utility-row small,
.ha-tablet-board .ha-power-metric small {
    color: rgba(222, 230, 246, 0.72);
    font-size: 0.82rem;
    line-height: 1.22;
}

.ha-tablet-board .ha-story-panel p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ha-tablet-board .ha-climate-zone-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.ha-tablet-board .ha-climate-row,
.ha-tablet-board .ha-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 6px;
    border-radius: 10px;
    background: rgba(62, 66, 87, 0.72);
}

.ha-tablet-board .ha-climate-row strong,
.ha-tablet-board .ha-utility-row strong,
.ha-tablet-board .ha-power-metric strong {
    display: block;
    color: #f4f7ff;
    font-size: 0.88rem;
}

.ha-tablet-board .ha-climate-row span {
    color: #ffffff;
    font: 700 0.92rem/1 'Poppins', sans-serif;
}

.ha-tablet-board .ha-overview-card {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(210px, 0.94fr);
    grid-template-areas:
        "head head"
        "title chart"
        "body chart"
        "context chart";
    align-items: start;
    gap: 2px;
}

.ha-tablet-board .ha-overview-card > .ha-card-head {
    grid-area: head;
}

.ha-tablet-board .ha-overview-card h2 {
    grid-area: title;
    font-size: 1.18rem;
    line-height: 1.08;
    margin: 2px 0 0;
}

.ha-tablet-board .ha-overview-card p {
    grid-area: body;
    margin: 0 0 1px;
    font-size: 0.84rem;
    line-height: 1.2;
}

.ha-tablet-board .ha-context-grid {
    grid-area: context;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 1px 0 0;
}

.ha-tablet-board .ha-context-pill {
    padding: 5px 6px 6px;
    border-radius: 9px;
    background: rgba(60, 55, 71, 0.88);
    position: relative;
    overflow: hidden;
}

.ha-tablet-board .ha-context-pill::after {
    content: '';
    position: absolute;
    inset: auto 10px 6px 10px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(27, 152, 224, 0.55), rgba(0, 201, 167, 0.4));
    opacity: 0.85;
}

.ha-tablet-board .ha-context-pill span {
    font-size: 0.7rem;
    color: rgba(222, 230, 246, 0.68);
}

.ha-tablet-board .ha-context-pill strong {
    font-size: 0.84rem;
    margin-top: 2px;
}

.ha-tablet-board .ha-chart-card {
    grid-area: chart;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 2px;
    min-height: 0;
    padding: 5px 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(50, 54, 70, 0.98), rgba(44, 47, 60, 0.98));
    align-self: stretch;
}

.ha-tablet-board .ha-chart-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.ha-tablet-board .ha-chart-label,
.ha-tablet-board .ha-chart-side span {
    display: block;
    color: rgba(222, 230, 246, 0.72);
    font-size: 0.7rem;
}

.ha-tablet-board .ha-chart-meta strong {
    display: block;
    margin-top: 2px;
    color: #ffffff;
    font: 700 1.04rem/1 'Poppins', sans-serif;
}

.ha-tablet-board .ha-chart-side {
    text-align: right;
}

.ha-tablet-board .ha-chart-svg {
    width: 100%;
    height: 76px;
    min-height: 76px;
    display: block;
}

.ha-tablet-board .ha-chart-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.ha-tablet-board .ha-chart-area {
    opacity: 0.18;
}

.ha-tablet-board .ha-chart-area-one {
    fill: #ff5536;
}

.ha-tablet-board .ha-chart-area-two {
    fill: #5ef2e7;
}

.ha-tablet-board .ha-chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.ha-tablet-board .ha-chart-line-one {
    stroke: #ff5536;
}

.ha-tablet-board .ha-chart-line-two {
    stroke: #5ef2e7;
}

.ha-tablet-board .ha-chart-hours {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    color: rgba(222, 230, 246, 0.72);
    font-size: 0.45rem;
}

.ha-tablet-board .ha-tablet-center-stack {
    min-height: 0;
}

.ha-tablet-board .ha-controls-card,
.ha-tablet-board .ha-states-card,
.ha-tablet-board .ha-snapshot-card,
.ha-tablet-board .ha-utility-panel,
.ha-tablet-board .ha-activity-card,
.ha-tablet-board .ha-power-panel {
    overflow: hidden;
    align-content: start;
}

.ha-tablet-board .ha-story-panel,
.ha-tablet-board .ha-zone-climate-panel,
.ha-tablet-board .ha-controls-card,
.ha-tablet-board .ha-states-card,
.ha-tablet-board .ha-snapshot-card,
.ha-tablet-board .ha-utility-panel,
.ha-tablet-board .ha-activity-card,
.ha-tablet-board .ha-power-panel {
    height: auto;
    align-self: start;
}

.ha-tablet-board .ha-utility-panel,
.ha-tablet-board .ha-activity-card,
.ha-tablet-board .ha-power-panel {
    padding: 4px;
}

.ha-tablet-board .ha-device-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.ha-tablet-board .ha-device-card {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 2px 5px;
    align-items: center;
    padding: 4px 5px;
    border-radius: 9px;
    background: rgba(60, 65, 87, 0.88);
}

.ha-tablet-board .ha-device-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.ha-tablet-board .ha-device-icon svg {
    width: 10px;
    height: 10px;
}

.ha-tablet-board .ha-device-label {
    font-size: 0.72rem;
}

.ha-tablet-board .ha-device-value {
    font-size: 0.88rem;
}

.ha-tablet-board .ha-chip-mini {
    min-height: 16px;
    padding: 1px 5px;
    font-size: 0.7rem;
}

.ha-tablet-board .ha-icon-action {
    width: 26px;
    height: 26px;
    border-radius: 10px;
}

.ha-tablet-board .ha-range-wrap {
    gap: 4px;
    margin-top: 2px;
}

.ha-tablet-board .ha-range-label {
    font-size: 0.74rem;
}

.ha-tablet-board .ha-range {
    height: 2px;
}

.ha-tablet-board .ha-range::-webkit-slider-thumb,
.ha-tablet-board .ha-range::-moz-range-thumb {
    width: 7px;
    height: 7px;
}

.ha-tablet-board .ha-toggle-track {
    width: 28px;
    height: 16px;
}

.ha-tablet-board .ha-toggle-thumb {
    width: 9px;
    height: 9px;
}

.ha-tablet-board .ha-toggle[aria-pressed="true"] .ha-toggle-thumb {
    transform: translateX(11px);
}

.ha-tablet-board .ha-tile-grid,
.ha-tablet-board .ha-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.ha-tablet-board .ha-tile,
.ha-tablet-board .ha-snapshot-item,
.ha-tablet-board .ha-power-metric {
    min-height: 0;
    padding: 4px 5px;
    border-radius: 9px;
    background: rgba(59, 55, 71, 0.88);
}

.ha-tablet-board .ha-tile::before {
    inset: 8px 8px auto 8px;
    width: calc(100% - 16px);
    height: 2px;
}

.ha-tablet-board .ha-tile strong,
.ha-tablet-board .ha-snapshot-item strong {
    font-size: 0.86rem;
}

.ha-tablet-board .ha-tile span,
.ha-tablet-board .ha-snapshot-item span {
    font-size: 0.72rem;
}

.ha-tablet-board .ha-utility-list {
    gap: 4px;
}

.ha-tablet-board .ha-utility-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(72, 114, 204, 0.96), rgba(54, 90, 178, 0.96));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
}

.ha-tablet-board .ha-activity-list {
    gap: 3px;
    align-content: start;
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.ha-tablet-board .ha-activity-list li {
    padding-left: 14px;
    font-size: 0.74rem;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ha-tablet-board .ha-activity-list li::before {
    width: 10px;
    height: 10px;
    top: 0.6em;
    box-shadow: 0 0 0 4px var(--mode-accent);
}

.ha-tablet-board .ha-power-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
}

.ha-tablet-board .ha-power-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 3px;
    height: 18px;
    margin-top: 2px;
}

.ha-tablet-board .ha-power-metric small {
    font-size: 0.72rem;
    line-height: 1.08;
}

.ha-tablet-board .ha-activity-card,
.ha-tablet-board .ha-power-panel {
    min-height: 0;
}

.ha-tablet-board .ha-power-bars span {
    display: block;
    width: 100%;
    border-radius: 999px 999px 8px 8px;
    background: linear-gradient(180deg, #9af57d 0%, rgba(92, 222, 143, 0.45) 100%);
}

@media (max-width: 1380px) {
    .ha-stage.ha-tablet-board {
        --ha-tablet-scale: 0.9;
        height: min(calc(100svh - 170px), 575px);
    }

    .ha-tablet-board .ha-tablet-topbar {
        grid-template-columns: 1fr auto;
    }

    .ha-tablet-board .ha-topbar-weather {
        display: none;
    }
}

@media (max-width: 1180px) {
    .ha-stage.ha-tablet-board {
        --ha-tablet-scale: 1;
        height: auto;
    }

    .ha-tablet-board .ha-tablet-fit {
        width: 100%;
        height: auto;
        transform: none;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .ha-tablet-board .ha-tablet-center,
    .ha-tablet-board .ha-tablet-center-stack {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .ha-tablet-board .ha-tablet-left,
    .ha-tablet-board .ha-tablet-right,
    .ha-tablet-board .ha-main-stack {
        grid-template-rows: auto;
    }
}

/* =====================================================================
   LIVE-DEMO RESPONSIVE PATCH (v20260415)
   Makes hero particles fluid, provides tablet/phone fallbacks for the
   tablet-board, and adds the 360px tier.
   ===================================================================== */

/* Fluid hero particles — replace fixed 760px / 560px circles */
.ha-hero::before {
    width: min(95vw, 760px);
    height: min(95vw, 760px);
}
.ha-hero::after {
    width: min(80vw, 560px);
    height: min(80vw, 560px);
}

@media (max-width: 1024px) {
    .ha-hero-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .ha-tablet-board {
        max-width: 100%;
    }
    .ha-stage {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .ha-hero-copy h1 {
        font-size: clamp(1.75rem, 5vw + 0.9rem, 2.6rem);
    }
    .ha-hero-copy p {
        font-size: 0.98rem;
    }
    .ha-room-button-icon {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 360px) {
    .ha-hero {
        padding-left: 4vw;
        padding-right: 4vw;
    }
    .ha-hero-copy h1 {
        font-size: 1.5rem;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}
