:root {
  --bg: #f6f8fc; --surface: #ffffff; --surface-2: #eef2f9; --hover: #e8edf6; --border: #dfe4ec;
  --text: #1f2937; --muted: #6b7280; --accent: #2563eb; --accent-soft: #dbe7ff; --accent-text: #fff;
  --danger: #dc2626; --ok: #16a34a; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18); --radius: 14px; --sel: #c9dafe;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --surface: #171d26; --surface-2: #1e2632; --hover: #232c3a; --border: #2b3443;
    --text: #e5e9f0; --muted: #94a0b4; --accent: #6b9bff; --accent-soft: #1f3157; --accent-text: #0b1220;
    --danger: #f87171; --ok: #4ade80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55); --sel: #24406f;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171d26; --surface-2: #1e2632; --hover: #232c3a; --border: #2b3443;
  --text: #e5e9f0; --muted: #94a0b4; --accent: #6b9bff; --accent-soft: #1f3157; --accent-text: #0b1220;
  --danger: #f87171; --ok: #4ade80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55); --sel: #24406f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Heebo, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg { flex-shrink: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); padding: 8px 16px; border-radius: 999px; font-weight: 500; transition: background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; color: var(--muted); transition: background .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- login ---------- */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 400px; }
.card h1 { margin: 12px 0 4px; font-size: 24px; }
.card p { margin: 0 0 20px; color: var(--muted); }
.card form { display: grid; gap: 12px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; color: var(--text); }
.logo img { width: 36px; height: 36px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; grid-template-rows: 64px 1fr; height: 100vh; height: 100dvh; }
header.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; }
header.top .logo { width: 224px; padding-inline-start: 8px; }
.search { flex: 1; max-width: 720px; position: relative; }
.search input { width: 100%; height: 46px; border: 0; background: var(--surface-2); border-radius: 999px; padding: 0 48px 0 20px; outline: none; transition: background .15s, box-shadow .15s; }
.search input:focus { background: var(--surface); box-shadow: var(--shadow); }
.search svg { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-actions { display: flex; gap: 4px; margin-inline-start: auto; }
#menuToggle { display: none; }

aside.side { padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.new-btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 15px; margin: 4px 0 14px; width: fit-content; transition: box-shadow .15s, background .15s; }
.new-btn:hover { background: var(--accent-soft); }
.nav a { display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.drop-target { outline: 2px dashed var(--accent); }
.storage { margin-top: 16px; padding: 0 16px; font-size: 13px; color: var(--muted); }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.meter > div { height: 100%; background: var(--accent); border-radius: 99px; }

main.main { background: var(--surface); border-radius: 18px 0 0 0; margin-inline-end: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; }
[dir="rtl"] main.main { border-radius: 0 18px 0 0; }
.main-head { display: flex; align-items: center; gap: 8px; padding: 14px 20px 6px; min-height: 64px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 2px; font-size: 20px; flex-wrap: wrap; flex: 1; min-width: 0; }
.crumbs button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:last-child { color: var(--text); font-weight: 500; }
.crumbs button:hover { background: var(--hover); }
.crumbs button.drop-target { outline: 2px dashed var(--accent); }
.crumbs .sep { color: var(--muted); display: inline-flex; }
.main-head { position: relative; }
/* overlays the header row so showing it never shifts the items below */
.selbar { position: absolute; inset: 10px 20px 2px; z-index: 3; display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px 8px 4px 4px; overflow-x: auto; }
.selbar .count { padding: 0 8px; font-weight: 500; flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 4px 20px 120px; position: relative; }
.section-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 18px 4px 10px; }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.folder-card { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 14px; height: 52px; background: var(--surface-2); border-radius: 12px; user-select: none; cursor: default; border: 2px solid transparent; }
.file-card { background: var(--surface-2); border-radius: 12px; padding: 0 8px 8px; user-select: none; cursor: default; border: 2px solid transparent; display: flex; flex-direction: column; }
.file-card .fc-head { display: flex; align-items: center; gap: 10px; height: 46px; padding-inline-start: 6px; }
.file-card .thumb { aspect-ratio: 4 / 3; background: var(--surface); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.file-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-card .thumb .big svg { width: 64px; height: 64px; }
.item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.folder-card:hover, .file-card:hover { background: var(--hover); }
.selected.folder-card, .selected.file-card, tr.selected td { background: var(--sel) !important; }
.drop-target.folder-card, tr.drop-target td { outline: 2px dashed var(--accent); outline-offset: -2px; }
.item-more { opacity: .9; width: 32px; height: 32px; }
.badge { display: inline-flex; color: var(--muted); }

/* ---------- list ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: start; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; cursor: pointer; white-space: nowrap; }
table.list td { padding: 6px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
table.list td.name-cell { width: 100%; max-width: 0; }
table.list .nm { display: flex; align-items: center; gap: 14px; }
table.list tr:hover td { background: var(--hover); }
table.list .col-hide { }
.sort-ind { font-size: 11px; }

/* ---------- empty & drop ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 140px; height: 140px; color: var(--accent); opacity: .85; }
.empty h2 { color: var(--text); font-weight: 500; margin: 12px 0 4px; }
.drop-overlay { position: absolute; inset: 8px; border: 3px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--accent-soft) 75%, transparent); display: grid; place-items: center; z-index: 20; pointer-events: none; font-size: 20px; font-weight: 600; color: var(--accent); }
.drop-overlay div { display: grid; justify-items: center; gap: 10px; }

/* ---------- menus ---------- */
.menu { position: fixed; z-index: 500; /* above dialogs (200), the viewer (300) and toasts (400) — menus open from inside them */ background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 6px 0; min-width: 220px; animation: pop .12s ease-out; }
.menu button { display: flex; width: 100%; align-items: center; gap: 14px; padding: 9px 18px; background: none; border: 0; text-align: start; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10,15,25,.5); z-index: 200; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .15s ease-out; }
.modal.wide { max-width: 560px; }
.modal h3 { margin: 0; font-size: 20px; font-weight: 500; padding: 22px 24px 8px; display: flex; align-items: center; gap: 10px; }
.modal h3 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .body { padding: 8px 24px; overflow-y: auto; display: grid; gap: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

.share-link { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.share-link .row { display: flex; gap: 8px; align-items: center; }
.share-link input { flex: 1; min-width: 0; direction: ltr; font-size: 13px; }
.share-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.share-meta span { display: inline-flex; align-items: center; gap: 4px; }
.share-meta .acts { margin-inline-start: auto; gap: 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 500; }
.pill.lock { background: #fef3c7; color: #92400e; }
.pill.open { background: #dcfce7; color: #166534; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.lock { background: #422c06; color: #fcd34d; } :root:not([data-theme="light"]) .pill.open { background: #0f3a22; color: #86efac; } }
.new-share { background: var(--surface-2); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.perm-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-pick label { cursor: pointer; }
.perm-pick input { position: absolute; opacity: 0; pointer-events: none; }
.perm-pick span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); height: 100%; }
.perm-pick span small { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.3; }
.perm-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.perm-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.pill.edit { background: var(--accent-soft); color: var(--accent); }
.new-share .opts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.new-share select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }

.tree { border: 1px solid var(--border); border-radius: 12px; max-height: 340px; overflow-y: auto; padding: 6px; }
.tree button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: start; }
.tree button:hover { background: var(--hover); }
.tree button.sel { background: var(--accent-soft); color: var(--accent); }
.tree button:disabled { opacity: .4; cursor: default; }

/* ---------- preview ---------- */
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(8,10,14,.92); display: flex; flex-direction: column; color: #fff; animation: fade .15s; }
.viewer-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.viewer-top .title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.viewer-top .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .icon-btn { color: #e5e7eb; }
.viewer .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.viewer-body { flex: 1; display: grid; place-items: center; padding: 8px 64px 24px; min-height: 0; position: relative; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.viewer-body iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.viewer-body pre { width: min(1000px, 100%); height: 100%; margin: 0; overflow: auto; background: #111827; color: #e5e7eb; padding: 20px; border-radius: 8px; direction: ltr; text-align: left; font: 13px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.viewer-body audio { width: min(520px, 100%); }
.no-preview { display: grid; justify-items: center; gap: 14px; text-align: center; background: #1f2937; padding: 36px 48px; border-radius: 16px; }
.no-preview svg { width: 72px; height: 72px; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px !important; height: 48px !important; background: rgba(255,255,255,.08) !important; }
.nav-arrow.prev { right: 10px; } .nav-arrow.next { left: 10px; }

/* ---------- uploads panel ---------- */
.uploads { position: fixed; bottom: 16px; left: 16px; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); z-index: 150; overflow: hidden; }
.uploads .uh { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 8px; background: var(--surface-2); font-weight: 500; }
.uploads .uh .t { flex: 1; padding-inline-start: 8px; }
.uploads ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.uploads li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 14px; }
.uploads li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring { width: 22px; height: 22px; }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .2s; }
.u-done { color: var(--ok); } .u-err { color: var(--danger); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .15s; pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast button { background: none; border: 0; color: #93c5fd; font-weight: 600; }

/* ---------- public share page ---------- */
.pub-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pub-top .grow { flex: 1; }
.pub-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
.pub-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pub-file { max-width: 560px; margin: 40px auto; text-align: center; }
.pub-file .big-icon svg { width: 88px; height: 88px; }
.pub-file h1 { font-size: 22px; font-weight: 500; word-break: break-word; margin: 14px 0 4px; }
.pub-file .preview { margin: 20px 0; }
.pub-file .preview img, .pub-file .preview video { max-width: 100%; max-height: 60vh; border-radius: 12px; box-shadow: var(--shadow); }
.pub-file .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.pub-card { background: var(--surface); border-radius: 18px; border: 1px solid var(--border); padding: 8px 16px 16px; }

/* ---------- responsive ---------- */
.backdrop-side { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 60px 1fr; }
  header.top { gap: 8px; padding: 0 8px; }
  header.top .logo { width: auto; }
  header.top .logo .logo-txt b { display: none; }
  header.top .logo .logo-domain { font-size: 10.5px; }
  #menuToggle { display: inline-grid; }
  aside.side { position: fixed; top: 0; bottom: 0; right: 0; width: 280px; background: var(--bg); z-index: 120; transform: translateX(100%); transition: transform .2s; padding-top: 16px; box-shadow: var(--shadow-lg); }
  aside.side.open { transform: none; }
  .backdrop-side.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 110; }
  main.main, [dir="rtl"] main.main { border-radius: 18px 18px 0 0; }
  .main-head { padding: 10px 12px 4px; }
  .crumbs { font-size: 17px; }
  .content { padding: 4px 12px 120px; }
  .selbar { inset: 8px 12px 2px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  table.list .col-hide { display: none; }
  .fab { position: fixed; bottom: 20px; right: 20px; z-index: 90; width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lg); display: grid; place-items: center; }
  .viewer-body { padding: 8px 8px 16px; }
  .nav-arrow { display: none !important; }
  .pub-top, .pub-main { padding-left: 16px; padding-right: 16px; }
  .search input { height: 42px; }
}
@media (min-width: 861px) { .fab { display: none; } }
.exp-pick { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.exp-pick select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.exp-pick .date-wrap { display: inline-flex; align-items: center; gap: 2px; position: relative; }
.exp-pick .date-wrap.hidden { display: none; }
.exp-pick .date-wrap .input { width: 132px; padding: 7px 10px; text-align: center; letter-spacing: .5px; }
.exp-pick .native-date { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.share-link .link-title { display: flex; align-items: center; gap: 8px; }
.share-link .link-title b { flex: 1; }
.share-link.is-edit { border-color: var(--accent); }
.share-link.is-edit .link-title { color: var(--accent); }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; padding: 4px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--accent-soft); }

/* ---------- share: 3 permissions + upload limits ---------- */
.perm-pick.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .perm-pick.three { grid-template-columns: 1fr; } }
.limits { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.lim-pick { display: inline-flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lim-pick label { display: inline-flex; gap: 6px; align-items: center; }
.lim-pick select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.share-link.perm-edit { border-color: var(--accent); }
.share-link.perm-edit .link-title { color: var(--accent); }
.share-link.perm-upload { border-color: #16a34a; }
.share-link.perm-upload .link-title { color: #15803d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .share-link.perm-upload .link-title { color: #4ade80; } }
:root[data-theme="dark"] .share-link.perm-upload .link-title { color: #4ade80; }

/* ---------- upload-only (drop-box) page ---------- */
.drop-zone { margin-top: 20px; border: 2px dashed var(--border); border-radius: 16px; padding: 28px 16px; display: grid; justify-items: center; gap: 6px; color: var(--muted); transition: border-color .15s, background .15s; }
.drop-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.sent-list { margin-top: 18px; text-align: start; }
.sent-list ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.sent-list li { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.sent-list li:last-child { border-bottom: 0; }
.sent-list .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- uploads: waiting / error text ---------- */
.u-wait { font-size: 12px; color: #b45309; white-space: nowrap; }
.u-err-msg { display: block; color: var(--danger); font-size: 12px; white-space: normal; }

/* ---------- activity log ---------- */
.log-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 8px; }
.log-bar select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-inline-start: 6px; }
.notify-box { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.log-help { font-size: 12px; margin-bottom: 8px; }
.log-help code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; }
.act { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); }
.act-ok { background: #dcfce7; color: #166534; } .act-bad { background: #fee2e2; color: #991b1b; } .act-acc { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .act-ok { background: #0f3a22; color: #86efac; } :root:not([data-theme="light"]) .act-bad { background: #4a1515; color: #fca5a5; } }
:root[data-theme="dark"] .act-ok { background: #0f3a22; color: #86efac; } :root[data-theme="dark"] .act-bad { background: #4a1515; color: #fca5a5; }

/* ---------- data table (table-skill port) ---------- */
.dt { position: relative; }
.dt-scroll { overflow: auto; max-height: calc(100dvh - 300px); border: 1px solid var(--border); border-radius: 12px; }
.dt-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.dt-table th, .dt-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.dt-table td.wrap { white-space: normal; word-break: break-word; }
.dt-table td.num { direction: ltr; text-align: right; }
.dt-head th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; user-select: none; }
.dt-head th.sortable { cursor: pointer; }
.dt-head th.dt-over { box-shadow: inset 3px 0 0 var(--accent); }
.dt-grip { color: var(--muted); opacity: .5; cursor: grab; margin-inline-end: 4px; font-size: 11px; }
.dt-sort { color: var(--accent); font-size: 11px; margin-inline-start: 4px; }
.dt-sort sup { font-size: 9px; }
.dt-resize { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 6px; cursor: col-resize; }
.dt-resize:hover { background: var(--accent); opacity: .4; }
.dt-head th { position: sticky; }
.dt-filters th { position: sticky; top: 31px; z-index: 2; background: var(--surface); padding: 4px 6px; }
.dt-filter { width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; outline: none; }
.dt-filter:focus { border-color: var(--accent); }
.dt-table tbody tr:hover td { background: var(--hover); }
.dt-table tbody td { cursor: default; }
.dt-table .nm { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; }
.dt-table tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); }
.dt-empty { text-align: center !important; color: var(--muted); padding: 28px !important; }
.dt-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 2px; font-size: 13px; color: var(--muted); }
.dt-pager { display: inline-flex; align-items: center; gap: 2px; }
.dt-pager .icon-btn { width: 30px; height: 30px; }
.dt-size select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); margin-inline-start: 4px; }
.dt-foot .btn { padding: 5px 12px; font-size: 13px; }
.dt-tip { position: absolute; z-index: 5; background: #1f2937; color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 6px; pointer-events: none; }

/* ---------- connect-drive page ---------- */
.dav-page { max-width: 820px; }
.dav-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.dav-step > div { flex: 1; min-width: 0; display: grid; gap: 6px; }
.dav-step .num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.dav-new { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.dav-new .input { flex: 1; min-width: 200px; }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-row code { flex: 1; min-width: 0; background: var(--surface-2); padding: 9px 12px; border-radius: 8px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; word-break: break-all; text-align: left; }
.code-row code.pw { font-size: 16px; letter-spacing: 1px; }
.newpw { background: #fef9c3; color: #713f12; border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .newpw { background: #3b3206; color: #fde68a; } }
:root[data-theme="dark"] .newpw { background: #3b3206; color: #fde68a; }
.dav-manual { margin-top: 14px; font-size: 14px; }
.dav-manual summary { cursor: pointer; color: var(--accent); }
.dav-manual div { margin-top: 8px; line-height: 1.9; }
.dav-manual code, .dav-step code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.dav-token { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dav-token .muted { flex: 1; font-size: 13px; }
.share-link.perm-site { border-color: #7c3aed; }
.share-link.perm-site .link-title { color: #6d28d9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .share-link.perm-site .link-title { color: #c4b5fd; } }
:root[data-theme="dark"] .share-link.perm-site .link-title { color: #c4b5fd; }
.link-title .link-btn + .link-btn { margin-inline-start: 0; }
label.check[data-siterow] { flex-wrap: wrap; }

label.fld { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }

/* ---------- ONLYOFFICE editor page ---------- */
.oo-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.oo-top { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 52px; }
.oo-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.oo-state { font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oo-top .btn { padding: 6px 12px; font-size: 14px; }
.oo-host { flex: 1; min-height: 0; }
.oo-host iframe { display: block; border: 0; }

/* menu items: label grows, keyboard hint at the far end (like Google Drive) */
.menu { min-width: 260px; }
.menu .mi-label { flex: 1; }
.menu .mi-hint { font: 12px/1 system-ui, sans-serif; color: var(--muted); background: none; border: 0; padding: 0; white-space: nowrap; }

/* domain under the logo name, so it's clear which server's drive is open */
.logo-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.logo-txt b { font-weight: 700; }
.logo-domain { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .2px; white-space: nowrap; text-align: start; }

/* ================= TeamDrive additions (appended to style.css by build.mjs) ================= */
.modal.wide { max-width: 680px; }
.btn.sm { padding: 5px 12px; font-size: 14px; gap: 6px; }
.btn.wide { width: 100%; justify-content: center; }
.btn.danger.primary, .btn.primary.danger { background: var(--danger); color: #fff; }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.xs { width: 24px; height: 24px; } .icon-btn.danger:hover { color: var(--danger); }
.input.sm { width: auto; padding: 5px 10px; font-size: 14px; border-radius: 8px; }
.input.mono { font-family: Consolas, monospace; font-size: 13px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex-shrink: 0; letter-spacing: .3px; }
.me-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; display: inline-flex; }
.ac-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.ac-ic.big { width: 52px; height: 52px; background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: #fef3c7; color: #92400e; } .pill.danger { background: #fee2e2; color: #991b1b; } .pill.ext { background: #ffedd5; color: #9a3412; }
:root[data-theme="dark"] .pill.warn { background: #422c06; color: #fcd34d; } :root[data-theme="dark"] .pill.danger { background: #4a1515; color: #fca5a5; } :root[data-theme="dark"] .pill.ext { background: #43230c; color: #fdba74; }
.act-warn { background: #fef3c7; color: #92400e; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.note.warn { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .note.warn { background: #422c06; color: #fcd34d; }
.empty-sm { color: var(--muted); padding: 16px 4px; font-size: 14px; }
.pad { padding: 20px; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.err { color: var(--danger); font-size: 14px; }
.err:empty { display: none; }
.fld-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fld-inline .input { width: auto; }
.form-grid { display: grid; gap: 12px; }
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.center-page .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.center-page .logo img { width: 36px; height: 36px; }
.qr { display: grid; place-items: center; } .qr svg, .qr img { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 12px; }
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .backup-codes code { background: var(--surface-2); padding: 6px; border-radius: 8px; text-align: center; font-size: 15px; }
.code-input { font-size: 26px; letter-spacing: 8px; text-align: center; }
.nav-h { font-size: 12px; color: var(--muted); padding: 14px 18px 4px; font-weight: 500; }
.nav-h:empty { padding: 0; border-top: 1px solid var(--border); margin: 8px 12px; }
.nav-badge { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; min-width: 18px; padding: 0 6px; text-align: center; font-weight: 600; line-height: 18px; }
.head-extra:empty { display: none; }
.crumb-link { padding: 4px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; } .crumb-link:hover { background: var(--hover); }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.warn > i, .meter.warn > div { background: var(--danger); }
.meter.mini { width: 70px; margin: 0; }

/* pages */
.page { max-width: 1060px; margin: 0 auto; padding: 4px 4px 60px; display: grid; gap: 14px; align-content: start; }
.page.narrow { max-width: 700px; }
.page .card { max-width: none; padding: 18px; border-radius: 14px; box-shadow: none; display: grid; gap: 10px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.tabs a:hover { color: var(--text); } .tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: grid; gap: 2px; }
.stat b { font-size: 22px; font-weight: 600; } .stat span { color: var(--muted); font-size: 13px; } .stat.warn b { color: #d97706; }
.stat.wide-stat { grid-column: span 2; } .stat .meter { margin: 4px 0 0; }
.sh-title { font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.list-table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.lt-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.lt-row:last-child { border-bottom: 0; } a.lt-row:hover { background: var(--hover); }
.lt-row.bad { background: #fef2f2; } :root[data-theme="dark"] .lt-row.bad { background: #2a1515; }
.lt-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.lt-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lt-main > small { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; }
.lt-main a { color: inherit; text-decoration: none; } .lt-main a:hover { text-decoration: underline; }
.selbar-inline { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; }
.filters .input { flex: 1; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .cols2 { grid-template-columns: 1fr; } .stat.wide-stat { grid-column: auto; } }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.mini-log { display: grid; gap: 4px; font-size: 13px; max-height: 360px; overflow-y: auto; }
.actions-row .btn { font-size: 14px; }
.log-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.log-help { font-size: 12px; margin-bottom: 8px; }

/* share dialog */
.share-body section { display: grid; gap: 8px; }
.chip-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; background: var(--surface); cursor: text; min-height: 44px; }
.chip-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip-box input { flex: 1; min-width: 160px; border: 0; outline: 0; background: transparent; padding: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 13px; }
.chip.team, .chip.group { background: var(--accent-soft); color: var(--accent); } .chip.ext { background: #ffedd5; color: #9a3412; }
.chip button { border: 0; background: transparent; display: inline-grid; place-items: center; border-radius: 50%; width: 18px; height: 18px; padding: 0; color: inherit; }
.chip button:hover { background: rgba(0,0,0,.1); }
.ac { position: relative; margin-top: -4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.ac button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 12px; text-align: start; }
.ac button:hover, .ac button.hi { background: var(--hover); }
.ac .ac-ic { width: 26px; height: 26px; }
.sh-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .sh-opts .input { width: auto; flex: 1; min-width: 200px; }
.sh-sum { font-size: 13px; } .sh-sum:empty { display: none; }
.acc-list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; flex-wrap: wrap; }
.acc-row:hover { background: var(--surface-2); } .acc-row.expired { opacity: .55; }
.acc-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; } .acc-who small { flex-basis: 100%; }
.mem-mini { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; flex-basis: 100%; }
.skip-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 14px; }
.sh-adv { border-top: 1px solid var(--border); padding-top: 10px; }

/* wizard */
.wiz-head { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.wiz-group { display: grid; gap: 4px; margin-top: 6px; }
.wiz-row { align-items: flex-start !important; padding: 4px 0; } .wiz-row span { display: grid; } .wiz-row small { font-size: 12px; }
.ver { display: grid; width: 100%; text-align: start; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; gap: 2px; }
.ver:hover { background: var(--hover); }

/* ================= document editor ================= */
.doc-page { height: 100dvh; display: grid; grid-template-rows: auto auto 1fr; background: var(--bg); }
.doc-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.doc-logo { width: 28px; height: 28px; }
.doc-titlebox { flex: 1; min-width: 0; display: grid; }
.doc-title { border: 1px solid transparent; background: transparent; font-size: 18px; font-weight: 500; padding: 2px 8px; border-radius: 8px; outline: 0; min-width: 0; }
.doc-title:hover:not(:disabled), .doc-title:focus { border-color: var(--border); }
.doc-state { font-size: 12px; padding: 0 8px; } .doc-state.bad { color: var(--danger); }
.doc-users { display: flex; gap: 2px; } .doc-users .avatar { border: 2px solid var(--surface); }
.doc-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; flex-wrap: wrap; }
.tb-btn { border: 0; background: transparent; min-width: 32px; height: 32px; border-radius: 8px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 14px; color: var(--text); }
.tb-btn:hover { background: var(--hover); } .tb-btn.on { background: var(--accent-soft); color: var(--accent); }
.tb-btn mark { background: #fde68a; padding: 0 3px; color: #000; }
.tb-sel { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 4px 6px; font-size: 14px; }
.tb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.tb-table { display: inline-flex; gap: 2px; }
.doc-body { display: flex; min-height: 0; }
.doc-scroll { flex: 1; overflow-y: auto; padding: 24px 12px 80px; }
.doc-sheet { background: var(--surface); max-width: 820px; margin: 0 auto; min-height: 1000px; padding: 56px 72px; border-radius: 4px; box-shadow: var(--shadow); }
.doc-sheet.preview { min-height: 0; padding: 24px; box-shadow: none; border: 1px solid var(--border); max-height: 60vh; overflow-y: auto; width: 100%; }
@media (max-width: 700px) { .doc-sheet { padding: 24px 18px; } .doc-scroll { padding: 8px 4px 60px; } }
.doc-editor .ProseMirror { outline: 0; min-height: 800px; font-size: 16px; line-height: 1.7; }
.doc-sheet .ProseMirror p { margin: 0 0 .6em; }
.doc-sheet .ProseMirror h1 { font-size: 28px; margin: .8em 0 .4em; } .doc-sheet .ProseMirror h2 { font-size: 22px; margin: .8em 0 .4em; } .doc-sheet .ProseMirror h3 { font-size: 18px; margin: .8em 0 .3em; }
.doc-sheet .ProseMirror blockquote { border-inline-start: 3px solid var(--border); margin: 0 0 .6em; padding-inline-start: 14px; color: var(--muted); }
.doc-sheet .ProseMirror pre { background: var(--surface-2); padding: 10px 14px; border-radius: 8px; direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 14px; }
.doc-sheet .ProseMirror code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; font-size: .9em; }
.doc-sheet .ProseMirror mark { background: #fde68a; color: inherit; }
.doc-sheet .ProseMirror hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.doc-sheet .ProseMirror table { border-collapse: collapse; width: 100%; margin: .6em 0; table-layout: fixed; }
.doc-sheet .ProseMirror td, .doc-sheet .ProseMirror th { border: 1px solid var(--border); padding: 6px 10px; vertical-align: top; position: relative; }
.doc-sheet .ProseMirror th { background: var(--surface-2); font-weight: 600; }
.doc-sheet .ProseMirror td > p, .doc-sheet .ProseMirror th > p { margin: 0; }
.doc-sheet .ProseMirror .selectedCell::after { content: ""; position: absolute; inset: 0; background: var(--sel); opacity: .4; pointer-events: none; }
.doc-sheet .ProseMirror .column-resize-handle { position: absolute; inset-inline-end: -2px; top: 0; bottom: 0; width: 4px; background: var(--accent); pointer-events: none; }
.doc-sheet .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--muted); float: right; pointer-events: none; height: 0; }
.doc-sheet .ProseMirror .cmt { background: #fef9c3; border-bottom: 2px solid #facc15; cursor: pointer; }
.doc-sheet .ProseMirror .cmt.flash { background: #fde047; }
:root[data-theme="dark"] .doc-sheet .ProseMirror .cmt { background: #3d3510; }
.collaboration-cursor__caret { position: relative; margin: 0 -1px; border-left: 1px solid; border-right: 1px solid; word-break: normal; pointer-events: none; }
.collaboration-cursor__label { position: absolute; top: -1.4em; left: -1px; font-size: 11px; font-weight: 600; line-height: normal; color: #fff; padding: 1px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; user-select: none; }
.doc-side { width: 340px; border-inline-start: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) { .doc-side { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 20; width: min(360px, 92vw); box-shadow: var(--shadow-lg); } }
.side-head { display: flex; align-items: center; gap: 8px; } .side-head b { flex: 1; }
.thread { border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: grid; gap: 8px; cursor: pointer; }
.thread.focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); } .thread.resolved { opacity: .6; }
.cm { display: grid; gap: 4px; } .cm.reply { padding-inline-start: 18px; border-inline-start: 2px solid var(--border); }
.cm.new { border: 1px solid var(--accent); border-radius: 12px; padding: 10px; gap: 8px; }
.cm-head { display: flex; align-items: center; gap: 6px; font-size: 13px; } .cm-head small { flex: 1; }
.cm-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.cm-quote { font-size: 13px; color: var(--muted); border-inline-start: 3px solid #facc15; padding-inline-start: 8px; max-height: 3.2em; overflow: hidden; }
.mention { color: var(--accent); font-weight: 500; }
.thread-acts { display: flex; gap: 8px; align-items: center; } .thread-acts .input { flex: 1; }
@media print {
  .doc-top, .doc-toolbar, .doc-side, #toasts { display: none !important; }
  .doc-page { display: block; height: auto; } .doc-scroll { overflow: visible; padding: 0; }
  .doc-sheet { box-shadow: none; padding: 0; max-width: none; min-height: 0; }
  .doc-sheet .ProseMirror .cmt { background: none; border: 0; } .collaboration-cursor__caret { display: none; }
  body { background: #fff; }
}
