/* OUP Brand Colors */
:root {
    --oxford-blue: #011e41;
    --electric-blue: #0043e0;
    --neutral-blue: #cad7d8;
    --madrid-orange: #fd5821;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    
    /* Fonts */
    --font-display: 'DM Serif Display', serif;
    --font-body: 'Open Sans', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Container */
    --container-max-width: 1200px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* AIDEV-NOTE: 0.3.2 — clip horizontal overflow at the root on mobile so wide
   visualisation columns can't widen the layout viewport. If they do,
   position:fixed children (the access-request modal) inherit that widened
   width and spill past the visible area. `clip` doesn't establish a
   containing block (so position:fixed stays viewport-relative); `hidden` is
   the fallback for older browsers. */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        overflow-x: clip;
        max-width: 100vw;
    }
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

a {
    color: var(--electric-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--oxford-blue);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--electric-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--oxford-blue);
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--oxford-blue);
    border-color: var(--oxford-blue);
}

.btn-secondary:hover {
    background-color: var(--oxford-blue);
    color: var(--white);
}

/* All hero/CTA pills share fixed min-width + min-height so the 3-button
   row reads as a single, balanced control group regardless of label length. */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    min-width: 220px;
    min-height: 44px;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    line-height: 1;
    border: 1.5px solid transparent;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(1, 30, 65, 0.08), 0 1px 3px rgba(1, 30, 65, 0.06);
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 30, 65, 0.18), 0 2px 4px rgba(1, 30, 65, 0.10);
}

.btn-pill .btn-arrow,
.btn-pill .btn-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Lucide SVG sits on the baseline by default — nudge it visually centered. */
.btn-pill .btn-icon {
    flex-shrink: 0;
    transform: translateY(-1px);
}

.btn-pill:hover .btn-arrow,
.btn-pill:hover .btn-icon {
    transform: translate(2px, -2px);
}

.btn-pill-primary {
    background-color: var(--electric-blue);
    color: var(--white);
    border-color: var(--electric-blue);
}

.btn-pill-primary:hover {
    background-color: var(--oxford-blue);
    border-color: var(--oxford-blue);
    color: var(--white);
}

.btn-pill-secondary {
    background-color: var(--white);
    color: var(--oxford-blue);
    border-color: rgba(1, 30, 65, 0.20);
}

.btn-pill-secondary:hover {
    background-color: var(--oxford-blue);
    color: var(--white);
    border-color: var(--oxford-blue);
}

.btn-pill[aria-disabled="true"] {
    cursor: not-allowed;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin: var(--spacing-lg) 0;
}

/* Header */
.site-header {
    background-color: var(--oxford-blue);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--white);
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: 0.3s;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
}

/* Legacy hero section styles - keeping for any remaining usage */
.hero-section {
    background: linear-gradient(135deg, var(--oxford-blue) 0%, var(--electric-blue) 100%);
    color: var(--white) !important;
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.hero-section * {
    color: var(--white) !important;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section p {
    color: var(--white) !important;
}

.hero-title {
    color: var(--white) !important;
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    font-weight: 400;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: var(--spacing-sm);
    color: var(--white) !important;
}

.hero-description {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--white) !important;
}

/* Sections */
section {
    padding: var(--spacing-xxl) 0;
}

.section-header {
    text-align: left;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    margin-bottom: var(--spacing-md);
}

.section-header p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: none;
    margin: 0;
}

/* Hero and CTA sections should remain centered */
.page-header,
.cta-section .section-header,
.cta-content {
    text-align: center;
}

.page-header p,
.cta-content p {
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts */
.overview-grid,
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.overview-item,
.feature-item {
    text-align: center;
    padding: var(--spacing-lg);
}

.overview-item h3,
.feature-item h3 {
    color: var(--electric-blue);
    margin-bottom: var(--spacing-md);
}

/* CTA Section */
.cta-section {
    background-color: var(--neutral-blue);
    text-align: center;
}

.cta-content h2 {
    margin-bottom: var(--spacing-md);
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-light);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.btn-wrapper {
    position: relative;
    display: inline-block;
}

.coming-soon-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--madrid-orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* About Page */
.page-header {
    background-color: var(--white);
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.page-header h1 {
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-light);
}

.team-section {
    background-color: var(--white);
}

/* Contact Section */
.contact-section {
    background-color: var(--white);
    padding: var(--spacing-xxl) 0;
}

.contact-section h2 {
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.contact-content p:first-child {
    margin-bottom: var(--spacing-lg);
    font-size: 1.1rem;
}

.contact-subsection {
    margin-bottom: var(--spacing-lg);
}

.contact-subsection h3 {
    margin-bottom: var(--spacing-sm);
}


/* 2-col, 3-row grid for team members; last tile intentionally blank */
.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
}

.team-member {
    background-color: var(--white);
    border-radius: 8px;
    padding: var(--spacing-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-photo {
    flex-shrink: 0;
    order: 2;
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--neutral-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.member-info {
    flex: 1;
    order: 1;
}

.member-title {
    color: var(--electric-blue);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.member-description {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--electric-blue);
    font-weight: 600;
    transition: color 0.3s ease;
}

.linkedin-link:hover {
    color: var(--oxford-blue);
}

.about-intro-section {
    background-color: var(--white);
    padding: var(--spacing-xxl) 0;
}

/* Center the About Us intro heading + tagline (sibling sections stay left-aligned). */
.about-intro-section .section-header {
    text-align: center;
}

.about-intro-section .section-header p {
    max-width: 720px;
    margin: 0 auto;
}

.team-section {
    background-color: #f8f9fa;
    padding: var(--spacing-xxl) 0;
}

.collaborators-section {
    background-color: var(--white);
    padding: var(--spacing-xxl) 0;
}

/* Tint .contact-section ONLY when it follows .collaborators-section (About page),
   so /home and any other page using .contact-section are unaffected. */
.collaborators-section + .contact-section {
    background-color: #f8f9fa;
}

/* Inline LinkedIn icon next to <h3> name */
.member-name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xs);
}

.member-name-row h3 {
    margin: 0;
}

.linkedin-link.linkedin-icon-only {
    gap: 0;
    line-height: 1;
    color: var(--electric-blue);
}

.linkedin-link.linkedin-icon-only svg {
    width: 18px;
    height: 18px;
    display: block;
}

.linkedin-link.linkedin-icon-only:hover {
    color: var(--oxford-blue);
}

/* Supporting team -- plain typographic list */
.supporting-team {
    margin-top: var(--spacing-xl);
    max-width: 760px;
}

.supporting-team h3 {
    margin-bottom: var(--spacing-sm);
}

.supporting-team ul {
    list-style: none;
    padding: 0;
}

.supporting-team li {
    padding: var(--spacing-xs) 0;
    color: var(--text-dark);
}

/* Collaborators / contributors typographic blocks */
.collab-subsection {
    margin-bottom: var(--spacing-xl);
    max-width: 880px;
}

.collab-subsection:last-child {
    margin-bottom: 0;
}

.collab-subsection h3 {
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
    font-size: 1.25rem;
}

.collab-subsection p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    color: var(--text-dark);
}

.collab-subsection p:last-child {
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background-color: var(--oxford-blue);
    color: var(--white);
    padding: var(--spacing-lg) 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-links a {
    color: var(--neutral-blue);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-social .social-link {
    color: var(--neutral-blue);
    transition: color 0.3s ease;
}

.footer-social .social-link:hover {
    color: var(--white);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-social .social-text {
    color: var(--neutral-blue);
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--neutral-blue);
    margin: 0;
}

.team-intro-section {
    background-color: #f8f9fa;
    padding: var(--spacing-lg) 0;
}

.mission-section {
    background-color: #f8f9fa;
}

.team-intro {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    color: var(--text-light);
}

.demo-section {
    background-color: #f8f9fa;
    padding: var(--spacing-xxl) 0;
}

.task-demo {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.demo-loading {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-light);
    font-style: italic;
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 600px;
}

.demo-column {
    border-right: 1px solid #eee;
    max-height: 600px;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
}

.demo-column:last-child {
    border-right: none;
}

.demo-column h3 {
    color: var(--oxford-blue);
    font-size: 1.25rem;
    font-weight: 600;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-sm) var(--spacing-lg);
    border-bottom: 2px solid var(--neutral-blue);
    background: #f8f9fa;
    flex-shrink: 0;
    margin: 0;
}

.demo-column-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
}

/* Task Column */
.task-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.task-card .task-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.task-card .task-content {
    line-height: 1.6;
    color: var(--text-dark);
}

/* Response Column */
.response-section {
    margin-bottom: var(--spacing-lg);
}

.response-section h4 {
    color: var(--oxford-blue);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-display);
}

.response-content {
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.response-content ul {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-md);
}

.response-content li {
    margin-bottom: var(--spacing-xs);
}

/* Rubric Column */
.rubric-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.rubric-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.rubric-item.scored-yes {
    background-color: #d4edda;
    border-color: #c3e6cb;
}


.rubric-item.scored-no {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.rubric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.rubric-header-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: center;
}

.rubric-header-text:first-child {
    text-align: left;
    flex: 1;
}

.rubric-header-text:nth-child(2) {
    min-width: 50px;
}

.rubric-header-text:nth-child(3) {
    min-width: 70px;
}

.rubric-criterion {
    font-weight: 600;
    color: var(--oxford-blue);
    flex: 1;
    font-size: 0.95rem;
}

.rubric-points {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 var(--spacing-sm);
    min-width: 40px;
    text-align: center;
}

.rubric-points.positive {
    color: #28a745;
}

.rubric-points.negative {
    color: #dc3545;
}

.rubric-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.rubric-status.yes {
    background-color: #28a745;
    color: white;
}


.rubric-status.no {
    background-color: #6c757d;
    color: white;
}

.rubric-description {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: var(--spacing-xs);
}

/* Progress Section Scaffolding - Desktop */
.demo-progress-container {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

.demo-progress-scaffolding {
    display: flex;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-lg);
}

.progress-spacer {
    flex: 1;
    min-height: 1px; /* Invisible spacers to maintain column alignment */
}

.demo-progress {
    flex: 1;
    background-color: transparent;
    padding: var(--spacing-lg);
    text-align: center;
    margin-top: 0;
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.progress-slider-container {
    width: 100%;
    position: relative;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    align-items: center;
}

.progress-label-no,
.progress-label-yes {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.label-no {
    background-color: #6c757d; /* Match rubric 'No' boxes */
}

.label-yes {
    background-color: #28a745; /* Match rubric 'Yes' boxes */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    position: relative;
    margin: var(--spacing-sm) 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--oxford-blue) 0%, var(--electric-blue) 100%);
    border-radius: 3px;
    transition: width 0.8s ease;
    position: relative;
}

.progress-indicator {
    position: absolute;
    right: -6px;
    top: -3px;
    width: 12px;
    height: 12px;
    background: var(--electric-blue);
    border: 2px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.raw-score-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--oxford-blue);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-score-box {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: var(--spacing-sm);
    min-width: 80px;
    max-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.progress-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--oxford-blue);
    margin: 0;
    line-height: 1;
}

.progress-score-combined {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--oxford-blue);
    margin: 0;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 4px;
    font-weight: 500;
    white-space: nowrap;
}

/* Construct Visualization Styles */
.construct-visualization-section {
    background-color: var(--white);
    padding: var(--spacing-xxl) 0;
}

.construct-visualization-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-top: var(--spacing-sm);
    background: var(--oxford-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.export-btn:hover {
    background: var(--electric-blue);
}

.export-btn svg {
    flex-shrink: 0;
}

#construct-visualization {
    width: 100%;
    min-height: 600px;
    position: relative;
}

.construct-tooltip {
    pointer-events: none;
    z-index: 1000;
}

.construct-info-panel {
    margin-top: var(--spacing-lg);
}

.construct-info-panel h3 {
    font-family: var(--font-display);
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

.construct-info-panel p {
    color: var(--oxford-blue);
    line-height: 1.6;
    margin: 0;
}

/* Visualization responsive adjustments */
@media (max-width: 768px) {
    #construct-visualization {
        min-height: 70vh; /* Much bigger on mobile - take up most of screen */
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .construct-visualization-container {
        padding: var(--spacing-sm);
        margin: 0 auto;
        text-align: center;
    }
    
    .construct-info-panel {
        margin-top: var(--spacing-md);
    }
    
    .construct-info-panel h3 {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .construct-info-panel p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    #construct-visualization {
        min-height: 60vh; /* Big on small mobile too */
    }
    
    .construct-visualization-container {
        padding: var(--spacing-xs);
        margin: 0 auto;
        text-align: center;
    }
    
    .section-header {
        text-align: left;
        padding: 0 var(--spacing-sm);
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .construct-info-panel h3 {
        font-size: 1.1rem;
    }
    
    .construct-info-panel p {
        font-size: 0.85rem;
    }
}

/* Mobile legend styles */
@media (max-width: 768px) {
    .mobile-legend {
        margin-top: var(--spacing-lg);
        text-align: center;
    }

    .mobile-legend-content {
        display: inline-block;
        padding: var(--spacing-md);
        background: var(--neutral-blue);
        border-radius: 8px;
        opacity: 0.95;
    }

    .mobile-legend h4 {
        color: var(--oxford-blue);
        font-family: "Open Sans", sans-serif;
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: var(--spacing-xs);
    }

    .mobile-legend .legend-items {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }
    
    .mobile-legend .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.75rem;
        color: var(--oxford-blue);
        font-family: "Open Sans", sans-serif;
    }

    .mobile-legend .legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        display: inline-block;
    }
    
    .mobile-legend .legend-dot.outer {
        background-color: var(--oxford-blue);
        border: 2px solid var(--oxford-blue);
    }

    .mobile-legend .legend-dot.inner {
        background-color: rgba(1, 30, 65, 0.4);
    }
}

@media (min-width: 769px) {
    .mobile-legend {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--oxford-blue);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        min-width: 200px;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }
    
    .main-nav.active {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--spacing-sm);
    }
    
    .main-nav li {
        width: 100%;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm);
        border-radius: 4px;
        width: 100%;
        text-align: left;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hamburger menu animation - perfect X formation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        transform-origin: center;
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
        transform-origin: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .overview-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }

    .member-name-row {
        gap: var(--spacing-xs);
    }

    .about-intro-section,
    .collaborators-section,
    .team-section {
        padding: var(--spacing-xl) 0;
    }

    .collab-subsection {
        margin-bottom: var(--spacing-lg);
    }

    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .cta-buttons,
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Demo section mobile styles - horizontal scrolling with fixed column width */
    .demo-grid {
        display: flex;
        flex-direction: row;
        min-height: 60vh;
        max-height: 60vh;
        gap: var(--spacing-sm);
        border-radius: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: var(--spacing-sm);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        -webkit-overflow-scrolling: touch;
    }
    
    .demo-column {
        min-width: 340px;
        max-width: 340px;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background: var(--white);
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        overflow: hidden;
    }
    
    .demo-column:last-child {
        margin-right: var(--spacing-sm);
    }
    
    .demo-column h3 {
        font-size: 1rem;
        font-weight: 600;
        padding: var(--spacing-md);
        background: #f8f9fa;
        color: var(--oxford-blue);
        margin: 0;
        border-radius: 8px 8px 0 0;
        flex-shrink: 0;
        border-bottom: 1px solid #eee;
    }
    
    .demo-column-content {
        padding: var(--spacing-md);
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Custom scrollbar for demo columns - grey like desktop */
    .demo-column-content::-webkit-scrollbar {
        width: 3px;
    }
    
    .demo-column-content::-webkit-scrollbar-track {
        background: #f8f9fa;
    }
    
    .demo-column-content::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }
    
    .demo-column-content::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    
    /* Horizontal scrollbar for main container - grey like desktop */
    .demo-grid::-webkit-scrollbar {
        height: 8px;
    }
    
    .demo-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .demo-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }
    
    .demo-grid::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    
    /* Task card mobile improvements */
    .task-card {
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .task-card .task-content {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Response section mobile improvements */
    .response-section {
        margin-bottom: var(--spacing-md);
    }
    
    .response-section h4 {
        font-size: 1rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .response-content {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Rubric mobile improvements - perfect alignment */
    .rubric-item {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
        background: var(--white);
        border-radius: 4px;
    }
    
    .rubric-header {
        display: grid !important;
        grid-template-columns: 1fr 50px 70px;
        gap: var(--spacing-sm);
        align-items: center;
        margin-bottom: var(--spacing-md);
        width: 100%;
    }
    
    .rubric-header-text {
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--text-dark);
        text-align: center;
    }
    
    .rubric-header-text:first-child {
        text-align: left;
    }
    
    .rubric-criterion {
        font-size: 0.85rem;
        line-height: 1.3;
        overflow: hidden;
    }
    
    .rubric-points {
        font-size: 1rem;
        font-weight: 600;
        text-align: center;
        justify-self: center;
    }
    
    .rubric-status {
        font-size: 0.75rem;
        padding: 4px 8px;
        text-align: center;
        border-radius: 4px;
        justify-self: center;
        width: 50px;
    }
    
    .rubric-description {
        font-size: 0.8rem;
        margin-top: var(--spacing-xs);
    }
    
    /* Progress Section for Mobile */
    .demo-progress-container {
        background-color: #f8f9fa;
        border-top: 1px solid #dee2e6;
        border-radius: 0 0 12px 12px;
    }
    
    .demo-progress-scaffolding {
        display: block; /* No scaffolding on mobile - full width */
        padding: 0;
    }
    
    .progress-spacer {
        display: none; /* Hide spacers on mobile */
    }
    
    .demo-progress {
        background-color: transparent;
        padding: var(--spacing-lg);
        text-align: center;
        margin-top: 0;
    }
    
    .progress-bar-container {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: center;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .progress-slider-container {
        width: 100%;
        position: relative;
    }
    
    .progress-labels {
        display: flex;
        justify-content: space-between;
        font-size: 0.875rem;
        color: var(--text-light);
        margin-bottom: var(--spacing-sm);
        font-weight: 500;
        align-items: center;
    }
    
    .progress-label-no,
    .progress-label-yes {
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        color: white;
    }
    
    .label-no {
        background-color: #6c757d; /* Match rubric 'No' boxes */
    }
    
    .label-yes {
        background-color: #28a745; /* Match rubric 'Yes' boxes */
    }
    
    .progress-bar {
        width: 100%;
        height: 6px;
        background-color: #e9ecef;
        border-radius: 3px;
        position: relative;
        margin: var(--spacing-sm) 0;
    }
    
    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--oxford-blue) 0%, var(--electric-blue) 100%);
        border-radius: 3px;
        transition: width 0.8s ease;
        position: relative;
    }
    
    .progress-indicator {
        position: absolute;
        right: -6px;
        top: -3px;
        width: 12px;
        height: 12px;
        background: var(--electric-blue);
        border: 2px solid var(--white);
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .raw-score-badge {
        position: absolute;
        top: -25px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--oxford-blue);
        color: var(--white);
        font-size: 0.75rem;
        font-weight: 600;
        padding: 2px 6px;
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .progress-score-box {
        background: var(--white);
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: var(--spacing-sm);
        min-width: 80px;
        max-width: 100px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        text-align: center;
    }
    
    .progress-score {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--oxford-blue);
        margin: 0;
        line-height: 1;
    }
    
    .progress-score-combined {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--oxford-blue);
        margin: 0;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }
    
    .progress-label {
        font-size: 0.875rem;
        color: var(--text-light);
        margin-top: 4px;
        font-weight: 500;
        white-space: nowrap;
    }
}

/* ============================================
   WORKFLOW DIAGRAM - STATIC INFOGRAPHIC
   ============================================ */

:root {
    --madrid-orange: #fd5821;
    --mallard-green: #005145;
    --ruskin-red: #9b1827;
    --scholar-purple: #5f4261;
}

.workflow-diagram-section {
    background: linear-gradient(180deg, #f8f9fa 0%, var(--white) 100%);
    padding: var(--spacing-xxl) 0;
}

.workflow-diagram {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Section styling */
.diagram-section {
    margin-bottom: var(--spacing-xxl);
    position: relative;
}

.diagram-section:last-child {
    margin-bottom: 0;
}

/* Section headers */
.section-label {
    display: inline-block;
    padding: 6px 14px;
    background: var(--oxford-blue);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
}

.section-label.step-1 { background: var(--oxford-blue); }
.section-label.step-2 { background: var(--electric-blue); }
.section-label.step-3 { background: var(--madrid-orange); }

/* Flow arrows between sections */
.flow-connector {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) 0;
}

.flow-connector svg {
    color: var(--neutral-blue);
}

/* Taxonomy wheel container */
.taxonomy-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.taxonomy-wheel {
    flex: 0 0 280px;
}

.taxonomy-wheel svg {
    width: 100%;
    height: auto;
}

.taxonomy-info {
    flex: 1;
}

.taxonomy-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

.taxonomy-info p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.taxonomy-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--electric-blue);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Competency zoom */
.competency-zoom {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.zoom-slice {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zoom-slice svg {
    width: 160px;
    height: 160px;
}

.slice-label {
    margin-top: var(--spacing-sm);
    font-weight: 600;
    color: var(--oxford-blue);
    text-align: center;
    font-size: 0.9rem;
}

.subcomp-list {
    flex: 1;
}

.subcomp-list h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-md);
}

.subcomp-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.subcomp-item:last-child {
    border-bottom: none;
}

.subcomp-code {
    flex: 0 0 40px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--electric-blue);
}

.subcomp-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.subcomp-criteria {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.criteria-dot {
    width: 8px;
    height: 8px;
    background: var(--electric-blue);
    border-radius: 50%;
}

/* Sub-competency column headers */
.subcomp-column-headers {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--neutral-blue);
}

.subcomp-col-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.subcomp-col-label.col-code {
    flex: 0 0 40px;
}

.subcomp-col-label.col-name {
    flex: 1;
}

.subcomp-col-label.col-criteria {
    flex: 0 0 auto;
}

/* Task to rubric flow */
.task-rubric-flow {
    display: flex;
    gap: var(--spacing-lg);
    align-items: stretch;
}

.flow-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.flow-column.sources {
    flex: 0 0 260px;
    gap: var(--spacing-md);
}

.flow-column.arrow {
    flex: 0 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-column.result {
    flex: 1;
}

/* Source cards */
.source-box {
    padding: var(--spacing-md);
    border-radius: 10px;
    border-left: 4px solid;
}

.source-box.task-source {
    background: rgba(253, 88, 33, 0.04);
    border-color: var(--madrid-orange);
}

.source-box.consensus-source {
    background: rgba(0, 67, 224, 0.04);
    border-color: var(--electric-blue);
}

.source-box.universal-source {
    background: rgba(0, 81, 69, 0.04);
    border-color: var(--mallard-green);
}

.source-box h5 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.source-box.task-source h5 { color: var(--madrid-orange); }
.source-box.consensus-source h5 { color: var(--electric-blue); }
.source-box.universal-source h5 { color: var(--mallard-green); }

.source-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.source-box li {
    font-size: 0.85rem;
    color: var(--text-dark);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-box li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.source-box.task-source li::before { background: var(--madrid-orange); }
.source-box.consensus-source li::before { background: var(--electric-blue); }
.source-box.universal-source li::before { background: var(--mallard-green); }

/* Final rubric card with background bounding box */
.assembly-rubric-col {
    position: relative;
    padding: var(--spacing-lg);
    background: linear-gradient(145deg, rgba(1, 30, 65, 0.08) 0%, rgba(0, 67, 224, 0.05) 50%, rgba(202, 215, 216, 0.3) 100%);
    border-radius: 28px;
    box-shadow: inset 0 2px 8px rgba(1, 30, 65, 0.04);
}

.rubric-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.04);
}

.rubric-card-header {
    background: linear-gradient(135deg, var(--oxford-blue) 0%, var(--electric-blue) 100%);
    color: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-display);
    font-size: 1rem;
}

.rubric-card-section {
    /* Clean section styling */
}

.rubric-card-section:last-of-type {
    /* No special styling needed */
}

.rubric-section-title {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rubric-card-section.task .rubric-section-title {
    background: rgba(253, 88, 33, 0.06);
    color: var(--madrid-orange);
}

.rubric-card-section.consensus .rubric-section-title {
    background: rgba(0, 67, 224, 0.06);
    color: var(--electric-blue);
}

.rubric-card-section.universal .rubric-section-title {
    background: rgba(0, 81, 69, 0.06);
    color: var(--mallard-green);
}

.rubric-card-items {
    padding: var(--spacing-sm) var(--spacing-lg);
}

.rubric-card-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rubric-card-section.task .item-dot { background: var(--madrid-orange); }
.rubric-card-section.consensus .item-dot { background: var(--electric-blue); }
.rubric-card-section.universal .item-dot { background: var(--mallard-green); }

.rubric-card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--oxford-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--white);
    border-radius: 0 0 12px 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .workflow-diagram {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-sm);
    }

    .taxonomy-display {
        flex-direction: column;
        text-align: center;
    }

    .taxonomy-wheel {
        flex: none;
        width: 200px;
        margin: 0 auto;
    }

    .taxonomy-stats {
        justify-content: center;
    }

    .competency-zoom {
        flex-direction: column;
    }

    .zoom-slice {
        flex: none;
        width: 100%;
    }

    .zoom-slice svg {
        width: 120px;
        height: 120px;
    }

    .task-rubric-flow {
        flex-direction: column;
    }

    .flow-column.sources {
        flex: none;
        width: 100%;
    }

    .flow-column.arrow {
        flex: none;
        transform: rotate(90deg);
        padding: var(--spacing-sm) 0;
    }

    .flow-column.result {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .taxonomy-wheel {
        width: 160px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-label {
        font-size: 0.65rem;
    }
}

/* Download Button */
.diagram-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-md);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--oxford-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: var(--electric-blue);
}

.download-btn svg {
    flex-shrink: 0;
}

/* Diagram content wrapper */
.diagram-content {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: 8px;
}

/* Task Card - Full */
.task-intro {
    max-width: 600px;
    margin: var(--spacing-lg) auto;
}

.task-card-full {
    background: var(--white);
    border: 2px solid var(--madrid-orange);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(253, 88, 33, 0.1);
}

.task-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--madrid-orange);
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-card-body {
    padding: var(--spacing-md);
}

.task-description {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: var(--spacing-md) !important;
}

.task-tags {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.tag-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.tag-note {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 4px;
}

.task-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--electric-blue);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
}

/* Small flow connector */
.flow-connector.small {
    padding: var(--spacing-md) 0;
}

/* Assembly Flow */
.assembly-flow {
    display: flex;
    gap: var(--spacing-lg);
    align-items: stretch;
}

.assembly-sources {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Compact Source Cards (Simplified) */
.assembly-sources-compact {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.source-card {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 16px;
    border-left: 5px solid;
    background: var(--white);
}

.source-card.task-source {
    border-left-color: var(--madrid-orange);
    background: linear-gradient(180deg, rgba(253, 88, 33, 0.06) 0%, rgba(253, 88, 33, 0.02) 40%, rgba(255, 255, 255, 1) 100%);
}

.source-card.consensus-source {
    border-left-color: var(--electric-blue);
    background: linear-gradient(180deg, rgba(0, 67, 224, 0.06) 0%, rgba(0, 67, 224, 0.02) 40%, rgba(255, 255, 255, 1) 100%);
}

.source-card.universal-source {
    border-left-color: var(--mallard-green);
    background: linear-gradient(180deg, rgba(0, 81, 69, 0.06) 0%, rgba(0, 81, 69, 0.02) 40%, rgba(255, 255, 255, 1) 100%);
}

.source-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.source-card-header svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.source-card.task-source .source-card-header { color: var(--madrid-orange); }
.source-card.consensus-source .source-card-header { color: var(--electric-blue); }
.source-card.universal-source .source-card-header { color: var(--mallard-green); }

.source-card-header span {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.source-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin: 0 0 var(--spacing-md) 0 !important;
    line-height: 1.4;
}

.criteria-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.criteria-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
    background: rgba(0, 81, 69, 0.1);
    color: var(--mallard-green);
    border: 1px solid rgba(0, 81, 69, 0.2);
}

.criteria-pill.negative {
    background: rgba(155, 24, 39, 0.1);
    color: var(--ruskin-red);
    border: 1px solid rgba(155, 24, 39, 0.2);
}

/* Grid-based Assembly Layout with Aligned Sections */
.assembly-grid {
    display: grid;
    grid-template-columns: 220px 80px 1fr;
    gap: var(--spacing-md);
    align-items: stretch;
}

.assembly-sources-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Large gap for floating effect */
    /* Offset for rubric card header and footer */
    padding-top: 62px;
    padding-bottom: 52px;
}

/* Source card styling - floating cards with prominent shadows */
.assembly-sources-col .source-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-lg);
    border-radius: 20px;
    background: var(--white);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.assembly-sources-col .source-card:hover {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.1),
        0 24px 48px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
}

.assembly-center-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.assembly-center-arrow svg {
    width: 56px;
    height: 56px;
    opacity: 0.6;
}

.assembly-arrow {
    flex: 0 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assembly-result {
    flex: 1;
}

/* Enhanced Source Box (legacy) */
.source-box {
    padding: var(--spacing-md);
    border-radius: 10px;
    border-left: 4px solid;
}

.source-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.source-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-box.task-source .source-icon { color: var(--madrid-orange); }
.source-box.consensus-source .source-icon { color: var(--electric-blue); }
.source-box.universal-source .source-icon { color: var(--mallard-green); }

.source-note {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: var(--spacing-sm) !important;
}

/* Inherited groups */
.inherited-group {
    margin-bottom: var(--spacing-sm);
}

.inherited-group:last-child {
    margin-bottom: 0;
}

.inherited-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--electric-blue);
    margin-bottom: 4px;
    padding-left: 12px;
}

.inherited-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.inherited-group li {
    font-size: 0.82rem;
    color: var(--text-dark);
    padding: 3px 0;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inherited-group li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--electric-blue);
    flex-shrink: 0;
}

/* Step 3 label color */
.section-label.step-3 {
    background: var(--oxford-blue);
}

/* Mobile responsive - additional rules */
@media (max-width: 768px) {
    .assembly-flow {
        flex-direction: column;
    }

    .assembly-sources,
    .assembly-sources-compact {
        flex: none;
        width: 100%;
    }

    .assembly-sources-compact {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .source-card {
        flex: 1 1 calc(50% - var(--spacing-xs));
        min-width: 140px;
    }

    .assembly-arrow {
        flex: none;
        transform: rotate(90deg);
        padding: var(--spacing-sm) 0;
    }

    .assembly-result {
        flex: none;
        width: 100%;
    }

    .task-intro {
        margin: var(--spacing-md) auto;
    }

    .task-card-body {
        padding: var(--spacing-sm);
    }

    .task-description {
        font-size: 0.9rem;
    }

    .diagram-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .download-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Task tag with full sub-competency name */
.task-tag-full {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 67, 224, 0.08);
    border: 1px solid var(--electric-blue);
    border-radius: 6px;
    padding: 6px 12px;
}

.task-tag-code {
    display: inline-block;
    padding: 2px 8px;
    background: var(--electric-blue);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
}

.task-tag-name {
    font-size: 0.82rem;
    color: var(--oxford-blue);
    font-weight: 500;
}

/* Criterion with points */
.source-box ul li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.criterion-text {
    flex: 1;
}

.criterion-points {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mallard-green);
    background: rgba(0, 81, 69, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Rubric card item with points */
.rubric-card-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-text {
    flex: 1;
}

.item-points {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mallard-green);
    background: rgba(0, 81, 69, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 81, 69, 0.15);
}

/* Rubric card footer with total */
.rubric-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--oxford-blue);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
}

.total-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neutral-blue);
}

/* Mobile adjustments for tags */
@media (max-width: 768px) {
    .task-tags {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-tag-full {
        width: 100%;
    }
}

/* Positive/Negative point styling */
.criterion-points.positive,
.item-points.positive {
    color: var(--mallard-green);
    background: rgba(0, 81, 69, 0.08);
    border-color: rgba(0, 81, 69, 0.15);
}

.criterion-points.negative,
.item-points.negative {
    color: var(--ruskin-red);
    background: rgba(155, 24, 39, 0.08);
    border-color: rgba(155, 24, 39, 0.15);
}

/* Step 4 label */
.section-label.step-4 {
    background: var(--mallard-green);
}

/* Scoring Flow Layout */
.scoring-flow {
    display: flex;
    gap: var(--spacing-md);
    align-items: stretch;
    margin-top: var(--spacing-lg);
}

.scoring-panel {
    flex: 1;
    background: var(--white);
    border-radius: 12px;
    border: 2px solid var(--neutral-blue);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--neutral-blue);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--oxford-blue);
    text-align: center;
}

.panel-content {
    padding: var(--spacing-md);
    flex: 1;
}

/* Eval Panel - Chat bubbles */
.eval-panel {
    max-width: 200px;
    flex: 0 0 200px;
}

.chat-bubble {
    border-radius: 10px;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.chat-bubble.user {
    background: var(--neutral-blue);
    margin-right: 20px;
}

.chat-bubble.assistant {
    background: rgba(0, 67, 224, 0.08);
    border: 1px solid var(--electric-blue);
    margin-left: 20px;
}

.chat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: var(--text-light);
}

.chat-bubble p {
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0 !important;
    color: var(--text-dark);
}

.placeholder-lines {
    height: 40px;
    background: linear-gradient(
        to bottom,
        var(--electric-blue) 0%, var(--electric-blue) 20%,
        transparent 20%, transparent 35%,
        var(--electric-blue) 35%, var(--electric-blue) 55%,
        transparent 55%, transparent 70%,
        var(--electric-blue) 70%, var(--electric-blue) 90%
    );
    background-size: 100% 100%;
    opacity: 0.3;
    border-radius: 2px;
}

.response-panel {
    flex: 1;
    border-color: var(--electric-blue);
    position: relative;
}

.response-panel .panel-header {
    background: rgba(0, 67, 224, 0.08);
    color: var(--oxford-blue);
    border-bottom: 1px solid var(--electric-blue);
}

.response-content {
    background: rgba(0, 67, 224, 0.04);
    border-radius: 8px;
    padding: var(--spacing-md) !important;
}

.response-line {
    height: 10px;
    background: var(--electric-blue);
    opacity: 0.25;
    border-radius: 2px;
    margin-bottom: 8px !important;
}

.response-line.short {
    width: 60%;
}

.response-label {
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--electric-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grades-panel {
    flex: 2.5;
    border-color: var(--oxford-blue);
}

.grades-panel .panel-header {
    background: var(--oxford-blue);
    color: var(--white);
}

.grades-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 2px solid var(--neutral-blue);
}

.grades-col-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.grades-col-label.col-criterion {
    flex: 1;
}

.grades-col-label.col-pts {
    width: 42px;
    text-align: center;
}

.grades-col-label.col-present {
    width: 38px;
    text-align: center;
}

.grades-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grade-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.grade-row.scored {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.grade-row.not-scored {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.grade-criterion-text {
    flex: 1;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--oxford-blue);
    line-height: 1.3;
}

.grade-points {
    width: 42px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.grade-points.positive {
    color: #28a745;
}

.grade-points.negative {
    color: #dc3545;
}

.grade-status {
    display: inline-block;
    width: 38px;
    padding: 2px 0;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
}

.grade-status.yes {
    background-color: #28a745;
    color: white;
}

.grade-status.no {
    background-color: #6c757d;
    color: white;
}

.grades-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--oxford-blue);
    color: var(--white);
    margin-top: auto;
}

.total-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.total-value-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-fraction {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neutral-blue);
}

.total-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
}

/* Scoring arrows */
.scoring-arrow {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile responsive for Step 4 */
@media (max-width: 900px) {
    .scoring-flow {
        flex-direction: column;
    }

    .eval-panel {
        max-width: none;
        flex: none;
    }

    .grades-panel {
        flex: none;
    }

    .scoring-arrow {
        flex: none;
        transform: rotate(90deg);
        padding: var(--spacing-sm) 0;
    }
}

/* ========================================
   AUTO-SCORER VISUALIZATION
   ======================================== */

.autoscorer-section {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(180deg, #f8f9fa 0%, var(--white) 100%);
}

.autoscorer-diagram {
    max-width: 1200px;
    margin: 0 auto;
}

.autoscorer-content {
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow: 0 4px 24px rgba(1, 30, 65, 0.08);
}

/* Viz Header */
.viz-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--neutral-blue);
}

.viz-header h2 {
    font-family: "DM Serif Display", serif;
    font-size: 2rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

.viz-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Scoring Pipeline Layout */
.scoring-pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) 0;
    overflow-x: auto;
}

/* Pipeline Phases */
.pipeline-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.phase-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: 6px 16px;
    background: var(--oxford-blue);
    border-radius: 20px;
}

.phase-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--white);
    color: var(--oxford-blue);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.phase-title {
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pipeline Connector */
.pipeline-connector {
    display: flex;
    align-items: center;
    padding-top: 60px;
}

/* Phase 1: Input Stack */
.input-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.input-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--white);
    border: 2px solid var(--neutral-blue);
    border-radius: 10px;
    min-width: 180px;
    transition: all 0.2s ease;
}

.input-card:hover {
    border-color: var(--electric-blue);
    transform: translateX(4px);
}

.card-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.task-input .card-icon {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
}

.response-input .card-icon {
    background: rgba(0, 81, 69, 0.1);
    color: var(--mallard-green);
}

.reference-input .card-icon {
    background: rgba(255, 225, 45, 0.3);
    color: var(--oxford-blue);
}

.card-content {
    flex: 1;
}

.card-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.card-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-line {
    height: 6px;
    background: var(--neutral-blue);
    border-radius: 3px;
    width: 100%;
}

.preview-line.short {
    width: 60%;
}

.card-preview.gold .preview-line {
    background: linear-gradient(90deg, var(--kipper-yellow) 0%, rgba(255, 225, 45, 0.5) 100%);
}

.context-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--spacing-sm);
}

.context-pill {
    padding: 4px 10px;
    background: var(--neutral-blue);
    color: var(--oxford-blue);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 12px;
}

/* Phase 2: Judge Container - highlighted background */
.phase-judge {
    background: rgba(0, 67, 224, 0.06);
    border-radius: 24px;
    padding: var(--spacing-lg);
    margin: 0 var(--spacing-sm);
}

.judge-container {
    position: relative;
}

.judge-box {
    background: var(--white);
    border: 2px solid var(--neutral-blue);
    border-radius: 16px;
    padding: var(--spacing-md);
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 67, 224, 0.12);
}

.judge-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--oxford-blue);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(0, 67, 224, 0.08);
    border-radius: 8px;
}

.criterion-input {
    margin-bottom: var(--spacing-md);
}

.criterion-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.criterion-box {
    background: var(--neutral-blue);
    border-radius: 8px;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.criterion-text {
    font-size: 0.8rem;
    color: var(--oxford-blue);
    font-style: italic;
}

.criterion-weight {
    font-size: 0.7rem;
    color: var(--mallard-green);
    font-weight: 700;
}

.binary-decision {
    background: rgba(0, 67, 224, 0.04);
    border-radius: 8px;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.decision-question {
    font-size: 0.7rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 8px;
}

.decision-options {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.decision-yes,
.decision-no {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.decision-yes {
    background: var(--mallard-green);
    color: var(--white);
}

.decision-no {
    background: var(--ruskin-red);
    color: var(--white);
}

.decision-yes.active,
.decision-no.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.points-output {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    padding: var(--spacing-sm);
    background: var(--mallard-green);
    border-radius: 8px;
}

.points-awarded {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.points-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Loop Indicator */
.loop-indicator {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loop-text {
    font-size: 0.7rem;
    color: var(--electric-blue);
    font-weight: 600;
    white-space: nowrap;
    margin-top: -5px;
}

/* Phase 3: Scoring */
.scoring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.points-accumulator {
    background: var(--neutral-blue);
    border-radius: 12px;
    padding: var(--spacing-md);
    min-width: 160px;
}

.accumulator-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.accumulator-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--spacing-sm);
}

.point-bar {
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white);
}

.point-bar.earned {
    background: var(--mallard-green);
}

.point-bar.not-earned {
    background: var(--neutral-blue);
    border: 2px dashed var(--oxford-blue);
    color: var(--oxford-blue);
    opacity: 0.5;
}

.accumulator-total {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    padding-top: var(--spacing-sm);
    border-top: 2px solid var(--oxford-blue);
}

.total-earned {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mallard-green);
}

.total-divider {
    font-size: 1rem;
    color: var(--oxford-blue);
}

.total-max {
    font-size: 1rem;
    color: var(--oxford-blue);
}

.calc-arrow {
    display: flex;
    align-items: center;
}

.task-score-box {
    background: linear-gradient(135deg, var(--electric-blue) 0%, #0033b0 100%);
    border-radius: 12px;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 67, 224, 0.3);
}

.score-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

/* Aggregation Section */
.aggregation-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--neutral-blue);
}

.aggregation-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.agg-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--neutral-blue);
    border-radius: 50%;
}

.agg-title {
    font-family: "DM Serif Display", serif;
    font-size: 1.2rem;
    color: var(--oxford-blue);
}

.aggregation-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.task-scores-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.mini-score {
    padding: 8px 12px;
    background: var(--neutral-blue);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--oxford-blue);
}

.mini-score-more {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 700;
}

.mean-calc {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mean-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.final-score-box {
    background: linear-gradient(135deg, var(--oxford-blue) 0%, #0a3a6b 100%);
    border-radius: 16px;
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: 0 8px 32px rgba(1, 30, 65, 0.2);
    min-width: 160px;
}

.final-score-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-sm);
}

.final-score-value {
    font-family: "DM Serif Display", serif;
    font-size: 2.5rem;
    color: var(--white);
    line-height: 1;
}

.final-score-value .percent {
    font-size: 1.2rem;
}

.final-score-note {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--spacing-sm);
}

/* Insight Box */
.insight-box {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(0, 67, 224, 0.05);
    border-left: 4px solid var(--electric-blue);
    border-radius: 0 12px 12px 0;
}

.insight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 50%;
}

.insight-content {
    flex: 1;
}

.insight-title {
    display: block;
    font-weight: 700;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

.insight-box p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .scoring-pipeline {
        flex-direction: column;
        align-items: center;
    }

    .pipeline-connector {
        padding-top: 0;
        transform: rotate(90deg);
        margin: var(--spacing-md) 0;
    }

    .pipeline-phase {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }

    .loop-indicator {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: var(--spacing-md);
    }

    .aggregation-flow {
        flex-direction: column;
    }

    .mean-calc {
        transform: rotate(90deg);
    }
}

@media (max-width: 600px) {
    .autoscorer-content {
        padding: var(--spacing-md);
    }

    .viz-header h2 {
        font-size: 1.5rem;
    }

    .judge-box {
        min-width: auto;
        width: 100%;
    }

    .task-scores-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .insight-box {
        flex-direction: column;
        text-align: center;
    }

    .insight-icon {
        margin: 0 auto;
    }
}


/* ========================================
   PRACTITIONER VALIDATION VISUALIZATION (visuals3)
   Three-stage workflow diagram with OUP branding
   ======================================== */

.practitioner-validation-section {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(180deg, var(--neutral-blue) 0%, var(--white) 100%);
    min-height: 100vh;
}

.practitioner-validation-diagram {
    max-width: 900px;
    margin: 0 auto;
}

.pv-wrapper {
    position: relative;
}

.pv-content {
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow: 0 4px 24px rgba(1, 30, 65, 0.08);
}

/* Download Button */
.pv-download-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-md);
}

.pv-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--oxford-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pv-download-btn:hover {
    background: var(--electric-blue);
    transform: translateY(-1px);
}

.pv-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Section Base Styles */
.pv-section {
    margin-bottom: var(--spacing-md);
}

.pv-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.pv-section-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--oxford-blue);
    margin: 0;
}

.pv-section-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.5;
}

/* Section Badges */
.pv-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
}

.pv-badge-practitioners {
    background: var(--oxford-blue);
}

.pv-badge-a {
    background: var(--electric-blue);
}

.pv-badge-b {
    background: #fd5821; /* Madrid Orange */
}

.pv-badge-c {
    background: #005145; /* Mallard Green */
}

/* Practitioner Groups */
.pv-practitioners-section {
    padding-bottom: var(--spacing-md);
}

.pv-practitioner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.pv-practitioner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--white);
    border: 2px dashed var(--neutral-blue);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.pv-practitioner-card:hover {
    border-color: var(--electric-blue);
    border-style: solid;
    transform: translateY(-2px);
}

.pv-practitioner-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-blue);
    border-radius: 50%;
    margin-bottom: var(--spacing-xs);
}

.pv-practitioner-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--oxford-blue);
    text-align: center;
    line-height: 1.3;
}

/* Flow Connectors */
.pv-flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.pv-flow-line {
    width: 2px;
    height: 20px;
    background: var(--neutral-blue);
}

.pv-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oxford-blue);
}

/* Stage Content Area */
.pv-stage-content {
    background: #f8fafb;
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--neutral-blue);
}

/* Task Card (Stage A) */
.pv-task-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(1, 30, 65, 0.06);
}

.pv-task-header {
    background: var(--electric-blue);
    padding: 10px 16px;
}

.pv-task-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pv-task-preview {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--neutral-blue);
}

/* Preview Lines (skeleton text) */
.pv-preview-line {
    height: 10px;
    background: var(--neutral-blue);
    border-radius: 5px;
    margin-bottom: 8px;
}

.pv-preview-line:last-child {
    margin-bottom: 0;
}

.pv-preview-line-long {
    width: 100%;
}

.pv-preview-line-medium {
    width: 75%;
}

.pv-preview-line-short {
    width: 50%;
}

/* Ratings Container (Stage A) */
.pv-ratings-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.pv-rating-question {
    text-align: center;
}

.pv-rating-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-sm);
}

.pv-likert-scale {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pv-likert-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pv-likert-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--neutral-blue);
    background: var(--white);
    transition: all 0.2s ease;
}

.pv-likert-selected .pv-likert-circle {
    border-color: var(--electric-blue);
    background: var(--electric-blue);
}

.pv-likert-number {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Comparison Container (Stage B) */
.pv-comparison-container {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.pv-answer-card {
    flex: 1;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(1, 30, 65, 0.06);
    border: 2px solid var(--neutral-blue);
}

.pv-answer-header {
    background: var(--neutral-blue);
    padding: 10px 16px;
    text-align: center;
}

.pv-answer-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--oxford-blue);
}

.pv-answer-preview {
    padding: var(--spacing-md);
}

/* VS Indicator */
.pv-vs-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 var(--spacing-xs);
}

.pv-vs-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(253, 88, 33, 0.1);
    border-radius: 50%;
}

.pv-vs-text {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fd5821;
}

/* Preference Section */
.pv-preference-section {
    text-align: center;
}

.pv-preference-indicator {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.pv-preference-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.pv-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--neutral-blue);
    background: var(--white);
}

.pv-radio-selected {
    border-color: #fd5821;
    background: #fd5821;
    box-shadow: inset 0 0 0 3px var(--white);
}

.pv-randomization-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* Scoring Container (Stage C) */
.pv-scoring-container {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.pv-revealed-answer {
    flex: 1;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(1, 30, 65, 0.06);
    border: 2px solid #005145;
}

.pv-revealed-header {
    background: #005145;
    padding: 10px 16px;
}

.pv-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pv-revealed-preview {
    padding: var(--spacing-md);
}

/* Scoring Arrow */
.pv-scoring-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
}

/* Rubric Panel */
.pv-rubric-panel {
    flex: 1;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(1, 30, 65, 0.06);
    border: 1px solid var(--neutral-blue);
}

.pv-rubric-header {
    background: var(--neutral-blue);
    padding: 10px 16px;
}

.pv-rubric-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--oxford-blue);
}

.pv-rubric-items {
    padding: var(--spacing-sm);
}

.pv-rubric-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.pv-rubric-item:last-child {
    margin-bottom: 0;
}

.pv-rubric-pass {
    background: rgba(0, 81, 69, 0.08);
}

.pv-rubric-fail {
    background: rgba(155, 24, 39, 0.08);
}

.pv-rubric-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pv-indicator-pass {
    background: rgba(0, 81, 69, 0.15);
}

.pv-indicator-fail {
    background: rgba(155, 24, 39, 0.15);
}

.pv-criterion-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.pv-criterion-result {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.pv-result-pass {
    color: #005145;
    background: rgba(0, 81, 69, 0.15);
}

.pv-result-fail {
    color: #9b1827;
    background: rgba(155, 24, 39, 0.15);
}

.pv-alignment-note {
    padding: var(--spacing-sm) var(--spacing-md);
    background: #f8fafb;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
    border-top: 1px solid var(--neutral-blue);
}

/* ========================================
   PRACTITIONER VALIDATION - RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .practitioner-validation-section {
        padding: var(--spacing-xl) 0;
    }

    .pv-content {
        padding: var(--spacing-md);
        border-radius: 12px;
    }

    .pv-section-title {
        font-size: 1.25rem;
    }

    .pv-practitioner-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }

    .pv-practitioner-card {
        padding: var(--spacing-sm);
    }

    .pv-practitioner-icon {
        width: 40px;
        height: 40px;
    }

    .pv-practitioner-label {
        font-size: 0.75rem;
    }

    .pv-stage-content {
        padding: var(--spacing-md);
    }

    .pv-ratings-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .pv-comparison-container {
        flex-direction: column;
    }

    .pv-vs-indicator {
        flex-direction: row;
        padding: var(--spacing-xs) 0;
    }

    .pv-preference-indicator {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .pv-scoring-container {
        flex-direction: column;
    }

    .pv-scoring-arrow {
        padding: var(--spacing-sm) 0;
        transform: rotate(90deg);
    }

    .pv-rubric-panel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pv-download-btn span {
        display: none;
    }

    .pv-download-btn {
        padding: 10px;
    }

    .pv-section-header {
        flex-wrap: wrap;
    }

    .pv-practitioner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pv-likert-circle {
        width: 20px;
        height: 20px;
    }

    .pv-likert-number {
        font-size: 0.7rem;
    }

    .pv-preference-option {
        font-size: 0.8rem;
    }

    .pv-randomization-note {
        font-size: 0.75rem;
    }
}

/* ========================================
   SCENARIO PRODUCTION VISUALIZATION
   ======================================== */

.production-viz-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.production-viz-container .download-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--oxford-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.production-viz-container .download-btn:hover {
    background: var(--electric-blue);
    transform: translateY(-2px);
}

.production-diagram {
    background: var(--white);
    border-radius: 28px;
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(202, 215, 216, 0.3);
}

/* Header row with title left, legend right */
.diagram-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.diagram-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    color: var(--oxford-blue);
    margin: 0;
}

.workflow-legend-inline {
    display: flex;
    gap: var(--spacing-md);
}

.workflow-legend-inline .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--oxford-blue);
}

.diagram-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

/* Workflow Stages Container - Vertical */
.workflow-stages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Stage Arrow - Vertical */
.stage-arrow {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xs) 0;
}

/* =============================================
   HORIZONTAL WORKFLOW LAYOUT
   ============================================= */

.production-viz-container.horizontal {
    max-width: 1200px;
}

.production-diagram.horizontal {
    padding: var(--spacing-xl) var(--spacing-lg);
}

/* Horizontal Workflow Stages */
.workflow-stages-horizontal {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin: var(--spacing-lg) 0;
    overflow-x: auto;
    padding: var(--spacing-sm) 0;
}

/* Horizontal Stage Card */
.stage-card-h {
    flex: 0 0 auto;
    width: 150px;
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-md);
    border-top: 4px solid var(--neutral-blue);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stage-card-h:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.06);
}

/* Stage-specific colors - Horizontal */
.stage-card-h.design-stage {
    border-top-color: var(--electric-blue);
    background: linear-gradient(180deg, rgba(0, 67, 224, 0.04) 0%, var(--white) 100%);
}

.stage-card-h.draft-stage {
    border-top-color: var(--madrid-orange);
    background: linear-gradient(180deg, rgba(253, 88, 33, 0.04) 0%, var(--white) 100%);
}

.stage-card-h.review-stage {
    border-top-color: var(--electric-blue);
    background: linear-gradient(180deg, rgba(0, 67, 224, 0.04) 0%, var(--white) 100%);
}

.stage-card-h.approve-stage {
    border-top-color: var(--electric-blue);
    background: linear-gradient(180deg, rgba(0, 67, 224, 0.04) 0%, var(--white) 100%);
}

.stage-card-h.publish-stage {
    border-top-color: var(--mallard-green);
    background: linear-gradient(180deg, rgba(0, 81, 69, 0.04) 0%, var(--white) 100%);
}

/* Stage Header - Horizontal */
.stage-header-h {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.stage-icon-h {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-title-h {
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
    color: var(--oxford-blue);
    margin: 0;
}

/* Stage Bullet - Single line */
.stage-bullet {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    min-height: 36px;
}

/* Stage Bullet - Text only (no icon) */
.stage-bullet-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    min-height: 36px;
    text-align: center;
    padding: 0 var(--spacing-xs);
}

.bullet-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bullet-icon.human {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
}

.bullet-icon.ai {
    background: rgba(253, 88, 33, 0.1);
    color: var(--madrid-orange);
}

.bullet-icon.publish {
    background: rgba(0, 81, 69, 0.15);
    color: var(--mallard-green);
}

/* Stage Actor Badge - Horizontal */
.stage-actor-h {
    margin-top: auto;
}

.actor-badge-h {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}

.actor-badge-h.human-actor {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
}

.actor-badge-h.ai-actor {
    background: rgba(253, 88, 33, 0.1);
    color: var(--madrid-orange);
}

.actor-badge-h.publish-actor {
    background: rgba(0, 81, 69, 0.1);
    color: var(--mallard-green);
}

/* Horizontal Arrow */
.stage-arrow-h {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-xs);
}

/* Horizontal Legend */
.workflow-legend-h {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--neutral-blue);
}

.workflow-legend-h .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--oxford-blue);
}

.legend-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color-swatch.human-swatch {
    background: var(--electric-blue);
}

.legend-color-swatch.ai-swatch {
    background: var(--madrid-orange);
}

.legend-color-swatch.output-swatch {
    background: var(--mallard-green);
}

/* Mobile Responsive for Horizontal Layout */
@media (max-width: 900px) {
    .workflow-stages-horizontal {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .stage-arrow-h {
        display: none;
    }

    .stage-card-h {
        width: calc(50% - var(--spacing-sm));
        min-width: 140px;
    }
}

@media (max-width: 500px) {
    .stage-card-h {
        width: 100%;
    }
}

/* Individual Stage Card */
.stage-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--white);
    border-radius: 20px;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-left: 6px solid var(--neutral-blue);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.05),
        0 16px 32px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stage-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.08),
        0 24px 48px rgba(0, 0, 0, 0.04);
}

/* Stage-specific colors */
.stage-card.design-stage {
    border-left-color: var(--electric-blue);
    background: linear-gradient(135deg, rgba(0, 67, 224, 0.03) 0%, var(--white) 100%);
}

.stage-card.draft-stage {
    border-left-color: var(--madrid-orange);
    background: linear-gradient(135deg, rgba(253, 88, 33, 0.03) 0%, var(--white) 100%);
}

.stage-card.review-stage {
    border-left-color: var(--mallard-green);
    background: linear-gradient(135deg, rgba(0, 81, 69, 0.03) 0%, var(--white) 100%);
}

.stage-card.approve-stage {
    border-left-color: var(--electric-blue);
    background: linear-gradient(135deg, rgba(0, 67, 224, 0.03) 0%, var(--white) 100%);
}

.stage-card.publish-stage {
    border-left-color: var(--mallard-green);
    background: linear-gradient(135deg, rgba(0, 81, 69, 0.03) 0%, var(--white) 100%);
}

/* Stage Badge (number) */
.stage-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 28px;
    height: 28px;
    background: var(--oxford-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Stage Icon */
.stage-icon {
    margin-bottom: var(--spacing-sm);
}

/* Stage Title */
.stage-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-xs);
}

/* Stage Content */
.stage-content {
    margin-bottom: var(--spacing-sm);
}

.stage-description {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: var(--spacing-sm);
}

/* Stage Details */
.stage-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.detail-icon.human {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
}

.detail-icon.ai {
    background: rgba(253, 88, 33, 0.1);
    color: var(--madrid-orange);
}

/* Iteration Badge */
.detail-item.iteration {
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.iteration-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(0, 81, 69, 0.1);
    color: var(--mallard-green);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Output Badge */
.detail-item.output {
    margin-top: var(--spacing-xs);
}

.output-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 4px 10px;
    background: var(--mallard-green);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Stage Actor */
.stage-actor {
    margin-top: var(--spacing-sm);
}

.actor-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.actor-badge.human-actor {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
    border: 1px solid rgba(0, 67, 224, 0.2);
}

.actor-badge.ai-actor {
    background: rgba(253, 88, 33, 0.1);
    color: var(--madrid-orange);
    border: 1px solid rgba(253, 88, 33, 0.2);
}

.actor-badge.publish-actor {
    background: rgba(0, 81, 69, 0.1);
    color: var(--mallard-green);
    border: 1px solid rgba(0, 81, 69, 0.2);
}

/* Workflow Legend */
.workflow-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--neutral-blue);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
}

.legend-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.legend-icon.human {
    background: rgba(0, 67, 224, 0.1);
    color: var(--electric-blue);
}

.legend-icon.ai {
    background: rgba(253, 88, 33, 0.1);
    color: var(--madrid-orange);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Methods Paragraph Section */
.methods-paragraph-section {
    padding: var(--spacing-xl) 0;
    background: var(--light-bg);
}

.methods-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04);
}

.methods-card h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-md);
}

.methods-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.methods-text strong {
    color: var(--oxford-blue);
    font-weight: 600;
}

/* Appendix Section */
.methods-appendix-section {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
    background: var(--white);
}

.appendix-card {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(1, 30, 65, 0.02) 0%, rgba(0, 67, 224, 0.03) 100%);
    border: 1px solid var(--neutral-blue);
    border-radius: 16px;
    padding: var(--spacing-xl);
}

.appendix-card h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--neutral-blue);
}

.appendix-content h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
    color: var(--electric-blue);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.appendix-content h3:first-child {
    margin-top: 0;
}

.appendix-content p {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.appendix-content strong {
    color: var(--oxford-blue);
    font-weight: 600;
}

.appendix-stats {
    margin-top: var(--spacing-md);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
}

.stats-table thead {
    background: var(--oxford-blue);
    color: var(--white);
}

.stats-table th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
}

.stats-table tbody tr:nth-child(even) {
    background: rgba(202, 215, 216, 0.3);
}

.stats-table tbody tr:nth-child(odd) {
    background: var(--white);
}

.stats-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--neutral-blue);
}

.stats-table td:last-child {
    font-weight: 600;
    color: var(--electric-blue);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .production-viz-container {
        padding: var(--spacing-md);
    }

    .production-viz-container .download-btn {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: var(--spacing-md);
        width: 100%;
        justify-content: center;
    }

    .production-diagram {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .diagram-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .diagram-title {
        font-size: 1.25rem;
    }

    .workflow-legend-inline {
        gap: var(--spacing-sm);
    }

    .workflow-legend-inline .legend-item {
        font-size: 0.7rem;
    }

    .diagram-subtitle {
        font-size: 0.9rem;
    }

    .stage-card {
        padding: var(--spacing-md);
    }

    .stage-title {
        font-size: 1.25rem;
    }

    .stage-description {
        font-size: 0.85rem;
    }

    .detail-item {
        font-size: 0.85rem;
    }

    .workflow-legend {
        gap: var(--spacing-md);
    }

    .legend-item {
        font-size: 0.8rem;
    }

    .methods-card {
        padding: var(--spacing-lg);
    }

    .methods-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* Horizontal workflow - stack vertically on mobile */
    .workflow-stages-horizontal {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .stage-card-h {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .stage-arrow-h {
        transform: rotate(90deg);
        padding: var(--spacing-xs) 0;
    }

    /* Appendix mobile */
    .appendix-card {
        padding: var(--spacing-md);
    }

    .appendix-card h2 {
        font-size: 1.25rem;
    }

    .appendix-content h3 {
        font-size: 1rem;
    }

    .appendix-content p {
        font-size: 0.9rem;
    }

    .stats-table {
        font-size: 0.8rem;
    }

    .stats-table th,
    .stats-table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ==========================================================================
   Access Request Modal  (arm-*)
   ========================================================================== */

.arm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 30, 65, 0.65); /* oxford-blue tint */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: var(--spacing-md);
}

.arm-overlay[hidden] {
    display: none;
}

/* arm-* modal lives in styles.css for now; styles.css is >5000 lines — flagged as future split candidate. */
.arm-dialog {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(1, 30, 65, 0.15);
    width: 100%;
    max-width: min(560px, 100%);   /* defence-in-depth: never exceed viewport even if a child has intrinsic overflow */
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;  /* don't chain scroll to body when hitting top/bottom of dialog */
    box-sizing: border-box;
    padding: var(--spacing-xl) var(--spacing-lg);
    position: relative;
}

.arm-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.arm-close:hover {
    color: var(--oxford-blue);
    background: var(--neutral-blue);
}

.arm-title {
    font-family: var(--font-display);
    color: var(--oxford-blue);
    margin-bottom: var(--spacing-xs);
    font-size: 1.75rem;
}

.arm-subtitle {
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

/* Form fields */
.arm-field {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-md);
}

.arm-field label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--oxford-blue);
}

.arm-field label span {
    color: #c0392b;
}

.arm-field input,
.arm-field select,
.arm-field textarea {
    font-family: var(--font-body);
    font-size: 16px;            /* AIDEV-NOTE: iOS Safari auto-zooms on focus when <16px; keep at 16 to prevent zoom-on-tap */
    width: 100%;
    min-width: 0;               /* override flex-item min-width:auto so long <option>s (countries) can't widen the field */
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.arm-field input:focus,
.arm-field select:focus,
.arm-field textarea:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(0, 67, 224, 0.15);
}

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

.arm-error {
    color: #c0392b;
    font-size: 0.82rem;
    margin-top: 0.3rem;
    min-height: 1rem;
}

/* Privacy notice */
.arm-privacy-notice {
    font-size: 0.82rem;
    color: var(--text-light);
    border-top: 1px solid var(--neutral-blue);
    padding-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.arm-privacy-notice a {
    color: var(--electric-blue);
    text-decoration: underline;
}

/* Submit row */
.arm-submit-row {
    display: flex;
    justify-content: flex-end;
}

/* arm-btn-submit mirrors .btn-pill-primary so the modal CTA reads as part of the pill family. */
.arm-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 220px;
    min-height: 44px;
    padding: 0.7rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    color: var(--white);
    background-color: var(--electric-blue);
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(1, 30, 65, 0.08);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.arm-btn-submit:hover:not(:disabled) {
    background-color: var(--oxford-blue);
    transform: translateY(-1px);
}

.arm-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.arm-server-error {
    color: #c0392b;
    font-size: 0.88rem;
    margin-top: var(--spacing-sm);
    text-align: center;
}

/* Success view */
.arm-success-view {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.arm-success-icon {
    font-size: 3rem;
    color: #27ae60;
    margin-bottom: var(--spacing-sm);
}

/* Utility */
.arm-hidden {
    display: none !important;
}

/* AIDEV-NOTE: 0.3.2 — mobile = edge-to-edge sheet. Overlay is the scroll
   container (page-style scroll); dialog is content-sized and full-bleed. */
@media (max-width: 600px) {
    .arm-overlay {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .arm-dialog {
        width: 100%;
        max-width: none;
        min-height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        padding: var(--spacing-md) var(--spacing-md) var(--spacing-xl);
    }

    /* Sticky close button: 44×44 (WCAG 2.5.5). float gives sticky a flow
       context; negative bottom margin claws back line-box so the title
       sits at the top of the dialog instead of being pushed down. */
    .arm-close {
        position: sticky;
        top: var(--spacing-xs);
        float: right;
        margin: 0 0 -2.5rem 0;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.75rem;
        z-index: 1;
        background: var(--white);
        border-radius: 6px;
    }

    .arm-title {
        font-size: 1.35rem;
        line-height: 1.25;
        padding-right: 3rem;            /* room for the sticky close button */
    }

    .arm-subtitle {
        font-size: 0.9rem;
    }

    /* Wrap long field labels; scoped to direct .arm-field children so the
       inline Yes/No radio labels in .arm-radio-group are unaffected. */
    .arm-field > label,
    .arm-field-radio > legend {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .arm-btn-submit {
        width: 100%;
        min-width: 0;
    }
    .arm-submit-row {
        justify-content: stretch;
    }
}

/* AIDEV-NOTE: 0.3.2 — added radio-group, placeholder, and Other-specify styles
   for redesigned access-request form (9 fields, ISO country list). Scoped under
   .arm-* to avoid collisions with other components. */

/* Placeholder styling — match .arm-subtitle grey, italicise for visual cue */
.arm-field input::placeholder,
.arm-field textarea::placeholder {
    color: #90a0ae;
    font-style: italic;
    opacity: 1;                /* Firefox compat */
}

/* Greys out the placeholder option in <select> until a real choice is made.
   Real <option>s explicitly reset to oxford-blue so they're full-strength. */
.arm-field select:invalid {
    color: #90a0ae;
}
.arm-field select option {
    color: var(--oxford-blue);
}

/* Contact-consent radio group */
.arm-field-radio {
    border: none;
    padding: 0;
    margin: 0 0 var(--spacing-md) 0;
}
.arm-field-radio legend {
    font-weight: 600;
    color: var(--oxford-blue);
    margin-bottom: 0.35rem;
    padding: 0;
}
.arm-radio-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    margin-top: 0.35rem;
}
.arm-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;          /* override .arm-field label boldness */
    color: var(--oxford-blue);
    cursor: pointer;
}
.arm-radio-group input[type="radio"] {
    accent-color: var(--electric-blue);
}

/* Other-specify input (revealed when parent select == 'other') */
.arm-other-input {
    margin-top: 0.5rem;
}
.arm-other-input.arm-hidden {
    display: none !important;
}

/* De-emphasise label of optional fields */
.arm-field--optional label {
    font-weight: 500;
}
