:root {
    --bg: #eef3f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --border: #d9e2f1;
    --shadow: 0 10px 30px rgba(31, 41, 55, 0.08);

    --blue: #265dbe;
    --blue-dark: #1f4a96;

    --none: #43a047;      /* green */
    --medium: #f4c542;    /* yellow */
    --high: #d32f2f;      /* red */
    --critical: #ef6c00;  /* orange */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #f5f8fc 0%, #edf3f9 100%);
    color: var(--text);
}

.page-shell {
    width: min(1800px, 96%);
    margin: 0 auto;
    padding: 24px 0 40px;
}

.hero {
    background: linear-gradient(135deg, #1f4a96 0%, #2d6cdf 100%);
    color: white;
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: rgba(255,255,255,0.92);
    font-size: 15px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.criterion-card,
.summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.criterion-card {
    min-height: 460px;
    width: 100%;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.card-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--blue-dark);
}

.criterion-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-dark);
    background: #eaf1ff;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    padding: 6px 10px;
    white-space: nowrap;
}

.criteria-description {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
    margin-top: 12px;
    margin-bottom: 16px;
}

.placeholder-image {
    width: 100%;
    height: 140px;
    border-radius: 14px;
    border: 2px dashed #c9d6ea;
    background: linear-gradient(135deg, #f4f8ff 0%, #eaf1ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7a90;
    font-weight: 600;
    font-size: 14px;
}

.choice-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.choice-btn {
    flex: 1;
    min-width: 150px;
    border: 1px solid #cfd9e8;
    background: #f8fbff;
    color: #1f4a96;
    border-radius: 12px;
    padding: 11px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.choice-btn:hover {
    background: #eef4ff;
    transform: translateY(-1px);
}

.secondary-choice {
    background: #f7f7f7;
    color: #475569;
}

.secondary-choice:hover {
    background: #efefef;
}

.active-choice {
    background: linear-gradient(135deg, #2158b8 0%, #2d6cdf 100%);
    color: white;
    border-color: #2158b8;
    box-shadow: 0 8px 20px rgba(33, 88, 184, 0.18);
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

select {
    width: 100%;
    border: 1px solid #cad5e5;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(38, 93, 190, 0.12);
}

.custom-select-wrap {
    position: relative;
}

.custom-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.custom-select-trigger {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cad5e5;
    border-radius: 10px;
    padding: 10px 34px 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
    color: #111827;
    cursor: pointer;
    position: relative;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select-trigger::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #667085;
    transform: translateY(-50%);
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(38, 93, 190, 0.12);
}

.custom-select-trigger.is-open {
    border-color: var(--blue);
}

.custom-select-trigger.is-disabled {
    background: #eceff3;
    color: #8b8f94;
    cursor: not-allowed;
}

.custom-select-trigger.field-error {
    border-color: #b00020;
    box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.15);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cad5e5;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.18);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    padding: 4px;
}

.custom-select-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    color: #111827;
}

.custom-select-option:hover,
.custom-select-option.is-active {
    background: #eef4ff;
}

.custom-select-option.is-selected {
    background: #e3ecff;
    font-weight: 700;
}

.result-panel {
    margin-top: 18px;
    border-top: 1px solid #e6edf7;
    padding-top: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
    border-radius: 12px;
    padding: 14px;
}

.score-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.score-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.score-number {
    font-weight: 700;
    color: #0f172a;
}

.vector-text {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    color: #1e3a8a;
    word-break: break-word;
}

.severity-none {
    background: var(--none);
}

.severity-low {
    background: #d3be06;
    color: #222;
}

.severity-medium {
    background: var(--medium);
    color: #222;
}

.severity-high {
    background: var(--high);
}

.severity-critical {
    background: var(--critical);
}

.error {
    color: #b00020;
    font-weight: 700;
}

.validation-error-banner {
    background: #fdecec;
    border: 1px solid #ef9a9a;
    color: #8b1e1e;
    font-weight: 700;
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 20px;
    text-align: center;
}

.locked-banner {
    background: #eef3f9;
    border: 1px solid #cfd9e8;
    color: #334155;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 18px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.comms-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #eef3f9;
    border: 1px solid #cfd9e8;
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 20px;
}

.comms-banner label {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1f4a96;
}

.comms-banner select {
    width: auto;
    min-width: 180px;
}

select.field-error {
    border-color: #b00020;
    box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.15);
}

select:disabled,
.choice-btn:disabled {
    background: #eceff3;
    color: #8b8f94;
    cursor: not-allowed;
    opacity: 0.85;
}

.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 26px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 12px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.12);
}

.primary-btn {
    background: linear-gradient(135deg, #2158b8 0%, #2d6cdf 100%);
    color: white;
}

.secondary-btn {
    background: #f0f3f8;
    color: #334155;
    border: 1px solid #d4dce8;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);
    opacity: 0.97;
}

.summary-card {
    margin-top: 30px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 12px;
}

.summary-table th,
.summary-table td {
    border: 1px solid #dce4f0;
    padding: 14px;
    text-align: center;
    height: 56px;
}

.summary-table th {
    background: #edf3ff;
    color: #1f4a96;
    font-size: 14px;
}

.row-label {
    text-align: left !important;
    font-weight: 700;
    background: #f8fbff;
    color: #334155;
    width: 140px;
}

.severity-none-cell {
    background: var(--none);
}

.severity-medium-cell {
    background: var(--medium);
}

.severity-high-cell {
    background: var(--high);
}

.severity-critical-cell {
    background: var(--critical);
}

@media (max-width: 1700px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .hero h1 {
        font-size: 26px;
    }

    .summary-table th,
    .summary-table td {
        padding: 10px;
        font-size: 12px;
    }
}

.not-assessed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    border: 1px dashed #d1d9e6;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafbfc 0%, #f2f4f7 100%);
    text-align: center;
    padding: 24px;
}

.not-assessed-card h3 {
    margin: 10px 0 8px;
    color: #475467;
    font-size: 22px;
}

.not-assessed-card p {
    margin: 0;
    font-size: 14px;
    color: #667085;
    line-height: 1.5;
}

.not-assessed-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
}

.summary-empty {
    background: #eceff3;
}

.severity-NA-cell {
    background: #8f8f8f !important;
}

.severity-none-cell {
    background: #56ad5a !important;
}

.severity-low-cell {
    background: #d3be06 !important;
}

.severity-medium-cell {
    background: #e08632 !important;
}

.severity-high-cell {
    background: #d80606 !important;
}

.severity-critical-cell {
    background: #7c0000 !important;
}

.summary-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
}

.score-mode-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    margin-bottom: 4px;
}

.mode-btn {
    border: 1px solid #cfd9e8;
    background: #f8fbff;
    color: #1f4a96;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.mode-btn:hover {
    background: #eef4ff;
}

.mode-btn.active-mode-btn {
    background: linear-gradient(135deg, #2158b8 0%, #2d6cdf 100%);
    color: white;
    border-color: #2158b8;
    box-shadow: 0 8px 20px rgba(33, 88, 184, 0.18);
}

.score-marker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.marker-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    color: white;
    background: rgba(0, 0, 0, 0.35);
}

.marker-tag-base {
    background: rgba(0, 0, 0, 0.55);
}

.marker-tag-temporal {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.85);
}

.summary-icon {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chp-icon {
    color: #111;
}

.pii-icon {
    color: #111;
}

.real-image-wrap {
    width: 100%;
    height: 160px;
    border-radius: 14px;
    overflow: hidden;
    background: #eef2f7;
    border: 1px solid #dbe4f0;
}

.criteria-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: white;
}

.summary-empty {
    background: #eceff3;
}

.summary-not-assessed {
    background: #8b8f94;
    color: white;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.not-assessed-table-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.risk-summary-card {
    margin-top: 32px;
    background: #ffffff;
    border: 1px solid #d9e2f1;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
}

.risk-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.risk-summary-header h2 {
    margin: 0;
    color: #1f4a96;
    font-size: 26px;
}

.cumulative-score-badge {
    background: linear-gradient(135deg, #2158b8 0%, #2d6cdf 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(33, 88, 184, 0.18);
}

.cumulative-score-badge-low {
    background: linear-gradient(135deg, #136a05 0%, #136a05 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(33, 88, 184, 0.18);
}

.cumulative-score-badge-medium {
    background: linear-gradient(135deg, #e0d44b 0%, #e0d44b 100%);
    color: black;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(33, 88, 184, 0.18);
}

.cumulative-score-badge-high {
    background: linear-gradient(135deg, #e08a2e 0%, #d9720c 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(33, 88, 184, 0.18);
}

.cumulative-score-badge-critical {
    background: linear-gradient(135deg, #c62828 0%, #8b0000 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(33, 88, 184, 0.18);
}

.risk-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-radius: 16px;
    padding: 18px 20px;
    margin-top: 14px;
    border: 1px solid transparent;
}

.risk-box-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: rgba(255,255,255,0.35);
}

.risk-box-content h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.risk-box-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

.risk-box-chp {
    background: #fdecec;
    border-color: #ef9a9a;
    color: #8b1e1e;
}

.risk-box-pii {
    background: #fff3e8;
    border-color: #ffcc9a;
    color: #a64b00;
}

.risk-box-safe {
    background: #ecf8ef;
    border-color: #a5d6a7;
    color: #1f6f3d;
}

.nested-group {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.subquestion-box {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f6fc 100%);
    border: 1px solid #d8e3f2;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.subquestion-box h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #1f4a96;
    font-weight: 700;
}

.inner-subquestion-box {
    background: linear-gradient(180deg, #f2d8ed 0%, #e7cef0 100%);
    border: 1px solid #f29ae0;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}