#pwa-tools {
    /* Keep capability handlers, but never overlay an external menu on the game. */
    display: none !important;
    position: fixed;
    top: max(2px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: #fff7e5;
    font: 12px/1.4 system-ui, sans-serif;
}
#pwa-tools > summary {
    width: max-content;
    margin: auto;
    padding: 4px 12px;
    border: 1px solid #bda778;
    border-radius: 0 0 12px 12px;
    background: #364d43ee;
    cursor: pointer;
}
#pwa-tools[open] > summary { min-height: 28px; }
.pwa-tools-card {
    width: min(300px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid #bda778;
    border-radius: 12px;
    background: #283d35;
    box-shadow: 0 6px 24px #0007;
}
.pwa-tools-card button {
    min-height: 44px;
    margin: 4px;
    padding: 8px 14px;
    border: 1px solid #d6c49b;
    border-radius: 8px;
    color: #25382f;
    background: #f4e8ca;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.pwa-tools-card button:disabled { opacity: .6; }
.pwa-tools-card p { margin: 8px 4px 0; overflow-wrap: anywhere; }
#pwa-tools :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
html[data-mahjong-keyboard] #pwa-tools { display: none; }
