/* Folder tabs and the shared document work surface. */
.documentation-tab-workspace { display: block; width: 100%; min-width: 0; min-height: 0; height: auto; max-height: none; overflow: visible; overflow-anchor: none; border-top: 0; background: var(--surface); }
.documentation-tab-workspace .documentation-content { display: block; min-width: 0; padding: 0; overflow: visible; }
.documentation-tabs-bar { display: flex; align-items: stretch; min-width: 0; position: sticky; top: 68px; z-index: 15; background: var(--surface-strong); border: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.documentation-tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.documentation-tab { display: flex; flex: 0 0 auto; min-width: 130px; max-width: 252px; height: 62px; border-right: 1px solid var(--line); position: relative; }
.documentation-tab > [role="tab"] { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 9px 12px; border: 0; border-radius: 0; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.documentation-tab > [role="tab"]:hover { background: var(--surface); color: var(--text); }
.documentation-tab [role="tab"] > svg { width: 18px; height: 18px; flex: none; }
.documentation-tab [role="tab"] > span { display: block; min-width: 0; }
.documentation-tab strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.documentation-tab small { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.documentation-tab b { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.documentation-tab.is-active { background: var(--ui-active); box-shadow: inset 0 3px var(--ui-focus); }
.documentation-tab.is-active > [role="tab"] { color: var(--ui-active-text); }
.documentation-tab.is-active [role="tab"] > svg { color: var(--ui-active-text); }
.documentation-tab-close { display: grid; place-items: center; flex: 0 0 30px; width: 30px; align-self: center; height: 36px; margin-right: 4px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; }
.documentation-tab-close:hover { color: var(--text); background: var(--surface-strong); }
.documentation-tab-close > svg { width: 15px; height: 15px; }
.documentation-browse-button { align-self: center; flex: none; margin: 4px 6px; background: var(--surface); }
.documentation-tab-workspace .documentation-commandbar { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 310px); align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.documentation-history { display: flex; gap: 4px; }
.documentation-history .icon-button { width: 34px; min-width: 34px; height: 36px; min-height: 36px; border-color: transparent; background: transparent; }
.documentation-history .icon-button:hover:not(:disabled) { background: var(--surface-strong); border-color: var(--line); }
.documentation-history .icon-button:disabled { opacity: .3; }
.documentation-tab-workspace .documentation-breadcrumbs { min-width: 0; flex-wrap: wrap; gap: 4px; order: 0; }
.documentation-tab-workspace .documentation-breadcrumbs button { max-width: 100%; min-height: 32px; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.documentation-tab-workspace .documentation-search { width: 100%; min-width: 0; }
.documentation-tab-workspace .documentation-folder-tools { padding: 18px 0 14px; border-bottom: 0; }
.documentation-tab-workspace .documentation-folder-tools strong { font-size: 20px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.documentation-tab-workspace .documentation-folder-tools > div:first-child { min-width: 0; }
.documentation-tab-workspace .documentation-folder-tools > div:first-child > span { margin-top: 5px; font-size: 12px; color: var(--muted); }
.documentation-tab-workspace .documentation-dropzone { padding: 0; min-height: 160px; }
.documentation-tab-workspace .documentation-folder-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 8px; }
.documentation-tab-workspace .documentation-folder-card { border: 1px solid var(--line); border-radius: 6px; background: var(--ui-subtle); }
.documentation-tab-workspace .documentation-folder-card:hover { border-color: var(--blue); background: var(--blue-soft); }
.documentation-tab-workspace .documentation-folder-open { min-height: 74px; }
.documentation-tab-workspace .documentation-folder-icon { background: var(--blue-soft); color: var(--blue); }
.documentation-tab-workspace .documentation-folder-open .documentation-item-copy strong { font-size: 15px; }
.documentation-tab-workspace .documentation-items-label { margin-top: 16px; }
.documentation-tab-workspace .documentation-file-card { padding: 12px 8px; gap: 14px; border-bottom-color: var(--line); }
.documentation-tab-workspace .documentation-file-card:hover { background: var(--ui-subtle); }
.documentation-tab-workspace .documentation-file-card.is-selected { background: var(--teal-soft); }
.documentation-tab-workspace .documentation-item-copy strong { font-size: 15px; font-weight: 600; line-height: 1.5; }
.documentation-tab-workspace .documentation-item-copy small { font-size: 12px; color: var(--muted); }
.documentation-tab-workspace .documentation-file-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.documentation-tab-workspace .documentation-file-icon[data-file-kind="pdf"] { color: #9b3547; background: #fbeef1; }
.documentation-tab-workspace .documentation-file-icon[data-file-kind="sheet"] { color: #266b4a; background: #e7f3ec; }
.documentation-tab-workspace .documentation-file-icon[data-file-kind="word"] { color: #2e6195; background: #e9f1fb; }
.documentation-tab-workspace .documentation-item-actions { padding-left: 10px; border-left: 1px solid var(--line); gap: 4px; }
.documentation-tab-workspace .documentation-item-actions .icon-button { width: 36px; min-width: 36px; min-height: 36px; }
.documentation-tab-workspace .documentation-item-actions .danger-icon { color: var(--muted); }
.documentation-tab-workspace .documentation-item-actions .danger-icon:hover { color: var(--red); background: var(--red-soft); }
.documentation-tab-workspace .documentation-estimate-total { padding: 12px 14px; border: 1px solid var(--line); background: var(--surface-strong); margin: 0 0 10px; }
.documentation-tab-workspace .documentation-estimate-amount strong { font-size: 19px; line-height: 1.3; }
.documentation-tab-workspace .documentation-estimate-label { font-size: 12px; }
.documentation-tab-workspace .documentation-estimate-heading { align-items: baseline; gap: 4px 12px; }
.documentation-tab-workspace .documentation-estimate-status { margin: 0; font-size: 11px; gap: 4px 8px; }
.documentation-tab-workspace .documentation-tax-totals { margin-top: 6px; }
.documentation-tab-workspace .documentation-tax-totals > span { font-size: 11px; }
.documentation-tab-workspace .documentation-tax-totals .file-tax-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 6px; }
.documentation-tab-workspace .documentation-tax-totals .file-total-badge { min-width: 0; min-height: 46px; padding: 5px 9px; }
.documentation-tab-workspace .documentation-tax-totals .file-total-value { font-size: 15px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.documentation-estimate-unavailable { align-self: center; font-size: 12px; line-height: 1.5; color: var(--muted); }
.documentation-tab-workspace .documentation-estimate-details { margin-top: 4px; }
.documentation-tab-workspace .documentation-estimate-details > summary { min-height: 34px; padding-block: 6px; }
.documentation-tab-workspace .documentation-estimate-scope { margin-bottom: 8px; font-size: 11px; }
.documentation-tab-workspace .documentation-file-totals .file-total-badge { background: var(--ui-subtle); color: var(--text); border-color: var(--line); }
.documentation-tab-workspace .documentation-file-totals .file-total-caption { color: var(--muted); }
.documentation-tab-workspace .documentation-file-totals .file-total-badge:hover { background: var(--ui-active); border-color: var(--ui-focus); }
.documentation-tab-workspace .documentation-tax-totals .file-total-badge { background: var(--surface); border-color: var(--line); color: var(--text); }
.documentation-tab-workspace .documentation-tax-totals .file-total-badge:last-child { background: var(--ui-active); color: var(--ui-active-text); }
.documentation-tab-workspace .documentation-tax-totals .file-total-badge:hover { border-color: var(--ui-focus); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-estimate-total { background: var(--ui-subtle); border-color: var(--line); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-file-totals .file-total-badge { background: var(--ui-subtle); color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-file-totals .file-total-badge:hover { background: var(--ui-active); border-color: var(--ui-focus); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-tax-totals .file-total-badge { background: var(--surface); border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-tax-totals .file-total-badge:last-child { background: var(--ui-active); color: var(--ui-active-text); }
html[data-theme="dark"] .documentation-tab-workspace .documentation-file-icon[data-file-kind="pdf"] { color: #f0acb7; background: #412d34; }
html[data-theme="dark"] .documentation-tab-workspace .documentation-file-icon[data-file-kind="sheet"] { color: #a0dabc; background: #2a3b32; }
html[data-theme="dark"] .documentation-tab-workspace .documentation-file-icon[data-file-kind="word"] { color: #a7c9eb; background: #2b3848; }
@media (min-width: 1400px) {
  .documentation-tab-workspace .documentation-file-card { grid-template-columns: minmax(0, 1fr) 248px; }
  .documentation-tab-workspace .documentation-dropzone.is-favorites .documentation-file-card { grid-template-columns: minmax(0, 1fr) 288px; }
  .documentation-tab-workspace .documentation-item-actions { justify-content: flex-end; }
  .documentation-tab-workspace .documentation-file-main:has(.documentation-file-totals) { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 18px; }
  .documentation-tab-workspace .documentation-file-totals { margin-left: 0; }
  .documentation-tab-workspace .documentation-file-totals .file-tax-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
.documentation-browse-body { display: flex; flex-direction: column; gap: 16px; padding: 20px; max-height: calc(100dvh - 40px); }
.documentation-browse-dialog .workspace-dialog-heading { margin: 0; padding: 0; }
.documentation-browse-dialog h2 { font-size: 19px; }
.documentation-browse-list { overflow-y: auto; overscroll-behavior: contain; max-height: 420px; min-height: 120px; scrollbar-width: thin; border-top: 1px solid var(--line); }
.documentation-browse-folder { display: grid; grid-template-columns: 22px minmax(0, 1fr) 20px; gap: 12px; width: 100%; padding: 13px 8px; min-height: 66px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.documentation-browse-folder:hover { background: var(--teal-soft); }
.documentation-browse-folder > svg { width: 20px; height: 20px; align-self: center; color: var(--teal); }
.documentation-browse-folder strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.documentation-browse-folder small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
:is([data-active-view="documents"], [data-active-view="regulations"]) .topbar :is(.search-field, #newRequestButton) { display: none; }
@media (max-width: 1100px) {
  .documentation-tab-workspace .documentation-commandbar { grid-template-columns: auto minmax(0, 1fr); }
  .documentation-tab-workspace .documentation-search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :is([data-active-view="documents"], [data-active-view="regulations"]) .workspace { overflow: visible; }
  html:has(.app-shell[data-active-view="documents"]), html:has(.app-shell[data-active-view="regulations"]),
  body:not(.dialog-open):has(.app-shell[data-active-view="documents"]), body:not(.dialog-open):has(.app-shell[data-active-view="regulations"]) { overflow-x: clip; }
  :is([data-active-view="documents"], [data-active-view="regulations"]) .topbar { grid-template-columns: minmax(0, 1fr) 44px 44px; }
  .documentation-tabs-bar { top: 0; margin-inline: -2px; }
  .documentation-tab { height: 58px; max-width: 224px; min-width: 122px; }
  .documentation-tab > [role="tab"] { padding: 8px 10px; gap: 7px; }
  .documentation-tab-close { width: 40px; flex-basis: 40px; height: 44px; margin-right: 0; }
  .documentation-browse-button { width: 44px; min-width: 44px; margin-inline: 3px; }
  .documentation-tab-workspace .documentation-commandbar { padding-block: 10px; gap: 8px; }
  .documentation-history { gap: 0; }
  .documentation-history .icon-button { width: 36px; min-width: 36px; height: 44px; }
  .documentation-tab-workspace .documentation-breadcrumbs button { font-size: 12px; }
  .documentation-tab-workspace .documentation-breadcrumbs button:last-child:not(:first-child),
  .documentation-tab-workspace .documentation-breadcrumbs > svg:last-of-type { display: none; }
  .documentation-tab-workspace .documentation-search input { font-size: 16px; min-height: 44px; }
  .documentation-tab-workspace .documentation-folder-tools { padding-block: 12px; gap: 6px; }
  .documentation-tab-workspace .documentation-folder-tools strong { font-size: 17px; }
  .documentation-tab-workspace .documentation-folder-grid { grid-template-columns: minmax(0, 1fr); }
  .documentation-tab-workspace .documentation-folder-open { min-height: 64px; }
  .documentation-tab-workspace .documentation-file-card { padding-inline: 2px; gap: 10px; }
  .documentation-tab-workspace .documentation-item-copy strong { font-size: 16px; }
  .documentation-tab-workspace .documentation-item-actions { border-left: 0; padding-left: 0; gap: 6px; }
  .documentation-tab-workspace .documentation-item-actions .icon-button { width: 44px; min-width: 44px; min-height: 44px; }
  .documentation-tab-workspace .documentation-files-heading { margin-top: 4px; }
  .documentation-tab-workspace .documentation-files-heading > button { width: auto; flex: none; }
  .documentation-tab-workspace .documentation-estimate-total { padding: 10px; margin-bottom: 0; }
  .documentation-tab-workspace .documentation-estimate-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 10px; }
  .documentation-tab-workspace .documentation-estimate-group + .documentation-estimate-group { border-top: 0; border-inline-start: 1px solid var(--line); padding: 0 0 0 10px; }
  .documentation-tab-workspace .documentation-estimate-groups:has(.documentation-estimate-group + .documentation-estimate-group) .file-tax-totals { grid-template-columns: minmax(0, 1fr); }
  .documentation-tab-workspace .documentation-tax-totals .file-total-caption { grid-column: 1; }
  .documentation-tab-workspace .documentation-tax-totals .file-total-value { grid-column: 1 / -1; }
  .documentation-tab-workspace .documentation-tax-totals .file-total-badge svg { grid-column: 2; grid-row: 1; }
  .documentation-tab-workspace .documentation-estimate-details > summary { min-height: 44px; font-size: 11px; }
  .documentation-tab-workspace .documentation-estimate-groups:has(details[open]) { grid-template-columns: minmax(0, 1fr); }
  .documentation-tab-workspace .documentation-estimate-groups:has(details[open]) .documentation-estimate-group + .documentation-estimate-group { border-inline-start: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
  .documentation-tab-workspace .documentation-estimate-groups:has(details[open]) .file-tax-totals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); }
  .documentation-browse-body { padding: 14px; gap: 12px; }
  .documentation-browse-dialog h2 { font-size: 17px; }
}
