﻿:root {
    color-scheme: light;
    --ink: #18201b;
    --muted: #5e6d64;
    --paper: #f7f9f5;
    --panel: #ffffff;
    --line: #d9e2dc;
    --green: #237447;
    --green-dark: #145333;
    --gold: #c9962f;
    --blue: #2d6f8f;
    --danger: #a33b31;
    --shadow: 0 16px 45px rgba(24, 32, 27, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(35, 116, 71, 0.12), transparent 38%),
        linear-gradient(315deg, rgba(45, 111, 143, 0.12), transparent 40%),
        var(--paper);
}

button,
input {
    font: inherit;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.intro-panel {
    max-width: 760px;
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: 4.4rem;
    line-height: 1;
}

.intro-copy {
    max-width: 660px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(240px, 0.75fr) minmax(280px, 1fr) minmax(300px, 1.05fr);
    gap: 18px;
    align-items: stretch;
}

.upload-panel,
.preview-panel,
.result-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.upload-panel,
.result-panel {
    padding: 22px;
}

.file-drop {
    display: grid;
    place-items: center;
    min-height: 210px;
    padding: 22px;
    border: 2px dashed #8eb49f;
    border-radius: 8px;
    background: #f9fbf7;
    cursor: pointer;
    text-align: center;
}

.file-drop:hover,
.file-drop:focus-within {
    border-color: var(--green);
}

.drop-title {
    display: block;
    color: var(--green-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

.drop-copy {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.file-drop input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

button {
    width: 100%;
    margin-top: 18px;
    padding: 13px 16px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--green);
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    background: var(--green-dark);
}

button:disabled {
    background: #91a69a;
    cursor: wait;
}

#status {
    min-height: 24px;
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

#status.error {
    color: var(--danger);
}

.preview-panel {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 420px;
    overflow: hidden;
    background: #eef4f0;
}

#preview {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: contain;
}

#preview.has-image {
    display: block;
}

#emptyPreview {
    position: absolute;
    color: var(--muted);
    font-weight: 700;
}

#preview.has-image + #emptyPreview {
    display: none;
}

.result-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    align-items: center;
}

.result-header .eyebrow {
    grid-column: 1 / -1;
}

h2 {
    margin: 0;
    font-size: 2.4rem;
}

.confidence {
    min-width: 74px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--gold);
    text-align: center;
    font-weight: 800;
}

.description {
    margin: 16px 0 20px;
    color: var(--muted);
    line-height: 1.55;
}

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

.trait-grid div {
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

dd {
    margin: 8px 0 0;
    font-weight: 700;
}

.traits-block {
    margin-top: 20px;
}

.traits-block h3 {
    margin: 0 0 10px;
}

#key_traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

#key_traits li {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--green-dark);
    background: #e7f2eb;
    font-size: 0.92rem;
    font-weight: 700;
}

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

    .preview-panel,
    #preview {
        min-height: 320px;
    }
}

@media (max-width: 560px) {
    .app-shell {
        width: min(100% - 22px, 1180px);
        padding: 24px 0;
    }

    .upload-panel,
    .result-panel {
        padding: 16px;
    }

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

    h1 {
        font-size: 2.3rem;
    }

    h2 {
        font-size: 1.7rem;
    }
}

/* Neon agri dashboard theme */
:root {
    --ink: #f1fff5;
    --muted: #a9c9b3;
    --paper: #07120b;
    --panel: rgba(9, 25, 15, 0.88);
    --panel-strong: rgba(13, 38, 22, 0.95);
    --line: rgba(106, 255, 151, 0.28);
    --green: #22ff75;
    --green-dark: #0ab85a;
    --lime: #b8ff35;
    --cyan: #28f7ff;
    --magenta: #ff4fd8;
    --gold: #ffe45c;
    --danger: #ff5f6d;
    --shadow: 0 22px 70px rgba(34, 255, 117, 0.16);
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 16% 20%, rgba(34, 255, 117, 0.18), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(40, 247, 255, 0.16), transparent 24%),
        radial-gradient(circle at 72% 82%, rgba(255, 79, 216, 0.12), transparent 28%),
        linear-gradient(135deg, #061008 0%, #0e2415 48%, #090b12 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(34, 255, 117, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 247, 255, 0.06) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 92%);
}

.app-shell {
    max-width: 1260px;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    min-height: 235px;
    margin-bottom: 18px;
    padding: 32px;
    border: 1px solid rgba(34, 255, 117, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(8, 24, 13, 0.92), rgba(9, 17, 16, 0.74)),
        repeating-linear-gradient(135deg, rgba(184, 255, 53, 0.08) 0 2px, transparent 2px 16px);
    box-shadow:
        0 0 0 1px rgba(40, 247, 255, 0.08) inset,
        0 22px 80px rgba(0, 0, 0, 0.36),
        0 0 44px rgba(34, 255, 117, 0.18);
}

.hero-panel h1 {
    text-shadow:
        0 0 16px rgba(34, 255, 117, 0.62),
        0 0 36px rgba(40, 247, 255, 0.28);
}

.intro-copy {
    color: var(--muted);
}

.hero-metrics {
    display: grid;
    gap: 10px;
    width: 210px;
}

.hero-metrics span {
    padding: 11px 13px;
    border: 1px solid rgba(40, 247, 255, 0.38);
    border-radius: 8px;
    color: var(--cyan);
    background: rgba(40, 247, 255, 0.08);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

.eyebrow,
.panel-kicker {
    color: var(--lime);
    text-shadow: 0 0 12px rgba(184, 255, 53, 0.54);
}

.panel-kicker {
    margin: 0 0 12px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-button,
.ghost-action {
    width: auto;
    margin: 0;
    border: 1px solid rgba(40, 247, 255, 0.28);
    color: var(--cyan);
    background: rgba(40, 247, 255, 0.08);
    box-shadow: none;
}

.tab-button.active,
.tab-button:hover,
.ghost-action:hover {
    color: #061008;
    background: var(--cyan);
    box-shadow: 0 0 26px rgba(40, 247, 255, 0.48);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.upload-panel,
.preview-panel,
.result-panel,
.stat-tile,
.insight-panel,
.history-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow:
        var(--shadow),
        0 0 0 1px rgba(40, 247, 255, 0.05) inset;
    backdrop-filter: blur(14px);
}

.file-drop {
    min-height: 246px;
    border-color: rgba(34, 255, 117, 0.54);
    background:
        linear-gradient(180deg, rgba(34, 255, 117, 0.1), rgba(40, 247, 255, 0.06)),
        rgba(8, 20, 12, 0.82);
}

.file-drop:hover,
.file-drop:focus-within {
    border-color: var(--lime);
    box-shadow: 0 0 34px rgba(34, 255, 117, 0.26);
}

.drop-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin-bottom: 14px;
    border: 1px solid rgba(184, 255, 53, 0.44);
    border-radius: 8px;
    color: var(--lime);
    background: rgba(184, 255, 53, 0.08);
    box-shadow: 0 0 28px rgba(184, 255, 53, 0.22);
    font-weight: 900;
}

.drop-title {
    color: var(--green);
    text-shadow: 0 0 12px rgba(34, 255, 117, 0.5);
}

.drop-copy,
#status,
.description,
dt {
    color: var(--muted);
}

.primary-action {
    color: #061008;
    background: linear-gradient(90deg, var(--green), var(--lime));
    box-shadow: 0 0 26px rgba(34, 255, 117, 0.38);
}

.primary-action:hover {
    background: linear-gradient(90deg, var(--lime), var(--cyan));
}

button:disabled {
    color: #284234;
    background: #8bac97;
}

.preview-panel {
    background:
        linear-gradient(rgba(34, 255, 117, 0.05), rgba(40, 247, 255, 0.05)),
        #07100b;
}

.scan-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(transparent 48%, rgba(34, 255, 117, 0.28) 50%, transparent 52%),
        linear-gradient(90deg, transparent 48%, rgba(40, 247, 255, 0.2) 50%, transparent 52%);
    background-size: 100% 74px, 74px 100%;
    opacity: 0.45;
}

#preview {
    position: relative;
    z-index: 1;
}

#emptyPreview {
    color: var(--cyan);
    text-shadow: 0 0 14px rgba(40, 247, 255, 0.48);
}

h2,
dd {
    color: var(--ink);
}

.confidence {
    color: #07120b;
    background: var(--gold);
    box-shadow: 0 0 22px rgba(255, 228, 92, 0.42);
}

.trait-grid div {
    border-color: rgba(40, 247, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

#key_traits li {
    color: #061008;
    background: linear-gradient(90deg, var(--green), var(--cyan));
}

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

.stat-tile {
    min-height: 150px;
    padding: 20px;
    border-radius: 8px;
}

.stat-tile span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-tile strong {
    display: block;
    margin-top: 18px;
    color: var(--green);
    font-size: 2.1rem;
    line-height: 1;
    text-shadow: 0 0 18px rgba(34, 255, 117, 0.45);
}

.dashboard-lower {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
    gap: 14px;
    margin-top: 14px;
}

.insight-panel,
.history-panel {
    padding: 22px;
    border-radius: 8px;
}

.section-title h2 {
    margin: 0;
}

#dashboardInsight {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.scan-history {
    display: grid;
    gap: 10px;
    min-height: 130px;
    padding: 0;
    margin: 18px 0;
    list-style: none;
}

.scan-history li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(184, 255, 53, 0.18);
    border-radius: 8px;
    background: rgba(184, 255, 53, 0.06);
}

.scan-history strong {
    color: var(--green);
}

.scan-history span {
    color: var(--muted);
    font-size: 0.9rem;
}

.ghost-action {
    color: var(--magenta);
    border-color: rgba(255, 79, 216, 0.35);
    background: rgba(255, 79, 216, 0.08);
}

@media (max-width: 980px) {
    .hero-panel,
    .dashboard-lower {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 560px) {
    .hero-panel {
        min-height: 0;
        padding: 20px;
    }

    .hero-metrics,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .tab-button {
        flex: 1;
    }

    .stat-tile {
        min-height: 116px;
    }
}
