* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.header-card,
.form-card,
.submit-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.header-card {
    padding: 20px;
    margin-bottom: 18px;
}

.header-card h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    color: #0f172a;
    max-width: 100%;
}

.header-card p {
    color: #475569;
    line-height: 1.6;
}

/* OFFICIAL GOVERNMENT / JMG BRANDING */

.official-strip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #0f2b5b;
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.official-strip span:last-child {
    color: #bfdbfe;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.official-header {
    border-top: 4px solid #fdb813;
    border-radius: 0 0 18px 18px;
    position: relative;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(15, 43, 91, 0.035) 0px,
            rgba(15, 43, 91, 0.035) 1px,
            transparent 1px,
            transparent 12px
        ),
        #ffffff;
}

.brand-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

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

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px;
}

.agency-name {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.3;
}

.agency-subtitle {
    margin-top: 3px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.survey-badge {
    align-self: flex-start;
    background: #eff6ff;
    color: #0f2b5b;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.eyebrow {
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.title-block h1 {
    max-width: 980px;
}

.official-note {
    background: #f8fafc;
    border-left: 4px solid #0f2b5b;
    padding: 12px 14px;
    border-radius: 10px;
}

.form-card {
    padding: 18px;
    margin-bottom: 18px;
}

.form-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 20px;
    color: #0f172a;
}

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

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
}

input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: auto;
    padding: 0;
    border-radius: 50%;
}

input:focus,
select:focus {
    outline: 2px solid #1d4ed8;
    outline-offset: 1px;
}

.help-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.honeypot {
    display: none;
}

/* TABLE SURVEY LAYOUT - clearer row separation */

.table-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
    margin-bottom: 20px;
}

.survey-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
    min-width: 1120px;
}

.th-note {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #bfdbfe;
}

.survey-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0f2b5b;
    color: #ffffff;
    text-align: left;
    font-size: 13px;
    padding: 16px;
    vertical-align: middle;
    white-space: nowrap;
}

.survey-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.survey-table th:first-child {
    border-radius: 16px 0 0 0;
}

.survey-table th:last-child {
    border-radius: 0 16px 0 0;
}

.survey-table td {
    padding: 16px;
    vertical-align: top;
    background: #ffffff;
    border-top: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
}

/* Show small column label inside each answer cell */
.survey-table td:not(.mineral-name)::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.survey-table td:first-child {
    border-left: 1px solid #dbe4f0;
    border-radius: 16px 0 0 16px;
}

.survey-table td:last-child {
    border-right: 1px solid #dbe4f0;
    border-radius: 0 16px 16px 0;
}

.survey-table tr:hover td {
    background: #f8fbff;
}

.mineral-col {
    width: 230px;
}

.mineral-name {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8fafc !important;
    border-right: 1px solid #e2e8f0;
}

.mineral-name strong {
    display: block;
    font-size: 20px;
    color: #0f172a;
    line-height: 1.3;
    font-weight: 800;
}

.mineral-number {
    display: inline-block;
    font-size: 12px;
    color: #1d4ed8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

/* RADIO BUTTON LIST - safer to click */

.radio-list {
    display: grid;
    gap: 10px;
}

.radio-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
    transition: 0.15s ease;
}

.radio-list label:hover {
    border-color: #0f2b5b;
    background: #f8fbff;
}

.radio-list input {
    width: 16px;
    height: 16px;
    min-height: auto;
    margin: 0;
    accent-color: #0f2b5b;
    flex-shrink: 0;
}

.radio-list span {
    font-size: 14px;
    line-height: 1.35;
    color: #0f172a;
}

.radio-list label:has(input:checked) {
    border-color: #0f2b5b;
    background: #eaf2ff;
    box-shadow: 0 0 0 2px rgba(15, 43, 91, 0.16);
}

.radio-list label:has(input:checked) span {
    font-weight: 800;
    color: #0f2b5b;
}

/* SUBMIT BAR */

.submit-bar {
    position: sticky;
    bottom: 0;
    padding: 14px;
    margin-top: 20px;
    border-radius: 18px 18px 0 0;
    z-index: 999;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.16);
}

.submit-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: #0f2b5b;
    cursor: pointer;
    transition: 0.18s ease;
}

button:hover {
    background: #123b80;
}

button:active {
    transform: scale(0.98);
}

.footer-note {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin: 24px 0;
}

/* DESKTOP */

@media (min-width: 768px) {
    .container {
        padding: 28px;
    }

    .header-card {
        padding: 28px;
    }

.header-card h1 {
    font-size: 26px;
    white-space: nowrap;
}

    .form-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .submit-bar {
        bottom: 18px;
        border-radius: 18px;
    }

    .submit-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    button {
        width: auto;
        min-width: 180px;
    }

    .official-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.brand-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    width: 72px;
    height: 72px;
}

.agency-name {
    font-size: 18px;
}
}

/* MOBILE: TABLE BECOMES CARDS */

@media (max-width: 767px) {
    .container {
        padding: 12px;
    }

    .header-card {
        padding: 18px;
        border-radius: 16px;
    }

    .header-card h1 {
        font-size: 22px;
    }

    .header-card p {
        font-size: 14px;
    }

    .form-card {
        padding: 16px;
        border-radius: 16px;
    }

    .table-card {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .table-responsive {
        overflow-x: visible;
    }

    .survey-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 14px;
    }

    .survey-table thead {
        display: none;
    }

    .survey-table,
    .survey-table tbody,
    .survey-table tr,
    .survey-table td {
        display: block;
        width: 100%;
    }

    .survey-table tr {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
        overflow: hidden;
        margin-bottom: 14px;
    }

    .survey-table td {
        border-bottom: 1px solid #e2e8f0;
        padding: 14px;
    }

    .survey-table td:last-child {
        border-bottom: 0;
    }

    .survey-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 800;
        color: #1d4ed8;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 8px;
    }

    .survey-table td.mineral-name::before {
        display: none;
    }

    .survey-table tr:nth-child(even) td,
    .survey-table tr:hover td {
        background: #ffffff;
    }

    .mineral-name {
        position: static;
        background: #f8fafc !important;
    }

.mineral-name strong {
    font-size: 22px;
    font-weight: 800;
}

    .radio-list {
        gap: 8px;
    }

    .radio-list label {
        padding: 11px 12px;
        border-radius: 12px;
    }

    .radio-list span {
        font-size: 14px;
    }

    .submit-bar {
        left: 0;
        right: 0;
        margin-left: -12px;
        margin-right: -12px;
        border-radius: 18px 18px 0 0;
    }
}

.official-footer {
    line-height: 1.6;
    color: #475569;
}

.official-footer strong {
    color: #0f2b5b;
}

.institution-line {
    font-size: 15px;
    font-weight: 700;
    color: #0f2b5b;
    margin-top: -4px;
}

.submit-btn {
    background: #15803d;
    color: #ffffff;
}

.submit-btn:hover {
    background: #166534;
}

.submit-btn:active {
    transform: scale(0.98);
}

.official-header > * {
    position: relative;
    z-index: 1;
}

.title-block {
    width: 100%;
}

.title-block h1 {
    max-width: none;
    width: 100%;
    letter-spacing: -0.02em;
}

.title-block p {
    max-width: none;
    width: 100%;
}

.official-note {
    max-width: none;
    width: 100%;
}

.autosave-box {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #14532d;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.autosave-box strong {
    font-size: 14px;
    color: #166534;
}

.autosave-box span {
    color: #166534;
}

.clear-draft-btn {
    width: fit-content;
    min-width: auto;
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.clear-draft-btn:hover {
    background: #b91c1c;
}

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    color: #0f2b5b;
    font-size: 13px;
    font-weight: 800;
}

.visitor-label {
    color: #475569;
    font-weight: 700;
}

.visitor-number {
    background: #0f2b5b;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
    min-width: 42px;
    text-align: center;
}

@media (max-width: 767px) {
    .visitor-counter {
        width: 100%;
        justify-content: space-between;
        border-radius: 14px;
    }
}

.footer-visitor-counter {
    margin: 14px auto 0;
    justify-content: center;
    transform: scale(0.95);
}

.required-mark {
    color: #dc2626;
    font-weight: 900;
}

/* =========================================================
   PATCH: Keselesaan Bacaan + Versi Bahasa Melayu
   Diletakkan di hujung fail supaya override rule lama.
   ========================================================= */

html {
    font-size: 17px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1360px;
}

.header-card {
    padding: 24px 26px;
}

.official-header {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(15, 43, 91, 0.035) 0px,
            rgba(15, 43, 91, 0.035) 1px,
            transparent 1px,
            transparent 12px
        ),
        #ffffff;
}

.header-card h1,
.title-block h1 {
    font-size: clamp(1.55rem, 2.15vw, 2rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    white-space: normal;
    max-width: none;
    width: 100%;
}

.header-card p,
.title-block p {
    font-size: 1rem;
    line-height: 1.72;
    max-width: none;
    width: 100%;
}

.official-note {
    font-size: 1rem;
    line-height: 1.65;
    max-width: none;
    width: 100%;
}

.institution-line {
    font-size: 1rem;
    line-height: 1.55;
}

.official-strip {
    font-size: 0.82rem;
    line-height: 1.35;
}

.agency-name {
    font-size: 1.08rem;
}

.agency-subtitle {
    font-size: 0.92rem;
}

.survey-badge,
.eyebrow {
    font-size: 0.82rem;
}

.form-card h2 {
    font-size: 1.32rem;
    line-height: 1.3;
}

label {
    font-size: 0.98rem;
    line-height: 1.35;
}

input,
select {
    min-height: 52px;
    padding: 12px 14px;
    font-size: 1rem;
    line-height: 1.4;
}

input[type="radio"] {
    width: 19px;
    height: 19px;
}

.help-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.autosave-box {
    font-size: 0.98rem;
    line-height: 1.6;
    padding: 14px 16px;
}

.autosave-box strong {
    font-size: 1rem;
}

.clear-draft-btn {
    font-size: 0.88rem;
    padding: 9px 13px;
}

.survey-table {
    min-width: 1220px;
}

.survey-table th,
.survey-table thead th {
    font-size: 0.88rem;
    line-height: 1.3;
    padding: 14px 16px;
}

.th-note {
    font-size: 0.74rem;
    line-height: 1.25;
}

.survey-table td {
    padding: 18px 16px;
}

.survey-table td:not(.mineral-name)::before {
    font-size: 0.8rem;
    line-height: 1.25;
    margin-bottom: 12px;
}

.mineral-col {
    width: 245px;
}

.mineral-name strong {
    font-size: 1.42rem;
    line-height: 1.28;
}

.mineral-number {
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.radio-list {
    gap: 11px;
}

.radio-list label {
    min-height: 50px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 13px;
}

.radio-list span {
    font-size: 1rem;
    line-height: 1.42;
}

button {
    font-size: 1rem;
    line-height: 1.35;
    padding: 15px 24px;
}

.footer-note {
    font-size: 0.95rem;
    line-height: 1.7;
}

.visitor-counter {
    font-size: 0.9rem;
}

.visitor-number {
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .header-card {
        padding: 26px 30px;
    }

    .header-card h1,
    .title-block h1 {
        font-size: clamp(1.6rem, 1.95vw, 2rem);
        white-space: normal;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1180px) {
    .form-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    html {
        font-size: 16.5px;
    }

    body {
        font-size: 16.5px;
    }

    .header-card {
        padding: 20px;
    }

    .header-card h1,
    .title-block h1 {
        font-size: 1.55rem;
        line-height: 1.23;
    }

    .header-card p,
    .title-block p,
    .official-note {
        font-size: 1rem;
        line-height: 1.68;
    }

    .form-card h2 {
        font-size: 1.28rem;
    }

    label {
        font-size: 1rem;
    }

    input,
    select {
        min-height: 52px;
        font-size: 1rem;
    }

    .survey-table td {
        padding: 16px;
    }

    .survey-table td::before,
    .survey-table td:not(.mineral-name)::before {
        font-size: 0.82rem;
        margin-bottom: 10px;
    }

    .mineral-name strong {
        font-size: 1.62rem;
        line-height: 1.25;
    }

    .radio-list {
        gap: 10px;
    }

    .radio-list label {
        min-height: 52px;
        padding: 13px 14px;
    }

    .radio-list span {
        font-size: 1.03rem;
        line-height: 1.42;
    }

    .submit-inner .help-text {
        font-size: 0.92rem;
    }

    .submit-btn {
        width: 100%;
        font-size: 1.05rem;
        padding: 15px 22px;
    }
}

/* =========================================================
   BILINGUAL TOGGLE + COMFORT READING PATCH
   ========================================================= */

body {
    font-size: 17px;
}

.language-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.lang-btn {
    width: auto;
    min-width: auto;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 9px 14px;
    background: #ffffff;
    color: #0f2b5b;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.lang-btn:hover {
    background: #eff6ff;
    color: #0f2b5b;
}

.lang-btn.active {
    background: #0f2b5b;
    color: #ffffff;
    border-color: #0f2b5b;
}

.thankyou-toggle {
    margin-top: 22px;
}

.header-card h1 {
    font-size: clamp(24px, 2.2vw, 30px);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.header-card p,
.title-block p {
    font-size: 17px;
    line-height: 1.72;
    max-width: none;
    width: 100%;
}

.help-text {
    font-size: 15px;
    line-height: 1.65;
}

.official-note {
    max-width: none;
    width: 100%;
    font-size: 16px;
    line-height: 1.7;
}

.institution-line {
    font-size: 17px;
    line-height: 1.55;
}

.form-card h2 {
    font-size: 22px;
}

label {
    font-size: 15px;
}

input,
select {
    min-height: 50px;
    padding: 12px 14px;
    font-size: 16px;
}

input[type="radio"] {
    width: 18px;
    height: 18px;
}

.autosave-box {
    font-size: 15px;
    line-height: 1.6;
}

.autosave-box strong {
    font-size: 16px;
}

.survey-table th {
    font-size: 14px;
}

.survey-table td:not(.mineral-name)::before {
    font-size: 12px;
}

.th-note {
    font-size: 11px;
}

.mineral-name strong {
    font-size: 23px;
    line-height: 1.25;
}

.mineral-number {
    font-size: 13px;
}

.radio-list {
    gap: 11px;
}

.radio-list label {
    min-height: 50px;
    padding: 12px 14px;
    gap: 11px;
}

.radio-list span {
    font-size: 16px;
    line-height: 1.38;
}

.submit-btn {
    background: linear-gradient(135deg, #15803d, #166534);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.25);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #166534, #14532d);
}

.return-survey-link {
    display: inline-block;
    background: #0f2b5b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
}

.return-survey-link:hover {
    background: #123b80;
}

@media (min-width: 768px) {
    .header-card h1 {
        font-size: clamp(24px, 2vw, 30px);
    }
}

@media (max-width: 767px) {
    body {
        font-size: 16px;
    }

    .language-toggle-wrap {
        justify-content: stretch;
    }

    .lang-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 13px;
    }

    .header-card h1 {
        font-size: 24px;
        line-height: 1.28;
        white-space: normal;
    }

    .header-card p,
    .title-block p {
        font-size: 16px;
        line-height: 1.72;
    }

    .official-note {
        font-size: 15.5px;
        line-height: 1.7;
    }

    .mineral-name strong {
        font-size: 25px;
    }

    .radio-list label {
        min-height: 52px;
        padding: 13px 14px;
    }

    .radio-list span {
        font-size: 16px;
    }

    .submit-bar {
        z-index: 999;
    }
}

/* =========================================================
   PATCH: Progress bar, completed cards and softer text colors
   ========================================================= */

:root {
    --survey-text-main: #1f2937;
    --survey-text-soft: #4b5563;
    --survey-text-muted: #57534e;
    --survey-accent-green: #14532d;
    --survey-success: #15803d;
    --survey-success-soft: #ecfdf5;
    --survey-success-border: #86efac;
    --survey-info-bg: #fafaf9;
    --survey-info-border: #d6d3d1;
}

body {
    color: var(--survey-text-main);
}

/* Top progress bar */
.survey-progress-top {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(250, 250, 249, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #d6d3d1;
    padding: 9px 12px;
}

.survey-progress-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

#surveyProgressText {
    min-width: 118px;
    font-size: 14px;
    font-weight: 900;
    color: var(--survey-text-main);
    white-space: nowrap;
}

.survey-progress-track {
    flex: 1;
    height: 11px;
    background: #e7e5e4;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.08);
}

.survey-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #15803d, #16a34a);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* Comfortable non-link text colors */
.header-card h1,
.agency-name,
.form-card h2,
.mineral-name strong,
.survey-table th,
.radio-list span,
label,
.help-text strong {
    color: var(--survey-text-main);
}

.header-card p,
.title-block p,
.help-text,
.agency-subtitle,
.official-footer,
.visitor-label,
.th-note {
    color: var(--survey-text-soft);
}

.eyebrow,
.mineral-number,
.survey-table td:not(.mineral-name)::before,
.survey-table td::before {
    color: var(--survey-text-muted) !important;
}

.institution-line {
    color: var(--survey-accent-green) !important;
}

.survey-badge {
    background: #f0fdf4 !important;
    color: var(--survey-accent-green) !important;
    border-color: #bbf7d0 !important;
}

.lang-btn.active {
    background: var(--survey-accent-green) !important;
    border-color: var(--survey-accent-green) !important;
    color: #ffffff !important;
}

.lang-btn:not(.active) {
    color: var(--survey-text-main);
    border-color: #d6d3d1;
}

/* Softer respondent information note with information icon */
.official-note {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    max-width: none;
    width: 100%;
    background: var(--survey-info-bg) !important;
    border: 1px solid var(--survey-info-border) !important;
    border-left: 1px solid var(--survey-info-border) !important;
    border-radius: 14px;
    padding: 15px 50px 15px 16px !important;
    color: var(--survey-text-soft) !important;
    line-height: 1.72;
}

.official-note-icon {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.72;
    filter: grayscale(1) contrast(0.95);
}

.official-note span {
    display: block;
    color: var(--survey-text-soft);
}

/* Completed mineral status */
.mineral-complete-badge {
    display: none;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: var(--survey-success);
    border: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.survey-table tbody tr.mineral-complete td {
    background: var(--survey-success-soft) !important;
    border-top-color: var(--survey-success-border) !important;
    border-bottom-color: var(--survey-success-border) !important;
}

.survey-table tbody tr.mineral-complete td:first-child {
    border-left-color: var(--survey-success-border) !important;
}

.survey-table tbody tr.mineral-complete td:last-child {
    border-right-color: var(--survey-success-border) !important;
}

.survey-table tbody tr.mineral-complete .mineral-name {
    background: #dcfce7 !important;
}

.survey-table tbody tr.mineral-complete .mineral-complete-badge {
    display: inline-flex;
    align-items: center;
}

.survey-table tbody tr.mineral-complete .radio-list label:has(input:checked) {
    background: #ffffff;
    border-color: var(--survey-success);
}

/* Better readability without making the interface crowded */
.header-card p,
.title-block p,
.official-note {
    font-size: 16.5px;
}

.radio-list span {
    font-size: 16px;
}

.survey-table td:not(.mineral-name)::before,
.survey-table td::before {
    font-size: 12.5px !important;
}

/* Mobile handling */
@media (max-width: 767px) {
    .survey-progress-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
    }

    #surveyProgressText {
        min-width: 0;
        font-size: 13.5px;
    }

    .survey-progress-track {
        height: 10px;
    }

    .official-note {
        padding: 15px 46px 15px 15px !important;
        font-size: 16px;
    }

    .official-note-icon {
        right: 14px;
        width: 22px;
        height: 22px;
    }

    .survey-table tbody tr.mineral-complete {
        background: var(--survey-success-soft) !important;
        border-color: var(--survey-success-border) !important;
        box-shadow: 0 10px 24px rgba(21, 128, 61, 0.12);
    }

    .survey-table tbody tr.mineral-complete td {
        background: var(--survey-success-soft) !important;
        border-bottom-color: #bbf7d0 !important;
    }

    .survey-table tbody tr.mineral-complete .mineral-name {
        background: #dcfce7 !important;
    }
}

/* =========================================================
   LANGUAGE SHORT TEXT + DEVELOPED-BY CREDIT PATCH
   ========================================================= */

.header-actions {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.language-inline,
.language-toggle-wrap.thankyou-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: #57534e;
    font-size: 13px;
    line-height: 1.45;
}

.language-label {
    font-weight: 800;
    color: #44403c;
}

.language-separator {
    color: #a8a29e;
    font-weight: 700;
}

.lang-btn {
    width: auto !important;
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 2px !important;
    background: transparent !important;
    color: #57534e !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.45;
    cursor: pointer;
}

.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn.active {
    background: transparent !important;
    border: 0 !important;
    color: #14532d !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-btn:focus-visible {
    outline: 2px solid #84cc16;
    outline-offset: 3px;
    border-radius: 4px !important;
}

.developer-credit {
    max-width: 520px;
    color: #57534e;
    font-size: 12.8px;
    font-weight: 700;
    line-height: 1.45;
}

@media (min-width: 900px) {
    .brand-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .header-actions {
        align-items: flex-end;
        text-align: right;
    }

    .language-inline {
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .header-actions {
        width: 100%;
    }

    .language-inline {
        width: 100%;
        padding-top: 2px;
    }

    .developer-credit {
        width: 100%;
        font-size: 12.6px;
    }

    .language-toggle-wrap.thankyou-toggle {
        justify-content: center !important;
        margin-top: 18px;
    }
}

/* =========================================================
   PATCH: Header alignment, footer credit, partial status
   ========================================================= */

/* Keep the National Critical Minerals List badge close to the right edge */
.header-actions {
    align-self: stretch;
    align-items: flex-end !important;
    text-align: right;
}

.survey-badge {
    align-self: flex-end !important;
    text-align: right;
}

.language-inline {
    justify-content: flex-end !important;
}

/* Credit moved to footer */
.footer-developed-by {
    display: inline-block;
    margin-top: 6px;
    color: #57534e;
    font-weight: 700;
}

/* Top progress: short incomplete marker */
.survey-progress-missing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 28px;
    padding: 5px 10px 5px 30px;
    border-radius: 999px;
    border: 1px solid #fcd34d;
    background-color: #fffbeb;
    background-image: url("https://cdn-icons-png.flaticon.com/512/1828/1828843.png");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px 14px;
    color: #7c2d12;
    font-size: 13px;
    font-weight: 900;
}

.survey-progress-missing[hidden] {
    display: none !important;
}

/* Completed status: green only on the left mineral column */
.survey-table tbody tr.mineral-complete td {
    background: #ffffff !important;
    border-top-color: #dbe4f0 !important;
    border-bottom-color: #dbe4f0 !important;
}

.survey-table tbody tr.mineral-complete td:first-child {
    border-left-color: var(--survey-success-border) !important;
}

.survey-table tbody tr.mineral-complete td:last-child {
    border-right-color: #dbe4f0 !important;
}

.survey-table tbody tr.mineral-complete .mineral-name {
    background: #dcfce7 !important;
    border-color: var(--survey-success-border) !important;
}

.survey-table tbody tr.mineral-complete .radio-list label:has(input:checked) {
    background: #f5f5f4 !important;
    border-color: #a8a29e !important;
    box-shadow: none !important;
}

/* Incomplete status: subtle amber marker only for rows already started */
.survey-table tbody tr.mineral-incomplete .mineral-name {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
}

.mineral-incomplete-badge,
.mineral-complete-badge {
    display: none;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.survey-table tbody tr.mineral-complete .mineral-complete-badge {
    display: inline-flex;
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #86efac;
}

.survey-table tbody tr.mineral-incomplete .mineral-incomplete-badge {
    display: inline-flex;
    background: #fffbeb;
    color: #7c2d12;
    border: 1px solid #fcd34d;
}

.status-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.status-icon-complete {
    background-image: url("https://cdn-icons-png.flaticon.com/512/845/845646.png");
}

.status-icon-incomplete {
    background-image: url("https://cdn-icons-png.flaticon.com/512/1828/1828843.png");
}

/* Mark individual unanswered criteria only after a mineral row has been started */
.survey-table td.question-missing {
    background: #fffbeb !important;
    border-top-color: #fcd34d !important;
    border-bottom-color: #fcd34d !important;
}

.survey-table td.question-missing::after {
    content: attr(data-missing);
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-top: 10px;
    padding: 4px 9px 4px 30px;
    border-radius: 999px;
    border: 1px solid #fcd34d;
    background-color: #fef3c7;
    background-image: url("https://cdn-icons-png.flaticon.com/512/1828/1828843.png");
    background-repeat: no-repeat;
    background-position: 9px center;
    background-size: 14px 14px;
    color: #7c2d12;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

@media (max-width: 767px) {
    .header-actions {
        align-items: flex-end !important;
        text-align: right;
    }

    .language-inline {
        justify-content: flex-end !important;
    }

    .survey-progress-missing {
        align-self: flex-start;
        border-radius: 12px;
    }

    .survey-table tbody tr.mineral-complete {
        background: #ffffff !important;
        border-color: #e2e8f0 !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
    }

    .survey-table tbody tr.mineral-complete td {
        background: #ffffff !important;
        border-bottom-color: #e2e8f0 !important;
    }

    .survey-table tbody tr.mineral-complete .mineral-name {
        background: #dcfce7 !important;
        border-bottom-color: #86efac !important;
    }

    .survey-table tbody tr.mineral-incomplete .mineral-name {
        background: #fffbeb !important;
        border-bottom-color: #fcd34d !important;
    }
}

/* Contact and autosave refinement patch */
.autosave-box {
    display: grid !important;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    padding: 14px 16px !important;
}

.autosave-box strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.autosave-box strong::before {
    content: "";
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    background-image: url("https://cdn-icons-png.flaticon.com/512/190/190411.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: grayscale(1) contrast(0.9);
    opacity: 0.82;
}

.autosave-box #autosaveStatus {
    display: block;
    min-width: 0;
    color: #365314;
}

.clear-draft-btn {
    justify-self: end;
    margin-top: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.clear-draft-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background-image: url("https://cdn-icons-png.flaticon.com/512/1214/1214428.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.survey-contact-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 16px;
    padding: 15px 16px;
    border: 1px solid #d6d3d1;
    border-radius: 16px;
    background: #fafaf9;
    color: var(--survey-text-soft, #44403c);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
}

.survey-contact-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 14px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    background-image: url("https://cdn-icons-png.flaticon.com/512/3059/3059502.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 21px 21px;
    filter: grayscale(0.15);
}

.survey-contact-content {
    min-width: 0;
}

.survey-contact-content strong {
    display: block;
    margin: 0 0 4px;
    color: var(--survey-text-main, #1c1917);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 900;
}

.survey-contact-content p {
    margin: 0 0 10px;
    color: var(--survey-text-soft, #44403c);
    font-size: 15.5px;
    line-height: 1.65;
}

.survey-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 38px;
    padding: 8px 13px 8px 38px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    background-color: #f0fdf4;
    background-image: url("https://cdn-icons-png.flaticon.com/512/3135/3135715.png");
    background-repeat: no-repeat;
    background-position: 13px center;
    background-size: 16px 16px;
    color: #14532d !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
}

.survey-contact-link:hover,
.survey-contact-link:focus {
    background-color: #dcfce7;
    border-color: #86efac;
    text-decoration: none;
}

@media (max-width: 767px) {
    .autosave-box {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .autosave-box strong {
        white-space: normal;
    }

    .clear-draft-btn {
        justify-self: stretch;
        width: 100%;
    }

    .survey-contact-card {
        gap: 12px;
        padding: 14px;
    }

    .survey-contact-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        background-size: 19px 19px;
    }

    .survey-contact-content p {
        font-size: 15px;
    }
}

/* =========================================================
   PATCH: Clickable incomplete progress, right contact button,
   and cleaner JMG logo display
   ========================================================= */

/* JMG logo should sit cleanly without a white card/box */
.brand-logo.brand-logo-jmg {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* The incomplete notice in the top bar is now a clickable jump button */
.survey-progress-missing {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #fcd34d;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.survey-progress-missing:hover,
.survey-progress-missing:focus-visible {
    background-color: #fef3c7;
    box-shadow: 0 6px 14px rgba(120, 53, 15, 0.14);
    transform: translateY(-1px);
    outline: none;
}

.survey-progress-missing:active {
    transform: translateY(0);
}

/* Short status badges */
.mineral-unfilled-badge {
    display: none;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    vertical-align: middle;
    background: #f5f5f4;
    color: #57534e;
    border: 1px solid #d6d3d1;
}

.status-icon-unfilled {
    background-image: url("https://cdn-icons-png.flaticon.com/512/565/565547.png");
}

/* Unfilled rows are only visibly tagged after the jump button has brought the user there */
.survey-table tbody tr.mineral-unfilled.survey-jump-visited .mineral-unfilled-badge {
    display: inline-flex;
}

.survey-table tbody tr.mineral-unfilled.survey-jump-target .mineral-name {
    background: #f5f5f4 !important;
    border-color: #d6d3d1 !important;
}

/* Jump focus effect for the current incomplete / unfilled mineral */
.survey-table tbody tr.survey-jump-target .mineral-name {
    outline: 3px solid rgba(245, 158, 11, 0.45);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(254, 243, 199, 0.85);
}

.survey-table tbody tr.survey-jump-target td.question-missing {
    outline: 3px solid rgba(245, 158, 11, 0.45);
    outline-offset: 3px;
}

/* Contact card: keep the digital staff card button on the right side */
.survey-contact-card {
    align-items: center;
}

.survey-contact-content {
    flex: 1 1 auto;
}

.survey-contact-content p {
    margin-bottom: 0 !important;
}

.survey-contact-link {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    text-align: center;
}

@media (max-width: 767px) {
    .survey-contact-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .survey-contact-content {
        flex: 1 1 calc(100% - 48px);
    }

    .survey-contact-link {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .survey-progress-missing {
        width: 100%;
        justify-content: center;
    }
}


/* =========================================================
   PATCH: Text-only incomplete notices and locked submit button
   ========================================================= */

/* Remove X / warning icons from incomplete and unfilled notices so they read as guidance, not errors. */
.survey-progress-missing {
    padding-left: 12px !important;
    background-image: none !important;
}

.survey-table td.question-missing::after {
    padding-left: 10px !important;
    background-image: none !important;
}

.mineral-incomplete-badge .status-icon,
.mineral-unfilled-badge .status-icon {
    display: none !important;
}

/* Keep the submit button visible, but make it clearly unavailable until all mineral assessments are complete. */
.submit-btn:disabled,
.submit-btn[aria-disabled="true"] {
    background: #d6d3d1 !important;
    color: #78716c !important;
    border-color: #d6d3d1 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.82;
    transform: none !important;
}

.submit-btn:disabled:hover,
.submit-btn[aria-disabled="true"]:hover,
.submit-btn:disabled:focus-visible,
.submit-btn[aria-disabled="true"]:focus-visible {
    background: #d6d3d1 !important;
    color: #78716c !important;
    box-shadow: none !important;
    transform: none !important;
}

.submit-btn:not(:disabled) {
    opacity: 1;
}

/* =========================================================
   FINAL PATCH: Mobile refinement, text-only status, and robust submit lock
   ========================================================= */

/* Progress notice: text only, no X/warning icon. */
.survey-progress-missing,
.survey-progress-missing:hover,
.survey-progress-missing:focus-visible,
.survey-progress-missing:active {
    background-image: none !important;
}

.survey-progress-missing::before,
.survey-progress-missing::after,
.mineral-incomplete-badge .status-icon,
.mineral-unfilled-badge .status-icon,
.status-icon-incomplete,
.status-icon-unfilled {
    content: none !important;
    display: none !important;
    background-image: none !important;
}

.survey-table td.question-missing::after {
    background-image: none !important;
    padding-left: 10px !important;
}

/* Stronger locked state for Submit button. Works even if browser restores form state. */
.submit-bar.submit-locked .submit-btn,
.submit-bar .submit-btn.is-locked,
.submit-bar .submit-btn:disabled,
.submit-bar .submit-btn[disabled],
.submit-bar .submit-btn[aria-disabled="true"] {
    background: #d6d3d1 !important;
    background-image: none !important;
    color: #57534e !important;
    border-color: #d6d3d1 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.88 !important;
    transform: none !important;
    filter: grayscale(0.15) !important;
}

.submit-bar.submit-locked .submit-btn:hover,
.submit-bar .submit-btn.is-locked:hover,
.submit-bar .submit-btn:disabled:hover,
.submit-bar .submit-btn[disabled]:hover,
.submit-bar .submit-btn[aria-disabled="true"]:hover {
    background: #d6d3d1 !important;
    background-image: none !important;
    color: #57534e !important;
    box-shadow: none !important;
    transform: none !important;
}

.submit-bar.submit-ready .submit-btn:not(:disabled),
.submit-bar .submit-btn:not(:disabled):not(.is-locked) {
    background: linear-gradient(135deg, #15803d, #166534) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.25) !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Cleaner mobile progress bar. The incomplete label remains clickable and jumps to the next incomplete mineral. */
@media (max-width: 767px) {
    .survey-progress-top {
        padding: 8px 12px 9px !important;
    }

    .survey-progress-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "text missing"
            "bar bar";
        align-items: center;
        gap: 7px 10px !important;
    }

    #surveyProgressText {
        grid-area: text;
        min-width: 0 !important;
        font-size: 14px !important;
        line-height: 1.2;
    }

    .survey-progress-track {
        grid-area: bar;
        width: 100%;
        height: 8px !important;
    }

    .survey-progress-missing {
        grid-area: missing;
        width: auto !important;
        min-height: 28px !important;
        justify-content: center !important;
        align-self: center !important;
        padding: 4px 11px !important;
        border-radius: 999px !important;
        font-size: 12.8px !important;
        line-height: 1.15;
        color: #7c2d12 !important;
        background-color: #fffbeb !important;
        border-color: #facc15 !important;
    }
}

/* Mobile header: reduce crowding while keeping readable text for older users. */
@media (max-width: 767px) {
    .container {
        padding: 12px 12px 18px !important;
    }

    .official-strip {
        padding: 10px 14px !important;
        border-radius: 14px 14px 0 0 !important;
        font-size: 11.8px !important;
        line-height: 1.32 !important;
        gap: 3px !important;
    }

    .header-card.official-header {
        padding: 16px !important;
        margin-bottom: 14px !important;
        border-radius: 0 0 16px 16px !important;
    }

    .brand-row {
        gap: 12px !important;
        margin-bottom: 16px !important;
        padding-bottom: 14px !important;
    }

    .brand-logos {
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .brand-logo,
    .brand-logo.brand-logo-jmg {
        width: 50px !important;
        height: 50px !important;
        flex: 0 0 50px !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .agency-name {
        font-size: 17px !important;
        line-height: 1.25 !important;
        letter-spacing: -0.01em;
    }

    .agency-subtitle {
        margin-top: 4px !important;
        font-size: 15px !important;
        line-height: 1.36 !important;
    }

    .header-actions {
        width: 100% !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 7px !important;
    }

    .survey-badge {
        align-self: flex-start !important;
        max-width: 100% !important;
        width: auto !important;
        padding: 8px 12px !important;
        border-radius: 999px !important;
        font-size: 11.6px !important;
        line-height: 1.25 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .language-inline {
        width: auto !important;
        display: inline-flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 7px !important;
        padding-top: 0 !important;
        font-size: 14px !important;
    }

    .language-inline .language-label,
    .language-inline .language-separator,
    .language-inline .lang-btn {
        flex: 0 0 auto !important;
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    .language-inline .lang-btn {
        padding: 0 2px !important;
    }

    .eyebrow {
        font-size: 12.8px !important;
        line-height: 1.25 !important;
        margin-bottom: 8px !important;
    }

    .header-card h1,
    .title-block h1 {
        font-size: 22px !important;
        line-height: 1.24 !important;
        letter-spacing: -0.02em !important;
        margin-bottom: 8px !important;
    }

    .institution-line {
        font-size: 16px !important;
        line-height: 1.42 !important;
        margin: 8px 0 12px !important;
    }

    .header-card p,
    .title-block p {
        font-size: 15.5px !important;
        line-height: 1.58 !important;
        margin-top: 0 !important;
        margin-bottom: 14px !important;
    }

    .official-note {
        padding: 14px 42px 14px 14px !important;
        font-size: 15px !important;
        line-height: 1.55 !important;
    }

    .official-note-icon {
        width: 21px !important;
        height: 21px !important;
        right: 13px !important;
        top: 13px !important;
    }
}

/* Mobile contact card: keep the digital staff card button neat on the right. */
@media (max-width: 767px) {
    .survey-contact-card {
        display: flex !important;
        align-items: flex-start !important;
        gap: 11px !important;
        padding: 14px !important;
    }

    .survey-contact-content {
        flex: 1 1 calc(100% - 46px) !important;
    }

    .survey-contact-content strong {
        font-size: 15.8px !important;
    }

    .survey-contact-content p {
        font-size: 14.8px !important;
        line-height: 1.55 !important;
    }

    .survey-contact-link {
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        justify-content: center !important;
        align-self: flex-end !important;
        min-height: 40px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        font-size: 13.5px !important;
    }
}

/* Mobile survey cards and footer: compact enough for phones, still comfortable to read. */
@media (max-width: 767px) {
    .mineral-name {
        padding: 18px 18px !important;
    }

    .mineral-name strong {
        font-size: 24px !important;
        line-height: 1.2 !important;
    }

    .survey-table td:not(.mineral-name)::before,
    .survey-table td::before {
        font-size: 12px !important;
        line-height: 1.25 !important;
        margin-bottom: 10px !important;
    }

    .radio-list label {
        min-height: 50px !important;
        padding: 12px 13px !important;
        border-radius: 12px !important;
    }

    .radio-list span {
        font-size: 15.8px !important;
        line-height: 1.3 !important;
    }

    .submit-bar {
        padding: 14px !important;
        border-radius: 22px 22px 0 0 !important;
    }

    .submit-inner .help-text {
        font-size: 15px !important;
        line-height: 1.55 !important;
    }

    .submit-btn {
        width: 100% !important;
        min-height: 56px !important;
        font-size: 18px !important;
        border-radius: 16px !important;
    }

    .footer-note.official-footer {
        margin: 22px 0 16px !important;
        font-size: 15px !important;
        line-height: 1.55 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .footer-developed-by {
        margin-top: 8px !important;
        font-size: 14.5px !important;
        line-height: 1.55 !important;
    }

    .footer-visitor-counter {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        border-radius: 16px !important;
        font-size: 13.5px !important;
    }
}

/* =========================================================
   FINAL HOTFIX: Mobile radio width and horizontal overflow
   Purpose: prevent survey option rows from stretching beyond
   the phone screen and keep radio circles visible on iPhone.
   ========================================================= */

@media (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        width: 100%;
        overflow-x: hidden !important;
    }

    .container,
    .header-card,
    .form-card,
    .table-card,
    .table-responsive,
    .submit-bar,
    .footer-note {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .container {
        width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden !important;
    }

    .table-card,
    .table-responsive {
        width: 100% !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .survey-table,
    .survey-table tbody,
    .survey-table tr,
    .survey-table td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .survey-table {
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        margin: 0 !important;
    }

    .survey-table thead {
        display: none !important;
    }

    .survey-table tr {
        margin: 0 0 14px !important;
        overflow: hidden !important;
        border-radius: 18px !important;
    }

    .survey-table td,
    .survey-table td:first-child,
    .survey-table td:last-child {
        border-left: 0 !important;
        border-right: 0 !important;
        border-radius: 0 !important;
    }

    .mineral-name {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
    }

    .radio-list,
    .radio-list.compact {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 10px !important;
    }

    .radio-list label,
    .radio-list.compact label {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 52px !important;
        margin: 0 !important;
        padding: 12px 14px !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .radio-list input[type="radio"],
    .radio-list.compact input[type="radio"] {
        display: block !important;
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        flex: 0 0 20px !important;
        margin: 0 10px 0 0 !important;
        padding: 0 !important;
        border-radius: 50% !important;
        -webkit-appearance: radio !important;
        appearance: auto !important;
    }

    .radio-list span,
    .radio-list.compact span {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
        font-size: 16px !important;
        line-height: 1.32 !important;
    }

    .submit-bar {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .survey-progress-top,
    .survey-progress-inner {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .survey-progress-missing {
        max-width: 54vw !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media (max-width: 390px) {
    .survey-progress-missing {
        max-width: 50vw !important;
        font-size: 12.2px !important;
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    .radio-list label,
    .radio-list.compact label {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* =========================================================
   HOTFIX: Floating top progress bar and floating submit bar
   Purpose: restore sticky/floating behaviour on mobile browsers,
   especially iPhone Safari, after the mobile width hotfix.
   ========================================================= */

.survey-progress-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important;
    width: 100% !important;
    will-change: transform;
}

.submit-bar {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 4800 !important;
    will-change: transform;
}

@media (min-width: 768px) {
    .submit-bar {
        bottom: 18px !important;
    }
}

@media (max-width: 767px) {
    body:has(.survey-progress-top) {
        padding-top: 104px !important;
        padding-bottom: 172px !important;
    }

    .survey-progress-top {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 8px 12px 9px !important;
        border-radius: 0 !important;
        background: rgba(250, 250, 249, 0.98) !important;
        border-bottom: 1px solid #d6d3d1 !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10) !important;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .survey-progress-inner {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .submit-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 20px 20px 0 0 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.18) !important;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .submit-inner {
        width: 100% !important;
        max-width: 1280px !important;
        margin: 0 auto !important;
        gap: 10px !important;
    }

    .submit-bar .help-text {
        margin: 0 !important;
        font-size: 14.5px !important;
        line-height: 1.45 !important;
    }

    .submit-bar .submit-btn {
        width: 100% !important;
        min-height: 56px !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 390px) {
    body:has(.survey-progress-top) {
        padding-top: 100px !important;
        padding-bottom: 166px !important;
    }

    .submit-bar .help-text {
        font-size: 13.5px !important;
    }
}
