﻿/* ศูนย์พัฒนาคุณภาพ — ธีมน้ำเงินเข้ม-ฟ้า-ขาว */
body { font-family: 'Sarabun', sans-serif; }

.ha-header {
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #bfdbfe;
    box-shadow: 0 4px 20px rgba(29, 78, 216, 0.08);
}

.ha-header-brand {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(58vw, 12.5rem);
    text-decoration: none;
    color: inherit;
}
.ha-header-brand:hover .ha-header-brand-title {
    color: #1d4ed8;
}
.ha-header-brand-text {
    min-width: 0;
}
.ha-header-brand-title {
    font-weight: 700;
    color: #172554;
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    transition: color 0.2s;
}
.ha-header-brand-subtitle {
    margin-top: 0.1rem;
    font-size: 0.6875rem;
    line-height: 1.25;
    color: #1e40af;
    white-space: normal;
    word-break: break-word;
}
@media (min-width: 768px) {
    .ha-header-brand {
        max-width: 14rem;
    }
    .ha-header-brand-title {
        font-size: 0.875rem;
    }
    .ha-header-brand-subtitle {
        font-size: 0.75rem;
    }
}
@media (min-width: 1280px) {
    .ha-header-brand {
        max-width: 16.5rem;
    }
    .ha-header-brand-title {
        font-size: 0.9375rem;
    }
}

.ha-header-nav .ha-nav-link {
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
    border-radius: 0.625rem;
    white-space: nowrap;
}
.ha-header-login {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
}
@media (min-width: 1024px) {
    .ha-header-nav .ha-nav-link {
        padding: 0.38rem 0.5rem;
        font-size: 0.8125rem;
    }
    .ha-header-login {
        padding: 0.5rem 0.85rem !important;
        font-size: 0.8125rem !important;
    }
}
@media (min-width: 1280px) {
    .ha-header-nav .ha-nav-link {
        padding: 0.42rem 0.62rem;
        font-size: 0.875rem;
    }
}

.ha-nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a8a;
    transition: background-color 0.2s, color 0.2s;
}
.ha-nav-link:hover { background: rgba(255, 255, 255, 0.65); color: #172554; }
.ha-nav-link.is-active { background: #fff; color: #172554; font-weight: 700; box-shadow: 0 1px 4px rgba(29, 78, 216, 0.12); }

.ha-nav-dropdown {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #dbeafe;
    box-shadow: 0 12px 32px rgba(29, 78, 216, 0.12);
    padding: 0.35rem 0;
    overflow: hidden;
}
.ha-nav-dropdown-link {
    display: block;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e40af;
    transition: background-color 0.2s, color 0.2s;
}
.ha-nav-dropdown-link:hover { background: #eff6ff; color: #1d4ed8; }
.ha-nav-dropdown-link.is-active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }

.ha-footer {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 1px solid #bfdbfe;
    color: #1e3a8a;
}
.ha-footer-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #172554;
    margin-bottom: 0.5rem;
}
.ha-footer-heading {
    font-weight: 600;
    color: #172554;
    margin-bottom: 0.75rem;
}
.ha-footer-text {
    color: #1e40af;
    line-height: 1.6;
}
.ha-footer-meta {
    color: #3b82f6;
}
.ha-footer-meta a {
    color: #1d4ed8;
}
.ha-footer-meta a:hover {
    color: #172554;
}

.ha-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 40%, #dbeafe 100%);
    border: 1px solid rgba(191, 219, 254, 0.7);
    box-shadow: 0 16px 48px rgba(37, 99, 235, 0.08);
}
.ha-hero::before {
    content: '';
    position: absolute;
    width: 14rem;
    height: 14rem;
    top: -4rem;
    right: -3rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25), transparent 70%);
    pointer-events: none;
}

.ha-glass {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.25rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 32px rgba(29, 78, 216, 0.06);
}

.ha-card {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ha-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1);
}

.ha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: filter 0.2s, transform 0.15s;
}
.ha-btn:hover { filter: brightness(1.05); }
.ha-btn:active { transform: scale(0.98); }

.ha-main-carousel {
    position: relative;
    width: 100%;
    background: #eff6ff;
    border-bottom: 1px solid rgba(191, 219, 254, 0.7);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.06);
}
.ha-main-carousel-viewport {
    width: 100%;
}
.ha-main-carousel-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(72vh, 36rem);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
@media (min-width: 768px) {
    .ha-main-carousel-frame {
        aspect-ratio: 21 / 9;
        max-height: min(68vh, 40rem);
    }
}
.ha-main-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.ha-main-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    background: linear-gradient(180deg, transparent, rgba(239, 246, 255, 0.95));
}
.ha-main-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: #1d4ed8;
    border: 1px solid rgba(191, 219, 254, 0.9);
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.12);
    transition: background 0.2s, transform 0.15s;
}
.ha-main-carousel-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}
.ha-main-carousel-nav--prev { left: 0.75rem; }
.ha-main-carousel-nav--next { right: 0.75rem; }
@media (min-width: 768px) {
    .ha-main-carousel-nav--prev { left: 1.25rem; }
    .ha-main-carousel-nav--next { right: 1.25rem; }
}

.ha-slide-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #bfdbfe;
    transition: width 0.25s, background 0.25s;
}
.ha-slide-dot.is-active {
    width: 1.5rem;
    background: #2563eb;
}

.ha-calendar-full-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #1d4ed8;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.ha-calendar-full-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.ha-calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    transition: background 0.2s;
}
.ha-calendar-nav:hover { background: #eff6ff; }
.ha-calendar-mount {
    position: relative;
    transition: opacity 0.28s ease;
}
.ha-calendar-mount.is-swapping {
    opacity: 0.45;
    pointer-events: none;
}
.ha-calendar-mount.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: haCalendarSpin 0.65s linear infinite;
    z-index: 5;
    pointer-events: none;
}
@keyframes haCalendarSpin {
    to { transform: rotate(360deg); }
}
.ha-calendar-month-label {
    min-width: 9rem;
    text-align: center;
    font-weight: 700;
    color: #1e40af;
    font-size: 1.05rem;
}
.ha-calendar-weekday {
    padding: 0.65rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
}
.ha-calendar-day {
    min-height: 6.5rem;
    border-right: 1px solid #dbeafe;
    border-bottom: 1px solid #dbeafe;
    padding: 0.35rem;
    background: #fff;
    vertical-align: top;
}
.ha-calendar-day:nth-child(7n) { border-right: none; }
.ha-calendar-day.is-empty { background: #fafafa; }
.ha-calendar-day.is-today {
    background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
    box-shadow: inset 0 0 0 2px #93c5fd;
}
.ha-calendar-day.has-events .ha-calendar-day-num {
    color: #1d4ed8;
    font-weight: 700;
}
.ha-calendar-day-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.25rem;
    line-height: 1;
}
.ha-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ha-calendar-event {
    width: 100%;
    text-align: left;
    padding: 0.2rem 0.35rem;
    border-radius: 0.4rem;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 1px solid #bfdbfe;
    font-size: 0.68rem;
    line-height: 1.25;
    color: #1e40af;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.ha-calendar-event:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}
.ha-calendar-event-time {
    display: block;
    font-weight: 700;
    color: #2563eb;
}
.ha-calendar-event-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .ha-calendar-day { min-height: 4.5rem; }
    .ha-calendar-event-title { display: none; }
    .ha-calendar-event { text-align: center; padding: 0.15rem; }
}

.ha-activity-modal {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s;
}
.ha-activity-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.ha-activity-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 58, 138, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.ha-activity-modal.is-open .ha-activity-modal-backdrop {
    opacity: 1;
}
.ha-activity-modal-panel {
    position: relative;
    width: 100%;
    max-width: 32rem;
    background: linear-gradient(180deg, #fff 0%, #fffdfb 100%);
    border-radius: 1.5rem;
    border: 1px solid #dbeafe;
    box-shadow: 0 28px 56px rgba(29, 78, 216, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    padding: 1.5rem 1.5rem 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.94) translateY(16px);
    transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1), transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.ha-activity-modal.is-open .ha-activity-modal-panel {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.ha-activity-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #1e40af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    z-index: 2;
}
.ha-activity-modal-close:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.ha-activity-modal-close:active {
    transform: scale(0.95);
}
.ha-activity-modal-header {
    padding-right: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dbeafe;
}
.ha-activity-modal-kicker {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 0.35rem;
}
.ha-activity-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
}
.ha-activity-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.ha-activity-info-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
    border: 1px solid #dbeafe;
}
.ha-activity-info-card--full {
    grid-column: 1 / -1;
}
.ha-activity-info-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ha-activity-info-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}
.ha-activity-info-icon--sm {
    width: 1.75rem;
    height: 1.75rem;
}
.ha-activity-info-icon--sm svg {
    width: 0.95rem;
    height: 0.95rem;
}
.ha-activity-info-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.ha-activity-info-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ha-activity-info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.35;
}
.ha-activity-detail-card {
    margin-top: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: #fff;
    border: 1px solid #dbeafe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.ha-activity-detail-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ha-activity-detail-body {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.65;
    white-space: pre-line;
}
.ha-activity-modal-body.is-entering [data-anim] {
    opacity: 0;
    transform: translateY(10px);
}
.ha-activity-modal-body.is-visible [data-anim] {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.ha-activity-modal-body.is-visible [data-anim="1"] { transition-delay: 0.06s; }
.ha-activity-modal-body.is-visible [data-anim="2"] { transition-delay: 0.12s; }
.ha-activity-modal-body.is-visible [data-anim="3"] { transition-delay: 0.18s; }
.ha-activity-modal-body.is-visible [data-anim="4"] { transition-delay: 0.24s; }
@media (max-width: 400px) {
    .ha-activity-info-grid {
        grid-template-columns: 1fr;
    }
}
@media (prefers-reduced-motion: reduce) {
    .ha-activity-modal,
    .ha-activity-modal-backdrop,
    .ha-activity-modal-panel,
    .ha-activity-modal-body [data-anim] {
        transition: none !important;
        transform: none !important;
    }
}

.ha-accred-select {
    min-width: 10rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.875rem;
}
.ha-accred-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #93c5fd;
}
.ha-accred-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.8rem;
}
.ha-accred-panels {
    display: grid;
    grid-template-columns: 1fr;
}
.ha-accred-panel {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    pointer-events: none;
    will-change: opacity, transform;
}
.ha-accred-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
    .ha-accred-panel {
        transition: none;
        transform: none;
    }
}
.ha-accred-cert-frame {
    max-width: 56rem;
    margin: 0 auto;
}
.ha-accred-cert-img {
    filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.08));
}

.ha-gallery-card {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ha-gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1);
}
.ha-gallery-card-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.72));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.ha-album-photo {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
}
.ha-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ha-photo-lightbox.hidden { display: none; }
.ha-photo-lightbox-inner {
    max-width: min(96vw, 72rem);
    max-height: 90vh;
    text-align: center;
}
.ha-photo-lightbox-img {
    max-width: 100%;
    max-height: calc(90vh - 3rem);
    object-fit: contain;
    border-radius: 0.5rem;
}
.ha-photo-lightbox-caption {
    color: #f9fafb;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}
.ha-photo-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.ha-photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}
.ha-photo-lightbox-nav--prev { left: 1rem; }
.ha-photo-lightbox-nav--next { right: 1rem; }

/* หน้าข้อมูลทั่วไป — รูปสี่เหลี่ยมผืนผ้าเกือบเต็มจอ */
.ha-info-stage {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.5rem 0.5rem 2.5rem;
}
@media (min-width: 768px) {
    .ha-info-stage { padding: 0.75rem 1rem 3rem; }
}
.ha-info-stack {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
@media (min-width: 768px) {
    .ha-info-stack { gap: 0.875rem; }
}
.ha-info-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: min(78vh, 52rem);
    margin: 0;
    padding: 0.35rem;
    border: none;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    cursor: zoom-in;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.ha-info-panel:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.ha-info-panel-img {
    display: block;
    width: 100%;
    height: min(76vh, 50rem);
    object-fit: contain;
    object-position: center;
}
.ha-info-empty {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* === Design system — layout, sections, forms, empty states === */
.ha-page-shell {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1rem 2.5rem;
}
@media (min-width: 768px) {
    .ha-page-shell { padding-left: 1.5rem; padding-right: 1.5rem; }
}
.ha-page-shell--narrow { max-width: 56rem; }
.ha-page-shell--compact { max-width: 42rem; }
.ha-home-stack { display: flex; flex-direction: column; gap: 2.5rem; }

.ha-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}
.ha-section-head--split {
    align-items: center;
}
@media (min-width: 640px) {
    .ha-section-head--split {
        flex-direction: row;
        align-items: flex-end;
    }
}
.ha-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #172554;
    line-height: 1.3;
}
.ha-section-desc {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #1e40af;
}
.ha-section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.55);
}
.ha-section-link:hover { color: #172554; background: #fff; }
.ha-section-aside { min-width: 0; }

.ha-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.25rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 32px rgba(29, 78, 216, 0.06);
}
.ha-empty-state-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ha-empty-state-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}
.ha-empty-state-desc {
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 24rem;
    margin: 0 auto;
    line-height: 1.5;
}
.ha-empty-state-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.ha-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ha-filter-pill:hover { background: #eff6ff; border-color: #93c5fd; }
.ha-filter-pill.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.ha-input {
    width: 100%;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ha-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}
.ha-search-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
    .ha-search-bar { flex-direction: row; }
}
.ha-search-bar .ha-input { flex: 1; min-width: 0; }

.ha-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.35rem;
}
.ha-form-error {
    font-size: 0.875rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.ha-form-hint {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    padding: 0.625rem 0.875rem;
}

.ha-ui-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.ha-ui-icon--xs { width: 0.875rem; height: 0.875rem; }
.ha-ui-icon--lg { width: 1.75rem; height: 1.75rem; }
.ha-ui-icon--xl { width: 2.5rem; height: 2.5rem; }
.ha-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    color: #93c5fd;
}
.ha-gallery-card-views {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.ha-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.ha-pagination-link {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.ha-pagination-link:hover { background: #eff6ff; }
.ha-pagination-link.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.ha-news-filter { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
#haNewsDynamic {
    position: relative;
    min-height: 120px;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#haNewsDynamic.is-loading { opacity: 0; transform: translateY(12px); }
.ha-news-dynamic.is-ready .ha-news-card {
    animation: haNewsCardIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.ha-news-dynamic.is-ready .ha-news-card:nth-child(1) { animation-delay: 0.03s; }
.ha-news-dynamic.is-ready .ha-news-card:nth-child(2) { animation-delay: 0.06s; }
.ha-news-dynamic.is-ready .ha-news-card:nth-child(3) { animation-delay: 0.09s; }
.ha-news-dynamic.is-ready .ha-news-card:nth-child(4) { animation-delay: 0.12s; }
.ha-news-dynamic.is-ready .ha-news-card:nth-child(5) { animation-delay: 0.15s; }
.ha-news-dynamic.is-ready .ha-news-card:nth-child(6) { animation-delay: 0.18s; }
@keyframes haNewsCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
#haNewsDynamic.is-busy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(239, 246, 255, 0.65);
    backdrop-filter: blur(2px);
    pointer-events: auto;
}

.ha-map-placeholder {
    min-height: 16rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    padding: 2rem;
}

.ha-error-page {
    text-align: center;
    padding: 4rem 1rem;
}
.ha-error-page-code {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: #bfdbfe;
    margin-bottom: 1rem;
}

.ha-footer-grid {
    display: grid;
    gap: 2rem;
}
@media (min-width: 640px) {
    .ha-footer-grid { grid-template-columns: 1.2fr 1fr; }
}
.ha-footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ha-footer-nav a {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.2s;
}
.ha-footer-nav a:hover { color: #172554; }
.ha-footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ha-login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.ha-login-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e3a8a;
}
.ha-login-modal-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ha-login-modal-close:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* === Mobile & touch === */
.ha-content img { max-width: 100%; height: auto; border-radius: 0.75rem; }
.ha-content p { margin-bottom: 1rem; }
.ha-content a { color: #2563eb; text-decoration: underline; }

.ha-login-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ha-login-modal.hidden { display: none; }
.ha-login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 58, 138, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ha-login-modal-panel {
    position: relative;
    width: 100%;
    max-width: 24rem;
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #dbeafe;
    box-shadow: 0 24px 48px rgba(29, 78, 216, 0.18);
    padding: 1.5rem;
    animation: haModalIn 0.25s ease-out;
}
@keyframes haModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ปุ่มรอง */
.ha-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    background: #fff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.ha-btn-outline:hover { background: #eff6ff; border-color: #93c5fd; }
.ha-btn-outline:active { transform: scale(0.98); }

/* หัวข้อหน้าย่อย */
.ha-page-header {
    background: linear-gradient(135deg, #fff 0%, #eff6ff 50%, #dbeafe 100%);
    border-bottom: 1px solid #dbeafe;
    padding: 2rem 0 1.75rem;
    position: relative;
    overflow: hidden;
}
.ha-page-header::after {
    content: '';
    position: absolute;
    width: 12rem;
    height: 12rem;
    top: -4rem;
    right: -2rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.18), transparent 70%);
    pointer-events: none;
}
.ha-page-header-inner {
    position: relative;
    z-index: 1;
}
.ha-page-header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.3;
}
@media (min-width: 768px) {
    .ha-page-header-title { font-size: 2rem; }
}
.ha-page-header-sub {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* หน้าแรก — ต้อนรับ */
.ha-welcome {
    border-bottom: 1px solid rgba(191, 219, 254, 0.5);
}
.ha-welcome--compact {
    background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
    padding: 1.25rem 0;
}
.ha-welcome--hero {
    padding: 1.5rem 0 0;
}
.ha-welcome-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .ha-welcome-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.ha-welcome-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 0.25rem;
}
.ha-welcome-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.3;
}
.ha-welcome--hero .ha-welcome-title { font-size: 1.75rem; }
@media (min-width: 768px) {
    .ha-welcome--hero .ha-welcome-title { font-size: 2rem; }
}
.ha-welcome-tagline {
    font-size: 0.95rem;
    color: #1d4ed8;
    margin-top: 0.25rem;
    font-weight: 500;
}
.ha-welcome-about {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
    line-height: 1.65;
    max-width: 36rem;
}
.ha-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* เมนูด่วนหน้าแรก — ลิงก์ศูนย์ */
.ha-quick-links {
    padding: 1.5rem 0 1rem;
    background: #eff6ff;
    border-bottom: 1px solid #dbeafe;
}
.ha-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
    gap: 1rem 1.25rem;
    justify-content: start;
}
@media (min-width: 640px) {
    .ha-quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(7.75rem, 1fr));
        gap: 1.15rem 1.5rem;
    }
}
@media (min-width: 1024px) {
    .ha-quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr));
        gap: 1.25rem 1.75rem;
    }
}
.ha-quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-width: 0;
    padding: 1rem 0.65rem 1.1rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #dbeafe;
    box-shadow: 0 2px 10px rgba(29, 78, 216, 0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
}
.ha-quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
    border-color: #bfdbfe;
}
.ha-quick-link-icon {
    width: 100%;
    max-width: 5.25rem;
    aspect-ratio: 1 / 1;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
    overflow: hidden;
}
@media (min-width: 640px) {
    .ha-quick-link-icon {
        max-width: 5.75rem;
    }
}
@media (min-width: 1024px) {
    .ha-quick-link-icon {
        max-width: 6.25rem;
    }
}
.ha-quick-link-icon--image {
    background: #fff;
    border: 1px solid #dbeafe;
    padding: 0;
}
.ha-quick-link-icon img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.ha-quick-link-icon svg { width: 1.25rem; height: 1.25rem; }
.ha-quick-link-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.35;
    width: 100%;
}
@media (min-width: 640px) {
    .ha-quick-link-label {
        font-size: 0.9rem;
    }
}
.ha-quick-link-desc {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    line-height: 1.35;
    width: 100%;
}
@media (min-width: 640px) {
    .ha-quick-link-desc {
        font-size: 0.75rem;
    }
}

/* การ์ดเนื้อหา */
.ha-content-card {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.05);
}
.ha-content-card--accent {
    background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}
.ha-content-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.65rem;
}
.ha-content-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.ha-content-card-icon svg { width: 1.25rem; height: 1.25rem; }
.ha-content-prose {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.7;
}

/* ติดต่อ */
.ha-contact-list { list-style: none; padding: 0; margin: 0; }
.ha-contact-list li {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dbeafe;
}
.ha-contact-list li:last-child { border-bottom: none; }
.ha-contact-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ha-contact-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}
.ha-contact-value {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}
.ha-map-card { min-height: 18rem; }
.ha-map-embed { width: 100%; height: 100%; min-height: 18rem; }
.ha-map-embed iframe {
    width: 100%;
    height: 100%;
    min-height: 18rem;
    border: 0;
    display: block;
}

/* เอกสารดาวน์โหลด — accordion + preview */
.ha-dl-doc-item {
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(29, 78, 216, 0.05);
}
.ha-dl-doc-toggle {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    padding: 1rem 1.1rem;
    transition: background 0.2s;
}
.ha-dl-doc-toggle:hover { background: #eff6ff; }
.ha-dl-doc-item.is-open .ha-dl-doc-toggle {
    background: #dbeafe;
    border-bottom: 1px solid #bfdbfe;
}
.ha-dl-doc-chevron {
    transition: transform 0.22s ease;
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: #1d4ed8;
}
.ha-dl-doc-item.is-open .ha-dl-doc-chevron { transform: rotate(180deg); }
.ha-dl-doc-preview {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}
.ha-dl-doc-item.is-open .ha-dl-doc-preview { grid-template-rows: 1fr; }
.ha-dl-doc-preview-inner { overflow: hidden; }
.ha-dl-doc-preview-body {
    padding: 0.75rem 1rem 1rem;
    background: #eff6ff;
    border-top: 1px solid #dbeafe;
}
.ha-dl-doc-iframe {
    width: 100%;
    height: min(70vh, 640px);
    min-height: 280px;
    display: block;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    background: #fff;
}

.ha-activity-list-item {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid #dbeafe;
    background: #fff;
    box-shadow: 0 2px 10px rgba(29, 78, 216, 0.04);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.ha-activity-list-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.08);
}

/* กลับขึ้นบน */
.ha-back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
}
.ha-back-to-top.is-visible {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ha-back-to-top:hover { filter: brightness(1.06); }

/* === Mobile & touch === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.ha-scroll-locked {
    overflow: hidden;
    touch-action: none;
}

.ha-header {
    padding-top: env(safe-area-inset-top, 0);
}

.ha-mobile-menu-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #93c5fd;
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, border-color 0.2s;
}
.ha-mobile-menu-btn:hover { background: #fff; }
.ha-mobile-menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.25rem;
}
.ha-mobile-menu-bar {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.ha-mobile-menu-btn.is-open .ha-mobile-menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.ha-mobile-menu-btn.is-open .ha-mobile-menu-bar:nth-child(2) {
    opacity: 0;
}
.ha-mobile-menu-btn.is-open .ha-mobile-menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.ha-mobile-menu {
    max-height: calc(100dvh - 4rem - env(safe-area-inset-top, 0));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 1px solid #bfdbfe;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ha-mobile-nav-link {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}
.ha-mobile-submenu-btn {
    flex-shrink: 0;
    width: 2.75rem;
    min-height: 2.75rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: #1e40af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ha-mobile-submenu-btn:hover { background: #eff6ff; }
.ha-mobile-submenu-chevron {
    transition: transform 0.22s ease;
}
.ha-mobile-nav-group.is-expanded .ha-mobile-submenu-chevron {
    transform: rotate(180deg);
}
.ha-mobile-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0 0.35rem 0.5rem;
    border-left: 2px solid #dbeafe;
    margin-left: 0.75rem;
    margin-bottom: 0.25rem;
}
.ha-mobile-submenu.hidden { display: none; }

.ha-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #bfdbfe transparent;
}
@media (min-width: 768px) {
    .ha-calendar-scroll {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }
}
@media (max-width: 767px) {
    .ha-calendar-scroll .ha-calendar {
        min-width: 36rem;
    }
}

.ha-calendar-mobile-list {
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #fff;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 12px rgba(29, 78, 216, 0.05);
}
.ha-calendar-mobile-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ha-calendar-mobile-event {
    width: 100%;
    text-align: left;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, border-color 0.15s;
}
.ha-calendar-mobile-event:active {
    background: #dbeafe;
    border-color: #bfdbfe;
}
.ha-calendar-mobile-event-date {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ha-calendar-mobile-event-time {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
}
.ha-calendar-mobile-event-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-top: 0.2rem;
    line-height: 1.35;
}

@media (max-width: 639px) {
    .ha-activity-modal {
        align-items: flex-end;
        padding: 0;
    }
    .ha-activity-modal-panel {
        max-width: 100%;
        border-radius: 1.25rem 1.25rem 0 0;
        max-height: min(92dvh, 92vh);
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0));
        transform: translateY(100%);
    }
    .ha-activity-modal.is-open .ha-activity-modal-panel {
        transform: translateY(0);
    }
    .ha-activity-modal-close {
        width: 2.75rem;
        height: 2.75rem;
    }

    .ha-login-modal {
        align-items: flex-end;
        padding: 0;
    }
    .ha-login-modal-panel {
        max-width: 100%;
        border-radius: 1.25rem 1.25rem 0 0;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0));
    }

    .ha-dl-doc-item > .flex.flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .ha-dl-doc-item > .flex.flex-wrap > .flex.flex-wrap.gap-2 {
        width: 100%;
        padding: 0 1rem 1rem;
        margin-top: -0.25rem;
    }
    .ha-dl-doc-item > .flex.flex-wrap > .flex.flex-wrap.gap-2 a {
        flex: 1;
        justify-content: center;
        min-height: 2.75rem;
        font-size: 0.8rem;
    }
    .ha-dl-doc-toggle {
        min-height: 2.75rem;
    }

    .ha-photo-lightbox {
        padding: 0.5rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0));
    }
    .ha-photo-lightbox-close,
    .ha-photo-lightbox-nav {
        width: 2.75rem;
        height: 2.75rem;
    }
    .ha-photo-lightbox-nav--prev { left: 0.5rem; }
    .ha-photo-lightbox-nav--next { right: 0.5rem; }
}

@media (max-width: 767px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
    select,
    textarea {
        font-size: 16px;
    }
}

@media (pointer: coarse) {
    .ha-btn,
    .ha-calendar-nav,
    .ha-calendar-full-btn,
    .ha-back-to-top {
        min-height: 2.75rem;
    }
    .ha-calendar-event {
        min-height: 1.75rem;
    }
}

.ha-back-to-top {
    right: max(1.25rem, env(safe-area-inset-right, 0));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0));
}

@media (hover: none) {
    .ha-card:hover,
    .ha-calendar-event:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ha-carousel [data-carousel-track],
    .ha-back-to-top,
    .ha-mobile-menu-bar,
    .ha-mobile-submenu-chevron {
        transition: none !important;
    }
    .ha-carousel [data-carousel-track] {
        scroll-behavior: auto;
    }
}
