/* Friends panel, save code, toasts and the first-visit tour (social/*.js). Same glass look as the rest of Quasar. */

/* ---------- shared bits ---------- */
.qs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: calc(12px * var(--round, 1));
    border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb),  0.04); color: var(--text-main);
    font: 600 0.82rem var(--font-ui); cursor: pointer; white-space: nowrap; transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.qs-btn:hover:not(:disabled) { background: rgba(var(--ink-rgb),  0.09); border-color: rgba(var(--ink-rgb),  0.25); }
.qs-btn:disabled { opacity: 0.55; cursor: default; }
.qs-btn.primary { background: var(--text-main); color: var(--bg-base); border-color: transparent; }
.qs-btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--text-main), var(--accent-cyan) 22%); box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35); }
.qs-btn .material-symbols-outlined { font-size: 1.05rem; }
.qs-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: calc(10px * var(--round, 1));
    border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: background 0.2s, color 0.2s;
    font: 600 0.75rem var(--font-ui);
}
.qs-icon-btn:hover { background: rgba(var(--ink-rgb),  0.08); color: var(--text-main); }
.qs-icon-btn .material-symbols-outlined { font-size: 1.15rem; }
.qs-icon-btn[data-sure="1"] { width: auto; padding: 0 10px; color: color-mix(in oklab, #ff6b8f, #000 var(--tx-dark, 0%)); background: rgba(255, 63, 120, 0.12); }
.qs-link { border: none; background: none; color: var(--accent-soft); font: 500 0.82rem var(--font-ui); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.qs-link:hover { color: var(--text-main); text-decoration: underline; }
.qs-link[data-sure="1"] { color: color-mix(in oklab, #ff6b8f, #000 var(--tx-dark, 0%)); }
.qs-grow { flex: 1; min-width: 0; }
.qs-desc { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0; }
.qs-msg { min-height: 0; margin: 6px 0 0; font-size: 0.8rem; color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); line-height: 1.4; }
.qs-msg:empty { display: none; }
.qs-msg.good { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qs-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.qs-avatar {
    --h: 190; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
    font: 700 0.9rem var(--font-display); color: #fff;
    background: linear-gradient(140deg, hsl(var(--h) 85% 58%), hsl(calc(var(--h) + 50) 75% 42%));
    box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb),  0.18);
}
.qs-avatar.sm { width: 30px; height: 30px; font-size: 0.78rem; }
.qs-avatar.lg { width: 46px; height: 46px; font-size: 1.15rem; }

/* ---------- top bar button ---------- */
#btn-friends-player { position: relative; }
#open-friends .qs-badge, #btn-friends-player .qs-badge {
    position: absolute; top: 3px; right: 6px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: calc(9px * var(--round, 1));
    font: 700 0.66rem/17px var(--font-ui); text-align: center; color: var(--on-accent); background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}
#btn-friends-player .qs-badge { top: -2px; right: -4px; }
#open-friends .qs-badge.alert, #btn-friends-player .qs-badge.alert { background: var(--accent-pink); color: #fff; box-shadow: 0 0 10px rgba(255, 63, 210, 0.6); }
#open-friends .qs-badge[hidden], #btn-friends-player .qs-badge[hidden] { display: none; }

/* ---------- the drawer ---------- */
.qs-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1500; width: min(400px, 100vw); display: flex; flex-direction: column;
    background: var(--glass-strong); border-left: 1px solid var(--line-strong);
    backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy);
    box-shadow: -30px 0 80px rgba(0, 0, 0, calc(0.55 * var(--shadow-k, 1))); text-align: left;
    transform: translateX(105%); transition: transform 0.3s var(--ease);
}
.qs-drawer.open { transform: none; }
.qs-drawer[hidden], .qs-drawer [hidden] { display: none !important; }
.qs-drawer::before { content: ''; position: absolute; left: -1px; top: 40px; bottom: 40px; width: 2px; background: var(--grad-accent); opacity: 0.7; }
.qs-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px 22px; }
.qs-head h2 { display: flex; align-items: center; gap: 10px; font: 700 1.05rem var(--font-display); letter-spacing: 0.06em; }
.qs-head h2 .material-symbols-outlined { color: var(--accent-cyan); }
.qs-scroll { flex: 1; overflow-y: auto; padding: 4px 18px 28px 22px; display: flex; flex-direction: column; gap: 18px; }
.qs-scroll h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 500 0.7rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-soft); }
.qs-scroll h3 .material-symbols-outlined { font-size: 1.05rem; }
.qs-scroll h3 .qs-count { margin-left: auto; letter-spacing: 0.05em; text-transform: none; color: var(--text-muted); font-family: var(--font-ui); }
.qs-card { padding: 16px; border-radius: calc(18px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.03); border: 1px solid var(--line); }
.qs-scroll input {
    width: 100%; min-width: 0; padding: 10px 14px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong);
    background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.92rem var(--font-ui); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.qs-scroll input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qs-scroll form { display: flex; gap: 8px; }

.qs-me { display: flex; align-items: center; gap: 14px; }
.qs-me-text { flex: 1; min-width: 0; }
.qs-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: none; background: none; padding: 0; color: var(--text-main); font: 700 1.1rem var(--font-ui); cursor: pointer; }
.qs-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-name .material-symbols-outlined { font-size: 1rem; color: var(--text-dim); }
.qs-name:hover .material-symbols-outlined { color: var(--accent-cyan); }
.qs-name-form input { padding: 7px 12px; }
.qs-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 0.8rem; color: var(--text-muted); }
.qs-fc { font: 700 0.9rem var(--font-mono); letter-spacing: 0.12em; color: var(--text-main); }
.qs-sub .qs-icon-btn { width: 26px; height: 26px; }
.qs-conn { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--text-dim); }
.qs-conn.on { background: #3dffa8; box-shadow: 0 0 10px #3dffa8; }

.qs-save .qs-desc { margin-bottom: 12px; }
.qs-code { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.35); border: 1px solid var(--line-strong); }
.qs-savecode { flex: 1; font: 700 1.02rem var(--font-mono); letter-spacing: 0.14em; color: var(--text-main); }
.qs-syncline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.qs-syncspace { flex-basis: 100%; padding-left: 22px; opacity: 0.8; }
.qs-syncline .material-symbols-outlined { font-size: 1rem; flex: none; }
.qs-syncline.ok .material-symbols-outlined { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qs-syncline.error, .qs-syncline.full { color: color-mix(in oklab, #ffc46b, #000 var(--tx-dark, 0%)); }
.qs-use { margin-top: 12px; }
.qs-use summary { cursor: pointer; color: var(--accent-soft); font-size: 0.82rem; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; }
.qs-use summary::before { content: 'chevron_right'; font-family: 'Material Symbols Outlined'; font-size: 1.1rem; transition: transform 0.2s; }
.qs-use[open] summary::before { transform: rotate(90deg); }
.qs-use summary::-webkit-details-marker { display: none; }
.qs-use form { margin: 10px 0 8px; }
.qs-use input { font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }

.qs-alerts { display: flex; flex-direction: column; gap: 8px; }
.qs-alerts:empty { display: none; }
.qs-alert { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: calc(14px * var(--round, 1)); font-size: 0.85rem; background: rgba(var(--accent-rgb), 0.07); border: 1px solid rgba(var(--accent-rgb), 0.25); }
.qs-alert.party { background: rgba(155, 92, 255, 0.1); border-color: rgba(155, 92, 255, 0.35); }

.qs-party.empty { background: none; border-style: dashed; }
.qs-members { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.qs-member { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 600; opacity: 0.55; }
.qs-member.on { opacity: 1; }
.qs-member small, .qs-friend small { display: block; font-weight: 400; font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-crown .material-symbols-outlined { font-size: 0.95rem; color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); vertical-align: -2px; }
.qs-member .qs-icon-btn { width: 28px; height: 28px; }

.qs-list { display: flex; flex-direction: column; gap: 4px; }
.qs-friend { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; border-radius: calc(14px * var(--round, 1)); transition: background 0.2s; }
.qs-friend:hover { background: rgba(var(--ink-rgb),  0.04); }
.qs-friend b { display: block; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-friend .qs-avatar { position: relative; }
.qs-friend:not(.on) .qs-avatar { filter: grayscale(0.85) brightness(0.7); }
.qs-friend.on .qs-avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 0 2px var(--glass-strong); }
.qs-friend .qs-btn { padding: 6px 11px; font-size: 0.78rem; }
.qs-friend .qs-remove { opacity: 0; }
.qs-friend:hover .qs-remove, .qs-friend .qs-remove:focus-visible, .qs-friend .qs-remove[data-sure="1"] { opacity: 1; }
@media (hover: none) { .qs-friend .qs-remove { opacity: 1; } }
.qs-sent { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.qs-sent-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 0.8rem; color: var(--text-muted); }
.qs-sent-row .material-symbols-outlined { font-size: 1rem; }

/* ---------- toasts ---------- */
.qs-toasts { position: fixed; top: 84px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(370px, calc(100vw - 32px)); pointer-events: none; }
.qs-toast {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 10px 14px 16px; border-radius: calc(18px * var(--round, 1)); pointer-events: auto;
    background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--text-main); font: 400 0.88rem/1.45 var(--font-ui); text-align: left;
    box-shadow: 0 18px 50px rgba(0, 0, 0, calc(0.6 * var(--shadow-k, 1))); backdrop-filter: var(--blur-heavy); -webkit-backdrop-filter: var(--blur-heavy);
    animation: qsToastIn 0.35s var(--ease) both;
}
.qs-toast > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.3rem; margin-top: 1px; }
.qs-toast-body { flex: 1; min-width: 0; }
.qs-toast-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qs-toast-actions button { padding: 7px 13px; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb),  0.05); color: var(--text-main); font: 600 0.8rem var(--font-ui); cursor: pointer; }
.qs-toast-actions button:hover { background: rgba(var(--ink-rgb),  0.1); }
.qs-toast-actions button.primary { background: var(--text-main); color: var(--bg-base); border-color: transparent; }
.qs-toast-x { border: none; background: none; color: var(--text-dim); cursor: pointer; padding: 2px; display: flex; }
.qs-toast-x:hover { color: var(--text-main); }
.qs-toast-x .material-symbols-outlined { font-size: 1.1rem; }
.qs-toast.out { animation: qsToastOut 0.25s ease both; }
.qs-n { font-weight: 700; color: var(--accent-cyan); }
@keyframes qsToastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes qsToastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- the tour ---------- */
.qs-tour { position: fixed; inset: 0; z-index: 2600; text-align: left; }
.qs-tour.out { animation: qsFade 0.25s ease reverse both; }
.qs-tour-hole {
    position: fixed; border-radius: calc(18px * var(--round, 1)); pointer-events: none;
    box-shadow: 0 0 0 200vmax rgba(1, 2, 8, 0.78), 0 0 0 2px rgba(var(--accent-rgb), 0.85), 0 0 30px 4px rgba(var(--accent-rgb), 0.4);
    transition: left 0.4s var(--ease), top 0.4s var(--ease), width 0.4s var(--ease), height 0.4s var(--ease), opacity 0.3s;
}
.qs-tour-card {
    position: fixed; width: min(380px, calc(100vw - 24px)); padding: 20px 20px 16px; border-radius: calc(22px * var(--round, 1));
    background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float);
    transition: left 0.4s var(--ease), top 0.4s var(--ease);
}
.qs-tour-card::before { content: ''; position: absolute; left: 30px; right: 30px; top: -1px; height: 2px; border-radius: calc(2px * var(--round, 1)); background: var(--grad-accent); box-shadow: 0 0 14px var(--accent-cyan); }
.qs-tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); }
.qs-tour-card.in { animation: qsCardIn 0.35s var(--ease) both; }
.qs-tour-card.center.in { animation: qsCardInCenter 0.4s var(--ease) both; }
.qs-tour-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qs-tour-top > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.4rem; }
.qs-tour-step { flex: 1; font: 500 0.68rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }
.qs-tour-card h3 { font: 700 1.15rem var(--font-display); letter-spacing: 0.03em; margin: 0 0 8px; }
.qs-tour-card p { margin: 0; color: color-mix(in oklab, #c3cbe6, #000 var(--tx-dark, 0%)); font-size: 0.9rem; line-height: 1.55; }
.qs-tour-card b { color: var(--text-main); }
.qs-tour-card kbd { padding: 1px 6px; border-radius: calc(5px * var(--round, 1)); border: 1px solid var(--line-strong); font: 600 0.78rem var(--font-mono); }
.qs-tour-code { margin-top: 14px; }
.qs-tour-name { margin-top: 12px; }
.qs-tour-name input {
    width: 100%; padding: 11px 14px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35);
    color: var(--text-main); font: 600 1rem var(--font-ui); outline: none;
}
.qs-tour-name input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qs-tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.qs-tour-dots { flex: 1; display: flex; gap: 5px; }
.qs-tour-dots i { width: 6px; height: 6px; border-radius: calc(3px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.15); transition: width 0.3s var(--ease), background 0.3s; }
.qs-tour-dots i.done { background: rgba(var(--accent-rgb), 0.45); }
.qs-tour-dots i.on { width: 18px; background: var(--accent-cyan); }
@keyframes qsFade { from { opacity: 0; } }
@keyframes qsCardIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes qsCardInCenter { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } }

html[data-fancy="low"] .qs-drawer, html[data-fancy="low"] .qs-tour-hole, html[data-fancy="low"] .qs-tour-card { transition: none; }
html[data-fancy="low"] .qs-tour-hole { box-shadow: 0 0 0 200vmax rgba(1, 2, 8, 0.82), 0 0 0 2px rgba(var(--accent-rgb), 0.85); }

@media (max-width: 760px) {
    .qs-toasts { top: 74px; right: 12px; }
    #open-friends .qs-badge { top: 1px; right: 2px; }
}
/* Eight buttons in the top bar (with Friends): a little tighter on phones so Config still fits. */
@media (max-width: 440px) {
    .top-controls { gap: 0; padding: 4px; }
    .top-btn { padding: 9px 9px; }
    .top-btn .material-symbols-outlined { font-size: 1.2rem; }
}

/* ---------- sign-in screen (social/auth.js) ---------- */
.qa-gate {
    position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto;
    background: radial-gradient(ellipse at 20% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(155, 92, 255, 0.16), transparent 55%), color-mix(in oklab, rgba(2, 3, 10, 0.94), rgba(255, 255, 255, 0.94) var(--bg-light, 0%));
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); text-align: left; animation: qsFade 0.35s ease both;
}
.qa-gate.out { animation: qsFade 0.3s ease reverse both; }
.qa-card {
    position: relative; width: min(520px, 100%); margin: auto; padding: 26px 26px 22px; border-radius: calc(26px * var(--round, 1));
    background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); animation: qsCardIn 0.45s var(--ease) both;
}
.qa-card::before { content: ''; position: absolute; left: 40px; right: 40px; top: -1px; height: 2px; border-radius: calc(2px * var(--round, 1)); background: var(--grad-accent); box-shadow: 0 0 14px var(--accent-cyan); }
.qa-brand { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.qa-logo { flex: none; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--accent-cyan) 30%, #6b3cff 70%, transparent 72%); box-shadow: 0 0 26px rgba(var(--accent-rgb), 0.5); }
.qa-brand h2 { margin: 2px 0 6px; font: 700 1.3rem var(--font-display); letter-spacing: 0.03em; }
.qa-sub { margin: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.5; }
.qa-sub b { color: var(--text-main); }
.qa-center { text-align: center; margin-top: 12px; }
.qa-banner { display: flex; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: calc(12px * var(--round, 1)); background: rgba(255, 196, 107, 0.1); border: 1px solid rgba(255, 196, 107, 0.35); color: #ffd99b; font-size: 0.84rem; }
.qa-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.35); border: 1px solid var(--line); margin-bottom: 18px; }
.qa-tabs button { padding: 9px; border: none; border-radius: calc(10px * var(--round, 1)); background: none; color: var(--text-muted); font: 600 0.86rem var(--font-ui); cursor: pointer; transition: background 0.2s, color 0.2s; }
.qa-tabs button.on { background: rgba(var(--ink-rgb),  0.1); color: var(--text-main); box-shadow: inset 0 0 0 1px var(--line-strong); }
.qa-form { display: flex; flex-direction: column; gap: 12px; }
.qa-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa-field { display: flex; flex-direction: column; gap: 5px; }
.qa-label { font: 500 0.68rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-soft); }
.qa-gate input {
    width: 100%; min-width: 0; padding: 11px 14px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong);
    background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.95rem var(--font-ui); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.qa-gate input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qa-field.bad input { border-color: rgba(255, 107, 143, 0.8); box-shadow: 0 0 0 3px rgba(255, 63, 120, 0.12); }
.qa-help { font-size: 0.76rem; color: var(--text-dim); line-height: 1.4; }
.qa-help:empty { display: none; }
.qa-help.good { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qa-help.bad { color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }
.qa-err { font-size: 0.78rem; color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); line-height: 1.4; }
.qa-err:empty { display: none; }
.qa-note { display: flex; gap: 8px; align-items: flex-start; margin: -2px 0 2px; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--accent-rgb), 0.06); border: 1px solid rgba(var(--accent-rgb), 0.2); color: color-mix(in oklab, #c3cbe6, #000 var(--tx-dark, 0%)); font-size: 0.8rem; line-height: 1.45; }
.qa-note .material-symbols-outlined { font-size: 1.1rem; color: var(--accent-cyan); }
.qa-note b { color: var(--text-main); }
.qa-msg { margin: 0; font-size: 0.85rem; color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }
.qa-msg:empty { display: none; }
.qa-msg.good { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qa-go, button[type="submit"].qa-go { padding: 12px; font-size: 0.95rem; margin-top: 4px; justify-content: center; } /* (the second beats index.css's button[type=submit], the search bar's Warp button, which left this 18 px tall) */
.qa-go .material-symbols-outlined { font-size: 1.15rem; }
.qa-go:disabled .material-symbols-outlined { animation: qaSpin 1s linear infinite; }
@keyframes qaSpin { to { transform: rotate(360deg); } }
.qa-old { padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px dashed var(--line-strong); }
.qa-old summary { cursor: pointer; color: var(--accent-soft); font-size: 0.84rem; font-weight: 500; }
.qa-old .qa-sub { margin: 8px 0; font-size: 0.8rem; }
.qa-inline { display: flex; gap: 8px; }
.qa-inline input { font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 480px) { .qa-row { grid-template-columns: 1fr; } .qa-card { padding: 22px 18px 18px; } }
html[data-fancy="low"] .qa-gate { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in oklab, #03040b, var(--paper, #fff) var(--bg-light, 0%)); }

/* ---------- account card in the drawer ---------- */
.qs-acct .qs-desc { margin-bottom: 10px; }
.qs-acct-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.84rem; margin-bottom: 12px; }
.qs-acct-grid dt { color: var(--text-muted); }
.qs-acct-grid dd { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.qs-acct form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.qs-acct form .qs-row { margin-top: 2px; }
.qs-handle { color: var(--text-muted); font-weight: 500; font-size: 0.82rem; }

/* ---------- profile pictures ---------- */
.qs-avatar.has-pic { overflow: hidden; background: color-mix(in oklab, #0b0f1e, var(--paper, #fff) var(--bg-light, 0%)); padding: 0; }
.qs-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; user-select: none; }
.qs-avatar.xl { width: 84px; height: 84px; font-size: 2rem; }
.qs-pic-btn { position: relative; border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.qs-pic-edit { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--text-main); color: var(--bg-base); box-shadow: 0 0 0 2px var(--glass-strong); }
.qs-pic-edit .material-symbols-outlined { font-size: 0.85rem; }
.qs-pic-btn:hover .qs-avatar { filter: brightness(1.15); }
.qs-btn.danger { border-color: rgba(255, 107, 143, 0.45); color: color-mix(in oklab, #ff9db6, #000 var(--tx-dark, 0%)); }
.qs-btn.danger:hover:not(:disabled) { background: rgba(255, 63, 120, 0.14); border-color: rgba(255, 107, 143, 0.8); }
.qs-admin-btn { width: 100%; margin-top: 10px; border-color: rgba(255, 215, 107, 0.4); color: color-mix(in oklab, #ffe39b, #000 var(--tx-dark, 0%)); }
.qs-badge-inline { margin-left: 4px; min-width: 18px; padding: 0 6px; border-radius: calc(9px * var(--round, 1)); background: var(--accent-pink); color: #fff; font-size: 0.7rem; }

/* ---------- dialogs (ui.js modal) ---------- */
.qs-modal { position: fixed; inset: 0; z-index: 5600; display: flex; align-items: center; justify-content: center; padding: 16px; background: color-mix(in oklab, rgba(1, 2, 8, 0.66), rgba(255, 255, 255, 0.66) var(--bg-light, 0%)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: qsFade 0.2s ease both; text-align: left; }
.qs-modal.out { animation: qsFade 0.2s ease reverse both; }
.qs-modal-card { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px; border-radius: calc(22px * var(--round, 1)); background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); animation: qsCardIn 0.3s var(--ease) both; }
.qs-modal-card.wide { width: min(640px, 100%); }
.qs-modal-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qs-modal-card h3 { margin: 0; font: 700 1.05rem var(--font-display); letter-spacing: 0.03em; }
.qs-modal-body { display: flex; flex-direction: column; gap: 10px; }
.qs-modal-card footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.qs-modal textarea, .qs-modal input:not([type=radio]):not([type=range]) {
    width: 100%; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.9rem var(--font-ui); outline: none; resize: vertical;
}
.qs-modal textarea { min-height: 70px; }
.qs-report-kinds { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.qs-report-kinds label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line); cursor: pointer; }
.qs-report-kinds label:has(input:checked) { border-color: var(--border-focus); background: rgba(var(--accent-rgb), 0.06); }
.qs-crop { position: relative; width: var(--s); height: var(--s); max-width: 100%; margin: 4px auto; border-radius: calc(16px * var(--round, 1)); overflow: hidden; background: #05070f; touch-action: none; }
.qs-crop canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.qs-crop canvas:active { cursor: grabbing; }
.qs-crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(1, 2, 8, 0.6), inset 0 0 0 2px rgba(var(--accent-rgb), 0.8); }
.qs-crop-zoom { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.qs-crop-zoom input { flex: 1; accent-color: var(--accent-cyan); }

/* ---------- ban screen ---------- */
.qa-ban-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 63, 120, 0.15); color: color-mix(in oklab, #ff6b8f, #000 var(--tx-dark, 0%)); }
.qa-card.qa-ban::before { background: linear-gradient(90deg, #ff3f78, #ff9d5c); box-shadow: 0 0 14px #ff3f78; }

/* ---------- admin panel (social/admin.js) ---------- */
.qd-admin { position: fixed; inset: 0; z-index: 5200; display: flex; align-items: stretch; justify-content: center; padding: 18px; background: color-mix(in oklab, rgba(1, 2, 8, 0.72), rgba(255, 255, 255, 0.72) var(--bg-light, 0%)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: left; animation: qsFade 0.25s ease both; }
.qd-shell { position: relative; width: min(1180px, 100%); display: flex; flex-direction: column; border-radius: calc(26px * var(--round, 1)); background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); overflow: hidden; animation: qsCardIn 0.35s var(--ease) both; }
.qd-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.qd-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 1.05rem var(--font-display); letter-spacing: 0.06em; }
.qd-head h2 .material-symbols-outlined { color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qd-tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; }
.qd-tabs button { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: none; border-radius: calc(10px * var(--round, 1)); background: none; color: var(--text-muted); font: 600 0.84rem var(--font-ui); cursor: pointer; white-space: nowrap; }
.qd-tabs button.on { background: rgba(var(--ink-rgb),  0.08); color: var(--text-main); }
.qd-tabs .material-symbols-outlined { font-size: 1.1rem; }
.qd-count { font-style: normal; min-width: 18px; padding: 0 6px; border-radius: calc(9px * var(--round, 1)); background: var(--accent-pink); color: #fff; font-size: 0.7rem; line-height: 18px; text-align: center; }
.qd-count[hidden] { display: none; }
.qd-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.qd-pad { padding: 18px 22px; overflow-y: auto; }
.qd-loading { display: flex; align-items: center; gap: 8px; padding: 30px; color: var(--text-muted); }
.qd-loading .material-symbols-outlined { animation: qaSpin 1s linear infinite; }
.qd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.qd-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb),  0.03); color: var(--text-main); cursor: pointer; text-align: left; font: 500 0.8rem var(--font-ui); }
.qd-stat:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(var(--ink-rgb),  0.06); }
.qd-stat b { font: 700 1.6rem var(--font-display); }
.qd-stat span:last-child { color: var(--text-muted); }
.qd-stat .material-symbols-outlined { color: var(--accent-cyan); }
.qd-health { display: flex; gap: 12px; padding: 14px; border-radius: calc(16px * var(--round, 1)); margin-bottom: 14px; font-size: 0.86rem; }
.qd-health p { margin: 4px 0 0; color: var(--text-muted); }
.qd-health.good { background: rgba(61, 255, 168, 0.06); border: 1px solid rgba(61, 255, 168, 0.25); }
.qd-health.good > .material-symbols-outlined { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qd-health.bad { background: rgba(255, 196, 107, 0.08); border: 1px solid rgba(255, 196, 107, 0.4); }
.qd-health.bad > .material-symbols-outlined { color: color-mix(in oklab, #ffc46b, #000 var(--tx-dark, 0%)); }
.qd-health.bad.worse { background: rgba(255, 63, 120, 0.1); border-color: rgba(255, 63, 120, 0.45); }
.qd-health.bad.worse > .material-symbols-outlined { color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }

/* Overview: the server */
.qd-h { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font: 700 0.82rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.qd-h small { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.qd-h .material-symbols-outlined { font-size: 1.1rem; color: var(--accent-cyan); }
.qd-stat.qd-sv { cursor: default; }
.qd-stat.qd-sv b { font-size: 1.35rem; }
.qd-stat.qd-sv > span:not(.material-symbols-outlined) { color: var(--text-muted); line-height: 1.35; }
.qd-bar { display: block; width: 100%; height: 5px; margin-top: 8px; border-radius: calc(5px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.08); overflow: hidden; }
.qd-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent-cyan); transition: width 0.4s; }
.qd-bar.warn > i { background: #ffc46b; }
.qd-bar.bad > i { background: #ff5c8a; }
.qd-sv-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.qd-sv-list li { padding: 2px 8px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.07); color: var(--text-main); font-size: 0.72rem; }
.qd-sv-list li.bad { background: rgba(255, 63, 120, 0.16); color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }
.qd-dim { color: var(--text-dim); font-size: 0.76rem; }

/* Live (owner only) */
.qd-live-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.qd-live-chip { padding: 5px 11px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); color: var(--text-muted); font-size: 0.78rem; }
.qd-live-chip b { color: var(--text-main); }
.qd-live-chip.on { border-color: rgba(61, 255, 168, 0.4); background: rgba(61, 255, 168, 0.07); }
.qd-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-bottom: 18px; }
.qd-live-card { padding: 12px; border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb),  0.03); }
.qd-live-card.away { opacity: 0.6; }
.qd-live-who { width: 100%; display: flex; align-items: center; gap: 10px; padding: 2px; border: none; background: none; color: var(--text-main); text-align: left; cursor: pointer; font: 400 0.86rem var(--font-ui); }
.qd-live-who > span { min-width: 0; }
.qd-live-who small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.qd-live-who .qd-b { margin-left: 4px; }
.qd-live-tabs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qd-live-tabs li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.25); font-size: 0.84rem; }
.qd-live-tabs li.away { opacity: 0.55; }
.qd-live-dev .material-symbols-outlined { color: var(--text-muted); font-size: 1.25rem; }
.qd-live-what { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 2px 6px; }
.qd-live-what > span:not(.material-symbols-outlined) { min-width: 0; overflow-wrap: anywhere; }
.qd-live-what > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.05rem; }
.qd-live-what b { font-weight: 650; }
.qd-live-what small { grid-column: 2; display: flex; align-items: center; gap: 4px; color: color-mix(in oklab, #c9a8ff, #000 var(--tx-dark, 0%)); font-size: 0.76rem; }
.qd-live-what small .material-symbols-outlined { font-size: 0.9rem; }
.qd-live-meta { flex: none; color: var(--text-dim); font-size: 0.7rem; text-align: right; line-height: 1.35; }
.qd-live-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px; }

/* Terminal (owner only) */
.qd-term-lock { max-width: 420px; margin: 30px auto; text-align: center; }
.qd-term-lock > .material-symbols-outlined { font-size: 2.4rem; color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qd-term-lock h3 { margin: 6px 0; font: 700 1.1rem var(--font-display); }
.qd-term-open { margin-top: 14px; }
.qd-term-note { color: color-mix(in oklab, #ffc46b, #000 var(--tx-dark, 0%)); font-size: 0.86rem; }
.qd-term-target { width: 190px; padding: 4px 8px; border-radius: calc(8px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.8rem ui-monospace, Menlo, Consolas, monospace; }
.qd-term-key { margin: 10px 0; padding: 10px 12px; border-radius: calc(10px * var(--round, 1)); background: color-mix(in oklab, #04060c, var(--paper, #fff) var(--bg-light, 0%)); color: color-mix(in oklab, #d6f7ff, #000 var(--tx-dark, 0%)); font: 0.74rem/1.4 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }

/* the owner's terminal (social/terminal.js, xterm.js) */
.qt { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--term-bg); }
.qt .material-symbols-outlined { font-size: 1.15rem; }
.qt-bar { display: flex; align-items: stretch; gap: 6px; padding: 6px 8px 0; min-height: 40px; background: rgba(var(--ink-rgb),  0.025); border-bottom: 1px solid var(--line); }
.qt-tabs { display: flex; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.qt-tabs::-webkit-scrollbar { display: none; }
.qt-tab { position: relative; flex: none; display: flex; align-items: center; gap: 7px; max-width: 220px; height: 34px; padding: 0 6px 0 12px; border-radius: calc(10px * var(--round, 1)) calc(10px * var(--round, 1)) 0 0; color: var(--text-muted); font: 600 0.8rem var(--font-ui); cursor: pointer; user-select: none; transition: background 0.15s, color 0.15s; }
.qt-tab:hover { background: rgba(var(--ink-rgb),  0.05); color: var(--text-main); }
.qt-tab.on { background: var(--term-bg); color: var(--text-main); box-shadow: inset 0 2px 0 var(--accent-cyan), 1px 0 0 var(--line), -1px 0 0 var(--line); }
.qt-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--term-bg); }
.qt-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 500; }
.qt-tab-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 6px #3dffa8; }
.qt-tab.connecting .qt-tab-dot, .qt-tab.retry .qt-tab-dot { background: #ffd76b; box-shadow: 0 0 6px #ffd76b; animation: qtPulse 1s ease-in-out infinite; }
.qt-tab.exited .qt-tab-dot, .qt-tab.failed .qt-tab-dot { background: #5b6478; box-shadow: none; }
.qt-tab-x { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: none; border-radius: calc(6px * var(--round, 1)); background: none; color: inherit; opacity: 0; cursor: pointer; }
.qt-tab:hover .qt-tab-x, .qt-tab.on .qt-tab-x { opacity: 0.7; }
.qt-tab-x:hover { opacity: 1 !important; background: rgba(255, 92, 122, 0.2); color: color-mix(in oklab, #ff8fa3, #000 var(--tx-dark, 0%)); }
.qt-tab-x .material-symbols-outlined { font-size: 0.95rem; }
.qt-new, .qt-tools { flex: none; display: flex; align-items: center; gap: 2px; padding-bottom: 5px; }
.qt-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border: none; border-radius: calc(8px * var(--round, 1)); background: none; color: var(--text-muted); font: 700 0.78rem ui-monospace, Menlo, Consolas, monospace; cursor: pointer; transition: background 0.12s, color 0.12s; }
.qt-btn:hover { background: rgba(var(--ink-rgb),  0.08); color: var(--text-main); }
.qt-btn:active { transform: translateY(1px); }
.qt-btn.on { background: rgba(var(--accent-rgb), 0.16); color: color-mix(in oklab, #7ff4ff, #000 var(--tx-dark, 0%)); }
.qt-btn:focus-visible, .qt-tab:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: -2px; }
.qt-new .qt-btn .material-symbols-outlined:first-child { font-size: 0.95rem; margin-right: -2px; }
.qt-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
.qt-stage { position: relative; flex: 1; min-height: 0; }
.qt-pane { position: absolute; inset: 0; padding: 6px 0 4px 10px; display: none; }
.qt-pane.on { display: block; }
.qt-pane .xterm { height: 100%; }
.qt-pane .xterm-viewport { scrollbar-width: thin; scrollbar-color: rgba(var(--ink-rgb),  0.16) transparent; }
.qt-pane.bell { animation: qtBell 0.3s ease; }
.qt-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); }
.qt-empty > .material-symbols-outlined { font-size: 2.6rem; color: #3a4258; }
.qt-empty[hidden] { display: none; }
.qt-empty .qs-btn { display: inline-flex; align-items: center; gap: 6px; }
.qt-find { position: absolute; top: 8px; right: 18px; z-index: 5; display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 10px; border-radius: calc(12px * var(--round, 1)); background: color-mix(in oklab, rgba(16, 20, 32, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1))); color: var(--text-muted); animation: qsFade 0.15s ease both; }
.qt-find[hidden] { display: none; }
.qt-find input { width: 220px; margin: 0 6px; border: none; background: none; outline: none; color: var(--text-main); font: 400 0.84rem ui-monospace, Menlo, Consolas, monospace; }
.qt-find-count { min-width: 70px; font-size: 0.74rem; text-align: right; padding-right: 4px; }
.qt-toast { position: absolute; left: 50%; top: 12px; z-index: 6; transform: translateX(-50%); padding: 6px 12px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--accent-rgb), 0.92); color: var(--on-accent); font: 700 0.76rem var(--font-ui); pointer-events: none; transition: opacity 0.25s; }
.qt-toast[hidden] { display: none; }
.qt-toast.out { opacity: 0; }
.qt-status { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; border-top: 1px solid var(--line); background: rgba(var(--ink-rgb),  0.025); color: var(--text-muted); font: 500 0.72rem ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; }
.qt-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #5b6478; }
.qt-status[data-state="live"] .qt-dot { background: #3dffa8; box-shadow: 0 0 6px #3dffa8; }
.qt-status[data-state="connecting"] .qt-dot, .qt-status[data-state="retry"] .qt-dot { background: #ffd76b; animation: qtPulse 1s ease-in-out infinite; }
.qt-status[data-state="live"] .qt-state { color: color-mix(in oklab, #7dffc4, #000 var(--tx-dark, 0%)); }
.qt-where, .qt-hint { color: var(--text-dim, #7a849c); }
.qt-hint { overflow: hidden; text-overflow: ellipsis; }
/* the key bar for phones and tablets (Esc, Ctrl, arrows…) */
.qt-kb { flex: none; display: flex; gap: 6px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(var(--ink-rgb),  0.03); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.qt-kb[hidden] { display: none; }
.qt-kb-keys { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 38px); grid-auto-columns: minmax(44px, max-content); gap: 5px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x; }
.qt-kb-keys::-webkit-scrollbar { display: none; }
.qt-kb-arrows { flex: none; display: grid; grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(2, 38px); gap: 5px; padding-left: 6px; border-left: 1px solid var(--line); touch-action: none; }
.qt-key { display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: calc(9px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.06); color: var(--text-main); font: 600 0.8rem ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qt-kb-arrows .qt-key { padding: 0; }
.qt-key .material-symbols-outlined { font-size: 1.3rem; }
.qt-key:active, .qt-key.down { background: rgba(var(--accent-rgb), 0.3); transform: translateY(1px); }
.qt-key.on { background: rgba(var(--accent-rgb), 0.22); border-color: rgba(var(--accent-rgb), 0.6); color: color-mix(in oklab, #7ff4ff, #000 var(--tx-dark, 0%)); }
.qt-key.lock { background: var(--accent-cyan); border-color: var(--accent-cyan); color: var(--on-accent); }
.qt-key.hot { color: color-mix(in oklab, #ff8fa3, #000 var(--tx-dark, 0%)); }
.qt-key.sym { font-size: 0.98rem; }
@media (hover: hover) { .qt-key:hover { background: rgba(var(--ink-rgb),  0.1); } }

.qt-keys { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.qt-keys td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qt-keys td:first-child { white-space: nowrap; width: 1%; }
.qt-keys kbd { display: inline-block; margin: 1px 2px; padding: 2px 7px; border-radius: calc(6px * var(--round, 1)); border: 1px solid var(--line-strong); border-bottom-width: 2px; background: rgba(var(--ink-rgb),  0.05); font: 600 0.74rem ui-monospace, Menlo, Consolas, monospace; color: var(--text-main); }
.qt-h { margin: 16px 0 4px; font: 500 0.68rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-soft); }
.qt-check { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 0.86rem; cursor: pointer; }
.qd-admin:fullscreen { padding: 0; background: var(--term-bg); }
.qd-admin:fullscreen .qd-shell { width: 100%; border-radius: 0; border: none; }
@keyframes qtPulse { 50% { opacity: 0.35; } }
@keyframes qtBell { 0% { box-shadow: inset 0 0 0 2px rgba(255, 215, 107, 0.6); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
@media (max-width: 760px) {
    .qt-hint, .qt-where, .qt-sep, .qt-tools [data-act="smaller"], .qt-tools [data-act="bigger"], .qt-tools [data-act="help"] { display: none; }
    .qt-bar { flex-wrap: wrap; }
    .qt-tabs { order: 3; flex-basis: 100%; }
    .qt-find input { width: 120px; }
}
@media (max-width: 760px) {
    .qd-live { grid-template-columns: 1fr; }
}
.qd-users { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 420px) 1fr; }
.qd-list-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.qd-search-row { padding: 14px 14px 8px; }
.qd-search { width: 100%; padding: 10px 14px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.9rem var(--font-ui); outline: none; }
.qd-search:focus { border-color: var(--border-focus); }
.qd-filters, .qd-durs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.qd-pad > .qd-filters { padding: 0 0 14px; }
.qd-durs { padding: 0; }
.qd-chip { padding: 6px 11px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); background: none; color: var(--text-muted); font: 600 0.76rem var(--font-ui); cursor: pointer; }
.qd-chip.on { background: var(--text-main); color: var(--bg-base); border-color: transparent; }
.qd-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.qd-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: none; border-radius: calc(12px * var(--round, 1)); background: none; color: var(--text-main); cursor: pointer; text-align: left; font: 400 0.86rem var(--font-ui); }
.qd-row:hover { background: rgba(var(--ink-rgb),  0.05); }
.qd-row.sel { background: rgba(var(--accent-rgb), 0.09); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.3); }
.qd-row .qs-avatar { position: relative; }
.qd-row.on .qs-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 0 2px var(--glass-strong); }
.qd-row-text { flex: 1; min-width: 0; }
.qd-row-text b { font-weight: 650; }
.qd-row-text small { display: block; color: var(--text-muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qd-handle { color: var(--text-muted); font-size: 0.8rem; }
.qd-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.qd-b { font-style: normal; padding: 2px 7px; border-radius: calc(99px * var(--round, 1)); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(var(--ink-rgb),  0.07); color: var(--text-muted); }
.qd-b.owner { background: rgba(255, 215, 107, 0.18); color: color-mix(in oklab, #ffe39b, #000 var(--tx-dark, 0%)); }
.qd-b.admin { background: rgba(255, 215, 107, 0.1); color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qd-b.ban { background: rgba(255, 63, 120, 0.18); color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }
.qd-b.mute { background: rgba(155, 92, 255, 0.18); color: color-mix(in oklab, #c9a8ff, #000 var(--tx-dark, 0%)); }
.qd-b.rep { background: rgba(255, 157, 92, 0.18); color: color-mix(in oklab, #ffb98a, #000 var(--tx-dark, 0%)); }
.qd-pages { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; color: var(--text-muted); font-size: 0.8rem; }
.qd-empty { padding: 20px; text-align: center; }
.qd-detail { min-height: 0; overflow-y: auto; }
.qd-detail:empty::before { content: "Pick someone on the left."; display: block; padding: 40px; color: var(--text-dim); text-align: center; }
.qd-card { padding: 18px 22px 26px; }
.qd-back { display: none; margin-bottom: 10px; }
.qd-who { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.qd-who h3 { margin: 0 0 2px; font: 700 1.25rem var(--font-display); }
.qd-who .qd-badges { justify-content: flex-start; margin-top: 6px; }
.qd-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 0.86rem; }
.qd-facts dt { color: var(--text-muted); }
.qd-facts dd { margin: 0; }
.qd-locked { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(255, 215, 107, 0.08); border: 1px solid rgba(255, 215, 107, 0.3); color: color-mix(in oklab, #ffe39b, #000 var(--tx-dark, 0%)); font-size: 0.84rem; }
.qd-card h4 { margin: 16px 0 8px; font: 500 0.68rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-soft); }
.qd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qd-mini { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.qd-mini > div { padding: 8px 10px; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.03); border: 1px solid var(--line); }
.qd-mini > div.done { opacity: 0.6; }
.qd-mini span { color: var(--text-muted); }
.qd-report { padding: 14px; margin-bottom: 10px; border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--ink-rgb),  0.03); }
.qd-rep-top { display: flex; gap: 12px; margin-bottom: 10px; font-size: 0.88rem; }
.qd-rep-top small { display: block; color: var(--text-muted); margin-top: 2px; }
.qd-rep-top p { margin: 6px 0 0; color: color-mix(in oklab, #c3cbe6, #000 var(--tx-dark, 0%)); }
.qd-msgq { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); }
.qd-temp { padding: 14px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.45); border: 1px dashed var(--line-strong); font: 700 1.2rem var(--font-mono); letter-spacing: 0.08em; text-align: center; user-select: all; }
.qd-flash { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 10px 16px; border-radius: calc(12px * var(--round, 1)); background: var(--text-main); color: var(--bg-base); font: 600 0.84rem var(--font-ui); box-shadow: 0 10px 30px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1))); z-index: 2; max-width: 90%; }
.qd-flash.out { opacity: 0; transition: opacity 0.3s; }
.qd-until { margin-top: 4px; }
@media (max-width: 860px) {
    .qd-admin { padding: 0; }
    .qd-shell { border-radius: 0; }
    /* icons only (the icons are spans too, so only the labels go) */
    .qd-tabs span:not(.material-symbols-outlined) { display: none; }
    .qd-head { flex-wrap: wrap; row-gap: 8px; padding: 12px 12px 8px 18px; }
    .qd-tabs { order: 3; flex-basis: 100%; justify-content: space-between; scrollbar-width: none; }
    .qd-tabs button { padding: 8px 10px; }
    .qd-x { margin-left: auto; }
    .qd-tabs .material-symbols-outlined { font-size: 1.25rem; }
    .qd-users { grid-template-columns: 1fr; }
    .qd-users.has-sel .qd-list-col { display: none; }
    .qd-users:not(.has-sel) .qd-detail { display: none; }
    .qd-list-col { border-right: none; }
    .qd-back { display: inline-flex; }
}
html[data-fancy="low"] .qd-admin, html[data-fancy="low"] .qs-modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
.qs-modal-card header, .qs-modal-card footer { position: static; inset: auto; width: auto; height: auto; padding: 0; background: none; border: none; transform: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; z-index: auto; }
.qs-modal-card footer { margin-top: 16px; }
.qs-modal-card footer { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 16px 0 0; line-height: normal; }
.qs-modal-card footer span { margin: 0; font-size: inherit; color: inherit; text-decoration: none; }
.qa-ban .qa-go { width: 100%; }

/* ---------- Social panel: tabs, people, profiles (social/party.js) ---------- */
.qs-drawer { width: min(440px, 100vw); }
.qs-me { padding: 0 18px 0 22px; }
.qs-me-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.qs-me-name b { font: 700 1.05rem var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-handle { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.qs-tabs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin: 12px 14px 4px 18px; padding: 4px; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); border: 1px solid var(--line); }
.qs-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border: none; border-radius: calc(10px * var(--round, 1)); background: none; color: var(--text-muted); font: 600 0.7rem var(--font-ui); cursor: pointer; transition: background 0.2s, color 0.2s; }
.qs-tabs button .material-symbols-outlined { font-size: 1.2rem; }
.qs-tabs button:hover { color: var(--text-main); }
.qs-tabs button.on { background: rgba(var(--ink-rgb),  0.1); color: var(--text-main); box-shadow: inset 0 0 0 1px var(--line-strong); }
.qs-tabs button.on .material-symbols-outlined { color: var(--accent-cyan); }
.qs-tab-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: calc(8px * var(--round, 1)); font: 700 0.62rem/16px var(--font-ui); font-style: normal; text-align: center; color: var(--on-accent); background: var(--accent-cyan); }
.qs-tab-badge.alert { background: var(--accent-pink); color: #fff; }
.qs-tab-badge[hidden] { display: none; }
.qs-pane { display: flex; flex-direction: column; gap: 18px; }
.qs-pane[hidden] { display: none !important; }
.qs-empty { text-align: center; padding: 18px 10px; }
.qs-empty .material-symbols-outlined { font-size: 2rem; color: var(--text-dim); }
.qs-loading .material-symbols-outlined { animation: qaSpin 1s linear infinite; vertical-align: -4px; }
.qs-go-people { margin-top: 10px; }
.qs-person { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; border: none; border-radius: calc(14px * var(--round, 1)); background: none; color: var(--text-main); text-align: left; cursor: pointer; transition: background 0.2s; font: inherit; }
.qs-person:hover, .qs-person:focus-visible, .qs-friend:hover { background: rgba(var(--ink-rgb),  0.05); outline: none; }
.qs-person b { display: block; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-person small { display: block; font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-person .qs-btn { padding: 6px 11px; font-size: 0.78rem; }
.qs-person .qs-avatar { position: relative; }
.qs-person.on .qs-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #3dffa8; box-shadow: 0 0 0 2px var(--glass-strong); }
.qs-friend { cursor: pointer; }
.qs-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.05); color: var(--text-muted); font: 600 0.72rem var(--font-ui); white-space: nowrap; }
.qs-tag .material-symbols-outlined { font-size: 0.95rem; }
.qs-pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.08); color: var(--text-muted); font: 700 0.62rem var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase; vertical-align: 2px; }
.qs-pill.gold { background: rgba(255, 215, 107, 0.14); color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qs-pill .material-symbols-outlined { font-size: 0.8rem; }
.qs-people-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); }
.qs-people-search:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qs-people-search .material-symbols-outlined { color: var(--text-muted); }
.qs-scroll .qs-people-search input { border: none; background: none; box-shadow: none; padding: 11px 0; }
.qs-people-note { margin-top: -10px; }
.qs-people-more { align-self: center; }
.qs-flabel { display: flex; flex-direction: column; gap: 4px; flex: 1; font: 500 0.66rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-soft); }
.qs-acct form { display: flex; flex-direction: column; gap: 10px; }
.qs-switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.86rem; }
.qs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.qs-switch-ui { flex: none; position: relative; width: 40px; height: 22px; margin-top: 2px; border-radius: calc(11px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.14); transition: background 0.2s; }
.qs-switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.qs-switch input:checked + .qs-switch-ui { background: var(--accent-cyan); }
.qs-switch input:checked + .qs-switch-ui::after { transform: translateX(18px); }
.qs-switch input:focus-visible + .qs-switch-ui { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35); }
.qs-switch small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; }
.qs-radio-row { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 0.86rem; }
.qs-radio-row label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line); cursor: pointer; }
.qs-radio-row label:has(input:checked) { border-color: var(--border-focus); background: rgba(var(--accent-rgb), 0.06); }
.qs-radio-row input { accent-color: var(--accent-cyan); }
.qs-avatar.xs { width: 22px; height: 22px; font-size: 0.62rem; }
.qs-profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.qs-profile .qs-avatar.xl { width: 96px; height: 96px; font-size: 2.3rem; margin-bottom: 6px; }
.qs-profile h3 { margin: 0; font: 700 1.25rem var(--font-display); }
.qs-profile-status { font-size: 0.82rem; color: var(--text-muted); }
.qs-profile-status.on { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qs-profile-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 8px 0 4px; font-size: 0.76rem; color: var(--text-dim); }
.qs-profile-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.qs-profile-more { display: flex; gap: 18px; justify-content: center; margin-top: 14px; }
.qs-profile-more .qs-link { color: var(--text-muted); }

/* ---------- Chats (social/chat.js) ---------- */
.qc-list-head { display: flex; align-items: center; justify-content: space-between; }
.qc-list-head h3 { margin: 0; }
.qc-conv { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: none; border-radius: calc(14px * var(--round, 1)); background: none; color: var(--text-main); text-align: left; cursor: pointer; font: inherit; }
.qc-conv:hover { background: rgba(var(--ink-rgb),  0.05); }
.qc-conv-top { display: flex; justify-content: space-between; gap: 8px; }
.qc-conv-top b { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-conv time { flex: none; font-size: 0.72rem; color: var(--text-dim); }
.qc-conv small { display: block; font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-conv.unread b, .qc-conv.unread small { color: var(--text-main); font-weight: 700; }
.qc-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: calc(10px * var(--round, 1)); background: var(--accent-pink); color: #fff; font: 700 0.7rem/20px var(--font-ui); font-style: normal; text-align: center; }
.qs-drawer.chatting .qs-scroll { overflow: hidden; padding: 0; }
.qs-drawer.chatting [data-pane="chats"], .qs-drawer.chatting [data-pane="groups"] { height: 100%; gap: 0; }
.qc-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.qc-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); }
.qc-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: none; border-radius: calc(12px * var(--round, 1)); background: none; color: var(--text-main); text-align: left; cursor: pointer; font: inherit; }
.qc-who:hover { background: rgba(var(--ink-rgb),  0.05); }
.qc-who b { display: block; font-size: 0.92rem; }
.qc-who small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.qc-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.qc-older { align-self: center; margin: 4px 0 10px; }
.qc-hello { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 0; text-align: center; }
.qc-hello small { color: var(--text-muted); font-size: 0.8rem; }
.qc-day { display: flex; justify-content: center; margin: 12px 0 6px; }
.qc-day span { padding: 3px 10px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.05); color: var(--text-dim); font: 600 0.7rem var(--font-ui); }
.qc-msg { display: flex; flex-direction: column; max-width: 82%; margin-top: 6px; }
.qc-msg.grouped { margin-top: 1px; }
.qc-msg.mine { align-self: flex-end; align-items: flex-end; }
.qc-msg.theirs { align-self: flex-start; align-items: flex-start; }
.qc-bubble { padding: 8px 12px; border-radius: calc(18px * var(--round, 1)); font-size: 0.9rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.qc-msg.theirs .qc-bubble { background: rgba(var(--ink-rgb),  0.08); border-bottom-left-radius: calc(6px * var(--round, 1)); }
.qc-msg.mine .qc-bubble { background: var(--bubble); color: var(--bubble-text, #fff); border-bottom-right-radius: calc(6px * var(--round, 1)); }
.qc-msg.grouped.theirs .qc-bubble { border-top-left-radius: calc(6px * var(--round, 1)); }
.qc-msg.grouped.mine .qc-bubble { border-top-right-radius: calc(6px * var(--round, 1)); }
.qc-msg.sending .qc-bubble { opacity: 0.6; }
.qc-msg.failed .qc-bubble { background: rgba(255, 63, 120, 0.25); }
.qc-bubble a { color: inherit; text-decoration: underline; }
.qc-meta { display: flex; align-items: center; gap: 6px; padding: 2px 6px 0; font-size: 0.68rem; color: var(--text-dim); }
.qc-msg.grouped .qc-meta time { display: none; }
.qc-msg .qc-meta:has(.qc-st) time { display: inline; }
.qc-st { display: inline-flex; align-items: center; gap: 3px; border: none; background: none; padding: 0; color: var(--text-dim); font: inherit; }
.qc-st .material-symbols-outlined { font-size: 0.85rem; }
.qc-st.seen { color: var(--accent-cyan); }
.qc-st.failed { color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); cursor: pointer; text-decoration: underline; }
.qc-flag { display: none; border: none; background: none; padding: 0; color: var(--text-dim); cursor: pointer; }
.qc-flag .material-symbols-outlined { font-size: 0.85rem; }
.qc-msg:hover .qc-flag, .qc-flag:focus-visible { display: inline-flex; }
@media (hover: none) { .qc-flag { display: inline-flex; } }
.qc-typing { padding: 0 18px 6px; font-size: 0.76rem; color: var(--text-muted); }
.qc-typing[hidden] { display: none; }
.qc-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.qc-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); animation: qcDot 1.2s infinite; }
.qc-dots i:nth-child(2) { animation-delay: 0.15s; }
.qc-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes qcDot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.qc-compose { position: relative; display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px 14px 16px; border-top: 1px solid var(--line); }
.qc-input { flex: 1; min-height: 40px; max-height: 132px; padding: 10px 14px; border-radius: calc(20px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.9rem/1.35 var(--font-ui); outline: none; resize: none; }
.qc-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qc-send { width: 40px; height: 40px; background: var(--text-main); color: var(--bg-base); border-radius: 50%; }
.qc-send:hover { background: #dff9ff; color: var(--bg-base); }
.qc-count { position: absolute; right: 64px; top: -8px; padding: 1px 6px; border-radius: calc(6px * var(--round, 1)); background: var(--glass-strong); font-size: 0.68rem; color: var(--text-muted); }
.qc-count[hidden] { display: none; }
.qc-blocked { flex: 1; display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.04); color: var(--text-muted); font-size: 0.82rem; }
.qc-quote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent-cyan); border-radius: calc(8px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.88rem; max-height: 180px; overflow-y: auto; }
.qc-pick { max-height: 50vh; overflow-y: auto; }

/* ---------- party jam + party chat (social/partychat.js) ---------- */
.qs-party-extra { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.qp-jam-empty { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: calc(14px * var(--round, 1)); border: 1px dashed var(--line-strong); }
.qp-jam-empty > .material-symbols-outlined { color: color-mix(in oklab, #c9a8ff, #000 var(--tx-dark, 0%)); }
.qp-jam-empty div { flex: 1; min-width: 0; font-size: 0.86rem; }
.qp-jam-empty small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.qp-jam-on { padding: 12px; border-radius: calc(16px * var(--round, 1)); background: linear-gradient(140deg, rgba(155, 92, 255, 0.14), rgba(var(--accent-rgb), 0.06)); border: 1px solid rgba(155, 92, 255, 0.35); display: flex; flex-direction: column; gap: 10px; }
.qp-jam-on.listening { box-shadow: 0 0 22px rgba(155, 92, 255, 0.2); }
.qp-jam-top { display: flex; align-items: center; gap: 6px; font-size: 0.86rem; }
.qp-jam-top .material-symbols-outlined { color: color-mix(in oklab, #c9a8ff, #000 var(--tx-dark, 0%)); }
.qp-jam-top small { margin-left: auto; color: var(--text-muted); font-size: 0.74rem; }
.qp-now { display: flex; gap: 10px; align-items: center; }
.qp-now img, .qp-art { flex: none; width: 52px; height: 52px; border-radius: calc(10px * var(--round, 1)); object-fit: cover; background: rgba(0, 0, 0, 0.4); display: grid; place-items: center; }
.qp-now b { display: block; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-now small { display: block; font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-bar { height: 4px; margin: 6px 0 3px; border-radius: calc(2px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.12); overflow: hidden; }
.qp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #9b5cff, var(--accent-cyan)); transition: width 1s linear; }
.qp-ctl { display: flex; align-items: center; gap: 4px; }
.qp-ctl .qs-icon-btn:disabled { opacity: 0.35; cursor: default; }
.qp-play { background: rgba(var(--ink-rgb),  0.9); color: var(--bg-base); border-radius: 50%; }
.qp-play:hover:not(:disabled) { background: #fff; color: var(--bg-base); }
.qp-open { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.qp-open input { accent-color: var(--accent-cyan); }
.qp-search { display: flex; gap: 6px; }
.qp-results { display: flex; flex-direction: column; gap: 2px; }
.qp-res { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: calc(10px * var(--round, 1)); }
.qp-res:hover { background: rgba(var(--ink-rgb),  0.05); }
.qp-res b { display: block; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-res small { display: block; font-size: 0.72rem; color: var(--text-muted); }
.qp-stop { align-self: flex-start; color: var(--text-muted); }
.qp-chat h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 500 0.66rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-soft); }
.qp-chat h4 .material-symbols-outlined { font-size: 1rem; }
.qp-msgs { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.25); overscroll-behavior: contain; }
.qp-sys { text-align: center; font-size: 0.72rem; color: var(--text-dim); padding: 2px 6px; }
.qp-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; }
.qp-msg.mine { padding-left: 30px; }
.qp-msg b { font-size: 0.78rem; }
.qp-msg time { font-size: 0.66rem; color: var(--text-dim); }
.qp-msg p { margin: 1px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
.qp-msg.sending { opacity: 0.6; }
.qp-msg.failed p { color: color-mix(in oklab, #ff8fab, #000 var(--tx-dark, 0%)); }
.qp-send { display: flex; gap: 6px; margin-top: 8px; }
.qs-scroll .qp-send input, .qs-scroll .qp-search input { padding: 8px 12px; font-size: 0.85rem; }
@media (max-width: 480px) {
    .qs-tabs { margin: 10px 10px 4px; }
    .qs-tabs button span:not(.material-symbols-outlined) { font-size: 0.62rem; }
    .qc-msg { max-width: 88%; }
}

/* ---------- the tutorial (social/tour.js) ---------- */
.qt-root { position: fixed; inset: 0; z-index: 2600; text-align: left; pointer-events: none; }
.qt-root.out { animation: qsFade 0.25s ease reverse both; }
.qt-block { position: fixed; pointer-events: auto; background: color-mix(in oklab, rgba(1, 2, 8, 0.74), rgba(255, 255, 255, 0.74) var(--bg-light, 0%)); transition: all 0.35s var(--ease); }
.qt-hole { position: fixed; border-radius: calc(16px * var(--round, 1)); pointer-events: none; box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.9), 0 0 30px 4px rgba(var(--accent-rgb), 0.45); transition: left 0.35s var(--ease), top 0.35s var(--ease), width 0.35s var(--ease), height 0.35s var(--ease), opacity 0.3s; animation: qtGlow 2.4s ease-in-out infinite; }
@keyframes qtGlow { 50% { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.9), 0 0 44px 10px rgba(var(--accent-rgb), 0.35); } }
.qt-card {
    position: fixed; pointer-events: auto; width: min(400px, calc(100vw - 20px)); max-height: calc(100vh - 20px); overflow-y: auto; padding: 18px 20px 16px; border-radius: calc(22px * var(--round, 1));
    background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); transition: left 0.35s var(--ease), top 0.35s var(--ease);
}
.qt-card::before { content: ""; position: absolute; left: 30px; right: 30px; top: -1px; height: 2px; border-radius: calc(2px * var(--round, 1)); background: var(--grad-accent); box-shadow: 0 0 14px var(--accent-cyan); }
.qt-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 20px)); }
.qt-card.in { animation: qsCardIn 0.35s var(--ease) both; }
.qt-card.center.in { animation: qsCardInCenter 0.4s var(--ease) both; }
.qt-card.nudge { animation: qtNudge 0.4s ease; }
.qt-card.center.nudge { animation: qtNudgeC 0.4s ease; }
@keyframes qtNudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes qtNudgeC { 25% { transform: translate(calc(-50% - 6px), -50%); } 75% { transform: translate(calc(-50% + 6px), -50%); } }
.qt-card.did .qt-do { border-color: rgba(61, 255, 168, 0.6); background: rgba(61, 255, 168, 0.1); color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qt-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qt-top > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.4rem; }
.qt-step { flex: 1; font: 500 0.66rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }
.qt-progress { height: 3px; border-radius: calc(2px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.08); overflow: hidden; margin-bottom: 12px; }
.qt-progress i { display: block; height: 100%; background: var(--grad-accent); transition: width 0.4s var(--ease); }
.qt-card h3 { margin: 0 0 8px; font: 700 1.12rem var(--font-display); letter-spacing: 0.02em; }
.qt-text { color: color-mix(in oklab, #c3cbe6, #000 var(--tx-dark, 0%)); font-size: 0.88rem; line-height: 1.55; }
.qt-text p { margin: 8px 0 0; }
.qt-text b { color: var(--text-main); }
.qt-text mark, .qs-tour-card mark { background: rgba(var(--accent-rgb, 255, 213, 74), 0.35); color: var(--text-main); padding: 0 0.2em; border-radius: 0.25em; font-weight: 600; }
.qt-text kbd, .qt-do kbd { padding: 1px 6px; border-radius: calc(5px * var(--round, 1)); border: 1px solid var(--line-strong); font: 600 0.76rem var(--font-mono); }
.qt-acct { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); border: 1px solid var(--line); }
.qt-acct dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 0.8rem; }
.qt-acct dt { color: var(--text-muted); }
.qt-acct dd { margin: 0; font-weight: 650; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; }
.qt-do { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.07); font-size: 0.86rem; color: var(--text-main); transition: all 0.3s; }
.qt-do .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.15rem; }
.qt-practice { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border-radius: calc(14px * var(--round, 1)); border: 1px dashed rgba(155, 92, 255, 0.55); background: rgba(155, 92, 255, 0.08); }
.qt-practice b { display: block; font-size: 0.88rem; }
.qt-practice small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.qt-chat { margin-top: 12px; padding: 10px; border-radius: calc(14px * var(--round, 1)); border: 1px dashed rgba(155, 92, 255, 0.55); background: rgba(155, 92, 255, 0.08); }
.qt-chat-log { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.qt-chat-log > .qs-avatar { margin-bottom: -4px; }
.qt-bub { padding: 7px 11px; border-radius: calc(16px * var(--round, 1)); border-bottom-left-radius: calc(5px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.09); font-size: 0.86rem; max-width: 85%; overflow-wrap: anywhere; animation: qsCardIn 0.3s var(--ease) both; }
.qt-bub.mine { align-self: flex-end; border-radius: calc(16px * var(--round, 1)); border-bottom-right-radius: calc(5px * var(--round, 1)); background: var(--bubble); color: var(--bubble-text, #fff); }
.qt-chat-form { display: flex; gap: 6px; }
.qt-chat-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: calc(18px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: 500 0.88rem var(--font-ui); outline: none; }
.qt-chat-form input:focus { border-color: var(--border-focus); }
.qt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.qt-help { font-size: 0.8rem; }
.qt-help[hidden] { display: none; }
html[data-fancy="low"] .qt-block, html[data-fancy="low"] .qt-hole, html[data-fancy="low"] .qt-card { transition: none; animation: none; }
@media (max-width: 480px) { .qt-card { padding: 16px 16px 14px; } .qt-text { font-size: 0.84rem; } }
.qt-test { padding: 1px 6px; margin-right: 4px; border-radius: calc(5px * var(--round, 1)); background: #e0a21b; color: #1a1200; letter-spacing: 0.1em; }

/* ---------- the tutorial editor (social/tour-editor.js, the admin panel's Tutorial tab) ---------- */
.qe { flex: 1; min-height: 0; display: flex; flex-direction: column; font-size: 0.86rem; }
.qe-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.qe-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; color: var(--text-muted); font-size: 0.8rem; }
.qe-state .material-symbols-outlined { font-size: 1.05rem; vertical-align: -3px; }
.qe-what b { color: var(--text-main); }
.qe-live { font: 500 0.72rem var(--font-mono); letter-spacing: 0.04em; }
.qe-save { display: inline-flex; align-items: center; gap: 4px; }
.qe-save[data-s="saved"] { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qe-save[data-s="error"] { color: #ff6b81; }
.qe-note { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--text-muted); }
.qe-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; }
.qe-side, .qe-pal { overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); }
.qe-pal { border-right: none; border-left: 1px solid var(--line); }
.qe-side-h { margin: 6px 4px 8px; font: 700 0.7rem var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.qe-side-h small { display: block; margin-top: 2px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; opacity: 0.8; }
.qe-side-h:not(:first-child) { margin-top: 18px; }
.qe-tip { margin: 6px 4px; font-size: 0.74rem; line-height: 1.45; color: var(--text-muted); }
.qe-tip code, .qe-sec-meta code { font: 0.72rem var(--font-mono); }
.qe-secs { display: flex; flex-direction: column; gap: 4px; }
.qe-sec { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 8px 8px 4px; border-radius: calc(12px * var(--round, 1)); border: 1px solid transparent; background: none; color: var(--text-main); font: 600 0.84rem var(--font-ui); text-align: left; cursor: pointer; }
.qe-sec:hover { background: rgba(var(--ink-rgb), 0.05); }
.qe-sec.on { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.4); }
.qe-sec.drop { border-color: var(--accent-cyan); border-style: dashed; background: rgba(var(--accent-rgb), 0.08); }
.qe-sec > .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.15rem; }
.qe-sec-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qe-sec-t small { display: block; font: 500 0.7rem var(--font-ui); color: var(--text-muted); }
.qe-fin { margin-top: 6px; padding-left: 12px; border: 1px dashed var(--line-strong); }
.qe-grip { display: inline-flex; flex: none; color: var(--text-muted); cursor: grab; touch-action: none; }
.qe-grip .material-symbols-outlined { font-size: 1.15rem; }
.qe-mark { flex: none; padding: 1px 6px; border-radius: calc(99px * var(--round, 1)); font: 700 0.62rem var(--font-ui); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; }
.qe-mark.new { background: rgba(61, 255, 168, 0.16); color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qe-mark.ch { background: rgba(224, 162, 27, 0.18); color: color-mix(in oklab, #ffc94d, #000 var(--tx-dark, 0%)); }
.qe-mark.live { background: rgba(var(--accent-rgb), 0.16); color: var(--accent-cyan); }
.qe-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 9px; border-radius: calc(12px * var(--round, 1)); border: 1px dashed var(--line-strong); background: none; color: var(--text-muted); font: 600 0.8rem var(--font-ui); cursor: pointer; }
.qe-add:hover { color: var(--text-main); border-color: var(--accent-cyan); }
.qe-add.sm { width: auto; margin: 0; padding: 5px 10px; }
.qe-wide { width: 100%; justify-content: center; }
.qe-edit { overflow-y: auto; padding: 16px 20px 40px; }
.qe-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.qe-sec-title { display: flex; gap: 10px; align-items: flex-start; flex: 1; }
.qe-sec-title h3 { margin: 0; font: 700 1.05rem var(--font-display); }
.qe-sec-title > .material-symbols-outlined { color: var(--accent-cyan); }
.qe-sec-acts { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.qe-sec-meta { flex-basis: 100%; margin: 0; }
.qe-icon-in, .qe-ic { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.qe-icon-in > .material-symbols-outlined { font-size: 1.6rem; color: var(--accent-cyan); }
.qe-icon-in input { width: 120px; }
.qe-in { min-width: 0; padding: 6px 9px; border-radius: calc(8px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.45); color: var(--text-main); font: 500 0.84rem var(--font-ui); outline: none; }
.qe-in:focus { border-color: var(--border-focus); }
textarea.qe-in { resize: vertical; line-height: 1.45; }
.qe-sec-name { flex: 1; min-width: 160px; font: 700 1rem var(--font-display); padding: 7px 10px; }
.qe-sel { padding-right: 4px; max-width: 100%; }
.qe-num-in { width: 60px; }
.qe-ic-in { width: 112px; font: 0.76rem var(--font-mono); }
.qe-css { width: 190px; font: 0.76rem var(--font-mono); }
.qe-grow { flex: 1; min-width: 140px; }
.qe-row { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, 0.85); font-size: 0.78rem; }
.qe-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.qe-steps { display: flex; flex-direction: column; gap: 12px; }
.qe-empty { text-align: center; padding: 20px; }
.qe-step { border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.25); padding: 10px 12px 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.qe-step.cur { border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.qe-step > header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qe-step > header .qs-icon-btn { width: 30px; height: 30px; }
.qe-num { flex: none; font: 600 0.66rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.qe-prev { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 650; }
.qe-prev span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-prev .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.1rem; }
.qe-blocks { display: flex; flex-direction: column; gap: 6px; min-height: 30px; }
.qe-drop-here { margin: 0; padding: 10px; border-radius: calc(10px * var(--round, 1)); border: 1px dashed var(--line-strong); color: var(--text-muted); text-align: center; font-size: 0.78rem; }
/* a block: a coloured piece with a little tab on top, like a puzzle piece */
.qe-b { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px 7px 6px; border-radius: calc(10px * var(--round, 1)); background: color-mix(in oklab, var(--c) 78%, #0b0f1a); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22); }
.qe-b::before { content: ""; position: absolute; left: 22px; top: -4px; width: 18px; height: 5px; border-radius: 4px 4px 0 0; background: inherit; }
.qe-b-grip { padding: 5px 3px; color: rgba(255, 255, 255, 0.9); }
.qe-b-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.qe-b-name { flex: none; font: 700 0.78rem var(--font-ui); letter-spacing: 0.02em; }
.qe-b .qe-in { background: rgba(255, 255, 255, 0.94); color: #10131c; border-color: transparent; }
.qe-b .qe-in:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.qe-b select.qe-in option { color: #10131c; }
.qe-b .qe-ic > .material-symbols-outlined { font-size: 1.2rem; }
.qe-b[data-t="say"] .qe-b-body { align-items: flex-start; }
.qe-b[data-t="say"] .qe-b-name { padding-top: 6px; }
.qe-hint { font-size: 0.78rem; opacity: 0.88; }
.qe-b-x { flex: none; display: inline-flex; padding: 4px; border: none; border-radius: 6px; background: none; color: rgba(255, 255, 255, 0.75); cursor: pointer; }
.qe-b-x:hover { background: rgba(0, 0, 0, 0.2); color: #fff; }
.qe-b-x .material-symbols-outlined { font-size: 1rem; }
.qe-targets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.qe-target { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 4px 3px 9px; border-radius: calc(99px * var(--round, 1)); background: rgba(0, 0, 0, 0.28); font-size: 0.78rem; font-weight: 600; }
.qe-target code { font: 0.72rem var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-target button { display: inline-flex; padding: 1px; border: none; background: none; color: inherit; cursor: pointer; opacity: 0.8; }
.qe-target button .material-symbols-outlined { font-size: 0.95rem; }
.qe-mini { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: calc(99px * var(--round, 1)); border: none; background: #fff; color: #3a2a7a; font: 700 0.76rem var(--font-ui); cursor: pointer; }
.qe-mini .material-symbols-outlined { font-size: 1rem; }
.qe-step-foot { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 8px; }
.qe-warn { flex: 1; min-width: 200px; margin: 0; padding: 0; list-style: none; }
.qe-warn li { display: flex; gap: 5px; align-items: flex-start; font-size: 0.74rem; color: color-mix(in oklab, #ffc94d, #000 var(--tx-dark, 0%)); }
.qe-warn .material-symbols-outlined { font-size: 0.95rem; }
.qe-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 3; width: min(320px, 80vw); max-height: 340px; overflow-y: auto; padding: 8px; border-radius: calc(14px * var(--round, 1)); background: color-mix(in oklab, var(--bg-base) 96%, var(--text-main)); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); animation: qsCardIn 0.2s var(--ease) both; }
.qe-menu > small { display: block; margin: 6px 6px 4px; font: 700 0.66rem var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; }
.qe-menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 7px 8px; border: none; border-radius: calc(10px * var(--round, 1)); background: none; color: var(--text-main); text-align: left; cursor: pointer; }
.qe-menu button:hover:not(:disabled) { background: rgba(var(--ink-rgb), 0.07); }
.qe-menu button:disabled { opacity: 0.4; cursor: default; }
.qe-menu button > .material-symbols-outlined { flex: none; padding: 4px; border-radius: 8px; background: var(--c); color: #fff; font-size: 1.05rem; }
.qe-menu b { display: block; font-size: 0.84rem; }
.qe-menu button small { display: block; font-size: 0.72rem; color: var(--text-muted); }
.qe-pal-cat { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.qe-pal-cat > small { margin: 0 4px; font: 700 0.66rem var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; }
.qe-pb { position: relative; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: none; border-radius: calc(10px * var(--round, 1)); background: color-mix(in oklab, var(--c) 78%, #0b0f1a); color: #fff; font: 700 0.78rem var(--font-ui); text-align: left; cursor: grab; touch-action: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22); transition: transform 0.15s; }
.qe-pb::before { content: ""; position: absolute; left: 16px; top: -4px; width: 16px; height: 5px; border-radius: 4px 4px 0 0; background: inherit; }
.qe-pb:hover { transform: translateX(3px); }
.qe-pb .material-symbols-outlined { font-size: 1.05rem; }
.qe-ghost { position: fixed; z-index: 9000; pointer-events: none; opacity: 0.92; transform: rotate(-1.5deg); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.qe-dragging { opacity: 0.3; }
.qe-is-dragging, .qe-is-dragging * { user-select: none; -webkit-user-select: none; cursor: grabbing !important; }
.qe-ph { flex: none; border-radius: calc(10px * var(--round, 1)); border: 2px dashed var(--accent-cyan); background: rgba(var(--accent-rgb), 0.08); }
.qe-ph-block { height: 34px; }
.qe-ph-step { height: 60px; }
.qe-ph-section { height: 40px; }
.qe-vers { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.qe-ver { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line); }
.qe-ver small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.qe-ver p { margin: 4px 0 0; font-size: 0.8rem; }
.qe-pub-h { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; font-size: 0.86rem; }
.qe-pub { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.qe-pub li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.05); font-size: 0.84rem; }
.qe-pub li .qe-check { width: 100%; }
.qe-pub-t { flex: 1; min-width: 0; }
.qs-modal .qe-pub input[type="checkbox"] { flex: none; width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--accent-cyan); }
.qe-pub-again { white-space: nowrap; font-size: 0.78rem; color: var(--text-muted); }
.qe-pub-warn { display: flex; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(224, 162, 27, 0.12); border: 1px solid rgba(224, 162, 27, 0.4); font-size: 0.8rem; }
.qe-pub-warn p { margin: 3px 0 0; color: var(--text-muted); }
.qe-pub-note { margin-top: 14px; }
/* picking something on the page */
.qe-picker { position: fixed; inset: 0; z-index: 9500; pointer-events: none; }
.qe-pk-box { position: fixed; opacity: 0; border-radius: 8px; border: 2px solid #ffc94d; background: rgba(255, 201, 77, 0.12); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25); transition: all 0.12s ease; }
.qe-pk-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); pointer-events: auto; padding: 12px 14px; border-radius: calc(16px * var(--round, 1)); background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); text-align: left; }
.qe-pk-what { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.86rem; overflow: hidden; }
.qe-pk-what .material-symbols-outlined { color: #ffc94d; }
.qe-pk-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qe-pk-what code { font: 0.76rem var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-pk-btns { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1100px) {
    .qe-main { grid-template-columns: 220px minmax(0, 1fr); }
    .qe-pal { display: none; }
}
@media (max-width: 860px) {
    .qe-bar { padding: 8px 12px; }
    .qe-bar .qs-btn span:not(.material-symbols-outlined) { display: none; }
    .qe-main { display: flex; flex-direction: column; overflow-y: auto; }
    .qe-side { border-right: none; border-bottom: 1px solid var(--line); overflow: visible; }
    .qe-secs { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .qe-sec { width: auto; flex: none; max-width: 220px; }
    .qe-side > .qe-side-h:not(:first-child), .qe-side > .qe-tip { display: none; }
    .qe-edit { overflow: visible; padding: 14px 12px 40px; }
    .qe-sec-acts { margin-left: 0; }
    .qe-css { width: 100%; }
}

/* ---------- global chat (social/global.js) ---------- */
.qs-drawer[data-tab="global"] .qs-scroll { overflow: hidden; padding: 0; }
.qs-drawer [data-pane="global"] { height: 100%; gap: 0; }
.qg-head { padding: 10px 12px 10px 18px; }
.qg-head b { display: block; font-size: 0.95rem; }
.qg-head small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.qg-globe { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, rgba(15, 211, 230, 0.25), rgba(107, 92, 255, 0.25)); border: 1px solid var(--line-strong); color: var(--accent-cyan); }
.qg-globe .material-symbols-outlined { font-size: 1.2rem; }
.qg-globe.big { width: 64px; height: 64px; margin-bottom: 4px; }
.qg-globe.big .material-symbols-outlined { font-size: 2.1rem; }
.qg-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; margin-top: 10px; }
.qg-msg.grouped { margin-top: 2px; }
.qg-msg.mine { align-self: flex-end; flex-direction: row-reverse; max-width: 82%; }
.qg-msg.theirs { align-self: flex-start; }
.qg-pic { flex: none; padding: 0; border: none; background: none; cursor: pointer; border-radius: 50%; }
.qg-gap { flex: none; width: 30px; }
.qg-body { display: flex; flex-direction: column; min-width: 0; }
.qg-msg.mine .qg-body { align-items: flex-end; }
.qg-name { display: flex; align-items: baseline; gap: 5px; padding: 0 6px 2px; border: none; background: none; color: var(--text-main); font: inherit; cursor: pointer; text-align: left; max-width: 100%; }
.qg-name b { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qg-name small { font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qg-name:hover b { text-decoration: underline; }
.qg-admin { align-self: center; display: inline-flex; color: var(--accent-cyan); }
.qg-admin .material-symbols-outlined { font-size: 0.9rem; }
.qg-msg.theirs .qc-bubble { background: rgba(var(--ink-rgb),  0.08); border-top-left-radius: calc(6px * var(--round, 1)); }
.qg-msg.mine .qc-bubble { background: var(--bubble); color: var(--bubble-text, #fff); border-bottom-right-radius: calc(6px * var(--round, 1)); }
.qg-msg.grouped.mine .qc-bubble { border-top-right-radius: calc(6px * var(--round, 1)); }
.qg-msg.ping .qc-bubble { box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.55); background: rgba(255, 196, 0, 0.12); }
.qg-msg.sending .qc-bubble { opacity: 0.6; }
.qg-msg.failed .qc-bubble { background: rgba(255, 63, 120, 0.25); }
.qg-msg .qc-meta time { display: inline; }
.qg-msg.grouped .qc-meta time { display: none; }
.qg-msg:hover .qc-meta time { display: inline; }
.qg-msg:hover .qc-flag, .qg-msg .qc-flag:focus-visible { display: inline-flex; }
.qg-at { font-weight: 700; color: var(--accent-soft); }
.qg-msg.mine .qg-at { color: #fff; text-decoration: underline; }
.qg-at.me { color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
@media (max-width: 480px) { .qs-tabs button { padding: 7px 0 6px; } .qs-tab-badge { right: 2px; } }


/* ---------- announcements from the admins (social/announce.js) ---------- */
.qn-announce { position: fixed; z-index: 2500; top: 76px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 12px 14px 16px; border-radius: calc(20px * var(--round, 1)); background: color-mix(in oklab, rgba(12, 14, 28, 0.94), rgba(255, 255, 255, 0.94) var(--bg-light, 0%)); border: 1px solid rgba(255, 196, 0, 0.45); box-shadow: var(--shadow-float), 0 0 30px rgba(255, 196, 0, 0.15); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); animation: qnIn 0.45s var(--ease) both; text-align: left; }
.qn-announce.out { animation: qnOut 0.3s ease both; }
@keyframes qnIn { from { opacity: 0; transform: translate(-50%, -24px); } }
@keyframes qnOut { to { opacity: 0; transform: translate(-50%, -24px); } }
.qn-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 196, 0, 0.14); color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
.qn-body { flex: 1; min-width: 0; }
.qn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.78rem; color: var(--text-muted); }
.qn-top b { font: 700 0.72rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
.qn-top span { display: inline-flex; align-items: center; gap: 5px; }
.qn-body p { margin: 6px 0 0; font-size: 0.95rem; line-height: 1.45; color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.qn-body a { color: var(--accent-soft); }
.qn-x { flex: none; }
html[data-fancy="low"] .qn-announce { animation: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.qd-ann { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 14px; border-radius: calc(16px * var(--round, 1)); margin-bottom: 14px; background: rgba(255, 196, 0, 0.06); border: 1px solid rgba(255, 196, 0, 0.3); font-size: 0.86rem; }
.qd-ann > .material-symbols-outlined { color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
.qd-ann > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.qd-ann p { margin: 4px 0 0; color: var(--text-muted); }
.qd-ann-text { width: 100%; min-height: 70px; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.88rem/1.4 var(--font-ui); resize: vertical; box-sizing: border-box; }
.qd-ann-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qd-ann-row select { margin-left: 6px; padding: 6px 8px; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.4); color: var(--text-main); font: inherit; }
.qd-ann-now { padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); border: 1px solid var(--line); }
.qd-ann-now small { color: color-mix(in oklab, #ffd34d, #000 var(--tx-dark, 0%)); }
.qd-ann-now p { color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 8px; }
@media (max-width: 600px) { .qn-announce { top: 64px; } }

/* ---------------------------------------------------------------- GIFs (gifs.js) */
.qx-gif-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; }
.qx-gif-btn b { font: 800 0.68rem/1 var(--font-ui); letter-spacing: 0.04em; padding: 3px 4px; border: 1.5px solid currentColor; border-radius: calc(5px * var(--round, 1)); }
.qx-gif-btn[hidden] { display: none; }
.qp-send .qx-gif-btn { width: 36px; height: 36px; }
.qc-bubble.gif { white-space: normal; line-height: 0; padding: 0; background: none !important; box-shadow: none !important; border-radius: calc(12px * var(--round, 1)); overflow: visible; }
.qx-gif { position: relative; display: block; max-width: 100%; border-radius: calc(12px * var(--round, 1)); overflow: hidden; background: rgba(var(--ink-rgb),  0.06); }
.qx-gif img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qc-msg.mine .qx-gif, .qg-msg.mine .qx-gif { margin-left: auto; }
.qp-gif { margin: 4px 0 0; }
.qd-msgq .qx-gif { display: inline-block; vertical-align: middle; }
.qc-quote .qx-gif .qx-fav { display: none; }
/* The star: shows when you hover a GIF; always there (smaller and dimmer) on touch screens. */
.qx-fav { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(var(--shade-rgb), 0.6); color: #fff; cursor: pointer; opacity: 0; transform: scale(0.85); transition: opacity 0.15s, transform 0.15s; -webkit-tap-highlight-color: transparent; }
.qx-fav .material-symbols-outlined { font-size: 19px; }
.qx-fav.on { color: color-mix(in oklab, #ffc400, #000 var(--tx-dark, 0%)); }
.qx-fav.on .material-symbols-outlined { font-variation-settings: "FILL" 1; }
.qx-gif:hover .qx-fav, .qx-item:hover .qx-fav, .qx-fav:focus-visible, .qx-fav.on { opacity: 1; transform: none; }
@media (hover: none) { .qx-fav { opacity: 0.85; transform: none; width: 34px; height: 34px; } }
.qx-flash { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10060; padding: 8px 14px; border-radius: calc(999px * var(--round, 1)); background: color-mix(in oklab, rgba(12, 14, 28, 0.94), rgba(255, 255, 255, 0.94) var(--bg-light, 0%)); border: 1px solid var(--line-strong); color: var(--text-main); font: 600 0.82rem var(--font-ui); pointer-events: none; transition: opacity 0.3s; }
.qx-flash.out { opacity: 0; }

.qx-picker { position: fixed; z-index: 10050; display: flex; flex-direction: column; border-radius: calc(16px * var(--round, 1)); background: color-mix(in oklab, rgba(12, 14, 28, 0.97), rgba(255, 255, 255, 0.97) var(--bg-light, 0%)); border: 1px solid var(--line-strong); box-shadow: 0 18px 50px rgba(0, 0, 0, calc(0.55 * var(--shadow-k, 1))); overflow: hidden; animation: qxIn 0.16s ease-out; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.qx-picker.sheet { border-radius: calc(18px * var(--round, 1)) calc(18px * var(--round, 1)) 0 0; padding-bottom: env(safe-area-inset-bottom); }
.qx-picker.out { opacity: 0; transition: opacity 0.15s; }
@keyframes qxIn { from { opacity: 0; transform: translateY(8px); } }
.qx-top { display: flex; gap: 6px; align-items: center; padding: 10px 10px 6px; }
.qx-search { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 40px; border-radius: calc(20px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-muted); }
.qx-search:focus-within { border-color: var(--border-focus); }
.qx-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text-main); font: 500 16px var(--font-ui); outline: none; padding: 0; }
.qx-tabs { display: flex; gap: 4px; padding: 0 10px 8px; }
.qx-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; border: 1px solid transparent; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.04); color: var(--text-muted); font: 600 0.78rem var(--font-ui); cursor: pointer; }
.qx-tabs button .material-symbols-outlined { font-size: 17px; }
.qx-tabs button.on { color: var(--text-main); background: rgba(var(--ink-rgb),  0.1); border-color: var(--line-strong); }
.qx-grid { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 0 10px 10px; }
.qx-col { width: calc(50% - 3px); display: flex; flex-direction: column; gap: 6px; }
.qx-item { position: relative; border-radius: calc(10px * var(--round, 1)); overflow: hidden; background: rgba(var(--ink-rgb),  0.06); cursor: pointer; outline: none; }
.qx-item:focus-visible { box-shadow: 0 0 0 2px var(--accent-cyan); }
.qx-item img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qx-item:active { transform: scale(0.97); }
.qx-empty { width: 100%; margin: 24px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 0 14px; }
.qx-foot { padding: 6px 12px 8px; font-size: 0.66rem; color: var(--text-muted); text-align: center; border-top: 1px solid var(--line); }

/* Touch screens (iPad, phones): 16px text in chat boxes (smaller makes iPhone Safari zoom in when you tap them),
   and heights that fit what's actually visible above Safari's toolbar. */
@media (hover: none) {
    .qc-input, .qs-scroll .qp-send input, .qs-scroll .qp-search input { font-size: 16px; }
    .qc-flag { display: inline-flex; opacity: 0.7; } /* report and delete: hover-only on computers */
}
@supports (height: 100dvh) {
    .qs-modal-card { max-height: calc(100dvh - 32px); }
}

/* ---------- replies, reactions and search in every chat (social/msgx.js) ---------- */
.qc-compose { flex-wrap: wrap; }
.mx-replyslot { flex-basis: 100%; }
.mx-replyslot:empty { display: none; }
.mx-replybar { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--accent-rgb), 0.06); border-left: 3px solid var(--accent-cyan); font-size: 0.78rem; color: var(--text-muted); animation: qsFade 0.18s ease both; }
.mx-replybar > .material-symbols-outlined { font-size: 1.05rem; color: var(--accent-cyan); }
.mx-replybar b { color: var(--text-main); }
.mx-replybar small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--text-dim); font-size: 0.74rem; }
.mx-replybar .qs-grow { min-width: 0; }
.qp-chat .mx-replyslot { margin-top: 8px; }

.mx-quote { display: flex; align-items: center; gap: 5px; max-width: 100%; margin: 2px 0 3px; padding: 3px 9px 3px 6px; border: none; border-left: 2px solid rgba(168, 243, 255, 0.55); border-radius: calc(8px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.05); color: var(--text-muted); font: 500 0.74rem/1.3 var(--font-ui); text-align: left; cursor: pointer; }
.mx-quote:hover { background: rgba(var(--ink-rgb),  0.09); color: var(--text-main); }
.mx-quote .material-symbols-outlined { flex: none; font-size: 0.85rem; transform: scaleX(-1); opacity: 0.7; }
.mx-quote span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-quote b { color: var(--accent-soft); font-weight: 600; }

.mx-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 2px 0; }
.mx-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 8px; border-radius: calc(99px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb),  0.05); color: var(--text-main); font: 600 0.74rem var(--font-ui); cursor: pointer; transition: transform 0.15s, background 0.15s; }
.mx-chip b { font-weight: 600; color: var(--text-muted); }
.mx-chip.on { border-color: rgba(var(--accent-rgb), 0.6); background: rgba(var(--accent-rgb), 0.14); }
.mx-chip.on b { color: var(--accent-soft); }
.mx-chip:active { transform: scale(0.92); }

/* hover tools (computers): React and Reply at the bubble's top corner */
.qc-msg, .qg-body, .qp-msg > div { position: relative; }
.mx-tools { display: none; position: absolute; top: -14px; z-index: 2; gap: 2px; padding: 2px; border-radius: calc(10px * var(--round, 1)); background: color-mix(in oklab, rgba(16, 18, 34, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(0, 0, 0, calc(0.4 * var(--shadow-k, 1))); }
.mx-tools button { display: grid; place-items: center; width: 28px; height: 26px; border: none; border-radius: calc(8px * var(--round, 1)); background: none; color: var(--text-muted); cursor: pointer; }
.mx-tools button:hover { background: rgba(var(--ink-rgb),  0.1); color: var(--text-main); }
.mx-tools .material-symbols-outlined { font-size: 1.05rem; }
.qc-msg.theirs .mx-tools, .qg-msg.theirs .mx-tools, .qp-msg .mx-tools { right: -6px; }
.qc-msg.mine .mx-tools, .qg-msg.mine .mx-tools { left: -6px; }
@media (hover: hover) and (pointer: fine) {
    .qc-msg:hover > .mx-tools, .qg-msg:hover .mx-tools, .qp-msg:hover .mx-tools, .mx-tools:focus-within { display: flex; }
}

/* touch: hold for the menu, swipe right to reply */
@media (hover: none) {
    [data-mx-msg] .qc-bubble, .qp-msg[data-mx-msg] p { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
    [data-mx-msg] { touch-action: pan-y; }
}
[data-mx-msg].mx-held .qc-bubble, .qp-msg.mx-held p { filter: brightness(1.35); transition: filter 0.15s; }
[data-mx-msg].mx-swipe-ready .qc-bubble { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.5); }
[data-mx-msg].mx-flash .qc-bubble, .qp-msg.mx-flash { animation: mxFlash 1.6s ease; }
@keyframes mxFlash { 0%, 40% { box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.8); } 100% { box-shadow: 0 0 0 3px rgba(255, 211, 77, 0); } }
.qp-msg { border-radius: calc(10px * var(--round, 1)); }

.mx-pop { position: fixed; z-index: 3000; display: flex; gap: 2px; padding: 5px; border-radius: calc(99px * var(--round, 1)); background: color-mix(in oklab, rgba(16, 18, 34, 0.97), rgba(255, 255, 255, 0.97) var(--bg-light, 0%)); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1))); animation: qsFade 0.15s ease both; }
.mx-pop button { width: 36px; height: 36px; border: none; border-radius: 50%; background: none; font-size: 1.3rem; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.mx-pop button:hover { background: rgba(var(--ink-rgb),  0.1); transform: scale(1.18); }

.mx-sheet-wrap { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; background: rgba(var(--shade-rgb), 0); transition: background 0.2s; }
.mx-sheet-wrap.open { background: rgba(var(--shade-rgb), 0.5); }
.mx-sheet { width: min(480px, 100%); max-height: 80vh; overflow-y: auto; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); border-radius: calc(22px * var(--round, 1)) calc(22px * var(--round, 1)) 0 0; background: color-mix(in oklab, rgba(14, 16, 30, 0.98), rgba(255, 255, 255, 0.98) var(--bg-light, 0%)); border: 1px solid var(--line-strong); border-bottom: none; transform: translateY(100%); transition: transform 0.22s var(--ease); text-align: left; }
.mx-sheet-wrap.open .mx-sheet { transform: none; }
.mx-sheet-msg { max-height: 120px; overflow: hidden; padding: 10px 12px; margin-bottom: 12px; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.05); font-size: 0.86rem; line-height: 1.4; color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; }
.mx-sheet-reacts { display: flex; justify-content: space-between; gap: 4px; padding: 6px; margin-bottom: 10px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.05); }
.mx-sheet-reacts button { flex: 1; height: 48px; border: none; border-radius: 50%; background: none; font-size: 1.6rem; cursor: pointer; }
.mx-sheet-reacts button:active { transform: scale(1.2); background: rgba(var(--ink-rgb),  0.08); }
.mx-sheet-acts { display: flex; flex-direction: column; border-radius: calc(14px * var(--round, 1)); overflow: hidden; background: rgba(var(--ink-rgb),  0.04); }
.mx-sheet-acts button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; border: none; border-bottom: 1px solid var(--line); background: none; color: var(--text-main); font: 500 0.95rem var(--font-ui); text-align: left; cursor: pointer; }
.mx-sheet-acts button:last-child { border-bottom: none; }
.mx-sheet-acts button.danger { color: color-mix(in oklab, #ff7a9c, #000 var(--tx-dark, 0%)); }
.mx-sheet-acts button:active { background: rgba(var(--ink-rgb),  0.08); }
.mx-sheet-close { width: 100%; min-height: 50px; margin-top: 10px; border: none; border-radius: calc(14px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.08); color: var(--text-main); font: 600 0.95rem var(--font-ui); cursor: pointer; }

.qc-thread { position: relative; }
.mx-search { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: color-mix(in oklab, #080914, var(--paper, #fff) var(--bg-light, 0%)); animation: qsFade 0.15s ease both; }
.mx-search-bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); color: var(--text-muted); }
.mx-search-bar input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: calc(20px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 16px var(--font-ui); outline: none; }
.mx-search-bar input:focus { border-color: var(--border-focus); }
.mx-results { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.mx-results > .qs-desc { padding: 18px 8px; text-align: center; }
.mx-count { padding: 4px 8px 6px; color: var(--text-dim); font-size: 0.72rem; }
.mx-hit { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: none; border-radius: calc(12px * var(--round, 1)); background: none; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.mx-hit:hover, .mx-hit:focus-visible { background: rgba(var(--ink-rgb),  0.06); }
.mx-hit-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; }
.mx-hit-top time { flex: none; color: var(--text-dim); font-size: 0.7rem; }
.mx-hit-text { display: block; margin-top: 2px; font-size: 0.84rem; line-height: 1.4; color: var(--text-muted); overflow-wrap: anywhere; }
.mx-hit mark { background: rgba(255, 211, 77, 0.3); color: color-mix(in oklab, #fff3cf, #000 var(--tx-dark, 0%)); border-radius: calc(3px * var(--round, 1)); padding: 0 1px; }
.qc-latest { align-self: center; position: sticky; bottom: 4px; margin-top: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1))); background: color-mix(in oklab, rgba(16, 18, 34, 0.96), rgba(255, 255, 255, 0.96) var(--bg-light, 0%)); }

/* ---------- phones: more room for the conversation ---------- */
/* The panel follows what's actually visible, so the on-screen keyboard never covers the chat box (app.js sets these). */
.qs-drawer { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
@media (max-width: 760px), (max-height: 500px) {
    /* In a conversation (or global chat), your own profile card just takes space: it's on the You tab. */
    .qs-drawer.chatting .qs-me, .qs-drawer[data-tab="global"] .qs-me { display: none; }
    .qs-drawer.chatting .qs-head, .qs-drawer[data-tab="global"] .qs-head { padding-top: 10px; padding-bottom: 4px; }
    /* Typing (keyboard up): only the conversation and the box you're typing in. */
    html.kb .qs-drawer.chatting .qs-head, html.kb .qs-drawer.chatting .qs-tabs,
    html.kb .qs-drawer[data-tab="global"] .qs-head, html.kb .qs-drawer[data-tab="global"] .qs-tabs { display: none; }
    .qc-compose { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)) 12px; }
    .qc-msgs { padding: 8px 12px 6px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .qs-me { display: none; }
    .qs-head { padding: 8px 14px 4px 18px; }
    .qs-tabs { margin-top: 4px; }
    .qs-tabs button span:not(.material-symbols-outlined) { display: none; }
}

/* A game/app request's link in the admin panel */
.qd-msgq a { color: var(--accent-cyan); word-break: break-all; }

/* ---------- groups (social/groups.js) ---------- */
.qgr-tile { --gh: 186; flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: calc(14px * var(--round, 1)); font-size: 1.35rem; line-height: 1;
    background: linear-gradient(140deg, hsla(var(--gh), 95%, 60%, 0.34), hsla(calc(var(--gh) + 40), 90%, 55%, 0.16)); border: 1px solid hsla(var(--gh), 95%, 70%, 0.35); box-shadow: inset 0 1px 0 rgba(var(--ink-rgb),  0.08); }
.qgr-tile.sm { width: 34px; height: 34px; border-radius: calc(11px * var(--round, 1)); font-size: 1.1rem; }
.qgr-tile.xl { width: 76px; height: 76px; border-radius: calc(24px * var(--round, 1)); font-size: 2.4rem; margin-bottom: 6px; }
.qgr-row { align-items: flex-start; }
.qgr-row small { white-space: nowrap; }
.qgr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.qgr-chips i { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.06); color: var(--text-muted); font: 600 0.66rem var(--font-ui); font-style: normal; }
.qgr-chips i .material-symbols-outlined { font-size: 0.8rem; }
.qgr-chips i.on { color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); background: rgba(61, 255, 168, 0.08); }
.qgr-chips i.ev { color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); background: rgba(255, 215, 107, 0.1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-unread.ping { background: #ffb020; color: #1a1000; }
.qgr-invite small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.qgr-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 8px; text-align: center; }
.qgr-empty > .material-symbols-outlined { font-size: 2.6rem; color: var(--accent-cyan); }
.qgr-empty .qs-row { justify-content: center; }

.qgr-room { position: relative; }
.qgr-head .qc-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qgr-bars { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.qgr-bars[hidden] { display: none; }
.qgr-bar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: none; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.04); color: var(--text-main); font: 500 0.78rem var(--font-ui); text-align: left; cursor: pointer; }
.qgr-bar:hover { background: rgba(var(--ink-rgb),  0.08); }
.qgr-bar > .material-symbols-outlined { font-size: 1rem; color: var(--accent-cyan); }
.qgr-bar.ev > .material-symbols-outlined { color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qgr-bar .qs-grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.qgr-bar .qs-grow b { color: var(--text-main); }
.qgr-bar i { flex: none; display: inline-flex; align-items: center; gap: 2px; font: 700 0.68rem var(--font-ui); font-style: normal; color: var(--text-muted); }
.qgr-bar i .material-symbols-outlined { font-size: 0.85rem; color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qgr-sys { align-self: center; max-width: 90%; margin: 8px 0 2px; padding: 2px 10px; text-align: center; font-size: 0.72rem; color: var(--text-dim); }
.qgr-pinned { display: inline-flex; color: var(--accent-cyan); }
.qgr-pinned .material-symbols-outlined { font-size: 0.85rem; }

.qgr-info { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; background: var(--bg-card, color-mix(in oklab, #080914, var(--paper, #fff) var(--bg-light, 0%))); animation: qsFade 0.15s ease both; }
.qgr-info[hidden] { display: none; }
.qgr-info-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.qgr-info-head b { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qgr-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 8px 12px 0; padding: 3px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.3); border: 1px solid var(--line); }
.qgr-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 5px; border: none; border-radius: calc(9px * var(--round, 1)); background: none; color: var(--text-muted); font: 600 0.68rem var(--font-ui); cursor: pointer; }
.qgr-tabs button .material-symbols-outlined { font-size: 1.1rem; }
.qgr-tabs button.on { background: rgba(var(--ink-rgb),  0.1); color: var(--text-main); }
.qgr-tabs button.on .material-symbols-outlined { color: var(--accent-cyan); }
.qgr-tabs button i { position: absolute; top: 2px; right: 8px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: calc(8px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.14); font: 700 0.6rem/15px var(--font-ui); font-style: normal; }
.qgr-info-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.qgr-info-body h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 500 0.7rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-soft, var(--accent-soft)); }
.qgr-info-body h3 .material-symbols-outlined { font-size: 1.05rem; }
.qgr-info-body h3 .qs-count { margin-left: auto; letter-spacing: 0.05em; text-transform: none; color: var(--text-muted); font-family: var(--font-ui); }
.qgr-info-body .qs-card { display: flex; flex-direction: column; gap: 10px; }
.qgr-info-body .qs-card h3 { margin-bottom: 0; }
.qgr-about { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.qgr-about h3 { margin: 0; font: 700 1.2rem var(--font-display); letter-spacing: 0.02em; text-transform: none; color: var(--text-main); }
.qgr-desc { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9rem; }
.qgr-code { display: flex; align-items: center; gap: 8px; }
.qgr-code b { padding: 6px 14px; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.35); border: 1px dashed var(--line-strong); font: 700 1.2rem var(--font-mono); letter-spacing: 0.2em; }
.qgr-danger { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qgr-edit { display: flex; flex-direction: column; gap: 10px; }
.qgr-edit .qs-flabel small { color: var(--text-dim); font-weight: 400; }
.qgr-edit textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.88rem var(--font-ui); resize: vertical; outline: none; }
.qgr-emojis { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qgr-emojis button { width: 36px; height: 36px; border: 1px solid transparent; border-radius: calc(10px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.04); font-size: 1.2rem; cursor: pointer; }
.qgr-emojis button.on { border-color: var(--accent-cyan); background: rgba(var(--accent-rgb), 0.12); }
.qgr-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.qgr-colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: hsl(var(--gh), 90%, 60%); cursor: pointer; }
.qgr-colors button.on { border-color: #fff; box-shadow: 0 0 0 2px hsla(var(--gh), 90%, 60%, 0.5); }
.qgr-pl-top { display: flex; flex-direction: column; gap: 8px; }
.qgr-pl-top .qs-row { margin: 0; }
.qgr-songs { display: flex; flex-direction: column; gap: 2px; }
.qgr-song { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: calc(12px * var(--round, 1)); }
.qgr-song:hover { background: rgba(var(--ink-rgb),  0.05); }
.qgr-song img, .qgr-noart { flex: none; width: 42px; height: 42px; border-radius: calc(8px * var(--round, 1)); object-fit: cover; background: rgba(var(--shade-rgb), 0.4); display: grid; place-items: center; color: var(--text-dim); }
.qgr-song > button.qs-grow { min-width: 0; padding: 0; border: none; background: none; color: var(--text-main); text-align: left; cursor: pointer; font: inherit; }
.qgr-song b { display: block; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qgr-song small { display: block; font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qgr-events { display: flex; flex-direction: column; gap: 10px; }
.qgr-event { display: flex; gap: 12px; padding: 12px; border-radius: calc(16px * var(--round, 1)); background: rgba(var(--ink-rgb),  0.03); border: 1px solid var(--line); }
.qgr-event.now { border-color: rgba(255, 215, 107, 0.5); background: rgba(255, 215, 107, 0.06); }
.qgr-event b { display: block; font-size: 0.92rem; }
.qgr-event small { display: block; font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.qgr-event .qs-row { margin-top: 8px; }
.qgr-ev-date { flex: none; width: 46px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: calc(12px * var(--round, 1)); background: rgba(255, 215, 107, 0.1); }
.qgr-ev-date b { font: 700 1.2rem/1 var(--font-display); color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qgr-ev-date small { margin: 2px 0 0; font: 700 0.62rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in oklab, #ffd76b, #000 var(--tx-dark, 0%)); }
.qs-btn.on { border-color: rgba(61, 255, 168, 0.55); color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qgr-evform select, .qgr-evform input[type="datetime-local"] { color-scheme: dark; }
.qgr-pins { display: flex; flex-direction: column; gap: 2px; }
.qgr-codein { text-transform: uppercase; font: 700 1.2rem var(--font-mono) !important; letter-spacing: 0.2em; text-align: center; }
@media (max-width: 760px), (max-height: 500px) {
    .qs-drawer.chatting[data-tab="groups"] .qs-me { display: none; }
}

/* ---------- groups: banners, the group page, channels, titles, Discover; group chats (groups.js) ---------- */
.qs-bn[data-b="img"] { background-size: cover; background-position: center; }
.qgr-banner { pointer-events: none; }
.qgr-banner.row { position: absolute; inset: 0; border-radius: inherit; opacity: 0.35; -webkit-mask-image: linear-gradient(90deg, #000, transparent 85%); mask-image: linear-gradient(90deg, #000, transparent 85%); }
.qgr-row.has-banner { position: relative; isolation: isolate; }
.qgr-row.has-banner > :not(.qgr-banner) { position: relative; }
.qgr-head.has-banner { position: relative; isolation: isolate; }
.qgr-banner.head { position: absolute; inset: 0; z-index: -1; opacity: 0.5; -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent); mask-image: linear-gradient(90deg, #000 20%, transparent); }
.qgr-banner.hero { width: 100%; flex: none; height: 110px; border-radius: calc(16px * var(--round, 1)); }
.qgr-banner.card { width: 100%; flex: none; height: 64px; border-radius: calc(12px * var(--round, 1)) calc(12px * var(--round, 1)) 0 0; }
.qgr-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 4px 4px; }
.qgr-page .qgr-banner.hero { align-self: stretch; }
.qgr-page-top { margin-top: -40px; }
.qgr-page-top .qgr-tile.xl { box-shadow: 0 0 0 4px var(--bg-card, #080914); background-color: var(--bg-card, #080914); }
.qgr-page > h3 { margin: 0; font: 700 1.2rem var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text-main); }
.qgr-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.qgr-stats span { display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 6px 10px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.05); font-size: 0.68rem; color: var(--text-muted); }
.qgr-stats b { font-size: 1.05rem; color: var(--text-main); }
.qgr-faces { display: flex; justify-content: center; }
.qgr-faces .qs-avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg-card, #080914); }
.qgr-titled { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.qgr-titled-one { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: calc(99px * var(--round, 1)); background: none; color: var(--text-main); font: inherit; cursor: pointer; text-align: left; }
.qgr-titled-one > span { display: flex; flex-direction: column; font-size: 0.78rem; }
.qg-title { display: inline-block; margin: 0 4px; padding: 0 6px; border-radius: calc(99px * var(--round, 1)); background: color-mix(in oklab, var(--accent-cyan) 16%, transparent); color: var(--accent-cyan); font: 700 0.62rem var(--font-ui); letter-spacing: 0.03em; vertical-align: 1px; white-space: nowrap; }
.qgr-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; margin-bottom: 8px; }
.qgr-bpick { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 3px; border: 2px solid transparent; border-radius: calc(10px * var(--round, 1)); background: none; color: var(--text-muted); font: 600 0.66rem var(--font-ui); cursor: pointer; }
.qgr-bpick .qs-bn { display: block; width: 100%; height: 26px; border-radius: calc(7px * var(--round, 1)); }
.qgr-bpick.on { border-color: var(--accent-cyan); color: var(--text-main); }
.qgr-chans { display: flex; gap: 4px; padding: 6px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.qgr-chans[hidden] { display: none; }
.qgr-chan { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px 4px 7px; border: 1px solid transparent; border-radius: calc(99px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.04); color: var(--text-muted); font: 600 0.76rem var(--font-ui); cursor: pointer; }
.qgr-chan .material-symbols-outlined { font-size: 0.95rem; }
.qgr-chan:hover { background: rgba(var(--ink-rgb), 0.08); }
.qgr-chan.on { background: color-mix(in oklab, var(--accent-cyan) 16%, transparent); border-color: color-mix(in oklab, var(--accent-cyan) 40%, transparent); color: var(--text-main); }
.qgr-chan.unread { color: var(--text-main); font-weight: 800; }
.qgr-chan i { font-style: normal; min-width: 16px; padding: 0 4px; border-radius: 99px; background: #ff4d6d; color: #fff; font: 700 0.62rem var(--font-ui); text-align: center; }
.qgr-chan.add { padding: 4px 6px; }
.qgr-chrow .qgr-chic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(var(--ink-rgb), 0.06); color: var(--accent-cyan); }
.qgr-disc-q { width: 100%; margin: 2px 0 6px; }
.qgr-disc-list { display: flex; flex-direction: column; gap: 8px; }
.qgr-dcard { display: flex; flex-direction: column; align-items: stretch; width: 100%; padding: 0 0 10px; border: 1px solid var(--line); border-radius: calc(12px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.03); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.qgr-dcard:hover { border-color: color-mix(in oklab, var(--accent-cyan) 45%, transparent); }
.qgr-dtop { display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-top: -18px; }
.qgr-dtop .qgr-tile { box-shadow: 0 0 0 3px var(--bg-card, #080914); background-color: var(--bg-card, #080914); }
.qgr-dtop b { display: block; margin-top: 16px; }
.qgr-dtop small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.qgr-dtop small i.on { font-style: normal; color: color-mix(in oklab, #3dffa8, #000 var(--tx-dark, 0%)); }
.qgr-ddesc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 12px 0; font-size: 0.8rem; color: var(--text-muted); }
.qgc-faces { flex: none; position: relative; display: inline-flex; width: 42px; height: 42px; }
.qgc-faces .qs-avatar { position: absolute; width: 28px; height: 28px; font-size: 0.72rem; box-shadow: 0 0 0 2px var(--glass-strong, #0b0f1e); }
.qgc-faces .qs-avatar:first-child { left: 0; top: 0; }
.qgc-faces .qs-avatar:nth-child(2) { right: 0; bottom: 0; }
.qgc-faces .qs-avatar:only-child { inset: 7px; }
.qgc-faces.sm { width: 34px; height: 34px; }
.qgc-faces.sm .qs-avatar { width: 23px; height: 23px; font-size: 0.62rem; }
.qgc-faces.xl { width: 84px; height: 84px; margin-bottom: 6px; }
.qgc-faces.xl .qs-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
.qgc-start { margin-bottom: 8px; border: 1px dashed var(--line); }
.qgc-start > .material-symbols-outlined:first-child { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in oklab, var(--accent-cyan) 16%, transparent); color: var(--accent-cyan); }
.qgc-namein, .qgc-find { width: 100%; margin-bottom: 6px; }
.qgc-pick { max-height: 46vh; overflow-y: auto; }
.qgc-pick label { cursor: pointer; }
.qgc-pick label.on-pick { background: color-mix(in oklab, var(--accent-cyan) 12%, transparent); }
.qs-modal .qgc-pick input[type=checkbox] { flex: none; padding: 0; margin: 0;  width: 18px; height: 18px; accent-color: var(--accent-cyan); }
.qgc-name { display: flex; gap: 6px; }
.qgc-name input { flex: 1; min-width: 0; }
@media (max-width: 760px), (max-height: 500px) {
    .qs-drawer.chatting[data-tab="chats"] .qs-me { display: none; }
}

/* ---------- profile look: banner, bio, favourite game (Social → You, and profile cards) ---------- */
.qs-bn { background: linear-gradient(135deg, #1a2140, #0b0f22); }
.qs-bn[data-b="aurora"] { background: radial-gradient(ellipse at 20% 0%, rgba(40, 255, 190, 0.55), transparent 60%), radial-gradient(ellipse at 85% 40%, rgba(80, 120, 255, 0.6), transparent 60%), linear-gradient(170deg, color-mix(in oklab, #04203a, var(--paper, #fff) var(--bg-light, 0%)), #063d3a); }
.qs-bn[data-b="sunset"] { background: linear-gradient(180deg, #3d1450 0%, #a33a5c 55%, #f08a4b 100%); }
.qs-bn[data-b="ocean"] { background: radial-gradient(ellipse at 50% 120%, rgba(0, 190, 255, 0.6), transparent 60%), linear-gradient(180deg, color-mix(in oklab, #03203f, var(--paper, #fff) var(--bg-light, 0%)), #064a73); }
.qs-bn[data-b="forest"] { background: radial-gradient(ellipse at 30% 0%, rgba(140, 255, 150, 0.3), transparent 55%), linear-gradient(170deg, color-mix(in oklab, #0b2416, var(--paper, #fff) var(--bg-light, 0%)), #2f6b3f); }
.qs-bn[data-b="candy"] { background: radial-gradient(circle at 15% 30%, rgba(255, 140, 220, 0.75), transparent 50%), radial-gradient(circle at 85% 70%, rgba(140, 200, 255, 0.65), transparent 50%), linear-gradient(135deg, #4d1a6e, #b83280); }
.qs-bn[data-b="ember"] { background: radial-gradient(ellipse at 50% 120%, rgba(255, 110, 40, 0.85), transparent 60%), linear-gradient(180deg, color-mix(in oklab, #1f0705, var(--paper, #fff) var(--bg-light, 0%)), #5a1208); }
.qs-bn[data-b="galaxy"] { background: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent), radial-gradient(circle at 30% 40%, rgba(155, 92, 255, 0.7), transparent 55%), radial-gradient(circle at 75% 55%, rgba(0, 190, 255, 0.55), transparent 50%), color-mix(in oklab, #070414, var(--paper, #fff) var(--bg-light, 0%)); }
.qs-bn[data-b="mono"] { background: repeating-linear-gradient(135deg, color-mix(in oklab, #1c1c20, var(--paper, #fff) var(--bg-light, 0%)) 0 12px, color-mix(in oklab, #26262b, var(--paper, #fff) var(--bg-light, 0%)) 12px 24px); }
.qs-bn[data-b="none"] { background: rgba(var(--ink-rgb),  0.04); }

.qs-profile.has-banner { position: relative; padding-top: 52px; }
.qs-profile-banner { position: absolute; left: -20px; right: -20px; top: -10px; height: 96px; border-radius: calc(16px * var(--round, 1)) calc(16px * var(--round, 1)) 0 0; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.qs-profile.has-banner > .qs-avatar { position: relative; box-shadow: 0 0 0 4px var(--glass-strong), 0 8px 24px rgba(0, 0, 0, calc(0.5 * var(--shadow-k, 1))); }
.qs-profile-bio { margin: 8px 0 2px; max-width: 320px; font-size: 0.9rem; line-height: 1.4; color: var(--text-main); overflow-wrap: anywhere; }
.qs-profile-fav { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 6px 12px 6px 6px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb),  0.04); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
button.qs-profile-fav:hover { background: rgba(var(--ink-rgb),  0.08); }
.qs-profile-fav img { width: 44px; height: 44px; border-radius: calc(10px * var(--round, 1)); object-fit: cover; background: rgba(var(--shade-rgb), 0.4); }
.qs-profile-fav small { display: block; font: 600 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.qs-profile-fav b { display: block; font-size: 0.88rem; }
.qs-profile-fav > .material-symbols-outlined { color: var(--accent-cyan); }

.qs-look { display: flex; flex-direction: column; gap: 10px; }
.qs-look h3 { margin-bottom: 0; }
.qs-look-preview { padding: 10px 20px 14px; border-radius: calc(16px * var(--round, 1)); background: rgba(var(--shade-rgb), 0.25); border: 1px solid var(--line); overflow: hidden; }
.qs-look-preview .qs-profile-banner { top: -10px; }
.qs-profile.mini .qs-avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; }
.qs-profile.mini h3 { font-size: 1rem; }
.qs-banners { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.qs-banners button { width: 46px; height: 30px; border-radius: calc(8px * var(--round, 1)); border: 2px solid transparent; cursor: pointer; color: var(--text-dim); display: grid; place-items: center; }
.qs-banners button .material-symbols-outlined { font-size: 1rem; }
.qs-banners button.on { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3); }
.qs-look textarea, .qs-look select { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.88rem var(--font-ui); letter-spacing: normal; text-transform: none; outline: none; color-scheme: dark; }
.qs-look textarea { resize: vertical; min-height: 54px; }
.qs-look textarea:focus, .qs-look select:focus { border-color: var(--border-focus); }
.qs-look .qs-flabel small { letter-spacing: 0.04em; text-transform: none; color: var(--text-dim); font-family: var(--font-ui); }
.qs-look .qs-row { margin: 0; }
.qs-scroll .qgr-edit, .qs-scroll .qgr-evform { flex-direction: column; gap: 10px; }
.qgr-evform { display: flex; flex-direction: column; gap: 10px; }
.qgr-evform select { width: 100%; padding: 10px 12px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb), 0.35); color: var(--text-main); font: 500 0.9rem var(--font-ui); letter-spacing: normal; text-transform: none; outline: none; }
.qgr-evform .qs-flabel small, .qgr-edit .qs-flabel small { letter-spacing: 0.04em; text-transform: none; font-family: var(--font-ui); }
.qgr-evform .qs-row, .qgr-edit .qs-row { margin: 0; }
.qs-look-preview .qs-profile h3 { display: block; margin: 0; font: 700 1rem var(--font-display); letter-spacing: 0.02em; text-transform: none; color: var(--text-main); }

/* ---------- Tutorial sections: the list on a "something new" step, the replay picker, the admin picker ---------- */
.qt-secs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.qt-secs li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: calc(12px * var(--round, 1)); background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.25); font-weight: 600; }
.qt-secs li .material-symbols-outlined { color: var(--accent-cyan); font-size: 1.2rem; }
.qt-pick, .qd-secs { display: grid; gap: 6px; margin-top: 10px; }
.qt-pick-sec, .qd-sec {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; text-align: left;
    border: 1px solid var(--line); border-radius: calc(12px * var(--round, 1)); background: rgba(var(--ink-rgb), 0.04);
    color: var(--text-main); font: 600 0.92rem var(--font-ui); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.qt-pick-sec:hover, .qd-sec:hover { background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.35); }
.qt-pick-sec > .material-symbols-outlined:first-child, .qd-sec .material-symbols-outlined { color: var(--accent-cyan); }
.qt-pick-sec > span { flex: none; }
.qt-pick-sec > span:not(.material-symbols-outlined) { flex: 1; }
.qt-pick-sec > .material-symbols-outlined:last-child { color: var(--text-muted); }
.qd-sec input { width: 18px; height: 18px; accent-color: var(--accent-cyan); }
.qd-sec:has(input:checked) { background: rgba(var(--accent-rgb), 0.14); border-color: rgba(var(--accent-rgb), 0.45); }

/* ================= Feed, posts and clips (social/posts.js) ================= */
.qf-pane { padding-bottom: 20px; }
.qf-top { display: grid; gap: 10px; margin-bottom: 12px; }
.qf-compose { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: calc(14px * var(--round, 1)); border: 1px solid var(--line-strong); background: rgba(var(--ink-rgb), 0.04); color: var(--text-muted); font: 500 0.9rem var(--font-ui); cursor: text; text-align: left; }
.qf-compose:hover { border-color: rgba(var(--accent-rgb), 0.45); color: var(--text-main); }
.qf-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qf-views { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); }
.qf-views button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 0; border-radius: 999px; background: none; color: var(--text-muted); font: 600 0.8rem var(--font-ui); cursor: pointer; }
.qf-views button .material-symbols-outlined { font-size: 1rem; }
.qf-views button.on { background: var(--grad-accent); color: var(--on-accent); }
.qf-list { display: grid; gap: 12px; }
.qf-post { padding: 12px 14px; border-radius: calc(16px * var(--round, 1)); border: 1px solid var(--line); background: var(--bg-card); text-align: left; }
.qf-post .qf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qf-who { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--text-main); font: 700 0.9rem var(--font-ui); cursor: pointer; }
.qf-who:hover b { text-decoration: underline; }
.qf-post .qf-head small { display: inline-flex; align-items: center; gap: 3px; color: var(--text-muted); font-size: 0.76rem; }
.qf-post .qf-head small .material-symbols-outlined { font-size: 0.9rem; }
.qf-more { margin-left: auto; }
.qf-text { margin: 4px 0 8px; color: var(--text-main); font-size: 0.92rem; line-height: 1.45; white-space: normal; word-break: break-word; }
.qf-clip { position: relative; width: 100%; max-height: 60vh; border-radius: calc(12px * var(--round, 1)); overflow: hidden; background: #000; margin: 4px 0 8px; }
.qf-clip video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.qf-clip .qf-dur { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font: 600 0.72rem var(--font-ui); pointer-events: none; }
.qf-clip .qf-dur .material-symbols-outlined { font-size: 0.9rem; }
.qf-clip.gone { display: flex; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 16 / 6; color: var(--text-muted); background: rgba(var(--ink-rgb), 0.05); font-size: 0.85rem; }
.qf-clip.in-chat { width: min(320px, 70vw); margin: 0; }
.qc-bubble.clip { padding: 4px !important; background: rgba(var(--ink-rgb), 0.06) !important; }
.qf-game { display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0 8px; padding: 8px 10px; border-radius: calc(12px * var(--round, 1)); border: 1px solid var(--line); background: rgba(var(--accent-rgb), 0.07); color: var(--text-main); font: 600 0.85rem var(--font-ui); cursor: pointer; text-align: left; }
.qf-game span:not(.material-symbols-outlined) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-game b { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 999px; background: var(--grad-accent); color: var(--on-accent); font-size: 0.78rem; }
.qf-game b .material-symbols-outlined { font-size: 1rem; }
.qf-game:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.qf-game.static { cursor: default; }
.qf-post .qf-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qf-reacts { display: flex; flex-wrap: wrap; gap: 4px; }
.qf-reacts button { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; background: rgba(var(--ink-rgb), 0.05); font-size: 0.9rem; cursor: pointer; transition: transform 0.12s, background 0.15s; }
.qf-reacts button span { font: 700 0.72rem var(--font-ui); color: var(--text-muted); }
.qf-reacts button:hover { transform: scale(1.08); }
.qf-reacts button.on { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.14); }
.qf-reacts button.on span { color: var(--text-main); }
.qf-cbtn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-muted); font: 600 0.8rem var(--font-ui); cursor: pointer; }
.qf-cbtn .material-symbols-outlined { font-size: 1rem; }
.qf-peek { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.04); font-size: 0.82rem; color: var(--text-muted); cursor: pointer; display: grid; gap: 3px; }
.qf-peek b { color: var(--text-main); }
.qf-comments { margin-top: 8px; display: grid; gap: 8px; }
.qf-clist { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.qf-c { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.04); }
.qf-c > div { flex: 1; min-width: 0; font-size: 0.84rem; }
.qf-c small { color: var(--text-muted); font-size: 0.7rem; }
.qf-c p { margin: 2px 0 0; word-break: break-word; }
.qf-c .qs-icon-btn { opacity: 0.5; } .qf-c:hover .qs-icon-btn { opacity: 1; }
.qf-cform { display: flex; gap: 6px; align-items: flex-end; }
.qf-cform textarea { flex: 1; resize: none; min-height: 36px; max-height: 120px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb, 0, 0, 0), 0.25); color: var(--text-main); font: 500 0.86rem var(--font-ui); }
.qf-form { display: grid; gap: 10px; text-align: left; }
.qf-ta { width: 100%; box-sizing: border-box; resize: vertical; min-height: 70px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb, 0, 0, 0), 0.25); color: var(--text-main); font: 500 0.95rem var(--font-ui); }
.qf-attach { display: grid; gap: 4px; justify-items: start; }
.qf-vis { display: inline-flex; gap: 6px; }
.qf-vis button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-muted); font: 600 0.82rem var(--font-ui); cursor: pointer; }
.qf-vis button .material-symbols-outlined { font-size: 1rem; }
.qf-vis button.on { border-color: transparent; background: var(--grad-accent); color: var(--on-accent); }
.qf-progress { height: 6px; border-radius: 99px; background: rgba(var(--ink-rgb), 0.1); overflow: hidden; }
.qf-progress i { display: block; height: 100%; width: 0; background: var(--grad-accent); transition: width 0.2s; }
.qf-menu { display: grid; gap: 8px; }
.qf-menu .qs-btn { justify-content: center; text-decoration: none; }
.qf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.qf-tile { position: relative; display: grid; border-radius: calc(12px * var(--round, 1)); overflow: hidden; border: 1px solid var(--line); background: var(--bg-card); cursor: pointer; }
.qf-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; display: block; }
.qf-tile .qf-dur { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font: 600 0.7rem var(--font-ui); }
.qf-tile .qf-dur .material-symbols-outlined { font-size: 0.85rem; }
.qf-tile-text { display: grid; padding: 6px 8px 0; text-align: left; }
.qf-tile-text b { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-tile-text small { display: inline-flex; align-items: center; gap: 3px; color: var(--text-muted); font-size: 0.72rem; }
.qf-tile-text small .material-symbols-outlined { font-size: 0.85rem; }
.qf-tile-acts { display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.qf-tile-acts:empty { display: none; }
.qf-tile-acts .qs-icon-btn .material-symbols-outlined { font-size: 1.1rem; }
.qf-find { width: 100%; box-sizing: border-box; padding: 9px 12px; margin-bottom: 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(var(--shade-rgb, 0, 0, 0), 0.25); color: var(--text-main); font: 500 0.9rem var(--font-ui); }
.qf-pick { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.qf-pick button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 0; background: transparent; color: var(--text-main); font: 600 0.9rem var(--font-ui); cursor: pointer; text-align: left; }
.qf-pick button:hover { background: rgba(var(--ink-rgb), 0.07); }
.qf-pick button[hidden] { display: none; }
.qf-pick small { margin-left: auto; color: var(--text-muted); font-weight: 500; font-size: 0.75rem; }
.qf-pick > button > .material-symbols-outlined { width: 32px; text-align: center; color: var(--accent-cyan); }
.qf-list.solo { max-height: 70vh; overflow-y: auto; }

/* (8 tabs: a little tighter so they fit in one row) */
.qs-tabs button span:not(.material-symbols-outlined):not(.qs-tab-badge) { font-size: 0.66rem; letter-spacing: -0.01em; white-space: nowrap; }

/* Tutorial editor: updates from the built-in tutorial */
.qe-updates { position: relative; }
.qe-updates .qe-mark { margin-left: 4px; }
.qe-upd-h { margin: 12px 0 6px; font-size: 0.85rem; color: var(--text-muted); }
.qe-upd { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
.qe-upd:hover { background: rgba(var(--ink-rgb), 0.05); }
.qe-upd b { display: block; font-size: 0.9rem; }
.qe-upd small { display: block; color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }

/* Roles: the owner's gold crown and an admin's blue shield (ui.js roleBadge), everywhere */
.q-role { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; padding: 1px 7px 1px 5px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.5; white-space: nowrap; }
.q-role .material-symbols-outlined { font-size: 0.95em; font-variation-settings: "FILL" 1; }
.q-role.owner { color: #1b1400; background: linear-gradient(135deg, #ffe58a, #f5b631); box-shadow: 0 0 10px rgba(245, 182, 49, 0.35); }
.q-role.amigo { color: color-mix(in oklab, #ffab73, #000 var(--tx-dark, 0%)); background: rgba(255, 128, 64, 0.16); border: 1px solid rgba(255, 128, 64, 0.45); }
.q-role.admin { color: color-mix(in oklab, #c7a2ff, #000 var(--tx-dark, 0%)); background: rgba(170, 120, 255, 0.15); border: 1px solid rgba(170, 120, 255, 0.4); }
.q-role.mod { color: color-mix(in oklab, #7cc7ff, #000 var(--tx-dark, 0%)); background: rgba(90, 170, 255, 0.14); border: 1px solid rgba(90, 170, 255, 0.35); }
.q-role.helper { color: color-mix(in oklab, #7fe3a5, #000 var(--tx-dark, 0%)); background: rgba(80, 210, 130, 0.13); border: 1px solid rgba(80, 210, 130, 0.35); }
.q-role.small { padding: 2px; border-radius: 50%; }
.q-role.small.amigo, .q-role.small.admin, .q-role.small.mod, .q-role.small.helper { border: none; background: none; padding: 0; }
.q-role.small .material-symbols-outlined { font-size: 0.85rem; }
.qs-owner-msg { display: flex; gap: 12px; align-items: flex-start; }
.qs-owner-msg p { margin: 0; font-size: 1rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Live: actions on a person and on each tab */
.qd-live-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.qd-live-acts .qs-btn { padding: 5px 10px; font-size: 0.75rem; }
.qd-live-acts .qs-btn .material-symbols-outlined { font-size: 1rem; }
.qd-live-tabacts { display: flex; gap: 2px; flex: none; }
.qd-live-tabacts .qs-icon-btn { width: 28px; height: 28px; }
.qd-live-tabacts .qs-icon-btn .material-symbols-outlined { font-size: 1rem; }
.qd-live-tabacts .danger { color: var(--danger, #ff6b6b); }
.qd-live-text { width: 100%; min-height: 80px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(var(--shade-rgb), 0.3); color: inherit; font: inherit; resize: vertical; }
.qd-live-tabs li { flex-wrap: wrap; }
.qd-live-tabacts { flex-basis: 100%; justify-content: flex-end; margin: -4px -4px -4px 0; }
.qs-a-status:empty { display: none; }
.qs-a-status { display: grid; gap: 8px; margin-top: 10px; }
.qs-a-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--ink-rgb), 0.05); border: 1px solid var(--line); font-size: 0.85rem; }
.qs-a-note > .material-symbols-outlined { color: var(--accent-cyan); flex: none; }
.qs-a-note > span:not(.material-symbols-outlined) { flex: 1; min-width: 0; }
.qs-a-note .qs-btn { flex: none; padding: 6px 10px; font-size: 0.78rem; }
.qs-appeal-text { width: 100%; min-height: 90px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(var(--shade-rgb), 0.3); color: inherit; font: inherit; resize: vertical; }
.qa-ban-acts { display: flex; gap: 8px; }
.qa-ban-acts .qs-btn { flex: 1; justify-content: center; }
.qa-forgot { font-size: inherit; }
.qs-modal .qa-forgot-user, .qs-modal .qa-forgot-note { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(var(--shade-rgb), 0.3); color: inherit; font: inherit; resize: vertical; }

/* Admin panel: the owner's queue, lockdown, the admins' day, ranks */
.qd-head h2.qd-rank-owner .material-symbols-outlined { color: #f5b631; }
.qd-head h2.qd-rank-amigo .material-symbols-outlined { color: #ff9a5c; }
.qd-head h2.qd-rank-admin .material-symbols-outlined { color: #c7a2ff; }
.qd-head h2.qd-rank-mod .material-symbols-outlined { color: #7cc7ff; }
.qd-head h2.qd-rank-helper .material-symbols-outlined { color: #7fe3a5; }
.qd-owner { display: grid; gap: 10px; margin: 6px 0 18px; }
.qd-owner .qd-h { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.qd-owner .qd-h .qd-count { position: static; font-style: normal; }
.qd-q { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid rgba(245, 182, 49, 0.35); background: rgba(245, 182, 49, 0.06); }
.qd-q small { display: block; color: var(--text-muted); font-size: 0.76rem; margin-top: 2px; }
.qd-q p { margin: 6px 0 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.qd-q-acts { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.qd-locks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.qd-lock { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.03); cursor: pointer; }
.qd-lock input { margin-top: 3px; accent-color: #ff6b6b; }
.qd-lock b { display: block; font-size: 0.88rem; }
.qd-lock small { display: block; color: var(--text-muted); font-size: 0.74rem; margin-top: 2px; }
.qd-lock.on { border-color: rgba(255, 107, 107, 0.55); background: rgba(255, 107, 107, 0.08); }
.qd-lock.on > .material-symbols-outlined { color: #ff8a8a; }
.qd-warn { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(255, 170, 60, 0.1); border: 1px solid rgba(255, 170, 60, 0.4); font-size: 0.85rem; }
.qd-warn > .material-symbols-outlined { color: #ffb347; }
.qd-day { display: grid; gap: 4px; }
.qd-day-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: none; background: rgba(var(--ink-rgb), 0.03); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.qd-day-row:hover { background: rgba(var(--ink-rgb), 0.07); }
.qd-day-row small { display: block; color: var(--text-muted); font-size: 0.74rem; }
.qd-day-row > b { font-size: 1.1rem; }
.qd-ranks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.qd-note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; color: var(--text-muted); margin: 6px 0; }
.qd-rank-help { margin: 10px 0 0; padding-left: 18px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.qd-undo { margin-left: 4px; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 2px; }
.qd-undo .material-symbols-outlined { font-size: 0.95rem; }
/* Global chat while it's read-only */
.qg-quiet { display: flex; gap: 8px; align-items: center; padding: 8px 12px; margin: 6px 0; border-radius: 12px; background: rgba(255, 170, 60, 0.1); border: 1px solid rgba(255, 170, 60, 0.35); font-size: 0.82rem; }
.qd-b.admin.r-amigo { background: rgba(255, 128, 64, 0.16); color: color-mix(in oklab, #ffab73, #000 var(--tx-dark, 0%)); }
.qd-b.admin.r-admin { background: rgba(170, 120, 255, 0.15); color: color-mix(in oklab, #c7a2ff, #000 var(--tx-dark, 0%)); }
.qd-b.admin.r-mod { background: rgba(90, 170, 255, 0.14); color: color-mix(in oklab, #7cc7ff, #000 var(--tx-dark, 0%)); }
.qd-b.admin.r-helper { background: rgba(80, 210, 130, 0.13); color: color-mix(in oklab, #7fe3a5, #000 var(--tx-dark, 0%)); }
/* the message of the day editor (admin Overview) */
.qd-motd { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: calc(16px * var(--round, 1)); margin-bottom: 14px; background: rgba(var(--accent-rgb), 0.05); border: 1px solid var(--line); }
.qd-motd > .material-symbols-outlined { color: var(--accent-cyan); }
.qd-motd p { margin: 2px 0 8px; color: var(--text-muted); font-size: 0.85rem; }
.qd-motd-today { margin-bottom: 8px; font-size: 0.9rem; }
.qd-motd-today small { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(var(--accent-rgb), 0.14); color: var(--accent-cyan); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.qd-motd-list, .qd-motd-pinned { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(var(--shade-rgb), 0.3); color: inherit; font: inherit; font-size: 0.85rem; }
.qd-motd-list { resize: vertical; line-height: 1.5; }
.qd-motd-pin { display: grid; gap: 4px; margin: 8px 0; color: var(--text-muted); font-size: 0.8rem; }
/* devices (owner: admin panel) */
.qd-devs { display: grid; gap: 6px; margin-bottom: 8px; }
.qd-dev { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--ink-rgb), 0.03); }
.qd-dev small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.qd-dev .qs-link { font-size: inherit; padding: 0; }
.qd-dev.banned { border-color: rgba(255, 90, 100, 0.4); background: rgba(255, 90, 100, 0.06); }
.qd-dev.banned > .material-symbols-outlined, .qd-red { color: #ff6b74; }
