#today-desk[hidden], #session-clock[hidden] { display: none; }
#today-desk { grid-column: 2 / -1; min-width: 0; }
body.nb-at-desk .sheet, body.nb-at-desk .library { display: none; }
.mast-actions #quick-search, .mast-actions #session-clock {
  display: inline-flex; gap: .42rem; align-items: center; color: inherit; background: transparent;
  border: 0; font: inherit; cursor: pointer; min-height: 36px;
}
.mast-actions #session-clock { color: #5136a7; font-variant-numeric: tabular-nums; }
.mast-actions #session-clock[hidden] { display: none; }
@media (max-width: 800px) {
  #today-desk { grid-column: 1 / -1; }
  body.nb-at-desk[data-pane="library"] #today-desk { display: none; }
  body.nb-at-desk[data-pane="library"] .library { display: block; }
  .mast-actions #quick-search span { display: none; }
  .mast-actions #quick-search, .mast-actions #session-clock { padding: 4px; }
}
@media (max-width: 470px) {
  body:has(#session-clock:not([hidden])) #sync-label { display: none; }
}

.opening-notebook { display: none; }
body[data-opening] .desk { display: block; background: #faf6ed; }
body[data-opening] .desk > :not(.opening-notebook) { display: none; }
body[data-opening] .opening-notebook { display: block; margin: 0; padding: clamp(32px, 8vw, 100px); color: #615d61; }
.reference-pane { position: sticky; top: 66px; align-self: start; height: calc(100dvh - 66px); overflow: auto; background: #f2ecdf; border-right: 1px solid var(--rule); min-width: 0; }
.reference-pane[hidden], body.nb-at-desk .reference-pane, body.focus-mode .reference-pane { display: none; }
.reference-pane header { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--rule); min-height: 58px; padding: 8px 14px; }
.reference-label { margin-right: auto; font: 600 .72rem var(--mono); color: #42427e; text-transform: uppercase; letter-spacing: .06em; }
.reference-pane header button, #back-to-writing { display: inline-flex; align-items:center; padding: 8px; font-size: .78rem; }
.reference-pane header button:hover, #back-to-writing:hover { background: #e5dece; }
.reference-content { padding: 26px clamp(16px,1.6vw,28px); }
#reference-folder { font: .7rem var(--mono); color: var(--muted); }
#reference-title { font: 400 clamp(26px,2.6vw,44px)/1.12 var(--serif); margin: 10px 0 20px; letter-spacing: -.02em; overflow-wrap: anywhere; }
#reference-body { font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; }
#reference-body :is(h1,h2,h3,h4) { font-size: 1.14rem; line-height: 1.26; }
.reference-choices { max-height: 42dvh; overflow: auto; }
.reference-choices button { text-align: left; }
#back-to-writing { display: none; }
@media(min-width: 801px) { body.has-reference .library { display:none; } }
@media(max-width: 800px) {
  .reference-pane { display:none; position:sticky; top:56px; height:calc(100dvh - 56px); }
  body.has-reference.see-reference:not(.nb-at-desk)[data-pane=write] .reference-pane { display:block; }
  body.has-reference.see-reference:not(.nb-at-desk)[data-pane=write] .sheet { display:none; }
  .reference-pane header { position: sticky; top: 0; background: #f2ecdf; z-index: 1; }
  .reference-pane .reference-label { display: none; }
  #back-to-writing { display:inline-flex; margin-right: auto; min-height: 44px; }
}

.quick-capture-form { display: grid; gap: .75rem; }
.quick-capture-form label { font-weight: 600; }
.quick-capture-form textarea { width: 100%; min-height: 9rem; max-height: 48dvh; resize: vertical; padding: .8rem; font: inherit; line-height: 1.5; color: var(--ink); background: #fffaf0; border: 1px solid var(--rule); border-radius: 3px; }
.quick-capture-form .dialog-actions { align-items: center; }
.quick-capture-form [role=status] { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: .8rem; }
