/* Size Docs to its available workspace, including when the main sidebar is open. */
.docs-library,
.docs-editor {
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
}
.docs-library *,
.docs-editor * {
  box-sizing: border-box;
}
.docs-editor-top,
.docs-editor-meta {
  flex-wrap: wrap;
  gap: 10px;
}
.docs-editor-top > *,
.docs-title-row > *,
.docs-library-actions > *,
.docs-list-toolbar > * {
  min-width: 0;
}
.docs-title-row,
.docs-rich-toolbar,
.docs-paper,
.docs-files,
.docs-recents {
  min-width: 0;
  max-width: 100%;
}
.docs-editor:not(.docs-editor-board) .docs-title-row,
.docs-editor:not(.docs-editor-board) .docs-paper,
.docs-editor .docs-rich-toolbar {
  width: 100%;
  max-width: 1240px;
}
.docs-library-actions,
.docs-create-actions {
  flex-wrap: wrap;
}
.docs-create-actions .btn {
  white-space: normal;
}
.docs-file-name strong,
.docs-recent-card strong,
.docs-breadcrumb strong {
  overflow-wrap: anywhere;
}
.docs-rich-toolbar {
  flex-wrap: wrap;
  height: auto;
}
.docs-rich-toolbar .btn {
  flex-shrink: 0;
}
.doc-block-text,
.doc-media,
.doc-ink-block {
  min-width: 0;
  max-width: 100%;
}
.doc-media img,
.doc-ink-block svg {
  max-width: 100%;
}
.docs-native-board {
  width: 100%;
  min-height: 360px;
  height: clamp(440px, 72dvh, 950px);
}
.docs-text-dialog,
.docs-library-dialog {
  max-width: calc(100vw - 24px);
}
.docs-notes-dialog {
  overscroll-behavior: contain;
}
.docs-notes-dialog > .modal-head {
  position: sticky;
  top: -26px;
  background: white;
  z-index: 4;
  padding-block: 12px;
}
.docs-notes-result,
.docs-notes-workspace,
.docs-notes-sheet {
  min-width: 0;
}
.docs-notes-dialog .modal-actions {
  flex-wrap: wrap;
}
@container (max-width: 860px) {
  .docs-library-layout {
    grid-template-columns: 155px minmax(0, 1fr);
    gap: 14px;
  }
  .docs-file-header,
  .docs-file-row {
    grid-template-columns: minmax(0, 1fr) 65px 24px;
    gap: 8px;
  }
  .docs-file-header > span:nth-child(2),
  .docs-file-location {
    display: none;
  }
  .docs-files {
    padding: 16px 12px;
  }
  .docs-editor-meta {
    margin-left: auto;
  }
  .docs-editor:not(.docs-editor-board) .docs-paper {
    padding: 24px 38px 50px;
  }
}
@container (max-width: 580px) {
  .docs-library-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-tree {
    position: static;
    max-height: 190px;
    overflow: auto;
    border: 1px solid #e0e6da;
    border-radius: 12px;
    padding: 10px;
  }
  .docs-library-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .docs-create-actions {
    width: 100%;
    gap: 8px;
  }
  .docs-create-actions .btn {
    flex: 1 1 100px;
    min-height: 42px;
  }
  .docs-list-toolbar .filter-tabs {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }
  .docs-files .docs-search {
    flex-basis: 100%;
    max-width: none;
  }
  .docs-recent-card {
    flex-basis: min(230px, 80cqw);
  }
  .docs-editor-top {
    align-items: center;
  }
  .docs-editor-meta {
    flex: 1;
    justify-content: flex-end;
  }
  .docs-editor-meta .btn {
    padding: 9px 10px;
    min-height: 40px;
  }
  .docs-title-row {
    gap: 10px;
  }
  .docs-title {
    font-size: clamp(21px, 5cqw, 29px);
    letter-spacing: -0.5px;
  }
  .docs-rich-toolbar {
    position: relative;
    top: auto;
    padding: 10px;
    gap: 8px;
  }
  .docs-rich-toolbar .btn,
  .docs-rich-toolbar select {
    min-height: 38px;
  }
  .docs-rich-toolbar [data-rich-count] {
    width: 100%;
  }
  .docs-editor:not(.docs-editor-board) .docs-paper {
    padding: 20px 27px 38px;
    border-radius: 12px;
  }
  .docs-writing-help {
    margin-bottom: 24px;
  }
  .doc-block-heading1 .doc-block-text {
    font-size: 24px;
  }
  .docs-native-board {
    height: max(420px, calc(100dvh - 220px));
    min-height: 0;
    margin: 0;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .docs-notes-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-notes-result textarea {
    min-height: 100px;
    max-height: 220px;
  }
}
@media (max-width: 760px) {
  .docs-notes-dialog,
  .docs-notes-dialog.docs-notes-expanded {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 12px;
  }
  .docs-notes-dialog > .modal-head {
    top: -12px;
    margin: 0;
    padding: 12px 4px;
  }
  .docs-notes-dialog > p {
    font-size: 11px;
    line-height: 1.5;
    margin: 8px 0;
  }
  .docs-notes-dialog .docs-ink-tools {
    gap: 8px;
    padding: 8px 0;
  }
  .docs-notes-dialog .docs-ink-tools label {
    min-height: 36px;
    font-size: 11px;
  }
  .docs-notes-dialog .docs-ink-tools .btn {
    min-height: 36px;
    padding: 7px 10px;
  }
  .docs-notes-workspace {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-notes-hint {
    font-size: 10px;
    padding: 9px;
  }
  .docs-notes-result {
    padding: 12px;
  }
  .docs-notes-result textarea {
    min-height: 110px;
    font-size: 18px;
  }
  .docs-notes-dialog .modal-actions {
    gap: 8px;
  }
  .docs-notes-dialog .modal-actions .btn {
    flex: 1 1 145px;
    min-height: 44px;
  }
  .docs-library-dialog input,
  .docs-text-dialog input[type="text"] {
    font-size: 16px;
  }
}
@media (max-width: 420px) {
  .docs-editor-top {
    gap: 8px;
  }
  .docs-editor-meta .docs-save-state {
    width: 100%;
    text-align: right;
  }
  .docs-rich-toolbar label {
    flex: 1 1 130px;
  }
  .docs-rich-toolbar label select {
    max-width: none;
    width: 100%;
  }
}
