/* My Files operation dialogs — dark palette sourced from #071D28, border #092735.
   Dialogs render outside .layout-theme, so body.app-dark-mode is the hook. */

.fph-muted {
    color: #555;
}

.fph-card,
.fph-card--line {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.fph-card {
    background: #fafafa;
}

.fph-stage {
    background-color: #f5f5f5;
}

.fph-sheet {
    background-color: #fafafa;
    max-height: 48vh;
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.fm-op-muted {
    color: #999;
}

.mud-dialog.fm-info-dialog {
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: min(360px, calc(100vw - 32px)) !important;
    max-height: min(82vh, 640px) !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

.fm-info-dialog .mud-dialog-title {
    flex: 0 0 auto;
    padding: 16px 16px 8px !important;
}

.fm-info-dialog .mud-dialog-content.fm-info-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding: 4px 16px 14px !important;
}

.fm-info-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    padding: 8px 16px 14px !important;
    justify-content: flex-start;
    background: #fff;
}

.fm-info-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fm-info-hero__ico {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    font-size: 1.15rem;
}

.fm-info-hero__ico.is-file {
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
}

.fm-info-hero__ico.is-folder {
    background: #fff6df;
    color: #c9a227;
}

.fm-info-hero__copy {
    min-width: 0;
}

.fm-info-hero__kicker {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b8290;
}

.fm-info-hero__name {
    margin-top: 2px;
    font-size: 0.98rem;
    font-weight: 750;
    color: #2c3e4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.fm-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4f7f9;
    border: 1px solid #e6edf1;
    color: #2c3e4a;
    font-size: 0.75rem;
    font-weight: 650;
}

.fm-info-chip.is-ok {
    background: rgba(31, 138, 91, 0.1);
    border-color: rgba(31, 138, 91, 0.22);
    color: #1f8a5b;
}

.fm-info-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fm-info-row {
    display: grid;
    grid-template-columns: 28px 92px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 40px;
    padding: 6px 8px;
    border-radius: 10px;
    background: #f7fafb;
}

.fm-info-row__ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #044464;
    font-size: 13px;
}

.fm-info-row__label {
    color: #6b8290;
    font-size: 0.76rem;
    font-weight: 650;
}

.fm-info-row__value {
    color: #2c3e4a;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

.fm-info-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.fm-info-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #e6edf1;
    color: #044464;
    font-size: 0.74rem;
    font-weight: 650;
}

.fm-info-audience {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e6edf1;
    background: #fff;
}

.fm-info-audience__empty {
    color: #6b8290;
    font-size: 0.78rem;
    line-height: 1.6;
}

.fm-info-audience__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-inline-start: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
    font-size: 0.68rem;
    font-weight: 750;
}

.fm-info-audience__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 168px;
    overflow-y: auto;
    padding-inline-end: 2px;
}

.fm-info-person {
    display: flex;
    direction: rtl;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 2px;
}

.fm-info-person__ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    background: rgba(4, 68, 100, 0.08);
    color: #044464;
    font-size: 12px;
}

.fm-info-person__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
    gap: 1px;
    text-align: right;
}

.fm-info-person__name,
.fm-info-person__meta {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-info-person__name {
    color: #2c3e4a;
    font-size: 0.82rem;
    font-weight: 700;
}

.fm-info-person__meta {
    color: #6b8290;
    font-size: 0.7rem;
}

.fm-info-path {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e6edf1;
    background: #fff;
}

.fm-info-path__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #6b8290;
    font-size: 0.74rem;
    font-weight: 700;
}

.fm-info-path__value {
    color: #2c3e4a;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.6;
    word-break: break-word;
}

body.app-dark-mode .fm-info-hero__ico.is-file {
    background: #0a3144;
    color: #9fd0e6;
}

body.app-dark-mode .fm-info-hero__ico.is-folder {
    background: rgba(201, 162, 39, 0.16);
    color: #e6c56a;
}

body.app-dark-mode .fm-info-hero__kicker,
body.app-dark-mode .fm-info-row__label,
body.app-dark-mode .fm-info-path__label {
    color: #8eafbf;
}

body.app-dark-mode .fm-info-hero__name,
body.app-dark-mode .fm-info-row__value,
body.app-dark-mode .fm-info-path__value,
body.app-dark-mode .fm-info-chip {
    color: #e6f2f8;
}

body.app-dark-mode .fm-info-audience,
body.app-dark-mode .fm-info-person__ico {
    background: #0a3144;
    border-color: #13485c;
    color: #9fd0e6;
}

body.app-dark-mode .fm-info-dialog .mud-dialog-actions {
    background: #071d28;
}

body.app-dark-mode .fm-info-audience__count {
    background: #123e52;
    color: #9fd0e6;
}

body.app-dark-mode .fm-info-person__name {
    color: #e6f2f8;
}

body.app-dark-mode .fm-info-person__meta,
body.app-dark-mode .fm-info-audience__empty {
    color: #8eafbf;
}

body.app-dark-mode .fm-info-chip,
body.app-dark-mode .fm-info-row,
body.app-dark-mode .fm-info-path,
body.app-dark-mode .fm-info-tag,
body.app-dark-mode .fm-info-row__ico {
    background: #0a3144;
    border-color: #13485c;
}

body.app-dark-mode .fm-info-chip.is-ok {
    background: rgba(31, 138, 91, 0.18);
    color: #8ddebe;
}

body.app-dark-mode .fm-info-tag {
    color: #9fd0e6;
}

.mud-dialog.fm-ver-dialog {
    width: min(420px, calc(100vw - 32px)) !important;
    max-width: min(420px, calc(100vw - 32px)) !important;
    max-height: min(82vh, 680px) !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

.fm-ver-dialog .mud-dialog-title {
    flex: 0 0 auto;
    padding: 16px 16px 8px !important;
}

.fm-ver-dialog .mud-dialog-content.fm-ver-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding: 4px 16px 12px !important;
}

.fm-ver-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    padding: 8px 16px 14px !important;
    justify-content: flex-start;
    background: #fff;
}

.fm-ver-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fm-ver-hero__ico {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
    font-size: 1.15rem;
}

.fm-ver-hero__copy {
    min-width: 0;
}

.fm-ver-hero__kicker {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b8290;
}

.fm-ver-hero__name {
    margin-top: 2px;
    font-size: 0.98rem;
    font-weight: 750;
    color: #2c3e4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-ver-loading {
    padding: 18px 0 8px;
}

.fm-ver-now,
.fm-ver-note,
.fm-ver-upload,
.fm-ver-empty,
.fm-ver-keep {
    border: 1px solid #e6edf1;
    border-radius: 12px;
    background: #f7fafb;
}

.fm-ver-now {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.fm-ver-now__label {
    color: #044464;
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

.fm-ver-now__meta {
    color: #526674;
    font-size: 0.76rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-ver-note {
    margin-bottom: 10px;
    padding: 10px 12px;
    color: #6a5420;
    background: #fff8e8;
    border-color: #f0e2bc;
    font-size: 0.78rem;
    line-height: 1.7;
}

.fm-ver-note.is-warn {
    color: #8a3b3b;
    background: #fff4f4;
    border-color: #f0d0d0;
}

.fm-ver-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    cursor: pointer;
    overflow: hidden;
}

.fm-ver-upload.is-busy {
    opacity: 0.7;
    pointer-events: none;
}

.fm-ver-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.fm-ver-upload > i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    background: #044464;
    color: #fff;
    font-size: 0.95rem;
}

.fm-ver-upload__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: right;
}

.fm-ver-upload__copy strong {
    color: #2c3e4a;
    font-size: 0.84rem;
}

.fm-ver-upload__copy small {
    color: #6b8290;
    font-size: 0.72rem;
    line-height: 1.5;
}

.fm-ver-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #2c3e4a;
    font-size: 0.82rem;
    font-weight: 750;
}

.fm-ver-head__count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
    font-size: 0.72rem;
}

.fm-ver-empty {
    padding: 12px;
    color: #6b8290;
    font-size: 0.78rem;
}

.fm-ver-list {
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-left: 2px;
}

.fm-ver-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 8px 8px 10px;
    border: 1px solid #e6edf1;
    border-radius: 12px;
    background: #fff;
}

.fm-ver-row__no {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    background: rgba(4, 68, 100, 0.08);
    color: #044464;
    font-size: 0.75rem;
    font-weight: 750;
}

.fm-ver-row__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
    gap: 1px;
    text-align: right;
}

.fm-ver-row__name,
.fm-ver-row__meta {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-ver-row__name {
    color: #2c3e4a;
    font-size: 0.8rem;
    font-weight: 700;
}

.fm-ver-row__meta {
    color: #6b8290;
    font-size: 0.7rem;
}

.fm-ver-row__dl {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    color: #044464;
    background: rgba(4, 68, 100, 0.08);
    text-decoration: none;
}

.fm-ver-row__dl:hover {
    background: #044464;
    color: #fff;
}

.fm-ver-keep {
    margin-top: 12px;
    padding: 10px 12px;
}

.fm-ver-keep__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #526674;
    font-size: 0.76rem;
    line-height: 1.6;
}

.fm-ver-keep__btn,
.fm-ver-keep__save {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #044464;
    font-size: 0.76rem;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.fm-ver-keep__edit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.fm-ver-keep__edit input {
    width: 92px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d5e1e8;
    border-radius: 8px;
    background: #fff;
    color: #2c3e4a;
    font-size: 0.82rem;
    appearance: textfield;
}

.fm-ver-keep__edit input::-webkit-outer-spin-button,
.fm-ver-keep__edit input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.fm-ver-keep__save {
    height: 34px;
    padding: 0 12px;
    background: #044464;
    color: #fff;
}

.fm-ver-keep__save:disabled,
.fm-ver-keep__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.fm-ver-keep__hint {
    margin-top: 6px;
    color: #6b8290;
    font-size: 0.7rem;
}

body.app-dark-mode .fm-ver-dialog .mud-dialog-actions {
    background: #071d28;
}

body.app-dark-mode .fm-ver-hero__ico,
body.app-dark-mode .fm-ver-row__no,
body.app-dark-mode .fm-ver-row__dl,
body.app-dark-mode .fm-ver-head__count {
    background: #0a3144;
    color: #9fd0e6;
}

body.app-dark-mode .fm-ver-hero__kicker,
body.app-dark-mode .fm-ver-row__meta,
body.app-dark-mode .fm-ver-upload__copy small,
body.app-dark-mode .fm-ver-keep__hint,
body.app-dark-mode .fm-ver-empty {
    color: #8eafbf;
}

body.app-dark-mode .fm-ver-hero__name,
body.app-dark-mode .fm-ver-now__label,
body.app-dark-mode .fm-ver-head,
body.app-dark-mode .fm-ver-row__name,
body.app-dark-mode .fm-ver-upload__copy strong {
    color: #e6f2f8;
}

body.app-dark-mode .fm-ver-now,
body.app-dark-mode .fm-ver-upload,
body.app-dark-mode .fm-ver-empty,
body.app-dark-mode .fm-ver-keep,
body.app-dark-mode .fm-ver-row,
body.app-dark-mode .fm-ver-keep__edit input {
    background: #0a3144;
    border-color: #13485c;
    color: #e6f2f8;
}

body.app-dark-mode .fm-ver-now__meta,
body.app-dark-mode .fm-ver-keep__line,
body.app-dark-mode .fm-ver-keep__btn {
    color: #9fd0e6;
}

body.app-dark-mode .fm-ver-note {
    background: #123e52;
    border-color: #13485c;
    color: #e6f2f8;
}

body.app-dark-mode .mud-dialog.fm-op-modal {
    --fm-bg: #071D28;
    --fm-border: #092735;
    --fm-raised: #0A3144;
    --fm-inset: #061821;
    --fm-line: #13485C;
    --fm-text: #E6F2F8;
    --fm-muted: #8EAFBF;
    --fm-hover: #123E52;
    --fm-accent: #1B6280;
    background: var(--fm-bg) !important;
    background-image: none !important;
    background-color: var(--fm-bg) !important;
    border: 1px solid var(--fm-border) !important;
    color: var(--fm-text) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5) !important;
}

body.app-dark-mode .mud-dialog.fm-op-modal .mud-dialog-title,
body.app-dark-mode .mud-dialog.fm-op-modal .mud-dialog-content,
body.app-dark-mode .mud-dialog.fm-op-modal .mud-dialog-actions,
body.app-dark-mode .mud-dialog.fm-op-modal .mud-container {
    background: transparent !important;
    color: var(--fm-text) !important;
}

body.app-dark-mode .mud-dialog.fm-op-modal .mud-dialog-title {
    border-bottom: 1px solid var(--fm-border) !important;
}

body.app-dark-mode .mud-dialog.fm-op-modal .mud-dialog-actions,
body.app-dark-mode .mud-dialog.share-create-dialog.fm-op-modal .mud-dialog-actions,
body.app-dark-mode .mud-dialog.share-create-dialog--app.fm-op-modal .mud-dialog-actions,
body.app-dark-mode .mud-dialog-container .mud-dialog.share-create-dialog--app.fm-op-modal .mud-dialog-actions {
    background: var(--fm-bg) !important;
    border-top: 1px solid var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .mud-typography,
body.app-dark-mode .fm-op-modal h3,
body.app-dark-mode .fm-op-modal label,
body.app-dark-mode .fm-op-modal p,
body.app-dark-mode .fm-op-modal span,
body.app-dark-mode .fm-op-modal .share-create-header__title,
body.app-dark-mode .fm-op-modal .share-create-items__title,
body.app-dark-mode .fm-op-modal .share-create-section__title,
body.app-dark-mode .fm-op-modal .share-create-option__label,
body.app-dark-mode .fm-op-modal .share-member-row__name {
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .fph-muted,
body.app-dark-mode .fm-op-modal .fm-op-muted,
body.app-dark-mode .fm-op-modal .text-muted,
body.app-dark-mode .fm-op-modal .mud-text-secondary,
body.app-dark-mode .fm-op-modal .share-create-header__hint,
body.app-dark-mode .fm-op-modal .share-create-items__sub,
body.app-dark-mode .fm-op-modal .share-create-option__desc,
body.app-dark-mode .fm-op-modal .share-member-row__sub,
body.app-dark-mode .fm-op-modal .share-selected-empty,
body.app-dark-mode .fm-op-modal .mud-input-helper-text {
    color: var(--fm-muted) !important;
}

body.app-dark-mode .fm-op-modal .mud-paper,
body.app-dark-mode .fm-op-modal .fph-card,
body.app-dark-mode .fm-op-modal .fph-stage,
body.app-dark-mode .fm-op-modal .fph-sheet,
body.app-dark-mode .fm-op-modal .comment-form-wrap,
body.app-dark-mode .fm-op-modal .share-create-section,
body.app-dark-mode .fm-op-modal .share-create-section--panel,
body.app-dark-mode .fm-op-modal .share-create-option,
body.app-dark-mode .fm-op-modal .share-create-perm,
body.app-dark-mode .fm-op-modal .share-recipient-panel,
body.app-dark-mode .fm-op-modal .share-selected-box,
body.app-dark-mode .fm-op-modal .share-create-items {
    background: var(--fm-raised) !important;
    color: var(--fm-text) !important;
    border-color: var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .fph-video {
    background: #000 !important;
    border-color: var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .share-create-option:hover,
body.app-dark-mode .fm-op-modal .share-create-perm:hover,
body.app-dark-mode .fm-op-modal .share-member-row:hover,
body.app-dark-mode .fm-op-modal .mud-nav-link:hover,
body.app-dark-mode .fm-op-modal .mud-table-row:hover {
    background: var(--fm-hover) !important;
}

body.app-dark-mode .fm-op-modal .share-member-row--all {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom-color: var(--fm-border);
}

body.app-dark-mode .fm-op-modal .share-create-option.is-on,
body.app-dark-mode .fm-op-modal .share-create-perm.is-on,
body.app-dark-mode .fm-op-modal .share-member-row.is-selected {
    background: #0E3C52 !important;
    border-color: var(--fm-line) !important;
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .share-create-option__icon {
    background: var(--fm-accent) !important;
    color: var(--fm-muted) !important;
}

body.app-dark-mode .fm-op-modal .share-recipient-tabs .mud-tabs-toolbar,
body.app-dark-mode .fm-op-modal .mud-tabs-tabbar {
    background: var(--fm-raised) !important;
    border-bottom: 1px solid var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .mud-tab {
    color: var(--fm-muted) !important;
}

body.app-dark-mode .fm-op-modal .mud-tab.mud-tab-active {
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .mud-input-outlined,
body.app-dark-mode .fm-op-modal .mud-input-slot,
body.app-dark-mode .fm-op-modal .comment-input .mud-input-slot,
body.app-dark-mode .fm-op-modal .comment-input textarea,
body.app-dark-mode .fm-op-modal textarea,
body.app-dark-mode .fm-op-modal input {
    background-color: #20475b !important;
    color: var(--fm-text) !important;
    -webkit-text-fill-color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .mud-input-outlined-border,
body.app-dark-mode .fm-op-modal .comment-input .mud-input-outlined-border {
    border-color: var(--fm-line) !important;
}

body.app-dark-mode .fm-op-modal .mud-input:hover .mud-input-outlined-border,
body.app-dark-mode .fm-op-modal .mud-input:focus-within .mud-input-outlined-border {
    border-color: #1E6F8C !important;
}

body.app-dark-mode .fm-op-modal .mud-input-label,
body.app-dark-mode .fm-op-modal .comment-input .mud-input-label {
    color: var(--fm-muted) !important;
}

body.app-dark-mode .fm-op-modal .mud-divider,
body.app-dark-mode .fm-op-modal .mud-table-cell,
body.app-dark-mode .fm-op-modal .mud-table-head .mud-table-cell {
    border-color: var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .mud-table,
body.app-dark-mode .fm-op-modal .mud-table-container,
body.app-dark-mode .fm-op-modal .mud-table-root,
body.app-dark-mode .fm-op-modal .mud-data-grid,
body.app-dark-mode .fm-op-modal .mud-table-body .mud-table-row,
body.app-dark-mode .fm-op-modal .mud-table-pagination {
    background: var(--fm-bg) !important;
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .mud-table-head,
body.app-dark-mode .fm-op-modal .mud-table-head .mud-table-cell {
    background: var(--fm-border) !important;
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .mud-table-body .mud-table-row:nth-of-type(odd),
body.app-dark-mode .fm-op-modal .mud-table-striped .mud-table-row:nth-child(odd) {
    background: #081F2C !important;
}

body.app-dark-mode .fm-op-modal .mud-alert {
    background: var(--fm-raised) !important;
    color: var(--fm-text) !important;
    border: 1px solid var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .mud-nav-link,
body.app-dark-mode .fm-op-modal .mud-navmenu {
    color: var(--fm-text) !important;
    background: transparent !important;
}

body.app-dark-mode .fm-op-modal .share-form-section {
    color: var(--fm-text) !important;
    background: #0D3A50 !important;
}

body.app-dark-mode .fm-op-modal .btnok,
body.app-dark-mode .fm-op-modal .btn1,
body.app-dark-mode .fm-op-modal .comment-send-btn.mud-button-root:not(.mud-disabled) {
    background: var(--fm-accent) !important;
    color: #F4FBFF !important;
    border: 1px solid var(--fm-line) !important;
}

body.app-dark-mode .fm-op-modal .btnok span,
body.app-dark-mode .fm-op-modal .btn1 span,
body.app-dark-mode .fm-op-modal .comment-send-btn span {
    background: transparent !important;
    color: #F4FBFF !important;
    border: none !important;
}

body.app-dark-mode .fm-op-modal .btnok:hover,
body.app-dark-mode .fm-op-modal .btn1:hover,
body.app-dark-mode .fm-op-modal .comment-send-btn.mud-button-root:not(.mud-disabled):hover {
    background: #227396 !important;
}

body.app-dark-mode .fm-op-modal .btnno {
    background: #C4A35A !important;
    color: #071D28 !important;
    border: 1px solid var(--fm-border) !important;
}

body.app-dark-mode .fm-op-modal .btnno span {
    background: transparent !important;
    color: #071D28 !important;
    border: none !important;
}

body.app-dark-mode .fm-op-modal .movecontent-progress-chip {
    border-color: var(--fm-line) !important;
    color: var(--fm-text) !important;
}

body.app-dark-mode .fm-op-modal .movecontent-progress-linear,
body.app-dark-mode .fm-op-modal .mud-progress-linear {
    background-color: var(--fm-inset) !important;
}

body.app-dark-mode .fm-op-modal pre {
    color: var(--fm-text) !important;
    background: transparent !important;
}

.mud-dialog.fm-tag-dialog {
    width: min(400px, calc(100vw - 32px)) !important;
    max-width: min(400px, calc(100vw - 32px)) !important;
    max-height: min(82vh, 560px) !important;
    border-radius: 16px !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
}

.fm-tag-dialog .mud-dialog-title {
    flex: 0 0 auto;
    padding: 16px 16px 8px !important;
}

.fm-tag-dialog .mud-dialog-content.fm-tag-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding: 4px 16px 12px !important;
}

.fm-tag-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    padding: 8px 16px 14px !important;
    justify-content: flex-start;
    background: #fff;
}

.fm-tag-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fm-tag-hero__ico {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
    font-size: 1.15rem;
}

.fm-tag-hero__copy {
    min-width: 0;
}

.fm-tag-hero__kicker {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b8290;
}

.fm-tag-hero__name {
    margin-top: 2px;
    font-size: 0.98rem;
    font-weight: 750;
    color: #2c3e4a;
}

.fm-tag-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.fm-tag-add input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d5e1e8;
    border-radius: 10px;
    background: #fff;
    color: #2c3e4a;
    font-size: 0.86rem;
}

.fm-tag-add input:focus {
    outline: none;
    border-color: #044464;
}

.fm-tag-add button {
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: #044464;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.fm-tag-add button:disabled {
    opacity: 0.45;
    cursor: default;
}

.fm-tag-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #2c3e4a;
    font-size: 0.82rem;
    font-weight: 750;
}

.fm-tag-head__count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 68, 100, 0.1);
    color: #044464;
    font-size: 0.72rem;
}

.fm-tag-loading {
    padding: 10px 0;
}

.fm-tag-empty {
    padding: 12px;
    border: 1px solid #e6edf1;
    border-radius: 12px;
    background: #f7fafb;
    color: #6b8290;
    font-size: 0.78rem;
}

.fm-tag-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 2px;
}

.fm-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 32px;
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e6edf1;
    color: #044464;
    font-size: 0.8rem;
    font-weight: 700;
}

.fm-tag-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.fm-tag-chip button {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    background: rgba(4, 68, 100, 0.08);
    color: #044464;
    cursor: pointer;
}

.fm-tag-chip button:hover {
    background: #c0392b;
    color: #fff;
}

body.app-dark-mode .fm-tag-dialog .mud-dialog-actions {
    background: #071d28;
}

body.app-dark-mode .fm-tag-hero__ico,
body.app-dark-mode .fm-tag-head__count,
body.app-dark-mode .fm-tag-chip button {
    background: #0a3144;
    color: #9fd0e6;
}

body.app-dark-mode .fm-tag-hero__kicker,
body.app-dark-mode .fm-tag-empty {
    color: #8eafbf;
}

body.app-dark-mode .fm-tag-hero__name,
body.app-dark-mode .fm-tag-head,
body.app-dark-mode .fm-tag-chip,
body.app-dark-mode .fm-tag-add input {
    color: #e6f2f8;
}

body.app-dark-mode .fm-tag-empty,
body.app-dark-mode .fm-tag-chip,
body.app-dark-mode .fm-tag-add input {
    background: #0a3144;
    border-color: #13485c;
}

body.app-dark-mode .fm-tag-chip button:hover {
    background: #c0392b;
    color: #fff;
}

/* Share dialogs on a phone: drop the repeated titles and explanations. */
@media (max-width: 768px) {
    .mud-dialog.share-create-dialog .mud-dialog-title {
        padding: 10px 12px 8px !important;
    }

    .share-create-header {
        align-items: center;
        gap: 8px;
    }

    .share-create-header__icon,
    .share-create-header__icon--app,
    .share-create-header__icon--external {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .share-create-header__title {
        font-size: 0.95rem !important;
    }

    .share-create-header__hint,
    .share-create-dialog--link .share-create-header__chip,
    .share-create-dialog--link .share-create-section__title,
    .share-create-option__desc,
    .share-create-option__icon,
    .share-dl__desc,
    .share-dl__icon,
    .share-create-dialog--app .share-recipient-tabs .mud-tab .mud-icon-root {
        display: none !important;
    }

    .share-create-body,
    .share-form-root {
        gap: 8px !important;
    }

    .share-create-dialog--link .share-create-section,
    .share-create-dialog--app .share-form-section {
        padding: 8px 10px;
        border-radius: 12px;
    }

    .share-create-dialog--link .share-create-section {
        background: transparent;
        border: 0;
        padding: 0;
    }

    .share-create-items {
        padding: 8px 10px;
    }

    .share-create-option,
    .share-dl__head {
        gap: 8px;
        min-height: 40px;
        padding: 4px 2px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .share-create-option.is-on,
    .share-dl.is-on {
        background: transparent;
        box-shadow: none;
    }

    .share-dl {
        margin-top: 0;
        border: 0;
        background: transparent;
    }

    .share-form-section-title {
        margin-bottom: 6px;
        font-size: 0.8rem;
    }

    .share-create-dialog--app .share-recipient-tabs .pa-3 {
        padding: 8px !important;
    }

    .share-selected-box {
        min-height: 0;
        padding: 8px;
    }

    .share-selected-empty {
        padding: 2px 4px;
        font-size: 0.78rem;
    }

    .share-create-dialog--app .share-dept-list,
    .share-dept-list {
        max-height: min(168px, 26vh) !important;
    }

    .mud-dialog.share-create-dialog .mud-dialog-actions,
    .mud-dialog.share-create-dialog--app .mud-dialog-actions,
    .share-create-dialog--app.mud-dialog .mud-dialog-actions {
        padding: 8px 10px 10px !important;
        min-height: 0 !important;
    }

    .mud-dialog.share-create-dialog .mud-dialog-actions .share-create-actions,
    .mud-dialog.share-create-dialog--app .mud-dialog-actions .share-create-actions,
    .share-create-dialog--app.mud-dialog .mud-dialog-actions .share-create-actions {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .mud-dialog.share-create-dialog .mud-dialog-actions .btnok,
    .mud-dialog.share-create-dialog .mud-dialog-actions .btnno,
    .mud-dialog.share-create-dialog--app .share-create-actions .btnok,
    .mud-dialog.share-create-dialog--app .share-create-actions .btnno,
    .share-create-dialog--app.mud-dialog .mud-dialog-actions .btnok,
    .share-create-dialog--app.mud-dialog .mud-dialog-actions .btnno {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        height: 42px !important;
    }
}
