/* Docufile 2: laid out like Revver. White top bar, dark purple menu on the left, the
   Documents explorer with Folder View, the list, and side panes on the right. */
:root {
  --paper: #f8f8f8;
  --surface: #ffffff;
  --sunk: #f4f4f6;
  --ink: #292929;
  --muted: #696969;
  --line: #d9d9d9;
  --line-soft: #ececec;
  --accent: #7514bd;
  --accent-hover: #500886;
  --accent-ink: #ffffff;
  --accent-soft: #ede1f7;
  --accent-tint: #f7f1fc;
  --nav: #321e4b;
  --nav-ink: #e9e2f2;
  --nav-hover: #45305f;
  --nav-on: #5b3d80;
  --topbar: #ffffff;
  --sel: #efe4f8;
  --warn: #8a6409;
  --warn-soft: #fbf3dc;
  --bad: #cc1531;
  --bad-soft: #fbe4e8;
  --ok: #20ab43;
  --info: #1b6ce6;
  --info-soft: #e5effd;
  --ai: #7514bd;
  --ai-soft: #ede1f7;
  --folder: #e5a823;
  --shadow: 0 8px 28px rgb(30 10 50 / .16);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px;
  --top: 60px;
  color-scheme: light;
}
/* Light like Revver. A dark look is only used if a page sets data-theme="dark". */
:root[data-theme="dark"] {
    --paper: #16131b; --surface: #1f1b26; --sunk: #26212e; --ink: #ece8f1; --muted: #a8a1b3; --line: #3a3443; --line-soft: #2e2837;
    --accent: #b27ae6; --accent-hover: #c99bf0; --accent-ink: #1a0f24; --accent-soft: #35254a; --accent-tint: #2a2037;
    --nav: #120b1c; --nav-ink: #ddd3ea; --nav-hover: #24173a; --nav-on: #3a2757; --topbar: #1f1b26; --sel: #35254a;
    --warn: #e3b552; --warn-soft: #33290f; --bad: #f08391; --bad-soft: #3a1a20; --ok: #5fd07c;
    --info: #8db4f2; --info-soft: #18253a; --ai: #c99bf0; --ai-soft: #35254a; --folder: #e8b54a;
    --shadow: 0 8px 28px rgb(0 0 0 / .5);
    color-scheme: dark;
  }


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 600 14px/1.5 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 { font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: .4rem; }
h3 { font-size: .9rem; font-weight: 800; }
p { margin: 0; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
mark { background: var(--warn-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pad-s { padding: 10px 14px; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.xs { width: 13px; height: 13px; }
.ic.filled { fill: currentColor; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: none; list-style: none; padding: 0; flex: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover, details[open] > .icon-btn { background: var(--accent-soft); color: var(--accent); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn .ic { width: 19px; height: 19px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 14px 0 10px; background: var(--topbar); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: 18px; white-space: nowrap; }
.brand-name { font-weight: 800; letter-spacing: .14em; color: var(--accent); font-size: 1.12rem; }
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; font-size: 1.05rem; }
.tb-search { flex: 0 1 460px; display: flex; align-items: center; gap: 6px; background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 20px; padding: 0 6px 0 14px; height: 38px; color: var(--muted); }
.tb-search:focus-within { border-color: var(--accent); background: var(--surface); }
.tb-search input { flex: 1; border: 0; padding: 6px 2px; background: transparent; box-shadow: none !important; min-width: 0; }
.tb-adv { color: var(--muted); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.tb-adv:hover { background: var(--accent-soft); color: var(--accent); }
.tb-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.tb-icon { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; min-width: 40px; justify-content: center; padding: 0 8px; border-radius: 20px; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit; list-style: none; }
.tb-icon::-webkit-details-marker { display: none; }
.tb-icon:hover, .tb-icon.on, details[open] > .tb-icon { background: var(--accent-soft); color: var(--accent); }
.tb-icon .ic { width: 21px; height: 21px; }
.tb-icon .ic.xs { width: 12px; height: 12px; }
.tb-icon .count { position: absolute; top: 3px; right: 3px; background: var(--bad); color: #fff; border-radius: 9px; font-size: .66rem; font-weight: 800; padding: 0 5px; line-height: 16px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: .72rem; background: var(--accent-soft); color: var(--accent); }
.only-sm { display: none; }

/* Menus from the top bar */
.menu-list { width: 250px; padding: 6px; display: flex; flex-direction: column; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover, .menu-list a.on { background: var(--accent-tint); color: var(--accent); }
.menu-list form { margin: 0; }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); font-weight: 600; }
.recents-pop { width: 320px; max-height: 70vh; overflow: auto; }
.recent-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; font-weight: 800; }

/* Left menu */
.app-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.rail { position: sticky; top: var(--top); height: calc(100vh - var(--top)); width: 64px; background: var(--nav); display: flex; flex-direction: column; padding: 6px 0; gap: 2px; z-index: 30; overflow: hidden auto; transition: width .15s; }
body.rail-wide .rail { width: 224px; }
.rail a, .rail button { display: flex; align-items: center; gap: 14px; padding: 0 21px; height: 46px; color: var(--nav-ink); text-decoration: none; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; border-left: 3px solid transparent; width: 100%; text-align: left; }
.rail a .ic, .rail button .ic { width: 21px; height: 21px; }
.rail a span, .rail button span { opacity: 0; transition: opacity .1s; }
body.rail-wide .rail a span, body.rail-wide .rail button span { opacity: 1; }
.rail a:hover, .rail button:hover { background: var(--nav-hover); color: #fff; }
.rail a.on { background: var(--nav-on); color: #fff; border-left-color: #c59ae8; }
.rail .rail-toggle { height: 40px; margin-bottom: 6px; color: #b9a9cc; }
body.rail-wide .rail .rail-toggle .ic { transform: scaleX(-1); }
.rail .rail-all { margin-top: auto; }
.rail .chev { margin-left: auto; opacity: 0; }
body.rail-wide .rail .chev { opacity: 1; }

/* All Features panel */
.features { position: fixed; z-index: 45; top: var(--top); left: 64px; bottom: 0; width: min(760px, calc(100vw - 64px)); background: var(--surface); box-shadow: var(--shadow); padding: 18px 24px 30px; overflow: auto; }
body.rail-wide .features { left: 224px; }
.features-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.features-head h2 { font-size: 1.2rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 24px; }
.features-grid h3 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; margin-bottom: 6px; }
.features-grid a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.features-grid a .ic { color: var(--accent); }
.features-grid a:hover { background: var(--accent-tint); color: var(--accent); }

.content { padding: 20px max(16px, 2vw) 60px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.content.wide { padding: 0; gap: 0; }
.content.wide > .flash { margin: 10px 16px 0; }
.flash { position: relative; padding-right: 36px; }
.flash-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 1.2rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* Documents explorer */
.explorer { display: grid; grid-template-columns: 290px minmax(0, 1fr) 48px; height: calc(100vh - var(--top)); background: var(--surface); }
.explorer.pane-open { grid-template-columns: 290px minmax(0, 1fr) min(400px, 34vw); }
.content.wide > .flash ~ .explorer { height: calc(100vh - var(--top) - 56px); }
.ex-tree { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.ex-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.ex-tabs button { flex: 1; border: 0; background: none; padding: 13px 8px 11px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.ex-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tree-filter { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 10px; color: var(--muted); flex: none; }
.tree-filter input { border: 0; padding: 7px 0; flex: 1; box-shadow: none !important; background: transparent; }
.tree { overflow: auto; flex: 1 1 auto; padding: 0 0 12px; min-height: 0; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 16px; }
.tree li > ul { display: none; }
.tree li.open > ul { display: block; }
.tree-row { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 6px; min-height: 34px; border-radius: 0 17px 17px 0; margin-right: 8px; }
.tree-row:hover { background: var(--sunk); }
.tree-row.on { background: var(--sel); }
.tree-row a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; padding: 5px 4px; min-width: 0; flex: 1; }
.tree-row a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-direction: column; line-height: 1.25; }
.tree-row a small { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }
.tree-row.on a { color: var(--accent); font-weight: 800; }
.tree-caret { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 3px; flex: none; padding: 0; }
.tree-caret:hover { background: var(--line-soft); }
.tree-caret .ic { transition: transform .12s; }
li.open > .tree-row .tree-caret .ic { transform: rotate(90deg); }
.tree-caret.none { cursor: default; }
.tree .ic.t-account { color: var(--nav); }
.tree .ic.t-cabinet { color: var(--accent); }
.tree .ic.t-drawer { color: #8d4bc4; }
.tree .ic.t-folder { color: var(--folder); }
.tree .ic.t-file { color: var(--muted); }
.tree-empty, .tree-label { padding: 8px 16px; color: var(--muted); font-size: .82rem; }
.tree-label { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; padding-top: 14px; }
:root[data-theme="dark"] .tree .ic.t-account { color: var(--nav-ink); }

.ex-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.ex-main.over::after { content: "Drop to upload here"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 70%, transparent); display: grid; place-items: center; font-weight: 800; color: var(--accent); font-size: 1.1rem; pointer-events: none; }
.crumbs-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 18px 6px; font-size: .9rem; color: var(--muted); flex: none; }
.crumbs-bar a { color: var(--muted); text-decoration: none; font-weight: 700; }
.crumbs-bar a:hover { color: var(--accent); text-decoration: underline; }
.crumbs-bar .cur { color: var(--ink); font-weight: 800; }
.crumbs-bar .sep { opacity: .55; }
.crumb-back { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--accent) !important; }
.crumb-back:hover { background: var(--accent-soft); }
.crumb-edit { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; width: 26px; height: 26px; display: inline-grid; place-items: center; }
.crumb-edit:hover { background: var(--accent-soft); color: var(--accent); }
.ex-head { display: flex; align-items: center; gap: 14px; margin: 6px 18px 0; padding: 14px 16px; background: var(--accent-tint); border-bottom: 3px solid var(--accent); border-radius: var(--r) var(--r) 0 0; flex: none; }
.ex-title { min-width: 0; flex: 1; }
.ex-title h1 { font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.ex-head-actions { display: flex; align-items: center; gap: 2px; }
.big-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; flex: none; background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.big-icon .ic { width: 28px; height: 28px; }
.big-icon.g-folder { color: var(--folder); }
.big-icon.g-drawer { color: #8d4bc4; }
.big-icon.g-account { color: var(--nav); }
:root[data-theme="dark"] .big-icon.g-account { color: var(--nav-ink); }
.shared-strip { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 18px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; background: var(--sunk); color: var(--ink); text-decoration: none; font-size: .85rem; border: 1px solid var(--line-soft); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.ex-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.ex-filter { display: flex; flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 18px; padding: 0 12px; color: var(--muted); width: min(280px, 100%); }
.ex-filter input { border: 0; padding: 6px 0; flex: 1; box-shadow: none !important; background: transparent; min-width: 0; }
.view-switch { display: flex; gap: 0; margin-left: 4px; border-left: 1px solid var(--line); padding-left: 6px; }
.count-label { color: var(--accent); font-weight: 800; margin-left: 6px; }
.sort-pop .pop-body { width: 200px; }

.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); padding: 8px 18px; border-bottom: 1px solid var(--line); flex: none; }

/* The list. One set of rows, styled as List, Thumbnail or Details. */
.items { flex: 1 1 auto; overflow: auto; min-height: 0; padding-bottom: 12px; }
.item { display: grid; align-items: center; gap: 0 12px; padding: 0 18px; min-height: 52px; border-bottom: 1px solid var(--line-soft); cursor: default; position: relative; outline-offset: -2px; }
.item:hover { background: var(--sunk); }
.item.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.item.checked { background: var(--accent-tint); }
.item.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.item .c-name { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.item .c-name > a { color: var(--ink); text-decoration: none; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.item .c-name > a:hover { color: var(--accent); text-decoration: underline; }
.item .sub { flex-basis: 100%; color: var(--muted); font-size: .8rem; font-weight: 600; }
.badges { display: inline-flex; gap: 3px; }
.badge { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sunk); color: var(--muted); }
.badge.lock { background: var(--ink); color: var(--paper); }
.badge.out { background: var(--warn-soft); color: var(--warn); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }
.c-act { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .1s; }
.item:hover .c-act, .item:focus-within .c-act, .item.sel .c-act { opacity: 1; }
@media (hover: none) { .c-act { opacity: 1; } }
.c-check { display: flex; align-items: center; }
.items:not(.selecting) .item:not(:hover):not(.sel) .c-check input { opacity: 0; }
.items-head { display: none; }
.thumb-img { display: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; text-align: center; color: var(--muted); }

.items.view-list .item { grid-template-columns: 26px 38px minmax(0, 1fr) auto; }
.items.view-list .c-type, .items.view-list .c-created, .items.view-list .c-modified, .items.view-list .c-size, .items.view-list .c-by { display: none; }

.items.view-details .items-head { display: grid; position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 40px; }
.items.view-details .items-head, .items.view-details .item { grid-template-columns: 26px 32px minmax(180px, 2.4fr) minmax(60px, .6fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(70px, .6fr) minmax(90px, .8fr) 70px; }
.items-head > * { color: var(--muted); font-weight: 800; font-size: .84rem; text-decoration: none; align-self: center; }
.items-head a:hover { color: var(--accent); }
.items.view-details .item { min-height: 41px; }
.items.view-details .sub { display: none; }
.items.view-details .item > span:not(.c-name) { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.items.view-details .glyph { width: 26px; height: 26px; }

.items.view-thumb { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px 18px; align-content: start; }
.items.view-thumb .empty-state { grid-column: 1 / -1; }
.items.view-thumb .item { display: flex; flex-direction: column; align-items: stretch; padding: 10px; border: 1px solid var(--line); border-radius: 10px; min-height: 0; gap: 6px; }
.items.view-thumb .c-icon { height: 104px; display: grid; place-items: center; background: var(--sunk); border-radius: 6px; overflow: hidden; }
.items.view-thumb .c-icon .glyph { width: 56px; height: 56px; }
.items.view-thumb .c-icon .glyph .ic { width: 30px; height: 30px; }
.items.view-thumb .thumb-img.loaded { display: block; width: 100%; height: 100%; object-fit: cover; }
.items.view-thumb .thumb-img.loaded + .glyph { display: none; }
.items.view-thumb .c-check { position: absolute; top: 14px; left: 14px; z-index: 1; }
.items.view-thumb .c-act { position: absolute; top: 12px; right: 12px; background: var(--surface); border-radius: 16px; }
.items.view-thumb .c-type, .items.view-thumb .c-created, .items.view-thumb .c-modified, .items.view-thumb .c-size, .items.view-thumb .c-by { display: none; }
.items.view-thumb .c-name > a { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .9rem; }

/* Item glyphs */
.glyph { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; flex: none; color: var(--muted); }
.glyph .ic { width: 24px; height: 24px; }
.glyph b { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font: 800 .5rem/1 var(--font); letter-spacing: .02em; color: #fff; background: var(--muted); padding: 2px 3px; border-radius: 2px; }
.glyph.sm { width: 24px; height: 24px; }
.glyph.sm .ic { width: 18px; height: 18px; }
.glyph.sm b { display: none; }
.glyph.g-cabinet { color: var(--accent); }
.glyph.g-drawer { color: #8d4bc4; }
.glyph.g-folder { color: var(--folder); }
.glyph.g-folder .ic { fill: color-mix(in srgb, var(--folder) 25%, transparent); }
.glyph.g-account { color: var(--nav); }
.glyph.g-pdf { color: var(--bad); }
.glyph.g-pdf b { background: var(--bad); }
.glyph.g-image { color: var(--info); }
.glyph.g-image b { background: var(--info); }
.glyph.g-sheet { color: var(--ok); }
.glyph.g-sheet b { background: var(--ok); }

.upload-bar { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; margin: 0 18px 14px; padding: 12px; border: 2px dashed var(--line); border-radius: 10px; color: var(--accent); cursor: pointer; flex: none; font-size: .95rem; }
.upload-bar:hover { border-color: var(--accent); background: var(--accent-tint); }

/* Side panes */
.ex-pane { display: grid; grid-template-columns: minmax(0, 1fr) 48px; border-left: 1px solid var(--line); min-height: 0; background: var(--surface); }
.explorer:not(.pane-open) .pane-body { display: none; }
.explorer:not(.pane-open) .ex-pane { grid-template-columns: 48px; }
.pane-body { overflow: auto; padding: 14px 16px 30px; display: flex; flex-direction: column; gap: 12px; min-width: 0; border-right: 1px solid var(--line-soft); }
.pane-body.loading { opacity: .5; }
.pane-tabs { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--sunk); }
.pane-tabs button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pane-tabs button:hover { background: var(--accent-soft); color: var(--accent); }
.pane-tabs button.on { background: var(--accent); color: #fff; }
.pane-head { display: flex; justify-content: space-between; align-items: center; }
.pane-head h2 { font-size: 1.05rem; }
.pane-subject { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.pane-subject > b { overflow-wrap: anywhere; }
.pane-h { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; margin-top: 6px; }
dl.props { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .88rem; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.previewer { width: 100%; height: calc(100vh - 230px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunk); }
.preview-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.summary { background: var(--ai-soft); padding: 10px 12px; border-radius: var(--r); }
.meta-form label { font-size: .8rem; }
.meta-form input, .meta-form select, .meta-form textarea { padding: 6px 9px; font-size: .9rem; }
.access-list, .notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.access-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.access-list .grow { display: flex; flex-direction: column; min-width: 0; }
.access-list small { color: var(--muted); }
.inherit { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: .75rem; max-width: 40%; }
.inherit small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.notes li.reply { padding-left: 30px; }
.note-meta { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.note-meta time { color: var(--muted); font-size: .78rem; margin-left: auto; }
.notes p { font-weight: 500; overflow-wrap: anywhere; }
table.audit td { vertical-align: top; }
ol.versions .star { width: 16px; color: var(--accent); }

/* Right-click and "…" menu */
.ctx-menu { position: fixed; z-index: 60; width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px 0; max-height: 80vh; overflow: auto; }
.ctx-group { padding: 4px; border-top: 1px solid var(--line-soft); }
.ctx-group:first-child { border-top: 0; }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: 4px; text-align: left; }
.ctx-menu button .ic { color: var(--muted); width: 17px; height: 17px; }
.ctx-menu button:hover, .ctx-menu button:focus { background: var(--accent-tint); color: var(--accent); outline: none; }
.ctx-menu button:hover .ic, .ctx-menu button:focus .ic { color: var(--accent); }
.ctx-menu button.danger { color: var(--bad); }
.ctx-menu button.danger .ic { color: var(--bad); }

/* Dialogs */
.dlg { border: 0; border-radius: 10px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); background: var(--surface); color: var(--ink); }
.dlg::backdrop { background: rgb(20 8 35 / .45); }
.dlg form { display: flex; flex-direction: column; }
.dlg header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line-soft); }
.dlg-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow: auto; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.picker { border: 1px solid var(--line); border-radius: var(--r); max-height: 320px; padding: 6px 0; }
.picker .tree-row { cursor: pointer; }

/* Upload queue */
.upload-queue { position: fixed; z-index: 50; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.uq-head { display: flex; justify-content: space-between; align-items: center; }
.ex-mobile-tabs { display: none; }

/* Phone and small tablet */
@media (max-width: 1180px) {
  .explorer, .explorer.pane-open { grid-template-columns: 240px minmax(0, 1fr) 48px; }
  .explorer.pane-open .ex-pane { position: fixed; z-index: 35; right: 0; top: var(--top); bottom: 0; width: min(420px, 92vw); grid-template-columns: minmax(0, 1fr) 48px; box-shadow: var(--shadow); }
  .items.view-details .c-created, .items.view-details .c-by { display: none; }
  .items.view-details .items-head, .items.view-details .item { grid-template-columns: 26px 32px minmax(160px, 2.4fr) minmax(60px, .6fr) minmax(120px, 1fr) minmax(70px, .6fr) 70px; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .only-sm { display: inline-flex; }
  .hide-sm { display: none; }
  .topbar { padding: 0 6px; gap: 4px; }
  .brand { margin-right: 4px; }
  .brand-name { display: none; }
  .tb-search { flex: 1 1 auto; }
  .app-shell { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: var(--top); width: 240px !important; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow); }
  .rail a span, .rail button span { opacity: 1 !important; }
  .rail .rail-toggle { display: none; }
  body.rail-open .rail { transform: none; }
  .features { left: 0 !important; width: 100vw; }
  .explorer, .explorer.pane-open { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 54px); }
  .explorer .ex-tree, .explorer .ex-pane { display: none; }
  .explorer[data-mtab="tree"] .ex-tree { display: flex; }
  .explorer[data-mtab="tree"] .ex-main { display: none; }
  .explorer[data-mtab="pane"] .ex-main { display: none; }
  .explorer.pane-open[data-mtab="pane"] .ex-pane { display: grid; position: static; width: auto; box-shadow: none; }
  .ex-mobile-tabs { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: 54px; background: var(--surface); border-top: 1px solid var(--line); }
  .ex-mobile-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; font: inherit; font-size: .75rem; font-weight: 700; color: var(--muted); cursor: pointer; }
  .ex-mobile-tabs button.on { color: var(--accent); }
  .crumbs-bar, .ex-toolbar { padding-left: 12px; padding-right: 12px; }
  .ex-head { margin: 4px 12px 0; padding: 10px 12px; }
  .big-icon { width: 40px; height: 40px; }
  .item { padding: 0 12px; }
  .items.view-details .items-head, .items.view-details .item { grid-template-columns: 26px 30px minmax(0, 1fr) 70px; }
  .items.view-details .c-type, .items.view-details .c-modified, .items.view-details .c-size { display: none; }
  .ex-filter { width: auto; flex: 1 1 140px; }
  .upload-bar { margin: 0 12px 10px; }
  .upload-queue { bottom: 66px; }
  .content { padding-left: 12px; padding-right: 12px; }
}

/* Auth pages */
.auth-main { max-width: 420px; margin: 0 auto; padding: 8vh 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); border-top: 4px solid var(--accent); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 1.35rem; }

/* Building blocks */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.actions, .toolbar, .row, .action-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row.wrap > label { flex: 1 1 150px; }
.grow { flex: 1 1 200px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel.narrow { max-width: 560px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; } }
.empty { padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.pad { padding: 10px 2px 0; }
.narrow-form { max-width: 620px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; font-weight: 600; color: var(--ink); }
label small { font-weight: 400; color: var(--muted); }
.check-line { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-width: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--sunk); }
.w-year { width: 7.5em; }
.code-input { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.code-input.small-code { font-size: 1.1rem; width: 8em; }

.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; list-style: none; }
.btn::-webkit-details-marker { display: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.ghost.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .8rem; }
.btn:disabled { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }

.flash { border-radius: var(--r); padding: 10px 14px; background: var(--accent-soft); color: var(--ink); border-left: 4px solid var(--accent); }
.flash.error { background: var(--bad-soft); border-left-color: var(--bad); }
.flash.info { background: var(--info-soft); border-left-color: var(--info); }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 9px; font-size: .74rem; font-weight: 600; background: var(--sunk); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.s-received { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.s-in_review { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.s-needs_info { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.s-approved { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.s-filed { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pill.s-lock { background: var(--ink); color: var(--paper); border-color: transparent; }
.pill.s-ai { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.meta-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.keep { font-family: var(--mono); font-size: .85rem; }
.keep.warn { color: var(--warn); font-weight: 600; }
.keep.bad { color: var(--bad); font-weight: 600; }

.crumbs { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .5; }



/* Tables and lists */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list th a { color: inherit; text-decoration: none; }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--sunk); }
table.list.dense td { padding: 5px 8px; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list .check { width: 34px; }
td.name { min-width: 220px; }
td.name .glyph { vertical-align: middle; margin-right: 8px; }
td.name .pill { margin-left: 6px; vertical-align: middle; }
td.name a { font-weight: 600; color: var(--ink); text-decoration: none; }
td.name a:hover { color: var(--accent); text-decoration: underline; }
tr.bad td { color: var(--bad); }
tr.muted td { color: var(--muted); }

ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.plain li { display: flex; align-items: center; gap: 10px; }
ul.plain a { color: var(--ink); font-weight: 500; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: .9rem; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-size: .78rem; margin-left: auto; }
.feed .kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--info-soft); color: var(--info); }
.feed li.task .kind { background: var(--warn-soft); color: var(--warn); }
.feed.compact li { padding: 6px 0; font-size: .84rem; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--line); }
.tile b { font: 600 1.7rem/1.1 var(--mono); }
.tile span { font-size: .84rem; color: var(--muted); }
.tile.attn { border-top-color: var(--accent); }
.tile.warn { border-top-color: var(--warn); }

/* Popovers built on <details> */
details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; z-index: 35; top: calc(100% + 6px); left: 0; width: min(340px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .14); }
details.pop.right .pop-body { left: auto; right: 0; }
details.group { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
details.group[open] { display: flex; flex-direction: column; gap: 10px; }
details.group summary { cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 12px; }

/* Uploader */
.dropzone { border: 2px dashed var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; text-align: center; color: var(--muted); }
.dz-inner > .ic { color: var(--accent); }
.dz-inner .link { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; display: inline; font-size: inherit; }
.dz-defaults { width: 100%; }
.dz-defaults summary { cursor: pointer; color: var(--muted); }
.dz-defaults .row { justify-content: center; margin-top: 10px; text-align: left; }
.dz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dz-list:empty { display: none; }
.dz-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .86rem; padding: 6px 8px; border-radius: var(--r); background: var(--sunk); }
.dz-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list .st { color: var(--muted); font-size: .8rem; }
.dz-list li.ok .st { color: var(--accent); }
.dz-list li.err .st { color: var(--bad); }
.dz-list li.ai .st { color: var(--ai); }
.dz-list .bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.dz-list .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.bulkbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r); padding: 8px 10px; margin-bottom: 8px; }
.bulkbar select, .bulkbar input { padding: 5px 8px; font-size: .85rem; }

/* File page */
.file-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .file-grid { grid-template-columns: 1fr; } }
.preview { padding: 0; overflow: hidden; position: sticky; top: 16px; }
.preview iframe { width: 100%; height: 78vh; border: 0; background: var(--sunk); display: block; }
@media (max-width: 1100px) { .preview { position: static; } .preview iframe { height: 60vh; } }
.textview { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.textview summary { cursor: pointer; color: var(--muted); }
.textview pre { white-space: pre-wrap; font: .8rem/1.5 var(--mono); max-height: 320px; overflow: auto; background: var(--sunk); padding: 10px; border-radius: var(--r); }
.panel.ai { border-color: var(--ai-soft); }
.panel.ai h2 { color: var(--ai); }
.attn-note { background: var(--warn-soft); padding: 8px 10px; border-radius: var(--r); font-size: .9rem; }
.panel.callout { border-color: var(--warn); background: var(--warn-soft); }
.callout-line { background: var(--sunk); padding: 10px 12px; border-radius: var(--r); }
dl.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; margin: 0; font-size: .88rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.retention-box { display: flex; flex-direction: column; gap: 8px; background: var(--sunk); padding: 10px 12px; border-radius: var(--r); }
.retention-box .row { align-items: center; }
.retention-box input[type=date] { padding: 4px 8px; }
ol.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ol.versions li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
ol.versions li:last-child { border-bottom: 0; }
ol.versions li .grow { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
ol.versions li small { color: var(--muted); }
ol.versions li.current .mono { color: var(--accent); font-weight: 600; }

/* Search */
.search-form details summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
ol.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ol.results li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
ol.results li:last-child { border-bottom: 0; }
.r-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.r-title a { font-weight: 700; color: var(--ink); }
.snippet { font-size: .86rem; color: var(--muted); max-width: 80ch; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.retention-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.retention-grid label { flex-direction: row; justify-content: space-between; align-items: center; font-weight: 500; background: var(--sunk); padding: 6px 10px; border-radius: var(--r); }
.qr { background: #fff; padding: 12px; border-radius: 8px; align-self: flex-start; border: 1px solid var(--line); }
.qr img, .qr canvas { display: block; }
.key { font-size: 1.05rem; letter-spacing: .05em; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Shared with you, permissions */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plain-list li:first-child { border-top: 0; }
.h3 { font-size: 1rem; margin: 0 0 4px; }
.perm-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-flags .pill { font-size: .75rem; }
.pill.deny { background: var(--bad-bg, #fde8e8); color: var(--bad, #a42020); }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }

/* Sign-in pages: purple band like Revver's login */
body.auth { background: linear-gradient(135deg, #360957, #6f2285 45%, #7514bd) top / 100% 220px no-repeat, var(--paper); }
.auth-brand { color: #fff; }
.auth-brand .mark { background: #fff; color: var(--accent); }

/* Home and other pages, in Revver's card style */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h2 { font-size: 1.05rem; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.link-list a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; min-width: 0; }
.link-list a:hover { background: var(--accent-tint); color: var(--accent); }
.link-list a > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.link-list a > span, .link-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list small { color: var(--muted); font-size: .76rem; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--info); margin-right: 10px; vertical-align: middle; }
.kind-dot.task { background: var(--accent); }
.tabs-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs-bar a { padding: 10px 16px 8px; color: var(--muted); text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs-bar a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-bar a .count { margin-left: 4px; color: var(--muted); font-weight: 600; }
.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-weight: 500; }
.name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-box { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); flex: none; }
.search-line { display: flex; gap: 8px; }
.ex-filter.big { width: auto; flex: 1; padding: 2px 14px; }
.ex-filter.big input { font-size: 1rem; }
.scopes { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.scopes .check-line { font-weight: 700; font-size: .88rem; }
details.advanced summary { cursor: pointer; color: var(--accent); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; list-style: none; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced[open] summary .ic { transform: rotate(180deg); }
details.advanced .row { margin-top: 10px; }
.search-hist { padding: 4px 8px !important; }
.search-hist li { display: flex; align-items: center; }
.search-hist a { flex: 1; display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; min-width: 0; }
.search-hist a:hover { background: var(--sunk); color: var(--accent); }
.search-hist a > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.search-hist a > span, .search-hist small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hist small { color: var(--muted); font-size: .75rem; }
.item .snippet { font-weight: 500; white-space: normal; }
.items.view-details .snippet { display: none; }
.ex-toolbar .grow { flex: 1; }
/* With a side pane open there's less room: Details drops Date Created and Created By. */
.explorer.pane-open .items.view-details .c-created, .explorer.pane-open .items.view-details .c-by { display: none; }
.explorer.pane-open .items.view-details .items-head, .explorer.pane-open .items.view-details .item { grid-template-columns: 26px 32px minmax(140px, 2.4fr) minmax(50px, .5fr) minmax(130px, 1fr) minmax(64px, .5fr) 70px; }
.tb-search { min-width: 0; }
@media (max-width: 860px) {
  .tb-right .pop:not(.tb-user), .tb-right .avatar-btn .ic.xs { display: none; }
  .tb-icon { min-width: 36px; padding: 0 4px; }
  .tb-search { flex: 1 1 0; padding-left: 10px; }
  .tb-right { margin-left: 0; }
  .items.view-list .item { grid-template-columns: 22px 34px minmax(0, 1fr) auto; gap: 0 8px; }
  .ex-toolbar { gap: 4px; }
  .view-switch { border-left: 0; padding-left: 0; margin-left: 0; }
}

/* Collections */
.cols-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.col-list h2 { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.col-list ul { list-style: none; margin: 0; padding: 0; }
.col-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.col-list a:hover { background: var(--sunk); }
.col-list a.on { background: var(--accent-soft, #efe7fb); color: var(--accent, #6b21c8); font-weight: 600; }
.col-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-list .count { font-weight: 500; font-size: 12px; color: var(--muted); }
.pill-default { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); vertical-align: middle; }
.card-head h2 .ic { vertical-align: -3px; }
.col-tree > li > .tree-row .col-name { font-weight: 600; }
.col-tree .tree-row .count { margin-left: auto; font-size: 12px; color: var(--muted); padding-right: 8px; }
.col-new { display: flex; gap: 6px; padding: 8px 10px; }
.col-new input { flex: 1; min-width: 0; }
.col-checks { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.col-checks label { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; font-weight: 500; text-align: left; }
.col-checks input[type=checkbox] { width: auto; margin: 0; flex: none; }
@media (max-width: 760px) { .cols-layout { grid-template-columns: 1fr; } }
.tree .ic.t-collection { color: var(--accent); }
