/**
 * Plot Designer Inline Overrides
 * Extracted from plot_designer.html <style> block
 */

/* Timeline slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--color-canvas-grid-major), var(--color-canvas-grid-major));
    border-radius: 9999px;
    height: 6px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-success);
    border: 2px solid var(--color-content-inverse);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-success);
    border: 2px solid var(--color-content-inverse);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* Event dot styling */
.event-dot {
    transition: transform 0.1s ease;
    z-index: 5;
}

.event-dot:hover {
    transform: scale(1.5);
    z-index: 10;
}

/* Ghost placement styling */
.placement--ghost {
    opacity: 0.3;
}

/* Contextual toolbar styling */
.contextual-toolbar {
    min-width: 240px;
}
.contextual-toolbar .placement-label {
    pointer-events: none;
}

/* Mobile contextual toolbar: position at bottom, full width */
@media (max-width: 768px), (pointer: coarse) and (max-height: 499.98px) {
    #toolbar-host.contextual-toolbar {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100vw !important;
        min-width: unset !important;
        max-width: 100vw !important;
        padding: 0 !important;
    }
    /* Direct content divs (placement, backdrop, decor, floating-permanent, zone-label, callout, pot) */
    #toolbar-host.contextual-toolbar > div {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 1rem 1rem 0 0 !important;
    }
    /* Content cards get comfortable mobile padding + safe-area for notched devices */
    #toolbar-host.contextual-toolbar > div.bg-surface-tint,
    #toolbar-host.contextual-toolbar > div > div.bg-surface-tint,
    #toolbar-host.contextual-toolbar > div.pd-card,
    #toolbar-host.contextual-toolbar > div > div.pd-card {
        padding: 0.75rem !important;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    /* Grandchild content divs — bed toolbar uses a wrapper <div> around view/edit mode divs */
    #toolbar-host.contextual-toolbar > div > div {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Override potential conflicting styles from external CSS */
    #toolbar-host.contextual-toolbar .pd-card {
        position: static !important;
        margin: 0 !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        border-radius: 1rem 1rem 0 0 !important;
    }
}

/* Toolbar pages — swipeable tab container (mobile only) */
.toolbar-pages {
    overflow: hidden;
}

/* The plant sheet: clip the neighbour page at the sides only, so the ⋯ menu
   (absolute, opening above the sheet) is not cut off. Without overflow: clip
   support it falls back to hidden above. */
@supports (overflow: clip) {
    .toolbar-pages--clip-x {
        overflow: visible;
        overflow-x: clip;
    }
}

/* Each page exactly as wide as the sheet, so long text (a long bed name in
   the fills-the-bed message) is cut short instead of widening the page past
   the sheet's edge. */
@media (max-width: 768px), (pointer: coarse) and (max-height: 499.98px) {
    .toolbar-pages--clip-x .toolbar-pages__track > [data-toolbar-page] {
        width: 100%;
        max-width: 100%;
    }
}

/* Plant sheet message line: "Fills <bed>. Drag a corner to shrink." (closable)
   or the drag hint. One small muted text line either way. */
.pd-sheet-message {
    display: flex;
    align-items: center;
    /* The ✕'s tap area is no taller than this row (the ⋯ above and the
       steppers below keep their taps): at least WCAG's 24px */
    min-height: 1.5rem;
    gap: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--color-content-muted, #6b7280);
}

/* One line that never wraps: only the bed name gives way (ellipsis). */
.pd-sheet-message__text {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.pd-sheet-message__fixed {
    flex: 0 0 auto;
    white-space: pre;
}

/* No bed name to give way (the message since make room): wrap instead, so
   the desktop card's narrow line never cuts the last words. */
.pd-sheet-message--wraps {
    align-items: flex-start;
}

.pd-sheet-message--wraps .pd-sheet-message__text {
    display: block;
    white-space: normal;
}

.pd-sheet-message--wraps .pd-sheet-message__fixed {
    white-space: normal;
}

.pd-sheet-message__bed {
    flex: 0 1 auto;
    min-width: 2.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre;
    font-weight: 500;
    color: var(--color-content-secondary, #374151);
}

/* The ✕: a small glyph on a 44px tap area. The area is an invisible
   pseudo-element, so the line stays one text line tall. */
.pd-sheet-message__close {
    position: relative;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1rem;
    min-height: 0; /* not the 44px `main button` rule */
    min-width: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    line-height: 1;
    color: var(--color-content-faint, #9ca3af);
    background: none;
    border: none;
    cursor: pointer;
}

.pd-sheet-message__close::before {
    content: "";
    position: absolute;
    top: 50%;
    /* Not past the sheet's pages, which clip on a phone (390: 4px lost) */
    right: -0.5rem;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
}

.pd-sheet-message__close:hover {
    color: var(--color-content-muted, #6b7280);
}

/* The ⋯ above the line and the steppers below it keep their own taps where
   the ✕'s tap area reaches into them. */
#toolbar-host [data-ph-capture-attribute-toolbar="more"],
#toolbar-host [data-ph-capture-attribute-toolbar^="resize-"] {
    position: relative;
    z-index: 1;
}

/* "Fills bed · drag a corner to shrink" by a corner handle (components/fill_bed_label.js) */
.pd-fill-bed-label {
    position: fixed;
    z-index: 55; /* above the canvas and the phone tip (50), below the sheet (60) */
    pointer-events: none;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--color-surface-tint, #fcfbf8);
    color: var(--color-content-primary, #111827);
    border: 1px solid var(--color-surface-border, #e5e3db);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    animation: pd-fill-bed-label-in 0.2s ease-out;
}

@keyframes pd-fill-bed-label-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .pd-fill-bed-label {
        animation: none;
    }
}

.toolbar-pages__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0.25rem 0.25rem;
    justify-content: space-between;
}

.toolbar-pages__tabs {
    display: flex;
    gap: 2px;
    background: var(--color-surface-alt, #f3f4f6);
    border-radius: 6px;
    padding: 2px;
    flex: 1;
    min-width: 0;
}

.toolbar-pages__tabs button {
    flex: 1;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    color: var(--color-content-muted, #6b7280);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}

.toolbar-pages__tabs button.active {
    background: var(--color-surface-tint, #ffffff);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: var(--color-content-primary, #111827);
    font-weight: 500;
}

.toolbar-pages__close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--color-surface-border, #e5e7eb);
    font-size: 0.75rem;
    color: var(--color-content-muted, #6b7280);
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.toolbar-pages__close:hover {
    background: var(--color-surface-alt, #f3f4f6);
}

.toolbar-pages__track {
    display: flex;
    transition: transform 0.2s ease;
    will-change: transform;
}

.toolbar-pages__track[data-swiping] {
    transition: none;
}

.toolbar-pages__track > [data-toolbar-page] {
    min-width: 100%;
    flex-shrink: 0;
    padding: 0 0.5rem 0.5rem;
}

/* Desktop: pages system invisible — show all content inline */
@media (min-width: 769px) and (min-height: 500px), (min-width: 769px) and (pointer: fine), (min-width: 769px) and (pointer: none) {
    .toolbar-pages {
        overflow: visible;
    }
    .toolbar-pages__header {
        display: none;
    }
    .toolbar-pages__track {
        display: block;
        transform: none !important;
        height: auto !important;
    }
    .toolbar-pages__track > [data-toolbar-page] {
        min-width: unset;
        padding: 0;
    }
}

/* Single-page toolbar: no tabs needed */
.toolbar-pages--single .toolbar-pages__header {
    display: none;
}

.toolbar-pages--single .toolbar-pages__track {
    transform: none !important;
    height: auto !important;
}

/* ─── Path Placement Toolbar ─── */
.toolbar-section {
    padding: 4px 0;
}
.toolbar-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-content-muted, #6B7280);
    margin-bottom: 4px;
}
.toolbar-row {
    padding: 2px 0;
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.toolbar-btn--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-content-inverse);
}
.toolbar-btn--primary:hover {
    background: var(--color-primary-hover);
}
.toolbar-btn--secondary {
    background: transparent;
    border-color: var(--color-surface-border, #E5E7EB);
    color: var(--color-content-secondary, #374151);
}
.toolbar-btn--secondary:hover {
    background: var(--color-surface-alt, #F9FAFB);
}
.toolbar-btn--danger {
    background: transparent;
    border-color: #FCA5A5;
    color: var(--color-danger);
}
.toolbar-btn--danger:hover {
    background: #FEF2F2;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) .toolbar-btn--danger:hover {
    background: #450a0a;
  }
}
.dark .toolbar-btn--danger:hover {
  background: #450a0a;
}

.path-entry-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}
.path-entry-row {
    border-left: 3px solid var(--entry-color, #6B7280);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    transition: background 0.15s;
    min-width: 0;
}
.path-entry-row:hover {
    background: rgba(0, 0, 0, 0.04);
}
.path-entry-row__main {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    cursor: pointer;
    min-height: 32px;
}
.path-entry-row__img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.path-entry-row__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--entry-color, #6B7280);
    flex-shrink: 0;
}
.path-entry-row__name {
    font-size: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.path-entry-row__count {
    font-size: 11px;
    color: var(--color-content-muted, #6B7280);
    flex-shrink: 0;
    padding: 1px 5px;
    margin-left: 4px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.06);
}
.path-entry-row__arrows {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}
.path-entry-row__arrow {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 6px 8px;
    color: var(--color-content-muted, #6B7280);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.path-entry-row__arrow-h {
    display: none;
}
.path-entry-row__arrow-v {
    display: inline;
}
.path-entry-row__arrow:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
    color: var(--color-content-primary, #111);
}
.path-entry-row__arrow:disabled {
    opacity: 0.2;
    cursor: default;
}
.path-entry-row__remove {
    font-size: 11px;
    line-height: 1;
    padding: 2px 4px;
    color: var(--color-content-muted, #9CA3AF);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.path-entry-row__remove:hover {
    color: var(--color-canvas-error);
    background: rgba(239, 68, 68, 0.08);
}
.path-entry-row__detail {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    min-width: 0;
}
.path-entry-row__detail input[type="range"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: block;
    margin-top: 6px;
    margin-bottom: 4px;
}

@media (min-width: 768px) and (min-height: 500px), (min-width: 768px) and (pointer: fine), (min-width: 768px) and (pointer: none) {
    .path-entry-list {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        max-height: none;
        overflow-y: visible;
        max-width: 600px;
    }
    .path-entry-row {
        border-left: none;
        border-radius: var(--radius-lg);
        border: 2px solid var(--entry-color, #6B7280);
    }
    .path-entry-row__main {
        padding: 2px 4px;
        min-height: 26px;
        gap: 2px;
    }
    .path-entry-row__img {
        width: 16px;
        height: 16px;
    }
    .path-entry-row__dot {
        width: 8px;
        height: 8px;
    }
    .path-entry-row__name {
        max-width: 140px;
    }
    .path-entry-row__arrows {
        flex-direction: row;
    }
    .path-entry-row__arrow {
        font-size: 14px;
        min-width: 18px;
        min-height: 18px;
        padding: 0 3px;
    }
    .path-entry-row__arrow-h {
        display: inline;
    }
    .path-entry-row__arrow-v {
        display: none;
    }
    .path-entry-row__detail {
        padding: 8px 10px 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        width: 200px;
    }
}

/* Path placement vertex editing handles — block browser touch gestures */
[data-pp-handles] [data-vertex-idx],
[data-pp-handles] [data-midpoint-after] {
    touch-action: none;
}

/* === Impeccable sweep: polish + animate === */

/* Zoom/toolbar button press feedback (animate-3, delight-1) */
.zoom-controls button,
.canvas-navigation-controls button,
.canvas-navigation-controls a {
    transition: transform 100ms cubic-bezier(0.25, 1, 0.5, 1),
                background-color 150ms;
}
.zoom-controls button:active,
.canvas-navigation-controls button:active,
.canvas-navigation-controls a:active {
    transform: scale(0.9);
}

/* Zoom percentage hover affordance (critique-2) */
.zoom-controls .zoom-level-display {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    transition: background-color 0.15s ease;
}
.zoom-controls .zoom-level-display:hover {
    background-color: var(--color-surface-alt, #f5f3ed);
}

/* Sidebar toolbar items hover lift (delight-6, polish-9) */
.tools-toolbar__item,
.tools-toolbar--desktop .tools-toolbar__btn {
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-md);
}
.tools-toolbar__item:hover,
.tools-toolbar--desktop .tools-toolbar__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    background-color: var(--color-surface-alt, #f5f3ed);
}
.tools-toolbar__item:active,
.tools-toolbar--desktop .tools-toolbar__btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Dimension label contrast backdrop (polish-8) */
.canvas-dimension-label {
    background: rgba(252, 251, 248, 0.85);
    backdrop-filter: blur(2px);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) .canvas-dimension-label {
    background: rgba(30, 30, 30, 0.85);
  }
}
.dark .canvas-dimension-label {
  background: rgba(30, 30, 30, 0.85);
}

/* Mobile safe-area padding (polish-10) */
.tools-fab {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
@supports (padding: env(safe-area-inset-top)) {
    .canvas-navigation-controls {
        top: calc(1rem + env(safe-area-inset-top, 0px));
    }
}

/* View-mode glow color tokens (critique-5) */
:root {
    --transition-glow-warm: rgba(255, 235, 170, 0.55);
    --transition-glow-mid: rgba(255, 220, 140, 0.25);
    --transition-glow-center: rgba(255, 255, 240, 0.6);
    --transition-glow-fade: rgba(255, 240, 180, 0.15);
}

/* Reduced-motion gating for zoom/nav controls (polish-4) */
@media (prefers-reduced-motion: reduce) {
    .zoom-controls,
    .zoom-controls *,
    .canvas-navigation-controls *,
    .tools-toolbar__item,
    .tools-toolbar--desktop .tools-toolbar__btn,
    .mode-pill-toggle__slider,
    .mode-pill-toggle__btn,
    .coaching-overlay__card--sway,
    .plant-tray__placement-bar,
    .save-checkmark {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .zoom-controls button:active,
    .canvas-navigation-controls button:active,
    .canvas-navigation-controls a:active,
    .tools-toolbar__item:hover,
    .tools-toolbar__item:active,
    .tools-toolbar--desktop .tools-toolbar__btn:hover,
    .tools-toolbar--desktop .tools-toolbar__btn:active {
        transform: none;
        box-shadow: none;
    }
}

/* === Mode pill sliding highlight (delight-2) === */
.mode-pill-toggle {
    position: relative;
}
.mode-pill-toggle__btn {
    position: relative;
    z-index: 1;
    transition: color 0.2s ease-out;
}
.mode-pill-toggle__slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(100% - 4px);
    height: calc(50% - 2px);
    border-radius: 0.5rem;
    background: var(--color-success);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-out;
    z-index: 0;
}
.mode-pill-toggle__slider--view {
    transform: translateY(100%);
}
@media (min-width: 640px) {
    .mode-pill-toggle__slider {
        width: calc(50% - 2px);
        height: calc(100% - 4px);
    }
    .mode-pill-toggle__slider--view {
        transform: translateX(100%);
    }
}

/* === Save checkmark flash (delight-5) === */
.save-checkmark {
    animation: checkmarkFlash 600ms ease-out forwards;
}
@keyframes checkmarkFlash {
    0% { opacity: 0; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.05); }
    70% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}

/* === Coaching overlay sway entrance (delight-8) === */
.coaching-overlay__card--sway {
    animation: coachingSway 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes coachingSway {
    0% { transform: rotate(1.5deg) scale(0.95); opacity: 0; }
    60% { transform: rotate(-0.5deg) scale(1.01); opacity: 1; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

/* === Mobile FAB empty canvas hint (critique-6) === */
.tools-toolbar__fab-hint {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-content-muted, #6b7280);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}


/* === Mode pill focus ring (polish-5) === */
.mode-pill-toggle__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-surface-alt), 0 0 0 4px var(--color-success);
    border-radius: 0.5rem;
}

/* === Desktop sidebar group separator (critique-1) === */
.tools-toolbar__separator--group {
    margin: 10px 10px;
}
:is(.dark, [data-theme="dark"]) .tools-toolbar__separator--group {
    opacity: 0.2;
}


/* Plant sheet Count/Spacing row: a full-width text row, so 32px tall is enough
   to hit; keeps the phone sheet no taller than before the steppers moved onto
   the Info page (beats the 44px `main button` rule in plot_designer.css). */
.pd-sheet-compact-row {
    min-height: 2rem;
}

/* ---- Succession (spec 2026-10-21): Whole year badges, dashed later crops, date chip ---- */
.succ-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}
.succ-layer[hidden] { display: none; }
.succ-outlines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.succ-badge {
    position: absolute;
    transform: translate(-100%, -100%);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 22px;
    min-width: 22px !important;
    min-height: 0 !important;
    max-height: 22px;
    padding: 0 7px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--color-surface-tint, #faf8f4);
    color: var(--color-brand);
    border: 1px solid var(--color-surface-border, #e5e3db);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.08);
    font-size: 12px; font-weight: 600; line-height: 1;
    font-family: inherit;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
}
.succ-badge span:empty { display: none; }
.succ-badge::before {
    /* a 44px touch target around the 22px pill (DESIGN.md) */
    content: '';
    position: absolute;
    inset: -11px;
}
.succ-badge.is-active {
    background: var(--color-brand);
    color: var(--color-brand-on);
    border-color: var(--color-brand);
}
.succ-halo { fill: rgba(255, 255, 255, 0.14); stroke: rgba(255, 255, 255, 0.95); stroke-width: 5; }
.succ-halo.is-later { display: none; }
.succ-outline { fill: none; stroke: var(--color-brand); stroke-width: 2; stroke-dasharray: 6 4; }
.succ-outline.is-later { stroke-opacity: 0.45; stroke-width: 1.5; }
.succ-tag {
    position: absolute;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--color-brand);
    color: var(--color-brand-on);
    font-size: 12px; font-weight: 600; line-height: 1.3;
    font-family: inherit;
    white-space: nowrap;
}

.succ-chip-wrap {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
}
.succ-chip {
    display: inline-flex;
    align-items: stretch;
    height: 44px;
    padding: 0 2px;
    border-radius: 999px;
    background: var(--color-surface-tint, #fcfbf8);
    border: 1px solid var(--color-surface-border, #e5e3db);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08), 0 4px 12px rgba(17, 24, 39, 0.08);
    color: var(--color-content-primary, #111827);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.succ-chip button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 0 !important;
    min-width: 0 !important;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.succ-chip .succ-chip__nav { padding: 0 8px; color: var(--color-brand); }
.succ-chip .succ-chip__nav:disabled { color: var(--color-content-faint, #9ca3af); cursor: default; opacity: 0.6; }
.succ-chip .succ-chip__date {
    padding: 0 4px;
    min-width: 52px;
    justify-content: center;
    color: var(--color-brand);
    text-decoration: underline dotted color-mix(in srgb, var(--color-brand) 45%, transparent);
    text-underline-offset: 4px;
}
.succ-chip.is-today .succ-chip__date { padding-left: 14px; }
.succ-chip.is-today .succ-chip__nav:last-of-type { padding-right: 12px; }
.succ-chip .succ-chip__sep { width: 1px; background: var(--color-surface-border, #e5e3db); margin: 8px 0; }
.succ-chip .succ-chip__close { padding: 0 12px 0 10px; color: var(--color-content-secondary, #4b5563); }

.succ-jump {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 24px));
    max-height: min(420px, 70vh);
    overflow-y: auto;
    padding: 6px;
    border-radius: 16px;
    background: var(--color-surface-tint, #fcfbf8);
    border: 1px solid var(--color-surface-border, #e5e3db);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.16);
}
.succ-jump__title { padding: 8px 10px 6px; font-size: 12px; font-weight: 600; color: var(--color-content-muted, #6b7280); }
.succ-jump__row {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: left;
    min-height: 44px;
    align-items: center;
    font-size: 14px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--color-content-secondary);
}
.succ-jump__row:hover, .succ-jump__row.is-current { background: var(--color-surface-alt); }
.succ-jump__date { flex: 0 0 4.5em; font-weight: 700; color: var(--color-brand); }
.succ-jump__reason { flex: 1; }
.succ-jump__sep { height: 1px; margin: 4px 6px; background: var(--color-surface-border, #e5e3db); }
.succ-jump__pick { font-weight: 700; color: var(--color-brand); }
.succ-jump__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; bottom: 0; left: 50%; }

@media (max-width: 768px), (pointer: coarse) and (max-height: 499.98px) {
    /* phones: in the gap between Edit/View and the settings, no calendar icon */
    .succ-chip-wrap { top: 12px; }
    .succ-chip { height: 44px; font-size: 14px; }
    .succ-chip .succ-chip__nav { padding: 0 7px; }
}

/* Dragging a plant over a full bed: the make-room outline shows the half it
   would take right under the finger, so the plant chip rides above the
   finger, smaller, and leaves the outline in view. */
.plant-tray__ghost.plant-tray__ghost--lifted {
    transform: translate(-50%, calc(-100% - 36px)) scale(0.6);
    transform-origin: 50% 100%;
    opacity: 0.85;
    transition: transform 120ms ease-out, opacity 120ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .plant-tray__ghost.plant-tray__ghost--lifted {
        transition: none;
    }
}

/* ── Views on the map: the placing hint ── */
/* The contextual toolbar's look: a surface-tint card, a brand Done at 44 px */
.pd-pin-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: 60px;
    width: max-content;
    margin: 0 auto;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 24px);
    padding: 6px 6px 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--color-surface-border);
    background: var(--color-surface-tint);
    color: var(--color-content-secondary);
    font-size: 14px;
    line-height: 1.3;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
/* Phone: the Edit | View and settings cards end at 64 px; keep a gap under them */
@media (max-width: 767px), (pointer: coarse) and (max-height: 499.98px) {
    .pd-pin-hint { top: 76px; }
}
.pd-pin-hint__text { min-width: 0; }
.pd-pin-hint__name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-content-primary);
    font-weight: 600;
}
.pd-pin-hint__done {
    flex: none;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    background: var(--color-brand);
    color: var(--color-content-inverse);
    font-weight: 600;
    font-size: 14px;
}
.pd-pin-hint__done:hover { background: var(--color-brand-hover); }
.pd-pin-hint__done:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* ── Views on the map: the Views tray (Your views), rows like the Pots tray ── */
.tool-tray__views {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px 12px;
}
/* Phone sheet: the rows run down, not across like the other trays' tiles. The
   sheet may grow like the grouped trays (its 60 px foot stays clear for the
   phone's nav bar), so three views fit whole; more scroll, with a shadow at
   the foot while rows are hidden below (the cover rides with the list's end
   and hides the shadow there). */
.tool-tray--mobile .tool-tray__sheet:has(.tool-tray__views) {
    max-height: 65vh;
}
.tool-tray--mobile .tool-tray__content:has(> .tool-tray__views) {
    display: block;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background:
        linear-gradient(to bottom, transparent, var(--color-surface-tint) 60%) 0 100% / 100% 28px no-repeat local,
        radial-gradient(farthest-side at 50% 100%, rgb(0 0 0 / 0.16), transparent) 0 100% / 100% 12px no-repeat scroll;
}
.tool-tray--mobile .tool-tray__views {
    padding: 4px 18px 16px;
}
/* Desktop: the flyout beside the sidebar's Views item (_tools_sidebar.html) */
.view-pin-flyout .tool-tray__views {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0 0;
    width: 280px;
}
.tool-tray__view-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--color-content-primary);
    cursor: pointer;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.tool-tray__view-row:hover { background: var(--color-surface-alt); }
.tool-tray__view-row:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.tool-tray__view-pic {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 48px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--color-surface-border);
    background: var(--color-surface-alt);
}
.tool-tray__view-pic img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tool-tray__view-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-tray__view-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}
.tool-tray__view-size { font-size: 12px; color: var(--color-content-muted); }
