/* [2026-10-16] Shared, flat Open surface using existing ModalService and theme roles.
 * Ref: docs/QA_TZ_UNIFIED_BRIEFCASE_LIFECYCLE_2026-10-16.md §4.
 * Chat: Step-by-Step, 01a12df4-46fa-7de1-ae74-b3bcc8c550b0. */
.modal-container.briefcase-version-modal {
    width: min(760px, calc(100vw - var(--space-8)));
    max-width: calc(100vw - var(--space-8));
}
.briefcase-version-history {
    color: var(--text-primary);
    min-width: 0;
}
.briefcase-history-name {
    font-weight: var(--font-weight-semibold, 600);
    overflow-wrap: anywhere;
    margin: 0 0 var(--space-2);
}
.briefcase-history-place,
.briefcase-history-hint {
    color: var(--text-secondary);
    margin: var(--space-2) 0 var(--space-3);
}
.briefcase-history-list {
    max-height: min(360px, 45dvh);
    overflow-y: auto;
    border-block: 1px solid var(--border-primary);
}
.briefcase-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-primary);
    cursor: pointer;
}
.briefcase-history-row:last-child {
    border-bottom: 0;
}
.briefcase-history-row:hover {
    background: var(--bg-hover);
}
.briefcase-history-row[aria-selected='true'] {
    color: var(--brand-primary-text);
    background: var(--brand-primary-bg);
}
.briefcase-history-row:focus-visible {
    outline: 1px solid var(--border-hover);
    outline-offset: -1px;
    box-shadow: none;
}
.briefcase-history-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.briefcase-history-row small {
    display: block;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
}
.briefcase-history-status {
    min-height: 1.5em;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.modal-container.briefcase-open-modal:has(.briefcase-browser) {
    width: min(1100px, calc(100vw - var(--space-8)));
    max-width: calc(100vw - var(--space-8));
    height: min(800px, calc(100dvh - var(--space-8)));
    min-height: 0;
    max-height: calc(100dvh - var(--space-8));
    display: flex;
    flex-direction: column;
}
.briefcase-open-modal:has(.briefcase-browser) .modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    padding: 0;
}
.briefcase-open-modal:has(.briefcase-browser) :is(#modal-service-message, #modal-message) {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.briefcase-browser {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    color: var(--text-primary);
}
.briefcase-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}
.briefcase-projects {
    width: 240px;
    flex: 0 0 240px;
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.briefcase-projects [data-projects] {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: var(--space-2) 0;
}
.briefcase-projects-caption {
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}
.briefcase-create {
    margin-left: auto;
    min-width: 0;
}
.briefcase-create:empty {
    display: none;
}
.briefcase-create .searchable-select-trigger {
    border-color: transparent;
    background: transparent;
    color: var(--text-primary);
}
.briefcase-create .searchable-select-trigger:hover {
    background: var(--bg-hover);
}
.briefcase-project {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    overflow-wrap: anywhere;
    font-size: var(--font-size-sm);
}
.briefcase-project .material-icons {
    font-size: 20px;
    flex-shrink: 0;
}
.briefcase-project[aria-pressed='true'] {
    background: var(--brand-primary-bg);
    color: var(--brand-primary-text);
}
.briefcase-project:hover,
.briefcase-file:hover {
    background: var(--bg-hover);
}
.briefcase-project:focus-visible,
.briefcase-file:focus-visible {
    outline: 1px solid var(--border-hover);
    outline-offset: -1px;
    box-shadow: none;
}
.briefcase-local {
    padding: var(--space-3);
    border-top: 1px solid var(--border-primary);
}
.briefcase-local p {
    margin: var(--space-2) 0 0;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}
.briefcase-computer {
    margin: var(--space-3);
    justify-content: flex-start;
    white-space: normal;
    text-align: left;
}
.briefcase-computer[aria-pressed='true'] {
    color: var(--brand-primary-text);
    background: var(--brand-primary-bg);
}
.briefcase-modules {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3);
    gap: var(--space-1);
    border-top: 1px solid var(--border-primary);
}
.briefcase-modules:empty {
    display: none;
}
.briefcase-modules .searchable-select {
    width: 100%;
    min-width: 0;
}
.briefcase-modules .searchable-select-dropdown {
    top: auto;
    bottom: calc(100% + var(--space-1));
    max-height: min(300px, 30dvh);
    transform-origin: bottom center;
}
.briefcase-modules .searchable-select-options {
    min-height: 0;
    max-height: inherit;
}
.briefcase-computer-panel {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: var(--space-6);
}
.briefcase-computer-panel h3 {
    margin: 0 0 var(--space-3);
    font-size: var(--font-size-lg);
}
.briefcase-computer-panel p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: var(--space-3) 0;
}
.briefcase-computer-panel [data-import-actions] {
    margin-top: var(--space-3);
}
/* [2026-10-25] Флажок окна выбора места («Хранить исходный файл в задаче») под списком. Ref:
   docs/TZ_SATELLITE_STAGE6_TYPES_2026-10-25.md §7.3 п.1. Chat: Blueprint-app.html — продолжение работы 2026-10-23. */
.briefcase-place-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
}
.briefcase-place-option .checkbox {
    flex: 0 0 auto;
}
.briefcase-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.briefcase-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-primary);
}
.briefcase-toolbar [data-search] {
    min-width: 0;
    width: 100%;
}
/* [2026-10-18] The search keeps a single border focus cue, like the adjacent
 * filters; ModalService's generic inset underline must not double its bottom edge.
 * Ref: DESIGN.md Inputs & Forms. Chat: open-ui-followup-20261018. */
.briefcase-toolbar [data-search]:focus-visible {
    box-shadow: none;
}
.briefcase-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}
.briefcase-filter {
    flex: 0 1 176px;
    min-width: 0;
}
.briefcase-columns-viewport {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}
.briefcase-columns,
.briefcase-document {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr) 88px;
    width: 100%;
    min-width: 720px;
}
.briefcase-columns {
    align-items: center;
    flex-shrink: 0;
    padding-block: var(--space-2);
}
.briefcase-columns > span {
    min-width: 0;
    padding-inline: var(--space-4);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}
.briefcase-columns .briefcase-file-name {
    padding-left: calc(24px + var(--space-7));
}
/* [2026-10-30] Заголовок «Редактор» — тот же боковой отступ, что у ячейки редактора строки (space-2): иначе правые края
   заголовка и имени модуля расходились на 8px. Chat: Dashboards — аналог Power BI 2026-10-29. */
.briefcase-columns > .briefcase-file-target {
    padding-inline: var(--space-2);
}
.briefcase-columns .briefcase-file-target {
    box-sizing: border-box;
}
.briefcase-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
/* [2026-10-18] One horizontal document row: name, Master, Work, editor.
 * These dimensions match BriefcaseBrowser's virtual row calculations.
 * Ref: docs/QA_TZ_UNIFIED_BRIEFCASE_LIFECYCLE_2026-10-16.md §4. */
.briefcase-document {
    border-bottom: 1px solid var(--border-primary);
}
.briefcase-document-heading {
    box-sizing: border-box;
    grid-column: 1;
    min-height: 80px;
    align-self: start;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    padding: var(--space-2) var(--space-4);
}
.briefcase-document-heading > .material-icons {
    font-size: 24px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.briefcase-document-heading .briefcase-file-name > span {
    font-weight: var(--font-weight-semibold);
}
.briefcase-document-zones {
    display: contents;
}
.briefcase-zone {
    min-width: 0;
}
.briefcase-zone:first-child {
    grid-column: 2;
}
.briefcase-zone + .briefcase-zone {
    grid-column: 3;
}
.briefcase-document-editor {
    box-sizing: border-box;
    grid-column: 4;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 80px;
    align-self: start;
    /* [2026-10-30] Боковой отступ space-4 → space-2: в колонке 88px оставалось 56px, и имя модуля «Dashboards» рвалось
       на «Dashboar / ds» (живая проверка окна Open). Ref: docs/TZ_DASHBOARDS_POWERBI_2026-10-29.md §6.1.
       Chat: Dashboards — аналог Power BI 2026-10-29. */
    padding: var(--space-2) var(--space-2);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    overflow-wrap: anywhere;
}
.briefcase-zone-state {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 80px;
    margin: 0;
    padding: var(--space-2) var(--space-4);
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}
.briefcase-versions-toggle.btn {
    box-sizing: border-box;
    display: flex;
    width: fit-content;
    max-width: 100%;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 var(--space-4);
    font-size: var(--font-size-xs);
}
.briefcase-history-state {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--space-4);
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}
/* [2026-10-29] Подпись раздела «Недавние» (только окно Slides, опция `recent`): высота — как у строки состояния
   версий (32px), чтобы совпасть с расчётом виртуального списка `recentRows`. Ref:
   docs/TZ_SLIDES_DECKCRAFT_PARITY_PART2_2026-10-18.md «Уточнение E4» E4.1. Chat: slides-deckcraft-parity-part2-2026-10-18. */
.briefcase-recent-caption {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--space-4);
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}
.briefcase-placement-error {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}
.briefcase-placement-error > strong {
    display: block;
    margin-bottom: var(--space-1);
}
.briefcase-file {
    box-sizing: border-box;
    height: 80px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    cursor: pointer;
}
.briefcase-file[aria-selected='true'] {
    background: var(--brand-primary-bg);
    color: var(--brand-primary-text);
}
.briefcase-file > .material-icons {
    font-size: 24px;
    color: var(--text-secondary);
}
.briefcase-file-name {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.briefcase-file-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: var(--font-size-sm);
}
.briefcase-file-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    text-align: left;
}
.briefcase-file-target {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    width: 88px;
    flex-shrink: 0;
    text-align: right;
}
.briefcase-selection {
    min-height: 36px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-primary);
    overflow-wrap: anywhere;
}
.briefcase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0 var(--space-3) var(--space-2);
}
.briefcase-open-modal:has(.briefcase-browser) .modal-header > [data-briefcase-close] {
    margin-left: var(--space-3);
}
.briefcase-open-modal:has(.briefcase-browser) .modal-actions {
    align-items: center;
    flex-wrap: wrap;
}
.briefcase-open-modal .modal-actions > .briefcase-selection {
    flex: 1 1 200px;
    min-width: 0;
    min-height: 0;
    margin-right: auto;
    padding: 0;
    border-top: 0;
}
.briefcase-open-modal .modal-actions > .briefcase-actions {
    padding: 0;
}
.briefcase-actions:empty {
    display: none;
}
.briefcase-source-error {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--color-error-text);
}
.briefcase-source-id {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}
.briefcase-state {
    padding: var(--space-6);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    text-align: center;
}
@media (max-width: 700px) {
    .modal-container.briefcase-open-modal:has(.briefcase-browser) {
        width: calc(100vw - var(--space-4));
        max-width: calc(100vw - var(--space-4));
        height: calc(100dvh - var(--space-4));
        max-height: calc(100dvh - var(--space-4));
    }
    .briefcase-projects {
        width: 150px;
        flex-basis: 150px;
    }
    .briefcase-filter {
        flex-basis: 144px;
    }
    .briefcase-file {
        gap: var(--space-2);
        padding: var(--space-3) var(--space-2);
    }
}
/* [2026-10-18] Keep the native create label and file names readable at 320px;
 * projects become a scrollable row; the module menu remains one full-width control.
 * Ref: DESIGN.md Inputs & Forms. Chat: open-ui-followup-20261018. */
@media (max-width: 480px) {
    .briefcase-open-modal:has(.briefcase-browser) .modal-header {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding: var(--space-3);
    }
    .briefcase-open-modal .modal-header h2 {
        flex: 1;
        min-width: 0;
    }
    .briefcase-open-modal .modal-header .briefcase-create {
        order: 1;
        flex: 1 0 100%;
        margin-left: 0;
    }
    .briefcase-layout {
        flex-direction: column;
    }
    .briefcase-projects {
        width: 100%;
        flex: 0 0 auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-primary);
    }
    .briefcase-computer {
        margin: var(--space-2) var(--space-3);
    }
    .briefcase-projects-caption {
        display: none;
    }
    .briefcase-projects [data-projects] {
        display: flex;
        flex-direction: row;
        flex: 0 0 auto;
        overflow: auto;
        padding: var(--space-2);
    }
    .briefcase-project {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .briefcase-modules .searchable-select-dropdown {
        top: calc(100% + var(--space-1));
        bottom: auto;
        transform-origin: top center;
    }
    .briefcase-filters {
        flex-wrap: nowrap;
    }
    .briefcase-filter {
        flex: 1 1 0;
    }
    .briefcase-sources {
        flex-shrink: 0;
        max-height: calc(var(--space-20) + var(--space-2));
        overflow-y: auto;
    }
    .briefcase-placement-error {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }
    .briefcase-placement-error > strong {
        margin-bottom: 0;
    }
    .briefcase-placement-error > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .briefcase-document-heading {
        gap: var(--space-2);
        padding-inline: var(--space-2);
    }
    .briefcase-zone-state,
    .briefcase-history-state,
    .briefcase-versions-toggle.btn {
        padding-inline: var(--space-2);
    }
}

.briefcase-toolbar[hidden] {
    display: none;
}
.briefcase-columns-viewport[hidden] {
    display: none;
}
/* [2026-10-23] .briefcase-computer[hidden] — окно «только место» (сохранение локального файла Word) прячет кнопку
   «Открыть на вашем компьютере»; display кнопки .btn иначе перебивает атрибут hidden.
   Ref: docs/QA_TZ_UNIFIED_BRIEFCASE_LIFECYCLE_2026-10-16.md §0. Chat: word-wordcraft-parity-2026-10-17. */
.briefcase-computer[hidden],
.briefcase-computer-panel[hidden],
.briefcase-list[hidden],
.briefcase-open-modal #modal-form-confirm[hidden] {
    display: none;
}
.briefcase-local [data-recovery] {
    margin-top: var(--space-3);
}
.briefcase-local [data-recovery][aria-pressed='true'] {
    color: var(--brand-primary-text);
    background: var(--brand-primary-bg);
}
.briefcase-sources:has(+ [data-list] [data-recovery-key]) {
    padding: var(--space-3) var(--space-4);
}
