:root {
    --page-bg: #eef2f6;
    --surface: #ffffff;
    --surface-muted: #f7f9fb;
    --text: #17202a;
    --muted: #637083;
    --line: #dce3ea;
    --brand: #123b63;
    --brand-strong: #0c2a47;
    --accent: #a33b2f;
    --focus: #2d7dd2;
    --shadow: 0 16px 42px rgba(15, 28, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(rgba(238, 242, 246, 0.94), rgba(238, 242, 246, 0.96)),
        url("../images/bg-master.jpg") center / cover fixed;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--brand);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: 12px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 6px;
    background: #fff;
    color: var(--brand-strong);
    font-weight: 700;
    transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

.site-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.site-header {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.site-banner {
    display: block;
    background: var(--brand-strong);
}

.site-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.site-title {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1.05rem;
    font-weight: 700;
}

.nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.nav-link-pill:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.panel {
    margin-top: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.panel-title {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1.35rem;
    font-weight: 700;
}

.panel-body {
    padding: 20px;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: #263746;
    font-weight: 700;
}

.field-help {
    display: block;
    margin-top: 5px;
    color: #566575;
    font-size: 0.9rem;
}

.form-control {
    min-height: 44px;
    border: 1px solid #bfccd8;
    border-radius: 6px;
}

.segmented {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #bfccd8;
    border-radius: 6px;
    background: var(--surface);
}

.status-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented label {
    min-height: 42px;
    margin: 0;
    padding: 10px 14px;
    color: var(--brand);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.segmented input:checked + label {
    background: var(--brand);
    color: #fff;
}

.segmented input:focus-visible + label {
    outline: 3px solid var(--focus);
    outline-offset: -3px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    min-height: 42px;
    border-radius: 6px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--brand);
    background: var(--brand);
}

.btn-primary:hover {
    border-color: var(--brand-strong);
    background: var(--brand-strong);
}

.btn-secondary {
    border-color: #b7c2ce;
    background: #eef2f6;
    color: #263746;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 6px;
    background: #e8f1f8;
    color: var(--brand-strong);
    font-weight: 700;
}

.alert-public {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #f0c2bd;
    border-radius: 6px;
    background: #fff3f1;
    color: #8f2418;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.results-table caption {
    caption-side: top;
    padding: 10px 12px;
    color: #263746;
    font-weight: 700;
    text-align: left;
}

.results-table {
    width: 100%;
    margin: 0;
    background: var(--surface);
}

.results-table th {
    border-top: 0;
    background: var(--surface-muted);
    color: #263746;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.results-table td {
    vertical-align: middle;
    padding: 0;
}

.row-link {
    display: block;
    min-height: 46px;
    padding: 0.75rem;
    color: var(--text);
    text-decoration: none;
}

.row-link:hover {
    background: #edf4fa;
    color: var(--brand-strong);
    text-decoration: none;
}

.row-link-action {
    color: var(--brand);
    font-weight: 700;
}

.empty-state {
    margin: 18px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    color: #263746;
}

.details-layout {
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
    gap: 20px;
}

.person-photo {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.person-name {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1.55rem;
    font-weight: 700;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.meta-item {
    min-height: 64px;
    padding: 11px 12px;
    background: var(--surface);
}

.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meta-value {
    display: block;
    margin-top: 4px;
    font-weight: 700;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    text-decoration: none;
}

.section-title {
    margin: 24px 0 12px;
    color: var(--brand-strong);
    font-size: 1.25rem;
    font-weight: 700;
}

.charges-list {
    display: grid;
    gap: 12px;
}

.charge-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.charge-main {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.charge-title {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1rem;
    font-weight: 700;
}

.charge-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.92rem;
}

.charge-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.charge-field {
    padding: 11px 12px;
    background: var(--surface);
}

.charge-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.charge-value {
    display: block;
    margin-top: 4px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.site-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 32px;
    color: #415162;
    font-size: 0.88rem;
}

.disclaimer-panel {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
}

.disclaimer-panel p {
    margin: 0 0 10px;
}

.disclaimer-panel p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .site-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 10px;
    }

    .site-nav,
    .panel-header,
    .status-row {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-actions {
        justify-content: stretch;
    }

    .panel-actions .nav-link-pill,
    .panel-actions .action-button {
        justify-content: center;
        width: 100%;
    }

    .search-grid,
    .details-layout,
    .meta-grid,
    .charge-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (forced-colors: active) {
    .site-header,
    .panel,
    .charge-item,
    .meta-grid,
    .table-wrap,
    .disclaimer-panel {
        border: 1px solid CanvasText;
        box-shadow: none;
    }

    .segmented input:checked + label {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }
}
