/* === FLEUR Garden Designer Styles === */

/* ==================== OFFLINE BANNER (mirrors style.css) ==================== */
.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; } }

/* ==================== AUTOSAVE STATUS CHIP ====================
   Visible feedback for autoSave(). States: idle, saving, saved, queued, failed. */
.autosave-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--cream-dark, #ecebe4);
    color: var(--text-muted, #6b6b6b);
    margin-left: 0.35rem;
    cursor: default;
    user-select: none;
    transition: background 0.18s, color 0.18s, opacity 0.18s;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.autosave-status .autosave-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.autosave-status[data-state="saving"] { color: #6a7fb5; background: #e7ecf5; }
.autosave-status[data-state="saving"] .autosave-dot { animation: fleur-autosave-pulse 1s ease-in-out infinite; }
.autosave-status[data-state="saved"]  { color: #4a7a4a; background: #e6f1e6; }
.autosave-status[data-state="queued"] { color: #8a6a20; background: #fbf1d8; }
.autosave-status[data-state="failed"] { color: #b04a20; background: #fbe4da; cursor: pointer; }
.autosave-status[data-state="failed"]:hover { filter: brightness(0.95); }
@keyframes fleur-autosave-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
@media print { .autosave-status { display: none !important; } }

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

/* Designer auth banner */
.designer-auth-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: #fdf4e1;
    color: #7a5314;
    border-bottom: 1px solid #e7d4a2;
    font-size: 0.85rem;
    text-align: center;
}
.designer-auth-banner a {
    color: #7a5314;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 0.25rem;
}
.designer-auth-banner button {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: #7a5314; margin-left: 0.75rem;
    vertical-align: middle;
}
[data-theme="dark"] .designer-auth-banner {
    background: #3a3020;
    color: #e8c98a;
    border-bottom-color: #5a4a2a;
}
[data-theme="dark"] .designer-auth-banner a { color: #e8c98a; }
[data-theme="dark"] .designer-auth-banner button { color: #e8c98a; }

/* Screen-reader-only content (visible to AT, hidden visually) */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --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;
    --text-primary: var(--charcoal);
    --text-muted: var(--mid-grey);
    --border-colour: var(--light-grey);
    --warm-grey: var(--mid-grey);
    --nav-height: 44px;
    --toolbar-height: 40px;
    --palette-width: 250px;
    --props-width: 220px;
    --status-height: 28px;
    /* Plant type colors */
    --color-tree: #5A7D5E;
    --color-shrub: #7A9E7E;
    --color-perennial: #A8C5AB;
    --color-grass: #C4D4A0;
    --color-climber: #8B9DC3;
    --color-bulb: #D4A0C4;
    --color-conifer: #3D6B4F;
    --color-fern: #6BAF7E;
    --color-annual: #E8C170;
}

/* === 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);
    --color-tree: #6B9E6E;
    --color-shrub: #8DB598;
    --color-perennial: #A5CDA8;
    --color-grass: #C4D4A0;
    --color-climber: #9AADD3;
    --color-bulb: #D4A0C4;
    --color-conifer: #5A9E6B;
    --color-fern: #7AB58A;
    --color-annual: #E8C170;
}

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

body {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    color: var(--charcoal);
    background: var(--cream-dark);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    transition: background 0.3s, color 0.3s;
}

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

[data-theme="dark"] .header {
    background: rgba(26, 29, 30, 0.98);
}

[data-theme="dark"] .toolbar-strip {
    background: rgba(26, 29, 30, 0.94);
}

.toolbar-strip {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    background: rgba(250, 247, 242, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--light-grey);
    z-index: 99;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 0.5rem;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

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

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

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

.header-nav {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.nav-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mid-grey);
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--sage-dark); }
.nav-link.active {
    background: var(--sage-light);
    color: var(--sage-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    /* Tablet/laptop widths: header packs Save / Snapshot / History / Share /
       Export / Care / Shop / Load / Help — let the row scroll horizontally
       rather than clipping the rightmost buttons. Dropdowns inside (Share,
       Export) are reparented to document.body on open, so their menus are
       not clipped by this overflow context. */
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
.header-actions > * { flex-shrink: 0; }
.header-actions::-webkit-scrollbar { height: 4px; }
.header-actions::-webkit-scrollbar-track { background: transparent; }
.header-actions::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
}
[data-theme="dark"] .header-actions {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
[data-theme="dark"] .header-actions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

/* Toolbar (inside toolbar-strip — no background/border of its own) */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    /* Safety net for tablet widths: if the toolbar can't fit, let it scroll
       horizontally instead of silently overflowing or clipping tools. */
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    min-width: 0;
}
.toolbar::-webkit-scrollbar { height: 4px; }
.toolbar::-webkit-scrollbar-thumb { background: var(--light-grey, #D9D5CC); border-radius: 2px; }

.tool-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 2px;
    color: var(--mid-grey);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    transition: all 0.15s;
}

.tool-btn:hover { background: var(--cream); color: var(--charcoal); }
.tool-btn.active { background: var(--sage-light); color: var(--sage-dark); }
.tool-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

.toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--light-grey);
    margin: 0 0.15rem;
}

.zoom-level {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--mid-grey);
    min-width: 36px;
    text-align: center;
}

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

.btn-primary:hover { background: var(--sage-dark); }

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

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

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.65rem; }

.btn-danger { color: #c44 !important; border-color: #c44 !important; }
.btn-danger:hover { background: #c44 !important; color: var(--white) !important; }

/* W7 polish: shared a11y + disabled states for the designer button system. */
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.btn-icon:focus-visible,
.tool-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--sage-text);
    outline-offset: 2px;
}

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

.btn-primary:hover {
    box-shadow: var(--shadow-sm);
}

/* === MAIN LAYOUT === */
.designer-layout {
    display: flex;
    position: fixed;
    top: calc(var(--nav-height) + var(--toolbar-height));
    bottom: var(--status-height);
    left: 0;
    right: 0;
}

/* === PALETTE SIDEBAR === */
.palette-sidebar {
    width: var(--palette-width);
    background: var(--white);
    border-right: 1px solid var(--light-grey);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

#plantPaletteContent,
#vegPalettePanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;       /* allow flex child to shrink below content size */
    overflow: hidden;     /* contain scrolling to .palette-list inside */
}

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem 0.5rem;
}

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

.palette-count {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--mid-grey);
}

.palette-search {
    padding: 0 0.75rem 0.5rem;
}

.palette-search input {
    width: 100%;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--charcoal);
    transition: border-color 0.2s;
}

.palette-search input:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
}

.palette-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 0.75rem 0.6rem;
}

.palette-filter {
    padding: 0.2rem 0.5rem;
    background: none;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: capitalize;
}

.palette-filter:hover { border-color: var(--sage); color: var(--sage-dark); }
.palette-filter.active {
    background: var(--sage-light);
    border-color: var(--sage);
    color: var(--sage-dark);
    font-weight: 700;
}

/* Advanced filter/sort panel */
.palette-adv {
    padding: 0 0.75rem 0.4rem;
}
.palette-adv-toggle {
    width: 100%;
    padding: 0.22rem 0.5rem;
    background: none;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.palette-adv-toggle:hover { border-color: var(--sage); color: var(--sage-dark); }
.palette-adv-toggle.active {
    background: var(--sage-light);
    border-color: var(--sage);
    color: var(--sage-dark);
    font-weight: 600;
}
.palette-adv-panel {
    margin-top: 0.35rem;
    padding: 0.4rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.palette-adv-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.palette-adv-row label {
    flex: 0 0 3rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--charcoal);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.palette-adv-row select {
    flex: 1;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.7rem;
    color: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.15s;
}
.palette-adv-row select:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
}
.palette-adv-clear {
    margin-top: 0.2rem;
    align-self: flex-end;
    font-size: 0.58rem;
}

.palette-list {
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid var(--cream-dark);
}

/* Plant palette items */
.palette-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--cream-dark);
    cursor: grab;
    transition: background 0.15s;
    user-select: none;
}

.palette-item:hover { background: var(--cream); }
.palette-item:active { cursor: grabbing; }

.palette-item-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--cream-dark);
    flex-shrink: 0;
}

.palette-item-symbol {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

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

.palette-item-name {
    font-size: 0.75rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette-item-common {
    font-size: 0.65rem;
    font-weight: 300;
    color: var(--mid-grey);
    line-height: 1.2;
}

.palette-item-spread {
    font-size: 0.58rem;
    font-weight: 400;
    color: var(--sage-text);
}

/* === CANVAS === */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    background: var(--cream-dark);
}

.canvas-container.tool-select { cursor: default; }
.canvas-container.tool-draw { cursor: crosshair; }
.canvas-container.tool-erase { cursor: pointer; }
.canvas-container.tool-text { cursor: text; }
.canvas-container.panning { cursor: grab; }
.canvas-container.dragging { cursor: grabbing; }

#gardenCanvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Prevent browser pan/zoom/pull-to-refresh from stealing touch gestures */
    touch-action: none;
    -ms-touch-action: none;
}

/* Drag ghost */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    border-radius: 50%;
    opacity: 0.7;
    border: 2px dashed var(--sage-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--white);
    transition: border-color 0.15s ease;
}

.companion-badge {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.92);
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 0.55rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    pointer-events: none;
}

/* === PROPERTIES SIDEBAR === */
.props-sidebar {
    width: var(--props-width);
    background: var(--white);
    border-left: 1px solid var(--light-grey);
    overflow-y: auto;
    flex-shrink: 0;
}

.props-section {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--cream-dark);
}

.props-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--sage-text);
    margin-bottom: 0.6rem;
}

.props-field {
    margin-bottom: 0.5rem;
}

.props-field label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mid-grey);
    margin-bottom: 0.2rem;
}

.props-field input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--charcoal);
    transition: border-color 0.2s;
}

.props-field input:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
}

.props-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Selected plant */
.selected-plant-name {
    font-size: 0.88rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    margin-bottom: 0.1rem;
}

.selected-plant-common {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 0.6rem;
}

.selected-plant-details {
    margin-bottom: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
}

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

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

/* Legend */
.legend {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--charcoal);
    text-transform: capitalize;
}

/* === STATUS BAR === */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--status-height);
    background: var(--white);
    border-top: 1px solid var(--light-grey);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1.5rem;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--mid-grey);
    z-index: 100;
}

/* === HELP BUTTON === */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--cream);
    border: 1px solid var(--light-grey);
    border-radius: 50%;
    cursor: pointer;
    color: var(--mid-grey);
    transition: all 0.15s;
    padding: 0;
}
.btn-icon:hover {
    background: var(--sage-light);
    border-color: var(--sage);
    color: var(--sage-dark);
}

/* === KEYBOARD SHORTCUTS MODAL === */
.shortcuts-content {
    max-width: 640px !important;
    padding: 1.5rem 2rem 2rem !important;
}
.shortcuts-content h2 {
    margin-bottom: 1.2rem;
}
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
}
.shortcut-category h3 {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sage-dark);
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--cream-dark);
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0;
    font-size: 0.75rem;
    color: var(--charcoal);
}
.shortcut-row span {
    margin-left: auto;
    color: var(--mid-grey);
    font-weight: 300;
}
kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--charcoal);
    background: var(--cream);
    border: 1px solid var(--light-grey);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--light-grey);
    line-height: 1;
    min-width: 1.4em;
    text-align: center;
}

@media (max-width: 500px) {
    .shortcuts-grid { grid-template-columns: 1fr; gap: 1rem; }
}

.shortcuts-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cream-dark);
}
.shortcuts-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.shortcuts-footer-actions .btn-outline { text-decoration: none; }
.shortcuts-footer-text {
    font-size: 0.78rem;
    color: var(--mid-grey);
    margin: 0;
}
.shortcuts-footer-text a { color: var(--sage-dark); text-decoration: underline; }

/* ===== Onboarding tour (designer) ===== */
.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 var(--sage, #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, #fff);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    pointer-events: auto;
}
.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, #2a2a2a);
}
.fleur-tour-body {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--charcoal, #2a2a2a);
    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, #888);
    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; }
}
@media print {
    .fleur-tour { display: none !important; }
}

/* === WELCOME MODAL === */
.welcome-content {
    max-width: 520px !important;
    text-align: center;
    padding: 2.5rem 2rem 2rem !important;
}
.welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.3rem;
}
.welcome-sub {
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 1.5rem;
}
.welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: left;
    margin-bottom: 1.8rem;
}
.welcome-feat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.8rem;
    background: var(--cream);
    border-radius: 6px;
    border: 1px solid var(--cream-dark);
}
.welcome-feat svg {
    color: var(--sage-text);
    margin-bottom: 0.2rem;
}
.welcome-feat strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--charcoal);
}
.welcome-feat span {
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--mid-grey);
}
.welcome-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}
.welcome-btn {
    font-size: 0.78rem;
    padding: 0.55rem 1.2rem;
}
@media (max-width: 500px) {
    .welcome-features { grid-template-columns: 1fr; }
    .welcome-actions { flex-direction: column; }
}

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

@media print { .ad-placeholder { display: none; } }

.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: 80px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}
.ad-placeholder .sponsor-headline {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #333);
    line-height: 1.25;
}
.ad-placeholder .sponsor-subline {
    font-size: 0.72rem;
    color: var(--text-secondary, #666);
    line-height: 1.3;
}
.ad-placeholder .sponsor-link .ad-label {
    align-self: flex-start;
    color: var(--sage, #95a67d);
}

.status-copyright {
    margin-left: auto;
    font-size: 0.55rem;
    font-weight: 300;
    color: var(--mid-grey);
    letter-spacing: 0.03em;
    opacity: 0.7;
}

/* === MODAL === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 4px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 30px;
    height: 30px;
    background: var(--cream);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content h2 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

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

/* Design list */
.design-list-controls {
    display: flex;
    gap: 0.5rem;
    margin: 0.25rem 0 0.75rem;
}
.design-search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid var(--cream-dark);
    border-radius: 4px;
    background: var(--cream);
    color: var(--charcoal);
}
.design-search-input:focus {
    outline: none;
    border-color: var(--sage);
    background: #fff;
}
.design-sort-select {
    flex: 0 0 auto;
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
    font-family: inherit;
    border: 1px solid var(--cream-dark);
    border-radius: 4px;
    background: var(--cream);
    color: var(--charcoal);
    cursor: pointer;
}
.design-sort-select:focus { outline: none; border-color: var(--sage); }

.design-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.design-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.design-list-item:hover { border-color: var(--sage); }

.design-list-name {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--charcoal);
}

.design-list-meta {
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--mid-grey);
}

.design-list-delete {
    background: none;
    border: none;
    color: var(--light-grey);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
}

.design-list-delete:hover { color: #c44; }

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

/* === SELECT / TEXTAREA in props === */
.props-field select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    background: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--charcoal);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B6B6B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.props-field select:focus {
    outline: none;
    border-color: var(--sage);
    background-color: var(--white);
}

/* Wall heights grid */
.wall-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    align-items: center;
}
.wall-grid .props-field label {
    font-size: 0.58rem;
}
.wall-compass {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sage-text);
}

/* Props note */
.props-note {
    font-size: 0.62rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

/* Match garden button */
.palette-match {
    padding: 0 0.75rem 0.5rem;
}
.btn-match {
    width: 100%;
    padding: 0.3rem 0.5rem;
    background: none;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--mid-grey);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.btn-match:hover { border-color: var(--sage); color: var(--sage-dark); }
.btn-match.active {
    background: var(--sage-light);
    border-color: var(--sage);
    color: var(--sage-dark);
    font-weight: 700;
}

/* === PLANT HOVER TOOLTIP === */
.plant-tooltip {
    position: fixed;
    z-index: 500;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    padding: 0.65rem 0.8rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.13);
    pointer-events: none;
    min-width: 175px;
    max-width: 230px;
}
.tt-name {
    font-size: 0.82rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    line-height: 1.3;
    margin-bottom: 0.1rem;
}
.tt-common {
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 0.45rem;
}
.tt-badge-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.tt-badge {
    padding: 0.1rem 0.42rem;
    border-radius: 2px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: capitalize;
    color: #fff;
    letter-spacing: 0.04em;
}
.tt-hardiness {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sage-dark);
    background: var(--sage-light);
    padding: 0.1rem 0.38rem;
    border-radius: 2px;
}
.tt-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.16rem 0.55rem;
    align-items: baseline;
}
.tt-label {
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid-grey);
    white-space: nowrap;
}
.tt-val {
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--charcoal);
    text-transform: capitalize;
}

/* === SEASON BUTTONS === */
.season-btn {
    padding: 0.2rem 0.42rem;
    background: none;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--mid-grey);
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.15s;
    white-space: nowrap;
}
.season-btn:hover { border-color: var(--sage); color: var(--sage-dark); }
.season-btn[data-season="spring"].active  { background: #d4edbc; border-color: #6a9f3a; color: #3a6a18; }
.season-btn[data-season="summer"].active  { background: #fceea0; border-color: #b09020; color: #705a00; }
.season-btn[data-season="autumn"].active  { background: #f5c890; border-color: #b06020; color: #602800; }
.season-btn[data-season="winter"].active  { background: #cce0f5; border-color: #4080b0; color: #204060; }

/* Tool cursor for bed tool */
.canvas-container.tool-bed     { cursor: crosshair; }
.canvas-container.tool-surface { cursor: crosshair; }
.canvas-container.tool-sketch  { cursor: crosshair; }
.canvas-container.tool-measure { cursor: crosshair; }

/* === SKETCH OPTIONS BAR === */
.sketch-options {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
}
.sketch-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid-grey);
    white-space: nowrap;
}
.sketch-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s, border-color 0.12s;
    flex-shrink: 0;
}
.sketch-color:hover  { transform: scale(1.2); }
.sketch-color.active { border-color: var(--charcoal); transform: scale(1.15); }

.sketch-weight {
    width: 26px;
    height: 26px;
    background: none;
    border: 1px solid var(--light-grey);
    border-radius: 2px;
    color: var(--mid-grey);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
.sketch-weight:hover  { border-color: var(--sage); color: var(--sage-dark); }
.sketch-weight.active { background: var(--sage-light); border-color: var(--sage); color: var(--sage-dark); }

/* === BOQ (PLANT LIST) === */
.boq-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}
.boq-empty {
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--mid-grey);
    padding: 0.3rem 0;
}
.boq-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0;
    border-bottom: 1px solid var(--cream-dark);
}
.boq-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.boq-info {
    flex: 1;
    min-width: 0;
}
.boq-name {
    font-size: 0.68rem;
    font-weight: 400;
    font-style: italic;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.boq-common {
    font-size: 0.58rem;
    font-weight: 300;
    color: var(--mid-grey);
    line-height: 1.2;
}
.boq-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--sage-dark);
    flex-shrink: 0;
}
.boq-export-btn {
    width: 100%;
    margin-top: 0.4rem;
}

/* === SURFACE TOOL DROPDOWN === */
.tool-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
.tool-drop-arrow {
    font-size: 0.45rem;
    margin-left: -1px;
    opacity: 0.5;
    line-height: 1;
}
.tool-dropdown-menu {
    display: none;
    position: fixed;      /* escapes .toolbar overflow clip — coords set in JS */
    top: 0;
    left: 0;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 200;
    min-width: 130px;
    padding: 0.25rem 0;
}
.tool-dropdown-menu.open { display: block; }
/* Hover-open is handled in JS (mouseenter) so it can recompute the fixed
   position from the trigger button's bounding rect. */
/* Header-context dropdown (Export ▾) — slightly larger arrow to match btn-outline text size */
.header-dropdown .tool-drop-arrow {
    font-size: 0.55rem;
    margin-left: 0.2rem;
    opacity: 0.65;
}
.tool-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.38rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Lato', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--charcoal);
    cursor: pointer;
    transition: background 0.12s;
}
.tool-dropdown-item:hover {
    background: var(--cream);
    color: var(--sage-dark);
}
.tool-dropdown-item.active {
    color: var(--sage-dark);
    background: var(--sage-light);
}
.tool-dropdown-heading {
    padding: 0.3rem 0.75rem 0.15rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage-dark);
    opacity: 0.7;
}
.tool-dropdown-sep {
    height: 1px;
    margin: 0.25rem 0.5rem;
    background: var(--light-grey);
}

/* === TEMPLATES MODAL === */
.modal-sub {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--mid-grey);
    margin-bottom: 1.2rem;
    margin-top: -0.5rem;
}
.modal-templates {
    max-width: 640px;
}
.templates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.template-card {
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 4px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
}
.template-card:hover {
    border-color: var(--sage);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.template-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    display: block;
}
.template-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
}
.template-card-meta {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--sage-dark);
    margin-bottom: 0.35rem;
}
.template-card-desc {
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--mid-grey);
    line-height: 1.45;
}

/* === COMPANION INDICATOR (canvas overlay style via CSS not needed; pure canvas) === */

/* === PHOTO BG OPACITY CONTROL === */
#bgOpacityWrap {
    display: none;
    align-items: center;
    gap: 0.3rem;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
}
#bgOpacityWrap.visible { display: flex; }
#bgOpacityWrap label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--mid-grey);
    white-space: nowrap;
}
#bgOpacity {
    width: 60px;
    cursor: pointer;
}
#clearBgBtn {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .props-sidebar { display: none; }
    .palette-sidebar { width: 200px; }
}

/* === TOOLBAR TOOLTIP ===
   Colors are hardcoded (not theme vars) because `--charcoal` and `--white`
   swap in dark mode — using them here caused white text on cream background. */
.tool-tooltip {
    position: fixed;
    z-index: 9999;
    background: #1f1f21;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 0.5rem 0.7rem;
    max-width: 220px;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    animation: tipFadeIn 0.12s ease;
}
@keyframes tipFadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tool-tip-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}
.tool-tip-desc {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255,255,255,0.82);
    line-height: 1.45;
    margin-bottom: 0.15rem;
}
.tool-tip-desc:empty { display: none; }
.tool-tip-key {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: #1f1f21;
    background: #f5f5f5;
    border-radius: 2px;
    padding: 0.08rem 0.35rem;
    margin-top: 0.15rem;
    letter-spacing: 0.05em;
}
.tool-tip-key:empty { display: none; }

@media (max-width: 600px) {
    .palette-sidebar { display: none; }
    .toolbar { display: none; }
    .header-nav { display: none; }
}

/* === MOBILE-ONLY SURFACES (visible only on narrow screens) ===
   These are hidden by default so they don't leak into desktop layouts.
   Each is re-enabled inside @media (max-width: 600px) below. */
.mobile-fab-bar { display: none; }
.mobile-more-drawer { display: none; }
.mobile-tools-drawer { display: none; }
.fleur-sheet { display: none; }

@media (max-width: 600px) {
    .mobile-fab-bar {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 900;
        justify-content: space-around;
        align-items: center;
        gap: 0.15rem;
        padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
        background: var(--cream, #FAF7F2);
        border-top: 1px solid var(--cream-dark, #F0EBE1);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    }
    .mfab-btn {
        flex: 1 1 0;
        min-width: 38px;
        height: 44px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: transparent;
        border: none;
        border-radius: 6px;
        color: var(--charcoal, #2d2d2d);
        cursor: pointer;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .mfab-btn:active { background: var(--cream-dark, #F0EBE1); transform: scale(0.96); }
    .mfab-btn.active {
        background: var(--sage, #7A9E7E);
        color: #fff;
    }
    /* Persistent on-screen label under each FAB icon (S28). Uses semantic
       muted-text token so dark mode flips automatically. */
    .mfab-label {
        font-size: 0.62rem;
        line-height: 1;
        color: var(--colour-text-muted);
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mfab-btn.active .mfab-label { color: #fff; }
    /* Leave space for the fab bar so it doesn't cover canvas UI */
    .canvas-container { padding-bottom: var(--fab-height, 52px); }
    .status-bar { bottom: var(--fab-height, 52px); }

    .mobile-more-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0; right: 0; bottom: var(--fab-height, 52px);
        z-index: 899;
        background: #fff;
        border-top: 1px solid var(--cream-dark, #F0EBE1);
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
        padding: 0.4rem;
        gap: 0.2rem;
        transform: translateY(110%);
        transition: transform 0.18s ease-out;
        pointer-events: none;
    }
    .mobile-more-drawer.open {
        transform: translateY(0);
        pointer-events: auto;
    }
    .mmd-item {
        padding: 0.75rem 0.9rem;
        min-height: 44px;
        text-align: left;
        background: transparent;
        border: none;
        border-radius: 4px;
        font-size: 0.88rem;
        color: var(--charcoal, #2d2d2d);
        cursor: pointer;
    }
    .mmd-item:active { background: var(--cream-dark, #F0EBE1); }

    /* Enlarge FAB buttons to meet 44×44 touch target */
    .mfab-btn {
        height: 44px;
        min-width: 40px;
    }

    /* View / Layers / Season chip rows inside the More drawer */
    .mmd-section-title {
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--mid-grey, #888);
        padding: 0.5rem 0.9rem 0.2rem;
    }
    .mmd-chip-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.1rem 0.6rem 0.5rem;
    }
    .mmd-chip {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0.5rem 0.9rem;
        background: var(--cream, #FAF7F2);
        border: 1px solid var(--cream-dark, #F0EBE1);
        border-radius: 999px;
        font-size: 0.82rem;
        color: var(--charcoal, #2d2d2d);
        cursor: pointer;
    }
    .mmd-chip.active {
        background: var(--sage, #7A9E7E);
        border-color: var(--sage, #7A9E7E);
        color: #fff;
    }

    /* Mobile Tools drawer — same pattern as More drawer but a 2-col grid */
    .mobile-tools-drawer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
        position: fixed;
        left: 0; right: 0; bottom: var(--fab-height, 52px);
        z-index: 899;
        background: #fff;
        border-top: 1px solid var(--cream-dark, #F0EBE1);
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
        padding: 0.5rem;
        transform: translateY(110%);
        transition: transform 0.18s ease-out;
        pointer-events: none;
    }
    .mobile-tools-drawer.open {
        transform: translateY(0);
        pointer-events: auto;
    }
    .mtd-item {
        min-height: 44px;
        padding: 0.75rem 0.9rem;
        background: var(--cream, #FAF7F2);
        border: 1px solid var(--cream-dark, #F0EBE1);
        border-radius: 6px;
        font-size: 0.9rem;
        color: var(--charcoal, #2d2d2d);
        cursor: pointer;
    }
    .mtd-item:active { background: var(--cream-dark, #F0EBE1); }
    .mtd-item.active {
        background: var(--sage, #7A9E7E);
        border-color: var(--sage, #7A9E7E);
        color: #fff;
    }

    /* Mobile bottom sheets (plants / hedge / extras / veg — S28 generalisation
       of the original plants-sheet pattern from S8). 3-state hidden/peek/full;
       sized via --fab-height so all four sit just above the FAB row. */
    .fleur-sheet {
        position: fixed;
        left: 0; right: 0; bottom: var(--fab-height, 52px);
        z-index: 898;
        background: #fff;
        display: flex;
        flex-direction: column;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
        transition: transform 0.22s ease-out, height 0.22s ease-out;
        height: var(--sheet-peek-height, 42vh);
    }
    .fleur-sheet--hidden {
        transform: translateY(110%);
        pointer-events: none;
    }
    .fleur-sheet--peek {
        transform: translateY(0);
        height: var(--sheet-peek-height, 42vh);
    }
    .fleur-sheet--full {
        transform: translateY(0);
        height: calc(100vh - var(--fab-height, 52px) - env(safe-area-inset-top, 0px));
    }
    .fleur-sheet__handle {
        width: 64px;
        min-height: 44px;
        padding: 0;
        margin: 2px auto 0;
        background: none;
        border: none;
        position: relative;
        cursor: grab;
    }
    .fleur-sheet__handle::before {
        content: '';
        position: absolute;
        top: 12px; left: 50%;
        width: 40px; height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: var(--light-grey, #D9D5CC);
    }
    .fleur-sheet__header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding: 0.2rem 0.9rem 0.4rem;
    }
    .fleur-sheet__title {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--charcoal, #2d2d2d);
    }
    .fleur-sheet__count {
        font-size: 0.75rem;
        color: var(--mid-grey, #888);
    }
    .fleur-sheet__search {
        padding: 0 0.7rem 0.4rem;
    }
    .fleur-sheet__search input {
        width: 100%;
        padding: 0.7rem 0.8rem;
        min-height: 44px;
        border: 1px solid var(--cream-dark, #F0EBE1);
        border-radius: 6px;
        background: var(--cream, #FAF7F2);
        font-size: 0.95rem;
        color: var(--charcoal, #2d2d2d);
    }
    .fleur-sheet__filters {
        display: flex;
        gap: 0.3rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.7rem 0.5rem;
        scrollbar-width: none;
    }
    .fleur-sheet__filters::-webkit-scrollbar { display: none; }
    .fleur-sheet__filters .palette-filter {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0.55rem 0.95rem;
        border: 1px solid var(--cream-dark, #F0EBE1);
        background: var(--cream, #FAF7F2);
        color: var(--charcoal, #2d2d2d);
        border-radius: 999px;
        font-size: 0.82rem;
        cursor: pointer;
    }
    .fleur-sheet__filters .palette-filter.active {
        background: var(--sage, #7A9E7E);
        border-color: var(--sage, #7A9E7E);
        color: #fff;
    }
    .fleur-sheet__list {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.2rem 0.6rem 0.8rem;
    }
    /* Make each plant row a proper 52px touch target inside the sheet */
    .fleur-sheet__list .palette-item {
        min-height: 52px;
    }
    .mfab-btn.active {
        background: var(--sage, #7A9E7E);
        color: #fff;
    }
}

/* Dark-mode variants for the new mobile surfaces */
[data-theme="dark"] .mobile-tools-drawer { background: #1f1f1f; border-top-color: #333; }
[data-theme="dark"] .mtd-item {
    background: #2a2a2a;
    border-color: #333;
    color: #eee;
}
[data-theme="dark"] .mtd-item:active { background: #333; }
[data-theme="dark"] .mmd-chip {
    background: #2a2a2a;
    border-color: #333;
    color: #eee;
}
[data-theme="dark"] .mmd-chip.active {
    background: var(--sage, #7A9E7E);
    border-color: var(--sage, #7A9E7E);
    color: #fff;
}
[data-theme="dark"] .fleur-sheet {
    background: #1f1f1f;
}
[data-theme="dark"] .fleur-sheet__title { color: #eee; }
[data-theme="dark"] .fleur-sheet__search input {
    background: #2a2a2a;
    border-color: #333;
    color: #eee;
}
[data-theme="dark"] .fleur-sheet__filters .palette-filter {
    background: #2a2a2a;
    border-color: #333;
    color: #eee;
}
[data-theme="dark"] .fleur-sheet__filters .palette-filter.active {
    background: var(--sage, #7A9E7E);
    border-color: var(--sage, #7A9E7E);
    color: #fff;
}
[data-theme="dark"] .fleur-sheet__handle::before { background: #555; }
[data-theme="dark"] .mobile-fab-bar {
    background: #1f1f1f;
    border-top-color: #333;
}
[data-theme="dark"] .mfab-btn { color: #eee; }
[data-theme="dark"] .mfab-btn:active { background: #2a2a2a; }
[data-theme="dark"] .mobile-more-drawer { background: #1f1f1f; border-top-color: #333; }
[data-theme="dark"] .mmd-item { color: #eee; }
[data-theme="dark"] .mmd-item:active { background: #2a2a2a; }

/* Smallest viewports (iPhone SE 1st gen ≤ 360px): hide secondary FAB labels
   so the 10-button row still fits. Top-level @media for older Safari support. */
@media (max-width: 360px) {
    #mfabUndo .mfab-label,
    #mfabRedo .mfab-label,
    #mfabZoomIn .mfab-label,
    #mfabZoomOut .mfab-label,
    #mfabFit .mfab-label { display: none; }
}

/* === CARE CALENDAR MODAL === */
.modal-care {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    padding: 1.5rem 2rem;
}

.care-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.care-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--charcoal);
    flex-shrink: 0;
}

.care-subtitle {
    margin: 0;
    font-size: 0.7rem;
    color: var(--mid-grey);
    flex: 1;
}

.care-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.care-actions .btn-sm {
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
}

.care-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.care-month-card {
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 4px;
    padding: 0.6rem 0.7rem;
    min-height: 100px;
}

.care-month-card.current-month {
    border-color: var(--sage);
    box-shadow: 0 0 0 1px var(--sage);
}

.care-month-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--cream-dark);
}

.care-season-tag {
    font-family: 'Lato', sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage-dark);
    margin-left: 0.4rem;
}

.care-category-group {
    margin-bottom: 0.35rem;
}

.care-category-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-dark);
    margin-bottom: 0.15rem;
}

.care-task {
    font-size: 0.65rem;
    color: var(--charcoal);
    line-height: 1.35;
    margin-bottom: 0.2rem;
    padding-left: 0.4rem;
    border-left: 2px solid var(--cream-dark);
}

.care-task-text {
    display: block;
}

.care-task-plants {
    font-size: 0.58rem;
    color: var(--mid-grey);
    font-style: italic;
    margin-top: 0.1rem;
    display: block;
}

.care-empty {
    font-size: 0.65rem;
    color: var(--mid-grey);
    font-style: italic;
    padding: 0.5rem 0;
}

@media (max-width: 800px) {
    .care-calendar-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 550px) {
    .care-calendar-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    /* Hide everything except the modal being printed */
    body > *:not(.modal) { display: none !important; }
    .modal:not(.care-printing):not(.shop-printing) { display: none !important; }
    .care-printing, .shop-printing { display: flex !important; position: static !important; z-index: auto !important; }
    .modal-overlay { display: none !important; }
    .care-printing .modal-content, .shop-printing .modal-content { max-width: 100% !important; width: 100% !important; max-height: none !important; box-shadow: none !important; padding: 1rem !important; overflow: visible !important; }
    .modal-close, .care-actions, .shop-actions { display: none !important; }
    /* Care-specific print */
    .care-calendar-grid { grid-template-columns: repeat(4, 1fr) !important; }
    .care-month-card { break-inside: avoid; page-break-inside: avoid; }
    /* Shop-specific print */
    .shop-link { border: 1px solid #ccc !important; color: #333 !important; }
    .shop-table { page-break-inside: auto; }
    .shop-table tr { page-break-inside: avoid; }
}

/* === PRINT: GARDEN DESIGN PLAN === */
/* Activate by adding .printing-design to <body> before window.print() */
@media print {
    body.printing-design > *:not(.canvas-container):not(#printTitleBlock) { display: none !important; }
    body.printing-design .canvas-container {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }
    body.printing-design #designCanvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    /* Fallback title if the DOM title block is hidden */
    body.printing-design:not(:has(#printTitleBlock))::before {
        content: attr(data-design-title);
        display: block;
        font-family: 'Playfair Display', serif;
        font-size: 18pt;
        text-align: center;
        margin: 0 0 0.5rem 0;
    }
    body.printing-design:not(:has(#printTitleBlock))::after {
        content: attr(data-design-meta);
        display: block;
        font-size: 9pt;
        text-align: center;
        margin: 0.5rem 0 0 0;
        color: #555;
    }

    /* --- E1 Title block overlay --- */
    body.printing-design #printTitleBlock {
        display: block !important;
        width: 100%;
        border: 1px solid #333;
        margin: 0 0 8pt 0;
        padding: 0;
        font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
        color: #111;
        background: #fff;
        page-break-inside: avoid;
    }
    body.printing-design #printTitleBlock .print-tb-row { display: flex; }
    body.printing-design #printTitleBlock .print-tb-main {
        align-items: baseline;
        justify-content: space-between;
        padding: 6pt 10pt;
        border-bottom: 1px solid #333;
    }
    body.printing-design #printTitleBlock .print-tb-title {
        font-family: 'Playfair Display', serif;
        font-size: 16pt;
        font-weight: 600;
        letter-spacing: 0.02em;
    }
    body.printing-design #printTitleBlock .print-tb-brand {
        font-size: 10pt;
        letter-spacing: 0.4em;
        color: #5A7D5E;
        font-weight: 700;
    }
    body.printing-design #printTitleBlock .print-tb-meta {
        flex-wrap: wrap;
        padding: 4pt 10pt;
        font-size: 8pt;
    }
    body.printing-design #printTitleBlock .print-tb-meta > div {
        flex: 0 0 auto;
        margin-right: 18pt;
        line-height: 1.3;
    }
    body.printing-design #printTitleBlock .print-tb-label {
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #777;
        font-size: 6.5pt;
    }
    body.printing-design #printTitleBlock .print-tb-val {
        display: block;
        font-weight: 600;
        color: #111;
    }

    /* Hide floating UI elements */
    #plantTooltip, .status-bar, .top-bar, .toolbar,
    .palette-sidebar, .props-sidebar, .toast-container,
    .modal, .modal-overlay, .context-menu,
    .onboarding-overlay, .scroll-top-btn { display: none !important; }
    @page { size: A4 landscape; margin: 12mm; }
}

/* Keep the overlay node hidden on screen (only the print stylesheet reveals it) */
#printTitleBlock { display: none; }

/* === E1 Print Preview Modal (screen) === */
.print-modal-content {
    max-width: 560px;
    width: 92%;
}
.print-modal-intro {
    font-size: 0.82rem;
    color: var(--mid-grey);
    margin: 0 0 1rem 0;
}
.print-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.print-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.75rem;
}
.print-field > span {
    font-weight: 600;
    color: var(--charcoal);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
}
.print-field input,
.print-field select {
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--charcoal);
}
.print-modal-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--cream-dark);
    margin-bottom: 0.5rem;
}
.print-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--charcoal);
}
.print-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--cream-dark);
}
@media (max-width: 600px) {
    .print-modal-grid { grid-template-columns: 1fr; }
}

/* === CROP ROTATION === */
.props-subheading {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-dark);
    margin: 0 0 0.3rem 0;
}

.rotation-warning {
    font-size: 0.65rem;
    color: #B8600A;
    line-height: 1.35;
    margin-bottom: 0.2rem;
    padding: 0.25rem 0.4rem;
    background: rgba(220,160,40,0.1);
    border-left: 2.5px solid #DCA028;
    border-radius: 2px;
}

.rotation-ok {
    font-size: 0.65rem;
    color: var(--sage-dark);
    margin-bottom: 0.2rem;
}

.rotation-empty {
    font-size: 0.65rem;
    color: var(--mid-grey);
    font-style: italic;
    margin-bottom: 0.2rem;
}

.rotation-current {
    font-size: 0.6rem;
    color: var(--charcoal);
    margin: 0.3rem 0 0.2rem;
}

.rotation-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.58rem;
    margin-top: 0.2rem;
}

.rotation-history-table th {
    text-align: left;
    font-weight: 700;
    color: var(--mid-grey);
    padding: 0.15rem 0.3rem;
    border-bottom: 1px solid var(--cream-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rotation-history-table td {
    padding: 0.15rem 0.3rem;
    border-bottom: 1px solid var(--cream-dark);
    color: var(--charcoal);
}

/* ==================== POSTCODE & CLIMATE INFO ==================== */

.postcode-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.postcode-row input {
    flex: 1;
    text-transform: uppercase;
}
.postcode-row .btn-sm {
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
}

.climate-info {
    background: var(--cream-dark);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    margin-top: 0.4rem;
}

.zone-badge {
    display: inline-block;
    background: var(--sage);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
}

.climate-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    padding: 0.12rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.climate-detail:last-of-type {
    border-bottom: none;
}
.climate-label {
    color: var(--mid-grey);
    font-weight: 400;
}
.climate-value {
    color: var(--charcoal);
    font-weight: 600;
}

.frost-bar {
    display: flex;
    gap: 1px;
    margin-top: 0.4rem;
}
.frost-month {
    flex: 1;
    text-align: center;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.15rem 0;
    border-radius: 2px;
    color: #fff;
}
.month-safe {
    background: var(--sage);
}
.month-edge {
    background: #D4A855;
}
.month-frost {
    background: #B0A8A0;
    color: rgba(255,255,255,0.7);
}

.frost-bar-label {
    text-align: center;
    font-size: 0.48rem;
    color: var(--mid-grey);
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.climate-not-found {
    font-size: 0.6rem;
    color: #B06040;
    padding: 0.3rem 0;
}

/* ==================== SURFACES / PATHWAYS ==================== */

#surfacePanel .props-field { margin-bottom: 0.5rem; }
#surfacePanel select { width: 100%; }

/* ==================== SHOPPING LIST ==================== */

.modal-shop {
    max-width: 960px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.shop-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.shop-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--charcoal);
}

.shop-subtitle {
    margin: 0;
    font-size: 0.7rem;
    color: var(--mid-grey);
    flex: 1;
}

.shop-affiliate-note {
    flex-basis: 100%;
    margin: 0.35rem 0 0;
    font-size: 0.68rem;
    font-style: italic;
    color: var(--mid-grey);
    line-height: 1.4;
}

@media print { .shop-affiliate-note { display: none; } }

.shop-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.shop-actions .btn-sm {
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
}

.shop-section {
    margin-bottom: 1.2rem;
}

.shop-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    border-bottom: 1.5px solid var(--cream-dark);
    padding-bottom: 0.3rem;
}

.shop-section-head h3 {
    font-family: 'Playfair Display', serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--charcoal);
    margin: 0;
}

.shop-section-meta {
    font-size: 0.6rem;
    color: var(--mid-grey);
}

.shop-table-wrap {
    overflow-x: auto;
}

.shop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.shop-table th {
    text-align: left;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mid-grey);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--cream-dark);
    white-space: nowrap;
}

.shop-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
    color: var(--charcoal);
}

.shop-table tbody tr:hover {
    background: rgba(139,171,127,0.06);
}

.shop-cell-name {
    min-width: 160px;
}

.shop-botanical {
    display: block;
    font-style: italic;
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--charcoal);
}

.shop-common {
    display: block;
    font-size: 0.58rem;
    color: var(--mid-grey);
    margin-top: 0.1rem;
}

.shop-cell-type {
    white-space: nowrap;
    font-size: 0.62rem;
    text-transform: capitalize;
}

.shop-type-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.shop-cell-qty {
    font-weight: 700;
    color: var(--sage-dark);
    text-align: center;
}

.shop-cell-pot {
    min-width: 80px;
}

.shop-pot-select {
    font-family: 'Lato', sans-serif;
    font-size: 0.62rem;
    padding: 0.2rem 0.3rem;
    border: 1px solid var(--cream-dark);
    border-radius: 3px;
    background: var(--white);
    color: var(--charcoal);
    cursor: pointer;
}

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

.shop-cell-price {
    text-align: right;
    white-space: nowrap;
}

.shop-cell-subtotal {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    color: var(--sage-dark);
}

.shop-cell-links {
    white-space: nowrap;
}

.shop-link {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sage-dark);
    text-decoration: none;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--sage);
    border-radius: 3px;
    margin-right: 0.2rem;
    transition: background 0.15s, color 0.15s;
}

.shop-link:hover {
    background: var(--sage);
    color: #fff;
}

.shop-note {
    font-size: 0.55rem;
    color: var(--mid-grey);
}

.shop-empty {
    text-align: center;
    color: var(--mid-grey);
    font-style: italic;
    font-size: 0.7rem;
    padding: 1rem 0;
}

/* Row include/exclude toggle */
.shop-cell-include,
.shop-th-include {
    width: 28px;
    padding: 0 0.25rem 0 0.1rem;
    text-align: center;
}
.shop-include-cb {
    width: 14px;
    height: 14px;
    accent-color: var(--sage);
    cursor: pointer;
    vertical-align: middle;
}
.shop-row-excluded td {
    opacity: 0.35;
    text-decoration: line-through;
    text-decoration-color: var(--mid-grey);
}
.shop-row-excluded .shop-include-cb {
    opacity: 1;
    text-decoration: none;
}

.shop-total-row td {
    font-weight: 700;
    font-size: 0.72rem;
    border-top: 1.5px solid var(--cream-dark);
    border-bottom: none;
    padding-top: 0.5rem;
}

.shop-total-val {
    font-size: 0.78rem;
    color: var(--sage-dark);
    text-align: right;
}

.shop-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream);
    border: 1.5px solid var(--sage);
    border-radius: 4px;
    padding: 0.7rem 1rem;
    margin-top: 0.5rem;
}

.shop-grand-total span:first-child {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
}

.shop-grand-val {
    font-family: 'Lato', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sage-dark);
}

.shop-disclaimer {
    font-size: 0.55rem;
    color: var(--mid-grey);
    margin-top: 0.6rem;
    line-height: 1.5;
    font-style: italic;
}

@media (max-width: 600px) {
    .shop-table { font-size: 0.6rem; }
    .shop-cell-name { min-width: 100px; }
    .shop-botanical { font-size: 0.62rem; }
    .shop-link { font-size: 0.48rem; padding: 0.1rem 0.2rem; }
}

/* ==================== VEG PALETTE ==================== */

.veg-palette-header {
    padding: 0.6rem 0.75rem 0.4rem;
    border-bottom: 1px solid var(--cream-dark);
}

.veg-palette-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--charcoal);
    margin: 0 0 0.2rem;
}

.veg-palette-hint {
    font-size: 0.65rem;
    color: var(--mid-grey);
    margin: 0;
    line-height: 1.4;
}

/* D2: Hedge palette mode toggle */
.hedge-palette-modes {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--charcoal);
}
.hedge-palette-modes label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.veg-palette-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.3rem 0;
}

.veg-palette-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.12s;
}

.veg-palette-item:hover {
    background: var(--cream);
}

.veg-palette-item.selected {
    background: var(--sage-light, #e8f0e8);
    border-left: 3px solid var(--sage);
}

.veg-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.veg-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--charcoal);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.veg-spacing {
    font-size: 0.62rem;
    color: var(--mid-grey);
    flex-shrink: 0;
}

.veg-palette-empty {
    font-size: 0.7rem;
    color: var(--mid-grey);
    padding: 1rem 0.75rem;
    font-style: italic;
}

/* === EMPTY STATES — load-modal design list, plant palette (S26) === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.4rem 0.8rem;
    gap: 0.4rem;
    color: var(--colour-text-muted);
}
.empty-state-icon {
    color: var(--colour-text-muted);
    opacity: 0.55;
    margin-bottom: 0.2rem;
}
.empty-state-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--colour-text);
    margin: 0;
}
.empty-state-sub {
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.4;
    max-width: 28ch;
}
.empty-state-cta {
    margin-top: 0.4rem;
    background: none;
    border: 1px solid var(--colour-border);
    color: var(--sage-text);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.empty-state-cta:hover,
.empty-state-cta:focus-visible {
    background: var(--sage-light);
    border-color: var(--sage-text);
    outline: none;
}
.empty-state-thin {
    color: var(--colour-text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
    margin: 0;
    text-align: center;
}
.empty-state--palette { padding: 2rem 1rem; }

/* === COMMENTS — viewer-mode panel + cards (S29) === */

/* Desktop right-side panel. Hidden by default until viewer toggle opens it. */
.comments-panel {
    position: fixed;
    top: 110px;
    right: 12px;
    width: 340px;
    max-height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
    background: var(--colour-bg);
    color: var(--colour-text);
    border: 1px solid var(--colour-border);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    z-index: 70;
    overflow: hidden;
}
.comments-panel[hidden] { display: none !important; }
.comments-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--colour-border);
    background: var(--colour-bg);
}
.comments-panel__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--colour-text);
}
.comments-panel__close {
    background: none;
    border: 0;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--colour-text-muted);
    padding: 0.1rem 0.4rem;
}
.comments-panel__close:hover { color: var(--colour-text); }

/* Comments list — shared between desktop panel and mobile sheet */
.comments-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.6rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.comment-card {
    display: flex;
    gap: 0.55rem;
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid var(--colour-border);
    align-items: flex-start;
}
.comment-card:last-child { border-bottom: 0; }
.comment-card__avatar {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sage-light);
    color: var(--sage-text);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.comment-card__body {
    flex: 1 1 auto;
    min-width: 0;
}
.comment-card__head {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.15rem;
}
.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--colour-text);
}
.comment-meta {
    font-size: 0.72rem;
    color: var(--colour-text-muted);
}
.comment-edited {
    font-size: 0.72rem;
    color: var(--colour-text-muted);
    font-style: italic;
}
.comment-body {
    font-size: 0.85rem;
    color: var(--colour-text);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.comment-delete {
    flex: 0 0 auto;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    color: var(--colour-text-muted);
    border-radius: 4px;
    line-height: 1;
}
.comment-delete:hover {
    color: #b04a20;
    background: rgba(176, 74, 32, 0.08);
}

/* Compose form */
.comment-form {
    border-top: 1px solid var(--colour-border);
    padding: 0.6rem 0.7rem;
    background: var(--colour-bg);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.comment-form[hidden] { display: none !important; }
.comment-form__input {
    width: 100%;
    border: 1px solid var(--colour-border);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font: inherit;
    font-size: 0.85rem;
    background: var(--colour-bg);
    color: var(--colour-text);
    resize: vertical;
}
.comment-form__input:focus {
    outline: 2px solid var(--sage-text);
    outline-offset: 1px;
    border-color: var(--sage-text);
}
.comment-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.comment-form__count {
    font-size: 0.72rem;
    color: var(--colour-text-muted);
}

.comments-anon-cta {
    border-top: 1px solid var(--colour-border);
    padding: 0.7rem;
    text-align: center;
    background: var(--colour-bg);
}
.comments-anon-cta[hidden] { display: none !important; }

.comments-empty[hidden] { display: none !important; }
.comments-empty.empty-state { padding: 1.6rem 0.8rem; }

/* Viewer toggle chip — comment count + label inline */
#viewerCommentsToggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile: swap desktop panel for the bottom sheet. */
@media (max-width: 600px) {
    .comments-panel {
        display: none !important;
    }
    .comments-list {
        padding: 0.4rem 0.5rem;
    }
    .comment-form--sheet {
        position: sticky;
        bottom: 0;
        background: var(--colour-bg);
    }
}

/* Veg tooltip: suppress capitalize so units stay lowercase */
.veg-tooltip .tt-val {
    text-transform: none;
}

/* === PALETTE IMAGE CREDIT (Step 11 — iNat attribution) === */
.palette-item-thumb-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.palette-item-credit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 0.55rem;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 2px;
    padding: 1px 3px;
    pointer-events: auto;
    cursor: help;
}
@media print {
    .palette-item-credit { display: none; }
}

/* === CLIMATE FIT BADGE (Session 5 — climate-adaptive suggestions) === */
.palette-item-climate {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    cursor: help;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}
.palette-item-climate.fit-ideal      { background: #2e7d32; color: #fff; }
.palette-item-climate.fit-hardy      { background: #1b5e20; color: #fff; }
.palette-item-climate.fit-borderline { background: #f9a825; color: #1a1a1a; }
.palette-item-climate.fit-tender     { background: #c62828; color: #fff; }
.palette-item-climate.fit-unknown    { background: #9e9e9e; color: #fff; }
@media print {
    .palette-item-climate { display: none; }
}

/* ==================== VIEWER MODE ==================== */
.viewer-info-bar {
    background: var(--sage-dark, #3a5a3a);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    z-index: 100;
}
.viewer-info-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}
.viewer-info-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.viewer-creator-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.viewer-garden-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 0.4rem;
}
.viewer-creator-name {
    opacity: 0.85;
    font-size: 0.8rem;
}
.viewer-creator-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-left: 0.3rem;
}
.viewer-info-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.viewer-stat {
    opacity: 0.75;
    font-size: 0.78rem;
}
.viewer-info-bar .btn-sm {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
}
.viewer-info-bar .btn-primary {
    background: #fff;
    color: var(--sage-dark, #3a5a3a);
}
.viewer-info-bar .btn-outline {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
.viewer-info-bar .btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* Hide editing UI in viewer mode */
body.viewer-mode .toolbar-strip,
body.viewer-mode .plant-palette,
body.viewer-mode .side-panel,
body.viewer-mode #saveBtn,
body.viewer-mode #shareDropdown,
body.viewer-mode #exportDropdown,
body.viewer-mode #careBtn,
body.viewer-mode #shopBtn,
body.viewer-mode #loadBtn,
body.viewer-mode #templatesBtn,
body.viewer-mode #bgUploadBtn,
body.viewer-mode #bgOpacityWrap,
body.viewer-mode #mobileFabBar,
body.viewer-mode #vegPalettePanel,
body.viewer-mode .toolbar-sep {
    display: none !important;
}
body.viewer-mode .main-area {
    top: 0; /* no toolbar offset */
}

/* Share popover */
.share-popover {
    position: fixed;
    background: var(--bg-colour, #fff);
    border: 1px solid var(--border-colour, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem;
    width: 320px;
    z-index: 1000;
    font-size: 0.82rem;
}
.share-popover h3 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}
.share-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-colour, #eee);
}
.share-toggle-label {
    font-weight: 600;
}
.share-toggle-desc {
    font-size: 0.72rem;
    opacity: 0.65;
}
.share-toggle-switch {
    position: relative;
    width: 40px; height: 22px;
    background: #ccc;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.share-toggle-switch.on {
    background: var(--sage, #7A9E7E);
}
.share-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.share-toggle-switch.on::after {
    transform: translateX(18px);
}
.share-url-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.share-url-input {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-colour, #ddd);
    border-radius: 4px;
    background: var(--card-bg, #f9f9f7);
    color: var(--text-colour, #333);
}
.share-url-row .btn-sm {
    white-space: nowrap;
}
@media (max-width: 600px) {
    .viewer-info-inner { flex-direction: column; align-items: flex-start; }
    .share-popover { width: calc(100vw - 2rem); left: 1rem !important; }
}

/* ──────────────────────────────────────────────────────────────
   M6 — Revision History modal + snapshot prompt
   ────────────────────────────────────────────────────────────── */

.modal-history {
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}
.modal-snapshot {
    max-width: 460px;
    padding: 1.5rem;
}
.history-header {
    margin-bottom: 1rem;
}
.history-header h2 {
    margin: 0 0 0.25rem 0;
}
.history-sub {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: 0.88rem;
}
.history-list {
    flex: 1 1 auto;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    padding-right: 0.25rem;
}
.history-empty {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
}
.history-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.15s;
}
.history-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.history-thumb {
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.history-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.history-thumb-placeholder {
    color: #9ca3af;
    font-size: 1.2rem;
}
.history-card-body {
    padding: 0.6rem 0.75rem 0.3rem;
    flex: 1 1 auto;
}
.history-card-title {
    font-weight: 600;
    color: var(--text, #1f1f21);
    font-size: 0.95rem;
    word-break: break-word;
}
.history-card-meta {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}
.history-card-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem 0.75rem;
}
.history-card-actions .btn-outline {
    flex: 1 1 0;
    text-align: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}
.history-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* === W6 — Selected-plant opacity slider + lock button === */
.plant-opacity-field {
    margin-top: 0.65rem;
}
.plant-opacity-label {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.plant-opacity-label span:last-child {
    font-weight: 600;
    color: var(--charcoal);
    font-variant-numeric: tabular-nums;
}
.plant-opacity-field input[type="range"] {
    width: 100%;
    accent-color: var(--sage-dark);
    cursor: pointer;
}
.plant-action-row {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.plant-action-row > button {
    flex: 1;
    text-align: center;
    justify-content: center;
}
#lockSelected.is-locked {
    background: var(--sage-dark);
    color: #fff;
    border-color: var(--sage-dark);
}
#lockTreesBtn.active {
    background: var(--sage-dark);
    color: #fff;
    border-color: var(--sage-dark);
}

/* W2: Hedge palette — dimension controls */
.hedge-dim-controls {
    margin: 0.6rem 0.4rem 0.2rem;
    padding: 0.55rem 0.6rem 0.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 0.78rem;
}
.hedge-dim-row {
    margin-bottom: 0.55rem;
}
.hedge-dim-row:last-child {
    margin-bottom: 0;
}
.hedge-dim-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.74rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.18rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hedge-dim-val {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-primary, #222);
    text-transform: none;
    letter-spacing: 0;
}
.hedge-dim-controls input[type="range"] {
    width: 100%;
    accent-color: var(--sage-dark, #5d7a3a);
}
.hedge-rows-seg {
    display: flex;
    gap: 2px;
    background: var(--bg-secondary, #eee);
    border-radius: 6px;
    padding: 2px;
}
.hedge-rows-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.32rem 0.2rem;
    font-size: 0.74rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary, #666);
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.hedge-rows-btn:hover {
    background: rgba(255, 255, 255, 0.7);
}
.hedge-rows-btn.active {
    background: var(--sage-dark, #5d7a3a);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.hedge-dim-summary {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-color, #d0d0d0);
    font-size: 0.78rem;
    color: var(--text-primary, #222);
    text-align: center;
}
.hedge-dim-summary strong {
    color: var(--sage-dark, #5d7a3a);
}

/* W5 — region banner inside shop modal */
.shop-region-banner {
    background: rgba(125, 158, 89, 0.10);
    border: 1px solid rgba(125, 158, 89, 0.35);
    color: #4a5a35;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    margin: 0.4rem 0 0.6rem;
}
[data-theme="dark"] .shop-region-banner {
    background: rgba(125, 158, 89, 0.16);
    color: #d4e0c5;
    border-color: rgba(125, 158, 89, 0.5);
}

/* W8 — Garden extras palette */
.extras-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.4rem;
    border-bottom: 1px solid var(--border, #e0d8c8);
    flex-wrap: wrap;
}
.extras-tab {
    background: var(--surface, #f5efe2);
    border: 1px solid var(--border, #e0d8c8);
    border-radius: 4px;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text, #2c2c2c);
}
.extras-tab.active {
    background: var(--sage, #7d9e59);
    color: #fff;
    border-color: var(--sage-dark, #5d7a3a);
}
.extras-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
}
.extras-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    background: var(--surface, #fbf7ee);
    border: 1px solid var(--border, #e0d8c8);
    border-radius: 6px;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
    text-align: left;
    color: var(--text, #2c2c2c);
}
.extras-item:hover { background: var(--surface-hover, #efe8d6); }
.extras-item.selected {
    background: rgba(125, 158, 89, 0.18);
    border-color: var(--sage-dark, #5d7a3a);
    box-shadow: 0 0 0 1px var(--sage-dark, #5d7a3a) inset;
}
.extras-glyph { font-size: 1.4rem; line-height: 1; }
.extras-name { font-size: 0.78rem; font-weight: 600; }
.extras-price { font-size: 0.7rem; color: var(--text-muted, #6a6a6a); }
.shop-cat-row td { background: rgba(125, 158, 89, 0.08); padding-top: 0.4rem !important; }

/* ==================== M10: User-added custom plants ==================== */

/* "+ Add" sits in the type-filter row, styled as an action chip.
   NOT a .palette-filter class — that selector is hooked to the filter-click
   handler (designer.js:6538) and the mobile-sheet clone (designer.js:9849),
   so this button must be self-contained to avoid hijacking filter logic. */
.palette-filter--add {
    padding: 0.2rem 0.5rem;
    background: none;
    border: 1px dashed var(--sage, #7A9E7E);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--sage-dark);
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto; /* push to end of wrap row */
}
.palette-filter--add:hover {
    background: var(--sage, #7A9E7E);
    color: #fff;
    border-style: solid;
}

/* Star badge on user-owned palette items */
.palette-item-user-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--sage, #7A9E7E);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}
.palette-item--user { background: rgba(125, 158, 89, 0.04); }
.palette-item--user:hover { background: rgba(125, 158, 89, 0.10); }

/* Right-click menu over a custom palette item */
.user-plant-menu {
    position: fixed;
    z-index: 9000;
    background: #fff;
    border: 1px solid var(--cream-dark, #d8d0bf);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 4px;
    min-width: 130px;
    font-size: 0.78rem;
}
.user-plant-menu button {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--charcoal, #333);
    border-radius: 4px;
}
.user-plant-menu button:hover { background: var(--cream, #f7f3ea); }
.user-plant-menu button[data-action="delete"]:hover { background: #fbeaea; color: #b13030; }

/* Add-plant modal layout (mirrors print-modal pattern at L2395+) */
.add-plant-modal-content {
    max-width: 520px;
    width: 92%;
    max-height: 85vh;
}
.add-plant-intro {
    font-size: 0.82rem;
    color: var(--text-muted, #6a6a6a);
    margin: 0 0 0.9rem;
}
.add-plant-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.add-plant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.add-plant-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
}
.add-plant-field--wide { grid-column: 1 / -1; }
.add-plant-field > span {
    font-weight: 600;
    color: var(--charcoal, #333);
}
.add-plant-field input[type="text"],
.add-plant-field select,
.add-plant-field textarea {
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--cream-dark, #d8d0bf);
    border-radius: 4px;
    background: var(--cream, #f7f3ea);
    color: var(--charcoal, #333);
}
.add-plant-field input[type="text"]:focus,
.add-plant-field select:focus,
.add-plant-field textarea:focus {
    outline: none;
    border-color: var(--sage, #7A9E7E);
    background: #fff;
}
.add-plant-field input[type="file"] {
    font-size: 0.78rem;
}
.add-plant-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--charcoal, #333);
    padding: 0.4rem 0;
}
.add-plant-toggle input { margin-top: 2px; }
.add-plant-error {
    color: #b13030;
    font-size: 0.78rem;
    min-height: 1em;
}
@media (max-width: 540px) {
    .add-plant-grid { grid-template-columns: 1fr; }
}
