:root {
    --ink: #0b0c0c;
    --paper: #f3f2f1;
    --surface: #ffffff;
    --line: #d8d8d8;
    --gov-green: #00703c;
    --gov-blue: #1d70b8;
    --danger: #b10e1e;
    --success: #007a3d;
    --warning: #b45309;
    --radius: 12px;
    --menu-item-size: 48px;
    --menu-green: #2f917a;
    --menu-blue: #0d8f88;
    --menu-deep-green: #174f49;
    /* Spacing scale (base-4) */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-12: 3rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Public Sans", "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    line-height: 1.65;
    background:
        radial-gradient(60rem 20rem at 10% -10%, #dff5e8 0%, transparent 70%),
        radial-gradient(40rem 18rem at 90% 0%, #e9f2fb 0%, transparent 70%),
        var(--paper);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--gov-blue);
    transition: color 0.15s ease;
}

:focus-visible {
    outline: 3px solid rgba(29, 112, 184, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    width: min(1100px, 94vw);
    margin: 0 auto;
}

.site-header {
    background: linear-gradient(180deg, #223444 0%, #1c2d3a 100%);
    border-bottom: 4px solid #1d8d85;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 0.8rem 0 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    color: #ffffff;
    padding: 0.25rem 0;
}

.brand-logo {
    width: auto;
    height: clamp(42px, 4.8vw, 52px);
    max-width: 260px;
    display: block;
    object-fit: contain;
}

.brand-wordmark {
    font-family: "Lexend Deca", "Public Sans", sans-serif;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #f2fbf9;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

.menu {
    margin-left: auto;
}

.mobile-menu-toggle {
    display: none;
}

.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0;
    align-items: flex-start;
    font-family: "Lexend Deca", "Public Sans", sans-serif;
}

.main-menu > li {
    position: relative;
    min-width: calc(3.25 * var(--menu-item-size));
    height: var(--menu-item-size);
    margin: 1px 1px 0;
    background: var(--menu-green);
    color: var(--menu-deep-green);
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.main-menu > li > a,
.main-menu > li > .menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    padding: 0 1rem 0 1.5rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.main-menu > li > a i,
.main-menu > li > .menu-trigger i {
    font-size: 0.9rem;
}

.main-menu > li:not(.with-submenu) {
    clip-path: polygon(10% 0%, 0% 100%, 95% 100%, 100% 50%, 95% 0%);
}

.main-menu > li:nth-child(2) {
    transform: translateX(-8px);
}

.main-menu > li:nth-child(3) {
    transform: translateX(-16px);
}

.main-menu > li:nth-child(4) {
    transform: translateX(-24px);
}

.main-menu > li:nth-child(5) {
    transform: translateX(-32px);
}

.main-menu > li:nth-child(6) {
    transform: translateX(-40px);
}

.main-menu > li.with-submenu {
    clip-path: polygon(10% 0%, 0% 100%, 0% 520%, 95% 520%, 95% 100%, 100% 50%, 95% 0%);
}

.main-menu > li:hover,
.main-menu > li:focus-within {
    background: linear-gradient(to right, var(--menu-green), var(--menu-blue));
    color: #ffffff;
}

.main-menu > li.active {
    background: var(--menu-blue);
    color: #ffffff;
    text-shadow: none;
}

.main-menu > li.active > a,
.main-menu > li.active > .menu-trigger {
    cursor: default;
}

.submenu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% - 1px);
    min-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
}

@media (min-width: 741px) {
    .with-submenu:hover .submenu,
    .with-submenu:focus-within .submenu {
        animation: submenu-in 0.15s ease forwards;
    }
}

@keyframes submenu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.with-submenu:hover .submenu,
.with-submenu:focus-within .submenu {
    display: block;
}

.submenu li + li {
    border-top: 1px solid #dfdfdf;
}

.submenu li a {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.8rem 1rem;
    color: #46535e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.12s ease, color 0.12s ease;
}

.submenu li a:hover,
.submenu li a:focus-visible {
    background: #f0f4f8;
    color: var(--ink);
}

.submenu li a.active {
    color: #ffffff;
    background: #0d8f88;
}

.page-content {
    flex: 1 0 auto;
    padding: 1.75rem 0 4rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(11, 12, 12, 0.06);
}

.panel > h2:first-child,
.panel > h3:first-child {
    margin-top: 0;
}

.hero {
    background: linear-gradient(135deg, #ffffff 0%, #f2f7fd 60%, #eef9f2 100%);
    border: 1px solid #d2dfd7;
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(11, 12, 12, 0.05);
}

.hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.hero p {
    margin: 0 0 0.7rem;
}

.cpc-title-bar {
    background: #263f7f;
    border: 1px solid #1c315f;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1rem 1.2rem;
    margin-bottom: 0;
}

.cpc-title-bar h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.45rem, 2.5vw, 2.1rem);
    line-height: 1.15;
}

.cpc-intro-panel {
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: 0;
}

.hgv-cpc-panel {
    background: linear-gradient(135deg, #f8fcff 0%, #f1f8f3 100%);
    border: 1px solid #c9ddcf;
}

.hgv-cpc-panel h2 {
    margin-top: 0;
}

.hero-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.hero-meta span {
    display: inline-block;
    background: #f0f5f1;
    border: 1px solid #c8d8ce;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.category-grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.test-selector-grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.test-selector-card {
    border: 1px solid #d9d9d9;
    border-radius: var(--radius);
    padding: 1rem;
    background: #f9fbfc;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.test-selector-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    border-color: #b8c8d8;
}

.test-selector-image-wrap {
    width: 100%;
    height: 140px;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.test-selector-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.test-selector-card h3 {
    margin: 0;
    color: var(--gov-green);
    font-size: 1.3rem;
}

.test-selector-card p {
    margin: 0;
}

.test-selector-card .category-meta {
    margin-top: auto;
    padding-top: 0.25rem;
}

.hazard-clip-grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.hazard-clip-card {
    border: 1px solid #d9d9d9;
    border-radius: var(--radius);
    padding: 0.85rem;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hazard-clip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    border-color: #b8c8d8;
}

.hazard-clip-card h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
}

.hazard-clip-poster {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    display: block;
    background: #ffffff;
}

.hazard-clip-preview {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    display: block;
    background: #000000;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    pointer-events: none;
}

.hazard-select-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.hazard-selection-count {
    font-size: 0.93rem;
    color: #24435e;
    background: #edf4fc;
    border: 1px solid #cadced;
    border-radius: 999px;
    padding: 0.26rem 0.7rem;
}

.hazard-select-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1f2f3f;
}

.hazard-player-wrap {
    position: relative;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 0.45rem;
    background: #f8fbff;
    margin-bottom: 0.7rem;
}

.hazard-video {
    width: 100%;
    border-radius: 6px;
    background: #000000;
    display: block;
}

.hazard-click-layer {
    position: absolute;
    left: 0.45rem;
    right: 0.45rem;
    top: 0.45rem;
    bottom: 0.45rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: crosshair;
    padding: 0;
    touch-action: manipulation;
}

.hazard-click-layer:focus-visible {
    outline: 2px solid #1d70b8;
    outline-offset: 2px;
}

.hazard-player-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.hazard-player-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d6d6d6;
    background: #ececec;
    margin-bottom: 0.55rem;
}

.hazard-player-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00703c, #28a266);
}

.hazard-click-timeline {
    position: relative;
    height: 34px;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    background: linear-gradient(180deg, #fefefe 0%, #f3f3f3 100%);
    margin-bottom: 0.65rem;
    overflow: hidden;
}

.hazard-click-flag {
    position: absolute;
    top: 4px;
    width: 10px;
    height: 24px;
}

.hazard-click-flag::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 7px solid #c82323;
    border-right: 9px solid transparent;
}

.hazard-click-flag::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 6px;
    width: 2px;
    height: 16px;
    background: #c82323;
}

.hazard-click-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.55rem;
}

.hazard-click-toolbar p {
    margin: 0;
}

.hazard-click-log {
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    background: #fcfcfc;
}

.hazard-review-media {
    width: min(760px, 100%);
    display: grid;
    gap: 0.55rem;
}

.hazard-review-video {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    display: block;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.hazard-review-timeline-wrap {
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    background: #fcfcfc;
    padding: 0.45rem;
}

.hazard-review-timeline {
    position: relative;
    height: 48px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 100%);
    overflow: hidden;
}

.hazard-review-window-layer,
.hazard-review-flag-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hazard-review-window {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #de9ba0;
    background: rgba(184, 47, 66, 0.08);
    min-width: 18px;
    z-index: 1;
}

.hazard-review-window-steps {
    position: absolute;
    inset: 0;
    display: flex;
}

.hazard-review-window-step {
    flex: 1 1 auto;
    display: inline-flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #4d171d;
    border-left: 1px solid rgba(132, 32, 47, 0.24);
}

.hazard-review-window-step:first-child {
    border-left: 0;
    background: rgba(198, 48, 66, 0.35);
}

.hazard-review-window-step:nth-child(2) {
    background: rgba(198, 48, 66, 0.3);
}

.hazard-review-window-step:nth-child(3) {
    background: rgba(198, 48, 66, 0.25);
}

.hazard-review-window-step:nth-child(4) {
    background: rgba(198, 48, 66, 0.2);
}

.hazard-review-window-step:nth-child(5) {
    background: rgba(198, 48, 66, 0.15);
}

.hazard-review-window-index {
    position: absolute;
    left: 3px;
    bottom: 2px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #4d171d;
    line-height: 1;
}

.hazard-review-flag {
    position: absolute;
    top: 5px;
    width: 10px;
    height: 34px;
    z-index: 2;
}

.hazard-review-flag::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 8px solid #c82323;
    border-right: 10px solid transparent;
}

.hazard-review-flag::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 7px;
    width: 2px;
    height: 21px;
    background: #c82323;
}

.hazard-review-playhead {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 2px;
    border-radius: 999px;
    background: #272727;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    z-index: 3;
    display: none;
    pointer-events: none;
}

.hazard-review-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.28rem;
}

.hazard-review-legend {
    display: flex;
    align-items: center;
    gap: 0.38rem;
    flex-wrap: wrap;
    margin: 0.35rem 0 0;
}

.hazard-review-legend-window {
    width: 18px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid #de9ba0;
    background: rgba(198, 48, 66, 0.25);
}

.hazard-review-legend-flag {
    position: relative;
    width: 12px;
    height: 12px;
    margin-left: 0.35rem;
}

.hazard-review-legend-flag::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 7px solid #c82323;
    border-right: 8px solid transparent;
}

.category-card {
    border: 1px solid #d9d9d9;
    border-radius: var(--radius);
    padding: 0.9rem;
    background: #f3f3f3;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    border-color: #c0c0c0;
}

.category-card h3 {
    margin: 0;
    color: var(--gov-green);
    font-size: 2rem;
    line-height: 1.1;
}

.category-image-wrap {
    width: 100%;
    height: 110px;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.category-meta {
    margin: 0;
    color: #4b4b4b;
    font-size: 0.96rem;
    line-height: 1.35;
}

.category-card form {
    margin-top: auto;
}

.traffic-sign-grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.traffic-sign-category-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.traffic-sign-card {
    border: 1px solid #d8d8d8;
    border-radius: var(--radius);
    padding: 0.85rem;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.traffic-sign-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    border-color: #c0c0c0;
}

.traffic-sign-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.traffic-sign-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.traffic-sign-title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 700;
}

.traffic-sign-source {
    margin-top: 0;
}

.button.category-button {
    width: 100%;
    background: var(--gov-green);
    border-color: #005a30;
    color: #ffffff;
}

.button.category-button:hover {
    background: #005a30;
}

.button.category-button:disabled {
    background: #d6d6d6;
    border-color: #b5b5b5;
    color: #4f4f4f;
}

.split {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.app-promo-panel {
    background: linear-gradient(120deg, #f4fbf6 0%, #f2f7fd 100%);
    border-color: #c9ddcf;
}

.app-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-promo-copy {
    flex: 1 1 320px;
}

.app-promo-kicker {
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    font-weight: 800;
    color: #2a6855;
}

.app-promo-copy h2 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.app-promo-copy p {
    margin: 0;
}

.button.app-promo-button {
    background: #0f7a46;
    border-color: #0b6038;
    color: #ffffff;
    white-space: nowrap;
}

.button.app-promo-button:hover {
    background: #0b6038;
}

.button {
    display: inline-block;
    background: #e8eef7;
    color: #0b0c0c;
    border: 1px solid #b4c7df;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.button:hover {
    background: #dbe7f4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
    box-shadow: none;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.button-primary {
    background: var(--gov-green);
    border-color: #005a30;
    color: #ffffff;
}

.button-primary:hover {
    background: #005a30;
    box-shadow: 0 2px 8px rgba(0, 112, 60, 0.3);
}

.button-danger {
    background: #b10e1e;
    border-color: #8f0d19;
    color: #ffffff;
}

.button-danger:hover {
    background: #8f0d19;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 0.85rem 0;
    color: #6b6b6b;
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #d7d7d7;
}

.auth-divider span {
    padding: 0 0.6rem;
}

.button.button-google {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: #ffffff;
    border-color: #dadce0;
    color: #3c4043;
    font-weight: 600;
}

.button.button-google:hover {
    background: #f8f9fa;
}

.google-mark {
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    background: linear-gradient(45deg, #4285f4 0%, #34a853 34%, #fbbc05 67%, #ea4335 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.inline-form {
    margin-bottom: 0.75rem;
}

.helper {
    font-size: 0.92rem;
    color: #4b4b4b;
}

.progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.timer-chip {
    background: #eef4ff;
    border: 1px solid #c7d8f4;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-weight: 700;
}

.timer-warning {
    color: #b10e1e;
    background: #fdecef;
    border-color: #efb9c0;
}

.case-study-panel {
    border: 1px solid #d4ddea;
    border-radius: 10px;
    background: #f7f9fd;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.9rem;
}

.case-study-panel h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.case-study-panel p {
    margin: 0 0 0.45rem;
}

.case-study-kicker {
    margin: 0 0 0.35rem;
    font-weight: 800;
    color: #1f3f76;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.84rem;
}

.progress-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #e4e4e4;
    border: 1px solid #cfcfcf;
    margin-bottom: 1rem;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00703c, #219f66);
}

.progress-bar.compact {
    height: 10px;
}

.question-title {
    font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.practice-sign-image-wrap {
    width: min(320px, 100%);
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
}

.practice-sign-image {
    width: 100%;
    height: auto;
    display: block;
}

.question-form {
    display: grid;
    gap: 0.65rem;
}

.option-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem;
    align-items: start;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 0.75rem;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-item:hover {
    border-color: #9fb8d8;
    background: #f5f9fe;
    box-shadow: 0 2px 8px rgba(29, 112, 184, 0.08);
}

.option-key {
    font-weight: 700;
}

.result-summary {
    margin-bottom: 1rem;
}

.result-score {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin: 0;
    font-weight: 800;
}

.status-pass {
    color: var(--success);
    font-weight: 700;
}

.status-fail {
    color: var(--danger);
    font-weight: 700;
}

.action-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.review-list {
    display: grid;
    gap: 0.8rem;
}

.review-item {
    border: 1px solid #d6d6d6;
    border-radius: var(--radius);
    padding: 1rem;
    transition: box-shadow 0.15s ease;
}

.review-item:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.review-item h3 {
    margin-top: 0;
    font-size: 1.05rem;
}

.review-correct {
    border-left: 5px solid #00703c;
}

.review-wrong {
    border-left: 5px solid #b10e1e;
}

.review-actions {
    margin-top: 0.65rem;
}

.button.review-explain-button {
    background: #ffe082;
    border-color: #f7b500;
    color: #4e342e;
}

.button.review-explain-button:hover {
    background: #ffd54f;
}

.review-explanation {
    margin-top: 0.55rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #f0ce77;
    border-radius: 8px;
    background: #fff9e9;
}

.review-explanation p {
    margin: 0;
}

.form-panel form {
    display: grid;
    gap: 0.55rem;
}

.account-settings-panel h2 {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.account-settings-form {
    display: grid;
    gap: 0.6rem;
}

.account-settings-form .button {
    margin-top: 0.35rem;
}

label {
    font-weight: 700;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #b8b8b8;
    border-radius: 8px;
    font: inherit;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover {
    border-color: #888888;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: 3px solid rgba(29, 112, 184, 0.22);
    border-color: #1d70b8;
    box-shadow: 0 0 0 4px rgba(29, 112, 184, 0.07);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stat-card h2 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.stat-card h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.stat-value {
    font-size: 1.8rem;
    margin: 0 0 0.35rem;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

th,
td {
    border-bottom: 1px solid #d9d9d9;
    padding: 0.6rem 0.45rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f2f4f8;
}

.qa-list {
    display: grid;
    gap: 0.7rem;
}

.qa-item {
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    padding: 0.8rem;
    background: #fcfcfc;
}

.qa-item h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.link-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.4rem;
}

.flash {
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.flash-success {
    background: #eaf7ef;
    border-color: #b8e0c8;
}

.flash-error {
    background: #fdecec;
    border-color: #f1c3c3;
}

.flash-info {
    background: #ecf4fd;
    border-color: #c5dff7;
}

.flash-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #78350f;
}

.error-list {
    border: 1px solid #efb9c0;
    background: #fdecef;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.8rem;
}

.error-list p {
    margin: 0.35rem 0;
}

.site-footer {
    background: var(--ink);
    color: #ffffff;
    margin-top: auto;
    padding: 1rem 0 1.25rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.93rem;
}

.footer-app-promo {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.footer-app-link {
    display: inline-block;
    text-decoration: none;
    color: #ffffff;
    background: #0f7a46;
    border: 1px solid #0b6038;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 700;
    transition: background 0.15s ease;
}

.footer-app-link:hover {
    background: #0b6038;
    text-decoration: none;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.95rem;
    margin-top: 0.6rem;
}

.footer-nav a {
    color: #d7e8ff;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.faq-list {
    display: grid;
    gap: 0.75rem;
}

.faq-home-list {
    display: grid;
    gap: 0.7rem;
}

.faq-home-item {
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    padding: 0.75rem 0.8rem;
    background: #fcfcfc;
}

.faq-home-item summary {
    cursor: pointer;
    font-weight: 700;
}

.faq-home-item p {
    margin: 0.55rem 0 0;
}

.faq-item {
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    padding: 0.8rem;
    background: #fcfcfc;
}

.faq-item h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

@media (max-width: 900px) {
    .test-selector-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .hazard-clip-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .split {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .main-menu > li {
        min-width: calc(2.6 * var(--menu-item-size));
    }

    .app-promo {
        align-items: flex-start;
    }

    .button.app-promo-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 740px) {
    .container {
        width: min(1100px, 96vw);
    }

    .header-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .menu {
        width: 100%;
        margin-left: 0;
    }

    .brand-wordmark {
        font-size: clamp(1.2rem, 5.3vw, 1.5rem);
    }

    .brand-logo {
        width: auto;
        height: clamp(38px, 10vw, 46px);
        max-width: 220px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.32);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
        font: inherit;
        font-size: 0.92rem;
        font-weight: 700;
        padding: 0.62rem 0.9rem;
        margin-top: 0.2rem;
        cursor: pointer;
    }

    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:focus-visible {
        background: rgba(255, 255, 255, 0.16);
        outline: none;
    }

    .menu.is-collapsed .main-menu {
        display: none;
    }

    .menu.is-expanded .main-menu {
        display: flex;
    }

    .main-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.38rem;
        padding-top: 0.35rem;
    }

    .main-menu > li,
    .main-menu > li:nth-child(n) {
        transform: none;
        width: 100%;
        min-width: 0;
        height: auto;
        clip-path: none;
        border-radius: 8px;
    }

    .main-menu > li.with-submenu {
        clip-path: none;
    }

    .main-menu > li > a,
    .main-menu > li > .menu-trigger {
        padding: 0.72rem 0.85rem;
        line-height: 1.25;
        font-size: 0.93rem;
    }

    .submenu {
        position: static;
        box-shadow: none;
        border-top: 1px solid #d4d4d4;
        min-width: 100%;
    }

    .main-menu > li.with-submenu:hover .submenu,
    .main-menu > li.with-submenu:focus-within .submenu {
        display: none;
    }

    .main-menu > li.with-submenu.submenu-open .submenu {
        display: block;
    }

    .main-menu > li.with-submenu.submenu-open:hover .submenu,
    .main-menu > li.with-submenu.submenu-open:focus-within .submenu {
        display: block;
    }

    body.test-in-progress .page-content {
        padding-top: 0.7rem;
    }

    body.test-in-progress .panel {
        padding: 0.9rem;
    }

    body.test-in-progress .progress-meta {
        gap: 0.48rem;
        font-size: 0.91rem;
    }

    body.test-in-progress .question-title {
        margin-top: 0.25rem;
        margin-bottom: 0.45rem;
        font-size: clamp(1.08rem, 5.3vw, 1.28rem);
        line-height: 1.28;
    }

    .option-item {
        grid-template-columns: auto auto 1fr;
        padding: 0.58rem;
    }

    body.test-in-progress .hazard-player-controls .button {
        flex: 1 1 calc(50% - 0.55rem);
        text-align: center;
    }

    body.test-in-progress .hazard-click-toolbar {
        gap: 0.45rem;
    }

    .category-card h3 {
        font-size: 1.55rem;
    }

    .category-image-wrap {
        height: 100px;
    }
}
