@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* ══════════════════════════════════ الأساس ══════════════════════════════════
   لوحة غرفة تحكّم: كثيفة، هادئة الألوان، واللون الصارخ الوحيد فيها محجوز لحالة
   واحدة — «هذا اللاعب يبث الآن». كل ما عداه رمادي متدرّج، حتى تبقى عين المشرف
   مشدودة إلى ما يتحرك داخل البلاطات لا إلى الواجهة حولها. */

:root {
    --bg: #070a0f;
    --panel: #0d131c;
    --panel-2: #141d29;
    --panel-3: #1b2634;
    --line: #1e2a3a;
    --line-soft: #172130;

    --text: #e8eef6;
    --dim: #8496ad;
    --faint: #5b6b80;

    --live: #34d399;
    --live-soft: rgba(52, 211, 153, .12);
    --live-line: rgba(52, 211, 153, .38);

    --sel: #60a5fa;
    --sel-soft: rgba(96, 165, 250, .12);

    --warn: #fbbf24;
    --danger: #fb7185;

    --r: 10px;
    --r-sm: 7px;
    --pad: 14px;

    --topbar-h: 58px;
    --sidebar-w: 330px;

    /* أدنى ارتفاع لبلاطة واحدة. ما دامت البلاطات تتسع للشاشة فالجدار يملؤها
       تماماً بلا تمرير؛ وحين يصغر الارتفاع المتاح عن هذا الحد (جدار 4×4 على
       شاشة قصيرة) تتوقف البلاطات عن الانكماش ويصير الجدار قابلاً للتمرير.
       ارفع الرقم لبلاطات أكبر وتمرير أكثر، واخفضه للعكس. */
    --tile-min-h: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: .9em;
    background: var(--panel-3);
    padding: 1px 5px;
    border-radius: 4px;
    direction: ltr;
    display: inline-block;
}

.hidden { display: none !important; }

/* شريط تمرير مخصّص. كان الإبهام بلون --panel-3 (#1b2634) فوق لوحة داكنة، أي
   غير مرئي عملياً — فبدا وكأن لا تمرير أصلاً. الآن أفتح بدرجتين ليُرى، مع حدّ
   شفاف يعطيه هامشاً بصرياً، ونسخة Firefox عبر scrollbar-color. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #2f4257;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: #486480; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

* { scrollbar-width: thin; scrollbar-color: #2f4257 transparent; }

/* ══════════════════════════════════ الأزرار ═════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    transition: background .12s, border-color .12s, opacity .12s;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #2a394d; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 11px; }

.btn.primary { background: var(--live); border-color: var(--live); color: #04150f; }
.btn.primary:hover:not(:disabled) { background: #4ade9f; border-color: #4ade9f; }

.btn.ghost { background: transparent; }
.btn.warn { color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.btn.warn:hover:not(:disabled) { background: rgba(251, 191, 36, .1); }
.btn.danger { color: var(--danger); border-color: rgba(251, 113, 133, .3); }
.btn.danger:hover:not(:disabled) { background: rgba(251, 113, 133, .12); }

.select {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px 10px;
    font-size: 13px;
    max-width: 240px;
}
.select:focus { outline: none; border-color: var(--sel); }

/* ═══════════════════════════════ تسجيل الدخول ═══════════════════════════════ */

/* place-items: center وحده يقصّ من الطرفين معاً حين تكون البطاقة أطول من
   الشاشة، فلا يمكن الوصول إلى زر الدخول. الكلمة المفتاحية safe ترجع إلى
   المحاذاة من البداية عند الفيضان بدل التوسيط، و overflow-y يتيح التمرير. */
.login-screen {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: safe center;
    overflow-y: auto;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(52, 211, 153, .07), transparent 70%),
        var(--bg);
}

.login-card {
    width: min(380px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--live-soft);
    border: 1px solid var(--live-line);
    position: relative;
}
.login-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 12px var(--live);
}
.eyebrow {
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--faint);
    text-transform: uppercase;
}
.login-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--dim); font-weight: 600; }
.field input, .field textarea {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 14px;
    resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sel); }

.login-error {
    background: rgba(251, 113, 133, .1);
    border: 1px solid rgba(251, 113, 133, .3);
    color: var(--danger);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font-size: 13px;
    text-align: center;
}

/* ══════════════════════════════════ الهيكل ══════════════════════════════════ */

.app { height: 100%; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    flex: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 var(--pad);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-dot {
    width: 9px; height: 9px; flex: none;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 10px var(--live);
}
.brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand small {
    display: block;
    font-size: 11.5px;
    color: var(--faint);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-group { display: flex; align-items: center; gap: 8px; }
.topbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    background: var(--live-soft);
    border: 1px solid var(--live-line);
    color: var(--live);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.offline { background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .3); color: var(--danger); }

/* منتقي التخطيط. الاختيار هنا ليس تجميلياً: كل تخطيط يحمل معه جودة بث مختلفة
   (راجع LIVE_TIERS في الخادم الخلفي)، فبلاطات أقل تعني كل بلاطة أوضح، ومجموع
   النطاق يبقى ثابتاً تقريباً في الحالات الأربع. */
.segmented {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 2px;
    gap: 2px;
}
.seg {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dim);
    direction: ltr;
    transition: background .12s, color .12s;
}
.seg:hover { color: var(--text); }
.seg.on { background: var(--panel-3); color: var(--text); }

.meter {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 13px;
    color: var(--dim);
    padding: 5px 10px;
    border-radius: var(--r-sm);
    background: var(--bg);
    border: 1px solid var(--line-soft);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.meter b { color: var(--live); font-size: 14px; }
.meter small { font-size: 11px; color: var(--faint); margin-inline-start: 3px; }
.meter.hot b { color: var(--warn); }

.whoami { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.whoami b { font-size: 13px; }
.whoami small { font-size: 11px; color: var(--faint); }

.workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
}

/* ═════════════════════════════ جدار الكاميرات ═══════════════════════════════ */

.wall-wrap {
    position: relative;
    min-width: 0;
    padding: var(--pad);
    /* الجدار يمرَّر من هنا حين تبلغ البلاطات حدّها الأدنى. أفقياً لا تمرير
       إطلاقاً: عدد الأعمدة يتبع التخطيط المختار دائماً. */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* ⚠ كانت الصفوف ثابتة: repeat(--n, minmax(0, 1fr)) مع height: 100%، أي أن
   البلاطات تنكمش بلا حدّ لتتسع للشاشة مهما صغرت — فجدار 4×4 على شاشة قصيرة
   يعطي بلاطات لا يُرى فيها شيء، ولا يمكن تمريره لأنه يتسع «تماماً» بحكم
   التعريف.
   الآن الصفوف ضمنية بحدٍّ أدنى: minmax(--tile-min-h, 1fr). تتصرف 1fr كما كانت
   ما دام هناك متسع، وعند بلوغ الحدّ الأدنى يفيض الجدار فيمرَّر من .wall-wrap.
   الخلية قد تكون أعرض أو أعلى من 16:9، و object-fit داخل البلاطة يحفظ نسبة
   الصورة دون تشويه. */
.wall {
    height: 100%;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
    grid-auto-rows: minmax(var(--tile-min-h), 1fr);
}
.wall[data-cols="1"] { --n: 1; }
.wall[data-cols="2"] { --n: 2; }
.wall[data-cols="3"] { --n: 3; }
.wall[data-cols="4"] { --n: 4; }

.slot-empty {
    border: 1px dashed var(--line);
    border-radius: var(--r);
    display: grid;
    place-items: center;
    color: var(--faint);
    font-size: 12px;
    font-weight: 600;
    direction: ltr;
    user-select: none;
}

.tile {
    position: relative;
    background: #000;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}
.tile.focused { border-color: var(--sel); }
.tile.live { border-color: var(--live-line); }

.tile video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.tile-head {
    position: absolute;
    top: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0));
    pointer-events: none;
}
.tile-head .tid {
    color: var(--live);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.tile-head .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-head .tflags { margin-inline-start: auto; display: flex; gap: 5px; align-items: center; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
}
.badge.eye { color: var(--live); }
.badge.jail { color: var(--warn); }

/* شريط الأدوات مخفي حتى التحويم، فلا يحجب الصورة أثناء المراقبة الفعلية. */
.tile-tools {
    position: absolute;
    top: 32px;
    inset-inline-end: 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity .13s, transform .13s;
}
.tile:hover .tile-tools, .tile:focus-within .tile-tools { opacity: 1; transform: none; }

.tool {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(6, 10, 16, .8);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 13px;
    line-height: 1;
    color: var(--text);
}
.tool:hover { background: var(--panel-3); }
.tool.close:hover { background: rgba(251, 113, 133, .25); color: var(--danger); }

.tile-status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 12px;
    font-size: 12.5px;
    color: var(--dim);
    background: linear-gradient(160deg, #0b1017, #05080d);
    pointer-events: none;
}
.tile-status b { display: block; color: var(--text); margin-bottom: 3px; font-size: 13px; }

/* نبضة خفيفة أثناء انتظار أول إطار — تُطمئن أن شيئاً يحدث، بلا ضجيج بصري. */
.tile-status.waiting b { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.wall-empty {
    position: absolute;
    inset: var(--pad);
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background: var(--bg);
    padding: 24px;
}
.wall-empty b { font-size: 15px; }
.wall-empty p { color: var(--dim); font-size: 13px; max-width: 46ch; line-height: 1.75; }

/* ═════════════════════════════════ الجانب ═══════════════════════════════════ */

.sidebar {
    border-inline-start: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-shell { padding: 10px; border-bottom: 1px solid var(--line-soft); position: relative; }
.search {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    padding-inline-end: 46px;
    font-size: 13px;
}
.search:focus { outline: none; border-color: var(--sel); }
.count {
    position: absolute;
    inset-inline-end: 19px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.player-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prow {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .1s;
}
.prow:hover { background: var(--panel-2); }
.prow.focused { background: var(--sel-soft); border-color: rgba(96, 165, 250, .3); }
/* الحالة الوحيدة التي تستحق لوناً: هذا اللاعب يبث الآن على الجدار. */
.prow.watching { background: var(--live-soft); border-color: var(--live-line); }

.prow .pid {
    flex: none;
    min-width: 26px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--faint);
    background: var(--bg);
    border-radius: 5px;
    padding: 3px 5px;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.prow.watching .pid { color: var(--live); background: rgba(52, 211, 153, .14); }

.prow .pmain { flex: 1; min-width: 0; line-height: 1.3; }
.prow .pname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.prow .pjob {
    font-size: 11px;
    color: var(--faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.prow .pflags { flex: none; display: flex; align-items: center; gap: 5px; }

.chip {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    background: var(--panel-3);
    color: var(--dim);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.chip.ping-warn { color: var(--warn); background: rgba(251, 191, 36, .12); }
.chip.ping-bad { color: var(--danger); background: rgba(251, 113, 133, .12); }
.chip.jail { color: var(--warn); background: rgba(251, 191, 36, .12); }
/* لاعب بلا مقبس التقاط لا يمكن مشاهدته مهما ضغطت. إظهار ذلك مسبقاً أفضل من
   ضغطة تُرَدّ بـ offline. */
.chip.nocap { color: var(--faint); background: transparent; border: 1px solid var(--line); }

.list-empty { padding: 22px 12px; text-align: center; color: var(--faint); font-size: 12.5px; }

/* ─────────────────────────────── لوحة التفاصيل ───────────────────────────── */

/* ⚠ كانت flex: none بلا overflow. على شاشة قصيرة (أو مع max-height: 46vh في
   نقطة 900px) يتجاوز ارتفاعُها المساحةَ المتاحة، فتُقصّ من الأسفل — وأزرار
   «طرد» و«حظر» هي أول ما يختفي. و body لديه overflow: hidden عمداً (جدار
   المراقبة يجب ألا يمرَّر)، فلا سبيل للوصول إليها إطلاقاً.
   الآن: تنكمش عند الحاجة وتُمرَّر داخلياً بدل أن تُقصّ. */
.detail {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* يحجز مكان شريط التمرير دائماً، فلا يقفز العرض عند ظهوره واختفائه. */
    scrollbar-gutter: stable;
    border-top: 1px solid var(--line);
    background: var(--panel-2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.detail-head { display: flex; align-items: center; gap: 8px; }
.detail-id { flex: 1; min-width: 0; line-height: 1.3; }
.detail-id b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-id small { display: block; font-size: 11.5px; color: var(--faint); }

/* أرقام مضغوطة: لوحة التفاصيل كانت تتجاوز أسفل الشريط الجانبي على شاشة 1080p
   فيُقصّ زر «حظر» — وهو آخر عنصر فيها. الضغط هنا يوفّر نحو 40 بكسل. */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-row > div {
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 5px 8px;
    text-align: center;
}
.stat-row dt { font-size: 10.5px; color: var(--faint); margin-bottom: 1px; }
.stat-row dd { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.coords { font-size: 11px; color: var(--faint); text-align: center; margin-top: -2px; }
.coords span { color: var(--dim); direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.actions .btn { padding: 7px 6px; font-size: 12px; }
.actions .btn:last-child { grid-column: span 2; }

/* ═══════════════════════════════ قائمة البلاطة ══════════════════════════════ */

.tile-menu {
    position: fixed;
    z-index: 60;
    min-width: 176px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 5px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tile-menu button {
    text-align: start;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}
.tile-menu button:hover { background: var(--panel-3); }
.tile-menu button:disabled { opacity: .4; cursor: not-allowed; }
.tile-menu button:disabled:hover { background: none; }
.tile-menu button.danger { color: var(--danger); }
.tile-menu button.danger:hover { background: rgba(251, 113, 133, .12); }
.tile-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* ═════════════════════════════════ النافذة ══════════════════════════════════ */

/* نفس علّة شاشة الدخول: نافذة الحظر (مدة + سبب بثلاثة أسطر + زرّان) قد تتجاوز
   شاشة قصيرة، فيصبح زر «تأكيد» خارج المجال ولا يمكن بلوغه. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: safe center;
    overflow-y: auto;
    background: rgba(3, 6, 10, .74);
    padding: 20px;
}
.modal-card {
    width: min(400px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.modal-card h3 { font-size: 17px; }
.modal-target {
    font-size: 12.5px;
    color: var(--dim);
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 8px 11px;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 3px; }

/* ═══════════════════════════════════ التنبيه ════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translate(-50%, 14px);
    background: var(--panel-3);
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(251, 113, 133, .45); color: var(--danger); }

/* ═════════════════════════════════ التضييق ══════════════════════════════════ */

@media (max-width: 1180px) {
    :root { --sidebar-w: 280px; }
    .brand small, .meter small { display: none; }
}

@media (max-width: 900px) {
    .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .sidebar { border-inline-start: 0; border-top: 1px solid var(--line); max-height: 46vh; }
    .topbar { flex-wrap: wrap; height: auto; padding: 10px var(--pad); gap: 10px; }
}
