/* Extracted from Django templates. Keep page formatting in CSS instead of inline <style> tags. */

/* Template style block */
.history-shell { margin: 0; padding-top: 0.5rem; }
  .history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.55rem; }
  .history-title { margin: 0; font-size: 1.35rem; line-height: 1.1; color: #111827; }
  .history-subtitle { margin-top: 0.25rem; font-size: 0.84rem; }
  .history-btn { border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #111827; text-decoration: none; padding: 0.35rem 0.7rem; font-size: 0.82rem; font-weight: 700; }
  .history-panel { border: 1px solid #d1d5db; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); overflow: hidden; }
  .history-table-wrap { max-height: calc(100vh - 170px); overflow: auto; background: #f4f5f7; }
  .history-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; font-size: 0.84rem; color: #1f2937; }
  .history-table th, .history-table td { border: 1px solid #dde1e6; padding: 0.25rem 0.46rem; vertical-align: middle; }
  .history-grid-head th { position: sticky; top: 0; background: #133752; color: #f8fafc; text-align: left; font-weight: 700; z-index: 2; }
  .history-filter-row th { position: sticky; top: 31px; background: #eaf1f8; z-index: 2; }
  .history-filter-input { width: 100%; box-sizing: border-box; border: 1px solid #c7d2fe; border-radius: 6px; padding: 0.22rem 0.35rem; font: inherit; background: #fff; color: #1f2937; }
  .history-row:nth-child(odd) td { background: #f5f6f8; }
  .history-row:nth-child(even) td { background: #edf0f3; }
  .history-row:hover td { background: #dfeee7 !important; }
  .history-empty { text-align: center; color: #6b7280; padding: 1rem 0.75rem; background: #f9fafb !important; }
  .history-link { color: #1d4ed8; font-weight: 700; text-decoration: none; }
  .history-link:hover { text-decoration: underline; }

/* Template style block */
.history-detail-shell { padding: 0.8rem 1rem; background: #fff; min-height: 100vh; color: #111827; }
  .history-detail-shell h1 { margin: 0 0 0.65rem; font-size: 1.25rem; }
  .meta { display: grid; gap: 0.25rem; margin-bottom: 0.9rem; font-size: 0.88rem; color: #374151; }
  .block { margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0.7rem; background: #fff; }
  .block h2 { margin: 0 0 0.45rem; font-size: 1rem; }
  .block h3 { margin: 0.6rem 0 0.35rem; font-size: 0.88rem; }
  .history-tsv { width: 100%; min-height: 170px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0.6rem; font: 12px/1.4 "Consolas", "Courier New", monospace; background: #f8fafc; resize: vertical; box-sizing: border-box; white-space: pre; }

/* Template style block */
.coa-query-shell {
            margin: 0;
            max-width: none;
            width: 100%;
            padding-top: 0.2rem;
            font-family: var(--app-font-family);
            height: calc(100vh - 86px);
            overflow: hidden;
        }
        .coa-workspace {
            --coa-left-pane-width: 360px;
            display: grid;
            grid-template-columns: minmax(0, var(--coa-left-pane-width)) 6px minmax(0, 1fr);
            gap: 0.85rem;
            align-items: stretch;
            height: 100%;
            min-height: 0;
        }
        .coa-workspace.is-detail-collapsed {
            grid-template-columns: 0 14px minmax(0, 1fr);
        }
        .coa-workspace.is-sheet-closed {
            grid-template-columns: minmax(0, 1fr) 0 0;
        }
        .coa-workspace.is-sheet-closed .coa-detail-column,
        .coa-workspace.is-sheet-closed .coa-pane-resizer {
            display: none;
        }
        .coa-workspace.is-sheet-closed .coa-list-column {
            width: min(100%, 1080px);
            max-width: 1080px;
            margin: 0 auto;
        }
        .coa-list-column {
            min-width: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .coa-query-window {
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 12px;
            box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 420px;
        }
        .coa-query-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 1.1rem 1.25rem 0.85rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .coa-query-title-wrap h1 {
            margin: 0;
            font-size: 1.5rem;
            line-height: 1.1;
            color: #111827;
            font-weight: 700;
        }
        .coa-grid-filter-input-wrap {
            position: relative;
        }
        .coa-grid-filter-icon {
            position: absolute;
            left: 0.42rem;
            top: 50%;
            transform: translateY(-50%);
            color: #64748b;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
        }
        .coa-grid-filter-icon svg {
            width: 0.82rem;
            height: 0.82rem;
            display: block;
        }
        .coa-grid-scroll {
            height: clamp(340px, 68vh, 760px);
            overflow: auto;
            background: #f4f5f7;
        }
        .coa-grid {
            width: 100%;
            min-width: 860px;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: 0.86rem;
            color: #1f2937;
        }
        .coa-grid th,
        .coa-grid td {
            padding: 0.22rem 0.5rem;
            border: 1px solid #dde1e6;
            vertical-align: middle;
        }
        .coa-grid-head th {
            position: sticky;
            top: 0;
            background: #133752;
            color: #f8fafc;
            text-align: left;
            font-weight: 700;
            z-index: 2;
        }
        .coa-grid-filter-row td {
            background: #eaf1f8 !important;
        }
        .coa-grid-filter-input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #c7d2fe;
            border-radius: 6px;
            padding: 0.24rem 0.38rem 0.24rem 1.45rem;
            font: inherit;
            background: #ffffff;
            color: #1f2937;
        }
        .coa-grid-filter-input::placeholder {
            color: #6b7280;
        }
        .coa-grid-filter-input-wrap.is-value-filtered .coa-grid-filter-icon,
        .coa-grid-filter-input-wrap.is-condition-filtered .coa-grid-filter-icon {
            color: #0f766e;
        }
        .coa-filter-menu {
            position: fixed;
            min-width: 320px;
            max-width: min(420px, calc(100vw - 1rem));
            max-height: min(460px, calc(100vh - 1rem));
            overflow: hidden;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #ffffff;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
            z-index: 1600;
            display: flex;
            flex-direction: column;
        }
        .coa-filter-menu[hidden] { display: none !important; }
        .coa-filter-menu-sort {
            display: grid;
            gap: 0;
            border-bottom: 1px dotted #cccccc;
            padding: 0.18rem 0;
        }
        .coa-filter-menu-sort-btn {
            border: none;
            background: #ffffff;
            color: #111827;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.25;
            text-align: left;
            padding: 0.26rem 0.5rem;
            cursor: pointer;
        }
        .coa-filter-menu-sort-btn:hover { background: #f3f4f6; }
        .coa-filter-menu-condition {
            display: block;
            border-bottom: 1px dotted #cccccc;
            padding: 0.12rem 0;
            background: #ffffff;
        }
        .coa-filter-menu-condition.is-open {
            display: block;
            padding: 0.12rem 0;
        }
        .coa-filter-menu-condition-toggle {
            width: 100%;
            border: none;
            background: #ffffff;
            color: #111827;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1.25;
            text-align: left;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.26rem 0.5rem;
            cursor: pointer;
        }
        .coa-filter-menu-condition-toggle:hover { background: #f3f4f6; }
        .coa-filter-menu-condition-arrow {
            display: inline-block;
            font-size: 0.82rem;
            line-height: 1;
            color: #4b5563;
            transition: transform 120ms ease;
            transform: rotate(0deg);
        }
        .coa-filter-menu-condition.is-open .coa-filter-menu-condition-arrow { transform: rotate(90deg); }
        .coa-filter-menu-condition-body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.32rem;
            padding: 0.2rem 0.45rem 0.36rem;
        }
        .coa-filter-menu-condition-body[hidden] { display: none !important; }
        .coa-filter-menu-condition-select,
        .coa-filter-menu-condition-value {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #ffffff;
            color: #1f2937;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.24rem 0.28rem;
            min-height: 1.6rem;
        }
        .coa-filter-menu-condition-value[disabled] {
            background: #f3f4f6;
            color: #6b7280;
            cursor: not-allowed;
        }
        .coa-filter-menu-search-wrap { padding: 0.3rem 0.45rem 0; }
        .coa-filter-menu-search {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #fff;
            color: #1f2937;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.24rem 0.28rem;
        }
        .coa-filter-menu-selection-controls {
            display: flex;
            justify-content: flex-start;
            gap: 0.55rem;
            padding: 0.24rem 0.45rem 0.22rem;
        }
        .coa-filter-menu-link {
            border: none;
            background: none;
            color: #2563eb;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1;
            cursor: pointer;
            padding: 0;
        }
        .coa-filter-menu-link:hover { text-decoration: underline; }
        .coa-filter-menu-list {
            display: grid;
            gap: 0;
            padding: 0.22rem 0.4rem 0.3rem;
            overflow-y: auto;
            max-height: min(150px, calc(100vh - 12rem));
        }
        .coa-filter-menu-option {
            border: none;
            border-radius: 0;
            background: #ffffff;
            color: #111827;
            display: flex;
            align-items: center;
            gap: 0.34rem;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.17rem 0.08rem;
            cursor: pointer;
        }
        .coa-filter-menu-option:hover,
        .coa-filter-menu-option:focus-within { background: #f3f4f6; }
        .coa-filter-menu-option-check {
            width: 0.82rem;
            height: 0.82rem;
            margin: 0;
            accent-color: #2563eb;
            flex: 0 0 auto;
        }
        .coa-filter-menu-option-label {
            min-width: 0;
            color: #334155;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .coa-filter-menu-empty {
            padding: 0.4rem 0.18rem;
            color: #6b7280;
            font-size: 0.75rem;
            background: #ffffff;
        }
        .coa-filter-menu-foot {
            display: flex;
            justify-content: flex-end;
            gap: 0.55rem;
            border-top: 1px dotted #cccccc;
            padding: 0.3rem 0.45rem 0.4rem;
            background: #ffffff;
        }
        .coa-filter-menu-cancel,
        .coa-filter-menu-apply {
            border-radius: 2px;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1;
            min-width: 64px;
            height: 20px;
            padding: 0.18rem 0.5rem;
            cursor: pointer;
        }
        .coa-filter-menu-cancel {
            border: 1px solid #b9b9b9;
            background: #eeeeee;
            color: #111827;
        }
        .coa-filter-menu-apply {
            border: 1px solid #18804e;
            background: #0f9d58;
            color: #ffffff;
        }
        .coa-grid tbody tr:nth-child(odd) td {
            background: #f5f6f8;
        }
        .coa-grid tbody tr:nth-child(even) td {
            background: #edf0f3;
        }
        .coa-grid-row:hover td,
        .coa-grid-row.is-selected td {
            background: #dfeee7 !important;
        }
        .coa-grid-row {
            cursor: pointer;
        }
        .coa-type-col {
            width: 14%;
        }
        .coa-name-col {
            width: 24%;
        }
        .coa-currency-col {
            width: 10%;
        }
        .coa-mapped-col {
            width: 22%;
        }
        .coa-status-col {
            width: 12%;
        }
        .coa-actions-col,
        .coa-actions-cell {
            width: 5rem;
            min-width: 5rem;
            max-width: 5rem;
            padding-left: 0.45rem !important;
            padding-right: 0.2rem !important;
            text-align: left;
        }
        .coa-kind-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.2rem 0.5rem;
            border-radius: 999px;
            background: #f1f5f9;
            border: 1px solid #cbd5e1;
            color: #334155;
            font-size: 0.78rem;
            font-weight: 700;
        }
        .coa-name-cell {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .coa-name-cell strong {
            font-weight: 600;
        }
        .coa-mapped-cell {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .coa-actions-menu {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }
        .coa-menu-dots {
            width: 1.75rem;
            height: 1.75rem;
            border: 0;
            border-radius: 0;
            background: transparent;
            color: #475569;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font: inherit;
            font-weight: 700;
            font-size: 1.25rem;
            line-height: 1;
            padding: 0;
            cursor: pointer;
        }
        .coa-menu-dots:hover,
        .coa-actions-menu.open .coa-menu-dots {
            background: transparent;
            color: #0f172a;
        }
        .coa-menu-dots:focus-visible {
            outline: 2px solid #94a3b8;
            outline-offset: 2px;
        }
        .coa-actions-menu-dropdown {
            position: absolute;
            right: 0;
            top: calc(100% + 0.25rem);
            z-index: 40;
            display: none;
            min-width: 9.5rem;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
            padding: 0.25rem;
        }
        .coa-actions-menu.open .coa-actions-menu-dropdown {
            display: block;
        }
        .coa-menu-item {
            display: block;
            width: 100%;
            box-sizing: border-box;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: #1f2937;
            cursor: pointer;
            font: inherit;
            font-size: 0.84rem;
            font-weight: 700;
            line-height: 1.2;
            padding: 0.5rem 0.6rem;
            text-align: left;
            text-decoration: none;
        }
        .coa-menu-item:hover,
        .coa-menu-item:focus {
            background: #f1f5f9;
            outline: none;
        }
        .coa-menu-danger {
            color: #b91c1c;
        }
        .coa-menu-danger:hover,
        .coa-menu-danger:focus {
            background: #fef2f2;
        }
        .coa-grid-empty td {
            text-align: center;
            color: #6b7280;
            padding: 1rem 0.75rem;
            background: #f9fafb !important;
        }
        .coa-delete-overlay {
            position: fixed;
            inset: 0;
            z-index: 3000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            background: rgba(15, 23, 42, 0.48);
            box-sizing: border-box;
        }
        .coa-delete-overlay[hidden] {
            display: none !important;
        }
        .coa-delete-dialog {
            width: min(100%, 480px);
            border: 1px solid #d1d5db;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
            padding: 1.1rem 1.15rem 1rem;
            box-sizing: border-box;
        }
        .coa-delete-dialog h2 {
            margin: 0 0 0.55rem;
            color: #111827;
            font-size: 1.08rem;
            line-height: 1.2;
        }
        .coa-delete-dialog p {
            margin: 0 0 0.65rem;
            color: #374151;
            font-size: 0.9rem;
            line-height: 1.45;
        }
        .coa-delete-dialog .coa-delete-warning {
            color: #991b1b;
            font-weight: 700;
        }
        .coa-delete-actions {
            display: flex;
            gap: 0.5rem;
            justify-content: flex-end;
            margin-top: 0.9rem;
        }
        .coa-delete-cancel,
        .coa-delete-confirm {
            border-radius: 7px;
            cursor: pointer;
            font: inherit;
            font-size: 0.86rem;
            font-weight: 700;
            line-height: 1.2;
            min-height: 2.1rem;
            padding: 0.45rem 0.75rem;
        }
        .coa-delete-cancel {
            border: 1px solid #cbd5e1;
            background: #ffffff;
            color: #1f2937;
        }
        .coa-delete-cancel:hover {
            background: #f8fafc;
        }
        .coa-delete-confirm {
            border: 1px solid #b91c1c;
            background: #b91c1c;
            color: #ffffff;
        }
        .coa-delete-confirm:hover {
            background: #991b1b;
        }
        .badge {
            display: inline-block;
            padding: 0.18rem 0.5rem;
            border-radius: 999px;
            font-weight: 700;
            font-size: 0.85rem;
        }
        .badge-open {
            background: #ecfdf5;
            color: #065f46;
            border: 1px solid #a7f3d0;
        }
        .badge-locked {
            background: #fef2f2;
            color: #991b1b;
            border: 1px solid #fecaca;
        }
        .text-danger-strong {
            color: #991b1b;
            font-weight: 700;
        }
        .muted-text {
            color: #6b7280;
        }
        .coa-detail-column {
            border: 1px solid #d1d5db;
            border-radius: 12px;
            background: #ffffff;
            box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: clamp(380px, 76vh, 920px);
        }
        .coa-detail-body {
            position: relative;
            flex: 1 1 auto;
            min-height: 0;
            background: #f8fafc;
        }
        .coa-pane-resizer {
            width: 6px;
            cursor: col-resize;
            user-select: none;
            touch-action: none;
            border-radius: 6px;
            background: transparent;
            position: relative;
            transition: background-color 120ms ease, box-shadow 120ms ease;
        }
        .coa-pane-resizer::before {
            content: "";
            position: absolute;
            left: 2px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #d1d5db;
        }
        .coa-workspace.is-detail-collapsed .coa-pane-resizer {
            width: 14px;
            border-radius: 8px;
            background: #eef2f7;
            box-shadow: inset 0 0 0 1px #d1d5db;
        }
        .coa-workspace.is-detail-collapsed .coa-pane-resizer::before {
            left: 5px;
            width: 3px;
            background: #94a3b8;
        }
        .coa-detail-frame {
            display: none;
            width: 100%;
            height: 100%;
            border: none;
            background: #ffffff;
        }
        .coa-detail-column.has-selection .coa-detail-frame {
            display: block;
        }
        .coa-detail-empty {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            text-align: center;
            color: #6b7280;
            font-weight: 600;
            font-size: 0.95rem;
        }
        .coa-detail-column.has-selection .coa-detail-empty {
            display: none;
        }
        .add-coa-panel {
            margin-top: 0.85rem;
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
            padding: 0.42rem 0.7rem 0.75rem;
        }
        .add-coa-summary {
            cursor: pointer;
            list-style: none;
            font-weight: 700;
            color: #1f2937;
        }
        .add-coa-summary::-webkit-details-marker {
            display: none;
        }
        .add-coa-actions {
            margin-top: 0.7rem;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .add-coa-actions .button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            min-height: 2.35rem;
            border: 1px solid #133752;
            border-radius: 8px;
            background: #133752;
            background-color: #133752;
            color: #f8fafc;
            font-size: 0.84rem;
            font-weight: 750;
            line-height: 1;
            padding: 0.55rem 0.9rem;
            text-decoration: none;
        }
        .add-coa-actions .button:hover,
        .add-coa-actions .button:focus {
            background: #0f2d44;
            background-color: #0f2d44;
            border-color: #0f2d44;
            color: #ffffff;
        }
        @media (max-width: 1240px) {
            .coa-workspace {
                grid-template-columns: minmax(0, var(--coa-left-pane-width)) 6px minmax(0, 1fr);
            }
        }
        @media (max-width: 1080px) {
            .coa-query-shell {
                max-width: none;
            }
            .coa-workspace {
                grid-template-columns: 1fr;
            }
            .coa-pane-resizer {
                display: none !important;
            }
            .coa-grid {
                min-width: 860px;
            }
            .coa-detail-column {
                min-height: 560px;
            }
        }

/* Template style block */
.handsontable td.tb-cell-invalid {
    background: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e;
  }

/* Template style block */
.coa-sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}
  .coa-sheet-actions{display:flex;align-items:center;gap:.4rem}
  .coa-icon-button{width:2rem;height:2rem;border:none;background:transparent;color:#6b7280;border-radius:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
  .coa-icon-button:hover{color:#374151;background:transparent}
  .coa-icon-button svg{width:1rem;height:1rem}
  .coa-sheet-menu{position:relative}
  .coa-sheet-menu-dropdown{position:absolute;right:0;top:2.2rem;min-width:170px;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.14);overflow:hidden;z-index:20}
  .coa-sheet-menu-dropdown button,.coa-sheet-menu-dropdown a{display:block;width:100%;padding:.55rem .7rem;text-align:left;border:none;background:#fff;color:#111827;text-decoration:none;font:inherit;cursor:pointer}
  .coa-sheet-menu-dropdown button:hover,.coa-sheet-menu-dropdown a:hover{background:#f3f4f6}

/* Template style block */
.badge{display:inline-block;padding:.18rem .5rem;border-radius:999px;font-weight:700;font-size:.85rem;vertical-align:middle;}
  .badge-locked{background:#fef2f2;color:#991b1b;border:1px solid #fecaca;}

/* Template style block */
.app-window-table-wrap{max-height:clamp(320px,65vh,720px);overflow:auto;scrollbar-gutter:stable;}

/* Template style block */
.app-window-table-wrap{max-height:clamp(320px,65vh,720px);overflow:auto;scrollbar-gutter:stable;}

/* Template style block */
.handsontable td.tb-cell-invalid {
    background: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e;
  }

/* Template style block */
.coa-sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}
  .coa-sheet-actions{display:flex;align-items:center;gap:.4rem}
  .coa-icon-button{width:2rem;height:2rem;border:none;background:transparent;color:#6b7280;border-radius:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
  .coa-icon-button:hover{color:#374151;background:transparent}
  .coa-icon-button svg{width:1rem;height:1rem}
  .coa-sheet-menu{position:relative}
  .coa-sheet-menu-dropdown{position:absolute;right:0;top:2.2rem;min-width:170px;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.14);overflow:hidden;z-index:20}
  .coa-sheet-menu-dropdown button,.coa-sheet-menu-dropdown a{display:block;width:100%;padding:.55rem .7rem;text-align:left;border:none;background:#fff;color:#111827;text-decoration:none;font:inherit;cursor:pointer}
  .coa-sheet-menu-dropdown button:hover,.coa-sheet-menu-dropdown a:hover{background:#f3f4f6}

/* Template style block */
.coa-map-panel{background:white;border:1px solid #e5e7eb;border-radius:12px;padding:12px 14px;box-shadow:0 1px 3px rgba(0,0,0,.06);margin:1rem 0}
  .coa-map-header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
  .coa-map-title{font-weight:800}
  .coa-add-map{display:flex;align-items:center;gap:8px}
  .coa-select{border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;background:white}
  .button.small{padding:.45rem .7rem;font-size:.9rem}
  .button.danger{color:#b91c1c;border-color:#fecaca;background:#fff1f2}
  .coa-map-list{margin-top:10px;display:flex;flex-direction:column;gap:6px}
  .coa-map-row{display:flex;align-items:center;justify-content:space-between;padding:10px 10px;border:1px solid #eef2f7;border-radius:12px;background:#fbfdff}
  .coa-inline-form{margin:0}
  .badge{display:inline-block;padding:.18rem .5rem;border-radius:999px;font-weight:700;font-size:.85rem;vertical-align:middle;}
  .badge-locked{background:#fef2f2;color:#991b1b;border:1px solid #fecaca;}

/* Template style block */
.app-window-table-wrap{max-height:clamp(320px,65vh,720px);overflow:auto;scrollbar-gutter:stable;}

/* Template style block */
.org-switch-shell {
        max-width: 760px;
        margin: 0 auto;
        color: #0f172a;
    }
    .org-switch-header h1 {
        margin: 0;
        font-size: 1.5rem;
    }
    .org-switch-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .org-switch-error {
        margin-top: 0.75rem;
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #991b1b;
        border-radius: 8px;
        padding: 0.55rem 0.7rem;
        font-size: 0.84rem;
    }
    .org-switch-list {
        margin-top: 0.8rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        overflow: hidden;
    }
    .org-switch-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.7rem 0.8rem;
        border-bottom: 1px solid #e2e8f0;
    }
    .org-switch-row:last-child {
        border-bottom: none;
    }
    .org-switch-copy {
        min-width: 0;
        display: grid;
        gap: 0.1rem;
    }
    .org-switch-copy strong {
        font-size: 0.95rem;
        line-height: 1.2;
        word-break: break-word;
    }
    .org-switch-copy span {
        color: #64748b;
        font-size: 0.82rem;
    }
    .org-switch-btn {
        border: 1px solid #133752;
        background: #133752;
        color: #f8fafc;
        border-radius: 8px;
        padding: 0.42rem 0.72rem;
        font: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 auto;
    }
    .org-switch-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .org-switch-btn.is-current {
        border-color: #cbd5e1;
        background: #f8fafc;
        color: #64748b;
        cursor: default;
    }
    .org-switch-footer {
        margin-top: 0.85rem;
        display: flex;
        justify-content: flex-end;
    }
    .org-remove-link {
        color: #b91c1c;
        text-decoration: none;
        font-weight: 700;
        font-size: 0.85rem;
    }
    .org-remove-link:hover {
        text-decoration: underline;
    }

.consolidation-shell {
    width: min(1500px, calc(100vw - 40px));
    margin: 22px auto 64px;
    color: #111827;
}

.consolidation-head,
.consolidation-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.consolidation-head h1,
.consolidation-panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.consolidation-head p,
.consolidation-panel-head p {
    margin: 4px 0 0;
    color: #6b7280;
}

.consolidation-chart-picker label,
.consolidation-form-grid label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 650;
    color: #4b5563;
}

.consolidation-chart-picker select,
.consolidation-form-grid input,
.consolidation-form-grid select,
.consolidation-form-grid textarea {
    min-height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    padding: 8px 10px;
}

.consolidation-tabs {
    position: sticky;
    top: calc(var(--navbar-offset, 54px) + 8px);
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 18px 0;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.consolidation-tabs a {
    padding: 8px 10px;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.consolidation-tabs a:hover,
.consolidation-tabs a:focus {
    background: #eef2ff;
    color: #1f2937;
}

.consolidation-panel {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.consolidation-table-wrap {
    margin-top: 14px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.consolidation-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 13px;
}

.consolidation-table th,
.consolidation-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.consolidation-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fafb;
    color: #4b5563;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 750;
}

.consolidation-table tbody tr:hover {
    background: #f8fafc;
}

.consolidation-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef0f3;
}

.consolidation-form-compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.consolidation-form-wide {
    grid-column: 1 / -1;
}

.consolidation-check {
    grid-template-columns: auto 1fr;
    align-items: center;
    align-content: center;
    min-height: 36px;
    padding-top: 18px;
}

.consolidation-check input {
    min-height: auto;
}

.consolidation-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}

.consolidation-form-actions button,
.consolidation-link-button {
    border: 1px solid #111827;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.consolidation-form-actions button {
    min-height: 36px;
    padding: 8px 14px;
}

.consolidation-link-button {
    padding: 6px 9px;
    background: #fff;
    color: #991b1b;
    border-color: #fecaca;
}

.consolidation-link-button:hover,
.consolidation-link-button:focus {
    background: #fef2f2;
}

.consolidation-alert {
    margin: 14px 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.consolidation-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.consolidation-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.coa-sheet-menu-dropdown .coa-sheet-menu-disabled,
.coa-sheet-menu-dropdown .coa-sheet-menu-disabled:hover,
.dimension-sheet-menu-dropdown .dimension-sheet-menu-disabled,
.dimension-sheet-menu-dropdown .dimension-sheet-menu-disabled:hover,
.coa-sheet-menu-dropdown .app-menu-disabled,
.coa-sheet-menu-dropdown .app-menu-disabled:hover,
.dimension-sheet-menu-dropdown .app-menu-disabled,
.dimension-sheet-menu-dropdown .app-menu-disabled:hover,
.tb-sheet-menu-dropdown .app-menu-disabled,
.tb-sheet-menu-dropdown .app-menu-disabled:hover {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.app-menu-group {
    display: block;
}

.app-menu-group-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.app-menu-group-toggle::after {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.14s ease;
}

.app-menu-group-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

.app-menu-group-options[hidden] {
    display: none !important;
}

.app-menu-group-options a,
.app-menu-group-options button {
    padding-left: 1.35rem !important;
}

.journal-actions-menu .app-menu-group-toggle,
.journal-actions-menu .app-menu-group-options button,
.journal-entry-detail-menu .app-menu-group-toggle,
.journal-entry-detail-menu .app-menu-group-options button {
    display: flex !important;
    width: 100%;
    border: 0;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.journal-actions-menu .app-menu-group-toggle,
.journal-actions-menu .app-menu-group-options button {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
}

.journal-entry-detail-menu .app-menu-group-toggle,
.journal-entry-detail-menu .app-menu-group-options button {
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.journal-actions-menu .app-menu-group-toggle:hover,
.journal-actions-menu .app-menu-group-options button:hover,
.journal-entry-detail-menu .app-menu-group-toggle:hover,
.journal-entry-detail-menu .app-menu-group-options button:hover {
    background: #f3f4f6;
}

.coa-lock-form {
    justify-content: flex-start;
}

.coa-danger-zone {
    border-color: #fecaca;
    background: #fff5f5;
}

.coa-danger-zone .consolidation-panel-head h2,
.coa-danger-zone .consolidation-panel-head p {
    color: #991b1b;
}

.coa-danger-button {
    border: 1px solid #b91c1c;
    border-radius: 6px;
    background: #b91c1c;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 36px;
    padding: 8px 14px;
}

.coa-danger-button:hover,
.coa-danger-button:focus {
    background: #991b1b;
    border-color: #991b1b;
}

.coa-admin-settings .consolidation-head {
    align-items: center;
}

.coa-admin-settings .coa-sheet-title-block h1 {
    font-size: 1.47rem;
    gap: 0.35rem;
}

.coa-admin-settings .coa-sheet-currency {
    font-size: 0.86rem;
}

.coa-admin-settings .consolidation-form-actions button,
.coa-admin-settings .consolidation-link-button,
.coa-admin-settings .org-admin-primary-btn,
.coa-admin-settings .org-admin-danger-btn {
    border-color: #133752;
    background: #133752;
    color: #ffffff;
}

.coa-admin-settings .consolidation-form-actions button:hover,
.coa-admin-settings .consolidation-form-actions button:focus,
.coa-admin-settings .consolidation-link-button:hover,
.coa-admin-settings .consolidation-link-button:focus,
.coa-admin-settings .org-admin-primary-btn:hover,
.coa-admin-settings .org-admin-primary-btn:focus,
.coa-admin-settings .org-admin-danger-btn:hover,
.coa-admin-settings .org-admin-danger-btn:focus {
    border-color: #0f2d44;
    background: #0f2d44;
    color: #ffffff;
}

.coa-admin-settings button.is-saving {
    cursor: wait;
    opacity: 0.74;
}

.company-admin-settings .consolidation-form-actions button,
.company-admin-settings .org-admin-primary-btn {
    border-color: #133752;
    background: #133752;
    color: #ffffff;
}

.company-admin-settings .consolidation-form-actions button:hover,
.company-admin-settings .consolidation-form-actions button:focus,
.company-admin-settings .org-admin-primary-btn:hover,
.company-admin-settings .org-admin-primary-btn:focus {
    border-color: #0f2d44;
    background: #0f2d44;
    color: #ffffff;
}

.coa-settings-back-link {
    color: #2563eb;
    font-size: 1.04rem;
    font-weight: 750;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
}

.coa-settings-back-link:hover,
.coa-settings-back-link:focus {
    color: #1d4ed8;
    text-decoration: underline;
}

.coa-settings-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 18px;
}

.coa-settings-dropdown-panel {
    padding: 0;
    overflow: hidden;
    border-color: #d8e1ee;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}

.coa-settings-dropdown {
    display: block;
}

.coa-settings-dropdown summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.88rem 1rem;
    cursor: pointer;
    list-style: none;
}

.coa-settings-dropdown summary::-webkit-details-marker {
    display: none;
}

.coa-settings-dropdown summary:hover {
    background: #f8fafc;
}

.coa-settings-dropdown[open] > summary {
    background: #fbfcfe;
    border-bottom: 1px solid #e2e8f0;
}

.coa-settings-summary-copy {
    min-width: 0;
    display: grid;
    gap: 0.16rem;
}

.coa-settings-summary-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
}

.coa-settings-summary-text {
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
}

.coa-settings-summary-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.coa-settings-summary-meta > span:first-child:not(.coa-settings-state-pill):not(.coa-settings-summary-action) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
}

.coa-settings-summary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 750;
    white-space: nowrap;
}

.coa-settings-summary-action::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.16s ease;
}

.coa-settings-dropdown[open] .coa-settings-summary-action {
    color: #1d4ed8;
}

.coa-settings-dropdown[open] .coa-settings-summary-action::after {
    transform: rotate(-135deg) translateY(-1px);
}

.coa-settings-dropdown-body {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    background: #ffffff;
}

.coa-settings-warning,
.coa-settings-note {
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.4;
    padding: 0.62rem 0.75rem;
}

.coa-settings-note {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.coa-settings-warning-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.coa-settings-impact {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    border: 1px solid #f1d6a8;
    border-radius: 8px;
    background: #fffaf0;
    color: #7c2d12;
    padding: 0.62rem 0.75rem;
}

.coa-settings-impact > span {
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}

.coa-settings-impact p {
    margin: 0;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.38;
}

.coa-settings-impact.coa-settings-warning-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.coa-settings-impact.coa-settings-warning-danger > span {
    color: #991b1b;
}

.coa-settings-impact-compact {
    padding: 0.55rem 0.68rem;
}

.coa-settings-table-primary,
.coa-settings-table-line,
.coa-settings-table-subtle {
    display: block;
}

.coa-settings-table-primary {
    color: #0f172a;
    font-weight: 750;
    line-height: 1.25;
}

.coa-settings-table-line {
    line-height: 1.35;
}

.coa-settings-table-subtle {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
}

.coa-settings-number-cell {
    color: #475569;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.coa-admin-settings .coa-policy-form {
    align-items: end;
    gap: 0.75rem;
}

.coa-admin-settings .coa-investment-policy-form,
.coa-admin-settings .coa-intercompany-policy-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.coa-admin-settings .coa-policy-form label {
    min-width: 0;
}

.coa-admin-settings .coa-policy-form input,
.coa-admin-settings .coa-policy-form select,
.coa-admin-settings .coa-policy-form textarea {
    box-sizing: border-box;
    width: 100%;
}

.coa-policy-number-field {
    max-width: none;
}

.coa-policy-number-field input {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.coa-policy-field-group {
    display: grid;
    gap: 6px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 650;
}

.coa-policy-field-label {
    line-height: 1.2;
}

.coa-policy-inline-inputs {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) minmax(5rem, 0.55fr);
    gap: 0.5rem;
}

.coa-policy-inline-inputs label {
    display: grid;
    gap: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.coa-policy-inline-inputs input {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.coa-disclosure-table-wrap {
    margin-top: 0;
}

.coa-disclosure-table {
    min-width: 680px;
}

.coa-disclosure-note-text {
    min-width: 18rem;
    color: #111827;
    line-height: 1.42;
    white-space: normal !important;
}

.coa-disclosure-updated {
    width: 8.5rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.coa-disclosure-actions {
    width: 1%;
    text-align: right !important;
}

.coa-disclosure-edit-row td {
    background: #fbfcfe;
    white-space: normal !important;
}

.coa-disclosure-edit-form {
    display: grid;
    gap: 0.65rem;
}

.coa-disclosure-edit-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 5.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    line-height: 1.42;
    padding: 0.65rem 0.72rem;
    resize: vertical;
}

.coa-disclosure-edit-form textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: #2563eb;
}

.coa-disclosure-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.coa-settings-note-card {
    display: grid;
    gap: 0.62rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fbfcfe;
    padding: 0.78rem;
}

.coa-settings-note-card label {
    margin: 0;
}

.coa-settings-note-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.coa-settings-note-meta {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
}

.coa-settings-note-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.coa-settings-workgrid,
.coa-settings-command-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 0.9fr) minmax(18rem, 1.1fr);
    gap: 0.75rem;
    align-items: start;
}

.coa-settings-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coa-settings-subpanel,
.coa-settings-command-card {
    min-width: 0;
    display: grid;
    gap: 0.72rem;
    align-content: start;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fbfcfe;
    padding: 0.82rem;
}

.coa-settings-subhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.coa-settings-subhead h3 {
    margin: 0;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.2;
}

.coa-settings-subhead p {
    margin: 0.22rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.35;
}

.coa-settings-count,
.coa-settings-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    min-width: 1.75rem;
    padding: 0.22rem 0.5rem;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.coa-settings-state-pill.is-open {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.coa-settings-state-pill.is-locked {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.coa-settings-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.65rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.coa-settings-select-label {
    display: grid;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 750;
}

.coa-settings-select {
    min-height: 2.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    padding: 0.5rem 0.62rem;
}

.coa-settings-confirm {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

.coa-settings-confirm input {
    width: auto;
    min-height: auto;
    margin: 0;
}

.coa-settings-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    border: 1px solid #133752;
    border-radius: 8px;
    background: #133752;
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1;
    padding: 0.55rem 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.coa-settings-primary-button:hover,
.coa-settings-primary-button:focus {
    background: #0f2d44;
    border-color: #0f2d44;
    color: #ffffff;
}

.coa-settings-primary-button:disabled,
.org-admin-primary-btn:disabled,
.coa-settings-select:disabled,
.coa-settings-confirm input:disabled,
.coa-settings-name-confirm input:disabled,
.consolidation-link-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.coa-settings-mapping-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.coa-settings-mapping-row {
    display: grid;
    grid-template-columns: minmax(10rem, 0.75fr) minmax(18rem, 1.25fr);
    align-items: end;
    gap: 0.65rem;
    padding: 0.62rem 0.68rem;
    border-bottom: 1px solid #eef2f7;
}

.coa-settings-mapping-row:last-child {
    border-bottom: 0;
}

.coa-settings-mapping-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.coa-settings-mapping-copy strong {
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.coa-settings-mapping-copy span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.coa-settings-row-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto;
    align-items: end;
    gap: 0.55rem;
}

.coa-settings-name-confirm {
    display: grid;
    gap: 0.3rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.2;
}

.coa-settings-name-confirm input {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.18rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.58rem;
}

.coa-settings-name-confirm input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: #2563eb;
}

.coa-settings-unmap-form .consolidation-link-button {
    min-height: 2.18rem;
    padding: 0.45rem 0.75rem;
}

.coa-settings-empty {
    padding: 0.75rem 0;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 650;
}

.coa-settings-action-block {
    display: grid;
    gap: 0.78rem;
    padding-top: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

.coa-settings-action-block:first-child {
    padding-top: 0;
    border-top: 0;
}

.coa-settings-action-block .consolidation-panel-head {
    align-items: center;
}

.coa-settings-action-block .consolidation-panel-head h2 {
    font-size: 1rem;
}

.coa-settings-lock-form {
    display: grid;
    grid-template-columns: auto;
    align-items: center;
    justify-content: end;
    gap: 0;
    margin-top: auto;
}

.org-manage-list.coa-settings-manage-list {
    padding: 0;
}

.org-manage-row.coa-settings-manage-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.coa-settings-manage-row .org-admin-primary-btn,
.coa-settings-manage-row .org-admin-danger-btn {
    min-width: 9.75rem;
}

.dimension-settings-action-stack {
    display: grid;
    justify-items: end;
    gap: 0.55rem;
    min-width: min(24rem, 100%);
}

.dimension-settings-action-stack .coa-settings-manage-form {
    display: grid;
    gap: 0.55rem;
    width: min(24rem, 100%);
}

.dimension-settings-action-stack [data-dimension-action-panel][hidden] {
    display: none !important;
}

.dimension-settings-action-stack label {
    display: grid;
    gap: 0.3rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.2;
}

.dimension-settings-action-stack input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.18rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.58rem;
}

.dimension-settings-action-stack input[type="text"]:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: #2563eb;
}

.dimension-settings-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dimension-settings-inline-actions .btn-secondary {
    min-height: 2.2rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 750;
}

.dimension-settings-inline-actions .btn-secondary:hover,
.dimension-settings-inline-actions .btn-secondary:focus {
    background: #f8fafc;
    color: #0f172a;
}

.coa-settings-danger-block {
    border-color: #fecaca;
    background: #fffafa;
}

.coa-settings-danger-block .coa-settings-subhead h3,
.coa-settings-danger-block .coa-settings-subhead p {
    color: #991b1b;
}

@media (max-width: 760px) {
    .consolidation-shell {
        width: min(100vw - 24px, 1500px);
        margin-top: 14px;
    }

    .consolidation-head,
    .consolidation-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .consolidation-tabs {
        position: static;
    }

    .coa-settings-dropdown summary,
    .coa-settings-add-form,
    .coa-settings-mapping-row,
    .coa-settings-workgrid,
    .coa-settings-command-grid,
    .coa-settings-lock-form {
        align-items: stretch;
        grid-template-columns: minmax(0, 1fr);
    }

    .coa-settings-summary-meta {
        width: 100%;
        justify-content: space-between;
    }

    .coa-settings-summary-action {
        width: auto;
    }

    .coa-settings-row-form,
    .dimension-settings-action-stack,
    .dimension-settings-action-stack .coa-settings-manage-form,
    .coa-settings-primary-button,
    .coa-danger-button,
    .coa-settings-manage-row .org-admin-primary-btn,
    .coa-settings-manage-row .org-admin-danger-btn {
        width: 100%;
    }

    .coa-settings-row-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .coa-admin-settings .coa-investment-policy-form,
    .coa-admin-settings .coa-intercompany-policy-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .org-manage-row.coa-settings-manage-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Template style block */
.perm-shell {
        max-width: 980px;
        margin: 0 auto;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .perm-header {
        margin-bottom: 0.95rem;
    }
    .perm-back-link {
        display: inline-flex;
        align-items: center;
        text-decoration: none;
        color: #334155;
        font-size: 0.83rem;
        font-weight: 700;
    }
    .perm-header h1 {
        margin: 0.35rem 0 0;
        font-size: 1.5rem;
        line-height: 1.2;
    }
    .perm-subtitle {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .perm-form {
        display: grid;
        gap: 0.9rem;
    }
    .perm-section {
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.95rem;
    }
    .perm-section h2 {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }
    .perm-help {
        margin: 0.3rem 0 0.75rem;
        color: #64748b;
        font-size: 0.84rem;
    }
    .perm-field {
        display: grid;
        gap: 0.4rem;
        max-width: 260px;
    }
    .perm-field span {
        font-size: 0.78rem;
        font-weight: 700;
        color: #334155;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    .perm-field select {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.5rem 0.58rem;
        font: inherit;
        color: #0f172a;
    }
    .perm-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 0.6rem;
    }
    .perm-checkbox-row {
        display: flex;
        align-items: flex-start;
        gap: 0.55rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.58rem 0.62rem;
        background: #ffffff;
    }
    .perm-checkbox-row input[type="checkbox"] {
        margin-top: 0.17rem;
    }
    .perm-checkbox-row.is-admin-only-locked {
        background: #f1f5f9;
        border-color: #cbd5e1;
        cursor: not-allowed;
    }
    .perm-checkbox-row.is-admin-only-locked .perm-checkbox-title,
    .perm-checkbox-row.is-admin-only-locked .perm-checkbox-help {
        color: #94a3b8;
    }
    .perm-checkbox-row.is-admin-only-locked input[type="checkbox"] {
        cursor: not-allowed;
    }
    .perm-checkbox-copy {
        display: grid;
        gap: 0.1rem;
        min-width: 0;
    }
    .perm-checkbox-title {
        font-size: 0.83rem;
        font-weight: 700;
        color: #0f172a;
        word-break: break-word;
    }
    .perm-checkbox-help {
        color: #64748b;
        font-size: 0.76rem;
        line-height: 1.25;
    }
    .perm-role-note {
        margin: 0.6rem 0 0;
        color: #64748b;
        font-size: 0.8rem;
    }
    .perm-scope-options {
        display: grid;
        gap: 0.5rem;
    }
    .perm-radio-row {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        color: #0f172a;
        font-size: 0.84rem;
    }
    .perm-company-list {
        margin-top: 0.7rem;
        display: grid;
        gap: 0.48rem;
    }
    .perm-empty {
        margin: 0;
        color: #64748b;
        font-size: 0.82rem;
    }
    .perm-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.6rem;
        margin-top: 0.1rem;
    }
    .perm-secondary-btn,
    .perm-primary-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font: inherit;
        font-size: 0.83rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.52rem 0.76rem;
        text-decoration: none;
    }
    .perm-secondary-btn {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #334155;
    }
    .perm-primary-btn {
        border: 1px solid #133752;
        background: #133752;
        color: #f8fafc;
        cursor: pointer;
    }
    .perm-primary-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .is-hidden {
        display: none;
    }

    @media (max-width: 640px) {
        .perm-actions {
            justify-content: stretch;
            flex-direction: column-reverse;
        }
        .perm-secondary-btn,
        .perm-primary-btn {
            width: 100%;
        }
    }

/* Template style block */
.org-shell {
        max-width: 1180px;
        margin: 0 auto;
        padding-top: 1rem;
        font-family: var(--app-font-family);
        color: #0f172a;
    }
    .org-identity-section {
        margin-bottom: 0.9rem;
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
        padding: 1rem 0.95rem;
        position: relative;
        text-align: left;
    }
    .org-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        position: relative;
    }
    .org-header-copy {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
    }
    .org-header-actions {
        display: flex;
        flex: 0 0 auto;
        justify-content: flex-end;
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        align-items: center;
    }
    .org-header h1 {
        margin: 0;
        font-size: 1.42rem;
        line-height: 1.1;
        font-weight: 700;
        letter-spacing: 0;
        text-align: left;
    }
    .org-subtitle {
        margin: 0.42rem 0 0;
        color: #64748b;
        font-size: 0.93rem;
    }
    .org-subtitle-danger {
        color: #991b1b;
        font-weight: 700;
    }
    .org-header-dots {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.35rem;
        height: 2.35rem;
        box-sizing: border-box;
        border: none;
        border-radius: 999px;
        background: transparent;
        color: #334155;
        cursor: pointer;
        font-size: 1.45rem;
        font-weight: 800;
        line-height: 1;
        padding: 0;
        box-shadow: none;
    }
    .org-header-dots:hover {
        background: transparent;
        color: #0f172a;
    }
    .org-header-dots:focus-visible {
        outline: 2px solid rgba(51, 65, 85, 0.22);
        outline-offset: 2px;
    }
    .org-header-menu-dropdown {
        min-width: 230px;
        top: calc(100% + 0.42rem);
        z-index: 90;
    }
    .org-disclosures-panel {
        margin-bottom: 0.9rem;
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }
    .org-disclosures-dropdown {
        display: block;
    }
    .org-disclosures-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.72rem;
        padding: 0.95rem 1rem 0.8rem;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
        cursor: pointer;
        list-style: none;
    }
    .org-disclosures-header::-webkit-details-marker {
        display: none;
    }
    .org-disclosures-header:hover {
        background: #f1f5f9;
    }
    .org-disclosures-header h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.03rem;
        line-height: 1.2;
        letter-spacing: 0;
    }
    .org-disclosures-summary-meta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.6rem;
        min-height: 1.45rem;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #ffffff;
        color: #475569;
        font-size: 0.76rem;
        font-weight: 750;
        line-height: 1;
        margin-left: auto;
        padding: 0.2rem 0.48rem;
    }
    .org-disclosures-caret {
        width: 0.46rem;
        height: 0.46rem;
        border-right: 2px solid #475569;
        border-bottom: 2px solid #475569;
        flex: 0 0 auto;
        transform: rotate(45deg) translateY(-1px);
        transition: transform 0.16s ease;
    }
    .org-disclosures-dropdown[open] .org-disclosures-caret {
        transform: rotate(-135deg) translateY(-1px);
    }
    .org-disclosures-list {
        display: grid;
        gap: 0.58rem;
        padding: 0.85rem 1rem 1rem;
    }
    .org-disclosure-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.74rem 0.82rem;
    }
    .org-disclosure-main {
        min-width: 0;
        display: grid;
        gap: 0.16rem;
    }
    .org-disclosure-main strong {
        overflow: hidden;
        color: #0f172a;
        font-size: 0.91rem;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .org-disclosure-main span,
    .org-disclosure-meta {
        color: #64748b;
        font-size: 0.78rem;
        line-height: 1.25;
    }
    .org-disclosure-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
        max-width: 26rem;
    }
    .org-disclosure-meta span {
        max-width: 13rem;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        background: #f8fafc;
        color: #334155;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.25rem 0.45rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .org-disclosure-row.is-restricted {
        border-style: dashed;
        background: #f8fafc;
    }
    .org-disclosure-row.is-restricted .org-disclosure-meta span:first-child {
        color: #94a3b8;
    }
    .org-disclosures-empty {
        border: 1px dashed #cbd5e1;
        border-radius: 8px;
        background: #f8fafc;
        color: #64748b;
        font-size: 0.86rem;
        padding: 0.95rem;
        text-align: center;
    }
    .org-tree-panel {
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow: hidden;
    }
    .org-tree-header {
        padding: 0.95rem 1rem 0.8rem;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
    }
    .org-tree-header h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.03rem;
        line-height: 1.2;
        letter-spacing: 0;
    }
    .org-tree-list {
        display: grid;
        gap: 0;
        padding: 0.85rem 1rem 1rem;
    }
    .org-tree-row {
        --org-depth: 0;
        position: relative;
        display: grid;
        grid-template-columns: calc(var(--org-depth) * 2.1rem) minmax(0, 1fr);
        min-height: 3.35rem;
    }
    .org-tree-connector {
        position: relative;
        min-height: 100%;
    }
    .org-tree-row:not(:last-child) .org-tree-connector::after {
        content: "";
        position: absolute;
        right: 1rem;
        top: 0;
        bottom: 0;
        width: 1px;
        background: #dbe3ef;
    }
    .org-tree-node {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.7rem;
        margin: 0.18rem 0;
        padding: 0.72rem 0.82rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #ffffff;
    }
    .org-tree-node-icon {
        width: 0.82rem;
        height: 0.82rem;
        border-radius: 999px;
        background: #133752;
        box-shadow: 0 0 0 4px #eaf1f8;
    }
    .org-tree-node-copy {
        min-width: 0;
        display: grid;
        gap: 0.12rem;
    }
    .org-tree-node-copy strong {
        color: #0f172a;
        font-size: 0.92rem;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .org-tree-node-copy span,
    .org-tree-node-meta {
        color: #64748b;
        font-size: 0.78rem;
        line-height: 1.25;
    }
    .org-tree-node-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
        white-space: nowrap;
    }
    .org-tree-node-meta span {
        border: 1px solid #dbeafe;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.25rem 0.45rem;
    }
    .org-tree-row.is-restricted .org-tree-node {
        border-style: dashed;
        background: #f8fafc;
        color: #94a3b8;
    }
    .org-tree-row.is-restricted .org-tree-node-icon {
        background: #94a3b8;
        box-shadow: 0 0 0 4px #e2e8f0;
    }
    .org-tree-row.is-restricted .org-tree-node-copy strong,
    .org-tree-row.is-restricted .org-tree-node-copy span {
        color: #94a3b8;
    }
    .org-tree-empty {
        padding: 1.2rem;
        color: #64748b;
        text-align: center;
    }
    .org-header-panel {
        position: absolute;
        top: calc(100% + 2.95rem);
        right: 0;
        width: min(760px, calc(100vw - 2.4rem));
        margin: 0;
        z-index: 80;
    }
    .org-header-actions .org-danger-form {
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fff7f7;
        box-shadow: 0 18px 42px rgba(127, 29, 29, 0.16);
        padding: 0.85rem 0.95rem;
    }
    .org-danger-form[hidden] {
        display: none;
    }
    .org-delete-warning {
        border-left: 3px solid #dc2626;
        background: #ffffff;
        color: #7f1d1d;
        font-size: 0.82rem;
        line-height: 1.4;
        padding: 0.52rem 0.68rem;
    }
    .org-confirm-row {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        color: #7f1d1d;
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1.35;
    }
    .org-confirm-row input {
        margin-top: 0.1rem;
    }
    .org-lock-banner {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.9rem;
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fff7f7;
        box-shadow: 0 6px 18px rgba(127, 29, 29, 0.08);
        padding: 0.9rem 1rem;
    }
    .org-lock-banner h2 {
        margin: 0;
        color: #991b1b;
        font-size: 1.04rem;
        line-height: 1.2;
    }
    .org-lock-banner p {
        margin: 0.35rem 0 0;
        color: #7f1d1d;
        font-size: 0.86rem;
        line-height: 1.45;
    }
    .org-lock-cancel-form {
        flex: 0 0 auto;
        margin: 0;
    }
    .org-disabled-stack {
        opacity: 0.42;
        pointer-events: none;
        filter: grayscale(0.75);
        user-select: none;
    }
    .org-subscription-section {
        margin-bottom: 0.9rem;
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
        padding: 0.85rem 0.95rem;
    }
    .org-subscription-head h2 {
        margin: 0;
        font-size: 1.02rem;
        line-height: 1.2;
        color: #0f172a;
    }
    .org-subscription-head p {
        margin: 0.3rem 0 0;
        font-size: 0.82rem;
        color: #64748b;
    }
    .org-subscription-form {
        margin-top: 0.78rem;
    }
    .org-subscription-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #133752;
        background: #133752;
        color: #f8fafc;
        border-radius: 8px;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.55rem 0.82rem;
        cursor: pointer;
        text-decoration: none;
    }
    .org-subscription-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .org-subscription-muted {
        margin: 0.75rem 0 0;
        color: #64748b;
        font-size: 0.82rem;
    }
    .org-danger-section {
        margin-bottom: 0.9rem;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(154, 52, 18, 0.06);
        padding: 0.85rem 0.95rem;
    }
    .org-danger-head h2 {
        margin: 0;
        font-size: 1.02rem;
        line-height: 1.2;
        color: #9a3412;
    }
    .org-danger-head p {
        margin: 0.3rem 0 0;
        color: #7c2d12;
        font-size: 0.82rem;
        line-height: 1.4;
    }
    .org-danger-form {
        display: grid;
        gap: 0.45rem;
        margin: 0.78rem 0 0;
    }
    .org-danger-form label {
        color: #7c2d12;
        font-size: 0.8rem;
        font-weight: 700;
    }
    .org-danger-inline {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .org-danger-inline input {
        border: 1px solid #fdba74;
        border-radius: 8px;
        box-sizing: border-box;
        color: #111827;
        flex: 1 1 260px;
        font: inherit;
        min-height: 2.12rem;
        padding: 0.45rem 0.58rem;
    }
    .org-danger-btn,
    .org-secondary-btn {
        border-radius: 8px;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        min-height: 2.12rem;
        padding: 0.55rem 0.82rem;
    }
    .org-danger-btn {
        background: #b91c1c;
        border: 1px solid #b91c1c;
        color: #ffffff;
    }
    .org-danger-btn:hover {
        background: #991b1b;
        border-color: #991b1b;
    }
    .org-secondary-btn {
        background: #ffffff;
        border: 1px solid #c2410c;
        color: #9a3412;
        justify-self: start;
    }
    .org-secondary-btn:hover {
        background: #ffedd5;
    }
    .org-users-panel {
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow: hidden;
        margin-bottom: 0.9rem;
    }
    .org-users-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.9rem;
        padding: 0.95rem 1rem 0.85rem;
        border-bottom: 1px solid #e2e8f0;
        background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    }
    .org-users-header h2 {
        margin: 0;
        font-size: 1.03rem;
        line-height: 1.2;
        color: #0f172a;
    }
    .org-users-invite-btn {
        margin-top: 0.42rem;
        display: inline-flex;
        align-items: center;
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        color: #f8fafc;
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
    }
    .org-users-invite-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .org-users-controls {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    .org-users-total {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #334155;
        border-radius: 999px;
        font-size: 0.76rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.35rem 0.6rem;
        white-space: nowrap;
    }

    .org-users-table-wrap {
        overflow-x: auto;
    }
    .org-users-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 760px;
        font-size: 0.86rem;
        table-layout: fixed;
    }
    .org-col-email {
        width: 44%;
    }
    .org-col-role {
        width: 16%;
    }
    .org-col-permissions {
        width: 28%;
    }
    .org-col-actions {
        width: 12%;
    }
    .org-users-table th,
    .org-users-table td {
        border-bottom: 1px solid #e5e7eb;
        padding: 0.48rem 0.62rem;
        vertical-align: middle;
        text-align: left;
    }
    .org-users-table th {
        background: #f8fafc;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        font-weight: 700;
        color: #475569;
    }
    .org-users-table tbody tr:hover td {
        background: #f8fafc;
    }
    .org-email-cell {
        color: #0f172a;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .org-role-cell {
        padding-left: 0.9rem;
    }
    .org-actions-cell {
        white-space: nowrap;
    }
    .org-permissions-cell {
        min-width: 0;
    }
    .org-permissions-link {
        display: inline-flex;
        align-items: center;
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        color: #f8fafc;
        text-decoration: none;
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.28rem 0.55rem;
    }
    .org-permissions-link:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .org-permissions-disabled {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #f8fafc;
        color: #64748b;
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.28rem 0.55rem;
    }
    .org-permissions-summary {
        display: block;
        margin-top: 0.3rem;
        color: #64748b;
        font-size: 0.73rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .org-role-pill {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        padding: 0.2rem 0.56rem;
        font-size: 0.73rem;
        font-weight: 700;
        line-height: 1;
    }
    .org-role-pill.role-admin {
        background: #fef2f2;
        color: #991b1b;
        border-color: #fecaca;
    }
    .org-role-pill.role-editor {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #bfdbfe;
    }
    .org-role-pill.role-viewer {
        background: #ecfdf5;
        color: #065f46;
        border-color: #a7f3d0;
    }

    .org-status-pill {
        display: inline-flex;
        align-items: center;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        padding: 0.2rem 0.56rem;
        font-size: 0.73rem;
        font-weight: 700;
        line-height: 1;
    }
    .org-actions-menu {
        position: relative;
        display: inline-flex;
    }
    .org-menu-dots {
        border: none;
        background: transparent;
        color: #334155;
        font-size: 0.96rem;
        line-height: 1;
        cursor: pointer;
        border-radius: 6px;
        padding: 0.1rem 0.34rem;
    }
    .org-menu-dots:hover {
        background: #e2e8f0;
    }
    .org-menu-dots.org-header-dots {
        width: 2.35rem;
        height: 2.35rem;
        border: none;
        background: transparent;
        font-size: 1.45rem;
        padding: 0;
        box-shadow: none;
    }
    .org-menu-dots.org-header-dots:hover {
        background: transparent;
    }
    .org-actions-menu-dropdown {
        display: none;
        position: absolute;
        right: 0;
        top: 1.32rem;
        min-width: 150px;
        border-radius: 8px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
        overflow: hidden;
        z-index: 30;
    }
    .org-actions-menu.open .org-actions-menu-dropdown {
        display: block;
    }
    .org-actions-menu-dropdown form {
        margin: 0;
    }
    .org-invite-role-form {
        padding: 0.6rem 0.74rem;
        border-bottom: 1px solid #e2e8f0;
    }
    .org-invite-role-form label {
        display: block;
        margin-bottom: 0.34rem;
        color: #475569;
        font-size: 0.72rem;
        font-weight: 800;
    }
    .org-invite-role-inline {
        display: grid;
        grid-template-columns: minmax(7rem, 1fr) auto;
        gap: 0.42rem;
        align-items: center;
    }
    .org-invite-role-inline select {
        width: 100%;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        font-size: 0.78rem;
        padding: 0.36rem 0.42rem;
    }
    .org-actions-menu-dropdown a,
    .org-actions-menu-dropdown button {
        width: 100%;
        display: block;
        text-align: left;
        border: none;
        background: #ffffff;
        padding: 0.58rem 0.74rem;
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        color: #0f172a;
        text-decoration: none;
        cursor: pointer;
    }
    .org-actions-menu-dropdown a:hover,
    .org-actions-menu-dropdown button:hover {
        background: #f8fafc;
    }
    .org-menu-danger {
        color: #b91c1c;
    }
    .org-menu-disabled {
        display: block;
        width: 100%;
        border: none;
        background: #f8fafc;
        padding: 0.58rem 0.74rem;
        color: #94a3b8;
        font: inherit;
        font-size: 0.79rem;
        font-weight: 700;
        text-align: left;
        cursor: default;
        user-select: none;
    }
    .org-actions-empty {
        display: inline-block;
        width: 1.64rem;
        height: 1.2rem;
    }

    .org-pending-block {
        border-top: 1px solid #dbe3ef;
        background: #f8fbff;
    }
    .org-active-users-block {
        margin-bottom: 0.85rem;
    }
    .org-pending-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.82rem 1rem 0.72rem;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
    }
    .org-pending-header h3 {
        margin: 0;
        font-size: 0.95rem;
        color: #0f172a;
    }
    .org-pending-count {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #475569;
        border-radius: 999px;
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.3rem 0.56rem;
        white-space: nowrap;
    }
    .org-pending-block .org-users-table th {
        background: #f8fafc;
    }
    .org-pending-block .org-users-table tbody tr:hover td {
        background: #eef6ff;
    }
    .org-empty-row {
        text-align: center;
        color: #64748b;
        padding: 0.95rem 0.75rem;
    }
    .org-admin-settings .consolidation-head {
        align-items: center;
    }
    .org-admin-settings .consolidation-panel {
        border-color: #dbe3ef;
        border-radius: 10px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
    }
    .org-admin-settings .consolidation-panel-head {
        align-items: center;
    }
    .org-admin-settings .consolidation-panel-head h2,
    .org-admin-settings .org-users-header h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.03rem;
        font-weight: 750;
        line-height: 1.2;
        letter-spacing: 0;
    }
    .org-admin-settings .consolidation-panel-head p,
    .org-admin-settings .org-users-header p {
        margin: 0.3rem 0 0;
        color: #64748b;
        font-size: 0.84rem;
        line-height: 1.35;
    }
    .org-admin-panel-actions,
    .org-admin-settings .org-users-controls {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.55rem;
        flex-wrap: wrap;
    }
    .org-admin-settings .org-subscription-form {
        margin: 0;
    }
    .org-admin-settings .org-subscription-btn,
    .org-admin-settings .org-users-invite-btn,
    .org-admin-primary-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-width: 11.25rem;
        min-height: 2.35rem;
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        color: #f8fafc;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 750;
        line-height: 1;
        margin: 0;
        padding: 0.55rem 0.9rem;
        text-align: center;
        text-decoration: none;
    }
    .org-admin-settings .org-subscription-btn:hover,
    .org-admin-settings .org-users-invite-btn:hover,
    .org-admin-primary-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
        color: #ffffff;
    }
    .org-admin-settings .org-users-header {
        align-items: center;
        padding: 0;
        border-bottom: none;
        background: transparent;
        margin-bottom: 1rem;
    }
    .org-admin-settings .org-users-panel {
        overflow: visible;
    }
    .org-admin-settings .org-users-total {
        min-height: 2.35rem;
        box-sizing: border-box;
        padding: 0.45rem 0.7rem;
    }
    .org-admin-dropdown-panel {
        padding: 0;
    }
    .org-admin-dropdown-panel > .org-manage-dropdown[open] > summary {
        border-bottom: 1px solid #e2e8f0;
    }
    .org-admin-dropdown-body {
        padding: 1rem 1.1rem 1.1rem;
    }
    .org-subscription-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        margin-bottom: 0.9rem;
    }
    .org-subscription-summary-item {
        min-width: 0;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #f8fafc;
        padding: 0.78rem 0.85rem;
    }
    .org-subscription-summary-label {
        display: block;
        color: #64748b;
        font-size: 0.74rem;
        font-weight: 750;
        letter-spacing: 0;
        line-height: 1.2;
        text-transform: uppercase;
    }
    .org-subscription-summary-value {
        display: block;
        margin-top: 0.25rem;
        color: #0f172a;
        font-size: 0.98rem;
        font-weight: 800;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
    .org-license-usage-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.9rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #f8fafc;
        padding: 0.78rem 0.85rem;
    }
    .org-license-usage-head > div {
        min-width: 0;
        display: grid;
        gap: 0.2rem;
    }
    .org-license-kicker {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 750;
        letter-spacing: 0;
        line-height: 1.2;
        text-transform: uppercase;
    }
    .org-license-usage-head strong {
        color: #0f172a;
        font-size: 1rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
    .org-license-usage-list {
        display: grid;
        gap: 0.7rem;
    }
    .org-license-usage-row {
        display: grid;
        gap: 0.48rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.78rem 0.85rem;
    }
    .org-license-usage-row.status-warning {
        border-color: #facc15;
        background: #fffdf2;
    }
    .org-license-usage-row.status-full,
    .org-license-usage-row.status-over {
        border-color: #fca5a5;
        background: #fff7f7;
    }
    .org-license-usage-main,
    .org-license-usage-meta {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.8rem;
    }
    .org-license-usage-main > div {
        min-width: 0;
        display: grid;
        gap: 0.16rem;
    }
    .org-license-usage-main strong {
        color: #0f172a;
        font-size: 0.92rem;
        line-height: 1.2;
    }
    .org-license-usage-main span,
    .org-license-usage-meta {
        color: #64748b;
        font-size: 0.78rem;
        line-height: 1.35;
    }
    .org-license-usage-count {
        flex: 0 0 auto;
        color: #0f172a !important;
        font-weight: 800;
        white-space: nowrap;
    }
    .org-license-usage-meter {
        height: 0.42rem;
        overflow: hidden;
        border-radius: 999px;
        background: #e2e8f0;
    }
    .org-license-usage-meter span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: #2563eb;
    }
    .org-license-usage-row.status-warning .org-license-usage-meter span {
        background: #ca8a04;
    }
    .org-license-usage-row.status-full .org-license-usage-meter span,
    .org-license-usage-row.status-over .org-license-usage-meter span {
        background: #dc2626;
    }
    .org-admin-summary-side {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.7rem;
        margin-left: auto;
    }
    .org-admin-panel-actions-body,
    .org-users-controls-body {
        justify-content: flex-start;
    }
    .org-users-controls-body {
        margin-bottom: 0.85rem;
    }
    .org-manage-panel {
        padding: 0;
        overflow: hidden;
    }
    .org-manage-dropdown {
        display: block;
    }
    .org-manage-dropdown summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem 1.1rem;
        cursor: pointer;
        list-style: none;
    }
    .org-manage-dropdown summary::-webkit-details-marker {
        display: none;
    }
    .org-manage-dropdown summary:hover {
        background: #f8fafc;
    }
    .org-manage-summary-copy {
        min-width: 0;
        display: grid;
        gap: 0.24rem;
    }
    .org-manage-summary-title {
        color: #0f172a;
        font-size: 1.03rem;
        font-weight: 750;
        line-height: 1.2;
    }
    .org-manage-summary-text {
        color: #64748b;
        font-size: 0.84rem;
        line-height: 1.35;
    }
    .org-manage-summary-action {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        color: #2563eb;
        font-size: 0.84rem;
        font-weight: 750;
        white-space: nowrap;
    }
    .org-manage-summary-action::after {
        content: "";
        width: 0.46rem;
        height: 0.46rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg) translateY(-1px);
        transition: transform 0.16s ease;
    }
    .org-manage-dropdown[open] .org-manage-summary-action::after {
        transform: rotate(-135deg) translateY(-1px);
    }
    .org-manage-dropdown[open] .org-manage-summary-action {
        color: #1d4ed8;
    }
    .org-manage-list {
        display: grid;
        gap: 0.78rem;
        padding: 0 1rem 1rem;
    }
    .org-manage-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(24rem, 42rem);
        align-items: end;
        gap: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #ffffff;
        padding: 1rem;
    }
    .org-manage-copy {
        min-width: 0;
    }
    .org-manage-copy h3 {
        margin: 0;
        color: #0f172a;
        font-size: 0.96rem;
        font-weight: 750;
        line-height: 1.2;
        letter-spacing: 0;
    }
    .org-manage-copy p {
        margin: 0.32rem 0 0;
        color: #64748b;
        font-size: 0.84rem;
        line-height: 1.4;
    }
    .org-manage-rename-form {
        display: grid;
        grid-template-columns: minmax(14rem, 1fr) auto;
        align-items: end;
        gap: 0.7rem;
        margin: 0;
    }
    .org-manage-rename-form label {
        display: grid;
        gap: 0.35rem;
        color: #475569;
        font-size: 0.78rem;
        font-weight: 750;
    }
    .org-manage-rename-form input {
        box-sizing: border-box;
        width: 100%;
        min-height: 2.35rem;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        padding: 0.48rem 0.62rem;
    }
    .org-manage-danger-row {
        align-items: center;
        border-color: #fecaca;
        background: #fffafa;
    }
    .org-manage-danger-row .org-manage-copy h3 {
        color: #991b1b;
    }
    .org-manage-danger-row .org-manage-copy p {
        color: #7f1d1d;
    }
    .org-admin-danger-btn {
        justify-self: end;
        box-sizing: border-box;
        min-width: 11.25rem;
        min-height: 2.35rem;
        border: 1px solid #b91c1c;
        border-radius: 8px;
        background: #b91c1c;
        color: #ffffff;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 750;
        line-height: 1;
        padding: 0.55rem 0.9rem;
    }
    .org-admin-danger-btn:hover,
    .org-admin-danger-btn:focus {
        background: #991b1b;
        border-color: #991b1b;
    }

    @media (max-width: 640px) {
        .org-lock-banner {
            flex-direction: column;
        }
        .org-identity-section {
            padding: 0.95rem;
        }
        .org-header {
            gap: 0.75rem;
        }
        .org-header-actions {
            right: auto;
        }
        .org-header-panel {
            position: fixed;
            top: calc(var(--navbar-offset) + 0.75rem);
            left: 0.8rem;
            right: 0.8rem;
            width: auto;
            max-height: calc(100vh - var(--navbar-offset) - 1.5rem);
            overflow-y: auto;
        }
        .org-users-header {
            flex-direction: column;
            align-items: flex-start;
        }
        .org-admin-settings .consolidation-head,
        .org-admin-settings .consolidation-panel-head {
            align-items: flex-start;
        }
        .org-manage-dropdown summary {
            align-items: flex-start;
            flex-direction: column;
        }
        .org-admin-summary-side {
            width: 100%;
            justify-content: space-between;
            margin-left: 0;
        }
        .org-admin-panel-actions,
        .org-admin-settings .org-users-controls {
            width: 100%;
            justify-content: flex-start;
        }
        .org-admin-settings .org-subscription-btn,
        .org-admin-settings .org-users-invite-btn,
        .org-admin-primary-btn,
        .org-admin-danger-btn {
            width: 100%;
        }
        .org-subscription-summary {
            grid-template-columns: 1fr;
        }
        .org-license-usage-head,
        .org-license-usage-main,
        .org-license-usage-meta {
            align-items: flex-start;
            flex-direction: column;
        }
        .org-license-usage-head .org-subscription-form,
        .org-license-usage-head .org-subscription-btn {
            width: 100%;
        }
        .org-license-usage-count {
            white-space: normal;
        }
        .org-manage-row,
        .org-manage-rename-form {
            grid-template-columns: minmax(0, 1fr);
        }
        .org-admin-danger-btn {
            justify-self: stretch;
        }
        .org-users-controls {
            width: 100%;
            justify-content: flex-start;
        }
        .org-tree-row {
            grid-template-columns: calc(var(--org-depth) * 1.15rem) minmax(0, 1fr);
        }
        .org-tree-node {
            grid-template-columns: auto minmax(0, 1fr);
        }
        .org-tree-node-meta {
            grid-column: 2;
            justify-content: flex-start;
        }
        .org-disclosure-row {
            grid-template-columns: minmax(0, 1fr);
        }
        .org-disclosure-meta {
            justify-content: flex-start;
            max-width: none;
        }
        .org-pending-header {
            flex-direction: column;
            align-items: flex-start;
        }
    }

/* Template style block */
.org-history-shell {
        max-width: 1280px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .org-history-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .org-history-header h1 {
        margin: 0;
        font-size: 1.65rem;
        line-height: 1.15;
    }
    .org-history-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .org-history-back {
        display: inline-flex;
        align-items: center;
        color: #2563eb;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
    }
    .org-history-back:hover,
    .org-history-back:focus {
        color: #1d4ed8;
        text-decoration: underline;
    }
    .org-history-navigator {
        display: flex;
        align-items: end;
        gap: 0.75rem;
        margin-bottom: 0.9rem;
        padding: 0.75rem;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #f8fbfd;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    }
    .org-history-page-picker {
        display: grid;
        gap: 0.28rem;
        min-width: 240px;
        color: #334155;
        font-size: 0.78rem;
        font-weight: 800;
    }
    .org-history-page-picker select {
        min-height: 2.1rem;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        font-size: 0.86rem;
        font-weight: 700;
        padding: 0.32rem 0.54rem;
    }
    .org-history-open-page {
        min-height: 2.1rem;
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        background-color: #133752;
        color: #ffffff;
        cursor: pointer;
        font-size: 0.84rem;
        font-weight: 800;
        padding: 0.32rem 0.72rem;
    }
    .org-history-open-page:hover,
    .org-history-open-page:focus {
        background: #0f2d44;
        background-color: #0f2d44;
        border-color: #0f2d44;
    }
    .org-history-open-page:disabled,
    .org-history-open-page[aria-disabled="true"] {
        border-color: #cbd5e1;
        background: #e2e8f0;
        color: #64748b;
        cursor: not-allowed;
    }
    .org-history-navigator p {
        flex: 1 1 auto;
        margin: 0;
        color: #64748b;
        font-size: 0.82rem;
        line-height: 1.35;
    }
    .org-disclosure-page-header {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.7rem;
        border-bottom: 1px solid #dbe3ef;
    }
    .org-disclosure-title-block {
        display: grid;
        gap: 0.18rem;
        min-width: 0;
    }
    .org-disclosure-kicker {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1;
        text-transform: uppercase;
    }
    .org-disclosure-title-block h1 {
        margin: 0;
        color: #0f172a;
        font-size: 1.55rem;
        font-weight: 800;
        line-height: 1.1;
    }
    .org-disclosure-title-block p {
        margin: 0;
        color: #64748b;
        font-size: 0.9rem;
        line-height: 1.3;
    }
    .org-disclosure-summary-strip {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.7rem;
        margin-bottom: 0.9rem;
    }
    .org-disclosure-summary-item {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
        padding: 0.72rem 0.82rem;
    }
    .org-disclosure-summary-item span {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1;
        text-transform: uppercase;
    }
    .org-disclosure-summary-item strong {
        overflow: hidden;
        color: #0f172a;
        font-size: 1.18rem;
        font-weight: 800;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .org-disclosures-page .org-disclosure-manage-panel {
        margin-bottom: 0.9rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }
    .org-disclosures-page .org-manage-summary-text {
        max-width: 720px;
    }
    .org-disclosure-form,
    .org-disclosure-row-form {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.72rem;
        padding: 0.9rem 1rem 1rem;
    }
    .org-disclosure-row-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.85rem 0 0.75rem;
    }
    .org-disclosure-form label,
    .org-disclosure-row-form label {
        display: grid;
        gap: 0.25rem;
        color: #334155;
        font-size: 0.76rem;
        font-weight: 800;
        line-height: 1.2;
    }
    .org-disclosure-form input,
    .org-disclosure-form select,
    .org-disclosure-form textarea,
    .org-disclosure-row-form input,
    .org-disclosure-row-form select,
    .org-disclosure-row-form textarea {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 7px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        font-size: 0.84rem;
        min-height: 2.1rem;
        padding: 0.42rem 0.5rem;
    }
    .org-disclosure-form textarea,
    .org-disclosure-row-form textarea {
        min-height: 5.4rem;
        resize: vertical;
    }
    .org-disclosure-form input:focus,
    .org-disclosure-form select:focus,
    .org-disclosure-form textarea:focus,
    .org-disclosure-row-form input:focus,
    .org-disclosure-row-form select:focus,
    .org-disclosure-row-form textarea:focus {
        border-color: #4da768;
        outline: 2px solid rgba(77, 167, 104, 0.22);
        outline-offset: 0;
    }
    .org-disclosure-form-wide,
    .org-disclosure-form-actions,
    .org-disclosure-row-form label,
    .org-disclosure-row-actions {
        grid-column: 1 / -1;
    }
    .org-disclosure-form-actions,
    .org-disclosure-row-actions {
        display: flex;
        justify-content: flex-end;
    }
    .org-disclosures-page .org-admin-primary-btn {
        border: 1px solid #133752;
        border-radius: 7px;
        background: #133752;
        background-color: #133752;
        color: #ffffff;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 800;
        min-height: 2.15rem;
        padding: 0.46rem 0.82rem;
    }
    .org-disclosures-page .org-admin-primary-btn:hover,
    .org-disclosures-page .org-admin-primary-btn:focus {
        border-color: #0f2d44;
        background: #0f2d44;
        background-color: #0f2d44;
    }
    .org-disclosure-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.9rem 1rem 0.75rem;
        border-bottom: 1px solid #dbe3ef;
        background: #f8fafc;
    }
    .org-disclosure-panel-header h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.02rem;
        font-weight: 800;
        line-height: 1.2;
    }
    .org-disclosure-panel-header p {
        margin: 0.25rem 0 0;
        color: #64748b;
        font-size: 0.82rem;
        line-height: 1.3;
    }
    .org-disclosure-table {
        min-width: 1180px;
    }
    .org-disclosure-table-primary,
    .org-disclosure-table-subtle {
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .org-disclosure-table-primary {
        color: #0f172a;
        font-weight: 800;
        line-height: 1.25;
    }
    .org-disclosure-table-subtle {
        margin-top: 0.16rem;
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 1.3;
    }
    .org-disclosure-area-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.24rem 0.48rem;
        white-space: nowrap;
    }
    .org-disclosure-table .org-disclosure-note-cell {
        min-width: 260px;
        color: #334155;
        line-height: 1.38;
    }
    .org-disclosure-period {
        display: block;
        margin-top: 0.12rem;
        color: #64748b;
        font-size: 0.76rem;
        font-weight: 700;
    }
    .org-disclosure-actions {
        min-width: 250px;
        vertical-align: top;
    }
    .org-disclosure-edit-menu {
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.5rem 0.65rem;
    }
    .org-disclosure-edit-menu > summary {
        cursor: pointer;
        color: #133752;
        font-size: 0.82rem;
        font-weight: 800;
        list-style: none;
    }
    .org-disclosure-edit-menu > summary::-webkit-details-marker {
        display: none;
    }
    .org-disclosure-edit-menu > summary::after {
        content: "";
        display: inline-block;
        width: 0.42rem;
        height: 0.42rem;
        margin-left: 0.45rem;
        border-right: 2px solid #133752;
        border-bottom: 2px solid #133752;
        transform: rotate(45deg) translateY(-0.1rem);
    }
    .org-disclosure-edit-menu[open] > summary::after {
        transform: rotate(225deg) translateY(-0.08rem);
    }
    .org-disclosure-delete-form {
        display: flex;
        justify-content: flex-end;
        padding: 0;
    }
    .org-disclosure-delete-form .org-admin-danger-btn {
        min-width: 0;
        min-height: 2.05rem;
        padding: 0.42rem 0.72rem;
    }
    .org-disclosure-empty-title,
    .org-disclosure-empty-copy {
        display: block;
    }
    .org-disclosure-empty-title {
        color: #334155;
        font-weight: 800;
    }
    .org-disclosure-empty-copy {
        margin-top: 0.16rem;
        color: #64748b;
        font-size: 0.82rem;
        font-style: normal;
    }
    .org-history-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow: hidden;
    }
    .org-history-table-wrap {
        max-height: calc(100vh - 160px);
        overflow: auto;
        background: #f4f6f8;
    }
    .org-history-table {
        width: 100%;
        min-width: 1320px;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 0.82rem;
    }
    .org-history-table th,
    .org-history-table td {
        border: 1px solid #dde3ea;
        padding: 0.36rem 0.46rem;
        text-align: left;
        vertical-align: middle;
        overflow-wrap: anywhere;
    }
    .org-history-head-row th {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #133752;
        color: #f8fafc;
        font-weight: 800;
    }
    .org-history-filter-row th {
        position: sticky;
        top: 31px;
        z-index: 3;
        background: #eaf1f8;
    }
    .org-history-filter {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        background: #ffffff;
        color: #111827;
        font: inherit;
        font-size: 0.78rem;
        padding: 0.24rem 0.34rem;
    }
    .org-history-row:nth-child(odd) td {
        background: #fbfcfe;
    }
    .org-history-row:nth-child(even) td {
        background: #f2f5f8;
    }
    .org-history-row:hover td {
        background: #e7f1ec !important;
    }
    .org-history-row.is-deleted td {
        background: #fff7f7;
    }
    .org-history-object-type {
        display: block;
        color: #475569;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1.15;
    }
    .org-history-object-label {
        display: block;
        margin-top: 0.12rem;
        color: #0f172a;
        font-weight: 600;
        line-height: 1.2;
    }
    .org-history-deleted-pill {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #ffffff;
        color: #475569;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.2rem 0.48rem;
    }
    .org-history-deleted-pill.yes {
        border-color: #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }
    .org-history-link {
        color: #1d4ed8;
        font-weight: 800;
        text-decoration: none;
        white-space: nowrap;
    }
    .org-history-link:hover {
        text-decoration: underline;
    }
    .org-history-empty {
        color: #64748b;
        text-align: center;
        padding: 1rem 0.75rem;
        background: #ffffff !important;
    }
    @media (max-width: 820px) {
        .org-disclosure-page-header {
            align-items: flex-start;
        }
        .org-disclosure-summary-strip {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }
    @media (max-width: 640px) {
        .org-history-header {
            flex-direction: column;
        }
        .org-disclosure-page-header,
        .org-disclosure-panel-header {
            flex-direction: column;
        }
        .org-disclosure-summary-strip {
            grid-template-columns: minmax(0, 1fr);
        }
        .org-history-navigator {
            align-items: stretch;
            flex-direction: column;
        }
        .org-history-page-picker {
            min-width: 0;
        }
        .org-disclosure-form,
        .org-disclosure-row-form {
            grid-template-columns: minmax(0, 1fr);
        }
        .org-disclosure-form-actions,
        .org-disclosure-row-actions,
        .org-disclosure-delete-form {
            justify-content: stretch;
        }
        .org-disclosures-page .org-admin-primary-btn,
        .org-disclosure-delete-form .org-admin-danger-btn,
        .org-history-back {
            width: 100%;
        }
    }

/* Template style block */
.audit-detail-shell {
        max-width: 1120px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #111827;
        font-family: var(--app-font-family);
    }
    .audit-detail-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.9rem;
    }
    .audit-detail-head h1 {
        margin: 0;
        font-size: 1.55rem;
        line-height: 1.15;
    }
    .audit-detail-head p {
        margin: 0.32rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .audit-detail-back {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #133752;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.55rem 0.75rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .audit-detail-back:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .audit-detail-meta {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
        margin-bottom: 0.85rem;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        padding: 0.72rem;
    }
    .audit-detail-meta div {
        min-width: 0;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #f8fafc;
        padding: 0.48rem 0.55rem;
    }
    .audit-detail-meta strong {
        display: block;
        color: #475569;
        font-size: 0.72rem;
        line-height: 1.2;
        margin-bottom: 0.16rem;
        text-transform: uppercase;
    }
    .audit-detail-meta span {
        display: block;
        color: #0f172a;
        font-size: 0.86rem;
        font-weight: 600;
        overflow-wrap: anywhere;
    }
    .audit-detail-block {
        margin-bottom: 0.85rem;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
        padding: 0.75rem;
    }
    .audit-detail-block h2 {
        margin: 0 0 0.5rem;
        font-size: 1rem;
        line-height: 1.2;
    }
    .audit-detail-block pre {
        max-height: 420px;
        overflow: auto;
        margin: 0;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #f8fafc;
        color: #111827;
        font: 12px/1.45 "Consolas", "Courier New", monospace;
        padding: 0.65rem;
        white-space: pre-wrap;
    }
    .audit-detail-tsv {
        width: 100%;
        min-height: 160px;
        margin-bottom: 0.55rem;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        box-sizing: border-box;
        background: #ffffff;
        color: #111827;
        font: 12px/1.45 "Consolas", "Courier New", monospace;
        padding: 0.65rem;
        resize: vertical;
        white-space: pre;
    }
    .audit-detail-muted {
        margin: 0;
        color: #64748b;
        font-size: 0.88rem;
    }
    @media (max-width: 820px) {
        .audit-detail-meta {
            grid-template-columns: 1fr;
        }
        .audit-detail-head {
            flex-direction: column;
        }
    }

/* Template style block */
.org-remove-confirm-shell {
        max-width: 760px;
        margin: 0 auto;
        color: #0f172a;
    }
    .org-remove-confirm-header h1 {
        margin: 0;
        font-size: 1.5rem;
    }
    .org-remove-confirm-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .org-remove-confirm-card {
        margin-top: 0.8rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        overflow: hidden;
    }
    .org-remove-confirm-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.66rem 0.75rem;
        border-bottom: 1px solid #e2e8f0;
    }
    .org-remove-confirm-row:last-child {
        border-bottom: none;
    }
    .org-remove-confirm-row span {
        color: #64748b;
        font-size: 0.82rem;
    }
    .org-remove-confirm-row strong {
        font-size: 0.9rem;
        text-align: right;
        word-break: break-word;
    }
    .org-remove-confirm-error,
    .org-remove-confirm-warning {
        margin-top: 0.8rem;
        border-radius: 8px;
        padding: 0.58rem 0.72rem;
        font-size: 0.84rem;
    }
    .org-remove-confirm-error {
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }
    .org-remove-confirm-warning {
        border: 1px solid #fde68a;
        background: #fffbeb;
        color: #92400e;
    }
    .org-remove-confirm-form {
        margin-top: 0.8rem;
    }
    .org-remove-confirm-danger {
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fef2f2;
        padding: 0.6rem 0.7rem;
        color: #7f1d1d;
        font-size: 0.83rem;
        line-height: 1.45;
    }
    .org-remove-confirm-name {
        display: grid;
        gap: 0.38rem;
        margin-top: 0.7rem;
        color: #334155;
        font-size: 0.84rem;
        font-weight: 700;
    }
    .org-remove-confirm-name input {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        font-weight: 600;
        padding: 0.5rem 0.6rem;
    }
    .org-remove-confirm-actions {
        margin-top: 0.8rem;
        display: flex;
        justify-content: flex-end;
        gap: 0.55rem;
    }
    .org-remove-confirm-cancel,
    .org-remove-confirm-submit {
        border-radius: 8px;
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.47rem 0.72rem;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .org-remove-confirm-cancel {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #334155;
    }
    .org-remove-confirm-submit {
        border: 1px solid #b91c1c;
        background: #b91c1c;
        color: #ffffff;
        cursor: pointer;
    }
    .org-remove-confirm-submit:disabled {
        border-color: #fecaca;
        background: #fee2e2;
        color: #991b1b;
        cursor: not-allowed;
    }
    .org-remove-confirm-submit:hover {
        background: #991b1b;
        border-color: #991b1b;
    }
    .org-remove-confirm-submit:disabled:hover {
        border-color: #fecaca;
        background: #fee2e2;
    }

/* Template style block */
.org-remove-shell {
        max-width: 760px;
        margin: 0 auto;
        color: #0f172a;
    }
    .org-remove-header h1 {
        margin: 0;
        font-size: 1.5rem;
    }
    .org-remove-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .org-remove-error,
    .org-remove-warning {
        margin-top: 0.8rem;
        border-radius: 8px;
        padding: 0.58rem 0.72rem;
        font-size: 0.84rem;
    }
    .org-remove-error {
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }
    .org-remove-warning {
        border: 1px solid #fde68a;
        background: #fffbeb;
        color: #92400e;
    }
    .org-remove-form {
        margin-top: 0.8rem;
    }
    .org-remove-options {
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        overflow: hidden;
    }
    .org-remove-option {
        display: flex;
        gap: 0.6rem;
        align-items: flex-start;
        padding: 0.68rem 0.75rem;
        border-bottom: 1px solid #e2e8f0;
        cursor: pointer;
    }
    .org-remove-option:last-child {
        border-bottom: none;
    }
    .org-remove-option input {
        margin-top: 0.22rem;
    }
    .org-remove-option-copy {
        display: grid;
        gap: 0.12rem;
        min-width: 0;
    }
    .org-remove-option-copy strong {
        font-size: 0.93rem;
        line-height: 1.2;
        word-break: break-word;
    }
    .org-remove-option-copy small {
        color: #64748b;
        font-size: 0.8rem;
    }
    .org-remove-actions {
        margin-top: 0.8rem;
        display: flex;
        justify-content: flex-end;
        gap: 0.55rem;
    }
    .org-remove-cancel,
    .org-remove-next {
        border-radius: 8px;
        font: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.47rem 0.72rem;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .org-remove-cancel {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #334155;
    }
    .org-remove-next {
        border: 1px solid #b91c1c;
        background: #b91c1c;
        color: #ffffff;
        cursor: pointer;
    }
    .org-remove-next:hover {
        background: #991b1b;
        border-color: #991b1b;
    }

/* Template style block */
.org-rename-shell {
        max-width: 760px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .org-rename-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .org-rename-header h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.15;
    }
    .org-rename-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .org-rename-back,
    .org-rename-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #133752;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.55rem 0.75rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .org-rename-back:hover,
    .org-rename-secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .org-rename-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        padding: 1rem;
    }
    .org-rename-warning {
        border-left: 3px solid #ca8a04;
        background: #fffbeb;
        color: #713f12;
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.95rem;
    }
    .org-rename-warning h2 {
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.2;
    }
    .org-rename-warning p {
        margin: 0.42rem 0 0;
        font-size: 0.86rem;
        line-height: 1.45;
    }
    .org-rename-form {
        display: grid;
        gap: 0.58rem;
    }
    .org-rename-form label {
        color: #334155;
        font-size: 0.82rem;
        font-weight: 750;
    }
    .org-rename-form input[type="text"] {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        color: #111827;
        font: inherit;
        min-height: 2.3rem;
        padding: 0.48rem 0.62rem;
    }
    .org-rename-confirm {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        line-height: 1.35;
    }
    .org-rename-confirm input {
        margin-top: 0.12rem;
    }
    .org-rename-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.55rem;
        margin-top: 0.25rem;
    }
    .org-rename-primary {
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        color: #ffffff;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.62rem 0.85rem;
    }
    .org-rename-primary:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    @media (max-width: 640px) {
        .org-rename-header {
            flex-direction: column;
        }
    }

/* Template style block */
.perm-shell {
        max-width: 980px;
        margin: 0 auto;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .perm-header {
        margin-bottom: 0.95rem;
    }
    .perm-back-link {
        display: inline-flex;
        align-items: center;
        text-decoration: none;
        color: #334155;
        font-size: 0.83rem;
        font-weight: 700;
    }
    .perm-header h1 {
        margin: 0.35rem 0 0;
        font-size: 1.5rem;
        line-height: 1.2;
    }
    .perm-subtitle {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .perm-form {
        display: grid;
        gap: 0.9rem;
    }
    .perm-section {
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.95rem;
    }
    .perm-section h2 {
        margin: 0 0 0.75rem;
        font-size: 1rem;
        line-height: 1.2;
    }
    .perm-field {
        display: grid;
        gap: 0.4rem;
        max-width: 260px;
    }
    .perm-field-wide {
        max-width: 420px;
    }
    .perm-field span {
        font-size: 0.78rem;
        font-weight: 700;
        color: #334155;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    .perm-field input,
    .perm-field select {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        padding: 0.5rem 0.58rem;
        font: inherit;
        color: #0f172a;
    }
    .perm-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 0.6rem;
    }
    .perm-checkbox-row {
        display: flex;
        align-items: flex-start;
        gap: 0.55rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.58rem 0.62rem;
        background: #ffffff;
    }
    .perm-checkbox-row input[type="checkbox"] {
        margin-top: 0.17rem;
    }
    .perm-checkbox-copy {
        display: grid;
        gap: 0.1rem;
        min-width: 0;
    }
    .perm-checkbox-title {
        font-size: 0.83rem;
        font-weight: 700;
        color: #0f172a;
        word-break: break-word;
    }
    .perm-checkbox-help {
        color: #64748b;
        font-size: 0.76rem;
        line-height: 1.25;
    }
    .perm-role-note {
        margin: 0.6rem 0 0;
        color: #64748b;
        font-size: 0.8rem;
    }
    .perm-scope-options {
        display: grid;
        gap: 0.5rem;
    }
    .perm-radio-row {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        color: #0f172a;
        font-size: 0.84rem;
    }
    .perm-company-list {
        margin-top: 0.7rem;
        display: grid;
        gap: 0.48rem;
    }
    .perm-empty {
        margin: 0;
        color: #64748b;
        font-size: 0.82rem;
    }
    .perm-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.6rem;
        margin-top: 0.1rem;
    }
    .perm-secondary-btn,
    .perm-primary-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font: inherit;
        font-size: 0.83rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.52rem 0.76rem;
        text-decoration: none;
    }
    .perm-secondary-btn {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #334155;
    }
    .perm-primary-btn {
        border: 1px solid #133752;
        background: #133752;
        color: #f8fafc;
        cursor: pointer;
    }
    .perm-primary-btn:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .is-hidden {
        display: none;
    }

    @media (max-width: 640px) {
        .perm-actions {
            justify-content: stretch;
            flex-direction: column-reverse;
        }
        .perm-secondary-btn,
        .perm-primary-btn {
            width: 100%;
        }
    }

/* Template style block */
.company-action-shell {
        max-width: 760px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .company-action-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .company-action-header h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.15;
    }
    .company-action-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .company-action-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        padding: 1rem;
    }
    .company-action-warning {
        border-left: 3px solid #ca8a04;
        background: #fffbeb;
        color: #713f12;
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.95rem;
    }
    .company-action-warning h2 {
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.2;
    }
    .company-action-warning p {
        margin: 0.42rem 0 0;
        font-size: 0.86rem;
        line-height: 1.45;
    }
    .company-action-form {
        display: grid;
        gap: 0.58rem;
    }
    .company-action-form label {
        color: #334155;
        font-size: 0.82rem;
        font-weight: 750;
    }
    .company-action-form select {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        color: #111827;
        font: inherit;
        min-height: 2.3rem;
        padding: 0.48rem 0.62rem;
    }
    .company-action-confirm {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        line-height: 1.35;
    }
    .company-action-confirm input {
        margin-top: 0.12rem;
    }
    .company-action-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.55rem;
        margin-top: 0.25rem;
    }
    .company-action-primary,
    .company-action-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.62rem 0.85rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .company-action-primary {
        border: 1px solid #133752;
        background: #133752;
        color: #ffffff;
        cursor: pointer;
    }
    .company-action-secondary {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #133752;
    }
    .company-action-primary:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .company-action-secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .company-action-empty {
        margin: 0;
        color: #475569;
        font-size: 0.92rem;
    }
    @media (max-width: 640px) {
        .company-action-header {
            flex-direction: column;
        }
    }

/* Template style block */
.company-history-shell {
        max-width: 1080px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .company-history-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .company-history-header h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.15;
    }
    .company-history-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .company-history-back {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #133752;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.55rem 0.75rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .company-history-back:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .company-history-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow-x: auto;
    }
    .company-history-table {
        width: 100%;
        min-width: 860px;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 0.86rem;
    }
    .company-history-table th,
    .company-history-table td {
        border-bottom: 1px solid #e5e7eb;
        padding: 0.6rem 0.72rem;
        text-align: left;
        vertical-align: top;
        overflow-wrap: anywhere;
    }
    .company-history-table th {
        background: #f8fafc;
        color: #475569;
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .company-history-table tbody tr:last-child td {
        border-bottom: 0;
    }
    .company-history-empty {
        color: #64748b;
        text-align: center;
    }
    @media (max-width: 640px) {
        .company-history-header {
            flex-direction: column;
        }
    }

/* Template style block */
.company-query-shell {
            margin: 0;
            width: 100%;
            max-width: none;
            padding-top: 0.2rem;
            font-family: var(--app-font-family);
            height: calc(100vh - 86px);
            overflow: hidden;
        }
        .company-workspace {
            --coa-left-pane-width: 360px;
        }
        .company-query-window {
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 12px;
            box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }
        .company-query-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 1.1rem 1.25rem 0.85rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .company-query-title-wrap h1 {
            margin: 0;
            font-size: 1.5rem;
            line-height: 1.1;
            color: #111827;
            font-weight: 700;
        }
        .company-grid-filter-input-wrap {
            position: relative;
        }
        .company-grid-filter-icon {
            position: absolute;
            left: 0.42rem;
            top: 50%;
            transform: translateY(-50%);
            color: #64748b;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
        }
        .company-grid-filter-icon svg {
            width: 0.82rem;
            height: 0.82rem;
            display: block;
        }
        .company-grid-scroll {
            flex: 1 1 auto;
            height: auto;
            min-height: 0;
            max-height: none;
            overflow: auto;
            background: #f4f5f7;
        }
        .company-grid {
            width: 100%;
            min-width: 900px;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: 0.86rem;
            color: #1f2937;
        }
        .company-grid th,
        .company-grid td {
            padding: 0.22rem 0.5rem;
            border: 1px solid #dde1e6;
            vertical-align: middle;
        }
        .company-grid-head th {
            position: sticky;
            top: 0;
            background: #133752;
            color: #f8fafc;
            text-align: left;
            font-weight: 700;
            z-index: 2;
        }
        .company-grid tbody tr:nth-child(odd) td {
            background: #f5f6f8;
        }
        .company-grid tbody tr:nth-child(even) td {
            background: #edf0f3;
        }
        .company-grid-filter-row td {
            background: #eaf1f8 !important;
        }
        .company-grid-filter-input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #c7d2fe;
            border-radius: 6px;
            padding: 0.24rem 0.38rem 0.24rem 1.45rem;
            font: inherit;
            background: #ffffff;
            color: #1f2937;
        }
        .company-grid-filter-input::placeholder {
            color: #6b7280;
        }
        .company-grid-filter-input-wrap.is-value-filtered .company-grid-filter-icon,
        .company-grid-filter-input-wrap.is-condition-filtered .company-grid-filter-icon {
            color: #0f766e;
        }
        .company-filter-menu {
            position: fixed;
            min-width: 320px;
            max-width: min(420px, calc(100vw - 1rem));
            max-height: min(460px, calc(100vh - 1rem));
            overflow: hidden;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #ffffff;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
            z-index: 1600;
            display: flex;
            flex-direction: column;
        }
        .company-filter-menu[hidden] {
            display: none !important;
        }
        .company-filter-menu-sort {
            display: grid;
            gap: 0;
            border-bottom: 1px dotted #cccccc;
            padding: 0.18rem 0;
        }
        .company-filter-menu-sort-btn {
            border: none;
            background: #ffffff;
            color: #111827;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.25;
            text-align: left;
            padding: 0.26rem 0.5rem;
            cursor: pointer;
        }
        .company-filter-menu-sort-btn:hover {
            background: #f3f4f6;
        }
        .company-filter-menu-condition {
            display: block;
            border-bottom: 1px dotted #cccccc;
            padding: 0.12rem 0;
            background: #ffffff;
        }
        .company-filter-menu-condition.is-open {
            display: block;
            padding: 0.12rem 0;
        }
        .company-filter-menu-condition-toggle {
            width: 100%;
            border: none;
            background: #ffffff;
            color: #111827;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1.25;
            text-align: left;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.26rem 0.5rem;
            cursor: pointer;
        }
        .company-filter-menu-condition-toggle:hover {
            background: #f3f4f6;
        }
        .company-filter-menu-condition-arrow {
            display: inline-block;
            font-size: 0.82rem;
            line-height: 1;
            color: #4b5563;
            transition: transform 120ms ease;
            transform: rotate(0deg);
        }
        .company-filter-menu-condition.is-open .company-filter-menu-condition-arrow {
            transform: rotate(90deg);
        }
        .company-filter-menu-condition-body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.32rem;
            padding: 0.2rem 0.45rem 0.36rem;
        }
        .company-filter-menu-condition-body[hidden] {
            display: none !important;
        }
        .company-filter-menu-condition-select,
        .company-filter-menu-condition-value {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #ffffff;
            color: #1f2937;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.24rem 0.28rem;
            min-height: 1.6rem;
        }
        .company-filter-menu-condition-value[disabled] {
            background: #f3f4f6;
            color: #6b7280;
            cursor: not-allowed;
        }
        .company-filter-menu-search-wrap {
            padding: 0.3rem 0.45rem 0;
        }
        .company-filter-menu-search {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d2d1d1;
            border-radius: 2px;
            background: #fff;
            color: #1f2937;
            font: inherit;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.24rem 0.28rem;
        }
        .company-filter-menu-selection-controls {
            display: flex;
            justify-content: flex-start;
            gap: 0.55rem;
            padding: 0.24rem 0.45rem 0.22rem;
        }
        .company-filter-menu-link {
            border: none;
            background: none;
            color: #2563eb;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            line-height: 1;
            cursor: pointer;
            padding: 0;
        }
        .company-filter-menu-link:hover {
            text-decoration: underline;
        }
        .company-filter-menu-list {
            display: grid;
            gap: 0;
            padding: 0.22rem 0.4rem 0.3rem;
            overflow-y: auto;
            max-height: min(150px, calc(100vh - 12rem));
        }
        .company-filter-menu-option {
            border: none;
            border-radius: 0;
            background: #ffffff;
            color: #111827;
            display: flex;
            align-items: center;
            gap: 0.34rem;
            font-size: 0.75rem;
            line-height: 1.2;
            padding: 0.17rem 0.08rem;
            cursor: pointer;
        }
        .company-filter-menu-option:hover,
        .company-filter-menu-option:focus-within {
            background: #f3f4f6;
        }
        .company-filter-menu-option-check {
            width: 0.82rem;
            height: 0.82rem;
            margin: 0;
            accent-color: #2563eb;
            flex: 0 0 auto;
        }
        .company-filter-menu-option-label {
            min-width: 0;
            color: #334155;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .company-filter-menu-empty {
            padding: 0.4rem 0.18rem;
            color: #6b7280;
            font-size: 0.75rem;
            background: #ffffff;
        }
        .company-filter-menu-foot {
            display: flex;
            justify-content: flex-end;
            gap: 0.55rem;
            border-top: 1px dotted #cccccc;
            padding: 0.3rem 0.45rem 0.4rem;
            background: #ffffff;
        }
        .company-filter-menu-cancel,
        .company-filter-menu-apply {
            border-radius: 2px;
            font: inherit;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1;
            min-width: 64px;
            height: 20px;
            padding: 0.18rem 0.5rem;
            cursor: pointer;
        }
        .company-filter-menu-cancel {
            border: 1px solid #b9b9b9;
            background: #eeeeee;
            color: #111827;
        }
        .company-filter-menu-apply {
            border: 1px solid #18804e;
            background: #0f9d58;
            color: #ffffff;
        }
        .company-grid-row:hover td,
        .company-grid-row.is-selected td {
            background: #dfeee7 !important;
        }
        .company-grid-row {
            cursor: pointer;
        }
        .company-name-cell {
            width: 32%;
            color: #111827;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .company-name-cell strong {
            display: block;
            font-weight: 600;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .company-name-cell small {
            display: block;
            color: #64748b;
            font-size: 0.74rem;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-top: 0.08rem;
        }
        .field-help {
            display: block;
            margin-top: 0.22rem;
            color: #64748b;
            font-size: 0.74rem;
            line-height: 1.3;
        }
        .company-chart-cell {
            width: 30%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .company-description-cell {
            width: 24%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #475569;
        }
        .company-chart-link {
            color: #1d4ed8;
            text-decoration: none;
            font-weight: 600;
        }
        .company-chart-link:hover {
            text-decoration: underline;
        }
        .company-chart-missing {
            color: #6b7280;
        }
        .company-ownership-cell {
            width: 16%;
            white-space: nowrap;
        }
        .company-ownership-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 4.2rem;
            border: 1px solid #bbf7d0;
            border-radius: 999px;
            background: #ecfdf5;
            color: #166534;
            font-size: 0.76rem;
            font-weight: 700;
            line-height: 1;
            padding: 0.22rem 0.45rem;
        }
        .company-ownership-pill.is-partial {
            border-color: #fed7aa;
            background: #fff7ed;
            color: #9a3412;
        }
        .company-actions-cell {
            width: 12%;
        }
        .company-actions-line {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            min-width: 0;
            flex-wrap: nowrap;
            justify-content: flex-start;
        }
        .company-grid-empty td {
            text-align: center;
            color: #6b7280;
            padding: 1rem 0.75rem;
            background: #f9fafb !important;
        }

        .add-company-panel {
            margin-top: 0.85rem;
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
            padding: 0.42rem 0.7rem 0.75rem;
        }
        .add-company-summary {
            cursor: pointer;
            list-style: none;
            font-weight: 700;
            color: #1f2937;
        }
        .add-company-summary::-webkit-details-marker {
            display: none;
        }
        .add-company-form {
            margin-top: 0.7rem;
        }
        .add-company-fields {
            display: grid;
            grid-template-columns: repeat(4, minmax(160px, 1fr));
            gap: 0.7rem;
        }
        .add-company-field label {
            display: block;
            font-size: 0.82rem;
            font-weight: 700;
            margin-bottom: 0.24rem;
            color: #374151;
        }
        .add-company-field input,
        .add-company-field select,
        .add-company-field textarea {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d1d5db;
            border-radius: 7px;
            min-height: 2.35rem;
            padding: 0.46rem 0.5rem;
            font: inherit;
            background: #ffffff;
        }
        .company-description-input {
            min-height: 2.35rem;
        }
        .add-company-field .ownership-mode-select,
        .company-ownership-form .ownership-mode-select {
            width: auto;
            min-width: 0;
        }
        .ownership-full-check {
            display: inline-flex !important;
            align-items: center;
            gap: 0.42rem !important;
            margin: 0;
            line-height: 1.25;
        }
        .ownership-full-check input {
            flex: 0 0 auto;
            margin: 0;
        }
        .ownership-percent-input-wrap {
            position: relative;
            display: block;
        }
        .ownership-percent-input-wrap .ownership-percent-input {
            padding-right: 1.7rem;
        }
        .ownership-percent-suffix {
            position: absolute;
            right: 0.62rem;
            top: 50%;
            transform: translateY(-50%);
            color: #64748b;
            font-size: 0.82rem;
            font-weight: 700;
            pointer-events: none;
        }
        .form-error {
            margin-top: 0.2rem;
            color: #b91c1c;
            font-size: 0.78rem;
            font-weight: 700;
        }
        .add-company-save {
            margin-top: 0.7rem;
        }

        .company-actions-menu {
            position: relative;
            display: inline-block;
            flex: 0 0 auto;
        }
        .company-menu-dots {
            border: none;
            background: transparent;
            color: #374151;
            cursor: pointer;
            border-radius: 6px;
            font: inherit;
            font-size: 1rem;
            font-weight: 800;
            line-height: 1;
            padding: 0.18rem 0.36rem;
        }
        .company-menu-dots:hover {
            background: #e5e7eb;
        }
        .company-actions-menu-dropdown {
            display: none;
            position: absolute;
            right: 0;
            top: 1.45rem;
            width: 190px;
            border-radius: 8px;
            border: 1px solid #d1d5db;
            background: #ffffff;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
            overflow: hidden;
            z-index: 30;
        }
        .company-actions-menu.open .company-actions-menu-dropdown {
            display: block;
        }
        .company-actions-menu-dropdown .company-menu-link {
            display: block;
            width: 100%;
            text-align: left;
            border: none;
            background: #ffffff;
            font: inherit;
            font-weight: 700;
            color: #111827;
            cursor: pointer;
            text-decoration: none;
            box-sizing: border-box;
            padding: 0.62rem 0.74rem;
        }
        .company-actions-menu-dropdown .company-menu-link:hover {
            background: #f8fafc;
        }
        .company-actions-menu-dropdown .company-menu-danger {
            color: #b91c1c;
        }
        .company-actions-menu-dropdown .company-menu-danger:hover {
            background: #fef2f2;
        }

        .deleted-companies-panel {
            overflow: visible;
        }
        .deleted-companies-note {
            margin: 0.65rem 0 0.7rem;
            color: #64748b;
            font-size: 0.82rem;
            line-height: 1.35;
        }
        .deleted-companies-scroll {
            overflow-x: auto;
        }
        .deleted-companies-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.84rem;
            color: #1f2937;
        }
        .deleted-companies-table th,
        .deleted-companies-table td {
            border-top: 1px solid #eef2f7;
            padding: 0.55rem 0.7rem;
            text-align: left;
            vertical-align: middle;
        }
        .deleted-companies-table th {
            background: #f8fafc;
            color: #475569;
            font-size: 0.74rem;
            letter-spacing: 0;
            text-transform: uppercase;
        }
        .deleted-companies-table strong,
        .deleted-companies-table small {
            display: block;
            line-height: 1.25;
        }
        .deleted-companies-table small {
            margin-top: 0.08rem;
            color: #64748b;
            font-size: 0.74rem;
        }
        .deleted-company-actions {
            display: flex;
            align-items: center;
            gap: 0.7rem;
            white-space: nowrap;
        }
        .restore-company-form {
            display: inline;
            margin: 0;
        }
        .company-text-action {
            border: none;
            background: transparent;
            color: #1d4ed8;
            cursor: pointer;
            font: inherit;
            font-weight: 700;
            padding: 0;
            text-decoration: none;
        }
        .company-text-action:hover {
            text-decoration: underline;
        }

        .company-detail-shell {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 0.75rem 0.85rem 1rem;
            box-sizing: border-box;
            min-height: 100vh;
            color: #111827;
            font-family: var(--app-font-family);
        }
        .company-detail-shell.is-embedded {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 0.65rem 0.75rem 0.9rem;
        }
        .company-detail-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .company-detail-head h1 {
            margin: 0;
            font-size: 1.7rem;
            line-height: 1.15;
            letter-spacing: 0;
        }
        .company-detail-head p {
            margin: 0.25rem 0 0;
            color: #64748b;
        }
        .company-detail-simple-head {
            align-items: center;
        }
        .company-detail-summary-panel {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
            padding: 1rem;
        }
        .company-detail-card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 0.85rem;
            margin-bottom: 0.9rem;
        }
        .company-detail-identity {
            min-width: 0;
        }
        .company-detail-identity-label {
            display: block;
            color: #64748b;
            font-size: 0.72rem;
            font-weight: 750;
            line-height: 1;
            margin-bottom: 0.28rem;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .company-detail-identity h1 {
            margin: 0;
            color: #111827;
            font-size: 1.45rem;
            line-height: 1.16;
            letter-spacing: 0;
            overflow-wrap: anywhere;
        }
        .company-detail-identity p {
            display: flex;
            align-items: baseline;
            gap: 0.45rem;
            flex-wrap: wrap;
            margin: 0.35rem 0 0;
            color: #64748b;
            font-size: 0.84rem;
            line-height: 1.25;
        }
        .company-detail-identity p span {
            font-weight: 750;
        }
        .company-detail-identity p strong {
            color: #334155;
            font-weight: 700;
            overflow-wrap: anywhere;
        }
        .company-detail-menu {
            align-self: center;
            flex: 0 0 auto;
        }
        .company-detail-menu-toggle {
            width: 2.45rem;
            height: 2.45rem;
            color: #475569;
            font-size: 1.75rem;
            font-weight: 800;
            line-height: 1;
        }
        .company-detail-summary-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
            gap: 0.8rem;
            margin: 0;
        }
        .company-detail-summary-list div {
            min-width: 0;
        }
        .company-detail-summary-list dt {
            margin: 0 0 0.25rem;
            color: #64748b;
            font-size: 0.74rem;
            font-weight: 750;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .company-detail-summary-list dd {
            margin: 0;
            color: #111827;
            font-size: 1rem;
            font-weight: 700;
            overflow-wrap: anywhere;
        }
        .company-detail-summary-list a {
            color: #1d4ed8;
            text-decoration: none;
        }
        .company-detail-summary-list a:hover {
            text-decoration: underline;
        }
        .company-detail-overview {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
            gap: 1rem;
            align-items: stretch;
        }
        .company-detail-hero,
        .company-detail-metrics {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
        }
        .company-detail-hero {
            padding: 1.15rem;
        }
        .company-detail-eyebrow {
            display: block;
            margin-bottom: 0.35rem;
            color: #64748b;
            font-size: 0.74rem;
            font-weight: 750;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .company-detail-hero h2 {
            margin: 0;
            color: #111827;
            font-size: 1.55rem;
            line-height: 1.15;
            letter-spacing: 0;
        }
        .company-detail-hero p {
            margin: 0.35rem 0 0;
            color: #475569;
        }
        .company-detail-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
            margin-top: 1rem;
        }
        .company-detail-metrics {
            display: grid;
            grid-template-columns: 1fr;
            padding: 0.5rem;
        }
        .company-detail-metrics div {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.8rem;
            padding: 0.72rem 0.8rem;
            border-bottom: 1px solid #eef2f7;
        }
        .company-detail-metrics div:last-child {
            border-bottom: none;
        }
        .company-detail-metrics span {
            color: #64748b;
            font-size: 0.78rem;
            font-weight: 750;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .company-detail-metrics strong {
            color: #0f172a;
            font-size: 1.1rem;
            line-height: 1;
        }
        .company-detail-panel {
            margin-top: 1rem;
            padding: 1rem;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
        }
        .company-detail-panel h2 {
            margin: 0 0 0.85rem;
            font-size: 1rem;
            line-height: 1.2;
            letter-spacing: 0;
        }
        .company-detail-panel-head h2 {
            margin-bottom: 0.85rem;
        }
        .company-detail-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 0.85rem;
            margin: 0;
        }
        .company-detail-list div {
            min-width: 0;
            padding: 0.72rem;
            border: 1px solid #eef2f7;
            border-radius: 8px;
            background: #f8fafc;
        }
        .company-detail-list-wide {
            grid-column: span 2;
        }
        .company-detail-list dt {
            margin: 0 0 0.22rem;
            color: #64748b;
            font-size: 0.74rem;
            font-weight: 750;
            text-transform: uppercase;
            letter-spacing: 0;
        }
        .company-detail-list dd {
            margin: 0;
            min-width: 0;
            color: #111827;
            font-weight: 650;
            overflow-wrap: anywhere;
        }
        .company-detail-list a {
            color: #1d4ed8;
            text-decoration: none;
        }
        .company-detail-list a:hover {
            text-decoration: underline;
        }
        .company-detail-table {
            min-width: 760px;
        }
        .company-control-meta {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 0.75rem;
            margin-top: 1rem;
        }
        .company-control-meta div,
        .company-control-empty,
        .company-control-record {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #ffffff;
        }
        .company-control-meta div {
            display: grid;
            gap: 0.24rem;
            padding: 0.75rem 0.85rem;
        }
        .company-control-meta span,
        .company-control-facts dt,
        .company-control-detail-grid dt {
            color: #64748b;
            font-size: 0.73rem;
            font-weight: 750;
            letter-spacing: 0;
            line-height: 1.2;
            text-transform: uppercase;
        }
        .company-control-meta strong {
            color: #0f172a;
            font-size: 0.98rem;
            line-height: 1.2;
            overflow-wrap: anywhere;
        }
        .company-control-records {
            display: grid;
            gap: 0.75rem;
            margin-top: 0.9rem;
        }
        .company-control-empty {
            color: #64748b;
            padding: 0.85rem 0.9rem;
            font-size: 0.88rem;
            font-weight: 650;
        }
        .company-control-record {
            padding: 0.9rem;
        }
        .company-control-record-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
        }
        .company-control-record-head h3 {
            margin: 0.34rem 0 0;
            color: #0f172a;
            font-size: 1rem;
            font-weight: 750;
            line-height: 1.2;
            letter-spacing: 0;
        }
        .company-control-status-pill {
            display: inline-flex;
            align-items: center;
            border: 1px solid #bfdbfe;
            border-radius: 999px;
            background: #eff6ff;
            color: #1d4ed8;
            font-size: 0.72rem;
            font-weight: 800;
            line-height: 1;
            padding: 0.22rem 0.48rem;
        }
        .company-control-status-pill.status-inactive {
            border-color: #e5e7eb;
            background: #f8fafc;
            color: #64748b;
        }
        .company-control-delete-form {
            margin: 0;
        }
        .company-control-facts,
        .company-control-detail-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.65rem;
            margin: 0.85rem 0 0;
        }
        .company-control-facts div,
        .company-control-detail-grid div {
            min-width: 0;
            border: 1px solid #edf2f7;
            border-radius: 8px;
            background: #f8fafc;
            padding: 0.55rem 0.62rem;
        }
        .company-control-facts dd,
        .company-control-detail-grid dd {
            margin: 0.22rem 0 0;
            color: #0f172a;
            font-size: 0.88rem;
            font-weight: 650;
            line-height: 1.25;
            overflow-wrap: anywhere;
        }
        .company-control-detail-wide {
            grid-column: 1 / -1;
        }
        .company-control-details,
        .company-control-advanced {
            border-top: 1px solid #eef2f7;
            margin-top: 0.85rem;
            padding-top: 0.72rem;
        }
        .company-control-details summary,
        .company-control-advanced summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            color: #0f172a;
            cursor: pointer;
            font-size: 0.86rem;
            font-weight: 750;
            list-style: none;
        }
        .company-control-details summary::-webkit-details-marker,
        .company-control-advanced summary::-webkit-details-marker {
            display: none;
        }
        .company-admin-dropdown-panel {
            padding: 0;
            overflow: hidden;
        }
        .company-admin-dropdown-summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            cursor: pointer;
            list-style: none;
            padding: 1rem 1.1rem;
        }
        .company-admin-dropdown-summary::-webkit-details-marker {
            display: none;
        }
        .company-admin-dropdown-summary:hover {
            background: #f8fafc;
        }
        .company-admin-dropdown-copy {
            display: grid;
            gap: 0.24rem;
            min-width: 0;
        }
        .company-admin-dropdown-title {
            color: #0f172a;
            font-size: 1.03rem;
            font-weight: 750;
            line-height: 1.2;
        }
        .company-admin-dropdown-text {
            color: #64748b;
            font-size: 0.84rem;
            line-height: 1.35;
        }
        .company-admin-dropdown-body {
            padding: 0 1rem 1rem;
        }
        .company-setup-dropdown-body {
            padding-top: 1rem;
        }
        .company-setup-dropdown-body .company-control-meta {
            margin-top: 0;
        }
        .company-control-summary-action {
            display: inline-flex;
            align-items: center;
            gap: 0.42rem;
            color: #2563eb;
            font-size: 0.8rem;
            font-weight: 750;
            white-space: nowrap;
        }
        .company-control-summary-action::after {
            content: "";
            width: 0.42rem;
            height: 0.42rem;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: rotate(45deg) translateY(-1px);
            transition: transform 0.16s ease;
        }
        .company-control-details[open] .company-control-summary-action::after,
        .company-control-advanced[open] .company-control-summary-action::after,
        .company-admin-dropdown-panel[open] .company-control-summary-action::after {
            transform: rotate(-135deg) translateY(-1px);
        }
        .company-control-form.consolidation-form-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 0.85rem;
            margin-top: 1rem;
        }
        .company-control-form-heading h3 {
            margin: 0;
            color: #0f172a;
            font-size: 0.98rem;
            font-weight: 750;
            line-height: 1.2;
            letter-spacing: 0;
        }
        .company-control-basic-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.75rem;
        }
        .company-control-setup-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        .company-control-field-full {
            grid-column: 1 / -1;
        }
        .company-control-advanced {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #fbfdff;
            margin-top: 0;
            padding: 0;
        }
        .company-control-advanced summary {
            padding: 0.85rem 0.9rem;
        }
        .company-control-advanced-title {
            color: #0f172a;
            font-size: 0.94rem;
            font-weight: 750;
        }
        .company-control-advanced-body {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.75rem;
            padding: 0 0.9rem 0.9rem;
        }
        .company-control-advanced fieldset {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.7rem;
            min-width: 0;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #ffffff;
            margin: 0;
            padding: 0.82rem;
        }
        .company-control-advanced legend {
            color: #475569;
            font-size: 0.76rem;
            font-weight: 800;
            letter-spacing: 0;
            line-height: 1;
            padding: 0 0.28rem;
            text-transform: uppercase;
        }
        .company-control-advanced fieldset .consolidation-form-wide {
            grid-column: 1 / -1;
        }
        .company-control-advanced .company-admin-check {
            min-height: 2.35rem;
            padding-top: 0;
        }
        .company-ownership-overview {
            display: grid;
            grid-template-columns: minmax(10rem, 0.6fr) minmax(10rem, 0.6fr) minmax(24rem, 2fr);
            gap: 0.75rem;
            align-items: stretch;
            margin-top: 1rem;
        }
        .company-ownership-stat,
        .company-ownership-settings-form {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #ffffff;
        }
        .company-ownership-stat {
            display: grid;
            align-content: center;
            gap: 0.26rem;
            padding: 0.75rem 0.85rem;
        }
        .company-ownership-stat span {
            color: #64748b;
            font-size: 0.73rem;
            font-weight: 750;
            line-height: 1.2;
            text-transform: uppercase;
        }
        .company-ownership-stat strong {
            color: #0f172a;
            font-size: 1.08rem;
            line-height: 1.2;
        }
        .company-ownership-settings-form {
            display: grid;
            grid-template-columns: auto minmax(12rem, 1fr) auto;
            gap: 0.7rem;
            align-items: end;
            margin: 0;
            padding: 0.75rem;
        }
        .company-ownership-settings-form label {
            display: grid;
            gap: 0.35rem;
            color: #475569;
            font-size: 0.84rem;
            font-weight: 700;
        }
        .company-ownership-settings-form .company-ownership-full-check {
            align-self: center;
            min-height: 2.35rem;
        }
        .company-ownership-settings-form input {
            box-sizing: border-box;
            width: 100%;
            min-height: 2.35rem;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #ffffff;
            color: #0f172a;
            font: inherit;
            padding: 0.45rem 0.58rem;
        }
        .company-ownership-settings-form input[type="checkbox"] {
            width: auto;
            min-height: auto;
            border: none;
            padding: 0;
        }
        .company-ownership-settings-form .company-ownership-save-btn {
            justify-self: end;
            width: auto;
            min-width: 8.25rem;
            min-height: 2.2rem;
            padding: 0.5rem 0.78rem;
        }
        .company-admin-check {
            grid-template-columns: auto 1fr !important;
            align-items: center;
            align-content: center;
            min-height: 36px;
            padding-top: 18px;
        }
        .company-admin-check input {
            min-height: auto;
        }
        .company-warning-title-line {
            display: flex;
            align-items: center;
            gap: 0.65rem;
        }
        .company-warning-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.65rem;
            height: 1.65rem;
            border-radius: 999px;
            background: #f59e0b;
            color: #111827;
            font-weight: 900;
            line-height: 1;
        }
        .company-manage-row {
            grid-template-columns: minmax(0, 1fr) minmax(34rem, 60rem);
        }
        .company-manage-action {
            display: grid;
            justify-items: end;
            gap: 0.75rem;
            min-width: 0;
        }
        .company-manage-panel {
            justify-self: stretch;
            width: 100%;
        }
        .company-manage-panel[hidden] {
            display: none !important;
        }
        .company-manage-form {
            display: grid;
            grid-template-columns: repeat(3, minmax(12rem, 1fr)) auto;
            align-items: end;
            gap: 0.7rem;
            margin: 0;
            width: 100%;
        }
        .company-manage-chart-form {
            grid-template-columns: minmax(14rem, 1fr) auto;
        }
        .company-manage-form label {
            display: grid;
            gap: 0.35rem;
            color: #475569;
            font-size: 0.84rem;
            font-weight: 700;
        }
        .company-manage-form input,
        .company-manage-form select,
        .company-manage-form textarea {
            box-sizing: border-box;
            width: 100%;
            min-height: 2.35rem;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #ffffff;
            color: #0f172a;
            font: inherit;
            padding: 0.45rem 0.58rem;
        }
        .company-manage-delete-options {
            display: grid;
            justify-items: end;
            gap: 0.65rem;
            max-width: 32rem;
            justify-self: end;
            color: #7f1d1d;
            font-size: 0.84rem;
            line-height: 1.4;
        }
        .company-manage-delete-options p {
            margin: 0;
        }

        .company-delete-modal[hidden] {
            display: none !important;
        }
        .company-delete-modal {
            position: fixed;
            inset: 0;
            z-index: 2400;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .company-delete-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(15, 23, 42, 0.58);
        }
        .company-delete-dialog {
            position: relative;
            width: min(560px, 100%);
            max-height: calc(100vh - 2rem);
            overflow-y: auto;
            border-radius: 10px;
            background: #ffffff;
            box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
        }
        .company-delete-form {
            margin: 0;
        }
        .company-delete-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem 1.1rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .company-delete-head h2 {
            margin: 0;
            color: #111827;
            font-size: 1.08rem;
            line-height: 1.2;
        }
        .company-delete-close {
            border: none;
            background: transparent;
            color: #64748b;
            cursor: pointer;
            font: inherit;
            font-size: 1.35rem;
            line-height: 1;
            padding: 0.1rem 0.25rem;
        }
        .company-delete-body {
            display: grid;
            gap: 0.8rem;
            padding: 1rem 1.1rem;
        }
        .company-delete-body p {
            margin: 0;
            color: #374151;
            font-size: 0.9rem;
            line-height: 1.45;
        }
        .company-delete-check,
        .company-delete-confirm {
            display: grid;
            gap: 0.35rem;
            color: #374151;
            font-size: 0.86rem;
            line-height: 1.35;
        }
        .company-delete-check {
            grid-template-columns: auto 1fr;
            align-items: start;
        }
        .company-delete-check input {
            margin-top: 0.16rem;
        }
        .company-delete-confirm span {
            font-weight: 700;
        }
        .company-delete-confirm input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d1d5db;
            border-radius: 7px;
            padding: 0.5rem 0.55rem;
            font: inherit;
        }
        .company-delete-actions {
            display: flex;
            justify-content: flex-end;
            gap: 0.65rem;
            padding: 0.85rem 1.1rem 1rem;
            border-top: 1px solid #e5e7eb;
        }
        .company-delete-actions .btn-secondary,
        .company-delete-actions .btn-danger {
            border-radius: 7px;
            border: 1px solid transparent;
            cursor: pointer;
            font: inherit;
            font-weight: 700;
            padding: 0.48rem 0.75rem;
        }
        .company-delete-actions .btn-secondary {
            border-color: #d1d5db;
            background: #ffffff;
            color: #374151;
        }
        .company-delete-actions .btn-danger {
            border-color: #991b1b;
            background: #b91c1c;
            color: #ffffff;
        }
        .company-delete-actions .company-restore-submit {
            border: 1px solid #1d4ed8;
            border-radius: 7px;
            background: #2563eb;
            color: #ffffff;
            cursor: pointer;
            font: inherit;
            font-weight: 700;
            padding: 0.48rem 0.75rem;
        }

        @media (max-width: 980px) {
            .company-query-shell {
                width: 100%;
                max-width: none;
                height: auto;
                min-height: calc(100vh - 86px);
                overflow: visible;
            }
            .company-query-title-wrap h1 {
                font-size: 1.5rem;
            }
            .company-grid-scroll {
                height: clamp(300px, 55vh, 540px);
                flex: 0 0 auto;
                max-height: none;
            }
            .add-company-fields {
                grid-template-columns: 1fr;
            }
            .company-grid {
                min-width: 900px;
            }
            .company-detail-shell {
                width: 100%;
                margin: 0;
                padding: 0.7rem 0.75rem 0.9rem;
            }
            .company-detail-head {
                align-items: stretch;
            }
            .company-detail-overview {
                grid-template-columns: 1fr;
            }
            .company-detail-list-wide {
                grid-column: auto;
            }
            .deleted-companies-table {
                min-width: 720px;
            }
            .company-control-meta,
            .company-control-facts,
            .company-control-detail-grid,
            .company-control-basic-grid,
            .company-control-setup-grid,
            .company-ownership-overview,
            .company-ownership-settings-form,
            .company-control-advanced-body,
            .company-control-advanced fieldset {
                grid-template-columns: minmax(0, 1fr);
            }
            .company-control-record-head {
                align-items: stretch;
                flex-direction: column;
            }
            .company-control-delete-form {
                align-self: flex-start;
            }
            .company-admin-dropdown-summary {
                align-items: flex-start;
                flex-direction: column;
            }
            .company-manage-row,
            .company-manage-action,
            .company-manage-form,
            .company-manage-chart-form {
                grid-template-columns: minmax(0, 1fr);
            }
            .company-manage-action,
            .company-manage-delete-options {
                justify-items: stretch;
                justify-self: stretch;
            }
        }

/* Template style block */
.company-admin-settings button.company-admin-primary-action,
.company-admin-settings .consolidation-form-actions button.company-admin-primary-action,
.company-admin-settings .org-admin-primary-btn.company-admin-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    min-width: 8.25rem;
    min-height: 2.25rem;
    border: 1px solid #133752;
    border-radius: 8px;
    background: #133752;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1;
    padding: 0.52rem 0.86rem;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.company-admin-settings button.company-admin-primary-action:hover,
.company-admin-settings button.company-admin-primary-action:focus,
.company-admin-settings .consolidation-form-actions button.company-admin-primary-action:hover,
.company-admin-settings .consolidation-form-actions button.company-admin-primary-action:focus,
.company-admin-settings .org-admin-primary-btn.company-admin-primary-action:hover,
.company-admin-settings .org-admin-primary-btn.company-admin-primary-action:focus {
    border-color: #0f2d44;
    background: #0f2d44;
    color: #ffffff;
}

.company-admin-settings .company-ownership-settings-form .company-ownership-save-btn {
    justify-self: end;
    width: auto;
    min-width: 7.75rem;
    max-width: max-content;
}

.company-rename-shell {
        max-width: 760px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .company-rename-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .company-rename-header h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.15;
    }
    .company-rename-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .company-rename-back,
    .company-rename-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #133752;
        font-size: 0.84rem;
        font-weight: 700;
        line-height: 1;
        padding: 0.55rem 0.75rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .company-rename-back:hover,
    .company-rename-secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .company-rename-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        padding: 1rem;
    }
    .company-rename-warning {
        border-left: 3px solid #ca8a04;
        background: #fffbeb;
        color: #713f12;
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.95rem;
    }
    .company-rename-warning h2 {
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.2;
    }
    .company-rename-warning p {
        margin: 0.42rem 0 0;
        font-size: 0.86rem;
        line-height: 1.45;
    }
    .company-rename-form {
        display: grid;
        gap: 0.58rem;
    }
    .company-rename-form label {
        color: #334155;
        font-size: 0.82rem;
        font-weight: 750;
    }
    .company-rename-form input[type="text"],
    .company-rename-form textarea {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        color: #111827;
        font: inherit;
        min-height: 2.3rem;
        padding: 0.48rem 0.62rem;
    }
    .company-rename-confirm {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        line-height: 1.35;
    }
    .company-rename-confirm input {
        margin-top: 0.12rem;
    }
    .company-rename-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.55rem;
        margin-top: 0.25rem;
    }
    .company-rename-primary {
        border: 1px solid #133752;
        border-radius: 8px;
        background: #133752;
        color: #ffffff;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.62rem 0.85rem;
    }
    .company-rename-primary:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .form-error {
        color: #b91c1c;
        font-size: 0.78rem;
        font-weight: 700;
    }
    @media (max-width: 640px) {
        .company-rename-header {
            flex-direction: column;
        }
    }

/* Template style block */
.company-action-shell {
        max-width: 760px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .company-action-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .company-action-header h1 {
        margin: 0;
        font-size: 1.75rem;
        line-height: 1.15;
    }
    .company-action-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
    }
    .company-action-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        padding: 1rem;
    }
    .company-action-warning {
        border-left: 3px solid #ca8a04;
        background: #fffbeb;
        color: #713f12;
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.95rem;
    }
    .company-action-warning h2 {
        margin: 0;
        font-size: 0.98rem;
        line-height: 1.2;
    }
    .company-action-warning p {
        margin: 0.42rem 0 0;
        font-size: 0.86rem;
        line-height: 1.45;
    }
    .company-action-form {
        display: grid;
        gap: 0.58rem;
    }
    .company-action-form label,
    .ownership-percent-field label {
        color: #334155;
        font-size: 0.82rem;
        font-weight: 750;
    }
    .company-action-form input[type="number"] {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        color: #111827;
        font: inherit;
        min-height: 2.3rem;
        padding: 0.48rem 1.8rem 0.48rem 0.62rem;
    }
    .ownership-full-check,
    .company-action-confirm {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        line-height: 1.35;
    }
    .ownership-full-check input,
    .company-action-confirm input {
        margin-top: 0.12rem;
    }
    .ownership-percent-input-wrap {
        position: relative;
        display: block;
        margin-top: 0.24rem;
    }
    .ownership-percent-suffix {
        position: absolute;
        right: 0.62rem;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 0.82rem;
        font-weight: 700;
        pointer-events: none;
    }
    .company-action-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.55rem;
        margin-top: 0.25rem;
    }
    .company-action-primary,
    .company-action-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.62rem 0.85rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .company-action-primary {
        border: 1px solid #133752;
        background: #133752;
        color: #ffffff;
        cursor: pointer;
    }
    .company-action-secondary {
        border: 1px solid #cbd5e1;
        background: #ffffff;
        color: #133752;
    }
    .company-action-primary:hover {
        background: #0f2d44;
        border-color: #0f2d44;
    }
    .company-action-secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
    }
    .form-error {
        color: #b91c1c;
        font-size: 0.78rem;
        font-weight: 700;
    }
    @media (max-width: 640px) {
        .company-action-header {
            flex-direction: column;
        }
    }

/* Template style block */
.dimension-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.4rem;
    padding: 0.45rem 0 0.55rem;
    box-sizing: border-box;
  }
  .dimension-sheet-head h1 {
    margin: 0;
    font-size: 1.47rem;
    line-height: 1.15;
  }
  .dimension-sheet-actions {
    display: flex;
    align-items: center;
    gap: 0.52rem;
    position: relative;
    z-index: 7100;
  }
  .dimension-icon-button {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .dimension-icon-button:hover {
    color: #374151;
    background: transparent;
  }
  .dimension-icon-button svg {
    width: 1rem;
    height: 1rem;
  }
  .dimension-edit-save-button {
    min-width: 3.8rem;
    height: 2.2rem;
    border: 1px solid #133752;
    border-radius: 7px;
    background: #133752;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1;
    padding: 0 0.72rem;
    white-space: nowrap;
  }
  .dimension-edit-save-button:hover,
  .dimension-edit-save-button:focus {
    background: #0f2d44;
    border-color: #0f2d44;
  }
  .dimension-edit-save-button.is-editing,
  .dimension-edit-save-button.is-saving,
  .dimension-edit-save-button.is-saving:disabled {
    background: #133752;
    border-color: #133752;
    color: #ffffff;
  }
  .dimension-edit-save-button.is-editing:hover,
  .dimension-edit-save-button.is-editing:focus,
  .dimension-edit-save-button.is-saving:hover:not(:disabled),
  .dimension-edit-save-button.is-saving:focus:not(:disabled) {
    background: #0f2d44;
    border-color: #0f2d44;
  }
  .dimension-edit-save-button.is-saving {
    min-width: 5rem;
  }
  .dimension-edit-save-button:disabled {
    cursor: wait;
    opacity: 0.72;
  }
  .dimension-sheet-menu {
    position: relative;
    z-index: 7150;
  }
  .dimension-sheet-menu .coa-icon-button {
    width: 2.7rem;
    height: 2.7rem;
    color: #475569;
    font-size: 1.42rem;
    font-weight: 800;
    line-height: 1;
  }
  .dimension-sheet-menu-dropdown {
    position: absolute;
    right: 0;
    top: 2.2rem;
    min-width: 220px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
    overflow: hidden;
    z-index: 7200;
  }
  .dimension-sheet-menu-dropdown a,
  .dimension-sheet-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    text-align: left;
    border: none;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .dimension-sheet-menu-dropdown a:hover,
  .dimension-sheet-menu-dropdown button:hover {
    background: #f3f4f6;
  }
  .dimension-grid-wrap {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    overflow: visible;
    min-height: 280px;
    position: relative;
    z-index: 1;
  }
  .dimension-grid-view-mode .htAutocompleteArrow {
    display: none !important;
  }
  .handsontable td.dimension-cell-invalid {
    background: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e;
  }
  .dimension-save-status {
    display: block;
    min-height: 0;
    margin: 0 0 0.55rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.35;
  }
  .dimension-save-status:empty {
    display: none;
  }
  .dimension-save-status.is-saving,
  .dimension-save-status.is-success,
  .dimension-save-status.is-warning,
  .dimension-save-status.is-error {
    padding: 0.48rem 0.65rem;
  }
  .dimension-save-status.is-saving {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
  }
  .dimension-save-status.is-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .dimension-save-status.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
  }
  .dimension-save-status.is-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .badge {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
  }
  .badge-locked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }

/* Template style block */
.app-window-table-wrap{max-height:clamp(320px,65vh,720px);overflow:auto;scrollbar-gutter:stable;}

/* Template style block */
.history-shell { margin: 0; padding-top: 0.5rem; }
  .history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.55rem; }
  .history-title { margin: 0; font-size: 1.35rem; line-height: 1.1; color: #111827; }
  .history-subtitle { margin-top: 0.25rem; font-size: 0.84rem; }
  .history-btn { border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #111827; text-decoration: none; padding: 0.35rem 0.7rem; font-size: 0.82rem; font-weight: 700; }
  .history-panel { border: 1px solid #d1d5db; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); overflow: hidden; }
  .history-table-wrap { max-height: calc(100vh - 170px); overflow: auto; background: #f4f5f7; }
  .history-table { width: 100%; min-width: 880px; border-collapse: collapse; table-layout: fixed; font-size: 0.84rem; color: #1f2937; }
  .history-table th, .history-table td { border: 1px solid #dde1e6; padding: 0.25rem 0.46rem; vertical-align: middle; }
  .history-grid-head th { position: sticky; top: 0; background: #133752; color: #f8fafc; text-align: left; font-weight: 700; z-index: 2; }
  .history-filter-row th { position: sticky; top: 31px; background: #eaf1f8; z-index: 2; }
  .history-filter-input { width: 100%; box-sizing: border-box; border: 1px solid #c7d2fe; border-radius: 6px; padding: 0.22rem 0.35rem; font: inherit; background: #fff; color: #1f2937; }
  .history-row:nth-child(odd) td { background: #f5f6f8; }
  .history-row:nth-child(even) td { background: #edf0f3; }
  .history-row:hover td { background: #dfeee7 !important; }
  .history-empty { text-align: center; color: #6b7280; padding: 1rem 0.75rem; background: #f9fafb !important; }
  .history-link { color: #1d4ed8; font-weight: 700; text-decoration: none; }
  .history-link:hover { text-decoration: underline; }

/* Template style block */
.history-detail-shell { padding: 0.8rem 1rem; background: #fff; min-height: 100vh; color: #111827; }
  .history-detail-shell h1 { margin: 0 0 0.65rem; font-size: 1.25rem; }
  .meta { display: grid; gap: 0.25rem; margin-bottom: 0.9rem; font-size: 0.88rem; color: #374151; }
  .block { margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0.7rem; background: #fff; }
  .block h2 { margin: 0 0 0.45rem; font-size: 1rem; }
  .grid-wrap { overflow: auto; border: 1px solid #d1d5db; border-radius: 8px; margin-bottom: 0.55rem; }
  .delta-grid { width: 100%; border-collapse: collapse; min-width: 420px; font-size: 0.82rem; }
  .delta-grid th, .delta-grid td { border: 1px solid #dde1e6; padding: 0.28rem 0.42rem; text-align: left; vertical-align: middle; }
  .delta-grid th { background: #133752; color: #f8fafc; font-weight: 700; position: sticky; top: 0; }
  .delta-grid tbody tr:nth-child(odd) td { background: #f5f6f8; }
  .delta-grid tbody tr:nth-child(even) td { background: #edf0f3; }
  .history-tsv { width: 100%; min-height: 150px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0.6rem; font: 12px/1.4 "Consolas", "Courier New", monospace; background: #f8fafc; resize: vertical; box-sizing: border-box; white-space: pre; }

/* Template style block */
.dimension-query-shell {
    margin: 0;
    max-width: none;
    width: 100%;
    padding-top: 0.2rem;
    font-family: var(--app-font-family);
    height: calc(100vh - 86px);
    overflow: hidden;
  }
  .dimension-workspace {
    --dimension-left-pane-width: 360px;
    display: grid;
    grid-template-columns: minmax(0, var(--dimension-left-pane-width)) 6px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
    height: 100%;
    min-height: 0;
  }
  .dimension-workspace.is-selector-collapsed {
    grid-template-columns: 0 14px minmax(0, 1fr);
  }
  .dimension-workspace.is-sheet-closed {
    grid-template-columns: minmax(0, 1fr) 0 0;
  }
  .dimension-workspace.is-sheet-closed .dimension-detail-column,
  .dimension-workspace.is-sheet-closed .dimension-pane-resizer {
    display: none;
  }
  .dimension-workspace.is-sheet-closed .dimension-list-column {
    width: min(100%, 1080px);
    max-width: 1080px;
    margin: 0 auto;
  }
  .dimension-list-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .dimension-query-window {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
  }
  .dimension-query-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem 0.85rem;
    border-bottom: 1px solid #e5e7eb;
  }
  .dimension-query-title-wrap h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.1;
    color: #111827;
    font-weight: 700;
  }
  .dimension-grid-scroll {
    height: clamp(340px, 68vh, 760px);
    overflow: auto;
    background: #f4f5f7;
  }
  .dimension-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.86rem;
    color: #1f2937;
  }
  .dimension-grid th,
  .dimension-grid td {
    padding: 0.24rem 0.5rem;
    border: 1px solid #dde1e6;
    vertical-align: middle;
  }
  .dimension-grid-head th {
    position: sticky;
    top: 0;
    background: #133752;
    color: #f8fafc;
    text-align: left;
    font-weight: 700;
    z-index: 2;
  }
  .dimension-grid-filter-row td {
    background: #e4eaf3 !important;
    padding: 0.18rem 0.35rem;
  }
  .dimension-grid-filter-input-wrap {
    position: relative;
  }
  .dimension-grid-filter-icon {
    position: absolute;
    left: 0.42rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
  }
  .dimension-grid-filter-icon svg {
    width: 0.82rem;
    height: 0.82rem;
    display: block;
  }
  .dimension-grid-filter-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 0.24rem 0.38rem 0.24rem 1.45rem;
    font: inherit;
    background: #ffffff;
    color: #1f2937;
  }
  .dimension-grid-filter-input-wrap.is-value-filtered .dimension-grid-filter-icon,
  .dimension-grid-filter-input-wrap.is-condition-filtered .dimension-grid-filter-icon {
    color: #0f766e;
  }
  .dimension-filter-menu {
    position: fixed;
    min-width: 320px;
    max-width: min(420px, calc(100vw - 1rem));
    max-height: min(460px, calc(100vh - 1rem));
    overflow: hidden;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1600;
    display: flex;
    flex-direction: column;
  }
  .dimension-filter-menu[hidden] {
    display: none !important;
  }
  .dimension-filter-menu-sort {
    display: grid;
    gap: 0;
    border-bottom: 1px dotted #cccccc;
    padding: 0.18rem 0;
  }
  .dimension-filter-menu-sort-btn {
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: left;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .dimension-filter-menu-sort-btn:hover {
    background: #f3f4f6;
  }
  .dimension-filter-menu-condition {
    display: block;
    border-bottom: 1px dotted #cccccc;
    padding: 0.12rem 0;
    background: #ffffff;
  }
  .dimension-filter-menu-condition.is-open {
    display: block;
    padding: 0.12rem 0;
  }
  .dimension-filter-menu-condition-toggle {
    width: 100%;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .dimension-filter-menu-condition-toggle:hover {
    background: #f3f4f6;
  }
  .dimension-filter-menu-condition-arrow {
    display: inline-block;
    font-size: 0.82rem;
    line-height: 1;
    color: #4b5563;
    transition: transform 120ms ease;
    transform: rotate(0deg);
  }
  .dimension-filter-menu-condition.is-open .dimension-filter-menu-condition-arrow {
    transform: rotate(90deg);
  }
  .dimension-filter-menu-condition-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.32rem;
    padding: 0.2rem 0.45rem 0.36rem;
  }
  .dimension-filter-menu-condition-body[hidden] {
    display: none !important;
  }
  .dimension-filter-menu-condition-select,
  .dimension-filter-menu-condition-value {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
    min-height: 1.6rem;
  }
  .dimension-filter-menu-condition-value[disabled] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
  }
  .dimension-filter-menu-search-wrap {
    padding: 0.3rem 0.45rem 0;
  }
  .dimension-filter-menu-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
  }
  .dimension-filter-menu-selection-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.24rem 0.45rem 0.22rem;
  }
  .dimension-filter-menu-link {
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .dimension-filter-menu-link:hover {
    text-decoration: underline;
  }
  .dimension-filter-menu-list {
    display: grid;
    gap: 0;
    padding: 0.22rem 0.4rem 0.3rem;
    overflow-y: auto;
    max-height: min(150px, calc(100vh - 12rem));
  }
  .dimension-filter-menu-option {
    border: none;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.34rem;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.17rem 0.08rem;
    cursor: pointer;
  }
  .dimension-filter-menu-option:hover,
  .dimension-filter-menu-option:focus-within {
    background: #f3f4f6;
  }
  .dimension-filter-menu-option-check {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
    accent-color: #2563eb;
    flex: 0 0 auto;
  }
  .dimension-filter-menu-option-label {
    min-width: 0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dimension-filter-menu-empty {
    padding: 0.4rem 0.18rem;
    color: #6b7280;
    font-size: 0.75rem;
    background: #ffffff;
  }
  .dimension-filter-menu-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    border-top: 1px dotted #cccccc;
    padding: 0.3rem 0.45rem 0.4rem;
    background: #ffffff;
  }
  .dimension-filter-menu-cancel,
  .dimension-filter-menu-apply {
    border-radius: 2px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 64px;
    height: 20px;
    padding: 0.18rem 0.5rem;
    cursor: pointer;
  }
  .dimension-filter-menu-cancel {
    border: 1px solid #b9b9b9;
    background: #eeeeee;
    color: #111827;
  }
  .dimension-filter-menu-apply {
    border: 1px solid #18804e;
    background: #0f9d58;
    color: #ffffff;
  }
  .dimension-grid tbody tr:nth-child(odd) td {
    background: #f5f6f8;
  }
  .dimension-grid tbody tr:nth-child(even) td {
    background: #edf0f3;
  }
  .dimension-grid-row {
    cursor: pointer;
  }
  .dimension-grid-row:hover td,
  .dimension-grid-row.is-selected td {
    background: #dfeee7 !important;
  }
  .dimension-code-col {
    width: 24%;
  }
  .dimension-name-col {
    width: 52%;
  }
  .dimension-values-col {
    width: 12%;
  }
  .dimension-status-col {
    width: 20%;
  }
  .dimension-actions-col {
    width: 23%;
  }
  .dimension-name-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dimension-code-cell {
    white-space: nowrap;
    color: #475569;
  }
  .dimension-code-cell strong {
    font-weight: 750;
  }
  .dimension-name-cell strong {
    font-weight: 600;
  }
  .dimension-values-cell {
    text-align: right;
    font-weight: 700;
    padding-right: 0.75rem;
  }
  .dimension-status-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
  }
  .dimension-status-pill.is-open {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
  }
  .dimension-status-pill.is-locked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }
  .dimension-actions-cell {
    text-align: right;
  }
  .dimension-grid-empty td {
    text-align: center;
    color: #6b7280;
    padding: 1rem 0.75rem;
    background: #f9fafb !important;
  }
  .dimension-actions-menu {
    position: relative;
    display: inline-block;
  }
  .dimension-menu-dots {
    border: none;
    background: transparent;
    color: #374151;
    font-size: 0.92rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.08rem 0.3rem;
  }
  .dimension-menu-dots:hover {
    background: #e5e7eb;
  }
  .dimension-actions-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 1.35rem;
    min-width: 170px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    z-index: 30;
  }
  .dimension-actions-menu.open .dimension-actions-menu-dropdown {
    display: block;
  }
  .dimension-actions-menu-dropdown form {
    margin: 0;
  }
  .dimension-actions-menu-dropdown a,
  .dimension-actions-menu-dropdown button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    border: none;
    background: #ffffff;
    padding: 0.58rem 0.74rem;
    font: inherit;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    text-decoration: none;
  }
  .dimension-actions-menu-dropdown a:hover,
  .dimension-actions-menu-dropdown button:hover {
    background: #f3f4f6;
  }
  .dimension-actions-menu-dropdown button.danger {
    color: #b91c1c;
  }
  .add-dimension-panel {
    margin-top: 0.85rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    padding: 0.42rem 0.7rem 0.75rem;
  }
  .add-dimension-summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    color: #1f2937;
  }
  .add-dimension-summary::-webkit-details-marker {
    display: none;
  }
  .add-dimension-form {
    margin-top: 0.7rem;
  }
  .add-dimension-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.24rem;
    color: #374151;
  }
  .add-dimension-field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0.46rem 0.5rem;
    font: inherit;
    background: #ffffff;
  }
  .form-error {
    margin-top: 0.2rem;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 700;
  }
  .add-dimension-save {
    margin-top: 0.7rem;
  }
  .dimension-detail-column {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: clamp(380px, 76vh, 920px);
  }
  .dimension-pane-resizer {
    width: 6px;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    border-radius: 6px;
    background: transparent;
    position: relative;
    transition: background-color 120ms ease, box-shadow 120ms ease;
  }
  .dimension-pane-resizer::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d1d5db;
  }
  .dimension-workspace.is-selector-collapsed .dimension-pane-resizer {
    width: 14px;
    border-radius: 8px;
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px #d1d5db;
  }
  .dimension-workspace.is-selector-collapsed .dimension-pane-resizer::before {
    left: 5px;
    width: 3px;
    background: #94a3b8;
  }
  .dimension-detail-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #f8fafc;
  }
  .dimension-detail-frame {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
  }
  .dimension-detail-column.has-selection .dimension-detail-frame {
    display: block;
  }
  .dimension-detail-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.95rem;
  }
  .dimension-detail-column.has-selection .dimension-detail-empty {
    display: none;
  }
  .muted-text {
    color: #6b7280;
  }

  @media (max-width: 1240px) {
    .dimension-workspace {
      grid-template-columns: minmax(0, var(--dimension-left-pane-width)) 6px minmax(0, 1fr);
    }
  }
  @media (max-width: 1080px) {
    .dimension-workspace {
      grid-template-columns: 1fr;
    }
    .dimension-pane-resizer {
      display: none !important;
    }
    .dimension-grid {
      min-width: 680px;
    }
    .dimension-detail-column {
      min-height: 560px;
    }
  }

/* Template style block */
.app-window-table-wrap{max-height:clamp(260px,50vh,560px);overflow:auto;scrollbar-gutter:stable;margin-top:.5rem;}

/* Template style block */
.dimension-panel-shell {
    padding: 1rem;
    min-height: 100%;
    box-sizing: border-box;
    background: #ffffff;
  }
  .dimension-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
  }
  .dimension-panel-title-block h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #111827;
    line-height: 1.15;
  }
  .dimension-panel-title-block p {
    margin: 0.28rem 0 0;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .dimension-panel-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
  }
  .dimension-panel-badge.is-open {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
  }
  .dimension-panel-badge.is-locked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }
  .dimension-panel-actions {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
  }
  .dimension-panel-values-wrap {
    margin-top: 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: auto;
    max-height: 560px;
    background: #f8fafc;
  }
  .dimension-panel-values-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    color: #1f2937;
  }
  .dimension-panel-values-grid th,
  .dimension-panel-values-grid td {
    border: 1px solid #e5e7eb;
    padding: 0.34rem 0.46rem;
    text-align: left;
    vertical-align: middle;
  }
  .dimension-panel-values-grid thead th {
    position: sticky;
    top: 0;
    background: #e5edf6;
    color: #1f2937;
    font-weight: 700;
    z-index: 1;
  }
  .dimension-panel-col-code {
    width: 90px;
  }
  .dimension-panel-col-name {
    width: auto;
  }
  .dimension-panel-col-actions {
    width: 120px;
  }
  .dimension-panel-value-actions {
    text-align: right;
    white-space: nowrap;
  }
  .dimension-panel-empty {
    text-align: center;
    color: #6b7280;
    padding: 1rem 0.75rem;
  }
  .dimension-panel-muted {
    color: #64748b;
    font-weight: 700;
    font-size: 0.78rem;
  }
  .dimension-grid-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.34rem 0.45rem;
    font: inherit;
    color: #0f172a;
  }
  .dimension-grid-input-number {
    text-align: center;
    font-weight: 700;
  }
  .dimension-grid-input.is-invalid {
    border-color: #b91c1c;
    background: #fef2f2;
  }
  .dimension-grid-status {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
    min-height: 1rem;
  }
  .button.tiny {
    padding: 0.24rem 0.5rem;
    font-size: 0.76rem;
    line-height: 1;
    border-radius: 8px;
  }

/* Template style block */
.fs-version-manager {
    display: none !important;
  }

  .fs-report-workspace {
    margin-top: 0;
    display: grid;
    grid-template-columns: clamp(250px, 28vw, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }
  .fs-report-workspace.is-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  .fs-report-sidebar,
  .fs-report-main {
    min-width: 0;
  }
  .fs-report-workspace.is-sidebar-collapsed .fs-report-sidebar {
    width: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
  }
  .fs-report-main > *:first-child {
    margin-top: 0;
  }
  .fs-report-workspace .fs-report-library {
    margin-top: 0;
    max-width: none;
    min-height: 0;
  }
  .fs-report-workspace .fs-report-tree {
    max-height: min(70vh, 760px);
  }
  .fs-report-workspace .fs-filter-bar,
  .fs-report-workspace .fs-create-layout,
  .fs-report-workspace .fs-create-empty,
  .fs-report-workspace .fs-create-notice {
    max-width: none;
  }

  .fs-top-toolbar {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
  }
  .fs-create-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  .fs-create-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
  }
  .fs-chart-switch {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .fs-chart-switch-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
  }
  .fs-chart-switch-select {
    min-width: 180px;
    max-width: 320px;
    padding: 0.46rem 0.52rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
  }
  .fs-chart-switch-btn {
    margin: 0;
    min-width: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .fs-map-link {
    margin: 0;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
  }
  .fs-map-link-alert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
  }
  .fs-map-link.is-alert {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .fs-map-link.is-alert:hover {
    background: #fee2e2;
  }
  .fs-create-back {
    margin: 0;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .fs-version-manager {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.85rem;
    max-width: 1160px;
  }
  .fs-version-manager-header h2 {
    margin: 0 0 0.2rem 0;
    font-size: 1.05rem;
  }
  .fs-version-manager-header p {
    margin: 0;
  }
  .fs-version-controls {
    margin-top: 0.8rem;
    max-width: 520px;
  }
  .fs-type-form label {
    display: block;
    margin-bottom: 0.32rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
  }
  .fs-version-control-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .fs-version-control-row select {
    flex: 1;
    min-width: 190px;
    padding: 0.48rem 0.52rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
  }
  .fs-version-control-btn {
    margin: 0;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .fs-version-control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  .fs-version-list {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .fs-version-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .fs-version-edit-form,
  .fs-version-readonly-row,
  .fs-version-create-form {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr) auto;
    gap: 0.5rem;
    align-items: center;
  }
  .fs-version-name,
  .fs-version-description {
    width: 100%;
    padding: 0.48rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
  }
  .fs-version-readonly-row .fs-version-name,
  .fs-version-readonly-row .fs-version-description {
    background: #f9fafb;
    color: #374151;
  }
  .fs-version-item-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .fs-version-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: #ecfeff;
    color: #0e7490;
    font-size: 0.76rem;
    font-weight: 700;
  }
  .fs-version-select-link,
  .fs-version-save-btn,
  .fs-version-delete-btn,
  .fs-version-create-btn {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
  }
  .fs-version-delete-form {
    margin: 0;
  }
  .fs-version-delete-btn {
    background: #991b1b;
  }
  .fs-version-delete-btn:hover {
    background: #7f1d1d;
  }
  .fs-version-create-form {
    margin-top: 0.75rem;
  }
  .fs-version-create-btn {
    min-width: 140px;
  }
  .fs-version-empty {
    margin-top: 0.75rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
  }
  .fs-report-library {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.85rem;
    max-width: 1160px;
  }
  .fs-save-as-panel {
    margin: 0 0 0.7rem 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.6rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  .fs-save-as-panel[hidden] {
    display: none !important;
  }
  .fs-save-as-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
  }
  .fs-save-as-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
  }
  .fs-save-as-input {
    width: 100%;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.58rem;
    font: inherit;
    box-sizing: border-box;
  }
  .fs-save-as-input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    outline-offset: 0;
    border-color: #93c5fd;
  }
  .fs-save-as-folder-row {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
  }
  .fs-save-as-folder-path {
    display: block;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    padding: 0.44rem 0.52rem;
    font-size: 0.82rem;
    line-height: 1.25;
    word-break: break-word;
  }
  .fs-save-as-hint {
    margin: 0;
    font-size: 0.78rem;
  }
  .fs-save-as-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .fs-save-as-cancel-btn {
    margin: 0;
    min-width: 86px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
  }
  .fs-save-as-cancel-btn:hover {
    background: #f9fafb;
  }
  .fs-save-as-confirm-btn {
    margin: 0;
    min-width: 96px;
    border-color: #315f9f;
    background: #315f9f;
    color: #ffffff;
  }
  .fs-save-as-confirm-btn:hover:not(:disabled),
  .fs-save-as-confirm-btn:focus-visible:not(:disabled) {
    border-color: #244a82;
    background: #244a82;
    color: #ffffff;
  }
  .fs-save-as-confirm-btn:disabled,
  .fs-save-as-cancel-btn:disabled,
  .fs-save-as-input:disabled {
    cursor: wait;
    opacity: 0.72;
  }
  .fs-save-as-panel.is-submitting {
    border-color: #bfdbfe;
  }
  .fs-report-library.is-selector-only {
    margin-top: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
    min-height: calc(100vh - 8.1rem);
    display: flex;
    flex-direction: column;
  }
  .fs-report-library-header h2 {
    margin: 0 0 0.2rem 0;
    font-size: 1.05rem;
  }
  .fs-report-library-header p {
    margin: 0;
  }
  .fs-report-selected {
    margin: 0.65rem 0 0 0;
    font-size: 0.9rem;
    color: #1f2937;
  }
  .fs-report-helper {
    margin: 0.65rem 0 0 0;
  }
  .fs-report-tree {
    margin-top: 0;
    border: 1px solid #b3bac3;
    border-radius: 0;
    background: #e8ebef;
    padding: 0.25rem 0.28rem;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    max-height: 560px;
    overflow: auto;
    font-size: 0.84rem;
    font-family: var(--app-font-family);
  }
  .fs-report-library.is-selector-only .fs-report-tree {
    margin-top: 0;
    flex: 1 1 auto;
    max-height: none;
    min-height: calc(100vh - 8.1rem);
    border-color: #aab2bc;
    background: #d3d8df;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    padding-top: 0.32rem;
    padding-left: 0.42rem;
  }
  .fs-report-library.is-selector-only .fs-tree-node {
    min-height: 1.82rem;
    gap: 0.45rem;
  }
  .fs-report-library.is-selector-only .fs-tree-caret {
    border-top-width: 6px;
    border-bottom-width: 6px;
    border-left-width: 7px;
  }
  .fs-report-library.is-selector-only .fs-tree-icon-folder {
    width: 16px;
    height: 12px;
  }
  .fs-report-library.is-selector-only .fs-tree-icon-folder::before {
    width: 8px;
    height: 5px;
    top: -5px;
  }
  .fs-report-library.is-selector-only .fs-tree-icon-report {
    width: 14px;
    height: 16px;
  }
  .fs-report-tree-row {
    padding-left: calc(0.1rem + (var(--fs-depth, 0) * 1rem));
  }
  .fs-tree-node {
    min-height: 1.52rem;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    border-radius: 0;
    padding-right: 0.3rem;
    color: #4d535c;
    cursor: default;
    user-select: none;
    line-height: 1.2;
  }
  .fs-report-tree-section {
    display: flex;
    align-items: center;
    min-height: 1.38rem;
    padding-top: 0.08rem;
    padding-bottom: 0.08rem;
    color: #334155;
    background: #d4dbe5;
    border-top: 1px solid #bdc6d4;
    border-bottom: 1px solid #b4bfd0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    margin-bottom: 0.04rem;
    padding-left: 0.45rem;
    user-select: none;
  }
  .fs-tree-node:hover {
    background: #dde3ea;
  }
  .fs-report-tree.is-save-as-mode .fs-tree-node {
    cursor: pointer;
  }
  .fs-report-tree-row.is-save-target {
    background: #dbeafe;
    color: #1e3a8a;
    box-shadow: inset 0 0 0 1px #93c5fd;
  }
  .fs-report-tree-row.is-save-target .fs-tree-icon-folder {
    border-color: #133752;
  }
  .fs-report-tree-row.is-save-target .fs-tree-icon-folder::before {
    border-color: #133752;
    background: #ffffff;
  }
  .fs-report-tree-report[draggable="true"],
  .fs-report-tree-library-item[draggable="true"] {
    cursor: grab;
  }
  .fs-report-tree-report[draggable="true"]:active,
  .fs-report-tree-library-item[draggable="true"]:active {
    cursor: grabbing;
  }
  .fs-report-tree-report.is-dragging,
  .fs-report-tree-library-item.is-dragging {
    opacity: 0.55;
  }
  .fs-report-tree-folder.is-drop-target {
    background: #dcfce7;
    color: #14532d;
    box-shadow: inset 0 0 0 1px #86efac;
  }
  .fs-report-tree-folder.is-invalid-drop-target {
    background: #fee2e2;
    color: #7f1d1d;
    box-shadow: inset 0 0 0 1px #fca5a5;
  }
  .fs-tree-node:focus-visible {
    outline: 1px solid #7f8a98;
    outline-offset: -1px;
  }
  .fs-report-tree-root {
    font-weight: 500;
    color: #4b5159;
  }
  .fs-report-tree-folder {
    font-weight: 500;
    color: #4b5159;
  }
  .fs-report-tree-report {
    color: #505760;
  }
  .fs-report-tree-library-item {
    color: #4f5662;
  }
  .fs-report-tree-report.is-active {
    background: #cad8ec;
    color: #1f334f;
  }
  .fs-report-tree-report.is-deleted,
  .fs-report-tree-library-item.is-deleted {
    color: #667085;
    font-style: italic;
  }
  .fs-report-tree-report.is-deleted .fs-tree-icon-report {
    border-color: #6b7280;
    background: linear-gradient(180deg, #8a94a4 0%, #758093 100%);
  }
  .fs-tree-caret {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #77808a;
    flex: 0 0 auto;
    transform-origin: 34% 50%;
    transition: transform 0.12s ease;
  }
  .fs-report-tree-root.is-expanded > .fs-tree-caret,
  .fs-report-tree-folder.is-expanded > .fs-tree-caret {
    transform: rotate(90deg);
  }
  .fs-tree-caret-empty {
    visibility: hidden;
  }
  .fs-tree-row-hidden {
    display: none !important;
  }
  .fs-tree-icon {
    position: relative;
    width: 14px;
    height: 11px;
    flex: 0 0 auto;
    background: transparent;
  }
  .fs-tree-icon-folder {
    border: 1px solid #133752;
    border-radius: 2px;
    background: #133752;
    box-sizing: border-box;
  }
  .fs-tree-icon-folder::before {
    content: "";
    position: absolute;
    left: 1px;
    top: -4px;
    width: 7px;
    height: 4px;
    border: 1px solid #133752;
    border-bottom: none;
    border-radius: 2px 2px 0 0;
    background: #ffffff;
    box-sizing: border-box;
  }
  .fs-tree-icon-folder::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: 4px;
    height: 1px;
    background: #ffffff;
    opacity: 0.95;
  }
  .fs-tree-icon-report {
    width: 15px;
    height: 15px;
    border: 1px solid #133752;
    border-radius: 2px;
    background: #133752;
    box-sizing: border-box;
    overflow: hidden;
  }
  .fs-tree-icon-report::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    right: 3px;
    bottom: 3px;
    background:
      linear-gradient(#ffffff, #ffffff) 0 0 / 100% 2px no-repeat,
      linear-gradient(to right, transparent 47%, #ffffff 47%, #ffffff 53%, transparent 53%),
      linear-gradient(to bottom, transparent 46%, #ffffff 46%, #ffffff 58%, transparent 58%, transparent 76%, #ffffff 76%, #ffffff 88%, transparent 88%);
  }
  .fs-tree-icon-library-formula,
  .fs-tree-icon-library-set {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c4cedb;
    border-radius: 2px;
    background: #f8fafc;
    color: #506077;
    box-sizing: border-box;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
  }
  .fs-tree-icon-library-formula::before {
    content: "\03A3";
  }
  .fs-tree-icon-library-set::before {
    content: "...";
    letter-spacing: 0;
    transform: translateY(-1px);
  }
  .fs-tree-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-tree-section-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-tree-deleted-timer {
    flex: 0 0 auto;
    margin-left: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    padding: 0.18rem 0.36rem;
    white-space: nowrap;
  }
  .fs-tree-locked-badge {
    flex: 0 0 auto;
    margin-left: 0.25rem;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    padding: 0.18rem 0.36rem;
    white-space: nowrap;
  }
  .fs-tree-published-badge {
    flex: 0 0 auto;
    margin-left: 0.25rem;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    padding: 0.18rem 0.36rem;
    white-space: nowrap;
  }
  .fs-report-tree-report .fs-tree-report-label {
    flex: 0 1 auto;
  }
  .fs-tree-menu-button {
    margin-left: auto;
    width: 1.35rem;
    height: 1.35rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #5f6b7a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
  }
  .fs-tree-menu-button:hover,
  .fs-tree-menu-button:focus-visible {
    background: #cfd8e3;
    color: #1f2937;
    outline: none;
  }
  .fs-report-tree-row.is-renaming .fs-tree-label {
    display: none;
  }
  .fs-tree-rename-input {
    min-width: 120px;
    width: min(320px, 100%);
    max-width: 100%;
    padding: 0.18rem 0.35rem;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    font: inherit;
    line-height: 1.2;
    color: #111827;
    background: #ffffff;
    outline: none;
  }
  .fs-tree-rename-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
  }
  .fs-report-context-menu {
    position: fixed;
    z-index: 3200;
    min-width: 165px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .fs-report-context-menu button {
    border: none;
    background: #ffffff;
    color: #1f2937;
    text-align: left;
    padding: 0.42rem 0.55rem;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
  }
  .fs-report-context-menu button:hover {
    background: #f3f4f6;
  }
  .fs-report-context-menu button.is-danger {
    color: #9f1239;
  }
  .fs-report-context-menu button.is-danger:hover {
    background: #fde7ef;
  }
  .fs-report-context-menu button[hidden] {
    display: none !important;
  }
  .fs-report-context-menu[hidden] {
    display: none !important;
  }
  .fs-report-conflict-dialog {
    position: fixed;
    inset: 0;
    z-index: 3300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.38);
    padding: 1rem;
  }
  .fs-report-conflict-dialog[hidden] {
    display: none !important;
  }
  .fs-report-conflict-panel {
    width: min(420px, 100%);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
    padding: 0.95rem;
  }
  .fs-report-conflict-title {
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }
  .fs-report-conflict-message {
    color: #4b5563;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
  }
  .fs-report-conflict-label {
    display: block;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.28rem;
  }
  .fs-report-conflict-input {
    width: 100%;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.52rem 0.6rem;
    font: inherit;
    box-sizing: border-box;
  }
  .fs-report-conflict-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.85rem;
  }
  .fs-report-conflict-replace {
    background: #1f2937;
    border-color: #1f2937;
    color: #ffffff;
  }
  .fs-context-hidden {
    display: none !important;
  }
  .fs-create-notice,
  .fs-create-empty {
    margin-top: 1rem;
    border-radius: 10px;
    padding: 0.8rem 0.95rem;
    max-width: 1060px;
  }
  .fs-create-notice {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
  }
  .fs-create-empty {
    background: #fff;
    border: 1px dashed #d1d5db;
    color: #4b5563;
  }
  .fs-report-alert-stack {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
  }
  .fs-report-alert {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
  }
  .fs-report-alert-warning {
    border-color: #fde68a;
    background: #fefce8;
    color: #92400e;
  }
  .fs-report-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .fs-report-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .fs-create-empty a {
    font-weight: 700;
    text-decoration: none;
  }
  .fs-create-layout {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }
  .fs-filter-bar {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.8rem;
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    max-width: 1160px;
  }
  .fs-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    flex: 0 1 168px;
    width: 168px;
    min-width: 140px;
    max-width: 220px;
  }
  .fs-filter-field:has(#fs-filter-dimension),
  .fs-filter-field:has(#fs-filter-dimension-value) {
    flex-basis: 220px;
    width: 220px;
    max-width: 260px;
  }
  .fs-filter-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
  }
  .fs-filter-native[hidden] {
    display: none !important;
  }
  .fs-multi-filter {
    position: relative;
    width: 100%;
    min-width: 0;
  }
  .fs-multi-filter-trigger {
    width: 100%;
    max-width: 100%;
    min-height: 2.2rem;
    text-align: left;
    padding: 0.45rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: #111827;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-multi-filter-trigger::after {
    content: "";
    float: right;
    margin-top: 0.45rem;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #6b7280;
  }
  .fs-multi-filter.is-open .fs-multi-filter-trigger {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
  }
  .fs-multi-filter-menu {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 0.3rem);
    left: 0;
    width: min(100%, 260px);
    min-width: min(100%, 180px);
    max-width: min(260px, calc(100vw - 2rem));
    max-height: 320px;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    overscroll-behavior: contain;
  }
  .fs-multi-filter-menu[hidden] {
    display: none !important;
  }
  .fs-multi-filter-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 0.35rem 0.45rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
  }
  .fs-multi-filter-controls button {
    border: 0;
    background: transparent;
    color: #2563eb;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.18rem 0.32rem;
    border-radius: 6px;
  }
  .fs-multi-filter-controls button:hover {
    background: #eff6ff;
  }
  .fs-multi-filter-options {
    overflow: auto;
    min-height: 0;
    overscroll-behavior: contain;
    padding: 0.3rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
  }
  .fs-multi-filter-option {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.28rem 0.36rem;
    border-radius: 6px;
    color: #111827;
    font-size: 0.8rem;
  }
  .fs-multi-filter-option:hover {
    background: #f1f5f9;
  }
  .fs-multi-filter-option input {
    margin: 0;
    width: 0.85rem;
    height: 0.85rem;
  }
  .fs-multi-filter-option-empty {
    color: #6b7280;
    font-size: 0.78rem;
    padding: 0.35rem;
  }
  .fs-multi-filter.is-disabled .fs-multi-filter-trigger {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #d1d5db;
  }
  .fs-create-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.8rem;
  }
  .fs-create-panel-wide {
    min-width: 0;
    min-height: min(680px, calc(100vh - var(--top-offset) - 5rem));
    display: flex;
    flex-direction: column;
  }
  .fs-mapped-lines-drawer {
    position: fixed;
    top: var(--top-offset);
    right: 0;
    bottom: 0;
    width: var(--fs-mapped-lines-width, min(780px, 62vw, calc(100vw - 1.4rem)));
    height: auto;
    z-index: 975;
    border-radius: 0;
    transform: translateX(115%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
    display: flex;
    flex-direction: column;
  }
  .fs-mapped-lines-resizer {
    position: absolute;
    left: -7px;
    top: 0;
    bottom: 0;
    width: 12px;
    border-radius: 0;
    cursor: ew-resize;
    background: transparent;
    z-index: 2;
  }
  .fs-mapped-lines-resizer::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    border-radius: 0;
    transform: translateX(-50%);
    background: #d7dee9;
  }
  .fs-mapped-lines-resizer:hover::before,
  .fs-mapped-lines-resizer:focus-visible::before {
    background: #3f6fb7;
  }
  body.fs-lines-drawer-open .fs-mapped-lines-drawer {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    border-radius: 0;
    box-shadow: none;
  }
  body.fs-lines-drawer-open .fs-create-panel-wide {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  body.fs-mapped-lines-resizing,
  body.fs-mapped-lines-resizing * {
    cursor: ew-resize !important;
    user-select: none !important;
  }
  .fs-query-builder-shell {
    --fs-query-pane-width: 336px;
    --fs-query-pane-min-width: 90px;
    --fs-source-pane-width: 420px;
    --fs-source-pane-min-width: 90px;
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 0.55rem;
    grid-template-columns:
      minmax(var(--fs-query-pane-min-width), var(--fs-query-pane-width))
      10px
      minmax(var(--fs-source-pane-min-width), var(--fs-source-pane-width));
  }
  .fs-query-tree-pane,
  .fs-source-tree-pane {
    border: 1px solid #d7dee9;
    border-radius: 6px;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 #ffffff;
    padding: 0.58rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .fs-query-pane-resizer {
    width: 10px;
    min-height: 0;
    align-self: stretch;
    border-radius: 999px;
    position: relative;
    cursor: col-resize;
    background: transparent;
  }
  .fs-query-pane-resizer::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    bottom: 0.7rem;
    left: 50%;
    width: 2px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #d2dceb 0%, #bcc9de 100%);
  }
  .fs-query-pane-resizer:hover::before,
  .fs-query-pane-resizer:focus-visible::before {
    background: linear-gradient(180deg, #7ea0d8 0%, #3f6fb7 100%);
  }
  .fs-query-tree-pane-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0 0 0.5rem 0;
    padding: 0 0.1rem 0.42rem 0.1rem;
    border-bottom: 1px solid #dfe5ef;
  }
  .fs-query-tree-pane-title {
    margin: 0;
    text-transform: none;
    font-size: 0.96rem;
    font-weight: 800;
    color: #1f2937;
  }
  .fs-query-tree-pane-hint {
    margin: 0;
    color: #5f6f87;
    font-size: 0.72rem;
    line-height: 1.3;
  }
  .fs-query-tree-pane-hint:empty {
    display: none;
  }
  .fs-query-tree-pane-hint.is-warning {
    color: #9a3412;
    font-weight: 700;
  }
  .fs-query-builder-shell.is-formula-mode .fs-query-tree-pane-title-row,
  .fs-query-builder-shell.is-formula-mode .fs-query-tree-sections,
  .fs-query-builder-shell.is-date-mode .fs-query-tree-pane-title-row,
  .fs-query-builder-shell.is-date-mode .fs-query-tree-sections {
    display: none;
  }
  body.fs-date-focus-active .fs-create-panel-wide,
  body.fs-date-focus-active .fs-filter-bar {
    opacity: 0.34;
    filter: grayscale(0.35);
    pointer-events: none;
    user-select: none;
  }
  body.fs-date-focus-active .fs-query-tree-pane {
    position: relative;
    z-index: 5;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  }
  body.fs-date-focus-active .fs-source-tree > .fs-source-tree-node:not([data-source-category="dates"]) {
    opacity: 0.24;
    filter: grayscale(0.65);
    pointer-events: none;
    user-select: none;
  }
  body.fs-date-focus-active .fs-source-tree > .fs-source-tree-node[data-source-category="dates"] {
    opacity: 1;
    filter: none;
    pointer-events: auto;
  }
  .fs-query-tree-sections {
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.12rem;
    scrollbar-gutter: stable;
  }
  .fs-query-tree-section {
    border: 1px solid #d5deea;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }
  .fs-query-tree-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.34rem 0.45rem;
    border-bottom: 1px solid #e4eaf3;
    background: #f3f6fa;
    cursor: context-menu;
  }
  .fs-query-tree-section-head h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: #1f2937;
  }
  .fs-query-tree-bucket {
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    padding: 0.5rem;
    margin: 0;
    min-height: 104px;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  }
  .fs-query-tree-bucket[data-empty="true"]::after {
    content: "No fields";
    position: absolute;
    inset: 0.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 5px;
    color: #8a97aa;
    font-size: 0.74rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  .fs-query-tree-bucket.is-drop-target {
    box-shadow: inset 0 0 0 2px rgba(79, 127, 198, 0.32);
    background: #eef4ff;
  }
  .fs-query-tree-bucket.is-contains-stack-target {
    border-color: #315f9f;
    box-shadow: 0 0 0 2px rgba(49, 95, 159, 0.2);
  }
  .fs-query-tree-drop-hint {
    margin-top: 0.16rem;
    font-size: 0.72rem;
    color: #5f6b7c;
  }
  .fs-query-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.14rem;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }
  .fs-query-tree-item {
    --fs-query-depth: 0;
    width: fit-content;
    min-width: 7.5rem;
    max-width: 100%;
    border: 1px solid #b7c1cf;
    background: #f2f5f9;
    border-radius: 4px;
    padding: 0.16rem 0.28rem;
    padding-left: calc(0.32rem + (var(--fs-query-depth) * 0.58rem));
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    color: #1f344f;
    font-size: 0.74rem;
    position: relative;
    cursor: grab;
  }
  .fs-query-tree-item.is-stacked {
    border-left-width: 3px;
    border-left-color: #5f7da8;
  }
  .fs-query-tree-item.is-stack-target {
    border-color: #315f9f;
    box-shadow: inset 0 0 0 2px rgba(49, 95, 159, 0.2);
    background: #dfeafb;
  }
  .fs-query-tree-item.is-dragging {
    opacity: 0.55;
  }
  .fs-query-tree-item:hover {
    border-color: #8da5c7;
    background: #eaf0f8;
  }
  .fs-query-tree-item.is-selected {
    border-color: #315f9f;
    background: #dfeafb;
    box-shadow: inset 0 0 0 1px rgba(49, 95, 159, 0.28);
  }
  .fs-query-tree-item.is-disabled {
    opacity: 0.56;
    cursor: not-allowed;
  }
  .fs-query-tree-item.is-locked {
    border-left-width: 3px;
    border-left-color: #7c8799;
    background: #e8ecf2;
  }
  .fs-query-tree-item-main {
    min-width: 0;
    flex: 0 1 auto;
    width: auto;
    display: flex;
    align-items: center;
    gap: 0.28rem;
  }
  .fs-query-tree-item-icon {
    min-width: 1.48rem;
    height: 1.08rem;
    padding: 0 0.18rem;
    border: 1px solid #c4cedb;
    border-radius: 3px;
    background: #f8fafc;
    color: #506077;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
  }
  .fs-query-tree-item[data-query-kind="set"] .fs-query-tree-item-icon {
    border-color: #b7c1cf;
    background: #f2f5f9;
    color: #394b66;
  }
  .fs-query-tree-item[data-query-kind="date"] .fs-query-tree-item-icon,
  .fs-query-tree-item[data-query-kind="slicer-date"] .fs-query-tree-item-icon {
    border-color: #c5cfdd;
    background: #f2f6fb;
    color: #52677f;
  }
  .fs-query-tree-item[data-query-kind="account"] .fs-query-tree-item-icon,
  .fs-query-tree-item[data-query-kind="calculation"] .fs-query-tree-item-icon {
    border-color: #d7c8b5;
    background: #fff7ed;
    color: #7b4a18;
  }
  .fs-query-tree-item[data-query-kind="dimension"] .fs-query-tree-item-icon {
    border-color: #d0c4e5;
    background: #f6f1ff;
    color: #7355a0;
  }
  .fs-query-tree-item[data-query-kind="company"] .fs-query-tree-item-icon {
    border-color: #b8d5cc;
    background: #eef8f4;
    color: #2f6f5f;
  }
  .fs-query-tree-item[data-query-kind="version"] .fs-query-tree-item-icon {
    border-color: #d8d1ab;
    background: #fbf8e6;
    color: #6f6625;
  }
  .fs-query-tree-item[data-query-kind="line"] .fs-query-tree-item-icon {
    border-color: #bac7e8;
    background: #eef4ff;
    color: #3559a6;
  }
  .fs-query-tree-item[data-query-kind="blank"] .fs-query-tree-item-icon {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #64748b;
  }
  .fs-query-tree-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
  }
  .fs-query-tree-item-formula {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.65rem;
    color: #394b66;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 9.5rem;
  }
  .fs-query-tree-item-filter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.1rem;
    width: 100%;
  }
  .fs-query-tree-item.is-slicer-control {
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }
  .fs-query-tree-item.is-slicer-control .fs-query-tree-item-main {
    gap: 0.28rem;
  }
  .fs-query-tree-item-filter.is-slicer-control {
    display: grid;
    grid-template-columns: minmax(64px, 0.42fr) minmax(120px, 1fr);
    align-items: center;
    gap: 0.36rem;
    border: 1px solid #d8e0ec;
    border-radius: 4px;
    background: #ffffff;
    padding: 0.3rem 0.36rem;
  }
  .fs-query-tree-filter-label {
    min-width: 0;
    color: #45556e;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-query-tree-filter-btn {
    max-width: 100%;
    border: 1px solid #bdc8d8;
    background: #f8fafc;
    color: #31425c;
    border-radius: 4px;
    padding: 0.16rem 0.34rem;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.15;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-query-tree-filter-btn::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #60718b;
    margin-right: 0.28rem;
    vertical-align: middle;
  }
  .fs-query-tree-filter-btn:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-query-tree-filter-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
  }
  .fs-query-tree-filter-select {
    width: 100%;
    max-width: 190px;
    min-width: 8.5rem;
    min-height: 1.55rem;
    border: 1px solid #bdc8d8;
    background: #f8fafc;
    color: #31425c;
    border-radius: 4px;
    padding: 0.16rem 0.34rem;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.15;
  }
  .fs-query-tree-item-filter.is-slicer-control .fs-query-tree-filter-select {
    max-width: none;
    min-width: 0;
    width: 100%;
  }
  .fs-query-tree-filter-select:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-query-tree-filter-select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
  }
  .fs-query-tree-item.is-formula {
    border-color: #b7c1cf;
    background: #f2f5f9;
    color: #1f344f;
  }
  .fs-query-tree-item.is-formula .fs-query-tree-item-meta {
    color: #5b6c84;
  }
  .fs-query-tree-item.is-formula .fs-query-tree-item-formula {
    color: #394b66;
  }
  .fs-query-tree-item.is-date {
    border-color: #8ca8c9;
    background: #e7eef7;
    color: #243d60;
  }
  .fs-query-tree-item.is-selected,
  .fs-query-tree-item.is-formula.is-selected,
  .fs-query-tree-item.is-date.is-selected {
    border-color: #315f9f;
    background: #dfeafb;
    color: #1f344f;
    box-shadow: inset 0 0 0 1px rgba(49, 95, 159, 0.28);
  }
  .fs-query-tree-item.is-date .fs-query-tree-item-summary {
    color: #315f9f;
  }
  .fs-query-tree-item-meta {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.64rem;
    color: #4f5f77;
  }
  .fs-query-tree-item-summary {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-left: 1px solid #c9d3e0;
    padding-left: 0.28rem;
    font-size: 0.64rem;
    color: #2f4f7c;
  }
  .fs-query-tree-item-badge {
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    color: #344054;
    border: 1px solid #c7d0dc;
    border-radius: 999px;
    background: #f8fafc;
    padding: 0.14rem 0.32rem;
    display: inline-flex;
    width: fit-content;
  }
  .fs-query-tree-sections,
  .fs-source-tree {
    scrollbar-width: thin;
    scrollbar-color: #c5cfdd transparent;
  }
  .fs-query-tree-sections::-webkit-scrollbar,
  .fs-source-tree::-webkit-scrollbar {
    width: 10px;
  }
  .fs-query-tree-sections::-webkit-scrollbar-thumb,
  .fs-source-tree::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c5cfdd;
    border: 2px solid transparent;
    background-clip: content-box;
  }
  .fs-query-tree-sections::-webkit-scrollbar-track,
  .fs-source-tree::-webkit-scrollbar-track {
    background: transparent;
  }
  .fs-query-formula-dialog {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .fs-query-formula-dialog[hidden] {
    display: none !important;
  }
  .fs-query-formula-panel {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
  }
  .fs-query-formula-title {
    margin: 0;
    font-size: 0.95rem;
    color: #1f344f;
    padding: 0 0.1rem 0.42rem 0.1rem;
    border-bottom: 1px solid #dfe5ef;
  }
  .fs-query-formula-field {
    display: grid;
    gap: 0.24rem;
    color: #4c5f78;
    font-size: 0.74rem;
    font-weight: 700;
  }
  .fs-query-formula-field input,
  .fs-query-formula-field textarea {
    width: 100%;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #f8fafc;
    color: #1f344f;
    font: inherit;
    font-weight: 500;
    padding: 0.42rem 0.5rem;
  }
  .fs-query-formula-field textarea {
    min-height: 9rem;
    flex: 1 1 auto;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
  }
  .fs-query-formula-field textarea.is-drop-target {
    border-color: #315f9f;
    background: #eef4ff;
    box-shadow: 0 0 0 2px rgba(49, 95, 159, 0.16);
  }
  .fs-query-set-dropzone {
    min-height: 10.5rem;
    max-height: 18rem;
    overflow: auto;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #f8fafc;
    padding: 0.46rem;
    display: grid;
    align-content: flex-start;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: 0.34rem;
  }
  .fs-query-set-dropzone.is-drop-target {
    border-color: #315f9f;
    background: #eef4ff;
    box-shadow: 0 0 0 2px rgba(49, 95, 159, 0.16);
  }
  .fs-query-set-empty {
    color: #667085;
    font-size: 0.75rem;
    font-weight: 600;
  }
  .fs-query-set-member {
    box-sizing: border-box;
    max-width: 100%;
    justify-self: start;
    min-height: 1.9rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f3f4f6;
    color: #111827;
    padding: 0.24rem 0.42rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.36rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .fs-query-set-member-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-query-set-member[data-query-kind="company"] .fs-query-tree-item-icon {
    border-color: #b8d5cc;
    background: #eef8f4;
    color: #2f6f5f;
  }
  .fs-query-set-member[data-query-kind="dimension"] .fs-query-tree-item-icon {
    border-color: #d0c4e5;
    background: #f6f1ff;
    color: #7355a0;
  }
  .fs-query-set-member[data-query-kind="account"] .fs-query-tree-item-icon,
  .fs-query-set-member[data-query-kind="calculation"] .fs-query-tree-item-icon {
    border-color: #d7c8b5;
    background: #fff7ed;
    color: #7b4a18;
  }
  .fs-query-set-member[data-query-kind="date"] .fs-query-tree-item-icon,
  .fs-query-set-member[data-query-kind="slicer-date"] .fs-query-tree-item-icon {
    border-color: #c5cfdd;
    background: #f2f6fb;
    color: #52677f;
  }
  .fs-query-set-member[data-query-kind="version"] .fs-query-tree-item-icon {
    border-color: #d8d1ab;
    background: #fbf8e6;
    color: #6f6625;
  }
  .fs-query-set-member[data-query-kind="line"] .fs-query-tree-item-icon {
    border-color: #bac7e8;
    background: #eef4ff;
    color: #3559a6;
  }
  .fs-query-formula-tools {
    display: grid;
    gap: 0.34rem;
  }
  .fs-query-formula-tool-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
  }
  .fs-query-formula-tool-row select,
  .fs-query-formula-tool-row button {
    min-height: 2rem;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #ffffff;
    color: #263852;
    font: inherit;
    font-size: 0.76rem;
  }
  .fs-query-formula-tool-row select {
    padding: 0.32rem 0.44rem;
  }
  .fs-query-formula-tool-row button {
    padding: 0.32rem 0.58rem;
    cursor: pointer;
  }
  .fs-query-formula-operator-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.28rem;
  }
  .fs-query-formula-operator-row button {
    min-height: 2rem;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #ffffff;
    color: #263852;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
  }
  .fs-query-formula-operator-row button:hover {
    background: #eef4ff;
    border-color: #8ea2c0;
  }
  .fs-query-formula-references {
    min-height: 0;
    border: 1px solid #d8e0ec;
    border-radius: 6px;
    background: #f8fafc;
    padding: 0.46rem;
    display: grid;
    gap: 0.36rem;
  }
  .fs-query-formula-reference-title {
    margin: 0;
    color: #344054;
    font-size: 0.74rem;
    font-weight: 800;
  }
  .fs-query-formula-reference-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    max-height: 8.5rem;
    overflow: auto;
  }
  .fs-query-formula-reference-btn {
    max-width: 100%;
    border: 1px solid #c2ccda;
    background: #ffffff;
    color: #25364d;
    border-radius: 4px;
    padding: 0.22rem 0.36rem;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: grab;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-query-formula-reference-btn:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-query-formula-reference-empty {
    color: #667085;
    font-size: 0.72rem;
  }
  .fs-query-formula-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: auto;
  }
  .fs-query-formula-actions button {
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #ffffff;
    color: #263852;
    padding: 0.36rem 0.68rem;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
  }
  .fs-query-formula-actions button[data-formula-action="save"] {
    border-color: #315f9f;
    background: #315f9f;
    color: #ffffff;
  }
  .fs-query-formula-actions button[data-formula-action="save"]:hover:not(:disabled),
  .fs-query-formula-actions button[data-formula-action="save"]:focus-visible:not(:disabled) {
    border-color: #244a82;
    background: #244a82;
    color: #ffffff;
  }
  .fs-query-formula-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
  }
  .fs-query-date-dialog {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
  }
  .fs-query-date-dialog[hidden] {
    display: none !important;
  }
  .fs-query-date-panel {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 #ffffff;
    padding: 0.68rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }
  .fs-query-date-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
    padding-bottom: 0.42rem;
    border-bottom: 1px solid #dfe5ef;
  }
  .fs-query-date-title-display {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-self: start;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    gap: 0.25rem;
  }
  .fs-query-date-title-display[hidden] {
    display: none !important;
  }
  .fs-query-date-title {
    margin: 0;
    font-size: 0.98rem;
    color: #1f344f;
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 1.7rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-query-date-title-edit {
    flex: 0 0 1.45rem;
    width: 1.45rem;
    height: 1.45rem;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: #52647c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: none !important;
    appearance: none;
  }
  .fs-query-date-title-edit:hover {
    color: #1f4f8f;
    background: transparent !important;
  }
  .fs-query-date-title-field {
    grid-column: 1 / 2;
    grid-row: 1;
    min-width: 0;
  }
  .fs-query-date-title-field input {
    min-height: 1.85rem;
  }
  .fs-query-date-title-edit-actions {
    grid-column: 2 / 3;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
  }
  .fs-query-date-title-edit-actions[hidden] {
    display: none !important;
  }
  .fs-query-date-title-action {
    width: 1.55rem;
    height: 1.55rem;
    border: 1px solid #bcc8d8;
    border-radius: 5px;
    background: #ffffff;
    color: #263852;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }
  .fs-query-date-title-action:hover {
    border-color: #315f9f;
    background: #eef4ff;
  }
  .fs-query-date-target {
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #3f526d;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.25;
    padding: 0.42rem 0.5rem;
  }
  .fs-query-date-section {
    display: grid;
    gap: 0.42rem;
  }
  .fs-query-date-section[hidden] {
    display: none !important;
  }
  .fs-query-date-section-title {
    color: #344054;
    font-size: 0.74rem;
    font-weight: 800;
  }
  .fs-query-date-options {
    display: grid;
    gap: 0.4rem;
  }
  .fs-query-date-option {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #f8fafc;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.48rem;
    align-items: start;
    cursor: pointer;
  }
  .fs-query-date-option:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-query-date-option:has(input:checked) {
    border-color: #315f9f;
    background: #e9f1ff;
    box-shadow: inset 0 0 0 1px rgba(49, 95, 159, 0.18);
  }
  .fs-query-date-option input {
    margin-top: 0.15rem;
  }
  .fs-query-date-option-copy {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
  }
  .fs-query-date-option-copy strong {
    color: #25364d;
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .fs-query-date-option-copy small {
    color: #5f6f87;
    font-size: 0.68rem;
    line-height: 1.25;
  }
  .fs-query-date-fields {
    display: grid;
    gap: 0.48rem;
  }
  .fs-query-date-fields[hidden] {
    display: none !important;
  }
  .fs-query-date-endpoints {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.62rem;
    min-width: 0;
  }
  .fs-query-date-endpoint {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid #d5deea;
    border-radius: 6px;
    background: #ffffff;
    padding: 0;
    min-height: 112px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    cursor: default;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  }
  .fs-query-date-endpoint:hover,
  .fs-query-date-endpoint.is-active,
  .fs-query-date-endpoint.is-drop-target {
    border-color: #315f9f;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(49, 95, 159, 0.12);
  }
  .fs-query-date-endpoint.is-disabled {
    border-color: #d8dee8;
    background: #f1f4f8;
    box-shadow: none;
    color: #7b8797;
  }
  .fs-query-date-endpoint.is-disabled:hover {
    border-color: #d8dee8;
    background: #f1f4f8;
    box-shadow: none;
  }
  .fs-query-date-endpoint-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.34rem 0.45rem;
    border-bottom: 1px solid #e4eaf3;
    background: #f3f6fa;
  }
  .fs-query-date-endpoint-title {
    margin: 0;
    color: #1f344f;
    font-size: 0.82rem;
    font-weight: 800;
  }
  .fs-query-date-endpoint-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    min-width: 0;
  }
  .fs-query-date-endpoint-meta {
    min-width: 0;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #5b6b82;
    font-size: 0.64rem;
    font-weight: 700;
  }
  .fs-query-date-endpoint-meta:empty {
    display: none;
  }
  .fs-query-date-endpoint-toggle {
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid #b7c4d6;
    border-radius: 4px;
    background: #ffffff;
    color: #33455f;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }
  .fs-query-date-endpoint-toggle:hover {
    border-color: #315f9f;
    color: #1f4f8f;
    background: #eef4ff;
  }
  .fs-query-date-endpoint.is-disabled .fs-query-date-endpoint-bucket {
    background: #eef2f7;
  }
  .fs-query-date-endpoint.is-disabled .fs-query-date-endpoint-item {
    border-color: #c8d1de;
    background: #e1e6ee;
    color: #667085;
  }
  .fs-query-date-endpoint-bucket {
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    padding: 0.5rem;
    margin: 0;
    min-height: 78px;
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
  }
  .fs-query-date-endpoint-bucket[data-empty="true"]::after {
    content: "Drop a date or option";
    position: absolute;
    inset: 0.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 5px;
    color: #8a97aa;
    font-size: 0.74rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  .fs-query-date-endpoint-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
  }
  .fs-query-date-endpoint-item {
    --fs-query-depth: 0;
    border: 1px solid #8ca8c9;
    background: #e7eef7;
    border-radius: 4px;
    padding: 0.16rem 0.28rem;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    color: #243d60;
    font-size: 0.74rem;
    position: relative;
    min-width: 0;
  }
  .fs-query-date-endpoint-item .fs-query-tree-item-main {
    min-width: 0;
    flex: 1 1 auto;
  }
  .fs-query-date-endpoint-lag {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    flex: 0 0 auto;
    color: #52647c;
    font-size: 0.68rem;
    font-weight: 800;
  }
  .fs-query-date-endpoint-lag input {
    box-sizing: border-box;
    width: 3rem;
    min-height: 1.45rem;
    border: 1px solid #b8c7d9;
    border-radius: 4px;
    background: #ffffff;
    color: #243954;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.1rem 0.25rem;
  }
  .fs-query-date-endpoint-lag input:focus {
    outline: 2px solid rgba(49, 95, 159, 0.2);
    outline-offset: 1px;
  }
  .fs-query-date-endpoint-remove {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #53657d;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }
  .fs-query-date-endpoint-remove:hover {
    border-color: #b8c7d9;
    background: #ffffff;
    color: #9f1d1d;
  }
  .fs-query-date-option-tray {
    border: 1px solid #d8e0ec;
    border-radius: 7px;
    background: #f8fafc;
    padding: 0.56rem;
    display: grid;
    gap: 0.5rem;
  }
  .fs-query-date-option-tray-title {
    color: #344054;
    font-size: 0.74rem;
    font-weight: 800;
  }
  .fs-query-date-manual-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: end;
  }
  .fs-query-date-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem;
    align-items: center;
  }
  .fs-query-date-chip {
    min-height: 2.1rem;
    max-width: 100%;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #ffffff;
    color: #243954;
    padding: 0.34rem 0.56rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: grab;
    white-space: nowrap;
  }
  .fs-query-date-chip:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-query-date-chip:active {
    cursor: grabbing;
  }
  .fs-query-date-lag-control {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
  }
  .fs-query-date-lag-control .fs-query-date-chip {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .fs-query-date-lag-control input {
    box-sizing: border-box;
    width: 3.8rem;
    min-height: 2.1rem;
    border: 1px solid #bcc8d8;
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: #ffffff;
    color: #243954;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 0.32rem 0.38rem;
  }
  .fs-query-date-lag-control input:focus {
    outline: 2px solid rgba(49, 95, 159, 0.2);
    outline-offset: 1px;
  }
  .fs-query-date-field {
    display: grid;
    gap: 0.24rem;
    color: #4c5f78;
    font-size: 0.74rem;
    font-weight: 700;
  }
  .fs-query-date-field input,
  .fs-query-date-field select {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.1rem;
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #f8fafc;
    color: #1f344f;
    font: inherit;
    font-weight: 500;
    padding: 0.38rem 0.5rem;
  }
  .fs-query-date-field[hidden] {
    display: none !important;
  }
  @media (max-width: 760px) {
    .fs-query-date-manual-row {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  .fs-query-date-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: auto;
  }
  .fs-query-date-actions button {
    border: 1px solid #bcc8d8;
    border-radius: 6px;
    background: #ffffff;
    color: #263852;
    padding: 0.36rem 0.68rem;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
  }
  .fs-query-date-actions button[data-date-action="clear"] {
    color: #b42318;
  }
  .fs-query-date-actions button[data-date-action="save"] {
    border-color: #315f9f;
    background: #315f9f;
    color: #ffffff;
  }
  .fs-query-context-menu {
    position: fixed;
    z-index: 3200;
    min-width: 170px;
    border: 1px solid #ced8e8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
    padding: 0.28rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
  .fs-query-context-menu[hidden] {
    display: none !important;
  }
  .fs-query-context-menu button {
    border: 0;
    background: transparent;
    text-align: left;
    color: #1f2937;
    border-radius: 6px;
    padding: 0.44rem 0.52rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }
  .fs-query-context-menu button[hidden] {
    display: none;
  }
  .fs-query-context-menu button:hover {
    background: #f2f6fd;
  }
  .fs-query-context-menu button.is-label,
  .fs-query-context-menu button.is-label:hover {
    background: transparent;
    color: #64748b;
    cursor: default;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    padding-bottom: 0.2rem;
    text-transform: uppercase;
  }
  .fs-query-context-menu button.is-danger {
    color: #b42318;
  }
  .fs-query-context-menu button.is-danger:hover {
    background: #fff1ef;
  }
  .fs-source-tree-headline {
    border-bottom: 1px solid #dfe5ef;
    padding: 0.22rem 0.12rem 0.34rem;
    display: flex;
    align-items: center;
  }
  .fs-source-tree-headline-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
  }
  .fs-source-tree-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.42rem 0 0.4rem 0;
  }
  .fs-source-tree-search {
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid #ced6e2;
    border-radius: 7px;
    padding: 0.33rem 0.48rem;
    font: inherit;
    font-size: 0.8rem;
    background: #fff;
  }
  .fs-source-tree-search:focus {
    outline: none;
    border-color: #2f6fdf;
    box-shadow: 0 0 0 2px rgba(47, 111, 223, 0.15);
  }
  .fs-source-tree-wrap {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid #dce3ef;
    border-radius: 7px;
    background: #fff;
    display: flex;
    flex-direction: column;
  }
  .fs-source-tree {
    flex: 1 1 auto;
    max-height: none;
    overflow: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 0.2rem 0.2rem 0.24rem 0.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
  }
  .fs-source-tree-node {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .fs-source-node-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.18rem 0.22rem;
    border-radius: 4px;
  }
  .fs-source-node-row:hover {
    background: #f4f6fa;
  }
  .fs-source-node-row.is-selected,
  .fs-source-item.is-selected {
    background: #e6eefc;
    box-shadow: inset 0 0 0 1px #8eaadc;
  }
  .fs-source-node-row:focus-visible,
  .fs-source-item:focus-visible {
    outline: 2px solid #7ea0d8;
    outline-offset: 1px;
  }
  .fs-source-node-row.is-group {
    background: transparent;
  }
  .fs-source-node-row.is-group.is-selected {
    background: #e6eefc;
  }
  .fs-source-node-row.is-draggable {
    cursor: grab;
  }
  .fs-source-node-row.is-draggable:active {
    cursor: grabbing;
  }
  .fs-source-node-main {
    min-width: 0;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
  }
  .fs-source-node-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    width: 0.8rem;
    height: 0.8rem;
    position: relative;
    cursor: pointer;
  }
  .fs-source-node-toggle::before {
    content: "";
    position: absolute;
    top: 0.13rem;
    left: 0.12rem;
    width: 0.35rem;
    height: 0.35rem;
    border-right: 2px solid #6f7f98;
    border-bottom: 2px solid #6f7f98;
    transform: rotate(45deg);
    transition: transform 0.12s ease;
  }
  .fs-source-tree-node.is-collapsed > .fs-source-node-row .fs-source-node-toggle::before {
    transform: rotate(-45deg);
    top: 0.19rem;
  }
  .fs-source-node-toggle[disabled] {
    visibility: hidden;
    pointer-events: none;
  }
  .fs-source-node-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: #293647;
    font-weight: 700;
  }
  .fs-source-node-count {
    border-radius: 999px;
    background: #edf2f8;
    color: #60718b;
    font-size: 0.66rem;
    line-height: 1;
    padding: 0.18rem 0.36rem;
    min-width: 1.1rem;
    text-align: center;
  }
  .fs-source-node-children {
    border-top: 0;
    padding: 0 0 0 0.86rem;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
  }
  .fs-source-tree-node.is-collapsed > .fs-source-node-children {
    display: none;
  }
  .fs-source-item {
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 0.18rem 0.22rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.32rem;
    min-width: 0;
  }
  .fs-source-item:hover {
    background: #f5f8fc;
  }
  .fs-source-item[draggable="true"],
  .fs-source-item.is-draggable {
    cursor: grab;
  }
  .fs-source-item.is-draggable:active {
    cursor: grabbing;
  }
  .fs-source-item.is-mapped-line {
    background: #f2f6ff;
  }
  .fs-source-item.is-in-layout {
    opacity: 0.52;
  }
  .fs-source-item.is-disabled {
    color: #7b8797;
    cursor: default;
    opacity: 0.78;
  }
  .fs-source-show-more {
    border: 0;
    background: transparent;
    color: #49617f;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.24rem 0.22rem 0.24rem 1.04rem;
    text-align: left;
  }
  .fs-source-show-more:hover,
  .fs-source-show-more:focus-visible {
    background: #f4f6fa;
    border-radius: 4px;
    outline: none;
  }
  .fs-source-item-label {
    min-width: 0;
    font-size: 0.76rem;
    color: #334256;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0;
  }
  .fs-source-tree-search-hit {
    border-radius: 2px;
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
  }
  .fs-source-item-label::before {
    content: "â€¢";
    color: #7b8aa0;
    font-size: 0.74rem;
    width: 0.55rem;
    display: inline-block;
    text-align: center;
  }
  .fs-source-item[data-source-type="mapped-line"] .fs-source-item-label::before {
    content: "âˆ‘";
    color: #3559a6;
  }
  .fs-source-item[data-source-type="consolidated-account"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="local-account"] .fs-source-item-label::before {
    content: "Â¤";
    color: #3b546f;
  }
  .fs-source-item[data-source-type="company"] .fs-source-item-label::before {
    content: "â—‰";
    color: #3b7c6a;
  }
  .fs-source-item[data-source-type="dimension"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="dimension-value"] .fs-source-item-label::before {
    content: "â—‡";
    color: #7a5fa8;
  }
  .fs-source-item[data-source-type="statement-version"] .fs-source-item-label::before {
    content: "â‰¡";
    color: #6e6b32;
  }
  .fs-source-item[data-source-type="calendar"] .fs-source-item-label::before {
    content: "â—·";
    color: #5a6e89;
  }
  .fs-source-item[data-source-type="version-type"] .fs-source-item-label::before {
    content: "T";
    color: #5a6e89;
  }
  .fs-source-item[data-source-type="mapped-line-hierarchy"] .fs-source-item-label::before {
    content: "R";
    color: #3559a6;
  }
  .fs-source-item[data-source-type="company-hierarchy"] .fs-source-item-label::before {
    content: "C";
    color: #3b7c6a;
  }
  .fs-source-item[data-source-type="dimension-hierarchy"] .fs-source-item-label::before {
    content: "D";
    color: #7a5fa8;
  }
  .fs-source-item[data-source-type="year-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="month-hierarchy"] .fs-source-item-label::before {
    content: "T";
    color: #5a6e89;
  }
  .fs-source-item-label::before,
  .fs-source-node-row[data-source-type] .fs-source-node-label::before {
    color: #617089;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    width: 1rem;
    height: 1rem;
    border: 1px solid #c4cedb;
    border-radius: 3px;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .fs-source-node-row[data-source-type] .fs-source-node-label::before {
    content: "";
    margin-right: 0.3rem;
    vertical-align: text-bottom;
  }
  .fs-source-item[data-source-type="mapped-line"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="mapped-line-hierarchy"] .fs-source-node-label::before {
    content: "R";
    color: #3559a6;
    border-color: #bac7e8;
    background: #eef4ff;
  }
  .fs-source-item[data-source-type="consolidated-account"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="local-account"] .fs-source-item-label::before {
    content: "$";
    color: #3b546f;
  }
  .fs-source-item[data-source-type="company"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="company-hierarchy"] .fs-source-node-label::before {
    content: "C";
    color: #3b7c6a;
    border-color: #b8d5cc;
    background: #eef8f4;
  }
  .fs-source-item[data-source-type="dimension"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="dimension-value"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="dimension-hierarchy"] .fs-source-node-label::before {
    content: "D";
    color: #7a5fa8;
    border-color: #d0c4e5;
    background: #f6f1ff;
  }
  .fs-source-item[data-source-type="statement-version"] .fs-source-item-label::before {
    content: "S";
    color: #6e6b32;
  }
  .fs-source-item[data-source-type="calendar"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="year-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="month-hierarchy"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="year-hierarchy"] .fs-source-node-label::before,
  .fs-source-node-row[data-source-type="month-hierarchy"] .fs-source-node-label::before {
    content: "Dt";
    color: #5a6e89;
    border-color: #c5cfdd;
    background: #f2f6fb;
  }
  .fs-source-item-label::before,
  .fs-source-node-row[data-source-type] .fs-source-node-label::before {
    content: none !important;
    display: none !important;
  }
  .fs-source-item[data-source-type] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type] .fs-source-node-label::before {
    content: "It" !important;
    display: inline-flex !important;
    color: #617089;
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1;
    width: 1.48rem;
    height: 1.08rem;
    border: 1px solid #c4cedb;
    border-radius: 3px;
    background: #f8fafc;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-right: 0.28rem;
    letter-spacing: 0;
  }
  .fs-source-item[data-source-type="mapped-line"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="mapped-line-hierarchy"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="mapped-line-hierarchy"] .fs-source-node-label::before {
    content: "Ln" !important;
    color: #3559a6;
    border-color: #bac7e8;
    background: #eef4ff;
  }
  .fs-source-item[data-source-type="consolidated-account"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="consolidated-account-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="local-account"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="local-account-hierarchy"] .fs-source-item-label::before {
    content: "Ac" !important;
    color: #7b4a18;
    border-color: #d7c8b5;
    background: #fff7ed;
  }
  .fs-source-item[data-source-type="financial-calculation"] .fs-source-item-label::before {
    content: "Calc" !important;
    color: #7b4a18;
    border-color: #d7c8b5;
    background: #fff7ed;
  }
  .fs-source-item[data-source-type="custom-formula"] .fs-source-item-label::before {
    content: "Fx" !important;
    color: #2e57a3;
    border-color: #b8c9ec;
    background: #eef4ff;
  }
  .fs-source-item[data-source-type="time-window"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="calendar"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="calendar-period"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="calendar-period-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="calendar-quarter"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="calendar-quarter-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="year-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="month-hierarchy"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="year-hierarchy"] .fs-source-node-label::before,
  .fs-source-node-row[data-source-type="month-hierarchy"] .fs-source-node-label::before {
    content: "Dt" !important;
    color: #52677f;
    border-color: #c5cfdd;
    background: #f2f6fb;
  }
  .fs-source-item[data-source-type="company"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="company-hierarchy"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="company-hierarchy"] .fs-source-node-label::before {
    content: "Co" !important;
    color: #2f6f5f;
    border-color: #b8d5cc;
    background: #eef8f4;
  }
  .fs-source-item[data-source-type="dimension"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="dimension-value"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="dimension-hierarchy"] .fs-source-item-label::before,
  .fs-source-node-row[data-source-type="dimension-hierarchy"] .fs-source-node-label::before {
    content: "Dim" !important;
    color: #7355a0;
    border-color: #d0c4e5;
    background: #f6f1ff;
  }
  .fs-source-item[data-source-type="statement-version"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="trial-balance-version"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="trial-balance-hierarchy"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="version-type"] .fs-source-item-label::before,
  .fs-source-item[data-source-type="forecast-version"] .fs-source-item-label::before {
    content: "Ver" !important;
    color: #6f6625;
    border-color: #d8d1ab;
    background: #fbf8e6;
  }
  .fs-source-item-action {
    border: 1px solid #c6d4e8;
    background: #fff;
    color: #3f5476;
    border-radius: 5px;
    font-size: 0.66rem;
    line-height: 1;
    font-weight: 700;
    padding: 0.16rem 0.3rem;
    cursor: pointer;
  }
  .fs-source-item-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .fs-source-drag-ghost {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    max-width: 260px;
    pointer-events: none;
    border: 1px solid #9fb4d2;
    border-radius: 5px;
    background: #ffffff;
    color: #24364d;
    box-shadow: 0 10px 24px rgba(34, 52, 76, 0.18);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.32rem 0.44rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-source-pointer-dragging {
    user-select: none;
  }
  .fs-source-empty {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 0.78rem;
    color: #6b7280;
    text-align: center;
    background: #fff;
  }
  .fs-grid-drop-target {
    outline: 2px dashed #2f6fdf;
    outline-offset: -2px;
  }
  body.fs-query-resizing,
  body.fs-query-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .fs-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  .fs-calc-btn {
    margin: 0;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .fs-calc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  .fs-clear-btn {
    margin: 0;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .fs-clear-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  .fs-report-slicers {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0 0 0.55rem 0;
    padding: 0.55rem;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    background: #f8fafc;
  }
  .fs-report-slicers[hidden] {
    display: none;
  }
  .fs-report-slicer-control {
    flex: 0 1 220px;
    width: min(100%, 220px);
    min-width: min(100%, 150px);
    max-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .fs-report-slicer-label {
    color: #374151;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fs-report-slicer-native[hidden] {
    display: none !important;
  }
  .fs-report-slicer-control .fs-multi-filter-trigger {
    min-height: 2rem;
    padding: 0.32rem 0.55rem;
    border-color: #bdc8d8;
    border-radius: 6px;
    font-size: 0.78rem;
  }
  .fs-report-slicer-control .fs-multi-filter-trigger:hover {
    border-color: #8ea2c0;
    background: #eef4ff;
  }
  .fs-report-slicer-control .fs-multi-filter-menu {
    width: min(100%, 240px);
    max-width: min(240px, calc(100vw - 2rem));
  }
  .fs-builder-wrap {
    margin-top: 0;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    flex: 1 1 auto;
    height: min(620px, calc(100vh - var(--top-offset) - 8rem));
    min-height: 420px;
    background: #fff;
  }
  #fs-builder-hot {
    min-height: 420px;
    height: 100%;
  }
  .fs-builder-note {
    margin: 0.55rem 0 0 0;
  }
  .handsontable .fs-hot-readonly {
    background: #f9fafb;
    color: #374151;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .handsontable .fs-hot-loading {
    background: #f8fafc !important;
    color: #64748b !important;
    font-style: italic;
    text-align: left !important;
  }
  .handsontable .fs-hot-action {
    color: #b91c1c;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
  }
  .handsontable th.fs-report-header-format-target {
    box-shadow: inset 0 0 0 2px #315f9f !important;
    background-color: #dfeafb !important;
  }
  .fs-excel-format-toolbar {
    position: fixed;
    z-index: 4600;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: max-content;
    min-width: 340px;
    max-width: min(560px, calc(100vw - 16px));
    padding: 5px 6px;
    border: 1px solid #a9b2bf;
    border-radius: 4px;
    background: #f7f8fa;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2);
    color: #1f2937;
    font-family: var(--app-font-family);
    font-size: 12px;
    line-height: 1.2;
  }
  .fs-excel-format-toolbar[hidden] {
    display: none !important;
  }
  .fs-excel-toolbar-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 26px;
  }
  .fs-excel-toolbar-row-secondary {
    padding-top: 3px;
    border-top: 1px solid #d7dce3;
  }
  .fs-excel-format-toolbar select {
    height: 24px;
    min-width: 58px;
    max-width: 150px;
    border: 1px solid #b7c0cc;
    border-radius: 2px;
    background: #ffffff;
    color: #111827;
    padding: 0 22px 0 6px;
    font: inherit;
  }
  .fs-excel-format-toolbar #fs-mini-font-family {
    width: 132px;
  }
  .fs-excel-format-toolbar #fs-mini-font-size {
    width: 54px;
    padding-right: 16px;
  }
  .fs-excel-format-toolbar #fs-mini-number-format {
    width: 96px;
  }
  .fs-excel-format-toolbar button,
  .fs-excel-color-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 24px;
    min-width: 26px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: #1f2937;
    padding: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .fs-excel-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
  }
  .fs-excel-format-toolbar button:hover,
  .fs-excel-color-button:hover,
  .fs-excel-format-toolbar button.is-active {
    border-color: #8fb6e8;
    background: #e9f3ff;
  }
  .fs-excel-format-toolbar button:focus-visible,
  .fs-excel-color-button:focus-within,
  .fs-excel-format-toolbar select:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
  }
  .fs-excel-toolbar-separator {
    width: 1px;
    height: 20px;
    margin: 0 2px;
    background: #c8cdd4;
  }
  .fs-excel-underline {
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .fs-excel-fill-icon,
  .fs-excel-text-icon,
  .fs-excel-border-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }
  .fs-excel-fill-icon::before {
    content: "";
    width: 13px;
    height: 9px;
    border: 1px solid #4b5563;
    border-bottom: 4px solid var(--fs-active-color, #facc15);
    background: #ffffff;
    transform: skew(-10deg);
  }
  .fs-excel-text-icon {
    font-size: 14px;
    font-weight: 700;
  }
  .fs-excel-text-icon::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 1px;
    height: 3px;
    background: var(--fs-active-color, #111827);
  }
  .fs-excel-border-icon::before {
    content: "";
    width: 15px;
    height: 12px;
    border: 1px solid #9ca3af;
    background:
      linear-gradient(#d1d5db, #d1d5db) 50% 50% / 1px 100% no-repeat,
      linear-gradient(#d1d5db, #d1d5db) 50% 50% / 100% 1px no-repeat;
  }
  .fs-excel-border-button {
    width: 34px !important;
    min-width: 34px !important;
    gap: 2px;
  }
  .fs-excel-caret {
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #374151;
  }
  .fs-mini-border-menu {
    position: absolute;
    top: 27px;
    left: 247px;
    z-index: 4720;
    display: grid;
    gap: 1px;
    min-width: 172px;
    padding: 4px;
    border: 1px solid #a9b2bf;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
  }
  .fs-mini-border-menu[hidden] {
    display: none !important;
  }
  .fs-mini-border-menu button {
    justify-content: flex-start;
    width: 100%;
    height: 26px;
    border: 0;
    border-radius: 2px;
    gap: 8px;
    padding: 0 8px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-weight: 500;
  }
  .fs-mini-border-menu button:hover {
    background: #e9f3ff;
  }
  .fs-border-menu-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    background:
      linear-gradient(#e5e7eb, #e5e7eb) 50% 50% / 1px 100% no-repeat,
      linear-gradient(#e5e7eb, #e5e7eb) 50% 50% / 100% 1px no-repeat,
      #ffffff;
  }
  .fs-border-menu-none::before,
  .fs-border-menu-all::before,
  .fs-border-menu-outside::before,
  .fs-border-menu-top::before,
  .fs-border-menu-bottom::before,
  .fs-border-menu-left::before,
  .fs-border-menu-right::before,
  .fs-border-menu-horizontal::before,
  .fs-border-menu-vertical::before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
  }
  .fs-border-menu-none {
    border-color: #e5e7eb;
    background: #ffffff;
  }
  .fs-border-menu-all::before,
  .fs-border-menu-outside::before {
    border: 2px solid #111827;
  }
  .fs-border-menu-top::before {
    border-top: 2px solid #111827;
  }
  .fs-border-menu-bottom::before {
    border-bottom: 2px solid #111827;
  }
  .fs-border-menu-left::before {
    border-left: 2px solid #111827;
  }
  .fs-border-menu-right::before {
    border-right: 2px solid #111827;
  }
  .fs-border-menu-horizontal::before {
    border-top: 2px solid #111827;
    border-bottom: 2px solid #111827;
  }
  .fs-border-menu-vertical::before {
    border-left: 2px solid #111827;
    border-right: 2px solid #111827;
  }
  .fs-excel-border-top::after,
  .fs-excel-border-bottom::after {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    height: 2px;
    background: #111827;
  }
  .fs-excel-border-top::after {
    top: 2px;
  }
  .fs-excel-border-bottom::after {
    bottom: 2px;
  }
  .fs-excel-format-toolbar [data-format-action="decimals-less"],
  .fs-excel-format-toolbar [data-format-action="decimals-more"] {
    width: 42px;
    min-width: 42px;
    flex-direction: column;
    gap: 0;
    line-height: 1;
    font-size: 11px;
  }
  .fs-excel-format-toolbar [data-format-action="more"] {
    width: 30px;
    min-width: 30px;
    font-size: 13px;
  }
  .fs-decimal-main {
    display: block;
    font-size: 10px;
    font-weight: 700;
  }
  .fs-decimal-arrow {
    position: relative;
    display: block;
    width: 16px;
    height: 6px;
  }
  .fs-decimal-arrow::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 3px;
    right: 3px;
    height: 1px;
    background: #2563eb;
  }
  .fs-decimal-arrow-left::after,
  .fs-decimal-arrow-right::after {
    content: "";
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
  }
  .fs-decimal-arrow-left::after {
    left: 1px;
    border-right: 5px solid #2563eb;
  }
  .fs-decimal-arrow-right::after {
    right: 1px;
    border-left: 5px solid #2563eb;
  }
  .fs-mini-scope-toggle {
    display: inline-flex;
    align-items: center;
    height: 24px;
    border: 1px solid #b7c0cc;
    border-radius: 3px;
    overflow: hidden;
    background: #ffffff;
  }
  .fs-mini-scope-toggle button {
    width: auto;
    min-width: 48px;
    height: 22px;
    border: 0;
    border-radius: 0;
    border-right: 1px solid #d7dce3;
    background: #ffffff;
    color: #374151;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
  }
  .fs-mini-scope-toggle button:last-child {
    border-right: 0;
  }
  .fs-mini-scope-toggle button.is-active {
    background: #dbeafe;
    color: #1d4ed8;
  }
  .fs-format-color-palette {
    position: fixed;
    z-index: 4700;
    display: grid;
    grid-template-columns: repeat(5, 22px);
    gap: 4px;
    width: max-content;
    padding: 7px;
    border: 1px solid #a9b2bf;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
  }
  .fs-format-color-palette[hidden] {
    display: none !important;
  }
  .fs-format-color-default {
    grid-column: 1 / -1;
    height: 24px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background: #f8fafc;
    color: #111827;
    font-family: var(--app-font-family);
    font-size: 12px;
    cursor: pointer;
  }
  .fs-format-color-swatch-btn {
    width: 22px;
    height: 22px;
    border: 1px solid #9ca3af;
    border-radius: 2px;
    background: var(--swatch-color);
    cursor: pointer;
  }
  .fs-format-color-default:hover,
  .fs-format-color-swatch-btn:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
  }
  .htContextMenu {
    z-index: 4500 !important;
    font-family: var(--app-font-family) !important;
    font-size: 12px !important;
  }
  .htContextMenu .ht_master .wtHolder {
    border: 1px solid #a9b2bf;
    border-radius: 4px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
    overflow: hidden;
  }
  .htContextMenu .htCore {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #ffffff !important;
  }
  .htContextMenu .htCore td {
    height: 24px !important;
    border: 0 !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    padding: 0 26px 0 28px !important;
    font-family: var(--app-font-family) !important;
    font-size: 12px !important;
    line-height: 24px !important;
    white-space: nowrap;
  }
  .htContextMenu .htCore td.current,
  .htContextMenu .htCore td.area,
  .htContextMenu .htCore td:hover {
    background: #dbeafe !important;
    color: #111827 !important;
  }
  .htContextMenu .htSeparator,
  .htContextMenu .htCore td.htSeparator {
    height: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    border-top: 1px solid #d4d8df !important;
    background: #ffffff !important;
  }
  .fs-format-dialog {
    position: fixed;
    inset: 0;
    z-index: 3600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.38);
  }
  .fs-format-dialog[hidden] {
    display: none !important;
  }
  .fs-format-panel {
    width: min(920px, 96vw);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  }
  .fs-format-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
  }
  .fs-format-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
  }
  .fs-format-subtitle {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.8rem;
  }
  .fs-format-close {
    border: none;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }
  .fs-drilldown-dialog {
    position: fixed;
    inset: 0;
    z-index: 3650;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.38);
  }
  .fs-drilldown-dialog[hidden] {
    display: none !important;
  }
  .fs-drilldown-panel {
    width: min(1280px, 98vw);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  }
  .fs-drilldown-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
  }
  .fs-drilldown-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
  }
  .fs-drilldown-subtitle {
    margin-top: 0.22rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
  }
  .fs-drilldown-close {
    border: none;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }
  .fs-drilldown-body {
    overflow: auto;
    padding: 1rem;
  }
  .fs-drilldown-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.9rem;
  }
  .fs-drilldown-summary-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.55rem 0.65rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
  }
  .fs-drilldown-section {
    margin-top: 0.75rem;
  }
  .fs-drilldown-section-title {
    margin-bottom: 0.45rem;
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 800;
  }
  .fs-drilldown-table-wrap {
    overflow: auto;
    border: 1px solid #dbe3ee;
    border-radius: 4px;
  }
  .fs-drilldown-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.78rem;
  }
  .fs-drilldown-table th,
  .fs-drilldown-table td {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.45rem 0.55rem;
    text-align: left;
    vertical-align: top;
  }
  .fs-drilldown-table th:last-child,
  .fs-drilldown-table td:last-child {
    border-right: 0;
  }
  .fs-drilldown-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
  }
  .fs-drilldown-table tr:last-child td {
    border-bottom: 0;
  }
  .fs-drilldown-table td.is-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .fs-drilldown-source-table {
    min-width: 1640px;
    font-size: 0.74rem;
  }
  .fs-drilldown-source-table th,
  .fs-drilldown-source-table td {
    padding: 0.36rem 0.45rem;
    white-space: nowrap;
  }
  .fs-drilldown-source-table .fs-drilldown-code-cell {
    min-width: 6.5rem;
  }
  .fs-drilldown-source-table .fs-drilldown-name-cell {
    min-width: 10rem;
    max-width: 14rem;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  .fs-drilldown-source-table .fs-drilldown-currency-cell {
    min-width: 5.25rem;
  }
  .fs-drilldown-source-table .fs-drilldown-dimensions-cell {
    min-width: 13rem;
    max-width: 18rem;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  .fs-drilldown-source-table .fs-drilldown-status-cell {
    min-width: 8rem;
    max-width: 12rem;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  .fs-drilldown-source-table tbody tr:nth-child(even) td {
    background: #fcfcfd;
  }
  .fs-drilldown-empty,
  .fs-drilldown-note {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.7rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .fs-drilldown-note {
    margin-bottom: 0.45rem;
    border-style: solid;
    background: #eff6ff;
    color: #1d4ed8;
  }
  .fs-drilldown-page {
    width: 100%;
    max-width: min(1280px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 0.4rem 0 1.5rem;
  }
  .fs-drilldown-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
  }
  .fs-drilldown-page-head h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
  }
  .fs-drilldown-page-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.45rem;
    flex: 0 0 auto;
  }
  .fs-drilldown-page .fs-drilldown-page-back.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 1.8rem;
    min-height: 1.8rem;
    padding: 0.26rem 0.58rem;
    border: 1px solid #133752 !important;
    border-radius: 6px;
    background: #133752 !important;
    background-color: #133752 !important;
    color: #ffffff !important;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
  }
  .fs-drilldown-page .fs-drilldown-page-back.button:hover,
  .fs-drilldown-page .fs-drilldown-page-back.button:focus {
    border-color: #0f2d44 !important;
    background: #0f2d44 !important;
    background-color: #0f2d44 !important;
    color: #ffffff !important;
  }
  .fs-drilldown-actions-menu {
    position: relative;
    flex: 0 0 auto;
  }
  .fs-drilldown-actions-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }
  .fs-drilldown-row-count {
    margin-top: 0.35rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .fs-drilldown-actions-button:hover,
  .fs-drilldown-actions-button:focus,
  .fs-drilldown-actions-button[aria-expanded="true"] {
    background: #f8fafc;
    color: #0f172a;
  }
  .fs-drilldown-actions-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    min-width: 8.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    padding: 0.25rem;
  }
  .fs-drilldown-actions-dropdown[hidden] {
    display: none !important;
  }
  .fs-drilldown-actions-dropdown button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.48rem 0.6rem;
    text-align: left;
  }
  .fs-drilldown-actions-dropdown button:hover,
  .fs-drilldown-actions-dropdown button:focus {
    background: #f1f5f9;
    color: #0f172a;
  }
  .fs-format-scope-panel {
    padding: 0.85rem 1rem 0;
  }
  .fs-format-scope-title {
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
  }
  .fs-format-scope-groups {
    display: grid;
    grid-template-columns: minmax(128px, 0.75fr) minmax(260px, 1.2fr) minmax(340px, 1.55fr);
    gap: 0.65rem;
    align-items: stretch;
  }
  .fs-format-scope-group {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.55rem;
    transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
  }
  .fs-format-scope-group.is-active {
    border-color: #bfdbfe;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }
  .fs-format-scope-group-title {
    margin-bottom: 0.4rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }
  .fs-format-scope-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 0.45rem;
  }
  .fs-format-scope-cards button {
    min-height: 4rem;
    border: 1px solid #d5dde8;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.55rem 0.6rem;
    text-align: left;
    font: inherit;
    cursor: pointer;
  }
  .fs-format-scope-cards button span {
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.15;
  }
  .fs-format-scope-cards button small {
    display: block;
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .fs-format-scope-cards button:hover,
  .fs-format-scope-cards button:focus-visible {
    border-color: #94a3b8;
    background: #f8fafc;
    outline: none;
  }
  .fs-format-scope-cards button.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
  }
  .fs-format-scope-cards button.is-active small {
    color: #1d4ed8;
  }
  .fs-format-scope-summary {
    min-height: 1.1rem;
    margin-top: 0.45rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
  }
  .fs-format-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }
  .fs-format-native-scope {
    display: none !important;
  }
  .fs-format-grid label,
  .fs-format-checks label {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .fs-format-grid input,
  .fs-format-grid select {
    min-height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    padding: 0.34rem 0.45rem;
    font: inherit;
  }
  .fs-format-grid label.is-disabled-by-scope {
    color: #94a3b8;
  }
  .fs-format-grid label.is-disabled-by-scope select,
  .fs-format-grid label.is-disabled-by-scope input,
  .fs-format-grid label.is-disabled-by-scope button {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
  }
  .fs-format-field-note {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .fs-format-color-trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    padding: 0.34rem 0.45rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .fs-format-color-trigger:hover {
    border-color: #2563eb;
    background: #f8fafc;
  }
  .fs-format-color-swatch {
    width: 18px;
    height: 18px;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    background: #ffffff;
  }
  .fs-format-color-swatch.is-empty {
    background:
      linear-gradient(135deg, transparent 45%, #ef4444 46%, #ef4444 54%, transparent 55%),
      #ffffff;
  }
  .fs-format-checks {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .fs-format-checks label {
    flex-direction: row;
    align-items: center;
  }
  .fs-format-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid #e5e7eb;
  }
  .fs-format-actions button {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.42rem 0.72rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .fs-format-actions .button {
    border-color: #166534;
    background: #166534;
    color: #ffffff;
  }
  @media (max-width: 760px) {
    .fs-format-scope-groups {
      grid-template-columns: 1fr;
    }
    .fs-format-scope-cards {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .fs-format-grid {
      grid-template-columns: 1fr;
    }
  }
  @media (max-width: 1180px) {
    .fs-report-workspace {
      grid-template-columns: 1fr;
    }
    .fs-report-workspace.is-sidebar-collapsed {
      grid-template-columns: 1fr;
    }
    .fs-report-workspace.is-sidebar-collapsed .fs-report-sidebar {
      width: auto;
      visibility: visible;
      pointer-events: auto;
      overflow: visible;
    }
    .fs-report-workspace .fs-report-tree {
      max-height: 360px;
    }
    .fs-top-toolbar {
      align-items: stretch;
    }
    .fs-chart-switch {
      width: 100%;
    }
    .fs-chart-switch-select {
      min-width: 0;
      flex: 1;
    }
    .fs-map-link {
      width: 100%;
      min-width: 0;
    }
    .fs-version-edit-form,
    .fs-version-readonly-row,
    .fs-version-create-form {
      grid-template-columns: 1fr;
    }
    .fs-version-item-actions {
      justify-content: flex-start;
    }
    .fs-create-layout {
      grid-template-columns: 1fr;
    }
    .fs-mapped-lines-drawer {
      width: min(760px, calc(100vw - 1rem));
      right: 0;
      top: var(--top-offset);
      bottom: 0;
      height: auto;
    }
    .fs-mapped-lines-resizer {
      display: none;
    }
    .fs-query-builder-shell {
      grid-template-columns: 1fr;
    }
    .fs-query-pane-resizer {
      display: none;
    }
  }

/* Template style block */
.coa-home-grid{display:grid;grid-template-columns:1fr;gap:1.5rem;}
  .fs-window-table-wrap{max-height:clamp(340px,68vh,760px);overflow:auto;scrollbar-gutter:stable;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);margin-top:.75rem;}
  .coa-section-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;}
  .coa-section-title{margin:0;}
  .coa-list{width:100%;border-collapse:collapse;background:white;margin-top:0;}
  .coa-list th,.coa-list td{border-bottom:1px solid #e5e7eb;padding:.6rem;vertical-align:middle;}
  .coa-list th{background:#f9fafb;text-align:left;font-weight:700;}
  .coa-list a{font-weight:700;text-decoration:none;}
  .coa-actions{display:flex;align-items:center;gap:.75rem;}
  .coa-col-actions{width:140px;}
  .fs-chart-name-header{display:flex;flex-direction:column;gap:.35rem;}
  .fs-chart-lookup{
    width:100%;
    max-width:360px;
    padding:.42rem .5rem;
    border:1px solid #d1d5db;
    border-radius:8px;
    background:#fff;
    font:inherit;
    font-weight:500;
  }
  .fs-chart-row{cursor:pointer;}
  .fs-chart-row td{transition:background-color .12s ease;}
  .fs-chart-row:hover td{background:#f3f4f6;}
  .fs-chart-row:focus-visible td{outline:2px solid #9ca3af;outline-offset:-2px;}
  .fs-chart-row-highlight td{background:#e5e7eb;}
  .fs-toolbar{
    margin-top:1rem;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:.8rem .9rem;
    box-shadow:0 1px 3px rgba(0,0,0,.06);
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:.75rem;
    flex-wrap:wrap;
  }
  .fs-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;}
  .fs-selected-chart,.fs-selected-version{margin:0;}
  .fs-selected-version{margin-top:.25rem;}
  .fs-step-card{
    margin-top:1rem;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:1rem;
    box-shadow:0 1px 3px rgba(0,0,0,.06);
    max-width:840px;
  }
  .fs-step-title {
    margin: 0 0 0.35rem 0;
  }
  .fs-step-button {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
  }
  .fs-step-footnote {
    margin: 0.6rem 0 0 0;
  }
  .fs-step-button-disabled {
    opacity: 0.6;
    pointer-events: none;
  }
  .fs-empty-state {
    margin-top: 1rem;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 1rem;
    color: #4b5563;
    max-width: 840px;
  }
  .fs-empty-state a {
    font-weight: 700;
    text-decoration: none;
  }
  @media (max-width: 980px){
    .fs-toolbar{align-items:stretch;}
    .fs-toolbar-btn{width:100%;}
  }

/* Template style block */
.fs-map-shell {
    color: #111827;
    padding: 0 0 0.85rem;
    font-family: var(--app-font-family);
  }
  .fs-map-top-panel {
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.45rem auto 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 0.65rem 0.75rem 0.62rem;
  }
  .fs-map-page-title {
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.2rem auto 0;
    padding: 0;
  }
  .fs-map-page-title h1 {
    color: #111827;
    font-size: 1.42rem;
    font-weight: 800;
    line-height: 1.1;
  }
  .fs-map-toolbar {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .fs-map-chart-field {
    min-width: 260px;
  }
  .fs-company-filter-wrap {
    min-width: 250px;
    max-width: 320px;
  }
  .fs-map-actions {
    align-items: flex-end;
    position: relative;
    z-index: 7300;
  }
  .fs-map-company-filter {
    position: relative;
  }
  .fs-map-toolbar .fs-company-filter-trigger {
    min-width: 250px;
    border-color: #d1d5db;
    background: #ffffff;
    color: #1f2937;
    box-shadow: none;
  }
  .fs-map-toolbar .fs-company-filter-trigger:hover:not(:disabled),
  .fs-map-company-filter.is-open .fs-company-filter-trigger {
    border-color: #94a3b8;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
  }
  .fs-company-filter-trigger .tb-multi-trigger-start,
  .fs-company-filter-trigger .tb-multi-trigger-caret {
    color: #64748b;
  }
  .fs-company-filter-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 3rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    padding: 0.12rem 0.36rem;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
  }
  .fs-map-company-filter[data-selection-state="some"] .fs-company-filter-state {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
  }
  .fs-map-company-filter[data-selection-state="none"] .fs-company-filter-state {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .fs-map-company-filter.is-disabled .fs-company-filter-trigger {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    box-shadow: none;
  }
  .fs-map-company-filter.is-disabled .tb-multi-trigger-start,
  .fs-map-company-filter.is-disabled .tb-multi-trigger-caret {
    color: #9ca3af;
  }
  .fs-company-filter-menu {
    width: min(340px, calc(100vw - 1.2rem));
    max-width: none;
  }
  .fs-company-filter-actions {
    gap: 0.65rem;
    border-bottom: 1px dotted #cccccc;
    background: #ffffff;
  }
  .fs-company-filter-actions .tb-multi-menu-link {
    color: #475569;
    font-weight: 850;
  }
  .fs-company-filter-actions .tb-multi-menu-link:hover {
    color: #111827;
  }
  .fs-company-filter-options {
    max-height: min(240px, calc(100vh - 14rem));
  }
  .fs-company-filter-empty {
    display: block;
    padding: 0.3rem 0.1rem;
    color: #64748b;
    font-size: 0.78rem;
  }
  .fs-map-save-btn {
    flex: 0 0 auto;
    min-width: 3.8rem;
    width: auto;
    border-color: #0f2f47 !important;
    background: #133752 !important;
    color: #f8fafc !important;
    font-weight: 800;
  }
  .fs-map-save-btn:hover:not(:disabled),
  .fs-map-save-btn:focus:not(:disabled),
  .fs-map-save-btn.is-editing {
    border-color: #0b2538 !important;
    background: #0f2f47 !important;
    color: #ffffff !important;
  }
  .fs-map-save-btn.is-saving,
  .fs-map-save-btn.is-saved,
  .fs-map-save-btn.is-save-error {
    width: auto;
    min-width: 5.3rem;
    padding: 0 0.65rem;
    gap: 0.38rem;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
  }
  .fs-map-save-btn.is-saved {
    color: #166534 !important;
    background: #f0fdf4 !important;
  }
  .fs-map-save-btn.is-save-error {
    color: #991b1b !important;
    background: #fef2f2 !important;
  }
  .fs-map-sheet-menu {
    position: relative;
    z-index: 7350;
  }
  .fs-map-menu-dropdown {
    min-width: 220px !important;
    top: 2.85rem !important;
    z-index: 7400 !important;
  }
  .fx-panel.fs-map-rule-panel {
    margin: 0.55rem auto 0;
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    overflow: visible;
  }
  .fs-map-rule-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 2.55rem;
    box-sizing: border-box;
    padding: 0.62rem 0.8rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
  }
  .fs-map-rule-summary::-webkit-details-marker {
    display: none;
  }
  .fs-map-rule-summary-title {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
  }
  .fs-map-rule-summary-meta {
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.14rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
  }
  .fs-map-rule-summary-caret {
    width: 0.48rem;
    height: 0.48rem;
    margin-left: auto;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.12s ease;
  }
  .fs-map-rule-panel[open] .fs-map-rule-summary-caret {
    transform: rotate(225deg);
  }
  .fs-map-rule-body {
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 0.85rem 0.85rem;
  }
  .fs-map-rule-form {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.55rem;
    align-items: end;
    margin: 0 0 0.8rem;
  }
  .fs-map-rule-field {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
  }
  .fs-map-rule-account-field {
    grid-column: span 3;
  }
  .fs-map-rule-line-field {
    grid-column: span 3;
  }
  .fs-map-rule-priority-field {
    grid-column: span 1;
  }
  .fs-map-rule-builder-field {
    grid-column: span 6;
    align-self: stretch;
  }
  .fs-map-rule-field label {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.1;
  }
  .fs-map-rule-field input,
  .fs-map-rule-field select {
    width: 100%;
    min-height: 2.28rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.84rem;
    line-height: 1.2;
    padding: 0.44rem 0.52rem;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .fs-map-rule-field input:focus,
  .fs-map-rule-field select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: #2563eb;
  }
  .fs-map-rule-submit {
    grid-column: span 1;
    min-height: 2.28rem;
    border-radius: 6px;
    white-space: nowrap;
  }
  .fs-map-rule-pair-list {
    display: grid;
    gap: 0.35rem;
  }
  .fs-map-rule-pair-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 2rem;
    gap: 0.35rem;
    align-items: center;
  }
  .fs-map-rule-pair-remove,
  .fs-map-rule-add {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
  }
  .fs-map-rule-pair-remove {
    width: 2rem;
    min-height: 2.28rem;
    padding: 0;
    line-height: 1;
  }
  .fs-map-rule-add {
    justify-self: start;
    min-height: 2rem;
    padding: 0.24rem 0.56rem;
  }
  .fs-map-rule-pair-remove:hover,
  .fs-map-rule-pair-remove:focus,
  .fs-map-rule-add:hover,
  .fs-map-rule-add:focus {
    border-color: #94a3b8;
    background: #f8fafc;
  }
  .fs-map-rule-add:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .fs-map-rule-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
  }
  .fs-map-rule-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
  }
  .fs-map-rule-table th,
  .fs-map-rule-table td {
    padding: 0.55rem 0.62rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
    color: #1f2937;
    font-size: 0.83rem;
    line-height: 1.25;
  }
  .fs-map-rule-table th {
    background: #ffffff;
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
  }
  .fs-map-rule-table tbody tr:last-child td {
    border-bottom: none;
  }
  .fs-map-rule-account {
    display: block;
    font-weight: 800;
  }
  .fs-map-rule-muted {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
  }
  .fs-map-rule-delete-cell {
    width: 1%;
    text-align: right;
  }
  .fs-map-rule-delete {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
  }
  .fs-map-rule-delete:hover,
  .fs-map-rule-delete:focus {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .fs-map-rule-empty {
    color: #64748b !important;
    font-weight: 700;
    text-align: center !important;
  }
  .fx-panel.fs-map-panel {
    overflow: hidden;
    margin: 0.55rem auto 0;
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .fx-panel.fx-rate-entry-panel.fs-map-panel {
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
  }
  .fs-map-notice {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .fs-map-notice-stack {
    display: grid;
    gap: 0.55rem;
    width: min(100%, max(var(--fs-map-table-width, 1360px), 1360px));
    max-width: 100%;
    margin: 0.75rem auto 0;
  }
  .fs-map-grid-wrap {
    overflow: auto;
    background: #eef2f7;
    min-height: 430px;
    height: calc(100vh - 278px);
    max-height: calc(100vh - 278px);
  }
  #fs-map-hot {
    min-width: 100%;
    width: max(100%, var(--fs-map-table-width, 100%));
    height: 100%;
  }
  .fs-map-column-filters + #fs-map-hot {
    height: calc(100% - 2.4rem);
  }
  .fs-map-column-filters {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: stretch;
    min-width: max(100%, var(--fs-map-filter-width, var(--fs-map-table-width, 100%)));
    width: max(100%, var(--fs-map-filter-width, var(--fs-map-table-width, 100%)));
    background: #eaf1f8;
    border-bottom: 1px solid #cbd5e1;
  }
  .fs-map-column-filter-cell {
    box-sizing: border-box;
    flex: 0 0 auto;
    padding: 0.28rem 0.35rem;
    border-right: 1px solid #cbd5e1;
    background: #eaf1f8;
  }
  .fs-map-column-filter-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.24rem 0.34rem;
  }
  .fs-map-column-filter-input::placeholder {
    color: #6b7280;
  }
  .fs-map-column-filter-input:focus {
    border-color: #2563eb;
    outline: 2px solid rgba(37, 99, 235, 0.18);
    outline-offset: 0;
  }
  #fs-map-hot.fs-map-grid-view-mode .htAutocompleteArrow {
    display: none !important;
  }
  .fs-map-grid-wrap .handsontable {
    font-size: 0.86rem;
    color: #1f2937;
  }
  .fs-map-grid-wrap .handsontable .htCore th {
    background: #133752 !important;
    color: #f8fafc !important;
    border-color: #0f2f47 !important;
    font-weight: 800 !important;
    vertical-align: middle !important;
  }
  .fs-map-grid-wrap .handsontable .htCore th.fs-map-context-header {
    background: #133752 !important;
    color: #f8fafc !important;
  }
  .fs-map-grid-wrap .handsontable .htCore th.fs-map-dimension-header {
    background: #133752 !important;
    color: #f8fafc !important;
  }
  .fs-map-grid-wrap .handsontable .htCore th.fs-map-details-header,
  .fs-map-grid-wrap .handsontable .htCore th.fs-map-match-header {
    background: #133752 !important;
    color: #f8fafc !important;
    box-shadow: inset 0 -1px 0 #0f2f47;
  }
  .fs-map-grid-wrap .handsontable .htCore td {
    background: #ffffff;
    color: #1f2937;
    border-color: #dde1e6 !important;
  }
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td {
    background: #fbfcfe;
  }
  .fs-map-grid-wrap .handsontable .wtBorder {
    border-color: #3b82f6 !important;
  }
  .fs-map-grid-wrap .handsontable .currentRow,
  .fs-map-grid-wrap .handsontable .currentCol,
  .fs-map-grid-wrap .handsontable .area {
    background: rgba(37, 99, 235, 0.08) !important;
  }
  .fs-map-grid-wrap .handsontable td.htDimmed,
  .fs-map-grid-wrap .handsontable td.fs-map-context-cell,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-context-cell {
    background: #e2e8f0 !important;
    color: #64748b;
    box-shadow: inset 0 0 0 1px #cbd5e1;
    opacity: 0.78;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-source-cell,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-source-cell {
    background: #dbe3ee !important;
    color: #334155;
    font-weight: 700;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-meta-cell,
  .fs-map-grid-wrap .handsontable td.fs-map-dimension-cell {
    font-weight: 600;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-details-cell,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-details-cell {
    background: #e2e8f0 !important;
    color: #64748b;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px #cbd5e1;
    opacity: 0.78;
    text-align: center;
  }
  .fs-map-details-link {
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 0;
    text-decoration: underline;
  }
  .fs-map-details-link:hover,
  .fs-map-details-link:focus {
    color: #1f2937;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell {
    color: #111827;
    font-weight: 700;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell-mapped,
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell-explicit,
  .fs-map-grid-wrap .handsontable td.htDimmed.fs-map-match-cell-mapped,
  .fs-map-grid-wrap .handsontable td.htDimmed.fs-map-match-cell-explicit,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-match-cell-mapped {
    background: #ecfdf5 !important;
    color: #14532d;
    box-shadow: inset 3px 0 0 #16a34a, inset 0 0 0 1px #bbf7d0;
    opacity: 1;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell-rule,
  .fs-map-grid-wrap .handsontable td.htDimmed.fs-map-match-cell-rule,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-match-cell-rule {
    background: #eff6ff !important;
    color: #1d4ed8;
    box-shadow: inset 3px 0 0 #3b82f6, inset 0 0 0 1px #bfdbfe;
    opacity: 1;
  }
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell-unmapped,
  .fs-map-grid-wrap .handsontable td.htDimmed.fs-map-match-cell-unmapped,
  .fs-map-grid-wrap .handsontable .htCore tbody tr:nth-child(even) td.fs-map-match-cell-unmapped {
    background: #fff7ed !important;
    color: #7c2d12;
    box-shadow: inset 3px 0 0 #f97316, inset 0 0 0 1px #fed7aa;
    opacity: 1;
  }
  .fs-map-grid-wrap .handsontable .currentRow td.fs-map-match-cell,
  .fs-map-grid-wrap .handsontable .currentCol.fs-map-match-cell,
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell.current,
  .fs-map-grid-wrap .handsontable td.fs-map-match-cell.area {
    filter: brightness(0.97);
  }
  .fs-map-empty {
    margin: 0.75rem;
    border: 1px dashed #d1d5db;
    border-radius: 7px;
    background: #f8fafc;
    padding: 0.75rem;
    color: #4b5563;
    font-size: 0.86rem;
    font-weight: 700;
  }
  .fs-save-status {
    margin: 0;
    max-width: min(720px, 58vw);
    white-space: normal;
    line-height: 1.3;
    text-align: right;
  }
  .fx-save-status.fs-save-status:empty {
    display: none !important;
  }
  .fx-save-status.fs-save-status.is-error {
    color: #991b1b;
    font-weight: 800;
  }
  .fs-map-details-dialog[hidden] {
    display: none !important;
  }
  .fs-map-details-dialog {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
  }
  .fs-map-details-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
  }
  .fs-map-details-card {
    position: relative;
    z-index: 1;
    width: min(900px, calc(100vw - 2rem));
    max-height: min(680px, calc(100vh - 2rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  }
  .fs-map-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.72rem 0.85rem;
  }
  .fs-map-details-head h2 {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
  }
  .fs-map-details-close {
    width: 1.95rem;
    height: 1.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
  }
  .fs-map-details-close:hover,
  .fs-map-details-close:focus {
    background: #f8fafc;
    color: #111827;
  }
  .fs-map-details-body {
    min-height: 0;
    overflow: auto;
    padding: 0.85rem;
  }
  .fs-map-details-meta {
    display: grid;
    gap: 0.22rem;
    margin-bottom: 0.72rem;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.35;
  }
  .fs-map-details-meta strong {
    color: #111827;
    font-size: 0.95rem;
  }
  .fs-map-details-table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
  }
  .fs-map-details-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
  }
  .fs-map-details-table th,
  .fs-map-details-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.52rem 0.6rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.82rem;
    line-height: 1.3;
  }
  .fs-map-details-table th {
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 800;
    white-space: nowrap;
  }
  .fs-map-details-table tbody tr:last-child td {
    border-bottom: none;
  }
  .fs-map-details-empty {
    color: #64748b;
    font-weight: 700;
    text-align: center !important;
  }
  .fs-map-details-overflow {
    margin-top: 0.55rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
  }
  @media (max-width: 980px) {
    .fs-map-top-panel {
      width: 100%;
    }
    .fs-map-page-title {
      width: 100%;
    }
    .fs-company-filter-wrap {
      max-width: none;
    }
    .fs-map-toolbar .fs-company-filter-trigger {
      width: 100%;
    }
    .fs-map-rule-form {
      grid-template-columns: 1fr;
    }
    .fs-map-grid-wrap {
      height: calc(100vh - 360px);
      max-height: calc(100vh - 360px);
      min-height: 340px;
    }
    .fs-save-status {
      max-width: 100%;
      text-align: left;
    }
  }

/* Template style block */
.folder-access-shell {
    max-width: 980px;
    margin: 0 auto;
    color: #0f172a;
    font-family: var(--app-font-family);
  }
  .folder-access-header {
    margin-bottom: 0.95rem;
  }
  .folder-access-back {
    display: inline-flex;
    align-items: center;
    color: #334155;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
  }
  .folder-access-header h1 {
    margin: 0.35rem 0 0;
    font-size: 1.5rem;
    line-height: 1.2;
  }
  .folder-access-header p {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
  }
  .folder-access-form {
    display: grid;
    gap: 0.9rem;
  }
  .folder-access-section {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.95rem;
  }
  .folder-access-section h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
  }
  .folder-access-section p {
    margin: 0.3rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
  }
  .folder-access-radio,
  .folder-access-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #0f172a;
    font-size: 0.84rem;
  }
  .folder-access-radio {
    margin-top: 0.7rem;
    margin-right: 1rem;
  }
  .folder-access-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
  }
  .folder-access-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
  }
  .folder-access-table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    font-size: 0.84rem;
  }
  .folder-access-table th,
  .folder-access-table td {
    padding: 0.62rem 0.72rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
  }
  .folder-access-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .folder-access-table tr:last-child td {
    border-bottom: none;
  }
  .folder-access-table .is-admin-row td {
    color: #475569;
    background: #fbfdff;
  }
  .folder-access-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    padding: 0.12rem 0.42rem;
    font-size: 0.7rem;
    font-weight: 800;
  }
  .folder-access-empty {
    color: #64748b;
  }
  .folder-access-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.1rem;
  }
  .folder-access-secondary,
  .folder-access-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.52rem 0.76rem;
    text-decoration: none;
  }
  .folder-access-secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
  }
  .folder-access-primary {
    border: 1px solid #133752;
    background: #133752;
    color: #f8fafc;
    cursor: pointer;
  }
  .folder-access-primary:hover {
    background: #0f2d44;
    border-color: #0f2d44;
  }
  @media (max-width: 640px) {
    .folder-access-actions {
      flex-direction: column-reverse;
    }
    .folder-access-secondary,
    .folder-access-primary {
      width: 100%;
    }
  }

/* Template style block */
.history-tsv {
    width: 100%;
    min-height: 160px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.6rem;
    font: 12px/1.4 "Consolas", "Courier New", monospace;
    color: #111827;
    background: #f8fafc;
    resize: vertical;
    box-sizing: border-box;
    white-space: pre;
  }

/* Template style block */
.tb-toolbar {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .8rem .9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    flex-wrap: wrap;
  }
  .tb-toolbar form { margin: 0; }
  .tb-toolbar-filters {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: .65rem;
    min-width: 0;
    flex-wrap: wrap;
  }
  .tb-toolbar-field { display: flex; flex-direction: column; gap: .3rem; min-width: 180px; }
  .tb-toolbar-field.has-multi { position: relative; }
  .tb-toolbar-field label { font-size: .84rem; font-weight: 700; color: #374151; }
  .tb-toolbar-field select,
  .tb-multi-trigger {
    padding: .5rem .6rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    min-width: 180px;
    color: #1f2937;
    font: inherit;
    min-height: 2.2rem;
  }
  .tb-multi-trigger {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    cursor: pointer;
  }
  .tb-multi-trigger-start {
    color: #64748b;
    display: inline-flex;
    align-items: center;
  }
  .tb-multi-trigger-start svg { width: .82rem; height: .82rem; display: block; }
  .tb-multi-trigger-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tb-multi-trigger-caret { color: #6b7280; font-size: .7rem; line-height: 1; }
  .fx-rates-toolbar .tb-multi-trigger-caret {
    width: 0;
    height: 0;
    border-left: 0.28rem solid transparent;
    border-right: 0.28rem solid transparent;
    border-top: 0.36rem solid #1f2937;
    color: #1f2937;
    font-size: 0;
    line-height: 0;
  }
  .fx-rates-toolbar .tb-multi-trigger[aria-expanded="true"] .tb-multi-trigger-caret {
    transform: rotate(180deg);
  }
  .tb-multi-menu {
    position: absolute;
    top: calc(100% + 0.32rem);
    left: 0;
    width: min(320px, calc(100vw - 1.2rem));
    max-width: 100%;
    border: 1px solid #d2d1d1;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1700;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .tb-multi-menu[hidden] { display: none !important; }
  .tb-multi-menu-search-wrap { padding: .42rem .46rem .2rem; }
  .tb-multi-menu-search {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
  }
  .tb-multi-menu-actions {
    display: flex;
    justify-content: flex-start;
    padding: .22rem .46rem .18rem;
    border-bottom: 1px dotted #cccccc;
  }
  .tb-multi-menu-link {
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .tb-multi-menu-link:hover { text-decoration: underline; }
  .tb-multi-menu-options {
    display: grid;
    gap: 0;
    padding: .24rem .4rem .28rem;
    overflow-y: auto;
    max-height: min(200px, calc(100vh - 14rem));
  }
  .tb-multi-option {
    border: none;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    gap: .34rem;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: .17rem .08rem;
    cursor: pointer;
  }
  .tb-multi-option:hover,
  .tb-multi-option:focus-within { background: #f3f4f6; }
  .tb-multi-option-check {
    width: .82rem;
    height: .82rem;
    margin: 0;
    accent-color: #2563eb;
    flex: 0 0 auto;
  }
  .tb-multi-option-label {
    min-width: 0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tb-multi-menu-foot {
    border-top: 1px dotted #cccccc;
    padding: .3rem .45rem .38rem;
    display: flex;
    justify-content: flex-end;
  }
  .tb-multi-menu-done {
    border: 1px solid #18804e;
    border-radius: 2px;
    background: #0f9d58;
    color: #ffffff;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 64px;
    height: 20px;
    padding: .18rem .5rem;
    cursor: pointer;
  }
  .tb-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    white-space: nowrap;
    padding: .58rem .95rem;
  }
  .fx-toolbar-icon-btn {
    gap: 0;
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    padding: 0;
  }
  .fx-toolbar-icon-btn:hover:not(:disabled),
  .fx-toolbar-dots-btn:hover {
    background: #e5e7eb;
    color: #334155;
  }
  .fx-toolbar-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .fx-toolbar-icon-svg {
    width: 1.14rem;
    height: 1.14rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .fx-toolbar-icon-svg svg {
    width: 100%;
    height: 100%;
    display: block;
  }
  .fx-toolbar-dots-btn {
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    padding: 0;
    gap: 0;
  }
  .fx-toolbar-dots {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 18px;
    height: 20px;
  }
  .fx-toolbar-dots span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    display: block;
  }
  .fx-toolbar-disabled[disabled] {
    color: #94a3b8;
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
  }
  .fx-toolbar-menu-wrap { position: relative; }
  .fx-toolbar-menu {
    position: absolute;
    top: calc(100% + 0.34rem);
    right: 0;
    min-width: 168px;
    border: 1px solid #d2d1d1;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1700;
    overflow: hidden;
  }
  .fx-toolbar-menu[hidden] { display: none !important; }
  .fx-toolbar-menu button {
    width: 100%;
    border: none;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: .78rem;
    line-height: 1.2;
    text-align: left;
    padding: .5rem .62rem;
    cursor: pointer;
  }
  .fx-toolbar-menu button:hover { background: #f3f4f6; }
  .tb-toolbar-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
  }
  .fx-rates-toolbar {
    width: min(100%, 1040px);
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
  }
  .fx-rates-page-head {
    width: min(100%, 1040px);
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }
  .fx-rates-subtitle {
    margin: 0.18rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
  }
  .fx-rates-toolbar .tb-toolbar-actions {
    align-self: center;
    align-items: center;
  }
  .tb-filter-hint { margin: .55rem 0 0 0; font-size: .86rem; }

  .fx-panel {
    margin: .75rem auto 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 860px;
    width: 100%;
  }
  .fx-panel.fx-rates-panel {
    width: min(100%, 1040px);
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
  }
  .fx-panel-head {
    padding: 1rem 1.1rem .75rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
  }
  .fx-panel-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.1;
    color: #111827;
  }
  .fx-panel-head-actions {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .fx-panel-menu-wrap { position: relative; }
  .fx-panel-menu-toggle {
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
  }
.fx-panel-menu-toggle:hover { color: #0f172a; background: #e5e7eb; }
.fx-panel-menu-toggle:disabled,
.fx-panel-menu-toggle-disabled {
  color: #9ca3af;
  background: transparent;
  cursor: not-allowed;
  opacity: 0.58;
}
.fx-panel-menu-toggle:disabled:hover,
.fx-panel-menu-toggle-disabled:hover {
  color: #9ca3af;
  background: transparent;
}
  .fx-panel-menu-dots {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5px;
    width: 14px;
    height: 15px;
  }
  .fx-panel-menu-dots span {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    display: block;
  }
  .fx-panel-menu {
    position: absolute;
    top: calc(100% + 0.34rem);
    right: 0;
    min-width: 168px;
    border: 1px solid #d2d1d1;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1700;
    overflow: hidden;
  }
  .fx-panel-menu[hidden] { display: none !important; }
  .fx-panel-menu button {
    width: 100%;
    border: none;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: .78rem;
    line-height: 1.2;
    text-align: left;
    padding: .5rem .62rem;
    cursor: pointer;
  }
  .fx-panel-menu button:hover:not(:disabled) { background: #f3f4f6; }
  .fx-panel-menu button:disabled,
  .fx-panel-menu .fx-panel-menu-disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .fx-panel-menu button:disabled:hover,
  .fx-panel-menu .fx-panel-menu-disabled:hover {
    background: #f9fafb;
    color: #9ca3af;
  }

  .fx-grid-wrap {
    height: calc(100vh - 340px);
    max-height: calc(100vh - 340px);
    min-height: 260px;
    overflow: auto;
    background: #f4f5f7;
  }
  .fx-grid {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.86rem;
    color: #1f2937;
  }
  .fx-grid th,
  .fx-grid td {
    padding: 0.24rem 0.5rem;
    border: 1px solid #dde1e6;
    vertical-align: middle;
  }
  .fx-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    text-align: left;
    font-weight: 700;
  }
  .fx-grid-filter-row td {
    background: #eaf1f8 !important;
    padding: 0.18rem 0.35rem;
  }
  .fx-grid-filter-input-wrap { position: relative; }
  .fx-grid-filter-icon {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
  }
  .fx-grid-filter-icon svg { width: 0.8rem; height: 0.8rem; display: block; }
  .fx-grid-filter-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    padding: 0.22rem 0.34rem 0.22rem 1.4rem;
  }
  .fx-grid-filter-input-wrap.is-value-filtered .fx-grid-filter-icon,
  .fx-grid-filter-input-wrap.is-condition-filtered .fx-grid-filter-icon { color: #0f766e; }
  .fx-grid tbody tr:nth-child(odd) td { background: #f5f6f8; }
  .fx-grid tbody tr:nth-child(even) td { background: #edf0f3; }
  .fx-grid-empty td {
    text-align: center;
    color: #6b7280;
    padding: 1rem 0.75rem;
    background: #f9fafb !important;
  }
  .fx-grid-load-status {
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.2;
    min-height: 2rem;
    padding: 0.55rem 0.85rem;
    text-align: center;
  }
  .fx-rate-cell {
    text-align: left;
    font-variant-numeric: tabular-nums;
  }
  .fx-edit-rate-cell[contenteditable="true"] {
    background: #fffef2 !important;
    outline: 1px solid #facc15;
    cursor: text;
  }
  .fx-edit-rate-cell.is-dirty {
    background: #fef3c7 !important;
  }

  .fx-filter-menu {
    position: fixed;
    min-width: 320px;
    max-width: min(420px, calc(100vw - 1rem));
    max-height: min(460px, calc(100vh - 1rem));
    overflow: hidden;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1600;
    display: flex;
    flex-direction: column;
  }
  .fx-filter-menu[hidden] { display: none !important; }
  .fx-filter-menu-sort {
    display: grid;
    gap: 0;
    border-bottom: 1px dotted #cccccc;
    padding: 0.18rem 0;
  }
  .fx-filter-menu-sort-btn {
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: left;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .fx-filter-menu-sort-btn:hover { background: #f3f4f6; }
  .fx-filter-menu-condition {
    display: block;
    border-bottom: 1px dotted #cccccc;
    padding: 0.12rem 0;
    background: #ffffff;
  }
  .fx-filter-menu-condition.is-open { display: block; padding: 0.12rem 0; }
  .fx-filter-menu-condition-toggle {
    width: 100%;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .fx-filter-menu-condition-toggle:hover { background: #f3f4f6; }
  .fx-filter-menu-condition-arrow {
    display: inline-block;
    font-size: 0.82rem;
    line-height: 1;
    color: #4b5563;
    transition: transform 120ms ease;
    transform: rotate(0deg);
  }
  .fx-filter-menu-condition.is-open .fx-filter-menu-condition-arrow { transform: rotate(90deg); }
  .fx-filter-menu-condition-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.32rem;
    padding: 0.2rem 0.45rem 0.36rem;
  }
  .fx-filter-menu-condition-body[hidden] { display: none !important; }
  .fx-filter-menu-condition-select,
  .fx-filter-menu-condition-value {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
    min-height: 1.6rem;
  }
  .fx-filter-menu-condition-value[disabled] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
  }
  .fx-filter-menu-search-wrap { padding: 0.3rem 0.45rem 0; }
  .fx-filter-menu-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
  }
  .fx-filter-menu-selection-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.24rem 0.45rem 0.22rem;
  }
  .fx-filter-menu-link {
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .fx-filter-menu-link:hover { text-decoration: underline; }
  .fx-filter-menu-list {
    display: grid;
    gap: 0;
    padding: 0.22rem 0.4rem 0.3rem;
    overflow-y: auto;
    max-height: min(150px, calc(100vh - 12rem));
  }
  .fx-filter-menu-option {
    border: none;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.34rem;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.17rem 0.08rem;
    cursor: pointer;
  }
  .fx-filter-menu-option:hover,
  .fx-filter-menu-option:focus-within { background: #f3f4f6; }
  .fx-filter-menu-option-check {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
    accent-color: #2563eb;
    flex: 0 0 auto;
  }
  .fx-filter-menu-option-label {
    min-width: 0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fx-filter-menu-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    border-top: 1px dotted #cccccc;
    padding: 0.3rem 0.45rem 0.4rem;
    background: #ffffff;
  }
  .fx-filter-menu-cancel,
  .fx-filter-menu-apply {
    border-radius: 2px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 64px;
    height: 20px;
    padding: 0.18rem 0.5rem;
    cursor: pointer;
  }
  .fx-filter-menu-cancel { border: 1px solid #b9b9b9; background: #eeeeee; color: #111827; }
  .fx-filter-menu-apply { border: 1px solid #18804e; background: #0f9d58; color: #ffffff; }
  .fx-filter-menu-empty { padding: 0.4rem 0.18rem; color: #6b7280; font-size: 0.75rem; background: #ffffff; }
  .muted-text { color: #6b7280; }

  @media (max-width: 980px) {
    .tb-toolbar { align-items: stretch; }
    .tb-toolbar-filters { flex-direction: column; width: 100%; min-width: 0; }
    .tb-toolbar-field,
    .tb-toolbar-field select,
    .tb-multi-trigger,
    .tb-toolbar-btn { width: 100%; }
    .tb-toolbar-actions {
      margin-left: 0;
      width: 100%;
    }
    .fx-grid { min-width: 620px; }
    .fx-grid-wrap {
      height: calc(100vh - 360px);
      max-height: calc(100vh - 360px);
      min-height: 200px;
    }
  }

/* Template style block */
.tb-toolbar{
    margin-top:1rem;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:.8rem .9rem;
    box-shadow:0 1px 3px rgba(0,0,0,.06);
    display:flex;
    align-items:flex-end;
    gap:.65rem;
    flex-wrap:wrap;
  }
  .tb-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;padding:.58rem .95rem;}
  .muted-text{color:#6b7280;}
  @media (max-width: 980px){
    .tb-toolbar{align-items:stretch;}
    .tb-toolbar-btn{width:100%;}
  }

/* Template style block */
.fx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .38rem;
    min-height: 2.2rem;
  }
  .fx-icon-btn-svg {
    width: .95rem;
    height: .95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .fx-icon-btn-svg svg {
    width: 100%;
    height: 100%;
    display: block;
  }
  .fx-action-disabled[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
  }
  .fx-row-menu-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .fx-row-menu-toggle {
    min-width: 42px;
    width: 42px;
    justify-content: center;
    padding: .55rem .2rem;
    gap: 0;
  }
  .fx-row-menu-dots {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 14px;
    height: 16px;
  }
  .fx-row-menu-dots span {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    display: block;
  }
  .fx-row-menu {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    min-width: 160px;
    border: 1px solid #d2d1d1;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1700;
    overflow: hidden;
  }
  .fx-row-menu[hidden] { display: none !important; }
  .fx-row-menu button {
    width: 100%;
    border: none;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: .78rem;
    line-height: 1.2;
    text-align: left;
    padding: .5rem .62rem;
    cursor: pointer;
  }
.fx-row-menu button:hover { background: #f3f4f6; }

.fx-admin-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #e5e7eb;
}

.fx-admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.fx-admin-table th,
.fx-admin-table td {
  padding: 0.58rem 0.72rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

.fx-admin-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}

.fx-admin-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  white-space: nowrap;
}

.fx-assignment-select {
  min-width: 220px;
  max-width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

.fx-assignment-select:disabled {
  color: #64748b;
  background: #f8fafc;
}

.fx-admin-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 0 0;
}

.fx-inline-form {
  padding: 0.85rem 0 0;
}

.fx-inline-form input,
.fx-inline-form select {
  min-height: 2.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}

.fx-form-action-field {
  justify-content: flex-end;
}

.fx-create-fields .fx-form-action-field {
  min-width: auto;
  width: auto;
  align-items: flex-start;
}

.fx-create-fields .fx-form-action-field .fx-compact-primary-btn {
  align-self: flex-start;
}

.fx-page-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0.3rem 0 0.15rem;
}

.fx-rate-entry-topline {
  width: 100%;
  box-sizing: border-box;
  margin: 0.2rem 0 0.05rem;
  justify-content: flex-start;
}

.fx-manage-topline {
  width: 100%;
  box-sizing: border-box;
  margin: 0.2rem 0 0.05rem;
  justify-content: flex-start;
}

.fx-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #1f2937;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.fx-back-link:hover {
  color: #111827;
  text-decoration: underline;
}

.fx-manage-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: min(100%, 1080px);
  box-sizing: border-box;
  margin: 0.25rem auto 0;
}

.fx-manage-title {
  color: #0f172a;
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.15;
}

.fx-manage-back-link {
  display: inline-flex;
  align-items: center;
  color: #2563eb;
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.fx-manage-back-link:hover,
.fx-manage-back-link:focus {
  color: #1d4ed8;
  text-decoration: underline;
}

.fx-rate-entry-back-link {
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.15;
}

.fx-rate-entry-head {
  align-items: flex-start;
}

.fx-manage-dropdown-panel {
  max-width: 1080px;
  padding: 0;
  border-color: #dbe3ef;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.fx-manage-dropdown {
  display: block;
}

.fx-manage-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  list-style: none;
}

.fx-manage-dropdown summary::-webkit-details-marker {
  display: none;
}

.fx-manage-dropdown summary:hover {
  background: #f8fafc;
}

.fx-manage-dropdown[open] > summary {
  border-bottom: 1px solid #e2e8f0;
}

.fx-manage-summary-copy {
  min-width: 0;
  display: grid;
  gap: 0.24rem;
}

.fx-manage-dropdown .fx-panel-title {
  color: #0f172a;
  font-size: 1.03rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0;
}

.fx-manage-summary-text {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.35;
}

.fx-manage-summary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #2563eb;
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.fx-manage-summary-action::after {
  content: "";
  width: 0.46rem;
  height: 0.46rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.16s ease;
}

.fx-manage-dropdown[open] .fx-manage-summary-action::after {
  transform: rotate(-135deg) translateY(-1px);
}

.fx-manage-dropdown-body {
  margin: 0;
  padding: 0.95rem 1rem 1rem;
}

.fx-manage-dropdown-body .fx-admin-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.fx-table-action-link,
.fx-compact-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1;
  margin: 0;
  padding: 0.42rem 0.68rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.fx-table-action-link {
  min-width: 5.25rem;
  min-height: 2.1rem;
  border: 1px solid #133752;
  background: #133752;
  color: #ffffff;
}

.fx-table-action-link:hover,
.fx-table-action-link:focus {
  border-color: #0f2d44;
  background: #0f2d44;
  color: #ffffff;
}

.fx-compact-primary-btn {
  border: 1px solid #133752;
  background: #133752;
  color: #ffffff;
}

.fx-manage-save-btn {
  min-width: 5.2rem;
  padding-left: 0.72rem;
  padding-right: 0.72rem;
}

.fx-compact-primary-btn:hover,
.fx-compact-primary-btn:focus {
  border-color: #0f2d44;
  background: #0f2d44;
  color: #ffffff;
}

.fx-assignment-warning-shell {
  width: min(100%, 1080px);
  margin: 0.55rem auto 0;
  color: #0f172a;
}

.fx-assignment-warning-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.fx-assignment-warning-head h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.fx-assignment-warning-head p {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.fx-assignment-warning-panel {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.fx-assignment-warning-copy {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #fed7aa;
}

.fx-assignment-warning-copy h2 {
  margin: 0;
  color: #9a3412;
  font-size: 1rem;
  line-height: 1.2;
}

.fx-assignment-warning-copy p {
  margin: 0.45rem 0 0;
  color: #7c2d12;
  font-size: 0.88rem;
  line-height: 1.45;
}

.fx-assignment-warning-table-wrap {
  overflow-x: auto;
  background: #ffffff;
}

.fx-assignment-warning-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.fx-assignment-warning-table th,
.fx-assignment-warning-table td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
  font-size: 0.88rem;
}

.fx-assignment-warning-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 750;
}

.fx-assignment-warning-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem 1rem;
  background: #ffffff;
}

.fx-warning-secondary-btn,
.fx-warning-confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.15rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  margin: 0;
  padding: 0.48rem 0.82rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.fx-warning-secondary-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.fx-warning-secondary-btn:hover,
.fx-warning-secondary-btn:focus {
  background: #f8fafc;
  color: #0f172a;
}

.fx-warning-confirm-btn {
  border: 1px solid #b45309;
  background: #b45309;
  color: #ffffff;
}

.fx-warning-confirm-btn:hover,
.fx-warning-confirm-btn:focus {
  border-color: #92400e;
  background: #92400e;
  color: #ffffff;
}

.fx-create-rate-set-panel[hidden] {
  display: none !important;
}

.fx-create-rate-set-form {
  padding: 0;
}

.fx-create-fields {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.75rem;
}

.fx-rate-sets-table,
.fx-assignments-table {
  min-width: 560px;
}

@media (max-width: 640px) {
  .fx-manage-head,
  .fx-manage-dropdown summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .fx-manage-summary-action {
    width: 100%;
    justify-content: space-between;
  }

  .fx-manage-dropdown-body {
    padding: 0.85rem;
  }

  .fx-create-fields {
    align-items: stretch;
  }

  .fx-form-action-field {
    justify-content: flex-start;
  }

  .fx-assignment-warning-head,
  .fx-assignment-warning-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .fx-warning-secondary-btn,
  .fx-warning-confirm-btn {
    width: 100%;
  }
}

.fx-rate-entry-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.fx-save-icon-btn {
  color: #0f172a;
  width: 2.65rem;
  height: 2.65rem;
}

.fx-rate-entry-head .fx-save-icon-btn {
  width: 2.3rem;
  height: 2.3rem;
}

.fx-save-icon-btn .fx-icon-btn-svg {
  width: 1.35rem;
  height: 1.35rem;
}

.fx-rate-entry-head .fx-save-icon-btn .fx-icon-btn-svg {
  width: 1.18rem;
  height: 1.18rem;
}

.fx-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  max-width: min(420px, 60vw);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.42rem 0.62rem;
}

.fx-save-status[hidden] {
  display: none !important;
}

.fx-save-status.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.fx-save-status.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.fx-save-status.is-saving {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.fx-save-status.is-warning {
  border-color: #facc15;
  background: #fffbeb;
  color: #92400e;
}

.fx-rate-entry-panel {
  max-width: 100%;
  width: min(100%, 1080px);
}

.fx-rate-entry-grid-wrap {
  height: calc(100vh - 330px);
  max-height: calc(100vh - 330px);
  min-height: 360px;
}

.fx-rate-entry-toolbar {
  width: min(100%, 1080px);
  box-sizing: border-box;
  margin: 0.55rem auto 0;
}

.fx-rate-entry-toolbar .fx-locked-toolbar-select:disabled {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.fx-rate-entry-head {
  width: min(100%, 1080px);
  box-sizing: border-box;
  margin: 0.25rem auto 0;
  padding: 0.42rem 0.72rem;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.fx-rate-entry-title {
  font-size: 1.12rem;
  line-height: 1.14;
}

.fx-rate-entry-title span {
  color: #8a94a3;
  font-size: 0.66em;
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 0.35rem;
  vertical-align: baseline;
}

.fx-rate-entry-grid {
  font-size: 0.86rem;
  user-select: text;
}

.fx-rate-entry-grid col.fx-col-row-number { width: 36px; }
.fx-rate-entry-grid col.fx-col-month { width: 138px; }
.fx-rate-entry-grid col.fx-col-type { width: 122px; }
.fx-rate-entry-grid col.fx-col-base { width: 76px; }
.fx-rate-entry-grid col.fx-col-quote { width: 86px; }
.fx-rate-entry-grid col.fx-col-rate { width: 180px; }
.fx-rate-entry-grid col.fx-col-inverse { width: 170px; }

.fx-rate-entry-grid th,
.fx-rate-entry-grid td {
  padding: 0.24rem 0.5rem;
  line-height: 1.25;
}

.fx-rate-entry-grid .fx-grid-filter-row td {
  padding: 0.18rem 0.35rem;
}

.fx-rate-entry-grid .fx-grid-filter-input {
  border-radius: 6px;
  font-size: inherit;
  padding: 0.22rem 0.34rem 0.22rem 1.4rem;
}

.fx-rate-entry-grid .fx-grid-filter-icon {
  left: 0.4rem;
}

.fx-rate-entry-grid .fx-grid-filter-icon svg {
  height: 0.8rem;
  width: 0.8rem;
}

.fx-rate-entry-grid .fx-row-number-head,
.fx-rate-entry-grid .fx-row-number-filter,
.fx-rate-entry-grid .fx-row-number-cell {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: right;
  color: #64748b;
  background: #dfe4ea !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.78rem;
  padding-left: 0.08rem;
  padding-right: 0.12rem;
}

.fx-rate-entry-grid .fx-row-number-head {
  background: #133752 !important;
  color: #f8fafc;
  text-align: center;
}

.fx-rate-entry-grid .fx-row-number-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: 0.28rem;
}

.fx-rate-entry-grid .fx-entry-cell {
  cursor: text;
  background: #ffffff !important;
  outline: 1px solid transparent;
  position: relative;
}

.fx-rate-entry-grid .fx-entry-cell[data-field="month"],
.fx-rate-entry-grid .fx-entry-cell[data-field="type"],
.fx-rate-entry-grid .fx-entry-cell[data-field="quote"] {
  padding-right: 1rem;
}

.fx-rate-entry-grid .fx-entry-cell[data-field="month"]::before,
.fx-rate-entry-grid .fx-entry-cell[data-field="type"]::before,
.fx-rate-entry-grid .fx-entry-cell[data-field="quote"]::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.35rem;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  transform: translateY(-35%);
  pointer-events: none;
}

.fx-rate-entry-grid .fx-entry-cell.fx-entry-cell-warning {
  background: #fee2e2 !important;
  box-shadow: inset 0 0 0 2px #dc2626;
}

.fx-rate-entry-grid .fx-entry-cell:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.fx-rate-entry-grid .fx-entry-cell:focus::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border: 1px solid #ffffff;
  background: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  cursor: crosshair;
}

.fx-rate-entry-grid .fx-entry-cell.is-fill-preview {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.fx-fill-dragging,
.fx-fill-dragging * {
  cursor: crosshair !important;
  user-select: none !important;
}

.fx-rate-entry-grid .fx-entry-cell[data-field="base"],
.fx-rate-entry-grid td[data-field="inverse"] {
  background: #e7ebf0 !important;
  color: #334155;
}

.fx-rate-entry-grid[data-locked="1"] .fx-entry-cell {
  cursor: default;
}

.fx-rate-entry-grid[data-locked="1"] .fx-entry-cell::after {
  display: none;
}

.fx-cell-suggestions {
  position: fixed;
  z-index: 3600;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  padding: 0.18rem;
  pointer-events: auto;
}

.fx-cell-suggestions[hidden] {
  display: none !important;
}

.fx-cell-suggestions button {
  display: block;
  width: 100%;
  border: none;
  border-radius: 3px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: left;
  padding: 0.32rem 0.45rem;
  cursor: pointer;
}

.fx-cell-suggestions button:hover,
.fx-cell-suggestions button:focus {
  background: #eaf1f8;
}

/* Template style block */
.history-tsv {
    width: 100%;
    min-height: 160px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.6rem;
    font: 12px/1.4 "Consolas", "Courier New", monospace;
    color: #111827;
    background: #f8fafc;
    resize: vertical;
    box-sizing: border-box;
    white-space: pre;
  }

/* Template style block */
.plan-shell {
        max-width: 1120px;
        margin: 0 auto;
        padding: 1.1rem 0 2rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .plan-header {
        text-align: center;
        margin-bottom: 1rem;
    }
    .plan-header h1 {
        margin: 0;
        font-size: 1.85rem;
        line-height: 1.15;
    }
    .plan-header p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.94rem;
    }
    .plan-alert {
        max-width: 720px;
        margin: 0 auto 1rem;
        border: 1px solid #fde68a;
        border-radius: 8px;
        background: #fffbeb;
        color: #92400e;
        padding: 0.65rem 0.8rem;
        font-size: 0.88rem;
        font-weight: 650;
    }
    .plan-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
    .plan-card {
        display: flex;
        flex-direction: column;
        min-width: 0;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
        padding: 1.05rem;
        text-align: center;
    }
    .plan-card h2 {
        margin: 0;
        font-size: 1.18rem;
        line-height: 1.2;
    }
    .plan-price {
        margin: 0.65rem 0 0;
        font-size: 1.32rem;
        font-weight: 800;
        color: #133752;
    }
    .plan-sub {
        margin: 0.25rem 0 0;
        color: #64748b;
        font-size: 0.92rem;
        font-weight: 700;
    }
    .plan-actions {
        display: grid;
        gap: 0.52rem;
        margin: 0.95rem 0 0;
    }
    .plan-primary-btn,
    .plan-secondary-btn {
        display: grid;
        gap: 0.12rem;
        width: 100%;
        border-radius: 7px;
        cursor: pointer;
        font: inherit;
        font-weight: 800;
        line-height: 1.15;
        padding: 0.62rem 0.78rem;
    }
    .plan-primary-btn {
        border: 1px solid #15803d;
        background: #15803d;
        color: #ffffff;
    }
    .plan-primary-btn:hover:not(:disabled) {
        background: #166534;
        border-color: #166534;
    }
    .plan-secondary-btn {
        border: 1px solid #86efac;
        background: #ffffff;
        color: #166534;
    }
    .plan-secondary-btn:hover:not(:disabled) {
        border-color: #15803d;
        background: #f0fdf4;
    }
    .plan-primary-btn span,
    .plan-secondary-btn span {
        font-size: 0.78rem;
        font-weight: 650;
        opacity: 0.88;
    }
    .plan-primary-btn:disabled,
    .plan-secondary-btn:disabled {
        cursor: not-allowed;
        opacity: 0.52;
    }
    .plan-savings {
        margin: 0;
        color: #166534;
        font-size: 0.8rem;
        font-weight: 750;
        line-height: 1.32;
    }
    .plan-card hr {
        width: 100%;
        border: 0;
        border-top: 1px solid #e2e8f0;
        margin: 1rem 0 0.8rem;
    }
    .plan-card > p:not(.plan-price):not(.plan-sub):not(.plan-savings) {
        margin: 0.15rem 0;
        color: #334155;
        font-size: 0.9rem;
        line-height: 1.35;
    }
    @media (max-width: 860px) {
        .plan-grid {
            grid-template-columns: 1fr;
        }
        .plan-card {
            max-width: 520px;
            margin: 0 auto;
            width: 100%;
            box-sizing: border-box;
        }
    }

/* Template style block */
.automatic-cta-shell {
    min-height: 100vh;
    background: #f5f7fa;
    color: #111827;
    padding: 0.85rem;
    font-family: var(--app-font-family);
  }
  .automatic-cta-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 0.75rem;
  }
  .automatic-cta-head h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.1;
  }
  .automatic-cta-head p {
    margin: 0.25rem 0 0;
    color: #667085;
    font-size: 0.84rem;
  }
  .cta-alert {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .cta-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .cta-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 0.75rem;
  }
  .cta-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
  }
  .cta-controls span {
    font-size: 0.74rem;
    color: #475569;
    font-weight: 800;
  }
  .cta-controls input,
  .cta-controls select,
  .cta-account-tools input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.84rem;
    min-height: 2rem;
    padding: 0.32rem 0.42rem;
  }
  .cta-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
    margin-bottom: 0.75rem;
  }
  .cta-panel-head,
  .cta-run-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-wrap: wrap;
  }
  .cta-panel-head h2 {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
  }
  .cta-actions,
  .cta-account-tools,
  .cta-result {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .cta-account-tools {
    justify-content: flex-end;
  }
  .cta-account-tools input {
    width: min(260px, 40vw);
  }
  .cta-actions button,
  .cta-account-tools button,
  .cta-run-button {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
  padding: 0.42rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
  }
  .cta-run-button {
    border-color: #166534;
    background: #166534;
    color: #ffffff;
  }
  .cta-month-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 0.45rem;
    padding: 0.65rem;
  }
  .cta-month-pill {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.45rem;
    row-gap: 0.05rem;
    align-items: center;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.44rem 0.48rem;
    cursor: pointer;
  }
  .cta-month-pill input {
    grid-row: span 2;
  }
  .cta-month-pill span {
    color: #111827;
    font-size: 0.86rem;
    font-weight: 800;
  }
  .cta-month-pill small {
    color: #667085;
    font-size: 0.72rem;
  }
  .cta-account-scroll {
    max-height: clamp(260px, 46vh, 620px);
    overflow: auto;
    background: #eef2f7;
  }
  .cta-account-grid {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.84rem;
  }
  .cta-account-grid th,
  .cta-account-grid td {
    border: 1px solid #dde1e6;
    padding: 0.34rem 0.45rem;
    text-align: left;
    white-space: nowrap;
  }
  .cta-account-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    font-weight: 800;
  }
  .cta-account-grid tbody tr:nth-child(odd) td {
    background: #f8fafc;
  }
  .cta-check-col {
    width: 44px;
    text-align: center !important;
  }
  .cta-empty {
    text-align: center !important;
    color: #667085;
    background: #ffffff !important;
    padding: 1rem !important;
  }
  .cta-run-bar {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  .cta-result {
    color: #334155;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
  }
  .cta-result strong {
    color: #111827;
  }
  @media (max-width: 980px) {
    .cta-controls,
    .cta-month-grid {
      grid-template-columns: 1fr 1fr;
    }
    .cta-account-tools {
      justify-content: flex-start;
    }
    .cta-account-tools input {
      width: 100%;
    }
  }

/* Template style block */
.tb-window-table-wrap{max-height:clamp(340px,68vh,760px);overflow:auto;scrollbar-gutter:stable;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);margin-top:.75rem;}
  .coa-list{width:100%;border-collapse:collapse;background:white;margin-top:0;}
  .coa-list th,.coa-list td{border-bottom:1px solid #e5e7eb;padding:.6rem;vertical-align:middle;}
  .coa-list th{background:#f9fafb;text-align:left;font-weight:700;}
  .coa-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;}
  .coa-col-actions{width:220px;}
  .muted-text{color:#6b7280;}
  .tb-message{padding:.55rem .7rem;border-radius:8px;margin:.35rem 0;font-weight:600;}
  .tb-message-error{background:#fef2f2;color:#991b1b;border:1px solid #fecaca;}

/* Template style block */
.tb-layout-scope-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.7rem;
    margin-top: 0.8rem;
    padding: 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
  }
  .tb-layout-scope-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-width: min(100%, 240px);
  }
  .tb-layout-scope-bar label[hidden] {
    display: none !important;
  }
  .tb-layout-scope-bar span {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
  }
  .tb-layout-scope-bar select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    min-height: 2rem;
    padding: 0.35rem 0.42rem;
  }

/* Template style block */
.tb-shell { margin: 0; max-width: none; width: 100%; padding-top: 0.75rem; font-family: var(--app-font-family); }
  .tb-workspace {
    --tb-left-pane-width: 460px;
    display: grid;
    grid-template-columns: minmax(0, var(--tb-left-pane-width)) 10px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
  }
  .tb-workspace.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .tb-workspace.is-collapsed .tb-right { display: none; }
  .tb-workspace.is-collapsed .tb-pane-resizer { display: none; }
  .tb-workspace.is-collapsed .tb-left {
    width: min(100%, 1080px);
    max-width: 1080px;
    margin: 0 auto;
  }
  .tb-workspace.is-left-collapsed {
    grid-template-columns: 0 14px minmax(0, 1fr);
  }
  .tb-workspace.is-left-collapsed .tb-left {
    overflow: hidden;
  }
  .tb-workspace.is-left-collapsed .tb-panel,
  .tb-workspace.is-left-collapsed .tb-add { pointer-events: none; }
  .tb-workspace.is-left-collapsed .tb-pane-resizer {
    width: 14px;
  }
  .tb-pane-resizer {
    position: relative;
    width: 10px;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    background: transparent;
  }
  .tb-pane-resizer::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 4px;
    width: 2px;
    border-radius: 999px;
    background: #d1d5db;
  }
  .tb-pane-resizer:hover::before,
  .tb-workspace.is-left-collapsed .tb-pane-resizer::before,
  .tb-workspace.is-resizing .tb-pane-resizer::before {
    background: #94a3b8;
  }
  .tb-workspace.is-resizing .tb-left,
  .tb-workspace.is-resizing .tb-right {
    will-change: width;
    pointer-events: none;
  }
  .tb-pane-resizer:focus-visible {
    outline: none;
  }
  .tb-pane-resizer:focus-visible::before {
    background: #0f172a;
  }
  body.tb-pane-resizing,
  body.tb-pane-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
  }
  .tb-left { min-width: 0; width: var(--tb-left-pane-width); max-width: var(--tb-left-pane-width); display: flex; flex-direction: column; position: relative; z-index: 1; overflow: hidden; }
  .tb-workspace:not(.is-resizing):not(.is-collapsed):not(.is-left-collapsed) .tb-left { min-width: 220px; }
  .tb-panel { background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14); overflow: hidden; display: flex; flex-direction: column; min-height: 420px; }
  .tb-panel-head { padding: 1rem 1.1rem 0.75rem; border-bottom: 1px solid #e5e7eb; }
  .tb-panel-head h1 { margin: 0; font-size: 1.45rem; line-height: 1.1; color: #111827; }
  .tb-panel-head p { margin: 0.25rem 0 0; font-size: 0.84rem; }
  .tb-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 0.45rem;
    align-items: end;
    justify-content: start;
    padding: 0.62rem 0.7rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
  }
  .tb-filters label { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
  .tb-filters label[hidden] { display: none !important; }
  .tb-filters label.is-disabled { opacity: 0.56; }
  .tb-filters span { font-size: 0.75rem; font-weight: 700; color: #475569; }
  .tb-filters select {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.82rem;
    padding: 0.32rem 0.38rem;
    min-height: 1.95rem;
  }
  .tb-filters select:disabled {
    background: #eef2f7;
    color: #64748b;
    cursor: not-allowed;
  }
  .tb-search-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-width: 0;
  }
  .tb-search-actions .button,
  #tb-search-button {
    width: auto;
    min-width: 4.25rem;
    min-height: 1.95rem;
    padding: 0.32rem 0.72rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }
  .tb-search-actions #tb-search-button {
    border: 1px solid #133752;
    background: #133752;
    background-color: #133752;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(19, 55, 82, 0.24);
  }
  .tb-search-actions #tb-search-button:hover,
  .tb-search-actions #tb-search-button:focus {
    border-color: #0f2d44;
    background: #0f2d44;
    background-color: #0f2d44;
    color: #ffffff;
  }
  .tb-note { margin: 0.7rem 0.8rem 0; border: 1px solid #fde68a; background: #fefce8; color: #92400e; border-radius: 8px; padding: 0.42rem 0.5rem; font-size: 0.8rem; font-weight: 600; }
  .tb-note[hidden] { display: none !important; }
  .tb-messages { display: grid; gap: 0.45rem; margin: 0.7rem 0.8rem 0; }
  .tb-message { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; border-radius: 8px; padding: 0.42rem 0.5rem; font-size: 0.8rem; font-weight: 600; }
  .tb-message-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
  .tb-message-success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
  .tb-message-warning { border-color: #fde68a; background: #fefce8; color: #92400e; }
  .tb-grid-wrap {
    height: var(--tb-grid-wrap-height, clamp(340px, 68vh, 760px));
    max-height: var(--tb-grid-wrap-height, clamp(340px, 68vh, 760px));
    overflow: auto;
    background: #f4f5f7;
  }
  .tb-grid { width: 100%; min-width: 920px; border-collapse: collapse; table-layout: fixed; font-size: 0.86rem; color: #1f2937; }
  .tb-grid th, .tb-grid td { padding: 0.24rem 0.5rem; border: 1px solid #dde1e6; vertical-align: middle; }
  .tb-grid thead th { position: sticky; top: 0; z-index: 2; background: #133752; color: #f8fafc; text-align: left; font-weight: 700; }
  .tb-grid-filter-row td { background: #eaf1f8 !important; padding: 0.18rem 0.35rem; }
  .tb-grid-filter-input-wrap { position: relative; }
  .tb-grid-filter-icon { position: absolute; left: 0.4rem; top: 50%; transform: translateY(-50%); color: #64748b; display: inline-flex; align-items: center; cursor: pointer; }
  .tb-grid-filter-icon svg { width: 0.8rem; height: 0.8rem; display: block; }
  .tb-grid-filter-input { width: 100%; box-sizing: border-box; border: 1px solid #c7d2fe; border-radius: 6px; background: #fff; color: #1f2937; font: inherit; padding: 0.22rem 0.34rem 0.22rem 1.4rem; }
  .tb-grid-filter-input-wrap.is-value-filtered .tb-grid-filter-icon,
  .tb-grid-filter-input-wrap.is-condition-filtered .tb-grid-filter-icon { color: #0f766e; }
  .tb-filter-menu {
    position: fixed;
    min-width: 320px;
    max-width: min(420px, calc(100vw - 1rem));
    max-height: min(460px, calc(100vh - 1rem));
    overflow: hidden;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    z-index: 1600;
    display: flex;
    flex-direction: column;
  }
  .tb-filter-menu[hidden] { display: none !important; }
  .tb-filter-menu-sort {
    display: grid;
    gap: 0;
    border-bottom: 1px dotted #cccccc;
    padding: 0.18rem 0;
  }
  .tb-filter-menu-sort-btn {
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: left;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .tb-filter-menu-sort-btn:hover {
    background: #f3f4f6;
  }
  .tb-filter-menu-condition {
    display: block;
    border-bottom: 1px dotted #cccccc;
    padding: 0.12rem 0;
    background: #ffffff;
  }
  .tb-filter-menu-condition.is-open {
    display: block;
    padding: 0.12rem 0;
  }
  .tb-filter-menu-condition-toggle {
    width: 100%;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.26rem 0.5rem;
    cursor: pointer;
  }
  .tb-filter-menu-condition-toggle:hover {
    background: #f3f4f6;
  }
  .tb-filter-menu-condition-arrow {
    display: inline-block;
    font-size: 0.82rem;
    line-height: 1;
    color: #4b5563;
    transition: transform 120ms ease;
    transform: rotate(0deg);
  }
  .tb-filter-menu-condition.is-open .tb-filter-menu-condition-arrow {
    transform: rotate(90deg);
  }
  .tb-filter-menu-condition-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.32rem;
    padding: 0.2rem 0.45rem 0.36rem;
  }
  .tb-filter-menu-condition-body[hidden] {
    display: none !important;
  }
  .tb-filter-menu-condition-select,
  .tb-filter-menu-condition-value {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
    min-height: 1.6rem;
  }
  .tb-filter-menu-condition-value[disabled] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
  }
  .tb-filter-menu-link {
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .tb-filter-menu-link:hover {
    text-decoration: underline;
  }
  .tb-filter-menu-search-wrap {
    padding: 0.3rem 0.45rem 0;
  }
  .tb-filter-menu-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.24rem 0.28rem;
  }
  .tb-filter-menu-selection-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.24rem 0.45rem 0.22rem;
  }
  .tb-filter-menu-list {
    display: grid;
    gap: 0;
    padding: 0.22rem 0.4rem 0.3rem;
    overflow-y: auto;
    max-height: min(150px, calc(100vh - 12rem));
  }
  .tb-filter-menu-option {
    border: none;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.34rem;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 0.17rem 0.08rem;
    cursor: pointer;
  }
  .tb-filter-menu-option:hover,
  .tb-filter-menu-option:focus-within {
    background: #f3f4f6;
  }
  .tb-filter-menu-option-check {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
    accent-color: #2563eb;
    flex: 0 0 auto;
  }
  .tb-filter-menu-option-label {
    min-width: 0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tb-filter-menu-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    border-top: 1px dotted #cccccc;
    padding: 0.3rem 0.45rem 0.4rem;
    background: #ffffff;
  }
  .tb-filter-menu-cancel,
  .tb-filter-menu-apply {
    border-radius: 2px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 64px;
    height: 20px;
    padding: 0.18rem 0.5rem;
    cursor: pointer;
  }
  .tb-filter-menu-cancel {
    border: 1px solid #b9b9b9;
    background: #eeeeee;
    color: #111827;
  }
  .tb-filter-menu-apply {
    border: 1px solid #18804e;
    background: #0f9d58;
    color: #ffffff;
  }
  .tb-filter-menu-empty {
    padding: 0.4rem 0.18rem;
    color: #6b7280;
    font-size: 0.75rem;
    background: #ffffff;
  }
  .tb-grid tbody tr:nth-child(odd) td { background: #f5f6f8; }
  .tb-grid tbody tr:nth-child(even) td { background: #edf0f3; }
  .tb-row { cursor: pointer; }
  .tb-row:hover td, .tb-row.is-selected td { background: #dfeee7 !important; }
  .tb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  .tb-pill { display: inline-flex; align-items: center; justify-content: center; padding: 0.2rem 0.5rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #f1f5f9; color: #334155; font-size: 0.76rem; font-weight: 700; line-height: 1; }
  .tb-status, .tb-issue { display: inline-block; padding: 0.18rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1; }
  .tb-status.open { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
  .tb-status.lock { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
  .tb-status.ro { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
  .tb-issue { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
  .tb-empty td { text-align: center; color: #6b7280; padding: 1rem 0.75rem; background: #f9fafb !important; }
  .tb-actions { text-align: right; }
  .tb-menu { position: relative; display: inline-block; }
  .tb-dots { border: none; background: transparent; color: #374151; font-size: 1.28rem; line-height: 1; cursor: pointer; border-radius: 6px; padding: 0.16rem 0.34rem; min-width: 2rem; min-height: 1.8rem; }
  .tb-dots:hover { background: #e5e7eb; }
  .tb-menu-dd { display: none; position: absolute; right: 0; top: 1.8rem; min-width: 170px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14); overflow: hidden; z-index: 30; }
  .tb-menu.open .tb-menu-dd { display: block; }
  .tb-menu-dd a, .tb-menu-dd button { display: block; width: 100%; box-sizing: border-box; text-align: left; border: none; background: #fff; padding: 0.58rem 0.72rem; font: inherit; font-weight: 700; color: #111827; cursor: pointer; text-decoration: none; }
  .tb-menu-dd a:hover, .tb-menu-dd button:hover { background: #f3f4f6; }
  .tb-menu-dd button.danger { color: #b91c1c; }
  .tb-add { margin-top: 0.85rem; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1); padding: 0.42rem 0.7rem 0.75rem; }
  .tb-add summary { cursor: pointer; list-style: none; font-weight: 700; color: #1f2937; }
  .tb-add summary::-webkit-details-marker { display: none; }
  .tb-add-choice { margin-top: 0.75rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .tb-add-choice-btn { width: 100%; min-height: 2.2rem; white-space: normal; text-align: center; }
  .tb-add-choice-btn.is-active { background: #133752; color: #fff; border-color: #133752; }
  .tb-add-grid { margin-top: 0.65rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
  .tb-add-form { background: #f8fafc; border: 1px solid #d1d5db; border-radius: 8px; padding: 0.55rem; display: flex; flex-direction: column; gap: 0.32rem; }
  .tb-add-form[hidden] { display: none !important; }
  .tb-add-form label { font-size: 0.78rem; font-weight: 700; color: #334155; }
  .tb-add-form input, .tb-add-form select { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #1f2937; font: inherit; padding: 0.35rem 0.42rem; min-height: 2rem; }
  .tb-right { position: relative; z-index: 3; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14); overflow: hidden; display: flex; flex-direction: column; min-width: 0; min-height: clamp(420px, 84vh, 1040px); }
  .tb-right h2 { margin: 0; font-size: 1.1rem; line-height: 1.1; color: #111827; }
  .tb-right p { margin: 0.28rem 0 0; font-size: 0.84rem; }
  .tb-detail-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: var(--tb-detail-body-height, auto);
    max-height: var(--tb-detail-body-height, none);
    background: #f8fafc;
  }
  #tb-detail-frame { display: none; width: 100%; height: 100%; border: none; background: #fff; }
  .tb-right.has-selection #tb-detail-frame { display: block; }
  .tb-workspace.is-resizing #tb-detail-frame {
    pointer-events: none;
  }
  .tb-workspace.is-resizing .tb-detail-body::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: col-resize;
    background: transparent;
  }
  .tb-detail-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center; color: #6b7280; font-weight: 600; font-size: 0.95rem; }
  .tb-right.has-selection .tb-detail-empty { display: none; }
  .muted-text { color: #6b7280; }
  @media (max-width: 1280px) { .tb-workspace { --tb-left-pane-width: 430px; } .tb-add-grid { grid-template-columns: 1fr; } }
  @media (max-width: 1080px) {
    .tb-workspace { grid-template-columns: 1fr; }
    .tb-pane-resizer { display: none; }
    .tb-grid { min-width: 920px; }
    .tb-right { min-height: 560px; }
  }
  @media (max-width: 520px) {
    .tb-filters { grid-template-columns: 1fr; }
  }

/* Template style block */
.muted-text{color:#6b7280;}
  .lock-pill{display:inline-flex;align-items:center;padding:.1rem .45rem;border-radius:999px;background:#fef2f2;color:#991b1b;border:1px solid #fecaca;font-weight:700;font-size:.78rem;margin-right:.4rem;}
  .locked-note{margin:.2rem 0 .65rem 0;}
  .journal-audit{margin-top:.75rem;background:white;border:1px solid #e5e7eb;border-radius:8px;padding:.7rem .8rem;box-shadow:0 1px 3px rgba(0,0,0,.06);}
  .journal-audit summary{cursor:pointer;font-weight:700;list-style:none;display:flex;align-items:center;gap:.4rem;}
  .journal-audit summary::-webkit-details-marker{display:none;}
  .journal-audit summary::before{content:"";width:.42rem;height:.42rem;border-right:1.6px solid #334155;border-bottom:1.6px solid #334155;transform:translateY(-18%) rotate(45deg);transition:transform .15s ease;}
  .journal-audit[open] summary::before{transform:translateY(8%) rotate(-135deg);}
  .journal-audit-embed-wrap{
    margin-top:.55rem;
    border:1px solid #e5e7eb;
    border-radius:8px;
    background:#f8fafc;
    overflow:hidden;
    height:640px;
  }
  .journal-audit-embed-frame{
    display:block;
    width:100%;
    height:100%;
    border:0;
    background:#f8fafc;
  }
  .handsontable td,.handsontable th{font-size:.93rem;}
  .handsontable .htCore tbody td{font-variant-numeric:tabular-nums;}

/* Template style block */
.muted-text{color:#6b7280;}

/* Template style block */
.intercompany-journal-shell {
    min-height: 100vh;
    background: #f5f7fa;
    color: #111827;
    padding: 0.85rem;
    font-family: var(--app-font-family);
  }
  .intercompany-journal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 0.75rem;
  }
  .intercompany-journal-head h1 {
    margin: 0;
    font-size: 1.26rem;
    line-height: 1.12;
  }
  .intercompany-journal-head p {
    margin: 0.25rem 0 0;
    color: #667085;
    font-size: 0.84rem;
  }
  .journal-entry-form-head {
    align-items: center;
  }
  .journal-entry-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .journal-entry-form-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    height: 2.35rem;
    border: 1px solid #0f2d44;
    border-radius: 6px;
    padding: 0 0.85rem;
    background: #0f2d44;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
  }
  .journal-entry-form-save-btn:hover,
  .journal-entry-form-save-btn:focus-visible {
    background: #133752;
    border-color: #133752;
    color: #ffffff;
    outline: none;
  }
  .journal-entry-form-save-btn.manual-save-btn:hover,
  .journal-entry-form-save-btn.manual-save-btn:focus-visible,
  .journal-entry-form-save-btn.intercompany-save-btn:hover,
  .journal-entry-form-save-btn.intercompany-save-btn:focus-visible {
    background: #133752 !important;
    border-color: #133752 !important;
    color: #ffffff !important;
  }
  .journal-entry-form-save-btn svg {
    width: 1rem;
    height: 1rem;
  }
  .journal-entry-form-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #475569;
    font-size: 1.55rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
  }
  .journal-entry-form-close-btn:hover,
  .journal-entry-form-close-btn:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
  }
  .journal-period-field {
    position: relative;
  }
  .journal-period-trigger {
    width: 100%;
    min-height: 1.9rem;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.26rem 0.4rem;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.2;
    cursor: pointer;
  }
  .journal-period-trigger:hover,
  .journal-period-trigger:focus-visible {
    border-color: #94a3b8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.13);
  }
  .journal-period-trigger-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border: 0;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .journal-period-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 0.28rem);
    width: min(18rem, 82vw);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
    padding: 0.5rem;
    z-index: 7600;
  }
  .journal-period-menu[hidden] {
    display: none !important;
  }
  .journal-period-menu-head {
    display: grid;
    grid-template-columns: 1.8rem minmax(0, 1fr) 1.8rem;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
  }
  .journal-period-menu-head strong {
    text-align: center;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
  }
  .journal-period-menu-head button,
  .journal-period-month {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .journal-period-menu-head button {
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    line-height: 1;
  }
  .journal-period-menu-head button:disabled {
    color: #cbd5e1;
    background: #f8fafc;
    cursor: not-allowed;
  }
  .journal-period-months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .journal-period-month {
    min-height: 2rem;
    padding: 0.32rem 0.35rem;
  }
  .journal-period-menu-head button:hover:not(:disabled),
  .journal-period-month:hover,
  .journal-period-month:focus-visible {
    background: #f3f4f6;
    outline: none;
  }
  .journal-period-month.is-selected {
    border-color: #133752;
    background: #133752;
    color: #ffffff;
  }
  .journal-dimensions-control {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
  }
  .journal-dimensions-control > span {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 800;
  }
  .journal-dimensions-toggle {
    min-width: 0;
    width: 100%;
    min-height: 1.9rem;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.26rem 0.4rem;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .journal-dimensions-toggle:hover,
  .journal-dimensions-toggle:focus-visible {
    border-color: #94a3b8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.13);
  }
  .journal-dimensions-toggle:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
  }
  .journal-dimensions-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 0.28rem);
    width: min(320px, 82vw);
    max-height: min(320px, calc(100vh - 1rem));
    overflow: auto;
    border: 1px solid #d2d1d1;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    padding: 0.22rem 0.4rem 0.3rem;
    z-index: 7600;
  }
  .journal-dimensions-menu[hidden] {
    display: none !important;
  }
  .journal-dimensions-selection-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.24rem 0.45rem 0.22rem;
  }
  .journal-dimensions-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.34rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0;
    padding: 0.17rem 0.08rem;
    color: #111827;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: left;
  }
  .journal-dimensions-option:hover,
  .journal-dimensions-option:focus-within {
    background: #f3f4f6;
  }
  .journal-dimensions-option-check {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
    accent-color: #2563eb;
    flex: 0 0 auto;
  }
  .journal-dimensions-option-label,
  .journal-dimensions-empty {
    color: #334155;
    font-size: 0.75rem;
    font-weight: 400;
  }
  .journal-dimensions-option-label {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .journal-dimensions-empty {
    display: block;
    padding: 0.35rem 0.4rem;
    color: #94a3b8;
  }
  .intercompany-alert {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .intercompany-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .intercompany-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
    gap: 0.5rem;
    padding: 0.62rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    margin-bottom: 0.75rem;
  }
  .intercompany-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
  }
  .intercompany-controls span {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 800;
  }
  .intercompany-controls input,
  .intercompany-controls select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.82rem;
    min-height: 1.9rem;
    padding: 0.26rem 0.4rem;
  }
  .intercompany-wide {
    grid-column: span 2;
  }
  .intercompany-grid-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  .intercompany-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-wrap: wrap;
  }
  .intercompany-total-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    flex-wrap: wrap;
  }
  .intercompany-total-strip strong {
    color: #111827;
  }
  .intercompany-balance-status {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    min-height: 1.05rem;
    padding: 0.06rem 0.32rem;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
  }
  .intercompany-balance-status.is-balanced {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .intercompany-grid-actions {
    display: flex;
    gap: 0.45rem;
  }
  .intercompany-grid-actions button {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.42rem 0.68rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
  }
  .intercompany-save-btn {
    border-color: #0f2d44 !important;
    background: #0f2d44 !important;
    color: #ffffff !important;
  }
  .intercompany-grid-scroll {
    height: clamp(300px, 64vh, 760px);
    overflow: auto;
    background: #eef2f7;
  }
  .intercompany-grid {
    width: 100%;
    min-width: var(--journal-grid-min-width, 1060px);
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.82rem;
  }
  .intercompany-grid th,
  .intercompany-grid td {
    border: 1px solid #dde1e6;
    padding: 0;
  }
  .intercompany-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    text-align: left;
    padding: 0.25rem 0.4rem;
    font-weight: 800;
    line-height: 1.12;
  }
  .intercompany-grid input,
  .intercompany-grid select {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    min-height: 1.78rem;
    padding: 0.2rem 0.38rem;
  }
  .intercompany-grid input[data-col="debit"],
  .intercompany-grid input[data-col="credit"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .intercompany-grid select {
    appearance: auto;
    cursor: pointer;
    background: #ffffff;
  }
  .intercompany-grid input:focus,
  .intercompany-grid select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.32);
    outline-offset: -2px;
  }
  .intercompany-grid tbody tr:nth-child(odd) input {
    background: #f8fafc;
  }
  .intercompany-grid tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid #cbd5e1;
    background: #e5e7eb;
    color: #0f172a;
    padding: 0.24rem 0.45rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
  }
  .intercompany-grid-total-label {
    text-align: left;
  }
  .intercompany-grid-total-amount {
    text-align: right;
  }
  .intercompany-col-entry { width: 40px; }
  .intercompany-col-entity { width: 180px; }
  .intercompany-col-account { width: 150px; }
  .intercompany-col-name { width: 240px; }
  .intercompany-col-dimension { width: 140px; }
  .intercompany-col-amount { width: 130px; }
  @media (max-width: 980px) {
    .intercompany-controls {
      grid-template-columns: 1fr 1fr;
    }
    .intercompany-wide {
      grid-column: span 2;
    }
  }

/* Template style block */
.journal-query-shell {
        margin: 0;
        max-width: none;
        width: 100%;
        padding-top: 0.5rem;
        font-family: var(--app-font-family);
        height: calc(100vh - 86px);
        overflow: hidden;
    }
    .journal-query-shell.is-compact {
        padding-top: 0;
    }
    .journal-query-workspace {
        --journal-left-pane-width: 620px;
        display: grid;
        grid-template-columns: minmax(0, var(--journal-left-pane-width)) 10px minmax(0, 1fr);
        gap: 0;
        align-items: stretch;
        height: 100%;
        min-height: 0;
    }
    .journal-query-workspace.is-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }
    .journal-query-workspace.is-collapsed .journal-detail-col,
    .journal-query-workspace.is-collapsed .journal-pane-resizer {
        display: none;
    }
    .journal-query-workspace.is-collapsed .journal-query-window-left {
        width: min(100%, 1180px);
        max-width: 1180px;
        margin: 0 auto;
    }
    .journal-query-workspace.is-list-collapsed {
        grid-template-columns: 0 10px minmax(0, 1fr);
    }
    .journal-query-workspace.is-list-collapsed .journal-query-window-left {
        border: 0;
        box-shadow: none;
        overflow: hidden;
        visibility: hidden;
    }
    .journal-query-window {
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
        overflow: visible;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .journal-query-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        padding: 0.55rem 0.85rem 0.5rem;
        border-bottom: 1px solid #e5e7eb;
        flex-wrap: wrap;
    }
    .journal-toolbar {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }
    .journal-query-title-wrap h1 {
        margin: 0;
        font-size: 1.16rem;
        line-height: 1.12;
        color: #111827;
        font-weight: 700;
    }
    .journal-query-title-wrap p {
        margin: 0.16rem 0 0;
        font-size: 0.76rem;
    }
    .journal-actions-menu-wrap {
        position: relative;
    }
    .journal-actions-menu-trigger {
        width: 1.8rem;
        height: 1.8rem;
        border: none;
        border-radius: 4px;
        background: transparent;
        color: #374151;
        font-size: 1.22rem;
        font-weight: 400;
        line-height: 1;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .journal-actions-menu-trigger:hover {
        background: #f3f4f6;
    }
    .journal-actions-menu-trigger-disabled,
    .journal-actions-menu-trigger:disabled {
        color: #9ca3af;
        background: transparent;
        cursor: not-allowed;
        opacity: 0.62;
    }
    .journal-actions-menu-trigger-disabled:hover,
    .journal-actions-menu-trigger:disabled:hover {
        color: #9ca3af;
        background: transparent;
    }
    .journal-actions-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 0.35rem);
        min-width: 190px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
        padding: 0.35rem 0;
        z-index: 3700;
    }
    #journal-actions-menu {
        right: 1rem;
    }
    .journal-actions-menu[hidden] {
        display: none !important;
    }
    .journal-actions-menu a {
        display: block;
        padding: 0.45rem 0.7rem;
        color: #111827;
        text-decoration: none;
        font-size: 0.82rem;
    }
    .journal-actions-menu span {
        display: block;
        padding: 0.45rem 0.7rem;
        color: #94a3b8;
        font-size: 0.82rem;
        cursor: not-allowed;
    }
    .journal-actions-menu a:hover {
        background: #f3f4f6;
    }
    .journal-add-menu {
        right: auto;
        left: 0;
        min-width: 210px;
    }
    .journal-pane-resizer {
        position: relative;
        width: 10px;
        cursor: col-resize;
        user-select: none;
        touch-action: none;
        background: transparent;
    }
    .journal-pane-resizer::before {
        content: "";
        position: absolute;
        top: 0.5rem;
        bottom: 0.5rem;
        left: 4px;
        width: 2px;
        border-radius: 999px;
        background: #d1d5db;
    }
    .journal-pane-resizer:hover::before,
    .journal-query-workspace.is-resizing .journal-pane-resizer::before {
        background: #94a3b8;
    }
    body.journal-pane-resizing,
    body.journal-pane-resizing * {
        cursor: col-resize !important;
        user-select: none !important;
    }
    .journal-detail-col {
        min-width: 0;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .journal-detail-body {
        position: relative;
        min-height: 0;
        flex: 1;
        background: #f5f7fa;
    }
    #journal-detail-frame {
        width: 100%;
        height: 100%;
        min-height: 0;
        border: 0;
        background: #ffffff;
        display: none;
    }
    .journal-detail-col.has-selection #journal-detail-frame {
        display: block;
    }
    .journal-detail-col.has-selection .journal-detail-empty {
        display: none;
    }
    .journal-detail-empty {
        display: grid;
        place-items: center;
        min-height: clamp(360px, 76vh, 880px);
        color: #667085;
        font-size: 0.9rem;
        text-align: center;
        padding: 1rem;
    }
    .journal-grid-meta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
        min-height: 2rem;
        padding: 0.55rem 0.85rem;
        border-top: 1px solid #e5e7eb;
        background: #f8fafc;
        color: #475467;
        font-size: 0.78rem;
        line-height: 1.2;
        text-align: center;
        flex-wrap: wrap;
    }
    .journal-grid-meta strong {
        color: #111827;
        font-weight: 700;
    }
    .journal-grid-warning {
        color: #92400e;
        font-weight: 700;
    }
    .journal-grid-scroll {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: auto;
        background: #f4f5f7;
    }
    .journal-grid {
        width: 100%;
        min-width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 0.8rem;
        color: #1f2937;
    }
    .journal-grid th,
    .journal-grid td {
        padding: 0.16rem 0.38rem;
        border: 1px solid #dde1e6;
        white-space: nowrap;
        vertical-align: middle;
        text-align: left;
    }
    .journal-grid-head th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #133752;
        color: #f8fafc;
        font-weight: 700;
        box-sizing: border-box;
        height: 1.9rem;
        line-height: 1;
        padding: 0.1rem 0.2rem;
        font-size: 0.66rem;
        text-align: center;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        vertical-align: middle;
    }
    .journal-grid-head th::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 4;
        width: 1px;
        background: rgba(255, 255, 255, 0.86);
        pointer-events: none;
    }
    .journal-grid-head th:last-child::after {
        display: none;
    }
    .journal-grid-head-label {
        display: inline-block;
    }
    .journal-col-resize-handle {
        position: absolute;
        top: 0;
        right: -3px;
        bottom: 0;
        z-index: 5;
        width: 6px;
        cursor: col-resize;
        touch-action: none;
    }
    .journal-col-resize-handle::after {
        content: "";
        position: absolute;
        top: 0.34rem;
        right: 2px;
        bottom: 0.34rem;
        width: 1px;
        background: rgba(255, 255, 255, 0.72);
    }
    .journal-col-resize-handle:hover::after,
    .journal-col-resize-handle:focus-visible::after {
        width: 2px;
        background: #bfdbfe;
    }
    .journal-col-resize-handle:focus-visible {
        outline: 2px solid rgba(191, 219, 254, 0.85);
        outline-offset: -2px;
    }
    .journal-column-resizing {
        cursor: col-resize !important;
        user-select: none;
    }
    .journal-grid-filter-row td {
        background: #eaf1f8 !important;
        padding: 0.12rem 0.28rem;
    }
    .journal-grid-filter-input-wrap {
        position: relative;
    }
    .journal-grid-filter-icon {
        position: absolute;
        left: 0.28rem;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        pointer-events: auto;
        display: inline-flex;
        align-items: center;
        border-radius: 4px;
        padding: 0.1rem;
        cursor: pointer;
        user-select: none;
    }
    .journal-grid-filter-icon:hover {
        color: #1d4ed8;
        background: #dbeafe;
    }
    .journal-grid-filter-icon:focus-visible {
        outline: 2px solid rgba(37, 99, 235, 0.45);
        outline-offset: 1px;
    }
    .journal-grid-filter-icon svg {
        width: 0.66rem;
        height: 0.66rem;
    }
    .journal-grid-filter-input {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #c7d2fe;
        border-radius: 4px;
        min-height: 1.34rem;
        padding: 0.1rem 0.28rem 0.1rem 1.05rem;
        font: inherit;
        font-size: 0.72rem;
        background: #ffffff;
        color: #111827;
    }
    .journal-grid-filter-input::placeholder {
        color: #6b7280;
    }
    .journal-grid-filter-input-wrap.is-value-filtered .journal-grid-filter-icon,
    .journal-grid-filter-input-wrap.is-condition-filtered .journal-grid-filter-icon {
        color: #0f766e;
    }
    .journal-grid-filter-input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.17);
    }
    .journal-grid tbody tr:nth-child(odd) td {
        background: #f5f6f8;
    }
    .journal-grid tbody tr:nth-child(even) td {
        background: #edf0f3;
    }
    .journal-grid-row {
        cursor: default;
    }
    .journal-grid-row td {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .journal-grid-row:hover td,
    .journal-grid-row:focus-visible td,
    .journal-grid-row.is-selected td {
        background: #dfeee7 !important;
    }
    .journal-grid-row:focus-visible {
        outline: none;
    }
    .journal-badge {
        display: inline-block;
        padding: 0.18rem 0.5rem;
        border-radius: 999px;
        font-weight: 700;
        font-size: 0.85rem;
    }
    .journal-badge-mapped {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0;
    }
    .journal-badge-unmapped {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }
    .journal-badge-posted {
        background: #eef2ff;
        color: #3730a3;
        border: 1px solid #c7d2fe;
    }
    .journal-amount-cell {
        font-variant-numeric: tabular-nums;
    }
    .journal-currency-cell {
        font-variant-numeric: tabular-nums;
    }
    .journal-memo-cell {
        max-width: 380px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .journal-grid-empty td {
        text-align: center;
        color: #6b7280;
        padding: 1rem 0.75rem;
        background: #f9fafb !important;
    }
    .journal-company-col { width: 114px; }
    .journal-version-type-col { width: 66px; }
    .journal-version-name-col { width: 92px; }
    .journal-chart-col { width: 90px; }
    .journal-currency-col { width: 64px; }
    .journal-status-col { width: 86px; }
    .journal-type-col { width: 210px; max-width: 210px; }
    .journal-memo-col { width: 220px; }
    .journal-line-count-col { width: 50px; }
    .journal-type-cell {
        width: 210px;
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .journal-period-col { width: 84px; }
    .journal-local-col { width: 76px; }
    .journal-consolidated-col { width: 82px; }
    .journal-source-amount-col { width: 70px; }
    .journal-source-currency-col { width: 62px; }
    .journal-converted-amount-col { width: 76px; }
    .journal-converted-currency-col { width: 66px; }
    .journal-filter-menu {
        position: fixed;
        min-width: 320px;
        max-width: min(420px, calc(100vw - 1rem));
        max-height: min(460px, calc(100vh - 1rem));
        overflow: hidden;
        border: 1px solid #d2d1d1;
        border-radius: 2px;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
        z-index: 3600;
        display: flex;
        flex-direction: column;
    }
    .journal-filter-menu[hidden] {
        display: none !important;
    }
    .journal-filter-menu-sort {
        display: grid;
        gap: 0;
        border-bottom: 1px dotted #cccccc;
        padding: 0.18rem 0;
    }
    .journal-filter-menu-sort-btn {
        border: none;
        background: #ffffff;
        color: #111827;
        font: inherit;
        font-size: 0.75rem;
        line-height: 1.25;
        text-align: left;
        padding: 0.26rem 0.5rem;
        cursor: pointer;
    }
    .journal-filter-menu-sort-btn:hover {
        background: #f3f4f6;
    }
    .journal-filter-menu-condition {
        display: block;
        border-bottom: 1px dotted #cccccc;
        padding: 0.12rem 0;
        background: #ffffff;
    }
    .journal-filter-menu-condition.is-open {
        display: block;
        padding: 0.12rem 0;
    }
    .journal-filter-menu-condition-toggle {
        width: 100%;
        border: none;
        background: #ffffff;
        color: #111827;
        font: inherit;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.25;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.26rem 0.5rem;
        cursor: pointer;
    }
    .journal-filter-menu-condition-toggle:hover {
        background: #f3f4f6;
    }
    .journal-filter-menu-condition-arrow {
        display: inline-block;
        font-size: 0.82rem;
        line-height: 1;
        color: #4b5563;
        transition: transform 120ms ease;
        transform: rotate(0deg);
    }
    .journal-filter-menu-condition.is-open .journal-filter-menu-condition-arrow {
        transform: rotate(90deg);
    }
    .journal-filter-menu-condition-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.32rem;
        padding: 0.2rem 0.45rem 0.36rem;
    }
    .journal-filter-menu-condition-body[hidden] {
        display: none !important;
    }
    .journal-filter-menu-condition-select,
    .journal-filter-menu-condition-value {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        border: 1px solid #d2d1d1;
        border-radius: 2px;
        background: #ffffff;
        color: #1f2937;
        font: inherit;
        font-size: 0.75rem;
        line-height: 1.2;
        padding: 0.24rem 0.28rem;
        min-height: 1.6rem;
    }
    .journal-filter-menu-condition-value[disabled] {
        background: #f3f4f6;
        color: #6b7280;
        cursor: not-allowed;
    }
    .journal-filter-menu-search-wrap {
        padding: 0.3rem 0.45rem 0;
    }
    .journal-filter-menu-search {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #d2d1d1;
        border-radius: 2px;
        background: #fff;
        color: #1f2937;
        font: inherit;
        font-size: 0.75rem;
        line-height: 1.2;
        padding: 0.24rem 0.28rem;
    }
    .journal-filter-menu-selection-controls {
        display: flex;
        justify-content: flex-start;
        gap: 0.55rem;
        padding: 0.24rem 0.45rem 0.22rem;
    }
    .journal-filter-menu-link {
        border: none;
        background: none;
        color: #2563eb;
        font: inherit;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }
    .journal-filter-menu-link:hover {
        text-decoration: underline;
    }
    .journal-filter-menu-list {
        display: grid;
        gap: 0;
        padding: 0.22rem 0.4rem 0.3rem;
        overflow-y: auto;
        max-height: min(150px, calc(100vh - 12rem));
    }
    .journal-filter-menu-option {
        border: none;
        border-radius: 0;
        background: #ffffff;
        color: #111827;
        display: flex;
        align-items: center;
        gap: 0.34rem;
        font-size: 0.75rem;
        line-height: 1.2;
        padding: 0.17rem 0.08rem;
        cursor: pointer;
    }
    .journal-filter-menu-option:hover,
    .journal-filter-menu-option:focus-within {
        background: #f3f4f6;
    }
    .journal-filter-menu-option-check {
        width: 0.82rem;
        height: 0.82rem;
        margin: 0;
        accent-color: #2563eb;
        flex: 0 0 auto;
    }
    .journal-filter-menu-option-label {
        min-width: 0;
        color: #334155;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .journal-filter-menu-empty {
        padding: 0.4rem 0.18rem;
        color: #6b7280;
        font-size: 0.75rem;
        background: #ffffff;
    }
    .journal-filter-menu-foot {
        display: flex;
        justify-content: flex-end;
        gap: 0.55rem;
        border-top: 1px dotted #cccccc;
        padding: 0.3rem 0.45rem 0.4rem;
        background: #ffffff;
    }
    .journal-filter-menu-cancel,
    .journal-filter-menu-apply {
        border-radius: 2px;
        font: inherit;
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 1;
        min-width: 64px;
        height: 20px;
        padding: 0.18rem 0.5rem;
        cursor: pointer;
    }
    .journal-filter-menu-cancel {
        border: 1px solid #b9b9b9;
        background: #eeeeee;
        color: #111827;
    }
    .journal-filter-menu-apply {
        border: 1px solid #18804e;
        background: #0f9d58;
        color: #ffffff;
    }
    .muted-text {
        color: #6b7280;
    }
    @media (max-width: 1180px) {
        .journal-query-workspace {
            display: block;
        }
        .journal-pane-resizer,
        .journal-query-workspace.is-collapsed .journal-detail-col {
            display: none;
        }
        .journal-query-workspace:not(.is-collapsed) .journal-detail-col {
            display: flex;
            margin-top: 0.75rem;
        }
        .journal-grid-scroll {
            height: clamp(320px, 58vh, 760px);
        }
    }

/* Template style block */
.history-shell { margin: 0; padding-top: 0.5rem; }
  .history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.55rem; }
  .history-title { margin: 0; font-size: 1.35rem; line-height: 1.1; color: #111827; }
  .history-subtitle { margin-top: 0.25rem; font-size: 0.84rem; }
  .history-btn { border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #111827; text-decoration: none; padding: 0.35rem 0.7rem; font-size: 0.82rem; font-weight: 700; }
  .history-panel { border: 1px solid #d1d5db; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); overflow: hidden; }
  .history-table-wrap { max-height: calc(100vh - 170px); overflow: auto; background: #f4f5f7; }
  .history-table { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; font-size: 0.84rem; color: #1f2937; }
  #journal-history-table { min-width: 1160px; }
  #journal-history-table .journal-history-col-when { width: 13%; }
  #journal-history-table .journal-history-col-company { width: 14%; }
  #journal-history-table .journal-history-col-tb { width: 14%; }
  #journal-history-table .journal-history-col-chart { width: 8%; }
  #journal-history-table .journal-history-col-action { width: 10%; }
  #journal-history-table .journal-history-col-user { width: 22%; }
  #journal-history-table .journal-history-col-rows { width: 6%; }
  #journal-history-table .journal-history-col-details { width: 13%; }
  #journal-history-table th:nth-child(6),
  #journal-history-table td:nth-child(6) {
    white-space: nowrap;
  }
  .history-table th, .history-table td { border: 1px solid #dde1e6; padding: 0.25rem 0.46rem; vertical-align: middle; }
  .history-grid-head th { position: sticky; top: 0; background: #133752; color: #f8fafc; text-align: left; font-weight: 700; z-index: 2; }
  .history-filter-row th { position: sticky; top: 31px; background: #eaf1f8; z-index: 2; }
  .history-filter-input { width: 100%; box-sizing: border-box; border: 1px solid #c7d2fe; border-radius: 6px; padding: 0.22rem 0.35rem; font: inherit; background: #fff; color: #1f2937; }
  .history-row:nth-child(odd) td { background: #f5f6f8; }
  .history-row:nth-child(even) td { background: #edf0f3; }
  .history-row:hover td { background: #dfeee7 !important; }
  .history-empty { text-align: center; color: #6b7280; padding: 1rem 0.75rem; background: #f9fafb !important; }
  .history-link { color: #1d4ed8; font-weight: 700; text-decoration: none; }
  .history-link:hover { text-decoration: underline; }

/* Template style block */
.history-detail-shell { padding: 0.8rem 1rem; background: #fff; min-height: 100vh; color: #111827; }
  .history-detail-shell h1 { margin: 0 0 0.65rem; font-size: 1.25rem; }
  .meta { display: grid; gap: 0.25rem; margin-bottom: 0.9rem; font-size: 0.88rem; color: #374151; }
  .block { margin-bottom: 1rem; border: 1px solid #e5e7eb; border-radius: 10px; padding: 0.7rem; background: #fff; }
  .block h2 { margin: 0 0 0.45rem; font-size: 1rem; }
  .history-tsv { width: 100%; min-height: 170px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0.6rem; font: 12px/1.4 "Consolas", "Courier New", monospace; background: #f8fafc; resize: vertical; box-sizing: border-box; white-space: pre; }

/* Template style block */
.journal-entry-detail-shell {
    min-height: 100vh;
    background: #f5f7fa;
    color: #111827;
    padding: 0.85rem;
    font-family: var(--app-font-family);
  }
  .manual-journal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 0.75rem;
  }
  .manual-journal-head h1 {
    margin: 0;
    font-size: 1.26rem;
    line-height: 1.12;
  }
  .manual-journal-head p {
    margin: 0.25rem 0 0;
    color: #667085;
    font-size: 0.84rem;
  }
  .journal-entry-detail-head {
    align-items: flex-start;
  }
  .journal-entry-detail-title {
    min-width: 0;
  }
  .journal-entry-detail-title h1,
  .journal-entry-detail-title p {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .journal-entry-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .journal-entry-detail-menu-wrap {
    position: relative;
  }
  .journal-entry-detail-icon-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #344054;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .journal-entry-detail-icon-btn:hover,
  .journal-entry-detail-icon-btn:focus-visible {
    background: #eef2f7;
    color: #111827;
    outline: none;
  }
  .journal-entry-detail-edit-btn {
    min-width: 4.25rem;
    height: 2.35rem;
    border: 1px solid #0f2d44;
    border-radius: 6px;
    background: #0f2d44;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
  }
  .journal-entry-detail-edit-btn:hover,
  .journal-entry-detail-edit-btn:focus-visible {
    background: #133752;
    border-color: #133752;
    color: #ffffff;
    outline: none;
  }
  .journal-entry-detail-edit-btn-disabled,
  .journal-entry-detail-edit-btn:disabled {
    border-color: #d1d5db;
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
  }
  .journal-entry-detail-edit-btn-disabled:hover,
  .journal-entry-detail-edit-btn:disabled:hover {
    border-color: #d1d5db;
    background: #e5e7eb;
    color: #9ca3af;
  }
  .journal-entry-detail-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 180px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    padding: 0.25rem 0;
    z-index: 7200;
  }
  .journal-entry-detail-menu[hidden] {
    display: none !important;
  }
  .journal-entry-detail-menu-form {
    margin: 0;
  }
  .journal-entry-detail-menu a,
  .journal-entry-detail-menu button {
    display: block;
    width: 100%;
    border: none;
    background: #ffffff;
    padding: 0.5rem 0.7rem;
    color: #111827;
    text-decoration: none;
    font-size: 0.82rem;
    font-family: inherit;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
  }
  .journal-entry-detail-menu a:hover,
  .journal-entry-detail-menu a:focus-visible,
  .journal-entry-detail-menu button:hover:not(:disabled),
  .journal-entry-detail-menu button:focus-visible:not(:disabled) {
    background: #f3f4f6;
    outline: none;
  }
  .journal-entry-detail-menu .journal-entry-detail-menu-disabled,
  .journal-entry-detail-menu button:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .manual-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
    gap: 0.5rem;
    padding: 0.62rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    margin-bottom: 0.75rem;
  }
  .manual-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
  }
  .manual-controls span {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 800;
  }
  .manual-controls input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.82rem;
    min-height: 1.9rem;
    padding: 0.26rem 0.4rem;
  }
  .manual-controls input[readonly],
  .manual-grid input[readonly] {
    cursor: default;
  }
  .manual-wide {
    grid-column: span 2;
  }
  .manual-grid-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  .manual-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-wrap: wrap;
  }
  .manual-total-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    flex-wrap: wrap;
  }
  .manual-total-strip strong {
    color: #111827;
  }
  .manual-balance-status {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    min-height: 1.05rem;
    padding: 0.06rem 0.32rem;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }
  .manual-balance-status.is-balanced {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .manual-grid-scroll {
    height: clamp(300px, 64vh, 760px);
    overflow: auto;
    background: #eef2f7;
  }
  .manual-grid {
    width: 100%;
    min-width: var(--journal-grid-min-width, 900px);
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.82rem;
  }
  .manual-grid th,
  .manual-grid td {
    border: 1px solid #dde1e6;
    padding: 0;
  }
  .manual-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    text-align: left;
    padding: 0.25rem 0.4rem;
    font-weight: 800;
    line-height: 1.12;
  }
  .manual-grid input,
  .manual-grid select {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    min-height: 1.78rem;
    padding: 0.2rem 0.38rem;
  }
  .manual-grid input[data-col="debit"],
  .manual-grid input[data-col="credit"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .manual-grid select {
    appearance: auto;
    cursor: pointer;
    background: #ffffff;
  }
  .manual-grid tbody tr:nth-child(odd) input {
    background: #f8fafc;
  }
  .manual-empty {
    text-align: center !important;
    color: #667085;
    background: #ffffff !important;
    padding: 1rem !important;
  }
  .manual-col-entry { width: 40px; }
  .manual-col-entity { width: 170px; }
  .manual-col-account { width: 150px; }
  .manual-col-name { width: 240px; }
  .manual-col-dimension { width: 140px; }
  .manual-col-amount { width: 130px; }
  @media (max-width: 980px) {
    .manual-controls {
      grid-template-columns: 1fr 1fr;
    }
    .manual-wide {
      grid-column: span 2;
    }
  }

/* Template style block */
.muted-text{color:#6b7280;}
  .tb-warning-actions{display:flex;gap:.75rem;flex-wrap:wrap;margin:1rem 0;}
  .tb-warning-box{background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;padding:1rem;max-width:700px;}

/* Template style block */
.manual-detail-shell {
    min-height: 100vh;
    background: #f5f7fa;
    color: #111827;
    padding: 0.85rem;
    font-family: var(--app-font-family);
  }
  .manual-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  .manual-detail-head h1 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.1;
  }
  .manual-detail-head p {
    margin: 0.25rem 0 0;
    color: #667085;
    font-size: 0.84rem;
  }
  .manual-detail-btn {
    border: 1px solid #166534;
    border-radius: 7px;
    background: #166534;
    color: #ffffff;
    text-decoration: none;
    padding: 0.42rem 0.68rem;
    font-size: 0.82rem;
    font-weight: 800;
  }
  .manual-detail-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }
  .manual-detail-summary div {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.52rem 0.62rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  }
  .manual-detail-summary span {
    display: block;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.18rem;
  }
  .manual-detail-summary strong {
    color: #111827;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
  }
  .manual-detail-memo {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.65rem;
    font-size: 0.84rem;
  }
  .manual-detail-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
  }
  .manual-detail-grid-scroll {
    max-height: calc(100vh - 230px);
    overflow: auto;
    background: #eef2f7;
  }
  .manual-detail-grid {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.84rem;
  }
  .manual-detail-grid th,
  .manual-detail-grid td {
    border: 1px solid #dde1e6;
    padding: 0.34rem 0.45rem;
    text-align: left;
    white-space: nowrap;
  }
  .manual-detail-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    font-weight: 800;
  }
  .manual-detail-grid tbody tr:nth-child(odd) td {
    background: #f8fafc;
  }
  .amount-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .manual-empty {
    text-align: center !important;
    color: #667085;
    background: #ffffff !important;
    padding: 1rem !important;
  }
  @media (max-width: 980px) {
    .manual-detail-summary {
      grid-template-columns: 1fr 1fr;
    }
  }

/* Template style block */
.manual-journal-shell {
    min-height: 100vh;
    background: #f5f7fa;
    color: #111827;
    padding: 0.85rem;
    font-family: var(--app-font-family);
  }
  .manual-journal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 0.75rem;
  }
  .manual-journal-head h1 {
    margin: 0;
    font-size: 1.26rem;
    line-height: 1.12;
  }
  .manual-journal-head p {
    margin: 0.25rem 0 0;
    color: #667085;
    font-size: 0.84rem;
  }
  .manual-grid-actions button {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    padding: 0.42rem 0.68rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
  }
  .manual-save-btn {
    border-color: #0f2d44 !important;
    background: #0f2d44 !important;
    color: #ffffff !important;
  }
  .manual-alert {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .manual-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .manual-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: end;
    gap: 0.5rem;
    padding: 0.62rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    margin-bottom: 0.75rem;
  }
  .manual-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
  }
  .manual-controls span {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 800;
  }
  .manual-controls input,
  .manual-controls select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.82rem;
    min-height: 1.9rem;
    padding: 0.26rem 0.4rem;
  }
  .manual-wide {
    grid-column: span 2;
  }
  .manual-grid-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  .manual-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-wrap: wrap;
  }
  .manual-total-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    flex-wrap: wrap;
  }
  .manual-total-strip strong {
    color: #111827;
  }
  .manual-balance-status {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    min-height: 1.05rem;
    padding: 0.06rem 0.32rem;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }
  .manual-balance-status.is-balanced {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .manual-grid-actions {
    display: flex;
    gap: 0.45rem;
  }
  .manual-grid-scroll {
    height: clamp(300px, 64vh, 760px);
    overflow: auto;
    background: #eef2f7;
  }
  .manual-grid {
    width: 100%;
    min-width: var(--journal-grid-min-width, 900px);
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.82rem;
  }
  .manual-grid th,
  .manual-grid td {
    border: 1px solid #dde1e6;
    padding: 0;
  }
  .manual-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    text-align: left;
    padding: 0.25rem 0.4rem;
    font-weight: 800;
    line-height: 1.12;
  }
  .manual-grid input,
  .manual-grid select {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: #ffffff;
    color: #111827;
    font: inherit;
    min-height: 1.78rem;
    padding: 0.2rem 0.38rem;
  }
  .manual-grid select {
    appearance: auto;
    cursor: pointer;
    background: #ffffff;
  }
  .manual-grid input:focus,
  .manual-grid select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.32);
    outline-offset: -2px;
  }
  .manual-grid .journal-row-number-input,
  .intercompany-grid .journal-row-number-input {
    background: #f1f5f9 !important;
    color: #475569;
    cursor: default;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .manual-grid tbody tr:nth-child(odd) input {
    background: #f8fafc;
  }
  .manual-grid tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid #cbd5e1;
    background: #e5e7eb;
    color: #0f172a;
    padding: 0.24rem 0.45rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
  }
  .manual-grid tfoot,
  .manual-grid tfoot tr,
  .manual-grid tfoot td,
  .manual-grid-total-row td,
  .intercompany-grid tfoot,
  .intercompany-grid tfoot tr,
  .intercompany-grid tfoot td,
  .intercompany-grid-total-row td {
    background: #e5e7eb !important;
  }
  .manual-grid-total-label {
    text-align: left;
  }
  .manual-grid-total-amount {
    text-align: right;
  }
  .manual-col-entry { width: 40px; }
  .manual-col-account { width: 150px; }
  .manual-col-name { width: 240px; }
  .manual-col-dimension { width: 140px; }
  .manual-col-amount { width: 130px; }
  .manual-grid th.manual-col-entry,
  .manual-grid td:first-child,
  .intercompany-grid th.intercompany-col-entry,
  .intercompany-grid td:first-child {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
  }
  .manual-grid .journal-row-number-input,
  .intercompany-grid .journal-row-number-input {
    min-height: 1.78rem;
    padding-left: 0.12rem !important;
    padding-right: 0.12rem !important;
  }
  .manual-controls .journal-dimensions-menu input.journal-dimensions-option-check,
  .intercompany-controls .journal-dimensions-menu input.journal-dimensions-option-check {
    appearance: auto;
    -webkit-appearance: checkbox;
    width: 13px !important;
    min-width: 13px !important;
    max-width: 13px !important;
    height: 13px !important;
    min-height: 13px !important;
    max-height: 13px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: initial;
    border-radius: 0;
    background: initial;
    accent-color: #2563eb;
    flex: 0 0 13px;
  }
  .manual-controls .journal-period-trigger > span:first-child,
  .manual-controls .journal-dimensions-toggle > span:first-child,
  .intercompany-controls .journal-period-trigger > span:first-child,
  .intercompany-controls .journal-dimensions-toggle > span:first-child {
    min-width: 0;
    color: #111827;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .manual-controls .journal-period-trigger > .journal-period-trigger-caret,
  .manual-controls .journal-dimensions-toggle > .journal-period-trigger-caret,
  .intercompany-controls .journal-period-trigger > .journal-period-trigger-caret,
  .intercompany-controls .journal-dimensions-toggle > .journal-period-trigger-caret {
    position: relative;
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    margin-left: auto;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  .manual-controls .journal-period-trigger > .journal-period-trigger-caret::before,
  .manual-controls .journal-dimensions-toggle > .journal-period-trigger-caret::before,
  .intercompany-controls .journal-period-trigger > .journal-period-trigger-caret::before,
  .intercompany-controls .journal-dimensions-toggle > .journal-period-trigger-caret::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 45%;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid #111827;
    border-bottom: 2px solid #111827;
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: center;
  }
  .manual-controls .journal-dimensions-menu .journal-dimensions-option,
  .intercompany-controls .journal-dimensions-menu .journal-dimensions-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.34rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.17rem 0.08rem;
    text-align: left;
  }
  .manual-controls .journal-dimensions-menu .journal-dimensions-option-label,
  .intercompany-controls .journal-dimensions-menu .journal-dimensions-option-label {
    min-width: 0;
    flex: 1 1 auto;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .manual-controls select,
  .manual-controls .journal-period-trigger,
  .manual-controls .journal-dimensions-toggle,
  .intercompany-controls select,
  .intercompany-controls .journal-period-trigger,
  .intercompany-controls .journal-dimensions-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.48rem center !important;
    background-size: 0.72rem 0.72rem !important;
    padding-right: 1.55rem !important;
  }
  .manual-controls .journal-period-trigger > .journal-period-trigger-caret,
  .manual-controls .journal-dimensions-toggle > .journal-period-trigger-caret,
  .intercompany-controls .journal-period-trigger > .journal-period-trigger-caret,
  .intercompany-controls .journal-dimensions-toggle > .journal-period-trigger-caret {
    display: none !important;
  }
  .manual-controls .journal-period-trigger > .journal-period-trigger-caret::before,
  .manual-controls .journal-dimensions-toggle > .journal-period-trigger-caret::before,
  .intercompany-controls .journal-period-trigger > .journal-period-trigger-caret::before,
  .intercompany-controls .journal-dimensions-toggle > .journal-period-trigger-caret::before {
    content: none !important;
  }
  .manual-controls .journal-dimensions-menu label.journal-dimensions-option,
  .intercompany-controls .journal-dimensions-menu label.journal-dimensions-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.34rem !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0.17rem 0.08rem !important;
    text-align: left !important;
  }
  .manual-controls .journal-dimensions-menu label.journal-dimensions-option > input.journal-dimensions-option-check,
  .intercompany-controls .journal-dimensions-menu label.journal-dimensions-option > input.journal-dimensions-option-check {
    order: 0 !important;
    align-self: center !important;
    flex: 0 0 13px !important;
    margin: 0 !important;
  }
  .manual-controls .journal-dimensions-menu label.journal-dimensions-option > span.journal-dimensions-option-label,
  .intercompany-controls .journal-dimensions-menu label.journal-dimensions-option > span.journal-dimensions-option-label {
    order: 1 !important;
    align-self: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    color: #334155 !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .manual-grid input.journal-account-input,
  .intercompany-grid input.journal-account-input {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color-scheme: light;
    box-shadow: inset 0 0 0 9999px #ffffff;
  }
  .manual-grid tbody tr:nth-child(odd) input.journal-account-input,
  .intercompany-grid tbody tr:nth-child(odd) input.journal-account-input,
  .manual-grid tbody tr:nth-child(even) input.journal-account-input,
  .intercompany-grid tbody tr:nth-child(even) input.journal-account-input {
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: inset 0 0 0 9999px #ffffff;
  }
  .manual-grid input.journal-account-input::-webkit-calendar-picker-indicator,
  .intercompany-grid input.journal-account-input::-webkit-calendar-picker-indicator {
    background-color: #ffffff !important;
    border: 0 !important;
    box-shadow: inset 0 0 0 9999px #ffffff !important;
  }
  .manual-grid td.journal-account-cell,
  .intercompany-grid td.journal-account-cell {
    position: relative;
    background: #ffffff !important;
    cursor: pointer;
  }
  .manual-grid td.journal-account-cell::after,
  .intercompany-grid td.journal-account-cell::after {
    content: "";
    position: absolute;
    right: 0.45rem;
    top: 50%;
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.6px solid #111827;
    border-bottom: 1.6px solid #111827;
    pointer-events: none;
    transform: translateY(-62%) rotate(45deg);
  }
  .manual-grid input.journal-account-input,
  .intercompany-grid input.journal-account-input {
    padding-right: 1.35rem !important;
  }
  .journal-account-dropdown {
    position: fixed;
    z-index: 10030;
    overflow-y: auto;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
    color: #111827;
    font-size: 0.78rem;
    line-height: 1.25;
  }
  .journal-account-dropdown-option {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    font: inherit;
    padding: 0.34rem 0.5rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .journal-account-dropdown-option:hover,
  .journal-account-dropdown-option.is-active {
    background: #eaf2ff;
  }
  .journal-account-dropdown-code {
    color: #0f172a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .journal-account-dropdown-name {
    color: #334155;
    font-weight: 500;
  }
  .journal-account-dropdown-empty,
  .journal-account-dropdown-more {
    padding: 0.34rem 0.5rem;
    color: #64748b;
    font-size: 0.74rem;
    background: #ffffff;
  }
  @media (max-width: 980px) {
    .manual-controls {
      grid-template-columns: 1fr 1fr;
    }
    .manual-wide {
      grid-column: span 2;
    }
  }

/* Template style block */
.period-history-shell {
    color: #111827;
    padding: 0.85rem 0 1rem;
    font-family: var(--app-font-family);
  }
  .period-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }
  .period-history-head h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.1;
    font-weight: 800;
  }
  .period-history-head p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
  }
  .period-history-back {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.35rem 0.7rem;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
  }
  .period-history-controls {
    display: grid;
    grid-template-columns: minmax(130px, 160px) minmax(220px, 360px) minmax(120px, 150px);
    align-items: end;
    justify-content: start;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    margin-bottom: 0.75rem;
  }
  .period-history-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-width: 0;
  }
  .period-history-controls span {
    color: #475569;
    font-size: 0.74rem;
    font-weight: 800;
  }
  .period-history-controls select,
  .period-history-controls input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.86rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.45rem;
  }
  .period-history-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
  }
  .period-history-table-wrap {
    max-height: clamp(360px, 68vh, 760px);
    overflow: auto;
    background: #eef2f7;
  }
  .period-history-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.84rem;
  }
  .period-history-table th,
  .period-history-table td {
    border: 1px solid #dde1e6;
    padding: 0.43rem 0.5rem;
    text-align: left;
    vertical-align: top;
  }
  .period-history-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    font-weight: 800;
  }
  .period-history-table tbody tr:nth-child(odd) td {
    background: #f8fafc;
  }
  .period-history-table td strong,
  .period-history-table td small {
    display: block;
  }
  .period-history-table td small {
    margin-top: 0.1rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .period-history-badge {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 0.23rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
  }
  .period-history-details summary {
    cursor: pointer;
    color: #1d4ed8;
    font-weight: 800;
  }
  .period-history-snapshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-top: 0.5rem;
  }
  .period-history-snapshots h3 {
    margin: 0 0 0.25rem;
    color: #334155;
    font-size: 0.78rem;
  }
  .period-history-snapshots pre {
    margin: 0;
    max-height: 18rem;
    overflow: auto;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    padding: 0.55rem;
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre;
  }
  .period-history-empty {
    color: #64748b;
    text-align: center;
    font-weight: 700;
    padding: 1rem !important;
    background: #ffffff !important;
  }
  @media (max-width: 980px) {
    .period-history-controls,
    .period-history-snapshots {
      grid-template-columns: 1fr;
    }
  }

/* Template style block */
.periods-shell {
    color: #111827;
    padding: 0.85rem 0 1rem;
    font-family: var(--app-font-family);
  }
  .periods-shell .periods-alert,
  .periods-shell .periods-controls,
  .periods-shell .periods-panel,
  .periods-shell .periods-empty-panel {
    box-sizing: border-box;
    width: min(85%, 1050px);
    margin-left: auto;
    margin-right: auto;
  }
  .periods-edit-save-button,
  .period-settings-save,
  .coa-edit-save-button {
    min-width: 3.8rem;
    height: 2.2rem;
    border: 1px solid #133752;
    border-radius: 7px;
    background: #133752;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 0.65rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }
  .periods-edit-save-button:hover,
  .periods-edit-save-button:focus,
  .period-settings-save:hover,
  .period-settings-save:focus,
  .coa-edit-save-button:hover,
  .coa-edit-save-button:focus {
    background: #0f2d44;
    border-color: #0f2d44;
  }
  .periods-edit-save-button.is-editing {
    background: #133752;
    border-color: #133752;
  }
  .periods-edit-save-button:not(:disabled) {
    background: #133752 !important;
    border-color: #133752 !important;
    color: #ffffff !important;
    opacity: 1;
  }
  .periods-edit-save-button:disabled,
  .coa-edit-save-button:disabled {
    background: #e5e7eb !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 1;
    pointer-events: none;
  }
  .periods-menu {
    position: relative;
    flex: 0 0 auto;
  }
  .periods-menu .coa-icon-button {
    width: 2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #475569;
    font-size: 1.2rem;
    line-height: 1;
  }
  .periods-menu .coa-icon-button:hover,
  .periods-menu .coa-icon-button:focus {
    color: #133752;
    background: transparent;
  }
  .periods-menu-dropdown {
    min-width: 10.5rem;
    z-index: 30;
  }
  .periods-alert {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .periods-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .periods-controls {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) minmax(190px, 1.1fr) minmax(115px, 0.65fr) minmax(135px, 0.8fr);
    align-items: end;
    justify-content: stretch;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    margin-bottom: 0.75rem;
  }
  .periods-controls-title {
    grid-column: 1 / -1;
    margin: 0 0 0.1rem;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.15;
    font-weight: 800;
  }
  .periods-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-width: 0;
  }
  .periods-controls label[hidden] {
    display: none !important;
  }
  .periods-controls label > span {
    color: #475569;
    font-size: 0.74rem;
    font-weight: 800;
  }
  .periods-edit-save-button span,
  .coa-edit-save-button span {
    color: inherit !important;
    font: inherit;
    font-weight: inherit;
  }
  .periods-controls select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 0.86rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.45rem;
  }
  .periods-panel-year-control {
    display: inline-grid;
    grid-template-columns: 2rem auto 2rem;
    align-items: center;
    gap: 0.35rem;
  }
  .periods-year-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 2rem;
    min-height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #133752;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
  }
  .periods-year-arrow:hover,
  .periods-year-arrow:focus {
    border-color: #133752;
    background: #eef6ff;
  }
  .periods-year-arrow:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .periods-control-disabled span {
    color: #94a3b8;
  }
  .periods-control-disabled select,
  .periods-controls select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .periods-control-actions,
  .periods-edit-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-height: 2.1rem;
    justify-self: end;
  }
  .periods-panel-actions {
    align-self: center;
  }
  .periods-action {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
    min-height: 2.1rem;
    padding: 0.38rem 0.72rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
  }
  .periods-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
  }
  .periods-empty-panel {
    padding: 1rem;
  }
  .periods-empty-panel strong {
    display: block;
    color: #111827;
    font-size: 0.95rem;
  }
  .periods-empty-panel p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
  }
  .periods-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
  }
  .periods-panel-title,
  .periods-panel-head h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.2;
  }
  .periods-panel-head p {
    margin: 0.15rem 0 0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
  }
  .periods-panel-year-control .periods-year-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-sizing: border-box;
    width: 4.9rem;
    min-width: 4.9rem;
    min-height: 2rem;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    background-image: none !important;
    color: #334155;
    padding: 0.28rem 0.25rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    text-align: center;
    text-align-last: center;
  }
  .periods-panel-year-control .periods-year-select::-ms-expand {
    display: none;
  }
  .periods-table-wrap {
    max-height: clamp(360px, 68vh, 760px);
    overflow: auto;
    background: #eef2f7;
  }
  .periods-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.86rem;
  }
  .periods-table th,
  .periods-table td {
    border: 1px solid #dde1e6;
    padding: 0.43rem 0.5rem;
    text-align: left;
    vertical-align: middle;
  }
  .periods-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #133752;
    color: #f8fafc;
    font-weight: 800;
  }
  .periods-table tbody tr:nth-child(odd) td {
    background: #f8fafc;
  }
  .periods-table td.periods-status-cell {
    text-align: center;
  }
  .periods-table td strong {
    display: block;
    color: #111827;
    font-weight: 800;
  }
  .periods-table td small {
    display: block;
    margin-top: 0.1rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .periods-year-row td {
    background: #eff6ff !important;
    border-top: 2px solid #cbd5e1;
  }
  .periods-action-col {
    width: 160px;
  }
  .periods-actions form {
    margin: 0;
  }
  .periods-action {
    width: 120px;
  }
  .periods-shell:not(.periods-editing) .periods-table td.periods-actions .periods-muted {
    color: #94a3b8;
  }
  .periods-shell:not(.periods-editing) .periods-action {
    background: #f8fafc !important;
    border-color: #d1d5db !important;
    color: #94a3b8 !important;
  }
  .periods-action:disabled {
    opacity: 1;
    cursor: not-allowed;
  }
  .periods-action-close {
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  .periods-action-open {
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  .periods-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.2rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 0.23rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
  }
  .periods-badge-open {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
  }
  .periods-badge-closed,
  .periods-auto-complete {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
  }
  .periods-auto-pending {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
  }
  .periods-auto-failed {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
  }
  .periods-auto-not_required {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #475569;
  }
  .periods-muted {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
  }
  .periods-preview-modal[hidden] {
    display: none !important;
  }
  .periods-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
  }
  .periods-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
  }
  .periods-preview-dialog {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  }
  .periods-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.1rem;
  }
  .periods-preview-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 750;
    letter-spacing: 0;
  }
  .periods-preview-head p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.84rem;
  }
  .periods-preview-close {
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
  }
  .periods-preview-summary {
    display: grid;
    gap: 0.45rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.84rem;
  }
  .periods-preview-table-wrap {
    overflow: auto;
  }
  .periods-preview-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    font-size: 0.82rem;
  }
  .periods-preview-table th,
  .periods-preview-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.6rem;
    text-align: left;
    vertical-align: top;
  }
  .periods-preview-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: uppercase;
  }
  .periods-preview-table td strong,
  .periods-preview-table td span {
    display: block;
  }
  .periods-preview-table td span {
    margin-top: 0.12rem;
    color: #64748b;
  }
  .periods-preview-table input {
    width: 7.5rem;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f172a;
    font: inherit;
    padding: 0.38rem 0.48rem;
    text-align: right;
  }
  .periods-preview-empty {
    color: #64748b;
    text-align: center !important;
  }
  .periods-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1.1rem;
  }
  .periods-preview-primary,
  .periods-preview-secondary {
    min-width: 8.75rem;
    min-height: 2.35rem;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    padding: 0.5rem 0.85rem;
  }
  .periods-preview-primary {
    border: 1px solid #166534;
    background: #166534;
    color: #ffffff;
  }
  .periods-preview-secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
  }
  @media (max-width: 980px) {
    .periods-shell .periods-alert,
    .periods-shell .periods-controls,
    .periods-shell .periods-panel,
    .periods-shell .periods-empty-panel {
      width: 100%;
    }
    .periods-controls {
      grid-template-columns: 1fr;
    }
    .periods-controls label {
      grid-column: 1 / -1;
    }
    .periods-control-actions {
      grid-column: 1 / -1;
      justify-content: flex-end;
    }
  }

/* Template style block */
.period-settings-shell {
    color: #111827;
    padding: 0.85rem 0 1rem;
    font-family: var(--app-font-family);
  }
  .period-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
    padding: 0 1rem;
  }
  .period-settings-shell .period-settings-head,
  .period-settings-shell .coa-settings-stack {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
  }
  .period-settings-head h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.1;
    font-weight: 800;
  }
  .period-settings-alert {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
  }
  .period-settings-alert ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
  }
  .period-settings-alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
  }
  .period-settings-panel {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
  }
  .period-settings-policy-form {
    margin: 0;
  }
  .period-settings-change-warning[hidden] {
    display: none !important;
  }
  .period-settings-table-wrap {
    overflow: auto;
    margin-top: 0;
    background: #ffffff;
  }
  .period-settings-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #1f2937;
    font-size: 0.86rem;
  }
  .period-settings-table th,
  .period-settings-table td {
    border-bottom: 1px solid #eef0f3;
    padding: 0.55rem 0.6rem;
    text-align: left;
    vertical-align: middle;
    white-space: normal;
  }
  .period-settings-table th {
    background: #f9fafb;
    color: #4b5563;
    font-weight: 800;
  }
  .period-settings-table tbody tr:nth-child(odd) td {
    background: #f8fafc;
  }
  .period-settings-table td strong,
  .period-settings-table td small {
    display: block;
  }
  .period-settings-table td small {
    margin-top: 0.12rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .period-settings-table select {
    width: min(100%, 13rem);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    min-height: 2.1rem;
    padding: 0.35rem 0.45rem;
  }
  .period-settings-table select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
  }
  .period-settings-current {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    color: #0f172a;
    font-weight: 800;
  }
  .period-settings-select-wrap {
    display: grid;
    gap: 0.22rem;
    max-width: 13rem;
  }
  .period-settings-select-wrap[hidden],
  .period-settings-current[hidden] {
    display: none !important;
  }
  .period-settings-select-wrap > span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
  }
  .period-settings-row-actions {
    width: 8rem;
  }
  .period-settings-row-changed td {
    background: #fffbeb !important;
  }
  .period-settings-locked-row td {
    background: #f3f4f6 !important;
  }
  .period-settings-locked-value {
    display: block;
    color: #334155;
    font-weight: 800;
  }
  .period-settings-empty {
    color: #64748b;
    text-align: center !important;
    font-weight: 700;
    padding: 1rem !important;
    background: #ffffff !important;
  }
  .period-settings-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.7rem 0.75rem;
  }
  .period-settings-actions[hidden] {
    display: none !important;
  }
  @media (max-width: 720px) {
    .period-settings-shell .period-settings-head,
    .period-settings-shell .coa-settings-stack {
      width: 100%;
    }
    .period-settings-head {
      align-items: center;
    }
    .period-settings-table {
      min-width: 520px;
    }
  }

/* Template style block */
.refresh-history-shell {
        max-width: 1220px;
        margin: 0 auto;
        padding-top: 1rem;
        color: #0f172a;
        font-family: var(--app-font-family);
    }
    .refresh-settings-shell {
        max-width: 720px;
    }
    .refresh-history-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .refresh-history-export {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.15rem;
        padding: 0.42rem 0.72rem;
        border: 1px solid #2f8550;
        border-radius: 7px;
        background: #ffffff;
        color: #166534;
        font-size: 0.86rem;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        white-space: nowrap;
    }
    .refresh-history-export:hover,
    .refresh-history-export:focus {
        background: #ecfdf3;
        color: #14532d;
        text-decoration: none;
    }
    .refresh-history-detail-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2rem;
        padding: 0.35rem 0.65rem;
        border: 1px solid #2f8550;
        border-radius: 7px;
        background: #ffffff;
        color: #166534;
        font-size: 0.8rem;
        font-weight: 800;
        line-height: 1.2;
        text-decoration: none;
        white-space: nowrap;
    }
    .refresh-history-detail-link:hover,
    .refresh-history-detail-link:focus {
        background: #ecfdf3;
        color: #14532d;
        text-decoration: none;
    }
    .refresh-history-head h1 {
        margin: 0;
        font-size: 1.55rem;
        line-height: 1.15;
    }
    .refresh-history-head p {
        margin: 0.35rem 0 0;
        color: #64748b;
        font-size: 0.9rem;
    }
    .refresh-history-panel {
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        overflow: hidden;
    }
    .refresh-history-panel + .refresh-history-panel {
        margin-top: 1rem;
    }
    .refresh-history-panel > h2,
    .refresh-history-panel > p,
    .refresh-history-panel > .refresh-settings-form,
    .refresh-history-panel > .tb-message {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    .refresh-history-panel > h2 {
        margin-bottom: 0;
        padding-top: 0.9rem;
    }
    .refresh-history-panel > .refresh-settings-form,
    .refresh-history-panel > .tb-message {
        margin-top: 0.85rem;
        margin-bottom: 1rem;
    }
    .refresh-settings-field {
        display: inline-grid;
        gap: 0.25rem;
        color: #334155;
        font-size: 0.82rem;
        font-weight: 800;
    }
    .refresh-settings-card {
        padding: 1rem 1.1rem 1.1rem;
        border-color: #cbd7e5;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    }
    .refresh-settings-card > h2 {
        margin: 0 0 0.9rem;
        padding: 0;
        color: #0f172a;
        font-size: 1.02rem;
        line-height: 1.2;
    }
    .refresh-settings-form-card {
        display: grid;
        gap: 1rem;
    }
    .refresh-settings-row {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px);
        gap: 1rem;
        align-items: end;
    }
    .refresh-settings-group,
    .refresh-settings-time-field {
        display: grid;
        gap: 0.42rem;
    }
    .refresh-settings-label,
    .refresh-settings-field > span {
        color: #334155;
        font-size: 0.78rem;
        font-weight: 900;
        letter-spacing: 0.01em;
    }
    .refresh-settings-time-field select {
        height: 2.25rem;
        min-width: 0;
        border: 1px solid #b8c7d8;
        border-radius: 7px;
        background: #ffffff;
        color: #0f172a;
        font: inherit;
        font-size: 0.86rem;
        font-weight: 700;
        padding: 0 0.6rem;
    }
    .refresh-toggle-grid {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: wrap;
    }
    .refresh-toggle-option {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        min-height: 2.25rem;
        padding: 0 0.72rem;
        border: 1px solid #b8c7d8;
        border-radius: 7px;
        background: #ffffff;
        color: #334155;
        font-size: 0.86rem;
        font-weight: 800;
        cursor: pointer;
        transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    }
    .refresh-toggle-option:hover {
        border-color: #315f8c;
        background: #f5f9fd;
    }
    .refresh-toggle-option input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }
    .refresh-toggle-box {
        width: 0.95rem;
        height: 0.95rem;
        border: 1.5px solid #8aa0b8;
        border-radius: 4px;
        background: #ffffff;
        box-shadow: inset 0 0 0 2px #ffffff;
    }
    .refresh-toggle-option input:checked + .refresh-toggle-box {
        border-color: #1d4f7a;
        background: #1d4f7a;
    }
    .refresh-toggle-option input:checked + .refresh-toggle-box::after {
        content: "";
        display: block;
        width: 0.26rem;
        height: 0.48rem;
        margin: 0.08rem auto 0;
        border: solid #ffffff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }
    .refresh-toggle-option:has(input:checked) {
        border-color: #1d4f7a;
        background: #e8f1f8;
        color: #133752;
    }
    .refresh-settings-actions {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding-top: 0.2rem;
    }
    .refresh-settings-save {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.15rem;
        padding: 0.42rem 0.85rem;
        border: 1px solid #1d4f7a;
        border-radius: 7px;
        background: #1d4f7a;
        color: #ffffff;
        font-size: 0.84rem;
        font-weight: 900;
        line-height: 1;
    }
    .refresh-settings-save:hover,
    .refresh-settings-save:focus {
        background: #133752;
        border-color: #133752;
    }
    .refresh-settings-meta {
        color: #64748b;
        font-size: 0.8rem;
        font-weight: 700;
    }
    @media (max-width: 720px) {
        .refresh-settings-row {
            grid-template-columns: 1fr;
        }
        .refresh-settings-actions {
            align-items: flex-start;
            flex-direction: column;
        }
    }
    .refresh-history-table-wrap {
        max-height: calc(100vh - 160px);
        overflow: auto;
        background: #f4f6f8;
    }
    .refresh-history-table {
        width: 100%;
        min-width: 1120px;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 0.84rem;
    }
    .refresh-history-public-table {
        min-width: 420px;
    }
    .refresh-history-table th,
    .refresh-history-table td {
        border: 1px solid #dde3ea;
        padding: 0.4rem 0.5rem;
        text-align: left;
        vertical-align: middle;
        overflow-wrap: anywhere;
    }
    .refresh-history-grid-head th {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #133752;
        color: #f8fafc;
        font-weight: 800;
    }
    .refresh-history-filter-row th {
        position: sticky;
        top: 32px;
        z-index: 3;
        background: #eaf1f8;
    }
    .refresh-history-filter {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        background: #ffffff;
        color: #111827;
        font: inherit;
        font-size: 0.78rem;
        padding: 0.24rem 0.34rem;
    }
    .refresh-history-row:nth-child(odd) td {
        background: #fbfcfe;
    }
    .refresh-history-row:nth-child(even) td {
        background: #f2f5f8;
    }
    .refresh-history-row:hover td {
        background: #e7f1ec !important;
    }
    .refresh-history-row.status-failed td {
        background: #fff7f7;
    }
    .refresh-history-row.status-cancelled td {
        background: #fffbeb;
    }
    .refresh-history-status-pill {
        display: inline-flex;
        align-items: center;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        background: #ffffff;
        color: #334155;
        font-size: 0.74rem;
        font-weight: 800;
        line-height: 1;
        padding: 0.2rem 0.52rem;
        white-space: nowrap;
    }
    .status-failed .refresh-history-status-pill {
        border-color: #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }
    .refresh-history-status-pill.status-failed {
        border-color: #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }
    .status-cancelled .refresh-history-status-pill {
        border-color: #fde68a;
        background: #fffbeb;
        color: #92400e;
    }
    .refresh-history-status-pill.status-cancelled {
        border-color: #fde68a;
        background: #fffbeb;
        color: #92400e;
    }
    .refresh-history-status-pill.status-complete {
        border-color: #bbf7d0;
        background: #f0fdf4;
        color: #166534;
    }
    .refresh-history-status-pill.status-warning {
        border-color: #fde68a;
        background: #fffbeb;
        color: #92400e;
    }
    .refresh-history-progress {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 0.42rem;
        min-width: 0;
        color: #475569;
        font-size: 0.76rem;
        font-weight: 700;
    }
    .refresh-history-progress-bar {
        height: 0.42rem;
        border-radius: 999px;
        background: #e5e7eb;
        overflow: hidden;
    }
    .refresh-history-progress-bar div {
        height: 100%;
        background: #16a34a;
    }
    .status-failed .refresh-history-progress-bar div {
        background: #dc2626;
    }
    .status-cancelled .refresh-history-progress-bar div {
        background: #d97706;
    }
    .refresh-history-failure {
        color: #991b1b;
    }
    .refresh-history-empty {
        color: #64748b;
        text-align: center;
        padding: 1rem 0.75rem;
        background: #ffffff !important;
    }
    .refresh-detail-shell {
        max-width: 980px;
    }
    .refresh-detail-alert {
        display: grid;
        gap: 0.25rem;
        margin-bottom: 1rem;
        padding: 0.8rem 0.95rem;
        border: 1px solid #fecaca;
        border-radius: 8px;
        background: #fef2f2;
        color: #7f1d1d;
    }
    .refresh-detail-alert strong {
        color: #991b1b;
        font-size: 0.94rem;
    }
    .refresh-detail-panel {
        padding: 1rem;
    }
    .refresh-detail-panel > h2 {
        margin: 0 0 0.85rem;
        padding: 0;
        color: #0f172a;
        font-size: 1rem;
    }
    .refresh-detail-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 0.7rem;
        margin: 0;
    }
    .refresh-detail-grid div {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
    }
    .refresh-detail-grid dt,
    .refresh-detail-current-step strong {
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }
    .refresh-detail-grid dd {
        margin: 0;
        color: #0f172a;
        font-size: 0.88rem;
        font-weight: 750;
        overflow-wrap: anywhere;
    }
    .refresh-detail-current-step {
        display: grid;
        gap: 0.22rem;
        margin-top: 0.9rem;
        padding-top: 0.85rem;
        border-top: 1px solid #e5e7eb;
    }
    .refresh-detail-current-step span {
        color: #334155;
        font-size: 0.88rem;
    }
    .refresh-detail-step-list {
        margin-top: 0;
    }
    .refresh-detail-empty {
        margin: 0;
        color: #64748b;
    }
    .refresh-detail-json {
        max-height: min(520px, calc(100vh - 260px));
        overflow: auto;
        margin: 0;
        padding: 0.85rem;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: #0f172a;
        color: #e5edf7;
        font-size: 0.78rem;
        line-height: 1.45;
        white-space: pre-wrap;
    }

/* Template style block */
.tb-history-shell {
    margin: 1rem 0 1.4rem;
    display: grid;
    gap: 0.85rem;
  }

  .tb-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
  }

  .tb-history-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.15;
    color: #111827;
  }

  .tb-history-subtitle {
    margin-top: 0.3rem;
  }

  .tb-history-back {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 7px;
    color: #1f2937;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.2;
    padding: 0.45rem 0.68rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
  }

  .tb-history-back:hover {
    background: #f8fafc;
    text-decoration: none;
  }

  .tb-history-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tb-history-stat {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: 0.34rem 0.58rem;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 600;
  }

  .tb-history-panel {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    overflow: hidden;
  }

  .tb-history-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 16rem);
  }

  .tb-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
  }

  .tb-history-table th,
  .tb-history-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.56rem 0.62rem;
    text-align: left;
    vertical-align: middle;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .tb-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef2f6;
    color: #1f2937;
    font-weight: 700;
    white-space: nowrap;
  }

  .tb-history-table tbody tr:nth-child(odd) {
    background: #fcfdff;
  }

  .tb-history-table tbody tr:hover {
    background: #f6f9fc;
  }

  .tb-history-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28rem 0.46rem;
  }

  .tb-history-user {
    color: #334155;
  }

  .tb-history-checksum {
    display: inline-block;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    padding: 0.16rem 0.4rem;
    font-size: 0.74rem;
    line-height: 1.2;
  }

  .tb-history-action-cell {
    text-align: right;
  }

  .tb-history-empty {
    color: #6b7280;
    font-style: italic;
  }

  .tb-history-detail-row td {
    background: #f8fafc;
    padding: 0.55rem 0.7rem;
  }

  .tb-history-snapshot summary {
    cursor: pointer;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.8rem;
  }

  .tb-history-snapshot pre {
    margin: 0.55rem 0 0;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    max-height: 22rem;
    overflow: auto;
    padding: 0.72rem;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre;
  }

/* Template style block */
/* Reuse COA styling (kept local so Trial Balance works even if COA CSS changes) */
  .coa-home-grid{display:grid;grid-template-columns:1fr;gap:1.5rem;}
  .tb-window-table-wrap{max-height:clamp(340px,68vh,760px);overflow:auto;scrollbar-gutter:stable;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);margin-top:.75rem;}
  .coa-section-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;}
  .coa-section-title{margin:0;}
  .coa-list{width:100%;border-collapse:collapse;background:white;margin-top:0;}
  .coa-list th,.coa-list td{border-bottom:1px solid #e5e7eb;padding:.6rem;vertical-align:middle;}
  .coa-list th{background:#f9fafb;text-align:left;font-weight:700;}
  .coa-list a{font-weight:700;text-decoration:none;}
  .coa-actions{display:flex;align-items:center;gap:.75rem;}
  .coa-col-actions{width:140px;}
  .tb-company-row{cursor:pointer;}
  .tb-company-row td{transition:background-color .12s ease;}
  .tb-company-row:hover td{background:#f3f4f6;}
  .tb-company-row:focus-visible td{outline:2px solid #9ca3af;outline-offset:-2px;}
  .tb-company-name-header{display:flex;flex-direction:column;gap:.35rem;}
  .tb-company-lookup{
    width:100%;
    max-width:360px;
    padding:.42rem .5rem;
    border:1px solid #d1d5db;
    border-radius:8px;
    background:#fff;
    font:inherit;
    font-weight:500;
  }
  .tb-company-row-highlight td{background:#e5e7eb;}
  .muted-text{color:#6b7280;}
  .tb-issue-mark{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1rem;
    height:1rem;
    margin-left:.35rem;
    border-radius:999px;
    background:#b91c1c;
    color:#fff;
    font-weight:800;
    font-size:.72rem;
    line-height:1;
  }

/* Template style block */
.handsontable td.tb-cell-invalid {
    background: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e;
  }

  .handsontable td.tb-cell-invalid input.tb-account-cell-input {
    background: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e;
  }

  .tb-validation-tooltip {
    position: fixed;
    z-index: 100000;
    max-width: min(22rem, calc(100vw - 1rem));
    padding: 0.55rem 0.7rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #7f1d1d;
    color: #fff;
    box-shadow: 0 14px 36px rgba(127, 29, 29, 0.24);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    pointer-events: none;
  }

  .tb-validation-tooltip[hidden] {
    display: none !important;
  }

  .tb-grid-shell {
    min-width: 0;
  }

  .tb-grid-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 34px;
    padding: 0.32rem clamp(7rem, 14vw, 16rem) 0.32rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #f8fafc;
    color: #0f172a;
  }

  .tb-grid-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    flex: 0 0 auto;
    min-height: 1.55rem;
    padding: 0.12rem 0.35rem;
    border: 1px solid #d8dee8;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .tb-grid-zoom-button {
    width: 1.35rem;
    height: 1.35rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }

  .tb-grid-zoom-button:hover:not(:disabled),
  .tb-grid-zoom-button:focus-visible:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
  }

  .tb-grid-zoom-button:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .tb-grid-zoom-track {
    position: relative;
    width: 3.8rem;
    height: 0.16rem;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .tb-grid-zoom-track::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--tb-grid-zoom-progress, 33.3%);
    border-radius: inherit;
    background: #2563eb;
  }

  .tb-grid-zoom-thumb {
    position: absolute;
    top: 50%;
    left: var(--tb-grid-zoom-progress, 33.3%);
    width: 0.52rem;
    height: 0.52rem;
    border: 1px solid #ffffff;
    border-radius: 999px;
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    transform: translate(-50%, -50%);
  }

  .tb-grid-zoom-label {
    min-width: 2.55rem;
    text-align: center;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .tb-selection-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    min-height: 30px;
    margin-left: 0;
    font-size: 0.78rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }

  .tb-selection-summary[hidden] {
    display: none !important;
  }

  .tb-selection-summary strong {
    color: #64748b;
    font-weight: 700;
    margin-right: 0.25rem;
  }

  #tb-hot .handsontable td,
  #tb-hot .handsontable th {
    font-size: var(--tb-grid-font-size, 0.93rem);
  }

  #tb-hot .handsontable textarea,
  #tb-hot .handsontable input {
    font-size: var(--tb-grid-font-size, 0.93rem);
  }

  @media (max-width: 900px) {
    .tb-grid-footer {
      align-items: flex-start;
      flex-wrap: wrap;
      padding-right: 0.75rem;
    }

    .tb-selection-summary {
      justify-content: flex-start;
      width: 100%;
    }
  }

  .handsontable td.tb-cell-period-locked {
    background: #f3f4f6 !important;
    color: #64748b !important;
  }

  .handsontable td.tb-account-dropdown-cell {
    position: relative;
    cursor: pointer;
    background: #ffffff !important;
    padding: 0 !important;
    overflow: hidden;
    vertical-align: middle;
  }

  .handsontable td.tb-account-dropdown-cell::after {
    content: "";
    position: absolute;
    right: 0.44rem;
    top: 50%;
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.6px solid #111827;
    border-bottom: 1.6px solid #111827;
    pointer-events: none;
    transform: translateY(-62%) rotate(45deg);
    z-index: 2;
  }

  .handsontable textarea.tb-account-editor-input,
  .handsontable input.tb-account-editor-input,
  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color-scheme: light;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 1.35rem !important;
  }

  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 23px;
    margin: 0 !important;
    box-sizing: border-box !important;
    padding: 0 1.35rem 0 0.35rem !important;
    font: inherit !important;
    line-height: normal;
    color: inherit !important;
  }

  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input:hover,
  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input:active,
  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input:focus,
  .handsontable td.tb-account-dropdown-cell input.tb-account-cell-input:focus-visible {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  .handsontable td.tb-cell-invalid,
  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid,
  .handsontable td.tb-cell-period-locked.tb-cell-invalid {
    background: #ffe3e3 !important;
    background-color: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e !important;
  }

  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid input.tb-account-cell-input,
  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid input.tb-account-cell-input:hover,
  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid input.tb-account-cell-input:active,
  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid input.tb-account-cell-input:focus,
  .handsontable td.tb-account-dropdown-cell.tb-cell-invalid input.tb-account-cell-input:focus-visible {
    background: #ffe3e3 !important;
    background-color: #ffe3e3 !important;
    box-shadow: inset 0 0 0 1px #cf2e2e !important;
  }

  .tb-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 0.45rem;
    margin: 0 0 0.18rem;
    position: relative;
    z-index: 5000;
  }

  .tb-header-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    grid-column: 2;
    grid-row: 1;
  }

  .tb-title {
    display: none;
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .tb-header-right {
    display: flex;
    align-items: center;
    gap: 0.28rem;
  }

  .tb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    justify-content: space-between;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .tb-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.42rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
  }

  .tb-edit-save-button {
    min-width: 4.25rem;
    height: 2.2rem;
  }

  .tb-year-control {
    margin-right: 0.16rem;
  }

  .tb-year-control .periods-year-select {
    min-width: 5.6rem;
  }

  .tb-settings-shell {
    padding-bottom: 1rem;
  }

  .tb-settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
  }

  .tb-settings-actions .form-select {
    min-height: 2.2rem;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 0.84rem;
    padding: 0.35rem 0.55rem;
  }

  .tb-settings-shell .tb-layout-scope-bar {
    margin: 0;
  }

  .tb-settings-shell .coa-grid-wrap {
    margin-top: 0;
  }

  .tb-sheet-context {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin: 0.45rem 0 0.35rem;
    min-height: 3.5rem;
    padding: 0.75rem 0.52rem;
    box-sizing: border-box;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .tb-sheet-context > span {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.55rem;
    padding: 0.16rem 0.42rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
  }

  .tb-sheet-context > .tb-sheet-context-year {
    gap: 0.38rem;
    padding: 0;
    border: none;
    background: transparent;
  }

  .tb-sheet-context .tb-year-control {
    display: inline-grid;
    grid-template-columns: 1.65rem 4.65rem 1.65rem;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
  }

  .tb-sheet-context .tb-year-control .periods-year-arrow {
    width: 1.65rem;
    min-height: 1.72rem;
    border: none;
    border-radius: 0;
    background: #f8fafc;
    color: #133752;
    font-size: 0.86rem;
  }

  .tb-sheet-context .tb-year-control .periods-year-arrow:first-child {
    border-right: 1px solid #e2e8f0;
  }

  .tb-sheet-context .tb-year-control .periods-year-arrow:last-child {
    border-left: 1px solid #e2e8f0;
  }

  .tb-sheet-context .tb-year-control .periods-year-select {
    width: 4.65rem;
    min-width: 4.65rem;
    min-height: 1.72rem;
    border: none;
    border-radius: 0 !important;
    background-color: #ffffff;
    font-size: 0.82rem;
    padding: 0.15rem 0.2rem;
  }

  .tb-sheet-context-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.32rem;
    margin-left: auto;
  }

  .tb-sheet-context-actions .tb-edit-save-button {
    min-width: 4rem;
    height: 2rem;
  }

  .tb-sheet-context-actions .tb-icon-button {
    width: 2.25rem;
    height: 2.25rem;
  }

  .tb-sheet-context-actions #tb-sheet-menu-toggle {
    color: #374151;
    font-size: 1.48rem;
    line-height: 1;
  }

  .tb-sheet-context-actions .tb-cancel-edit-button {
    width: 2rem;
    height: 2rem;
    color: #991b1b;
    font-size: 1.08rem;
    font-weight: 800;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
  }

  .tb-sheet-context-actions .tb-cancel-edit-button:hover,
  .tb-sheet-context-actions .tb-cancel-edit-button:focus {
    color: #7f1d1d;
    border-color: #fca5a5;
    background: #fee2e2;
  }

  .tb-sheet-context-actions .tb-cancel-edit-button[hidden] {
    display: none !important;
  }

  .tb-sheet-context strong {
    color: #0f172a;
    font-weight: 800;
  }

  .tb-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.24rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.16rem;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
  }

  .tb-nav-actions .btn {
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.32rem 0.46rem;
    text-decoration: none !important;
  }

  .tb-nav-actions .btn:hover,
  .tb-nav-actions .btn:focus {
    border-color: #cbd5e1;
    background: #fff;
    color: #111827;
  }

  .tb-nav-actions .tb-consolidated-link {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #065f46;
  }

  .tb-icon-button {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 700;
    line-height: 1;
  }

  .tb-icon-button:hover,
  .tb-icon-button:focus {
    color: #374151;
    background: transparent;
    outline: none;
  }

  .tb-icon-button svg {
    width: 0.92rem;
    height: 0.92rem;
  }

  .save-feedback-spinner {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 2px solid rgba(51, 65, 85, 0.25);
    border-top-color: currentColor;
    animation: save-spin 0.8s linear infinite;
  }

  .coa-icon-button.is-saving,
  .coa-icon-button.is-saved,
  .dimension-icon-button.is-saving,
  .dimension-icon-button.is-saved,
  .tb-icon-button.is-saving,
  .tb-icon-button.is-saved {
    width: auto;
    min-width: 4.4rem;
    gap: 0.35rem;
    padding: 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .coa-icon-button.is-saved,
  .dimension-icon-button.is-saved,
  .tb-icon-button.is-saved {
    color: #166534;
  }

  .manual-save-btn.is-saving,
  .intercompany-save-btn.is-saving,
  .cta-run-button.is-saving,
  .coa-edit-save-button.is-saving,
  .coa-edit-save-button.is-saved,
  .btn.is-saving {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    opacity: 0.86;
  }

  .coa-edit-save-button.is-saving:disabled {
    background: #133752 !important;
    border-color: #133752 !important;
    color: #ffffff !important;
    cursor: wait;
  }

  .coa-edit-save-button.is-saved,
  .coa-edit-save-button.is-saved:disabled {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
  }

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

  .tb-sheet-menu {
    position: relative;
    z-index: 5001;
  }

  .tb-sheet-menu-dropdown {
    position: absolute;
    right: 0;
    top: 2.35rem;
    min-width: 170px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
    overflow: hidden;
    z-index: 6000;
  }

  .tb-sheet-menu-dropdown[hidden] {
    display: none !important;
  }

  .tb-sheet-menu-dropdown button,
  .tb-sheet-menu-dropdown a {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    text-align: left;
    border: none;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
  }

  .tb-sheet-menu-dropdown button:hover,
  .tb-sheet-menu-dropdown a:hover {
    background: #f3f4f6;
  }

  .tb-sheet-menu-dropdown button:disabled,
  .tb-sheet-menu-dropdown button[aria-disabled="true"] {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
  }

  .tb-sheet-actions-dropdown {
    min-width: 220px;
  }

  .tb-sheet-actions-dropdown a,
  .tb-sheet-actions-dropdown button {
    white-space: nowrap;
  }

  .tb-actions a.btn:hover,
  .tb-actions a.btn:focus {
    text-decoration: none !important;
  }

  .tb-actions .form-select {
    width: auto;
    min-width: 170px;
    max-width: 280px;
    border-radius: 999px;
    min-height: 1.8rem;
    padding: 0.25rem 0.42rem;
    font-size: 0.8rem;
  }

  .tb-period-lock-note {
    margin: 0 0 0.24rem;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
  }

  .tb-consolidated-chart-form {
    margin: 0;
  }

  .tb-consolidated-chart-label {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
  }

  .tb-consolidated-chart-form .form-select {
    min-width: 280px;
    max-width: 380px;
  }

  .tb-consolidated-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.22rem 0.52rem;
    margin: 0 0 0.25rem;
    padding: 0.28rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 650;
  }

  .tb-consolidated-summary > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.08rem;
  }

  .tb-consolidated-journal-panel {
    margin: 0 0 0.25rem;
    padding: 0.42rem 0.55rem;
    box-shadow: none;
  }

  .tb-consolidated-journal-panel summary {
    font-size: 0.82rem;
  }

  .tb-consolidated-journal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 650;
  }

  .tb-consolidated-grid-wrap {
    margin-top: 0;
  }

  @media (max-width: 991px) {
    .tb-header {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: flex-start;
    }

    .tb-header-top {
      grid-column: 2;
      grid-row: 1;
    }

    .tb-actions {
      grid-column: 1 / -1;
      grid-row: 2;
    }

    .tb-action-group {
      width: 100%;
      border-radius: 14px;
    }

    .tb-actions .form-select {
      min-width: 0;
      max-width: none;
      width: 100%;
    }
  }

/* Template style block */
.coa-grid-wrap {
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    min-height: 0;
    overflow: hidden;
  }

/* Template style block */
.auth-field {
        display: grid;
        gap: 0.3rem;
        margin-bottom: 0.75rem;
    }
    .auth-field span {
        font-size: 0.85rem;
        font-weight: 700;
        color: #1f2937;
    }
    .auth-field input {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        padding: 0.52rem 0.6rem;
        font: inherit;
        color: #0f172a;
        width: 100%;
        box-sizing: border-box;
    }
    .auth-field input:focus {
        outline: 2px solid rgba(77, 167, 104, 0.25);
        outline-offset: 0;
        border-color: #4da768;
    }
    .auth-errors {
        margin: 0 0 0.8rem;
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #991b1b;
        border-radius: 8px;
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
    }
    .auth-errors p {
        margin: 0;
    }
    .auth-field-error {
        color: #b91c1c;
        font-size: 0.75rem;
        line-height: 1.2;
    }
    .auth-success {
        margin: 0 0 0.8rem;
        border: 1px solid #86efac;
        background: #f0fdf4;
        color: #166534;
        border-radius: 8px;
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
    }

/* Template style block */
.saas-home {
        margin: 0;
        padding: 0.8rem 0 1rem;
    }
    .saas-home-header {
        margin-bottom: 0.95rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .saas-home-header h1 {
        margin: 0;
        font-size: 1.7rem;
        line-height: 1.1;
        color: #0f172a;
        font-weight: 800;
        letter-spacing: -0.02em;
        text-align: left;
    }
    .saas-home-header p {
        margin: 0.4rem 0 0;
        color: #475569;
        font-size: 0.95rem;
        font-weight: 500;
        text-align: left;
    }
    .workflow-board {
        position: relative;
        left: 5%;
        width: min(100%, 1220px);
        margin: 0 auto;
        min-height: 620px;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }
    .workflow-lines {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        overflow: visible;
    }
    .workflow-lines line,
    .workflow-lines polyline {
        fill: none;
        stroke: #5f7794;
        stroke-width: 2;
        stroke-linecap: butt;
        stroke-linejoin: miter;
        vector-effect: non-scaling-stroke;
        shape-rendering: crispEdges;
        opacity: 0.95;
    }
    .workflow-node {
        position: absolute;
        display: inline-block;
        width: max-content;
        min-width: 0;
        max-width: none;
        text-decoration: none;
        color: #1e3a8a;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0.16rem 0.28rem;
        box-sizing: border-box;
        box-shadow: none;
        text-align: center;
        transform: translate(-50%, -50%);
        transition: transform 0.14s ease, color 0.14s ease;
        z-index: 2;
    }
    .workflow-node:hover {
        transform: translate(-50%, -52%);
        color: #2563eb;
        z-index: 8;
    }
    .workflow-node:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
        z-index: 8;
    }
    .node-logo {
        position: absolute;
        right: calc(100% + 0.46rem);
        top: 50%;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.55rem;
        height: 1.55rem;
        border-radius: 999px;
        color: #1e3a8a;
        background: #eaf1ff;
        border: 1px solid #93c5fd;
        flex: 0 0 auto;
        transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
    }
    .workflow-node:hover .node-logo {
        background: #dbeafe;
        border-color: #60a5fa;
        color: #1d4ed8;
        transform: translateY(-50%) scale(1.08);
    }
    .workflow-board.is-subscription-inactive .workflow-lines {
        opacity: 0.25;
    }
    .workflow-board.is-subscription-inactive .workflow-node:not(.node-organization) {
        color: #94a3b8;
        cursor: not-allowed;
        filter: grayscale(1);
        opacity: 0.44;
        pointer-events: none;
    }
    .workflow-board.is-subscription-inactive .workflow-node:not(.node-organization):hover {
        color: #94a3b8;
        transform: translate(-50%, -50%);
    }
    .workflow-board.is-subscription-inactive .workflow-node:not(.node-organization) .node-logo {
        background: #f1f5f9;
        border-color: #cbd5e1;
        color: #94a3b8;
    }
    .workflow-board.is-subscription-inactive .workflow-node:not(.node-organization):hover .node-logo {
        background: #f1f5f9;
        border-color: #cbd5e1;
        color: #94a3b8;
    }
    .node-logo svg {
        width: 1.15rem;
        height: 1.15rem;
    }
    .node-title {
        display: block;
        font-size: 0.98rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        line-height: 1.2;
        white-space: nowrap;
        min-width: 0;
    }
    .node-description {
        position: absolute;
        left: 50%;
        top: calc(100% + 0.42rem);
        width: 15.5rem;
        max-width: min(15.5rem, 72vw);
        transform: translate(-50%, -0.25rem);
        border: 1px solid #d7e2ef;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
        color: #475569;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.35;
        text-align: left;
        white-space: normal;
        padding: 0.54rem 0.62rem;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    }
    .workflow-node:hover .node-description,
    .workflow-node:focus-visible .node-description {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }
    .node-organization {
        left: 18%;
        top: 7%;
    }
    .node-fx {
        left: 18%;
        top: 26%;
    }
    .node-coa {
        left: 18%;
        top: 45%;
    }
    .node-journal {
        left: 35%;
        top: 45%;
    }
    .node-companies {
        left: 18%;
        top: 65%;
    }
    .node-trial {
        left: 35%;
        top: 65%;
    }
    .node-periods {
        left: 50%;
        top: 65%;
    }
    .node-mappings {
        left: 35%;
        top: 84%;
    }
    .node-reports {
        left: 65%;
        top: 65%;
    }
    .node-dimensions {
        left: 35%;
        top: 26%;
    }
    @media (max-width: 1120px) {
        .workflow-board {
            min-height: 560px;
        }
        .workflow-node {
            width: 170px;
            min-width: 170px;
            max-width: 170px;
        }
        .node-title {
            font-size: 0.92rem;
        }
    }
    @media (max-width: 920px) {
        .workflow-board {
            left: 0;
            min-height: auto;
            padding: 1rem;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.7rem;
            overflow: visible;
        }
        .workflow-lines {
            display: none;
        }
        .workflow-node {
            position: static;
            display: grid;
            grid-template-columns: 1.55rem minmax(0, 1fr);
            align-items: center;
            justify-content: start;
            column-gap: 0.46rem;
            width: auto;
            min-width: 0;
            max-width: none;
            text-align: left;
            transform: none;
        }
        .workflow-node:hover {
            transform: none;
        }
        .workflow-node:hover .node-logo {
            transform: none;
        }
        .workflow-board.is-subscription-inactive .workflow-node:not(.node-organization):hover {
            transform: none;
        }
        .node-logo {
            position: static;
            transform: none;
        }
        .node-description {
            grid-column: 2;
            position: static;
            width: auto;
            max-width: none;
            transform: none;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            padding: 0.12rem 0 0;
            opacity: 1;
            visibility: visible;
            color: #64748b;
            font-size: 0.76rem;
        }
    }

/* Chart detail refinements */
.coa-sheet-head {
    position: relative;
    z-index: 7000;
}

.coa-sheet-title-block {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.coa-sheet-kicker {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.coa-sheet-title-block h1 {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0;
    color: #111827;
    font-size: 1.34rem;
    line-height: 1.15;
}

.coa-sheet-currency {
    color: #9ca3af;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0;
}

.coa-inline-status {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.84rem;
}

.coa-sheet-actions {
    gap: 0.52rem;
    position: relative;
    z-index: 7100;
}

.coa-icon-button {
    width: 2.7rem;
    height: 2.7rem;
    font-size: 1.42rem;
    font-weight: 800;
    line-height: 1;
}

.coa-icon-button svg {
    width: 1.32rem;
    height: 1.32rem;
}

.coa-sheet-menu {
    position: relative;
    z-index: 7150;
}

.coa-sheet-menu-dropdown {
    top: 2.95rem;
    z-index: 7200;
}

.coa-grid-wrap {
    position: relative;
    z-index: 1;
}

.coa-grid-subbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0.5rem 0 0.55rem;
    color: #64748b;
    font-size: 0.84rem;
}

.coa-grid-subbar a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.coa-grid-subbar a:hover {
    text-decoration: underline;
}

.coa-map-disclosure {
    margin: 0.45rem 0 0.5rem;
    padding: 0;
    border-color: #d8dee8;
    border-radius: 8px;
    box-shadow: none;
    overflow: visible;
}

.coa-map-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 2.15rem;
    padding: 0.42rem 0.68rem;
    color: #111827;
    cursor: pointer;
    list-style: none;
    appearance: none;
    -webkit-appearance: none;
}

.coa-map-summary::marker {
    content: "";
    font-size: 0;
}

.coa-map-summary::-webkit-details-marker {
    display: none;
}

.coa-map-summary::after {
    content: "";
    width: 0.46rem;
    height: 0.46rem;
    flex: 0 0 auto;
    border-right: 2px solid #2563eb;
    border-bottom: 2px solid #2563eb;
    transform: rotate(45deg) translateY(-0.12rem);
    transition: transform 0.16s ease;
}

.coa-map-disclosure[open] .coa-map-summary::after {
    transform: rotate(225deg) translateY(-0.08rem);
}

.coa-map-summary-meta {
    margin-left: auto;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.coa-map-body {
    border-top: 1px solid #eef2f7;
    padding: 0.65rem 0.68rem 0.72rem;
}

.coa-map-disclosure .coa-add-map {
    justify-content: flex-start;
    margin: 0 0 0.58rem;
}

.coa-map-disclosure .coa-map-list {
    margin-top: 0;
}

.coa-map-disclosure .coa-map-row {
    border-radius: 8px;
    padding: 0.48rem 0.55rem;
}

.coa-grid-warning {
    margin: 0.48rem 0 0.55rem;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    background: #fef2f2;
    color: #7f1d1d;
    padding: 0.58rem 0.72rem;
    font-size: 0.86rem;
    line-height: 1.35;
}

.coa-grid-warning[hidden] {
    display: none !important;
}

.coa-grid-warning strong {
    color: #991b1b;
}

.coa-grid-warning div {
    margin-top: 0.16rem;
    white-space: pre-line;
}

.coa-grid-warning .muted-text {
    color: #7f1d1d;
}

.app-table-cell-selecting,
.app-table-cell-selecting * {
    cursor: cell !important;
    user-select: none !important;
}

table.app-cell-range-active td,
table.app-cell-range-active th {
    user-select: none;
}

td.app-cell-selection,
th.app-cell-selection {
    background: #dbeafe !important;
    color: #0f172a !important;
}

td.app-cell-selection input,
td.app-cell-selection select,
td.app-cell-selection textarea,
td.app-cell-selection [contenteditable='true'],
th.app-cell-selection input,
th.app-cell-selection select,
th.app-cell-selection textarea,
th.app-cell-selection [contenteditable='true'] {
    background: #dbeafe !important;
    color: #0f172a !important;
}

.app-cell-context-menu {
    position: fixed;
    z-index: 3800;
    min-width: 150px;
    color-scheme: light;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.app-cell-context-menu[hidden] {
    display: none !important;
}

.app-cell-context-menu button {
    border: none;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    padding: 0.42rem 0.55rem;
    text-align: left;
}

.app-cell-context-menu button:hover {
    background: #f3f4f6;
}

.app-cell-context-menu button:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.app-cell-context-menu button:disabled:hover {
    background: #ffffff;
}

/* Responsive normalization */
.saas-home,
.workflow-board,
.fs-report-workspace,
.fs-report-sidebar,
.fs-report-main,
.fs-report-library,
.fs-create-layout,
.fs-filter-bar,
.fs-query-builder-shell,
.fs-query-tree-pane,
.fs-source-tree-pane,
.fs-builder-wrap {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.saas-home-header,
.saas-home-header h1,
.saas-home-header p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1020px) {
    .workflow-board {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 920px) {
    .workflow-board {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    }

    .workflow-node {
        min-width: 0;
        overflow: visible;
    }

    .node-title {
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

@media (max-width: 760px) {
    .workflow-board {
        grid-template-columns: 1fr;
        padding: 0.7rem;
    }
}

.fs-report-workspace {
    width: 100%;
}

.fs-report-main > *,
.fs-top-toolbar,
.fs-create-header,
.fs-create-header-actions,
.fs-report-slicers,
.fs-report-slicer-control {
    min-width: 0;
    max-width: 100%;
}

.fs-report-slicer-control {
    flex: 0 1 220px;
    width: min(100%, 220px);
    min-width: min(100%, 150px);
    max-width: 240px;
}

.fs-report-slicer-control .fs-multi-filter-menu {
    max-width: calc(100vw - 2rem);
}

.fs-builder-wrap {
    width: 100%;
}

@media (max-width: 1660px) {
    .fs-report-workspace,
    .fs-report-workspace.is-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .fs-report-workspace.is-sidebar-collapsed .fs-report-sidebar {
        width: auto;
        visibility: visible;
        pointer-events: auto;
        overflow: visible;
    }

    .fs-report-workspace .fs-report-tree {
        max-height: 320px;
    }

    .fs-query-builder-shell {
        grid-template-columns: 1fr;
    }

    .fs-query-pane-resizer {
        display: none;
    }
}

@media (min-width: 901px) {
    .coa-workspace {
        --coa-left-pane-width: clamp(280px, 34vw, 360px);
        grid-template-columns: minmax(0, var(--coa-left-pane-width)) 6px minmax(0, 1fr);
    }

    .coa-workspace.is-detail-collapsed {
        grid-template-columns: 0 14px minmax(0, 1fr);
    }

    .coa-pane-resizer {
        display: block !important;
    }

    .coa-workspace.is-sheet-closed .coa-pane-resizer {
        display: none !important;
    }

    .dimension-workspace {
        --dimension-left-pane-width: clamp(280px, 34vw, 360px);
        grid-template-columns: minmax(0, var(--dimension-left-pane-width)) 6px minmax(0, 1fr);
    }

    .dimension-workspace.is-selector-collapsed {
        grid-template-columns: 0 14px minmax(0, 1fr);
    }

    .dimension-pane-resizer {
        display: block !important;
    }

    .dimension-workspace.is-sheet-closed .dimension-pane-resizer {
        display: none !important;
    }

    .tb-workspace {
        --tb-left-pane-width: clamp(340px, 40vw, 430px);
        grid-template-columns: minmax(0, var(--tb-left-pane-width)) 10px minmax(0, 1fr);
    }

    .tb-workspace.is-left-collapsed {
        grid-template-columns: 0 14px minmax(0, 1fr);
    }

    .tb-pane-resizer {
        display: block;
    }

    .journal-query-workspace {
        --journal-left-pane-width: clamp(380px, 48vw, 620px);
        display: grid;
        grid-template-columns: minmax(0, var(--journal-left-pane-width)) 10px minmax(0, 1fr);
    }

    .journal-query-workspace.is-list-collapsed {
        grid-template-columns: 0 10px minmax(0, 1fr);
    }

    .journal-pane-resizer {
        display: block;
    }

    .journal-query-workspace:not(.is-collapsed) .journal-detail-col {
        margin-top: 0;
    }

    .fs-report-workspace {
        grid-template-columns: clamp(240px, 24vw, 300px) minmax(0, 1fr);
        gap: 0.85rem;
        align-items: start;
    }

    .fs-report-workspace.is-sidebar-collapsed {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .fs-report-workspace.is-sidebar-collapsed .fs-report-sidebar {
        width: 0;
        visibility: hidden;
        pointer-events: none;
        overflow: hidden;
    }

    .fs-report-workspace .fs-report-tree {
        max-height: calc(100vh - var(--top-offset) - 4.5rem);
    }

    .fs-query-builder-shell {
        grid-template-columns:
            minmax(var(--fs-query-pane-min-width), var(--fs-query-pane-width))
            10px
            minmax(var(--fs-source-pane-min-width), var(--fs-source-pane-width));
    }

    .fs-query-pane-resizer {
        display: block;
    }
}

@media (max-width: 980px) {
    .fs-query-builder-shell.is-date-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .fs-query-builder-shell.is-date-mode .fs-query-pane-resizer {
        display: none;
    }
}

@media (max-width: 900px) {
    .tb-left {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 760px) {
    .fs-report-workspace {
        gap: 0.65rem;
    }

    .fs-report-library {
        padding: 0.65rem;
    }

    .fs-report-library.is-selector-only {
        min-height: auto;
    }

    .fs-report-library.is-selector-only .fs-report-tree,
    .fs-report-workspace .fs-report-tree {
        min-height: 0;
        max-height: 280px;
    }

    .fs-builder-wrap {
        min-height: 320px;
        height: min(520px, calc(100vh - var(--top-offset) - 6rem));
    }

    #fs-builder-hot {
        min-height: 320px;
    }

    .fs-filter-field,
    .fs-filter-field:has(#fs-filter-dimension),
    .fs-filter-field:has(#fs-filter-dimension-value),
    .fs-report-slicer-control {
        flex-basis: 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .fs-multi-filter-menu,
    .fs-report-slicer-control .fs-multi-filter-menu {
        width: 100%;
        max-width: calc(100vw - 2rem);
    }
}
