:root {
    --gold: #d7a62b;
    --gold-dark: #9d6f12;
    --gold-soft: #f7edd2;
    --black: #090b0b;
    --black-2: #111515;
    --ink: #111313;
    --muted: #666764;
    --line: #e4dccb;
    --surface: #fffdf8;
    --background: #f7f2e8;
    --danger: #b83f3f;
    --success: #4a762c;
    --shadow: 0 22px 60px rgba(88, 58, 10, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100svh;
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* SafeHub camera — native-like preview instead of a large white dialog */
#cameraDialog {
    width: min(92vw, 720px);
    height: min(88dvh, 780px);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(215, 166, 43, 0.75);
    border-radius: 22px;
    background: #000;
    color: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

#cameraDialog::backdrop {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(3px);
}

#cameraDialog[open] {
    display: block;
}

#cameraDialog h3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    margin: 0;
    padding: 18px 64px 28px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
    color: #fff;
    font-size: 18px;
    text-align: center;
    pointer-events: none;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    max-height: none;
    display: block;
    object-fit: cover;
    background: #000;
}

#cameraDialog #capturePhotoButton {
    position: absolute;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 4;
    min-width: 118px;
    margin: 0;
    padding: 14px 22px;
    transform: translateX(-50%);
    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 900;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

#cameraDialog #capturePhotoButton:disabled {
    opacity: 0.55;
}

#cameraDialog #closeCameraButton {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 5;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

#cameraDialog #flashCameraButton {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: 5;
    min-width: 112px;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.52);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

#cameraDialog #flashCameraButton.is-on {
    border-color: rgba(255, 220, 92, 0.95);
    background: rgba(170, 122, 0, 0.88);
    color: #fff7c2;
}

#cameraDialog #flashCameraButton.is-unavailable,
#cameraDialog #flashCameraButton:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

#cameraDialog #flashCameraButton[hidden] {
    display: none !important;
}


@media (max-width: 700px) {
    #cameraDialog {
        width: 100vw;
        height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    #cameraDialog h3 {
        padding-top: max(18px, env(safe-area-inset-top));
    }
}

body.privacy-shield > * {
    filter: blur(18px);
    visibility: hidden;
}

body.privacy-shield::after {
    content: 'SafeWorker';
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    color: #caa85e;
    background: #090b0b;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.app {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(
            circle at 50% 18%,
            #ffffff 0,
            #fbf7ef 42%,
            #f4ecdd 100%
        );
}

.topbar {
    min-height: 82px;
    padding: 12px max(24px, 4.5vw);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(8, 10, 10, 0.97);
    border-bottom: 1px solid rgba(215, 166, 43, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(215, 166, 43, 0.28);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand strong {
    color: #f8f7f2;
    font-size: 27px;
    letter-spacing: -0.02em;
}

.brand strong span {
    color: var(--gold);
}

.brand-role {
    margin-top: 3px;
    color: #c9cdd2;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand small {
    margin-top: 7px;
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: #f5f0e5;
    font-size: 14px;
}

.brand-by {
    font-size: 0.78em;
    font-weight: 650;
    opacity: 0.86;
}

.excelliso-word {
    color: inherit;
    font-weight: 800;
}

.excelliso-s {
    color: var(--gold);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-language-wrap {
    display: none;
}

.desktop-language-wrap {
    display: flex;
}

.language-picker {
    position: relative;
}

.language-trigger {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid #d7c7a7;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #fffdf8);
    color: var(--ink);
    font-weight: 850;
    text-align: left;
    box-shadow: 0 5px 14px rgba(88, 58, 10, 0.06);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.language-trigger:hover,
.language-picker.open .language-trigger {
    border-color: var(--gold);
    box-shadow:
        0 0 0 4px rgba(215, 166, 43, 0.12),
        0 10px 24px rgba(88, 58, 10, 0.1);
}

.desktop-language-trigger {
    width: 190px !important;
    max-width: 190px !important;
    border-color: rgba(215, 166, 43, 0.55) !important;
    border-radius: 999px !important;
    background: #111515 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.language-current-flag {
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif;
    font-size: 22px;
    line-height: 1;
}

.language-current-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.language-chevron {
    width: 9px;
    height: 9px;
    flex: none;
    border-right: 2px solid var(--gold-dark);
    border-bottom: 2px solid var(--gold-dark);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.language-picker.open .language-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.language-menu {
    display: none;
    position: absolute;
    z-index: 999;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 6px;
    border: 1px solid #dfd2b7;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 45px rgba(31, 23, 8, 0.22);
}

.language-picker.open .language-menu {
    display: block;
    animation: language-pop 0.18s ease-out both;
}

.language-picker[data-language-picker="desktop-header"] .language-menu {
    width: 300px;
    max-height: min(62vh, 420px);
    top: calc(100% + 10px);
    right: 0;
}

.language-option {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-weight: 720;
    text-align: left;
}

.language-option:hover,
.language-option[aria-selected="true"] {
    background: var(--gold-soft);
}

.language-option-flag {
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif;
    font-size: 21px;
}

@keyframes language-pop {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.shell {
    width: min(820px, calc(100% - 30px));
    margin: 0 auto;
    padding: 34px 0 72px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: screen-fade 0.22s ease;
}

@keyframes screen-fade {
    from {
        opacity: 0.2;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.screen[data-screen="home"]::before,
.screen[data-screen="home"]::after {
    content: "";
    width: 48vw;
    height: 280px;
    position: fixed;
    bottom: -90px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.9;
}

.screen[data-screen="home"]::before {
    left: -7vw;
    background:
        repeating-linear-gradient(
            18deg,
            transparent 0 30px,
            rgba(215, 166, 43, 0.52) 31px 32px,
            transparent 33px 58px
        );
}

.screen[data-screen="home"]::after {
    right: -7vw;
    background:
        repeating-linear-gradient(
            -18deg,
            transparent 0 30px,
            rgba(215, 166, 43, 0.52) 31px 32px,
            transparent 33px 58px
        );
}

.hero {
    padding: 14px 8px 24px;
    text-align: center;
}

.hero-mark {
    width: 92px;
    height: 92px;
    margin: 0 auto 25px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(145deg, #151818, #050606);
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.25),
        0 0 28px rgba(215, 166, 43, 0.28);
}

.hero-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eyebrow {
    margin-bottom: 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.hero-safehub {
    display: inline-block;
}

.hero-safehub span {
    color: var(--gold);
}

.hero-worker {
    margin-left: 8px;
    display: inline-block;
    color: #7f858b;
    font-size: 0.92em;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 780px;
    margin: 0 auto 17px;
    font-size: clamp(36px, 6.2vw, 59px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.hero p {
    max-width: 660px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.home-cta {
    max-width: 780px;
    margin: 28px auto 0;
}

.primary,
.secondary {
    width: 100%;
    border-radius: 16px;
    font-weight: 900;
}

.primary {
    position: relative;
    overflow: hidden;
    padding: 18px 22px;
    border: 1px solid #1e2222;
    background: linear-gradient(180deg, #111515, #080a0a);
    color: #ffffff;
    box-shadow:
        0 13px 30px rgba(0, 0, 0, 0.18),
        0 8px 22px rgba(215, 166, 43, 0.15);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.primary:hover {
    transform: translateY(-2px);
    border-color: rgba(215, 166, 43, 0.8);
    background: linear-gradient(180deg, #1b1810, #0c0d0d);
    box-shadow:
        0 0 0 1px rgba(215, 166, 43, 0.2),
        0 18px 40px rgba(0, 0, 0, 0.25),
        0 10px 34px rgba(215, 166, 43, 0.32);
}

.primary:active {
    transform: translateY(0) scale(0.995);
}

.primary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.secondary {
    padding: 15px 20px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
}


/* =========================================================
   Safety Engagement Score dashboard — premium v2
   ========================================================= */
.score-dashboard {
    width: min(780px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.safety-score-card,
.score-activity-card {
    border-radius: 26px;
}

.safety-score-card {
    padding: clamp(22px, 5vw, 34px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 185, 78, 0.72);
    background:
        radial-gradient(circle at 93% 8%, rgba(226, 182, 69, 0.22), transparent 30%),
        radial-gradient(circle at 12% 100%, rgba(215, 166, 43, 0.10), transparent 32%),
        linear-gradient(145deg, #111515 0%, #080a0a 68%, #161105 100%);
    color: #ffffff;
    box-shadow:
        0 22px 52px rgba(37, 26, 4, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.safety-score-card::before {
    content: "";
    width: 220px;
    height: 220px;
    position: absolute;
    right: -105px;
    top: -112px;
    border: 1px solid rgba(230, 187, 82, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 34px rgba(230, 187, 82, 0.035),
        0 0 0 70px rgba(230, 187, 82, 0.018);
    pointer-events: none;
}

.score-card-head,
.score-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.score-card-head {
    position: relative;
    z-index: 1;
}

.score-card-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.score-card-title-wrap > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.score-card-eyebrow {
    color: #deb54e;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.16em;
    line-height: 1.2;
}

.score-card-title-wrap h2,
.score-activity-head h2 {
    margin: 0;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.score-card-title-wrap h2 {
    color: #ffffff;
    font-size: clamp(20px, 4.5vw, 28px);
}

.score-activity-head h2 {
    color: var(--ink);
    font-size: clamp(21px, 4.6vw, 29px);
}

.score-medal {
    width: 52px;
    height: 52px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid rgba(236, 199, 107, 0.62);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(235, 197, 103, 0.20), rgba(148, 102, 14, 0.08));
    box-shadow: inset 0 0 18px rgba(224, 180, 70, 0.08);
}

.score-medal svg {
    width: 32px;
    height: 32px;
    overflow: visible;
}

.score-medal circle {
    fill: none;
    stroke: #e3b94e;
    stroke-width: 2;
}

.score-medal path {
    fill: #e9c45f;
}

.score-safety-worker {
    width: 96px;
    height: 100px;
    margin: -10px -5px -18px 0;
    flex: none;
    display: grid;
    place-items: center;
    position: relative;
    filter: drop-shadow(0 13px 17px rgba(0, 0, 0, 0.38));
    transform-origin: 50% 100%;
    animation: score-worker-float 4.6s ease-in-out infinite;
}

.score-safety-worker svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.score-worker-shadow {
    fill: rgba(0, 0, 0, 0.30);
}

.score-worker-body {
    fill: #171b1a;
    stroke: rgba(237, 202, 107, 0.58);
    stroke-width: 1.6;
}

.score-worker-vest {
    fill: #262c29;
}

.score-worker-vest-line {
    fill: none;
    stroke: #dcb54d;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.86;
}

.score-worker-head {
    fill: #e9c3a5;
}

.score-worker-hair {
    fill: #171717;
}

.score-worker-helmet {
    fill: #20b45a;
    stroke: #8ce2a9;
    stroke-width: 1.5;
}

.score-worker-helmet-brim {
    fill: #159348;
    stroke: #8ce2a9;
    stroke-width: 1.2;
}

.score-worker-helmet-mark {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
}

.score-worker-face {
    fill: none;
    stroke: #714f3f;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.score-worker-arm {
    fill: #252b29;
    stroke: rgba(237, 202, 107, 0.50);
    stroke-width: 1.5;
}

.score-worker-hand {
    fill: #e9c3a5;
}

.score-worker-clipboard {
    fill: #efe9db;
    stroke: #d1a83d;
    stroke-width: 1.7;
}

.score-worker-clip {
    fill: #d5aa37;
}

.score-worker-check,
.score-worker-paper {
    fill: none;
    stroke: #159348;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.score-worker-paper {
    stroke: #777b77;
    stroke-width: 1.7;
}

@keyframes score-worker-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(0.7deg); }
}

@media (prefers-reduced-motion: reduce) {
    .score-safety-worker { animation: none; }
}

.score-loading,
.score-error {
    margin-top: 22px;
    padding: 15px 16px;
    position: relative;
    z-index: 1;
    border-radius: 14px;
    font-weight: 750;
}

.score-loading {
    border: 1px solid rgba(226, 184, 78, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #d7d9d7;
}

.score-error {
    border: 1px solid rgba(255, 127, 107, 0.28);
    background: rgba(184, 63, 63, 0.13);
    color: #ffc4b9;
}

#scoreContent {
    position: relative;
    z-index: 1;
}

.score-number-row {
    margin-top: 27px;
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.score-points {
    background: linear-gradient(180deg, #f2d47e 0%, #d5a62e 55%, #b87f11 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: clamp(66px, 15vw, 96px);
    line-height: 0.9;
    letter-spacing: -0.06em;
    text-shadow: 0 8px 28px rgba(215, 166, 43, 0.10);
}

.score-unit {
    color: #ffffff;
    font-size: clamp(24px, 5.7vw, 38px);
    font-weight: 950;
}

.score-level-row {
    width: fit-content;
    margin-top: 21px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(226, 184, 78, 0.36);
    border-radius: 999px;
    background: rgba(226, 184, 78, 0.10);
    color: #f1f1ed;
    font-size: 15px;
}

.score-level-row strong {
    color: #efca6b;
}

.score-next-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #c8cbc8;
    font-size: 15px;
}

.score-next-row strong {
    color: #ffffff;
}

.score-progress {
    width: 100%;
    height: 13px;
    margin-top: 22px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
}

.score-progress-fill {
    width: 0;
    height: 100%;
    display: block;
    position: relative;
    border-radius: inherit;
    background: linear-gradient(90deg, #a97012 0%, #d5a62e 50%, #f0cf70 100%);
    box-shadow: 0 0 18px rgba(224, 177, 59, 0.38);
    transition: width 0.45s ease;
}

.score-progress-fill::after {
    content: "";
    width: 7px;
    height: 7px;
    position: absolute;
    right: 3px;
    top: 2px;
    border-radius: 50%;
    background: rgba(255,255,255,.72);
    box-shadow: 0 0 8px rgba(255,255,255,.7);
}

.score-progress-text {
    margin-top: 9px;
    color: #e7e8e6;
    font-size: 14px;
    font-weight: 850;
    text-align: right;
}

.score-pending-count {
    width: fit-content;
    margin-top: 15px;
    padding: 9px 12px;
    border: 1px solid rgba(229, 187, 83, 0.33);
    border-radius: 999px;
    background: rgba(229, 187, 83, 0.10);
    color: #f0ce76;
    font-size: 12px;
    font-weight: 850;
}

.score-privacy-note {
    margin: 17px 0 0;
    color: #9ea29f;
    font-size: 12px;
    line-height: 1.45;
}

.score-activity-card {
    padding: clamp(20px, 4.5vw, 28px);
    border: 1px solid #ded7c7;
    background:
        radial-gradient(circle at 100% 0%, rgba(215, 166, 43, 0.08), transparent 26%),
        rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 38px rgba(82, 57, 16, 0.10);
}

.score-link-button {
    flex: none;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--gold-dark);
    font-weight: 850;
}

.score-link-button:hover,
.score-link-button:focus-visible {
    background: var(--gold-soft);
}

.score-activity-list {
    margin-top: 12px;
}

.score-activity-item {
    padding: 15px 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #ece7db;
}

.score-activity-item:last-child {
    border-bottom: 0;
}

.score-activity-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid #f0ddb1;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff9e9, #f8edcf);
    font-size: 19px;
    box-shadow: 0 6px 14px rgba(138, 96, 13, 0.08);
}

.score-activity-body {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.score-activity-title {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.35;
}

.score-activity-meta,
.score-activity-date {
    color: #7a7b78;
    font-size: 12px;
    line-height: 1.35;
}

.score-activity-date {
    max-width: 105px;
    text-align: right;
}

.score-empty {
    margin: 18px 0 0;
    padding: 28px 18px 20px;
    position: relative;
    border: 1px dashed #dfc98f;
    border-radius: 18px;
    background: linear-gradient(145deg, #fffdf8, #faf5e8);
    color: #6f706d;
    text-align: center;
    line-height: 1.5;
}

.score-empty::before {
    content: "✦";
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f7e8b9;
    color: #a87513;
    font-size: 23px;
    font-weight: 900;
}

.score-actions {
    display: grid;
    gap: 11px;
}

.score-new-report {
    min-height: 58px;
    border-color: #b98a24;
    background: linear-gradient(135deg, #edcf78 0%, #d9a934 52%, #bb7f12 100%);
    color: #111313;
    box-shadow: 0 12px 25px rgba(169, 113, 15, 0.22);
}

.score-new-report:hover,
.score-new-report:focus-visible {
    background: linear-gradient(135deg, #f4da8b, #e0b443 52%, #c98d1d);
    color: #0b0d0d;
}

.score-history-button {
    border-color: #343838;
    background: #111515;
    color: #ffffff;
}

.anonymous-score-note {
    margin-top: 10px;
    display: block;
    color: #6d5317;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
}

@media (max-width: 620px) {
    .safety-score-card {
        padding: 21px 20px 23px;
    }

    .score-card-head {
        align-items: flex-start;
    }

    .score-medal {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .score-safety-worker {
        width: 78px;
        height: 83px;
        margin: -9px -6px -14px 0;
    }

    .score-card-eyebrow {
        font-size: 9px;
        letter-spacing: 0.13em;
    }

    .score-activity-head {
        align-items: flex-start;
    }

    .score-activity-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .score-activity-date {
        grid-column: 2;
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 420px) {
    .score-card-title-wrap {
        gap: 10px;
    }

    .score-medal {
        width: 42px;
        height: 42px;
    }

    .score-safety-worker {
        width: 66px;
        height: 72px;
        margin-right: -7px;
    }

    .score-card-title-wrap h2 {
        font-size: 19px;
    }
}

.panel {
    padding: clamp(20px, 5vw, 34px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: var(--shadow);
}

.stephead {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.back {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #ffffff;
    font-size: 20px;
}

.stephead small {
    color: var(--muted);
}

.stephead h2 {
    margin: 2px 0 0;
    font-size: 25px;
}

.choice-grid {
    display: grid;
    gap: 14px;
}

.choice {
    width: 100%;
    padding: 19px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    text-align: left;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.choice:hover,
.choice.selected {
    transform: translateY(-1px);
    border-color: var(--gold);
    box-shadow: 0 9px 22px rgba(157, 111, 18, 0.12);
}

.choice-icon {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--gold-soft);
    font-size: 23px;
}

.choice h3 {
    margin: 1px 0 6px;
    font-size: 18px;
}

.choice p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.notice {
    margin: 18px 0;
    padding: 16px;
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    background: #fff8e8;
    color: #604d18;
    font-size: 14px;
    line-height: 1.55;
}

.notice strong {
    margin-bottom: 4px;
    display: block;
}

.checkline {
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkline input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--gold-dark);
}

.field {
    margin-bottom: 18px;
}

.field label {
    margin-bottom: 8px;
    display: block;
    font-weight: 750;
}

.field input,
.field textarea,
.field select,
.time-fields select {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #d6c9b1;
    border-radius: 14px;
    outline: none;
    background: #ffffff;
    color: var(--ink);
}

.field textarea {
    min-height: 125px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.time-fields select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(215, 166, 43, 0.13);
}

.hint {
    margin-top: 7px;
    display: block;
    color: var(--muted);
    font-size: 12px;
}
/* Voice input */

.voice-controls {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.voice-button,
.voice-stop-button {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.voice-button {
    border: 1px solid #bda86f;
    background: linear-gradient(
        180deg,
        #fffdf8,
        #f6ecd3
    );
    color: var(--ink);
}

.voice-button:hover,
.voice-button:focus {
    border-color: var(--gold);
    box-shadow:
        0 0 0 3px rgba(215, 166, 43, 0.12);
}

.voice-button:active {
    transform: scale(0.98);
}

.voice-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.voice-stop-button {
    border: 1px solid #d8aaaa;
    background: #fff1f1;
    color: var(--danger);
}

.voice-stop-button:hover,
.voice-stop-button:focus {
    border-color: var(--danger);
    box-shadow:
        0 0 0 3px rgba(184, 63, 63, 0.1);
}

.voice-status {
    min-width: 0;
    flex: 1 1 100%;
    min-height: 20px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.voice-status.listening {
    color: var(--gold-dark);
    font-weight: 800;
}

.voice-status.listening::before {
    content: "●";
    margin-right: 6px;
    animation: voice-pulse 0.9s ease-in-out infinite alternate;
}

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

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

@keyframes voice-pulse {
    from {
        opacity: 0.35;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

body.rtl .voice-controls,
body.rtl .voice-status {
    direction: rtl;
    text-align: right;
}

body.rtl .voice-status.listening::before {
    margin-right: 0;
    margin-left: 6px;
}

@media (max-width: 760px) {
    .voice-button,
    .voice-stop-button {
        width: 100%;
    }

    .voice-status {
        text-align: center;
    }

    body.rtl .voice-status {
        text-align: center;
    }
}
.code-wrap {
    max-width: 480px;
    margin: 0 auto;
}

.code-input {
    text-align: center;
    text-transform: uppercase;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.feedback {
    min-height: 24px;
    margin: 11px 0;
    font-size: 14px;
    text-align: center;
}

.feedback.error {
    color: var(--danger);
}

.feedback.success {
    color: var(--success);
}

.feedback.loading {
    color: var(--gold-dark);
}

.types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.type-card {
    min-height: 160px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    text-align: left;
    transition:
        border-color 0.18s ease,
        transform 0.18s ease;
}

.type-card:hover,
.type-card.selected {
    transform: translateY(-1px);
    border-color: var(--gold);
}

.type-card .dot {
    width: 13px;
    height: 13px;
    margin-bottom: 14px;
    display: block;
    border-radius: 50%;
}

.type-card h3 {
    margin: 0 0 7px;
    font-size: 17px;
}

.type-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.type-card[data-type="unsafe-condition"] .dot {
    background: #3c8a55;
}

.type-card[data-type="unsafe-act"] .dot {
    background: #e17a25;
}

.type-card[data-type="near-miss"] .dot {
    background: #e4b326;
}

.type-card[data-type="incident"] .dot,
.type-card[data-type="accident"] .dot {
    background: #be3f3f;
}

.type-card[data-type="dangerous-situation"] .dot {
    background: #7e1f2b;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.time-fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 9px;
}

.time-separator {
    color: var(--gold-dark);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.urgent {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #f0c9c9;
    border-radius: 14px;
    background: #fff1f1;
    color: #7a2929;
    font-size: 13px;
    line-height: 1.5;
}

.actions {
    margin-top: 24px;
    display: flex;
    gap: 11px;
}

.actions > * {
    flex: 1;
}

.photo-box {
    padding: 18px;
    border: 1.5px dashed #cbbd9e;
    border-radius: 18px;
    background: #fffdf8;
    text-align: center;
}

.visually-hidden-file {
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    position: absolute !important;
    overflow: hidden !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.custom-file-control {
    width: 100%;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #d6c9b1;
    border-radius: 14px;
    background: #ffffff;
    text-align: left;
}

.custom-file-button {
    flex: none;
    padding: 10px 14px;
    border: 1px solid #bda86f;
    border-radius: 10px;
    background: linear-gradient(180deg, #fffdf8, #f6ecd3);
    color: var(--ink);
    font-weight: 800;
}

.custom-file-button:hover,
.custom-file-button:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(215, 166, 43, 0.12);
}

.custom-file-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.photo-preview {
    width: 100%;
    max-height: 300px;
    margin-top: 14px;
    display: none;
    object-fit: contain;
    border-radius: 14px;
}

.photo-status {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.photo-status.checking {
    color: #8a6415;
}

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

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

.photo-previews {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.photo-preview-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e1d5bd;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(88, 58, 10, 0.08);
}

.photo-preview-item .photo-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: none;
    margin: 0;
    display: block;
    object-fit: cover;
    border-radius: 0;
}

.remove-photo {
    width: 100%;
    margin: 0;
    padding: 10px 8px;
    display: block;
    border: 0;
    border-top: 1px solid #f0dfdf;
    background: #fff7f7;
    color: var(--danger);
    font-weight: 800;
}

.remove-photo:hover,
.remove-photo:focus-visible {
    background: #fdeaea;
}

@media (max-width: 620px) {
    .photo-previews {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.success {
    text-align: center;
}

.success-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-soft);
    font-size: 38px;
}

.reference {
    margin: 20px 0;
    padding: 15px;
    border-radius: 14px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 24px;
    font-weight: 900;
}

.privacy-note {
    margin-top: 24px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.legal-footer {
    width: min(820px, calc(100% - 30px));
    margin: 0 auto;
    padding: 16px 0 20px;
    color: #77736b;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.legal-links {
    margin-bottom: 7px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
}

.legal-links a {
    color: #6f6b63;
    font-weight: 700;
    text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus {
    color: var(--gold-dark);
    text-decoration: underline;
}

.legal-copy {
    color: #8b877f;
    font-size: 11px;
}

.splash {
    inset: 0;
    z-index: 9999;
    position: fixed;
    display: grid;
    place-items: center;
    background:
        radial-gradient(
            circle at 50% 44%,
            #1d1b12 0,
            #080a0a 42%,
            #020303 100%
        );
    transition:
        opacity 0.32s ease,
        visibility 0.32s ease;
}

.splash.is-hidden {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.splash-inner {
    padding: 24px;
    color: #ffffff;
    text-align: center;
}

.splash-logo {
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: 25px;
    box-shadow:
        0 0 0 1px rgba(215, 166, 43, 0.45),
        0 0 45px rgba(215, 166, 43, 0.42);
    animation: splash-pulse 1.15s ease-in-out infinite alternate;
}

.splash-brand {
    margin-top: 18px;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.splash-brand span {
    color: var(--gold);
}

.splash-role {
    margin-top: 5px;
    color: #c9cdd2;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.splash-signature {
    margin-top: 7px;
    color: #f6f2e8;
    font-size: 13px;
    letter-spacing: 0.03em;
}

.splash-line {
    width: 58px;
    height: 2px;
    margin: 12px auto 14px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold),
        transparent
    );
}

.splash-text {
    color: #d8d2c5;
    font-size: 14px;
}

@keyframes splash-pulse {
    from {
        filter: brightness(0.92);
        transform: scale(0.985);
    }

    to {
        filter: brightness(1.12);
        transform: scale(1.02);
    }
}

body.rtl .choice,
body.rtl .type-card,
body.rtl .field label,
body.rtl .field input,
body.rtl .field textarea,
body.rtl .field select,
body.rtl .notice,
body.rtl .privacy-note,
body.rtl .hero h1,
body.rtl .hero p {
    direction: rtl;
    text-align: right;
}

body.rtl .language-trigger,
body.rtl .language-option {
    direction: rtl;
    text-align: right;
}

body.home-active {
    overflow: hidden;
}

body.home-active .app {
    height: 100svh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

body.home-active .topbar {
    position: relative;
    top: auto;
}

body.home-active .shell {
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

body.home-active .screen[data-screen="home"].active {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.home-active .screen[data-screen="home"] .hero {
    width: 100%;
    padding: 12px 8px;
}

body.home-active .legal-footer {
    min-height: 54px;
    padding: 7px 0 9px;
}

body:not(.home-active) {
    overflow: auto;
}

body:not(.home-active) .app {
    min-height: 100svh;
    height: auto;
    overflow: visible;
}

body:not(.home-active) .shell {
    min-height: calc(100svh - 82px);
    height: auto;
    padding: 28px 0 72px;
    overflow: visible;
}

@media (max-width: 760px) {
    .topbar {
        min-height: 70px;
        height: auto;
        padding: 10px 15px;
    }

    .brand img {
        width: 42px;
        height: 42px;
    }

    .brand strong {
        font-size: 20px;
    }

    .brand-role {
        font-size: 9px;
        letter-spacing: 0.12em;
    }

    .brand small {
        margin-top: 5px;
        display: block;
        font-size: 11px;
    }

    .mobile-language-wrap {
        display: flex;
    }

    .desktop-language-wrap {
        display: none !important;
    }

    .language-trigger.compact {
        width: auto;
        max-width: 132px;
        min-height: 38px;
        padding: 0 9px;
        border-color: rgba(215, 166, 43, 0.5);
        border-radius: 999px;
        background: #111515;
        color: #ffffff;
        box-shadow: none;
    }

    .language-trigger.compact .language-current-name {
        max-width: 68px;
        font-size: 13px;
    }

    .mobile-language-wrap .language-menu {
        position: fixed;
        top: 78px;
        right: 12px;
        left: 12px;
        max-height: min(68vh, 520px);
        padding: 10px;
        border-radius: 20px;
    }

    .shell {
        width: min(100% - 22px, 820px);
        padding-top: 20px;
    }

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

    .hero p {
        font-size: 16px;
    }

    .panel {
        border-radius: 20px;
    }

    .types,
    .two-col {
        grid-template-columns: 1fr;
    }

    .type-card {
        min-height: 135px;
    }

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

    .custom-file-control {
        align-items: stretch;
        flex-direction: column;
    }

    .custom-file-button {
        width: 100%;
    }

    .custom-file-name {
        text-align: center;
        white-space: normal;
    }

    .legal-footer {
        width: min(100% - 28px, 820px);
        padding: 12px 0 18px;
    }

    body.home-active .app {
        grid-template-rows: 70px 1fr auto;
    }

    body.home-active .topbar {
        min-height: 70px;
        height: 70px;
    }

    body.home-active .screen[data-screen="home"] .hero {
        padding: 20px 6px 12px;
    }

    body.home-active .hero-mark {
        width: 76px;
        height: 76px;
        margin-bottom: 14px;
    }

    body.home-active .hero h1 {
        margin-bottom: 12px;
        font-size: clamp(32px, 9vw, 42px);
    }

    body.home-active .hero p {
        font-size: 15px;
        line-height: 1.42;
    }

    body.home-active .home-cta {
        margin-top: 24px;
    }

    body.home-active .legal-footer {
        width: min(100% - 24px, 820px);
        min-height: 66px;
        padding: 7px 0 10px;
        font-size: 10px;
    }

    body.home-active .legal-links {
        gap: 4px 8px;
        line-height: 1.35;
    }

    body.home-active .legal-copy {
        font-size: 9px;
    }
}

@media (max-width: 430px) {
    .brand strong {
        font-size: 18px;
    }

    .brand small {
        margin-top: 4px;
        font-size: 9px;
    }

    .hero-mark {
        width: 78px;
        height: 78px;
    }

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

@media (max-height: 720px) and (max-width: 760px) {
    body.home-active .screen[data-screen="home"] .hero {
        padding-top: 10px;
    }

    body.home-active .hero-mark {
        width: 64px;
        height: 64px;
        margin-bottom: 10px;
    }

    body.home-active .hero h1 {
        font-size: 30px;
    }

    body.home-active .hero p {
        font-size: 14px;
    }

    body.home-active .home-cta {
        margin-top: 18px;
    }
}


/* SafeHub camera controls - final mobile layout override */
#cameraDialog #flashCameraButton {
    position: absolute !important;
    top: max(14px, env(safe-area-inset-top)) !important;
    left: 14px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(50vw - 24px) !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
}

#cameraDialog #flashCameraButton[hidden] {
    display: inline-flex !important;
}

#cameraDialog #closeCameraButton {
    position: absolute !important;
    top: max(14px, env(safe-area-inset-top)) !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(50vw - 24px) !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
}

#cameraDialog #capturePhotoButton {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: 70vw !important;
    margin: 0 !important;
    padding: 14px 26px !important;
    transform: translateX(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
}

@media (max-width: 700px) {
    #cameraDialog #flashCameraButton,
    #cameraDialog #closeCameraButton {
        font-size: 14px !important;
    }
}

/* SafeHub camera — keep dialog title for accessibility, hide it visually */
#cameraDialog #cameraTitle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
}

/* =========================================================
   Safety Score v4 — minimal 30-level dashboard
   ========================================================= */
body.score-active {
    background: #070909;
}

body.score-active .app {
    background:
        radial-gradient(circle at 74% 18%, rgba(215, 166, 43, 0.11), transparent 26%),
        linear-gradient(180deg, #0b0e0e 0%, #070909 64%, #090b0b 100%);
}

body.score-active .shell {
    width: min(820px, calc(100% - 28px));
    padding-top: 18px;
    padding-bottom: 26px;
}

body.score-active .legal-footer {
    border-top-color: rgba(215, 166, 43, 0.12);
    background: #070909;
    color: #9da09e;
}

body.score-active .legal-links a {
    color: #bbbdbb;
}

.score-screen.active {
    min-height: calc(100dvh - 150px);
}

.score-dashboard-v4 {
    min-height: calc(100dvh - 168px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-dashboard-nav {
    min-height: 42px;
    display: flex;
    align-items: center;
}

.score-back-button {
    width: 42px;
    height: 42px;
    padding: 0 0 4px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(224, 184, 80, 0.38);
    border-radius: 50%;
    background: rgba(15, 18, 18, 0.9);
    color: #f1d177;
    font-size: 32px;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.score-back-button:hover,
.score-back-button:focus-visible {
    border-color: rgba(240, 203, 105, 0.9);
    background: rgba(31, 28, 17, 0.96);
    outline: none;
}

.safety-score-card-v4 {
    padding: clamp(24px, 5vw, 38px);
    border-radius: 30px;
    border: 1px solid rgba(224, 184, 80, 0.64);
    background:
        radial-gradient(circle at 82% 18%, rgba(215, 166, 43, 0.18), transparent 27%),
        radial-gradient(circle at 18% 110%, rgba(26, 176, 86, 0.07), transparent 32%),
        linear-gradient(150deg, #111515 0%, #080a0a 68%, #100d06 100%);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.safety-score-card-v4::before {
    width: 280px;
    height: 280px;
    right: -155px;
    top: -155px;
    border-color: rgba(231, 190, 87, 0.13);
    box-shadow:
        0 0 0 42px rgba(231, 190, 87, 0.025),
        0 0 0 88px rgba(231, 190, 87, 0.012);
}

.score-main-row {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 215px);
    align-items: center;
    gap: clamp(10px, 3vw, 28px);
}

.score-main-copy {
    min-width: 0;
}

.score-main-copy h2 {
    margin: 0;
    color: #f7f7f4;
    font-size: clamp(22px, 5vw, 32px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.safety-score-card-v4 .score-number-row {
    margin-top: 26px;
}

.safety-score-card-v4 .score-points {
    font-size: clamp(76px, 17vw, 116px);
    background: linear-gradient(180deg, #f9e29b 0%, #e4b947 45%, #bd8214 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 7px 18px rgba(215, 166, 43, 0.12));
}

.safety-score-card-v4 .score-unit {
    color: #f2d16f;
    font-size: clamp(22px, 5vw, 34px);
}

.score-level-row-v4 {
    width: auto;
    margin-top: 22px;
    padding: 0;
    gap: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #bfc2bf;
    font-size: clamp(15px, 3.6vw, 20px);
}

.score-level-row-v4 strong {
    color: #67d87f;
    font-size: 1.05em;
}

.score-helmet-face {
    width: min(100%, 210px);
    aspect-ratio: 1;
    justify-self: end;
    position: relative;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.34));
}

.score-helmet-face svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.helmet-face-halo {
    fill: rgba(32, 181, 86, 0.08);
    stroke: rgba(233, 194, 95, 0.52);
    stroke-width: 2;
}

.helmet-face-bg {
    fill: url(#none);
    fill: #0d1712;
    stroke: rgba(61, 204, 105, 0.24);
    stroke-width: 2;
}

.helmet-face-ear,
.helmet-face-skin {
    fill: #e9bea0;
    stroke: #6f4d3c;
    stroke-width: 2;
}

.helmet-face-hair {
    fill: #171918;
}

.helmet-face-helmet {
    fill: #1bad58;
    stroke: #86df9f;
    stroke-width: 2.2;
}

.helmet-face-helmet-panel {
    fill: rgba(255, 255, 255, 0.08);
}

.helmet-face-brim {
    fill: #108746;
    stroke: #86df9f;
    stroke-width: 2;
}

.helmet-face-badge {
    fill: #113f28;
    stroke: #efc75c;
    stroke-width: 2.6;
}

.helmet-face-cross {
    fill: none;
    stroke: #ffffff;
    stroke-width: 4;
    stroke-linecap: round;
}

.helmet-face-brow,
.helmet-face-nose,
.helmet-face-smile {
    fill: none;
    stroke: #4b342c;
    stroke-linecap: round;
}

.helmet-face-brow {
    stroke-width: 4;
}

.helmet-face-nose {
    stroke-width: 2.2;
}

.helmet-face-smile {
    stroke-width: 3.6;
}

.helmet-face-eye {
    fill: #171918;
}

.helmet-face-eye-glint {
    fill: #ffffff;
}

.score-progress-v4 {
    height: 12px;
    margin-top: 20px;
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.12);
}

.score-progress-v4 .score-progress-fill {
    background: linear-gradient(90deg, #1ca64e 0%, #55d875 55%, #8ce29f 100%);
    box-shadow: 0 0 18px rgba(55, 203, 98, 0.28);
}

.score-progress-v4 .score-progress-fill::after {
    display: none;
}

.score-progress-meta-v4 {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.score-progress-meta-v4 .score-progress-text {
    margin: 0;
    color: #c5c8c5;
    font-size: 13px;
    font-weight: 800;
}

.score-level-rail {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    gap: 3px;
}

.score-level-segment {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.score-level-segment.is-complete {
    background: rgba(211, 168, 48, 0.78);
}

.score-level-segment.is-current {
    transform: scaleY(1.7);
    background: #49d66f;
    box-shadow: 0 0 8px rgba(73, 214, 111, 0.75);
}

.score-actions-v4 {
    margin-top: auto;
    padding-top: 24px;
    display: block;
}

.score-actions-v4 .score-new-report {
    width: 100%;
    min-height: 64px;
    border: 1px solid #f0d175;
    border-radius: 999px;
    background: linear-gradient(135deg, #f5d982 0%, #d9a934 52%, #bd8319 100%);
    color: #101313;
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 950;
    letter-spacing: -0.01em;
    box-shadow:
        0 16px 34px rgba(169, 113, 15, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.score-actions-v4 .score-new-report:hover,
.score-actions-v4 .score-new-report:focus-visible {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #f9e39a 0%, #e4b84d 52%, #cb9122 100%);
}

@media (max-width: 620px) {
    body.score-active .shell {
        width: min(100% - 24px, 820px);
        padding-top: 10px;
        padding-bottom: 18px;
    }

    .score-screen.active {
        min-height: calc(100dvh - 132px);
    }

    .score-dashboard-v4 {
        min-height: calc(100dvh - 146px);
        gap: 10px;
    }

    .score-dashboard-nav {
        min-height: 36px;
    }

    .score-back-button {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    .safety-score-card-v4 {
        padding: 22px 20px 24px;
        border-radius: 25px;
    }

    .score-main-row {
        min-height: 205px;
        grid-template-columns: minmax(0, 1fr) 132px;
        gap: 6px;
    }

    .score-main-copy h2 {
        font-size: clamp(20px, 5.8vw, 26px);
    }

    .safety-score-card-v4 .score-points {
        font-size: clamp(68px, 19vw, 90px);
    }

    .safety-score-card-v4 .score-unit {
        font-size: clamp(20px, 5vw, 27px);
    }

    .score-helmet-face {
        width: 138px;
        margin-right: -4px;
    }

    .score-level-row-v4 {
        margin-top: 18px;
        font-size: 14px;
    }

    .score-level-rail {
        margin-top: 18px;
        gap: 2px;
    }

    .score-level-segment {
        height: 4px;
    }

    .score-actions-v4 {
        padding-top: 18px;
    }

    .score-actions-v4 .score-new-report {
        min-height: 58px;
        font-size: 19px;
    }
}

@media (max-width: 390px) {
    .score-main-row {
        grid-template-columns: minmax(0, 1fr) 112px;
    }

    .score-helmet-face {
        width: 116px;
    }

    .score-main-copy h2 {
        font-size: 19px;
    }

    .safety-score-card-v4 .score-points {
        font-size: 65px;
    }
}


/* SafeHub Safety Score v5 — compact 30-level card */
.score-dashboard-v5 {
    min-height: calc(100dvh - 168px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.safety-score-card-v5 {
    padding: clamp(22px, 4.5vw, 34px);
    border-radius: 30px;
    border: 1px solid rgba(232, 193, 89, 0.66);
    background:
        radial-gradient(circle at 84% 17%, rgba(215, 166, 43, 0.17), transparent 26%),
        radial-gradient(circle at 82% 58%, rgba(37, 185, 87, 0.06), transparent 25%),
        linear-gradient(150deg, #101414 0%, #070909 70%, #0d0b06 100%);
    box-shadow: 0 24px 62px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.04);
    overflow: hidden;
}

.safety-score-card-v5::before {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    right: -135px;
    top: -130px;
    border: 1px solid rgba(232, 193, 89, 0.10);
    border-radius: 50%;
    box-shadow: 0 0 0 42px rgba(232,193,89,.025), 0 0 0 86px rgba(232,193,89,.012);
    pointer-events: none;
}

.score-main-row-v5 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(132px, 190px);
    align-items: center;
    gap: clamp(12px, 3vw, 26px);
    position: relative;
    z-index: 1;
}

.score-main-copy-v5 { min-width: 0; }
.score-main-copy-v5 h2 {
    margin: 0;
    color: #f5f5f2;
    font-size: clamp(22px, 5vw, 31px);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.score-number-row-v5 { margin-top: 22px; }
.safety-score-card-v5 .score-points {
    font-size: clamp(76px, 17vw, 112px);
    line-height: .9;
    background: linear-gradient(180deg,#fae49d 0%,#e4b848 46%,#b87d11 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 16px rgba(215,166,43,.12));
}
.safety-score-card-v5 .score-unit {
    color: #f0ce69;
    font-size: clamp(21px, 5vw, 32px);
}

.score-level-chip-v5 {
    display: inline-flex;
    margin-top: 22px;
    padding: 6px 11px;
    border: 1px solid rgba(82,207,113,.25);
    border-radius: 999px;
    background: rgba(28,111,57,.13);
    color: #8ce39e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
}

.score-level-title-v5 {
    display: block;
    margin-top: 8px;
    color: #f0d06d;
    font-size: clamp(17px, 4vw, 24px);
    line-height: 1.18;
    font-weight: 900;
}

.score-helmet-face-v5 {
    width: min(100%, 182px);
    justify-self: end;
}
.score-helmet-face-v5 .helmet-face-ring {
    fill: none;
    stroke: url(#safehubRing);
    stroke-width: 2.2;
}
.score-helmet-face-v5 .helmet-face-bg { fill: #0b1510; }
.score-helmet-face-v5 .helmet-face-helmet { fill: url(#safehubHelmet); }
.score-helmet-face-v5 .helmet-face-skin { fill: #e8b99a; }

.score-progress-block-v5 {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.score-progress-v5 {
    height: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.12);
}
.score-progress-v5 .score-progress-fill {
    background: linear-gradient(90deg,#28b65a 0%,#5cda78 100%);
    box-shadow: 0 0 18px rgba(62,202,99,.24);
}
.score-progress-meta-v5 {
    margin-top: 7px;
    display: flex;
    justify-content: flex-end;
}
.score-progress-meta-v5 .score-progress-text {
    margin: 0;
    color: #c8cbc8;
    font-size: 13px;
    font-weight: 850;
}
.score-next-level-v5 {
    margin-top: 13px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    color: #aeb2ae;
    font-size: 13px;
}
.score-next-level-v5 strong {
    color: #f0d06d;
    text-align: end;
    font-size: 14px;
}

.score-actions-v5 {
    margin-top: auto;
    padding-top: 20px;
}
.score-actions-v5 .score-new-report {
    width: 100%;
    min-height: 62px;
    border: 1px solid #f0d175;
    border-radius: 999px;
    background: linear-gradient(135deg,#f5d982 0%,#d9a934 52%,#bd8319 100%);
    color: #101313;
    font-size: clamp(18px,4.5vw,23px);
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(169,113,15,.24), inset 0 1px 0 rgba(255,255,255,.55);
}

@media (max-width: 620px) {
    .score-dashboard-v5 { min-height: calc(100dvh - 146px); gap: 10px; }
    .safety-score-card-v5 { padding: 22px 20px 24px; border-radius: 25px; }
    .score-main-row-v5 { grid-template-columns: minmax(0,1fr) 124px; gap: 6px; }
    .score-main-copy-v5 h2 { font-size: clamp(20px,5.7vw,25px); }
    .safety-score-card-v5 .score-points { font-size: clamp(68px,19vw,88px); }
    .safety-score-card-v5 .score-unit { font-size: clamp(20px,5vw,26px); }
    .score-helmet-face-v5 { width: 128px; margin-right: -2px; }
    .score-level-chip-v5 { margin-top: 18px; }
    .score-progress-block-v5 { margin-top: 20px; padding-top: 16px; }
    .score-next-level-v5 { align-items: flex-start; }
    .score-actions-v5 { padding-top: 18px; }
    .score-actions-v5 .score-new-report { min-height: 58px; font-size: 19px; }
}

@media (max-width: 390px) {
    .score-main-row-v5 { grid-template-columns: minmax(0,1fr) 108px; }
    .score-helmet-face-v5 { width: 112px; }
    .score-main-copy-v5 h2 { font-size: 19px; }
    .safety-score-card-v5 .score-points { font-size: 64px; }
    .score-level-title-v5 { font-size: 16px; }
}

/* SafeHub interaction protection: prevent copying/pasting app content. */
html,
body,
body * {
    -webkit-touch-callout: none;
}

body,
.app,
.screen,
.panel,
.score-dashboard,
.safety-score-card,
.choice,
.type-card,
button,
label,
p,
span,
h1,
h2,
h3,
strong,
small {
    -webkit-user-select: none;
    user-select: none;
}

/* Keep normal caret/editing behaviour while clipboard actions remain blocked by JS. */
input,
textarea,
select {
    -webkit-user-select: text;
    user-select: text;
}

/* =========================================================
   SafeHub Safety Score FINAL — approved face + light app background
   ========================================================= */
body.score-active {
    background: var(--background) !important;
}

body.score-active .app {
    background:
        radial-gradient(circle at 82% 14%, rgba(215, 166, 43, 0.08), transparent 24%),
        var(--background) !important;
}

body.score-active .legal-footer {
    border-top-color: var(--line) !important;
    background: var(--background) !important;
    color: var(--muted) !important;
}

body.score-active .legal-links a {
    color: var(--ink) !important;
}

.score-back-button {
    border-color: rgba(157, 111, 18, 0.34) !important;
    background: rgba(255, 253, 248, 0.95) !important;
    color: var(--gold-dark) !important;
    box-shadow: 0 8px 22px rgba(88, 58, 10, 0.10) !important;
}

.score-back-button:hover,
.score-back-button:focus-visible {
    background: #fffdf8 !important;
    border-color: var(--gold) !important;
}

.score-helmet-face-v5 {
    width: min(100%, 182px);
    aspect-ratio: 1;
    justify-self: end;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.28));
}

.score-helmet-face-v5 img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.score-level-chip-v5 {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8ce39e;
    letter-spacing: 0;
    font-size: clamp(14px, 3.2vw, 17px);
}

.score-level-title-v5 {
    margin-top: 5px;
}

.score-progress-block-v5 {
    margin-top: 20px;
}

.score-actions-v5 {
    padding-top: 18px;
}

@media (max-width: 620px) {
    body.score-active .shell {
        width: min(100% - 24px, 820px);
        padding-top: 10px;
        padding-bottom: 18px;
    }

    .score-main-row-v5 {
        grid-template-columns: minmax(0, 1fr) 132px;
        gap: 8px;
    }

    .score-helmet-face-v5 {
        width: 132px;
        margin-right: 0;
    }

    .score-main-copy-v5 h2 {
        font-size: clamp(20px, 5.4vw, 24px);
        max-width: 11em;
    }
}

@media (max-width: 390px) {
    .score-main-row-v5 {
        grid-template-columns: minmax(0, 1fr) 112px;
    }

    .score-helmet-face-v5 {
        width: 112px;
    }

    .score-main-copy-v5 h2 {
        font-size: 18px;
    }
}

/* =========================================================
   SafeHub UI consistency v16 — report flow + compact score/history
   ========================================================= */

body.report-flow-active .app {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

body.report-flow-active .shell {
    width: min(920px, calc(100% - 32px));
    min-height: 0;
    height: auto;
    padding: 26px 0 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
}

body.report-flow-active[data-active-screen="form"] .shell,
body.report-flow-active[data-active-screen="success"] .shell {
    justify-content: flex-start;
}

body.report-flow-active .screen.active {
    width: 100%;
}

body.report-flow-active .legal-footer {
    width: min(920px, calc(100% - 32px));
    padding-top: 10px;
}

.report-step-panel {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3.8vw, 34px);
    border-radius: 26px;
    box-shadow: 0 18px 44px rgba(88, 58, 10, 0.12);
}

.report-step-panel::before,
.report-step-panel::after {
    content: "";
    height: 4px;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0 999px 999px 0;
}

.report-step-panel::before {
    width: 100%;
    background: #efe6d2;
}

.report-step-panel::after {
    background: linear-gradient(90deg, #b77c13 0%, #e0b23f 100%);
    box-shadow: 0 0 14px rgba(215, 166, 43, 0.24);
}

.report-step-1::after { width: 25%; }
.report-step-2::after { width: 50%; }
.report-step-3::after { width: 75%; }
.report-step-4::after { width: 100%; }

.report-step-panel .stephead {
    margin-bottom: 22px;
    align-items: flex-start;
}

.report-step-panel .stephead > div {
    min-width: 0;
}

.report-step-panel .stephead small {
    display: block;
    margin-bottom: 3px;
    color: #77766f;
    font-size: 13px;
}

.report-step-panel .stephead h2 {
    margin: 0;
    font-size: clamp(24px, 3.2vw, 30px);
    line-height: 1.16;
    letter-spacing: -0.025em;
}

.report-step-panel .back {
    width: 44px;
    height: 44px;
    flex: none;
    border-color: #ddcfb3;
    border-radius: 14px;
    color: #8c6312;
    box-shadow: 0 5px 14px rgba(88, 58, 10, 0.06);
}

.report-step-panel .back:hover,
.report-step-panel .back:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(215, 166, 43, 0.10);
}

/* Step 1 — more compact and balanced on desktop. */
.report-step-1 .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.report-step-1 .choice {
    min-height: 114px;
    padding: 18px;
    align-items: center;
}

.report-step-1 .choice.selected {
    background: linear-gradient(145deg, #fffdf8, #fff8e7);
    box-shadow: 0 0 0 2px rgba(215, 166, 43, 0.10), 0 10px 24px rgba(157, 111, 18, 0.09);
}

.report-step-1 .notice {
    margin: 16px 0 12px;
    padding: 14px 15px;
}

.report-step-1 .checkline {
    margin: 12px 0 0;
}

.report-step-1 .actions {
    margin-top: 18px;
}

/* Step 2 — same panel width as the rest, compact centered content. */
.code-wrap.report-step-panel {
    max-width: 880px;
}

.code-wrap.report-step-panel .field,
.code-wrap.report-step-panel #codeFeedback,
.code-wrap.report-step-panel #verifyCode,
.code-wrap.report-step-panel .privacy-note {
    width: min(560px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.code-wrap.report-step-panel .field {
    margin-bottom: 12px;
}

.code-wrap.report-step-panel .code-input {
    min-height: 60px;
    font-size: clamp(21px, 3vw, 26px);
    letter-spacing: 0.10em;
}

.code-wrap.report-step-panel #verifyCode {
    margin-top: 4px;
}

.code-wrap.report-step-panel .privacy-note {
    margin-top: 16px;
    margin-bottom: 0;
}

/* Step 3 — tighter cards with stronger selected state. */
.report-step-3 .types {
    gap: 14px;
}

.report-step-3 .type-card {
    min-height: 132px;
    padding: 18px 18px 17px;
    position: relative;
    box-shadow: 0 5px 16px rgba(88, 58, 10, 0.035);
}

.report-step-3 .type-card.selected {
    background: linear-gradient(145deg, #fffdf8, #fff8e9);
    box-shadow: 0 0 0 2px rgba(215, 166, 43, 0.10), 0 10px 24px rgba(157, 111, 18, 0.09);
}

.report-step-3 .type-card.selected::after {
    content: "✓";
    width: 26px;
    height: 26px;
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111515;
    color: #f0cf70;
    font-size: 13px;
    font-weight: 950;
}

.report-step-3 .type-card .dot {
    margin-bottom: 12px;
}

/* Step 4 — compact accordion sections, no loss of form functionality. */
.report-form-panel {
    max-width: 900px;
}

.urgent-compact {
    margin-bottom: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 3px;
}

.report-sections {
    display: grid;
    gap: 12px;
}

.report-section {
    overflow: hidden;
    border: 1px solid #dfd5c1;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 5px 16px rgba(88, 58, 10, 0.04);
}

.report-section[open] {
    border-color: rgba(215, 166, 43, 0.76);
    background: #fffdf8;
    box-shadow: 0 8px 24px rgba(157, 111, 18, 0.08);
}

.report-section > summary {
    min-height: 70px;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.report-section > summary::-webkit-details-marker {
    display: none;
}

.report-section-index {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--gold-soft);
    color: var(--gold-dark);
    font-size: 14px;
    font-weight: 950;
}

.report-section > summary strong,
.report-section > summary small {
    display: block;
}

.report-section > summary strong {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.25;
}

.report-section > summary small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.report-section-chevron {
    width: 10px;
    height: 10px;
    justify-self: end;
    border-right: 2px solid #9d7a2e;
    border-bottom: 2px solid #9d7a2e;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.18s ease;
}

.report-section[open] .report-section-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.report-section-body {
    padding: 0 16px 16px;
    border-top: 1px solid #eee4d1;
}

.report-section-body > :first-child {
    margin-top: 16px;
}

.report-section-body .field:last-child {
    margin-bottom: 0;
}

.report-form-panel .field {
    margin-bottom: 14px;
}

.report-form-panel .field textarea {
    min-height: 96px;
}

.report-form-panel .compact-field select {
    max-width: 420px;
}

.report-form-panel .voice-controls {
    margin-top: 8px;
}

.report-form-panel .voice-button,
.report-form-panel .voice-stop-button {
    min-height: 40px;
    padding: 9px 12px;
}

.report-photo-field > label {
    display: none;
}

.report-form-panel .photo-box {
    padding: 15px;
}

.report-submit-actions {
    margin-top: 16px;
}

/* Score v6 — smaller score card + useful report history. */
body.score-active .shell {
    width: min(900px, calc(100% - 32px));
    padding-top: 18px;
    padding-bottom: 28px;
}

.score-dashboard-v6 {
    width: min(820px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.score-dashboard-v6 .score-dashboard-nav {
    min-height: 40px;
}

.safety-score-card-v6 {
    padding: clamp(22px, 3.5vw, 28px);
    border-radius: 26px;
}

.score-main-row-v6 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.score-main-copy-v6 {
    min-width: 0;
}

.score-main-copy-v6 h2 {
    margin: 0;
    color: #f5f5f2;
    font-size: clamp(21px, 3vw, 27px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.score-number-row-v6 {
    margin-top: 15px;
}

.safety-score-card-v6 .score-points {
    font-size: clamp(64px, 10vw, 82px);
    line-height: 0.88;
}

.safety-score-card-v6 .score-unit {
    color: #f0ce69;
    font-size: clamp(20px, 3.2vw, 27px);
}

.score-level-chip-v6 {
    margin-top: 15px;
    display: inline-block;
    color: #83df99;
    font-size: 13px;
    font-weight: 900;
}

.score-level-title-v6 {
    margin-top: 5px;
    display: block;
    color: #f0d06d;
    font-size: clamp(17px, 2.8vw, 21px);
}

.score-helmet-face-v6 {
    width: 148px;
    aspect-ratio: 1;
    justify-self: end;
    overflow: hidden;
    border-radius: 50%;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

.score-helmet-face-v6 img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.score-progress-block-v6 {
    margin-top: 17px;
    padding-top: 15px;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.score-progress-v6 {
    height: 10px;
    margin-top: 0;
}

.score-progress-v6 .score-progress-fill {
    background: linear-gradient(90deg, #28b65a 0%, #5cda78 100%);
}

.score-progress-meta-v6 {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}

.score-progress-meta-v6 .score-progress-text {
    margin: 0;
    font-size: 12px;
}

.score-next-level-v6 {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #aeb2ae;
    font-size: 12px;
}

.score-next-level-v6 strong {
    color: #f0d06d;
    text-align: end;
}

.score-history-card {
    padding: 18px;
    border: 1px solid #ded6c5;
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 12px 30px rgba(82, 57, 16, 0.08);
}

.score-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.score-summary-stat {
    min-width: 0;
    padding: 11px 10px;
    display: grid;
    gap: 3px;
    border: 1px solid #e5dccb;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

.score-summary-stat strong {
    color: #1a1d1d;
    font-size: 22px;
    line-height: 1;
}

.score-summary-stat span {
    overflow-wrap: anywhere;
    color: #6f706c;
    font-size: 11px;
    font-weight: 800;
}

.score-summary-stat.is-approved strong { color: #2f8150; }
.score-summary-stat.is-pending strong { color: #a77717; }
.score-summary-stat.is-rejected strong { color: #b14646; }

.score-history-head {
    margin-top: 16px;
    padding-top: 15px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #ece4d5;
}

.score-history-head small {
    display: block;
    margin-bottom: 2px;
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.score-history-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    letter-spacing: -0.015em;
}

.score-activity-item-v6 {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 12px 0;
}

.score-activity-item-v6 .score-activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 15px;
}

.score-status-pill {
    width: fit-content;
    margin-top: 2px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.score-status-pill.is-approved {
    background: #e9f6ed;
    color: #317248;
}

.score-status-pill.is-pending {
    background: #fff4d9;
    color: #8c6618;
}

.score-status-pill.is-rejected {
    background: #fdeaea;
    color: #9f3b3b;
}

.score-actions-v6 {
    margin-top: 0;
    padding-top: 0;
}

.score-actions-v6 .score-new-report,
.score-actions-v6 .score-new-report:hover,
.score-actions-v6 .score-new-report:focus-visible {
    min-height: 58px;
    border: 1px solid #1e2222;
    border-radius: 16px;
    background: linear-gradient(180deg, #111515, #080a0a);
    color: #ffffff;
    font-size: 17px;
    box-shadow: 0 13px 30px rgba(0, 0, 0, 0.16), 0 8px 22px rgba(215, 166, 43, 0.13);
}

body.rtl .report-step-panel .stephead,
body.rtl .report-section > summary,
body.rtl .score-history-card {
    direction: rtl;
}

body.rtl .report-step-3 .type-card.selected::after {
    right: auto;
    left: 14px;
}

body.rtl .score-next-level-v6 strong,
body.rtl .score-activity-date {
    text-align: left;
}

@media (max-width: 760px) {
    body.report-flow-active .app {
        display: flex;
        min-height: 100svh;
    }

    body.report-flow-active .shell {
        width: min(100% - 22px, 920px);
        padding: 16px 0 24px;
        display: block;
    }

    body.report-flow-active .legal-footer {
        width: min(100% - 26px, 920px);
    }

    .report-step-panel {
        padding: 20px 17px;
        border-radius: 21px;
    }

    .report-step-panel .stephead {
        margin-bottom: 18px;
    }

    .report-step-panel .stephead h2 {
        font-size: clamp(22px, 6vw, 27px);
    }

    .report-step-1 .choice-grid,
    .report-step-3 .types {
        grid-template-columns: 1fr;
    }

    .report-step-1 .choice {
        min-height: 96px;
    }

    .report-step-3 .type-card {
        min-height: 112px;
    }

    .report-section > summary {
        min-height: 64px;
        grid-template-columns: 34px minmax(0, 1fr) 16px;
        padding: 11px 12px;
    }

    .report-section-body {
        padding: 0 12px 13px;
    }

    .score-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .score-main-row-v6 {
        grid-template-columns: minmax(0, 1fr) 118px;
        gap: 8px;
    }

    .score-helmet-face-v6 {
        width: 118px;
    }

    .safety-score-card-v6 .score-points {
        font-size: clamp(58px, 17vw, 76px);
    }

    .score-history-card {
        padding: 15px;
        border-radius: 19px;
    }

    .score-activity-item-v6 {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .score-activity-item-v6 .score-activity-date {
        grid-column: 2;
        text-align: left;
    }
}

@media (max-width: 390px) {
    .score-main-row-v6 {
        grid-template-columns: minmax(0, 1fr) 102px;
    }

    .score-helmet-face-v6 {
        width: 102px;
    }

    .score-summary-stat {
        padding: 10px 7px;
    }

    .score-summary-stat strong {
        font-size: 20px;
    }
}
.score-activity-icon.is-approved {
    border-color: #cde7d5;
    background: #edf8f0;
    color: #2f8150;
}

.score-activity-icon.is-pending {
    border-color: #ead8a5;
    background: #fff7df;
    color: #9a711a;
}

.score-activity-icon.is-rejected {
    border-color: #efcaca;
    background: #fff0f0;
    color: #aa4040;
}


/* =========================================================
   SafeHub UI v17 — legal footer consistency
   Keep policy links visually identical on every app screen.
   ========================================================= */
.legal-footer,
body.home-active .legal-footer,
body.score-active .legal-footer,
body.report-flow-active .legal-footer {
    color: #77736b !important;
}

.legal-links a,
body.home-active .legal-links a,
body.score-active .legal-links a,
body.report-flow-active .legal-links a {
    color: #6f6b63 !important;
    font-weight: 600 !important;
    text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible,
body.home-active .legal-links a:hover,
body.score-active .legal-links a:hover,
body.report-flow-active .legal-links a:hover {
    color: var(--gold-dark) !important;
    text-decoration: underline;
}

/* =========================================================
   SafeHub UI v18 — mobile-only consistency fixes
   1) Home legal links match every other screen on phones.
   2) Success reference never overflows its card on phones.
   Desktop styling is intentionally unchanged.
   ========================================================= */
@media (max-width: 760px) {
    /* Home footer: use the same typography and rhythm as the rest of the app. */
    body.home-active .legal-footer {
        width: min(100% - 28px, 820px);
        min-height: 0;
        padding: 12px 0 18px;
        color: #77736b !important;
        font-size: 12px;
        line-height: 1.55;
    }

    body.home-active .legal-links {
        margin-bottom: 7px;
        gap: 8px 14px;
        line-height: 1.55;
    }

    body.home-active .legal-links a {
        color: #6f6b63 !important;
        font-size: inherit;
        font-weight: 600 !important;
        line-height: inherit;
    }

    body.home-active .legal-copy {
        color: #8b877f;
        font-size: 11px;
        line-height: 1.55;
    }

    /* Successful-report reference: preserve the complete code inside the box. */
    body.report-flow-active[data-active-screen="success"] .reference,
    .screen[data-screen="success"] .reference {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 16px 0;
        padding: 13px 10px;
        overflow: hidden;
        color: var(--gold-dark);
        font-size: clamp(14px, 4.2vw, 18px);
        line-height: 1.28;
        letter-spacing: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 390px) {
    body.report-flow-active[data-active-screen="success"] .reference,
    .screen[data-screen="success"] .reference {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 14px;
        word-break: break-all;
    }
}


/* =========================================================
   SafeHub UI v19 — definitive mobile footer + success code fix
   Only mobile presentation is changed.
   ========================================================= */
@media (max-width: 760px) {
    /* One identical legal-footer treatment on every SafeHub screen. */
    .legal-footer,
    body.home-active .legal-footer,
    body.score-active .legal-footer,
    body.report-flow-active .legal-footer {
        width: min(100% - 28px, 820px) !important;
        min-height: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 12px 0 18px !important;
        color: #77736b !important;
        font-size: 12px !important;
        line-height: 1.55 !important;
        text-align: center !important;
    }

    .legal-links,
    body.home-active .legal-links,
    body.score-active .legal-links,
    body.report-flow-active .legal-links {
        margin-bottom: 7px !important;
        gap: 8px 14px !important;
        line-height: 1.55 !important;
    }

    .legal-links a,
    body.home-active .legal-links a,
    body.score-active .legal-links a,
    body.report-flow-active .legal-links a {
        color: #6f6b63 !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.55 !important;
        text-decoration: none !important;
    }

    .legal-copy,
    body.home-active .legal-copy,
    body.score-active .legal-copy,
    body.report-flow-active .legal-copy {
        color: #8b877f !important;
        font-size: 11px !important;
        line-height: 1.55 !important;
    }

    /* The complete report reference stays inside its card, even on 320px phones. */
    .reference,
    body.report-flow-active[data-active-screen="success"] .reference,
    .screen[data-screen="success"] .reference {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin: 16px 0 !important;
        padding: 13px 10px !important;
        overflow: hidden !important;
        color: var(--gold-dark) !important;
        font-size: clamp(12px, 3.7vw, 17px) !important;
        line-height: 1.32 !important;
        letter-spacing: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-all !important;
        text-align: center !important;
    }
}

/* =========================================================
   SafeWorker v20 — final worker navigation and reporting flow
   Language -> code -> Home; per-report anonymous/named choice.
   ========================================================= */
:root {
    --sw-navy: #0d2540;
    --sw-green: #11985d;
    --sw-green-dark: #087548;
    --sw-green-soft: #eaf8f1;
    --sw-blue-soft: #e9f4ff;
    --sw-orange: #ffb21b;
    --sw-red: #ed3c3c;
    --sw-ui-line: #e5e9ee;
    --sw-ui-muted: #65748a;
}

[hidden] { display: none !important; }

body:not(.authenticated-app) .topbar {
    display: none !important;
}

body.authenticated-app {
    background: #f4f7f9;
    color: var(--sw-navy);
}

body.authenticated-app .app {
    min-height: 100svh;
    background: #f4f7f9;
}

body.authenticated-app .topbar {
    width: 100%;
    min-height: 76px;
    padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--sw-ui-line);
    background: rgba(255,255,255,.96);
    box-shadow: 0 4px 18px rgba(13,37,64,.05);
}

body.authenticated-app .topbar .brand {
    width: min(820px, 100%);
    margin: 0 auto;
}

body.authenticated-app .topbar .brand img {
    width: 47px;
    height: 47px;
    border-radius: 12px;
    object-fit: contain;
}

body.authenticated-app .topbar .brand-copy strong {
    color: var(--sw-navy);
    font-size: 21px;
    letter-spacing: -.02em;
}

body.authenticated-app .topbar .brand-copy small {
    color: var(--sw-ui-muted);
    font-size: 11px;
}

body.authenticated-app .shell {
    width: min(820px, calc(100% - 28px));
    padding: 24px 0 calc(106px + env(safe-area-inset-bottom));
}

body.authenticated-app .legal-footer {
    display: none !important;
}

/* First-run / signed-out screens */
.onboarding-screen.active {
    min-height: calc(100svh - 40px);
    display: grid;
    place-items: center;
    padding: 20px 0;
}

.onboarding-card {
    width: min(520px, 100%);
    margin: 0 auto;
    border-color: #e7dfcf;
}

.onboarding-brand {
    margin-bottom: 28px;
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.onboarding-brand img {
    width: 74px;
    height: 74px;
    margin-bottom: 5px;
    object-fit: contain;
}

.onboarding-brand strong {
    color: var(--sw-navy);
    font-size: 28px;
    letter-spacing: -.03em;
}

.onboarding-brand span {
    color: var(--muted);
    font-size: 13px;
}

.onboarding-card h1,
.onboarding-card h2 {
    color: var(--sw-navy);
}

.onboarding-language-picker {
    width: 100%;
    margin: 24px 0 18px;
}

.onboarding-language-trigger {
    width: 100%;
    min-height: 58px;
    justify-content: flex-start;
    background: #fff;
}

.onboarding-language-trigger .language-chevron {
    margin-left: auto;
}

body.rtl .onboarding-language-trigger .language-chevron {
    margin-right: auto;
    margin-left: 0;
}

.onboarding-language-picker .language-menu {
    width: 100%;
    max-height: min(48vh, 430px);
    overflow-y: auto;
}

.onboarding-card .primary,
.home-new-report,
#finalSubmitReportButton {
    border-color: var(--sw-green-dark) !important;
    background: linear-gradient(180deg, #16a768, var(--sw-green-dark)) !important;
    box-shadow: 0 12px 28px rgba(17,152,93,.22) !important;
}

/* Minimal Home */
body.authenticated-app .screen[data-screen="home"]::before,
body.authenticated-app .screen[data-screen="home"]::after {
    display: none;
}

.safeworker-home {
    min-height: min(62svh, 560px);
    padding: clamp(34px, 9vw, 82px) 8px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.safeworker-home h1 {
    max-width: 600px;
    color: var(--sw-navy);
    font-size: clamp(34px, 8vw, 56px);
}

.home-new-report {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 20px;
    font-size: clamp(19px, 5vw, 24px);
}

.home-new-report > span:first-child {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--sw-green-dark);
    font-size: 28px;
}

/* Top-level cards */
.top-level-panel,
.profile-dashboard {
    width: 100%;
    border: 1px solid var(--sw-ui-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(13,37,64,.08);
}

.top-level-panel h2,
.profile-dashboard > h2 {
    color: var(--sw-navy);
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -.035em;
}

.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-title-row h2 { margin: 0 0 5px; }
.section-title-row p,
.top-level-panel > p { color: var(--sw-ui-muted); }

.icon-refresh {
    width: 44px;
    height: 44px;
    flex: none;
    border: 1px solid var(--sw-ui-line);
    border-radius: 13px;
    background: #fff;
    color: var(--sw-navy);
    font-size: 22px;
}

/* My Reports */
.reports-list {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.report-history-card {
    padding: 15px;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--sw-ui-line);
    border-radius: 18px;
    background: #fff;
}

.report-history-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--sw-blue-soft);
    color: #1775b9;
    font-weight: 900;
}

.report-history-card[data-report-type="unsafe-condition"] .report-history-icon { background:#fff4d7; color:#b87800; }
.report-history-card[data-report-type="unsafe-act"] .report-history-icon { background:#eaf8f1; color:#0d8752; }
.report-history-card[data-report-type="accident"] .report-history-icon { background:#ffebeb; color:#c82e2e; }

.report-history-copy { min-width: 0; }
.report-history-copy strong { display:block; color:var(--sw-navy); font-size:16px; }
.report-history-copy small { display:block; margin-top:4px; color:var(--sw-ui-muted); overflow-wrap:anywhere; }

.report-status-pill {
    padding: 6px 9px;
    border-radius: 999px;
    background:#eef2f6;
    color:#4f6074;
    font-size:11px;
    font-weight:850;
    white-space:nowrap;
}
.report-status-pill.is-pending,
.report-status-pill.is-in-review { background:#fff2cf; color:#8b6100; }
.report-status-pill.is-resolved { background:#ddf6e9; color:#087548; }
.report-status-pill.is-rejected { background:#ffe3e3; color:#b32828; }
.report-status-pill.is-queued { background:#e9f4ff; color:#176a9e; }

.reports-empty {
    padding: 34px 16px;
    border: 1px dashed #cad3dd;
    border-radius: 18px;
    color: var(--sw-ui-muted);
    text-align: center;
}

/* Policies + instructions */
.instructions-card {
    margin: 22px 0 16px;
    padding: 18px;
    border: 1px solid #cfeadf;
    border-radius: 20px;
    background: var(--sw-green-soft);
}
.instructions-card h3 { margin:0 0 12px; color:var(--sw-navy); }
.instructions-card details {
    border-top: 1px solid rgba(13,117,72,.14);
    padding: 12px 0;
}
.instructions-card details:first-of-type { border-top:0; }
.instructions-card summary { cursor:pointer; color:var(--sw-navy); font-weight:800; }
.instructions-card p { margin:9px 0 0; color:#526379; line-height:1.55; }

.policies-list { display:grid; gap:10px; }
.policies-list a {
    min-height: 64px;
    padding: 12px 14px;
    display:grid;
    grid-template-columns: 36px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    border:1px solid var(--sw-ui-line);
    border-radius:16px;
    background:#fff;
    color:var(--sw-navy);
    text-decoration:none;
}
.policies-list a > span:first-child { font-size:22px; text-align:center; }
.policies-list a > span:last-child { color:#8a98a8; font-size:25px; }

/* Profile / PPE */
.profile-dashboard { padding: clamp(20px,5vw,34px); }
.profile-dashboard > h2 { margin:0 0 18px; }
.profile-dashboard .safety-score-card { margin-bottom:16px; }
.ppe-card {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--sw-ui-line);
    border-radius: 20px;
    background: #fff;
}
.ppe-card h3 { margin:0 0 12px; color:var(--sw-navy); font-size:22px; }
.ppe-list { display:grid; gap:8px; }
.ppe-item {
    min-height:52px;
    padding:9px 11px;
    display:grid;
    grid-template-columns:38px minmax(0,1fr);
    align-items:center;
    gap:9px;
    border:1px solid #edf0f3;
    border-radius:13px;
}
.ppe-item span { font-size:23px; text-align:center; }
.ppe-item strong { color:var(--sw-navy); font-size:14px; }
.logout-button {
    width:100%;
    min-height:54px;
    margin-top:18px;
    border:1px solid #f1b9b9;
    border-radius:16px;
    background:#fff6f6;
    color:#c92e2e;
    font-weight:900;
}

/* Report category page: four large visual choices, not a dropdown. */
body.report-flow-active .topbar { display:none !important; }
body.report-flow-active .bottom-app-nav { display:none !important; }
body.report-flow-active .shell { padding-bottom:26px !important; }
body.report-flow-active .legal-footer { display:none !important; }

.screen[data-screen="type"] .panel,
.screen[data-screen="form"] .panel,
.screen[data-screen="mode"] .panel,
.screen[data-screen="success"] .panel {
    border-color: var(--sw-ui-line);
    background:#fff;
    box-shadow:0 14px 38px rgba(13,37,64,.08);
}

.screen[data-screen="type"] .types {
    grid-template-columns: 1fr;
    gap: 12px;
}

.screen[data-screen="type"] .type-card {
    min-height: 96px;
    padding: 15px;
    display:grid;
    grid-template-columns: 54px minmax(0,1fr);
    align-items:center;
    gap:14px;
    border:1px solid var(--sw-ui-line);
    border-radius:18px;
    background:#fff;
    text-align:left;
}

.screen[data-screen="type"] .type-card:hover,
.screen[data-screen="type"] .type-card.selected {
    border-color:var(--sw-green);
    box-shadow:0 8px 22px rgba(17,152,93,.12);
}

.type-symbol {
    width:54px;
    height:54px;
    display:grid;
    place-items:center;
    border-radius:15px;
    font-size:27px;
    font-weight:950;
}
.near-miss-symbol { background:#e9f4ff; color:#1775b9; }
.unsafe-condition-symbol { background:#fff4d7; color:#b87800; }
.unsafe-act-symbol { background:#eaf8f1; color:#0d8752; }
.accident-symbol { background:#ffebeb; color:#c82e2e; }

.screen[data-screen="type"] .type-card h3 { margin:0 0 5px; color:var(--sw-navy); }
.screen[data-screen="type"] .type-card p { margin:0; color:var(--sw-ui-muted); }

/* Persistent 4-tab app navigation */
.bottom-app-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    min-height: calc(70px + env(safe-area-inset-bottom));
    padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    border-top:1px solid var(--sw-ui-line);
    background:rgba(255,255,255,.98);
    box-shadow:0 -10px 30px rgba(13,37,64,.07);
}

.bottom-app-nav button {
    min-width:0;
    min-height:56px;
    padding:5px 2px;
    display:grid;
    justify-items:center;
    align-content:center;
    gap:3px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#66768b;
    font:inherit;
}

.bottom-app-nav button.active { color:var(--sw-green-dark); }
.bottom-app-nav .nav-icon { font-size:22px; line-height:1; }
.bottom-app-nav .nav-label { max-width:100%; overflow:hidden; font-size:11px; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }

@media (max-width: 520px) {
    body.authenticated-app .shell { width:min(100% - 22px,820px); padding-top:16px; }
    body.authenticated-app .topbar { min-height:68px; padding-top:max(9px,env(safe-area-inset-top)); padding-bottom:9px; }
    body.authenticated-app .topbar .brand img { width:42px; height:42px; }
    body.authenticated-app .topbar .brand-copy strong { font-size:19px; }
    .top-level-panel,
    .profile-dashboard { padding:18px 15px; border-radius:20px; }
    .report-history-card { grid-template-columns:44px minmax(0,1fr); }
    .report-history-icon { width:44px; height:44px; }
    .report-status-pill { grid-column:2; justify-self:start; }
    .bottom-app-nav .nav-label { font-size:10px; }
}

/* =========================================================
   SafeWorker v21 — unified worker visual + report type icons
   ========================================================= */

:root {
    --sw-worker-visual: url('/assets/images/safeworker-worker-bg.webp');
}

/* Keep the same worker/industrial visual language across the app.
   The image stays decorative and is strongly washed out behind text. */
body.authenticated-app .safeworker-home {
    min-height: min(64svh, 590px);
    padding: clamp(38px, 9vw, 86px) clamp(18px, 5vw, 42px) 28px;
    border: 1px solid rgba(205, 216, 228, .72);
    border-radius: 28px;
    background-image:
        linear-gradient(90deg,
            rgba(255,255,255,.99) 0%,
            rgba(255,255,255,.96) 38%,
            rgba(255,255,255,.72) 58%,
            rgba(255,255,255,.18) 100%),
        var(--sw-worker-visual);
    background-repeat: no-repeat, no-repeat;
    background-position: center, right center;
    background-size: 100% 100%, auto 100%;
    box-shadow: 0 16px 42px rgba(13,37,64,.08);
    overflow: hidden;
}

body.authenticated-app .safeworker-home h1 {
    max-width: min(58%, 460px);
    text-wrap: balance;
    text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

body.authenticated-app .safeworker-home .home-cta {
    width: min(100%, 620px);
    margin-top: auto;
}

/* The same character is visible softly on My Reports, Policies and Profile. */
body.authenticated-app .top-level-panel,
body.authenticated-app .profile-dashboard,
body.report-flow-active .screen[data-screen="type"] .panel,
body.report-flow-active .screen[data-screen="form"] .panel,
body.report-flow-active .screen[data-screen="mode"] .panel,
body.report-flow-active .screen[data-screen="success"] .panel {
    background-color: #fff;
    background-image:
        linear-gradient(90deg,
            rgba(255,255,255,.995) 0%,
            rgba(255,255,255,.985) 57%,
            rgba(255,255,255,.82) 77%,
            rgba(255,255,255,.50) 100%),
        var(--sw-worker-visual);
    background-repeat: no-repeat, no-repeat;
    background-position: center top, right top;
    background-size: 100% 100%, auto 285px;
}

/* Report-type icons: binoculars / warning / worker / medical cross. */
.type-symbol,
.report-history-icon {
    overflow: hidden;
}

.type-symbol svg,
.report-history-icon svg {
    width: 34px;
    height: 34px;
    display: block;
}

.report-history-icon svg {
    width: 30px;
    height: 30px;
}

.near-miss-symbol,
.report-history-card[data-report-type="near-miss"] .report-history-icon {
    background: #dff1ff;
    color: #1369a9;
}

.unsafe-condition-symbol,
.report-history-card[data-report-type="unsafe-condition"] .report-history-icon {
    background: #ffb718;
    color: #fff;
}

.unsafe-act-symbol,
.report-history-card[data-report-type="unsafe-act"] .report-history-icon {
    background: #23a86b;
    color: #fff;
}

.accident-symbol,
.report-history-card[data-report-type="accident"] .report-history-icon {
    background: #ef3434;
    color: #fff;
}

/* The accident SVG draws its own red tile, so keep the surrounding tile clean. */
.accident-symbol svg,
.report-history-card[data-report-type="accident"] .report-history-icon svg {
    width: 40px;
    height: 40px;
}

/* Keep text legible over the decorative visual in RTL too. */
body.rtl.authenticated-app .safeworker-home {
    background-image:
        linear-gradient(270deg,
            rgba(255,255,255,.99) 0%,
            rgba(255,255,255,.96) 38%,
            rgba(255,255,255,.72) 58%,
            rgba(255,255,255,.18) 100%),
        var(--sw-worker-visual);
    background-position: center, left center;
}

body.rtl.authenticated-app .safeworker-home h1 {
    margin-inline-start: auto;
}

@media (max-width: 620px) {
    body.authenticated-app .safeworker-home {
        min-height: 530px;
        padding: 30px 18px 22px;
        background-image:
            linear-gradient(180deg,
                rgba(255,255,255,.98) 0%,
                rgba(255,255,255,.91) 34%,
                rgba(255,255,255,.42) 64%,
                rgba(255,255,255,.20) 100%),
            var(--sw-worker-visual);
        background-position: center, center top;
        background-size: 100% 100%, auto 100%;
    }

    body.authenticated-app .safeworker-home h1 {
        max-width: 78%;
        font-size: clamp(32px, 10vw, 47px);
    }

    body.authenticated-app .top-level-panel,
    body.authenticated-app .profile-dashboard,
    body.report-flow-active .screen[data-screen="type"] .panel,
    body.report-flow-active .screen[data-screen="form"] .panel,
    body.report-flow-active .screen[data-screen="mode"] .panel,
    body.report-flow-active .screen[data-screen="success"] .panel {
        background-size: 100% 100%, auto 220px;
        background-position: center top, right -8px top;
    }

    body.rtl.authenticated-app .top-level-panel,
    body.rtl.authenticated-app .profile-dashboard,
    body.rtl.report-flow-active .screen[data-screen="type"] .panel,
    body.rtl.report-flow-active .screen[data-screen="form"] .panel,
    body.rtl.report-flow-active .screen[data-screen="mode"] .panel,
    body.rtl.report-flow-active .screen[data-screen="success"] .panel {
        background-position: center top, left -8px top;
    }
}

/* =========================================================
   SafeWorker v22 — premium icon polish + dark premium nav/profile
   ========================================================= */

:root {
    --sw-premium-black: #0a0d10;
    --sw-premium-black-2: #11161c;
    --sw-premium-gold: #d9b24b;
    --sw-premium-gold-soft: rgba(217, 178, 75, 0.16);
}

/* Make report category visuals closer to the approved mockup. */
.screen[data-screen="type"] .type-card {
    min-height: 106px;
    gap: 16px;
    border-radius: 22px;
    box-shadow: 0 6px 16px rgba(13, 37, 64, 0.04);
}

.type-symbol,
.report-history-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 6px 14px rgba(13,37,64,0.08);
}

.type-symbol svg,
.report-history-icon svg {
    width: 34px;
    height: 34px;
}

.accident-symbol svg,
.report-history-card[data-report-type="accident"] .report-history-icon svg {
    width: 30px;
    height: 30px;
}

.report-history-card {
    grid-template-columns: 62px minmax(0,1fr) auto;
    gap: 14px;
    border-radius: 20px;
}

.report-history-card[data-report-type="near-miss"] .report-history-icon {
    background: #dceeff;
    color: #1f6fa8;
}

.report-history-card[data-report-type="unsafe-condition"] .report-history-icon {
    background: #ffbf1f;
    color: #fff;
}

.report-history-card[data-report-type="unsafe-act"] .report-history-icon {
    background: #22ae68;
    color: #fff;
}

.report-history-card[data-report-type="accident"] .report-history-icon {
    background: #f33a3a;
    color: #fff;
}

/* Premium bottom navigation with real icons instead of text symbols. */
.bottom-app-nav {
    border-top: 1px solid rgba(217, 178, 75, 0.18);
    background: rgba(10, 13, 16, 0.96);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.32);
    backdrop-filter: blur(14px);
}

.bottom-app-nav button {
    min-height: 58px;
    border-radius: 16px;
    color: rgba(239, 243, 248, 0.72);
}

.bottom-app-nav button.active {
    background: linear-gradient(180deg, rgba(217,178,75,0.18), rgba(217,178,75,0.08));
    color: #ffffff;
}

.bottom-app-nav .nav-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    line-height: 0;
}

.bottom-app-nav .nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.bottom-app-nav .nav-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

/* Premium dark profile screen, with unified black background. */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    border-color: rgba(217, 178, 75, 0.20);
    background-color: var(--sw-premium-black);
    background-image:
        linear-gradient(180deg,
            rgba(8,10,13,0.98) 0%,
            rgba(10,13,16,0.96) 48%,
            rgba(12,15,19,0.98) 100%),
        linear-gradient(90deg,
            rgba(10,13,16,0.98) 0%,
            rgba(10,13,16,0.90) 58%,
            rgba(10,13,16,0.46) 100%),
        var(--sw-worker-visual);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center, center, right top;
    background-size: 100% 100%, 100% 100%, auto 310px;
    color: #f6f3ea;
    box-shadow: 0 20px 54px rgba(0,0,0,0.28);
}

body.authenticated-app .screen[data-screen="profile"] .profile-dashboard > h2,
body.authenticated-app .screen[data-screen="profile"] .ppe-card h3,
body.authenticated-app .screen[data-screen="profile"] .ppe-item strong {
    color: #ffffff;
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card {
    border: 1px solid rgba(217, 178, 75, 0.32);
    background:
        radial-gradient(circle at 82% 18%, rgba(217,178,75,0.18), transparent 28%),
        linear-gradient(180deg, rgba(8,10,13,0.94), rgba(10,13,16,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 42px rgba(0,0,0,0.28);
}

body.authenticated-app .screen[data-screen="profile"] .score-loading,
body.authenticated-app .screen[data-screen="profile"] .score-error,
body.authenticated-app .screen[data-screen="profile"] .score-level-chip-v5,
body.authenticated-app .screen[data-screen="profile"] #scoreNextLevelLabel,
body.authenticated-app .screen[data-screen="profile"] .score-progress-text,
body.authenticated-app .screen[data-screen="profile"] .score-next-level-v5,
body.authenticated-app .screen[data-screen="profile"] .ppe-item,
body.authenticated-app .screen[data-screen="profile"] .ppe-item span {
    color: #eef2f7;
}

body.authenticated-app .screen[data-screen="profile"] .score-unit,
body.authenticated-app .screen[data-screen="profile"] #scoreLevelCounter,
body.authenticated-app .screen[data-screen="profile"] #scoreLevelTitle,
body.authenticated-app .screen[data-screen="profile"] #scoreNextLevelTitle {
    color: var(--sw-premium-gold);
}

body.authenticated-app .screen[data-screen="profile"] .score-progress {
    background: rgba(255,255,255,0.10);
}

body.authenticated-app .screen[data-screen="profile"] .score-progress-fill {
    background: linear-gradient(90deg, #d9b24b, #f4d98a);
}

body.authenticated-app .screen[data-screen="profile"] .ppe-card {
    border: 1px solid rgba(217, 178, 75, 0.16);
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(8px);
}

body.authenticated-app .screen[data-screen="profile"] .ppe-item {
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
}

body.authenticated-app .screen[data-screen="profile"] .logout-button {
    border-color: rgba(217, 178, 75, 0.22);
    background: rgba(140, 28, 28, 0.12);
    color: #ffd7d7;
}

@media (max-width: 520px) {
    .report-history-card {
        grid-template-columns: 54px minmax(0,1fr);
    }

    .type-symbol,
    .report-history-icon {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .type-symbol svg,
    .report-history-icon svg {
        width: 30px;
        height: 30px;
    }

    body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        background-size: 100% 100%, 100% 100%, auto 230px;
        background-position: center, center, right -4px top;
    }

    .bottom-app-nav .nav-label {
        font-size: 10px;
    }
}

/* =========================================================
   SafeWorker v22 FINAL — approved category icons, premium nav,
   unified black Profile sheet
   ========================================================= */

/* Category tiles exactly follow the approved visual language. */
.screen[data-screen="type"] .type-symbol,
.report-history-card .report-history-icon {
    flex: 0 0 auto;
    border: 0;
    box-shadow: 0 8px 18px rgba(13, 37, 64, 0.10), inset 0 1px 0 rgba(255,255,255,.35);
}

.screen[data-screen="type"] .near-miss-symbol,
.report-history-card[data-report-type="near-miss"] .report-history-icon {
    background: #dcefff;
    color: #126da9;
}

.screen[data-screen="type"] .unsafe-condition-symbol,
.report-history-card[data-report-type="unsafe-condition"] .report-history-icon {
    background: linear-gradient(145deg, #ffc52b, #ffad06);
    color: #fff;
}

.screen[data-screen="type"] .unsafe-act-symbol,
.report-history-card[data-report-type="unsafe-act"] .report-history-icon {
    background: linear-gradient(145deg, #26b873, #13945a);
    color: #fff;
}

.screen[data-screen="type"] .accident-symbol,
.report-history-card[data-report-type="accident"] .report-history-icon {
    background: linear-gradient(145deg, #ff4242, #e5232d);
    color: #fff;
}

.type-symbol .report-type-svg,
.report-history-icon .report-type-svg {
    width: 38px;
    height: 38px;
    display: block;
}

/* Premium bottom dock. The active item uses the Excelliso gold accent. */
.bottom-app-nav {
    min-height: calc(76px + env(safe-area-inset-bottom));
    padding-top: 8px;
    border-top: 1px solid rgba(217, 178, 75, .24);
    background: linear-gradient(180deg, rgba(13,16,19,.97), rgba(7,9,11,.99));
    box-shadow: 0 -12px 34px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.035);
}

.bottom-app-nav button {
    min-height: 61px;
    gap: 4px;
    border-radius: 17px;
    color: #9ba7b5;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.bottom-app-nav button.active {
    background: linear-gradient(180deg, rgba(217,178,75,.18), rgba(217,178,75,.055));
    color: #e7c55f;
    box-shadow: inset 0 0 0 1px rgba(217,178,75,.12);
}

.bottom-app-nav button:active {
    transform: translateY(1px) scale(.98);
}

.bottom-app-nav .nav-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
}

.bottom-app-nav .nav-icon svg {
    width: 27px;
    height: 27px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.18));
}

.bottom-app-nav .nav-label {
    color: inherit;
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .005em;
}

/* Profile is one continuous black premium sheet, not a black card on white. */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    min-height: calc(100dvh - 170px);
    border: 1px solid rgba(217,178,75,.22);
    border-radius: 28px;
    background: #090c0f !important;
    background-image:
        radial-gradient(circle at 86% 8%, rgba(217,178,75,.10), transparent 24%),
        linear-gradient(180deg, #0b0f13 0%, #080b0e 52%, #06080a 100%) !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    color: #f4f5f7;
    box-shadow: 0 22px 58px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.035);
}

body.authenticated-app .screen[data-screen="profile"] .profile-dashboard > h2 {
    color: #fff;
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card {
    margin: 0;
    padding: 10px 4px 24px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card::before {
    opacity: .42;
}

body.authenticated-app .screen[data-screen="profile"] .score-progress-block-v5 {
    border-top-color: rgba(217,178,75,.12);
}

body.authenticated-app .screen[data-screen="profile"] .ppe-card {
    margin-top: 0;
    padding: 21px 4px 6px;
    border: 0;
    border-top: 1px solid rgba(217,178,75,.14);
    border-radius: 0;
    background: transparent !important;
    backdrop-filter: none;
}

body.authenticated-app .screen[data-screen="profile"] .ppe-list {
    gap: 9px;
}

body.authenticated-app .screen[data-screen="profile"] .ppe-item {
    border: 1px solid rgba(255,255,255,.075);
    background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.022));
}

body.authenticated-app .screen[data-screen="profile"] .logout-button {
    margin-top: 22px;
    border-color: rgba(227,73,73,.44);
    background: rgba(117,23,28,.18);
    color: #ffb9bd;
}

@media (max-width: 520px) {
    .screen[data-screen="type"] .type-symbol,
    .report-history-card .report-history-icon {
        width: 56px;
        height: 56px;
        border-radius: 17px;
    }

    .type-symbol .report-type-svg,
    .report-history-icon .report-type-svg {
        width: 35px;
        height: 35px;
    }

    body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        min-height: calc(100dvh - 150px);
        padding: 24px 18px 26px;
        border-radius: 24px;
    }
}

/* =========================================================
   SafeWorker v23 — unified premium black header + footer dock
   The authenticated header now uses the exact dark visual family
   of the bottom navigation so the app is framed consistently.
   ========================================================= */
body.authenticated-app .topbar {
    border-bottom: 1px solid rgba(217, 178, 75, .24) !important;
    background: linear-gradient(180deg, rgba(13,16,19,.99), rgba(7,9,11,.99)) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.28), inset 0 -1px 0 rgba(255,255,255,.025) !important;
    backdrop-filter: blur(14px);
}

body.authenticated-app .topbar .brand {
    color: #f4f5f7;
}

body.authenticated-app .topbar .brand img {
    background: #090c0f;
    box-shadow:
        0 0 0 1px rgba(217,178,75,.34),
        0 7px 18px rgba(0,0,0,.34) !important;
}

body.authenticated-app .topbar .brand-copy strong {
    color: #f7f8fa !important;
}

body.authenticated-app .topbar .brand-copy small {
    color: #a9b3bf !important;
}

body.authenticated-app .topbar .brand-by {
    color: #98a4b1;
}

body.authenticated-app .topbar .excelliso-word {
    color: #d8dee7;
}

body.authenticated-app .topbar .excelliso-s {
    color: #e7c55f;
}

/* Keep top and bottom chrome visually identical. */
body.authenticated-app .bottom-app-nav {
    border-top-color: rgba(217,178,75,.24) !important;
    background: linear-gradient(180deg, rgba(13,16,19,.99), rgba(7,9,11,.99)) !important;
}

/* =========================================================
   SafeWorker v24 — light Profile content + worker visual
   Header/footer remain premium black. The Profile content area
   returns to the same clean white visual language as the app.
   ========================================================= */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    min-height: calc(100dvh - 170px);
    border: 1px solid rgba(205,216,228,.78) !important;
    border-radius: 28px;
    color: #102943 !important;
    background-color: #ffffff !important;
    background-image:
        linear-gradient(90deg,
            rgba(255,255,255,.995) 0%,
            rgba(255,255,255,.985) 52%,
            rgba(255,255,255,.80) 74%,
            rgba(255,255,255,.38) 100%),
        var(--sw-worker-visual) !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: center, right top !important;
    background-size: 100% 100%, auto 330px !important;
    box-shadow: 0 18px 48px rgba(13,37,64,.10) !important;
}

body.authenticated-app .screen[data-screen="profile"] .profile-dashboard > h2,
body.authenticated-app .screen[data-screen="profile"] .ppe-card h3,
body.authenticated-app .screen[data-screen="profile"] .ppe-item strong {
    color: #102943 !important;
}

/* Safety Score is a clean white card over the worker background. */
body.authenticated-app .screen[data-screen="profile"] .safety-score-card {
    margin: 0 0 18px !important;
    padding: 24px 22px 26px !important;
    border: 1px solid rgba(205,216,228,.86) !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,.93) !important;
    box-shadow:
        0 14px 34px rgba(13,37,64,.10),
        inset 0 1px 0 rgba(255,255,255,.95) !important;
    backdrop-filter: blur(5px);
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card::before {
    opacity: .08 !important;
}

body.authenticated-app .screen[data-screen="profile"] .score-loading,
body.authenticated-app .screen[data-screen="profile"] .score-error,
body.authenticated-app .screen[data-screen="profile"] .score-level-chip-v5,
body.authenticated-app .screen[data-screen="profile"] #scoreNextLevelLabel,
body.authenticated-app .screen[data-screen="profile"] .score-progress-text,
body.authenticated-app .screen[data-screen="profile"] .score-next-level-v5,
body.authenticated-app .screen[data-screen="profile"] .ppe-item,
body.authenticated-app .screen[data-screen="profile"] .ppe-item span {
    color: #51657a !important;
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card h3,
body.authenticated-app .screen[data-screen="profile"] .score-points {
    color: #102943 !important;
}

body.authenticated-app .screen[data-screen="profile"] .score-unit,
body.authenticated-app .screen[data-screen="profile"] #scoreLevelCounter,
body.authenticated-app .screen[data-screen="profile"] #scoreLevelTitle,
body.authenticated-app .screen[data-screen="profile"] #scoreNextLevelTitle {
    color: #b8891c !important;
}

body.authenticated-app .screen[data-screen="profile"] .score-progress-block-v5 {
    border-top-color: rgba(16,41,67,.10) !important;
}

body.authenticated-app .screen[data-screen="profile"] .score-progress {
    background: #e8edf2 !important;
}

body.authenticated-app .screen[data-screen="profile"] .score-progress-fill {
    background: linear-gradient(90deg, #b8891c, #e0bc5b) !important;
}

/* PPE area stays light and consistent with the score card. */
body.authenticated-app .screen[data-screen="profile"] .ppe-card {
    margin-top: 0 !important;
    padding: 22px !important;
    border: 1px solid rgba(205,216,228,.80) !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 12px 30px rgba(13,37,64,.08) !important;
    backdrop-filter: blur(5px);
}

body.authenticated-app .screen[data-screen="profile"] .ppe-list {
    gap: 9px;
}

body.authenticated-app .screen[data-screen="profile"] .ppe-item {
    border: 1px solid rgba(205,216,228,.72) !important;
    background: rgba(255,255,255,.94) !important;
    color: #102943 !important;
}

body.authenticated-app .screen[data-screen="profile"] .logout-button {
    margin-top: 22px;
    border-color: rgba(188,45,55,.28) !important;
    background: rgba(255,255,255,.94) !important;
    color: #b52f39 !important;
    box-shadow: 0 10px 24px rgba(13,37,64,.06);
}

@media (max-width: 520px) {
    body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        min-height: calc(100dvh - 150px);
        padding: 24px 18px 26px;
        border-radius: 24px;
        background-image:
            linear-gradient(180deg,
                rgba(255,255,255,.98) 0%,
                rgba(255,255,255,.91) 25%,
                rgba(255,255,255,.72) 44%,
                rgba(255,255,255,.96) 63%,
                rgba(255,255,255,1) 100%),
            var(--sw-worker-visual) !important;
        background-position: center, right -6px top !important;
        background-size: 100% 100%, auto 300px !important;
    }

    body.authenticated-app .screen[data-screen="profile"] .safety-score-card,
    body.authenticated-app .screen[data-screen="profile"] .ppe-card {
        padding: 20px 17px !important;
        border-radius: 21px !important;
    }
}

body.rtl.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    background-image:
        linear-gradient(270deg,
            rgba(255,255,255,.995) 0%,
            rgba(255,255,255,.985) 52%,
            rgba(255,255,255,.80) 74%,
            rgba(255,255,255,.38) 100%),
        var(--sw-worker-visual) !important;
    background-position: center, left top !important;
}

@media (max-width: 520px) {
    body.rtl.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        background-image:
            linear-gradient(180deg,
                rgba(255,255,255,.98) 0%,
                rgba(255,255,255,.91) 25%,
                rgba(255,255,255,.72) 44%,
                rgba(255,255,255,.96) 63%,
                rgba(255,255,255,1) 100%),
            var(--sw-worker-visual) !important;
        background-position: center, left -6px top !important;
    }
}

/* =========================================================
   SafeWorker v25 — Profile worker photo made clearly visible
   Keep the score/PPE content white while the worker with the
   high-visibility vest remains clearly visible behind the top
   section of the Profile page.
   ========================================================= */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    position: relative;
    overflow: hidden;
    background-color: #ffffff !important;
    background-image:
        linear-gradient(180deg,
            rgba(255,255,255,.16) 0%,
            rgba(255,255,255,.22) 30%,
            rgba(255,255,255,.54) 52%,
            rgba(255,255,255,.92) 72%,
            #ffffff 100%),
        var(--sw-worker-visual) !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: center top, right top !important;
    background-size: 100% 100%, auto 470px !important;
}

/* Keep the title readable while allowing the photo to show through. */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard > h2 {
    position: relative;
    z-index: 1;
    color: #102943 !important;
    text-shadow:
        0 1px 0 rgba(255,255,255,.95),
        0 0 14px rgba(255,255,255,.88);
}

/* Score stays a white card, but slightly translucent so the visual
   remains present instead of disappearing completely. */
body.authenticated-app .screen[data-screen="profile"] .safety-score-card {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.90) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.authenticated-app .screen[data-screen="profile"] .ppe-card,
body.authenticated-app .screen[data-screen="profile"] .logout-button {
    position: relative;
    z-index: 1;
}

@media (max-width: 520px) {
    body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        background-image:
            linear-gradient(180deg,
                rgba(255,255,255,.10) 0%,
                rgba(255,255,255,.16) 24%,
                rgba(255,255,255,.42) 46%,
                rgba(255,255,255,.88) 67%,
                #ffffff 100%),
            var(--sw-worker-visual) !important;
        background-position: center top, right -44px top !important;
        background-size: 100% 100%, auto 455px !important;
    }

    body.authenticated-app .screen[data-screen="profile"] .safety-score-card {
        background: rgba(255,255,255,.88) !important;
    }
}

body.rtl.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    background-position: center top, left top !important;
}

@media (max-width: 520px) {
    body.rtl.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        background-position: center top, left -44px top !important;
    }
}


/* =========================================================
   SafeWorker v26 — final photographic report-type icon assets
   Use the uploaded PNG artwork directly; no CSS/SVG redraws.
   ========================================================= */
.screen[data-screen="type"] .type-symbol,
.report-history-card .report-history-icon {
    width: 76px !important;
    height: 76px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    display: grid !important;
    place-items: center !important;
}

.screen[data-screen="type"] .type-symbol::before,
.screen[data-screen="type"] .type-symbol::after,
.report-history-card .report-history-icon::before,
.report-history-card .report-history-icon::after {
    content: none !important;
    display: none !important;
}

.report-type-image {
    width: 76px !important;
    height: 76px !important;
    display: block !important;
    object-fit: contain !important;
    border-radius: 19px !important;
    filter: drop-shadow(0 7px 12px rgba(16, 35, 54, .12));
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

@media (max-width: 520px) {
    .screen[data-screen="type"] .type-symbol,
    .report-history-card .report-history-icon,
    .report-type-image {
        width: 70px !important;
        height: 70px !important;
    }

    .screen[data-screen="type"] .type-symbol,
    .report-history-card .report-history-icon {
        border-radius: 18px !important;
    }

    .report-type-image {
        border-radius: 17px !important;
    }
}


/* =========================================================
   SafeWorker v27 — unified panels, premium policy/PPE icons,
   centered desktop layout, improved legal page consistency.
   ========================================================= */

/* One centered content width for all authenticated panels. */
body.authenticated-app .shell {
    width: min(1100px, calc(100% - 28px));
    margin-inline: auto;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

body.authenticated-app .screen,
body.authenticated-app .screen.app-section {
    width: 100%;
}

body.authenticated-app .top-level-panel,
body.authenticated-app .profile-dashboard,
body.authenticated-app .screen[data-screen="type"] .panel,
body.authenticated-app .screen[data-screen="form"] .panel,
body.authenticated-app .screen[data-screen="mode"] .panel,
body.authenticated-app .screen[data-screen="success"] .panel {
    width: min(100%, 980px);
    margin-inline: auto;
    padding: clamp(22px, 3.2vw, 34px);
    border-radius: 26px;
    border: 1px solid rgba(205,216,228,.88) !important;
    background: #ffffff !important;
    box-shadow: 0 16px 42px rgba(13,37,64,.08) !important;
}

body.authenticated-app .top-level-panel,
body.authenticated-app .profile-dashboard {
    display: block;
}

/* Policy cards: premium icon badges and cleaner copy. */
.policies-list { gap: 12px; }
.policies-list a {
    min-height: 82px;
    padding: 14px 16px;
    grid-template-columns: 52px minmax(0,1fr) auto;
    gap: 14px;
    border-radius: 18px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.policies-list a:hover,
.policies-list a:focus-visible {
    border-color: rgba(184,137,28,.30);
    box-shadow: 0 10px 22px rgba(13,37,64,.08);
    transform: translateY(-1px);
}
.policy-icon-badge {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(13,37,64,.10), inset 0 1px 0 rgba(255,255,255,.45);
}
.policy-icon-badge svg { width: 28px; height: 28px; display:block; }
.policy-icon-privacy { background: linear-gradient(145deg, #ffd76d, #dca117); color: #fff; }
.policy-icon-terms { background: linear-gradient(145deg, #dfeaf7, #bfd3ea); color: #1e4f82; }
.policy-icon-cookies { background: linear-gradient(145deg, #ffcf6c, #f2a632); color: #7b4c0b; }
.policy-icon-data { background: linear-gradient(145deg, #dff4ee, #b9e3d7); color: #16714b; }
.policy-icon-access { background: linear-gradient(145deg, #d8e7ff, #b4cff7); color: #215d9b; }
.policy-copy { min-width: 0; display: grid; gap: 4px; }
.policies-list .policy-copy strong {
    display: block;
    color: var(--sw-navy);
    font-size: 18px;
}
.policies-list .policy-copy small {
    color: var(--sw-ui-muted);
    font-size: 12.5px;
    line-height: 1.4;
}
.policies-list .policy-arrow {
    color: #94a1b0;
    font-size: 26px;
    line-height: 1;
}

/* PPE cards: better icons + short legal-purpose text. */
.ppe-card { padding: 22px !important; }
.ppe-intro {
    margin: 0 0 14px;
    color: var(--sw-ui-muted);
    font-size: 13.5px;
    line-height: 1.55;
}
.ppe-list { gap: 10px; }
.ppe-item {
    min-height: 86px;
    padding: 12px 13px;
    grid-template-columns: 54px minmax(0,1fr);
    gap: 12px;
    border-radius: 16px;
    align-items: start;
}
.ppe-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(13,37,64,.09), inset 0 1px 0 rgba(255,255,255,.45);
}
.ppe-icon svg { width: 28px; height: 28px; display:block; }
.ppe-helmet { background: linear-gradient(145deg, #ff6a61, #e5382e); color: #fff; }
.ppe-glasses { background: linear-gradient(145deg, #dbedf7, #c2ddec); color: #245d86; }
.ppe-gloves { background: linear-gradient(145deg, #d9f0f6, #c1e1ea); color: #2f6d78; }
.ppe-shoes { background: linear-gradient(145deg, #e8d6c7, #c7a88d); color: #68462f; }
.ppe-vest { background: linear-gradient(145deg, #ffe37d, #f7b52d); color: #8b5200; }
.ppe-hearing { background: linear-gradient(145deg, #e2e5eb, #cbd3dd); color: #4f6379; }
.ppe-copy { min-width: 0; display:grid; gap:4px; }
.ppe-item strong {
    display: block;
    color: var(--sw-navy) !important;
    font-size: 16px;
}
.ppe-item small {
    color: var(--sw-ui-muted);
    font-size: 12.6px;
    line-height: 1.45;
}

/* Keep white profile visual unified and centered. */
body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
    background-image:
        linear-gradient(180deg,
            rgba(255,255,255,.10) 0%,
            rgba(255,255,255,.16) 24%,
            rgba(255,255,255,.42) 46%,
            rgba(255,255,255,.88) 68%,
            #ffffff 100%),
        var(--sw-worker-visual) !important;
    background-position: center top, right top !important;
    background-size: 100% 100%, auto 455px !important;
}

body.authenticated-app .screen[data-screen="profile"] .safety-score-card,
body.authenticated-app .screen[data-screen="profile"] .ppe-card {
    width: 100%;
    margin-inline: auto;
}

@media (min-width: 900px) {
    body.authenticated-app .shell {
        width: min(1180px, calc(100% - 52px));
    }

    body.authenticated-app .top-level-panel,
    body.authenticated-app .profile-dashboard,
    body.authenticated-app .screen[data-screen="type"] .panel,
    body.authenticated-app .screen[data-screen="form"] .panel,
    body.authenticated-app .screen[data-screen="mode"] .panel,
    body.authenticated-app .screen[data-screen="success"] .panel {
        padding: 30px 34px;
    }
}

@media (max-width: 520px) {
    body.authenticated-app .shell {
        width: min(100% - 16px, 1100px);
    }

    body.authenticated-app .top-level-panel,
    body.authenticated-app .profile-dashboard,
    body.authenticated-app .screen[data-screen="type"] .panel,
    body.authenticated-app .screen[data-screen="form"] .panel,
    body.authenticated-app .screen[data-screen="mode"] .panel,
    body.authenticated-app .screen[data-screen="success"] .panel {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .policies-list a {
        grid-template-columns: 48px minmax(0,1fr) auto;
        min-height: 78px;
        padding: 13px;
    }

    .policy-icon-badge,
    .ppe-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .policy-icon-badge svg,
    .ppe-icon svg {
        width: 25px;
        height: 25px;
    }

    .ppe-item {
        min-height: 92px;
        grid-template-columns: 48px minmax(0,1fr);
    }
}

/* =========================================================
   SafeWorker v28 — premium PPE accordions + gold Worker brand
   ========================================================= */

/* Brand: keep Safe white and make Worker gold everywhere. */
.brand-worker-gold,
body.authenticated-app .topbar .brand-copy strong .brand-worker-gold,
.splash-brand .brand-worker-gold {
    color: #e7c55f !important;
}

/* Policies use a restrained black/gold premium icon system. */
.policy-icon-badge {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(215,166,43,.42) !important;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 36%),
        linear-gradient(145deg, #171b20, #080a0c) !important;
    color: #e7c55f !important;
    box-shadow:
        0 9px 20px rgba(0,0,0,.16),
        inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.policy-icon-badge::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    border: 1px solid rgba(255,255,255,.025);
    pointer-events: none;
}
.policy-icon-badge svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 5px rgba(215,166,43,.18));
}

/* Premium PPE accordion. */
.ppe-card {
    overflow: hidden;
}

.ppe-list {
    display: grid;
    gap: 11px;
}

.ppe-detail {
    margin: 0;
    border: 1px solid rgba(205,216,228,.88);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 20px rgba(13,37,64,.045);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ppe-detail[open] {
    border-color: rgba(184,137,28,.34);
    box-shadow: 0 12px 28px rgba(13,37,64,.085);
}

.ppe-detail > summary {
    min-height: 74px;
    padding: 11px 14px;
    display: grid;
    grid-template-columns: 52px minmax(0,1fr) 28px;
    align-items: center;
    gap: 13px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.ppe-detail > summary::-webkit-details-marker {
    display: none;
}

.ppe-detail > summary strong {
    color: var(--sw-navy) !important;
    font-size: 16px;
    line-height: 1.25;
}

.ppe-chevron {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #9b7a21;
    font-size: 23px;
    line-height: 1;
    transition: transform .18s ease;
}

.ppe-detail[open] .ppe-chevron {
    transform: rotate(180deg);
}

.ppe-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(215,166,43,.48) !important;
    border-radius: 16px;
    background:
        radial-gradient(circle at 32% 20%, rgba(255,255,255,.08), transparent 36%),
        linear-gradient(145deg, #171b20, #080a0c) !important;
    color: #e7c55f !important;
    box-shadow:
        0 9px 20px rgba(0,0,0,.14),
        inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.ppe-icon svg {
    width: 29px;
    height: 29px;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(215,166,43,.18));
}

.ppe-detail-body {
    padding: 0 16px 16px 79px;
}

.ppe-detail-body p {
    margin: 0;
    padding: 13px 14px;
    border: 1px solid rgba(215,166,43,.16);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(250,246,235,.88), rgba(255,255,255,.98));
    color: #536579;
    font-size: 13.5px;
    line-height: 1.6;
}

.ppe-intro {
    margin: -2px 0 16px !important;
    padding: 12px 14px;
    border-left: 3px solid rgba(215,166,43,.78);
    border-radius: 0 12px 12px 0;
    background: rgba(247,237,210,.42);
    color: #56677a !important;
    font-size: 13px !important;
    line-height: 1.55;
}

/* Ensure old v27 PPE-item styling cannot affect the new details layout. */
.ppe-card .ppe-detail .ppe-icon,
.ppe-card .ppe-detail .ppe-icon span {
    color: #e7c55f !important;
}

/* Keep all primary panels visually consistent on desktop. */
@media (min-width: 900px) {
    body.authenticated-app .screen[data-screen="home"] .top-level-panel,
    body.authenticated-app .screen[data-screen="reports"] .top-level-panel,
    body.authenticated-app .screen[data-screen="policies"] .top-level-panel,
    body.authenticated-app .screen[data-screen="profile"] .profile-dashboard {
        width: min(980px, 100%) !important;
        margin-inline: auto !important;
    }
}

@media (max-width: 520px) {
    .ppe-detail > summary {
        min-height: 70px;
        padding: 10px 12px;
        grid-template-columns: 48px minmax(0,1fr) 26px;
        gap: 11px;
    }

    .ppe-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .ppe-icon svg {
        width: 26px;
        height: 26px;
    }

    .ppe-detail-body {
        padding: 0 12px 13px 71px;
    }

    .ppe-detail-body p {
        padding: 12px;
        font-size: 12.7px;
        line-height: 1.55;
    }
}

body.rtl .ppe-detail > summary {
    grid-template-columns: 28px minmax(0,1fr) 52px;
}
body.rtl .ppe-detail > summary .ppe-icon { grid-column: 3; grid-row: 1; }
body.rtl .ppe-detail > summary strong { grid-column: 2; grid-row: 1; text-align: right; }
body.rtl .ppe-detail > summary .ppe-chevron { grid-column: 1; grid-row: 1; }
body.rtl .ppe-detail-body { padding: 0 79px 16px 16px; }
body.rtl .ppe-intro { border-left: 0; border-right: 3px solid rgba(215,166,43,.78); border-radius: 12px 0 0 12px; }

@media (max-width: 520px) {
    body.rtl .ppe-detail > summary { grid-template-columns: 26px minmax(0,1fr) 48px; }
    body.rtl .ppe-detail-body { padding: 0 71px 13px 12px; }
}
