/* Layout: fixed sidebar + top search bar; content views swap in the main column. */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eceee9;
  --line: #dde1da;
  --line-strong: #c4cbc2;
  --fg: #18201c;
  --muted: #5b675f;
  --accent: #1d5a4b;
  --accent-fg: #ffffff;
  --accent-soft: #e0ece7;
  --ok: #2e7148;
  --ok-soft: #e2f0e6;
  --warn: #94600f;
  --warn-soft: #f6ead3;
  --bad: #a63e2c;
  --bad-soft: #f6e1dc;
  --info: #3a5876;
  --info-soft: #e1e8f0;
  --stage: #121714;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .06);
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --surface: #1a1f1c; --surface-2: #222925; --line: #2d3530; --line-strong: #3d4740;
    --fg: #e7ebe8; --muted: #9aa69f; --accent: #6fb8a3; --accent-fg: #0f1513; --accent-soft: #1f3330;
    --ok: #7cc496; --ok-soft: #1d3326; --warn: #e0ad5a; --warn-soft: #3a2e19; --bad: #e88b78; --bad-soft: #3d231d;
    --info: #9bb8d6; --info-soft: #1f2a36; --stage: #0b0e0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121614; --surface: #1a1f1c; --surface-2: #222925; --line: #2d3530; --line-strong: #3d4740;
  --fg: #e7ebe8; --muted: #9aa69f; --accent: #6fb8a3; --accent-fg: #0f1513; --accent-soft: #1f3330;
  --ok: #7cc496; --ok-soft: #1d3326; --warn: #e0ad5a; --warn-soft: #3a2e19; --bad: #e88b78; --bad-soft: #3d231d;
  --info: #9bb8d6; --info-soft: #1f2a36; --stage: #0b0e0c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* App shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font-weight: 600; font-size: 13px; letter-spacing: .02em;
}
.brand-name { font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .count {
  margin-inline-start: auto; min-width: 22px; padding: 0 6px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; text-align: center;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.store {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; display: grid; gap: 4px;
}
.store b { font-weight: 600; font-size: 13px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-inline-end: 6px; vertical-align: 1px; }
.demo-note { font-size: 12px; color: var(--muted); padding: 0 6px; }
.demo-note button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 640px; }
.search .ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 42px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
  padding-inline: 40px 44px; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kbd {
  position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px;
  font: 11px/18px var(--mono); color: var(--muted); background: var(--surface-2);
}
.top-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.lang { font-family: var(--font-ar); }
html[lang="ar"] .lang { font-family: var(--font); }
.me { display: flex; align-items: center; gap: 10px; padding-inline-start: 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  background: var(--info-soft); color: var(--info);
}
.me-text { line-height: 1.25; font-size: 13px; }
.me-text span { display: block; color: var(--muted); font-size: 12px; }

.view { padding: 26px 28px 48px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; text-wrap: balance; }
.head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs .ico { width: 14px; height: 14px; }

/* Tabs and chips */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button {
  border: 0; background: none; padding: 10px 12px; margin-bottom: -1px;
  color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs .on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .n { color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 15px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px;
  background: var(--surface-2); font-size: 12.5px; border: 0;
}
button.tag:hover { background: var(--accent-soft); color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active, .pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.completed { background: var(--info-soft); color: var(--info); }
.pill.hold, .pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.returned { background: var(--bad-soft); color: var(--bad); }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stat { padding: 14px 18px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; }
.stat b { display: block; font-size: 20px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 13px; }

/* Project cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.pcard {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.pcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pcard .cover { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.pcard .where { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.pcard .where .ico { width: 15px; height: 15px; }
.counts { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.counts span { display: inline-flex; align-items: center; gap: 6px; }
.counts .ico { width: 15px; height: 15px; }
.bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pcard .foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: start; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td .thumb { width: 44px; height: 34px; border-radius: 5px; object-fit: cover; }
td .cell { display: flex; align-items: center; gap: 12px; }
tbody tr.link:hover { background: var(--surface-2); cursor: pointer; }

/* Project page */
.phero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface);
}
.phero .pic { min-height: 240px; background: var(--surface-2); }
.phero .pic img { width: 100%; height: 100%; object-fit: cover; }
.phero .info { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.folder {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: start;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.folder:hover { border-color: var(--line-strong); }
.folder.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.folder .ico { color: var(--accent); width: 20px; height: 20px; }
.folder b { display: block; font-weight: 600; font-size: 13.5px; }
.folder span { font-size: 12px; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title h2 { margin: 0; font-size: 16px; font-weight: 600; }

/* Asset grid */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px 16px; }
.tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile .frame {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.tile .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.tile:hover .frame img { transform: scale(1.03); }
.tile:hover .frame { border-color: var(--line-strong); }
.tile .name { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tile .sdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sdot.approved { background: var(--ok); } .sdot.pending { background: var(--warn); } .sdot.returned { background: var(--bad); }
.badge {
  position: absolute; inset-block-end: 8px; inset-inline-end: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 5px; background: rgba(10, 14, 12, .72); color: #fff;
  font: 500 11.5px/18px var(--mono);
}
.badge .ico { width: 12px; height: 12px; fill: #fff; stroke: none; }
.match {
  font-size: 12px; color: var(--accent); display: inline-flex; align-items: center; gap: 5px;
}
.match::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.docface {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(var(--surface-2), var(--surface-2));
}
.paper {
  width: 58%; height: 80%; background: #fff; border-radius: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  padding: 12% 10%; display: flex; flex-direction: column; gap: 7%;
}
.paper i { display: block; height: 4px; border-radius: 2px; background: #d9ddd8; }
.paper i:first-child { width: 70%; height: 6px; background: #9aa39d; }
.paper i:nth-child(3) { width: 85%; } .paper i:nth-child(5) { width: 60%; }
.ftype {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  padding: 1px 7px; border-radius: 4px; color: #fff; font: 600 11px/18px var(--mono); letter-spacing: .04em;
}
.ftype.pdf { background: #b23a2c; } .ftype.xlsx { background: #23704a; } .ftype.pptx { background: #b8551c; } .ftype.dwg { background: #2f5d8a; }
.cadface { position: absolute; inset: 0; display: grid; place-items: center; background-color: #f1f4f7; background-image: linear-gradient(#dfe6ee 1px, transparent 1px), linear-gradient(90deg, #dfe6ee 1px, transparent 1px); background-size: 16px 16px; }
.cadface svg { width: 55%; height: 55%; stroke: #2f5d8a; fill: none; stroke-width: 1.3; }

/* Search page */
.split { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 26px; align-items: start; }
.filters { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 18px; }
.fgroup h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
html[lang="ar"] .fgroup h4 { letter-spacing: 0; }
.fgroup label { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.fgroup label .c { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.fgroup input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.fhead { display: flex; justify-content: space-between; align-items: center; }
.fhead b { font-size: 14px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; }
.resbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.resbar select { height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 10px; }
.note { font-size: 13px; color: var(--muted); }
.suggest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }

/* Asset page */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stage {
  position: relative; border-radius: 14px; overflow: hidden; background: var(--stage);
  display: grid; place-items: center; min-height: 420px;
}
.stage img { max-height: 68vh; width: 100%; object-fit: contain; }
.stage .tools { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; display: flex; gap: 6px; }
.stage .tools button, .stage .navb {
  width: 34px; height: 34px; border-radius: 8px; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.stage .tools button:hover, .stage .navb:hover { background: rgba(255, 255, 255, .22); }
.stage .navb { position: absolute; top: 50%; transform: translateY(-50%); }
.stage .navb.prev { inset-inline-start: 12px; } .stage .navb.next { inset-inline-end: 12px; }
.play {
  position: absolute; width: 68px; height: 68px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center;
}
.play .ico { width: 26px; height: 26px; fill: #121714; stroke: none; margin-inline-start: 4px; }
.vbar {
  position: absolute; inset-inline: 0; inset-block-end: 0; padding: 26px 16px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff;
  display: flex; align-items: center; gap: 12px; font: 12px var(--mono);
}
.vbar .track { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.vbar .track i { position: absolute; top: -3px; width: 2px; height: 10px; background: #fff; border-radius: 1px; }
.bigdoc { width: min(420px, 80%); aspect-ratio: 1 / 1.35; margin: 28px 0; background: #fff; border-radius: 4px; padding: 9% 9%; display: flex; flex-direction: column; gap: 14px; color: #1d2420; font-size: 12px; line-height: 1.5; }
.bigdoc h5 { margin: 0; font-size: 15px; }
.bigdoc .lines { display: flex; flex-direction: column; gap: 9px; }
.bigdoc .lines i { height: 5px; border-radius: 3px; background: #e2e5e1; }
.nopreview { color: #c9d1cc; text-align: center; padding: 60px 24px; max-width: 420px; display: grid; gap: 14px; justify-items: center; }
.nopreview .ico { width: 44px; height: 44px; stroke-width: 1.3; }
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.scene { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.scene div { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.scene img { width: 100%; height: 100%; object-fit: cover; }
.panel {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  display: flex; flex-direction: column;
}
.panel .ph { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.panel h1 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.panel .actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.panel .tabs { padding-inline: 10px; }
.pbody { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.block h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
html[lang="ar"] .block h3 { letter-spacing: 0; }
.block p { margin: 0; }
.block .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.ocr { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; white-space: pre-line; }
.tx { display: flex; flex-direction: column; gap: 2px; }
.tx button { display: grid; grid-template-columns: 52px 1fr; gap: 8px; text-align: start; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.tx button:hover { background: var(--surface-2); }
.tx .t { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.approval { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.approval .pill { margin-top: 1px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.log li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.log .avatar { width: 30px; height: 30px; font-size: 11px; }
.log span { display: block; color: var(--muted); font-size: 12px; }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.strip a { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.strip img { width: 100%; height: 100%; object-fit: cover; }

/* Menus, dialogs, toast */
.menu {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-start: 0; z-index: 30;
  min-width: 260px; padding: 6px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); box-shadow: var(--shadow);
}
.menu button {
  width: 100%; display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: start; font-size: 13.5px;
}
.menu button:hover { background: var(--surface-2); }
.menu button span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(12, 16, 14, .45); display: grid; place-items: center; padding: 16px; }
.dialog {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column;
}
.dialog.wide { width: min(760px, 100%); }
.dialog .dh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog .dh h2 { margin: 0; font-size: 17px; font-weight: 600; }
.dialog .db { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog .df { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > span { font-size: 13px; font-weight: 500; }
.field input[type="text"], .field input[type="date"], .field input[type="password"], .field select {
  height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 10px;
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 14px; font-size: 13px; }
.seg button + button { border-inline-start: 1px solid var(--line-strong); }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); padding: 0 10px; font-family: var(--mono); font-size: 12.5px; }
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 30px 20px;
  display: grid; justify-items: center; gap: 8px; text-align: center; background: var(--surface-2);
}
.drop .ico { width: 30px; height: 30px; color: var(--accent); }
.drop b { font-weight: 600; }
.toast {
  position: fixed; z-index: 60; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  padding: 11px 16px; border-radius: 10px; background: var(--fg); color: var(--bg);
  font-size: 13.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
[dir="rtl"] .toast { transform: translateX(50%); }
.credits { font-size: 12.5px; display: flex; flex-direction: column; gap: 8px; }
.credits a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Collections */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.ccard { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ccard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 10; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic img:first-child { grid-row: span 2; }
.ccard .body { padding: 12px 14px 14px; }
.ccard h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }

/* Approvals */
.queue { display: flex; flex-direction: column; gap: 12px; }
.qitem { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.qitem .frame { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; position: relative; background: var(--surface-2); }
.qitem .frame img { width: 100%; height: 100%; object-fit: cover; }
.qitem h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; }
.qitem .meta { font-size: 12.5px; color: var(--muted); }
.qitem .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.qnote { margin-top: 6px; font-size: 12.5px; padding: 6px 10px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); display: inline-block; }

/* Settings */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.conn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.conn .logo { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font: 600 11px var(--mono); color: #fff; }
.conn .st { margin-inline-start: auto; font-size: 12px; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatches button.on { box-shadow: 0 0 0 2px var(--fg); }
.types { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; }
  .nav a { white-space: nowrap; }
  .side-foot { display: none; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .me-text { display: none; }
  .view { padding: 20px 16px 40px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .phero { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .qitem { grid-template-columns: 90px minmax(0, 1fr); }
  .qitem .btns { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .search { flex: 1 1 100%; max-width: none; }
  .top-right { margin-inline-start: 0; width: 100%; justify-content: space-between; }
  .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-right .btn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Multi-page additions ---------- */
.side { overflow-y: auto; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
html[lang="ar"] .nav-label { letter-spacing: 0; }
.nav-label em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); letter-spacing: 0; text-transform: none; }
.nav a { padding: 7px 10px; }
.nav .count.info { background: var(--info-soft); color: var(--info); }
.ai-mark {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  background: var(--info-soft); color: var(--info); font: 600 10.5px/18px var(--mono); letter-spacing: .03em;
}
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
[dir="rtl"] .switch input:checked::after { transform: translateX(-16px); }
.opt { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.opt:first-of-type { border-top: 0; }
.opt .txt { flex: 1; min-width: 0; }
.opt b { display: block; font-weight: 600; font-size: 13.5px; }
.opt span { display: block; font-size: 12.5px; color: var(--muted); }
.opt select, .card select.sm { height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 8px; font-size: 13px; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter.warn i { background: var(--warn); }
.big { font-size: 26px; font-weight: 600; line-height: 1.1; }
.askbox { display: flex; gap: 8px; }
.askbox input { flex: 1; min-width: 0; height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 12px; outline: none; }
.askbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.minilist { display: flex; flex-direction: column; }
.minilist a, .minilist .it { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.minilist > :first-child { border-top: 0; }
.minilist img { width: 44px; height: 34px; border-radius: 5px; object-fit: cover; }
.minilist b { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minilist span { font-size: 12px; color: var(--muted); }

/* Processing pipeline */
.job { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.job .frame { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; position: relative; background: var(--surface-2); }
.job .frame img { width: 100%; height: 100%; object-fit: cover; }
.job h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.job .meta { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.step .ico { width: 13px; height: 13px; }
.step.d { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.step.r { color: var(--info); background: var(--info-soft); border-color: transparent; font-weight: 600; }
.step.f { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.step.s { opacity: .5; text-decoration: line-through; }
.job .err { margin-top: 8px; font-size: 12.5px; color: var(--bad); }
.job .side-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 120px; }
.job .pct { font: 600 13px var(--mono); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }

/* Assistant */
.chat { max-width: 860px; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.msg .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.msg.bot .avatar { background: var(--accent); color: var(--accent-fg); }
.msg .bubble { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.msg.me .bubble { background: var(--surface-2); border-color: transparent; }
.msg .bubble p { margin: 0; }
.msg .who { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; }
.cite { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.cite:hover { background: var(--accent-soft); color: var(--accent); }
.cite .ico { width: 14px; height: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.thumbs a { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.thumbs img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.composer { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 30%); max-width: 860px; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font: 11.5px var(--font); }
.chart .val { fill: var(--fg); font-weight: 600; }
.chart .barm { fill: var(--accent); }
.chart .barm:hover { opacity: .8; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .tr { height: 12px; border-radius: 3px; background: var(--surface-2); }
.hbar .tr i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
[dir="rtl"] .hbar .tr i { border-radius: 4px 0 0 4px; }
.hbar b { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.health .ico { width: 16px; height: 16px; }
.health.ok { color: var(--ok); }
.health.warn { color: var(--warn); }
.tree { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.tree li { padding: 5px 0; }
.tree .node { display: flex; align-items: center; gap: 8px; }
.tree .ico { width: 16px; height: 16px; color: var(--accent); }
.tree ul { list-style: none; margin: 0; padding-inline-start: 24px; }
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wizard-steps span { font-size: 12px; padding: 3px 10px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.wizard-steps span.on { background: var(--accent); color: var(--accent-fg); }
.mtx td:not(:first-child), .mtx th:not(:first-child) { text-align: center; }
.mtx .ico { width: 16px; height: 16px; color: var(--ok); }
.mtx .no { color: var(--muted); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .job { grid-template-columns: 72px minmax(0, 1fr); }
  .job .side-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; }
  .nav-group { flex-direction: row; }
  .nav-label { display: none; }
  .hbar { grid-template-columns: 100px minmax(0, 1fr) 56px; }
}

.grid-side { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-side { grid-template-columns: minmax(0, 1fr); } }

.grid-side { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-side { grid-template-columns: minmax(0, 1fr); } }

.switch { display: inline-block; vertical-align: middle; }
.switch input { display: block; position: relative; }
.switch input::after { top: 2px; }
.linkbtn { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.linkbtn .ico { width: 15px; height: 15px; }

/* ---------- File manager (All files) ---------- */
.fm { display: grid; grid-template-columns: 248px minmax(0, 1fr) 290px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-height: 640px; overflow: hidden; }
.fm.noinfo { grid-template-columns: 248px minmax(0, 1fr); }
.fm-tree { border-inline-end: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); overflow: auto; max-height: 78vh; }
.fm-sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 8px 4px; display: flex; align-items: center; gap: 6px; }
html[lang="ar"] .fm-sec { letter-spacing: 0; }
.tnode { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--fg); border: 1px dashed transparent; user-select: none; }
.tnode:hover { background: var(--surface-2); }
.tnode.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tnode.drop-on, .ftile.drop-on, .lrow.drop-on { border-color: var(--accent); background: var(--accent-soft); }
.tnode .tw { width: 18px; height: 18px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--muted); border-radius: 4px; flex: none; }
.tnode .tw:hover { background: var(--line); }
.tnode .tw .ico { width: 14px; height: 14px; transition: transform .12s; }
.tnode .tw.open .ico { transform: rotate(90deg); }
[dir="rtl"] .tnode .tw .ico { transform: scaleX(-1); }
[dir="rtl"] .tnode .tw.open .ico { transform: scaleX(-1) rotate(90deg); }
.tnode .ico.f { width: 16px; height: 16px; color: var(--accent); flex: none; }
.tnode .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnode .cnt { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tkids { padding-inline-start: 14px; }
.fm-main { min-width: 0; display: flex; flex-direction: column; }
.fm-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fm-bar .crumbs { margin: 0; font-size: 13.5px; flex: 1; min-width: 200px; flex-wrap: wrap; }
.fm-bar .crumbs a, .fm-bar .crumbs span { padding: 2px 4px; border-radius: 5px; }
.fm-bar .crumbs a[data-drop].drop-on { background: var(--accent-soft); }
.fm-bar .crumbs span:last-child { color: var(--fg); font-weight: 600; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.iconbtn:hover { color: var(--fg); border-color: var(--muted); }
.iconbtn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fm-bar select { height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 8px; font-size: 13px; }
.fm-sub { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.fm-sub .chip { height: 28px; }
.fm-sub .hint { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 14px 0; padding: 8px 10px; border-radius: 10px; background: var(--fg); color: var(--bg); }
.bulk b { font-weight: 600; margin-inline-end: 6px; font-size: 13.5px; }
.bulk button { height: 30px; padding: 0 10px; border-radius: 7px; border: 0; background: transparent; color: var(--bg); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bulk button:hover { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.bulk .ico { width: 16px; height: 16px; }
.bulk .sp { margin-inline-start: auto; }
.fm-body { padding: 14px; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; max-height: 70vh; }
.fm-body h4 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ftile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; border: 1px dashed transparent; cursor: default; user-select: none; min-width: 0; }
.ftile:hover { background: var(--surface-2); }
.ftile.sel { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.ftile .frame { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.ftile .frame img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ftile .nm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftile .mt { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.ftile .ck { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid #fff; background: rgba(10, 14, 12, .35); display: grid; place-items: center; opacity: 0; transition: opacity .1s; padding: 0; }
.ftile:hover .ck, .ftile.sel .ck, .fm.selecting .ftile .ck { opacity: 1; }
.ftile.sel .ck { background: var(--accent); border-color: var(--accent); }
.ftile .ck .ico { width: 13px; height: 13px; color: #fff; stroke-width: 2.5; }
.folderface { aspect-ratio: 4 / 3; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.folderface .ico { width: 44px; height: 44px; color: var(--accent); stroke-width: 1.3; }
.folderface .peek { position: absolute; inset-block-end: 6px; inset-inline: 6px; display: flex; gap: 3px; }
.folderface .peek img { width: 30%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; border: 1.5px solid var(--surface); }
.ltable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ltable th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ltable th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.ltable th button .ico { width: 13px; height: 13px; }
.ltable td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lrow { cursor: default; user-select: none; border: 1px dashed transparent; }
.lrow:hover td { background: var(--surface-2); }
.lrow.sel td { background: var(--accent-soft); }
.lrow .nmcell { display: flex; align-items: center; gap: 10px; max-width: 320px; }
.lrow .nmcell span { overflow: hidden; text-overflow: ellipsis; }
.lrow .th { width: 36px; height: 27px; border-radius: 4px; overflow: hidden; flex: none; position: relative; background: var(--surface-2); display: grid; place-items: center; }
.lrow .th img { width: 100%; height: 100%; object-fit: cover; }
.lrow .th .ico { width: 18px; height: 18px; color: var(--accent); }
.lrow .th .ftype { position: static; font-size: 9px; line-height: 14px; padding: 0 3px; }
.lrow input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.fm-info { border-inline-start: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 14px; overflow: auto; max-height: 78vh; }
.fm-info h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.fm-info .pv { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.fm-info .pv img { width: 100%; height: 100%; object-fit: cover; }
.fm-info .pv.folder { display: grid; place-items: center; }
.fm-info .pv.folder .ico { width: 56px; height: 56px; color: var(--accent); stroke-width: 1.2; }
.fm-info .stackpv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.fm-info .stackpv img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; width: 100%; }
.fm-info .kv { font-size: 12.5px; }
.fm-info .btnrow .btn { flex: 1; }
.fm-empty { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.fm-empty .ico { width: 36px; height: 36px; color: var(--accent); }
.ctx { position: fixed; z-index: 70; min-width: 210px; padding: 5px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.ctx button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: none; border-radius: 6px; font-size: 13px; text-align: start; }
.ctx button:hover { background: var(--surface-2); }
.ctx button .ico { width: 16px; height: 16px; color: var(--muted); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.ctx .danger { color: var(--bad); }
.ctx .danger .ico { color: var(--bad); }
.picker { border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-height: 320px; overflow: auto; background: var(--bg); }
.toast .undo { margin-inline-start: 14px; border: 0; background: none; color: var(--accent-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.sugg { display: flex; flex-direction: column; gap: 8px; }
.sugg label { display: grid; grid-template-columns: 18px 52px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.sugg img { width: 52px; height: 39px; object-fit: cover; border-radius: 5px; }
.sugg b { display: block; font-weight: 500; }
.sugg span { color: var(--muted); font-size: 12px; }
.sugg .to { color: var(--accent); font-weight: 600; }
@media (max-width: 1280px) { .fm { grid-template-columns: 220px minmax(0, 1fr); } .fm-info { display: none; } .fm.showinfo .fm-info { display: flex; grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); max-height: none; } }
@media (max-width: 760px) { .fm, .fm.noinfo { grid-template-columns: minmax(0, 1fr); } .fm-tree { border-inline-end: 0; border-bottom: 1px solid var(--line); max-height: 260px; } }

.fm-sub .sp { flex: 1; }
.fm-sub select { height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 8px; font-size: 13px; }
.fm-sub { padding-bottom: 2px; }
