:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f9fafb;

    --text: #000000;
    --text-soft: #676361;
    --muted: #676361;

    --line: #ddd6cf;
    --line-strong: #c8beb6;

    --brand: #000000;
    --brand-stone: #676361;
    --brand-red: #A51F15;
    --brand-green: #899E2A;
    --brand-blue: #669DC7;
    --brand-contrast: #ffffff;

    --yes: #899E2A;
    --yes-bg: #f2f7e7;

    --no: #A51F15;
    --no-bg: #f9ecea;

    --unsure: #669DC7;
    --unsure-bg: #edf5fb;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.08);

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-pill: 999px;

    --max-width: 1240px;

    --font-title: "Moderat", Arial, sans-serif;
    --font-heading: "Blacker Pro Display", Georgia, serif;
    --font-body: "Arialle", Arial, sans-serif;
}

h1, h2, h3, h4 {
    text-transform: capitalize !important;  /* Force capitalization */
}

@font-face {
    font-family: "Moderat", sans-serif;
    src: url("/fonts/moderat-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Blacker Pro Display", serif;
    src: url("/fonts/Blacker-Display-Regular-trial.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Arialle", Arial, sans-serif;
    src: url("/fonts/ARIAL.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Arialle", Arial, sans-serif;
    src: url("/fonts/ARIALBD.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-red);
    text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

a:hover {
    color: var(--brand);
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h1 {
    font-family: var(--font-title);
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 700;
}

h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    text-transform: lowercase;
}

h2 {
    font-size: 1.7rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.05rem;
}

p,
li,
td,
th,
label,
input,
select,
textarea,
button,
small {
    font-family: var(--font-body);
}

p {
    margin: 0 0 14px;
    color: var(--text-soft);
}

small {
    color: var(--muted);
}

strong {
    color: var(--text);
}

ul {
    margin: 0;
    padding-left: 1.2rem;
}

li {
    margin-bottom: 8px;
}

/* Layout */
.container,
.report-summary-page {
    width: min(var(--max-width), calc(100% - 32px));
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.report-summary-page {
    margin: 36px auto 0;
    flex: 1 0 auto;
}

.report-page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.screen-only {
    display: block;
}

.text-muted {
    color: var(--muted);
}

.centered {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.is-hidden {
    display: none !important;
}

/* Header / nav */
.topnav,
.navbar,
nav {
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.topnav-inner,
.nav-inner,
.nav-wrap {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topnav-inner {
    min-height: 78px;
}

.brand,
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand a,
.nav-brand a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
}

.brand img,
.nav-brand img,
.logo,
.tmec-logo {
    height: 44px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.brand-copy {
    min-width: 0;
}

.brand-name,
.nav-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.05;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 700;
    text-transform: none; /* FIX */
}

.nav-links,
.menu,
.topnav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a,
.menu-item,
.topnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a:hover,
.menu-item:hover,
.topnav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-links a.active,
.menu-item.active,
.topnav a.active {
    background: var(--brand-red);
    color: #ffffff;
    border-color: var(--brand-red);
}

.nav-subtitle {
    text-transform: capitalize;
}

/* Progress */
.topnav-progress {
    padding-top: 0;
    padding-bottom: 18px;
}

.progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.84);  /* Ensures the text is white */
    font-size: 0.88rem;
    font-weight: 700;
}

.progress-meta strong {
    color: #ffffff;  /* Ensure the word 'Progress' is white */
}

.progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar,
#progBar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-green) 100%);
    border-radius: var(--radius-pill);
    transition: width 0.22s ease;
}

/* Generic cards and boxes */
.card,
.box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card {
    padding: 28px;
}

.box {
    padding: 22px 24px;
    margin: 0 0 20px;
}

.card h3,
.box h2,
.box h3 {
    margin-bottom: 8px;
}

.section-title {
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 30px 0 24px;
}

/* Questionnaire card */
.container .card {
    max-width: 100%;
}

#cat {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: #000000;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

#qidLabel {
    color: var(--muted);
    font-weight: 700;
}

#text {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.3vw, 2rem);
    line-height: 1.18;
    color: var(--text);
    margin-top: 16px;
    margin-bottom: 0;
    max-width: 780px;
    text-transform: lowercase;
}

/* Tool explainer section */
.tool-explainer {
    margin-bottom: 22px;
}

.tool-explainer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tool-explainer-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.tool-explainer-card h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

.tool-explainer-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

@media (max-width: 900px) {
    .tool-explainer-grid {
        grid-template-columns: 1fr;
    }
}

/* Examples / legislation panels */
.examples-container {
    max-width: 2000px;
    padding: 0 32px;
}

.examples-table td {
    white-space: pre-line;
}

.examples-table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.examples-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Table headers styling */
.examples-table thead th {
    background: var(--surface-soft);
    color: var(--text);
    text-align: left;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;  /* Ensure proper capitalization */
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
}

/* Table body cells */
.examples-table tbody td {
    padding: 16px;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    line-height: 1.55;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.examples-table tbody tr:last-child td {
    border-bottom: none;
}

.examples-table tbody tr:hover {
    background: #faf8f5;
}

/* Column widths */
.examples-table th:nth-child(1),
.examples-table td:nth-child(1) {
    width: 24%;
}

.examples-table th:nth-child(2),
.examples-table td:nth-child(2) {
    width: 22%;
}

.examples-table th:nth-child(3),
.examples-table td:nth-child(3) {
    width: 18%;
}

.examples-table th:nth-child(4),
.examples-table td:nth-child(4) {
    width: 22%;
}

.examples-table th:nth-child(5),
.examples-table td:nth-child(5) {
    width: 14%;
}

/* Examples title */
#examplesWrap > div:first-child {
    font-weight: 700;
}

/* Legislation title + content */
#legislationWrap {
    font-style: italic;
}

#legislationWrap {
    margin-top: 16px;
}

/* Actions / buttons */
#actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action {
    appearance: none;
    border: 1px solid var(--brand-red);
    background: var(--brand-red);
    color: #ffffff;
    min-height: 52px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.96rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
    box-shadow: none;
}

.action:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background: #8f1b13;  /* Slightly darker red */
    border-color: #8f1b13;
    color: #ffffff;
}

.action:active {
    transform: translateY(0);
}

/* Secondary action button styles */
.action.secondary {
    background: #ffffff;
    color: var(--text);
    border-color: var(--line-strong);
}

.action.secondary:hover {
    background: var(--surface-soft);
    border-color: var(--brand-stone);
    color: var(--text);
}

/* Icon styling */
.action-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* YES button styles */
.action-yes {
    border-color: var(--brand-green);
    background: #ffffff;
    color: var(--text);
}

.action-yes .action-icon {
    background: var(--yes-bg);
    color: var(--yes);
}

/* Hover effect for YES button */
.action-yes:hover {
    background: var(--yes-bg);  /* Pale green background on hover */
    border-color: var(--brand-green);
    color: var(--brand-green);
}

/* NO button styles */
.action-no {
    border-color: var(--brand-red);  /* Red border */
    background: #ffffff;             /* White background */
    color: #000000;                  /* Black text for the "No" button */
}

.action-no:hover {
    background: #f8d7da;  /* Pale red background on hover */
    border-color: var(--brand-red);
    color: var(--brand-red); /* Red text on hover */
}

/* NO button icon circle (N) */
.action-no .action-icon {
    background: rgba(165, 31, 21, 0.4);  /* Faded red circle for the "N" icon */
    color: var(--brand-red);  /* Red text (the "N") inside the red circle */
}

/* Hover effect for the "N" icon circle */
.action-no:hover .action-icon {
    background: rgba(143, 27, 19, 0.6);  /* Slightly darker faded red on hover */
}

/* UNSURE button styles */
.action-unsure {
    border-color: var(--brand-blue);
    background: #ffffff;
    color: var(--text);
}

.action-unsure .action-icon {
    background: var(--unsure-bg);
    color: var(--brand-blue);
}

/* Hover effect for UNSURE button */
.action-unsure:hover {
    background: var(--unsure-bg);  /* Pale blue background on hover */
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

/* When a button is selected */
.action.is-selected {
    border-color: var(--brand);
    background: #000000;
    color: #ffffff;
}

.action.is-selected .action-icon {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.action.is-loading {
    opacity: 0.82;
    pointer-events: none;
}

.actions-busy .action:not(.is-selected) {
    opacity: 0.55;
    pointer-events: none;
}

/* Pre-questionnaire reminders */
.pre-banner,
.pre-attention {
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.pre-banner {
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.pre-attention {
    background: #fff1f0;
    border: 1px solid #d93025;
    border-left: 5px solid #d93025;
}

.pre-banner-title,
.pre-attention-title {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.pre-banner-title {
    color: var(--text);
}

.pre-attention-title {
    color: #d93025;
}

.pre-banner-items,
.pre-attention-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pre-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.pre-banner .pre-pill {
    color: var(--text-soft);
    border-color: var(--line);
}

.pre-attention .pre-pill {
    background: #ffffff;
    color: #8b1e1e;
    border-color: #f0b3ad;
}

/* Collapsible header */
.pre-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.pre-banner-icon {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-soft);
}

.pre-banner-items {
    transition: all 0.25s ease;
    overflow: hidden;
}

.pre-banner-items.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
}

.pre-banner-items:not(.is-collapsed) {
    max-height: 500px;
    opacity: 1;
    margin-top: 10px;
}

/* Icon (+ / -) */
.pre-banner-icon {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-soft);
}

/* Smooth collapse */
.pre-banner-items {
    transition: all 0.25s ease;
    overflow: hidden;
}

/* Collapsed state */
.pre-banner-items.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
}

/* Expanded state */
.pre-banner-items:not(.is-collapsed) {
    max-height: 500px;
    opacity: 1;
    margin-top: 10px;
}
/* Modal */
.pre-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.pre-modal.is-open {
    display: flex;
}

.pre-modal-card {
    width: min(520px, 100%);
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}

.pre-modal-card h3 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.pre-modal-card p {
    margin-bottom: 18px;
}

.pre-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Footer --------------------------------------------------------------------------------------------*/
.footer {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 10px auto 30px;
    padding-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
    flex-shrink: 0;
}

.report-footer {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 22px auto 24px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
    flex-shrink: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead th {
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    padding: 15px 12px;
    border-bottom: 1px solid var(--line);
}

tbody td {
    padding: 15px 12px;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #faf8f5;
}

/* Report summary */
.report-summary-page .box ul {
    margin: 0;
}

.report-summary-page .box li {
    color: var(--text-soft);
}

.report-summary-page h2,
.report-summary-page h3 {
    margin-top: 24px;
}

.report-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.report-summary-topbox {
    margin-bottom: 22px;
}

.report-summary-topbox-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.report-overview-box {
    margin-top: 0;
    margin-bottom: 24px;
}

.report-overview-box-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.report-overview-copy {
    flex: 1 1 320px;
}

.report-overview-chart {
    flex: 1 1 720px;
}

.section-compliance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px 20px;
}

.section-compliance-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-compliance-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text);
}

.section-compliance-track {
    width: 100%;
    height: 10px;
    background: var(--surface-soft-2);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.section-compliance-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-green) 100%);
    border-radius: var(--radius-pill);
}

.report-unanswered {
    align-self: flex-start;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: none;
    padding: 18px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--text);
    font-family: var(--font-title);
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 1;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-yes {
    background: var(--yes-bg);
    color: var(--yes);
    border-color: #d9e8b1;
}

.badge-no {
    background: var(--no-bg);
    color: var(--no);
    border-color: #e8c4bf;
}

.badge-unsure {
    background: var(--unsure-bg);
    color: var(--brand-blue);
    border-color: #c6def0;
}

.badge-neutral {
    background: var(--surface-soft);
    color: var(--text-soft);
    border-color: var(--line);
}

/* Forms */
input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(102, 157, 199, 0.14);
}

/* Print / PDF */
@media print {
    .screen-only,
    .topnav,
    .navbar,
    nav {
        display: none !important;
    }

    @page {
        margin: 20mm 18mm 32mm 18mm;
    }

    body {
        display: block;
        min-height: auto;
        background: #ffffff;
        margin: 0;
    }

    .report-page-shell {
        min-height: auto;
        display: block;
    }

    .report-summary-page {
        width: auto;
        margin: 0;
        padding-bottom: 110px; /* reserve space for footer */
    }

    .report-footer {
        position: fixed;
        left: 24px;
        right: 24px;
        bottom: 0;
        width: auto;
        margin: 0;
        padding-top: 10px;
        padding-bottom: 6px;
        border-top: 1px solid #d1d5db;
        background: #ffffff;
        font-size: 0.8rem;
        line-height: 1.35;
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .section-compliance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container,
    .report-summary-page,
    .topnav-inner,
    .nav-inner,
    .nav-wrap,
    .footer,
    .report-footer {
        width: min(100%, calc(100% - 20px));
    }

    .topnav-inner {
        min-height: auto;
        padding: 16px 0;
    }

    .container .card {
        padding: 22px;
    }

    #text {
        font-size: 1.35rem;
    }

    #actions {
        flex-direction: column;
    }

    .action {
        width: 100%;
        justify-content: flex-start;
        padding: 0 16px;
    }

    thead {
        display: none;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tbody tr {
        border-bottom: 1px solid var(--line);
        padding: 10px 0;
    }

    tbody td {
        border-bottom: none;
        padding: 8px 0;
    }
}

@media (max-width: 680px) {
    .brand a,
    .nav-brand a {
        align-items: flex-start;
    }

    .topnav-inner,
    .nav-inner,
    .nav-wrap {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }

    .nav-links,
    .menu,
    .topnav-links {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 1.8rem;
    }

    .nav-links a,
    .menu-item,
    .topnav a {
        min-height: 38px;
        padding: 0 12px;
    }

    .pre-modal-card {
        padding: 22px;
        border-radius: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Pre-questionnaire reminders container */
.preq-reminders {
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* Pre-questionnaire reminders header */
.preq-reminders-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    padding-bottom: 10px;
}

/* Button in the header to toggle visibility */
.preq-reminders-header button {
    background: var(--secondary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

/* Content area for pre-questionnaire reminders */
.preq-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    opacity: 1;  /* Make sure content is visible when expanded */
    transition: opacity 0.3s ease-in-out; /* Smooth transition */
}

/* Reminder items */
.preq-pill {
    background: var(--surface);
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text);
}

/* Hide content when collapsed */
.preq-content.collapsed {
    display: none;
}

/* Styling for the website footer ---------------------------------- */
.website-footer {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    width: 100%;
    margin-top: auto; /* pushes footer to bottom on short pages */
    padding: 8px 0;
    box-sizing: border-box;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-copy {
    text-align: right;
    width: 100%;
    padding-right: 20px;
}

.footer-name {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.footer-subtitle {
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Prensa logo */
.prensa-logo {
    width: 90px;
    height: auto;
    margin-top: 6px;
}

/* Copyright */
.footer-bottom {
    text-align: right;
    margin-top: 4px;
    padding-right: 20px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.7;
}