/* The dock only appears with the theme's mobile header. No header geometry rules. */
#ahan-mobile-dock,
#ahan-dock-space { display: none; }

@media (max-width: 800px), (max-width: 883px) and (max-height: 410px) and (orientation: landscape) {
    #ahan-mobile-dock {
        --ahan-dock-ink: #30384a;
        --ahan-dock-gold: #e6b422;
        box-sizing: border-box;
        position: fixed;
        z-index: 1035;
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        width: auto;
        max-width: 530px;
        margin: 0 auto;
        display: block;
        border: 1px solid #e0e4ec;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 8px 32px rgba(30, 41, 59, .18), 0 0 0 5px rgba(255,255,255,.55);
        color: var(--ahan-dock-ink);
        font-family: inherit;
        transition: opacity 160ms ease, transform 160ms ease;
        isolation: isolate;
    }
    #ahan-mobile-dock .ahan-dock-inner {
        display: flex;
        align-items: stretch;
        height: 68px;
        padding: 3px 4px;
        gap: 0;
    }
    #ahan-mobile-dock .ahan-dock-item {
        box-sizing: border-box;
        position: relative;
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        min-height: 44px;
        margin: 0;
        padding: 6px 0;
        border: 0;
        border-radius: 13px;
        background: transparent;
        color: #687387;
        font: inherit;
        font-size: 10px;
        font-weight: 600;
        line-height: 16px;
        white-space: nowrap;
        text-decoration: none;
        text-shadow: none;
        box-shadow: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    #ahan-mobile-dock .ahan-dock-item > span:not(.ahan-dock-primary-icon) { line-height: 16px; }
    #ahan-mobile-dock .ahan-footer-icon { display: block; width: 22px; height: 22px; flex-shrink: 0; }
    #ahan-mobile-dock .ahan-dock-item:is(:hover, :active),
    #ahan-mobile-dock .ahan-dock-item.is-current,
    #ahan-mobile-dock .ahan-dock-item[aria-expanded="true"] { color: #5c4307; background: #fff8e5; }
    #ahan-mobile-dock .ahan-dock-item:focus-visible { outline: 2px solid #a77d09 !important; outline-offset: 2px; }
    #ahan-mobile-dock .ahan-dock-item.is-current::after {
        content: ''; position: absolute; bottom: 2px; width: 14px; height: 2px; border-radius: 2px; background: #c99817;
    }
    #ahan-mobile-dock .ahan-dock-primary { color: #5c4307; gap: 2px; overflow: visible; }
    #ahan-mobile-dock .ahan-dock-primary-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 39px;
        margin-top: -8px;
        border: 3px solid #fff;
        border-radius: 14px;
        background: #f1c440;
        box-shadow: 0 4px 12px rgba(190,143,18,.16);
        color: #46370e;
    }
    #ahan-mobile-dock.ahan-dock-obscured,
    #ahan-mobile-dock.ahan-keyboard-open { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(12px); }
    #ahan-dock-space { display: block; height: calc(94px + env(safe-area-inset-bottom, 0px)); }
    /* Only marked existing floating controls are lifted; their behavior is untouched. */
    .ahan-dock-float-offset { bottom: calc(94px + env(safe-area-inset-bottom, 0px)) !important; }
    .ahan-dock-float-offset .on-hover-text { display: none !important; }
    .ahan-dock-floating-widget.ahan-dock-hide-widget { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    #ahan-mobile-dock { transition: none; }
}
@media print {
    #ahan-mobile-dock, #ahan-dock-space { display: none !important; }
}
