/* Fixed bottom bar — bottom-bar.js */

/* Fixed bottom bar Start */
#bottom-bar {
    box-sizing: border-box;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    z-index: 1000010;
    padding: 0 16px;
}
#bottom-bar .bar-widgets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    max-width: min(52vw, 420px);
    max-height: 44px;
    overflow: hidden;
    flex: 0 1 auto;
}
#bottom-bar .bottom-bar-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    color: #1f2937;
}
#bottom-bar .bottom-bar-widget-title {
    font-weight: 600;
    white-space: nowrap;
}
#bottom-bar .bottom-bar-widget p,
#bottom-bar .bottom-bar-widget form,
#bottom-bar .bottom-bar-widget ul {
    margin: 0;
}
#bottom-bar .bottom-bar-widget ul {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 !important;
}
#bottom-bar .bottom-bar-widget li {
    display: inline-flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}
#bottom-bar .bottom-bar-widget li::before {
    content: none !important;
}
#bottom-bar .bottom-bar-widget a {
    color: #367bb7 !important;
    font-size: inherit;
    text-decoration: none;
    white-space: nowrap;
}
#bottom-bar .bottom-bar-widget a:hover {
    color: #1a5a9a !important;
    text-decoration: underline;
}
#bottom-bar .bar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex: 0 0 auto;
}
#bottom-bar .bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    color: #1f2937;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
#bottom-bar .bar-btn:hover {
    background: #eef2ff;
    border-color: #93c5fd;
}
#bottom-bar .bar-btn:active {
    transform: translateY(1px);
}
#bottom-bar [data-hover-label] {
    position: relative;
}
#bottom-bar [data-hover-label]::before {
    content: attr(data-hover-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    padding: 5px 9px;
    border-radius: 6px;
    background: #1f2937;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}
#bottom-bar [data-hover-label]:hover::before,
#bottom-bar [data-hover-label]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
#bottom-bar .bar-chat img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
#bottom-bar .bar-top svg {
    width: 18px;
    height: 12px;
    fill: currentColor;
}
#bottom-bar a.bar-btn {
    text-decoration: none;
    color: inherit;
}
#bottom-bar .bar-cloud svg,
#bottom-bar .bar-rss svg {
    display: block;
}
#bottom-bar .bar-cloud,
#bottom-bar .bar-rss {
    color: #0084ff;
}
#bottom-bar .bar-cloud svg {
    width: 28px;
    height: 28px;
}
#bottom-bar .bar-rss svg {
    width: 22px;
    height: 22px;
}
#bottom-bar .bar-cloud[aria-pressed="true"],
#bottom-bar .bar-chat[aria-pressed="true"],
#bottom-bar .bar-filter-posts[aria-pressed="true"],
#bottom-bar .bar-filter-posts.is-active,
#bottom-bar .bar-search[aria-expanded="true"] {
    background: #eef2ff;
    border-color: #93c5fd;
}
#bottom-bar .bar-search svg {
    display: block;
    width: 22px;
    height: 22px;
}

.ac-bottom-search-panel {
    box-sizing: border-box;
    position: fixed;
    left: 50%;
    bottom: 4.5rem;
    transform: translateX(-50%);
    z-index: 1000010;
    width: min(36rem, calc(100vw - 2rem));
    max-width: min(36rem, calc(100vw - 2rem));
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.ac-bottom-search-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dcdcde;
    background: #f8f9fa;
}
.ac-bottom-search-panel__close {
    flex-shrink: 0;
}
.mwai-close-button.ac-panel-close {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.mwai-close-button.ac-panel-close::before,
.mwai-close-button.ac-panel-close::after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2px;
    height: 18px;
    margin-top: -9px;
    margin-left: -0.6px;
    background-color: #64748b;
    transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}
.mwai-close-button.ac-panel-close::before {
    transform: rotate(45deg);
}
.mwai-close-button.ac-panel-close::after {
    transform: rotate(-45deg);
}
.mwai-close-button.ac-panel-close:hover::before,
.mwai-close-button.ac-panel-close:focus-visible::before {
    transform: rotate(135deg);
    background-color: #0f172a;
}
.mwai-close-button.ac-panel-close:hover::after,
.mwai-close-button.ac-panel-close:focus-visible::after {
    transform: rotate(45deg);
    background-color: #0f172a;
}
.ac-bottom-search-panel__body {
    padding: 1rem;
}
.ac-bottom-search-panel__form {
    display: block;
}
.ac-bottom-search-panel__input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    line-height: normal;
    background: #fff;
    color: #1f2937;
}
.ac-bottom-search-panel__input:focus {
    outline: none;
    border-color: #002276;
    box-shadow: 0 0 0 2px rgba(0, 34, 118, 0.15);
}
.ac-bottom-search-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.ac-bottom-search-option {
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid #002276;
    border-radius: 6px;
    background: #fff;
    color: #002276;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.ac-bottom-search-option:hover {
    border-color: #002276;
    background: #002276;
    color: #fff;
}
.ac-bottom-search-option.is-active,
.ac-bottom-search-option[aria-pressed="true"] {
    border-color: #002276;
    background: #002276;
    color: #fff;
}
/* While hovering options, only the hovered button stays highlighted. */
.ac-bottom-search-options:hover .ac-bottom-search-option.is-active:not(:hover),
.ac-bottom-search-options:hover .ac-bottom-search-option[aria-pressed="true"]:not(:hover) {
    border-color: #002276;
    background: #fff;
    color: #002276;
}
.ac-bottom-search-option.is-active:hover,
.ac-bottom-search-option[aria-pressed="true"]:hover {
    border-color: #001a5c;
    background: #001a5c;
    color: #fff;
}

@media (max-width: 760px) {
    #bottom-bar {
        min-height: 56px;
        height: auto;
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    }
    #bottom-bar .bar-actions {
        width: 100%;
        gap: 10px;
    }
    #bottom-bar .bar-widgets {
        flex: 1 1 auto;
        justify-content: center;
        max-width: none;
        max-height: 44px;
        gap: 8px;
    }
    #bottom-bar .bottom-bar-widget {
        font-size: 12px;
        overflow: hidden;
    }
    #bottom-bar .bottom-bar-widget-title {
        display: none;
    }
    #bottom-bar .bottom-bar-widget a,
    #bottom-bar .bottom-bar-widget p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #bottom-bar .bar-btn {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
    #bottom-bar .bar-chat img {
        width: 32px;
        height: 32px;
    }
    #bottom-bar .bar-rss,
    #bottom-bar .bar-search {
        display: none !important;
    }
    .ac-bottom-search-options {
        grid-template-columns: 1fr;
    }
}

/* Bottom-bar email field (neutral names — avoids ad-blocker newsletter filter lists) */
#bottom-bar .ac-bar-mail-wrap {
    margin: 0;
    padding: 0;
    line-height: 1;
    min-width: 0;
    max-width: 100%;
}
#bottom-bar .ac-bar-mail-form {
    display: flex;
    align-items: center;
    margin: 0;
    min-width: 0;
    max-width: 100%;
}
#bottom-bar .ac-bar-mail-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    margin: 0;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    line-height: normal;
    background: #fff;
    color: #1f2937;
}
#bottom-bar .ac-bar-mail-input::placeholder {
    color: #6b7280;
}
#bottom-bar .ac-bar-mail-input:focus {
    outline: none;
    border-color: #367bb7;
    box-shadow: 0 0 0 2px rgba(54, 123, 183, 0.15);
}
/* Border flash — bar-widgets uses overflow:hidden, so keep the effect in-bounds */
@keyframes ac-bar-mail-blink {
    0%, 100% {
        border-color: #d1d5db;
        border-width: 1px;
    }
    12.5%, 37.5%, 62.5%, 87.5% {
        border-color: #002276;
        border-width: 6px;
    }
    25%, 50%, 75% {
        border-color: #d1d5db;
        border-width: 1px;
    }
}
#bottom-bar .ac-bar-mail-input.ac-bar-mail-blink {
    animation: ac-bar-mail-blink 10s ease-in-out;
}
@media (min-width: 761px) {
    #bottom-bar .bar-widgets {
        flex: 0 0 auto;
    }
    #bottom-bar .ac-bar-mail-wrap,
    #bottom-bar .ac-bar-mail-form {
        flex: 0 0 auto;
        width: 258px;
    }
    #bottom-bar .ac-bar-mail-input {
        width: 258px;
        max-width: 258px;
        flex: 0 0 auto;
    }
}
@media (max-width: 760px) {
    #bottom-bar .ac-bar-mail-input {
        max-width: none;
        flex: 1 1 auto;
    }
}

/* Fixed bottom bar End */

/* Reserve space at the bottom of the page so content isn't hidden.
   Mobile bar is height:auto (buttons + padding + safe-area), so use >56px. */
body { padding-bottom: 56px; }

@media (max-width: 760px) {
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
