/* =========================================================
   HERB-AI | BOTANICAL SAGE DESIGN SYSTEM
   Soft, calm, responsive and consistent
========================================================= */

:root {
    --page: #f5f7f2;
    --surface: #ffffff;
    --surface-soft: #edf3eb;
    --surface-sage: #e4ede2;

    --green: #315c46;
    --green-dark: #234634;
    --green-deep: #193a2b;
    --green-soft: #6e9278;
    --green-pale: #dce9dc;

    --text: #26382d;
    --muted: #78867b;
    --border: #e2e9e0;

    --danger: #a94c43;
    --warning-bg: #fff5df;
    --warning-text: #8b641e;

    --shadow-sm: 0 3px 12px rgba(35, 70, 52, .045);
    --shadow: 0 10px 30px rgba(35, 70, 52, .065);
    --shadow-hover: 0 16px 38px rgba(35, 70, 52, .10);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --container: 1200px;
    --nav-height: 78px;

    --transition: 220ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
    min-height: 100vh;
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    background: var(--page);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
}

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

button {
    cursor: pointer;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--green-pale);
    color: var(--green-deep);
}

/* =========================================================
   GLOBAL LAYOUT
========================================================= */

main {
    min-height: 65vh;
}

.section {
    width: min(100% - 48px, var(--container));
    margin: 0 auto;
    padding: 76px 0;
}

.section-top {
    padding-top: 15px;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 25px;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 36px;
    text-align: center;
}

.section-heading h2 {
    margin: 8px 0 12px;
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.25;
    font-weight: 600;
}

.section-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.section-tag,
.eyebrow {
    display: inline-block;
    color: var(--green-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* =========================================================
   NAVIGATION
========================================================= */

.navbar,
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid rgba(226, 233, 224, .9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-container,
.header-inner {
    width: min(100% - 48px, 1300px);
    min-height: var(--nav-height);
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--green);
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 27px;
    font-weight: 700;
    white-space: nowrap;
}

.logo i,
.brand-icon {
    font-size: 25px;
}

.nav-links,
.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-links a,
.main-nav a {
    padding: 9px 13px;
    border-radius: 9px;
    color: #536458;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active,
.main-nav a:hover,
.main-nav a.active {
    color: var(--green-dark);
    background: var(--surface-sage);
}

/* =========================================================
   BUTTONS
========================================================= */

.btn,
.btn-primary,
.btn-outline {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 21px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--green);
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition:
        transform var(--transition),
        background var(--transition),
        box-shadow var(--transition);
}

.btn:hover,
.btn-primary:hover {
    background: var(--green-dark);
    box-shadow: 0 7px 17px rgba(49, 92, 70, .16);
    transform: translateY(-2px);
}

.btn-outline {
    color: var(--green);
    background: transparent;
    border-color: #cbd9cb;
}

.btn-outline:hover {
    background: var(--surface-sage);
    border-color: #aebfae;
    transform: translateY(-2px);
}

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

/* =========================================================
   HERO SECTIONS
========================================================= */

.home-hero {
    position: relative;
    overflow: hidden;
    min-height: 540px;
    padding: 85px max(7%, calc((100% - 1250px) / 2));
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 55px;
    background:
        radial-gradient(circle at 80% 25%, rgba(220, 233, 220, .75), transparent 30%),
        linear-gradient(120deg, #f5f7f0, #edf3eb);
}

.hero-content {
    max-width: 700px;
}

.home-hero h1,
.page-hero h1 {
    margin: 17px 0 20px;
    color: var(--green-deep);
    font-family: Georgia, serif;
    font-size: clamp(36px, 4.5vw, 57px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: -.7px;
}

.home-hero h1 em,
.page-hero h1 em {
    color: var(--green-soft);
    font-style: normal;
}

.home-hero p,
.page-hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.95;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 30px;
}

.hero-visual {
    min-height: 340px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-circle {
    width: 265px;
    height: 265px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    background: linear-gradient(145deg, #e4eee1, #d5e5d5);
    box-shadow: var(--shadow);
}

.hero-circle span {
    font-size: 112px;
}

.floating-card {
    position: absolute;
    padding: 13px 18px;
    border: 1px solid rgba(226, 233, 224, .9);
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    color: var(--green);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 700;
}

.card-one {
    top: 38px;
    right: 0;
}

.card-two {
    bottom: 38px;
    left: 0;
}

.page-hero {
    padding: 82px 24px 74px;
    text-align: center;
    background:
        radial-gradient(circle at 15% 15%, rgba(220, 233, 220, .55), transparent 25%),
        linear-gradient(135deg, #f2f6ef, #eaf1e9);
}

.page-hero h1 {
    font-size: clamp(34px, 4vw, 48px);
}

.page-hero p {
    margin: auto;
}

/* =========================================================
   STATISTICS
========================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 35px;
}

.stat-card,
.stats>div {
    padding: 25px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover,
.stats>div:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-card strong,
.stats>div strong {
    display: block;
    margin-bottom: 5px;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 600;
}

.stat-card span,
.stats>div span {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   HOME FEATURE CARDS
========================================================= */

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

.feature-grid-two {
    max-width: 900px;
    margin: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    display: inline-flex;
    margin-bottom: 17px;
    font-size: 30px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--green);
    font-size: 18px;
}

.feature-card p {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.85;
}

.feature-card a,
.text-link {
    color: var(--green);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.feature-card a:hover,
.text-link:hover {
    color: var(--green-dark);
    text-decoration: underline;
}

.highlight-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 65px;
    padding: 40px;
    border: 1px solid #e1eadf;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, #edf4eb, #e5eee3);
}

.highlight-section h2 {
    margin: 10px 0 14px;
    color: var(--green-deep);
    font-family: Georgia, serif;
    font-size: 29px;
    line-height: 1.3;
}

.highlight-section p {
    max-width: 650px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 14px;
}

.highlight-icon {
    flex-shrink: 0;
    font-size: 85px;
}

/* =========================================================
   PLANT EXPLORER
========================================================= */

.explorer-hero,
.intelligence-hero {
    padding: 70px 24px;
    background: linear-gradient(120deg, #eef4eb, #f9fbf7);
    border-radius: 0 0 26px 26px;
}

.explorer-hero-content,
.intelligence-hero-content {
    max-width: 760px;
    margin: auto;
    text-align: center;
}

.explorer-hero h1,
.intelligence-hero h1 {
    margin: 15px 0;
    color: var(--green-deep);
    font-family: Georgia, serif;
    font-size: clamp(35px, 4.5vw, 52px);
    font-weight: 500;
    line-height: 1.2;
}

.explorer-hero h1 span,
.intelligence-hero h1 span {
    color: var(--green-soft);
}

.explorer-hero p,
.intelligence-hero p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.explorer-search,
.explorer-results {
    width: min(100% - 48px, var(--container));
    margin: auto;
    padding: 45px 0;
}

.search-form {
    max-width: 850px;
    margin: auto;
    padding: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.search-form input {
    flex: 1;
    min-width: 200px;
    height: 48px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fbfcfa;
    color: var(--text);
    font-size: 14px;
    transition: border var(--transition), box-shadow var(--transition);
}

.search-form input:focus,
.form-group select:focus,
textarea:focus {
    border-color: var(--green-soft);
    box-shadow: 0 0 0 3px rgba(110, 146, 120, .13);
}

.clear-search {
    padding: 8px 12px;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* =========================================================
   PLANT CARDS
========================================================= */

.plant-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.plant-card {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.plant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.plant-card-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--green);
}

.plant-card h3 {
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 20px;
    overflow-wrap: anywhere;
}

.plant-card .scientific-name,
.plant-card .scientific {
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.plant-details {
    display: grid;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
}

.plant-details p {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.plant-details strong {
    color: var(--green);
}

.traditional-uses {
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.85;
}

.traditional-uses h4,
.plant-card h4 {
    margin-bottom: 7px;
    color: var(--green);
    font-size: 13px;
}

/* =========================================================
   RESULT NAVIGATION / SEARCH HIGHLIGHT
========================================================= */

#search-results,
#results,
#analysis-results,
#research-results,
#plant-results,
#selected-plant,
#cluster-overview {
    scroll-margin-top: calc(var(--nav-height) + 24px);
}

.search-highlight {
    animation: resultHighlight 1.8s ease;
}

@keyframes resultHighlight {
    0% {
        outline: 3px solid rgba(110, 146, 120, .45);
        outline-offset: 5px;
    }

    100% {
        outline: 3px solid transparent;
        outline-offset: 12px;
    }
}

/* =========================================================
   PLANT INTELLIGENCE
========================================================= */

.intelligence-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 25px auto;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #5eaa75;
    box-shadow: 0 0 0 4px rgba(94, 170, 117, .12);
}

.status-error {
    background: #cf6258;
}

.intelligence-selection,
.selected-plant-section,
.similar-plants-section,
.cluster-overview {
    width: min(100% - 48px, var(--container));
    margin: auto;
    padding: 42px 0;
}

.intelligence-selection .section-heading,
.selected-plant-section .section-heading,
.similar-plants-section .section-heading,
.cluster-overview .section-heading {
    margin-bottom: 30px;
}

.intelligence-form {
    max-width: 700px;
    margin: auto;
    padding: 26px;
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.form-group {
    flex: 1;
    min-width: 220px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
}

.form-group select {
    width: 100%;
    min-height: 47px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fbfcfa;
    color: var(--text);
}

.intelligence-form button {
    min-height: 47px;
}

/* Selected plant */

.selected-plant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.selected-plant-info {
    min-width: 0;
}

.plant-label,
.cluster-badge span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.selected-plant-info h3 {
    margin: 10px 0 5px;
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: 28px;
}

.scientific-name {
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}

.plant-family,
.traditional-use {
    margin-top: 11px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.plant-family strong,
.traditional-use strong {
    color: var(--green);
}

.cluster-badge {
    min-width: 125px;
    padding: 22px;
    border: 1px solid #e0eade;
    border-radius: 14px;
    background: var(--surface-soft);
    text-align: center;
}

.cluster-badge strong {
    display: block;
    margin-top: 7px;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 38px;
}

/* ML statistics */

.ml-statistics {
    width: min(100% - 48px, var(--container));
    margin: auto;
    padding: 15px 0 40px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.ml-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--green);
}

.ml-stat-card h3 {
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: 27px;
}

.ml-stat-card p {
    color: var(--muted);
    font-size: 12px;
}

/* Similar plants */

.similar-plants-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.similar-plant-card {
    min-width: 0;
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.similar-plant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.similar-card-top,
.similarity-heading,
.cluster-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.plant-number {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.similar-cluster {
    padding: 5px 10px;
    border-radius: 30px;
    background: var(--surface-soft);
    color: var(--green);
    font-size: 10px;
}

.similar-plant-card h3 {
    margin: 18px 0 5px;
    color: var(--green-dark);
    font-size: 18px;
    overflow-wrap: anywhere;
}

.similar-family,
.similar-use {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.similarity-heading {
    margin-top: 20px;
    color: var(--text);
    font-size: 12px;
}

.similarity-heading strong {
    color: var(--green);
}

.similarity-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    margin-top: 9px;
    border-radius: 30px;
    background: #e9eee7;
}

.similarity-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9fbea0, #47765b);
    transition: width .6s ease;
}

/* Clusters */

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

.cluster-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}

.cluster-card:hover {
    transform: translateY(-4px);
}

.cluster-icon {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--green);
}

.cluster-card-header span {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.cluster-card h3 {
    margin-top: 17px;
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: 30px;
}

.cluster-card>p {
    color: var(--muted);
    font-size: 12px;
}

.cluster-plants {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.cluster-plants span {
    padding: 6px 9px;
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--green-dark);
    font-size: 10px;
}

.cluster-plants .more-plants {
    background: var(--green-pale);
    font-weight: 700;
}

.ml-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: min(100% - 48px, var(--container));
    margin: 25px auto 55px;
    padding: 21px;
    border: 1px solid #dfe9dc;
    border-radius: 13px;
    background: #edf4eb;
    color: var(--green-dark);
}

.ml-disclaimer>i {
    margin-top: 3px;
    color: var(--green);
    font-size: 20px;
}

.ml-disclaimer h3 {
    margin-bottom: 6px;
    font-size: 14px;
}

.ml-disclaimer p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

/* =========================================================
   EMPTY STATES
========================================================= */

.empty-state {
    min-height: 220px;
    padding: 45px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd9ca;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .7);
    color: var(--muted);
    text-align: center;
}

.empty-state>span,
.empty-state>i {
    margin-bottom: 13px;
    color: var(--green-soft);
    font-size: 32px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 21px;
}

.empty-state p {
    max-width: 550px;
    font-size: 13px;
}

/* =========================================================
   TRADITIONAL KNOWLEDGE UPLOAD
========================================================= */

.upload-panel {
    max-width: 850px;
    margin: auto;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.upload-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.file-label {
    display: block;
    width: 100%;
    padding: 25px;
    border: 1px dashed #afc5ae;
    border-radius: 13px;
    background: #f7faf5;
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border var(--transition);
}

.file-label:hover {
    border-color: var(--green-soft);
    background: var(--surface-soft);
}

.file-label input {
    display: block;
    width: 100%;
    margin-top: 13px;
    color: var(--muted);
    font-size: 12px;
}

.file-name {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.small-note {
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #f0d0c9;
    border-radius: 10px;
    background: #fff4f1;
    color: var(--danger);
    font-size: 13px;
}

.tag-warning {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 10px;
    font-weight: 700;
}

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

/* =========================================================
   NOTICES
========================================================= */

.notice {
    margin-top: 28px;
    padding: 21px;
    border: 1px solid #dfe9dc;
    border-radius: 13px;
    background: #edf4eb;
}

.notice strong {
    display: block;
    margin-bottom: 7px;
    color: var(--green);
    font-size: 13px;
}

.notice p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.85;
}

/* =========================================================
   TABLES
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 14px 17px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

th {
    background: var(--surface-soft);
    color: var(--green);
    font-weight: 800;
}

td {
    color: var(--text);
}

tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   RESEARCH
========================================================= */

.research-list {
    display: grid;
    gap: 17px;
}

.research-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.research-card h3 {
    margin-bottom: 11px;
    color: var(--green);
    font-size: 18px;
}

.research-card p {
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.research-card strong {
    color: var(--green-dark);
}

.research-card blockquote {
    margin-top: 14px;
    padding: 13px 16px;
    border-left: 3px solid var(--green-soft);
    border-radius: 0 9px 9px 0;
    background: #f5f8f3;
    color: #657568;
    font-size: 12px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.count-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
}

/* =========================================================
   ANALYTICS DASHBOARD
========================================================= */

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.chart-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    margin-bottom: 5px;
    color: var(--green-dark);
    font-size: 16px;
}

.chart-card .chart-description {
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 11px;
}

.chart {
    width: 100%;
    min-height: 320px;
}

#analytics-data {
    display: none;
}

/* =========================================================
   FOOTER
========================================================= */

.footer,
.site-footer {
    padding: 40px 24px 20px;
    background: var(--green-deep);
    color: white;
}

.footer-inner {
    width: min(100%, var(--container));
    margin: auto;
}

.footer-brand {
    margin-bottom: 23px;
}

.footer-brand h3 {
    margin-bottom: 8px;
    font-family: Georgia, serif;
    font-size: 24px;
}

.footer-brand p {
    max-width: 430px;
    color: #d0ddd1;
    font-size: 12px;
}

.footer-bottom {
    margin-top: 23px;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    text-align: center;
}

.footer-bottom p {
    color: #c8d6ca;
    font-size: 11px;
}

/* =========================================================
   ERROR PAGE
========================================================= */

.error-page {
    min-height: 60vh;
    padding: 65px 20px;
    text-align: center;
}

.error-page h1 {
    margin: 10px 0;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 65px;
}

.error-page h2 {
    margin-bottom: 12px;
    color: var(--green-dark);
}

.error-page p {
    margin-bottom: 25px;
    color: var(--muted);
}

/* =========================================================
   ADDITIONAL ELEMENTS
========================================================= */

.subheading {
    margin: 30px 0 15px;
    color: var(--green-dark);
    font-family: Georgia, serif;
    font-size: 21px;
}

/* =========================================================
   RESPONSIVE DESIGN
========================================================= */

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

    .plant-grid,
    .card-grid,
    .similar-plants-grid,
    .cluster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        margin: auto;
    }

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

    .hero-visual {
        min-height: 280px;
    }

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

@media (max-width: 760px) {
    :root {
        --nav-height: 105px;
    }

    .nav-container,
    .header-inner {
        width: calc(100% - 28px);
        min-height: var(--nav-height);
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 10px 0;
    }

    .logo,
    .brand {
        font-size: 24px;
    }

    .nav-links,
    .main-nav {
        justify-content: center;
        gap: 3px;
    }

    .nav-links a,
    .main-nav a {
        padding: 7px 9px;
        font-size: 10px;
    }

    .section {
        width: calc(100% - 32px);
        padding: 52px 0;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .highlight-section {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px;
    }

    .highlight-icon {
        font-size: 65px;
    }

    .ml-statistics {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .home-hero {
        padding: 58px 22px;
    }

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

    .page-hero {
        padding: 58px 20px;
    }

    .feature-grid,
    .feature-grid-two,
    .plant-grid,
    .card-grid,
    .similar-plants-grid,
    .cluster-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card,
    .stats>div {
        padding: 19px 10px;
    }

    .stat-card strong,
    .stats>div strong {
        font-size: 25px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input,
    .search-form .btn,
    .search-form .btn-primary,
    .search-form .btn-outline {
        width: 100%;
    }

    .upload-panel {
        padding: 21px;
    }

    .chart {
        min-height: 270px;
    }

    .section-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .floating-card {
        padding: 9px 11px;
        font-size: 10px;
    }

    .hero-circle {
        width: 205px;
        height: 205px;
    }

    .hero-circle span {
        font-size: 82px;
    }

    .intelligence-hero,
    .explorer-hero {
        padding: 52px 6%;
    }

    .intelligence-selection,
    .selected-plant-section,
    .similar-plants-section,
    .cluster-overview,
    .explorer-search,
    .explorer-results {
        width: calc(100% - 32px);
        padding: 32px 0;
    }

    .intelligence-form {
        padding: 19px;
        flex-direction: column;
        align-items: stretch;
    }

    .form-group {
        width: 100%;
    }

    .selected-plant-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .cluster-badge {
        width: 100%;
    }

    .ml-disclaimer {
        width: calc(100% - 32px);
        margin: 20px auto 38px;
    }

    .ml-statistics {
        width: calc(100% - 32px);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}