
  #tkrv-workspace .frame { min-height: 100svh; }


@scope (#tkrv-workspace) {
  :scope {
    color-scheme: light dark;
    --ground: light-dark(#dce2f0, #161b29);
    --page: light-dark(#ffffff, #202638);
    --paper: light-dark(#ffffff, #2c3347);
    --subtle: light-dark(#f1f3fa, #30384e);
    --hover: light-dark(#f2f5fe, #303a54);
    --ink: light-dark(#172038, #f6f8ff);
    --secondary: light-dark(#293448, #dbe3f7);
    --muted: light-dark(#505d77, #b3bfd9);
    --line: light-dark(#e1e7f3, #36425d);
    --strong-line: light-dark(#7985a0, #92a0be);
    --accent: light-dark(#bd382a, #ff8f79);
    --accent-paper: light-dark(#fff0eb, #522f33);
    --accent-ink: light-dark(#ffffff, #292130);
    --paper-shadow: light-dark(#1829520c, #00000030);
    --dialog-shadow: light-dark(#10244c27, #090e1b9b);
    --signal: light-dark(#f04c35, #ff765b);
    --nav-surface: light-dark(#fbfcff, #1e2537);
    font: 15px/1.52 "Avenir Next", "Avenir", system-ui, sans-serif;
    color: var(--ink);
    background: var(--ground);
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { border: 0; background: transparent; cursor: pointer; }
  button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
  button:active { transform: scale(.975); }
  select, input[type="date"] { color-scheme: light dark; }

  .frame { display: grid; grid-template-columns: clamp(174px, 16.7vw, 253px) minmax(0,1fr); gap: 9px; min-height: 696px; padding: 9px 9px 9px 0; background: var(--ground); }
  .sidebar { display: flex; flex-direction: column; align-self: stretch; min-width: 0; background: var(--nav-surface); margin: -9px 0; padding: 18px 0 9px; }
  .brand { display: flex; align-items: center; gap: 8px; margin: 1px 18px 25px; font-size: 13px; font-weight: 650; letter-spacing: .004em; }
  .mark { position: relative; width: 17px; height: 17px; border-radius: 5px; background: var(--signal); }
  .mark::after { content: ""; position: absolute; top: 4px; left: 4px; width: 8px; height: 5px; border: solid var(--page); border-width: 0 0 1.4px 1.4px; transform: rotate(-46deg); }
  .system-links { display: grid; gap: 2px; }
  .space-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 16px; color: var(--secondary); border-radius: 0; text-align: left; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
  .space-item:hover { background: var(--hover); }
  .space-item[aria-current="page"] { color: var(--ink); background: var(--hover); box-shadow: inset 2px 0 var(--signal); font-weight: 600; }
  .nav-count {
    margin-left: auto; padding: 0 4px; min-width: 17px;
    text-align: center; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
  }
  .space-item[data-view="updates"] .nav-count:not(:empty) { background: var(--accent-paper); color: var(--accent); border-radius: 6px; }
  .system-links .identity-mark { flex-basis: 18px; }
  .system-links [aria-current="page"] .identity-mark { color: var(--accent); }
  .side-label { display: flex; align-items: center; justify-content: space-between; min-height: 24px; margin: 22px 0 2px; padding: 0 16px; color: var(--muted); font-size: 12px; font-weight: 550; }
  .folder-heading { display: flex; align-items: center; padding-inline: 8px; }
  .folder-heading .icon-button { flex: 0 0 24px; }
  .folder-title { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; padding: 5px 4px; color: var(--secondary); text-align: left; font-size: 13px; overflow-wrap: anywhere; }
  .folder-chevron { flex: 0 0 8px; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: scale(.78,1) rotate(45deg); }
  .folder-title[aria-expanded="false"] .folder-chevron { transform: scale(.78,1) rotate(-45deg); }
  .folder-list { padding-left: 0; }
  .folder-actions { display: grid; gap: 4px; margin: 0 0 5px 10px; }
  .folder-actions button { text-align: left; }
  .identity-mark { display: inline-grid; flex: 0 0 18px; place-items: center; width: 18px; height: 18px; color: var(--muted); font-size: 15px; line-height: 1; }
  .identity-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
  .project-nav-row { position: relative; }
  .project-nav-row .space-item { padding-left: 44px; }
  .project-nav-icon { position: absolute; top: 50%; left: 12px; width: 25px; height: 25px; translate: 0 -50%; }
  .folder-list .project-nav-row .space-item { padding-left: 57px; }
  .folder-list .project-nav-icon { left: 25px; }
  .heading-title .title-mark { position: absolute; inset: calc((var(--title-line) - 32px) / 2) calc(100% + 7px) auto auto; display: grid; place-items: center; width: 32px; height: 32px; }
  .title-mark .identity-mark { width: 25px; height: 25px; font-size: 22px; }
  #project-export .identity-mark { width: 15px; height: 15px; }
  #project-export { display: inline-flex; align-items: center; gap: 6px; background: transparent; }
  #project-export:hover { background: var(--hover); }
  .identity-picker { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
  .identity-picker legend { padding: 0; color: var(--muted); font-size: 13px; }
  .identity-choices { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .identity-choices button { width: 31px; height: 31px; border: 1px solid var(--line); }
  .identity-choices button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-paper); }

  .workspace { display: grid; align-content: stretch; min-width: 0; }
  .toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-height: 57px; padding: 13px 18px 5px; }

  .toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
  .view-switcher { display: flex; align-items: center; gap: 3px; }
  .view-switcher button { min-height: 28px; padding: 4px 9px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 550; }
  .view-switcher button:hover { background: var(--hover); }
  .view-switcher button[aria-current="page"] { color: var(--ink); background: var(--subtle); font-weight: 675; }
  .quiet-action, .primary-action { min-height: 30px; padding: 5px 10px; border-radius: 6px; background: var(--subtle); color: var(--secondary); font-size: 12px; font-weight: 550; line-height: 1.45; }
  .quiet-action:hover { background: var(--hover); color: var(--ink); }
  .primary-action { background: var(--accent); color: var(--accent-ink); }
  .primary-action:hover { filter: saturate(1.14) contrast(1.05); }
  #quick-create { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 7px; border-radius: 8px; color: var(--ink); text-align: left; font-size: 12px; font-weight: 650; }
  .shortcut { margin-left: auto; color: var(--muted); font: inherit; font-size: 10px; white-space: nowrap; }
  #nav-toggle { display: none; }
  .icon-button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 8px; color: var(--muted); font-size: 17px; line-height: 1; }
  .icon-button:hover { color: var(--ink); background: var(--hover); }

  .spread { display: grid; grid-template-columns: minmax(0,1fr) clamp(208px, 25.8vw, 414px); gap: 9px; align-items: stretch; min-width: 0; min-height: 0; }
  .spread:not(:has(.margin:not([hidden]), .inspector:not([hidden]))) { grid-template-columns: minmax(0,1fr); }
  .spread:has(.inspector:not([hidden])) { grid-template-columns: minmax(0,1fr) clamp(208px, 25.8vw, 414px); }
  .sheet { --sheet-inset: clamp(49px, 4.6vw, 70px); width: 100%; min-width: 0; padding: 24px clamp(23px, 3vw, 46px) 64px var(--sheet-inset); }
  .document-heading { --title-size: clamp(32px, 3.35vw, 41px); --title-line: calc(var(--title-size) * 1.12); display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 24px; }
  h1 { margin: 0; color: var(--ink); font-size: var(--title-size); font-weight: 650; letter-spacing: -.043em; line-height: var(--title-line); overflow-wrap: anywhere; }
  #heading-actions { margin-block: max(0px, calc((var(--title-line) - 30px) / 2)) 0; }
  .margin { position: relative; min-width: 0; min-height: 100%; overflow: hidden; border-radius: 11px; background: var(--subtle); }
  .project-cover { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 57%; }


  #project-outline { position: absolute; top: calc(100% + 7px); right: 0; z-index: 4; display: grid; gap: 1px; width: 184px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: 0 9px 24px var(--dialog-shadow); }
  #project-outline button { padding: 6px 7px; border-radius: 5px; color: var(--secondary); text-align: left; font-size: 13px; overflow-wrap: anywhere; }
  #project-outline button:hover { background: var(--subtle); color: var(--ink); }

  .document-blocks { max-width: 740px; padding-bottom: 100px; }
  .editor-block { position: relative; display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 0 8px; min-height: 30px; margin: 0 -4px 1px -7px; padding: 3px 4px 3px 7px; border-radius: 6px; }
  .editor-block:hover, .editor-block:focus-within { background: var(--hover); }
  .editor-block[data-selected] { background: var(--accent-paper); }
  .editor-block[data-type="heading"] { margin: 26px -4px 5px -7px; }
  .editor-block[data-type="heading"] .block-field { font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.34; }
  .editor-block[data-type="task"] { grid-template-columns: 18px minmax(0,1fr) 23px; }
  .editor-block[data-type="bullet"] { grid-template-columns: 13px minmax(0,1fr); }
  .block-marker { padding: 2px 0; color: var(--muted); text-align: center; }
  .editor-block[data-type="quote"] .block-field { padding-left: 11px; border-left: 2px solid var(--accent); border-radius: 0; color: var(--secondary); }
  .editor-block[data-status="done"] :is(.block-field, .task-open-title), .task-line[data-status="done"] .task-name { color: var(--muted); text-decoration: line-through; }
  .editor-block[data-drop="before"] { box-shadow: 0 -2px var(--accent); }
  .editor-block[data-drop="after"] { box-shadow: 0 2px var(--accent); }
  .block-field { display: block; field-sizing: content; width: 100%; min-width: 0; min-height: 23px; margin: 0; padding: 1px 0; overflow: hidden; overflow-wrap: anywhere; resize: none; border: 0; border-radius: 4px; background: transparent; font-size: 14px; font-weight: 500; line-height: 1.56; }
  .block-field::placeholder { color: var(--muted); opacity: 1; font-size: 12px; font-weight: 475; }
  .block-field:focus-visible { outline: none; }
  .editor-block:has(.block-field:focus-visible) { box-shadow: -2px 0 var(--accent); }
  .block-gutter { position: absolute; top: 3px; right: 100%; display: flex; align-items: center; width: 45px; padding-right: 3px; opacity: 0; pointer-events: none; }
  .editor-block:hover .block-gutter, .editor-block:focus-within .block-gutter, .editor-block:has(.block-menu:not([hidden])) .block-gutter { opacity: 1; pointer-events: auto; }
  .block-gutter .icon-button { flex: 0 0 21px; width: 21px; height: 24px; }
  .block-grip { cursor: grab; }
  .block-grip span { display: block; width: 8px; height: 12px; background: radial-gradient(circle at 2px 2px, currentColor 1px, transparent 1.15px) 0 0 / 4px 4px; }
  .block-menu { position: absolute; inset: calc(100% + 4px) auto auto 5px; z-index: 3; width: 214px; max-width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); box-shadow: 0 10px 30px var(--dialog-shadow); }
  .menu-label { margin: 4px 8px 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .menu-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; font-size: 13px; }
  .menu-option[data-active], .menu-option:hover { background: var(--accent-paper); }
  .menu-icon { width: 16px; color: var(--accent); text-align: center; }

  .task-list { list-style: none; margin: 0; padding: 0; }
  .task-line { position: relative; display: grid; grid-template-columns: 18px minmax(0,1fr) 26px; align-items: start; gap: 8px; min-height: 32px; margin: 0 0 3px -7px; padding: 4px 5px 4px 7px; border-radius: 6px; }
  .task-line:hover, .task-line:focus-within { background: var(--hover); }
  .task-hit-row { cursor: pointer; }
  .task-line[data-selected] { background: var(--accent-paper); }
  .task-title-wrap, .task-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 500; }
  .task-date, .task-origin { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
  .task-date { font-variant-numeric: tabular-nums; }
  :is(.task-date, .task-origin) .identity-mark { flex: 0 0 14px; width: 14px; height: 14px; color: inherit; font-size: 12px; }
  .editor-block[data-today] .task-date { color: var(--secondary); }
  .task-check { appearance: none; display: grid; place-items: center; width: 18px; height: 18px; margin: 3px 0 0; border: 1.4px solid var(--strong-line); border-radius: 6px; background: transparent; cursor: pointer; }
  .task-check:hover { border-color: var(--accent); }
  .task-check:checked { border-color: var(--accent); background: var(--accent); }
  .task-check:checked::after { content: ""; width: 7px; height: 4px; border: solid var(--accent-ink); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg) translateY(-1px); }
  .open-task { opacity: 0; }
  .task-line:hover .open-task, .task-line:focus-within .open-task, .editor-block:hover .open-task, .editor-block:focus-within .open-task, [data-selected] .open-task { opacity: 1; }

  .inspector { --task-inset: 20px; align-self: stretch; min-width: 0; padding: 0 var(--task-inset) 22px; border-radius: 11px; background: var(--page); }
  .task-header { position: relative; margin: 0 calc(-1 * var(--task-inset)); padding: 12px var(--task-inset) 16px; border-radius: 11px 11px 0 0; border-bottom: 1px solid var(--line); background: var(--subtle); }
  .inspector-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 550; }
  #inspector-section { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #task-actions { font-weight: 750; letter-spacing: .03em; }
  .task-heading { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: start; gap: 9px; margin-bottom: 13px; }
  .task-heading .task-check { width: 22px; height: 22px; margin-top: 2px; }
  #task-title { field-sizing: content; width: 100%; min-height: 1.24em; padding: 0; resize: none; border: 0; border-radius: 4px; background: transparent; font-size: clamp(20px,2.05vw,26px); font-weight: 700; letter-spacing: -.031em; line-height: 1.24; }
  .task-stickers { position: relative; display: flex; flex-wrap: wrap; gap: 5px; }
  .task-sticker { position: relative; display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; min-height: 27px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--secondary); font-size: 12px; font-weight: 550; white-space: nowrap; }
  .task-sticker span { overflow: hidden; text-overflow: ellipsis; }
  .task-sticker .identity-mark { flex: 0 0 14px; width: 14px; height: 14px; color: inherit; font-size: 12px; }
  .task-sticker svg { flex: 0 0 14px; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
  .task-sticker[data-empty] { border-style: dashed; border-color: color-mix(in srgb, var(--strong-line) 55%, transparent); color: var(--muted); background: transparent; }
  .task-sticker:is(:hover, [aria-expanded="true"]), .task-sticker:focus-within { border-color: var(--strong-line); }
  .task-sticker[data-value="active"] { color: light-dark(#26468e,#c6d7ff); background: light-dark(#e5edff,#354775); }
  .task-sticker[data-value="done"] { color: light-dark(#286044,#b2e3c7); background: light-dark(#e8f4eb,#28463e); }
  .task-sticker[data-overdue] { color: var(--accent); background: var(--accent-paper); }
  #task-date { position: absolute; inset: 0; height: 100%; opacity: 0; }
  #task-date-sticker:has(#task-date:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
  #task-date-sticker .date-popover { left: min(0px, calc(100cqi - 320px)); right: auto; white-space: normal; }
  .task-stickers { container-type: inline-size; }
  #task-choices, #task-inbox-menu { top: calc(100% + 5px); bottom: auto; left: auto; right: 0; max-width: 100%; }
  #task-choices { width: min(225px, 100%); max-height: 230px; overflow: auto; }
  #task-choices button[aria-pressed="true"] { background: var(--subtle); font-weight: 650; }
  #task-inbox-menu { top: 42px; right: var(--task-inset); width: max-content; }
  select, input[type="date"] { max-width: 100%; min-width: 0; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 12px; }
  .task-description { padding: 14px 0 8px 27px; }
  .task-description .block-gutter { width: 43px; padding-right: 1px; }
  .task-description .block-gutter .icon-button { flex-basis: 20px; width: 20px; }
  .task-description .editor-block[data-type="heading"] { margin-top: 12px; }
  .task-description .editor-block[data-type="task"] { grid-template-columns: 18px minmax(0,1fr); }

  .task-discussion { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 15px; }
  .discussion-heading { display: flex; align-items: baseline; gap: 7px; margin-bottom: 10px; }
  .discussion-heading h2 { margin: 0; font-size: 16px; font-weight: 650; }
  #comment-count, .comment-time { color: var(--muted); font-size: 11px; }
  .comment-entry { margin: 0 0 13px; min-width: 0; }
  .comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
  .comment-author { font-size: 12px; font-weight: 680; }
  .comment-body, #comment-editor { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
  .comment-body { margin-top: 3px; }
  .comment-body :is(p,div,blockquote,ul,ol), #comment-editor :is(p,div,blockquote,ul,ol) { margin: 3px 0; }
  .comment-body :is(ul,ol), #comment-editor :is(ul,ol) { padding-left: 20px; }
  .comment-body blockquote, #comment-editor blockquote { padding-left: 8px; border-left: 2px solid var(--strong-line); color: var(--secondary); }
  .comment-body a, #comment-editor a { color: var(--accent); text-underline-offset: 2px; }
  .comment-answer { margin-top: 4px; padding: 2px 0; color: var(--muted); font-size: 11px; }
  .comment-answer:hover { color: var(--accent); }
  .comment-thread { border-left: 1px solid var(--line); margin: 7px 0 0 4px; padding-left: 10px; }
  .comment-thread .comment-thread { border: 0; margin-left: 0; padding-left: 0; }
  .comment-reply { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 3px 0; color: var(--muted); font-size: 12px; }
  .comment-compose { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
  .comment-compose:focus-within { border-color: var(--strong-line); }
  .comment-tools { display: flex; flex-wrap: wrap; gap: 1px; padding: 4px; border-bottom: 1px solid var(--line); }
  .comment-tools .icon-button { width: 23px; height: 24px; font-size: 13px; }
  .comment-tools .icon-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-paper); }
  .comment-link-row { display: flex; align-items: center; gap: 5px; padding: 6px 5px 0; }
  #comment-url { flex: 1; min-width: 0; padding: 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--page); font-size: 12px; }
  #comment-editor { min-height: 61px; padding: 8px 8px 6px; outline: none; }
  #comment-editor:empty::before { content: "Написать комментарий…"; color: var(--muted); pointer-events: none; }
  .comment-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; padding: 4px 5px 6px; }
  .comment-footer #comment-attach { background: transparent; padding-inline: 4px; font-size: 11px; }
  .comment-footer .primary-action { min-height: 28px; padding: 4px 8px; font-size: 11px; }
  .comment-footer .primary-action:disabled { opacity: .5; cursor: default; }
  .comment-files { display: grid; gap: 3px; list-style: none; margin: 4px 0; padding: 0; font-size: 12px; }
  #comment-pending-files { margin-inline: 7px; }
  .comment-files li { display: flex; align-items: center; gap: 5px; min-width: 0; }
  .comment-files a, .comment-file-name { min-width: 0; overflow-wrap: anywhere; }
  .comment-files a { color: var(--accent); text-underline-offset: 2px; }
  .file-size { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
  .comment-files .icon-button { width: 19px; height: 19px; flex: 0 0 auto; font-size: 14px; }

  .section-note { margin: 3px 0 11px; color: var(--muted); font-size: 14px; }
  .system-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 17px; }
  .system-controls [aria-pressed="true"] { background: var(--accent-paper); color: var(--accent); }
  .date-caption { color: var(--muted); font-size: 13px; }
  .search-field { width: min(100%, 190px); padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 13px; }
  .task-group { margin-bottom: 19px; }
  .task-group summary { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
  .board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
  .board-column { min-width: 0; }
  .board-column h2, .week-day h2 { margin: 0 0 8px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.019em; }
  .board-column h2 { padding: 0 0 7px; border-bottom: 1px solid var(--line); }
  .board-column[data-drop] h2 { border-color: var(--accent); color: var(--accent); }
  .task-card { display: block; width: 100%; margin: 2px 0; padding: 7px; border-radius: 7px; text-align: left; overflow-wrap: anywhere; }
  .task-card:hover, .task-card[data-selected] { background: var(--accent-paper); }
  .task-card-title { padding: 0; text-align: left; overflow-wrap: anywhere; }
  .week-grid { display: grid; grid-template-columns: repeat(8,minmax(136px,1fr)); overflow-x: auto; padding-bottom: 9px; }
  .week-day { min-height: 280px; padding: 9px; border-right: 1px solid var(--line); }
  .week-day:first-child { padding-left: 0; }
  .week-day:last-child { border: 0; }
  .week-day[data-current] h2 { color: var(--accent); }
  .week-day[data-drop] { border-radius: 8px; background: var(--accent-paper); }
  .week-day select { width: 100%; margin-bottom: 8px; }
  .week-day .task-line { grid-template-columns: 16px minmax(0,1fr) 20px; gap: 6px; margin-left: 0; padding-inline: 3px; font-size: 13px; }
  .week-day .open-task { width: 20px; }
  .week-day .quiet-action { margin-bottom: 5px; }

  .update-list, .list-catalog { display: grid; }
  .update-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: start; gap: 9px 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .unread-dot { width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--accent); }
  .update-row:not([data-unread]) .unread-dot { visibility: hidden; }
  .update-main { display: block; width: 100%; padding: 0; text-align: left; overflow-wrap: anywhere; }
  .update-main strong { display: block; font-weight: 650; font-size: 15px; }
  .update-context { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--muted); font-size: 13px; }
  .update-main strong .identity-mark { width: 15px; height: 15px; margin-right: 5px; vertical-align: -.15em; font-size: 13px; }
  .row-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
  .catalog-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .catalog-row select { max-width: 115px; }
  .catalog-open { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0; text-align: left; overflow-wrap: anywhere; }
  .catalog-name { display: flex; min-width: 0; align-items: center; gap: 3px; }
  .catalog-name .catalog-open { flex: 1; }
  .catalog-name .icon-button { flex: 0 0 24px; }
  .catalog-star[aria-pressed="true"] { color: var(--accent); }
  #workspace-dialog { width: min(390px,calc(100% - 28px)); max-width: none; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 55px var(--dialog-shadow); }
  #workspace-dialog::backdrop { background: #29213555; }
  #workspace-dialog h2 { margin: 0 0 11px; font-size: 23px; font-weight: 700; letter-spacing: -.035em; }
  #workspace-dialog label { display: grid; gap: 4px; margin: 9px 0; color: var(--muted); font-size: 13px; }
  #workspace-dialog input:not([type="checkbox"]) { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
  #workspace-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 15px; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }


  .primary-pane { min-width: 0; border-radius: 11px; background: var(--page); }
  .capture-dock { margin-top: auto; padding: 13px 12px 2px; border-top: 1px solid var(--line); }
  #quick-create:hover { background: var(--hover); }
  #quick-create > span:nth-child(2) { white-space: nowrap; }
  .capture-plus { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: var(--accent-paper); color: var(--accent); font-size: 19px; font-weight: 575; line-height: 1; }
  #mobile-quick-create { display: none; }
  .outline-control { position: relative; }
  .outline-control summary { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--subtle); color: var(--secondary); cursor: pointer; list-style: none; }
  .outline-control summary::-webkit-details-marker { display: none; }
  .outline-control summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .outline-control summary:hover, .outline-control[open] summary { background: var(--hover); }
  .outline-control summary span { width: 13px; height: 8px; border-block: 1px solid; position: relative; }
  .outline-control summary span::before { position: absolute; content: ""; width: 13px; top: 3px; border-top: 1px solid; }
  .editor-block[data-type="task"] .task-check { grid-column: 1; grid-row: 1; }
  .editor-block[data-type="task"] :is(.block-field, .task-open-title) { grid-column: 2; grid-row: 1; }
  .task-open-title { display: block; width: fit-content; max-width: 100%; padding: 1px 0; border-radius: 4px; text-align: left; line-height: 1.56; }
  .task-open-title:hover { text-decoration: underline; text-underline-offset: 2px; }
  [data-status="done"] .task-open-title:hover { text-decoration-line: line-through underline; }
  .editor-block[data-type="task"] .open-task { grid-column: 3; grid-row: 1; }
  .editor-block[data-type="task"] .task-meta { grid-column: 2 / -1; grid-row: 2; padding-bottom: 2px; }
  .task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; margin-top: 3px; }
  .row-sticker { min-height: 23px; padding: 2px 6px; border-radius: 5px; gap: 4px; font-size: 11px; line-height: 1.35; }
  .row-sticker.date-field input { position: absolute; inset: 0; height: 100%; opacity: 0; }
  .row-sticker.date-field:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .capture-menu.floating-sticker-menu, .date-popover.floating-sticker-menu { position: fixed; inset: auto; z-index: 20; max-width: calc(100vw - 16px); max-height: min(230px, calc(100vh - 16px)); overflow: auto; }
  .floating-sticker-menu button[aria-pressed="true"] { background: var(--subtle); font-weight: 650; }
  .date-popover.floating-sticker-menu { max-height: calc(100vh - 16px); white-space: normal; }
  .week-day .task-name { font-size: 13px; }


  .heading-title { position: relative; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 11px; min-width: 0; }
  #heading-date { color: var(--muted); font-size: 15px; font-weight: 550; white-space: nowrap; }
  .day-controls { display: flex; align-items: center; gap: 2px; }
  .date-step { display: inline-grid; place-items: center; width: 30px; min-height: 30px; padding: 0; background: transparent; }
  .date-step .identity-mark { width: 16px; height: 16px; }
  .inline-create { display: flex; align-items: center; gap: 8px; margin: 18px 0 21px -3px; padding: 3px; color: var(--muted); text-align: left; font-size: 13px; }
  .inline-create:hover { color: var(--accent); }
  .inline-plus { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 6px; font-size: 15px; line-height: 1; }
  .task-group summary::-webkit-details-marker { display: none; }
  .task-group summary::before { content: ""; width: 5px; height: 5px; margin-right: 3px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(-45deg); }
  .task-group[open] summary::before { transform: translateY(-1px) rotate(45deg); }
  .group-count { color: var(--muted); font-size: 11px; font-weight: 500; }
  .task-group[data-overdue] summary span:first-child { color: var(--accent); }
  .system-controls button[aria-pressed="false"] { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
  .system-controls button[aria-pressed="true"] { background: var(--subtle); color: var(--ink); }
  .system-controls button:hover { background: var(--hover); }
  .editor-block[data-selected], .task-line[data-selected] { box-shadow: inset 2px 0 var(--signal); background: var(--hover); }

  .create-anchor { position: relative; }
  .capture-menu {
    position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 7;
    display: grid; gap: 2px; width: 174px; padding: 5px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: 0 9px 22px var(--dialog-shadow);
  }
  .capture-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 7px;
    border-radius: 5px; text-align: left; color: var(--ink); font-size: 13px;
  }
  .capture-menu button:hover, .capture-menu button:focus-visible { background: var(--hover); }
  .capture-menu-icon { flex: 0 0 16px; color: var(--accent); text-align: center; }
  .toolbar .capture-menu { inset: calc(100% + 6px) 0 auto auto; }
  .date-field { position: relative; min-width: 0; }
  .date-field input { width: 100%; cursor: pointer; }
  .date-popover {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 8; width: min(232px, calc(100vw - 24px));
    padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
    box-shadow: 0 9px 24px var(--dialog-shadow); color: var(--ink); font-size: 12px;
  }
  .date-popover-heading, .date-popover-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
  .date-month { font-weight: 650; }
  .date-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); margin: 6px 0; text-align: center; gap: 2px; }
  .date-weekday { align-self: center; padding: 2px 0; color: var(--muted); font-size: 10px; }
  .date-day { min-height: 27px; padding: 0; border-radius: 5px; font-variant-numeric: tabular-nums; }
  .date-day:hover { background: var(--hover); }
  .date-day[data-current] { color: var(--accent); }
  .date-day[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
  .date-popover-footer .quiet-action { min-height: 25px; padding: 3px 6px; font-size: 11px; }
  #workspace-dialog:has(.date-popover) { overflow: visible; }

  @media (max-width: 1130px) {
    .shortcut { display: none; }
  }
  @media (min-width: 741px) and (max-width: 930px) {
    .frame { grid-template-columns: 147px minmax(0,1fr); gap: 7px; }
    .spread, .spread:has(.inspector:not([hidden])) { grid-template-columns: minmax(0,1fr) 180px; gap: 7px; }
    .spread:not(:has(.margin:not([hidden]), .inspector:not([hidden]))) { grid-template-columns: minmax(0,1fr); }
    .shortcut { display: none; }
  }
  @media (max-width: 740px) {
    .frame { grid-template-columns: minmax(0,1fr); min-height: 555px; padding: 5px; gap: 5px; border-radius: 12px; }
    .sidebar, .margin { display: none; }
    .sidebar { margin: 0; }
    .heading-title { gap: 4px 8px; }
    .frame[data-nav-open] .sidebar { display: flex; padding: 9px 8px; }
    .frame[data-nav-open] .sidebar .brand, .capture-dock { display: none; }
    #nav-toggle, #mobile-quick-create { display: inline-block; }
    .toolbar { min-height: 53px; justify-content: space-between; padding: 9px 10px 3px; gap: 6px; }
    .toolbar-actions { justify-content: flex-end; gap: 5px; }
    .view-switcher button { padding-inline: 6px; }
    #mobile-quick-create { white-space: nowrap; }
    .spread, .spread:has(.inspector:not([hidden])) { grid-template-columns: minmax(0,1fr); gap: 0; }
    .spread:has(.inspector:not([hidden])) { grid-template-rows: auto minmax(0,1fr); }
    .spread:has(.inspector:not([hidden])) .sheet { display: none; }
    .sheet { --sheet-inset: 41px; padding: 20px 16px 46px var(--sheet-inset); }
    .document-heading { --title-size: 29px; margin-bottom: 20px; }
    .heading-title .title-mark { right: calc(100% + 5px); }
    .title-mark .identity-mark { width: 22px; height: 22px; font-size: 20px; }
    .inspector { --task-inset: 15px; min-height: 440px; margin-top: 5px; }
    .task-description { padding-left: 35px; }
    .block-gutter { width: 36px; padding-right: 0; }
    .block-gutter .icon-button { flex-basis: 18px; width: 18px; }
    .open-task { opacity: 1; }
    .board, .week-grid { grid-template-columns: minmax(0,1fr); }
    .week-day[data-mobile-hide] { display: none; }
    .week-day { min-height: 100px; padding-inline: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  }
  @media (max-width: 360px) {
    .toolbar { gap: 4px; padding-inline: 8px; }
    .toolbar-actions { gap: 4px; }
    .view-switcher button { padding-inline: 4px; font-size: 11px; }
    .outline-control summary { width: 25px; }
    #nav-toggle, #mobile-quick-create { padding-inline: 8px; }
    .document-heading { --title-size: 27px; column-gap: 8px; }
    #heading-date { font-size: 12px; }
    #project-export-label { display: none; }
    .date-step { width: 26px; }
  }
  @media (pointer: coarse) {
    .open-task, .editor-block .block-gutter { opacity: 1; pointer-events: auto; }
  }
}

#workspace-feedback { padding: 4px 10px; margin: 0; background: #fff0eb; color: #9a3127; }
