/*
 * 制作管理システム Filament 共通テーマ
 *
 * Work / Master / Admin の全パネルから読み込まれます。
 * 画面固有の調整は各画面側へ置き、共通ルールのみをここに追加してください。
 */

:root {
    --app-section-gap: 1rem;
    --app-section-radius: 0.75rem;
}

/* システム名を1行で表示し、サイドバー内で過度に大きくしない。 */
.fi-sidebar-header .fi-logo,
.fi-topbar .fi-logo {
    font-size: 0.9em !important;
    line-height: 1.15 !important;
    letter-spacing: -0.08em !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.fi-sidebar-header {
    gap: 0.5rem !important;
}

/* 業務画面で横幅を有効活用する。 */
.fi-main,
.fi-main-ctn {
    width: 100%;
    max-width: none;
}

/* セクションの見た目と間隔を全パネルで統一する。 */
.fi-section {
    /*
     * Filament Select / dropdown / popover を
     * Section境界で切断しない。
     * 折りたたみは app-unified-collapsed 側の
     * display:none で制御する。
     */
    overflow: visible;
    border-radius: var(--app-section-radius);
}

.fi-section + .fi-section {
    margin-top: var(--app-section-gap);
}

.fi-section-header {
    min-height: 3.25rem;
    align-items: center;
}

.fi-section-content-ctn,
.fi-section-content {
    width: 100%;
}

/* 長い入力項目やテーブルが親要素を押し広げないようにする。 */
.fi-section .fi-fo-component-ctn,
.fi-section .fi-fo-field-wrp,
.fi-section .fi-ta-ctn {
    min-width: 0;
    width: 100%;
}

.fi-section .grid {
    align-items: start;
}

.fi-section-heading,
.fi-section-description {
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .fi-topbar .fi-logo {
        font-size: 0.9em !important;
    }

    .fi-section-header,
    .fi-section-content-ctn,
    .fi-section-content {
        padding-inline: 1rem !important;
    }

    /* 4列フォームなどをスマートフォンでは1列に統一する。 */
    .fi-section .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .fi-section .col-span-1,
    .fi-section .col-span-2,
    .fi-section [class*='col-span-'] {
        grid-column: 1 / -1 !important;
    }
}

/*
 * 全画面のセクション見出しを左寄せで統一する。
 * Filamentの標準クラスと、内側のflex/grid要素の双方を明示的に左寄せする。
 */
html body .fi-section > .fi-section-header {
    width: 100% !important;
    text-align: left !important;
    align-items: stretch !important;
}

html body .fi-section > .fi-section-header > div.flex.items-center.gap-3 {
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

html body .fi-section > .fi-section-header > div.flex.items-center.gap-3 > .grid.flex-1 {
    width: 100% !important;
    min-width: 0 !important;
    justify-items: start !important;
    text-align: left !important;
    margin-inline: 0 auto !important;
}

html body .fi-section .fi-section-header-heading,
html body .fi-section .fi-section-header-description {
    width: 100% !important;
    text-align: left !important;
    justify-self: start !important;
    margin-inline: 0 !important;
}

/* 開閉ボタンやヘッダー操作は右端に配置する。 */
html body .fi-section > .fi-section-header .fi-icon-btn,
html body .fi-section > .fi-section-header .fi-section-header-actions,
html body .fi-section > .fi-section-header [class*="header-action"] {
    margin-inline-start: auto !important;
    flex: 0 0 auto !important;
}

/* app-semantic-ui:start
 * 業務状態・参照項目・概要カードの共通表現。
 * パネル識別色とは分離し、操作の意味に応じて色を使う。
 */
:root {
    --app-semantic-primary-bg: rgb(219 234 254);
    --app-semantic-primary-text: rgb(30 64 175);
    --app-semantic-success-bg: rgb(220 252 231);
    --app-semantic-success-text: rgb(22 101 52);
    --app-semantic-warning-bg: rgb(254 249 195);
    --app-semantic-warning-text: rgb(133 77 14);
    --app-semantic-danger-bg: rgb(254 226 226);
    --app-semantic-danger-text: rgb(153 27 27);
    --app-semantic-gray-bg: rgb(243 244 246);
    --app-semantic-gray-text: rgb(55 65 81);
}

.app-record-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(255 255 255);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.app-overview-item {
    display: grid;
    align-content: center;
    gap: 0.25rem;
    min-width: 0;
}

.app-overview-item.is-wide {
    grid-column: span 2 / span 2;
}

.app-overview-label {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
}

.app-overview-value {
    min-width: 0;
    overflow: hidden;
    color: rgb(17 24 39);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-status-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1rem;
}

.app-status-badge::before {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: currentColor;
    content: '';
}

.app-status-badge.is-primary {
    background: var(--app-semantic-primary-bg);
    color: var(--app-semantic-primary-text);
}

.app-status-badge.is-success {
    background: var(--app-semantic-success-bg);
    color: var(--app-semantic-success-text);
}

.app-status-badge.is-warning {
    background: var(--app-semantic-warning-bg);
    color: var(--app-semantic-warning-text);
}

.app-status-badge.is-danger {
    background: var(--app-semantic-danger-bg);
    color: var(--app-semantic-danger-text);
}

.app-status-badge.is-gray {
    background: var(--app-semantic-gray-bg);
    color: var(--app-semantic-gray-text);
}

/* 参照セクションは編集セクションより控えめな背景にする。 */
.app-reference-section.fi-section,
.fi-section.app-reference-section {
    border-color: rgb(209 213 219);
    background: rgb(249 250 251);
}

.app-reference-section > .fi-section-header {
    background: rgb(243 244 246 / 0.75);
}

/* disabledを薄くし過ぎず、参照項目であることを明確にする。 */
.fi-fo-field-wrp input:disabled,
.fi-fo-field-wrp textarea:disabled,
.fi-fo-field-wrp select:disabled,
.fi-input:disabled {
    border-color: rgb(209 213 219) !important;
    background: rgb(243 244 246) !important;
    color: rgb(55 65 81) !important;
    cursor: default !important;
    opacity: 1 !important;
}

fieldset:disabled .fi-section {
    border-color: rgb(209 213 219);
}

fieldset:disabled .fi-section-content-ctn,
fieldset:disabled .fi-section-content {
    background: rgb(249 250 251 / 0.45);
}

.dark .app-record-overview {
    border-color: rgb(55 65 81);
    background: rgb(17 24 39);
}

.dark .app-overview-label {
    color: rgb(156 163 175);
}

.dark .app-overview-value {
    color: rgb(243 244 246);
}

.dark .app-status-badge.is-primary {
    background: rgb(30 58 138 / 0.55);
    color: rgb(191 219 254);
}

.dark .app-status-badge.is-success {
    background: rgb(20 83 45 / 0.55);
    color: rgb(187 247 208);
}

.dark .app-status-badge.is-warning {
    background: rgb(113 63 18 / 0.55);
    color: rgb(254 240 138);
}

.dark .app-status-badge.is-danger {
    background: rgb(127 29 29 / 0.55);
    color: rgb(254 202 202);
}

.dark .app-status-badge.is-gray {
    background: rgb(55 65 81);
    color: rgb(229 231 235);
}

.dark .app-reference-section.fi-section,
.dark .fi-section.app-reference-section {
    border-color: rgb(75 85 99);
    background: rgb(31 41 55 / 0.55);
}

.dark .app-reference-section > .fi-section-header {
    background: rgb(55 65 81 / 0.45);
}

.dark .fi-fo-field-wrp input:disabled,
.dark .fi-fo-field-wrp textarea:disabled,
.dark .fi-fo-field-wrp select:disabled,
.dark .fi-input:disabled {
    border-color: rgb(75 85 99) !important;
    background: rgb(31 41 55) !important;
    color: rgb(209 213 219) !important;
}

.dark fieldset:disabled .fi-section-content-ctn,
.dark fieldset:disabled .fi-section-content {
    background: rgb(31 41 55 / 0.25);
}

@media (max-width: 767px) {
    .app-record-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-overview-item.is-wide {
        grid-column: auto;
    }
}
/* app-semantic-ui:end */
/* app-responsive-grid-fallback:start
 * Filamentへ追加する独自Blade内のレスポンシブgrid指定を共通化する。
 * Vite/Tailwindの生成有無に依存せず、既存の sm:/md:/lg:/xl:grid-cols-* を有効にする。
 */
.grid {
    display: grid;
    min-width: 0;
}

.grid > * {
    min-width: 0;
}

[class~="grid-cols-1"] {
    grid-template-columns: minmax(0, 1fr);
}

[class~="grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[class~="grid-cols-3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
    [class~="sm:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="sm:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) {
    [class~="md:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    [class~="md:grid-cols-7"] {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    [class~="lg:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="lg:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1280px) {
    [class~="xl:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-5"] {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-6"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-7"] {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }

    [class~="xl:grid-cols-[1.4fr_1fr]"] {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important;
    }
}

/* 数値集計は同じ高さに揃え、狭い列でも値がはみ出さないようにする。 */
.fi-section .grid > div,
.app-record-overview > div {
    min-width: 0;
}

.fi-section .grid .text-2xl,
.fi-section .grid .text-xl,
.app-record-overview .app-overview-value {
    overflow-wrap: anywhere;
}

/* スマートフォンでは従来どおり1列を優先する。 */
@media (max-width: 767px) {
    .fi-section .grid[class*="grid-cols-"],
    .fi-section .grid[class*="sm:grid-cols-"],
    .fi-section .grid[class*="md:grid-cols-"],
    .fi-section .grid[class*="lg:grid-cols-"],
    .fi-section .grid[class*="xl:grid-cols-"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
/* app-responsive-grid-fallback:end */

/* app-business-tabs:start
 * Access版に近い「見える・迷わない」業務タブ。
 * PCは折返して全項目を見せ、横スクロールや左右ボタンを不要にする。
 * 狭い画面だけ横スクロールに退避する。
 */
.business-tabs { min-width: 0; }
.business-tabs__bar {
    display: block;
    min-width: 0;
    border-bottom: 1px solid rgb(229 231 235);
}
.business-tabs__scroll-button { display: none !important; }
.business-tabs__scroller { min-width: 0; overflow: visible; }
.business-tabs__list {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.2rem 0.25rem;
    padding: 0.2rem 0.25rem 0;
}
.business-tabs__group-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: rgb(107 114 128);
    padding: 0.55rem 0.35rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.business-tabs__tab {
    display: inline-flex;
    min-height: 2.35rem;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: 0.35rem 0.35rem 0 0;
    background: transparent;
    color: rgb(75 85 99);
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.15rem;
    white-space: nowrap;
}
.business-tabs__tab:hover { background: rgb(249 250 251); color: rgb(31 41 55); }
.business-tabs__tab:focus-visible { outline: 2px solid rgb(59 130 246); outline-offset: -2px; }
.business-tabs__tab.is-active {
    border-color: rgb(191 219 254);
    border-bottom-color: rgb(37 99 235);
    background: rgb(239 246 255);
    color: rgb(29 78 216);
}
.business-tabs__tab-main { display: inline-flex; align-items: center; gap: 0.35rem; }
.business-tabs__count {
    display: inline-flex;
    min-width: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(243 244 246);
    color: rgb(75 85 99);
    padding: 0.05rem 0.35rem;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.business-tabs__tab.is-active .business-tabs__count { background: rgb(219 234 254); color: rgb(30 64 175); }
.business-tabs__hint { display: none !important; }
.business-tabs__content { min-width: 0; }
.dark .business-tabs__bar { border-bottom-color: rgb(255 255 255 / 0.1); }
.dark .business-tabs__group-label { color: rgb(156 163 175); }
.dark .business-tabs__tab { color: rgb(156 163 175); }
.dark .business-tabs__tab:hover { background: rgb(255 255 255 / 0.05); color: rgb(229 231 235); }
.dark .business-tabs__tab.is-active { border-color: rgb(59 130 246 / 0.45); background: rgb(59 130 246 / 0.1); color: rgb(147 197 253); }
.dark .business-tabs__count { background: rgb(55 65 81); color: rgb(209 213 219); }
@media (max-width: 767px) {
    .business-tabs__scroller { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
    .business-tabs__list { width: max-content; min-width: 100%; flex-wrap: nowrap; }
}
/* app-business-tabs:end */

/* app-unsaved-changes:start
 * 業務フォームの未保存・保存中・保存済み状態を共通表示する。
 */
.business-save-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.1);
    backdrop-filter: blur(8px);
}

.business-save-bar.is-compact {
    position: static;
    justify-content: flex-end;
    box-shadow: none;
    background: rgb(249 250 251);
}

.business-save-status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    color: rgb(75 85 99);
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.business-save-status__dot {
    width: 0.625rem;
    height: 0.625rem;
    flex: 0 0 0.625rem;
    border-radius: 9999px;
    background: rgb(34 197 94);
    box-shadow: 0 0 0 3px rgb(34 197 94 / 0.14);
}

.business-save-status.is-dirty {
    color: rgb(180 83 9);
    font-weight: 700;
}

.business-save-status.is-dirty .business-save-status__dot {
    background: rgb(245 158 11);
    box-shadow: 0 0 0 3px rgb(245 158 11 / 0.16);
}

.business-save-status.is-saving {
    color: rgb(29 78 216);
    font-weight: 700;
}

.business-save-status.is-saving .business-save-status__dot {
    background: rgb(59 130 246);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.16);
    animation: business-save-pulse 1.1s ease-in-out infinite;
}

.business-save-status__text {
    flex: 0 0 auto;
}

.business-save-status__hint {
    min-width: 0;
    color: rgb(107 114 128);
    font-weight: 400;
}

.dark .business-save-bar {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(17 24 39 / 0.96);
}

.dark .business-save-bar.is-compact {
    background: rgb(255 255 255 / 0.04);
}

.dark .business-save-status {
    color: rgb(209 213 219);
}

.dark .business-save-status.is-dirty {
    color: rgb(253 186 116);
}

.dark .business-save-status.is-saving {
    color: rgb(147 197 253);
}

.dark .business-save-status__hint {
    color: rgb(156 163 175);
}

@keyframes business-save-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 767px) {
    .business-save-bar {
        bottom: 0.5rem;
        align-items: stretch;
        flex-direction: column;
    }

    .business-save-status {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .business-save-status__hint {
        width: 100%;
        padding-left: 1.125rem;
    }

    .business-save-bar .fi-btn {
        width: 100%;
        justify-content: center;
    }
}
/* app-unsaved-changes:end */


/* business-detail-table:start
 * 横長の業務明細を、列幅制御・折り返し・固定列・列切替で扱いやすくする。
 * 画面幅が狭い場合は固定列を解除し、セル同士の重なりを防止する。
 */
.business-detail-table {
    position: relative;
    min-width: 0;
    max-width: 100%;
    container-name: business-detail-table;
    container-type: inline-size;
}

.business-detail-table .fi-ta-ctn,
.business-detail-table .fi-ta-content-ctn,
.business-detail-table .fi-ta-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

.business-detail-table .fi-ta-content {
    position: relative;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    isolation: isolate;
    box-shadow: inset -10px 0 12px -14px rgb(15 23 42 / 0.45), inset 10px 0 12px -14px rgb(15 23 42 / 0.3);
    -webkit-overflow-scrolling: touch;
}

/* 長い文字列で列が無制限に広がらないよう、セルごとに幅と折り返しを管理する。 */
.business-detail-table .fi-ta-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
}

.business-detail-table .fi-ta-cell,
.business-detail-table .fi-ta-header-cell,
.business-detail-table th,
.business-detail-table td {
    box-sizing: border-box;
    min-width: 7.5rem;
    max-width: 18rem;
    vertical-align: middle;
}

/* Filament内側のnowrapや最小幅がセル外へ文字を描画しないようにする。 */
.business-detail-table .fi-ta-cell > *,
.business-detail-table .fi-ta-header-cell > *,
.business-detail-table td > *,
.business-detail-table th > * {
    min-width: 0 !important;
    max-width: 100%;
}

.business-detail-table .fi-ta-text,
.business-detail-table .fi-ta-text-item,
.business-detail-table .fi-ta-header-cell-label,
.business-detail-table .fi-ta-header-cell-label span,
.business-detail-table td span:not(.fi-badge),
.business-detail-table th span:not(.fi-badge) {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}

.business-detail-table .business-table-primary-column {
    position: sticky !important;
    left: 0;
    z-index: 4;
    width: 16rem;
    min-width: 12rem;
    max-width: 22rem;
    overflow: hidden;
    background: rgb(255 255 255);
    box-shadow: 1px 0 0 rgb(229 231 235), 8px 0 12px -12px rgb(15 23 42 / 0.55);
    white-space: normal !important;
}

.business-detail-table .business-table-primary-column .fi-ta-text,
.business-detail-table .business-table-primary-column .fi-ta-text-item,
.business-detail-table .business-table-primary-column span:not(.fi-badge) {
    display: block;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.business-detail-table thead .business-table-primary-column {
    z-index: 7;
    background: rgb(249 250 251);
}

.business-detail-table tbody tr:hover .business-table-primary-column {
    background: rgb(249 250 251);
}

.business-detail-table .business-table-secondary-column {
    width: 11rem;
    min-width: 8rem;
    max-width: 15rem;
}

.business-detail-table .business-table-code-column {
    width: 8rem;
    min-width: 6rem;
    max-width: 10rem;
}

.business-detail-table .business-table-amount-column {
    width: 9rem;
    min-width: 7.5rem;
    max-width: 11rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.business-detail-table .business-table-amount-column .fi-ta-text,
.business-detail-table .business-table-amount-column .fi-ta-text-item,
.business-detail-table .business-table-amount-column span {
    white-space: nowrap !important;
    overflow-wrap: normal;
    word-break: normal;
}

/* Filamentの行操作セルを右端へ固定する。 */
.business-detail-table .fi-ta-actions-header-cell,
.business-detail-table .fi-ta-actions-cell,
.business-detail-table th:has(.fi-ta-actions),
.business-detail-table td:has(.fi-ta-actions) {
    position: sticky !important;
    right: 0;
    z-index: 5;
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 9rem;
    overflow: visible;
    background: rgb(255 255 255);
    box-shadow: -1px 0 0 rgb(229 231 235), -8px 0 12px -12px rgb(15 23 42 / 0.55);
}

.business-detail-table thead .fi-ta-actions-header-cell,
.business-detail-table thead th:has(.fi-ta-actions) {
    z-index: 8;
    background: rgb(249 250 251);
}

.business-detail-table tbody tr:hover .fi-ta-actions-cell,
.business-detail-table tbody tr:hover td:has(.fi-ta-actions) {
    background: rgb(249 250 251);
}

.business-table-mobile-guide {
    display: none;
}

.dark .business-detail-table .business-table-primary-column,
.dark .business-detail-table .fi-ta-actions-header-cell,
.dark .business-detail-table .fi-ta-actions-cell,
.dark .business-detail-table th:has(.fi-ta-actions),
.dark .business-detail-table td:has(.fi-ta-actions) {
    background: rgb(17 24 39);
    box-shadow: 1px 0 0 rgb(55 65 81), 8px 0 12px -12px rgb(0 0 0 / 0.8);
}

.dark .business-detail-table thead .business-table-primary-column,
.dark .business-detail-table thead .fi-ta-actions-header-cell,
.dark .business-detail-table thead th:has(.fi-ta-actions),
.dark .business-detail-table tbody tr:hover .business-table-primary-column,
.dark .business-detail-table tbody tr:hover .fi-ta-actions-cell,
.dark .business-detail-table tbody tr:hover td:has(.fi-ta-actions) {
    background: rgb(31 41 55);
}

/* 左右の固定列を置く余裕がない幅では固定を解除し、中央列への重なりを防ぐ。 */
@container business-detail-table (max-width: 60rem) {
    .business-detail-table .business-table-primary-column,
    .business-detail-table .fi-ta-actions-header-cell,
    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table th:has(.fi-ta-actions),
    .business-detail-table td:has(.fi-ta-actions) {
        position: static !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        box-shadow: none !important;
    }

    .business-detail-table .business-table-primary-column {
        width: 14rem;
        min-width: 10rem;
        max-width: 18rem;
    }
}

/* container query非対応時の安全側フォールバック。 */
@media (max-width: 1023px) {
    .business-detail-table .business-table-primary-column,
    .business-detail-table .fi-ta-actions-header-cell,
    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table th:has(.fi-ta-actions),
    .business-detail-table td:has(.fi-ta-actions) {
        position: static !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        box-shadow: none !important;
    }
}

@media (max-width: 767px) {
    .business-table-mobile-guide {
        display: flex;
        align-items: flex-start;
        gap: 0.375rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid rgb(191 219 254);
        border-radius: 0.5rem;
        background: rgb(239 246 255);
        color: rgb(30 64 175);
        font-size: 0.75rem;
        line-height: 1.35rem;
    }

    .dark .business-table-mobile-guide {
        border-color: rgb(30 64 175);
        background: rgb(23 37 84 / 0.55);
        color: rgb(191 219 254);
    }

    /* スマートフォンは主要項目だけの要約行にする。 */
    .business-detail-table .business-table-secondary-column,
    .business-detail-table .business-table-code-column {
        display: none !important;
    }

    .business-detail-table .fi-ta-cell,
    .business-detail-table .fi-ta-header-cell,
    .business-detail-table th,
    .business-detail-table td {
        min-width: 6.5rem;
        max-width: 13rem;
    }

    .business-detail-table .business-table-primary-column {
        width: 12rem;
        min-width: 9rem;
        max-width: 14rem;
    }

    .business-detail-table .fi-ta-actions-cell,
    .business-detail-table td:has(.fi-ta-actions) {
        width: 6.5rem;
        min-width: 6.5rem;
        max-width: 7.5rem;
    }
}
/* business-detail-table:end */

/* app-table-overlap-guard:start
 * 一覧表を画面幅へ無理に圧縮せず、列の必要幅を維持したまま横スクロールさせる。
 * セル内文字は列外へ描画させず、長い名称列だけを折り返す。
 */
.fi-ta-ctn,
.fi-ta-content-ctn,
.fi-ta-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

.fi-ta-content {
    position: relative;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

/* Filament標準のwidth:100%で列を潰さず、内容に必要な横幅を確保する。 */
.fi-ta-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
}

.fi-ta-header-cell,
.fi-ta-cell {
    box-sizing: border-box;
    width: auto !important;
    min-width: 6.5rem;
    max-width: none;
    overflow: hidden;
    vertical-align: middle;
}

.fi-ta-header-cell > *,
.fi-ta-cell > * {
    min-width: 0 !important;
    max-width: 100%;
}

.fi-ta-header-cell-label,
.fi-ta-header-cell-label span {
    white-space: nowrap !important;
}

/* 通常列は1行を保ち、列幅を確保する。これにより隣のセルへの重なりを防ぐ。 */
.fi-ta-cell .fi-ta-text,
.fi-ta-cell .fi-ta-text-item {
    min-width: max-content;
    max-width: 100%;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

.fi-ta-cell .fi-badge {
    max-width: 100%;
    white-space: nowrap;
}

/* 行操作は最終更新列と重ならないよう、必要幅を独立して確保する。 */
.fi-ta-actions-header-cell,
.fi-ta-actions-cell,
th:has(> .fi-ta-actions),
td:has(> .fi-ta-actions) {
    width: 1% !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.fi-ta-actions {
    display: flex !important;
    min-width: max-content;
    flex-wrap: nowrap !important;
    align-items: center;
    white-space: nowrap;
}

/* 一覧画面の業務列幅。PHP側のextraHeaderAttributes / extraCellAttributesから使用する。 */
.business-list-short-column {
    width: 4.5rem !important;
    min-width: 4.5rem !important;
}

.business-list-key-column {
    width: 9.5rem !important;
    min-width: 8.5rem !important;
}

.business-list-code-column {
    width: 10rem !important;
    min-width: 8.5rem !important;
}

.business-list-title-column {
    width: 18rem !important;
    min-width: 14rem !important;
    max-width: 22rem !important;
}

.business-list-title-column .fi-ta-text,
.business-list-title-column .fi-ta-text-item {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden !important;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.4;
}

.business-list-number-column {
    width: 8rem !important;
    min-width: 7rem !important;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.business-list-status-column {
    width: 7rem !important;
    min-width: 6.5rem !important;
    text-align: center;
}

.business-list-progress-column {
    width: 9rem !important;
    min-width: 8.5rem !important;
    text-align: center;
}

.business-list-date-short-column {
    width: 7.5rem !important;
    min-width: 7rem !important;
    font-variant-numeric: tabular-nums;
}

.business-list-date-column {
    width: 11rem !important;
    min-width: 10.5rem !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.business-list-number-column .fi-ta-text,
.business-list-number-column .fi-ta-text-item,
.business-list-date-short-column .fi-ta-text,
.business-list-date-short-column .fi-ta-text-item,
.business-list-date-column .fi-ta-text,
.business-list-date-column .fi-ta-text-item {
    white-space: nowrap !important;
}

/* 狭い画面でも列を潰さず横スクロールする。名称列だけ少し小さくする。 */
@media (max-width: 1023px) {
    .business-list-title-column {
        width: 15rem !important;
        min-width: 12rem !important;
        max-width: 18rem !important;
    }

    .fi-ta-actions {
        gap: 0.5rem !important;
    }
}

@media (max-width: 639px) {
    .business-list-title-column {
        width: 13rem !important;
        min-width: 10rem !important;
        max-width: 15rem !important;
    }

    .business-list-key-column,
    .business-list-code-column {
        min-width: 8rem !important;
    }
}
/* app-table-overlap-guard:end */


/* business-primary-action-guard:start */
[data-requires-clean-form="true"].business-workflow-action--blocked {
    cursor: not-allowed !important;
    filter: saturate(0.35);
    opacity: 0.55;
}

[data-requires-clean-form="true"].business-workflow-action--blocked:hover,
[data-requires-clean-form="true"].business-workflow-action--blocked:focus-visible {
    filter: saturate(0.35);
    opacity: 0.55;
}
/* business-primary-action-guard:end */

/* screen-specific-usability:start */
.business-tabs__group-label {
    display: inline-flex;
    min-height: 2.85rem;
    flex: 0 0 auto;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0 0.6rem;
    border-left: 2px solid rgb(203 213 225);
    color: rgb(71 85 105);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.business-tabs__tab {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.business-tabs__tab-main {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.business-tabs__subtotal {
    color: rgb(100 116 139);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
}

.business-tabs__tab.is-active .business-tabs__subtotal {
    color: rgb(37 99 235);
}

.business-tab-loading {
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px dashed rgb(147 197 253);
    border-radius: 0.75rem;
    background: rgb(239 246 255 / 0.9);
    color: rgb(30 64 175);
    font-size: 0.875rem;
    font-weight: 700;
}

.business-tab-loading__spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid rgb(191 219 254);
    border-top-color: rgb(37 99 235);
    border-radius: 9999px;
    animation: business-tab-spin 0.8s linear infinite;
}

.business-workflow-guide {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-workflow-guide__item {
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: rgb(248 250 252);
    padding: 0.8rem 0.9rem;
}

.business-workflow-guide__item.is-current {
    border-color: rgb(96 165 250);
    background: rgb(239 246 255);
    box-shadow: 0 0 0 2px rgb(59 130 246 / 0.08);
}

.business-workflow-guide__title {
    color: rgb(15 23 42);
    font-size: 0.82rem;
    font-weight: 800;
}

.business-workflow-guide__description {
    margin-top: 0.25rem;
    color: rgb(71 85 105);
    font-size: 0.75rem;
    line-height: 1.35rem;
}

.business-stepper {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-stepper__step {
    position: relative;
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.8rem;
    background: rgb(255 255 255);
    padding: 0.9rem 0.9rem 0.9rem 3.2rem;
}

.business-stepper__number {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(37 99 235);
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
}

.business-stepper__title {
    color: rgb(15 23 42);
    font-size: 0.88rem;
    font-weight: 800;
}

.business-stepper__description {
    margin-top: 0.2rem;
    color: rgb(71 85 105);
    font-size: 0.75rem;
    line-height: 1.3rem;
}

.business-execution-summary {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-execution-summary__item {
    min-width: 0;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: rgb(248 250 252);
    padding: 0.8rem;
}

.business-execution-summary__label {
    color: rgb(100 116 139);
    font-size: 0.7rem;
    font-weight: 700;
}

.business-execution-summary__value {
    margin-top: 0.2rem;
    color: rgb(15 23 42);
    font-size: 0.95rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.business-save-bar--attention {
    animation: business-save-attention 0.6s ease-in-out 2;
}

.dark .business-tabs__group-label {
    border-left-color: rgb(71 85 105);
    color: rgb(148 163 184);
}

.dark .business-tabs__subtotal,
.dark .business-workflow-guide__description,
.dark .business-stepper__description {
    color: rgb(148 163 184);
}

.dark .business-tabs__tab.is-active .business-tabs__subtotal {
    color: rgb(147 197 253);
}

.dark .business-tab-loading {
    border-color: rgb(30 64 175);
    background: rgb(30 58 138 / 0.18);
    color: rgb(191 219 254);
}

.dark .business-workflow-guide__item,
.dark .business-stepper__step,
.dark .business-execution-summary__item {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(255 255 255 / 0.035);
}

.dark .business-workflow-guide__item.is-current {
    border-color: rgb(59 130 246);
    background: rgb(30 58 138 / 0.2);
}

.dark .business-workflow-guide__title,
.dark .business-stepper__title,
.dark .business-execution-summary__value {
    color: rgb(241 245 249);
}

.dark .business-execution-summary__label {
    color: rgb(148 163 184);
}

@keyframes business-tab-spin {
    to { transform: rotate(360deg); }
}

@keyframes business-save-attention {
    0%, 100% { box-shadow: 0 8px 24px rgb(0 0 0 / 0.1); }
    50% { box-shadow: 0 0 0 4px rgb(245 158 11 / 0.32), 0 8px 24px rgb(0 0 0 / 0.1); }
}

@media (max-width: 900px) {
    .business-workflow-guide,
    .business-stepper,
    .business-execution-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* screen-specific-usability:end */

/* invoice-step-overlap-hotfix:start */
.business-stepper--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-stepper--four .business-stepper__step {
    position: static;
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: start;
    column-gap: 0.7rem;
    min-width: 0;
    padding: 0.9rem;
}

.business-stepper--four .business-stepper__number {
    position: static;
    flex: none;
    grid-column: 1;
    grid-row: 1;
}

.business-stepper--four .business-stepper__content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.business-stepper--four .business-stepper__title,
.business-stepper--four .business-stepper__description {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 1180px) {
    .business-stepper--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .business-stepper--four {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* invoice-step-overlap-hotfix:end */

/* app-user-interface-settings:start
   ユーザー別配色・共通UI・ユーザーメニュー幅調整。 */
:root {
        --app-user-sidebar-color: #334155;
        --app-user-sidebar-text: rgb(255 255 255 / 0.94);
        --app-user-sidebar-hover: rgb(255 255 255 / 0.16);
        --app-user-sidebar-hover-subtle: rgb(255 255 255 / 0.12);
        --app-user-sidebar-focus: rgb(255 255 255 / 0.8);
        --app-user-topbar-color: #1d4ed8;
        --app-user-topbar-text: rgb(255 255 255 / 0.96);
        --app-user-topbar-hover: rgb(255 255 255 / 0.14);
    }

    .fi-sidebar,
    .fi-sidebar-header,
    .fi-sidebar-nav {
        background-color: var(--app-user-sidebar-color) !important;
    }

    .fi-sidebar .fi-logo,
    .fi-sidebar .fi-sidebar-group-label,
    .fi-sidebar .fi-sidebar-item-label,
    .fi-sidebar .fi-sidebar-item-icon,
    .fi-sidebar .fi-icon-btn,
    .fi-sidebar .fi-sidebar-header button,
    .fi-sidebar .fi-sidebar-header svg {
        color: var(--app-user-sidebar-text, rgb(255 255 255 / 0.94)) !important;
    }

    .fi-sidebar .fi-sidebar-item > a:hover,
    .fi-sidebar .fi-sidebar-item-active > a,
    .fi-sidebar .fi-sidebar-item.fi-active > a {
        background-color: var(--app-user-sidebar-hover, rgb(255 255 255 / 0.16)) !important;
    }

    .fi-sidebar .fi-sidebar-item > a:focus-visible,
    .fi-sidebar .fi-icon-btn:focus-visible {
        outline-color: var(--app-user-sidebar-focus, rgb(255 255 255 / 0.8)) !important;
    }

    .fi-sidebar .fi-sidebar-group-button:hover,
    .fi-sidebar .fi-sidebar-header button:hover {
        background-color: var(--app-user-sidebar-hover-subtle, rgb(255 255 255 / 0.12)) !important;
    }

    .fi-topbar > nav,
    .fi-topbar nav {
        background-color: var(--app-user-topbar-color) !important;
    }

    .fi-topbar .fi-logo,
    .fi-topbar .fi-icon-btn,
    .fi-topbar .fi-icon-btn svg,
    .fi-topbar button,
    .fi-topbar button svg {
        color: var(--app-user-topbar-text, rgb(255 255 255 / 0.96)) !important;
    }

    .fi-topbar .fi-icon-btn:hover,
    .fi-topbar button:hover {
        background-color: var(--app-user-topbar-hover, rgb(255 255 255 / 0.14)) !important;
    }

    .app-topbar-title {
        order: 20;
        display: flex;
        align-items: center;
        min-width: 0;
        max-width: min(52vw, 42rem);
        margin-inline: 0.35rem auto;
        overflow: hidden;
        color: var(--app-user-topbar-text, #fff);
        font-size: 0.93rem;
        font-weight: 700;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fi-topbar > nav > .ms-auto {
        order: 30;
    }

    .fi-topbar .fi-topbar-open-sidebar-btn,
    .fi-topbar .fi-topbar-close-sidebar-btn,
    .fi-topbar [data-sidebar-open-button],
    .fi-topbar [data-sidebar-close-button] {
        order: 10;
    }

    /* ユーザーメニューは標準14remより広げ、画面端ではビューポート内に収める。 */
    .app-user-menu-panel,
    .fi-dropdown-panel:has(.app-user-menu-company) {
        width: min(18rem, calc(100vw - 1rem)) !important;
        max-width: min(18rem, calc(100vw - 1rem)) !important;
        overflow-x: hidden !important;
    }

    .app-user-menu-company {
        display: grid;
        min-width: 0;
        max-width: 100%;
        gap: 0.2rem;
        margin: 0.35rem 0.5rem 0.55rem;
        padding: 0.65rem 0.75rem;
        overflow: hidden;
        border-radius: 0.55rem;
        background: rgb(241 245 249);
        color: rgb(30 41 59);
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .app-user-menu-company-label {
        display: block;
        min-width: 0;
        color: rgb(100 116 139);
        font-size: 0.68rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .app-user-menu-company-name {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        line-break: strict;
        white-space: normal;
    }

    .app-user-menu-panel .fi-dropdown-list-item-label,
    .fi-dropdown-panel:has(.app-user-menu-company) .fi-dropdown-list-item-label {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .dark .app-user-menu-company {
        background: rgb(51 65 85 / 0.65);
        color: rgb(241 245 249);
    }

    .dark .app-user-menu-company-label {
        color: rgb(203 213 225);
    }

    .app-system-footer {
        width: 100%;
        padding: 1.25rem 1rem 1.5rem;
        color: rgb(100 116 139);
        font-size: 0.75rem;
        text-align: center;
    }

    .dark .app-system-footer {
        color: rgb(148 163 184);
    }

    .app-user-list-avatar-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-user-list-avatar {
        width: 1.75rem;
        height: 1.75rem;
        border: 1px solid rgb(203 213 225);
        border-radius: 9999px;
        background: rgb(226 232 240);
        object-fit: cover;
    }

    @media (max-width: 767px) {
        .app-topbar-title {
            max-width: 58vw;
            font-size: 0.82rem;
        }

        .app-user-menu-panel,
        .fi-dropdown-panel:has(.app-user-menu-company) {
            width: min(17rem, calc(100vw - 0.75rem)) !important;
            max-width: min(17rem, calc(100vw - 0.75rem)) !important;
        }
    }
/* app-user-interface-settings:end */
/* app-user-avatar-white-circle:start */
.fi-user-avatar {
    box-sizing: border-box;
    border: 1px solid rgb(203 213 225) !important;
    border-radius: 9999px !important;
    background-color: rgb(255 255 255) !important;
    padding: 2px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.10);
}

.app-user-list-avatar {
    box-sizing: border-box;
    background-color: rgb(255 255 255) !important;
    padding: 1px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
/* app-user-avatar-white-circle:end */

/* PUBFLOW_AUTH_THEME_START */
/*
 * PubFlow authentication theme
 * 対象: Filament simple auth pages only (work / master / admin)
 * 通常のログイン後画面には影響させない。
 */

.fi-simple-layout {
    --pubflow-navy: #0d3b66;
    --pubflow-navy-deep: #082f5f;
    --pubflow-teal: #0f9b9d;
    --pubflow-teal-soft: #e9f7f7;
    --pubflow-text: #18324c;
    --pubflow-muted: #64748b;
    --pubflow-border: #dbe4ec;
    --pubflow-surface: #ffffff;
    --pubflow-canvas: #f5f7fa;

    position: relative !important;
    min-height: 100vh !important;
    background: var(--pubflow-canvas) !important;
    color: var(--pubflow-text) !important;
}

/* ログインカード側 */
.fi-simple-layout > .fi-simple-main-ctn {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    padding: 3rem clamp(2rem, 4vw, 5rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
        radial-gradient(circle at 95% 5%, rgba(15, 155, 157, .065), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #f4f7fa 100%) !important;
}

.fi-simple-layout .fi-simple-main {
    position: relative !important;
    width: min(100%, 540px) !important;
    max-width: 540px !important;
    margin: 0 !important;
    padding: clamp(2rem, 3.4vw, 3.25rem) !important;
    border: 1px solid var(--pubflow-border) !important;
    border-radius: 14px !important;
    background: var(--pubflow-surface) !important;
    box-shadow: 0 22px 55px rgba(13, 59, 102, .10), 0 3px 12px rgba(15, 23, 42, .05) !important;
    overflow: hidden !important;
}

.fi-simple-layout .fi-simple-main::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pubflow-navy) 0 58%, var(--pubflow-teal) 58% 100%);
    pointer-events: none;
}

/*
 * PubFlowはロゴ内の1回だけ表示する。
 * Filament側のbrandName文字列はログイン画面では非表示。
 */
.fi-simple-layout .fi-simple-header .fi-logo {
    display: none !important;
}

.fi-simple-layout .fi-simple-header::before {
    content: "";
    display: block;
    width: min(100%, 270px);
    height: 156px;
    margin: 0 auto 1.25rem;
    background: url('/images/pubflow-logo.png') center / contain no-repeat;
}

.fi-simple-layout .fi-simple-header {
    gap: .35rem !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
}

.fi-simple-layout .fi-simple-header-heading {
    color: var(--pubflow-navy-deep) !important;
    font-size: 1.6rem !important;
    font-weight: 760 !important;
    letter-spacing: .01em !important;
}

.fi-simple-layout .fi-simple-header-subheading {
    color: var(--pubflow-muted) !important;
    line-height: 1.7 !important;
}

/* 3パネルの識別。ブランド名ではなく機能区分だけを表示。 */
.fi-panel-work .fi-simple-layout .fi-simple-main::before,
.fi-panel-master .fi-simple-layout .fi-simple-main::before,
.fi-panel-admin .fi-simple-layout .fi-simple-main::before {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: .3rem .65rem;
    border: 1px solid #d8e3ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #52687d;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
}

.fi-panel-work .fi-simple-layout .fi-simple-main::before { content: "業務処理"; }
.fi-panel-master .fi-simple-layout .fi-simple-main::before { content: "業務マスタ管理"; }
.fi-panel-admin .fi-simple-layout .fi-simple-main::before { content: "システム管理"; }

/* 入力欄 */
.fi-simple-layout .fi-fo-field-wrp-label span,
.fi-simple-layout .fi-input-wrp-label {
    color: #243f58 !important;
    font-weight: 700 !important;
}

.fi-simple-layout .fi-input-wrp {
    min-height: 46px !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 0 0 1px var(--pubflow-border) !important;
    transition: box-shadow .16s ease, border-color .16s ease !important;
}

.fi-simple-layout .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 2px rgba(15, 155, 157, .35), 0 0 0 1px var(--pubflow-teal) !important;
}

.fi-simple-layout .fi-input,
.fi-simple-layout input[type="email"],
.fi-simple-layout input[type="password"],
.fi-simple-layout input[type="text"] {
    color: #142f49 !important;
}

/* アクションボタンは3パネルでPubFlow色へ統一 */
.fi-simple-layout .fi-btn.fi-color-primary,
.fi-simple-layout button[type="submit"].fi-btn {
    min-height: 46px !important;
    border-radius: 8px !important;
    background: linear-gradient(90deg, var(--pubflow-navy-deep), #0e437c) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 7px 16px rgba(8, 47, 95, .16) !important;
}

.fi-simple-layout .fi-btn.fi-color-primary:hover,
.fi-simple-layout button[type="submit"].fi-btn:hover {
    filter: brightness(1.07) !important;
}

.fi-simple-layout a:not(.fi-btn) {
    color: #1766a6 !important;
    text-decoration-color: rgba(23, 102, 166, .32) !important;
    text-underline-offset: 3px;
}

.fi-simple-layout .fi-checkbox-input:checked {
    background-color: var(--pubflow-teal) !important;
    border-color: var(--pubflow-teal) !important;
}

.fi-simple-layout .fi-form-actions {
    margin-top: .3rem !important;
}

.fi-simple-layout .fi-form-actions .fi-btn {
    width: 100% !important;
    justify-content: center !important;
}

.fi-simple-layout .fi-alert {
    border-radius: 8px !important;
}

/* 左側ブランドパネル */
@media (min-width: 1024px) {
    .fi-simple-layout {
        display: grid !important;
        grid-template-columns: minmax(520px, 1.08fr) minmax(480px, .92fr) !important;
        align-items: stretch !important;
        overflow: hidden !important;
    }

    /*
     * 左側は「1案」の完成ビジュアルをそのまま表示する。
     * contain で全体を見せ、余白部分は同じ画像の cover レイヤーを
     * 薄く敷いて、全画面でも左右が間延びしないようにする。
     */
    .fi-simple-layout::before {
        content: "";
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        min-height: 100vh;
        box-sizing: border-box;
        background-image:
            url('/images/pubflow-auth-left-first-design.jpg'),
            linear-gradient(90deg, rgba(248,251,253,.72), rgba(248,251,253,.36)),
            url('/images/pubflow-auth-left-first-design.jpg'),
            linear-gradient(135deg, #f8fbfd 0%, #eef5f8 100%);
        background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
        background-size: contain, cover, cover, cover;
        background-position: center center, center center, center center, center center;
        border-right: 1px solid #dce6ee;
    }

    /* 1案の画像内に見出し・説明が入っているためCSS文字は重ねない */
    .fi-simple-layout::after {
        display: none !important;
        content: none !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        grid-column: 2;
        grid-row: 1;
    }
}

/* 大型ディスプレイでは左右比率を維持しつつカードを肥大化させない */
@media (min-width: 1440px) {
    .fi-simple-layout {
        grid-template-columns: minmax(720px, 54fr) minmax(620px, 46fr) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(78%, 540px) !important;
        max-width: 540px !important;
    }
}

/* 横長ディスプレイでも左側ビジュアルの全体感を保つ */
@media (min-width: 1800px) {
    .fi-simple-layout .fi-simple-main {
        width: min(72%, 560px) !important;
        max-width: 560px !important;
    }
}




/* 右下の光和コンピューターロゴ */
.fi-simple-layout > .fi-simple-main-ctn::after {
    content: "";
    position: fixed;
    right: clamp(1rem, 2vw, 1.75rem);
    bottom: clamp(1rem, 2vw, 1.25rem);
    width: clamp(82px, 7.5vw, 112px);
    height: clamp(30px, 2.9vw, 42px);
    background: url('/images/kowa-computer-logo.png') right bottom / contain no-repeat;
    opacity: .92;
    pointer-events: none;
    z-index: 1;
}

/* タブレット・スマートフォンはシンプルな1カラム */
@media (max-width: 1023px) {
    .fi-simple-layout::before,
    .fi-simple-layout::after {
        display: none !important;
        content: none !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn::after {
        position: fixed;
        right: .85rem;
        bottom: .85rem;
        width: 74px;
        height: 26px;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        min-height: 100vh !important;
        padding: 2rem 1.25rem !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(100%, 520px) !important;
        padding: 2rem 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .fi-simple-layout > .fi-simple-main-ctn {
        padding: 1rem !important;
    }

    .fi-simple-layout .fi-simple-main {
        border-radius: 10px !important;
        padding: 1.75rem 1.15rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: 230px;
        height: 133px;
        margin-bottom: 1rem;
    }

    .fi-panel-work .fi-simple-layout .fi-simple-main::before,
    .fi-panel-master .fi-simple-layout .fi-simple-main::before,
    .fi-panel-admin .fi-simple-layout .fi-simple-main::before {
        top: .65rem;
        right: .65rem;
        font-size: .64rem;
    }
}



/*
 * ログイン後のPubFlowロゴ
 *
 * brandLogo画像には依存せず、Filament標準のbrandName表示枠(.fi-logo)を
 * 正式な透過PubFlowロゴの表示枠として使う。
 * これにより、メニュー折畳時・スマホで「PubFlow」という単色文字へ戻らない。
 *
 *  - デスクトップ・メニュー展開時: 左サイドバー左上
 *  - デスクトップ・メニュー折畳時: 上部バー（ハンバーガーの右側）
 *  - スマートフォン: 上部バー（ハンバーガーの右側）
 */
.fi-sidebar-header .fi-logo,
.fi-topbar .fi-logo {
    flex: 0 0 auto !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: contain !important;

    /* brandName文字は表示しない。正式ロゴ画像だけを見せる。 */
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    letter-spacing: 0 !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
}

/* メニュー展開時：サイドバーの選択色に合わせる。 */
.fi-sidebar-header .fi-logo {
    /* サイドメニュー展開時だけ、トップバー側より若干コンパクトに表示する。 */
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    background-size: 150px auto !important;
    background-image: var(
        --app-pubflow-sidebar-logo-image,
        url('/images/pubflow-menu-logo.png')
    ) !important;
}

/* メニュー折畳時・スマホ：トップバーの選択色に合わせる。 */
.fi-topbar .fi-logo {
    background-image: var(
        --app-pubflow-topbar-logo-image,
        url('/images/pubflow-menu-logo.png')
    ) !important;
}

/* brandLogoのimgが過去キャッシュ等で残っていても二重に出さない。 */
.fi-sidebar-header .fi-logo > img,
.fi-topbar .fi-logo > img {
    display: none !important;
}

/* 旧パッチのサイドバー背景ロゴは無効化。 */
.fi-sidebar-nav {
    background-image: none !important;
    padding-top: .5rem !important;
}

/* スマホでも小さくし過ぎない。ハンバーガー右横に元ロゴ比率のまま表示。 */
@media (max-width: 768px) {
    .fi-topbar .fi-logo {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
    }
}

/* ダークモード設定でも認証画面だけはブランド基準の明るい配色に統一 */
.dark .fi-simple-layout,
.dark .fi-simple-layout > .fi-simple-main-ctn,
.dark .fi-simple-layout .fi-simple-main {
    color-scheme: light;
}

.dark .fi-simple-layout .fi-simple-main {
    background: #fff !important;
    color: var(--pubflow-text) !important;
}
/* PUBFLOW_AUTH_THEME_END */

/* APP_TABLE_HEADER_THEME_START */
:root {
    --app-user-table-header-color: #e2e8f0;
    --app-user-table-header-text-color: #111827;
}

.fi-ta-table > thead,
.fi-ta-table > thead > tr,
.fi-ta-table > thead > tr > th,
.fi-ta-header-cell,
.fi-ta-actions-header-cell,
table > thead,
table > thead > tr,
table > thead > tr > th,
table > thead > tr > td,
.business-detail-table thead .business-table-primary-column,
.business-detail-table thead .fi-ta-actions-header-cell,
.business-detail-table thead th:has(.fi-ta-actions) {
    background-color: var(--app-user-table-header-color) !important;
    color: var(--app-user-table-header-text-color) !important;
}

.fi-ta-table > thead > tr > th *,
.fi-ta-header-cell *,
.fi-ta-actions-header-cell *,
.fi-ta-header-cell-label,
.fi-ta-header-cell-label span,
table > thead > tr > th *,
table > thead > tr > td * {
    color: var(--app-user-table-header-text-color) !important;
}

.dark .fi-ta-table > thead,
.dark .fi-ta-table > thead > tr,
.dark .fi-ta-table > thead > tr > th,
.dark .fi-ta-header-cell,
.dark table > thead,
.dark table > thead > tr,
.dark table > thead > tr > th,
.dark table > thead > tr > td {
    background-color: var(--app-user-table-header-color) !important;
    color: var(--app-user-table-header-text-color) !important;
}
/* APP_TABLE_HEADER_THEME_END */

/* ACCESS_WEB_AUDIT_V2_DENSE_BUSINESS_UI_START
 * Access版の一覧性を基準に、PC業務画面の縦方向の余白を抑える。
 * 認証画面・ユーザー設定・スマートフォンには適用しない。
 */
@media (min-width: 1024px) {
    .fi-panel-work .fi-main {
        padding-top: 1rem !important;
        padding-bottom: 1.25rem !important;
    }

    .fi-panel-work .fi-page > .gap-y-8,
    .fi-panel-work .fi-page > .gap-y-6,
    .fi-panel-work .fi-main-ctn > .gap-y-8,
    .fi-panel-work .fi-main-ctn > .gap-y-6 {
        row-gap: 1rem !important;
    }

    .fi-panel-work .fi-section-header {
        padding: .65rem .9rem !important;
    }

    .fi-panel-work .fi-section-content-ctn > .fi-section-content {
        padding: .8rem .9rem !important;
    }

    .fi-panel-work .fi-fo-component-ctn,
    .fi-panel-work .fi-fo-grid {
        gap: .65rem !important;
    }

    .fi-panel-work .fi-ta-header {
        padding: .65rem .8rem !important;
    }

    .fi-panel-work .fi-ta-cell,
    .fi-panel-work .fi-ta-header-cell {
        padding-top: .42rem !important;
        padding-bottom: .42rem !important;
    }

    .fi-panel-work .fi-modal-content {
        padding-top: .75rem !important;
        padding-bottom: .85rem !important;
    }
}

.business-dense-grid {
    border-collapse: collapse;
    border: 1px solid rgb(209 213 219);
}
.business-dense-grid th,
.business-dense-grid td {
    border: 1px solid rgb(209 213 219);
    padding: .38rem .48rem;
    vertical-align: middle;
    white-space: nowrap;
}
.business-dense-grid th {
    font-weight: 700;
    text-align: left;
}
.dark .business-dense-grid,
.dark .business-dense-grid th,
.dark .business-dense-grid td {
    border-color: rgb(75 85 99);
}

.business-key-value-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}
.business-key-value-grid > div {
    border: 1px solid rgb(229 231 235);
    border-radius: .5rem;
    padding: .6rem .75rem;
}
.business-key-value-grid span {
    display: block;
    margin-bottom: .2rem;
    font-size: .72rem;
    color: rgb(107 114 128);
}
.business-key-value-grid strong { display:block; }

@media (max-width: 900px) {
    .business-key-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    .fi-sidebar, .fi-topbar, .fi-header-actions, .fi-breadcrumbs, .print\\:hidden { display: none !important; }
    .fi-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .fi-main-ctn { margin: 0 !important; width: 100% !important; }
    .business-dense-grid { font-size: 9px !important; min-width: 0 !important; width: 100% !important; }
    .business-dense-grid th, .business-dense-grid td { padding: 2px 3px !important; white-space: normal !important; }
}
/* ACCESS_WEB_AUDIT_V2_DENSE_BUSINESS_UI_END */

/* APP_FILAMENT_SELECT_LAYER_UNIFIED_20260909_START
 * Filament 3 / Choices.js の検索式Selectを全画面で同じレイヤールールに統一する。
 *
 * 方針:
 * - Section自体で候補一覧をclipしない。
 * - Selectが開いている間だけ、その祖先(Field/Grid/Section/Modal)を前面化する。
 * - Choices本体と候補一覧を、後続Section・sticky保存バーより前面へ出す。
 * - 個別画面ごとのz-index/overflow修正は置かない。
 */
:root {
    --app-select-layer-section: 10000;
    --app-select-layer-ancestor: 10010;
    --app-select-layer-control: 10020;
    --app-select-layer-dropdown: 10030;
}

/* Filament Section の丸角は維持しつつ、Select候補はSection外へ出せるようにする。 */
html body .fi-section {
    overflow: visible !important;
}

/*
 * Choices.js が開いている枝だけを持ち上げる。
 * Grid/Field/Sectionの途中に stacking context / clipping があっても候補を隠さない。
 */
html body .fi-section-content-ctn:has(.choices.is-open),
html body .fi-section-content:has(.choices.is-open),
html body .fi-fo-component-ctn:has(.choices.is-open),
html body .fi-fo-grid:has(.choices.is-open),
html body .fi-grid-col:has(.choices.is-open),
html body .fi-fo-field-wrp:has(.choices.is-open),
html body form:has(.choices.is-open),
html body fieldset:has(.choices.is-open) {
    position: relative !important;
    z-index: var(--app-select-layer-ancestor) !important;
    overflow: visible !important;
    isolation: auto !important;
}

/* 後続Sectionやsticky操作バーより、Selectを含むSection全体を前面へ。 */
html body .fi-section:has(.choices.is-open) {
    position: relative !important;
    z-index: var(--app-select-layer-section) !important;
    overflow: visible !important;
    isolation: auto !important;
}

/* UI_MODAL_SELECT_WIDTH_LOCK_V3_20261006
 * モーダル内のsearchable Selectを開いたとき、候補の長い文字列や
 * Choices.jsのscrollWidthでモーダル全体の横幅を押し広げない。
 * 縦方向は既存のmodal-contentスクロールを使い、横方向だけ確実に閉じる。
 */
html body .fi-panel-work .fi-modal-window:has(.choices.is-open) {
    overflow: hidden !important;
    isolation: auto !important;
}

html body .fi-panel-work .fi-modal-content:has(.choices.is-open) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    isolation: auto !important;
}

/* Grid/fieldのmin-contentが候補文字列に引っ張られないようにする。 */
html body .fi-panel-work .fi-modal-content .fi-grid-col,
html body .fi-panel-work .fi-modal-content .fi-fo-field-wrp,
html body .fi-panel-work .fi-modal-content .choices {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* 候補一覧はSelect本体の横幅を上限とし、長い候補は折り返す。 */
html body .fi-panel-work .fi-modal-content .choices.is-open .choices__list--dropdown,
html body .fi-panel-work .fi-modal-content .choices.is-open .choices__list[aria-expanded] {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

html body .fi-panel-work .fi-modal-content .choices__item--choice {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Choices本体と候補一覧。 */
html body .choices.is-open {
    position: relative !important;
    z-index: var(--app-select-layer-control) !important;
    overflow: visible !important;
}

html body .choices.is-open .choices__list--dropdown,
html body .choices.is-open .choices__list[aria-expanded] {
    position: absolute !important;
    z-index: var(--app-select-layer-dropdown) !important;
}
/* APP_FILAMENT_SELECT_LAYER_UNIFIED_20260909_END */


/* MASTER_TABLE_PREFERENCES_V1_4_20260912
 * 業務マスタ一覧の一括選択チェック列だけを少しコンパクトにする。
 * :has() は現在利用しているChromium系ブラウザで利用可能。
 */
@media (min-width: 1024px) {
    .fi-panel-master .fi-ta-table .fi-ta-selection-cell,
    .fi-panel-master .fi-ta-table .fi-ta-selection-header-cell,
    .fi-panel-master .fi-ta-table > thead > tr > th:first-child:has(.fi-checkbox-input),
    .fi-panel-master .fi-ta-table > tbody > tr > td:first-child:has(.fi-checkbox-input) {
        width: 2.5rem !important;
        min-width: 2.5rem !important;
        max-width: 2.5rem !important;
        padding-left: .375rem !important;
        padding-right: .375rem !important;
    }

    .fi-panel-master .fi-ta-table .fi-ta-selection-cell .fi-checkbox-input,
    .fi-panel-master .fi-ta-table .fi-ta-selection-header-cell .fi-checkbox-input,
    .fi-panel-master .fi-ta-table > thead > tr > th:first-child:has(.fi-checkbox-input) .fi-checkbox-input,
    .fi-panel-master .fi-ta-table > tbody > tr > td:first-child:has(.fi-checkbox-input) .fi-checkbox-input {
        margin-inline: auto !important;
    }
}

/* PUBFLOW_DARK_MODE_DESIGN_V1_20260918_START
 * ダークモード共通デザイン。
 * - 業務画面の補足・説明・弱いグレー文字を高コントラスト化する。
 * - custom Blade の light-only 背景が残った場合も、黒系サーフェスへ統一する。
 * - 操作色は見積画面を基準に primary=blue / success=green / warning=amber / danger=red へ統一する。
 * Work / Master / Admin の3パネル共通 theme.css から適用する。
 */
.dark .fi-main {
    --pubflow-dark-text: rgb(248 250 252);
    --pubflow-dark-muted: rgb(241 245 249);
    --pubflow-dark-surface: rgb(9 9 11);
    --pubflow-dark-surface-soft: rgb(24 24 27);
    --pubflow-dark-surface-raised: rgb(31 41 55);
    --pubflow-dark-border: rgb(255 255 255 / 0.12);
}

/* 1. 説明文・補足文・サブ情報を白系にして可読性を確保する。 */
.dark .fi-main .text-gray-400,
.dark .fi-main .text-gray-500,
.dark .fi-main .text-gray-600,
.dark .fi-main .text-gray-700,
.dark .fi-main .dark\:text-gray-200,
.dark .fi-main .dark\:text-gray-300,
.dark .fi-main .dark\:text-gray-400,
.dark .fi-main .fi-section-description,
.dark .fi-main .fi-fo-field-wrp-helper-text,
.dark .fi-main .fi-ta-empty-state-description,
.dark .fi-main .app-overview-label,
.dark .fi-main .business-tabs__group-label,
.dark .fi-main .business-tabs__subtotal,
.dark .fi-main .business-workflow-guide__description,
.dark .fi-main .business-stepper__description,
.dark .fi-main .business-execution-summary__label,
.dark .fi-main .business-save-status__hint,
.dark .fi-main .business-table-mobile-guide {
    color: var(--pubflow-dark-muted) !important;
}

.dark .fi-main input::placeholder,
.dark .fi-main textarea::placeholder,
.dark .fi-main .choices__placeholder,
.dark .fi-main .fi-select-input::placeholder {
    color: rgb(226 232 240) !important;
    opacity: 1 !important;
}

/* 2. ダークモードで白いカード・説明枠を残さない。 */
.dark .fi-main .bg-white,
.dark .fi-main .bg-gray-50,
.dark .fi-main .bg-gray-100,
.dark .fi-main .dark\:bg-gray-800,
.dark .fi-main .dark\:bg-gray-900,
.dark .fi-main .dark\:bg-gray-900\/40,
.dark .fi-main .dark\:bg-gray-950,
.dark .fi-main .dark\:bg-white\/5,
.dark .fi-main .dark\:bg-white\/10 {
    background-color: var(--pubflow-dark-surface-soft) !important;
    color: var(--pubflow-dark-text) !important;
}

.dark .fi-main .border-gray-200,
.dark .fi-main .border-gray-300,
.dark .fi-main .dark\:border-gray-700,
.dark .fi-main .dark\:border-white\/10,
.dark .fi-main .ring-gray-200,
.dark .fi-main .dark\:ring-gray-700,
.dark .fi-main .dark\:ring-white\/10,
.dark .fi-main .dark\:ring-white\/20 {
    border-color: var(--pubflow-dark-border) !important;
    --tw-ring-color: var(--pubflow-dark-border) !important;
}

/* business-tabs はコンポーネント内styleより強くし、選択タブも白背景にしない。 */
.dark .fi-main .business-tabs .business-tabs__bar {
    border-bottom-color: var(--pubflow-dark-border) !important;
}

.dark .fi-main .business-tabs .business-tabs__tab {
    color: var(--pubflow-dark-muted) !important;
}

.dark .fi-main .business-tabs .business-tabs__tab:hover {
    background: rgb(255 255 255 / 0.05) !important;
    color: var(--pubflow-dark-text) !important;
}

.dark .fi-main .business-tabs .business-tabs__tab.is-active {
    border-color: rgb(59 130 246 / 0.55) !important;
    border-bottom-color: rgb(96 165 250) !important;
    background: rgb(30 58 138 / 0.22) !important;
    color: rgb(219 234 254) !important;
}

/* 製作・注文一覧など、注意説明を置く共通黒背景枠。 */
.app-dark-callout {
    border: 1px solid rgb(229 231 235);
    background: rgb(249 250 251);
    color: rgb(17 24 39);
}

.dark .fi-main .app-dark-callout {
    border-color: var(--pubflow-dark-border) !important;
    background: var(--pubflow-dark-surface) !important;
    color: var(--pubflow-dark-text) !important;
    box-shadow: none !important;
}

/* 3. 操作色は見積画面の配色を基準に統一。パネル固有のprimary色はボタン等ではBlueへ寄せる。 */
.dark .fi-main .fi-color-primary {
    --c-400: 96, 165, 250 !important;
    --c-500: 59, 130, 246 !important;
    --c-600: 37, 99, 235 !important;
}

.dark .fi-main .fi-color-success {
    --c-400: 74, 222, 128 !important;
    --c-500: 34, 197, 94 !important;
    --c-600: 22, 163, 74 !important;
}

.dark .fi-main .fi-color-warning {
    --c-400: 251, 191, 36 !important;
    --c-500: 245, 158, 11 !important;
    --c-600: 217, 119, 6 !important;
}

.dark .fi-main .fi-color-danger {
    --c-400: 248, 113, 113 !important;
    --c-500: 239, 68, 68 !important;
    --c-600: 220, 38, 38 !important;
}

.dark .fi-main .fi-color-gray {
    --c-400: 161, 161, 170 !important;
    --c-500: 113, 113, 122 !important;
    --c-600: 82, 82, 91 !important;
}
/* PUBFLOW_DARK_MODE_DESIGN_V1_20260918_END */


/* PUBFLOW_DARK_MODE_TABLE_HEADER_HOVER_V2_20260918_START
 * ダークモードの一覧表で、ソート可能な見出しにマウスオーバーした際、
 * Filament側の dark:hover 背景が内側buttonへ適用されて黒くなり、
 * 黒文字と重なって読めなくなる現象を防ぐ。
 * 見出しは通常・hover・focus・sort状態を通して淡色背景＋濃色文字を維持する。
 */
.dark .fi-main .fi-ta-header-cell:hover,
.dark .fi-main .fi-ta-actions-header-cell:hover,
.dark .fi-main table > thead > tr > th:hover,
.dark .fi-main table > thead > tr > td:hover {
    background-color: var(--app-user-table-header-color, #e2e8f0) !important;
    color: var(--app-user-table-header-text-color, #111827) !important;
}

.dark .fi-main .fi-ta-header-cell > button,
.dark .fi-main .fi-ta-header-cell > button:hover,
.dark .fi-main .fi-ta-header-cell > button:focus,
.dark .fi-main .fi-ta-header-cell > button:focus-visible,
.dark .fi-main .fi-ta-header-cell > a,
.dark .fi-main .fi-ta-header-cell > a:hover,
.dark .fi-main .fi-ta-header-cell > a:focus,
.dark .fi-main table > thead > tr > th > button,
.dark .fi-main table > thead > tr > th > button:hover,
.dark .fi-main table > thead > tr > th > button:focus,
.dark .fi-main table > thead > tr > th > button:focus-visible,
.dark .fi-main table > thead > tr > th > a,
.dark .fi-main table > thead > tr > th > a:hover,
.dark .fi-main table > thead > tr > th > a:focus {
    background-color: transparent !important;
    color: var(--app-user-table-header-text-color, #111827) !important;
}

.dark .fi-main .fi-ta-header-cell > button *,
.dark .fi-main .fi-ta-header-cell > a *,
.dark .fi-main table > thead > tr > th > button *,
.dark .fi-main table > thead > tr > th > a * {
    color: var(--app-user-table-header-text-color, #111827) !important;
}

/* 業務タブもhover/focus時の文字色を必ず確保する。 */
.dark .fi-main .business-tabs .business-tabs__tab:hover,
.dark .fi-main .business-tabs .business-tabs__tab:focus-visible {
    background-color: rgb(255 255 255 / 0.08) !important;
    color: var(--pubflow-dark-text, rgb(248 250 252)) !important;
}

.dark .fi-main .business-tabs .business-tabs__tab:hover *,
.dark .fi-main .business-tabs .business-tabs__tab:focus-visible * {
    color: inherit !important;
}
/* PUBFLOW_DARK_MODE_TABLE_HEADER_HOVER_V2_20260918_END */

/* HEADER_CLOCK_ANNOUNCEMENT_FOOTER_V1_20260918_START */
.app-topbar-clock {
    order: 26;
    display: none;
    align-items: center;
    flex: 0 0 auto;
    margin-inline: 0.35rem 0.2rem;
    color: var(--app-user-topbar-text, rgb(255 255 255 / 0.96));
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.app-topbar-clock__compact {
    display: none;
}

.app-topbar-announcements {
    position: relative;
    order: 27;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-inline: 0.15rem 0.35rem;
}

.app-topbar-announcements__button {
    position: relative;
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    color: var(--app-user-topbar-text, rgb(255 255 255 / 0.96));
    transition: background-color 120ms ease;
}

.app-topbar-announcements__button:hover,
.app-topbar-announcements__button:focus-visible {
    background: var(--app-user-topbar-hover, rgb(255 255 255 / 0.14));
}

.app-topbar-announcements__button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.app-topbar-announcements__count {
    position: absolute;
    top: 0.08rem;
    right: 0.05rem;
    display: inline-flex;
    min-width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    padding-inline: 0.2rem;
    border: 2px solid var(--app-user-topbar-color, rgb(30 41 59));
    border-radius: 9999px;
    background: rgb(220 38 38);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
}

.app-topbar-announcements__panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 80;
    width: min(30rem, calc(100vw - 1rem));
    max-height: min(70vh, 36rem);
    overflow: hidden;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.8rem;
    background: #fff;
    color: rgb(15 23 42);
    box-shadow: 0 18px 45px rgb(15 23 42 / 0.22);
}

.dark .app-topbar-announcements__panel {
    border-color: rgb(71 85 105);
    background: rgb(17 24 39);
    color: rgb(248 250 252);
    box-shadow: 0 18px 45px rgb(0 0 0 / 0.45);
}

.app-topbar-announcements__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgb(226 232 240);
}

.dark .app-topbar-announcements__header {
    border-bottom-color: rgb(55 65 81);
}

.app-topbar-announcements__header > div {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.app-topbar-announcements__header strong {
    font-size: 0.95rem;
}

.app-topbar-announcements__header span {
    color: rgb(100 116 139);
    font-size: 0.7rem;
}

.dark .app-topbar-announcements__header span {
    color: rgb(203 213 225);
}

.app-topbar-announcements__header button {
    display: inline-flex;
    width: 1.9rem;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    color: rgb(71 85 105) !important;
    font-size: 1.25rem;
    line-height: 1;
}

.dark .app-topbar-announcements__header button {
    color: rgb(226 232 240) !important;
}

.app-topbar-announcements__content {
    max-height: calc(min(70vh, 36rem) - 3.7rem);
    overflow-y: auto;
    padding: 0.45rem 0.75rem 0.8rem;
}

.app-topbar-announcements__empty {
    margin: 0;
    padding: 1.5rem 0.75rem;
    color: rgb(100 116 139);
    text-align: center;
    font-size: 0.82rem;
}

.dark .app-topbar-announcements__empty {
    color: rgb(203 213 225);
}

.app-topbar-announcements__section + .app-topbar-announcements__section {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgb(226 232 240);
}

.dark .app-topbar-announcements__section + .app-topbar-announcements__section {
    border-top-color: rgb(55 65 81);
}

.app-topbar-announcements__section h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.4rem 0.25rem 0.35rem;
    color: rgb(71 85 105);
    font-size: 0.72rem;
    font-weight: 700;
}

.dark .app-topbar-announcements__section h3 {
    color: rgb(226 232 240);
}

.app-announcement-scope {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.42rem;
    border-radius: 9999px;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.2;
}

.app-announcement-scope--system {
    background: rgb(37 99 235);
}

.app-announcement-scope--company {
    background: rgb(5 150 105);
}

.app-topbar-announcement-item {
    padding: 0.7rem 0.6rem;
    border-radius: 0.55rem;
}

.app-topbar-announcement-item:hover {
    background: rgb(248 250 252);
}

.dark .app-topbar-announcement-item:hover {
    background: rgb(31 41 55);
}

.app-topbar-announcement-item__meta {
    color: rgb(100 116 139);
    font-size: 0.66rem;
    line-height: 1.3;
}

.dark .app-topbar-announcement-item__meta {
    color: rgb(203 213 225);
}

.app-topbar-announcement-item__title {
    margin-top: 0.16rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.app-topbar-announcement-item__body {
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
    color: rgb(71 85 105);
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-line;
}

.dark .app-topbar-announcement-item__body {
    color: rgb(226 232 240);
}

.app-system-footer {
    display: grid;
    gap: 0.45rem;
}

.app-system-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.app-system-footer__link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.app-system-footer__link:hover,
.app-system-footer__link:focus-visible {
    color: rgb(37 99 235);
}

.dark .app-system-footer__link:hover,
.dark .app-system-footer__link:focus-visible {
    color: rgb(147 197 253);
}

.app-terms-dialog {
    width: min(54rem, calc(100vw - 2rem));
    max-height: min(80vh, 48rem);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.9rem;
    background: #fff;
    color: rgb(15 23 42);
    box-shadow: 0 24px 64px rgb(15 23 42 / 0.28);
}

.app-terms-dialog::backdrop {
    background: rgb(15 23 42 / 0.55);
}

.dark .app-terms-dialog {
    border-color: rgb(71 85 105);
    background: rgb(17 24 39);
    color: rgb(248 250 252);
}

.app-terms-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgb(226 232 240);
}

.dark .app-terms-dialog__header {
    border-bottom-color: rgb(55 65 81);
}

.app-terms-dialog__header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.app-terms-dialog__header p {
    margin: 0.25rem 0 0;
    color: rgb(100 116 139);
    font-size: 0.72rem;
}

.dark .app-terms-dialog__header p {
    color: rgb(203 213 225);
}

.app-terms-dialog__close {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    color: inherit;
    font-size: 1.25rem;
}

.app-terms-dialog__body {
    max-height: calc(min(80vh, 48rem) - 8rem);
    overflow-y: auto;
    padding: 1.1rem 1.25rem;
    font-size: 0.82rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.app-terms-dialog__footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.8rem 1.15rem;
    border-top: 1px solid rgb(226 232 240);
}

.dark .app-terms-dialog__footer {
    border-top-color: rgb(55 65 81);
}

.app-terms-dialog__button {
    padding: 0.45rem 1rem;
    border-radius: 0.5rem;
    background: rgb(37 99 235);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

@media (min-width: 1024px) {
    .app-topbar-clock {
        display: flex;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .app-topbar-clock__full {
        display: none;
    }

    .app-topbar-clock__compact {
        display: inline;
    }
}

@media (max-width: 767px) {
    .app-topbar-announcements__panel {
        position: fixed;
        top: 4.1rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}
/* HEADER_CLOCK_ANNOUNCEMENT_FOOTER_V1_20260918_END */

/* HEADER_FOOTER_ALIGNMENT_V2_20260918_START */
@media (min-width: 1024px) {
    .fi-topbar > nav > .app-topbar-title {
        margin-inline-end: 0.35rem !important;
    }

    .fi-topbar > nav > .app-topbar-clock {
        margin-inline-start: auto !important;
    }

    .fi-topbar > nav > .app-topbar-announcements,
    .fi-topbar > nav > .app-topbar-login-user,
    .fi-topbar > nav > .ms-auto {
        flex: 0 0 auto;
    }

    .fi-topbar > nav > .ms-auto {
        margin-inline-start: 0 !important;
    }
}

.app-system-footer__links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 1.25rem;
    row-gap: 0.35rem;
}
/* HEADER_FOOTER_ALIGNMENT_V2_20260918_END */



/* ===== PubFlow login refresh v3 2026-09-18 ===== */
@media (min-width: 1024px) {
    .fi-simple-layout {
        display: grid !important;
        grid-template-columns: minmax(760px, 51fr) minmax(680px, 49fr) !important;
        align-items: stretch !important;
        overflow: hidden !important;
        background: linear-gradient(180deg, #f6fafc 0%, #edf4f8 100%) !important;
    }

    .fi-simple-layout::before {
        content: "" !important;
        display: block !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        background: url('/images/pubflow-auth-left-hero-20260918-v3.png') center center / cover no-repeat !important;
        border-right: 1px solid #d8e5ef !important;
    }

    .fi-simple-layout::after {
        display: none !important;
        content: none !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-height: 100vh !important;
        background:
            radial-gradient(circle at 86% 12%, rgba(32, 203, 195, .10), transparent 0 26%),
            linear-gradient(180deg, #f7fbfe 0%, #eff5f9 100%) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(80%, 560px) !important;
        max-width: 560px !important;
        padding: 3rem 2.6rem 2.5rem !important;
        border-radius: 22px !important;
        border: 1px solid #dbe7f0 !important;
        background: rgba(255, 255, 255, .96) !important;
        box-shadow: 0 20px 48px rgba(31, 66, 106, .12) !important;
    }

    .fi-simple-layout .fi-logo {
        margin-bottom: 1rem !important;
    }

    .fi-simple-layout .fi-input-wrp {
        background: #f6faff !important;
        box-shadow: 0 0 0 1px #d6e1ec !important;
    }

    .fi-simple-layout .fi-input-wrp:focus-within {
        box-shadow: 0 0 0 2px rgba(25, 188, 180, .24), 0 0 0 1px #1cbab3 !important;
    }

    .fi-simple-layout .fi-btn.fi-color-primary,
    .fi-simple-layout button[type="submit"].fi-btn {
        min-height: 50px !important;
        border-radius: 10px !important;
        background: linear-gradient(90deg, #0a4b94 0%, #0d66ae 52%, #16b3b0 100%) !important;
        box-shadow: 0 12px 24px rgba(15, 78, 141, .18) !important;
    }

    .fi-simple-layout .fi-btn.fi-color-primary:hover,
    .fi-simple-layout button[type="submit"].fi-btn:hover {
        filter: brightness(1.05) !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout {
        grid-template-columns: minmax(820px, 52fr) minmax(700px, 48fr) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(78%, 580px) !important;
        max-width: 580px !important;
    }
}


/* ===== PubFlow login responsive fix v4 2026-09-18 ===== */
/*
 * v3 の固定最小幅 (760px + 680px) による横はみ出しを解消する。
 * 1024px 以上でも viewport 内に必ず収め、ログイン入力欄を隠さない。
 */
@media (min-width: 1024px) {
    .fi-simple-layout {
        width: 100% !important;
        max-width: 100vw !important;
        grid-template-columns: minmax(0, 42fr) minmax(0, 58fr) !important;
        overflow-x: hidden !important;
    }

    .fi-simple-layout::before,
    .fi-simple-layout > .fi-simple-main-ctn {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        box-sizing: border-box !important;
        padding-inline: clamp(1.5rem, 3vw, 3rem) !important;
    }

    .fi-simple-layout .fi-simple-main {
        box-sizing: border-box !important;
        width: min(94%, 520px) !important;
        max-width: 520px !important;
        padding: 2.25rem 2rem 2rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: min(100%, 230px) !important;
        height: 132px !important;
        margin-bottom: .9rem !important;
    }

    .fi-simple-layout .fi-simple-header {
        margin-bottom: 1.45rem !important;
    }
}

@media (min-width: 1200px) {
    .fi-simple-layout {
        grid-template-columns: minmax(0, 46fr) minmax(0, 54fr) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(90%, 540px) !important;
        max-width: 540px !important;
        padding: 2.6rem 2.25rem 2.25rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: min(100%, 250px) !important;
        height: 145px !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout {
        grid-template-columns: minmax(0, 52fr) minmax(0, 48fr) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(84%, 580px) !important;
        max-width: 580px !important;
        padding: 3rem 2.6rem 2.5rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: min(100%, 270px) !important;
        height: 156px !important;
    }
}

/* 高さが低い画面ではカードを縦方向にも圧縮して全項目を見せる */
@media (min-width: 1024px) and (max-height: 760px) {
    .fi-simple-layout > .fi-simple-main-ctn {
        padding-block: 1rem !important;
        align-items: center !important;
    }

    .fi-simple-layout .fi-simple-main {
        padding-top: 1.6rem !important;
        padding-bottom: 1.45rem !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        height: 104px !important;
        margin-bottom: .5rem !important;
    }

    .fi-simple-layout .fi-simple-header {
        margin-bottom: .9rem !important;
    }

    .fi-simple-layout .fi-simple-header-heading {
        font-size: 1.35rem !important;
    }
}

/* pubflow-menu-adaptive-logo-v2:start */
/*
 * サイドバー背景色が白/濃色のどちらでもPubFlowが欠けないようにする。
 * シンボルは固定、Pubはユーザー設定のsidebar text色、Flowはブランドティール。
 */
.fi-sidebar-header .fi-logo {
    position: relative !important;
    display: block !important;
    width: 198px !important;
    min-width: 198px !important;
    max-width: 198px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background-image: url('/images/pubflow-menu-symbol-20260918-v2.svg') !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: 42px 42px !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
}
.fi-sidebar-header .fi-logo::after {
    content: "PubFlow" !important;
    position: absolute !important;
    left: 50px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: block !important;
    width: 138px !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -1px !important;
    background: linear-gradient(90deg,
        var(--app-user-sidebar-text, #0d3b66) 0%,
        var(--app-user-sidebar-text, #0d3b66) 43%,
        #38c2bd 43%,
        #38c2bd 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}
.fi-sidebar-header .fi-logo > img { display: none !important; }
@media (max-width: 1180px) {
    .fi-sidebar-header .fi-logo {
        width: 184px !important;
        min-width: 184px !important;
        max-width: 184px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        background-size: 40px 40px !important;
    }
    .fi-sidebar-header .fi-logo::after {
        left: 48px !important;
        width: 128px !important;
        font-size: 23px !important;
    }
}
/* pubflow-menu-adaptive-logo-v2:end */

/* TOPBAR_TEXT_SIZE_TWEAK_V1_20260918_START */
.fi-topbar > nav,
.fi-topbar nav {
    font-size: 0.95rem;
}
.fi-topbar .app-topbar-clock {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.015em;
}
.fi-topbar > nav > .ms-auto,
.fi-topbar nav .ms-auto {
    gap: 0.45rem;
}
.fi-topbar nav .fi-dropdown > button,
.fi-topbar nav .fi-dropdown [type="button"],
.fi-topbar nav .fi-dropdown-trigger,
.fi-topbar nav .fi-user-menu-trigger,
.fi-topbar nav .fi-user-menu > button {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}
.fi-topbar nav .fi-dropdown > button span,
.fi-topbar nav .fi-dropdown [type="button"] span,
.fi-topbar nav .fi-dropdown-trigger span,
.fi-topbar nav .fi-user-menu-trigger span,
.fi-topbar nav .fi-user-menu > button span {
    font-size: inherit !important;
}
/* TOPBAR_TEXT_SIZE_TWEAK_V1_20260918_END */

/* LOGIN_CARD_TONE_TWEAK_V5_20260918_START */
@media (min-width: 1024px) {
    .fi-simple-layout > .fi-simple-main-ctn {
        background:
            radial-gradient(circle at 86% 12%, rgba(148, 163, 184, .10), transparent 0 25%),
            linear-gradient(180deg, #f6f7f8 0%, #eceff2 100%) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(90%, 480px) !important;
        max-width: 480px !important;
        padding: 2rem 1.8rem 1.85rem !important;
        border-radius: 20px !important;
        border: 1px solid #d9dee5 !important;
        background: rgba(255, 255, 255, .985) !important;
        box-shadow: 0 14px 34px rgba(51, 65, 85, .08) !important;
    }

    .fi-simple-layout .fi-simple-main::after {
        height: 3px !important;
        background: linear-gradient(90deg, #173f74 0 58%, #8aa1af 58% 100%) !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: min(100%, 220px) !important;
        height: 126px !important;
        margin-bottom: .7rem !important;
    }

    .fi-simple-layout .fi-simple-header {
        margin-bottom: 1.2rem !important;
    }

    .fi-simple-layout .fi-simple-header-heading {
        font-size: 1.45rem !important;
    }

    .fi-panel-work .fi-simple-layout .fi-simple-main::before,
    .fi-panel-master .fi-simple-layout .fi-simple-main::before,
    .fi-panel-admin .fi-simple-layout .fi-simple-main::before {
        top: .9rem !important;
        right: .9rem !important;
        background: #f3f4f6 !important;
        border-color: #d5dbe2 !important;
        color: #6b7280 !important;
    }

    .fi-simple-layout .fi-input-wrp {
        min-height: 44px !important;
        background: #f8f9fb !important;
        box-shadow: 0 0 0 1px #d6dbe2 !important;
    }

    .fi-simple-layout .fi-input-wrp:focus-within {
        box-shadow: 0 0 0 2px rgba(148, 163, 184, .22), 0 0 0 1px #bcc5d0 !important;
    }

    .fi-simple-layout .fi-input,
    .fi-simple-layout input[type="email"],
    .fi-simple-layout input[type="password"],
    .fi-simple-layout input[type="text"] {
        color: #223247 !important;
    }

    .fi-simple-layout .fi-btn.fi-color-primary,
    .fi-simple-layout button[type="submit"].fi-btn {
        min-height: 44px !important;
        border-radius: 10px !important;
        border: 1px solid #cfd6de !important;
        background: linear-gradient(180deg, #fafafa 0%, #e5e9ee 100%) !important;
        color: #23364c !important;
        font-weight: 700 !important;
        box-shadow: 0 6px 16px rgba(100, 116, 139, .10) !important;
    }

    .fi-simple-layout .fi-btn.fi-color-primary:hover,
    .fi-simple-layout button[type="submit"].fi-btn:hover {
        background: linear-gradient(180deg, #ffffff 0%, #dfe5eb 100%) !important;
        filter: none !important;
    }

    .fi-simple-layout a:not(.fi-btn) {
        color: #58708c !important;
        text-decoration-color: rgba(88, 112, 140, .28) !important;
    }
}

@media (min-width: 1200px) {
    .fi-simple-layout .fi-simple-main {
        width: min(88%, 500px) !important;
        max-width: 500px !important;
        padding: 2.2rem 1.95rem 1.95rem !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout .fi-simple-main {
        width: min(82%, 510px) !important;
        max-width: 510px !important;
    }
}
/* LOGIN_CARD_TONE_TWEAK_V5_20260918_END */



/* APP_CHROME_LAYER_GUARD_V1_20260925_START
 * スクロール時に業務コンテンツやsticky要素がトップバー／サイドバーへ被らないよう、
 * メインコンテンツを独立した低いstacking contextへ閉じ込める。
 * モーダル等のbody直下オーバーレイはこの制約外なので、通常どおり最前面表示できる。
 */
:root {
    --app-chrome-topbar-z: 60;
    --app-chrome-sidebar-z: 55;
    --app-chrome-sidebar-header-z: 56;
}

html body .fi-main-ctn,
html body .fi-main {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

html body .fi-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: var(--app-chrome-topbar-z) !important;
    isolation: isolate;
}

html body .fi-topbar > nav,
html body .fi-topbar nav {
    position: relative;
    z-index: 1;
}

html body .fi-sidebar {
    z-index: var(--app-chrome-sidebar-z) !important;
    isolation: isolate;
}

html body .fi-sidebar-header {
    position: sticky !important;
    top: 0 !important;
    z-index: var(--app-chrome-sidebar-header-z) !important;
    isolation: isolate;
}

html body .fi-sidebar-nav {
    position: relative;
    z-index: 1;
}
/* APP_CHROME_LAYER_GUARD_V1_20260925_END */


/* UI_MODAL_LAYER_FIX_V3_20260927_START
 * 通常時はAPP_CHROME_LAYER_GUARDの元設計を維持。
 * Filament modalが開いている間だけmain stacking contextをchromeより上へ上げる。
 * modal root自体はfixed/inset:0でviewport全体を覆う。
 */
:root {
    --app-chrome-topbar-z: 60;
    --app-chrome-sidebar-z: 55;
    --app-chrome-sidebar-header-z: 56;
    --app-modal-open-main-z: 70;
    --app-modal-root-z: 90;
}

/* 通常時: 9/25のchrome guardを明示的に復元 */
html body .fi-main-ctn,
html body .fi-main {
    position: relative !important;
    z-index: 0 !important;
    isolation: isolate !important;
}

html body .fi-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: var(--app-chrome-topbar-z) !important;
    isolation: isolate !important;
}

html body .fi-sidebar {
    z-index: var(--app-chrome-sidebar-z) !important;
    isolation: isolate !important;
}

html body .fi-sidebar-header {
    position: sticky !important;
    top: 0 !important;
    z-index: var(--app-chrome-sidebar-header-z) !important;
    isolation: isolate !important;
}

/* modal表示中だけmainをchromeより上へ */
html body:has(.fi-modal.fi-modal-open) .fi-main-ctn,
html body:has(.fi-modal.fi-modal-open) .fi-main {
    z-index: var(--app-modal-open-main-z) !important;
    isolation: isolate !important;
}

/* modal/backdropをviewport全体の最前面へ */
html body .fi-modal.fi-modal-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    z-index: var(--app-modal-root-z) !important;
}
/* UI_MODAL_LAYER_FIX_V3_20260927_END */

/* PUBFLOW_SIDEBAR_PANEL_TOGGLE_ICON_V1_20260928
 * サイドバー開閉ボタンを chevron から「サイドパネル」アウトラインへ。
 * 黒背景は使わず、サイドバーの青背景上に白線アイコンとして表示する。
 */
.fi-sidebar-header > .fi-icon-btn.ms-auto,
.fi-sidebar-header > .fi-icon-btn.mx-auto {
    position: relative !important;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0.45rem !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--app-user-sidebar-text, rgb(255 255 255 / 0.94)) !important;
    align-items: center !important;
    justify-content: center !important;
}

.fi-sidebar-header > .fi-icon-btn.ms-auto:hover,
.fi-sidebar-header > .fi-icon-btn.mx-auto:hover {
    background: rgb(255 255 255 / 0.12) !important;
    background-color: rgb(255 255 255 / 0.12) !important;
}

.fi-sidebar-header > .fi-icon-btn.ms-auto:focus-visible,
.fi-sidebar-header > .fi-icon-btn.mx-auto:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.78) !important;
    outline-offset: 2px !important;
}

.fi-sidebar-header > .fi-icon-btn.ms-auto > svg,
.fi-sidebar-header > .fi-icon-btn.mx-auto > svg {
    display: none !important;
}

/*
 * 外枠 + 左側の細いペイン境界を1つの疑似要素で描画。
 * 参考アイコンの「縦長サイドペイン付きパネル」を再現する。
 */
.fi-sidebar-header > .fi-icon-btn.ms-auto::before,
.fi-sidebar-header > .fi-icon-btn.mx-auto::before {
    content: "" !important;
    display: block !important;
    width: 1.15rem !important;
    height: 0.92rem !important;
    border: 1.6px solid currentColor !important;
    border-radius: 0.22rem !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(
            to right,
            transparent 0,
            transparent 31%,
            currentColor 31%,
            currentColor calc(31% + 1.6px),
            transparent calc(31% + 1.6px),
            transparent 100%
        ) !important;
    opacity: 0.98 !important;
}
/* PUBFLOW_SIDEBAR_PANEL_TOGGLE_ICON_V1_20260928_END */

/* GLOBAL_SEARCH_OFF_ROLE_SAVE_FEEDBACK_V1_20260929
 * PubFlow does not use Filament global search.
 * Use each screen list search and filters instead.
 */
.fi-global-search {
    display: none !important;
}

/* GLOBAL_SEARCH_OFF_ROLE_SAVE_FEEDBACK_V1_1_RECOVERY_20260929 */
.fi-global-search {
    display: none !important;
}


/* LOGIN_LAYOUT_LEFT_FORM_RIGHT_VISUAL_V1_20261004_START
 * Goal:
 * - swap desktop auth layout to left=form / right=visual
 * - narrow login card and therefore input width
 * - reduce whitespace on the login side
 * - slightly enlarge the visual side to about 2:3 balance
 * - keep the approved wording/image/logo composition
 */
@media (min-width: 1024px) {
    .fi-simple-layout {
        grid-template-columns: minmax(380px, 2fr) minmax(560px, 3fr) !important;
    }

    .fi-simple-layout::before {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-height: 100vh !important;
        border-right: 0 !important;
        border-left: 1px solid #dce6ee !important;
        background-image:
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            linear-gradient(135deg, #f8fbfd 0%, #eef5f8 100%) !important;
        background-repeat: no-repeat, no-repeat !important;
        background-size: cover, cover !important;
        background-position: center center, center center !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-content: center !important;
        padding: 1.1rem clamp(.8rem, 1.7vw, 1.4rem) !important;
        background:
            radial-gradient(circle at 16% 10%, rgba(148, 163, 184, .09), transparent 0 24%),
            linear-gradient(180deg, #f5f7f9 0%, #edf1f4 100%) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(100%, 420px) !important;
        max-width: 420px !important;
        padding: 1.65rem 1.5rem 1.45rem !important;
        border-radius: 18px !important;
        border: 1px solid #d8dee6 !important;
        background: rgba(255,255,255,.985) !important;
        box-shadow: 0 14px 34px rgba(51, 65, 85, .08) !important;
    }

    .fi-simple-layout .fi-simple-main::after {
        height: 3px !important;
        background: linear-gradient(90deg, #1a4f97 0 58%, #97a9b8 58% 100%) !important;
    }

    .fi-simple-layout .fi-simple-header::before {
        width: min(100%, 210px) !important;
        height: 118px !important;
        margin-bottom: .55rem !important;
    }

    .fi-simple-layout .fi-simple-header {
        margin-bottom: 1rem !important;
    }

    .fi-simple-layout .fi-simple-header-heading {
        font-size: 1.35rem !important;
    }

    .fi-simple-layout .fi-input-wrp {
        min-height: 42px !important;
        background: #f7f9fb !important;
        box-shadow: 0 0 0 1px #d6dbe2 !important;
    }

    .fi-simple-layout .fi-input-wrp:focus-within {
        box-shadow: 0 0 0 2px rgba(148, 163, 184, .22), 0 0 0 1px #bcc5d0 !important;
    }

    .fi-simple-layout .fi-btn.fi-color-primary,
    .fi-simple-layout button[type="submit"].fi-btn {
        min-height: 42px !important;
    }

    /* KOWAロゴは左下へ移動し、右ビジュアルを広く見せる */
    .fi-simple-layout > .fi-simple-main-ctn::after {
        left: clamp(1rem, 2vw, 1.6rem) !important;
        right: auto !important;
        bottom: clamp(.9rem, 2vw, 1.15rem) !important;
        width: clamp(88px, 7.4vw, 116px) !important;
        height: clamp(32px, 2.9vw, 44px) !important;
        background-position: left bottom !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout {
        grid-template-columns: minmax(400px, 2fr) minmax(640px, 3fr) !important;
    }

    .fi-simple-layout .fi-simple-main {
        width: min(100%, 430px) !important;
        max-width: 430px !important;
    }
}
/* LOGIN_LAYOUT_LEFT_FORM_RIGHT_VISUAL_V1_20261004_END */


/* LOGIN_INPUT_WIDTH_COMPACT_V1_20261005_START
 * Desktop only: email/password fields about 100px narrower than the card content.
 * Labels/hints/card/button remain at the current width.
 */
@media (min-width: 1024px) {
    .fi-simple-layout .fi-input-wrp:has(input[type="email"]),
    .fi-simple-layout .fi-input-wrp:has(input[type="password"]) {
        width: calc(100% - 96px) !important;
        max-width: calc(100% - 96px) !important;
        margin-right: auto !important;
    }
}
/* LOGIN_INPUT_WIDTH_COMPACT_V1_20261005_END */


/* LOGIN_FORM_COMPACT_ALIGNMENT_V1_3_20261005_START
 * Fine-tune desktop login panel width so:
 * - login card is slightly narrower,
 * - email/password area and submit button share the same narrower width,
 * - overall login-side rhythm stays compact.
 */
@media (min-width: 1024px) {
    .fi-simple-layout .fi-simple-main {
        width: min(100%, 388px) !important;
        max-width: 388px !important;
        padding: 1.5rem 1.35rem 1.35rem !important;
    }

    .fi-simple-layout .fi-simple-main form {
        width: calc(100% - 92px) !important;
        max-width: calc(100% - 92px) !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .fi-simple-layout .fi-input-wrp:has(input[type="email"]),
    .fi-simple-layout .fi-input-wrp:has(input[type="password"]) {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }

    .fi-simple-layout .fi-ac,
    .fi-simple-layout .fi-ac .fi-btn,
    .fi-simple-layout .fi-ac button[type="submit"],
    .fi-simple-layout button[type="submit"].fi-btn.fi-color-primary {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout .fi-simple-main {
        width: min(100%, 396px) !important;
        max-width: 396px !important;
    }

    .fi-simple-layout .fi-simple-main form {
        width: calc(100% - 96px) !important;
        max-width: calc(100% - 96px) !important;
    }
}
/* LOGIN_FORM_COMPACT_ALIGNMENT_V1_3_20261005_END */


/* LOGIN_FORM_CENTERED_WITHIN_CARD_V1_4_20261005_START
 * Center the compact login form block inside the card,
 * while keeping each label/input/button left-aligned within that block.
 */
@media (min-width: 1024px) {
    .fi-simple-layout .fi-simple-main {
        width: min(100%, 388px) !important;
        max-width: 388px !important;
        padding: 1.5rem 1.35rem 1.35rem !important;
    }

    .fi-simple-layout .fi-simple-main form {
        width: calc(100% - 92px) !important;
        max-width: calc(100% - 92px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .fi-simple-layout .fi-input-wrp:has(input[type="email"]),
    .fi-simple-layout .fi-input-wrp:has(input[type="password"]) {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .fi-simple-layout .fi-ac,
    .fi-simple-layout .fi-ac .fi-btn,
    .fi-simple-layout .fi-ac button[type="submit"],
    .fi-simple-layout button[type="submit"].fi-btn.fi-color-primary {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout .fi-simple-main {
        width: min(100%, 396px) !important;
        max-width: 396px !important;
    }

    .fi-simple-layout .fi-simple-main form {
        width: calc(100% - 96px) !important;
        max-width: calc(100% - 96px) !important;
    }
}
/* LOGIN_FORM_CENTERED_WITHIN_CARD_V1_4_20261005_END */


/* LOGIN_LEGAL_BELOW_CARD_V1_20261005_START
 * ログイン画面の運用会社／セキュリティポリシー／Copyrightを
 * ページ最下部のfooter領域ではなく、ログインカード直下へ配置する。
 */
.fi-simple-layout > .fi-simple-main-ctn > .app-login-legal {
    box-sizing: border-box;
    width: min(100%, 388px);
    margin: .72rem auto 0;
    padding: 0 .25rem;
    color: #64748b;
    font-size: .72rem;
    line-height: 1.45;
    text-align: center;
    flex: 0 0 auto;
}

.app-login-legal__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .25rem .85rem;
}

.app-login-legal__link {
    color: #58708c;
    text-decoration: underline;
    text-decoration-color: rgba(88, 112, 140, .32);
    text-underline-offset: .18em;
}

.app-login-legal__link:hover,
.app-login-legal__link:focus-visible {
    color: #173f74;
    text-decoration-color: currentColor;
}

.app-login-legal__copyright {
    margin-top: .26rem;
    white-space: nowrap;
}

@media (min-width: 1440px) {
    .fi-simple-layout > .fi-simple-main-ctn > .app-login-legal {
        width: min(100%, 396px);
    }
}

@media (max-width: 1023px) {
    .fi-simple-layout > .fi-simple-main-ctn > .app-login-legal {
        width: min(100%, 420px);
        margin-top: .65rem;
        padding-inline: .5rem;
    }
}

@media (max-width: 480px) {
    .app-login-legal__copyright {
        white-space: normal;
    }
}
/* LOGIN_LEGAL_BELOW_CARD_V1_20261005_END */


/* LOGIN_LEGAL_STACK_FIX_V1_1_20261005_START
 * Hotfix:
 * app-login-legal is inserted immediately after .fi-simple-main.
 * fi-simple-main-ctn is an existing flex container, so force a vertical
 * stack only for the login container and prevent the card from shrinking.
 */
.fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
}

.fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .fi-simple-main {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

.fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .app-login-legal {
    flex: 0 0 auto !important;
    align-self: center !important;
}

@media (min-width: 1024px) {
    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .fi-simple-main {
        width: min(100%, 388px) !important;
        max-width: 388px !important;
    }

    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .app-login-legal {
        width: min(100%, 388px) !important;
        margin-top: .72rem !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .fi-simple-main,
    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .app-login-legal {
        width: min(100%, 396px) !important;
        max-width: 396px !important;
    }
}

@media (max-width: 1023px) {
    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .fi-simple-main,
    .fi-simple-layout > .fi-simple-main-ctn.app-login-main-stack > .app-login-legal {
        width: min(100%, 420px) !important;
        max-width: 420px !important;
    }
}
/* LOGIN_LEGAL_STACK_FIX_V1_1_20261005_END */


/* LOGIN_RIGHT_VISUAL_CROP_FIX_V1_20261005_START
 * Narrow desktop hotfix:
 * The right-side approved image used background-size: cover, which enlarged
 * the image vertically and cropped the headline / circular icons horizontally.
 * On 1024-1279px desktops, scale the visual to width instead.
 * This makes the wording slightly smaller and keeps the circular icons visible.
 */
@media (min-width: 1024px) and (max-width: 1279px) {
    .fi-simple-layout::before {
        background-image:
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%) !important;
        background-repeat: no-repeat, no-repeat !important;
        background-size: 108% auto, cover !important;
        background-position: center top, center center !important;
        background-color: #eef5f8 !important;
    }
}

/* Slightly wider desktops still benefit from a little more breathing room. */
@media (min-width: 1280px) and (max-width: 1439px) {
    .fi-simple-layout::before {
        background-size: 116% auto, cover !important;
        background-position: center top, center center !important;
    }
}

/* Large desktop keeps the original immersive cover treatment. */
@media (min-width: 1440px) {
    .fi-simple-layout::before {
        background-size: cover, cover !important;
        background-position: center center, center center !important;
    }
}
/* LOGIN_RIGHT_VISUAL_CROP_FIX_V1_20261005_END */


/* LOGIN_RIGHT_VISUAL_BOTTOM_GAP_FIX_V1_20261005_START
 * Keep the readable full-width composition on top, but use the same
 * approved visual as a cover underlay so the remaining lower area
 * is never an empty block.
 */
@media (min-width: 1024px) and (max-width: 1279px) {
    .fi-simple-layout::before {
        background-image:
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%) !important;
        background-repeat: no-repeat, no-repeat, no-repeat !important;
        background-size: 108% auto, cover, cover !important;
        background-position: center top, center bottom, center center !important;
    }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    .fi-simple-layout::before {
        background-image:
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%) !important;
        background-repeat: no-repeat, no-repeat, no-repeat !important;
        background-size: 116% auto, cover, cover !important;
        background-position: center top, center bottom, center center !important;
    }
}

@media (min-width: 1440px) {
    .fi-simple-layout::before {
        background-image:
            url('/images/pubflow-auth-right-visual-20261004-v1.png'),
            linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%) !important;
        background-repeat: no-repeat, no-repeat !important;
        background-size: cover, cover !important;
        background-position: center center, center center !important;
    }
}
/* LOGIN_RIGHT_VISUAL_BOTTOM_GAP_FIX_V1_20261005_END */


/* WORK_MODAL_VIEWPORT_SCROLL_FIX_V1_20261006_START
 * Keep Work-panel edit modals inside the viewport.
 * The modal window stays visible; only its content area scrolls vertically.
 */
.fi-panel-work .fi-modal-window {
    max-height: calc(100dvh - 1.5rem) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.fi-panel-work .fi-modal-header {
    flex: 0 0 auto !important;
}

.fi-panel-work .fi-modal-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

.fi-panel-work .fi-modal-footer {
    flex: 0 0 auto !important;
}

/* Leave a small viewport margin on shorter desktop screens. */
@media (min-width: 768px) {
    .fi-panel-work .fi-modal-window {
        max-height: calc(100dvh - 2rem) !important;
    }
}
/* WORK_MODAL_VIEWPORT_SCROLL_FIX_V1_20261006_END */
