/* A persistent explorer and independent reading pane. */
.documents-view .topbar { min-height: 65px; padding: 12px 22px; }
.documents-view .topbar h1 { margin: 0; font-size: 19px; font-weight: 700; color: #252329; }
.documents-view #breadcrumb { display: none; }
.documents-view #top-actions button { font-size: 12px; padding: 7px 11px; }
.documents-view #content { padding: 0; min-height: 0; display: flex; overflow: hidden; }
.documents-workbench { --explorer-width: 264px; display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; min-height: 0; min-width: 0; position: relative; background: #fff; color: #33333b; }
.documents-workbench.explorer-open { grid-template-columns: var(--explorer-width) 4px minmax(0, 1fr); }
.documents-workbench [hidden] { display: none !important; }
.documents-workbench button { transition: none; }
.documents-workbench :focus-visible { outline: 2px solid #4486bd; outline-offset: -2px; }
.document-explorer { display: none; flex-direction: column; min-height: 0; min-width: 0; background: #f5f5f7; border-right: 1px solid #e6e5e9; }
.explorer-open > .document-explorer { display: flex; }
.document-explorer-heading { min-height: 44px; padding: 0 12px 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.document-explorer-heading h2 { margin: 0; font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 650; color: #66636c; }
.document-explorer-actions { display: flex; gap: 2px; }
.document-explorer-actions .icon-button { width: 25px; height: 25px; }
.document-explorer-actions .chat-icon { width: 15px; height: 15px; }
.document-explorer-close { display: none; }
.document-filter { display: flex; align-items: center; position: relative; margin: 0 12px 12px; }
.document-filter > .chat-icon { position: absolute; left: 9px; width: 14px; height: 14px; color: #8a8690; pointer-events: none; }
.document-filter input { width: 100%; min-width: 0; padding: 7px 8px 7px 29px; border: 1px solid #e0dee5; border-radius: 5px; background: #fff; font-size: 12px; line-height: 18px; }
.document-filter input::placeholder { color: #96919c; }
.document-filter input:focus { border-color: #4486bd; box-shadow: none; }
.document-tree { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; overscroll-behavior: contain; scrollbar-width: thin; }
.document-tree-item { outline: 0; }
.document-tree-row { display: flex; align-items: center; gap: 6px; min-height: 31px; padding: 5px 12px 5px calc(10px + var(--depth) * 15px); cursor: pointer; border-left: 2px solid transparent; font-size: 12px; line-height: 20px; user-select: none; }
.document-tree-row:hover { background: #eae9ed; }
.document-tree-item[aria-selected=true] > .document-tree-row { background: #e3edf8; color: #18568c; border-left-color: #4183bd; }
.document-tree-item:focus-visible { outline: none; }
.document-tree-item:focus-visible > .document-tree-row { outline: 1px solid #4486bd; outline-offset: -1px; }
.document-tree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-tree-row > .chat-icon { width: 16px; height: 16px; }
.document-file-icon { color: #497da7; }
.document-folder-icon { color: #aa8854; }
.document-chevron { width: 12px; height: 18px; display: flex; align-items: center; flex: none; color: #7c7582; }
.document-chevron .chat-icon { width: 12px; height: 12px; }
.document-tree-item[aria-expanded=true] > .document-tree-row .document-chevron { transform: rotate(90deg); }
.document-tree-empty { margin: 4px 16px; font-size: 12px; color: #827c88; }
.document-explorer-count { border-top: 1px solid #e8e6ec; padding: 10px 16px; font-size: 11px; color: #827c88; }
.document-divider { display: none; position: relative; z-index: 2; cursor: col-resize; background: #f5f5f7; touch-action: none; }
.explorer-open > .document-divider { display: block; }
.document-divider:hover, .document-divider:focus, .resizing-explorer .document-divider { background: #4486bd; }
.resizing-explorer, .resizing-explorer * { cursor: col-resize !important; user-select: none !important; }
.document-viewer { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.document-tabbar { min-height: 43px; display: flex; align-items: stretch; border-bottom: 1px solid #e8e6ec; background: #f5f5f7; gap: 0; }
.document-tabbar > .icon-button { align-self: center; margin: 0 7px; flex: none; }
.document-tab { display: flex; align-items: center; gap: 9px; padding: 0 8px 0 13px; max-width: calc(100% - 46px); border-top: 2px solid #4486bd; border-left: 1px solid #e8e6ec; border-right: 1px solid #e8e6ec; background: #fff; margin-bottom: -1px; font-size: 12px; }
.document-tab > .chat-icon { width: 15px; height: 15px; color: #497da7; }
.document-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-tab .icon-button { width: 23px; height: 23px; margin-left: 12px; flex: none; }
.document-tab .icon-button .chat-icon { width: 14px; height: 14px; }
.document-tab-empty { background: transparent; border-color: transparent; color: #827c88; }
.document-viewer-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 47px; border-bottom: 1px solid #efedf1; }
.document-breadcrumbs { display: flex; gap: 7px; align-items: center; min-width: 0; flex: 1; font-size: 11px; color: #7c7582; overflow: hidden; }
.document-breadcrumbs span { flex-shrink: 0; white-space: nowrap; }
.document-breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; color: #4f4855; }
.document-path-separator { color: #a39da8; }
.document-viewer-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.document-modes { display: flex; background: #f1f0f4; padding: 2px; border: 1px solid #e8e6ec; border-radius: 5px; }
.document-modes .document-mode { border: 0; border-radius: 3px; background: transparent; font-size: 11px; padding: 4px 8px; color: #7c7484; }
.document-modes .document-mode[aria-pressed=true] { background: #fff; color: #2d2734; box-shadow: 0 1px 3px #25202d12; }
.document-viewer-actions > .icon-button { width: 25px; height: 26px; }
.document-viewer-actions .document-edit { padding: 5px 11px; font-size: 11px; border-radius: 5px; border-color: #dcd8e2; color: #54445f; }
.document-scroll { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; scrollbar-width: thin; }
.document-statusbar { display: flex; gap: 15px; justify-content: space-between; min-height: 29px; padding: 7px 17px; background: #fbfafc; border-top: 1px solid #eae7ee; font-size: 10px; color: #938a9c; }
.document-revision { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.document-welcome { margin: auto; max-width: 390px; padding: 100px 25px 35px; text-align: center; color: #8a8392; }
.document-welcome > .chat-icon { width: 60px; height: 60px; stroke-width: .9; color: #bab3c4; margin-bottom: 10px; }
.document-welcome h2 { color: #4d435a; font-size: 20px; letter-spacing: -.35px; font-weight: 550; margin-bottom: 10px; }
.document-welcome p { font-size: 13px; line-height: 1.8; }
.document-welcome button { margin-top: 15px; font-size: 12px; }
.document-markdown { width: 100%; max-width: 880px; padding: 28px 42px 60px; margin: 0 auto; color: #38343e; font: 14px/1.8 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; white-space: normal; overflow-wrap: anywhere; }
.document-markdown > :first-child { margin-top: 0; }
.document-markdown h1, .document-markdown h2, .document-markdown h3, .document-markdown h4, .document-markdown h5, .document-markdown h6 { color: #2d2735; line-height: 1.4; font-weight: 650; scroll-margin-top: 24px; }
.document-markdown h1 { font-size: 29px; letter-spacing: -.7px; border-bottom: 1px solid #eae7ed; padding-bottom: 18px; margin: 0 0 24px; }
.document-markdown h2 { font-size: 21px; margin: 32px 0 13px; letter-spacing: -.35px; }
.document-markdown h3 { font-size: 17px; margin: 25px 0 10px; }
.document-markdown p { margin: 0 0 17px; }
.document-markdown a { color: #2671a9; text-decoration: underline; text-decoration-color: #2671a948; text-underline-offset: 3px; }
.document-markdown a:hover { text-decoration-color: currentColor; }
.document-markdown ul, .document-markdown ol { padding-left: 24px; margin: 10px 0 18px; }
.document-markdown li { padding-left: 3px; margin: 4px 0; }
.document-markdown li > ul, .document-markdown li > ol { margin: 5px 0; }
.document-markdown :not(pre) > code { font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 5px; background: #f2f0f5; color: #705b84; border: 1px solid #eae6ef; border-radius: 4px; white-space: pre-wrap; }
.document-code-block { border: 1px solid #e7e4ed; border-radius: 6px; background: #f8f7fa; overflow: hidden; margin: 19px 0 23px; }
.document-code-language { display: block; border-bottom: 1px solid #eae7ef; padding: 5px 15px; color: #9a8fa5; font-size: 10px; }
.document-code-block pre { padding: 15px 17px; margin: 0; overflow-x: auto; font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; color: #544965; }
.document-code-block code { font: inherit; }
.document-markdown blockquote { border-left: 3px solid #b5a6c4; margin: 18px 0; padding: 7px 17px; background: #faf8fc; color: #7b6a8c; white-space: pre-line; }
.document-markdown hr { border: 0; border-top: 1px solid #e8e4ed; margin: 28px 0; }
.document-table { overflow-x: auto; margin: 19px 0 24px; border: 1px solid #e6e2eb; border-radius: 5px; }
.document-table table { font-size: 12px; }
.document-table th { padding: 9px 13px; text-transform: none; letter-spacing: 0; font-size: 12px; color: #63596f; background: #f8f6fa; font-weight: 600; }
.document-table td { padding: 10px 13px; border-color: #eae6ef; }
.document-checklist-item { list-style: none; margin-left: -20px !important; }
.document-checklist-item input { width: 13px; height: 13px; margin: 0 8px 0 0; accent-color: #477f65; vertical-align: middle; }
.document-empty-body { color: #96909d; }
.document-source { display: flex; align-items: flex-start; margin: 0; min-height: 100%; width: max-content; min-width: 100%; padding: 22px 28px 40px 0; font: 12px/22px ui-monospace, SFMono-Regular, Consolas, monospace; color: #4b4560; white-space: pre; tab-size: 4; }
.document-source pre { margin: 0; font: inherit; }
.document-source-numbers { min-width: 53px; padding: 0 17px 0 15px; margin-right: 19px !important; text-align: right; color: #b7b0bf; border-right: 1px solid #f0edf4; user-select: none; position: sticky; left: 0; background: #fff; }
.document-explorer-backdrop { display: none; }
@media (max-width: 1100px) {
  .document-viewer-toolbar { flex-wrap: wrap; gap: 8px; padding: 8px 13px; }
  .document-breadcrumbs { flex-basis: 100%; }
  .document-viewer-actions { margin-left: auto; }
  .document-markdown { padding: 25px 25px 45px; }
}
@media (max-width: 900px) {
  .documents-workbench.explorer-open { grid-template-columns: minmax(0, 1fr); }
  .document-explorer { position: absolute; left: 0; top: 0; bottom: 0; width: min(290px, calc(100% - 38px)); z-index: 5; box-shadow: 5px 0 18px #28203418; }
  .explorer-open > .document-divider { display: none; }
  .document-explorer-close { display: inline-flex; }
  .explorer-open > .document-explorer-backdrop { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: #30283929; z-index: 4; }
}
@media (max-width: 700px) {
  .documents-view .topbar { min-height: 58px; padding: 12px 13px; }
  .documents-view .topbar h1 { font-size: 17px; }
  .documents-view #top-actions button { font-size: 10px; padding: 6px 8px; }
  .document-markdown { padding: 22px 18px 40px; font-size: 13px; }
  .document-markdown h1 { font-size: 24px; }
  .document-markdown h2 { font-size: 19px; }
  .document-viewer-actions { gap: 7px; }
  .document-source { font-size: 11px; }
  .document-source-numbers { min-width: 37px; padding-right: 10px; margin-right: 10px !important; }
}
