/* ==========================================================================
   GardenGreen — Grok-style design system
   Dark-first, calm density, high contrast, soft surfaces
   ========================================================================== */

:root,
[data-theme="dark"] {
    color-scheme: dark;

    --bg: #09090b;
    --bg-elevated: #111113;
    --bg-soft: #18181b;
    --bg-hover: #1f1f23;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-strong: rgba(255, 255, 255, 0.06);

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --text-faint: #71717a;

    --primary: #34d399;
    --primary-dim: #10b981;
    --primary-soft: rgba(52, 211, 153, 0.12);
    --primary-glow: rgba(52, 211, 153, 0.28);

    --secondary: #a3e635;
    --accent: #38bdf8;
    --danger: #fb7185;
    --warning: #fbbf24;

    --white: var(--bg-elevated);
    --bg-light: var(--bg);
    --primary-light: var(--primary-soft);
    --primary-dark: #064e3b;
    --glass: var(--surface-strong);
    --glass-border: var(--border);
    --shadow: 0 0 0 1px var(--border), 0 24px 48px rgba(0, 0, 0, 0.45);

    --hero-overlay: rgba(9, 9, 11, 0.78);
    --hero-glow-1: rgba(52, 211, 153, 0.12);
    --hero-glow-2: rgba(56, 189, 248, 0.08);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --font: "Inter", "Outfit", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-display: "Outfit", "Inter", ui-sans-serif, system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 180ms var(--ease);
    --transition-slow: 320ms var(--ease);

    --header-h: 64px;
    --max: 1120px;
}

/* Light theme — still available via toggle */
[data-theme="light"] {
    color-scheme: light;

    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --bg-soft: #f4f4f5;
    --bg-hover: #ececef;
    --surface: rgba(0, 0, 0, 0.02);
    --surface-strong: #ffffff;

    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);

    --text-main: #18181b;
    --text-muted: #52525b;
    --text-faint: #a1a1aa;

    --primary: #059669;
    --primary-dim: #047857;
    --primary-soft: rgba(5, 150, 105, 0.1);
    --primary-glow: rgba(5, 150, 105, 0.18);

    --secondary: #65a30d;
    --accent: #0284c7;
    --danger: #e11d48;
    --warning: #d97706;

    --white: #ffffff;
    --bg-light: var(--bg);
    --primary-light: var(--primary-soft);
    --primary-dark: #064e3b;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: var(--border);
    --shadow: 0 0 0 1px var(--border), 0 16px 40px rgba(0, 0, 0, 0.06);

    --hero-overlay: rgba(250, 250, 250, 0.88);
    --hero-glow-1: rgba(5, 150, 105, 0.1);
    --hero-glow-2: rgba(2, 132, 199, 0.08);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 15.5px;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient mesh — Grok-like depth without noise clutter */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(900px 500px at 12% -10%, var(--hero-glow-1), transparent 55%),
        radial-gradient(700px 420px at 92% 8%, var(--hero-glow-2), transparent 50%),
        radial-gradient(600px 400px at 50% 100%, rgba(52, 211, 153, 0.04), transparent 60%);
}

::selection {
    background: var(--primary-soft);
    color: var(--text-main);
}

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

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.75rem;
    }
}

.glass-card {
    background: var(--surface-strong);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
}

/* ---------- Type ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-main);
}

h1 {
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    font-weight: 650;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.1rem;
}

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

.section-header {
    margin-bottom: 2.5rem;
}

.section-header p,
.section-lede {
    color: var(--text-muted);
    max-width: 36rem;
    margin: 0.5rem auto 0;
    font-size: 1rem;
}

.accent {
    background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(52, 211, 153, 0.22);
    margin-bottom: 1.25rem;
    font-family: var(--mono);
}

/* ---------- Header ---------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
    border-bottom: 1px solid transparent;
}

header.scrolled,
header:focus-within {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom-color: var(--border);
}

nav.container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: var(--text-main);
    text-decoration: none;
    flex-shrink: 0;
}

.logo svg {
    color: var(--primary);
    flex-shrink: 0;
}

.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: var(--primary);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
    color: var(--text-main);
    background: var(--surface);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1rem;
    transition: background var(--transition), border-color var(--transition);
    padding: 0;
    box-shadow: none;
}

#theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.nav-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: currentColor;
    position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 1.5px;
    background: currentColor;
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

body.nav-open .mobile-nav {
    display: flex;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 999;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem 1.25rem;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.mobile-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    padding: 0.85rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}

@media (min-width: 900px) {
    .nav-links {
        display: flex;
    }
    .nav-toggle {
        display: none;
    }
    .mobile-nav {
        display: none !important;
    }
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-primary-large,
.btn-secondary,
.btn-secondary-large,
.btn-pro,
.btn-imperial,
.btn-ghost,
.btn-water,
.btn-timeline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        color var(--transition);
    white-space: nowrap;
}

.btn-primary,
.btn-primary-large {
    background: var(--primary);
    color: #052e1c;
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 8px 24px var(--primary-glow);
    padding: 0.7rem 1.25rem;
    font-size: 0.92rem;
}

.btn-primary-large {
    padding: 0.9rem 1.5rem;
    font-size: 0.98rem;
}

.btn-primary:hover,
.btn-primary-large:hover {
    transform: translateY(-1px);
    background: #6ee7b7;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 12px 32px var(--primary-glow);
}

.btn-secondary,
.btn-secondary-large {
    background: var(--surface);
    color: var(--text-main);
    border-color: var(--border-strong);
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
}

.btn-secondary-large {
    padding: 0.88rem 1.4rem;
}

.btn-secondary:hover,
.btn-secondary-large:hover {
    background: var(--bg-hover);
    border-color: var(--text-faint);
    color: var(--text-main);
}

.btn-pro {
    background: linear-gradient(135deg, #ecfccb, #a3e635 45%, #4ade80);
    color: #14532d !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.55rem 1rem;
    box-shadow: 0 6px 18px rgba(163, 230, 53, 0.2);
}

.btn-pro:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(163, 230, 53, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    color: var(--text-main);
    background: var(--surface);
}

.btn-imperial {
    background: var(--primary);
    color: #052e1c;
    font-weight: 700;
    padding: 0.85rem 1.5rem;
    margin-top: 1.5rem;
    border: none;
}

.btn-imperial:hover {
    transform: scale(1.02);
}

.btn-delete-entry {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.25rem 0.45rem;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.btn-delete-entry:hover {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.12);
}

/* ---------- Hero ---------- */
.hero {
    padding: calc(var(--header-h) + 3.5rem) 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    gap: 2.75rem;
    align-items: center;
}

@media (min-width: 960px) {
    .hero-content {
        grid-template-columns: 1.05fr 0.95fr;
        gap: 3rem;
        text-align: left;
    }

    .hero-text {
        text-align: left;
    }

    .hero-text .section-lede,
    .hero-text > p {
        margin-left: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}

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

.hero-text > p,
.hero-lede {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.hero-image {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.hero-frame {
    padding: 0.55rem;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-frame img {
    width: 100%;
    border-radius: calc(var(--radius-xl) - 4px);
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-main);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--primary-glow);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 var(--primary-glow); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Features ---------- */
.features {
    padding: 4rem 0 5rem;
    background: transparent;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.feature-card {
    padding: 1.4rem 1.35rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: none;
}

.feature-card:nth-child(1),
.feature-card:nth-child(2),
.feature-card:nth-child(3) {
    background: var(--surface);
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: var(--surface-strong);
    box-shadow: none;
}

.feature-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    background: var(--primary-soft);
    border: 1px solid rgba(52, 211, 153, 0.18);
    box-shadow: none;
    line-height: 1;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ---------- AI tool ---------- */
.ai-tool {
    padding: 3rem 0 5rem;
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: stretch;
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius-xl) !important;
}

@media (min-width: 900px) {
    .ai-grid {
        grid-template-columns: 1.05fr 0.95fr;
    }
}

.ai-upload {
    padding: 1.75rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
    .ai-upload {
        padding: 2rem;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
}

.ai-upload h2 {
    margin-bottom: 0.35rem;
}

.ai-upload > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.ai-results {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
    background: var(--bg-soft);
}

.placeholder-results {
    text-align: center;
    opacity: 0.9;
    padding: 1.5rem;
    max-width: 18rem;
}

.placeholder-results .icon {
    font-size: 2rem;
    margin-bottom: 0.85rem;
    width: 56px;
    height: 56px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.placeholder-results h3 {
    margin-bottom: 0.4rem;
}

.placeholder-results p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.diagnosis-form,
.add-form {
    text-align: left;
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea,
.search-container input {
    width: 100%;
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-group textarea {
    min-height: 96px;
    resize: vertical;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.search-container input:hover {
    border-color: var(--border-strong);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-container input:focus {
    outline: none;
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--bg-elevated);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.search-container input::placeholder {
    color: var(--text-faint);
}

.tip {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 0.45rem;
}

.accent-text {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    cursor: pointer;
}

.upload-zone {
    border: 1px dashed var(--border-strong);
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2rem 1.25rem;
    text-align: center;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: none;
}

.upload-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.file-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 0.45rem;
    font-family: var(--mono);
}

.upload-zone-small {
    height: 150px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    cursor: pointer;
    margin-bottom: 1.25rem;
    background: var(--bg);
    transition: border-color var(--transition), background var(--transition);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-zone-small:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* Diagnosis result card */
.diagnosis-loading {
    text-align: center;
    padding: 2rem 1rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.diagnosis-card {
    background: var(--bg-elevated);
    padding: 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    text-align: left;
    box-shadow: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.id-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--mono);
    margin-bottom: 0.25rem;
}

.id-value {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.confidence {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-weight: 500;
    margin-top: 0.25rem;
}

.severity-badge {
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--mono);
    flex-shrink: 0;
}

.severity-badge.high { background: rgba(251, 113, 133, 0.15); color: #fb7185; border: 1px solid rgba(251, 113, 133, 0.25); }
.severity-badge.moderate { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.22); }
.severity-badge.none { background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(52, 211, 153, 0.25); }

.result-body p {
    margin-bottom: 0.65rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.result-body strong {
    color: var(--text-main);
    font-weight: 600;
}

/* ---------- Library ---------- */
.library {
    padding: 4rem 0 5rem;
}

.category-nav {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.cat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    opacity: 1;
    flex-shrink: 0;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}

.cat-item:hover,
.cat-item.active {
    opacity: 1;
    transform: none;
    color: var(--text-main);
    border-color: rgba(52, 211, 153, 0.35);
    background: var(--primary-soft);
}

.cat-circle {
    width: 28px;
    height: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    margin-bottom: 0;
    box-shadow: none;
}

.cat-item.active .cat-circle {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: none;
}

.cat-item span {
    font-size: 0.82rem;
    font-weight: 600;
    color: inherit;
}

.search-container {
    max-width: 100%;
    margin: 0 0 1.75rem;
}

.search-container input {
    border-radius: var(--radius-pill);
    padding: 0.85rem 1.2rem;
    background: var(--surface-strong);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.9rem;
    margin-top: 0;
}

.library-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    cursor: pointer;
    box-shadow: none;
    color: var(--text-main);
}

.library-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: var(--surface-strong);
    box-shadow: none;
}

.lib-thumb {
    height: 120px;
    background: linear-gradient(160deg, var(--bg-soft), var(--bg));
    display: grid;
    place-items: center;
    font-size: 2.75rem;
    border-bottom: 1px solid var(--border);
    transition: none;
}

.library-card:hover .lib-thumb {
    transform: none;
}

.lib-info {
    padding: 1rem 1.1rem 1.15rem;
}

.lib-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.lib-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.lib-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.lib-tag {
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.safety-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
    flex-shrink: 0;
    font-family: var(--mono);
}

.safety-badge.safe {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(52, 211, 153, 0.22);
}

.safety-badge.toxic {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
    border: 1px solid rgba(251, 113, 133, 0.22);
}

/* ---------- Pricing ---------- */
.pricing-section {
    padding: 4rem 0 5rem;
}

.pricing-section > .container {
    text-align: center;
}

.pricing-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.9rem !important;
    max-width: 760px !important;
    margin: 2rem auto 0 !important;
}

@media (min-width: 720px) {
    .pricing-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

.pricing-card,
.pricing-section .glass-card {
    padding: 1.6rem !important;
    border-radius: var(--radius-lg) !important;
    text-align: left !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.council-card {
    border-color: rgba(52, 211, 153, 0.35) !important;
    background:
        linear-gradient(160deg, rgba(52, 211, 153, 0.08), transparent 50%),
        var(--surface) !important;
    position: relative;
}

.council-card .elite-pill,
.council-card > span:first-child {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: 0.04em;
}

.price {
    font-size: 2.1rem !important;
    font-weight: 700 !important;
    margin: 0.75rem 0 1rem !important;
    letter-spacing: -0.03em;
    color: var(--text-main) !important;
}

.pricing-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    line-height: 1.85;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.pricing-section ul b {
    color: var(--text-main);
    font-weight: 600;
}

/* ---------- Dashboard / Garden ---------- */
.dashboard-preview {
    padding: 4rem 0 5rem;
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.dashboard-header > div:first-child p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (min-width: 900px) {
    .dashboard-header {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 1rem;
    }
}

.atmosphere-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem !important;
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    min-width: 0;
    width: 100%;
    box-shadow: none !important;
}

@media (min-width: 900px) {
    .atmosphere-card {
        min-width: 280px;
        width: auto;
    }
}

.atmo-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    animation: none;
}

.atmo-data { flex-grow: 1; min-width: 0; }

.atmo-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.15rem;
}

.atmo-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    font-family: var(--mono);
}

.atmo-value {
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

#atmo-advice {
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.4rem !important;
    border-top: 1px solid var(--border) !important;
    padding-top: 0.4rem !important;
    font-weight: 500 !important;
}

.frost-pulse {
    animation: frost-glow 2s infinite alternate;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

@keyframes frost-glow {
    from { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.05); }
    to { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12); }
}

.recovery-glow {
    animation: success-pulse 2s infinite alternate;
    border-color: rgba(52, 211, 153, 0.45) !important;
}

@keyframes success-pulse {
    from { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.05); }
    to { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
}

.plant-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 0.9rem !important;
    padding: 1rem !important;
    border-radius: var(--radius-lg) !important;
    min-height: 280px;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.plant-card {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
    border: 1px solid var(--border);
    box-shadow: none;
    width: 100%;
}

.plant-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: none;
}

.plant-thumb {
    position: relative;
}

.plant-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-soft);
}

.btn-delete {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    opacity: 1;
    z-index: 2;
    transition: background var(--transition);
}

.btn-delete:hover {
    background: var(--danger);
}

.alarm-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    background: rgba(251, 113, 133, 0.92);
    color: #fff;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: 0.04em;
    animation: none;
}

.plant-info {
    padding: 1rem 1.05rem 1.1rem;
}

.plant-info h3 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.species {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: normal;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 6px;
    background: var(--bg-soft);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin: 0.5rem 0 0.45rem;
    max-width: none;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dim), var(--primary));
    border-radius: var(--radius-pill);
    transition: width 0.5s var(--ease);
}

.remind-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.text-danger {
    color: var(--danger) !important;
    font-weight: 600;
}

.plant-footer {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.btn-timeline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-pill);
    flex: 1;
}

.btn-timeline:hover {
    background: var(--surface);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.btn-water {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(52, 211, 153, 0.25);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 650;
    flex: 1;
}

.btn-water:hover {
    background: rgba(52, 211, 153, 0.2);
}

.btn-alarm {
    background: rgba(251, 113, 133, 0.15) !important;
    color: var(--danger) !important;
    border-color: rgba(251, 113, 133, 0.3) !important;
    animation: none;
}

.overdue-alarm {
    border-color: rgba(251, 113, 133, 0.4);
    animation: none;
}

/* Ledger */
.ledger-container {
    margin-top: 1.25rem !important;
    padding: 1.25rem !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    box-shadow: none !important;
}

.ledger-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ledger-header h3 {
    margin-bottom: 0.2rem;
}

.ledger-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#global-ledger {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.15rem;
}

.ledger-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left: 2px solid var(--primary);
    animation: slide-in 0.3s var(--ease);
}

.ledger-entry .entry-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.ledger-entry .entry-icon { font-size: 1rem; flex-shrink: 0; }
.ledger-entry .entry-text {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
}
.ledger-entry .entry-time {
    font-size: 0.7rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--mono);
    white-space: nowrap;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* Empty states */
.empty-state {
    padding: 2.5rem 1.25rem;
    background: transparent;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    max-width: none;
    margin: 0 auto;
    text-align: center;
    grid-column: 1 / -1;
}

.empty-state .icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.empty-state h3 {
    margin-bottom: 0.35rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ---------- Modals ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 820px);
    overflow-y: auto;
    position: relative;
    padding: 1.5rem 1.35rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.modal .close-modal {
    position: absolute !important;
    top: 0.85rem !important;
    right: 0.85rem !important;
    z-index: 5 !important;
    background: var(--surface) !important;
    color: var(--text-muted) !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid var(--border) !important;
    font-size: 1rem !important;
    cursor: pointer;
    line-height: 1;
}

.modal .close-modal:hover {
    color: var(--text-main) !important;
    background: var(--bg-hover) !important;
}

.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1.15rem;
    padding-right: 2rem;
}

.imperial-modal {
    background: var(--bg-elevated) !important;
    backdrop-filter: none !important;
    border: 1px solid var(--border) !important;
    color: var(--text-main) !important;
    max-width: 420px;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.imperial-modal::after {
    display: none;
}

.imperial-modal h2 {
    color: var(--text-main);
    text-transform: none;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.imperial-modal p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

#imperial-briefing {
    z-index: 10000;
}

/* ---------- Footer ---------- */
footer {
    padding: 3.5rem 0 6.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    background: transparent;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

footer::after {
    display: none;
}

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

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 0.65rem;
}

.footer-brand span {
    color: var(--primary);
}

.site-footer > p {
    color: var(--text-muted);
    max-width: 28rem;
    margin: 0 auto 1.5rem;
    font-size: 0.92rem;
}

.footer-links-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-links-row a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: color var(--transition);
}

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

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-faint);
    font-family: var(--mono);
}

/* ---------- Camera ---------- */
.camera-container {
    position: fixed !important;
    inset: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000;
    display: none;
    margin: 0;
}

.camera-container video {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover !important;
    position: absolute;
    inset: 0;
}

.camera-container #btn-diag-snap,
.camera-container #btn-snap {
    position: absolute !important;
    bottom: max(2rem, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 4px solid rgba(52, 211, 153, 0.55) !important;
    z-index: 10000 !important;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
    display: block !important;
    padding: 0 !important;
    color: transparent !important;
}

/* ---------- Motion ---------- */
.animate-in {
    animation: fade-up 0.35s var(--ease) both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Mobile bottom dock ---------- */
.mobile-dock {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 900;
    gap: 0.25rem;
    padding: 0.35rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    max-width: calc(100vw - 1.5rem);
}

.mobile-dock a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-pill);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 64px;
    transition: color var(--transition), background var(--transition);
}

.mobile-dock a span.dock-ico {
    font-size: 1rem;
    line-height: 1;
}

.mobile-dock a:hover,
.mobile-dock a:focus-visible {
    color: var(--text-main);
    background: var(--surface);
}

@media (min-width: 900px) {
    .mobile-dock {
        display: none;
    }
    footer {
        padding-bottom: 3.5rem;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Misc legacy hooks ---------- */
.toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    z-index: 2000;
    font-size: 0.9rem;
}

.env-tag {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    background: var(--bg-elevated);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-share-portfolio {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Keep dark-mode overrides from fighting the new system */
[data-theme="dark"] .glass-card,
[data-theme="light"] .glass-card {
    color: var(--text-main);
}

[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: var(--text-main) !important;
}

[data-theme="dark"] .price,
[data-theme="light"] .price {
    color: var(--text-main) !important;
}

[data-theme="dark"] .plant-card,
[data-theme="light"] .plant-card {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .feature-card h3,
[data-theme="light"] .feature-card h3 {
    color: var(--text-main);
}

[data-theme="dark"] .search-container input,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="light"] .search-container input,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-main);
}

[data-theme="dark"] .cat-circle,
[data-theme="light"] .cat-circle {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="dark"] .upload-zone,
[data-theme="light"] .upload-zone {
    background: var(--bg);
    border-color: var(--border-strong);
}

[data-theme="dark"] header.scrolled,
[data-theme="light"] header.scrolled {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--border);
}

/* ---------- Today’s tasks ---------- */
.tasks-panel {
    margin-bottom: 1rem;
    padding: 1.1rem 1.15rem 1.15rem !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    box-shadow: none !important;
}

.tasks-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.tasks-panel-header h3 {
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.tasks-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tasks-filters {
    display: flex;
    gap: 0.35rem;
}

.chip {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.chip:hover {
    color: var(--text-main);
    border-color: var(--border-strong);
}

.chip.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(52, 211, 153, 0.35);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.task-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
}

.task-row.urgent {
    border-color: rgba(251, 113, 133, 0.35);
    background: rgba(251, 113, 133, 0.06);
}

.task-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    border: 1px solid rgba(52, 211, 153, 0.18);
    font-size: 1rem;
}

.task-row.urgent .task-ico {
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.22);
}

.task-main {
    min-width: 0;
}

.task-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.task-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.task-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.task-actions .btn-secondary,
.task-actions .btn-primary {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
}

.tasks-empty {
    text-align: center;
    padding: 1.25rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Plant detail sheet ---------- */
.plant-detail-sheet {
    max-width: 560px !important;
    padding: 1.35rem 1.25rem 1.5rem !important;
}

.detail-hero {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.15rem;
    padding-right: 1.5rem;
}

.detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.detail-hero h2 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
    padding-right: 0;
}

.detail-species {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.detail-summary {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-stat {
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
}

.detail-stat .label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    font-family: var(--mono);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-stat .value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.detail-section {
    margin-bottom: 0.95rem;
}

.detail-section h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    font-family: var(--mono);
    margin-bottom: 0.4rem;
}

.detail-section p,
.detail-section li {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.detail-section ul {
    margin: 0;
    padding-left: 1.1rem;
}

.detail-section li {
    margin-bottom: 0.25rem;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.detail-actions .btn-primary,
.detail-actions .btn-secondary {
    flex: 1;
    min-width: 120px;
}

.plant-card {
    cursor: pointer;
}

.plant-card .plant-footer button {
    cursor: pointer;
}

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

    .task-row {
        grid-template-columns: auto 1fr;
    }

    .task-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
