/* core.css — shared by every page (front + admin).
   Base reset + global utilities (tooltip; future modal/alert live here too). */

/* --- Color system ------------------------------------------------------- */
/* The whole UI is built on these tokens — don't hardcode colors in CSS, use a
   var(). Built on the 4 Gray brand colors:
   light blue = accent/primary interactions, dark blue = navy (dark surfaces,
   headings), red = danger, yellow = warning. */
:root {
    /* Brand */
    --g-blue:      #009cdb;   /* light blue */
    --g-dark-blue: #1b2845;   /* dark blue  */
    --g-red:       #e21636;
    --g-yellow:    #fbbf16;

    /* Accent (light blue) — primary buttons, focus, links, active, selected */
    --accent:       var(--g-blue);
    --accent-hover: #0082b8;
    --accent-soft:  #e3f4fc;
    --ring:         rgba(0, 156, 219, .22);   /* focus glow */

    /* Navy (dark blue) — dark surfaces, headings, strong text, tooltips */
    --navy:       var(--g-dark-blue);
    --navy-hover: #2a3a5e;

    /* Status */
    --danger:       var(--g-red);
    --danger-soft:  #fdecef;
    --warning:      var(--g-yellow);
    --warning-soft: #fef5db;
    --warning-ink:  #946d00;   /* readable amber for text/icons on light bg */
    --success:      #1e9e6a;
    --success-soft: #e3f6ee;

    /* Surfaces & cool neutrals (harmonized with the navy) */
    --surface:       #ffffff;
    --bg:            #f3f5f9;   /* page background */
    --hover:         #f4f6fa;   /* subtle row/hover bg */
    --sunken:        #f6f8fb;   /* inputs / disabled bg */
    --border-light:  #eef0f5;
    --border:        #e3e7ef;
    --border-strong: #d2d7e2;

    /* Shape — site-wide cap: never exceed this radius on anything. */
    --radius: 4px;

    /* Text */
    --text:        #2a3447;   /* body */
    --text-strong: var(--navy);
    --text-muted:  #5e6678;   /* labels, secondary */
    --text-faint:  #99a1b3;   /* placeholders, faint */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* --- Buttons (app-wide) ------------------------------------------------- */
.sc-btn {
    display: inline-block; text-align: center; text-decoration: none;
    font-size: .8rem; font-weight: 600; cursor: pointer;
    padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border);
    background: #fff; color: var(--text);
}
.sc-btn:hover { background: var(--hover); }
.sc-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-btn--primary:hover { background: var(--accent-hover); }
.sc-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
/* re-assert the red bg + white text on hover, else the base .sc-btn:hover
   (gray bg) clobbers it → unreadable white-on-gray; just darken the red. */
.sc-btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; filter: brightness(.92); }

/* --- Global tooltip ----------------------------------------------------- */
/* Any element with [data-sc-tip="..."] gets a hover/focus tooltip, positioned
   by core.js. A single floating node is reused for all of them. */
.sc-tip {
    position: fixed;
    z-index: 2000;
    background: var(--navy);
    color: #fff;
    padding: 5px 10px;
    border-radius: var(--radius);
    font-size: .72rem;
    line-height: 1.3;
    max-width: 300px;
    white-space: normal;        /* let long text (e.g. file titles) wrap instead of overflowing */
    overflow-wrap: anywhere;
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .12s ease, transform .12s ease;
}
.sc-tip.is-visible { opacity: 1; transform: translateY(0); }
/* Caret pointing back at the trigger. core.js sets [data-pos] + the
   --sc-tip-caret offset (the trigger's centre, so it still points correctly
   after the tooltip is clamped to the viewport edge). */
.sc-tip::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--navy);
    transform: rotate(45deg);
}
.sc-tip[data-pos="top"]::after    { bottom: -3px; left: var(--sc-tip-caret, 50%); margin-left: -4px; }
.sc-tip[data-pos="bottom"]::after { top: -3px;    left: var(--sc-tip-caret, 50%); margin-left: -4px; }
.sc-tip[data-pos="right"]::after  { left: -3px;   top:  var(--sc-tip-caret, 50%); margin-top: -4px; }
.sc-tip[data-pos="left"]::after   { right: -3px;  top:  var(--sc-tip-caret, 50%); margin-top: -4px; }

/* --- Custom searchable select (SC.select) ------------------------------- */
.sc-select { position: relative; }
.sc-select__native { display: none; }              /* hidden, but still submits */
.sc-select__trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font: inherit; font-size: .88rem; padding: 10px 12px; cursor: pointer; text-align: left;
    border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text);
}
.sc-select__trigger:focus,
.sc-select.is-open .sc-select__trigger { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.sc-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-select__value.is-placeholder { color: var(--text-faint); }
.sc-select__trigger svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--text-faint); transition: transform .15s ease; }
.sc-select.is-open .sc-select__trigger svg { transform: rotate(180deg); }

.sc-select__panel {
    position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 14px 34px rgba(76, 87, 125, .18); overflow: hidden;
}
/* Opens upward when there isn't room below (set by JS). */
.sc-select.is-up .sc-select__panel { top: auto; bottom: calc(100% + 6px); }
/* Anchors to the trigger's right edge when a wide panel would overflow the
   viewport's right side (set by JS) — keeps the page from scrolling sideways. */
.sc-select.is-right .sc-select__panel { left: auto; right: 0; }
.sc-select__search { padding: 8px; border-bottom: 1px solid var(--border-light); }
.sc-select__search input {
    width: 100%; font: inherit; font-size: .82rem; padding: 8px 11px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--sunken); color: var(--text);
}
/* iOS Safari zooms the whole page into any focused field under 16px — keep the search box at 16px on touch screens. */
@media (hover: none), (pointer: coarse) { .sc-select__search input { font-size: 16px; } }
.sc-select__search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); background: #fff; }
.sc-select__options { list-style: none; margin: 0; padding: 6px; max-height: 240px; overflow-y: auto; }
.sc-select__option {
    padding: 9px 11px; border-radius: var(--radius); font-size: .85rem; color: var(--text); cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-select__option + .sc-select__option { margin-top: 3px; }   /* gap so hover states don't touch */
.sc-select__option:hover, .sc-select__option.is-highlight { background: var(--hover); }
.sc-select__option.is-selected { color: var(--accent); font-weight: 600; }
/* Optional color dot + grouped section headers (opt-in via data-sc-color / <optgroup>). */
.sc-select__option.has-dot { display: flex; align-items: center; }
/* .has-dot sets display:flex, which would beat the [hidden] attribute — keep
   filtering/search able to hide these options. */
.sc-select__option.has-dot[hidden] { display: none; }
.sc-select__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex: 0 0 auto; }
/* data-sc-dot="square" on the <select>: a square swatch (the CCL team pickers, 2026-09-25) */
.sc-select__dot--square { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.sc-select__value .sc-select__dot { vertical-align: middle; }
/* Grouped section header — a clear bold band, full width across grid columns.
   Sticky so the current category stays visible while scrolling the list. */
.sc-select__group { position: sticky; top: -6px; z-index: 2;
    margin: 6px 0 4px; padding: 7px 11px; background: var(--sunken); border: 1px solid var(--border-light); border-radius: var(--radius);
    font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-strong); pointer-events: none; grid-column: 1 / -1; }
.sc-select__options > .sc-select__group:first-child { margin-top: 0; }
.sc-select__group + .sc-select__option { margin-top: 0; }

/* Multi-select: a checkbox in front of each option. */
.sc-select--multi .sc-select__option { position: relative; padding-left: 32px; }
.sc-select--multi .sc-select__option::before { content: ''; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; border: 1.5px solid var(--border); border-radius: 4px; background: #fff; box-sizing: border-box; }
.sc-select--multi .sc-select__option.is-selected::before { background: var(--accent); border-color: var(--accent); }
.sc-select--multi .sc-select__option.is-selected::after { content: ''; position: absolute; left: 16.5px; top: 50%;
    width: 3.5px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-62%) rotate(45deg); }
.sc-select__empty { padding: 14px 10px; color: var(--text-faint); font-size: .82rem; text-align: center; }
/* Multi-select picks as chips in the trigger (an × each, then "+N"), and the panel's foot: count + Clear all (2026-09-17). */
.sc-select--multi .sc-select__trigger { height: auto; min-height: var(--sc-ctl, 36px); padding-top: 3px; padding-bottom: 3px; }
.sc-select--multi .sc-select__value { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: normal; }
.sc-select__chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 2px 4px 2px 8px; border-radius: 4px; background: var(--accent-soft, #e6f4fb); color: var(--accent); font-size: .8rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
/* ONE chip + "+N" stay on ONE line: the chip shrinks and its label ellipsises, the "+N" never wraps under it */
.sc-select--multi .sc-select__value--one { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.sc-select__value--one .sc-select__chip { flex: 0 1 auto; min-width: 0; }
.sc-select__value--one .sc-select__chip--more { flex: none; }
.sc-select__chip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sc-select__chip-x { flex: none; }
.sc-select__chip--more { padding: 2px 8px; background: var(--sunken, #f3f5f9); color: var(--text-muted); }
.sc-select__chip-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.sc-select__chip-x:hover { opacity: 1; background: rgba(0,0,0,.08); }
.sc-select__chip-x svg { width: 10px; height: 10px; }
.sc-select__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border-light, var(--border)); font-size: .8rem; color: var(--text-muted); }
.sc-select__foot[hidden] { display: none; }
.sc-select__clear { padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font: inherit; font-size: .78rem; font-weight: 600; color: var(--text); cursor: pointer; }
.sc-select__clear:hover { border-color: var(--accent); color: var(--accent); }

/* --- SC.dialog (swal-style alert / confirm / prompt) -------------------- */
/* Blocks page scroll while any dialog is open. */
.sc-dialog-lock { overflow: hidden; }

.sc-dialog {
    position: fixed; inset: 0; z-index: 1000000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(27, 40, 69, .45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .16s ease;
}
.sc-dialog.is-open { opacity: 1; }

.sc-dialog__card {
    width: 100%; max-width: 420px;
    background: var(--surface); border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(27, 40, 69, .32);
    padding: 28px 26px 24px; text-align: center;
    transform: translateY(8px) scale(.97); transition: transform .18s ease;
}
.sc-dialog.is-open .sc-dialog__card { transform: none; }

.sc-dialog__icon {
    width: 56px; height: 56px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.sc-dialog__icon svg { width: 30px; height: 30px; }
.sc-dialog__icon--success  { background: var(--success-soft); color: var(--success); }
.sc-dialog__icon--danger   { background: var(--danger-soft);  color: var(--danger); }
.sc-dialog__icon--warning  { background: var(--warning-soft); color: var(--warning-ink); }
.sc-dialog__icon--info     { background: var(--accent-soft);  color: var(--accent); }
.sc-dialog__icon--question { background: var(--accent-soft);  color: var(--accent); }

.sc-dialog__title {
    margin: 0 0 6px; font-size: 1.15rem; font-weight: 600; color: var(--text-strong);
}
.sc-dialog__text {
    margin: 0; font-size: .9rem; line-height: 1.55; color: var(--text-muted);
    white-space: pre-line; word-wrap: break-word;
}
.sc-dialog__title + .sc-dialog__text { margin-top: 4px; }

.sc-dialog__input {
    width: 100%; margin-top: 16px; font: inherit; font-size: .9rem;
    padding: 10px 12px; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--sunken);
}
.sc-dialog__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); background: #fff; }
textarea.sc-dialog__input { resize: vertical; min-height: 84px; }

.sc-dialog__actions {
    margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.sc-dialog__actions .sc-btn { min-width: 96px; padding: 9px 18px; }

/* --- SC.toast (transient corner notifications) -------------------------- */
.sc-toast-wrap {
    position: fixed; z-index: 1000001; right: 18px; bottom: 18px;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
    pointer-events: none;
}
.sc-toast {
    display: flex; align-items: center; gap: 9px;
    max-width: 360px;
    background: var(--navy); color: #fff;
    padding: 10px 15px; border-radius: var(--radius);
    font-size: .82rem; line-height: 1.35;
    box-shadow: 0 10px 28px rgba(27, 40, 69, .28);
    border-left: 3px solid transparent;
    opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
}
.sc-toast.is-open { opacity: 1; transform: none; }
.sc-toast__icon { display: inline-flex; flex: 0 0 auto; }
.sc-toast__icon svg { width: 17px; height: 17px; }
.sc-toast--success { border-left-color: var(--success); }
.sc-toast--success .sc-toast__icon { color: #62d6a4; }
.sc-toast--danger  { border-left-color: var(--danger); }
.sc-toast--danger .sc-toast__icon  { color: #ff7b8f; }
.sc-toast--warning { border-left-color: var(--warning); }
.sc-toast--warning .sc-toast__icon { color: var(--warning); }
.sc-toast--info    { border-left-color: var(--accent); }
.sc-toast--info .sc-toast__icon    { color: #5cc6f0; }

/* --- SC.fileModal — reusable "open a set of files" modal ----------------
   One implementation for the Files Browser folder-expand, the social "View
   all", and the Page Studio carousel "View all". Sits BELOW the file viewer
   (z 1200) so opening a file layers on top. */
.scfl-ov { position: fixed; inset: 0; z-index: 1335; display: flex; align-items: center; justify-content: center; padding: 4vh 18px; }
.scfl-ov__bg { position: absolute; inset: 0; background: rgba(15, 20, 35, .62); }
.scfl { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 1080px; max-height: 90vh;
    background: var(--surface); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(16, 24, 40, .4); overflow: hidden; }
body.scfl-open { overflow: hidden; }

.scfl__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-light); flex: 0 0 auto; }
.scfl__title { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scfl__count { flex: 0 0 auto; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--text-muted);
    background: var(--sunken); border: 1px solid var(--border-light); padding: 3px 9px; border-radius: 999px; }
.scfl__x { margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-muted); cursor: pointer; }
.scfl__x svg { width: 16px; height: 16px; }
.scfl__x:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }

/* Toolbar: search (left) · spacer · sort · view toggle */
.scfl__tools { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border-light); flex: 0 0 auto; flex-wrap: wrap; }
.scfl__search { display: inline-flex; align-items: center; gap: 7px; width: 260px; max-width: 100%;
    padding: 0 11px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.scfl__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.scfl__search svg { width: 15px; height: 15px; color: var(--text-faint); flex: 0 0 auto; }
.scfl__search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: .86rem; color: var(--text); }
.scfl__toolsp { flex: 1 1 auto; }
.scfl__tools .sc-select { width: 176px; flex: 0 0 auto; }
.scfl__tools .sc-select__trigger { height: 38px; padding: 0 12px; font-size: .84rem; }
.scfl__views { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.scfl__views button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px;
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.scfl__views button + button { border-left: 1px solid var(--border); }
.scfl__views button svg { width: 17px; height: 17px; }
.scfl__views button:hover { background: var(--hover); color: var(--text); }
.scfl__views button.is-on { background: var(--accent-soft); color: var(--accent); }

.scfl__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }
.scfl__note { padding: 48px 0; text-align: center; color: var(--text-muted); font-size: .9rem; }

/* Cards */
.scfl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.scfl-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--border-light);
    border-radius: var(--radius); background: #fff; cursor: pointer; overflow: hidden; font: inherit; }
.scfl-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scfl-card__thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10;
    background: var(--sunken); overflow: hidden; }
.scfl-card__thumb i { font-size: 30px; color: var(--text-faint); }
.scfl-card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scfl-card__type { position: absolute; right: 6px; bottom: 6px; z-index: 1; font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
    color: #fff; background: rgba(16, 24, 40, .72); padding: 2px 6px; border-radius: var(--radius); }
.scfl-card__title { padding: 9px 11px 0; font-size: .84rem; font-weight: 600; color: var(--text-strong); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: calc(1.3em * 2); }   /* reserve 2 lines so the meta line aligns across a row */
.scfl-card__meta { padding: 3px 11px 11px; font-size: .74rem; color: var(--text-muted); }

/* List (compact rows) */
.scfl-list { display: flex; flex-direction: column; gap: 6px; }
.scfl-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 10px;
    border: 1px solid var(--border-light); border-radius: var(--radius); background: #fff; cursor: pointer; font: inherit; }
.scfl-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.scfl-row__thumb { position: relative; flex: 0 0 auto; width: 48px; height: 40px; border-radius: var(--radius); overflow: hidden;
    background: var(--sunken); display: flex; align-items: center; justify-content: center; }
.scfl-row__thumb i { font-size: 16px; color: var(--text-faint); }
.scfl-row__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scfl-row__main { flex: 1 1 auto; min-width: 0; }
.scfl-row__title { display: block; font-size: .86rem; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scfl-row__meta { display: block; font-size: .74rem; color: var(--text-muted); margin-top: 1px; }
.scfl-row__type { flex: 0 0 auto; font-size: 9.5px; font-weight: 700; letter-spacing: .03em; color: var(--text-muted);
    background: var(--sunken); border: 1px solid var(--border-light); padding: 2px 7px; border-radius: var(--radius); }

/* Table */
.scfl-t { width: 100%; border-collapse: collapse; font-size: .84rem; }
.scfl-t thead th { position: sticky; top: -16px; z-index: 1; background: var(--surface); text-align: left; font-size: .72rem;
    font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; }
.scfl-t thead th:first-child { cursor: default; width: 46px; }
.scfl-t thead th .is-arrow, .scfl-t thead th.is-sorted span::after { content: ""; }
.scfl-t thead th.is-sorted { color: var(--accent); }
.scfl-t thead th.is-sorted span::after { content: "▲"; font-size: 8px; margin-left: 5px; }
.scfl-t thead th.is-desc span::after { content: "▼"; }
.scfl-t__num { text-align: right; }
.scfl-t__row { cursor: pointer; }
.scfl-t__row > td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.scfl-t__row:hover > td { background: var(--accent-soft); }
.scfl-t__thumb { display: inline-block; width: 40px; height: 30px; border-radius: 3px; background: var(--sunken) center/cover no-repeat; }
.scfl-t__thumb.is-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); }
.scfl-t__thumb.is-empty i { font-size: 13px; }
.scfl-t__name { font-weight: 600; color: var(--text-strong); }
.scfl-t__type { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; color: var(--text-muted); background: var(--sunken);
    border: 1px solid var(--border-light); padding: 2px 7px; border-radius: var(--radius); }
.scfl-t__num { color: var(--text-muted); }

@media (max-width: 620px) {
    .scfl-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .scfl__search { width: 100%; order: 3; }
    .scfl__toolsp { display: none; }
}

/* --- SC.download progress bubbles (sticky bottom-right) ----------------- */
.sc-dlq { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none; width: min(320px, calc(100vw - 32px)); }
.sc-dl-item { pointer-events: auto; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16, 24, 40, .18); padding: 11px 13px;
    opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.sc-dl-item.is-in { opacity: 1; transform: none; }
.sc-dl-item.is-out { opacity: 0; transform: translateY(8px); }
.sc-dl-item__top { display: flex; align-items: center; gap: 8px; }
.sc-dl-item__ic { display: inline-flex; color: var(--accent); flex: 0 0 auto; }
.sc-dl-item__ic svg { width: 16px; height: 16px; }
.sc-dl-item__name { flex: 1 1 auto; min-width: 0; font-size: .82rem; font-weight: 600; color: var(--text-strong);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-dl-item__pct { flex: 0 0 auto; font-size: .74rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sc-dl-item__bar { position: relative; margin-top: 8px; height: 5px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.sc-dl-item__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--accent); transition: width .18s ease; }
.sc-dl-item.is-done .sc-dl-item__ic { color: var(--success); }
.sc-dl-item.is-done .sc-dl-item__fill { background: var(--success); }
.sc-dl-item.is-done .sc-dl-item__pct { color: var(--success); }
.sc-dl-item.is-fail .sc-dl-item__fill { background: var(--danger); }
.sc-dl-item.is-fail .sc-dl-item__pct { color: var(--danger); }
/* Indeterminate (no Content-Length): a sliding sliver instead of a fixed %. */
.sc-dl-item.is-indet .sc-dl-item__fill { width: 40% !important; animation: sc-dl-indet 1.1s ease-in-out infinite; }
@keyframes sc-dl-indet { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .sc-dl-item, .sc-dl-item__fill { transition: none; } .sc-dl-item.is-indet .sc-dl-item__fill { animation: none; } }

/* SC.reorder (core.js, 2026-09-29) — the drop placeholder + the page state while an item is dragged */
.sc-reorder__ph { box-sizing: border-box; border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); list-style: none; }
body.sc-reordering, body.sc-reordering * { cursor: grabbing !important; user-select: none !important; }
