/* ═══════════════════════════════════════
   نظام 2028 · 1280px · FA محلي
   ═══════════════════════════════════════ */

:root {
    --shell-w: 1440px;
    --side-w: 230px;
    --queue-w: 360px;
    --font: Tahoma, 'Segoe UI', Arial, sans-serif;

    --side-bg: #161618;
    --side-text: #a1a1aa;
    --side-on: #ffffff;
    --side-line: #10b981;
    --side-glow: rgba(16, 185, 129, 0.15);

    --work-bg: #ffffff;
    --page-bg: #eceef2;

    --ink: #111827;
    --ink-2: #374151;
    --ink-3: #6b7280;
    --line: #dde3ed;
    --line-2: #f4f6fa;

    --go: #059669;
    --go-bg: #ecfdf5;
    --go-line: #6ee7b7;
    --go-shadow: rgba(5, 150, 105, 0.22);

    --blue: #2563eb;
    --blue-bg: #eff6ff;
    --blue-line: #93c5fd;

    --no: #dc2626;
    --no-bg: #fef2f2;
    --no-line: #fca5a5;

    --r: 10px;
    --r-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: linear-gradient(160deg, #e8ecf4 0%, #f4f6fa 40%, #eef2f7 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Shell ── */
.shell {
    width: calc(100% - 32px);
    max-width: var(--shell-w);
    min-height: calc(100vh - 32px);
    margin: 16px auto;
    display: flex;
    flex-direction: column;
    background: var(--work-bg);
    border: 1px solid #cbd5e1;
    border-radius: var(--r-lg);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.shell-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-bottom: 2px solid #334155;
}

.badge-2027 {
    display: inline-grid;
    place-items: center;
    min-width: 52px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0f172a;
    background: linear-gradient(135deg, #34d399, #10b981);
    border: 2px solid #6ee7b7;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 4px 12px rgba(16,185,129,.35);
}

.shell-topbar-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.shell-main {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
}

/* ── Box frames (حواف مميزة) ── */
.box-frame {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.box-frame-head {
    border-color: var(--go-line);
    border-right: 3px solid var(--go);
    background: linear-gradient(180deg, #f0fdf8 0%, #fff 100%);
}

/* ── Icon wrap ── */
.ico-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.ico-wrap .fa {
    font-size: 16px;
    line-height: 1;
    width: 1em;
    text-align: center;
}

.ico-wrap-sm { width: 28px; height: 28px; border-radius: 8px; }
.ico-wrap-sm .fa { font-size: 14px; }

.ico-wrap-lg { width: 46px; height: 46px; border-radius: 12px; }
.ico-wrap-lg .fa { font-size: 20px; }

.ico-wrap-accent {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.ico-wrap-green {
    background: var(--go-bg);
    color: var(--go);
}

/* ── Sidebar sticky + ألوان المصادر ── */
.side {
    width: var(--side-w);
    flex-shrink: 0;
    background: var(--side-bg);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    gap: 10px;
    border-left: 1px solid #27272a;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.side-link.box-frame {
    border: none !important;
    box-shadow: none !important;
}

.side-top.box-frame,
.side-foot.box-frame {
    border: none !important;
    box-shadow: none !important;
}

.side-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-logo strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--side-on);
}

.side-logo small {
    display: block;
    font-size: 11px;
    color: #71717a;
    margin-top: 1px;
}

.side-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 2px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--side-text);
    background: transparent !important;
    border-color: transparent !important;
    text-decoration: none;
    border-radius: var(--r);
    transition: background 0.15s, color 0.15s;
}

.side-link .ico-wrap {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.side-link:hover {
    color: var(--side-on);
    background: rgba(255, 255, 255, 0.04) !important;
}

.side-link:hover .ico-wrap {
    background: rgba(16, 185, 129, 0.12);
    color: var(--side-line);
}

.side-link.is-on {
    color: var(--side-on);
    font-weight: 700;
    box-shadow: none;
}

/* حواف ملونة لكل قسم في القائمة */
.side-link-dash { border-inline-start: 3px solid transparent; }
.side-link-mob  { border-inline-start: 3px solid rgba(245, 158, 11, 0.35); }
.side-link-mo   { border-inline-start: 3px solid rgba(139, 92, 246, 0.35); }
.side-link-files { border-inline-start: 3px solid rgba(14, 165, 233, 0.35); }

.side-link-mob .ico-wrap { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.side-link-mo .ico-wrap  { background: rgba(139, 92, 246, 0.14); color: #a78bfa; }
.side-link-files .ico-wrap { background: rgba(14, 165, 233, 0.14); color: #38bdf8; }
.side-link-dash .ico-wrap { background: rgba(16, 185, 129, 0.14); color: #34d399; }

.side-link-mob.is-on  { border-inline-start-color: #f59e0b !important; background: rgba(245, 158, 11, 0.08) !important; }
.side-link-mo.is-on   { border-inline-start-color: #8b5cf6 !important; background: rgba(139, 92, 246, 0.08) !important; }
.side-link-files.is-on { border-inline-start-color: #0ea5e9 !important; background: rgba(14, 165, 233, 0.08) !important; }
.side-link-dash.is-on { border-inline-start-color: var(--side-line) !important; }

.side-link-mob.is-on .ico-wrap  { background: rgba(245, 158, 11, 0.25); color: #f59e0b; }
.side-link-mo.is-on .ico-wrap   { background: rgba(139, 92, 246, 0.25); color: #8b5cf6; }
.side-link-files.is-on .ico-wrap { background: rgba(14, 165, 233, 0.25); color: #0ea5e9; }

.side-foot {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    border-radius: var(--r);
    box-shadow: none !important;
}

.side-user {
    font-size: 13px;
    color: var(--side-on);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-out-form { margin: 0; padding: 0; display: inline; }

.side-out-form .side-out {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.side-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #f87171;
}

.side-out:hover { color: #fca5a5; }

.side-out .fa { font-size: 14px; }

.side-cache {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}

.side-cache:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: #f0fdfa;
}

.side-cache:disabled {
    opacity: .6;
    cursor: wait;
}

.side-cache .fa { font-size: 13px; }

/* ── Workspace ── */
.work {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--work-bg);
}

.work-head {
    margin: 14px 14px 0;
    padding: 16px 18px;
}

.work-head-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.work-eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--go);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.work-head h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}

.work-body {
    flex: 1;
    padding: 16px 18px 24px;
    background: #f8fafc;
}

/* ── Footer ── */
.shell-footer {
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 14px 20px;
}

.shell-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ink-3);
}

.shell-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shell-footer-brand strong {
    color: var(--ink);
    font-weight: 700;
}

.shell-footer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shell-footer-meta .fa {
    margin-left: 4px;
    color: var(--go);
    font-size: 11px;
}

.shell-footer-dot {
    color: #cbd5e1;
}

.badge-2027-sm {
    min-width: 44px;
    padding: 3px 8px;
    font-size: 11px;
    letter-spacing: 1px;
}

/* ── Blocks (cards) ── */
.block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.block-top {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--line-2);
}

.block-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.block-ico {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: none;
    box-shadow: none;
}

.block-ico .fa { font-size: 18px; line-height: 1; }

.block-ico-green { background: var(--go-bg); color: var(--go); }
.block-ico-blue  { background: var(--blue-bg); color: var(--blue); }

.block-top h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.block-top p {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 3px;
}

.block-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.block-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--go);
    background: var(--go-bg);
    border: 1px solid var(--go-line);
    padding: 4px 11px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.block-count .fa { margin-left: 4px; }

/* ── Queue rail (يسار الشاشة · مركز السحب) ── */
.queue-rail {
    width: var(--queue-w);
    flex-shrink: 0;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #eef2f7 0%, #fff 180px);
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    z-index: 15;
    box-shadow: inset 1px 0 0 rgba(255,255,255,0.6);
}

.queue-rail-inner {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: hidden;
}

.queue-rail-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.queue-rail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
}

.queue-rail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.queue-rail-title h2 {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
}

.queue-rail-title p {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.queue-rail-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.queue-rail-ico .fa { font-size: 16px; }

.queue-rail-count {
    font-size: 11px;
    font-weight: 800;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.35);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.queue-rail-count .fa { margin-left: 4px; }

.queue-rail-toolbar {
    flex-shrink: 0;
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.queue-rail-toolbar .btn-go {
    box-shadow: 0 2px 8px var(--go-shadow);
}

/* ── منطقة السحب الحي ── */
.pull-live-slot {
    flex-shrink: 0;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding: 0 12px;
}

.pull-live-slot.is-active {
    max-height: 280px;
    opacity: 1;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f0fdf8 0%, #fff 100%);
}

.out-wait-pull { width: 100%; }

.queue-rail-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.src-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid;
}

.src-tag .fa { font-size: 10px; }

.src-tag.src-mobiltna { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.src-tag.src-modyolo  { color: #6d28d9; background: #f5f3ff; border-color: #c4b5fd; }
.src-tag.src-direct   { color: #0369a1; background: #f0f9ff; border-color: #7dd3fc; }

.queue-rail .q-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 12px 12px;
    gap: 8px;
    margin: 0;
    min-height: 60px;
}

.queue-rail-body-label {
    flex-shrink: 0;
    padding: 10px 12px 6px;
    font-size: 10px;
    font-weight: 800;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.queue-rail-body-label .fa {
    margin-left: 5px;
    opacity: 0.7;
}

.btn-block { width: 100%; justify-content: center; }

/* ── نتائج السحب (روابط جاهزة) ── */
.queue-rail-done {
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
    display: flex;
    flex-direction: column;
    min-height: 100px;
    max-height: 36vh;
}

.queue-rail-done-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 8px;
    font-size: 11px;
    font-weight: 800;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.queue-rail-done-head .fa { margin-left: 5px; }

.queue-rail-done-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--go);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.queue-rail-done:not(.has-results) .queue-rail-done-count {
    background: #cbd5e1;
}

.queue-rail-results {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 10px 12px;
    margin: 0;
    min-height: 0;
    scroll-behavior: smooth;
}

.queue-rail-results .out-ok {
    padding: 10px;
    font-size: 12px;
    border: 1px solid var(--go-line);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.queue-rail-results .out-ok-head { margin-bottom: 6px; }
.queue-rail-results .out-ok-name { font-size: 12px; font-weight: 700; }
.queue-rail-results .out-ok-tags { gap: 4px; flex-wrap: wrap; }
.queue-rail-results .out-tag { font-size: 10px; padding: 2px 6px; }

.queue-rail-results .url-box {
    display: block;
    margin-top: 8px;
    border: 1px solid var(--go-line);
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.queue-rail-results .url-box-head {
    padding: 6px 8px;
    background: rgba(16, 185, 129, 0.15);
    border-bottom: 1px solid rgba(16, 185, 129, 0.25);
}

.queue-rail-results .url-box-title {
    font-size: 10px;
    color: #6ee7b7;
}

.queue-rail-results .url-box-body {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.queue-rail-results .url-box-text {
    flex: 1;
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 10px;
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
    color: #e2e8f0;
    background: transparent;
    cursor: pointer;
    direction: ltr;
    text-align: left;
}

.queue-rail-results .url-box-copy {
    flex-shrink: 0;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    width: 34px;
}

.queue-rail-results .out-btns {
    margin-top: 8px;
    gap: 6px;
}

.queue-rail-results .out-btns .btn-xs {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    padding: 7px 8px;
}

.block-queue {
    margin-top: 0;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.q-row {
    background: #fff;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--blue);
    border-radius: var(--r);
    padding: 8px 10px;
    box-shadow: none;
    content-visibility: auto;
    contain-intrinsic-size: auto 100px;
}

.q-meta-compact {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 6px;
    margin: 6px 0;
}

.q-inp {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    font: inherit;
    font-size: 12px;
    background: #fff;
}

.q-url-compact {
    display: flex;
    gap: 4px;
    align-items: center;
}

.q-inp-url { flex: 1; min-width: 0; direction: ltr; text-align: left; font-size: 11px; }

.q-url-hint {
    font-size: 10px;
    color: var(--ink-3);
    margin-top: 4px;
    word-break: break-all;
    direction: ltr;
    text-align: left;
    opacity: 0.85;
}

.pull-pro-lite { padding: 12px; box-shadow: none; }
.pull-pro-lite .pull-pro-foot { display: none; }

/* ── Form ── */
.fld { margin-bottom: 14px; }

.fld label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.fld label .fa {
    color: var(--blue);
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.btn .fa { font-size: 14px; margin-left: 2px; }

.fld input,
.fld select,
.fld textarea {
    width: 100%;
    padding: 10px 13px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fld input:focus,
.fld select:focus,
.fld textarea:focus {
    outline: none;
    border-color: var(--go);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12), inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fld textarea {
    min-height: 120px;
    resize: vertical;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.fld-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fld-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--r);
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.3;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-go {
    background: var(--go);
    color: #fff;
    border-color: #047857;
    box-shadow: 0 2px 6px var(--go-shadow);
}

.btn-go:hover:not(:disabled) { background: #047857; }

.btn-line {
    background: #fff;
    color: var(--ink-2);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.btn-line:hover:not(:disabled) {
    background: var(--line-2);
    border-color: #c5ced9;
}

.btn-no {
    background: #fff;
    color: var(--no);
    border-color: var(--no-line);
    box-shadow: var(--shadow-sm);
}

.btn-no:hover:not(:disabled) { background: var(--no-bg); }

.btn-xs { padding: 6px 12px; font-size: 12px; }

.btn-ico {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 14px;
}

/* ── Queue items ── */
.q-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.q-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--ink-3);
    font-size: 12px;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background: #fff;
    line-height: 1.6;
}

.q-empty small { font-size: 11px; color: #94a3b8; }

.q-empty .fa {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.q-row:hover { background: #fafbfc; }

.q-row.src-mobiltna {
    border-inline-start-color: #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, #fff 55%);
}

.q-row.src-modyolo {
    border-inline-start-color: #8b5cf6;
    background: linear-gradient(90deg, #f5f3ff 0%, #fff 55%);
}

.q-row.src-direct {
    border-inline-start-color: #0ea5e9;
    background: linear-gradient(90deg, #f0f9ff 0%, #fff 55%);
}

.q-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.q-row-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.q-idx {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.q-src-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid;
    white-space: nowrap;
}

.q-src-badge .fa { font-size: 10px; }

.q-src-badge.src-mobiltna { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.q-src-badge.src-modyolo  { color: #6d28d9; background: #f5f3ff; border-color: #c4b5fd; }
.q-src-badge.src-direct   { color: #0369a1; background: #f0f9ff; border-color: #7dd3fc; }

.q-row.src-mobiltna .q-idx { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
.q-row.src-modyolo .q-idx  { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.q-row.src-direct .q-idx   { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }

.q-del {
    width: 26px;
    height: 26px;
    padding: 0;
    min-width: 0;
}

.q-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.q-label .fa { color: var(--ink-3); font-size: 11px; flex-shrink: 0; }

.q-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.q-meta-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-3);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.q-meta-field input,
.q-meta-field select {
    width: 100%;
    padding: 7px 9px;
    font: inherit;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

/* ── شريط الرابط بالعرض الكامل ── */
.q-url-bar {
    width: 100%;
    margin-top: 2px;
    padding: 10px 10px 8px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.q-url-bar.src-mobiltna {
    border-color: #d97706;
    background: linear-gradient(180deg, #1c1408 0%, #0f172a 100%);
    box-shadow: inset 0 2px 0 rgba(245, 158, 11, 0.25);
}

.q-url-bar.src-modyolo {
    border-color: #7c3aed;
    background: linear-gradient(180deg, #140f1f 0%, #0f172a 100%);
    box-shadow: inset 0 2px 0 rgba(139, 92, 246, 0.25);
}

.q-url-bar.src-direct {
    border-color: #0284c7;
    background: linear-gradient(180deg, #0c1929 0%, #0f172a 100%);
    box-shadow: inset 0 2px 0 rgba(14, 165, 233, 0.25);
}

.q-url-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.q-url-bar-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #94a3b8;
}

.q-url-bar.src-mobiltna .q-url-bar-label { color: #fbbf24; }
.q-url-bar.src-modyolo .q-url-bar-label  { color: #c4b5fd; }
.q-url-bar.src-direct .q-url-bar-label   { color: #7dd3fc; }

.q-url-copy {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.q-url-copy:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.q-url-copy .fa { font-size: 11px; }

.q-url-input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 10px 11px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.55;
    word-break: break-all;
    white-space: pre-wrap;
    resize: vertical;
    direction: ltr;
    text-align: left;
}

.q-url-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.q-url-bar.src-mobiltna .q-url-input:focus { border-color: rgba(245, 158, 11, 0.45); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12); }
.q-url-bar.src-modyolo .q-url-input:focus  { border-color: rgba(139, 92, 246, 0.45); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12); }
.q-url-bar.src-direct .q-url-input:focus   { border-color: rgba(14, 165, 233, 0.45); box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12); }

.q-url-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.q-url-open:hover { color: #cbd5e1; }

.q-url-bar.src-mobiltna .q-url-open:hover { color: #fbbf24; }
.q-url-bar.src-modyolo .q-url-open:hover  { color: #c4b5fd; }
.q-url-bar.src-direct .q-url-open:hover   { color: #7dd3fc; }

.q-url-open .fa { font-size: 10px; }

.q-url-hint-only {
    display: block;
    padding: 6px 10px 8px;
    font-size: 10px;
    color: var(--ink-3);
    background: rgba(0,0,0,0.02);
    border-top: 1px dashed var(--line);
}

.q-url-hint-only .fa { margin-left: 4px; opacity: 0.75; }

.q-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Outcomes ── */
.out-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.out-wait-pull {
    text-align: center;
    line-height: 1.5;
    padding: 16px 14px;
    background: linear-gradient(180deg, #f0fdf8 0%, #fff 100%);
    border: 1px solid var(--go-line);
    border-radius: var(--r);
}

.pull-pro {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--go-line);
    border-radius: var(--r);
    box-shadow: var(--shadow-md);
}

.pull-pro-init {
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
    padding: 20px;
    border-style: dashed;
    box-shadow: none;
}

.pull-pro-init .fa { margin-left: 6px; color: var(--go); }

.pull-pro-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.pull-pro-file {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    line-height: 1.4;
    word-break: break-word;
}

.pull-pro-file .fa {
    color: var(--go);
    margin-left: 5px;
}

.pull-pro-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

@keyframes pull-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
    .pull-pro-badge { animation: none; }
    .pull-progress-bar span { transition: none; }
}

.pull-pro-meter {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 6px 10px;
    align-items: center;
    margin-bottom: 12px;
}

.pull-pro-meter-pct {
    grid-row: 1 / 3;
    font-size: 26px;
    font-weight: 800;
    color: var(--go);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    min-width: 72px;
}

.pull-pro-meter-pct small {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.75;
}

.pull-pro-bar {
    margin-bottom: 0;
}

.pull-pro-ratio {
    grid-column: 2;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: left;
}

.pull-pro-ratio span {
    opacity: 0.5;
    margin: 0 3px;
}

.pull-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.pull-progress-bar span {
    display: block;
    height: 100%;
    min-width: 2%;
    background: linear-gradient(90deg, #059669, #34d399);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.pull-pro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.pull-pro-stat {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}

.pull-pro-stat-k {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-3);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.pull-pro-stat strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.pull-pro-stat-total { border-top: 2px solid #0ea5e9; }
.pull-pro-stat-done  { border-top: 2px solid #34d399; }
.pull-pro-stat-done strong { color: #047857; }
.pull-pro-stat-left  { border-top: 2px solid #f59e0b; }
.pull-pro-stat-left strong { color: #b45309; }

.pull-pro-foot {
    font-size: 10px;
    color: var(--ink-3);
    text-align: center;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.pull-pro-foot .fa { margin-left: 4px; opacity: 0.7; }

@media (max-width: 400px) {
    .pull-pro-stats { grid-template-columns: 1fr; }
    .pull-pro-meter-pct { font-size: 22px; }
}

.out-wait {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background: var(--line-2);
}

.out-wait .fa { margin-left: 6px; color: var(--blue); }

.out-ok {
    background: #fff;
    border: 1px solid var(--go-line);
    border-right: 4px solid var(--go);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-md);
}

.out-ok-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.out-ok-head .fa {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--go-bg);
    border: 1px solid var(--go-line);
    color: var(--go);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}

.out-ok-name {
    font-size: 14px;
    font-weight: 700;
    word-break: break-word;
}

.out-ok-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.out-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--line-2);
    color: var(--ink-2);
    border: 1px solid var(--line);
}

.out-tag-g { background: var(--go-bg); color: #047857; border-color: var(--go-line); }

/* ── URL boxes ── */
.url-box {
    border: 2px solid var(--blue-line);
    border-radius: var(--r);
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.url-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--blue-bg);
    border-bottom: 1px solid var(--blue-line);
}

.url-box-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue);
}

.url-box-title .fa { margin-left: 5px; }

.url-box-ext {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: var(--blue);
    padding: 2px 8px;
    border-radius: 4px;
}

.url-box-body {
    display: flex;
    align-items: stretch;
}

.url-box-text {
    flex: 1;
    display: block;
    padding: 12px 14px;
    font-family: Consolas, monospace;
    font-size: 12px;
    color: var(--ink);
    word-break: break-all;
    line-height: 1.5;
    cursor: pointer;
    min-width: 0;
}

.url-box-copy {
    flex-shrink: 0;
    width: 44px;
    border: none;
    border-right: 1px solid var(--line);
    background: #fff;
    color: var(--blue);
    cursor: pointer;
    font-size: 16px;
}

.url-box-copy:hover { background: var(--blue-bg); }

.url-field {
    border: 2px solid var(--line);
    border-radius: var(--r);
    background: #fff;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.url-field:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.url-field-input,
.fld textarea.url-area {
    width: 100%;
    border: none !important;
    box-shadow: none !important;
    font-family: Consolas, monospace !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    background: transparent !important;
}

.url-field-input {
    padding: 11px 12px !important;
}

.fld textarea.url-area {
    min-height: 130px;
    padding: 12px 14px !important;
}

.url-field-input:focus,
.fld textarea.url-area:focus {
    outline: none;
    box-shadow: none !important;
}

.out-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.btn-copy-link { min-width: 120px; }

.out-err {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r);
    border: 1px solid var(--no-line);
    border-right: 4px solid var(--no);
    background: var(--no-bg);
    color: #991b1b;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.out-err .fa { font-size: 18px; flex-shrink: 0; }

.out-note {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: var(--r);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.out-note.ok { background: var(--go-bg); color: #047857; border: 1px solid var(--go-line); }
.out-note.bad { background: var(--no-bg); color: #991b1b; border: 1px solid var(--no-line); }

/* ── Table ── */
.tbl-wrap {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tbl th {
    text-align: right;
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
    background: var(--line-2);
    border-bottom: 2px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tbl th .fa { margin-left: 4px; opacity: 0.7; }

.tbl td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tr:hover td { background: #f8fafc; }

.tbl-file {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tbl-file .fa { color: var(--blue); font-size: 15px; }

.tbl-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.tbl-acts .btn-xs { padding: 6px 10px; font-size: 12px; white-space: nowrap; }

/* ── Files hub ── */
.files-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--line-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.files-search {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    min-height: 42px;
}

.files-search .fa-search {
    color: var(--ink-3);
    font-size: 14px;
    flex-shrink: 0;
}

.files-search input {
    flex: 1;
    border: none;
    outline: none;
    font: inherit;
    font-size: 14px;
    background: transparent;
    min-width: 0;
}

.files-search-clear {
    border: none;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.files-search-clear:hover { color: var(--no); background: var(--no-bg); }

.files-tabs {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.files-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.files-tab .fa { font-size: 14px; opacity: 0.85; }

.files-tab-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--line-2);
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.files-tab.is-on {
    background: var(--blue-bg);
    border-color: var(--blue-line);
    color: var(--blue);
}

.files-tab--apps.is-on {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}

.files-tab--apps.is-on .files-tab-count {
    background: #059669;
    color: #fff;
}

.files-tab--games.is-on {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.files-tab--games.is-on .files-tab-count {
    background: #7c3aed;
    color: #fff;
}

.files-tab--tv.is-on {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.files-tab--tv.is-on .files-tab-count {
    background: #ea580c;
    color: #fff;
}

.files-tab.is-on .files-tab-count {
    background: var(--blue);
    color: #fff;
}

.files-panel { display: block; }
.files-panel[hidden] { display: none !important; }

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.file-tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s, border-color 0.15s;
    content-visibility: auto;
    contain-intrinsic-size: auto 160px;
}

.file-tile:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.file-tile--apps { border-top: 3px solid #10b981; }
.file-tile--games { border-top: 3px solid #8b5cf6; }
.file-tile--tv { border-top: 3px solid #f97316; }

.file-tile-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.file-tile-ico {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 17px;
}

.file-tile--apps .file-tile-ico {
    background: #ecfdf5;
    color: #059669;
}

.file-tile--games .file-tile-ico {
    background: #f5f3ff;
    color: #7c3aed;
}

.file-tile--tv .file-tile-ico {
    background: #fff7ed;
    color: #ea580c;
}

.file-tile-body {
    min-width: 0;
    flex: 1;
}

.file-tile-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.file-tile-size,
.file-tile-user,
.file-tile-miss {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 600;
}

.file-tile-miss {
    color: #dc2626;
}

.file-tile-user {
    display: flex;
    margin-top: 3px;
}

.file-tile-acts {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.file-tile-link {
    border-top: 1px solid var(--line-2);
    padding-top: 8px;
    margin-top: auto;
}

.file-tile-link summary {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.file-tile-link summary::-webkit-details-marker { display: none; }

.file-tile-link[open] summary { color: var(--blue); margin-bottom: 8px; }

.file-tile-url-wrap {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.file-tile-url-wrap textarea {
    flex: 1;
    min-width: 0;
    font-size: 10px;
    font-family: Consolas, monospace;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    resize: none;
    background: #f8fafc;
    color: var(--ink-2);
    line-height: 1.4;
    direction: ltr;
    text-align: left;
}

.file-tile-url-wrap .btn { flex-shrink: 0; padding: 6px 9px; }

/* legacy list alias */
.files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.file-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    content-visibility: auto;
    contain-intrinsic-size: auto 120px;
}

.file-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.file-card-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.file-card-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--blue-bg);
    color: var(--blue);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.file-card-name {
    font-size: 14px;
    font-weight: 700;
    word-break: break-word;
    margin-bottom: 6px;
}

.file-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.file-card-acts {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.file-card-url {
    width: 100%;
    margin-top: 0;
}

.file-card-url .q-url-input {
    min-height: 52px;
    resize: vertical;
}

.files-empty,
.files-no-match {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-3);
    font-size: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--r-lg);
    background: var(--line-2);
}

.files-empty--apps .fa { color: #10b981; opacity: 0.7; }
.files-empty--games .fa { color: #8b5cf6; opacity: 0.7; }
.files-empty--tv .fa { color: #f97316; opacity: 0.7; }

.files-empty .fa,
.files-no-match .fa {
    display: block;
    font-size: 28px;
    margin-bottom: 10px;
    opacity: 0.45;
}

.files-empty--apps .fa,
.files-empty--games .fa,
.files-empty--tv .fa {
    opacity: 0.7;
}

@media (max-width: 520px) {
    .files-grid {
        grid-template-columns: 1fr;
    }
}

.files-storage-info {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    font-size: 12px;
}

.files-storage-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--line);
}

.files-storage-row:last-child { border-bottom: none; }

.files-storage-k {
    font-weight: 700;
    color: var(--ink-2);
    min-width: 110px;
}

.files-storage-k .fa { margin-left: 5px; opacity: 0.75; }

.files-storage-v {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    font-size: 11px;
    color: var(--ink-3);
    background: transparent;
}

/* ── نتائج السحب — رابط بالعرض الكامل ── */
.out-ok-dl .q-url-bar {
    width: 100%;
    margin-bottom: 10px;
}

.out-ok-dl .q-url-input {
    min-height: 56px;
    resize: vertical;
    font-size: 11px;
}

.queue-rail-results .out-ok-dl {
    padding: 12px;
}

.queue-rail-results .out-ok-dl .out-ok-head .fa {
    width: 26px;
    height: 26px;
    font-size: 13px;
}

.queue-rail-results .out-ok-dl .out-btns {
    margin-top: 0;
}

.queue-rail-results .out-ok-dl .q-url-input {
    font-size: 10px;
    min-height: 48px;
}

@media (max-width: 600px) {
    .file-card-head { flex-direction: column; }
    .file-card-acts { width: 100%; }
    .file-card-acts .btn-xs { flex: 1; justify-content: center; }
    .files-tabs { width: 100%; }
    .files-tab { flex: 1; justify-content: center; }
}

/* ── Auth ── */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--page-bg);
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-box.wide { max-width: 520px; }

.auth-bar {
    background: var(--side-bg);
    color: #fff;
    padding: 30px 24px;
    text-align: center;
}

.auth-bar .ico-wrap {
    margin: 0 auto 12px;
}

.auth-bar strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
}

.auth-bar span {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.auth-form { padding: 24px; }

.auth-form h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 10px;
    color: var(--ink);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-2);
}

.auth-form h3:first-child { margin-top: 0; }

.auth-form h3 .fa { color: var(--go); }

.msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border-radius: var(--r);
    font-size: 13px;
    margin-bottom: 14px;
}

.msg-ok { background: var(--go-bg); color: #047857; border: 1px solid var(--go-line); }
.msg-bad { background: var(--no-bg); color: #991b1b; border: 1px solid var(--no-line); }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--side-bg);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--r);
    font-size: 13px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    border: 1px solid #333;
}

.toast .fa { margin-left: 6px; color: var(--side-line); }

/* ── Mobile ── */
@media (max-width: 1100px) {
    :root { --shell-w: 100%; --queue-w: 280px; --side-w: 210px; }
}

@media (max-width: 900px) {
    .shell-main { flex-direction: column; }
    .side {
        width: 100%;
        max-height: none;
        position: relative;
        border-left: none;
        border-bottom: 1px solid #27272a;
    }
    .side-menu { flex-direction: row; flex-wrap: wrap; }
    .side-link { flex: 1 1 45%; border-inline-start-width: 3px !important; }
    .side-link.is-on { border-bottom: 3px solid currentColor; border-inline-start-width: 3px !important; }
    .side-foot { display: flex; align-items: center; justify-content: space-between; }
    .queue-rail {
        width: 100%;
        position: relative;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--line);
        order: -1;
        box-shadow: none;
    }
    .queue-rail .q-list { max-height: 280px; }
    .q-meta { grid-template-columns: 1fr; }
    .work-head, .work-body { padding-left: 12px; padding-right: 12px; }
    .shell-footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 768px) {
    .shell { width: 100%; margin: 0; min-height: 100vh; border-radius: 0; border-left: none; border-right: none; }
}
