/*
 * Blog Post Detail — Terminal Editorial
 * ======================================
 */

/* ---- Hero Strip ---- */
.blogpost-hero {
    position: relative;
    padding: 80px 0 0;
    background: linear-gradient(165deg, #0a0a0a 0%, #1a1208 40%, #121212 100%);
    overflow: hidden;
    height: 0;
}

.blogpost-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 115, 0, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 115, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.blogpost-hero__scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 115, 0, 0.008) 2px,
        rgba(255, 115, 0, 0.008) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ---- Layout ---- */
.blogpost-content.section {
    padding-top: 32px;
    padding-bottom: 80px;
}

/* Let blog post pages breathe wider than default site sections. */
.blogpost-content .container {
    max-width: min(1540px, 96vw);
}

.blogpost-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 32px;
    align-items: start;
}

/* ---- Main Article Area ---- */
.blogpost-main {
    min-width: 0;
}

/* ---- Article Card ---- */
.blog-post-full {
    background: rgba(30, 30, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    animation: postReveal 0.6s ease-out both;
}

@keyframes postReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Post Header ---- */
.blog-post-header {
    padding: 20px 28px 0;
}

.blog-post-title {
    font-family: 'Fira Code', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-post-date {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: rgba(255, 115, 0, 0.8);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-post-author {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(224, 224, 224, 0.4);
}

/* ---- Post Image ---- */
.blog-post-image {
    padding: 0 28px 0;
}

.blog-post-full .blog-post-image {
    margin: 0;
    height: auto;
    max-width: none;
    overflow: visible;
    flex: none;
}

.blog-post-image img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--dark-color, #121212);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    display: block;
}

.blog-post-full .blog-post-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0;
}

/* ---- Post Body (content) ---- */
.blog-post-body {
    padding: 20px 28px 28px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(224, 224, 224, 0.75);
}

.blog-post-body h2 {
    font-family: 'Fira Code', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    color: #f0f0f0;
    margin-top: 28px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid rgba(255, 115, 0, 0.72);
    box-shadow: none;
    background: transparent;
}

.blog-post-body h3 {
    font-family: 'Fira Code', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-top: 22px;
    margin-bottom: 12px;
}

.blog-post-body h4 {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #d0d0d0;
    margin-top: 24px;
    margin-bottom: 10px;
}

.blog-post-body p {
    margin-bottom: 14px;
}

.blog-post-body a {
    color: #FF7300;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 115, 0, 0.3);
    transition: border-color 0.2s ease;
}

.blog-post-body a:hover {
    border-color: #FF7300;
}

.blog-post-body ul,
.blog-post-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.blog-post-body ul {
    list-style-type: disc;
}

.blog-post-body ol {
    list-style-type: decimal;
}

.blog-post-body ul ul {
    list-style-type: circle;
}

.blog-post-body ul ul ul {
    list-style-type: square;
}

.blog-post-body ol ol {
    list-style-type: lower-alpha;
}

.blog-post-body ol ol ol {
    list-style-type: lower-roman;
}

.blog-post-body li {
    display: list-item;
    margin-bottom: 8px;
    padding-left: 4px;
}

.blog-post-body li::marker {
    color: rgba(255, 115, 0, 0.5);
}

.blog-post-body blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    background: rgba(255, 115, 0, 0.04);
    border-left: 3px solid rgba(255, 115, 0, 0.4);
    border-radius: 0 8px 8px 0;
    color: rgba(224, 224, 224, 0.65);
    font-style: italic;
}

.blog-post-body blockquote p:last-child {
    margin-bottom: 0;
}

.blog-post-body pre {
    margin: 24px 0;
    padding: 20px 24px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #e0e0e0;
}

.blog-post-body code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    background: rgba(255, 115, 0, 0.06);
    border: 1px solid rgba(255, 115, 0, 0.1);
    border-radius: 4px;
    color: rgba(255, 115, 0, 0.85);
    word-break: break-word;
}

.blog-post-body pre code {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

.blog-post-body img {
    width: min(100%, 980px);
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.85rem;
}

.blog-post-body th,
.blog-post-body td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-post-body th {
    background: rgba(255, 115, 0, 0.06);
    color: rgba(255, 115, 0, 0.85);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.blog-post-body td {
    background: rgba(30, 30, 30, 0.3);
}

.blog-post-body hr {
    border: none;
    height: 5px;
    background: linear-gradient(
        90deg,
        rgba(255, 115, 0, 0.34) 0%,
        rgba(255, 115, 0, 0.98) 50%,
        rgba(255, 115, 0, 0.34) 100%
    );
    margin: 30px 0;
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(255, 115, 0, 0.32);
}

/* ---- Tags ---- */
.blog-tags {
    padding: 0 28px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-tags h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 115, 0, 0.6);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 24px;
    margin-bottom: 12px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    color: rgba(224, 224, 224, 0.6);
    text-decoration: none;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.blog-tag:hover {
    background: rgba(255, 115, 0, 0.08);
    border-color: rgba(255, 115, 0, 0.3);
    color: #FF7300;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ---- Back Navigation ---- */
.blogpost-nav {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blogpost-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 115, 0, 0.85);
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 115, 0, 0.06);
    border: 1px solid rgba(255, 115, 0, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.blogpost-nav__back:hover {
    color: #FF7300;
    border-color: #FF7300;
    background: rgba(255, 115, 0, 0.12);
}

.blogpost-nav__back i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.blogpost-nav__back:hover i {
    transform: translateX(-3px);
}

/* ---- Sidebar ---- */
.blogpost-sidebar {
    position: sticky;
    top: 100px;
}

.blogpost-sidebar__section {
    background: rgba(30, 30, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.blogpost-sidebar__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: rgba(20, 20, 20, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: rgba(224, 224, 224, 0.6);
    letter-spacing: 0.03em;
}

.blogpost-sidebar__prompt {
    color: #FF7300;
    font-weight: 700;
}

.blogpost-sidebar__list {
    padding: 8px 0;
    list-style: none;
}

.blogpost-sidebar__list li {
    list-style: none;
}

.blogpost-sidebar__list li a {
    display: block;
    padding: 12px 20px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(224, 224, 224, 0.55);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.blogpost-sidebar__list li a:hover {
    color: #FF7300;
    background: rgba(255, 115, 0, 0.04);
    border-left-color: rgba(255, 115, 0, 0.4);
}

/* ---- Loading State ---- */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading p {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: rgba(224, 224, 224, 0.4);
    letter-spacing: 0.05em;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 115, 0, 0.1);
    border-top-color: #FF7300;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ---- Error State ---- */
.error-message {
    text-align: center;
    padding: 60px 28px;
    background: rgba(30, 30, 30, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.error-message h2 {
    font-family: 'Fira Code', monospace;
    font-size: 1.4rem;
    color: #f0f0f0;
    margin-bottom: 12px;
}

.error-message p {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    color: rgba(224, 224, 224, 0.5);
    margin-bottom: 24px;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .blogpost-content .container {
        max-width: 98vw;
    }

    .blogpost-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blogpost-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blogpost-content.section {
        padding-top: 18px;
        padding-bottom: 42px;
    }

    .blogpost-content .container {
        max-width: 100vw;
        padding-left: 14px;
        padding-right: 14px;
    }

    /* Mobile: remove card framing so content gets maximum usable width. */
    .blog-post-full {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
        animation: none;
    }

    .blog-post-header {
        padding: 14px 0 0;
    }

    .blog-post-title {
        font-size: 1.36rem;
        line-height: 1.28;
        margin-bottom: 10px;
    }

    .blog-post-image {
        padding: 0;
    }

    .blog-post-image img {
        aspect-ratio: auto;
    }

    .blog-post-body {
        padding: 14px 0 12px;
        font-size: 0.88rem;
    }

    .blog-post-body h2 {
        font-size: 1.2rem;
        margin-top: 22px;
        margin-bottom: 12px;
    }

    .blog-post-body h3 {
        font-size: 1.05rem;
        margin-top: 18px;
        margin-bottom: 10px;
    }

    .blog-tags {
        padding: 16px 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .blogpost-nav {
        margin-top: 20px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .blog-post-body pre {
        background: rgba(48, 52, 60, 0.78);
        border: 1px solid rgba(255, 255, 255, 0.24);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
        color: rgba(245, 245, 245, 0.97);
    }

    .blog-post-body pre code {
        color: rgba(248, 248, 248, 0.98);
    }
}

@media (max-width: 480px) {
    .blog-post-title {
        font-size: 1.2rem;
    }

    .blogpost-content .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Keep article headings left-aligned despite global mobile heading centering rules. */
.blog-post-body h1,
.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4 {
    text-align: left !important;
}

/* Blog post pages: keep typography left-aligned on tablet/mobile. */
@media (max-width: 992px) {
    .blogpost-content .blog-post-title,
    .blogpost-content .blog-post-body h1,
    .blogpost-content .blog-post-body h2,
    .blogpost-content .blog-post-body h3,
    .blogpost-content .blog-post-body h4,
    .blogpost-content .blog-post-body p,
    .blogpost-content .blog-post-body li,
    .blogpost-content .blog-post-body blockquote,
    .blogpost-content .blog-post-meta,
    .blogpost-content .blog-post-date,
    .blogpost-content .blog-post-author {
        text-align: left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .blogpost-content .blog-post-meta {
        justify-content: flex-start !important;
    }
}

/* ---- Home Assistant Automation Card ---- */

.ha-card {
    margin: 24px 0;
    border: 1px solid rgba(255, 115, 0, 0.18);
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.7);
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.84rem;
}

.ha-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    background: rgba(255, 115, 0, 0.06);
    border-bottom: 1px solid rgba(255, 115, 0, 0.12);
}

.ha-card__icon {
    font-size: 1rem;
    color: #FF7300;
    flex-shrink: 0;
    font-style: normal;
}

.ha-card__title {
    flex: 1;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ha-card__mode-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(210, 210, 210, 0.65);
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.ha-card__description {
    padding: 10px 18px 0;
    color: rgba(210, 210, 210, 0.55);
    font-size: 0.78rem;
    line-height: 1.55;
}

.ha-card__copy {
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 115, 0, 0.3);
    border-radius: 5px;
    color: rgba(255, 115, 0, 0.7);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ha-card__copy:hover {
    background: rgba(255, 115, 0, 0.09);
    border-color: #FF7300;
    color: #FF7300;
}
.ha-card__copy--copied {
    border-color: #50c878;
    color: #50c878;
}
.ha-card__copy[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    /* Below, not above: the button sits at the very top of .ha-card, which
       clips (overflow: hidden) anything poking out past its top edge. */
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    font-size: 0.68rem;
    font-family: inherit;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    letter-spacing: 0.03em;
}
.ha-card__copy:hover[data-tooltip]::after,
.ha-card__copy--copied[data-tooltip]::after {
    opacity: 1;
}

.ha-card__toggle {
    flex-shrink: 0;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(255, 115, 0, 0.3);
    border-radius: 5px;
    color: rgba(255, 115, 0, 0.8);
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    letter-spacing: 0.04em;
}

.ha-card__toggle:hover {
    background: rgba(255, 115, 0, 0.09);
    border-color: #FF7300;
    color: #FF7300;
}

.ha-card__gui {
    padding: 10px 0 6px;
}

.ha-card__yaml {
    padding: 0;
}

.ha-card__yaml pre {
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(255, 115, 0, 0.08);
}

.ha-section {
    padding: 5px 18px 7px;
}

.ha-section + .ha-section {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 2px;
}

.ha-section__label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.35);
    margin-bottom: 6px;
}

.ha-section__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ha-section__dot--trigger   { background: #4a9eff; }
.ha-section__dot--condition { background: #f0c040; }
.ha-section__dot--action    { background: #50c878; }
.ha-section__dot--field     { background: #b980ff; }
.ha-section__dot--variable  { background: #4ad9c0; }

.ha-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ha-item {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: rgba(210, 210, 210, 0.8);
    line-height: 1.6;
    word-break: break-word;
}

.ha-item__type {
    display: inline-block;
    padding: 1px 7px;
    background: rgba(255, 115, 0, 0.09);
    border: 1px solid rgba(255, 115, 0, 0.2);
    border-radius: 4px;
    color: rgba(255, 115, 0, 0.9);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-right: 6px;
    vertical-align: middle;
    text-transform: lowercase;
    white-space: nowrap;
}
.ha-item__action-head {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.ha-item__field {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-left: 1px;
}
.ha-item__required {
    padding: 0 5px;
    background: rgba(255, 115, 0, 0.12);
    border: 1px solid rgba(255, 115, 0, 0.25);
    border-radius: 3px;
    color: rgba(255, 115, 0, 0.85);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ha-item__template {
    margin: 4px 0 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: rgba(190, 220, 255, 0.85);
    font-family: inherit;
    font-size: 0.8em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.ha-item__note {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    color: rgba(200, 200, 200, 0.5);
    font-size: 0.82em;
    font-style: italic;
    line-height: 1.5;
}
.ha-item__data-key {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.82em;
}

.ha-item code {
    font-family: inherit;
    font-size: 0.82em;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 3px;
    color: rgba(190, 220, 255, 0.9);
}

.ha-choose__list {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ha-choose__branch-item {
    list-style: none;
}
details.ha-choose__branch {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 5px;
}
details.ha-choose__branch[open] {
    background: rgba(255, 255, 255, 0.045);
}
.ha-choose__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
}
.ha-choose__summary::-webkit-details-marker {
    display: none;
}
.ha-choose__summary::before {
    content: '';
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 4px solid rgba(255, 115, 0, 0.7);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.15s ease;
}
details.ha-choose__branch[open] > .ha-choose__summary::before {
    transform: rotate(90deg);
}
.ha-choose__label {
    flex-shrink: 0;
    font-size: 0.75em;
    font-weight: 600;
    color: #FF7300;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ha-choose__preview {
    color: rgba(210, 210, 210, 0.55);
    font-size: 0.88em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ha-choose__body {
    padding: 0 10px 8px;
}
.ha-choose__section-label {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 5px;
}
.ha-choose__section-label:first-of-type {
    margin-top: 2px;
}
.ha-items--nested {
    margin-top: 4px;
}
.ha-items--nested .ha-item {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
    .ha-card__header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .ha-card__title {
        font-size: 0.82rem;
        white-space: normal;
    }
    .ha-section {
        padding: 5px 14px 7px;
    }
    .ha-item {
        padding: 5px 10px;
    }
}
