@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-optical-sizing: auto;
}

@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
}
[x-cloak] { display: none !important; }

.filter-dialog {
    width: min(960px, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.filter-dialog::backdrop { background: rgb(0 0 0 / 50%); }

#result-more .htmx-request { pointer-events: none; opacity: .65; }

.lookup-select { min-width: 0; }
.lookup-panel { position: fixed; z-index: 1080; max-height: 15rem; overflow-y: auto; overscroll-behavior: contain; }
.lookup-option { white-space: normal; overflow-wrap: anywhere; }
.lookup-option:hover { background: var(--bs-tertiary-bg); }

.status-dialog { width: min(520px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.status-dialog::backdrop { background: rgb(0 0 0 / 50%); }

.detail-label { color: var(--bs-secondary-color); font-size: .8rem; font-weight: 400; margin-bottom: .35rem; }
.detail-value { overflow-wrap: anywhere; font-size: .9rem; font-weight: 600; margin-bottom: 0; }
.detail-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-history li:last-child { padding-bottom: 0 !important; }

.report-dashboard { max-width: 1600px; }
.report-eyebrow { font-size: .72rem; letter-spacing: .1em; color: #516568; font-weight: 600; }
.report-filter .mb-3 { margin-bottom: 0 !important; }
.report-kpi { border-radius: 1rem; }
.report-label { font-size: .8rem; font-weight: 400; color: var(--bs-secondary-color); margin-bottom: .6rem; }
.report-number { font-size: clamp(1.7rem, 2.6vw, 2.6rem); font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.report-teal { color: #147a72; }
.report-government { background: #3d505a; }
.report-private { background: #238b80; }
.report-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; }
.report-chart-scroll { overflow-x: auto; }
.report-chart { display: grid; grid-template-columns: repeat(var(--report-periods), minmax(24px, 1fr)); gap: .35rem; min-width: min(100%, 600px); padding-top: 1rem; }
.report-bars { height: 190px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #dce3e3; }
.report-bars > span { display: block; width: 40%; max-width: 34px; border-radius: 4px 4px 0 0; }
.report-chart-label { display: block; text-align: center; font-size: .62rem; color: #5f6e73; margin-top: .6rem; }
.report-progress { height: 5px; }
.report-breakdown-label { overflow-wrap: anywhere; min-width: 0; }
.report-filter.htmx-request { opacity: .65; pointer-events: none; }

/* Shared app navigation and footer. */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; background: #f7f9fa; }
.app-header { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid #e3e9e9; }
.app-navbar { min-height: 82px; padding-block: .8rem; }
.app-brand { display: flex; align-items: center; gap: .75rem; margin-right: 2rem; color: #213638; white-space: normal; max-width: 100%; }
.app-brand-mark { display: block; width: 52px; height: 52px; flex: 0 0 52px; object-fit: contain; border-radius: 50%; background: #fff; }
.app-brand strong { display: block; font-size: 1rem; letter-spacing: -.025em; }
.app-brand small { display: block; color: #6c7d7e; font-size: .66rem; margin-top: .1rem; }
.app-navbar .nav-link { color: #536567; font-size: .83rem; font-weight: 500; border-radius: 8px; padding: .65rem .8rem; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: #174e48; background: #eaf3f1; }
.app-menu-toggle { border: 0; background: transparent; padding-inline: .45rem !important; }
.app-dropdown { border: 1px solid #e3e9e9; border-radius: 12px; padding: .5rem; box-shadow: 0 12px 36px #173f3c14; }
.app-dropdown .dropdown-item { font-size: .85rem; padding: .6rem .75rem; border-radius: 6px; }
.app-dropdown .dropdown-item:hover { background: #eaf3f1; color: #174e48; }
.app-account { display: flex; align-items: center; gap: 1rem; border-left: 1px solid #e3e9e9; padding-left: 1.2rem; }
.app-account-info { display: flex; flex-direction: column; gap: .15rem; }
.app-account-name { font-size: .78rem; font-weight: 600; max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #253e40; }
.app-account-role { font-size: .66rem; color: #6c7d7e; }
.app-signout { border: 1px solid #dce4e4; color: #385354; border-radius: 8px; padding: .45rem .7rem; font-size: .75rem; }
.app-signout:hover { border-color: #173f3c; background: #173f3c; color: white; }
.app-login-note { color: #6c7d7e; font-size: .75rem; }
.notification-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: .45rem; padding-inline: .25rem; border-radius: 999px; background: #d96555; color: white; font-size: .62rem; font-weight: 700; }
.app-main { flex: 1; min-width: 0; }
.app-footer { margin-top: 2rem; padding: 1.5rem 0; background: #fff; border-top: 1px solid #e3e9e9; }
.app-footer-brand { color: #294749; font-size: .83rem; font-weight: 600; }
.app-footer-caption { display: block; margin-top: .3rem; font-size: .72rem; color: #718284; }
.app-footer-meta { font-size: .7rem; color: #718284; }
.app-footer-meta a { color: #385e5b; text-decoration: none; }
.app-footer-meta a:hover { text-decoration: underline; }
.app-skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 2000; background: white; padding: .6rem; }
@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse { padding-top: 1rem; }
    .app-navbar .navbar-nav { gap: .25rem; }
    .app-account { margin-top: 1rem; padding: 1rem 0 0; border-left: 0; border-top: 1px solid #e3e9e9; justify-content: space-between; }
    .app-navbar .dropdown-menu { position: static; margin-top: .3rem; width: 100%; }
    .app-navbar .nav-item.dropdown > div { flex-wrap: wrap; }
    .app-login-note { display: none; }
}

/* Sidebar navigation retains the compact menu on small screens. */
@media (min-width: 992px) {
    .app-has-sidebar { padding-left: 250px; }
    .app-sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; border-bottom: 0; border-right: 1px solid #e3e9e9; overflow-y: auto; }
    .app-sidebar .app-navbar { min-height: 100%; padding: 1.5rem 0; align-items: stretch; }
    .app-sidebar .container-fluid { flex-direction: column; align-items: stretch; padding-inline: 1rem !important; }
    .app-sidebar .app-brand { margin: 0 0 2rem; padding-inline: .35rem; }
    .app-sidebar .navbar-collapse { flex-direction: column; align-items: stretch; flex-grow: 1; }
    .app-sidebar .navbar-nav { flex-direction: column; margin-right: 0 !important; gap: .35rem; }
    .app-sidebar .nav-link { padding: .8rem 1rem; }
    .app-sidebar .nav-item.dropdown > div { flex-wrap: wrap; }
    .app-sidebar .nav-item.dropdown > div > a { flex: 1; }
    .app-sidebar .dropdown-menu { position: static; width: 100%; min-width: 0; margin-top: .35rem; box-shadow: none; }
    .app-sidebar .dropdown-item { white-space: normal; }
    .app-sidebar .app-account { flex-direction: column; align-items: stretch; gap: .85rem; margin-top: auto; padding: 1.25rem .75rem 0; border-left: 0; border-top: 1px solid #e3e9e9; }
    .app-sidebar .navbar-nav + .app-account { margin-top: auto; }
    .app-sidebar .navbar-nav { padding-bottom: 1.5rem; }
    .app-sidebar .app-account-name { max-width: 100%; }
    .app-sidebar .app-signout { width: 100%; }
    .app-has-sidebar .help-toc { top: 24px; max-height: calc(100dvh - 48px); }
}
@media (max-width: 991.98px) {
    .app-sidebar { max-height: 100dvh; overflow-y: auto; }
    .app-sidebar .nav-item.dropdown > div > a { flex: 1; }
}
@media print {
    .app-has-sidebar { padding-left: 0; }
}

/* Result workspace. */
.results-page { max-width: 1800px; }
.results-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.75rem; }
.results-eyebrow { font-size: .66rem; font-weight: 600; letter-spacing: .12em; color: #66817f; margin-bottom: .4rem; }
.results-page-header h1 { font-size: 2rem; font-weight: 650; letter-spacing: -.04em; margin-bottom: .3rem; color: #213c3d; }
.results-description { font-size: .82rem; color: #78888a; margin-bottom: 0; }
.results-primary-button { background: #173f3c; color: white; border: 1px solid #173f3c; border-radius: 9px; font-size: .8rem; padding: .65rem .95rem; }
.results-primary-button:hover { background: #225b55; color: white; border-color: #225b55; }
.results-secondary-button { background: white; color: #38585a; border: 1px solid #dce5e5; border-radius: 9px; font-size: .78rem; padding: .65rem .9rem; }
.results-secondary-button:hover { background: #eef5f4; color: #174e48; border-color: #b5cfca; }
.results-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding-bottom: 1.5rem; }
.results-switch-group { display: flex; flex-direction: column; gap: .4rem; }
.results-control-label { font-size: .68rem; font-weight: 600; color: #78888a; }
.results-switch { display: flex; gap: .25rem; background: #eaf0f0; padding: .25rem; border-radius: 10px; }
.results-switch a { padding: .55rem .9rem; border-radius: 7px; text-decoration: none; color: #6e8082; font-size: .78rem; font-weight: 500; }
.results-switch a:hover { color: #204c48; }
.results-switch a.is-selected { background: white; color: #204c48; box-shadow: 0 1px 4px #193f3a12; }
.results-selection-caption { margin: 1rem 0 0 auto; color: #7b8b8d; font-size: .7rem; text-align: right; line-height: 1.7; }
.results-selection-caption strong { color: #39595b; font-weight: 500; }
.results-metrics { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.results-metrics.has-billing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.results-metric { background: white; border: 1px solid #e0e8e7; border-radius: 12px; padding: 1.1rem 1.3rem; display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; }
.results-metric h2 { color: #7a8c8d; font-size: .73rem; font-weight: 400; margin-bottom: .45rem; }
.results-metric p { color: #234947; font-size: 1.85rem; font-weight: 650; letter-spacing: -.04em; margin: 0; line-height: 1.2; }
.results-metric > span { font-size: .65rem; color: #889697; text-align: right; padding-bottom: .2rem; }
.results-workspace { border: 1px solid #e0e8e7; background: white; border-radius: 14px; box-shadow: 0 2px 5px #193f3a03; overflow: hidden; }
.results-toolbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.25rem; }
.results-toolbar > div:first-child { display: flex; align-items: center; gap: .65rem; }
.results-toolbar h2 { color: #2d4a4b; font-size: .9rem; font-weight: 600; margin: 0; }
.results-year-tag { background: #f0f4f4; color: #748786; font-size: .64rem; border-radius: 5px; padding: .25rem .45rem; }
.results-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.results-quick-search { display: flex; gap: .4rem; align-items: center; }
.results-quick-search .form-control { width: clamp(180px, 20vw, 280px); font-size: .76rem; border-color: #e0e8e7; border-radius: 8px; padding: .65rem .8rem; }
.results-filter-button { white-space: nowrap; display: flex; gap: .4rem; align-items: center; }
.results-filter-count { border-radius: 4px; background: #e5f0ee; color: #2a625b; font-size: .63rem; padding: .1rem .35rem; }
.results-active-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 0 1.25rem 1rem; }
.results-filter-chip { display: flex; gap: .6rem; align-items: center; border: 1px solid #dce9e6; background: #f1f7f5; color: #426c65; font-size: .67rem; border-radius: 6px; padding: .35rem .55rem; text-decoration: none; }
.results-filter-chip:hover { background: #e4f0ec; color: #234947; }
.results-clear-all { font-size: .67rem; color: #7c8c8e; margin-left: .25rem; }
.results-table { --bs-table-hover-bg: #f3f8f6; font-size: .72rem; color: #536768; }
.results-table thead th { background: #f7f9f9; border-top: 1px solid #e7ecec; border-bottom: 1px solid #e7ecec; padding: .85rem .7rem; font-size: .65rem; font-weight: 500; color: #7c8d8f; white-space: nowrap; }
.results-table thead th a { color: inherit; text-decoration: none; }
.results-table thead th[aria-sort='ascending'] a, .results-table thead th[aria-sort='descending'] a { color: #315f59; }
.results-table td, .results-table tbody th { padding: .85rem .7rem; border-bottom: 1px solid #eef2f2; color: #5b6d6f; vertical-align: middle; }
.results-table .results-row-number { color: #9aa7a8; font-size: .64rem; font-weight: 400; width: 38px; text-align: center; }
.results-reference { color: #245d54; font-weight: 600; text-decoration: none; white-space: nowrap; }
.results-reference:hover { color: #163e38; text-decoration: underline; }
.results-value { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-table td[data-column='received'], .results-table td[data-column='completed'] { white-space: nowrap; color: #8a9798; font-size: .68rem; }
.results-table td[data-column='amount'] { text-align: right; font-variant-numeric: tabular-nums; color: #3b5657; white-space: nowrap; }
.results-status { display: inline-block; border-radius: 5px; padding: .3rem .45rem; font-size: .57rem; letter-spacing: .02em; font-weight: 500; background: #f0f3f4; color: #78898c; white-space: nowrap; }
.results-status[data-state='paid'], .results-status[data-state='completed'] { background: #e9f4ee; color: #3b7b61; }
.results-status[data-state='unpaid'], .results-status[data-state='on_hold'] { background: #fbf3e5; color: #a27a35; }
.results-status[data-state='in_progress'] { background: #eaf1fa; color: #5279a4; }
.results-status[data-state='failed'], .results-status[data-state='rejected'] { background: #faeceb; color: #ab6863; }
.results-row-action { font-size: .66rem; color: #66847d; text-decoration: none; border-bottom: 1px dashed #b5cac4; padding-bottom: .1rem; }
.results-row-action:hover { color: #245d54; }
.results-table .results-empty { text-align: center; padding: 3.5rem 1rem; }
.results-empty strong { display: block; color: #47625e; font-size: .85rem; font-weight: 500; margin-bottom: .5rem; }
.results-empty span { font-size: .75rem; color: #8a999a; }
.results-load-more { padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; background: #fff; }
.results-loaded-count { font-size: .69rem; color: #8b999b; margin: 0; }
.results-more-button { font-size: .7rem; padding: .5rem 1rem; }
.results-scroll-hint { color: #93a0a2; font-size: .64rem; margin: .5rem 1rem 0; }
@media (max-width: 767.98px) {
    .results-page-header { align-items: flex-start; }
    .results-selection-caption { display: none; }
    .results-selection { gap: .8rem; justify-content: space-between; }
    .results-switch a { padding: .5rem .65rem; font-size: .71rem; }
    .results-metric { align-items: flex-start; flex-direction: column; padding: 1rem; }
    .results-metric p { font-size: 1.5rem; overflow-wrap: anywhere; }
    .results-metric > span { text-align: left; }
    .results-toolbar { align-items: stretch; }
    .results-tools { width: 100%; }
    .results-quick-search { flex: 1; min-width: 0; }
    .results-quick-search .form-control { flex: 1; width: 100%; min-width: 0; }
}
/* Keep record identifiers visible while scrolling a wide result table. */
.results-table { font-size: .75rem; }
.results-table thead th { color: #607577; font-size: .68rem; }
.results-table td, .results-table tbody th { padding-inline: .55rem; }
.results-table .results-row-number { position: sticky; left: 0; z-index: 2; width: 40px; min-width: 40px; max-width: 40px; padding-inline: .25rem; background-color: white; }
.results-table [data-column='reference'] { position: sticky; left: 40px; z-index: 2; width: 110px; min-width: 110px; background-color: white; border-right: 1px solid #edf1f1; }
.results-table thead .results-row-number, .results-table thead [data-column='reference'] { background-color: #f7f9f9; z-index: 3; }
.results-table td[data-column='received'], .results-table td[data-column='completed'] { color: #617577; }
.results-status { font-size: .61rem; }
.results-status[data-state='unpaid'], .results-status[data-state='on_hold'] { color: #88631e; }
@media (min-width: 992px) and (max-width: 1599.98px) {
    .results-value { max-width: 125px; }
}
@media (max-width: 767.98px) {
    .results-toolbar { position: relative; }
    .results-toolbar > div:first-child { min-height: 38px; padding-right: 125px; }
    .results-toolbar .results-year-tag { display: none; }
    .results-tools .results-filter-button { position: absolute; top: 1rem; right: 1.25rem; }
    .results-quick-search { flex-basis: 100%; }
}

/* Status update modal and standalone form. */
.status-dialog { width: min(560px, calc(100% - 2rem)); padding: 0; border: 1px solid #dce6e3; border-radius: 18px; box-shadow: 0 24px 90px #102e2a38; color: #294645; }
.status-dialog::backdrop { background: #132f3080; backdrop-filter: blur(3px); }
.status-modal-heading { display: flex; align-items: flex-start; gap: .85rem; padding: 1.5rem 1.5rem 1.15rem; }
.status-modal-icon { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; background: #eaf3ef; color: #3d7567; border: 1px solid #deebe4; border-radius: 12px; }
.status-modal-eyebrow { font-size: .6rem; color: #7b928b; letter-spacing: .1em; font-weight: 600; margin: 0 0 .3rem; }
.status-modal-heading h2, .status-modal-heading h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.025em; color: #24413e; margin: 0 0 .3rem; }
.status-modal-heading > div > p:last-child { color: #7a8b88; font-size: .75rem; margin-bottom: 0; }
.status-modal-close { display: grid; place-items: center; margin: -.15rem -.35rem 0 auto; width: 30px; height: 30px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent; color: #879b94; font-size: 1.4rem; line-height: 1; }
.status-modal-close:hover { background: #eef4f1; color: #315f52; }
.status-form-content { padding: 0 1.5rem; }
.status-record { background: #f5f8f6; border: 1px solid #e3ebe6; border-radius: 10px; padding: 1rem; margin-bottom: 1.25rem; }
.status-record-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.status-context-label { display: block; font-size: .64rem; color: #7e918a; font-weight: 400; margin-bottom: .3rem; }
.status-record-top strong { color: #31594d; display: block; font-size: .94rem; font-weight: 600; overflow-wrap: anywhere; }
.status-data-tag { background: white; border: 1px solid #e0e8e2; color: #7f9489; font-size: .55rem; border-radius: 4px; padding: .3rem .4rem; white-space: nowrap; }
.status-record-project { margin: .7rem 0 .25rem; font-size: .75rem; font-weight: 500; color: #4a6b5e; overflow-wrap: anywhere; }
.status-record-client { font-size: .65rem; color: #8a9c93; margin-bottom: 0; overflow-wrap: anywhere; }
.status-current { display: flex; align-items: center; gap: .75rem; padding-top: .75rem; margin-top: .75rem; border-top: 1px solid #e3ebe6; }
.status-current .status-context-label { margin: 0; }
.status-current .results-status { font-size: .63rem; }
.status-current-date { margin: .45rem 0 0; font-size: .61rem; color: #8c9e94; }
.status-update-form label { font-size: .75rem; font-weight: 500; color: #4a685c; }
.status-update-form .form-control, .status-update-form .form-select { border-color: #dfe8e2; border-radius: 8px; padding: .7rem .8rem; font-size: .8rem; color: #476154; }
.status-update-form .form-control:focus, .status-update-form .form-select:focus { border-color: #9ebeb0; box-shadow: 0 0 0 .18rem #dfeee680; }
.status-update-form .form-text { font-size: .65rem; color: #8a9c91; }
.status-history-note { font-size: .66rem; color: #82968a; margin-bottom: 1.25rem; }
.status-form-actions { display: flex; justify-content: space-between; gap: .75rem; border-top: 1px solid #e7ede9; padding: 1rem 0 1.25rem; }
.status-form-actions .btn { min-width: 100px; }
.status-loading { min-height: 310px; display: flex; align-items: center; justify-content: center; gap: .65rem; color: #7e9489; font-size: .8rem; }
.status-request-error { margin: 0 1.5rem 1rem; border: 1px solid #efd8d2; border-radius: 8px; padding: .8rem; background: #fdf4f1; font-size: .75rem; color: #965d4d; }
.status-standalone { max-width: 650px; }
.status-standalone-card { background: white; border: 1px solid #e0e8e3; border-radius: 16px; }
@media (max-width: 575.98px) { .status-modal-heading { padding: 1.25rem 1.1rem 1rem; gap: .65rem; } .status-form-content { padding-inline: 1.1rem; } .status-modal-heading h2 { font-size: 1.05rem; } .status-modal-icon { width: 36px; height: 36px; } .status-request-error { margin-inline: 1.1rem; } }

.result-entry-dialog { width: min(850px, calc(100vw - 32px)); }
.result-entry-form { padding: 0 24px 24px; }
.result-entry-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; }
.result-entry-wide { grid-column: 1 / -1; }
.requisition-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.requisition-entry-form { padding: 0 1.5rem 1.5rem; }
.requisition-entry-form .card { border-color: #e0e8e3; }
.requisition-request-error { margin: 0 1.5rem 1.5rem; border: 1px solid #efd8d2; border-radius: 8px; padding: .8rem; background: #fdf4f1; font-size: .75rem; color: #965d4d; }
.requisition-request-error p { margin-top: .25rem; }
.requisition-request-error a { color: inherit; font-weight: 600; }
@media(max-width:600px) { .result-entry-grid { grid-template-columns: minmax(0,1fr); } }
@media(max-width:575.98px) { .requisition-entry-form { padding-inline: 1.1rem; } }

/* Help centre, user guides, and FAQ. */
.help-page { max-width: 1200px; color: #254443; }
.help-tabs { display: flex; gap: 4px; border-bottom: 1px solid #dce5e4; margin-bottom: 32px; overflow-x: auto; }
.help-tabs a { padding: 12px 16px; text-decoration: none; color: #607875; white-space: nowrap; border-bottom: 3px solid transparent; }
.help-tabs a[aria-current="page"] { color: #174c45; font-weight: 600; border-color: #238b80; }
.help-eyebrow { color: #647e79; font-size: .7rem; font-weight: 700; letter-spacing: .1em; margin-bottom: 12px; }
.help-page h1 { font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -.045em; font-weight: 650; }
.help-page h2 { font-size: 1.55rem; letter-spacing: -.025em; }
.help-page a:not(.btn):focus-visible, .help-faq summary:focus-visible { outline: 3px solid #73b7ad; outline-offset: 4px; border-radius: 4px; }
.help-hero { display: grid; grid-template-columns: 1fr 310px; align-items: center; gap: 60px; padding: 38px; border: 1px solid #dae6e2; border-radius: 22px; background: linear-gradient(120deg, #edf5f0, #f7faf9); margin-bottom: 48px; }
.help-hero h1 { max-width: 610px; margin-bottom: 18px; }
.help-hero > div > p:not(.help-eyebrow) { color: #617672; line-height: 1.75; max-width: 540px; margin-bottom: 24px; }
.help-year-card { background: #fff; border: 1px solid #dce7e2; border-radius: 16px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; }
.help-year-card strong { font-size: 2rem; letter-spacing: -.04em; }
.help-year-card > span:not(.help-eyebrow), .help-year-card p { color: #617672; font-size: .82rem; }
.help-year-card p { margin: 18px 0; line-height: 1.65; }
.help-year-card a { font-size: .85rem; color: #175e52; }
.help-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.help-section-heading > a { font-size: .85rem; color: #175e52; }
.help-section-heading h2 { margin-bottom: 0; }
.help-topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.help-topic-card { display: flex; flex-direction: column; padding: 25px; border: 1px solid #dce5e4; background: #fff; border-radius: 16px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.help-topic-card:hover { color: inherit; border-color: #7faaa0; box-shadow: 0 8px 20px #174c4509; }
.help-topic-number { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; background: #edf4f1; color: #32685e; font-size: .75rem; font-weight: 600; border-radius: 10px; }
.help-topic-card h3 { font-size: 1.05rem; line-height: 1.45; margin: 20px 0 12px; }
.help-topic-card p { font-size: .83rem; color: #6a7e7a; line-height: 1.7; margin-bottom: 22px; }
.help-topic-link { display: flex; justify-content: space-between; margin-top: auto; font-size: .78rem; font-weight: 600; color: #286b5d; }
.help-support { display: flex; justify-content: space-between; align-items: center; gap: 30px; background: #edf3f1; border: 1px solid #dce5e4; border-radius: 18px; padding: 28px; }
.help-support > div { max-width: 590px; }
.help-support p { color: #647b75; line-height: 1.7; font-size: .9rem; }
.help-support form { flex: 1; min-width: 300px; }
.help-support > a { flex-shrink: 0; }
.help-guide-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 40px; align-items: start; }
.help-toc { position: sticky; top: 106px; max-height: calc(100dvh - 130px); overflow-y: auto; padding-right: 8px; }
.help-toc nav { border-left: 2px solid #dde7e3; padding-left: 18px; }
.help-toc nav a { display: block; color: #55736b; text-decoration: none; font-size: .82rem; padding: 7px 0; line-height: 1.5; }
.help-toc nav a:hover { color: #103f36; text-decoration: underline; }
.help-guide-section { padding: 28px; background: #fff; border: 1px solid #dce5e4; border-radius: 18px; margin-bottom: 24px; scroll-margin-top: 106px; }
.help-guide-section-title { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.help-guide-section-title h2 { font-size: 1.4rem; margin-bottom: 8px; }
.help-guide-section-title p { font-size: .86rem; line-height: 1.6; color: #6a7e7a; margin: 0; }
.help-steps { padding-left: 1.4rem; margin-bottom: 20px; }
.help-steps li { padding-left: 6px; margin-bottom: 18px; font-size: .92rem; line-height: 1.85; color: #425e56; }
.help-steps li::marker { color: #257464; font-weight: 600; }
.help-back-top { font-size: .77rem; color: #577a70; }
.help-access-table { font-size: .83rem; line-height: 1.65; }
.help-access-table td, .help-access-table th { padding: 13px 8px; }
.help-faq-page { max-width: 970px; }
.help-faq-search { background: #fff; border: 1px solid #dce5e4; padding: 24px; border-radius: 16px; }
.help-faq-list { display: grid; gap: 12px; }
.help-faq { border: 1px solid #dce5e4; background: #fff; border-radius: 14px; scroll-margin-top: 106px; }
.help-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; list-style: none; cursor: pointer; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq-category { display: block; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: #7a9088; margin-bottom: 6px; }
.help-faq-question { font-size: .95rem; font-weight: 550; line-height: 1.5; }
.help-faq-toggle { color: #3d796a; font-size: 1.4rem; transition: transform .15s; }
.help-faq[open] .help-faq-toggle { transform: rotate(45deg); }
.help-faq-answer { padding: 0 24px 24px; line-height: 1.85; font-size: .9rem; color: #5a7369; }
.help-faq-answer a { color: #1a6c58; font-size: .8rem; }
@media (max-width: 991px) {
    .help-hero { grid-template-columns: 1fr; gap: 28px; }
    .help-year-card { max-width: 400px; }
    .help-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .help-guide-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .help-toc { position: static; max-height: none; overflow: visible; }
    .help-toc nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
    .help-toc nav > p { grid-column: 1 / -1; }
    .help-support { align-items: flex-start; flex-direction: column; }
    .help-support form { min-width: 0; width: 100%; }
}
@media (max-width: 575px) {
    .help-hero { padding: 24px; margin-bottom: 32px; }
    .help-topic-grid { grid-template-columns: minmax(0, 1fr); }
    .help-tabs a { padding: 11px 12px; font-size: .83rem; }
    .help-guide-section { padding: 20px; }
    .help-guide-section-title { gap: 12px; }
    .help-guide-section-title h2 { font-size: 1.15rem; }
    .help-support, .help-faq-search { padding: 20px; }
    .help-faq summary { padding: 18px; gap: 12px; }
    .help-faq-answer { padding: 0 18px 18px; }
}
@media print {
    .app-header, .app-footer, .app-skip-link, .help-tabs, .help-toc, .help-print, .help-back-top, .help-guide-content > .help-support { display: none !important; }
    .help-page { max-width: none; padding: 0 !important; color: #000; }
    .help-guide-layout { display: block; }
    .help-guide-section { border: 0; padding: 0; margin-bottom: 26pt; }
    .help-guide-section h2, .help-guide-section-title { break-after: avoid; }
    .help-steps li, .help-access-table tr { break-inside: avoid; }
    .help-steps li { font-size: 10pt; line-height: 1.6; margin-bottom: 10pt; }
    .help-guide-section-title h2 { font-size: 15pt; }
    .help-topic-number { color: #000; border: 1px solid #ccc; }
    .help-access-table { font-size: 9pt; }
    body, .app-main { background: #fff !important; }
}

/* Account management shares the results workspace and action styles. */
.account-page { max-width: 1440px; }
.account-back { color: #526966; font-size: .85rem; text-decoration: none; }
.account-panel { background: #fff; border: 1px solid #dce5e3; border-radius: 16px; padding: 24px; }
.account-panel h2 { font-size: 1.05rem; font-weight: 650; margin-bottom: 12px; }
.account-choice-list { display: grid; gap: 8px; min-width: 0; }
.account-choice { display: flex; align-items: flex-start; gap: 12px; background: #f7faf9; border: 1px solid #e1e9e6; border-radius: 10px; padding: 13px 14px; font-size: .85rem; cursor: pointer; }
.account-choice input { accent-color: #175c53; flex-shrink: 0; margin-top: 3px; width: 16px; height: 16px; }
.account-choice:has(input:checked) { border-color: #669b8f; background: #edf6f2; }
.account-choice:focus-within { outline: 2px solid #175c53; outline-offset: 2px; }
.account-form-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 24px 0; }
.account-role { display: inline-block; border-radius: 6px; padding: 5px 9px; background: #edf3f1; color: #25564d; font-size: .75rem; font-weight: 600; }
.account-state { display: inline-block; color: #245e50; background: #eaf5ee; padding: 4px 9px; border-radius: 20px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.account-state.is-inactive { color: #68716e; background: #edf0ee; }
.account-name { color: #214e47; font-weight: 600; text-decoration: none; }
.account-name:hover, .account-back:hover { text-decoration: underline; }
.account-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; }
.account-details { margin: 0; overflow-wrap: anywhere; }
.account-details dt { color: #6a7a75; font-size: .75rem; font-weight: 500; margin-top: 16px; }
.account-details dd { font-size: .9rem; margin: 4px 0 0; }
.notification-list { display: grid; gap: .75rem; max-width: 980px; }
.notification-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; background: white; border: 1px solid #dce5e3; border-radius: 14px; }
.notification-card.is-unread { border-left: 4px solid #238b80; background: #f5faf8; }
.email-log-list { display: grid; gap: .8rem; }
.email-log-entry { padding: .9rem 0; border-top: 1px solid #e4ebe8; }
.email-log-entry:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 575px) { .account-panel { padding: 20px; } .account-page .results-quick-search { flex-wrap: wrap; width: 100%; } .account-page .results-quick-search input { flex-basis: 100%; } }

.usage-page { max-width: 1680px; }
.usage-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.usage-metrics .results-metric small { font-size: .9rem; font-weight: 500; }
.usage-chart-scroll { overflow-x: auto; }
.usage-chart { display: grid; grid-template-columns: repeat(var(--usage-days), minmax(16px, 1fr)); gap: 5px; }
.usage-bar-track { height: 170px; display: flex; align-items: flex-end; border-bottom: 1px solid #dce5e3; }
.usage-bar { display: block; width: 100%; max-width: 32px; margin-inline: auto; background: #39796b; border-radius: 4px 4px 0 0; }
.usage-day-label { display: block; font-size: .6rem; color: #6a7a75; white-space: nowrap; margin-top: 8px; }
.usage-breakdown { margin-top: 18px; }
.usage-breakdown > div:first-child, .usage-ranking { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; }
.usage-track { height: 5px; background: #edf3f1; border-radius: 5px; margin-top: 8px; }
.usage-track span { display: block; height: 100%; background: #71a493; border-radius: 5px; }
.usage-ranking { padding: 12px 0; border-bottom: 1px solid #edf3f1; overflow-wrap: anywhere; }
.usage-ranking a { color: #25564d; }
.usage-request { min-width: 180px; max-width: 300px; overflow-wrap: anywhere; }
.usage-agent { min-width: 180px; max-width: 350px; overflow-wrap: anywhere; }
@media (max-width: 767px) { .usage-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .usage-metrics { grid-template-columns: 1fr; } }

.offline-status { padding: 12px 24px; background: #fff3cd; color: #5e4a12; font-size: .85rem; border-bottom: 1px solid #eadba6; }
.offline-status a { color: #4c431f; font-weight: 650; }
.offline-pages { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; }
.offline-page-link { overflow-wrap: anywhere; font-size: .8rem; color: #25564d; }
.offline-draft { padding: 18px 0; border-top: 1px solid #e4ebe8; }
.offline-error { white-space: pre-wrap; }

.offline-detail-dialog { width: min(760px, calc(100% - 24px)); max-height: 90vh; overflow-y: auto; }
.offline-detail-dialog::backdrop { background: rgba(16, 35, 32, .45); }
#offline-editor > summary { cursor: pointer; }
#offline-sector-filter { width: auto; min-width: 150px; }
#offline-search { width: min(100%, 290px); }

.offline-readiness { margin: 1rem clamp(1rem, 4vw, 5rem) 0; padding: 1rem 1.25rem; border: 1px solid var(--bs-border-color, #d9e0e2); border-radius: 1rem; background: #fff; }
.offline-readiness-heading, .offline-readiness-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.offline-readiness-meta { justify-content: flex-start; gap: .5rem 1.5rem; margin-top: .5rem; font-size: .85rem; color: #596b70; }
.offline-readiness[data-state="attention"] { border-color: #b98224; }
#offline-error-list { white-space: pre-wrap; overflow-wrap: anywhere; }


.app-notifications { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1090; width: min(460px, calc(100vw - 3rem)); display: grid; gap: .75rem; pointer-events: none; }
.app-notification { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.4rem; border-radius: 1.4rem; background: #fff; color: #292e30; box-shadow: 0 20px 55px #18242c30; pointer-events: auto; animation: notification-enter .3s ease-out both; }
.app-notification-dot { flex: 0 0 16px; height: 16px; margin-top: .3rem; border-radius: 50%; background: #198754; }
.app-notification[data-level="error"] .app-notification-dot { background: #c43d3d; }
.app-notification[data-level="warning"] .app-notification-dot { background: #b98224; }
.app-notification-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.app-notification-content strong { display: block; font-weight: 650; }
.app-notification-content p { margin: .35rem 0 0; color: #686e72; }
.app-notification-close { flex: 0 0 auto; border: 0; background: transparent; color: #85898b; font-size: 1.8rem; line-height: 1; padding: 0 .2rem; cursor: pointer; }
.app-notification.is-leaving { animation: notification-exit .3s ease-in both; }
@keyframes notification-enter { from { transform: translateX(calc(100% + 2rem)); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes notification-exit { to { transform: translateX(calc(100% + 2rem)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .app-notification, .app-notification.is-leaving { animation-duration: .01ms; } }

.dashboard-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.dashboard-metric { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border: 1px solid #dfe7e4; border-radius: 1.25rem; background: #fff; }
.dashboard-metric span { color: #596b65; font-size: .85rem; }
.dashboard-metric strong { color: #203e35; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 650; line-height: 1.1; }
.dashboard-summary div, .dashboard-change { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid #e4ebe8; }
.dashboard-summary div:last-child, .dashboard-change:last-child { border-bottom: 0; }
.dashboard-summary dt { font-weight: 400; color: #596b65; }
.dashboard-summary dd { margin: 0; font-weight: 650; }
@media (max-width: 767px) { .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 399px) { .dashboard-metrics { grid-template-columns: 1fr; } }

/* Result overview, shared by the dialog and direct record links. */
.result-detail-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; }
.result-detail-dialog-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.5rem; border-bottom: 1px solid #e2ebe6; background: #fff; }
.result-detail-dialog-heading h2 { color: #24413e; font-size: 1.15rem; font-weight: 600; margin: 0; }
.result-detail { color: #294645; }
.result-detail-dialog .result-detail { padding: 1.5rem; }
.result-detail-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1.25rem; margin-bottom: 1.5rem; }
.result-detail-reference { color: #24413e; font-size: 1.8rem; font-weight: 600; letter-spacing: -.04em; margin-bottom: .4rem; overflow-wrap: anywhere; }
.result-detail-sector, .result-detail-tag { display: inline-flex; align-items: center; padding: .3rem .5rem; border: 1px solid #dfebe4; border-radius: 6px; background: #f3f7f4; color: #658075; font-size: .65rem; font-weight: 500; }
.result-detail-sector { background: #e6f1eb; color: #396c59; }
.result-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 470px; }
.result-detail .card { border-color: #e0e8e3; background: white; box-shadow: none; }
.result-detail .card-body > h2 { color: #31564a; font-size: .9rem; font-weight: 600; }
.result-detail .result-detail-dates { background: #f2f7f4; }
.result-detail dt { color: #7a9185; font-size: .74rem; font-weight: 400; }
.result-detail dd { color: #39594e; font-size: .85rem; }
.result-detail .detail-notes { font-size: .82rem; color: #526e61; }
.result-detail .detail-history { font-size: .82rem; }
.result-detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.result-detail-section-heading h3 { color: #31564a; font-size: .95rem; font-weight: 600; margin: 0; }
.result-detail-caption, .result-detail-empty { font-size: .75rem; color: #83968b; }
.result-attachment-list { list-style: none; padding: 0; margin: 0; }
.result-attachment-list li { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-top: 1px solid #edf1ee; }
.result-attachment-list a { color: #456c5b; font-size: .82rem; overflow-wrap: anywhere; }
.result-attachment-list form { margin-left: auto; }
.result-file-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 38px; background: #edf4ef; color: #628a75; border-radius: 7px; }
.result-change-event { border-top: 1px solid #e7eee8; }
.result-change-event summary { display: flex; align-items: center; gap: .75rem; padding: 1rem 0; cursor: pointer; list-style: none; }
.result-change-event summary::-webkit-details-marker { display: none; }
.result-change-event summary::after { content: '+'; color: #7e9588; font-size: 1.1rem; }
.result-change-event[open] summary::after { content: '−'; }
.result-change-heading { display: grid; gap: .25rem; min-width: 0; }
.result-change-heading strong { color: #3b5b4d; font-size: .8rem; font-weight: 600; }
.result-change-heading > span { color: #8a9b90; font-size: .68rem; }
.result-change-dot { width: 8px; height: 8px; border-radius: 50%; background: #adc6b6; flex-shrink: 0; }
.result-change-dot[data-action=deleted] { background: #c58f7c; }
.result-change-dot[data-action=restored] { background: #5d977c; }
.result-change-count { margin-left: auto; white-space: nowrap; color: #8a9b90; font-size: .65rem; }
.result-change-body { padding: 0 0 1.1rem 1.25rem; }
.result-change-table { table-layout: fixed; font-size: .73rem; border-color: #e7eee8; }
.result-change-table thead th { color: #85988b; font-size: .65rem; font-weight: 500; background: #f5f8f5; }
.result-change-table th:first-child { width: 28%; }
.result-change-table td, .result-change-table th { padding: .65rem; overflow-wrap: anywhere; color: #4e6b5b; font-weight: 400; }
.result-detail .result-change-table .detail-notes { font-size: .73rem; }
.result-deletion-note { background: #faf4ef; border: 1px solid #eedfd1; border-radius: 8px; padding: .8rem; }
@media (max-width: 575.98px) {
    .result-detail-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
    .result-detail-dialog-heading, .result-detail-dialog .result-detail { padding: 1rem; }
    .result-detail .card-body { padding: 1rem !important; }
    .result-detail-reference { font-size: 1.5rem; }
    .result-detail-actions { width: 100%; }
    .result-detail-actions .btn { font-size: .7rem; }
    .result-change-body { padding-left: 0; }
    .result-change-count { display: none; }
    .result-change-event summary::after { margin-left: auto; }
    .result-change-table { min-width: 480px; }
}
