/* ====================
   GLOBAL STYLES
   ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d7a3e;
    --primary-light: #4a9d57;
    --primary-dark: #1f5430;
    --secondary-color: #5a7c3e;
    --accent-color: #e8944a;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

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

a:hover {
    color: var(--primary-dark);
}

/* ====================
   NAVBAR
   ==================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

#soil-parameters,
#scoresheet {
    scroll-margin-top: 90px;
}

.logo-icon {
    font-size: 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--bg-white);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* ====================
   HERO SECTION
   ==================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    padding: 100px 20px;
    text-align: center;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
}

/* Home page: compact the introduction and centre its three destination links. */
.home-page .hero {
    min-height: 250px;
    padding: 40px 20px;
}

.home-page .hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.home-page .hero p {
    margin-bottom: 0;
}

/* ====================
   BUTTONS
   ==================== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: #d97a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 148, 74, 0.3);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 122, 62, 0.3);
}

/* ====================
   CONTAINER & SPACING
   ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====================
   FRAMEWORK SECTION
   ==================== */
.framework-section {
    background-color: var(--bg-white);
    padding: 80px 20px;
}

.framework-section h2,
.assessment-section h2,
.resources-section h2 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
    margin-bottom: 50px;
}

.framework-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.home-page .framework-section {
    padding: 40px 20px;
}

.home-page .framework-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 960px;
    margin: 0 auto;
}

.home-page .step-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.step-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.step-number {
    font-size: 30px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.step-card h3 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.25;
}

.step-card p {
    color: var(--text-light);
    line-height: 1.3;
    font-size: 13px;
}

.step-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.step-link:hover {
    text-decoration: underline;
}

.step-heading-link {
    color: var(--primary-dark);
    text-decoration: none;
}

.step-heading-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ====================
   ASSESSMENT SECTION
   ==================== */
.assessment-section {
    background-color: var(--bg-light);
    padding: 80px 20px;
}

.assessment-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.assessment-panel {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.assessment-panel h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 24px;
}

.attribute-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.attribute-column .form-group {
    margin-bottom: 16px;
}

.potassium-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: end;
    margin-bottom: 16px;
    grid-column: 1 / -1;
}

.potassium-row .button-group .btn {
    width: 100%;
}

.reset-button-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.reset-button-row .btn {
    min-width: 190px;
}

@media (max-width: 900px) {
    .potassium-row {
        grid-template-columns: 1fr;
    }
    .reset-button-row {
        justify-content: flex-start;
    }
}

.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.results-left,
.results-right {
    display: grid;
    gap: 20px;
}

.results-right {
    align-self: start;
}

@media (max-width: 900px) {
    .attribute-grid,
    .results-layout {
        grid-template-columns: 1fr;
    }
}

/* ====================
   FORM STYLES
   ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(45, 122, 62, 0.2);
}

/* ====================
   SEARCH STYLES
   ==================== */
.search-section, .doc-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.search-section h4,
.doc-section h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 14px;
}

.doc-section-layout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.doc-section-column {
    display: flex;
    flex-direction: column;
}

.doc-section-column-right {
    align-items: center;
}

.doc-subheading {
    margin: 0 0 8px 0;
    text-align: center;
}

.doc-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
    align-items: center;
    justify-content: center;
}

.doc-link-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(232, 148, 74, 0.14);
    border: 1px solid rgba(232, 148, 74, 0.32);
    color: #9a571d;
    font-size: 13px;
    font-weight: 600;
}

.doc-link-pill:hover {
    background: rgba(232, 148, 74, 0.24);
    color: #7d4515;
}

@media (max-width: 900px) {
    .doc-section-layout {
        grid-template-columns: 1fr;
    }

    .doc-section-column-right {
        align-items: flex-start;
    }

    .doc-subheading {
        text-align: left;
    }

    .doc-link-row {
        justify-content: flex-start;
    }
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(232, 148, 74, 0.3);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-light);
}

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

.result-genus {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.result-species {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.result-description {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    font-style: italic;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

/* ====================
   RESULTS PANEL
   ==================== */
.results-panel {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4f1 100%);
    padding: 20px;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-empty {
    text-align: center;
    color: var(--text-light);
}

.overall-score {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.score-gauge {
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.score-label {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.assessment-summary {
    background-color: var(--bg-white);
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

.assessment-summary h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.assessment-summary p {
    color: var(--text-light);
    font-size: 14px;
}

.score-details {
    display: grid;
    gap: 12px;
}

.score-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: linear-gradient(90deg, rgba(45, 122, 62, 0.05), transparent);
    border-left: 3px solid var(--primary-color);
    border-radius: 3px;
}

.score-detail-label {
    font-weight: 600;
    color: var(--text-dark);
}

.score-detail-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 18px;
}

#benefitsList {
    list-style: none;
    padding: 0;
}

#benefitsList li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

#benefitsList li:before {
    content: "✓ ";
    color: var(--success-color);
    font-weight: bold;
    margin-right: 8px;
}

#benefitsList li:last-child {
    border-bottom: none;
}

.recommendations-list {
    background-color: var(--bg-light);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--warning-color);
}

.recommendations-list p {
    margin: 8px 0;
    color: var(--text-light);
}

/* ====================
   RESOURCES SECTION
   ==================== */
.resources-section {
    background-color: var(--bg-white);
    padding: 80px 20px;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.resource-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.resource-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.resource-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
}

.resource-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.resource-link:hover {
    color: var(--accent-color);
    margin-left: 5px;
}

.bottom-resource-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 16px;
    padding: 26px 28px;
    margin-top: 40px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.bottom-resource-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    text-align: center;
}

.bottom-resource-bar h3 {
    color: var(--bg-white);
    font-size: 24px;
    margin: 0;
    font-weight: 700;
}

.bottom-resource-bar h3 a {
    color: var(--bg-white);
    text-decoration: none;
}

.bottom-resource-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.scoresheet-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.scoresheet-upload-row {
    grid-column: 1 / -1;
}

.scoresheet-upload-card {
    display: grid;
    gap: 14px;
}

.scoresheet-upload-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scoresheet-upload-tab {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.22);
    color: var(--bg-white);
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 14px;
}

.scoresheet-upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

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

.scoresheet-upload-status {
    color: var(--bg-white);
    font-size: 13px;
    font-weight: 600;
}

.scoresheet-fertiliser-full {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.fertiliser-table-wrapper {
    overflow-x: auto;
}

.fertiliser-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 680px;
}

#microbialTable {
    min-width: 0;
    table-layout: fixed;
}

#microbialTable th:first-child,
#microbialTable td:first-child {
    width: 44%;
}

#microbialTable th:nth-child(2),
#microbialTable td:nth-child(2),
#microbialTable th:nth-child(3),
#microbialTable td:nth-child(3) {
    width: 28%;
}

#microbialTable .fert-total-value {
    text-align: right;
}

.fertiliser-table thead tr {
    background: rgba(255, 255, 255, 0.15);
}

.fertiliser-table th {
    color: var(--bg-white);
    font-weight: 700;
    font-size: 12px;
    padding: 10px 10px;
    text-align: left;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.fertiliser-table th .col-sub {
    font-weight: 400;
    opacity: 0.75;
    font-size: 11px;
    display: block;
}

.fertiliser-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s;
}

.fertiliser-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.07);
}

.fertiliser-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.fert-product {
    color: var(--bg-white);
    font-weight: 600;
    white-space: nowrap;
    min-width: 140px;
}

.fert-input {
    width: 90px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    font-size: 13px;
    text-align: right;
    appearance: textfield;
    -moz-appearance: textfield;
}

.fert-input::-webkit-inner-spin-button,
.fert-input::-webkit-outer-spin-button {
    opacity: 0.5;
}

.fert-input:focus {
    outline: 2px solid #6ab971;
    background: #fff;
}

.fert-stat {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    min-width: 60px;
}

.fert-usecase {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    min-width: 180px;
}

.fert-total-row {
    background: rgba(255, 255, 255, 0.12);
    border-top: 2px solid rgba(255, 255, 255, 0.4);
}

.fert-total-label {
    color: var(--bg-white);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 12px 10px;
}

.fert-total-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    text-align: left;
    padding: 12px 10px;
}

.scoresheet-top-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.scoresheet-quad-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.scoresheet-card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    padding: 18px;
    text-align: left;
}

.scoresheet-card h4 {
    color: var(--bg-white);
    margin: 0 0 14px 0;
    font-size: 16px;
    font-weight: 700;
}

.parameter-spectrum {
    position: relative;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.spectrum-segment {
    flex: 1;
    min-height: 72px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.parameter-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #000000;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.parameter-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 14px;
    background: linear-gradient(180deg, #eeeeee 0%, #b8b8b8 100%);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    -webkit-clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
    z-index: 4;
}

.parameter-marker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 14px;
    background: linear-gradient(180deg, #b8b8b8 0%, #eeeeee 100%);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
    -webkit-clip-path: polygon(50% 0, 0 100%, 100% 100%);
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.18));
    z-index: 4;
}

/* Edge-clamped marker styling for values beyond setpoints */
.parameter-marker.edge-clamped {
    width: 4px;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 4px 2px rgba(231, 76, 60, 0.4);
    animation: edge-clamp-pulse 2s ease-in-out infinite;
}

@keyframes edge-clamp-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 4px 2px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 8px 4px rgba(231, 76, 60, 0.6);
    }
}

.spectrum-low {
    background: #e8944a;
    color: #2d1f15;
}

.spectrum-mid {
    background: #6ab971;
    color: #153521;
}

.spectrum-high {
    background: #8e62bf;
    color: #ffffff;
}

.parameter-spectrum-empty .spectrum-segment {
    color: transparent;
}

.scoresheet-fields {
    display: grid;
    gap: 14px;
}

.two-column-fields {
    grid-template-columns: 1fr 1fr;
}

.scoresheet-card .form-group {
    margin-bottom: 0;
}

.scoresheet-card label {
    color: var(--bg-white);
    font-weight: 600;
}

.scoresheet-card input {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: var(--text-dark);
}

.percentage-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.percentage-input-wrapper input {
    flex: 1;
}

.percentage-input-wrapper span {
    color: var(--bg-white);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .scoresheet-grid {
        grid-template-columns: 1fr;
    }

    .scoresheet-top-row {
        grid-template-columns: 1fr;
    }

    .scoresheet-upload-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .scoresheet-quad-grid {
        grid-template-columns: 1fr;
    }

    .spectrum-segment {
        min-height: 58px;
    }

    .two-column-fields {
        grid-template-columns: 1fr;
    }
}

.resource-tab-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    color: var(--bg-white);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.resource-tab-link:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}
.plant-trials-content {
    width: 100%;
    align-items: stretch;
    text-align: left;
}
.plant-trials-intro {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    margin: 0;
}

.plant-trials-tabs {
    display: inline-flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 6px;
}

.plant-trials-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plant-trials-tab.active {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.plant-trials-tab-panel {
    display: none;
    gap: 16px;
}

.plant-trials-tab-panel.active {
    display: grid;
}

.plant-trials-form {
    display: grid;
    gap: 16px;
}
.plant-trials-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.plant-trials-form .form-group {
    margin-bottom: 0;
}
.plant-trials-form label {
    color: var(--bg-white);
}
.plant-trials-submit-group {
    grid-column: span 3;
    display: flex;
    align-items: flex-end;
}
.plant-trials-submit-group .btn {
    width: 100%;
}
.plant-trials-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
}

.plant-trials-visual-controls {
    display: grid;
    gap: 14px;
}

.plant-trials-wide-field {
    grid-column: span 3;
}

.plant-trials-visual-controls textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    font-family: inherit;
    resize: vertical;
}

.plant-trials-file-name {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}
.plant-trials-format-guide {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}
.plant-trials-format-guide h2 {
    margin-bottom: 8px;
    color: var(--bg-white);
    font-size: 18px;
}
.plant-trials-format-guide p {
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
}
.plant-trials-result {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 16px;
    color: var(--bg-white);
}
.trial-result-header h4,
.trial-table-wrap h4 {
    margin-bottom: 10px;
    color: var(--bg-white);
}
.trial-result-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}
.trial-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 20px;
}
.trial-card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    padding: 12px;
}
.trial-card h5 {
    margin-bottom: 6px;
    color: var(--bg-white);
}
.trial-card p {
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
}
.trial-plain-language {
    margin: 8px 0 12px;
    color: var(--bg-white);
    font-size: 14px;
}
.trial-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.trial-metric-chart {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}
.trial-metric-chart h5 {
    margin-bottom: 10px;
    color: var(--bg-white);
    font-size: 13px;
}
.trial-key-metric {
    border: 3px solid #f0bc6c;
    background: rgba(240, 188, 108, 0.16);
}
.trial-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 700;
}
.trial-table-wrap {
    overflow-x: auto;
    margin-bottom: 14px;
}
.trial-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 840px;
    font-size: 13px;
}
.trial-table th,
.trial-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.trial-table th {
    color: var(--bg-white);
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}
.trial-table td {
    color: rgba(255, 255, 255, 0.9);
}
.trial-error {
    color: #ffd8d8;
    background: rgba(203, 47, 47, 0.28);
    border: 1px solid rgba(255, 174, 174, 0.5);
    padding: 10px;
    border-radius: 8px;
}

.trial-visual-summary {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    font-weight: 600;
}

.trial-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.trial-visual-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    padding: 12px;
}

.trial-visual-card h4 {
    margin-bottom: 10px;
    color: #ffffff;
}

.trial-metric-block {
    margin-bottom: 10px;
}

.trial-metric-block h5 {
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trial-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.trial-bar-label,
.trial-bar-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.88);
}

.trial-bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.trial-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.trial-bar-positive {
    background: linear-gradient(90deg, #78d47e 0%, #42ad5f 100%);
}

.trial-bar-negative {
    background: linear-gradient(90deg, #ef9a8d 0%, #cf4f45 100%);
}

.trial-no-data {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* Assessment and resources are accessed through the home-page quick links. */
.home-page #assessment,
.home-page #resources {
    display: none;
}

.focused-performance-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.focused-performance-section-heading {
    margin-bottom: 16px;
}

.focused-performance-section-heading h3 {
    color: #ffffff;
    margin-bottom: 4px;
}

.focused-performance-section-heading p {
    color: rgba(255, 255, 255, 0.86);
    margin: 0;
}

.focused-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.focused-performance-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    overflow: hidden;
}

.focused-performance-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(16, 59, 78, 0.45);
}

.focused-performance-heading h4,
.focused-performance-heading h5 {
    color: #ffffff;
    margin: 0;
}

.focused-performance-heading h4 {
    font-size: 17px;
}

.focused-performance-heading h5 {
    font-size: 14px;
    text-align: right;
}

.focused-performance-content {
    display: grid;
    grid-template-columns: minmax(190px, 0.95fr) minmax(210px, 1.05fr);
    gap: 14px;
    padding: 14px;
}

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

.focused-performance-table {
    width: 100%;
    min-width: 190px;
    border-collapse: collapse;
    font-size: 12px;
}

.focused-performance-table th,
.focused-performance-table td {
    padding: 7px 8px;
    text-align: right;
    color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.focused-performance-table thead th {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.focused-performance-table th:first-child {
    text-align: left;
}

.focused-chart {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.focused-chart-scale {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    text-align: right;
}

.focused-chart-groups {
    display: flex;
    flex: 1;
    min-height: 164px;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: 16px;
    padding: 12px 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    overflow-x: auto;
}

.focused-chart-group {
    display: grid;
    min-width: 82px;
    flex: 0 0 82px;
    grid-template-rows: 130px auto;
    gap: 5px;
    text-align: center;
}

.focused-chart-bars {
    display: flex;
    height: 130px;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}

.focused-bar-column {
    display: flex;
    width: 16px;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.focused-bar-value {
    display: none;
}

.focused-bar,
.focused-legend-swatch {
    background: #999999;
}

.focused-bar {
    width: 100%;
    min-height: 0;
}

.focused-chart-level {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.focused-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 10px;
    padding-top: 9px;
}

.focused-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
}

.focused-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
}

.focused-treatment-0 { background: #a3a3a3; }
.focused-treatment-1 { background: #89bf82; }
.focused-treatment-2 { background: #4e9854; }
.focused-treatment-3 { background: #296b38; }
.focused-treatment-4 { background: #d4a44d; }
.focused-treatment-5 { background: #5190b2; }

@media (max-width: 900px) {
    .plant-trials-grid {
        grid-template-columns: 1fr;
    }

    .plant-trials-wide-field,
    .plant-trials-submit-group {
        grid-column: span 1;
    }

    .trial-metric-grid {
        grid-template-columns: 1fr;
    }

    .trial-recommendations-grid {
        grid-template-columns: 1fr;
    }

    .trial-visual-grid {
        grid-template-columns: 1fr;
    }

    .focused-performance-grid {
        grid-template-columns: 1fr;
    }

    .focused-performance-content {
        grid-template-columns: 1fr;
    }
}

/* ====================
   MODALS
   ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 50px auto;
    padding: 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-color);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 32px;
}

.modal-content h3 {
    color: var(--primary-dark);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 20px;
}

.modal-content ul {
    margin-left: 20px;
    line-height: 1.8;
    color: var(--text-light);
}

.modal-content li {
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

/* ====================
   FOOTER
   ==================== */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
}

.footer-content p {
    margin: 10px 0;
    opacity: 0.95;
}

/* ====================
   RESPONSIVE DESIGN
   ==================== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 15px;
    }

    .nav-logo {
        font-size: 18px;
    }

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

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

    .assessment-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .framework-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .home-page .hero {
        min-height: 200px;
        padding: 30px 20px;
    }

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

    .home-page .framework-section {
        padding: 30px 20px;
    }

    .home-page .framework-steps {
        grid-template-columns: 1fr;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-content {
        width: 95%;
        margin: 30px auto;
        padding: 25px;
    }

    .framework-section h2,
    .assessment-section h2,
    .resources-section h2 {
        font-size: 28px;
    }

    .overall-score {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 10px;
    }
    .plant-trials-grid {
        grid-template-columns: 1fr;
    }
    .trial-recommendations-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 10px;
        font-size: 14px;
    }

    .nav-logo {
        font-size: 14px;
    }

    .logo-icon {
        font-size: 20px;
    }

    .hero {
        padding: 60px 20px;
        min-height: 350px;
    }

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

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

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .assessment-panel {
        padding: 20px;
    }

    .step-card {
        padding: 20px;
    }

    .resource-card {
        padding: 20px;
    }

    .modal-content {
        padding: 20px;
        margin: 20px auto;
    }

    .modal-content h2 {
        font-size: 24px;
    }

    .modal-content h3 {
        font-size: 18px;
    }
}

/* ====================
   UTILITY CLASSES
   ==================== */
.hidden {
    display: none !important;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}
