/* Arcavo Dataroom — tokens and layout per SPEC §10 and the design canvas. Self-hosted fonts, no external resources. */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --brand-900: #0B3B3A; --brand-600: #157A5E; --brand-700: #0F5F49; --brand-100: #E3F3EC;
  --ink-900: #111827; --ink-600: #4B5563; --ink-300: #D1D5DB; --ink-200: #E5E7EB;
  --surface: #FFFFFF; --surface-2: #F3F4F6; --surface-3: #F9FAFB;
  --label: #EEF0FF; --label-ink: #3730A3;
  --amber-bg: #FEF3C7; --amber-ink: #92400E; --red-bg: #FEE2E2; --red-ink: #991B1B; --danger: #B91C1C;
  --r-sm: 8px; --r-md: 12px; --r-lg: 14px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--brand-900); color: var(--ink-900); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); }
a:hover { color: var(--brand-900); }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-600); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.spacer { flex: 1; }
.right { margin-left: auto; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.pad { padding: 14px 16px; }
.danger { color: var(--danger); }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--brand-900); color: var(--brand-100); border-radius: var(--r-sm); padding: 12px 14px; overflow: auto; }

/* frame */
.frame { min-height: 100vh; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 8px; color: #fff; flex-wrap: wrap; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.brand-logo { height: 30px; width: auto; max-width: 180px; border-radius: 6px; background: #fff; padding: 2px 6px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; }
.brand-lg { font-size: 18px; margin-bottom: 18px; justify-content: center; }
.brand-lg .brand-mark { width: 34px; height: 34px; }
.sep { opacity: .5; }
.roomname { color: #fff; opacity: .9; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.topsearch { position: relative; display: flex; align-items: center; color: #9CA3AF; }
.topsearch svg { position: absolute; left: 10px; }
.topsearch input { height: 36px; width: 320px; max-width: 50vw; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); color: #fff; padding: 0 12px 0 32px; font: 13px var(--font); }
.topsearch input::placeholder { color: #9CA3AF; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--brand-100); color: var(--brand-900); font: 600 13px var(--font); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.menu { position: relative; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: 44px; background: #fff; color: var(--ink-900); border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); min-width: 200px; padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent; color: var(--ink-900); text-decoration: none; border-radius: var(--r-sm); font: 13px var(--font); cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.workspace { flex: 1; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.flashes { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.flash { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; background: var(--brand-100); color: var(--brand-900); }
.flash-warn { background: var(--amber-bg); color: var(--amber-ink); }
.room { display: flex; flex: 1; min-height: 0; flex-wrap: wrap; }
.rail { width: 64px; padding: 14px 10px; border-right: 1px solid var(--ink-200); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: var(--ink-600); }
.rail a:hover { background: var(--surface-2); color: var(--ink-900); }
.rail a.active { background: var(--brand-100); color: var(--brand-600); }
.rail-spacer { flex: 1; }
.side { width: 240px; padding: 18px 12px; border-right: 1px solid var(--ink-200); display: flex; flex-direction: column; gap: 16px; }
.side-head { font-size: 12px; font-weight: 600; color: var(--ink-600); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 12px; }
.side-head-plain { background: transparent; padding: 0 12px; margin-bottom: -8px; }
.quick, .tree, .accnav { display: flex; flex-direction: column; gap: 2px; }
.quick a, .tree a, .accnav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--ink-900); text-decoration: none; font-size: 13px; }
.quick a svg { color: var(--ink-600); }
.quick a:hover, .tree a:hover, .accnav a:hover { background: var(--surface-2); color: var(--ink-900); }
.quick a.cur, .tree a.cur, .accnav a.cur { background: var(--brand-100); color: var(--brand-600); font-weight: 500; }
.tree a svg { color: var(--brand-600); }
.tree a.sub { padding-left: 34px; }
.accnav { width: 240px; padding: 22px 12px; border-right: 1px solid var(--ink-200); }
.storage { margin-top: auto; font-size: 12px; color: var(--ink-600); padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); }
.storage-row { display: flex; justify-content: space-between; }
.storage strong { color: var(--ink-900); }
.bar { height: 6px; background: var(--ink-300); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.bar-fill { height: 6px; background: var(--brand-600); border-radius: 999px; }
.main { flex: 999 1 560px; min-width: 0; padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.main.narrow { max-width: 820px; }
.page { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--ink-600); margin-bottom: 4px; }
.crumbs a { color: var(--ink-600); }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--ink-300); background: #fff; color: var(--ink-900); font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; list-style: none; }
.btn:hover { background: var(--surface-2); color: var(--ink-900); }
.btn.primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.primary:hover { background: var(--brand-700); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; justify-content: center; }
.btn.icon.ghost { border: 0; background: transparent; width: 32px; height: 32px; color: var(--ink-600); }
.btn.on { background: var(--brand-100); border-color: var(--brand-600); color: var(--brand-900); }
.btn[disabled], .btn:disabled { color: #9CA3AF; background: var(--surface-3); cursor: not-allowed; }
.btn.danger { color: var(--danger); }
.linkbtn { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-600); vertical-align: middle; }
.chip-dark { background: rgba(255,255,255,.12); color: #fff; }
.chip-btn { border: 0; cursor: pointer; font: 500 12px var(--font); }
.chip-grey { background: var(--surface-2); color: var(--ink-600); }
.chip-amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip-red { background: var(--red-bg); color: var(--red-ink); }
.chip-green { background: var(--brand-100); color: var(--brand-900); }
.chip-indigo { background: var(--label); color: var(--label-ink); }
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--label); color: var(--label-ink); font-size: 12px; font-weight: 600; align-items: center; justify-content: center; }
.callout { border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.callout.green { background: var(--brand-100); color: var(--brand-900); }
.callout.amber { background: var(--amber-bg); color: var(--amber-ink); }
.callout.red { background: var(--red-bg); color: var(--red-ink); }

.viewas-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--amber-bg); color: var(--amber-ink); font-size: 13px; font-weight: 500; }
/* toolbar, dropdowns */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-list { position: absolute; left: 0; top: 44px; background: #fff; border: 1px solid var(--ink-200); border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 240px; padding: 6px; z-index: 20; display: flex; flex-direction: column; gap: 2px; }
.dropdown.right .dropdown-list { left: auto; right: 0; top: 36px; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-900); text-decoration: none; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: var(--font); }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink-900); }
.dropdown-form { flex-wrap: wrap; cursor: default; }
.dropdown-form:hover { background: transparent; }
.dropdown-form input[type=text], .dropdown-form select { flex: 1; min-width: 120px; height: 32px; border: 1px solid var(--ink-300); border-radius: 6px; padding: 0 8px; font: 13px var(--font); }
.processing { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand-600); display: inline-block; }
.progress { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.progress .bar { margin-top: 2px; }
.dropzone.over { outline: 2px dashed var(--brand-600); outline-offset: -2px; background: var(--brand-100); }
tr.draggable { cursor: grab; }
tr.dragging { opacity: .45; }
tr.drop-into td { background: var(--brand-100) !important; box-shadow: inset 0 0 0 2px var(--brand-600); }
tr.drop-before td { box-shadow: inset 0 3px 0 var(--brand-600); }
tr.drop-after td { box-shadow: inset 0 -3px 0 var(--brand-600); }
.droptarget.drop-into { background: var(--brand-100) !important; outline: 2px solid var(--brand-600); outline-offset: -2px; color: var(--brand-900) !important; }

/* tables */
.tablewrap { border: 1px solid var(--ink-200); border-radius: var(--r-md); overflow-x: auto; }
table.docs { border-collapse: collapse; width: 100%; }
table.docs th { font-size: 12px; font-weight: 600; color: var(--ink-600); text-align: left; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--ink-300); white-space: nowrap; }
table.docs td { font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--ink-200); vertical-align: middle; }
table.docs tr:last-child td { border-bottom: 0; }
table.docs tbody tr:hover td { background: var(--surface-3); }
table.docs .empty { text-align: center; color: var(--ink-600); padding: 32px; }
.c-check { width: 36px; } .c-index { width: 72px; color: var(--ink-600); } .c-labels { width: 90px; } .c-size { width: 90px; } .c-date { width: 130px; } .c-act { width: 48px; text-align: right; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand-600); margin: 0; vertical-align: middle; }
a.name { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-900); text-decoration: none; flex-wrap: wrap; }
a.name:hover { color: var(--brand-600); }
a.name.folder svg { color: var(--brand-600); }
table.log td { vertical-align: top; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.panel { border: 1px solid var(--ink-200); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.group-row { flex-wrap: wrap; }
.group-row input[type=text] { flex: 1; }
.group-row details.restrict { width: 100%; }
.group-row details.restrict label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-600); }
.group-row details.restrict input[type=text] { height: 32px; border: 1px solid var(--ink-300); border-radius: 6px; padding: 0 8px; font: 13px var(--font); }
.group-row input[type=color] { width: 36px; height: 34px; border: 1px solid var(--ink-300); border-radius: 6px; padding: 2px; background: #fff; }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .grid4 label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-600); }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=search], .form select, .form textarea,
.filters-form select, .filters-form input, table.docs select, table.docs input[type=date], .row input[type=text], .row select, .grid4 input, .grid4 select {
  height: 38px; border: 1px solid var(--ink-300); border-radius: var(--r-sm); padding: 0 12px; font: 14px var(--font); color: var(--ink-900); background: #fff; }
.form textarea { height: auto; padding: 10px 12px; resize: vertical; font: 14px/1.5 var(--font); }
.form input:focus, .form select:focus, .form textarea:focus, .btn:focus-visible, a:focus-visible, select:focus { outline: 2px solid var(--brand-600); outline-offset: 1px; }
.form .check, .check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink-900); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row label { flex: 1; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--ink-200); border-radius: var(--r-sm); padding: 10px 12px; }
legend { font-size: 12px; color: var(--ink-600); padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.passkey-alt { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.passkey-alt .btn { justify-content: center; }
/* plain pages (login etc.) */
body.plain { display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
.card-page { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.card-page .brand { color: #fff; }
.card { background: #fff; border-radius: var(--r-lg); box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.card h1 { font-size: 20px; }
.lang-switch { text-align: center; }
.lang-switch .linkbtn { color: var(--brand-100); font-size: 13px; }
.qr { display: flex; justify-content: center; }
.nda-text { white-space: pre-wrap; max-height: 320px; overflow: auto; background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; }

/* rooms list */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.roomcard { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--ink-200); border-radius: var(--r-md); text-decoration: none; color: var(--ink-900); }
.roomcard:hover { border-color: var(--brand-600); background: var(--surface-3); color: var(--ink-900); }
.roomcard-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-100); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; }
.roomcard-name { font-weight: 600; font-size: 15px; }
.roomcard-meta { font-size: 12px; color: var(--ink-600); }

/* viewer */
.viewer { flex: 1; display: flex; min-width: 0; flex-wrap: wrap; }
.viewer-stage { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.viewer-bar, .viewer-tools { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--ink-200); flex-wrap: wrap; }
.viewer-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.viewer-tools .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.viewer-tools .btn.icon { width: 36px; }
.pagebox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-600); }
.pagebox input { width: 54px; height: 32px; border: 1px solid var(--ink-300); border-radius: 6px; text-align: center; font: 13px var(--font); }
.vsep { width: 1px; height: 24px; background: var(--ink-200); margin: 0 4px; }
.viewer-search input { height: 36px; border: 1px solid var(--ink-300); border-radius: var(--r-sm); padding: 0 12px; font: 13px var(--font); width: 220px; }
.viewer-canvas { flex: 1; overflow: auto; padding: 28px 24px; display: flex; justify-content: center; align-items: flex-start; }
.page-wrap { position: relative; width: min(100%, var(--pw, 760px)); background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); user-select: none; -webkit-user-select: none; }
.page-wrap img { display: block; width: 100%; height: auto; pointer-events: none; }
.wm-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.wm-overlay span { transform: rotate(-30deg); font-size: 20px; font-weight: 600; color: rgba(11,59,58,.16); white-space: nowrap; letter-spacing: .02em; line-height: 2.4; text-align: center; }
.wm-footer { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 12px; font-size: 10px; color: #6B7280; background: rgba(255,255,255,.92); border-top: 1px solid var(--surface-2); pointer-events: none; }
.viewer-empty { padding: 60px 20px; color: var(--ink-600); text-align: center; }
.viewer-side { width: 320px; border-left: 1px solid var(--ink-200); display: flex; flex-direction: column; background: #fff; }
.tabs { display: flex; border-bottom: 1px solid var(--ink-200); padding: 0 8px; }
.tabs button { height: 44px; padding: 0 12px; border: 0; background: transparent; font: 500 13px var(--font); color: var(--ink-600); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button[aria-selected=true] { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.tabpanel { padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; font-size: 13px; }
dl.meta { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; color: var(--ink-600); }
dl.meta dd { margin: 0; color: var(--ink-900); }
.qitem { display: block; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--ink-200); text-decoration: none; color: var(--ink-900); font-size: 13px; }
.qitem:hover { background: var(--surface-2); color: var(--ink-900); }
@media print { body.viewer-body .viewer-canvas, body.viewer-body .viewer-side { display: none !important; } body.viewer-body::after { content: "Afdrukken is niet toegestaan vanuit de viewer."; display: block; padding: 40px; } }

/* Q&A */
.qa { flex: 1; display: flex; min-width: 0; flex-wrap: wrap; }
.qa-list { width: 420px; border-right: 1px solid var(--ink-200); display: flex; flex-direction: column; }
.qa-list-head { padding: 20px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qa-list-head h1 { font-size: 20px; margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.filter { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink-300); background: #fff; font: 500 12px var(--font); color: var(--ink-600); text-decoration: none; }
.filter.on { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.qa-items { flex: 1; overflow: auto; }
.qrow { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--ink-200); text-decoration: none; color: var(--ink-900); }
.qrow:hover { background: var(--surface-3); color: var(--ink-900); }
.qrow.cur { background: var(--brand-100); }
.qrow-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-600); flex-wrap: wrap; }
.qrow-meta .chip { height: 20px; }
.qrow-title { font-weight: 500; font-size: 14px; }
.qa-detail { flex: 999 1 560px; min-width: 0; background: var(--surface-3); overflow: auto; }
.qa-detail-inner { padding: 20px 26px; display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.qa-detail h2 { font-size: 18px; margin: 4px 0 0; }
.bubble { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble.draft { border-style: dashed; }
.bubble p { white-space: pre-wrap; margin: 0; line-height: 1.55; }
.bubble-head { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.attach { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); text-decoration: none; color: var(--ink-900); font-size: 12px; width: fit-content; }

/* permissions */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 12px; color: var(--ink-600); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
table.matrix td { padding: 6px 10px; }
table.matrix .c-target { width: 320px; padding-left: calc(12px + var(--depth, 0) * 22px); }
table.matrix tr.root td { background: var(--surface-3); }
.gdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: middle; }
select.lvl { height: 30px; border: 1px solid var(--ink-300); border-radius: var(--r-sm); padding: 0 8px 0 18px; font: 500 12px var(--font); color: var(--ink-900); background: #fff; min-width: 170px; background-image: radial-gradient(circle at 8px 50%, var(--c, #9CA3AF) 4px, transparent 4.5px); }
select.lvl.inherit { color: var(--ink-600); border-style: dashed; }
.lvl-form { display: inline-flex; gap: 6px; align-items: center; }
.pagebars { display: flex; gap: 4px; align-items: flex-end; height: 120px; overflow-x: auto; padding-bottom: 18px; }
.pagebar { position: relative; width: 18px; height: 100px; background: var(--surface-2); border-radius: 3px; display: flex; align-items: flex-end; }
.pagebar-fill { width: 100%; background: var(--brand-600); border-radius: 3px; }
.pagebar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-600); }

table.heat .heatcell { text-align: center; font-weight: 600; background: rgb(21 122 94 / calc(var(--a, 0) * 0.85)); color: color-mix(in srgb, var(--ink-900), #fff calc(var(--a, 0) * 90%)); }
/* redaction */
.redact-box { position: absolute; background: #000; border: 1px solid #000; }
.redact-box.editable { outline: 2px dashed #F59E0B; cursor: pointer; }
.redact-draft { position: absolute; background: rgba(0,0,0,.45); border: 1px dashed #F59E0B; pointer-events: none; }
.page-wrap.redacting { cursor: crosshair; }
.page-wrap.redacting .wm-overlay, .page-wrap.redacting .wm-footer { display: none; }
/* tokens */
.tokenbox { flex: 1; min-width: 200px; background: #fff; border: 1px solid var(--ink-300); border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink-900); word-break: break-all; }
.token-new details { margin-top: 6px; }

/* responsive */
@media (max-width: 900px) {
  .frame { padding: 8px; }
  .rail { width: 100%; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--ink-200); padding: 8px; }
  .rail-spacer { display: none; }
  .side, .accnav { width: 100%; border-right: 0; border-bottom: 1px solid var(--ink-200); }
  .storage { margin-top: 0; }
  .main, .page { padding: 16px; }
  .topsearch input { width: 100%; max-width: none; }
  .viewer-side { width: 100%; border-left: 0; border-top: 1px solid var(--ink-200); }
  .qa-list { width: 100%; border-right: 0; }
  .c-size, .c-date { display: none; }
}
