:root {
  --bg: #0e1116;
  --bg-soft: #151a22;
  --panel: #1a2029;
  --panel-2: #202834;
  --border: #2a323f;
  --text: #e6ebf2;
  --muted: #8b95a7;
  --accent: #0a84ff;
  --accent-2: #4da3ff;
  --green: #2fbf71;
  --amber: #f5a623;
  --red: #e5484d;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-soft: #e9edf4;
  --panel: #ffffff;
  --panel-2: #f0f3f8;
  --border: #dbe1ea;
  --text: #161b26;
  --muted: #5c6675;
  --shadow: 0 6px 24px rgba(30, 40, 60, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  transition: transform .18s ease;
}
.sidebar.hidden { transform: translateX(-100%); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  color: var(--muted); text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2); }
.nav a .badge { margin-left: auto; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.me-badge { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.me-badge .avatar { width: 32px; height: 32px; }
.me-badge .who { min-width: 0; flex: 1; }
.me-badge .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-badge .role { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.me-badge .logout { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px; }
.me-badge .logout:hover { color: var(--red); background: var(--panel-2); }

.main-col { flex: 1; margin-left: 236px; min-width: 0; display: flex; flex-direction: column; }
.sidebar.hidden ~ .main-col { margin-left: 0; }
.topbar {
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; }
.crumb a { color: var(--accent-2); text-decoration: none; }
.crumb .sep { opacity: .5; }
.crumb .current { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; position: relative;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.view { padding: 26px 30px 60px; max-width: 1180px; margin: 0 auto; width: 100%; }
.view.wide { max-width: 1400px; }

/* badges */
.badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 1px 6px; min-width: 16px; text-align: center;
}
.with-badge .badge { position: absolute; top: -4px; right: -4px; }
.hidden { display: none !important; }

/* page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 750; letter-spacing: -.3px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all .12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 750; line-height: 1.1; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tc, var(--accent)); }
.stat.t-green { --tc: var(--green); } .stat.t-amber { --tc: var(--amber); } .stat.t-red { --tc: var(--red); }
.stat.t-purple { --tc: var(--purple); } .stat.t-teal { --tc: var(--teal); } .stat.t-blue { --tc: var(--accent); }

/* grids */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* project cards */
.proj-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .12s, transform .12s;
}
.proj-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.proj-card .pc-top { display: flex; align-items: center; gap: 10px; }
.proj-card .pc-color { width: 26px; height: 26px; border-radius: 8px; flex: none; }
.proj-card h3 { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card .desc { color: var(--muted); font-size: 13px; min-height: 36px; }
.proj-card .pc-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.chip {
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px;
}
.chip.ACTIVE { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.chip.ARCHIVED { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.chip.role { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-2); }
.chip.sync-ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.chip.sync-err { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.chip.sync-running { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* explorer */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs a { color: var(--accent-2); text-decoration: none; font-size: 13px; }
.crumbs .csep { color: var(--muted); }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.node {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .12s;
  position: relative;
}
.node:hover { border-color: var(--accent); }
.node .thumb {
  height: 84px; border-radius: 7px; display: grid; place-items: center;
  background: var(--panel-2); font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .5px; text-transform: uppercase;
  overflow: hidden;
}
.node .thumb .ext { font-size: 15px; color: var(--accent-2); }
.node .nname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .nmeta { color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; }
.node .node-menu { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .12s; }
.node:hover .node-menu { opacity: 1; }
.node.summary { display: grid; place-items: center; color: var(--muted); }

/* folder tree */
.seg { display: flex; gap: 4px; }
.seg .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tree { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tree-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 14px;
  font-size: 13px; min-width: 0;
}
.tree-row.t-folder { font-weight: 600; }
.tree-row.t-file { color: var(--text); font-weight: 400; }
.tree-row:hover { background: var(--bg-soft); }
.tree-row .tree-tw { width: 16px; flex: none; cursor: pointer; color: var(--muted); text-align: center; user-select: none; }
.tree-row .tree-tw.leaf { visibility: hidden; }
.tree-row .tree-name { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tree-row .tree-name:hover { text-decoration: underline; }
.tree-row .tree-sub { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 8px; flex: none; }
.tree-row .tree-open { margin-left: auto; flex: none; }
.tree-row .tree-size { color: var(--muted); font-size: 11px; margin-left: auto; flex: none; }
.tree-kids { position: relative; }
.tree-kids .tree-kids { padding-left: 26px; }
.tree-group { position: relative; }
.tree-group::before {
  content: ""; position: absolute; left: 21px; top: 0; bottom: 0;
  border-left: 1px solid var(--border);
}
.tree-kids .tree-row { padding-left: 26px; }
.tree.empty { color: var(--muted); padding: 24px; text-align: center; }

/* chat-ish activity feed */
.feed { list-style: none; }
.feed li { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .f-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; font-size: 13px; flex: none; }
.feed .f-main { min-width: 0; flex: 1; }
.feed .f-main .f-title { font-size: 13px; }
.feed .f-main .f-title strong { font-weight: 600; }
.feed .f-main .f-sub { font-size: 12px; color: var(--muted); }
.feed .f-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.feed .empty { color: var(--muted); text-align: center; padding: 24px; }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .input, .filter-bar .select { width: auto; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 8, 12, .6);
  display: grid; place-items: center; z-index: 50; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop .16s ease; }
.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head .x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-head .x:hover { color: var(--text); background: var(--panel-2); }
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* toast */
#toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  color: var(--text); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; min-width: 220px; max-width: 360px;
  animation: pop .15s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(60% 50% at 50% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); }
.login-card {
  width: 360px; max-width: 92vw; background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); padding: 34px 30px; text-align: center;
}
.login-card .brand-mark { margin: 0 auto 14px; width: 48px; height: 48px; font-size: 24px; border-radius: 12px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.google-btn {
  display: inline-flex; align-items: center; gap: 10px; width: 100%; justify-content: center;
  background: #fff; color: #1a1a1a; border: 1px solid #d8dee7; border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.google-btn:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.google-btn svg { width: 18px; height: 18px; }

/* charts */
.chart { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.legend .li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* avatars */
.avatar {
  border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 700; display: grid; place-items: center; flex: none;
  font-size: 13px;
}

/* misc */
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { font-size: 40px; margin-bottom: 10px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; }
pre.json { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 12px; overflow: auto; max-height: 320px; }
a.link { color: var(--accent-2); text-decoration: none; }
a.link:hover { text-decoration: underline; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
.sync-bar { width: 100%; height: 6px; background: var(--panel-2); border-radius: 20px; overflow: hidden; margin-top: 8px; }
.sync-bar .fill { height: 100%; background: var(--accent); border-radius: 20px; transition: width .3s; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* fullscreen overlay (viewer, folder view) */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 700; display: grid; place-items: center; animation: fade .14s ease; }
.overlay .panel { width: 97vw; max-width: 1400px; height: 95vh; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; animation: pop .16s ease; }
.overlay .panel-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.overlay .panel-title { min-width: 0; overflow: hidden; }
.overlay .panel-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; max-width: 60vw; }
.overlay .panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; }

/* inline file preview */
.preview-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; border-radius: 8px; }

/* Document-control panel (lock + comments) */
.preview-split { display: flex; flex: 1; min-height: 0; gap: 12px; }
.preview-split .preview-frame,
.preview-split .preview-note { flex: 1; min-width: 0; }
.docr-panel { width: 300px; flex: none; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--panel); }
.docr-title { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .75; margin-bottom: 6px; }
.docr-title svg { width: 13px; height: 13px; }
.docr-lock { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.docr-lock-status { font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.lock-avail { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.lock-held { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #e5484d; }
.lock-chip { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, #e5484d 14%, transparent); color: #e5484d; border: 1px solid color-mix(in srgb, #e5484d 40%, transparent); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.lock-chip svg { width: 12px; height: 12px; }
.docr-comments { display: flex; flex-direction: column; gap: 8px; }
.docr-cmt { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.docr-cmt-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.docr-cmt-body { font-size: 12.5px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.docr-compose { display: flex; flex-direction: column; gap: 6px; }
.docr-input { resize: vertical; min-height: 48px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 12.5px; font-family: inherit; }
.docr-compose-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.docr-compose-bar .att-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 6px 2px 8px; font-size: 11px; max-width: 100%; }
.att-chip svg { width: 11px; height: 11px; opacity: .7; }
.att-rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.att-rm:hover { color: #e5484d; }
.docr-cmt-att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.att-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--accent); text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 6px; padding: 2px 7px; }
.att-link:hover { text-decoration: underline; }
.att-link svg { width: 11px; height: 11px; }
.docr-replies { margin: 6px 0 0 10px; padding-left: 8px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.docr-reply { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.docr-reply .docr-input { min-height: 30px; flex: 1; }
.link-btn { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; font-size: 11.5px; }
.link-btn:hover { text-decoration: underline; }
.mention { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; padding: 0 2px; }
.mention-box { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; max-height: 180px; overflow-y: auto; }
.mention-item { display: flex; justify-content: space-between; gap: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 6px 9px; font-size: 12px; text-align: left; }
.mention-item:hover { background: var(--panel-2); }
.mention-name { font-weight: 600; }
.mention-email { font-size: 11px; }
.docr-select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; font-family: inherit; }
.docr-decide .docr-input { flex: 1; }
.approv-box { display: flex; flex-direction: column; gap: 8px; }
.approv-row { border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.status-chip { border-radius: 999px; padding: 1px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.st-ok { background: color-mix(in srgb, #2fbf71 18%, transparent); color: #2fbf71; }
.st-bad { background: color-mix(in srgb, #e5484d 16%, transparent); color: #e5484d; }
.st-wait { background: color-mix(in srgb, #f5a623 20%, transparent); color: #b3791a; }

/* Member contribution chips */
.contrib-chip { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: 11px; margin: 1px 3px 1px 0; white-space: nowrap; }
.preview-note { margin: auto; text-align: center; color: var(--text); padding: 30px; }
.preview-note p { margin: 4px 0; }

/* folder cards */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.folder-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.folder-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.folder-card .fc-ico { font-size: 26px; color: var(--accent-2); line-height: 1; }
.folder-card .fc-name { font-weight: 600; font-size: 13px; margin: 8px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card .fc-count { color: var(--muted); font-size: 11.5px; }

/* compact file rows */
.sub-head { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; }
.folder-view .sub-head:first-child { margin-top: 0; }
.file-list { display: flex; flex-direction: column; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.file-item:hover { background: var(--panel); border-color: var(--border); }
.file-item .ext { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; font-size: 9px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; overflow: hidden; }
.file-item .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 13px; }
.file-item .fi-meta { flex: none; color: var(--muted); font-size: 11px; }
/* --- Command palette (Ctrl K) --- */
.pal-backdrop { position: fixed; inset: 0; background: rgba(8,9,12,.55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; z-index: 300; padding-top: 10vh; }
.pal-panel { width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pal-ico { color: var(--muted); display: grid; place-items: center; }
.pal-ico.big { width: 32px; height: 32px; }
.pal-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 15px; }
.pal-input::placeholder { color: var(--muted); }
.kbd { flex: none; font-size: 10px; font-family: ui-monospace, monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: var(--panel-2); }
.pal-results { max-height: min(420px, 60vh); overflow-y: auto; }
.pal-group { padding: 8px 14px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; border-left: 2px solid transparent; }
.pal-item.hl { background: var(--panel-2); border-left-color: var(--accent); }
.pal-item .pal-ico { width: 20px; }
.pal-item .pal-ico svg { width: 18px; height: 18px; }
.pal-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pal-meta { flex: none; color: var(--muted); font-size: 11px; }
.pal-hint { padding: 22px 14px; color: var(--muted); font-size: 12.5px; text-align: center; }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10.5px; }

/* --- Explorer table / list view --- */
.expl-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.expl-table thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--panel-2); }
.expl-table th.tb { padding: 0; }
.expl-table th.center, .expl-table td.center { text-align: center; }
.expl-table th.right, .expl-table td.right { text-align: right; }
.sortbtn { display: inline-flex; align-items: center; gap: 5px; width: 100%; padding: 9px 12px; background: none; border: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sortbtn:hover { color: var(--text); }
.sortbtn.active { color: var(--accent); }
.sarr { font-size: 9px; }
.expl-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.expl-table tbody tr { cursor: pointer; }
.expl-table tbody tr:hover { background: var(--panel-2); }
.tname { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tname svg { width: 16px; height: 16px; color: var(--accent-2); flex: none; }
.trash-list { display: flex; flex-direction: column; gap: 6px; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.trash-row .tname { flex: 1; min-width: 0; }
.trash-row .btn { flex: none; }
.listfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 0 2px; }

/* --- Overlay breadcrumbs --- */
.ovc-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; margin-top: 2px; color: var(--muted); }
.ovc-crumbs { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ovc-crumbs a { color: var(--accent-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.ovc-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.ovc-crumbs .csep, .ovc-trail .csep { color: var(--muted); opacity: .6; }
.ovc-crumbs .cur { color: var(--text); font-weight: 600; }
.ovc-crumbs svg { width: 13px; height: 13px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 12px; font-size: 11.5px; font-weight: 600; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.chip-btn:hover { color: var(--text); }
.chip-btn.active { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); color: var(--accent-2); }

/* Toggle switch */
.switch { position: relative; width: 40px; height: 22px; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--muted, #666); border-radius: 999px; transition: background .2s; }
.switch .slider::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch:has(input:focus-visible) .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
