:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  --ink: #37352f;
  --muted: #706d65;
  --accent: #176ab6;
  --line: #e9e7e2;
  --canvas: #fff;
  --sidebar: #f7f6f3;
  --surface: #fff;
  --raised: #fff;
  --soft: #f8f7f5;
  --hover: #efede9;
  --active: #eae8e3;
  --active-text: #37352f;
  --edge: #dfdcd5;
  --edge-hover: #a9a59c;
  --focus: #2383e2;
  --primary: #37352f;
  --primary-hover: #49463f;
  --on-primary: #fff;
  --danger: #a73b35;
  --gold: #865817;
  --tone-lilac: #efedf8;
  --ink-lilac: #55437f;
  --tone-gold: #f7efda;
  --ink-gold: #775500;
  --tone-blue: #e9edf8;
  --ink-blue: #3e568b;
  --tone-violet: #f2edf4;
  --ink-violet: #70527a;
}
*, *::before, *::after { box-sizing: border-box; }
* { touch-action: pan-x pan-y; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
.icon { width: 17px; height: 17px; flex: none; vertical-align: middle; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 19px 13px 14px; background: var(--sidebar); border-right: 1px solid var(--line);
  overflow: auto; gap: 23px;
}
.nav-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.nav-heading {
  margin: 0 9px 4px; color: var(--muted); font-size: 10px; font-weight: 750;
  letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between;
}
.nav-heading .icon-button { min-height: 24px; padding: 3px; }
.nav-item {
  border: 0; width: 100%; background: transparent; text-align: left; display: flex;
  align-items: center; gap: 9px; border-radius: 7px; min-height: 36px; padding: 7px 9px; color: var(--muted);
}
.nav-item:hover, .icon-button:hover { background: var(--hover); }
.nav-item.active { background: var(--active); color: var(--active-text); font-weight: 700; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item kbd { margin-left: auto; }
kbd { padding: 1px 5px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font: 11px ui-monospace, monospace; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.workspace-account strong, .workspace-account small { display: block; }
.workspace-account small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.workspace-account > .icon:last-child { margin-left: auto; }
.workspace-list { display: grid; gap: 4px; }
.workspace-list .nav-item { min-height: 44px; }
.workspace-list small { margin-left: auto; }
.workspace-drawer-actions { display: grid; gap: 4px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
dialog.workspace-drawer { position: fixed; inset: auto auto 0 0; margin: 0; width: min(380px, 100%); max-width: 100%; max-height: 85dvh; border-radius: 16px 16px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.invitation-link { width: 100%; }
.login-card details { margin-top: 16px; }
.login-card details label { margin-block: 12px; }
.login-card details input { width: 100%; }
.assistant-card {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 10px;
  text-align: left; border-radius: 9px; border: 1px solid var(--edge); background: var(--raised);
}
.assistant-card:hover { border-color: var(--edge-hover); }
.assistant-card strong, .assistant-card small { display: block; }
.assistant-card strong { font-size: 12px; }
.assistant-card small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.assistant-card > .icon { width: 13px; }
.assistant-icon { display: grid; place-items: center; width: 30px; height: 30px; background: var(--tone-lilac); color: var(--accent); border-radius: 7px; }
.topbar {
  height: 53px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 31px; border-bottom: 1px solid var(--line); background: var(--canvas);
}
.crumbs, .actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { text-decoration: underline; }
.crumbs > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .icon { width: 12px; color: var(--muted); }
.crumbs strong { font-weight: 650; }
.icon-button {
  border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--muted); min-height: 33px; padding: 7px;
}
.icon-button.selected { color: var(--gold); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; min-height: 35px;
  border: 1px solid var(--edge); border-radius: 7px; background: var(--raised); font-weight: 650; white-space: nowrap;
}
.button:hover { background: var(--hover); }
.button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: var(--danger); }
.button .icon { width: 15px; height: 15px; }
.mobile-toggle, .sidebar-backdrop { display: none; }
.content { width: min(100% - 78px, 1120px); margin: 34px auto 65px; }
.section { margin-top: 31px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-header h2 { margin: 0; font-size: 19px; font-weight: 740; letter-spacing: -.42px; }
.text-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px;
  border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap;
}
.text-button .icon { width: 14px; height: 14px; }
.text-button:hover { color: var(--accent); text-decoration: underline; }
.table-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table-toolbar { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.table-toolbar a, .table-label { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.table-toolbar a:hover { text-decoration: underline; }
.table-toolbar .icon { color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th, td { border-top: 1px solid var(--line); padding: 7px 13px; height: 42px; white-space: nowrap; }
th { background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 650; }
th:first-child { width: 42%; min-width: 190px; }
th .icon, .row-link .icon { width: 14px; height: 14px; margin-right: 6px; color: var(--muted); }
.row-link { display: inline-flex; align-items: center; font-weight: 650; }
.row-link:hover { text-decoration: underline; }
.table-shell input:not([type=checkbox]), .table-shell select {
  width: 100%; min-width: 104px; max-width: 190px; padding: 4px 5px; border: 1px solid transparent;
  border-radius: 5px; background: transparent;
}
.table-shell input:hover, .table-shell select:hover { border-color: var(--edge); }
.table-shell select { font-size: 12px; width: auto; min-width: 92px; }
.table-shell select[data-tone="0"] { color: var(--ink-lilac); background: var(--tone-lilac); }
.table-shell select[data-tone="1"] { color: var(--ink-gold); background: var(--tone-gold); }
.table-shell select[data-tone="2"] { color: var(--ink-blue); background: var(--tone-blue); }
input[type=checkbox] { accent-color: var(--accent); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 13px; }
.list a + a { border-top: 1px solid var(--line); }
.list a:hover { background: var(--soft); }
.list a small { margin-left: auto; color: var(--muted); }
.empty { color: var(--muted); padding: 20px; margin: 0; }
.entry-title { margin: 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.08; font-weight: 780; letter-spacing: -.055em; }
.entry-icon { display: block; color: var(--muted); margin-bottom: 12px; }
.entry-icon .icon { width: 28px; height: 28px; }
.entry-content { max-width: 960px; }
.document-page { max-width: 740px; margin-top: clamp(42px, 8vh, 108px); padding-left: 28px; }
.entry-heading { margin-bottom: 22px; }
.subtle { color: var(--muted); line-height: 1.6; }
.title-input { width: 100%; background: transparent; border: 0; border-radius: 4px; padding: 4px 0; }
.title-input::placeholder { color: var(--muted); }
.title-input:focus { outline: none; }
.save-status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.page-menu { position: relative; }
.page-menu summary { cursor: pointer; list-style: none; }
.page-menu summary::-webkit-details-marker { display: none; }
.page-menu-list {
  position: absolute; right: 0; z-index: 7; min-width: 150px; padding: 5px;
  border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); box-shadow: 0 9px 24px #27203524;
}
.properties { display: grid; gap: 4px; margin: 0 0 24px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.properties .property-line { display: grid; grid-template-columns: 17px minmax(90px, 118px) minmax(0, 190px); align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.properties input, .properties select { min-width: 0; justify-self: start; }
dialog { border: 1px solid var(--edge); border-radius: 14px; padding: 20px; width: min(490px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 20px 80px #1d271b30; }
dialog::backdrop { background: #222b2266; }
dialog h2 { font-size: 19px; margin: 0; }
dialog .section-header { margin-bottom: 14px; }
dialog form, .login form { display: grid; gap: 12px; }
dialog label, .login label { display: grid; gap: 6px; font-weight: 650; }
dialog input, dialog select, .properties input:not([type=checkbox]), .properties select, .login input {
  border: 1px solid var(--edge); border-radius: 6px; min-height: 36px; padding: 6px 9px; background: var(--surface);
}
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.search-results { max-height: 350px; overflow: auto; margin-top: 12px; }
.search-box { width: 100%; }
.toast { position: fixed; bottom: 18px; right: 18px; z-index: 5; border-radius: 8px; background: #37352f; color: white; padding: 12px 16px; max-width: min(400px, calc(100vw - 36px)); }
.toast.error { background: #863a32; }
.loading { margin: 45px; color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-card { width: min(100%, 420px); border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 28px; }
.login-card img { width: 43px; height: 43px; }
.login-card h1 { font: 500 35px Georgia, serif; margin: 12px 0; letter-spacing: -.04em; }
.login-card a { text-decoration: underline; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 205px minmax(0, 1fr); }
  .content { width: calc(100% - 44px); }
  .topbar { padding-inline: 20px; }
}
@media (max-width: 660px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; top: 50px; left: 0; z-index: 4; width: min(245px, 82vw); height: calc(100dvh - 50px);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 200ms ease, visibility 0s linear 200ms;
  }
  .sidebar.open { transform: translateX(0); visibility: visible; transition-delay: 0s; box-shadow: 10px 0 30px #222b2226; }
  .sidebar-backdrop { display: block; position: fixed; inset: 50px 0 0; z-index: 3; border: 0; padding: 0; background: #0005; }
  .mobile-toggle { display: inline-flex; min-width: 44px; min-height: 44px; flex: none; }
  .mobile-toggle .icon { width: 18px; height: 18px; }
  .topbar { position: sticky; top: 0; z-index: 5; height: 50px; padding-inline: 12px; }
  .content { width: calc(100% - 30px); margin-top: 18px; }
  .topbar .crumb-home { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
.database-description { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.database-description input { flex: 1; min-width: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px; }
.pill { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.pill[data-tone="0"] { color: var(--ink-lilac); background: var(--tone-lilac); }
.pill[data-tone="1"] { color: var(--ink-gold); background: var(--tone-gold); }
.pill[data-tone="2"] { color: var(--ink-blue); background: var(--tone-blue); }

#entry-editor { position: relative; min-width: 0; margin-left: -8px; }
.add-block {
  position: absolute; left: -44px; z-index: 1; width: 24px; height: 28px;
  padding: 0; background: transparent; border: 0; border-radius: 5px; color: var(--muted); font-size: 19px;
}
.add-block:hover, .add-block[aria-expanded=true] { background: var(--hover); color: var(--ink); }
.block-drag-handle {
  position: absolute; left: -18px; width: 26px; padding: 4px; z-index: 2; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.block-drag-handle svg { width: 12px; height: 20px; pointer-events: none; }
.block-drag-handle:hover, .block-drag-handle.holding, .block-drag-handle.dragging { background: var(--hover); color: var(--ink); }
.block-drag-handle.dragging { cursor: grabbing; }
.dragging-block { opacity: .45; outline: 1px dashed var(--focus); }
.block-drop-indicator { position: absolute; left: 8px; right: 0; height: 3px; background: var(--focus); z-index: 7; pointer-events: none; }
.block-drag-preview {
  position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; max-width: 180px; padding: 8px 12px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--focus); border-radius: 7px;
  box-shadow: 0 4px 16px #0003; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-document { position: relative; min-height: 350px; }
.page-document.empty-document::before {
  content: "Start writing, or type / for blocks";
  position: absolute; top: 2px; left: 8px; color: var(--muted); pointer-events: none;
  font-size: 16px; line-height: 1.65;
}
.tiptap {
  position: relative; min-height: 350px; padding: 2px 8px 60px; outline: none;
  word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-size: 16px; line-height: 1.62;
}
.tiptap > :first-child { margin-top: 0; }
.tiptap p { margin: 4px 0; }
.tiptap h1, .tiptap h2, .tiptap h3 { line-height: 1.2; margin: 26px 0 6px; letter-spacing: -.025em; }
.tiptap h1 { font-size: 1.9em; }
.tiptap h2 { font-size: 1.55em; }
.tiptap h3 { font-size: 1.25em; }
.tiptap ul, .tiptap ol { margin: 6px 0; padding-inline-start: 1.65em; }
.tiptap blockquote { margin: 8px 0; padding-inline-start: 13px; border-inline-start: 3px solid var(--edge-hover); }
.tiptap a { color: var(--accent); text-decoration: underline; }
.tiptap code { background: var(--hover); padding: .1em .25em; border-radius: 4px; font: .88em ui-monospace, monospace; }
.tiptap pre { padding: 14px; background: var(--soft); border-radius: 7px; overflow-wrap: anywhere; }
.tiptap pre code { padding: 0; background: transparent; }
.tiptap hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.tiptap .tableWrapper { overflow-x: auto; margin-block: 12px; }
.tiptap table { table-layout: fixed; border-collapse: collapse; width: 100%; font-size: 14px; }
.tiptap td, .tiptap th {
  position: relative; min-width: 72px; width: auto; height: 37px; border: 1px solid var(--edge); padding: 5px 9px;
  vertical-align: top; white-space: normal; overflow-wrap: anywhere; font-size: inherit;
}
.tiptap th { background: var(--soft); color: var(--ink); font-weight: 650; }
.tiptap td > :first-child, .tiptap th > :first-child { margin-top: 0; }
.tiptap .selectedCell::after { content: ""; position: absolute; inset: 0; background: #6487db24; pointer-events: none; }
.tiptap .column-resize-handle { position: absolute; width: 3px; top: 0; bottom: 0; right: -2px; background: var(--focus); pointer-events: none; }
.tiptap.resize-cursor { cursor: col-resize; }
.database-view-block { margin: 18px 0; white-space: normal; font-size: 14px; line-height: normal; }
.database-view-block.ProseMirror-selectednode { outline: 2px solid var(--focus); outline-offset: 3px; }
.tiptap .database-view-block table { table-layout: auto; font-size: 13px; }
.tiptap .database-view-block td, .tiptap .database-view-block th {
  position: static; min-width: 0; width: auto; height: 42px; border: 0; border-top: 1px solid var(--line);
  padding: 7px 13px; vertical-align: middle; white-space: nowrap; overflow-wrap: normal;
}
.tiptap .database-view-block th { color: var(--muted); font-size: 11px; }
.tiptap .database-view-block th:first-child { width: 42%; min-width: 190px; }
.tiptap .database-view-block .row-link { color: inherit; text-decoration: none; }
.tiptap .database-view-block .row-link:hover { text-decoration: underline; }
.editor-popup {
  position: fixed; z-index: 6; background: var(--surface); border: 1px solid var(--edge); border-radius: 9px;
  box-shadow: 0 10px 30px #2320322e; color: var(--ink);
}
.block-menu { display: flex; flex-direction: column; width: min(252px, calc(100vw - 18px)); padding: 6px; }
.editor-popup input {
  width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft);
}
.block-menu > input { flex: none; }
.block-items { display: grid; gap: 2px; margin-top: 5px; min-height: 0; max-height: min(290px, 45vh); overflow: auto; }
.block-items button {
  display: flex; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; padding: 4px; text-align: left;
}
.block-items button span {
  display: grid; place-items: center; width: 28px; height: 27px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--muted); font-size: 11px;
}
.block-items button:hover, .block-items button:focus-visible,
.inline-tools button:hover, .inline-tools button[aria-pressed=true], .table-tools button:hover { background: var(--hover); }
.inline-tools, .link-editor { display: flex; align-items: center; padding: 4px; gap: 2px; }
.inline-tools button, .table-tools button {
  border: 0; border-radius: 5px; background: transparent; padding: 5px 8px; font-size: 12px;
}
.inline-tools button { min-width: 29px; min-height: 28px; }
.link-editor { padding: 6px; width: min(360px, calc(100vw - 18px)); }
.link-editor input { min-width: 0; }
.table-tools {
  position: fixed; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; width: max-content; max-width: calc(100vw - 18px);
  padding: 4px; border-radius: 8px; border: 1px solid var(--edge); background: var(--surface);
  box-shadow: 0 8px 20px #2320321c;
}
.table-tools [data-table^=delete] { color: var(--danger); }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ededeb;
    --muted: #aaa9a5;
    --accent: #83b9f0;
    --line: #373735;
    --canvas: #191919;
    --sidebar: #202020;
    --surface: #202020;
    --raised: #242423;
    --soft: #252524;
    --hover: #323231;
    --active: #393938;
    --active-text: #f5f4f1;
    --edge: #494947;
    --edge-hover: #777773;
    --focus: #73b3f2;
    --primary: #dddcd7;
    --primary-hover: #eeede9;
    --on-primary: #242421;
    --danger: #f1a9a2;
    --gold: #edcc82;
    --tone-lilac: #3a324b;
    --ink-lilac: #d9c7f1;
    --tone-gold: #453d2d;
    --ink-gold: #edcf97;
    --tone-blue: #303a52;
    --ink-blue: #bed0fd;
    --tone-violet: #443447;
    --ink-violet: #e5c8e7;
  }
}

@media (max-width: 660px) {
  .document-page { width: calc(100% - 54px); margin-top: 37px; }
  .topbar { height: 50px; gap: 5px; }
  .topbar .actions { gap: 3px; }
  .save-status { font-size: 10px; }
  .topbar .crumbs { gap: 4px; }
  .entry-heading { margin-bottom: 15px; }
}

.view-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.view-tab { padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); }
.view-tab:hover, .view-tab[aria-pressed=true] { background: var(--hover); color: var(--ink); }
.view-tab[aria-pressed=true] { border-color: var(--line); font-weight: 650; }
.property-button {
  max-width: 210px; padding: 5px 7px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
}
.property-button:hover { border-color: var(--edge); background: var(--soft); }
.property-input, .pill-group { display: inline-flex; align-items: center; gap: 4px; }
.related-records { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.property-link { color: var(--accent); }
.property-link .icon { width: 12px; height: 12px; }
.record-list { border-top: 1px solid var(--line); }
.record-list article { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 10px 13px; }
.record-list article + article { border-top: 1px solid var(--line); }
.record-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 0 12px 12px; }
.record-gallery article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.record-gallery article p { margin-block: 8px 0; }
.record-summary { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; }
.record-gallery .record-summary { margin-top: 8px; }
.calendar-toolbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--line);
}
.calendar-toolbar .actions { gap: 5px; }
.calendar-scroll { overflow-x: auto; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); min-width: 630px; }
.calendar-weekday, .calendar-day { padding: 5px; border-top: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.calendar-weekday { text-align: center; font-weight: 650; color: var(--muted); background: var(--soft); }
.calendar-day { min-height: 94px; }
.calendar-day.outside { color: var(--muted); background: var(--soft); }
.day-top { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
.day-top time { padding: 4px; }
.day-top time[aria-current=date] { background: var(--primary); color: var(--on-primary); border-radius: 5px; }
.day-top .icon-button { min-height: 25px; padding: 4px; }
.calendar-event {
  display: block; color: var(--active-text); background: var(--active); border-radius: 4px; margin: 3px 0;
  font-size: 11px; padding: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-event:hover { text-decoration: underline; }
#linked-databases { display: grid; gap: 12px; }
#linked-databases:not(:empty) { margin-top: 21px; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.form-pair input, .form-pair select, .view-option-row select, [data-rule-value] input { min-width: 0; width: 100%; }
.view-options { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.view-options summary, .filter-choices summary { cursor: pointer; }
.view-option-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: start; margin-bottom: 4px; }
.view-option-row.filter { grid-template-columns: minmax(82px, 1fr) minmax(82px, 1fr) minmax(75px, 1fr) auto; }
.filter-choices { padding: 6px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); }
.filter-choices summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-list { display: grid; gap: 5px; max-height: 195px; overflow: auto; padding: 5px 2px; }
dialog .choice-list label, dialog .inline-check { display: flex; align-items: center; gap: 7px; font-weight: 500; }
dialog .choice-list input, dialog .inline-check input { min-height: unset; width: auto; }
.dialog-error { margin: 0; color: var(--danger); }
.tiptap ul[data-type=taskList] { list-style: none; padding-left: 0; }
.tiptap li[data-type=taskItem] { display: flex; align-items: flex-start; gap: 8px; }
.tiptap li[data-type=taskItem] > label { flex-shrink: 0; padding-top: 3px; }
.tiptap li[data-type=taskItem] > div { flex: 1; min-width: 0; }
.tiptap li[data-type=taskItem][data-checked=true] > div > p:first-child { text-decoration: line-through; color: var(--muted); }
.tiptap li[data-type=taskItem] ul[data-type=taskList] { margin-left: 9px; }
@media (max-width: 510px) {
  .view-option-row.filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .view-option-row.filter > [data-rule-value] { grid-row: 2; grid-column: 1 / 3; }
  .view-option-row.filter > [data-remove-rule] { grid-column: 3; grid-row: 1; }
}

.nav-depth-1 { padding-inline-start: 20px; }
.nav-depth-2 { padding-inline-start: 30px; }
.nav-depth-3 { padding-inline-start: 40px; }
.nav-depth-4 { padding-inline-start: 50px; }

.workspace-empty .button { margin-top: 15px; }

/* Page images and gallery previews */
.image-progress { margin: 0 8px 8px; font-size: 12px; }
.tiptap img {
  display: block; max-width: 100%; width: auto; height: auto; max-height: min(72vh, 780px);
  object-fit: contain; margin: 14px 0; border-radius: 5px; background: var(--soft);
}
.tiptap img.ProseMirror-selectednode { outline: 2px solid var(--focus); outline-offset: 3px; }
.gallery-cover {
  display: block; aspect-ratio: 16 / 9; overflow: hidden; margin: -13px -13px 11px;
  border-radius: 7px 7px 0 0; background: var(--soft); border-bottom: 1px solid var(--line);
}
.gallery-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.option-trigger { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; }
.option-trigger .pill { overflow: hidden; text-overflow: ellipsis; }
.option-sheet { max-height: min(620px, calc(100% - 32px)); background: var(--surface); }
.option-selection, .option-rows { background: var(--soft); border: 1px solid var(--line); border-radius: 9px; }
.option-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 7px 10px; margin-bottom: 14px; }
.option-chip { display: inline-flex; align-items: center; gap: 3px; min-height: 36px; border: none; border-radius: 7px; background: var(--surface); padding: 3px 6px; }
.option-chip .icon { width: 13px; }
.option-form input { font-size: 16px; }
.option-rows { overflow-y: auto; max-height: min(35vh, 300px); }
.option-rows:empty { display: none; }
.option-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 7px 13px; border: 0; background: transparent; text-align: left; }
.option-row + .option-row { border-top: 1px solid var(--line); }
.option-row:hover, .option-chip:hover { background: var(--hover); }
.option-row .pill, .option-chip .pill { font-size: 13px; }
.option-row .icon { color: var(--accent); }
@media (any-pointer: coarse), (max-width: 700px) {
  input:not(.title-input), select, textarea { font-size: 16px; }
  .option-trigger { min-height: 44px; }
  .option-sheet { position: fixed; inset: auto 0 0; margin: 0 auto; width: min(640px, 100%); max-width: 100%; max-height: 86dvh; border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
  .option-sheet::before { content: ''; display: block; width: 30px; height: 4px; border-radius: 4px; margin: 0 auto 10px; background: var(--edge-hover); }
  .option-sheet .section-header .icon-button { min-width: 44px; min-height: 44px; }
}
