:root {
  color-scheme: dark;
  --paper: #191919;
  --canvas: #191919;
  --sidebar: #202020;
  --surface: #252525;
  --surface-raised: #2b2b2b;
  --hover: #2c2c2c;
  --line: #353535;
  --line-strong: #444444;
  --ink: #e8e8e8;
  --muted: #a6a6a6;
  --faint: #777777;
  --accent: #c7b8e4;
  --accent-dark: #d9cdef;
  --accent-wash: #30283b;
  --danger: #f09595;
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--accent-dark); }
.eyebrow, .document-kicker, .sidebar-label { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: var(--muted); }
.primary, .secondary { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 15px; font-weight: 600; }
.primary { color: #1b1720; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: var(--accent-dark); background: transparent; }
.secondary:hover { background: var(--accent-wash); }
.small { padding: 7px 11px; font-size: 12px; }
.subtle-button, .icon-button { border: 0; background: transparent; }
.icon-button { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-size: 20px; line-height: 1; }
.icon-button:hover, .subtle-button:hover { background: var(--hover); }
.mobile-only { display: none; }
.app-shell { height: 100%; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 24px; padding: 0 17px; border-bottom: 1px solid var(--line); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 220px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark, .login-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #48404f; color: var(--ink); font: 700 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.global-nav { display: flex; align-items: stretch; height: 100%; gap: 1px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.global-nav button { padding: 2px 15px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.global-nav button:hover { color: var(--ink); }
.global-nav button.selected { color: var(--accent-dark); border-bottom-color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.top-actions button { font-size: 12px; color: var(--muted); padding: 7px 8px; border-radius: 6px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #87ac91; box-shadow: 0 0 0 3px #28362d; }
.workspace-row { display: flex; flex: 1; min-height: 0; min-width: 0; }
.sidebar { z-index: 5; display: flex; flex-direction: column; flex: 0 0 270px; min-width: 270px; height: 100%; border-right: 1px solid var(--line); background: var(--sidebar); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px 17px 12px; }
.workbook-list { display: flex; flex-direction: column; gap: 2px; max-height: 30vh; overflow: auto; padding: 0 8px 13px; border-bottom: 1px solid var(--line); }
.workbook-item, .new-workbook { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; font-size: 12.5px; }
.workbook-item span { color: var(--muted); }
.workbook-item:hover, .new-workbook:hover { background: var(--hover); }
.workbook-item.active { background: #35303b; font-weight: 650; }
.new-workbook { color: var(--muted); }
.current-workbook { padding: 16px 17px 0; }
.sidebar-tools { display: flex; gap: 4px; padding: 13px; }
.sidebar-tools button { border: 0; border-radius: 6px; padding: 6px 9px; font-size: 12px; font-weight: 600; background: transparent; color: var(--accent-dark); }
.sidebar-tools button:hover { background: var(--accent-wash); }
.search-wrap { display: flex; align-items: center; gap: 7px; margin: 0 13px; padding: 0 10px; height: 35px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.search-wrap span { font-size: 22px; line-height: 1; }
.search-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 7px 18px; }
.sidebar-label { padding: 5px 16px 9px; }
.tree-item { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 32px; padding: 5px 9px 5px calc(9px + var(--depth, 0) * 15px); border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--ink); font-size: 12.5px; }
.tree-item:hover { background: var(--hover); }
.tree-item.active { background: #35303b; color: var(--ink); font-weight: 650; }
.tree-icon { flex: 0 0 17px; color: var(--muted); text-align: center; font-size: 15px; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-name small { display: block; overflow: hidden; color: var(--muted); font-weight: 400; text-overflow: ellipsis; }
.sidebar-empty { margin: 8px 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sidebar-footer { display: flex; gap: 2px; align-items: center; justify-content: space-between; padding: 8px 9px 10px; border-top: 1px solid var(--line); }
.sidebar-footer button { padding: 6px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 11px; }
.sidebar-footer button:hover { background: var(--hover); }
.empty-main { display: grid; flex: 1; min-width: 0; place-items: center; overflow: auto; background: var(--paper); padding: 30px; }
.empty-card { width: min(500px, 100%); padding: 40px 22px; text-align: center; }
.empty-symbol { display: grid; place-items: center; margin: 0 auto 25px; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 27px; color: var(--accent); }
.empty-card h1 { margin: 12px 0 7px; font: 700 clamp(29px, 3vw, 39px)/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
.empty-card p { color: var(--muted); line-height: 1.75; }
.empty-actions { display: flex; justify-content: center; gap: 9px; margin-top: 26px; }
.document-main, .collection-main { display: flex; flex-direction: column; min-width: 0; flex: 1; background: var(--paper); }
.document-top { display: flex; align-items: center; justify-content: space-between; min-height: 47px; gap: 15px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--faint); white-space: nowrap; overflow: hidden; font-size: 11.5px; }
.breadcrumbs button { max-width: 160px; overflow: hidden; text-overflow: ellipsis; border: 0; background: transparent; color: var(--muted); font-size: inherit; }
.breadcrumbs button:hover { color: var(--accent); }
.breadcrumbs strong { overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink); }
.document-actions { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.document-actions button, .view-tools button, .calendar-head button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 9px; font-size: 11.5px; }
.document-actions button:hover, .view-tools button:hover, .calendar-head button:hover { background: var(--canvas); color: var(--ink); }
.document-actions button:last-child { font-size: 18px; line-height: 1; }
.save-status { margin-right: 8px; font-size: 11px; color: var(--faint); }
.document-scroll, .collection-scroll { flex: 1; min-height: 0; overflow: auto; }
.document-sheet { width: min(900px, 100%); margin: 0 auto; padding: 70px 72px 130px; }
.document-kicker { color: var(--faint); }
.page-title { width: 100%; height: auto; padding: 5px 0 14px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 clamp(34px, 4vw, 48px)/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
.page-title::placeholder { color: var(--faint); }
.record-properties { padding: 10px 0 25px; border-bottom: 1px solid var(--line); }
.record-properties .eyebrow { margin-bottom: 10px; }
.record-properties p { font-size: 12px; color: var(--muted); }
.property-row { display: grid; grid-template-columns: 160px 1fr; align-items: center; min-height: 33px; gap: 15px; }
.property-row label { font-size: 12px; color: var(--muted); }
.property-row input:not([type="checkbox"]), .property-row select { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); font-size: 12px; }
.property-row input:hover, .property-row select:hover { border-color: var(--line); }
.property-row .relation-button { justify-self: start; padding: 5px 7px; border: 0; background: transparent; color: var(--accent-dark); font-size: 12px; }
.blocks { display: flex; flex-direction: column; gap: 2px; margin-top: 15px; }
.block-shell { display: flex; position: relative; align-items: flex-start; min-height: 32px; margin-left: -40px; padding-left: 40px; }
.block-rail { display: flex; position: absolute; top: 2px; left: -8px; align-items: center; gap: 0; opacity: 0; z-index: 2; }
.block-shell:hover .block-rail, .block-shell:focus-within .block-rail { opacity: 1; }
.block-rail > button { border: 0; border-radius: 4px; background: transparent; color: var(--faint); width: 24px; height: 28px; padding: 0; font-size: 22px; line-height: 1; }
.block-rail > button:hover { background: var(--hover); color: var(--ink); }
.block-rail .drag-handle { cursor: grab; font-size: 22px; }
.block-rail .drag-handle:active { cursor: grabbing; }
.block-actions { position: absolute; top: 30px; left: 20px; display: flex; flex-direction: column; width: 135px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); box-shadow: var(--shadow); }
.block-actions button { width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left; font-size: 12px; }
.block-actions button:hover { background: var(--hover); }
.block-shell.dragging { opacity: .4; }
.block-shell.drop-before::before, .block-shell.drop-after::after { content: ""; position: absolute; left: 36px; right: 0; height: 2px; background: var(--accent); }
.block-shell.drop-before::before { top: -2px; }
.block-shell.drop-after::after { bottom: -2px; }
.slash-menu { position: absolute; z-index: 7; top: calc(100% + 4px); left: 40px; width: min(340px, calc(100vw - 50px)); max-height: min(390px, 65vh); overflow-y: auto; padding: 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); box-shadow: var(--shadow); }
.slash-heading { padding: 6px 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.slash-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 5px; background: transparent; text-align: left; }
.slash-option:hover, .slash-option.selected { background: var(--hover); }
.slash-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); font-size: 17px; }
.slash-option strong, .slash-option small { display: block; }
.slash-option strong { font-size: 12px; font-weight: 600; }
.slash-option small { color: var(--muted); font-size: 10px; }
.slash-empty { padding: 9px; color: var(--muted); font-size: 12px; }
.block-edit { display: flex; gap: 8px; align-items: start; width: 100%; }
.block-edit textarea { resize: none; width: 100%; min-height: 32px; padding: 2px 0; border: 0; outline: 0; overflow: hidden; background: transparent; color: var(--ink); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .002em; }
.block-edit textarea::placeholder { color: var(--faint); }
.block-edit.heading1 textarea { font: 700 30px/1.27 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.03em; }
.block-edit.heading2 textarea { font: 700 24px/1.33 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.025em; }
.block-edit.heading3 textarea { font: 650 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.block-edit.quote { padding-left: 17px; border-left: 2px solid var(--line-strong); }
.block-edit.quote textarea { color: var(--muted); font-style: italic; }
.block-marker { width: 23px; flex: 0 0 23px; padding-top: 3px; color: var(--muted); text-align: center; font-size: 16px; }
.check-input { margin: 9px 6px 0 2px; accent-color: var(--accent); }
.document-divider { width: 100%; margin: 18px 0; border: 0; border-top: 1px solid var(--line-strong); }
.media-block { max-width: 100%; margin: 12px 0; }
.media-block img { display: block; max-width: 100%; max-height: 480px; object-fit: contain; border-radius: 7px; }
.media-block figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.file-block, .page-link-block, .linked-collection-block { display: flex; align-items: center; gap: 11px; width: 100%; margin: 7px 0; padding: 12px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--accent-dark); text-align: left; text-decoration: none; }
.page-link-block { gap: 10px; margin: 2px 0; padding: 4px 0; border: 0; background: transparent; color: var(--ink); font-size: 17px; font-weight: 600; }
.page-link-block .child-icon { width: 24px; color: var(--muted); font-size: 23px; font-weight: 400; line-height: 1; }
.page-link-block:hover { background: transparent; text-decoration: underline; }
.unlinked-child { margin-left: 0; }
.file-block:hover, .page-link-block:hover, .linked-collection-block:hover { background: var(--accent-wash); }
.linked-collection-block small { margin-left: auto; color: var(--muted); }
.collection-heading { padding: 62px 42px 28px; }
.collection-heading h1 { margin: 5px 0; font: 700 clamp(34px, 3.5vw, 46px)/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
.collection-heading p { margin: 3px 0; font-size: 12px; color: var(--muted); }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 34px 0 42px; border-bottom: 1px solid var(--line); }
.view-tabs { display: flex; overflow-x: auto; min-width: 0; }
.view-tabs button { padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; font-size: 12px; }
.view-tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 650; }
.view-tools { display: flex; align-items: center; white-space: nowrap; }
.view-tools .primary { border: 1px solid var(--accent); color: #1b1720; background: var(--accent); padding: 7px 11px; }
.view-tools .primary:hover { background: var(--accent-dark); }
.table-scroll { overflow: auto; max-height: 58vh; }
.collection-table { border-collapse: collapse; width: 100%; table-layout: auto; }
.collection-table th, .collection-table td { min-width: 145px; max-width: 330px; padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.collection-table th:first-child, .collection-table td:first-child { min-width: 260px; padding-left: 42px; }
.collection-table th { position: sticky; top: 0; background: var(--paper); z-index: 1; color: var(--muted); font-weight: 600; }
.collection-table tr:hover td { background: var(--hover); }
.record-title { border: 0; background: transparent; padding: 0; text-align: left; color: var(--ink); font-weight: 600; }
.record-title:hover { color: var(--accent); }
.empty-value { color: var(--faint); }
.tag { display: inline-block; margin: 1px 2px 1px 0; padding: 2px 7px; border-radius: 4px; background: #342b42; color: #cdbbe9; font-size: 11px; }
.relation-count { color: var(--accent); }
.view-hint { padding: 38px 42px; color: var(--muted); font-size: 13px; }
.board-scroll { display: flex; gap: 12px; padding: 20px 42px; overflow-x: auto; min-height: 320px; }
.board-column { flex: 0 0 230px; padding: 9px; border-radius: 6px; background: var(--surface); }
.board-column header { display: flex; justify-content: space-between; padding: 5px 6px 13px; font-size: 12px; font-weight: 650; }
.board-column header small { color: var(--muted); }
.board-card { display: flex; flex-direction: column; gap: 5px; width: 100%; margin-bottom: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-raised); text-align: left; }
.board-card:hover { border-color: var(--accent); }
.board-card strong { font-size: 12px; }
.board-card small { color: var(--muted); font-size: 10px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; max-width: 1050px; margin: 22px auto 0; padding: 0 30px; }
.calendar-head strong { font-size: 22px; font-weight: 650; }
.calendar-head button { font-size: 24px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); max-width: 1050px; margin: 10px auto 35px; padding: 0 30px; overflow-x: auto; }
.weekday { padding: 8px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 11px; }
.calendar-day { min-height: 100px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day.muted { background: var(--surface); }
.day-number { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.calendar-day button { display: block; width: 100%; margin: 3px 0; padding: 3px 5px; border: 0; border-radius: 4px; background: var(--accent-wash); color: var(--accent-dark); text-align: left; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding: 25px 42px; }
.gallery-card { display: flex; flex-direction: column; min-height: 190px; gap: 13px; padding: 19px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: left; }
.gallery-card:hover { border-color: var(--accent); }
.gallery-card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: var(--accent-wash); color: var(--accent); font-size: 23px; }
.gallery-card strong { font-size: 19px; font-weight: 650; }
.gallery-card small { display: block; color: var(--muted); font-size: 10px; }
.collection-footer { padding: 14px 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.collection-notes { margin: 30px 42px 70px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.collection-notes p { margin: 8px 0; color: var(--muted); font-size: 12px; }
.collection-notes button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; }
.drawer { z-index: 6; display: flex; flex-direction: column; flex: 0 0 350px; width: 350px; border-left: 1px solid var(--line); background: var(--sidebar); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 23px; font-weight: 650; }
.drawer-list { flex: 1; overflow-y: auto; padding: 16px; }
.drawer-empty, .drawer-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.drawer-note { padding: 0 18px; }
.comment-card, .trash-item { margin-bottom: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.comment-card.resolved { opacity: .66; }
.comment-meta { color: var(--faint); font-size: 10px; }
.comment-card blockquote { margin: 10px 0; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--muted); font: italic 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.comment-card p { margin: 10px 0; white-space: pre-wrap; font-size: 12px; }
.comment-card button, .trash-item button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 11px; }
#comment-form { padding: 15px 18px 20px; border-top: 1px solid var(--line); }
#comment-form label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
#comment-form textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
#comment-form button { margin-top: 8px; }
.history-item { display: flex; flex-direction: column; gap: 3px; width: 100%; margin-bottom: 6px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: left; }
.history-item:hover { border-color: var(--accent); }
.history-item strong { font-size: 12px; }
.history-item span, .history-item small, .trash-item small { color: var(--muted); font-size: 10px; }
.trash-item { display: flex; flex-direction: column; gap: 5px; }
.history-preview button:not(.primary) { border: 0; background: transparent; color: var(--accent); padding: 0; }
.history-preview h3 { margin: 18px 0 3px; font-size: 22px; font-weight: 650; }
.history-preview pre, .conflict-preview pre { overflow: auto; max-height: 42vh; padding: 12px; border-radius: 6px; background: var(--surface); white-space: pre-wrap; font: 12px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.history-preview .primary { margin-top: 10px; }
.conflict-preview { overflow-y: auto; padding: 0 18px; }
.conflict-preview > div { margin: 12px 0; }
.conflict-preview strong { display: block; }
.stacked-actions { display: flex; flex-direction: column; gap: 8px; padding: 15px 18px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .65); }
.modal { width: min(440px, 100%); max-height: calc(100vh - 50px); overflow-y: auto; padding: 23px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.modal form > label { display: block; margin-bottom: 13px; font-size: 11px; font-weight: 650; color: var(--muted); }
.modal form > label input, .modal form > label select { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-raised); color: var(--ink); font-size: 13px; }
.modal-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.menu-stack button { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); text-align: left; font-size: 12px; }
.menu-stack button:hover { border-color: var(--accent); }
.menu-stack { display: flex; flex-direction: column; gap: 7px; }
.menu-stack button.danger { color: var(--danger); }
.relation-options { max-height: 270px; overflow-y: auto; }
.relation-options label { display: flex; gap: 8px; align-items: center; padding: 7px; font-size: 12px; }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-raised); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; }
.toast.error { border-color: #784040; background: #372425; color: var(--danger); }
.toast.success { background: #24342a; }
.loading-screen, .login-screen { display: grid; place-items: center; height: 100%; background: var(--canvas); color: var(--muted); }
.login-card { width: min(420px, calc(100vw - 35px)); padding: 43px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.login-mark { width: 45px; height: 45px; margin-bottom: 30px; border-radius: 12px; font-size: 27px; }
.login-card h1 { margin: 11px 0 7px; font: 700 36px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
.login-card p { color: var(--muted); }
.login-card form { margin-top: 28px; }
.login-card label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-raised); color: var(--ink); }
.login-card form button { width: 100%; margin-top: 12px; }
.setup-note { padding: 13px; border-radius: 6px; background: var(--surface-raised); font-size: 12px; }
@media (max-width: 1100px) {
  .brand { min-width: auto; }
  .topbar { gap: 14px; }
  .drawer { flex-basis: 310px; width: 310px; }
  .document-sheet { padding-inline: 45px; }
  .view-tools button:not(.primary) { display: none; }
}
@media (max-width: 800px) {
  .mobile-only { display: inline-grid; }
  .topbar { padding: 0 12px; height: 56px; flex-basis: 56px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 25px; height: 25px; font-size: 15px; }
  .top-actions { display: none; }
  .global-nav { margin-left: auto; }
  .global-nav button { padding-inline: 10px; font-size: 11px; }
  .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: min(300px, 82vw); height: calc(100dvh - 56px); transform: translateX(-105%); box-shadow: 8px 0 25px rgba(0,0,0,.08); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .document-top { padding: 0 12px; }
  .document-sheet { padding: 45px 24px 90px; }
  .block-shell { margin-left: 0; padding-left: 0; }
  .block-rail { position: static; flex: 0 0 auto; margin-right: 4px; opacity: .7; }
  .slash-menu { left: 0; }
  .collection-heading { padding: 38px 20px 19px; }
  .view-bar { padding: 0 12px; }
  .view-tools .primary { font-size: 11px; }
  .board-scroll { padding: 15px; }
  .collection-table th:first-child, .collection-table td:first-child { min-width: 190px; padding-left: 15px; }
  .gallery-grid { padding: 15px; }
  .drawer { position: fixed; z-index: 8; top: 56px; bottom: 0; right: 0; width: min(390px, 100vw); box-shadow: -8px 0 30px rgba(0,0,0,.09); }
  .calendar-grid { min-width: 740px; }
}
@media (max-width: 550px) {
  .brand > span:last-child, .hide-small { display: none; }
  .global-nav button { padding-inline: 8px; }
  .document-sheet { padding-inline: 18px; }
  .page-title { font-size: 38px; }
  .property-row { grid-template-columns: 105px 1fr; gap: 5px; }
  .collection-heading h1 { font-size: 37px; }
  .view-tabs button { padding-inline: 8px; }
  .view-tools { margin-left: 3px; }
  .view-tools .primary { padding: 6px; }
}
