/* === FLEUR Plant Database Styles === */

/* ==================== OFFLINE BANNER ====================
   Appears at top of viewport when navigator.onLine is false.
   Non-blocking, aria-live for screen readers. */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0.55rem 1rem;
    background: #b04a20;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(-100%);
    transition: transform 0.22s ease;
    pointer-events: none;
}
.offline-banner:not([hidden]) {
    transform: translateY(0);
    pointer-events: auto;
}
.offline-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd87a;
    box-shadow: 0 0 0 2px rgba(255, 216, 122, 0.35);
    flex-shrink: 0;
    animation: fleur-offline-pulse 1.6s ease-in-out infinite;
}
@keyframes fleur-offline-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
body.has-offline-banner { padding-top: 2.25rem; }
@media print { .offline-banner { display: none !important; } }

@font-face {
    font-family: 'Yesterday';
    src: url('Yesterday.otf') format('opentype');
}

/* === LIGHT THEME (default) ===
   --sage, --sage-dark, --sage-text, --sage-light, --cream, --cream-dark
   are defined in tokens.css (loaded first). Page-specific extras only below. */
:root {
    --charcoal: #2C2C2C;
    --mid-grey: #6B6B6B;
    --light-grey: #D8D3CC;
    --white: #FFFFFF;
    /* Aliases for tokens referenced via var(--x, fallback) elsewhere — give them real values so the cascade is consistent. */
    --text-primary: var(--charcoal);
    --text-muted: var(--mid-grey);
    --border-colour: var(--light-grey);
    --warm-grey: var(--mid-grey);
    --nav-height: 70px;
    --sidebar-width: 280px;
    --header-bg: rgba(250, 247, 242, 0.96);
    --overlay-bg: rgba(0,0,0,0.5);
    --card-shadow: 0 8px 30px rgba(0,0,0,0.07);
    --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --fav-color: #e25555;
    --skeleton-base: #E8E3DB;
    --skeleton-shine: #F5F0E8;
    --type-tree: #4A6741;
    --type-shrub: #6B8F6E;
    --type-perennial: #8DB598;
    --type-grass: #B5C98A;
    --type-climber: #7A8FB5;
    --type-bulb: #C490B5;
    --type-conifer: #2E5A3E;
    --type-fern: #5A9E6B;
    --type-annual: #D4A855;
    --type-bamboo: #7A9445;
}

/* === DARK THEME ===
   Brand sage + cream tokens come from tokens.css. Page-specific extras only. */
[data-theme="dark"] {
    --charcoal: #E8E4DF;
    --mid-grey: #9A9590;
    --light-grey: #3A3D3F;
    --white: #242628;
    --text-primary: var(--charcoal);
    --text-muted: var(--mid-grey);
    --border-colour: var(--light-grey);
    --warm-grey: var(--mid-grey);
    --header-bg: rgba(26, 29, 30, 0.96);
    --overlay-bg: rgba(0,0,0,0.7);
    --card-shadow: 0 8px 30px rgba(0,0,0,0.2);
    --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.35);
    --skeleton-base: #2E3133;
    --skeleton-shine: #3A3D3F;
    --type-tree: #6B9E6E;
    --type-shrub: #8DB598;
    --type-perennial: #A5CDA8;
    --type-grass: #C4D4A0;
    --type-climber: #9AADD3;
    --type-bulb: #D4A0C4;
    --type-conifer: #5A9E6B;
    --type-fern: #7AB58A;
    --type-annual: #E8C170;
    --type-bamboo: #9AB56A;
}

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

body {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    color: var(--charcoal);
    background: var(--cream);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--light-grey);
    z-index: 100;
    transition: background 0.3s;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Yesterday', 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--sage-dark);
    letter-spacing: 0.05em;
}

.logo-sub {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--sage-text);
}

/* Header Nav */
.header-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--mid-grey);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--sage-dark); background: var(--sage-light); }
.nav-link.active { color: var(--sage-dark); background: var(--sage-light); }

.header-search {
    flex: 1;
    min-width: 180px;
    max-width: 400px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.55rem 2.2rem 0.55rem 1rem;
    border: 1px solid var(--light-grey);
    border-radius: 6px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--charcoal);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--sage-light);
}

.search-icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mid-grey);
    pointer-events: none;
}

/* Search Autocomplete */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    z-index: 110;
    max-height: 360px;
    overflow-y: auto;
    display: none;
}

.search-autocomplete.visible { display: block; }

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--cream-dark);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--sage-light);
}

.autocomplete-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--cream-dark);
}

.autocomplete-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-name {
    font-size: 0.82rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-common {
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--mid-grey);
}

.autocomplete-type {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.result-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--mid-grey);
    white-space: nowrap;
}

/* === BUTTONS === */
.btn-primary {
    padding: 0.55rem 1.2rem;
    background: var(--sage-text);    /* WCAG AA: was --sage (2.98:1) → --sage-text (4.55:1) */
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--sage-dark);
    box-shadow: var(--shadow-md, 0 2px 8px rgba(90,125,94,0.3));
}

.btn-primary:active { transform: scale(0.97); }

.btn-primary:focus-visible,
.btn-outline:focus-visible,
.btn-icon:focus-visible {
    outline: 2px solid var(--sage-text);
    outline-offset: 2px;
}

.btn-primary:disabled,
.btn-outline:disabled,
.btn-icon:disabled,
.btn-primary[aria-disabled="true"],
.btn-outline[aria-disabled="true"],
.btn-icon[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-outline {
    padding: 0.55rem 1.2rem;
    background: transparent;
    color: var(--sage-text);
    border: 1.5px solid var(--sage);
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--sage-text);    /* WCAG AA fix: matches .btn-primary */
    color: #fff;
}

.btn-outline:active { transform: scale(0.97); }

.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--light-grey);
    border-radius: 6px;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    border-color: var(--sage);
    color: var(--sage-text);
    background: var(--sage-light);
}

.btn-icon.active {
    background: var(--sage-text);
    color: #fff;
    border-color: var(--sage-text);
}

.filter-toggle { display: none; }

/* === TOOLBAR STRIP (Sort + View controls) === */
.toolbar-strip {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-select {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    background: var(--white);
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--sage);
}

.view-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn:hover { border-color: var(--sage); color: var(--sage-text); }

.view-btn.active {
    background: var(--sage-text);
    border-color: var(--sage-text);
    color: #fff;
}

.fav-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: transparent;
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
}

.fav-filter-btn:hover { border-color: var(--fav-color); color: var(--fav-color); }

.fav-filter-btn.active {
    background: rgba(226,85,85,0.08);
    border-color: var(--fav-color);
    color: var(--fav-color);
}

/* === MAIN LAYOUT === */
.main-layout {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--light-grey);
    padding: 1.25rem;
    overflow-y: auto;
    height: calc(100vh - var(--nav-height));
    position: sticky;
    top: var(--nav-height);
    transition: background 0.3s;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-grey);
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--charcoal);
}

.clear-filters {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--sage-text);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.clear-filters:hover { color: var(--sage-dark); }

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.active-filters:empty { margin-bottom: 0; }

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--sage-light);
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--sage-dark);
    transition: background 0.15s;
}

.filter-tag:hover { background: rgba(122,158,126,0.18); }

.filter-tag button {
    background: none;
    border: none;
    color: var(--sage-dark);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
}

/* Filter Groups */
.filter-group {
    border-bottom: 1px solid var(--cream-dark);
}

.filter-group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--charcoal);
    text-align: left;
    transition: color 0.15s;
}

.filter-group-toggle:hover { color: var(--sage-dark); }

.toggle-icon {
    font-size: 1rem;
    font-weight: 300;
    color: var(--mid-grey);
    transition: transform 0.25s ease;
}

.filter-group.open .toggle-icon { transform: rotate(45deg); }

.filter-options {
    display: none;
    padding: 0 0 0.6rem 0;
}

.filter-group.open .filter-options { display: block; }

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--charcoal);
    cursor: pointer;
    transition: color 0.12s;
}

.filter-options label:hover { color: var(--sage-dark); }

.filter-options input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--sage);
    cursor: pointer;
}

.filter-options .filter-checkbox {
    /* Uses the same layout as the auto-generated labels */
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--charcoal);
    cursor: pointer;
}
.filter-options .filter-note {
    margin: 0.45rem 0 0 0;
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--mid-grey);
    line-height: 1.35;
    font-style: italic;
}

.filter-options .zone-filter-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--charcoal);
    margin-bottom: 0.35rem;
}
.filter-options .zone-filter-select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--charcoal);
    background: var(--cream, #fafaf7);
    border: 1px solid var(--warm-grey, #ddd);
    border-radius: 4px;
    cursor: pointer;
}
.filter-options .zone-filter-select:focus {
    outline: 2px solid var(--sage-text);
    outline-offset: 1px;
}

/* === PLANT GRID === */
.plant-grid-container {
    flex: 1;
    padding: 0 1.5rem 1.5rem;
    min-width: 0;
}

.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* List view */
.plant-grid.list-view {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.plant-grid.list-view .plant-card {
    display: flex;
    flex-direction: row;
    border-radius: 6px;
}

.plant-grid.list-view .plant-card-img-wrap {
    width: 100px;
    flex-shrink: 0;
}

.plant-grid.list-view .plant-card-img {
    aspect-ratio: 1;
    height: 100%;
    border-radius: 6px 0 0 6px;
}

.plant-grid.list-view .plant-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    padding: 0.6rem 1rem;
}

.plant-grid.list-view .plant-card-name { margin-bottom: 0; }
.plant-grid.list-view .plant-card-common { margin-bottom: 0; }

/* === PLANT CARD === */
.plant-card {
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

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

.plant-card-img-wrap {
    position: relative;
    overflow: hidden;
}

.plant-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--cream-dark);
    transition: transform 0.4s ease;
}

/* Failed image fallback -- applied by window.fleurImgError.
   Softens the placeholder + hides hover zoom so broken images aren't jarring. */
img[data-image-failed="true"] {
    object-fit: contain !important;
    padding: 18% !important;
    background: var(--cream-dark);
    opacity: 0.85;
    transform: none !important;
}
.plant-card:hover .plant-card-img[data-image-failed="true"] {
    transform: none;
}

.plant-card:hover .plant-card-img {
    transform: scale(1.04);
}

/* Favourite heart */
.fav-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.2s, background 0.2s;
    opacity: 0;
}

.plant-card:hover .fav-btn { opacity: 1; }
.fav-btn.active { opacity: 1; }

.fav-btn:hover {
    transform: scale(1.15);
    background: rgba(255,255,255,0.95);
}

.fav-btn svg {
    width: 16px;
    height: 16px;
    transition: fill 0.2s, stroke 0.2s;
}

.fav-btn svg {
    fill: none;
    stroke: var(--mid-grey);
    stroke-width: 2;
}

.fav-btn.active svg {
    fill: var(--fav-color);
    stroke: var(--fav-color);
}

/* Season indicator dot */
.season-dot {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    display: flex;
    gap: 3px;
}

.season-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0.8;
}

.season-pip.spring { background: #8BC34A; }
.season-pip.summer { background: #FFB300; }
.season-pip.autumn { background: #E65100; }
.season-pip.winter { background: #90CAF9; }

.plant-card-body {
    padding: 0.9rem;
}

.plant-card-name {
    font-size: 0.9rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.plant-card-common {
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 0.4rem;
}

.plant-card-meta {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.plant-tag {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.04em;
}

.plant-tag-type {
    color: #fff;
}

.plant-tag-family {
    background: var(--sage-light);
    color: var(--sage-dark);
}

.plant-tag-hardiness {
    background: var(--cream-dark);
    color: var(--mid-grey);
    font-size: 0.6rem;
}

/* === SKELETON LOADING === */
@keyframes skeleton-pulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 8px;
    overflow: hidden;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-body {
    padding: 0.9rem;
}

.skeleton-line {
    height: 12px;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.tag { width: 30%; height: 18px; display: inline-block; margin-right: 0.35rem; }

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--mid-grey);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.no-results p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* === MODALS === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
}

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

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    background: var(--cream);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--charcoal);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.modal-close:hover { background: var(--light-grey); transform: scale(1.08); }

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

.modal-gallery {
    background: var(--cream-dark);
    position: relative;
    overflow: hidden;
    border-radius: 12px 0 0 12px;
}

.modal-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--charcoal);
    transition: background 0.2s, transform 0.15s;
}

.gallery-nav:hover { background: var(--white); transform: translateY(-50%) scale(1.08); }
.gallery-nav.prev { left: 0.5rem; }
.gallery-nav.next { right: 0.5rem; }

.gallery-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.35rem;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
}

.gallery-dot.active { background: var(--white); transform: scale(1.2); }

/* Modal Favourite */
.modal-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: transparent;
    border: 1.5px solid var(--light-grey);
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.modal-fav-btn:hover { border-color: var(--fav-color); color: var(--fav-color); }

.modal-fav-btn.active {
    background: rgba(226,85,85,0.06);
    border-color: var(--fav-color);
    color: var(--fav-color);
}

.modal-info {
    padding: 2rem;
}

.modal-info h2 {
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 0.25rem;
}

.modal-common {
    font-size: 1rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 0.15rem;
}

.modal-family {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--sage-text);
    margin-bottom: 0.5rem;
}

.toxicity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.6rem;
    margin: 0 0 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 3px;
    border: 1px solid transparent;
}
.toxicity-badge.toxic {
    background: #fbe9e9;
    color: #8a1f1f;
    border-color: #e5b9b9;
}
.toxicity-badge.caution {
    background: #fdf4e1;
    color: #7a5314;
    border-color: #e7d4a2;
}
[data-theme="dark"] .toxicity-badge.toxic {
    background: rgba(180, 60, 60, 0.18);
    color: #f3b6b6;
    border-color: rgba(180, 60, 60, 0.4);
}
[data-theme="dark"] .toxicity-badge.caution {
    background: rgba(200, 150, 50, 0.14);
    color: #e8c98a;
    border-color: rgba(200, 150, 50, 0.35);
}

.modal-desc {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--charcoal);
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--cream-dark);
}

.modal-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.5rem;
}

.attr-item {
    display: flex;
    flex-direction: column;
}

.attr-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--mid-grey);
    margin-bottom: 0.1rem;
}

.attr-value {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--charcoal);
    text-transform: capitalize;
}

/* === ORIGIN & MAP === */
.section-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--sage-text);
    margin-bottom: 0.5rem;
}

.origin-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cream-dark);
}

.origin-text {
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.origin-map {
    background: var(--cream);
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid var(--cream-dark);
}

.origin-map svg {
    width: 100%;
    height: auto;
    display: block;
}

/* === WHERE TO BUY === */
.buy-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cream-dark);
}

.buy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.buy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--charcoal);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.buy-link:hover {
    background: #fff;
    border-color: var(--sage);
    transform: translateY(-1px);
}

.buy-link-name { font-weight: 500; }

.buy-link-rating {
    font-size: 0.7rem;
    color: var(--sage-text);
    font-weight: 600;
}

.buy-link-arrow {
    color: var(--sage-text);
    font-weight: 600;
}

.buy-disclosure {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    font-style: italic;
    color: var(--mid-grey);
    line-height: 1.4;
}

/* Primary "Buy at <supplier>" CTA — Phase 1 §5 (Session 23) */
.buy-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--sage-text);     /* AA-safe sage on white text (4.55:1) — see .btn-primary */
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(93, 122, 58, 0.18);
    transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
}
.buy-primary:hover {
    background: var(--sage-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(93, 122, 58, 0.28);
}
.buy-primary:focus-visible {
    outline: 3px solid var(--sage-text);
    outline-offset: 2px;
}
.buy-primary-icon { font-size: 1.1rem; line-height: 1; }
.buy-primary-label { flex: 1; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.buy-primary-action { letter-spacing: 0.01em; }
.buy-primary-arrow { font-weight: 700; opacity: 0.85; transition: transform 0.15s; }
.buy-primary:hover .buy-primary-arrow { transform: translateX(2px); }
.buy-primary .buy-link-rating {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
}

/* Dark-mode override: light sage bg needs dark text for AA contrast (~9:1 vs ~3.5:1). */
[data-theme="dark"] .buy-primary {
    color: #1a1d1e;
}
[data-theme="dark"] .buy-primary .buy-link-rating {
    color: rgba(26, 29, 30, 0.85);
}

/* "Also available at:" row sits beneath the primary CTA */
.buy-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.buy-secondary-label {
    font-size: 0.75rem;
    color: var(--mid-grey);
    margin-right: 0.25rem;
}

@media (max-width: 600px) {
    .buy-primary { font-size: 0.9rem; padding: 0.95rem 1rem; }
}

@media print { .buy-section { display: none !important; } }

/* === SUGGESTIONS === */
.suggestions-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cream-dark);
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.suggestion-card {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.suggestion-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.suggestion-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--cream-dark);
}

.suggestion-card-body {
    padding: 0.5rem 0.6rem;
}

.suggestion-card-name {
    font-size: 0.72rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    line-height: 1.3;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-card-common {
    font-size: 0.65rem;
    font-weight: 300;
    color: var(--mid-grey);
}

.suggestion-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.suggestion-badge {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sage-dark);
    background: rgba(106, 135, 89, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* === EDIT MODAL === */
.modal-edit {
    max-width: 700px;
    padding: 2rem;
}

.modal-edit h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.edit-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.edit-form .form-group {
    margin-bottom: 0.9rem;
}

.edit-form label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--mid-grey);
    margin-bottom: 0.3rem;
}

.edit-form input,
.edit-form select,
.edit-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--charcoal);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.edit-form input:focus,
.edit-form select:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--sage-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cream-dark);
}

/* === SCROLL TO TOP === */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--sage-text);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 90;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
    pointer-events: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: var(--sage-dark);
    transform: translateY(-2px);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .header-search {
        order: 3;
        max-width: none;
        width: 100%;
        flex-basis: 100%;
    }

    .logo-sub { display: none; }

    .header {
        height: auto;
        min-height: var(--nav-height);
    }

    .main-layout {
        margin-top: 110px;
    }

    .btn-designer {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        width: 280px;
        height: calc(100vh - var(--nav-height));
        z-index: 50;
        transition: left 0.3s;
        box-shadow: none;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    .filter-toggle { display: block; }

    .plant-grid-container {
        padding: 0 1rem 1rem;
    }

    .plant-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .plant-card-body { padding: 0.65rem; }
    .plant-card-name { font-size: 0.8rem; }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-gallery {
        max-height: 300px;
        border-radius: 12px 12px 0 0;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .modal-info { padding: 1.25rem; }

    .modal-attributes {
        grid-template-columns: 1fr;
    }

    .suggestions-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .suggestion-card-name { font-size: 0.65rem; }
    .suggestion-card-common { font-size: 0.6rem; }

    .modal-edit { padding: 1.25rem; }

    .edit-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .toolbar-strip { padding: 0.5rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .toolbar-left, .toolbar-right { flex-wrap: wrap; }
}

/* === AD PLACEHOLDERS === */
.ad-placeholder {
    margin: 1rem 0;
    padding: 1.5rem 1rem;
    border: 1.5px dashed var(--light-grey);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: var(--cream);
}
.ad-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--light-grey);
}

.ad-placeholder.sponsor-filled {
    padding: 0;
    border-style: solid;
    border-color: var(--sage, #95a67d);
    background: var(--cream);
}
.ad-placeholder .sponsor-link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    gap: 0.3rem;
}
.ad-placeholder .sponsor-link:hover { background: rgba(149,166,125,0.08); }
.ad-placeholder .sponsor-image {
    width: 100%;
    max-height: 90px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.ad-placeholder .sponsor-headline {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #333);
    line-height: 1.3;
}
.ad-placeholder .sponsor-subline {
    font-size: 0.74rem;
    color: var(--text-secondary, #666);
    line-height: 1.35;
}
.ad-placeholder .sponsor-link .ad-label {
    align-self: flex-start;
    color: var(--sage, #95a67d);
}
@media print { .ad-placeholder { display: none; } }

/* === GALLERY === */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.gallery-header {
    text-align: center;
    margin-bottom: 2rem;
}
.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}
.gallery-subtitle {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 1rem;
}
.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}
.gallery-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-colour, #e8e6e1);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.gallery-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-colour, #f5f5f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gallery-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-card-placeholder {
    opacity: 0.3;
}
.gallery-card-body {
    padding: 0.75rem 0.9rem;
}
.gallery-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}
.gallery-card-creator {
    font-size: 0.75rem;
    opacity: 0.65;
}
.gallery-card-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    background: var(--sage-light, #d5e3d0);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-dark, #3a5a3a);
}
.gallery-card-featured {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.18rem 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #b48a13;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 2;
}
.gallery-card-img { position: relative; }
.gallery-card-stats {
    display: flex;
    gap: 0.8rem;
    font-size: 0.72rem;
    opacity: 0.5;
}
/* M11/M12 — gallery social-signal counts (views + forks + comments). Hidden via
   inline conditional render in createGalleryCard when all counts are zero. */
.gallery-card-counts {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--colour-text-muted);
}
.gallery-card-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1;
}
.gallery-card-count svg {
    color: var(--sage-text);
    flex-shrink: 0;
}
.gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    opacity: 0.6;
}
.gallery-empty p {
    margin-bottom: 1rem;
}
.gallery-loading {
    text-align: center;
    padding: 2rem;
    opacity: 0.5;
}
.gallery-load-more {
    display: block;
    margin: 1.5rem auto 0;
}
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* === SITE FOOTER === */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    background: var(--white);
    border-top: 1px solid var(--light-grey);
    font-size: 0.72rem;
    font-weight: 300;
    color: var(--mid-grey);
    transition: background 0.3s;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-link {
    color: var(--mid-grey);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 400;
    transition: color 0.15s;
}
.footer-link:hover {
    color: var(--sage-dark);
}

/* === DESIGNER LINK BUTTON === */
.btn-designer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--sage-text);
    border: 1.5px solid var(--sage-text);
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-designer:hover {
    background: var(--sage-dark);
    border-color: var(--sage-dark);
    box-shadow: 0 2px 8px rgba(90,125,94,0.25);
    color: #fff;
    text-decoration: none;
}
.btn-designer:active { transform: scale(0.97); }
.btn-designer svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* === AUTH / LOGIN === */
.btn-login {
    font-size: 0.7rem;
    padding: 0.45rem 0.9rem;
}

.btn-login.logged-in {
    background: var(--sage-text);
    color: #fff;
    border-color: var(--sage-text);
}

.modal-auth {
    max-width: 480px;
    padding: 2.5rem 2rem;
}

.modal-auth h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 1.5rem;
}

.auth-gate-banner {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--sage-dark);
    background: var(--sage-light);
    border-left: 3px solid var(--sage);
    padding: 0.65rem 0.85rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.auth-form .form-group {
    margin-bottom: 0.9rem;
}

.auth-form label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--mid-grey);
    margin-bottom: 0.3rem;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--light-grey);
    border-radius: 6px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--charcoal);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--sage-light);
}

.auth-error {
    font-size: 0.8rem;
    color: #c44;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(204,68,68,0.06);
    border-radius: 4px;
}
.auth-success {
    font-size: 0.8rem;
    color: #4a8c5c;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(74,140,92,0.08);
    border-radius: 4px;
}

.form-hint {
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-top: 0.2rem;
}

.form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    font-size: 0.72rem;
    color: var(--mid-grey);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cream-dark);
}

/* Account type selector */
.account-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.account-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border: 1.5px solid var(--light-grey);
    border-radius: 8px;
    background: var(--cream);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.account-type-option:hover {
    border-color: var(--sage);
}

.account-type-option.selected {
    border-color: var(--sage);
    background: var(--sage-light);
}

.account-type-option input[type="radio"] {
    display: none;
}

.account-type-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.account-type-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--charcoal);
}

.account-type-desc {
    font-size: 0.6rem;
    font-weight: 300;
    color: var(--mid-grey);
    line-height: 1.3;
}

.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cream-dark);
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--sage-text);
    font-family: 'Lato', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.auth-switch button:hover {
    color: var(--sage-dark);
}

/* === OAuth Sign-In Buttons === */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--light-grey);
    border-radius: 6px;
    background: var(--white);
    color: var(--charcoal);
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-oauth:hover {
    border-color: var(--sage);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.btn-oauth:active {
    transform: scale(0.98);
}

.btn-oauth:focus-visible {
    outline: 2px solid var(--sage-text);
    outline-offset: 2px;
}

.oauth-icon {
    flex-shrink: 0;
}

/* Apple button — dark per brand guidelines */
.btn-oauth-apple {
    background: var(--charcoal);
    color: var(--cream);
    border-color: var(--charcoal);
}

.btn-oauth-apple:hover {
    opacity: 0.9;
    border-color: var(--charcoal);
}

[data-theme="dark"] .btn-oauth-google {
    background: var(--cream-dark, #2a2a2c);
    border-color: var(--light-grey);
    color: var(--cream);
}

[data-theme="dark"] .btn-oauth-apple {
    background: #fff;
    color: #000;
    border-color: #fff;
}

@media (max-width: 600px) {
    .btn-oauth {
        min-height: 44px;
        font-size: 0.9rem;
    }
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.account-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.account-role {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--sage-light);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sage-dark);
}
.account-zone-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e8f0e4;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #3a6b35;
    margin-left: 0.35rem;
}
[data-theme="dark"] .account-zone-badge {
    background: rgba(140, 181, 144, 0.18);
    color: #A5D4A9;
}

.account-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--cream);
    border-radius: 8px;
    border: 1px solid var(--cream-dark);
}

.account-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.account-info-label {
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mid-grey);
}

.account-info-value {
    font-weight: 300;
    color: var(--charcoal);
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.account-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--cream);
    border-radius: 8px;
    border: 1px solid var(--cream-dark);
}

.account-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sage-dark);
}

.account-stat-label {
    font-size: 0.6rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mid-grey);
}

.account-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-danger {
    color: #c44 !important;
    border-color: #c44 !important;
}

.btn-danger:hover {
    background: #c44 !important;
    color: #fff !important;
}

/* === FOCUS STATES (Accessibility) === */
*:focus-visible {
    outline: 2px solid var(--sage-text);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--sage-text);
    outline-offset: 2px;
}

/* Skip to content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--sage-text);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--light-grey); border-radius: 2px; }

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: var(--light-grey); border-radius: 3px; }

/* === CARD STAGGER ANIMATION === */
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.plant-card {
    animation: cardFadeIn 0.3s ease both;
}

/* Toast styles moved to tokens.css (cross-page primitive, S24) */

/* === FILTER COUNTS === */
.filter-count {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--mid-grey);
    margin-left: auto;
    padding-left: 0.3rem;
    opacity: 0.7;
}

/* === KEYBOARD SHORTCUT HELP === */
.kbd-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.15s ease;
}

.kbd-help-overlay .modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(2px);
}

.kbd-help-panel {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 460px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.2s ease;
}

.kbd-help-panel h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.kbd-help-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--charcoal);
    cursor: pointer;
    opacity: 0.6;
    border-radius: 50%;
}
.kbd-help-close:hover { opacity: 1; background: var(--cream); }

.kbd-help-section { margin-top: 1.1rem; }
.kbd-help-section:first-of-type { margin-top: 0; }
.kbd-help-section h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-dark, #5a7a5e);
    margin-bottom: 0.5rem;
}

.kbd-help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.kbd-help-actions .btn-outline { text-decoration: none; }

.kbd-help-text {
    font-size: 0.82rem;
    color: var(--charcoal);
    line-height: 1.5;
    margin: 0.25rem 0;
}
.kbd-help-text a { color: var(--sage-dark, #5a7a5e); text-decoration: underline; }
.kbd-help-muted { opacity: 0.75; font-size: 0.78rem; }

/* ===== Onboarding tour ===== */
.fleur-tour {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}
.fleur-tour[hidden] { display: none; }
.fleur-tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 20, 0.45);
    pointer-events: auto;
}
.fleur-tour-spotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(16, 24, 20, 0.45),
                0 0 0 3px #7A9E7E,
                0 10px 30px rgba(0,0,0,0.25);
    transition: all 0.25s ease;
    pointer-events: none;
}
.fleur-tour-popover {
    position: absolute;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--white);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    pointer-events: auto;
    animation: modalSlideIn 0.2s ease;
}
.fleur-tour-step {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage-dark, #5a7a5e);
    margin-bottom: 0.35rem;
}
.fleur-tour-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: var(--charcoal);
}
.fleur-tour-body {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--charcoal);
    margin: 0 0 1rem;
}
.fleur-tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.fleur-tour-skip {
    background: transparent;
    border: none;
    color: var(--mid-grey);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.3rem 0.2rem;
}
.fleur-tour-skip:hover { color: var(--charcoal); text-decoration: underline; }
.fleur-tour-nav { display: flex; gap: 0.4rem; }
.fleur-tour-nav button:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 520px) {
    .fleur-tour-popover { width: calc(100vw - 24px); left: 12px !important; }
}

.kbd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    color: var(--charcoal);
    border-bottom: 1px solid var(--cream-dark);
}

.kbd-row:last-child { border-bottom: none; }

kbd {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    background: var(--cream);
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--charcoal);
    box-shadow: 0 1px 0 var(--light-grey);
    min-width: 24px;
    text-align: center;
}

/* === SCROLL PROGRESS === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--sage);
    z-index: 101;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* === MODAL ACTION BAR === */
.modal-action-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.75rem;
}

.modal-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    background: transparent;
    border: 1.5px solid var(--light-grey);
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.modal-action-btn:hover {
    border-color: var(--sage);
    color: var(--sage-text);
    background: var(--sage-light);
}

/* === MOBILE BOTTOM NAV === */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--light-grey);
    z-index: 160;
    justify-content: space-around;
    padding: 0.35rem 0 max(0.35rem, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    transition: background 0.3s;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.3rem 0.6rem;
    background: none;
    border: none;
    color: var(--mid-grey);
    font-family: 'Lato', sans-serif;
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--sage-dark);
}

.mobile-nav-item svg {
    opacity: 0.7;
    transition: opacity 0.15s;
}

.mobile-nav-item.active svg,
.mobile-nav-item:hover svg {
    opacity: 1;
}

/* === GALLERY SWIPE INDICATOR === */
.gallery-swipe-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.65rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-swipe-hint.visible { opacity: 1; }

/* === PLANT CARE SHEET (export) === */
.care-sheet {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 500;
    background: #fff;
    overflow-y: auto;
    color: #2C2C2C;
    font-family: 'Lato', sans-serif;
}

.care-sheet-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

.care-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #7A9E7E;
}

.care-sheet-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 0.2rem;
    color: #2C2C2C;
}

.care-sheet-title h2 {
    font-size: 1rem;
    font-weight: 300;
    color: #6B6B6B;
    margin-bottom: 0.15rem;
}

.care-sheet-title .family {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #7A9E7E;
}

.care-sheet-logo {
    font-family: 'Yesterday', 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #7A9E7E;
}

.care-sheet-image {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.care-sheet-desc {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #2C2C2C;
}

.care-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.care-sheet-attr {
    padding: 0.6rem;
    background: #FAF7F2;
    border-radius: 6px;
    border: 1px solid #E8E3DB;
}

.care-sheet-attr-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6B6B6B;
    margin-bottom: 0.2rem;
}

.care-sheet-attr-value {
    font-size: 0.85rem;
    font-weight: 400;
    color: #2C2C2C;
}

.care-sheet-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #E8E3DB;
    font-size: 0.7rem;
    color: #6B6B6B;
}

.care-sheet-actions {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 501;
}

.care-sheet-actions button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.care-sheet-actions .btn-print {
    background: #7A9E7E;
    color: #fff;
}

.care-sheet-actions .btn-print:hover { background: #5A7D5E; }

.care-sheet-actions .btn-close-sheet {
    background: #E8E3DB;
    color: #2C2C2C;
}

/* === COLOUR SWATCH PICKER === */
.colour-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0.35rem 0;
}

.colour-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.colour-swatch:hover {
    transform: scale(1.18);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.colour-swatch.active {
    border-color: var(--sage-dark);
    box-shadow: 0 0 0 2px var(--sage-light), 0 2px 8px rgba(0,0,0,0.1);
    transform: scale(1.12);
}

.colour-swatch.active::after {
    content: '✓';
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.colour-swatch[data-colour="white"].active::after,
.colour-swatch[data-colour="cream"].active::after,
.colour-swatch[data-colour="yellow"].active::after {
    color: #333;
    text-shadow: none;
}

.colour-swatch-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 400;
    color: var(--mid-grey);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.colour-swatch:hover .colour-swatch-label {
    opacity: 1;
}

.colour-swatch-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--sage-text);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.colour-swatch:hover .colour-swatch-count {
    opacity: 1;
}

/* === SIMILAR PLANTS BANNER === */
.similar-banner {
    background: var(--sage-light);
    border: 1px solid var(--sage);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    animation: slideDown 0.25s ease;
}

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

.similar-banner-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.similar-banner-icon {
    color: var(--sage-dark);
    flex-shrink: 0;
}

.similar-banner-text {
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--charcoal);
    flex: 1;
}

.similar-banner-text strong {
    font-weight: 600;
    font-style: italic;
}

.similar-banner-close {
    background: none;
    border: 1.5px solid var(--sage);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--sage-dark);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.similar-banner-close:hover {
    background: var(--sage-text);
    color: #fff;
}

/* === FIND SIMILAR BUTTON ON CARDS === */
.similar-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.2s, background 0.2s;
    opacity: 0;
}

.plant-card:hover .similar-btn { opacity: 1; }

.similar-btn:hover {
    transform: scale(1.15);
    background: var(--sage);
}

.similar-btn:hover svg {
    stroke: #fff;
}

.similar-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--mid-grey);
    stroke-width: 2;
    fill: none;
}

/* === MOBILE RESPONSIVE ENHANCEMENTS === */
@media (max-width: 600px) {
    .mobile-nav { display: flex; }

    .site-footer { padding-bottom: calc(3.5rem + env(safe-area-inset-bottom)); }

    .scroll-top-btn { bottom: 5rem; }

    /* .toast-container mobile offset moved to tokens.css (S24) */

    /* Larger touch targets */
    .plant-card { min-height: 44px; }
    .fav-btn { width: 38px; height: 38px; opacity: 1; }
    .similar-btn { width: 34px; height: 34px; opacity: 0.8; }
    .colour-swatch { width: 32px; height: 32px; }

    .btn-outline, .btn-primary {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .filter-options label {
        padding: 0.4rem 0;
        min-height: 38px;
        align-items: center;
    }

    .filter-options input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    /* Gallery touch-friendly */
    .gallery-nav {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    /* Modal stacks on mobile */
    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-gallery {
        max-height: 250px;
        border-radius: 0;
    }

    .modal-info {
        padding: 1rem;
    }

    .modal-action-bar {
        gap: 0.35rem;
    }

    .modal-action-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    /* Header adjustments for mobile nav */
    .header-actions .btn-login,
    .header-actions .filter-toggle {
        display: none;
    }

    .header-actions .btn-designer { display: none; }
}

/* === PRINT === */
@media print {
    .header, .sidebar, .site-footer, .scroll-top-btn, .toast-container, .mobile-nav { display: none; }
    .main-layout { margin-top: 0; }
    .plant-card { break-inside: avoid; animation: none; }
}

/* Care sheet print */
@media print {
    .care-sheet-actions { display: none; }
    .care-sheet { position: static; height: auto; }
    .care-sheet-inner { padding: 0; }
}

/* === IMAGE CREDIT OVERLAYS (Step 11 — iNat attribution) === */
/* .plant-card-img-wrap already position:relative above */
.plant-card-credit {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    font-size: 0.62rem;
    line-height: 1.2;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 3px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

.suggestion-card-img-wrap { position: relative; }
.suggestion-card-credit {
    position: absolute;
    left: 4px;
    bottom: 4px;
    padding: 1px 5px;
    font-size: 0.55rem;
    line-height: 1.2;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 3px;
    max-width: calc(100% - 8px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

.gallery-caption {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
    max-width: calc(100% - 80px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 3;
}
.gallery-caption a {
    color: #fff;
    text-decoration: none;
}
.gallery-caption a:hover {
    text-decoration: underline;
}

@media print {
    .plant-card-credit,
    .suggestion-card-credit,
    .gallery-caption { display: none; }
}

/* ──────────────────────────────────────────────────────────────
   M6 — Pro tier: paywall modal + account billing block
   ────────────────────────────────────────────────────────────── */

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d4a020 0%, #b07c10 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.35rem;
    line-height: 1;
}

.modal-paywall {
    max-width: 520px;
    padding: 2rem;
}
.paywall-header {
    text-align: center;
    margin-bottom: 1.25rem;
}
.paywall-header .pro-badge {
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    padding: 0.22rem 0.6rem;
}
.paywall-header h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.6rem;
}
.paywall-reason {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
}
.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.paywall-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.95rem;
    color: var(--text, #1f1f21);
}
.paywall-tick {
    color: #2e8b57;
    font-weight: 700;
    flex: 0 0 auto;
    margin-top: 0.05rem;
}
.paywall-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.paywall-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.1rem 0.75rem;
    background: #fff;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    font: inherit;
    color: inherit;
}
.paywall-plan:hover:not(:disabled) {
    border-color: var(--accent, #2e8b57);
    transform: translateY(-1px);
}
.paywall-plan:disabled,
.paywall-plan.is-loading {
    cursor: wait;
    opacity: 0.7;
}
.paywall-plan-annual {
    border-color: var(--accent, #2e8b57);
    background: linear-gradient(to bottom, rgba(46,139,87,0.04), #fff);
}
.paywall-plan-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.paywall-plan-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text, #1f1f21);
}
.paywall-plan-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted, #6b7280);
    margin-left: 0.15rem;
}
.paywall-plan-note {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}
.paywall-plan-badge {
    position: absolute;
    top: -0.6rem;
    right: -0.4rem;
    background: #2e8b57;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    letter-spacing: 0.05em;
}
.paywall-fine {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    text-align: center;
}
.paywall-error {
    margin: 0.8rem 0 0 0;
    padding: 0.6rem 0.8rem;
    background: #fdecec;
    color: #a12828;
    border-radius: 8px;
    font-size: 0.88rem;
    text-align: center;
}
.paywall-signin {
    margin: 0.8rem 0 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
}
.paywall-signin .link-btn,
.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent, #2e8b57);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* Account billing block */
.account-billing {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-subtle, #f8f9fa);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
}
.account-billing-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.account-billing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.account-billing-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.account-billing-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text, #1f1f21);
}
.account-billing-meta {
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
    text-align: right;
    flex: 1 1 100%;
}
@media (min-width: 480px) {
    .account-billing-meta { flex: 0 1 auto; }
}
.account-billing-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.account-billing-actions .btn-primary,
.account-billing-actions .btn-outline {
    flex: 1 1 0;
    min-width: 140px;
    text-align: center;
    justify-content: center;
}
.account-pastdue-banner {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
    background: #fdecec;
    color: #8a1c1c;
    border: 1px solid #f1b7b7;
    border-radius: 8px;
    font-size: 0.88rem;
}
.account-pastdue-banner strong {
    font-weight: 700;
}

/* Pro branding (logo + terms) in profile edit mode */
.profile-pro-section {
    margin-top: 0.5rem;
}
.logo-upload-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.logo-preview {
    width: 96px;
    height: 60px;
    border: 1px dashed var(--border, #d1d5db);
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}
.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.logo-preview-empty {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
    text-align: center;
    padding: 0 0.3rem;
}
.logo-upload-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* === Onboarding modal (S25 — Phase 2 §1) ============================== */
.onboarding-modal {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.onboarding-modal[style*="display: flex"] { display: flex; }
.onboarding-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.onboarding-shell {
    position: relative;
    background: var(--colour-bg);
    color: var(--colour-text);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.4rem 2rem 1.4rem;
}
.onboarding-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}
.onboarding-close:hover { opacity: 1; }
.onboarding-progress {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.onboarding-question {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.7rem;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}
.onboarding-subtitle {
    font-size: 0.95rem;
    margin: 0 0 1.4rem;
    opacity: 0.75;
}
.onboarding-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.onboarding-option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    background: rgba(122, 158, 126, 0.08);
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    font: inherit;
    color: inherit;
}
.onboarding-option-card:hover,
.onboarding-option-card:focus-visible {
    border-color: var(--sage-text);
    background: rgba(122, 158, 126, 0.18);
    outline: none;
}
.onboarding-option-card:active { transform: scale(0.98); }
.onboarding-option-icon { font-size: 1.6rem; line-height: 1; }
.onboarding-option-label { font-size: 1rem; font-weight: 500; }

.onboarding-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}
.onboarding-template-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.1rem 1rem;
    background: var(--cream-dark);
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, transform 0.1s ease;
    font: inherit;
    color: inherit;
}
.onboarding-template-card:hover,
.onboarding-template-card:focus-visible {
    border-color: var(--sage-text);
    outline: none;
}
.onboarding-template-card:active { transform: scale(0.99); }
.onboarding-template-card--recommended {
    border-color: var(--sage-text);
    box-shadow: 0 0 0 1px var(--sage-text);
}
.onboarding-template-card--loading { opacity: 0.6; pointer-events: none; }
.onboarding-recommended-badge {
    position: absolute;
    top: -0.55rem;
    right: 0.8rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--sage-text);
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
[data-theme="dark"] .onboarding-recommended-badge { color: #1a1d1e; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .onboarding-recommended-badge { color: #1a1d1e; }
}
.onboarding-template-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.onboarding-template-summary {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
}
.onboarding-template-desc {
    margin: 0.15rem 0 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}
.onboarding-template-cta {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--sage-text);
    font-weight: 600;
}
.onboarding-skip {
    display: block;
    margin: 1.4rem auto 0;
    background: none;
    border: none;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    color: inherit;
    opacity: 0.65;
    padding: 0.3rem;
}
.onboarding-skip:hover { opacity: 1; }

@media (max-width: 600px) {
    .onboarding-shell { padding: 2rem 1.2rem 1rem; }
    .onboarding-question { font-size: 1.4rem; }
    .onboarding-options,
    .onboarding-template-grid { grid-template-columns: 1fr; }
}
