/* Vector Web: a browser tab has no window to minimise, maximise or close. */
.vector-web #window-chrome .chrome-ctl:not(.chrome-help) { display: none; }

/* iOS Safari blurs its status bar unless a fixed, coloured box spans the top edge.
   The tabs' own headers do where they are fixed; this stands in where they aren't,
   beneath those headers and matching what it covers. */
.edge-cap { display: none; }
body.mobile .edge-cap {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 99;
    background-color: #030303;
}
body.mobile:has(#chats:not([style*="none"]) > .account) .edge-cap { background-color: #131313; }

/* Mini app windows (web/miniapps.js) */
.xdc-window {
    position: fixed;
    width: 480px;
    height: 640px;
    min-width: 320px;
    min-height: 360px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    resize: both;
}
.xdc-window.xdc-max {
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    resize: none;
}
.xdc-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    height: 37px;
    padding: 0 4px 0 10px;
    flex-shrink: 0;
    background: #141414;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
    font: 600 13px system-ui, sans-serif;
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.xdc-dragging .xdc-bar { cursor: grabbing; }
.xdc-dragging .xdc-frame { pointer-events: none; }
.xdc-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.xdc-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xdc-btn {
    all: unset;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #bdbdbd;
    cursor: pointer;
}
.xdc-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.xdc-close:hover { background: #c0392b; }
.xdc-frame { flex: 1; width: 100%; border: 0; background: #0a0a0a; }
/* Full screen on touch devices and narrow screens: no frame, a floating exit chip. */
.xdc-window.xdc-immersive {
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none;
    max-height: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    resize: none;
    background: #000;
}
.xdc-immersive .xdc-bar { display: none; }
.xdc-chip {
    all: unset;
    box-sizing: border-box;
    display: none;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: rgba(14, 14, 16, 0.8);
    border: 1.5px solid rgba(89, 252, 179, 0.5);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    opacity: 0.55;
    transition: opacity 0.25s ease, transform 0.12s ease;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    z-index: 1;
}
.xdc-chip svg { width: 16px; height: 16px; }
.xdc-immersive .xdc-chip { display: grid; }
.xdc-chip.xdc-chip-active { opacity: 1; }
.xdc-chip:active { transform: scale(0.92); }
.xdc-chip:focus-visible { outline: 2px solid #59fcb3; outline-offset: 2px; }
