/* Workspace UI, loaded AFTER style.css. No assets, global resets, or auth styles.
 * Host contract: #app > .app-shell contains .sidebar, .main, .topbar, #content.
 * Home reuses .home-heading, .quick-grid/.quick-card, .recent-list/.recent-row.
 * Appearance: .document-page[data-font="serif"|"mono"], .is-small-text,
 * .is-full-width; the same hooks are supported on .database-page.
 * Portals are siblings of #app, explicitly gated on the authenticated shell.
 * JS retains ownership of inert, hidden, dragging, selection and popup placement.
 */
#app > .app-shell {
  --paper: #fff;
  --sidebar: #f7f7f5;
  --ink: #37352f;
  --text: #37352f;
  --muted: #787774;
  --line: #e9e9e7;
  --border: #e9e9e7;
  --hover: #efefed;
  --soft: #f1f1ef;
  --accent: #337ea9;
  --bg: #f7f7f5;
  --surface: #fff;
  --workspace-sidebar: 248px;
  --workspace-topbar: 48px;
  --document-font: LocalSystem, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --document-size: 16px;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  font-size: 14px;
  line-height: 1.5;
}
#app > .app-shell button { border-radius: 4px; }
#app > .app-shell :is(button, a, input, select, textarea, summary, [contenteditable="true"]):focus-visible {
  outline: 2px solid #337ea9;
  outline-offset: 2px;
}
#app > .app-shell :is(input, select, textarea):not(.page-title) { border-color: #dededb; }
#app > .app-shell :is(input, select, textarea):focus { outline-color: #337ea9; }
#app > .app-shell .primary { background: #2383e2; border-color: #2383e2; color: #fff; }
#app > .app-shell .primary:hover { background: #1673cc; border-color: #1673cc; }
#app > .app-shell .secondary { border-color: #dededb; }
#app > .app-shell .eyebrow { color: var(--muted); letter-spacing: .04em; font-size: 11px; }

/* Navigation is compact, but every row remains a real button. */
#app > .app-shell .sidebar {
  width: var(--workspace-sidebar);
  padding: 8px 8px 10px;
  border-right: 1px solid #eeeeec;
  background: var(--sidebar);
  max-height: 100dvh;
}
#app > .app-shell .brand { min-height: 40px; padding: 4px 8px 10px; gap: 8px; font-size: 14px; letter-spacing: -.1px; }
#app > .app-shell .brandmark { width: 22px; height: 22px; font-size: 17px; border-radius: 4px; background: #e5e5e2; color: #55534e; }
#app > .app-shell .brand small { font-size: 8px; letter-spacing: .4px; color: var(--muted); }
#app > .app-shell .nav-button { min-height: 30px; padding: 5px 9px; margin: 0; gap: 9px; color: #686762; font-size: 13px; line-height: 20px; }
#app > .app-shell .nav-button.active { color: var(--ink); background: #eaeae7; font-weight: 600; }
#app > .app-shell .nav-button .key { font-size: 11px; color: var(--muted); }
#app > .app-shell .sidebar svg { width: 17px; height: 17px; }
#app > .app-shell .side-scroll { margin-top: 16px; min-height: 70px; overscroll-behavior: contain; scrollbar-width: thin; }
#app > .app-shell .section-label { font-size: 11px; color: var(--muted); padding: 9px 9px 5px; }
#app > .app-shell .tree-row { min-height: 30px; border-radius: 4px; }
#app > .app-shell .tree-row.active { background: #eaeae7; }
#app > .app-shell .tree-open { min-width: 0; min-height: 30px; gap: 7px; padding: 4px 6px; color: #565550; }
#app > .app-shell .tree-row.active .tree-open { color: var(--ink); font-weight: 550; }
#app > .app-shell .tree-icon { color: #92918d; }
#app > .app-shell .tree-toggle { width: 17px; min-height: 28px; color: #92918d; }
#app > .app-shell .tree-add, #app > .app-shell .tree-more { flex-shrink: 0; width: 24px; min-height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: #92918d; opacity: 0; }
#app > .app-shell .tree-more svg, #app > .app-shell .tree-add svg { width: 15px; height: 15px; }
#app > .app-shell .tree-row:hover .tree-add, #app > .app-shell .tree-row:hover .tree-more, #app > .app-shell .tree-row:focus-within .tree-add, #app > .app-shell .tree-row:focus-within .tree-more, #app > .app-shell .tree-more[aria-expanded="true"] { opacity: 1; }
#app > .app-shell .tree-more:hover, #app > .app-shell .tree-add:hover, #app > .app-shell .tree-more[aria-expanded="true"] { background: #e2e2de; color: var(--ink); }
#app:has(> .app-shell) ~ #tree-menu { position: fixed; z-index: 140; min-width: 232px; max-width: 280px; padding: 5px; display: grid; gap: 1px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #0002; font-size: 13px; }
#app:has(> .app-shell) ~ #tree-menu[hidden] { display: none !important; }
#app:has(> .app-shell) ~ #tree-menu [role="menuitem"] { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 5px 8px; border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
#app:has(> .app-shell) ~ #tree-menu [role="menuitem"] span { flex: 1; }
#app:has(> .app-shell) ~ #tree-menu [role="menuitem"]:hover, #app:has(> .app-shell) ~ #tree-menu [role="menuitem"]:focus-visible { background: #efefec; outline: none; }
#app:has(> .app-shell) ~ #tree-menu [role="menuitem"].danger { color: #b3261e; }
#app:has(> .app-shell) ~ #tree-menu kbd { font: inherit; font-size: 11px; color: var(--muted); }
#app:has(> .app-shell) ~ #tree-menu hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
#app:has(> .app-shell) ~ #tree-menu .tree-menu-meta { margin: 4px 8px 3px; font-size: 11px; color: var(--muted); }
#app:has(> .app-shell) ~ #toast .toast-action { margin-left: 14px; padding: 0; border: 0; background: none; color: #e9d9a6; font: inherit; font-weight: 600; cursor: pointer; }
#app:has(> .app-shell) ~ #toast .toast-action:focus-visible { outline: 2px solid #e9d9a6; outline-offset: 3px; border-radius: 2px; }
#app > .app-shell .sidebar-footer { margin-top: 8px; padding-top: 7px; }
#app > .app-shell .profile { width: 100%; gap: 8px; padding: 9px 8px 3px; }
#app > .app-shell .avatar { width: 25px; height: 25px; background: #e7e7e3; border-color: #ddddd8; color: #67665f; border-radius: 5px; }
#app > .app-shell .profile .muted { font-size: 10px; }

/* Quiet chrome and a document-sized reading measure. */
#app > .app-shell .main { margin-left: var(--workspace-sidebar); width: calc(100% - var(--workspace-sidebar)); }
#app > .app-shell .topbar { height: var(--workspace-topbar); min-width: 0; padding: 0 16px; gap: 10px; background: #fff; border-bottom: 1px solid #f4f4f2; backdrop-filter: none; }
#app > .app-shell .breadcrumb { flex: 1; min-width: 0; gap: 7px; font-size: 13px; color: var(--muted); }
#app > .app-shell .breadcrumb > svg { width: 16px; height: 16px; }
#app > .app-shell .breadcrumb > button { min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app > .app-shell .breadcrumb .current { color: var(--ink); max-width: 280px; }
#app > .app-shell .topbar-actions { flex-shrink: 0; gap: 2px; }
#app > .app-shell .topbar-actions > button { min-height: 28px; padding: 4px 7px; font-size: 12px; }
#app > .app-shell .save-state { color: var(--muted); margin-right: 6px; }
#app > .app-shell .save-state.error { color: #b3423a; }
#app > .app-shell .content { max-width: 960px; padding: 48px 56px 96px; margin-inline: auto; }
#app > .app-shell .content.document-page { max-width: 832px; padding: 64px 56px 100px; --document-size: 16px; }
#app > .app-shell .content.database-page { max-width: 1480px; padding: 48px 40px 80px; }
#app > .app-shell :is(.document-page, .database-page)[data-font="serif"] { --document-font: Georgia, 'Times New Roman', 'Noto Serif KR', serif; }
#app > .app-shell :is(.document-page, .database-page)[data-font="mono"] { --document-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#app > .app-shell :is(.document-page, .database-page).is-small-text { --document-size: 14px; }
#app > .app-shell .content:is(.document-page, .database-page).is-full-width { max-width: none; padding-inline: 56px; }
#app > .app-shell .page-title { font-family: var(--document-font); font-size: 40px; line-height: 1.2; letter-spacing: -1.1px; font-weight: 750; margin-bottom: 12px; color: var(--ink); }
#app > .app-shell .page-title:focus-visible { outline-offset: 5px; border-radius: 2px; }
#app > .app-shell .page-mark { background: transparent; border: 0; border-radius: 4px; width: 40px; height: 40px; color: #91908a; margin-bottom: 16px; justify-content: start; }
#app > .app-shell .page-mark svg { width: 32px; height: 32px; }
#app > .app-shell .page-meta { color: var(--muted); opacity: 1; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; margin-bottom: 12px; }
#app > .app-shell .page-presence { gap: 6px 10px; color: var(--muted); margin: 6px 0 18px; }
#app > .app-shell .presence-member { background: #f1f1ef; border-radius: 4px; padding: 2px 6px; color: #686762; }
#app > .app-shell .presence-note { color: var(--muted); }
#app > .app-shell .editor-tools { top: var(--workspace-topbar); background: #fffffff5; backdrop-filter: none; min-height: 28px; }
#app > .app-shell .editor-tools button { min-height: 26px; }
#app > .app-shell .blocks { margin-top: 4px; padding-top: 4px; }
#app > .app-shell .block-editor { font-family: var(--document-font); font-size: var(--document-size); line-height: 1.65; caret-color: var(--ink); border-radius: 3px; }
#app > .app-shell .block-editor:focus { background: transparent; }
#app > .app-shell .block-editor[contenteditable="true"]:focus-visible { outline: 1px solid #b8cee0; outline-offset: 2px; }
#app > .app-shell .block-editor:empty::before { color: #9b9a97; }
#app > .app-shell .block-editor a { color: inherit; text-decoration-color: #aaa9a5; }
#app > .app-shell .block[data-type="h1"] .block-editor { font-size: 1.875em; line-height: 1.3; }
#app > .app-shell .block[data-type="h2"] .block-editor { font-size: 1.5em; line-height: 1.35; }
#app > .app-shell .block[data-type="h3"] .block-editor { font-size: 1.25em; line-height: 1.4; }
#app > .app-shell .block[data-type="h4"] .block-editor { font-size: 1.125em; }
#app > .app-shell .blocks { font-size: var(--document-size); }
#app > .app-shell .block[data-type="quote"] { border-left: 3px solid #37352f; padding-left: 14px; }
#app > .app-shell .block[data-type="quote"] .block-editor { color: inherit; }
#app > .app-shell .block[data-type="callout"] { background: #f1f1ef; padding: 13px 16px; border-radius: 4px; }
#app > .app-shell .block[data-type="callout"] .block-prefix { color: var(--muted); }
#app > .app-shell .block[data-type="code"] { background: #f7f6f3; border-color: #eeede9; padding: 12px 16px; border-radius: 4px; }
#app > .app-shell .code-block-content { padding: 0; background: transparent; }
#app > .app-shell .block[data-type="code"] .block-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; }
#app > .app-shell .block.drop-target { box-shadow: 0 -2px 0 #78b6e7; }
#app > .app-shell .document-outline { top: 128px; right: 16px; width: 136px; }
#app > .app-shell .document-page.is-full-width .document-outline { position: static; width: 100%; max-height: 160px; margin: 12px 0; }
#app > .app-shell .document-table .block-editor { font-size: var(--document-size); }
#app > .app-shell .document-table th { background: #f7f7f5; }
#app > .app-shell .table-controls { opacity: .7; }
#app > .app-shell .file-section { border-color: var(--line); }
#app > .app-shell .property label { color: var(--muted); }

/* Home is a useful index rather than a landing page. */
#app > .app-shell .home-heading { margin-bottom: 28px; align-items: center; gap: 16px; }
#app > .app-shell .home-heading h1 { font-size: 30px; letter-spacing: -.7px; margin: 4px 0 8px; }
#app > .app-shell .home-heading p { color: var(--muted); }
#app > .app-shell .section-heading { margin: 26px 0 10px; }
#app > .app-shell .section-heading h2 { font-size: 13px; color: #686762; font-weight: 600; }
#app > .app-shell .section-heading button { font-size: 12px; }
#app > .app-shell .quick-grid { gap: 10px; }
#app > .app-shell .quick-card { border: 1px solid var(--line); border-radius: 5px; padding: 14px; box-shadow: 0 1px 2px #00000003; }
#app > .app-shell .quick-card:hover { background: #f9f9f8; border-color: #d6d6d2; }
#app > .app-shell .quick-card .card-symbol { background: #f1f1ef; color: #787774; width: 27px; height: 27px; border-radius: 4px; margin-bottom: 12px; }
#app > .app-shell .quick-card strong { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#app > .app-shell .quick-card p { font-size: 12px; color: var(--muted); }
#app > .app-shell .quick-card .arrow { color: #91918e; top: 15px; right: 12px; }
#app > .app-shell .recent-list { border-top: 0; }
#app > .app-shell .recent-row { min-height: 40px; padding: 8px; gap: 10px; border-bottom: 1px solid #f0f0ee; border-radius: 4px; }
#app > .app-shell .recent-row .row-title { min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app > .app-shell .recent-row :is(.row-date, .row-kind) { color: var(--muted); flex-shrink: 0; }
#app > .app-shell .recent-row svg { color: #91908c; }
#app > .app-shell .home-bottom { color: var(--muted); margin-top: 24px; }
#app > .app-shell .empty-state { border-radius: 5px; border-color: #dededb; color: var(--muted); padding: 32px 20px; }

/* Databases keep real overflow and editable cell geometry. */
#app > .app-shell .db-toolbar { margin: 22px 0 0; padding-bottom: 7px; gap: 8px; }
#app > .app-shell .view-tabs { gap: 1px; min-width: 0; }
#app > .app-shell .view-tab { min-height: 30px; padding: 5px 8px; color: var(--muted); }
#app > .app-shell .view-tab.active { color: var(--ink); background: transparent; box-shadow: 0 2px 0 var(--ink); border-radius: 0; }
#app > .app-shell .view-tab svg { width: 15px; height: 15px; }
#app > .app-shell .db-tools { gap: 4px; flex-wrap: wrap; }
#app > .app-shell .db-tools :is(input, select) { font-size: 12px; padding: 4px 6px; min-height: 28px; border-radius: 4px; border-color: var(--line); }
#app > .app-shell .db-tools button { min-height: 28px; }
#app > .app-shell .table-wrap { border-top: 0; overscroll-behavior-x: contain; }
#app > .app-shell .database-page table { font-family: var(--document-font); font-size: 13px; }
#app > .app-shell .database-page th { background: #fff; color: var(--muted); padding: 7px 9px; font-size: 12px; height: 33px; }
#app > .app-shell .database-page td { padding: 3px 7px; height: 34px; }
#app > .app-shell .database-page td :is(input, select, button) { font-family: inherit; font-size: 13px; padding: 4px; }
#app > .app-shell .database-page td select { color: inherit; }
#app > .app-shell .database-page tr:hover td { background: #fafaf9; }
#app > .app-shell .db-count { font-size: 11px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
#app > .app-shell .board { gap: 12px; padding-top: 16px; }
#app > .app-shell .board-column { border-radius: 5px; background: #f7f7f5; padding: 10px 8px; }
#app > .app-shell .board-column.drag-over { outline-color: #78b6e7; }
#app > .app-shell .task-card { border-radius: 5px; border-color: #e7e7e3; padding: 10px; margin-bottom: 7px; }
#app > .app-shell .task-card:hover { border-color: #c9c9c4; background: #fdfdfc; }
#app > .app-shell .task-card strong { font-size: 13px; line-height: 1.5; }
#app > .app-shell .task-footer { color: var(--muted); }
#app > .app-shell .gallery { padding-top: 16px; gap: 12px; }
#app > .app-shell .gallery .task-card { padding: 0; }
#app > .app-shell .gallery .card-body { padding: 12px; }
#app > .app-shell .gallery .card-cover { height: 72px; background: #f3f3f0; color: #92918b; }
#app > .app-shell .calendar-controls { margin-top: 16px; }
#app > .app-shell .calendar-cell.today > .day { background: #e36a59; }
#app > .app-shell .calendar-cell button { background: #f0f0ed; }
#app > .app-shell .pane { top: var(--workspace-topbar); width: min(360px, 100%); padding: 18px; box-shadow: -4px 0 16px #00000006; }
#app > .app-shell .pane-title { margin-bottom: 16px; }
#app > .app-shell .history-item { border-radius: 4px; padding: 10px; }

/* Portals stay untouched when #app is an auth/boot/error screen. */
#app:has(> .app-shell) ~ #overlay,
#app:has(> .app-shell) ~ .authoring-popover,
#app:has(> .app-shell) ~ .selection-toolbar {
  --paper: #fff; --surface: #fff; --ink: #37352f; --text: #37352f;
  --muted: #787774; --line: #e9e9e7; --hover: #efefed; --bg: #f7f7f5;
  color: #37352f;
}
#app:has(> .app-shell) ~ #overlay .modal-shade { background: #19191938; backdrop-filter: none; }
#app:has(> .app-shell) ~ #overlay .modal { border-color: #dededb; border-radius: 6px; box-shadow: 0 12px 40px #00000024; }
#app:has(> .app-shell) ~ #overlay .modal-head h2 { font-size: 16px; }
#app:has(> .app-shell) ~ #overlay .menu-list { gap: 1px; }
#app:has(> .app-shell) ~ #overlay .menu-list button { min-height: 30px; padding: 5px 8px; font-size: 13px; border-radius: 4px; }
#app:has(> .app-shell) ~ #overlay .menu-list hr { margin: 5px 0; }
#app:has(> .app-shell) ~ #overlay .primary { background: #2383e2; border-color: #2383e2; color: #fff; }
#app:has(> .app-shell) ~ #overlay .primary:hover { background: #1673cc; }
#app:has(> .app-shell) ~ #overlay :is(button, input, select, textarea, summary):focus-visible,
#app:has(> .app-shell) ~ .authoring-popover :is(button, input):focus-visible,
#app:has(> .app-shell) ~ .selection-toolbar :is(button, input):focus-visible { outline: 2px solid #337ea9; outline-offset: 2px; }
#app:has(> .app-shell) ~ :is(.authoring-popover, .selection-toolbar) { border-radius: 5px; border-color: #dededb; box-shadow: 0 4px 18px #00000020; }
#app:has(> .app-shell) ~ .authoring-popover { padding: 6px; }
#app:has(> .app-shell) ~ .authoring-popover .authoring-types button { min-height: 30px; padding: 5px 8px; }
#app > .app-shell .editor-slash { background: #fff; border-color: #dededb; border-radius: 5px; box-shadow: 0 4px 18px #00000020; padding: 5px; }
#app > .app-shell .editor-slash button { padding: 6px 9px; border-radius: 4px; }
#app > .app-shell .editor-slash .selected { background: #efefed; color: var(--ink); }

/* Match JS's 760px inert boundary exactly. No desktop display override. */
@media (max-width: 1450px) {
  #app > .app-shell .document-outline { position: static; width: 100%; max-height: 160px; margin: 0 0 18px; border-left: 2px solid var(--line); padding-left: 8px; }
  #app > .app-shell .document-outline button { display: inline-block; width: auto; max-width: 180px; }
}
@media (max-width: 1100px) {
  #app > .app-shell .content { padding-inline: 36px; }
  #app > .app-shell .content.document-page { padding-inline: 56px; }
  #app > .app-shell .content.database-page { padding-inline: 28px; }
  #app > .app-shell .db-tools { width: 100%; }
}
@media (max-width: 760px) {
  #app > .app-shell .sidebar { width: min(248px, calc(100vw - 48px)); transform: translateX(-100%); visibility: hidden; box-shadow: 6px 0 24px #00000016; }
  #app > .app-shell .sidebar.open { transform: none; visibility: visible; }
  #app > .app-shell .main { margin-left: 0; width: 100%; }
  #app > .app-shell .topbar { padding-inline: 8px; gap: 4px; }
  #app > .app-shell .mobile-nav { display: inline-flex; min-width: 30px; min-height: 32px; padding: 5px; }
  #app > .app-shell .breadcrumb { gap: 5px; font-size: 12px; }
  #app > .app-shell .breadcrumb > span:not(.current),
  #app > .app-shell .breadcrumb > button { display: none; }
  #app > .app-shell .breadcrumb .current { max-width: none; }
  #app > .app-shell .topbar-actions > button { min-width: 30px; min-height: 32px; padding: 5px; }
  #app > .app-shell .content { padding: 28px 20px 72px; }
  #app > .app-shell .content.document-page,
  #app > .app-shell .content.document-page.is-full-width { padding: 36px 20px 80px 48px; }
  #app > .app-shell .content.database-page,
  #app > .app-shell .content.database-page.is-full-width { padding: 28px 16px 72px; }
  #app > .app-shell .page-title { font-size: 32px; letter-spacing: -.7px; }
  #app > .app-shell .page-meta { font-size: 10px; gap: 5px 8px; }
  #app > .app-shell .page-presence { gap: 5px; }
  #app > .app-shell .editor-tools { top: var(--workspace-topbar); gap: 3px; }
  #app > .app-shell .editor-tools .hint { max-width: none; }
  #app > .app-shell .home-heading h1 { font-size: 27px; }
  #app > .app-shell .quick-grid { grid-template-columns: 1fr; gap: 8px; }
  #app > .app-shell .quick-card { min-height: 72px; padding: 12px 34px 12px 55px; }
  #app > .app-shell .quick-card .card-symbol { position: absolute; left: 14px; top: 17px; margin: 0; }
  #app > .app-shell .recent-row { gap: 8px; }
  #app > .app-shell .recent-row .row-date { font-size: 10px; }
  #app > .app-shell .db-tools { gap: 5px; }
  #app > .app-shell .db-tools :is(input, select) { max-width: 124px; }
  #app > .app-shell .view-tabs { flex-wrap: wrap; }
  #app > .app-shell .property { grid-template-columns: 90px minmax(0, 1fr); }
  #app > .app-shell .pane { width: 100%; }
  #app > .app-shell .document-columns { grid-template-columns: 1fr; gap: 12px; }
  #app > .app-shell .block.indent-4,
  #app > .app-shell .block.indent-5,
  #app > .app-shell .block.indent-6 { margin-left: 48px; }
}
@media (hover: none) {
  #app > .app-shell .tree-add, #app > .app-shell .tree-more { opacity: 1; }
  #app > .app-shell :is(.block-handle, .block-insert) { opacity: .7; }
  #app > .app-shell .table-controls { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #app > .app-shell *,
  #app:has(> .app-shell) ~ #overlay *,
  #app:has(> .app-shell) ~ .authoring-popover,
  #app:has(> .app-shell) ~ .selection-toolbar { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Parent-owned shell actions. These are opt-in, never inferred from viewport. */
#app > .app-shell .sidebar-toggle { display: inline-flex; min-width: 28px; min-height: 28px; padding: 5px; color: var(--muted); }
#app > .app-shell .home-quick-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
#app > .app-shell .home-quick-actions button { min-height: 30px; font-size: 12px; }
#app > .app-shell .home-section { margin-top: 28px; }
#app > .app-shell .workspace-home { max-width: 960px; }
#app > .app-shell .page-icon-button { cursor: pointer; }
#app > .app-shell .page-icon-button:hover { background: var(--hover); }
#app > .app-shell .page-cover { position: relative; width: 100%; min-height: 150px; max-height: 260px; border-radius: 4px; margin-bottom: 24px; overflow: hidden; background: #f1f1ef; }
#app > .app-shell .page-cover img { display: block; width: 100%; height: 220px; object-fit: cover; }
#app > .app-shell .cover-remove { position: absolute; right: 12px; bottom: 12px; border: 1px solid #dededb; background: #fffffff2; font-size: 12px; }
#app:has(> .app-shell) ~ #overlay .modal-shade:has(> .modal:is([data-kind="page-menu"], [data-kind="appearance"])) { padding: 54px 12px 12px; justify-content: flex-end; background: #00000008; }
#app:has(> .app-shell) ~ #overlay .modal:is([data-kind="page-menu"], [data-kind="appearance"]) { width: 300px; padding: 10px; max-height: calc(100dvh - 66px); overflow-y: auto; }
#app:has(> .app-shell) ~ #overlay .modal:is([data-kind="page-menu"], [data-kind="appearance"]) .modal-head { margin-bottom: 8px; padding: 2px 4px; }
#app:has(> .app-shell) ~ #overlay #page-action-query { margin: 0 0 8px; padding: 6px 8px; font-size: 13px; border-radius: 4px; }
@media (min-width: 761px) {
  #app > .app-shell.sidebar-collapsed { --workspace-sidebar: 0px; }
  #app > .app-shell.sidebar-collapsed .sidebar { width: 248px; transform: translateX(-100%); visibility: hidden; }
}
/* Integrated controls: retain semantic hidden state under authored flex rules. */
#app:has(> .app-shell) ~ #overlay .page-actions > [hidden]{display:none!important}
#app:has(> .app-shell) ~ #overlay .appearance-options fieldset{border:0;padding:0;margin:0 0 16px}
#app:has(> .app-shell) ~ #overlay .appearance-fonts{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}
#app:has(> .app-shell) ~ #overlay .appearance-fonts button{display:flex;flex-direction:column;gap:6px;align-items:center;padding:12px 6px;border-radius:5px}
#app:has(> .app-shell) ~ #overlay .appearance-fonts button[aria-pressed=true]{background:#f0f0ef;box-shadow:inset 0 0 0 1px #c8c8c5}
#app:has(> .app-shell) ~ #overlay .font-sample{font-size:24px;line-height:30px}#app:has(> .app-shell) ~ #overlay .font-serif{font-family:Georgia,'Nanum Myeongjo',serif}#app:has(> .app-shell) ~ #overlay .font-mono{font-family:ui-monospace,monospace}
#app:has(> .app-shell) ~ #overlay .appearance-row{display:flex;align-items:center;justify-content:space-between;min-height:38px;margin:0;gap:16px;font-size:14px}
#app:has(> .app-shell) ~ #overlay .appearance-row input{width:18px;height:18px;margin:0;accent-color:#2b78b4}
#app:has(> .app-shell) ~ #overlay .page-icon-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
#app:has(> .app-shell) ~ #overlay .page-icon-grid button{padding:14px;border:1px solid #e8e8e6;border-radius:5px}
#app:has(> .app-shell) ~ #overlay .page-icon-grid svg{width:22px;height:22px}
#app:has(> .app-shell) ~ #overlay .menu-footnote{font-size:11px;color:#787774;border-top:1px solid #eee;padding-top:12px;margin:8px 0 0}
#app:has(> .app-shell) ~ #overlay .copy-fallback{width:100%;min-height:140px;resize:vertical}
#app>.app-shell .library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e9e9e7;padding-bottom:12px;flex-wrap:wrap}
#app>.app-shell #library-search-form{display:flex;align-items:center;gap:6px}#app>.app-shell #library-query{width:180px;border:1px solid #e4e4e1;border-radius:4px;padding:7px 9px}
#app>.app-shell .library-count{font-size:12px;margin:16px 0}
@media (max-width:600px){#app>.app-shell .library-toolbar{align-items:stretch;flex-direction:column}#app>.app-shell #library-query{flex:1;width:0}#app>.app-shell .home-heading h1{font-size:26px}}
@media (max-width: 600px) {
  #app > .app-shell .home-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  #app > .app-shell .home-heading > div { min-width: 0; max-width: 100%; }
  #app > .app-shell .home-heading h1 { overflow-wrap: anywhere; }
  #app > .app-shell .home-heading > button { flex-shrink: 0; white-space: nowrap; min-height: 36px; }
}
#app:has(> .app-shell) ~ #overlay .schema-properties { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
#app:has(> .app-shell) ~ #overlay .schema-property { padding: 12px 0; border-bottom: 1px solid #e9e9e7; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#app:has(> .app-shell) ~ #overlay .schema-property-label { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
#app:has(> .app-shell) ~ #overlay .schema-property-label small { color: #787774; }
#app:has(> .app-shell) ~ #overlay .schema-property-actions { display: flex; gap: 3px; flex-shrink: 0; flex-wrap: wrap; }
#app:has(> .app-shell) ~ #overlay .schema-property-actions button { font-size: 12px; padding: 5px 7px; white-space: nowrap; }
#app:has(> .app-shell) ~ #overlay .schema-add-section { margin: 16px 0; }
#app:has(> .app-shell) ~ #overlay .schema-add-section summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
#app:has(> .app-shell) ~ #overlay .schema-limit-note { font-size: 12px; line-height: 1.6; }
@media (max-width: 600px) {
  #app:has(> .app-shell) ~ #overlay .schema-property { align-items: flex-start; flex-direction: column; }
  #app:has(> .app-shell) ~ #overlay .schema-property-actions { width: 100%; }
}

/* D03 option identity and impact confirmation */
#app:has(> .app-shell) ~ #overlay .schema-option-list{display:grid;gap:12px;margin:16px 0}#app:has(> .app-shell) ~ #overlay .schema-option-row{display:grid;grid-template-columns:minmax(65px,1fr) minmax(90px,2fr) auto;gap:8px;align-items:center}#app:has(> .app-shell) ~ #overlay .schema-option-row>label{overflow-wrap:anywhere}#app:has(> .app-shell) ~ #overlay .schema-option-remove{display:flex;align-items:center;gap:4px;white-space:nowrap}#app:has(> .app-shell) ~ #overlay .schema-option-remove input{width:auto}#app:has(> .app-shell) ~ #overlay .schema-options-editor textarea{width:100%;box-sizing:border-box}#app:has(> .app-shell) ~ #overlay .schema-options-editor li{overflow-wrap:anywhere}#app:has(> .app-shell) ~ #overlay .schema-options-editor [role="alert"]{color:var(--danger,#a52727)}

/* D03 property deletion/recovery. Scoped away from authentication screens. */
#app:has(> .app-shell) ~ #overlay .schema-deletion-list{list-style:none;margin:16px 0;padding:0;display:grid;gap:12px}
#app:has(> .app-shell) ~ #overlay .schema-deletion{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
#app:has(> .app-shell) ~ #overlay .schema-deletion>div{min-width:0}
#app:has(> .app-shell) ~ #overlay .schema-deletion small{display:block;overflow-wrap:anywhere;margin-top:6px}
#app:has(> .app-shell) ~ #overlay .schema-delete-warning{padding:12px;border:1px solid var(--border);border-radius:8px;line-height:1.6}
@media (max-width:600px){#app:has(> .app-shell) ~ #overlay .schema-deletion{align-items:stretch;flex-direction:column}}
#app:has(> .app-shell) ~ #overlay .schema-type-list{list-style:none;margin:16px 0;padding:0;display:grid;gap:12px}
#app:has(> .app-shell) ~ #overlay .schema-type-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
#app:has(> .app-shell) ~ #overlay .schema-type-item>div{min-width:0}
#app:has(> .app-shell) ~ #overlay .schema-type-item small{display:block;overflow-wrap:anywhere;margin-top:6px}
#app:has(> .app-shell) ~ #overlay .schema-type-warning{padding:12px;border:1px solid var(--border);border-radius:8px;line-height:1.6}
#app:has(> .app-shell) ~ #overlay .schema-type-samples{width:100%;table-layout:fixed;white-space:normal;border-collapse:collapse;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .schema-type-samples th,#app:has(> .app-shell) ~ #overlay .schema-type-samples td{width:auto;min-width:0;white-space:normal;text-align:left;padding:6px 8px;border-bottom:1px solid var(--border);overflow-wrap:anywhere;vertical-align:top}
#app:has(> .app-shell) ~ #overlay .schema-type-samples small{display:block;opacity:.7}
@media (max-width:600px){#app:has(> .app-shell) ~ #overlay .schema-type-item{align-items:stretch;flex-direction:column}}
@media (min-width: 601px) {
  #app:has(> .app-shell) ~ #overlay .schema-property-label { flex: 1 1 30%; }
  #app:has(> .app-shell) ~ #overlay .schema-property-actions { flex: 0 1 65%; justify-content: flex-end; }
}
#app > .app-shell .advanced-filter-status { display:flex; align-items:center; gap:10px; margin:8px 0; font-size:13px; }
#app:has(> .app-shell) ~ #overlay .advanced-filter-group { min-width:0; border:1px solid #ddd; padding:12px; margin:10px 0; border-radius:6px; }
#app:has(> .app-shell) ~ #overlay .advanced-filter-condition { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; align-items:center; }
#app:has(> .app-shell) ~ #overlay .advanced-filter-condition input,
#app:has(> .app-shell) ~ #overlay .advanced-filter-condition select { flex:1 1 140px; width:auto; min-width:0; margin:0; }
#app:has(> .app-shell) ~ #overlay .advanced-filter-actions { display:flex; gap:8px; flex-wrap:wrap; }
#app:has(> .app-shell) ~ #overlay #advanced-filter-error { color:#a33; }

#app > .app-shell .multi-sort-status { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:8px 0; font-size:13px; color:var(--muted); }
#app:has(> .app-shell) ~ #overlay .multi-sort-editor { min-width:0; }
#app:has(> .app-shell) ~ #overlay .multi-sort-list { list-style:none; padding:0; }
#app:has(> .app-shell) ~ #overlay .multi-sort-row { display:grid; grid-template-columns:24px minmax(0,1fr) minmax(110px,.7fr) auto; gap:8px; align-items:center; margin:10px 0; }
#app:has(> .app-shell) ~ #overlay .multi-sort-row select { min-width:0; width:100%; }
#app:has(> .app-shell) ~ #overlay .multi-sort-actions { display:flex; gap:4px; }
#app:has(> .app-shell) ~ #overlay .multi-sort-editor details { margin-top:12px; font-size:12px; color:var(--muted); }
#app:has(> .app-shell) ~ #overlay #multi-sort-error { color:#b33; }
@media (max-width:600px) { #app:has(> .app-shell) ~ #overlay .multi-sort-row { grid-template-columns:20px minmax(0,1fr) minmax(95px,.65fr); } #app:has(> .app-shell) ~ #overlay .multi-sort-actions { grid-column:2 / -1; } }

/* Named server views are separate from browser-only working settings. */
#app:has(> .app-shell) ~ #overlay .saved-views { min-width: 0; }
#app:has(> .app-shell) ~ #overlay .saved-view-note,
#app:has(> .app-shell) ~ #overlay .saved-views details { color: var(--text-muted, #62686e); font-size: 13px; line-height: 1.6; }
#app:has(> .app-shell) ~ #overlay .saved-view-list { list-style: none; padding: 0; margin: 16px 0; max-height: 45vh; overflow-y: auto; }
#app:has(> .app-shell) ~ #overlay .saved-view-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
#app:has(> .app-shell) ~ #overlay .saved-view-list li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#app:has(> .app-shell) ~ #overlay .saved-view-list small { display: block; margin-top: 4px; color: #68717b; }
#app:has(> .app-shell) ~ #overlay .saved-view-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
#app:has(> .app-shell) ~ #overlay .saved-view-actions button { min-height: 36px; }
#app:has(> .app-shell) ~ #overlay .saved-view-editor label { display: block; margin-top: 12px; }
#app:has(> .app-shell) ~ #overlay .saved-view-editor input,
#app:has(> .app-shell) ~ #overlay .saved-view-editor select { width: 100%; min-width: 0; }
#app:has(> .app-shell) ~ #overlay .saved-view-error,
#app:has(> .app-shell) ~ #overlay .saved-view-delete { color: #9b2727; background: #fff3f0; padding: 12px; border-radius: 8px; overflow-wrap: anywhere; }
#app:has(> .app-shell) ~ #overlay .saved-view-notice { color: #216145; overflow-wrap: anywhere; }
@media (max-width: 760px) {
 #app:has(> .app-shell) ~ #overlay .saved-view-list li { align-items: flex-start; flex-direction: column; }
}

/* Full-result calendar, scoped away from authentication screens. */
#app > .app-shell .dbv-undated{margin-top:16px;padding:12px;border:1px solid var(--border);border-radius:6px;}
#app > .app-shell .dbv-undated summary{cursor:pointer;font-weight:600;}
#app > .app-shell .dbv-undated > div{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
#app > .app-shell .dbv-undated button{max-width:100%;overflow-wrap:anywhere;}

/* D04: scoped tag controls, native keyboard-accessible radio/checkbox choices. */
#app > .app-shell .tag-picker-trigger{display:flex;flex-wrap:wrap;gap:4px;align-items:center;min-height:32px;width:100%;text-align:left;border:1px solid transparent;background:transparent;padding:4px 6px;white-space:normal}
#app > .app-shell .tag-picker-trigger:hover:not(:disabled){border-color:var(--border);background:var(--hover)}
#app > .app-shell .tag-chip,#app:has(> .app-shell) ~ #overlay .tag-chip{display:inline-block;background:#edf0f4;color:#394454;border-radius:4px;padding:2px 7px;max-width:100%;overflow-wrap:anywhere;font-size:12px;line-height:1.5}
#app > .app-shell .tag-empty{color:var(--muted)}
#app:has(> .app-shell) ~ #overlay .tag-selected{display:flex;gap:5px;flex-wrap:wrap;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .tag-options{max-height:300px;overflow:auto;margin-top:12px;display:grid;gap:4px}
#app:has(> .app-shell) ~ #overlay .tag-option{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--border);border-radius:6px;cursor:pointer;overflow-wrap:anywhere}
#app:has(> .app-shell) ~ #overlay .tag-option[hidden]{display:none!important}
#app:has(> .app-shell) ~ #overlay .tag-option input{width:18px;height:18px;margin:0;flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .tag-option:focus-within{outline:2px solid var(--accent);outline-offset:1px}
#app:has(> .app-shell) ~ #overlay #tag-error{color:#a12a2a;overflow-wrap:anywhere}
@media (max-width:600px){#app:has(> .app-shell) ~ #overlay .tag-picker .modal-actions{flex-wrap:wrap}#app:has(> .app-shell) ~ #overlay .tag-options{max-height:35vh}}

/* D04 keyboard-accessible option ordering; retains input identity across moves. */
#app:has(> .app-shell) ~ #overlay .schema-option-order{grid-column:1/-1;display:flex;justify-content:flex-end;gap:6px}
#app:has(> .app-shell) ~ #overlay .schema-option-row input{min-width:0}

/* D04 closed color palette. Names remain visible; color is never the sole cue. */
#app:has(> .app-shell) ~ #overlay .schema-option-color{grid-column:1/3;display:flex;align-items:center;gap:8px;font-size:12px}
#app:has(> .app-shell) ~ #overlay .schema-option-color select{min-width:0;max-width:180px;width:100%}
#app:has(> .app-shell) ~ #overlay .schema-option-row .schema-option-order{grid-column:3;flex-wrap:wrap}
#app > .app-shell .tag-color-gray,#app:has(> .app-shell) ~ #overlay .tag-color-gray{background:#e9e9e7;color:#454542}
#app > .app-shell .tag-color-brown,#app:has(> .app-shell) ~ #overlay .tag-color-brown{background:#f1e6dd;color:#69452d}
#app > .app-shell .tag-color-orange,#app:has(> .app-shell) ~ #overlay .tag-color-orange{background:#ffead5;color:#844107}
#app > .app-shell .tag-color-yellow,#app:has(> .app-shell) ~ #overlay .tag-color-yellow{background:#fff3c4;color:#715710}
#app > .app-shell .tag-color-green,#app:has(> .app-shell) ~ #overlay .tag-color-green{background:#e0f0e3;color:#265c38}
#app > .app-shell .tag-color-blue,#app:has(> .app-shell) ~ #overlay .tag-color-blue{background:#dfedfb;color:#245687}
#app > .app-shell .tag-color-purple,#app:has(> .app-shell) ~ #overlay .tag-color-purple{background:#eee4f8;color:#623b88}
#app > .app-shell .tag-color-pink,#app:has(> .app-shell) ~ #overlay .tag-color-pink{background:#f9e3ef;color:#85345f}
#app > .app-shell .tag-color-red,#app:has(> .app-shell) ~ #overlay .tag-color-red{background:#fbe3e0;color:#8c322b}
@media (forced-colors:active) {#app > .app-shell .tag-chip,#app:has(> .app-shell) ~ #overlay .tag-chip{border:1px solid CanvasText}}

/* Numeric presentation never replaces the raw editing value. */
#app > .app-shell .number-property { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:100px; font-variant-numeric:tabular-nums; }
#app > .app-shell .number-display { overflow-wrap:anywhere; }
#app > .app-shell .number-edit { max-width:100%; font-size:12px; }
#app > .app-shell .number-edit summary { cursor:pointer; color:var(--muted); padding:3px 0; }
#app > .app-shell .number-edit label { display:flex; flex-direction:column; }
#app > .app-shell .number-edit input { width:145px; max-width:100%; }
#app > .app-shell .number-edit small, #app > .app-shell .number-raw { display:block; font-size:11px; color:var(--muted); }
#app:has(> .app-shell) ~ #overlay .number-format-editor select { width:100%; padding:9px; margin-top:6px; }
#app:has(> .app-shell) ~ #overlay .number-format-example { padding:12px; background:var(--bg); line-height:1.8; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }

/* Numeric summaries use the server's full filtered snapshot, not rendered rows. */
#app > .app-shell .number-aggregate-footer { background:#f7f7f5; border-top:2px solid var(--line); }
#app > .app-shell .number-aggregate-footer :is(th,td) { padding:12px; vertical-align:top; }
#app > .app-shell .number-aggregate-footer th { font-weight:normal; text-align:left; min-width:180px; }
#app > .app-shell .number-aggregate-footer small { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
#app > .app-shell .number-aggregate-footer select { width:100%; min-width:100px; max-width:180px; }
#app > .app-shell .number-aggregate-footer output { display:block; margin-top:8px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }

/* Numeric progress is static, scoped, and always accompanied by raw-range text. */
#app > .app-shell .number-progress { display:inline-flex; flex-direction:column; gap:4px; vertical-align:middle; max-width:100%; margin:4px 0 0; }
#app > .app-shell .number-display { display:flex; flex-direction:column; align-items:flex-start; }
#app > .app-shell .number-progress-visual { display:inline-block; flex:none; background:#e3e8e4; }
#app > .app-shell .progress-bar { width:100px; max-width:100%; height:7px; border-radius:8px; overflow:hidden; }
#app > .app-shell .progress-bar > span { display:block; width:var(--number-progress); height:100%; background:#357450; }
#app > .app-shell .progress-ring { width:24px; height:24px; border-radius:50%; background:conic-gradient(#357450 var(--number-progress),#e3e8e4 0); padding:5px; box-sizing:border-box; }
#app > .app-shell .progress-ring > span { display:block; width:100%; height:100%; border-radius:50%; background:var(--surface,#fff); }
#app > .app-shell .number-progress-range, #app > .app-shell .number-progress-empty { font-size:10px; color:#59665f; white-space:normal; overflow-wrap:anywhere; }
#app > .app-shell .dbv-property:has(.number-progress), #app > .app-shell .dbv-card-property > span:has(.number-progress) { display:flex; flex-direction:column; align-items:flex-start; }
#app:has(> .app-shell) ~ #overlay .number-progress-editor label { display:block; margin-top:12px; }
#app:has(> .app-shell) ~ #overlay .number-progress-editor select, #app:has(> .app-shell) ~ #overlay .number-progress-editor input { width:100%; padding:9px; margin-top:6px; box-sizing:border-box; }
#app:has(> .app-shell) ~ #overlay #number-progress-error { color:#a12929; }
@media (forced-colors:active) {
 #app > .app-shell .number-progress-visual { forced-color-adjust:none; background:Canvas; border:1px solid CanvasText; }
 #app > .app-shell .progress-bar > span { background:Highlight; }
 #app > .app-shell .progress-ring { background:conic-gradient(Highlight var(--number-progress),Canvas 0); }
 #app > .app-shell .progress-ring > span { background:Canvas; }
}

/* D01 one-way relation controls stay inside the workspace and its modal portal. */
#app > .app-shell .relation-trigger{max-width:100%;min-height:32px;text-align:left;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--line);background:transparent;border-radius:6px;padding:5px 8px}
#app:has(> .app-shell) ~ #overlay .relation-selected{display:grid;gap:6px;max-height:180px;overflow:auto;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .relation-selected>div,#app:has(> .app-shell) ~ #overlay .relation-search,#app:has(> .app-shell) ~ #overlay .relation-pagination{display:flex;align-items:center;gap:8px;justify-content:space-between}
#app:has(> .app-shell) ~ #overlay .relation-search input{min-width:0;flex:1}
#app:has(> .app-shell) ~ #overlay .relation-options{display:grid;gap:6px;max-height:260px;overflow:auto;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .relation-options label{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid var(--line);border-radius:6px;overflow-wrap:anywhere}
#app:has(> .app-shell) ~ #overlay .relation-options input{width:auto}
#app:has(> .app-shell) ~ #overlay .relation-pagination{font-size:12px;flex-wrap:wrap}

#app > .app-shell .rollup-value{display:inline-block;padding:6px 8px;min-width:3ch;font-variant-numeric:tabular-nums;color:var(--text);overflow-wrap:anywhere}#app:has(> .app-shell) ~ #overlay .rollup-editor select{width:100%;max-width:100%;margin:6px 0 14px}#app:has(> .app-shell) ~ #overlay .rollup-editor .muted{font-size:12px;line-height:1.5}#app:has(> .app-shell) ~ #overlay .rollup-editor label{display:block}#app:has(> .app-shell) ~ #overlay .rollup-editor #rollup-error{color:var(--danger);font-size:13px}

#app > .app-shell .formula-value{display:inline-block;padding:6px 8px;min-width:3ch;font-variant-numeric:tabular-nums;color:var(--text);overflow-wrap:anywhere}#app:has(> .app-shell) ~ #overlay .formula-editor select,#app:has(> .app-shell) ~ #overlay .formula-editor textarea{width:100%;max-width:100%;margin:6px 0 14px}#app:has(> .app-shell) ~ #overlay .formula-editor textarea{min-height:100px;resize:vertical;font-family:monospace}#app:has(> .app-shell) ~ #overlay .formula-editor .muted{font-size:12px;line-height:1.5}#app:has(> .app-shell) ~ #overlay .formula-editor label{display:block}#app:has(> .app-shell) ~ #overlay .formula-editor #formula-error{color:var(--danger);font-size:13px}

/* D02 member picker: workspace-scoped controls and its modal portal only. */
#app > .app-shell .person-trigger{max-width:100%;min-height:32px;text-align:left;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--line);background:transparent;border-radius:6px;padding:5px 8px}
#app:has(> .app-shell) ~ #overlay .person-editor{min-width:0;overflow-wrap:anywhere}
#app:has(> .app-shell) ~ #overlay .person-selected{display:grid;gap:6px;max-height:170px;overflow:auto;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .person-selected>div{display:flex;align-items:center;gap:8px;justify-content:space-between;min-width:0}
#app:has(> .app-shell) ~ #overlay .person-selected>div>span{min-width:0;overflow-wrap:anywhere}
#app:has(> .app-shell) ~ #overlay .person-selected button{flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .person-options{display:grid;gap:6px;max-height:260px;overflow:auto;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .person-options label{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid var(--line);border-radius:6px;overflow-wrap:anywhere;min-width:0}
#app:has(> .app-shell) ~ #overlay .person-options input{width:auto;flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .person-editor .modal-actions{flex-wrap:wrap}
#app > .app-shell .status-trigger{max-width:100%;min-height:32px;text-align:left;background:transparent;border:1px solid var(--line);border-radius:6px;padding:5px 8px}
#app > .app-shell .status-chip,#app:has(> .app-shell) ~ #overlay .status-chip{display:inline-block;border-radius:5px;padding:2px 7px;white-space:normal;overflow-wrap:anywhere;color:#374151;background:#edf0f3}
#app > .app-shell .status-in_progress,#app:has(> .app-shell) ~ #overlay .status-in_progress{color:#184b8a;background:#e4efff}
#app > .app-shell .status-done,#app:has(> .app-shell) ~ #overlay .status-done{color:#236640;background:#e4f4e9}
#app > .app-shell .status-board-value{margin:-4px 0 12px;padding:0 8px}
#app:has(> .app-shell) ~ #overlay .status-options{max-height:340px;overflow:auto;display:grid;gap:10px;margin:12px 0}
#app:has(> .app-shell) ~ #overlay .status-options fieldset{min-width:0;border:1px solid var(--line);border-radius:6px;padding:10px}
#app:has(> .app-shell) ~ #overlay .status-options label{display:flex;align-items:center;gap:10px;padding:6px;min-width:0}
#app:has(> .app-shell) ~ #overlay .status-options input{width:auto;flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .status-editor .modal-actions{flex-wrap:wrap}

/* V04: bounded owned database previews, scoped to the workspace shell. */
#app > .app-shell .inline-databases { margin-top:32px; border-top:1px solid var(--border,#e5e4e1); padding-top:20px; min-width:0; }
#app > .app-shell .inline-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#app > .app-shell .inline-heading h2 { margin:0; font-size:16px; }
#app > .app-shell .inline-heading h3 { margin:0; font-size:15px; overflow-wrap:anywhere; }
#app > .app-shell .inline-heading > div { display:flex; gap:8px; }
#app > .app-shell .inline-help { font-size:12px; line-height:1.6; }
#app > .app-shell .inline-database { margin-top:16px; padding:16px; border:1px solid var(--border,#e5e4e1); border-radius:8px; min-width:0; }
#app > .app-shell .inline-database > .muted { font-size:12px; }
#app > .app-shell .inline-table-wrap { max-width:100%; overflow:auto; }
#app > .app-shell .inline-table-wrap table { border-collapse:collapse; width:100%; font-size:13px; }
#app > .app-shell .inline-table-wrap th, #app > .app-shell .inline-table-wrap td { padding:9px 12px; text-align:left; border-bottom:1px solid var(--border,#e5e4e1); min-width:110px; max-width:260px; overflow-wrap:anywhere; }
#app > .app-shell .inline-table-wrap th { font-weight:500; }
#app > .app-shell .inline-table-wrap th button { text-align:left; }
#app > .app-shell .inline-pager { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:16px; font-size:12px; flex-wrap:wrap; }

/* N01 personal metadata, isolated from shared document authoring. */
#app:has(> .app-shell) ~ #overlay .personal-favorites{font-size:14px;line-height:1.6;min-width:0}
#app:has(> .app-shell) ~ #overlay .personal-favorites-list{padding:0;list-style:none;max-height:45vh;overflow:auto}
#app:has(> .app-shell) ~ #overlay .personal-favorites-list li{display:flex;align-items:center;gap:8px;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border,#e7e5e4)}
#app:has(> .app-shell) ~ #overlay .favorite-title{min-width:0;overflow-wrap:anywhere;text-align:left;flex:1}
#app:has(> .app-shell) ~ #overlay .favorite-controls{display:flex;gap:4px;flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .favorite-controls button{font-size:12px;padding:5px}
#app:has(> .app-shell) ~ #overlay .personal-favorites details{margin-top:16px}
#app:has(> .app-shell) ~ #overlay .personal-favorites summary{cursor:pointer;font-weight:600}

/* N02 personal visits, separate from shared modification order. */
#app > .app-shell .personal-visits .section-heading{flex-wrap:wrap;gap:12px}
#app > .app-shell .personal-visits .section-heading > span{display:flex;flex-wrap:wrap;gap:8px}
#app > .app-shell .personal-visits details{margin-top:24px;font-size:13px}
#app > .app-shell .personal-visits summary{cursor:pointer;font-weight:600}
#app > .app-shell .personal-visits [role="alert"]{overflow-wrap:anywhere}

/* N04: account-scoped library metadata; no global/auth selector changes. */
#app > .app-shell .library-filters{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:16px 0}
#app > .app-shell .library-filters label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);min-width:120px;flex:1}
#app > .app-shell .library-filters select{width:100%;min-width:0;max-width:100%;padding:7px 8px;color:var(--ink);background:var(--paper);border:1px solid var(--border);border-radius:4px}
#app > .app-shell .library-search-label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#app > .app-shell .library-entry{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:6px;min-width:0}
#app > .app-shell .library-entry .recent-row{border-bottom:0;width:100%}
#app > .app-shell .library-metadata{display:flex;flex-wrap:wrap;align-items:center;gap:5px 14px;padding:0 12px 0 43px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
#app > .app-shell .library-metadata > span{max-width:100%}
#app > .app-shell .library-area{background:var(--soft);border-radius:3px;padding:1px 6px;color:var(--ink)}
#app > .app-shell .library-location{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#app > .app-shell .library-help{font-size:12px;color:var(--muted);margin-top:24px}
#app > .app-shell .library-help summary{cursor:pointer;width:fit-content}
#app > .app-shell .library-help p{margin:8px 0}
#app > .app-shell .library-note{font-size:12px}
#app > .app-shell .library-results{min-height:80px}
@media (max-width:600px){
 #app > .app-shell .library-filters{gap:10px}
 #app > .app-shell .library-filters label{flex-basis:calc(50% - 10px);min-width:0;max-width:calc(50% - 5px)}
 #app > .app-shell .library-filters > button{margin-left:auto;min-height:32px}
 #app > .app-shell .library-metadata{padding-left:12px;gap:5px 10px}
 #app > .app-shell .library-toolbar .view-tabs{max-width:100%;flex-wrap:wrap;height:auto}
 #app > .app-shell .library-toolbar #library-search-form{min-width:0;width:100%}
}
/* C01 server-confirmed capability inspection; scoped to the workspace portal. */
#app:has(> .app-shell) ~ #overlay .page-permission-details dl{display:grid;grid-template-columns:105px minmax(0,1fr);gap:12px 16px;margin:20px 0}
#app:has(> .app-shell) ~ #overlay .page-permission-details dt{color:var(--muted)}
#app:has(> .app-shell) ~ #overlay .page-permission-details dd{margin:0;overflow-wrap:anywhere}
#app:has(> .app-shell) ~ #overlay .page-permission-details summary{cursor:pointer;color:var(--muted);margin:16px 0}
/* C01 owner grants, scoped to the application modal portal. */
#app:has(> .app-shell) ~ #overlay .page-grants-editor fieldset{border:1px solid var(--line);border-radius:6px;padding:12px 14px;margin:12px 0;min-width:0}
#app:has(> .app-shell) ~ #overlay .page-grants-editor legend{font-size:12px;font-weight:600;padding:0 4px}
#app:has(> .app-shell) ~ #overlay .page-grants-editor ul{list-style:none;padding:0;margin:12px 0;max-height:220px;overflow:auto}
#app:has(> .app-shell) ~ #overlay .page-grants-editor li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
#app:has(> .app-shell) ~ #overlay .page-grants-editor li span{overflow-wrap:anywhere;min-width:0}
#app:has(> .app-shell) ~ #overlay .page-grants-editor li button{flex-shrink:0}
#app:has(> .app-shell) ~ #overlay .page-grants-editor [role=alert]:empty{display:none}
#app:has(> .app-shell) ~ #overlay .page-grants-editor [role=alert]{color:#a43e38}
#app:has(> .app-shell) ~ #overlay .page-grants-editor [role=group]{border:1px solid #d9c8a6;background:#fcf9f2;padding:14px;border-radius:6px}
#app:has(> .app-shell) ~ #overlay .page-grants-editor .modal-actions{flex-wrap:wrap}
#app:has(> .app-shell) ~ #overlay .page-grants-editor summary{cursor:pointer;font-size:12px;color:var(--muted)}
/* E02 explicit sidecar area, not an inline collaborative editor. */
#app > .app-shell .synced-blocks{margin:32px 0;padding:20px 0;border-top:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}
#app > .app-shell .synced-blocks header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#app > .app-shell .synced-blocks h2{font-size:18px;margin:0}
#app > .app-shell .synced-blocks h3{font-size:13px;color:var(--muted);margin:20px 0 8px}
#app > .app-shell .synced-blocks ul{list-style:none;padding:0;margin:0}
#app > .app-shell .synced-blocks li{border-left:2px solid var(--line);padding:10px 14px;margin:8px 0;background:var(--sidebar)}
#app > .app-shell .synced-blocks .sync-preview{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto;margin:6px 0;display:block}
#app > .app-shell .synced-blocks button{max-width:100%;white-space:normal;text-align:left;min-height:36px;margin:4px 4px 4px 0}
#app > .app-shell .synced-blocks [aria-pressed=true]{outline:2px solid var(--accent);outline-offset:1px;background:var(--soft)}
#app > .app-shell .synced-blocks button:focus-visible,#app > .app-shell .synced-blocks summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#app > .app-shell .synced-blocks [role=group]{display:flex;flex-direction:column;gap:4px;max-height:300px;overflow:auto;margin:8px 0}
#app > .app-shell .synced-blocks [role=alert]{color:#a43e38}
#app > .app-shell .synced-blocks details{margin:14px 0;border-top:1px solid var(--line);padding-top:12px}
#app > .app-shell .synced-blocks summary{cursor:pointer;font-weight:500}
#app > .app-shell .synced-blocks nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#app > .app-shell .synced-blocks .sync-block-type{font-size:11px;color:var(--muted)}

/* E03: opt-in literal math source; bounded preview stays within the app shell. */
#app > .app-shell .math-block-content{min-width:0;width:100%;border:1px solid var(--border,#deddda);border-radius:8px;padding:12px;background:var(--surface,#fff)}
#app > .app-shell .math-source-label{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px;font-weight:600}
#app > .app-shell .math-source-label span,#app > .app-shell .math-help{font-size:12px;font-weight:400;color:var(--muted,#686868)}
#app > .app-shell .math-block-content .block-editor{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;min-height:44px;margin-top:8px;padding:8px;border:1px solid var(--border,#deddda);border-radius:4px}
#app > .app-shell .math-block-content .block-editor:focus{outline:2px solid #5684ad;outline-offset:2px}
#app > .app-shell .math-block-content [aria-invalid=true]{border-color:#a83232}
#app > .app-shell .math-preview{max-width:100%;overflow:auto;padding:12px 0;line-height:1.6}
#app > .app-shell .math-preview math{font-size:1.2em}
#app > .app-shell .math-preview pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media (max-width:640px){#app > .app-shell .math-block-content{padding:8px}#app > .app-shell .math-block-content .block-editor{font-size:16px}}

/* E05 opt-in internal references: scoped to the app shell. */
#app > .app-shell .document-mentions{border-top:1px solid var(--border);margin-top:28px;padding-top:20px;overflow-wrap:anywhere}
#app > .app-shell .document-mentions header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#app > .app-shell .document-mentions h2{font-size:18px;margin:0}
#app > .app-shell .document-mentions h3{font-size:14px;margin:20px 0 8px}
#app > .app-shell .document-mentions ul{list-style:none;padding:0;margin:0}
#app > .app-shell .document-mentions li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0;flex-wrap:wrap}
#app > .app-shell .document-mentions button{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left;min-height:36px}
#app > .app-shell .document-mentions details{margin-top:16px}
#app > .app-shell .document-mentions summary{cursor:pointer;padding:8px 0}
#app > .app-shell .mention-search{display:flex;gap:8px;align-items:center;margin:8px 0}
#app > .app-shell .mention-search input{min-width:0;flex:1}
#app > .app-shell .mention-options{display:grid;gap:6px;max-height:20rem;overflow:auto;margin:10px 0}
#app > .app-shell .mention-options button[aria-pressed=true]{outline:2px solid currentColor;outline-offset:-2px}
#app > .app-shell .document-mentions nav{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
#app > .app-shell .mention-unavailable{color:var(--muted)}
@media (max-width:640px){#app > .app-shell .document-mentions button{min-height:44px}#app > .app-shell .mention-search input{font-size:16px}#app > .app-shell .document-mentions li{align-items:stretch;flex-direction:column}}

/* Explicit native-checkbox selection; nested structure stays visible on narrow screens. */
#app:has(> .app-shell) ~ #overlay .block-batch-fields{min-width:0;border:0;padding:0;margin:16px 0}
#app:has(> .app-shell) ~ #overlay .block-batch-list{max-height:44vh;overflow:auto;border:1px solid var(--border);border-radius:8px}
#app:has(> .app-shell) ~ #overlay .block-batch-row{display:flex;align-items:flex-start;gap:10px;padding:10px;border-bottom:1px solid var(--border);cursor:pointer;min-width:0}
#app:has(> .app-shell) ~ #overlay .block-batch-row input{flex:0 0 auto;width:18px;height:18px;margin:3px 0}
#app:has(> .app-shell) ~ #overlay .block-batch-row>span{min-width:0;display:grid;gap:3px;overflow-wrap:anywhere;white-space:pre-wrap}
#app:has(> .app-shell) ~ #overlay .block-batch-row small{color:var(--muted)}
#app:has(> .app-shell) ~ #overlay .block-batch-row:focus-within{outline:2px solid var(--accent);outline-offset:-2px}

/* C05: block-level comment context, scoped to the signed-in workspace. */
#app > .app-shell .comment-hint{font-size:11px;color:var(--muted);margin:10px 0}
#app > .app-shell .comment-compose{border:1px solid var(--line);border-radius:6px;padding:12px;min-width:0;margin-top:16px}
#app > .app-shell .comment-compose legend{font-size:12px;font-weight:600}
#app > .app-shell .comment-compose label{display:block;font-size:12px;margin:8px 0 4px}
#app > .app-shell .comment-compose select{width:100%;min-width:0;font-size:12px}
#app > .app-shell .comment-compose textarea{margin-top:0}
#app > .app-shell .comment-anchor{margin:10px 0;padding:10px;background:var(--sidebar);border-left:2px solid var(--accent);font-size:11px;overflow-wrap:anywhere}
#app > .app-shell .comment-anchor strong,#app > .app-shell .comment-anchor small{display:block}
#app > .app-shell .comment-anchor small,#app > .app-shell .comment-context-label{color:var(--muted);font-size:10px}
#app > .app-shell .comment-anchor blockquote{margin:8px 0;white-space:pre-wrap;max-height:160px;overflow:auto}
#app > .app-shell .comment-anchor[data-context-state="orphan"],#app > .app-shell .comment-anchor[data-context-state="changed"]{border-left-color:#a47c49}
#app > .app-shell #comment-status{font-size:12px;overflow-wrap:anywhere}

/* C09: scoped history browsing and explicit restore review. */
#app > .app-shell .history-browser { width: min(440px, 100%); overflow-x: hidden; overflow-wrap: anywhere; }
#app > .app-shell .history-browser :is(p,li,dd,small,time) { font-size: 12px; line-height: 1.6; }
#app > .app-shell .history-browser .history-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; white-space: normal; text-align: left; margin: 8px 0; }
#app > .app-shell .history-preview { margin: 16px 0; padding: 12px; border: 1px solid var(--line); background: var(--paper); }
#app > .app-shell .history-preview h4 { margin: 14px 0 6px; }
#app > .app-shell .history-preview ul { padding-left: 18px; }
#app > .app-shell .history-preview dd { margin: 4px 0 10px; }
#app > .app-shell .history-preview dd span { display: block; }
#app > .app-shell .history-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
#app > .app-shell .history-consent input { flex: 0 0 auto; }
#app > .app-shell .history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#app > .app-shell .history-browser button { white-space: normal; min-height: 36px; }
@media (max-width: 440px) { #app > .app-shell .history-browser { width: 100%; padding: 14px; box-sizing: border-box; } }

/* V05 independent title draft, no main editor binding. */
#app > .app-shell .peek-title-editor{border:1px solid var(--border,#ddd);border-radius:8px;padding:12px;margin:12px 0;min-width:0}#app > .app-shell .peek-title-editor label{display:block;font-weight:600;margin-bottom:6px}#app > .app-shell .peek-title-editor input{box-sizing:border-box;width:100%;min-width:0;padding:9px;border:1px solid var(--border,#ddd);border-radius:5px}#app > .app-shell .peek-title-editor [role=alert]{overflow-wrap:anywhere}#app > .app-shell .peek-title-editor button{white-space:normal}

#app > .app-shell .peek-property-editor{border:1px solid var(--border,#ddd);border-radius:8px;padding:12px;margin:12px 0;min-width:0}#app > .app-shell .peek-property-editor label{display:block;font-weight:600;margin-bottom:6px}#app > .app-shell .peek-property-editor :is(input:not([type=checkbox]),textarea,select){box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:9px;border:1px solid var(--border,#ddd);border-radius:5px;font:inherit}#app > .app-shell .peek-property-editor textarea{resize:vertical}#app > .app-shell .peek-property-editor input[type=checkbox]{width:24px;height:24px}#app > .app-shell .peek-property-editor button{white-space:normal;margin-top:6px}#app > .app-shell .peek-property-editor [role=alert]{overflow-wrap:anywhere}

#app > .app-shell .peek-choice-list{max-height:300px;overflow:auto;min-width:0;border:1px solid var(--border,#ddd);border-radius:6px;padding:8px}#app > .app-shell .peek-choice-list fieldset{min-width:0;margin:0 0 10px;padding:8px;border:1px solid var(--border,#ddd)}#app > .app-shell .peek-choice-list .peek-choice-option{display:flex;align-items:flex-start;gap:8px;padding:7px 2px;font-weight:400;min-width:0}#app > .app-shell .peek-choice-list input:is([type=radio],[type=checkbox]){width:22px;height:22px;flex:0 0 22px;margin:0}#app > .app-shell .peek-choice-list :is(.tag,.status-chip){white-space:normal;overflow-wrap:anywhere;min-width:0}#app > .app-shell .peek-property-editor .side-peek-help{overflow-wrap:anywhere}

#app > .app-shell .peek-date-fields label{margin-top:10px}#app > .app-shell .peek-date-fields label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px}#app > .app-shell .peek-date-fields input[type=date]{min-height:42px}

/* Private peek relation controls remain within the narrow pane. */
#app > .app-shell .peek-relation{min-width:0;overflow-wrap:anywhere}#app > .app-shell .peek-relation-selected{display:flex;gap:8px;align-items:center;justify-content:space-between}#app > .app-shell .peek-relation-selected span{min-width:0}#app > .app-shell .peek-relation .relation-search input{min-width:0;width:100%}#app > .app-shell .peek-relation .relation-pagination{flex-wrap:wrap}#app > .app-shell .peek-relation .relation-options{max-height:260px;overflow:auto}

/* Peek place fields are independent from the original page's modal editor. */
#app > .app-shell .peek-place{min-width:0;max-width:100%}
#app > .app-shell .peek-place label{display:block;margin-top:8px}
#app > .app-shell .peek-place input,#app > .app-shell .peek-place textarea{box-sizing:border-box;width:100%;min-width:0;max-width:100%}
#app > .app-shell .peek-place textarea{resize:vertical}
#app > .app-shell .peek-place-coordinates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:420px){#app > .app-shell .peek-place-coordinates{grid-template-columns:minmax(0,1fr)}}

#app > .app-shell .peek-text-editor{border:1px solid var(--border,#ddd);border-radius:8px;padding:12px;margin:12px 0;min-width:0}#app > .app-shell .peek-text-editor label{display:block;font-weight:600;margin-bottom:6px}#app > .app-shell .peek-text-editor :is(textarea,select){box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:9px;border:1px solid var(--border,#ddd);border-radius:5px;font:inherit}#app > .app-shell .peek-text-editor textarea{min-height:180px;resize:vertical;white-space:pre-wrap;overflow-wrap:anywhere}#app > .app-shell .peek-text-editor button{white-space:normal;margin-top:6px}#app > .app-shell .peek-text-editor :is([role=alert],.side-peek-help){overflow-wrap:anywhere}

/* Page-bottom panels stay compact: small muted labels, icon-only refresh, no explanatory copy. */
#app > .app-shell .panel-compact{margin:18px 0 0;padding-top:10px;border-top:1px solid #ececea;min-width:0;font-size:14px}
#app > .app-shell .panel-compact .panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
#app > .app-shell .panel-compact .panel-label{color:#9b9a97;font-size:12px;font-weight:600}
#app > .app-shell .panel-compact .panel-sub{margin:10px 0 4px;color:#9b9a97;font-size:12px}
#app > .app-shell .panel-compact h3{font-size:14px}
#app > .app-shell .icon-btn{width:24px;height:24px;padding:0;display:inline-grid;place-items:center;border:0;border-radius:4px;background:transparent;color:#787774;cursor:pointer}
#app > .app-shell .icon-btn:hover:not(:disabled){background:#efefed}
#app > .app-shell .icon-btn:disabled{opacity:.4;cursor:default}
#app > .app-shell .backlinks{margin:2px 0 6px;color:#787774;font-size:13px}
#app > .app-shell .backlinks summary{cursor:pointer;width:max-content;padding:2px 0}
#app > .app-shell .backlinks ul{list-style:none;margin:4px 0;padding:0}
#app > .app-shell .backlinks li{margin:2px 0}
/* F012 page chrome: title tools appear on hover/focus, presence sits in the topbar. */
#app > .app-shell .page-head .page-mark,
#app > .app-shell .page-head .page-cover-open,
#app > .app-shell .page-head .page-comment-add { opacity: 0; transition: opacity .15s ease; }
#app > .app-shell .page-head:hover .page-mark,
#app > .app-shell .page-head:hover .page-cover-open,
#app > .app-shell .page-head:focus-within .page-mark,
#app > .app-shell .page-head:focus-within .page-cover-open,
#app > .app-shell .page-head:hover .page-comment-add,
#app > .app-shell .page-head:focus-within .page-comment-add { opacity: 1; }
#app > .app-shell .page-head .page-comment-add { display: inline-flex; align-items: center; height: 26px; margin: -4px 0 12px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: #787774; font-size: 12px; cursor: pointer; }
#app > .app-shell .page-head .page-comment-add:hover { background: #efefed; }
#app > .app-shell .page-head .page-mark.has-icon,
#app > .app-shell .page-head .page-mark:has(img) { opacity: 1; }
@media (hover: none) { #app > .app-shell .page-head .page-mark, #app > .app-shell .page-head .page-cover-open, #app > .app-shell .page-head .page-comment-add { opacity: 1; } }
#app > .app-shell .topbar-presence { display: inline-flex; align-items: center; }
#app > .app-shell .presence-avatars { display: inline-flex; align-items: center; margin-right: 6px; }
#app > .app-shell .presence-avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; color: #4a4a46; background: #e9e8e4; border: 2px solid #fff; margin-left: -6px; }
#app > .app-shell .presence-avatar:first-child { margin-left: 0; }
#app > .app-shell .topbar-edited { color: var(--muted); font-size: 12px; white-space: nowrap; margin: 0 6px; }
#app > .app-shell .file-section-label { font-size: 12px; font-weight: 500; color: var(--muted); margin: 8px 0 4px; }
@media (max-width: 760px) { #app > .app-shell .topbar-edited { display: none; } }

/* F014: database row property list. Fixed label column, values beside their label, 34px rows. */
#app > .app-shell .properties { display: flex; flex-direction: column; margin: 4px 0 12px; }
#app > .app-shell .property { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; min-height: 34px; }
#app > .app-shell .property label { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#app > .app-shell .property .prop-type { display: inline-flex; flex: none; width: 14px; height: 14px; }
#app > .app-shell .property .prop-type svg { width: 14px; height: 14px; }
#app > .app-shell .property > :not(label) { display: flex; align-items: center; min-width: 0; min-height: 34px; padding: 0 8px; border-radius: 4px; }
#app > .app-shell .property > :not(label):hover { background: rgba(55, 53, 47, .06); }
#app > .app-shell .property > input:not([type="checkbox"]) { width: 100%; border: 0; background: transparent; font: inherit; }
#app > .app-shell .prop-more,
#app > .app-shell .prop-add { align-self: flex-start; min-height: 30px; margin-top: 2px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
#app > .app-shell .prop-more:hover,
#app > .app-shell .prop-add:hover { background: rgba(55, 53, 47, .06); }

/* F015: page menu groups. Dividers come from <hr>; 더 보기 / 내보내기 are native disclosures. */
#app:has(> .app-shell) ~ #overlay .page-actions details.page-menu-more { margin: 2px 0; }
#app:has(> .app-shell) ~ #overlay .page-actions details.page-menu-more > summary { display: flex; align-items: center; min-height: 30px; padding: 0 8px; border-radius: 4px; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
#app:has(> .app-shell) ~ #overlay .page-actions details.page-menu-more > summary::-webkit-details-marker { display: none; }
#app:has(> .app-shell) ~ #overlay .page-actions details.page-menu-more > summary:hover { background: rgba(55, 53, 47, .06); }
#app:has(> .app-shell) ~ #overlay .page-actions details.page-menu-more[open] > :not(summary) { margin-left: 10px; }

/* PM fix: page menu shortcut hints and property values sit next to their labels (Notion layout). */
#app > .app-shell .page-actions .menu-kbd { margin-left: auto; color: var(--muted); font-size: 11px; background: none; border: 0; }
#app > .app-shell .property > button { justify-content: flex-start; text-align: left; justify-self: start; }
