/* ============================================================
   HOME BUILDER — Free-Form Canvas Builder Styles
   Admin-only CMS inside HUB Settings.
   Users place and resize blocks freely on a canvas.
   ============================================================ */

/* ==================== TOOLBAR ==================== */
/* Compact — previously consumed ~70px of vertical space. Users complained
   it was eating the canvas area. Tightened padding + reduced button/badge
   sizes across the board brings it to ~44px. */
.hb-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hb-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.hb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ==================== STATUS BADGE ==================== */
.hb-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
    font-family: 'Futura PT', 'Jost', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hb-status-badge.hb-status-draft { background: #fff3cd; color: #856404; }
.hb-status-badge.hb-status-dirty { background: #fff3cd; color: #856404; }
.hb-status-badge.hb-status-unpublished { background: #fce8c8; color: #7c5200; }
.hb-status-badge.hb-status-published { background: #d4edda; color: #155724; }

/* ==================== LAYOUT NAME (inline editable) ==================== */
.hb-layout-name-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 4px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 220px;
}
.hb-layout-name-input {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #231F20;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 6px;
    padding: 3px 6px;
    outline: none;
    width: 100%;
    min-width: 100px;
    transition: border-color 0.2s, background 0.2s;
}
.hb-layout-name-input:hover {
    border-color: #e0ddd8;
    background: #faf9f7;
}
.hb-layout-name-input:focus {
    border-color: #1E6332;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.1);
}
.hb-layout-name-icon {
    font-size: 11px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}
.hb-layout-name-icon:hover { color: #1E6332; }

/* ==================== GLOBAL SETTINGS POPOVER ==================== */
.hb-global-settings-popover {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05);
    width: 270px;
    overflow: hidden;
}
.hb-gs-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f7f5;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    border-bottom: 1px solid #eee;
}
.hb-gs-body {
    padding: 14px 16px 16px;
}
.hb-gs-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    margin-top: 10px;
}
.hb-gs-label:first-child { margin-top: 0; }
.hb-gs-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hb-gs-color {
    width: 36px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    padding: 1px;
    flex-shrink: 0;
}

/* ==================== BUTTONS ==================== */
/* Compacted from 9px/20px padding + 14px font to fit the toolbar into a
   shorter row. Full-width labels preserved (Add Block, New Template, etc.)
   — just smaller and tighter. */
.hb-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 7px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.hb-btn:hover { transform: translateY(-1px); }
.hb-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.hb-btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
}
.hb-btn-outline:hover { border-color: #1E6332; color: #1E6332; }

.hb-btn-snap-on {
    background: #1E633215;
    border-color: #1E6332;
    color: #1E6332;
}

.hb-btn-secondary { background: #f0f0f0; color: #333; }
.hb-btn-secondary:hover { background: #e0e0e0; }

.hb-btn-primary { background: linear-gradient(135deg, #1E6332, #2F8542); color: #fff; }
.hb-btn-primary:hover { background: linear-gradient(135deg, #214A3E, #1E6332); }

.hb-btn-sm { padding: 5px 12px; font-size: 12px; }
.hb-btn-xs { padding: 3px 8px; font-size: 11px; }

.hb-btn-danger-outline { border-color: #dc3545; color: #dc3545; background: transparent; }
.hb-btn-danger-outline:hover { background: #fee2e2; border-color: #b02a37; color: #b02a37; }

/* ==================== ICON BUTTONS ==================== */
.hb-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    color: #888;
}
.hb-btn-icon:hover { background: #f0f0f0; }
.hb-btn-icon-xs { width: 22px; height: 22px; font-size: 10px; }
.hb-btn-danger-icon { color: #dc3545; }
.hb-btn-danger-icon:hover { background: #fee2e2; color: #b02a37; }

/* ==================== TOGGLE BUTTONS ==================== */
.hb-btn-group {
    display: flex;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.hb-btn-toggle {
    flex: 1;
    padding: 7px 14px;
    border: none;
    background: #fff;
    color: #666;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    border-right: 1px solid #ddd;
}
.hb-btn-toggle:last-child { border-right: none; }
.hb-btn-toggle:hover { background: #f8f8f8; }
.hb-btn-toggle-active,
.hb-btn-toggle.hb-btn-toggle-active { background: #1E6332; color: #fff; }
.hb-btn-toggle-active:hover { background: #214A3E; }

/* ==================== WORKSPACE (canvas + push-based props panel) ==================== */
.hb-workspace {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.hb-canvas-wrap {
    flex: 1;
    min-width: 0;
    transition: flex 0.25s ease;
}

/* ==================== CANVAS HEIGHT BAR ==================== */
.hb-canvas-height-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: #fafaf8;
    border: 1px solid #e8e4df;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    font-size: 11.5px;
    color: #777;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

/* ==================== CANVAS ==================== */
.hb-canvas {
    position: relative;
    background: #fff;
    border: 2px dashed #c4c0bb;
    border-radius: 0 0 10px 10px;
    overflow: visible;
    cursor: default;
    min-height: 400px;
    /* Visual reference grid — 10px squares (snap increments are finer: 1% ≈ 12px
       horizontal, 5px vertical — see SNAP_PCT / SNAP_PX in home-builder.js). */
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 10px 10px;
}

/* ==================== BLOCK ==================== */
.hb-block {
    position: absolute;
    border: 2px solid #d4d0cb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: move;
    transition: box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.hb-block:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-color: #bbb;
}

.hb-block-selected {
    border-color: #1E6332 !important;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Block content preview — fills the entire block (no header, no top-right buttons).
   Clone + Delete live in the right-side properties panel. */
.hb-block-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* Section wrapper emitted by home.js _renderSection() uses .hv2-section. The
   global .hv2-section rule carries padding for grid-layout contexts, but inside
   a canvas block we want the section to fill the whole block so widgets like
   Calendar + Weather and Announcements don't get indented or collapse to
   content height (which would leave visible empty space inside the block). */
.hb-block-content > .hv2-section {
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== RESIZE HANDLES ==================== */
.hb-handle {
    position: absolute;
    z-index: 10;
    background: #1E6332;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.hb-handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.hb-handle-n  { top: -6px; left: 50%; margin-left: -6px; cursor: n-resize; }
.hb-handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.hb-handle-e  { top: 50%; right: -6px; margin-top: -6px; cursor: e-resize; }
.hb-handle-se { bottom: -6px; right: -6px; cursor: se-resize; }
.hb-handle-s  { bottom: -6px; left: 50%; margin-left: -6px; cursor: s-resize; }
.hb-handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.hb-handle-w  { top: 50%; left: -6px; margin-top: -6px; cursor: w-resize; }

/* ==================== BLOCK CONTENT PREVIEWS ==================== */
.hb-preview-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 14px;
    gap: 8px;
}
.hb-preview-empty i { font-size: 28px; }

.hb-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hb-preview-hero {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 16px;
}
.hb-preview-hero-h { font-size: 20px; font-weight: 700; margin-bottom: 4px; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.hb-preview-hero-sub { font-size: 14px; opacity: 0.85; margin-bottom: 8px; }
.hb-preview-hero-cta { font-size: 13px; background: rgba(255,255,255,0.9); color: #1E6332; padding: 6px 18px; border-radius: 6px; font-weight: 600; }

.hb-preview-richtext {
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    overflow: hidden;
}
.hb-preview-richtext h1, .hb-preview-richtext h2, .hb-preview-richtext h3 { font-size: 16px; color: #1E6332; margin: 4px 0; }
.hb-preview-richtext img { max-width: 100%; border-radius: 4px; }

.hb-preview-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
}

.hb-preview-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 6px;
    width: 100%;
    height: 100%;
}
.hb-preview-gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}
.hb-preview-gallery-ph {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #ccc;
}
.hb-preview-gallery-more {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #888;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== NEW TYPE PREVIEWS ==================== */
.hb-preview-video {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.hb-preview-video-thumb {
    flex: 1;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    position: relative;
}
.hb-preview-video-thumb i {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.hb-preview-video-thumb span {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}
.hb-preview-video-cap {
    padding: 4px 8px;
    font-size: 11px;
    color: #666;
    background: #f9f9f9;
    text-align: center;
}
.hb-preview-embed {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f7ff;
    border-radius: 6px;
    padding: 12px;
}

/* ==================== PROPS PANEL CLOSE BUTTON ==================== */
.hb-props-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.hb-props-close:hover { background: #f0f0f0; }

/* ==================== PROPERTIES PANEL (push-based, compresses canvas) ==================== */
.hb-props-panel {
    width: 0;
    overflow: hidden;
    background: #fff;
    border-left: none;
    flex-shrink: 0;
    transition: width 0.25s ease, border-left 0.25s ease;
    /* Sticky sidebar — stays pinned to the top of the viewport while the
       canvas scrolls, with its own internal scroll when content overflows. */
    position: sticky;
    top: 60px;                              /* clears the main app header */
    align-self: flex-start;
    max-height: calc(100vh - 60px);
    min-height: 400px;
}

.hb-props-panel-open {
    width: 340px;
    border-left: 1px solid #e8e4df;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
}

.hb-props-panel-inner {
    padding: 0 0 24px;                      /* bottom padding so last section isn't flush */
    width: 340px;
    min-width: 340px;
}

.hb-props-empty {
    padding: 40px 20px;
    text-align: center;
    color: #aaa;
    display: none; /* Panel is hidden entirely when no block selected */
    flex-direction: column;
    align-items: center;
    font-size: 13px;
}

.hb-props-header {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #231F20;
    border-bottom: 1px solid #f0ede8;
}

.hb-props-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-props-section {
    padding: 16px 18px;
    border-bottom: 1px solid #f0ede8;
}
.hb-props-section:last-child { border-bottom: none; }

.hb-props-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 12px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

.hb-size-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.hb-size-preset {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Futura PT', 'Jost', sans-serif;
    white-space: nowrap;
}
.hb-size-preset:hover:not(:disabled) { border-color: #1E6332; color: #1E6332; background: #f0faf4; }
.hb-size-preset i { margin-right: 3px; font-size: 10px; }
.hb-size-preset-active { border-color: #1E6332; color: #1E6332; background: #f0faf4; font-weight: 600; }
.hb-size-preset:disabled { cursor: default; opacity: 1; }

.hb-props-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
/* Position-only (no W/H) for auto-sized blocks */
.hb-props-grid--pos {
    grid-template-columns: 1fr 1fr;
}

/* Reset-to-default-size button on singleton blocks' props panel */
.hb-props-reset-size {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
    font-size: 11.5px;
}
.hb-props-reset-size i { margin-right: 5px; }

/* "Auto-sized" note shown in place of the size presets + W/H inputs */
.hb-props-autosize-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #F4F0E9;
    border: 1px solid #e8e4df;
    border-left: 3px solid #1E6332;
    border-radius: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}
.hb-props-autosize-note > i {
    color: #1E6332;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}
.hb-props-autosize-note > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.hb-props-autosize-note strong {
    font-size: 12px;
    font-weight: 700;
    color: #1E6332;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hb-props-autosize-note span {
    font-size: 11.5px;
    color: #475453;
    line-height: 1.4;
}

.hb-prop-field label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    text-transform: uppercase;
}

/* Block Actions (Duplicate + Delete in properties panel) */
.hb-props-actions {
    padding-top: 8px;
}
.hb-props-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.hb-props-action-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
}
.hb-props-action-btn i { margin-right: 5px; }
.hb-props-action-note {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    padding: 6px 8px;
    background: #F4F0E9;
    border-radius: 6px;
    border-left: 2px solid #C19A6B;
}
.hb-props-action-note i { margin-right: 4px; color: #C19A6B; }

/* ==================== CALENDAR + WEATHER EDITOR ==================== */
/* Category filter chips */
.hb-cal-hint {
    font-size: 11px;
    color: #6b7280;
    margin: 0 0 8px 2px;
    line-height: 1.4;
}
.hb-cal-cat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hb-cal-cat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.hb-cal-cat-chip:hover { border-color: #1E6332; background: #fafaf7; }
.hb-cal-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 6px;
    font-size: 11px;
}
.hb-cal-cat-label { font-size: 13px; color: #231F20; }

/* Event list */
.hb-cal-add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(30, 99, 50, 0.2);
    margin-bottom: 10px;
}
.hb-cal-add-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(30, 99, 50, 0.3); }
.hb-cal-add-btn i { font-size: 14px; }

.hb-cal-loading {
    text-align: center;
    padding: 16px;
    color: #6b7280;
    font-size: 12px;
}
.hb-cal-loading i { margin-right: 6px; color: #1E6332; }

.hb-cal-empty {
    text-align: center;
    padding: 20px 14px;
    color: #6b7280;
    background: #fafaf7;
    border-radius: 8px;
    border: 1px dashed #e8e4df;
    font-size: 12px;
    line-height: 1.45;
}
.hb-cal-empty i { font-size: 24px; color: #C19A6B; margin-bottom: 8px; display: block; }
.hb-cal-empty strong { color: #231F20; font-size: 13px; }
.hb-cal-empty-sub { margin-top: 4px; font-size: 11px; color: #9ca3af; }
.hb-cal-empty--error { border-color: #fecaca; background: #fef2f2; }
.hb-cal-empty--error i { color: #dc2626; }

.hb-cal-event-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hb-cal-event-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #1E6332;
    padding: 10px 2px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hb-cal-event-group-label span {
    color: #9ca3af;
    font-weight: 600;
}
.hb-cal-event-group-label--past { color: #9ca3af; }

.hb-cal-event-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    border: 1px solid #e8e4df;
    border-left: 3px solid var(--cal-row-accent, #1E6332);
    border-radius: 6px;
    background: #fff;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hb-cal-event-row:hover {
    background: #fafaf7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border-color: #d6d3cd;
    border-left-color: var(--cal-row-accent, #1E6332);
}
.hb-cal-event-dot {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.hb-cal-event-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}
.hb-cal-event-title {
    font-size: 13px;
    font-weight: 600;
    color: #231F20;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hb-cal-event-date {
    font-size: 10.5px;
    color: #6b7280;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hb-cal-event-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.hb-cal-event-btn {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.hb-cal-event-btn:hover { background: #F4F0E9; color: #1E6332; }
.hb-cal-event-btn--danger:hover { background: #fef2f2; color: #dc2626; }

.hb-cal-event-row--confirm {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #dc2626;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.hb-cal-event-confirm-msg {
    font-size: 12px;
    color: #b91c1c;
    font-weight: 600;
}
.hb-cal-event-confirm-msg i { margin-right: 5px; }
.hb-cal-event-confirm-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Event form */
.hb-cal-form {
    background: #fafaf7;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hb-cal-form-head {
    font-size: 13px;
    font-weight: 700;
    color: #1E6332;
    letter-spacing: 0.2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e4df;
}
.hb-cal-form-head i { margin-right: 6px; }

.hb-cal-form-row { display: flex; flex-direction: column; gap: 4px; }
.hb-cal-form-row label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475453;
}
.hb-cal-form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.hb-cal-form-half { min-width: 0; }

.hb-cal-req {
    color: #dc2626;
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 2px;
}
.hb-cal-opt {
    font-weight: 500;
    color: #9ca3af;
    text-transform: none;
    font-style: italic;
    letter-spacing: 0;
    margin-left: 4px;
}
.hb-cal-textarea { resize: vertical; min-height: 60px; font-family: inherit; }

.hb-cal-form-cats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.hb-cal-form-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.hb-cal-form-cat i { color: var(--cat-color); font-size: 13px; }
.hb-cal-form-cat span { font-size: 9.5px; font-weight: 600; color: #475453; text-transform: uppercase; letter-spacing: 0.3px; }
.hb-cal-form-cat:hover { background: var(--cat-bg); border-color: var(--cat-color); transform: translateY(-1px); }
.hb-cal-form-cat--active {
    background: var(--cat-bg);
    border-color: var(--cat-color);
    box-shadow: 0 0 0 2px var(--cat-color) inset;
}
.hb-cal-form-cat--active span { color: var(--cat-color); }

.hb-cal-form-error {
    font-size: 11.5px;
    color: #b91c1c;
    background: #fef2f2;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    line-height: 1.4;
}
.hb-cal-form-error i { margin-right: 5px; }

.hb-cal-form-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid #e8e4df;
    margin-top: 4px;
}
.hb-cal-form-buttons button { flex: 1; }
.hb-cal-form-buttons button i { margin-right: 4px; }

/* Reusable info panel used by editors that have no configurable settings yet */
.hb-cal-info-panel {
    background: #F4F0E9;
    border: 1px solid #e8e4df;
    border-left: 3px solid #1E6332;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #475453;
    line-height: 1.5;
}
.hb-cal-info-panel-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-weight: 700;
    color: #1E6332;
    font-size: 13px;
}
.hb-cal-info-panel-head i { font-size: 13px; }

/* -------- Event description RTE -------- */
.hb-cal-rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 5px 6px;
    background: #fafaf7;
    border: 1px solid #e8e4df;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
    align-items: center;
}
.hb-cal-rte-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #475453;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    font-family: inherit;
}
.hb-cal-rte-btn:hover {
    background: #fff;
    color: #1E6332;
    border-color: #e8e4df;
}
.hb-cal-rte-sep {
    width: 1px;
    height: 16px;
    background: #e8e4df;
    margin: 0 2px;
}
.hb-cal-rte-heading {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #475453;
    cursor: pointer;
    font-family: inherit;
    height: 26px;
}
.hb-cal-rte-heading:hover {
    background: #fff;
    border-color: #e8e4df;
}

/* Color picker */
.hb-cal-rte-color-wrap {
    position: relative;
    display: inline-block;
}
.hb-cal-rte-color-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    padding: 6px;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 146px;
}
.hb-cal-rte-swatch {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease, border-color 0.1s ease;
}
.hb-cal-rte-swatch:hover {
    transform: scale(1.12);
    border-color: #1E6332;
}

/* Contenteditable editor surface */
.hb-cal-rte-editor {
    min-height: 110px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 0 0 6px 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #231F20;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hb-cal-rte-editor:focus {
    border-color: #1E6332;
    box-shadow: 0 0 0 2px rgba(30, 99, 50, 0.15);
}
.hb-cal-rte-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
    font-style: italic;
}
.hb-cal-rte-editor h1 { font-size: 18px; font-weight: 700; margin: 8px 0 4px; }
.hb-cal-rte-editor h2 { font-size: 16px; font-weight: 700; margin: 7px 0 4px; }
.hb-cal-rte-editor h3 { font-size: 14px; font-weight: 700; margin: 6px 0 3px; }
.hb-cal-rte-editor p  { margin: 4px 0; }
.hb-cal-rte-editor ul,
.hb-cal-rte-editor ol { padding-left: 22px; margin: 4px 0; }
.hb-cal-rte-editor a  { color: #1E6332; text-decoration: underline; }
.hb-cal-rte-editor img { max-width: 100%; height: auto; border-radius: 6px; margin: 4px 0; }
.hb-cal-rte-editor iframe { max-width: 100%; border-radius: 6px; }
.hb-cal-rte-editor video { max-width: 100%; border-radius: 6px; }

/* Inline action bar (link / image / video) */
.hb-cal-rte-inline-bar {
    margin-top: 6px;
    padding: 8px 10px;
    background: #F4F0E9;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    animation: hbCalRteBarIn 0.18s ease;
}
@keyframes hbCalRteBarIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hb-cal-rte-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.hb-cal-rte-bar-icon {
    color: #1E6332;
    font-size: 12px;
    flex-shrink: 0;
}
.hb-cal-rte-bar-input {
    flex: 1;
    min-width: 0;
}
.hb-cal-rte-bar-hint {
    margin-top: 6px;
    font-size: 10.5px;
    color: #6b7280;
    line-height: 1.4;
}

/* Layer buttons */
.hb-layer-btns {
    display: flex;
    gap: 6px;
}

/* ==================== FORM FIELDS ==================== */
.hb-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    color: #333;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}
.hb-input:focus { border-color: #1E6332; outline: none; box-shadow: 0 0 0 3px rgba(30,99,50,0.1); }
.hb-input-sm { padding: 6px 8px; font-size: 12px; }
.hb-input-xs { padding: 4px 6px; font-size: 12px; }

.hb-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    color: #333;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}
.hb-textarea:focus { border-color: #1E6332; outline: none; box-shadow: 0 0 0 3px rgba(30,99,50,0.1); }

.hb-field-row {
    margin-bottom: 12px;
}
.hb-field-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

.hb-field-row-group {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.hb-field-half { flex: 1; min-width: 0; margin-bottom: 0; }

.hb-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.hb-color-field input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.hb-color-field span { font-size: 12px; color: #888; }
.hb-color-clear {
    width: 22px;
    height: 22px;
    border: none;
    background: #f3f0ec;
    color: #999;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.hb-color-clear:hover {
    background: #e8d5d5;
    color: #c44;
}
.hb-color-none {
    width: 32px;
    height: 32px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #bbb;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50%/12px 12px;
    transition: border-color 0.15s;
}
.hb-color-none:hover {
    border-color: #1E6332;
    color: #1E6332;
}

.hb-range-field {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hb-range-field input[type="range"] { flex: 1; accent-color: #1E6332; }
.hb-range-field span { font-size: 12px; color: #888; min-width: 36px; text-align: right; }

/* ==================== EDITOR FIELDS ==================== */
.hb-editor-fields {
    padding: 0;
}

/* Section separator in editor panel */
.hb-editor-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8c8680;
}
.hb-editor-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e4df;
}

.hb-img-preview-wrap {
    position: relative;
    margin-bottom: 12px;
    text-align: center;
    background: #fafaf8;
    border-radius: 8px;
    padding: 10px;
}
.hb-img-preview {
    max-width: 100%;
    max-height: 160px;
    border-radius: 6px;
    object-fit: contain;
}
.hb-img-preview-wrap .hb-btn-icon {
    position: absolute;
    top: 6px;
    right: 6px;
}
.hb-img-loading {
    padding: 30px;
    text-align: center;
    color: #1E6332;
    font-size: 18px;
}

/* Rich text editor */
.hb-rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #fafaf8;
    border: 1px solid #e8e4df;
    border-radius: 6px 6px 0 0;
    align-items: center;
}

.hb-rte-toolbar button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hb-rte-toolbar button:hover { background: #e8e4df; }

.hb-rte-toolbar select {
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11px;
    color: #555;
    background: #fff;
    cursor: pointer;
}

.hb-rte-sep {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 2px;
}

.hb-rte-editor {
    border: 1px solid #e8e4df;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 12px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    outline: none;
}
.hb-rte-editor:focus { box-shadow: 0 0 0 3px rgba(30,99,50,0.1); }

/* Gallery editor */
.hb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
}

.hb-gallery-item {
    border: 1px solid #e8e4df;
    border-radius: 8px;
    overflow: hidden;
    background: #fafaf8;
}

.hb-gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.hb-gallery-thumb-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.hb-gallery-item-actions {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hb-empty-hint {
    color: #aaa;
    font-size: 13px;
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 0;
}

/* ==================== STARTER SCREEN ==================== */
.hb-starter {
    text-align: center;
    padding: 40px 20px;
}

.hb-starter-header {
    margin-bottom: 30px;
}

.hb-starter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.hb-starter-card {
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}
.hb-starter-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }

.hb-starter-thumb {
    position: relative;
    height: 140px;
    background: #fafaf8;
    border-bottom: 1px solid #f0ede8;
    overflow: hidden;
}
.hb-starter-thumb-sm { height: 90px; }
.hb-starter-thumb-scratch {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-thumb-block {
    position: absolute;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hb-thumb-label {
    font-size: 7px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.hb-starter-info {
    padding: 12px;
    text-align: left;
}
.hb-starter-info strong {
    display: block;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 14px;
    color: #231F20;
    margin-bottom: 2px;
}
.hb-starter-info span {
    font-size: 12px;
    color: #888;
}

.hb-starter-card-sm { padding: 0; }
.hb-starter-card-sm .hb-starter-info { padding: 8px; text-align: center; }

/* ==================== TEMPLATE OVERLAY ==================== */
.hb-template-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hb-template-modal {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 1000px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.hb-template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hb-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

/* Template card (enhanced) */
.hb-tpl-card {
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    overflow: hidden;
}
.hb-tpl-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(30,99,50,0.08); border-color: #1E633240; }

.hb-tpl-card-saved { border-color: #C19A6B40; }
.hb-tpl-card-saved:hover { border-color: #C19A6B80; box-shadow: 0 6px 20px rgba(193,154,107,0.12); }

.hb-tpl-thumb {
    position: relative;
    height: 110px;
    background: linear-gradient(135deg, #fafaf8 0%, #f4f2ef 100%);
    border-bottom: 1px solid #f0ede8;
    overflow: hidden;
    padding: 6px;
}
.hb-tpl-thumb .hb-thumb-block {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-tpl-info { padding: 10px 12px; }

.hb-tpl-name {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #231F20;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.hb-tpl-desc {
    font-size: 11px;
    color: #888;
    line-height: 1.35;
    margin-bottom: 6px;
}

.hb-tpl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.hb-tpl-chip {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}
.hb-tpl-chip i { font-size: 9px; }
.hb-tpl-chip-more {
    color: #999;
    background: #f5f5f5;
    border-color: #e5e5e5;
}

.hb-tpl-count {
    font-size: 10px;
    color: #aaa;
    font-weight: 500;
}

/* Template section headers */
.hb-tpl-section { margin-bottom: 20px; }
.hb-tpl-section-header {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #475453;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hb-tpl-section-count {
    background: #f0ede8;
    color: #666;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* Template action buttons row */
.hb-tpl-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.hb-tpl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Futura PT', 'Jost', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid;
}
.hb-tpl-action-new {
    background: #1E6332;
    color: #fff;
    border-color: #1E6332;
}
.hb-tpl-action-new:hover {
    background: #214A3E;
    border-color: #214A3E;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(30, 99, 50, 0.25);
}
.hb-tpl-action-save {
    background: #fff;
    color: #C19A6B;
    border-color: #C19A6B;
}
.hb-tpl-action-save:hover {
    background: #faf6f0;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(193, 154, 107, 0.2);
}

/* Inline new/save template form */
.hb-tpl-new-form {
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 16px;
}
.hb-tpl-new-form-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Save layout bar */
.hb-tpl-save-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F4F0E9;
    border: 1px dashed #C19A6B60;
    border-radius: 10px;
}

/* ── Saved Versions ── */
.hb-versions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 4px;
}
.hb-version-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.15s;
}
.hb-version-card:hover { border-color: #1E6332; }
.hb-version-info { flex: 1; min-width: 0; }
.hb-version-name { font-size: 14px; font-weight: 600; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-version-meta { font-size: 11px; color: #888; margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.hb-version-meta span:not(:last-child)::after { content: '·'; margin-left: 6px; color: #ccc; }
.hb-version-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Saved layout delete button */
.hb-tpl-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(220,38,38,0.08);
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
}
.hb-tpl-card:hover .hb-tpl-delete { opacity: 1; }
.hb-tpl-delete:hover { background: rgba(220,38,38,0.15); }

/* ==================== TYPE PICKER ==================== */
.hb-type-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: hbFadeIn 0.15s ease;
}

@keyframes hbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hb-type-picker {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 820px;
    width: 100%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    animation: hbScaleIn 0.2s ease;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes hbScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hb-type-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.hb-type-picker-header h3 {
    margin: 0;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 18px;
    color: #231F20;
}

.hb-type-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.hb-type-picker-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border: 1px solid #e8e4df;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
    width: 100%;
}
.hb-type-picker-btn:hover { background: #fafaf8; border-color: #1E6332; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30, 99, 50, 0.12); }

/* Singleton types already on the page: show disabled state with "Already on page" badge */
.hb-type-picker-btn--disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8f7f5;
}
.hb-type-picker-btn--disabled:hover {
    background: #f8f7f5;
    border-color: #e8e4df;
    transform: none;
    box-shadow: none;
}
.hb-type-picker-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #1E6332;
    background: #F4F0E9;
    border-radius: 8px;
    vertical-align: middle;
}

.hb-type-picker-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.hb-type-picker-info {
    min-width: 0;
}
.hb-type-picker-info strong {
    display: block;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 13px;
    color: #231F20;
    margin-bottom: 2px;
}
.hb-type-picker-info span {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
    display: block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .hb-props-panel-open {
        width: 280px;
    }
    .hb-props-panel-inner {
        width: 280px;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .hb-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .hb-toolbar-right {
        width: 100%;
        justify-content: flex-end;
    }
    .hb-layout-name-wrap {
        max-width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
    .hb-layout-name-input {
        font-size: 14px;
    }
    .hb-global-settings-popover {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    .hb-starter-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .hb-template-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .hb-template-modal {
        max-width: 100%;
        padding: 16px;
    }
    .hb-tpl-save-bar {
        flex-wrap: wrap;
    }
    .hb-tpl-delete { opacity: 1; }
    .hb-type-picker {
        max-width: 100%;
    }
    .hb-type-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hb-props-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hb-handle {
        width: 16px;
        height: 16px;
    }
    .hb-handle-nw { top: -8px; left: -8px; }
    .hb-handle-n  { top: -8px; margin-left: -8px; }
    .hb-handle-ne { top: -8px; right: -8px; }
    .hb-handle-e  { right: -8px; margin-top: -8px; }
    .hb-handle-se { bottom: -8px; right: -8px; }
    .hb-handle-s  { bottom: -8px; margin-left: -8px; }
    .hb-handle-sw { bottom: -8px; left: -8px; }
    .hb-handle-w  { left: -8px; margin-top: -8px; }
}

/* ==================== CALENDAR + WEATHER BLOCK (builder preview) ====================
   Duplicated from home.css so the widget looks identical on the builder canvas AND
   the live Home page. Prefix .eff-calwx-* avoids collisions. Accent color is set
   inline via --calwx-accent custom property on the root element.
   =============================================================================== */
.eff-calwx {
    --calwx-accent: #1E6332;
    position: relative;
    height: 100%;
    background: #fff;
    overflow: hidden;
    border: 1px solid #e8e4df;
    box-shadow: 0 4px 16px rgba(30, 99, 50, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    font-family: 'Futura PT', 'Jost', sans-serif;
    color: #231F20;
}

/* Weather header */
.eff-calwx-wx {
    position: relative;
    background: linear-gradient(135deg, var(--calwx-accent) 0%, #2F8542 55%, #18A74B 100%);
    color: #fff;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    min-height: 68px;
}
.eff-calwx-wx-icon {
    font-size: 34px;
    line-height: 1;
    opacity: 0.95;
    animation: effCalwxFloat 3.2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
.eff-calwx-wx-body { line-height: 1.15; }
.eff-calwx-wx-temp { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.eff-calwx-wx-temp span { font-size: 13px; font-weight: 500; opacity: 0.9; margin-left: 1px; }
.eff-calwx-wx-cond { font-size: 11.5px; opacity: 0.9; font-weight: 500; margin-top: 1px; }
.eff-calwx-wx-meta {
    justify-self: end;
    text-align: right;
    font-size: 10.5px;
    opacity: 0.92;
    line-height: 1.5;
}
.eff-calwx-wx-loc, .eff-calwx-wx-hilo { white-space: nowrap; }
.eff-calwx-wx-loc i { margin-right: 3px; font-size: 10px; }
.eff-calwx-wx-hilo i { font-size: 9px; }
.eff-calwx-wx-hilo i.fa-arrow-down { margin-left: 4px; }
.eff-calwx-wx-shine {
    position: absolute;
    top: 0; left: -40%;
    width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.14) 50%, transparent 100%);
    animation: effCalwxShine 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes effCalwxFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
@keyframes effCalwxShine {
    0%    { left: -40%; }
    60%   { left: 120%; }
    100%  { left: 120%; }
}

/* Body */
.eff-calwx-body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 6px;
}
.eff-calwx-head { display: flex; align-items: baseline; justify-content: space-between; }
.eff-calwx-month { font-size: 15px; font-weight: 700; color: #231F20; letter-spacing: 0.2px; }
.eff-calwx-view {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.eff-calwx-view i { margin-right: 3px; }
.eff-calwx-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.eff-calwx-dow > div {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.6px;
    padding: 2px 0;
}

.eff-calwx-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(28px, 1fr);
    gap: 2px;
    flex: 1;
    min-height: 0;
}
.eff-calwx-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 500;
    color: #475453;
    cursor: default;
    padding: 2px 0;
    transition: background 0.16s ease, transform 0.16s ease;
    min-height: 28px;
}
.eff-calwx-cell:hover { background: #F4F0E9; }
.eff-calwx-cell--empty { visibility: hidden; }
.eff-calwx-cell--today {
    background: var(--calwx-accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(30, 99, 50, 0.32);
    animation: effCalwxTodayPulse 2.6s ease-in-out infinite;
}
.eff-calwx-cell--today:hover {
    background: var(--calwx-accent);
    transform: scale(1.04);
}
.eff-calwx-num { line-height: 1; }
.eff-calwx-dots { display: flex; gap: 2px; margin-top: 3px; height: 4px; align-items: center; }
.eff-calwx-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.eff-calwx-cell--today .eff-calwx-dot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); }

@keyframes effCalwxTodayPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(30, 99, 50, 0.32); }
    50%      { box-shadow: 0 2px 14px rgba(30, 99, 50, 0.55); }
}

