/* PDF Okuyucu — design tokens and base styles. No external fonts or stylesheets (§5, §12.8). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e1e4e8;
  --text: #1d2330;
  --muted: #667085;
  --accent: #2f5bea;
  --accent-soft: #e8eefe;
  --danger: #c4372c;
  --danger-soft: #fdecea;
  --ok: #18794e;
  --ok-soft: #e6f4ec;
  --warn-soft: #fff4d6;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mark-yellow: rgba(255, 213, 0, .45);
  --mark-green: rgba(46, 204, 113, .38);
  --mark-blue: rgba(52, 152, 219, .35);
  --mark-pink: rgba(255, 105, 180, .35);
  --mark-orange: rgba(255, 140, 0, .38);
  --seg-hover: rgba(47, 91, 234, .10);
  --seg-selected: rgba(47, 91, 234, .22);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --surface: #1a1e27;
    --surface-2: #222734;
    --border: #2e3442;
    --text: #e6e8ee;
    --muted: #98a2b3;
    --accent: #7d9bff;
    --accent-soft: #24304f;
    --danger: #ff6b5e;
    --danger-soft: #3a2220;
    --ok: #4cc38a;
    --ok-soft: #1c3329;
    --warn-soft: #3a3320;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
h3 { font-size: 13px; margin: 0; }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; }

/* Buttons */
.button, button.primary, .button.primary {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap;
}
.button:hover { background: var(--surface-2); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger:hover { filter: brightness(1.08); }
.icon-button { border: 0; background: transparent; cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1.2; color: var(--muted); }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.link-button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }

/* Chips */
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-error { background: var(--danger-soft); color: var(--danger); }

/* Shell */
.app-shell { display: flex; flex-direction: column; height: 100vh; }
.app-body { flex: 1; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.brand-mark { color: var(--accent); font-size: 18px; }
.topbar-search { flex: 1; max-width: 520px; }
.topbar-search input { width: 100%; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.user-menu { margin-left: auto; position: relative; }
.user-menu summary { list-style: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; cursor: pointer; font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: 40px; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50; display: flex; flex-direction: column; }
.user-menu .menu > a, .user-menu .menu button { padding: 6px 10px; text-align: left; border-radius: 6px; }
.user-menu .menu > a:hover, .user-menu .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu-head { padding: 6px 10px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* Library: three panes */
.library-layout { display: grid; grid-template-columns: 280px 1fr 300px; height: 100%; }
.pane { overflow: auto; min-height: 0; }
.pane-left, .pane-right { background: var(--surface); padding: 8px 6px 16px; }
.pane-left { border-right: 1px solid var(--border); }
.pane-right { border-left: 1px solid var(--border); }
.pane-center { padding: 20px 24px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; }
.pane-sub { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; padding: 14px 10px 4px; }
.empty-hint { color: var(--muted); padding: 4px 10px; font-size: 13px; }
.trash-link { display: block; width: calc(100% - 8px); margin: 16px 4px 0; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.trash-link:hover, .trash-link.selected { background: var(--surface-2); color: var(--text); }

/* Tree */
.tree { list-style: none; margin: 0; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 2px; border-radius: 6px; padding: 1px 4px; position: relative; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.selected { background: var(--accent-soft); }
.tree-row.drop-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.twisty { width: 18px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.twisty.empty { cursor: default; }
.tree-label { flex: 1; text-align: left; border: 0; background: none; cursor: pointer; padding: 4px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-icon { margin-right: 6px; }
.tree-row .row-actions { display: none; }
.tree-row:hover .row-actions { display: inline-flex; }
.rename { flex: 1; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 4px; background: var(--surface); color: var(--text); }

/* Folder contents */
.contents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.drop-zone { min-height: 60vh; border-radius: var(--radius); border: 2px dashed transparent; transition: border-color .15s, background .15s; }
.drop-zone.active { border-color: var(--accent); background: var(--accent-soft); }
.doc-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.doc-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.doc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover { background: var(--surface-2); }
.doc-table td.title { font-weight: 500; max-width: 380px; }
.doc-table .row-actions { opacity: 0; text-align: right; }
.doc-table tr:hover .row-actions { opacity: 1; }
.reason-row td { color: var(--danger); background: var(--danger-soft); font-size: 13px; }
.upload-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.upload-list li { display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-list li.failed { background: var(--danger-soft); }
.upload-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-list .status.error { color: var(--danger); }
.placeholder { max-width: 520px; margin: 12vh auto; text-align: center; color: var(--muted); }
.placeholder h2 { color: var(--text); margin-bottom: 8px; }
.placeholder.small { margin: 40px auto; }
.trash-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.trash-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Workspace page */
.workspace-page { max-width: 1000px; margin: 0 auto; padding: 20px 24px; }
.crumb { font-size: 12px; color: var(--muted); }
.toggle { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.card-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.card { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: var(--surface); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-main { display: grid; gap: 4px; }
.card-actions { display: flex; gap: 6px; align-items: center; }
.group-title { margin: 18px 0 8px; color: var(--muted); }
.mark-card { border-left: 4px solid var(--border); }
.mark-yellow { border-left-color: #f5c400; }
.mark-green { border-left-color: #27ae60; }
.mark-blue { border-left-color: #2e86de; }
.mark-pink { border-left-color: #e84393; }
.mark-orange { border-left-color: #e67e22; }
.note { margin: 0; white-space: pre-wrap; }

/* Sign-in */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); padding: 28px; border-radius: 12px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; }
.login-card form, .narrow form { display: grid; gap: 12px; margin-top: 18px; }
label { display: grid; gap: 4px; font-weight: 500; }
input[type=email], input[type=password], input[type=text], input:not([type]), input[inputmode] { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.error { color: var(--danger); margin: 0; }
.ok { color: var(--ok); }
.narrow { max-width: 420px; margin: 40px auto; padding: 0 16px; }

/* Toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--text); color: var(--surface); box-shadow: var(--shadow); max-width: 560px; }
.toast-error { background: var(--danger); color: #fff; }
.toast .icon-button { color: inherit; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: var(--warn-soft); color: var(--text); z-index: 200; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; }

@media (max-width: 900px) {
  .library-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .pane-left, .pane-right { border: 0; border-bottom: 1px solid var(--border); max-height: 35vh; }
}

/* Reader (§10) */
.reader { display: flex; flex-direction: column; height: 100%; }
.reader-bar { display: flex; align-items: center; gap: 12px; padding: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.reader-title { font-size: 15px; flex: 1; min-width: 80px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Wraps on narrow windows instead of pushing the whole page sideways. */
.reader-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.zoom { min-width: 44px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-banner { padding: 6px 16px; background: var(--warn-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.reader-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 6px 1fr; outline: none; }
.reader-pane { overflow: auto; background: var(--surface-2); }
.pane-splitter { cursor: col-resize; background: var(--border); }
.pane-splitter:hover { background: var(--accent); }
.pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.page-slot { position: relative; background: #fff; box-shadow: var(--shadow); flex: none; }
.page-slot canvas { position: absolute; inset: 0; }
.page-overlay { position: absolute; inset: 0; cursor: text; }
.hl { position: absolute; pointer-events: none; border-radius: 2px; mix-blend-mode: multiply; }
.hl-hover { background: var(--seg-hover); }
.hl-selected { background: var(--seg-selected); outline: 1px solid rgba(47, 91, 234, .5); }
.mark-fill-yellow { background: var(--mark-yellow); }
.mark-fill-green { background: var(--mark-green); }
.mark-fill-blue { background: var(--mark-blue); }
.mark-fill-pink { background: var(--mark-pink); }
.mark-fill-orange { background: var(--mark-orange); }
.mark-region { background: transparent !important; border: 2px solid rgba(47, 91, 234, .7); }
@media (prefers-color-scheme: dark) { .hl { mix-blend-mode: normal; } }

/* Dialogs and forms */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 25, .45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.25); width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 18px; overflow: auto; display: grid; gap: 12px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
select, input[type=number], textarea { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
textarea.paste { width: 100%; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; resize: vertical; }
pre.prompt { white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius); font-size: 12px; margin: 0; }
.part-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.part-list li { display: flex; gap: 8px; align-items: center; }
.part-list li span { flex: 1; }
.report { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.report .ok { color: var(--ok); }
.report .warn { color: #a15c00; }
.original { color: var(--muted); font-size: 13px; margin: 0; }
.reader-tools .divider { width: 1px; height: 22px; background: var(--border); }
.select-label select { max-width: 240px; }

/* Mark tools and panel (§10.3–10.4) */
.tool-strip { display: flex; align-items: center; gap: 6px; padding: 4px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tool { border: 1px solid transparent; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.tool:hover { background: var(--surface-2); }
.tool.active, .button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--text); }
.swatch-yellow { background: #f7d000; } .swatch-green { background: #2ecc71; } .swatch-blue { background: #3498db; }
.swatch-pink { background: #ff69b4; } .swatch-orange { background: #ff8c00; }
.small { font-size: 12px; }
.reader-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.reader-body.with-panel { grid-template-columns: 1fr 320px; }
.reader-body .reader-panes { min-height: 0; }
.reader-pane.tool-highlight .page-overlay { cursor: crosshair; }
.reader-pane.tool-region .page-overlay { cursor: cell; }
.drag-region { border-style: dashed !important; }
.marks-panel { border-left: 1px solid var(--border); background: var(--surface); overflow: auto; min-height: 0; }
.marks-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.mark-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 8px; }
.mark-item { border-left: 4px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 8px 10px; display: grid; gap: 6px; }
.mark-item.focused { outline: 2px solid var(--accent); }
.mark-item.mark-yellow { border-left-color: #f5c400; } .mark-item.mark-green { border-left-color: #27ae60; } .mark-item.mark-blue { border-left-color: #2e86de; }
.mark-item.mark-pink { border-left-color: #e84393; } .mark-item.mark-orange { border-left-color: #e67e22; }
.mark-excerpt { text-align: left; border: 0; background: none; cursor: pointer; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.mark-excerpt img { max-width: 100%; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.row-buttons { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-buttons select { max-width: 160px; font-size: 12px; }
.mark-item textarea { width: 100%; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid-form .span-2 { grid-column: span 2; }
.grid-form input, .grid-form textarea { width: 100%; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row code { flex: 1; background: var(--surface-2); padding: 6px 8px; border-radius: 6px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 700px) { .grid-form { grid-template-columns: 1fr; } .grid-form .span-2 { grid-column: auto; } }
.ref-list { padding-left: 22px; display: grid; gap: 6px; }
.ref-list.plain { list-style: none; padding-left: 0; }

/* Search (§18b.3) */
.search-page { max-width: 900px; margin: 0 auto; padding: 20px 24px; }
.search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.hit-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.hit { background: var(--surface); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.hit a { display: flex; gap: 8px; align-items: center; }
.hit-title { font-weight: 600; }
.hit-text { margin: 6px 0 0; color: var(--text); }
.similar-list { list-style: none; padding: 8px; margin: 0; display: grid; gap: 8px; }
.similar-list li { background: var(--surface-2); padding: 8px 10px; border-radius: 6px; font-size: 13px; }

/* Workspace desk (§16) */
.desk { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; outline: none; }
.desk-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.desk-toolbar .tool-group { display: flex; gap: 4px; align-items: center; padding-right: 10px; border-right: 1px solid var(--border); }
.desk-toolbar .tool-group:last-child { border-right: 0; }
.tool-button { min-width: 30px; height: 30px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: 15px; }
.tool-button:hover { background: var(--surface-2); }
.tool-button.active { border-color: var(--accent); background: var(--surface-2); }
.tool-button:disabled { opacity: .4; cursor: default; }
.zoom-label { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.desk-viewport { position: relative; flex: 1; overflow: hidden; background-color: var(--surface-2);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted) 35%, transparent) 1px, transparent 1px); background-size: 24px 24px;
  border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); touch-action: none; cursor: grab; user-select: none; }
.desk-viewport[data-tool="pen"], .desk-viewport[data-tool="marker"] { cursor: crosshair; }
.desk-viewport[data-tool="note"] { cursor: copy; }
.desk-viewport[data-tool="eraser"] { cursor: cell; }
.desk-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.desk-item { position: absolute; box-sizing: border-box; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; cursor: default; }
.desk-item.desk-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.desk-off { visibility: hidden; }
.desk-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--muted) 60%, transparent) 50%); }
.desk-note { padding: 10px 12px; color: #1f2937; }
.desk-note .note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.note-sari { background: #fff3a8; } .note-pembe { background: #ffd1e3; } .note-mavi { background: #cfe8ff; }
.note-yesil { background: #d3f5d6; } .note-mor { background: #e6d9ff; }
.note-swatch { border-color: var(--border); }
.desk-card { background: var(--surface); border-left: 5px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.desk-card.closed { opacity: .75; }
.card-quote { margin: 0; padding: 0; font-family: Georgia, "Times New Roman", serif; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.card-translation { margin: 0; font-style: italic; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.card-note { margin: 0; padding: 4px 6px; background: var(--surface-2); border-radius: 4px; }
.card-source { margin: auto 0 0; font-size: 12px; color: var(--muted); }
.card-snapshot { max-width: 100%; max-height: 120px; object-fit: contain; align-self: center; pointer-events: none; }
.desk-strokes { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 100000; }
.desk-stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: visibleStroke; }
.desk-stroke.marker { opacity: .35; }
.desk-stroke.desk-selected { filter: drop-shadow(0 0 2px var(--accent)); }
.desk-stroke.desk-erasing { opacity: .15; }
.desk-rect { position: absolute; display: none; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; }
.desk-minimap { position: absolute; right: 12px; bottom: 12px; width: 180px; height: 120px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.desk-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; color: var(--muted); }

/* Map correction tools (§9.5) */
.fix-strip { border-top: 1px dashed var(--border); }
.excluded-list { position: relative; font-size: 13px; }
.excluded-list summary { cursor: pointer; }
.excluded-list ul { position: absolute; z-index: 20; right: 0; margin: 4px 0 0; padding: 8px 12px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); white-space: nowrap; }
.link-button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 4px; }
.hl.excluded-region { background: repeating-linear-gradient(45deg, rgba(100,116,139,.18) 0 6px, transparent 6px 12px); outline: 1px dashed rgba(100,116,139,.6); }
.chip.warn { background: #fde68a; color: #78350f; }

/* Sharing (§14) */
.share-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.share-list li { display: flex; gap: 10px; align-items: center; }

/* Live collaboration (§14.3) */
.presence { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.presence-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; }
.hl.hl-peer { outline: 2px solid; outline-offset: 1px; background: transparent; pointer-events: none; }

.desk-people { position: absolute; z-index: 5; right: 16px; margin-top: 8px; }
.desk { position: relative; }
.desk-item.desk-locked, .desk-stroke.desk-locked { outline: 2px dashed; outline-offset: 3px; }

/* Admin page (§13) */
.admin-page { max-width: 1000px; margin: 0 auto; padding: 20px 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 20px; align-items: end; }
.admin-grid label { display: grid; gap: 4px; }
.admin-access { background: var(--surface); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 6px; margin: 8px 0; }
