/* PDO Touchpoints design system
   Shared visual rules only: no data, permission, or workflow changes. */
:root {
    --navy: #102d52;
    --blue: #245f9f;
    --darkblue: #1b4d82;
--bg: #f3f3f3;
    --line: #dbe4ef;
    --ink: #24364d;
    --muted: #687b91;
    --soft: #edf3fa;
    --good: #287b5d;
    --warn: #9b6a24;
    --bad: #b84e59;
    --shadow: 0 4px 16px #16365c0b;

    --ui-primary: #245f9f;
    --ui-primary-hover: #1b4d82;
    --ui-border: #d5dfeb;
    --ui-focus: #77a7df;
    --ui-surface: #fff;
    --ui-surface-soft: #f5f8fc;
    --ui-selected: #eaf2fc;
    --ui-control: 40px;
    --ui-control-touch: 44px;
    --ui-radius-control: 8px;
    --ui-radius-card: 12px;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Shared section/card treatment. */
body .app .group,
body .modalcover .group {
    border-color: var(--ui-border);
    border-radius: var(--ui-radius-card);
    box-shadow: var(--shadow);
}

.heading h1,
.group-title h2,
.group > h2 {
    color: var(--navy);
}

.hint,
.heading p {
    color: var(--muted);
    line-height: 1.55;
}

/* Main actions use one size and one shape across pages and dialogs.
   Card tiles, inline links, list options and calendar controls keep their
   distinct interaction pattern. */
body .app button:not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body .modalcover button:not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body #authGate button:not(.auth-password-toggle):not(.auth-text-button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button) {
    box-sizing: border-box;
    height: auto;
    min-height: var(--ui-control);
    padding: 8px 14px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-control);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body .app button:not(.primary):not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body .modalcover button:not(.primary):not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body #authGate button:not(.primary):not(.auth-password-toggle):not(.auth-text-button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button) {
    background: var(--ui-surface);
    color: var(--ink);
}

body .app button.primary,
body .modalcover button.primary,
body #authGate button.primary,
body #authGate #authBtn,
body #authGate .auth-reset-save {
    height: auto;
    min-height: var(--ui-control);
    padding: 8px 14px;
    border-color: var(--ui-primary);
    border-radius: var(--ui-radius-control);
    background: var(--ui-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
}

body .app button.primary:hover:not(:disabled),
body .modalcover button.primary:hover:not(:disabled),
body #authGate button.primary:hover:not(:disabled),
body #authGate #authBtn:hover:not(:disabled),
body #authGate .auth-reset-save:hover:not(:disabled) {
    border-color: var(--ui-primary-hover);
    background: var(--ui-primary-hover);
    box-shadow: 0 4px 12px #173e751a;
}

body .app button:not(:disabled):hover:not(.primary):not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body .modalcover button:not(:disabled):hover:not(.primary):not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
body #authGate button:not(:disabled):hover:not(.primary):not(.auth-password-toggle):not(.auth-text-button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button) {
    border-color: #aec3dc;
    background: var(--ui-surface-soft);
}

body .app button:disabled,
body .modalcover button:disabled,
body #authGate button:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Compact/action-specific patterns stay distinct but align to the system. */
body .side .navbtn {
    min-height: 40px;
    padding: 9px 12px;
}

body .app .people-sections button {
    min-height: 84px;
    padding: 20px 22px;
    border-radius: var(--ui-radius-card);
}

body .app .people-unit-results button {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 0;
}

body .app .config-tile {
    min-height: 100px;
    padding: 16px;
    border-radius: var(--ui-radius-card);
}

body .app .people-unit-chip {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
}

body .app .fin-quick-note,
body .modalcover .fin-quick-note {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 7px;
}

body #authGate .auth-text-button {
    min-height: 0;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--ui-primary);
    font-size: 12px;
    font-weight: 600;
}

body #authGate .auth-password-toggle {
    min-height: 32px;
    padding: 5px;
    border: 0;
    background: transparent;
}

/* One control height, label style, focus ring, and disabled state for forms. */
body .app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body .modalcover input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body #authGate input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body .app select,
body .modalcover select,
body #authGate select {
    box-sizing: border-box;
    min-height: var(--ui-control);
    height: var(--ui-control);
    padding: 0 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-control);
    background-color: var(--ui-surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}

body .app textarea,
body .modalcover textarea,
body #authGate textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-control);
    background: var(--ui-surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
}

/* Leave space for the existing show/hide-password control. */
body #authGate .auth-password input {
    padding-right: 48px !important;
}

body .app input[type="file"],
body .modalcover input[type="file"],
body #authGate input[type="file"] {
    box-sizing: border-box;
    min-height: var(--ui-control);
    height: auto;
    padding: 5px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-control);
    background: var(--ui-surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

body .app input[type="file"]::file-selector-button,
body .modalcover input[type="file"]::file-selector-button {
    min-height: 28px;
    margin-right: 8px;
    padding: 4px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: var(--ui-surface-soft);
    color: var(--ui-primary);
    font: inherit;
    font-weight: 600;
}

body .app input[type="checkbox"],
body .app input[type="radio"],
body .modalcover input[type="checkbox"],
body .modalcover input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    accent-color: var(--ui-primary);
}

body .app .field > label,
body .modalcover .field > label,
body #authGate .field > label {
    margin-bottom: 0;
    color: #4e627a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

body .app input:focus-visible,
body .app select:focus-visible,
body .app textarea:focus-visible,
body .modalcover input:focus-visible,
body .modalcover select:focus-visible,
body .modalcover textarea:focus-visible,
body #authGate input:focus-visible,
body #authGate select:focus-visible,
body #authGate textarea:focus-visible,
body .app button:focus-visible,
body .modalcover button:focus-visible,
body #authGate button:focus-visible,
body .app a:focus-visible {
    border-color: var(--ui-focus);
    outline: 3px solid #77a7df33;
    outline-offset: 1px;
}

body .app input:disabled,
body .app select:disabled,
body .app textarea:disabled,
body .modalcover input:disabled,
body .modalcover select:disabled,
body .modalcover textarea:disabled {
    background-color: #f2f5f8;
    color: #8694a6;
    cursor: not-allowed;
}

/* Searchable dropdowns share the same control and menu language. */
body .app .pdo-combo:not(.pdo-native-select) > input.pdo-combo-input {
    min-height: var(--ui-control);
    height: var(--ui-control);
    border-radius: var(--ui-radius-control);
    font-size: 13px;
}

body .app .pdo-combo.pdo-native-select > select.pdo-combo-source {
    min-height: var(--ui-control);
    height: var(--ui-control);
    border-radius: var(--ui-radius-control);
    font-size: 13px;
}

body .pdo-combo::after {
    top: 18px;
    border-top-color: #657990;
}

body .pdo-combo.is-open::after {
    top: 18px;
    border-bottom-color: #657990;
}

body .pdo-combo-popup {
    border-color: var(--ui-border);
    border-radius: 9px;
    box-shadow: 0 8px 24px #1736571a;
}

body .pdo-combo-option {
    min-height: 36px;
    padding: 8px 12px;
    color: var(--ink);
}

body .pdo-combo-option.is-active,
body .pdo-combo-option[aria-selected="true"] {
    background: var(--ui-selected);
    color: var(--ui-primary);
}

/* Filter and section tabs share a consistent selected/idle state. */
body .app .home-filter-tabs,
body .app .status-filter-tabs,
body .app .people-tabs {
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #f0f4f8;
}

body .app .home-filter-tabs button,
body .app .status-filter-tabs button,
body .app .people-tabs button,
body .app .fin-tabs button,
body .app .fin-direct-buttons button,
body .modalcover .fin-tabs button,
body .modalcover .fin-direct-buttons button {
    box-sizing: border-box;
    min-height: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #53677f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

body .app .home-filter-tabs button.is-selected,
body .app .status-filter-tabs button.is-selected,
body .app .people-tabs button.active,
body .app .fin-tabs button.is-selected,
body .app .fin-direct-buttons button.is-selected,
body .modalcover .fin-tabs button.is-selected,
body .modalcover .fin-direct-buttons button.is-selected {
    border-color: #cbdcf0;
    background: var(--ui-surface);
    color: var(--ui-primary);
    box-shadow: 0 1px 3px #17324f0d;
}

body .app .home-filter-tabs button:hover:not(.is-selected),
body .app .status-filter-tabs button:hover:not(.is-selected),
body .app .people-tabs button:hover:not(.active),
body .app .fin-tabs button:hover:not(.is-selected),
body .app .fin-direct-buttons button:hover:not(.is-selected),
body .modalcover .fin-tabs button:hover:not(.is-selected),
body .modalcover .fin-direct-buttons button:hover:not(.is-selected) {
    background: #e8eef6;
    color: var(--ui-primary);
}

/* Consistent tables and semantic status colors. */
body .app .tbl th,
body .app .people-table th {
    padding: 12px 14px;
    background: var(--ui-surface-soft);
    color: #687b91;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
}

body .app .tbl td,
body .app .people-table td {
    padding: 12px 14px;
    border-bottom-color: #e8edf4;
    color: #344a63;
    font-size: 13px;
}

body .app .pill {
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
}

body .app .pill.open,
body .app .pill.sent,
body .app .pill.new,
body .app .pill.progress,
body .app .pill.accept {
    background: #eaf2fc;
    color: #285f9b;
}

body .app .pill.pending,
body .app .pill.clarify {
    background: #fff4df;
    color: #8f621e;
}

body .app .pill.completed,
body .app .pill.closed {
    background: #e8f5ee;
    color: #287b5d;
}

body .app .pill.urgent {
    background: #fbecee;
    color: #ad4350;
}

/* Respect touch sizing and avoid automatic zoom on mobile form controls. */
@media (max-width: 700px) {
    body .app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    body .modalcover input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    body #authGate input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    body .app select,
    body .modalcover select,
    body #authGate select,
    body .app .pdo-combo:not(.pdo-native-select) > input.pdo-combo-input,
    body .app .pdo-combo.pdo-native-select > select.pdo-combo-source {
        min-height: var(--ui-control-touch);
        height: var(--ui-control-touch);
        font-size: 16px;
    }

    body .app textarea,
    body .modalcover textarea,
    body #authGate textarea {
        min-height: 104px;
        font-size: 16px;
    }

    body .app button:not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
    body .modalcover button:not(.link):not(.auth-password-toggle):not(.auth-text-button):not(.config-tile):not(.people-unit-chip):not(.fin-quick-note):not(.people-sections button):not(.people-unit-results button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button),
    body #authGate button:not(.auth-password-toggle):not(.auth-text-button):not(.pdo-calendar button):not(.home-filter-tabs button):not(.status-filter-tabs button):not(.people-tabs button):not(.fin-tabs button):not(.fin-direct-buttons button) {
        min-height: var(--ui-control-touch);
    }

    body .app .home-filter-tabs button,
    body .app .status-filter-tabs button,
    body .app .people-tabs button,
    body .app .fin-tabs button,
    body .app .fin-direct-buttons button,
    body .modalcover .fin-tabs button,
    body .modalcover .fin-direct-buttons button {
        min-height: var(--ui-control-touch);
        height: var(--ui-control-touch);
    }

    body #authGate #authBtn,
    body #authGate .auth-reset-save {
        min-height: var(--ui-control-touch);
    }

    body .pdo-combo::after,
    body .pdo-combo.is-open::after {
        top: 20px;
    }

    body .pdo-combo-option {
        min-height: 44px;
        padding: 11px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .app button,
    body .modalcover button,
    body #authGate button,
    body .side .navbtn,
    body .app .group {
        transition: none;
    }
}
/* Separate history comments without changing the timeline */
.timeline .event .pdo-comment {
    margin: 10px 0;
    padding: 11px 14px;

    background: #f9fafc;
    border: 1px solid #e5eaf0;
    border-left: 3px solid #d5dfec;
    border-radius: 7px;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.8;
}

.timeline .event .pdo-comment:empty {
    display: none;
}
/* Finishing stages — presentation only */
body :is(#modalBody, #unitHistoryBody) .fin-stages-list {
    padding: 16px 20px 8px;
    border: 1px solid #dfe6ee;
    border-radius: 13px;
    background: #fff;
    box-shadow: none;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 5px 18px;
    border-bottom: 1px solid #e8edf3;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-heading h3 {
    margin: 0;
    color: #253b54;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.4;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-heading > span {
    color: #778598;
    font-size: 11px;
}

/* Consistent stage rows */
body :is(#modalBody, #unitHistoryBody) .fin-stages-list .stage-line {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-height: 75px;
    margin: 0;
    padding: 17px 14px;
    border: 0;
    border-bottom: 1px solid #e9edf3;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list .stage-line:last-child {
    border-bottom: 0;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line > div > div:first-child {
    align-items: center !important;
    min-height: 40px;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line > div > div:first-child > div > b {
    color: #2b3f57;
    font-size: 14px;
    font-weight: 650;
    line-height: 22px;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line > div > div:first-child > div > .hint {
    margin-top: 2px;
    color: #7c899a;
    font-size: 11px;
    line-height: 18px;
}

/* Current stage */
body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-current="true"] {
    margin: 3px 0;
    padding: 17px 13px;
    min-height: 83px;
    border: 1px solid #d5e6fb;
    border-radius: 9px;
    background: #f3f8ff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-current="true"]
> div > div:first-child > div > b,
body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-current="true"]
> div > div:first-child > div > .hint {
    color: #2866ad;
}

/* Stage indicators */
body :is(#modalBody, #unitHistoryBody) .fin-stages-list .step-dot {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    border: 1.5px solid #b7c2ce;
    border-radius: 50%;
    background: #fff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-completed="true"] > .step-dot {
    border-color: #31956a;
    background: #31956a;
    color: #fff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-completed="true"] > .step-dot::after {
    content: "\2713";
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-current="true"] > .step-dot {
    border: 2px solid #2d76c9;
    background: #fff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line[data-stage-current="true"] > .step-dot::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2d76c9;
}

/* Consistent action buttons */
body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-stage-toggle,
body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-add-update {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 7px;
    width: auto;
    height: 40px;
    min-height: 40px;
    margin: 0 0 0 auto;
    padding: 0 14px;
    border: 1px solid #dbe5f0;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-stage-toggle {
    background: #f7faff;
    color: #456a97;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-stage-toggle:hover {
    background: #edf4fc;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-add-update {
    border-color: #2b73c5;
    background: #2b73c5;
    color: #fff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-add-update:hover {
    border-color: #225fa5;
    background: #225fa5;
}

/* Mobile */
@media (max-width: 640px) {
    body :is(#modalBody, #unitHistoryBody) .fin-stages-list {
        padding: 0 10px 6px;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stages-heading {
        gap: 10px;
        padding: 18px 5px;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stages-heading h3 {
        font-size: 15px;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stages-heading > span {
        font-size: 10px;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-stage-toggle,
    body :is(#modalBody, #unitHistoryBody) .fin-stages-list .fin-add-update {
        height: 44px;
        min-height: 44px;
        padding: 0 10px;
        font-size: 11px;
    }
}
/* Stage heading outside the stage-list box */
body :is(#modalBody, #unitHistoryBody) .fin-stages-heading {
    margin: 0 0 12px;
    padding: 0 4px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Unit Performance cards */
body #modalBody
[data-fin-panel="performance"] .fin-case {
    margin: 0 0 16px;
    padding: 18px 20px;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

body #modalBody
[data-fin-panel="performance"] .fin-case > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

body #modalBody
[data-fin-panel="performance"] .fin-case > header > strong {
    min-width: 0;
    color: #2b3f57;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

body #modalBody
[data-fin-panel="performance"] .fin-case > .hint {
    margin: 8px 0 14px;
    color: #748296;
    font-size: 11px;
    line-height: 1.7;
}

/* Separate planned-action text when present */
body #modalBody
[data-fin-panel="performance"] .fin-case > p:not(.hint) {
    margin: 10px 0;
    padding: 11px 14px;
    border: 1px solid #e5eaf0;
    border-left: 3px solid #d5dfec;
    border-radius: 7px;
    background: #f9fafc;
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* Separate each status-history entry */
body #modalBody
[data-fin-panel="performance"] .fin-case-log {
    margin: 14px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body #modalBody
[data-fin-panel="performance"] .fin-case-log > p {
    margin: 0 0 10px;
    padding: 12px 14px;
    border: 1px solid #e5eaf0;
    border-left: 3px solid #d5dfec;
    border-radius: 7px;
    background: #f9fafc;
}

body #modalBody
[data-fin-panel="performance"] .fin-case-log > p:last-child {
    margin-bottom: 0;
}

body #modalBody
[data-fin-panel="performance"] .fin-case-log > p > strong {
    display: block;
    color: #344b66;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

body #modalBody
[data-fin-panel="performance"] .fin-case-log > p > small {
    display: block;
    margin-top: 6px;
    color: #748296;
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    body #modalBody
    [data-fin-panel="performance"] .fin-case {
        padding: 15px;
    }
}
body #modalBody .fin-fac-count {
    margin: 0 0 22px;
    padding: 18px;
    border: 1px solid #dce6f1;
    border-radius: 10px;
    background: #f8fafd;
}
body #modalBody .fin-fac-count-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
body #modalBody .fin-fac-count-heading h3 {
    margin: 0;
    color: #2b3f57;
    font-size: 14px;
}
body #modalBody .fin-fac-count-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}
body #modalBody .fin-fac-count-facts span {
    display: block;
    margin-bottom: 5px;
    color: #748296;
    font-size: 11px;
}
body #modalBody .fin-fac-count-facts strong {
    color: #344b66;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
body #modalBody .fin-fac-count-note {
    margin: 14px 0 0;
    color: #6d7d90;
    font-size: 11px;
    line-height: 1.8;
}
.pill.not-started {
    background: #fff6df;
    color: #896112;
}
.fin-fac-age-inline {
    display: block;
    margin-top: 5px;
    color: #6d7d90;
    font-size: 11px;
}
@media (max-width: 640px) {
    body #modalBody .fin-fac-count-facts {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line > div > div:first-child > .fin-count-chip {
    margin-left: auto;
    align-self: center;
    flex: 0 0 auto;
}

body :is(#modalBody, #unitHistoryBody) .fin-stages-list
.stage-line > div > div:first-child > .fin-add-update {
    margin-left: 0 !important;
}
body :is(#modalBody, #unitHistoryBody) .fin-stage-timeline {
    margin: 20px 0 0 8px;
    padding-left: 20px;
    border-left: 1px solid #d5dfed;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update {
    position: relative;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid #dfe7f1;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update:last-child {
    margin-bottom: 0;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update::before {
    content: "";
    position: absolute;
    left: -27px;
    top: 18px;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border: 2px solid #7c9dc9;
    border-radius: 50%;
    background: #fff;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update-head > strong {
    color: #173a6c;
    font-size: 13px;
    font-weight: 600;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-update-head > time {
    margin-left: auto;
    color: #71829b;
    font-size: 11px;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-state {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-state.follow {
    color: #214b9b;
    background: #edf3fc;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-state.pending {
    color: #946018;
    background: #fff4df;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-state.closed {
    color: #28734c;
    background: #edf7f0;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-comment {
    margin: 10px 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #243b59;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-subline {
    margin: 6px 0 0;
    color: #71829b;
    font-size: 12px;
    line-height: 1.5;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-files {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-files .fin-stage-file {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #214b9b;
    font-size: 12px;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-file img {
    width: 88px;
    height: 64px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid #dfe7f1;
    border-radius: 7px;
    background: #f6f8fc;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-file img[hidden] {
    display: none;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-file:hover span {
    text-decoration: underline;
}

body :is(#modalBody, #unitHistoryBody) .fin-stage-file:focus-visible {
    outline: 2px solid #214b9b;
    outline-offset: 4px;
}

@media (max-width: 520px) {
    body :is(#modalBody, #unitHistoryBody) .fin-stage-update {
        padding: 12px;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stage-update-head > strong {
        flex: 1 1 100%;
    }

    body :is(#modalBody, #unitHistoryBody) .fin-stage-update-head > time {
        margin-left: 0;
        margin-right: auto;
    }
}
body #modalBody .fin-performance-case > header > strong {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    white-space: normal;
}

body #modalBody .fin-performance-info {
    margin-top: 10px;
}

body #modalBody .fin-performance-info p {
    margin: 5px 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #71829b;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

body #modalBody .fin-performance-info strong {
    color: #526b8c;
    font-weight: 600;
}

body #modalBody .fin-performance-history {
    margin-top: 18px;
}

body #modalBody .fin-performance-history .fin-stage-update {
    background: #fff;
}
/* Remove template whitespace around comment lines */
body :is(#modalBody, #unitHistoryBody) div.fin-stage-comment {
    white-space: normal;
}

/* Preserve the actual text formatting of each line */
body :is(#modalBody, #unitHistoryBody) div.fin-stage-comment > div {
    white-space: pre-wrap;
    text-align: start;
    margin: 0;
    padding: 0;
}
#actionSalesforcePrompt {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
    border: 1px solid #cbdcf2;
    border-radius: 12px;
    background: #eef5ff;
}

#actionSalesforcePrompt[hidden],
#actionSalesforceCaseField[hidden] {
    display: none !important;
}

#actionSalesforcePrompt label {
    display: block;
    margin-bottom: 8px;
    color: #214b9b;
    font-size: 13px;
    font-weight: 600;
}

#actionSalesforceCaseNo {
    width: 100%;
    box-sizing: border-box;
}

#actionSalesforcePrompt .action-salesforce-choices {
    display: flex;
    gap: 8px;
}

#actionSalesforcePrompt button {
    min-width: 80px;
    margin: 0;
    background: #fff;
    color: #214b9b;
    border: 1px solid #cbdcf2;
}

#actionSalesforcePrompt button.is-selected {
    background: #214b9b;
    border-color: #214b9b;
    color: #fff;
}

@media (max-width: 700px) {
    #actionSalesforcePrompt {
        grid-template-columns: 1fr;
    }
}