/* ================================================================
   Mejhoul Thinning Management Decision-Support System
   Refined Agricultural Design — Volcani Institute
   Fonts: Cormorant Garamond (headings) · Manrope (body)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --primary:           #2D6A4F;
    --primary-dark:      #1B4332;
    --primary-light:     #52B788;
    --secondary:         #C77D48;
    --secondary-dark:    #9C5B2E;
    --accent:            #F4A261;
    --background:        #FAFAF6;
    --background-darker: #F2EDE3;
    --card:              #FFFFFF;
    --text:              #1C1C17;
    --text-secondary:    #6E6A5E;
    --text-light:        #A09B90;
    --border:            #E4DDD0;
    --border-light:      #EDE8E0;
    --danger:            #B91C1C;
    --shadow-sm:         0 1px 4px rgba(28,28,23,0.05);
    --shadow:            0 2px 16px rgba(28,28,23,0.07);
    --shadow-lg:         0 10px 36px rgba(28,28,23,0.11);
    --radius:            16px;
    --radius-sm:         10px;
    --radius-xs:         6px;
    --transition:        all 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    --font-head:         'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-body:         'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hero-banner { display: none !important; }

.dev-ribbon {
    pointer-events: none;
    position: fixed;
    top: 16px;
    left: -60px;
    z-index: 2200;
    width: 280px;
    transform: rotate(-45deg);
    background: rgba(206, 58, 58, 0.94);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 72px;
    padding: 0 0;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: var(--font-body);
    line-height: 1.1;
    transform-origin: center;
}

.dev-ribbon span {
    display: block;
    width: 100%;
}

.dev-ribbon small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.88;
}

@media (max-width: 980px) {
    .dev-ribbon {
        width: 230px;
        top: 10px;
        left: -54px;
        font-size: 0.85rem;
    }
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar         { width: 5px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: #C8C0B4; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ================================================================
   Material Symbols — global thin weight
   ================================================================ */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

/* Standard button / card icons — 18 px */
.btn-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

/* Tiny label icons — 13 px, muted */
.label-icon {
    font-size: 13px;
    width: 13px;
    height: 13px;
    min-width: 13px;
    vertical-align: middle;
    margin-right: 5px;
    color: var(--text-light);
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
    display: inline-flex;
    align-items: center;
}

/* Page heading icons — 26 px, light green */
.page-heading-icon {
    font-size: 26px;
    width: 26px;
    height: 26px;
    vertical-align: middle;
    margin-right: 10px;
    color: var(--primary-light);
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48;
}

/* Modal icon — centred block */
.modal-icon {
    font-size: 32px;
    display: block;
    margin: 0 auto 10px;
    color: var(--primary);
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48;
}

/* ================================================================
   Topbar
   ================================================================ */
.topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(250,250,246,0.94);
    border-bottom: 1px solid var(--border);
    padding: 13px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.topbar-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.pill-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    font-size: 0.82rem;
    font-family: var(--font-body);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.01em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pill-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45,106,79,0.24);
}

.pill-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

.topbar-title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-dark);
    flex: 1;
    text-align: center;
    letter-spacing: 0.02em;
}

.model-status {
    font-size: 11.5px;
    color: var(--text-light);
    font-weight: 400;
}

/* ================================================================
   Main Content
   ================================================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    height: 100vh;
    background: var(--background);
}

.page {
    display: none;
    padding: 40px 52px;
    animation: fadeIn 0.3s ease;
    max-width: 900px;
    margin: 0 auto;
}

.page.active { display: block; }

.page#page-home {
    position: relative;
    overflow: hidden;
    background: none;
    max-width: none;
    width: 100%;
    margin: 0;
    min-height: 100vh;
}

#home-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

#home-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.16);
    z-index: 0;
}

.page#page-home .home-hero,
.page#page-home .home-grid,
.page#page-home .card {
    position: relative;
    z-index: 1;
}

.home-glass-panel {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 18px auto 0;
    padding: 24px 28px 30px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Page title rows */
.page-title-row {
    margin-bottom: 26px;
    padding: 22px 24px;
    border-radius: calc(var(--radius) - 4px);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.page-title-row h2,
#page-heading {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    padding-left: 36px; /* align under heading text after icon */
}

.page-title {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* ================================================================
   Cards
   ================================================================ */
.card {
    background: rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    padding: 28px 32px;
    transition: box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
    margin-bottom: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.card:hover { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }

.card-title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-dark);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.card-copy {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.7;
}

/* ================================================================
   Home Page
   ================================================================ */
.home-hero {
    display: grid;
    gap: 10px;
    text-align: center;
    padding: 24px 0 22px;
}

.home-logo {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 4px;
    border-radius: 50%;
    box-shadow: 0 6px 28px rgba(45,106,79,0.16);
}

.home-hero h1 {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.home-copy {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.8;
}

#home-heading.typing-cursor::after,
#home-subtitle.typing-cursor::after {
    content: '|';
    display: inline-block;
    margin-left: 6px;
    opacity: 0.8;
    animation: blinkCursor 1s step-end infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.home-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
}

/* ---- Home Cards ---- */
.home-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 28px 24px;
    border-radius: var(--radius);
    border: 1.5px solid rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* subtle top-strip on hover */
.home-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2.5px;
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.home-card:first-child::before {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.home-card:last-child::before {
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.home-card:hover::before { opacity: 1; }

.home-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Large decorative icon */
.home-card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-bottom: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 48;
    transition: transform 0.25s ease;
}

.home-card:first-child .home-card-icon {
    background: rgba(45,106,79,0.08);
    color: var(--primary);
}

.home-card:last-child .home-card-icon {
    background: rgba(199,125,72,0.09);
    color: var(--secondary);
}

.home-card:hover .home-card-icon {
    transform: scale(1.07);
}

.home-card-title {
    font-family: var(--font-head);
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.home-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.75;
    flex: 1;
}

/* "Get started" CTA row — reveals on hover */
.home-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-4px);
}

.home-card:first-child .home-card-cta { color: var(--primary); }
.home-card:last-child  .home-card-cta { color: var(--secondary); }

.home-card:hover .home-card-cta {
    opacity: 1;
    transform: translateX(0);
}

.home-card-cta .material-symbols-outlined {
    font-size: 14px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ================================================================
   Form Elements
   ================================================================ */
.form-block {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: var(--font-body);
}

.form-group input,
.form-group select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 13.5px;
    font-family: var(--font-body);
    background: #FDFCFA;
    color: var(--text);
    transition: var(--transition);
    min-height: 42px;
    appearance: auto;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.11);
}

.form-group input::placeholder {
    color: #C4BEB4;
    font-style: italic;
    font-size: 13px;
}

.form-group input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(185,28,28,0.09);
}

.form-group .error-msg {
    font-size: 11px;
    color: var(--danger);
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.form-group input.error + .error-msg { display: block; }

.form-group-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.form-group-inline > label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: var(--font-body);
}

.radio-group input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Section labels (Upper / Center / Lower Whorl) */
.section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary);
    margin: 18px 0 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}

.section-label:first-of-type {
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
}

.helper-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.helper-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.helper-text a:hover { text-decoration: underline; }

.yield-thinning-controls {
    padding: 6px 0 14px;
}

.yield-thinning-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.yield-mode-row {
    margin-bottom: 10px;
}

.yield-submode-row {
    margin-bottom: 14px;
}

.yield-submode-row label {
    font-weight: 600;
}

/* ================================================================
   Tabs — pill style
   ================================================================ */
.tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 20px;
    background: var(--background-darker);
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--border);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    background: transparent;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 9px;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tab-btn .btn-icon {
    font-size: 15px;
    width: 15px;
    height: 15px;
    min-width: 15px;
    opacity: 0.65;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.55);
}

.tab-btn.active {
    color: var(--primary-dark);
    background: white;
    box-shadow: 0 1px 6px rgba(0,0,0,0.09);
}

.tab-btn.active .btn-icon {
    opacity: 1;
    color: var(--primary);
}

.tab-content        { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 11px 26px;
    min-height: 44px;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.btn-analyze {
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    font-size: 14px;
    padding: 13px 42px;
    min-width: 220px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.1);
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid rgba(255,255,255,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-analyze:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0,0,0,0.12);
}

.btn-analyze:disabled {
    background: #CBC6BC;
    color: #F0EDE8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-center {
    display: flex;
    justify-content: center;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

/* ================================================================
   Weather / Station Controls
   ================================================================ */
.btn-weather {
    width: 100%;
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 11px 22px;
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.1);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    letter-spacing: 0.01em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-weather:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(0,0,0,0.12);
}

.btn-weather:disabled {
    background: #CBC6BC;
    color: #F0EDE8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.weather-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: rgba(45,106,79,0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(45,106,79,0.13);
    margin-bottom: 12px;
}

.weather-status .spinner {
    font-size: 15px;
    animation: spin-emoji 1.2s linear infinite;
}

@keyframes spin-emoji {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#weather-status-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.weather-features-display {
    background: var(--background-darker);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 16px;
    margin-top: 10px;
}

.weather-feature-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.weather-period-summary {
    background: white;
    border-radius: var(--radius-xs);
    padding: 12px;
    border: 1px solid var(--border);
}

.weather-period-summary h4 {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.weather-period-summary h4 small {
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
}

.feature-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.feature-value:last-child { border-bottom: none; }

.feature-label { color: var(--text-secondary); font-weight: 500; }

.feature-value span:last-child { font-weight: 700; color: var(--text); }

.manual-weather {
    background: var(--background-darker);
    border-radius: var(--radius-sm);
    padding: 18px;
    border: 1.5px dashed var(--border);
    margin-top: 14px;
}

.manual-weather h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#station-select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 13.5px;
    font-family: var(--font-body);
    background: #FDFCFA;
    color: var(--text);
    transition: var(--transition);
    min-height: 42px;
    cursor: pointer;
}

#station-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.11);
}

#station-select:disabled {
    background: var(--background-darker);
    cursor: not-allowed;
    color: var(--text-light);
}

/* ================================================================
   Results Page
   ================================================================ */
.result-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.result-header h2 {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 22px;
}

.distribution-card,
.result-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.distribution-card:hover,
.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.distribution-value {
    font-family: var(--font-head);
    font-size: 38px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1;
    letter-spacing: 0.01em;
}

.distribution-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.result-card-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 10px;
}

.result-card-value {
    font-family: var(--font-head);
    font-size: 36px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1;
}

.result-card-caption {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.feature-summary { margin-top: 18px; }

.feature-summary .card-title { font-size: 16px; }

.summary-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.summary-row.small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 18px;
}

.summary-label {
    font-weight: 700;
    color: var(--text);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
}

.summary-value { color: var(--text-secondary); font-size: 13.5px; }

.feature-table { width: 100%; border-collapse: collapse; }

.feature-table th,
.feature-table td {
    text-align: left;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.feature-table th {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    background: var(--background-darker);
    padding-top: 11px;
    padding-bottom: 11px;
}

.feature-table td { color: var(--text); }

/* Chart */
.chart-container {
    position: relative;
    width: 100%;
    height: 360px;
    margin-bottom: 22px;
}

.chart-container canvas { width: 100% !important; height: 100% !important; }

.summary-box {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-sm);
    background: var(--background-darker);
    border: 1px solid var(--border);
}

.prediction-value {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-dark);
}

.confidence-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-style: italic;
}

.results-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.results-placeholder .icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
    display: block;
}

.results-placeholder p { font-size: 17px; }

.results-content { display: none; }

.results-content.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* ================================================================
   Modal
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28,28,23,0.52);
    padding: 20px;
    z-index: 9999;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.hidden { display: none; }

.modal-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 20px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
    text-align: center;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 14px; right: 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover { color: var(--text); background: var(--background-darker); }

.modal-card h2 {
    font-family: var(--font-head);
    margin-bottom: 14px;
    font-size: 22px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 13.5px;
}

.bug-email {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 13.5px;
}

.bug-email:hover { text-decoration: underline; }

/* ================================================================
   Toast
   ================================================================ */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9990;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast.show    { transform: translateY(0); opacity: 1; }
.toast.error   { background: var(--danger); }
.toast.success { background: var(--primary); }

/* ================================================================
   Model Status Badge
   ================================================================ */
.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    margin-top: 3px;
}

.model-badge.loading { background: rgba(199,125,72,0.11); color: var(--secondary-dark); }
.model-badge.ready   { background: rgba(45,106,79,0.10);  color: var(--primary); }
.model-badge.error   { background: rgba(185,28,28,0.09);  color: var(--danger); }

.model-badge .dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.model-badge.loading .dot { animation: blink 1s infinite; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 40px rgba(45,106,79,0.22); }
    50%       { transform: scale(1.04); box-shadow: 0 0 60px rgba(45,106,79,0.36); }
}

/* ================================================================
   Data Entry Grid
   ================================================================ */
.data-entry-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 22px;
    align-items: start;
}

/* ================================================================
   Sidebar
   ================================================================ */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.sidebar-header .logo-row img { width: 44px; height: 44px; border-radius: 12px; }

.sidebar-header h1 {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    color: white;
    line-height: 1.35;
}

.sidebar-header .version {
    font-size: 10.5px;
    color: rgba(255,255,255,0.28);
    margin-top: 4px;
    padding-left: 58px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.58);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: white; }

.sidebar-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(45,106,79,0.38);
}

.sidebar-nav a .icon { font-size: 20px; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.sidebar-footer p {
    font-size: 10.5px;
    color: rgba(255,255,255,0.26);
    line-height: 1.6;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    width: 44px; height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 1400;
    box-shadow: 0 8px 20px rgba(45,106,79,0.35);
}

.mobile-menu-backdrop { display: none; }

/* ================================================================
   Steps Grid
   ================================================================ */
.steps-grid { display: grid; gap: 18px; margin-top: 14px; }

.step-item { display: flex; gap: 16px; align-items: flex-start; }

.step-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.step-icon.step-1 { background: var(--primary); }
.step-icon.step-2 { background: var(--secondary); }
.step-icon.step-3 { background: var(--primary-light); }

.step-text h3 {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.step-text p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1100px) {
    .data-entry-grid       { grid-template-columns: 1fr; }
    .weather-features-grid { grid-template-columns: 1fr; }
    .summary-row           { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .home-grid, .distribution-grid { grid-template-columns: 1fr; }
    .topbar { padding: 11px 20px; }
    .topbar-actions { justify-content: center; width: 100%; }
    .page { padding: 30px 24px; }
    .home-glass-panel { padding: 20px 20px 24px; }
}

@media (max-width: 720px) {
    .page              { padding: 22px 16px; }
    .home-card         { padding: 22px 20px 20px; }
    .form-group-inline { flex-direction: column; align-items: stretch; }
    .form-row          { grid-template-columns: 1fr; }
    .card              { padding: 20px; }
    .home-card-cta     { opacity: 1; transform: translateX(0); }
}

@media (max-width: 800px) {
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar {
        width: 260px; min-width: 260px;
        position: fixed;
        top: 0; left: 0;
        z-index: 1300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    body.mobile-menu-open .sidebar { transform: translateX(0); }
    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(28,28,23,0.42);
        z-index: 1200;
    }
    body.mobile-menu-open .mobile-menu-backdrop { display: block; }
}