/* panels.css - Phase 2: Definitive Architecture & Visual System */

/* --- 1. Dock Container & Z-Index Layering --- */
.dock {
    position: fixed;
    /* FIX: Z-Index Update (Layer 4) */
    /* Must be above all sticky headers (120) */
    z-index: 200; 
    pointer-events: none; /* Passthrough clicks */
}
.dock > * {
    pointer-events: auto; /* Capture clicks on children */
}

/* Panel Anchor Positioning */
.dock-checklist,
.dock-costs,
.dock-conflicts,
.dock-colors,
.dock-fx,
.dock-luggage,
.dock-packing {
    bottom: 24px;
    right: 24px;
    z-index: 202; /* Relative bump above container */
}

/* --- 2. Floating Action Button (FAB) --- */
.dock-fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    /* FIX: Z-Index Update (Layer 4 Top) */
    z-index: 210;
}

.dock-btn.tools-btn {
    background: var(--primary-bg);
    color: var(--primary-ink);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /* Elevation: Resting */
    box-shadow: var(--shadow-lg), 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dock-btn.tools-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
}

.dock-btn.tools-btn:active {
    transform: scale(0.95);
}

.dock-fab.open .tools-btn {
    transform: rotate(45deg);
    background: var(--ink); /* Visual feedback for "Close" state */
    box-shadow: var(--shadow-md);
}

/* --- 3. FAB Tools Menu (Fan Out) --- */
.dock-fab .dock-pane {
    display: none;
    position: absolute;
    bottom: 0;
    right: calc(100% + 16px);
    flex-direction: row-reverse;
    align-items: center;
    padding: 6px;
    gap: 8px;
    height: 56px;
    
    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    
    box-shadow: var(--shadow-lg);
    border-radius: 999px;
    
    transform-origin: center right;
    transform: scale(0.8) translateX(20px);
    opacity: 0;
    transition: 
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
        opacity 0.2s ease;
}

.dock-fab.open .dock-pane {
    display: flex;
    transform: scale(1) translateX(0);
    opacity: 1;
}

.tools-menu {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
}

.tools-menu .icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--ink-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tools-menu .icon-btn:hover {
    background: var(--panel);
    color: var(--primary-bg);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.tools-menu .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--warn-ink);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

/* --- 4. Main Dock Panels (Shell) --- */
.dock:not(.dock-fab) .dock-pane {
    border-radius: var(--radius);
    padding: 16px;
    
    /* Glassmorphism Surface */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    
    box-shadow: var(--shadow-lg);
    
    position: absolute;
    right: 0;
    bottom: 88px; /* Above FAB */
    max-height: calc(100vh - 120px);
    display: none; /* Hidden by default */
    pointer-events: auto;
    
    /* Entrance Animation */
    transform-origin: bottom right;
    animation: paneSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes paneSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Visibility Toggles */
.dock.open .dock-pane.costs { display: block; }
.dock.open .dock-pane.conflicts { display: flex; }

.dock.open .dock-pane.checklist,
.dock.open .dock-pane.colors,
.dock.open .dock-pane.fx,
.dock.open .dock-pane.luggage,
.dock.open .dock-pane.packing { display: flex; }

/* Panel Sizing & Layout */
.dock-pane.checklist,
.dock-pane.costs,
.dock-pane.conflicts,
.dock-pane.packing,
.dock-pane.colors,
.dock-pane.fx,
.dock-pane.luggage {
    width: 420px;
    min-width: 420px;
    max-width: 420px;
}

.dock-pane.checklist,
.dock-pane.packing,
.dock-pane.colors,
.dock-pane.fx,
.dock-pane.luggage {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

/* SURGICAL FIX: Costs panel specific layout to prevent overflow */
/* We use flex column with hidden overflow to constrain children */
.dock-pane.costs {
    display: none; /* Default hidden */
    flex-direction: column;
    overflow: hidden; /* Clip children to border radius */
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0) 34%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 28px 56px -32px rgba(15, 23, 42, 0.42), 0 20px 36px -30px rgba(79, 70, 229, 0.22);
}
.dock.open .dock-pane.costs {
    display: flex; /* Override 'block' to enable flex layout */
}

.dock-pane.conflicts {
    display: none;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0) 36%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 28px 56px -32px rgba(15, 23, 42, 0.42), 0 20px 36px -30px rgba(220, 38, 38, 0.18);
}
.conflict-summary {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 16px 18px 18px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.9), rgba(255,255,255,0) 46%),
        linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,244,244,0.94));
    border: 1px solid rgba(248, 113, 113, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 18px 30px -26px rgba(220, 38, 38, 0.22);
}
.conflict-summary::after {
    content: '';
    position: absolute;
    inset: auto -12% -42% auto;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(248, 113, 113, 0.22), rgba(248, 113, 113, 0));
    pointer-events: none;
}
.conflict-summary-count {
    font-family: var(--font-display);
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    color: #991b1b;
}
.conflict-summary-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b91c1c;
}
.conflict-summary-copy {
    position: relative;
    z-index: 1;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-dim);
    max-width: 33ch;
}
.conflict-list {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--chipBorder) transparent;
}
.conflict-group {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
.conflict-group:last-child {
    margin-bottom: 0;
}
.conflict-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px;
}
.conflict-group-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.conflict-group-count {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.conflict-group-stack {
    display: grid;
    gap: 10px;
}
.conflict-entry {
    position: relative;
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 14px;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.9), rgba(255,255,255,0) 44%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
    box-shadow: 0 18px 30px -28px rgba(15, 23, 42, 0.34), 0 10px 16px -20px rgba(148, 163, 184, 0.36);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.conflict-entry::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.9), rgba(249, 115, 22, 0.65));
}
.conflict-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 40px -30px rgba(15, 23, 42, 0.44), 0 18px 24px -28px rgba(220, 38, 38, 0.34);
    border-color: rgba(220, 38, 38, 0.2);
}
.conflict-entry:focus-visible {
    outline: none;
    border-color: rgba(220, 38, 38, 0.3);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14), 0 24px 40px -30px rgba(15, 23, 42, 0.44);
}
.conflict-entry-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
}
.conflict-entry-title-wrap {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.conflict-entry-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.conflict-entry-subtitle {
    font-size: 11px;
    color: var(--ink-dim);
}
.conflict-overlap-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(254,242,242,0.98), rgba(255,237,213,0.95));
    border: 1px solid rgba(248, 113, 113, 0.22);
    color: #b91c1c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.conflict-party {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
}
.conflict-party-marker {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--conflict-tone, #64748b);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--conflict-tone, #64748b) 12%, transparent);
}
.conflict-party[data-tone="flight"] { --conflict-tone: #4f46e5; }
.conflict-party[data-tone="hotel"] { --conflict-tone: #475569; }
.conflict-party[data-tone="transport"] { --conflict-tone: #0f766e; }
.conflict-party[data-tone="attraction"] { --conflict-tone: #b45309; }
.conflict-party[data-tone="food"] { --conflict-tone: #c2410c; }
.conflict-party[data-tone="general"] { --conflict-tone: #64748b; }
.conflict-party-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.conflict-party-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.conflict-party-side {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.conflict-party-tag {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--conflict-tone, #475569);
    background: color-mix(in srgb, var(--conflict-tone, #475569) 12%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--conflict-tone, #475569) 24%, #ffffff);
}
.conflict-party-tag[data-tone="flight"] { --conflict-tone: #4f46e5; }
.conflict-party-tag[data-tone="hotel"] { --conflict-tone: #475569; }
.conflict-party-tag[data-tone="transport"] { --conflict-tone: #0f766e; }
.conflict-party-tag[data-tone="attraction"] { --conflict-tone: #b45309; }
.conflict-party-tag[data-tone="food"] { --conflict-tone: #c2410c; }
.conflict-party-tag[data-tone="general"] { --conflict-tone: #64748b; }
.conflict-party-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    word-break: break-word;
}
.conflict-party-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-dim);
}
.conflict-entry-footer {
    font-size: 11px;
    font-weight: 600;
    color: #b91c1c;
}
.no-conflicts {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 10px 18px;
}
.conflict-empty-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #0f766e;
    background: linear-gradient(180deg, rgba(240,253,250,0.98), rgba(236,253,245,0.96));
    border: 1px solid rgba(16, 185, 129, 0.16);
    box-shadow: 0 20px 34px -26px rgba(16, 185, 129, 0.3);
    margin-bottom: 14px;
}
.conflict-empty-icon svg {
    width: 28px;
    height: 28px;
}
.conflict-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}
.conflict-empty-copy {
    max-width: 28ch;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-dim);
    margin: 0 auto;
}
@media (max-width: 768px) {
    .dock-pane.conflicts {
        gap: 12px;
    }
    .conflict-summary {
        padding: 14px 14px 16px;
        border-radius: 18px;
    }
    .conflict-entry {
        padding: 13px 12px;
        border-radius: 18px;
    }
    .conflict-group-head {
        padding: 0 2px;
    }
}

.color-panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fx-panel-body {
    /* Reset legacy inline display */
    display: block;
    width: 100%;
}

#dockConflicts { display: none; }
#dockConflicts.open { display: block; }

/* --- 5. Headers & Navigation --- */
.pane-head {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--laneGrid);
    flex-shrink: 0;
}

.cost-pane-head {
    padding-bottom: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.dock-pane.colors .pane-head,
.dock-pane.fx .pane-head {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.checklist-header .pane-head {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.pane-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* --- 6. Shared UI Components (Buttons, Inputs) --- */
.ghost,
.hide-btn,
.reset-all-btn,
.add-item-btn,
.add-category-btn,
.add-incidental-btn {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--chipBorder);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: 32px;
    line-height: 30px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.ghost:hover,
.hide-btn:hover,
.add-item-btn:hover,
.add-category-btn:hover,
.add-incidental-btn:hover {
    background: var(--panel2);
    transform: translateY(-1px);
}

.cost-pane-head .hide-btn {
    border-radius: 999px;
    padding: 0 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
    border-color: rgba(203, 213, 225, 0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 12px 22px -20px rgba(15, 23, 42, 0.28);
}

.reset-all-btn {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border-color: var(--warn-border);
}
.reset-all-btn:hover {
    background: #FEE2E2;
}

/* Specific FX Panel Buttons (White Pill Style) */
.fx-action-btn {
    background: #FFFFFF;
    color: var(--ink);
    border: 1px solid var(--chipBorder);
    border-radius: 999px;
    padding: 6px 16px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.fx-action-btn:hover {
    background: #F9FAFB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Global chip style shared across cards and inputs */
.chip {
    font-size: 10px;
    padding: 2px 6px;
    line-height: 1.2;
    border-radius: 6px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--ink);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- 7. Scroll Containers --- */
.checklist-scroll-container,
.packing-scroll-container {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 50vh;
    padding: 8px; /* Increased padding to prevent content clipping */
    margin: 0; /* Reset margins for consistency */
    scrollbar-width: thin;
    scrollbar-color: var(--chipBorder) transparent;
}

/* SURGICAL FIX: Replaced max-height with flex-grow to fill available space */
.cost-content {
    flex: 1 1 auto; /* Grow to fill space between Header and Incidentals */
    min-height: 0; /* Critical for nested flex scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--chipBorder) transparent;
    padding-bottom: 16px; /* Breathing room */
}

@media (max-width: 768px) {
    .checklist-scroll-container,
    .packing-scroll-container {
        max-height: calc(85vh - 120px); /* Adjusted for mobile view */
        padding: 12px; /* Increased padding for better spacing */
    }
}

/* --- 8. Checklist & Packing Lists (Core Logic & Styling) --- */
.checklist-section h3 {
    margin: 0 0 12px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Restyled Category Block (Card Style) */
.category-block {
    background: #F4F4F5; /* Matches 'panel2' or grey reference */
    border: 1px solid var(--laneGrid);
    border-radius: 16px; /* Rounded corners like reference */
    padding: 16px;
    margin-bottom: 16px;
}

.category-header, .packing-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none; /* Cleaner header */
}

.category-header h4, .packing-category-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    flex: 1;
}

.category-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.del-cat-btn, .header-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}
.del-cat-btn:hover {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border-color: var(--warn-border);
}
.header-add-btn:hover {
    background: #fff;
    color: var(--primary-bg);
    box-shadow: var(--shadow-sm);
}

/* Packing Edit Mode Add Row */
.packing-add, .checklist-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.packing-add input, .checklist-add input {
    flex: 1;
    background: #fff;
    border: 1px solid var(--inputBorder);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 13px;
    font-family: var(--font-body);
}
.packing-add button, .checklist-add button {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--chipBorder);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.packing-mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--panel2);
    padding: 3px;
    border-radius: 8px;
}
.packing-mode-toggle button {
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.packing-mode-toggle button.active {
    background: #fff;
    color: var(--primary-bg);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}
.packing-mode-toggle svg { width: 16px; height: 16px; }

.packing-empty-state {
    text-align: center;
    padding: 32px 12px;
    color: var(--ink-dim);
    font-size: 14px;
    background: var(--panel2);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--chipBorder);
}

/* Packing Event (Accordion) - Uplifted */
.packing-event {
    margin-bottom: 12px;
    border: 1px solid var(--laneGrid);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}
.packing-event:hover { box-shadow: var(--shadow-md); }

.packing-event summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    gap: 12px;
    background: #F9FAFB; /* Lighter grey for header */
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.packing-event[open] summary {
    border-bottom-color: var(--laneGrid);
    background: #F3F4F6;
}
.packing-event summary::-webkit-details-marker { display: none; }

/* Styled Toggle Arrow */
.packing-event-toggle {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    color: var(--ink-dim);
}
.packing-event-toggle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
}
.packing-event[open] > summary .packing-event-toggle {
    transform: rotate(180deg);
    background: var(--primary-bg);
    color: #fff;
}
.packing-event[open] > summary .packing-event-toggle::before {
    transform: rotate(45deg) translate(-1px, -1px);
}

.packing-event-title { 
    flex: 1; 
    color: var(--ink); 
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.packing-event-date { 
    color: var(--ink-dim); 
    font-size: 11px; 
    font-weight: 500; 
    background: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--chipBorder);
}

.packing-category-block-pack,
.packing-category-block-edit {
    padding: 16px;
}
.packing-category-block-pack:not(:last-child) {
    border-bottom: 1px solid var(--laneGrid);
}

/* Edit Mode Blocks */
.packing-category-block-edit {
    background: var(--panel2);
    margin-bottom: 12px;
    border: 1px solid var(--laneGrid);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.packing-category-block-pack h4 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.cat-icon { font-size: 14px; }

/* Unified List Styling */
.packing-list,
.checklist-list,
.packing-list-edit {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px; 
}

/* Universal White Card List Items */
.packing-list li,
.checklist-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: #FFFFFF;
    border: 1px solid var(--laneGrid);
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* Hover Effect for Items */
.packing-list li:hover,
.checklist-list li:hover {
    border-color: var(--inputBorder);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* Checked State */
.packing-list li.done,
.checklist-list li.done {
    background: #FAFAFA;
    opacity: 0.7;
    box-shadow: none;
}
.packing-list li.done label,
.checklist-list li.done label {
    text-decoration: line-through;
    color: var(--ink-dim);
}

/* Edit Mode Items (Simpler Look) */
.packing-list-edit li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    border: 1px solid var(--laneGrid);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.item-text { flex: 1; cursor: text; font-family: var(--font-body); font-weight: 500; }
.item-controls { display: flex; gap: 4px; align-items: center; }

.quantity-btn {
    background: var(--panel2);
    color: var(--ink);
    border: 1px solid var(--chipBorder);
    border-radius: 6px;
    padding: 0;
    width: 24px; height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.quantity-btn:hover { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.quantity-val {
    font-size: 12px; color: var(--ink); min-width: 24px; text-align: center; font-weight: 600;
}

.packing-list input[type="checkbox"],
.checklist-list input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--primary-bg);
    flex-shrink: 0;
    border-radius: 4px;
}
.packing-list label,
.checklist-list label {
    flex: 1; margin: 0; cursor: pointer; font-weight: 500; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.quantity { color: var(--ink-dim); font-weight: 400; font-size: 12px; margin-left: 4px; }

.checklist-edit-btn {
    flex-shrink: 0;
    border: 1px solid var(--chipBorder);
    background: var(--panel2);
    color: var(--ink-dim);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    opacity: 0.72;
    transition: all 0.15s ease;
}
.checklist-edit-btn:hover,
.checklist-edit-btn:focus-visible {
    opacity: 1;
    color: var(--ink);
    background: #fff;
    border-color: var(--inputBorder);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.checklist-inline-edit-input {
    display: block;
}

.checklist-indicator-wrap { flex-shrink: 0; margin-left: 4px; display: flex; gap: 4px; }
.checklist-list li .more-btn, .itinerary-task-content .more-btn {
    flex-shrink: 0; margin-left: auto; padding: 4px; line-height: 1; 
    font-weight: bold; font-size: 14px; background: transparent; border: 1px solid transparent; 
    border-radius: 4px; cursor: pointer; color: var(--ink-dim); opacity: 0.5;
    transition: all 0.15s ease;
}
.checklist-list li .more-btn:hover, .itinerary-task-content .more-btn:hover { 
    opacity: 1; color: var(--ink); background: rgba(0,0,0,0.05);
}

.del-btn, .del-item-btn {
    background: transparent; border: none; color: var(--ink-dim); cursor: pointer; 
    padding: 4px; border-radius: 4px; display: flex; align-items: center; 
    justify-content: center; font-size: 16px; opacity: 0.6; transition: all 0.2s ease;
}
.del-btn:hover, .del-item-btn:hover {
    background: var(--warn-bg); color: var(--warn-ink); opacity: 1;
}

/* Restyled Itinerary Task Items (Card with Header) */
.itinerary-task-item {
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 8px; 
    padding: 12px;
    background: #fff; 
    border-radius: 12px; 
    border: 1px solid var(--laneGrid); 
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.itinerary-task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--inputBorder);
}
.itinerary-task-item.highlighted { 
    animation: highlight-fade 2s ease-out forwards; 
    border-color: var(--primary-bg); 
}
@keyframes highlight-fade { from { background-color: #EEF2FF; } to { background-color: #fff; } }

.itinerary-task-context { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    width: 100%; 
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--laneGrid);
}
.itinerary-task-content { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%; 
    padding-left: 0; 
    padding-top: 4px;
}
.itinerary-task-content label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    flex: 1;
}
.itinerary-task-content.done label {
    text-decoration: line-through;
    color: var(--ink-dim);
}

.context-link { 
    font-size: 13px; 
    color: var(--ink); 
    text-decoration: none; 
    font-weight: 600; 
    flex: 1; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.context-subtype {
    font-size: 10px; 
    background-color: var(--panel2); 
    color: var(--ink-dim);
    padding: 2px 8px; 
    border-radius: 6px; 
    text-transform: uppercase; 
    white-space: nowrap; 
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid var(--chipBorder);
}

/* --- 9. Incidentals Grid --- */
/* SURGICAL FIX: Added padding-bottom to create visible gap from panel edge */
.incidentals-container {
    border-top: 1px solid var(--laneGrid); 
    margin-top: 16px; 
    padding-top: 16px;
    padding-bottom: 12px; /* Visual gap restoration */
    flex-shrink: 0;
}
.incidentals-head-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.incidentals-head { font-size: 13px; font-weight: 600; margin: 0; color: var(--ink); }
.incidentals-list {
    display: flex; flex-direction: column; 
    gap: 4px; 
    max-height: 200px; 
    overflow-y: auto; 
    overflow-x: hidden; 
    padding-right: 4px;
}
.incidental-item {
    display: grid;
    /* FIX: Widen currency field (3rd col) from 55px to 70px. Slightly reduce spacer. */
    grid-template-columns: 35% 65px 70px 24px 24px 1fr; 
    gap: 6px; 
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.incidental-item input, .incidental-item select {
    font-family: var(--font-body); 
    font-size: 12px; 
    height: 28px;
    border: 1px solid var(--inputBorder); 
    border-radius: var(--radius-sm);
    background-color: var(--panel2); 
    padding: 2px 6px; 
    color: var(--ink);
    width: 100%;
    min-width: 0; 
}

.incidental-item .incidental-desc {
    width: 100% !important;
}

/* Legacy Chip styles removed. Now exclusively using .iconbtn or .doc-item */

.incidental-doc-btn .badge {
    position: absolute; top: -4px; right: -4px; min-width: 14px; height: 14px;
    line-height: 14px; font-size: 9px; border: 2px solid #fff;
    background-color: var(--primary-bg); color: white; font-weight: 600;
    padding: 0 3px; border-radius: 999px;
}

/* Make incidental doc button match the small circular card iconbtn */
.incidental-item .incidental-doc-btn.iconbtn {
    -webkit-appearance: none; appearance: none; display: inline-flex;
    align-items: center; justify-content: center; width: 20px; height: 20px;
    padding: 0; margin: 0 2px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.5);
    color: var(--ink); cursor: pointer; flex-shrink: 0; transition: all 0.15s ease;
    position: relative;
}
.incidental-item .incidental-doc-btn.iconbtn svg,
.incidental-item .incidental-doc-btn.iconbtn img { width: 12px; height: 12px; }

/* Redesigned Delete Chip to match card delete button */
.incidental-item .incidental-del {
    width: 20px; height: 20px; 
    border-radius: 50%;
    background: var(--panel); 
    border: 1px solid var(--chipBorder);
    color: var(--ink-dim); 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; padding: 0;
    font-size: 14px; line-height: 1;
}
.incidental-item .incidental-del:hover {
    background: var(--warn-bg); 
    color: var(--warn-ink); 
    border-color: var(--warn-border);
    transform: scale(1.1);
}

/* --- 10. Cost Matrix --- */
.matrix-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.cost-matrix { border-collapse: collapse; width: 100%; font-size: 12px; color: var(--ink); }
.cost-matrix th, .cost-matrix td {
    padding: 12px 4px; 
    text-align: right; 
    border-bottom: 1px solid var(--laneGrid); 
    white-space: nowrap;
}
.cost-matrix th {
    font-family: var(--font-display); font-weight: 600; background: #fff;
    position: sticky; top: 0; z-index: 10; color: var(--ink-dim);
}
.cost-matrix tbody th, .cost-matrix tfoot th {
    text-align: left; position: sticky; left: 0; background: #fff; z-index: 5;
    color: var(--ink); font-weight: 600; border-right: 1px solid var(--laneGrid);
    box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}
.cost-matrix tfoot { border-top: 2px solid var(--laneGrid); background: var(--panel2); }
.cost-matrix tfoot td, .cost-matrix tfoot th { font-weight: 700; color: var(--primary-bg); background: var(--panel2); }
.cost-inline,
.cost-inline-single {
    white-space: nowrap;
}
.cost-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.cost-inline .cost-foreign {
    color: #0f766e;
    font-weight: 700;
}
.cost-inline .cost-base {
    color: rgba(0,0,0,0.6);
    font-size: 11px;
    font-weight: 500;
}
.cost-inline-single {
    color: var(--ink);
    font-weight: 600;
}
.cost-foreign-only {
    color: #0f766e;
    font-weight: 700;
}

.daily-budget-cell,
.matrix-actual-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-width: 132px;
}
.matrix-budget-input-group {
    display: grid;
    grid-template-columns: 36px 78px;
    align-items: center;
    justify-content: end;
    column-gap: 8px;
    width: 100%;
}
.matrix-budget-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.56);
    white-space: nowrap;
    width: 36px;
    min-width: 36px;
    text-align: center;
}
.matrix-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--inputBorder);
    border-radius: 8px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    margin-left: 0;
}
.matrix-currency-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--panel2);
    color: var(--ink-dim);
    border: 1px solid var(--inputBorder);
    border-radius: 999px;
    padding: 3px 0;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 36px;
    min-width: 36px;
    text-align: center;
}
.matrix-static-currency-label {
    cursor: default;
}
.matrix-static-currency-label-empty {
    visibility: hidden;
}
.matrix-cell-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    padding: 5px 8px;
    font-size: 12px;
    color: var(--ink);
}
.matrix-budget-convert-row {
    display: grid;
    grid-template-columns: 36px 78px;
    align-items: center;
    justify-content: end;
    column-gap: 8px;
    width: 100%;
    min-height: 18px;
}
.matrix-budget-base,
.matrix-money-value {
    min-height: 12px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.58);
    white-space: nowrap;
    text-align: right;
}
.matrix-budget-base .cost-inline,
.matrix-budget-base .cost-inline-single,
.matrix-money-value .cost-inline,
.matrix-money-value .cost-inline-single {
    justify-content: flex-end;
}
.matrix-money-empty {
    color: rgba(15, 23, 42, 0.58);
    font-weight: 600;
}

/* --- 11. Summary Totals & Log --- */
.summary-toggle {
    display: flex;
    background: linear-gradient(180deg, rgba(241,245,249,0.96), rgba(248,250,252,0.9));
    border-radius: 999px;
    padding: 4px;
    margin: 8px 0 12px;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.summary-toggle button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-dim);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.summary-toggle button.active {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.9));
    color: var(--primary-bg);
    box-shadow: 0 12px 18px -16px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255,255,255,0.96);
    font-weight: 700;
}
.cost-summary-meter-wrap {
    padding: 0 2px;
    margin-bottom: 12px;
}
.cost-budget-meter {
    padding: 10px 14px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.9));
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
}
.cost-budget-meter-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.summary-total-container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    text-align: center;
    gap: 18px;
    margin: 0 0 18px;
    padding: 20px 18px;
    background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.9));
    border-radius: 22px;
    border: 1px solid rgba(203, 213, 225, 0.7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 24px 36px -32px rgba(15, 23, 42, 0.3);
}
.summary-total {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.summary-total div:first-child {
    font-family: var(--font-display); font-size: 11px; color: var(--ink-dim);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0;
}
.summary-total div:last-child {
    font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink);
    letter-spacing: -0.03em;
}
.summary-total.projected div:last-child { color: var(--ink-dim); }

.cost-accordion { border: none; display: flex; flex-direction: column; gap: 10px; }
.cost-accordion .accordion-item {
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.68);
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.86));
    box-shadow: 0 18px 24px -28px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}
.cost-accordion .accordion-item summary {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 12px;
    font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 1px solid transparent;
    color: var(--ink);
}
.cost-accordion .accordion-item[open] summary {
    border-bottom-color: rgba(226, 232, 240, 0.92);
}

.cost-summary-label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.cost-summary-label-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cost-summary-amount {
    font-weight: 700;
    flex-shrink: 0;
    padding-left: 8px;
}

.cost-category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cost-accent) 24%, rgba(15,23,42,0.1));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cost-surface) 180%, #ffffff) 0%, rgba(255,255,255,0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.94), 0 12px 20px -22px var(--cost-glow, rgba(15,23,42,0.18));
    vertical-align: middle;
    flex-shrink: 0;
}

.cost-category-pill-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cost-accent, var(--primary-bg));
}
.cost-accordion .accordion-item .sub-list {
    padding: 8px 16px 12px; background: rgba(248,250,252,0.82); border-bottom: 1px solid transparent;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.cost-accordion .accordion-item .sub-item {
    display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-dim); padding: 4px 0;
}

.cost-summary-content {
    padding-right: 4px;
}

.cost-log-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cost-log-view .log-day-group { margin-bottom: 0; }
.cost-log-card {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.68);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.84));
    box-shadow: 0 20px 28px -30px rgba(15, 23, 42, 0.28);
}
.cost-log-view .log-day-header {
    font-size: 13px; font-weight: 700; color: var(--ink); padding-bottom: 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92); margin-bottom: 10px; display: flex; justify-content: space-between;
}
.cost-log-view .log-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: 13px;
    min-width: 0;
    transition: background 0.2s ease;
}
.cost-log-view .log-item:hover { background: rgba(241,245,249,0.88); }
.cost-log-view .log-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}
.cost-log-view .log-item-main .cost-category-pill {
    flex: 0 0 auto;
}
.cost-log-view .log-item-title {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}
.cost-log-view .log-item-cost {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    white-space: nowrap;
    font-weight: 700;
    color: var(--ink);
}
.cost-log-view .log-item-cost .cost-inline,
.cost-log-view .log-item-cost .cost-inline-single {
    justify-content: flex-end;
}
.log-item-del {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(248, 113, 113, 0.26);
    color: var(--warn-ink);
    cursor: pointer;
    opacity: 1;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.log-item:hover .log-item-del,
.log-item-del:focus-visible { opacity: 1; }
.log-item-del:hover,
.log-item-del:focus-visible { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-border); transform: translateY(-1px) scale(1.04); box-shadow: 0 4px 10px rgba(248, 113, 113, 0.16); }

/* --- 14. FX & Colors Panels Redesign --- */
.swatch-grid {
    display: grid;
    /* FIX: 4-Column layout for breadth */
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 4px;
}
.sw {
    width: 100% !important;
    /* FIX: Taller, softer swatches */
    height: 44px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sw:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sw.active {
    box-shadow: 0 0 0 2px var(--primary-bg), var(--shadow-sm);
    transform: scale(1.05);
}

/* COLOR PANEL FIX: Make swatches look like mini cards with gradient */
.sw {
    background: linear-gradient(180deg, var(--sw-color), #ffffff); /* Approximation of shade */
    position: relative;
    overflow: hidden;
    border-left: 3px solid var(--sw-color) !important;
}

/* FX Chips as Cards */
.fx-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.fx-card {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #E4E4E7; /* Subtle border color */
    border-radius: 12px; /* Rounded corners like reference */
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.fx-card:hover {
    border-color: var(--primary-bg);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.fx-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fx-code {
    font-family: var(--font-display);
    font-weight: 600; /* Bold */
    font-size: 13px;
    color: var(--ink);
}

.fx-rate {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 12px;
    color: var(--ink-dim);
}

/* Hover-only Delete Button */
.fx-card-del {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--warn-border);
    color: var(--warn-ink);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.fx-card:hover .fx-card-del {
    opacity: 1;
}

.fx-card-del:hover {
    background: var(--warn-bg);
    transform: scale(1.1);
}

/* Ghost card — inline add currency */
.fx-card-ghost {
    border: 1px dashed color-mix(in srgb, var(--inputBorder) 80%, transparent);
    background: transparent;
    opacity: 0.65;
    cursor: pointer;
    min-height: 80px;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}
.fx-card-ghost:hover {
    border-color: var(--primary-bg);
    opacity: 1;
}
.fx-card-ghost.fx-card-ghost--open {
    border-color: var(--primary-bg);
    opacity: 1;
    cursor: default;
    min-height: auto;
    padding: 12px;
}
.fx-ghost-collapsed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    pointer-events: none;
}
.fx-card-ghost--open .fx-ghost-collapsed {
    display: none;
}
.fx-ghost-plus {
    font-size: 22px;
    line-height: 1;
    color: var(--ink-dim);
}
.fx-ghost-label {
    font-size: 11px;
    color: var(--ink-dim);
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}
.fx-ghost-expanded {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.fx-card-ghost--open .fx-ghost-expanded {
    display: flex;
}

/* Inline select / rate input (ghost + existing card edit) */
.fx-inline-sel,
.fx-inline-rate {
    background: var(--panel2);
    color: var(--ink);
    border: 1px solid var(--inputBorder);
    border-radius: var(--radius-sm);
    padding: 5px 7px;
    font-family: var(--font-body);
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}
.fx-inline-sel:focus,
.fx-inline-rate:focus {
    border-color: var(--primary-bg);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
    background: #fff;
}

/* Inline action row (shared by ghost and existing card edit) */
.fx-inline-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* Existing card inline edit mode */
.fx-card-editing {
    cursor: default;
    padding: 12px;
}
.fx-card-editing .fx-card-content {
    display: none;
}
.fx-card-editing .fx-card-del {
    display: none;
}
.fx-inline-edit {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.fx-card-editing .fx-inline-edit {
    display: flex;
}
.fx-edit-code {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    text-align: center;
    display: block;
    margin-bottom: 2px;
}

#fxPopover {
    position: fixed; right: 24px; bottom: calc(88px + 24px); z-index: 61;
}

/* --- 15. Drag & Drop Visuals --- */
.checklist-list li.dragging,
.packing-list-edit li.dragging {
    opacity: 0.5; background: var(--panel2); border: 1px dashed var(--ink-dim); transform: scale(0.98);
}
.checklist-list li.drag-over,
.packing-list-edit li.drag-over {
    border-top: 2px solid var(--primary-bg); transform: translateY(4px);
}
.drag-grip {
    cursor: grab; color: var(--inputBorder); font-size: 14px; margin-right: 6px;
    display: flex; align-items: center;
}
.drag-grip:hover { color: var(--ink-dim); }
.drag-grip:active { cursor: grabbing; }

/* --- 16. Popovers & Document Lists --- */
.docs-popover {
    /* FIX: Added position: fixed to enable z-index and viewport positioning */
    position: fixed; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5); 
    box-shadow: var(--shadow-lg); 
    border-radius: 12px; 
    padding: 8px;
    /* FIX: Ensure high z-index to show above dock panels (52) and FAB (60) */
    z-index: 3000; 
    min-width: 200px;
}

.modal-docs-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-docs-stack .doc-list {
    max-height: 150px;
    overflow-y: auto;
}

.modal-docs-stack .btn {
    width: 100%;
}
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--laneGrid);
    cursor: pointer;
    transition: all 0.15s ease;
}

.doc-item:hover {
    background: var(--panel2);
    border-color: var(--inputBorder);
    transform: translateX(2px);
}

.doc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--ink-dim);
    line-height: 0;
    font-size: 16px;
}

.doc-icon svg {
    display: block;
}

.doc-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action button in doc item (Delete or Download) */
.doc-action {
    color: var(--ink-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.doc-item:hover .doc-action {
    opacity: 1;
}

.doc-action:hover {
    background: rgba(0,0,0,0.05);
    color: var(--ink);
}

.doc-action.delete:hover {
    background: var(--warn-bg);
    color: var(--warn-ink);
}

/* --- 17. Budget Meter --- */
.progress-bar-container {
    background-color: var(--panel2);
    height: 6px;
    border-radius: 999px;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
}
.progress-bar-inner {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
}
.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- 18. Mobile Refinements --- */
@media (max-width: 768px) {
    .dock-checklist, .dock-costs, .dock-conflicts, .dock-colors, .dock-fx, .dock-luggage, .dock-packing {
        left: 0; right: 0; width: 100%;
        /* REMOVED bottom: 0 override here, relying on the specific calculation below */
    }
    .dock:not(.dock-fab) .dock-pane {
        width: 100%; max-width: 100%; min-width: 100%; height: 85vh; max-height: 85vh;
        bottom: calc(88px + 3px); /* 3px above FAB panel */
        
        /* FIX: Restored full rounded corners for floating card look */
        border-radius: 24px; 
        
        box-shadow: 0 -10px 40px rgba(0,0,0,0.1); padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    /* Bottom sheet handle */
    .dock:not(.dock-fab) .dock-pane::before {
        content: ''; display: block; width: 40px; height: 4px; background: var(--inputBorder);
        border-radius: 99px; margin: -8px auto 12px auto;
    }
    
    .cost-pane-head {
        padding-bottom: 12px;
        margin-bottom: 8px;
    }
    .dock-pane.costs .cost-content { padding-bottom: 80px; }
    .summary-total-container {
        gap: 12px;
        padding: 16px 14px;
        border-radius: 18px;
    }
    .summary-total div:last-child {
        font-size: 22px;
    }
    .cost-budget-meter {
        padding: 9px 12px 11px;
    }
    .cost-log-card {
        padding: 10px 12px;
        border-radius: 16px;
    }
    .cost-log-view .log-item {
        grid-template-columns: minmax(0, 1fr) auto 18px;
        gap: 8px;
        padding: 6px 2px;
    }
    .cost-log-view .log-item-main {
        gap: 8px;
    }
    .cost-log-view .log-item-title {
        font-size: 12px;
    }
    .cost-category-pill {
        padding: 2px 7px;
    }
    .add-spend-panel {
        max-width: min(352px, calc(100vw - 24px));
        max-height: calc(100vh - 32px);
        padding: 14px;
        gap: 8px;
    }
    .add-spend-panel .spend-display-wrap {
        padding: 10px 12px 12px;
        border-radius: 16px;
    }
    .spend-display-amount {
        font-size: 32px;
    }
    .add-spend-panel .spend-category-wrap {
        gap: 6px;
    }
    .spend-category-btn {
        height: 32px;
        padding: 0 10px;
    }
    .spend-category-pill-text {
        font-size: 10px;
    }
    .spend-keypad-btn {
        height: 42px;
        font-size: 18px;
    }
    .spend-cancel-btn,
    .spend-add-btn {
        height: 42px;
    }
    .cost-category-pill-label {
        font-size: 7px;
        letter-spacing: 0.06em;
    }
    /* FIX: Maintain new strict grid on mobile */
    .incidental-item { grid-template-columns: 35% 65px 70px 24px 24px 1fr; gap: 4px; }
    
    .fx-chips {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* --- 19. Spend & Cost Detail Modals --- */
/* UPDATED: New Card-Based Styles for Daily Costs */

.spend-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4); /* Slightly darker backdrop */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.spend-panel {
    background: var(--panel);
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
    max-height: min(720px, calc(100vh - 64px));
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

.spend-panel h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    text-align: center;
    color: var(--ink);
    font-weight: 700;
}

.add-spend-panel {
    max-width: 352px;
    max-height: calc(100vh - 40px);
    padding: 16px;
    gap: 10px;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0) 36%),
        linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,250,252,0.97));
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 28px 56px -32px rgba(15, 23, 42, 0.36), 0 16px 28px -24px rgba(79, 70, 229, 0.18);
}

.day-cost-detail-panel {
    max-width: 428px;
}

.add-spend-panel h3 {
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.add-spend-panel .spend-display-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(241,245,249,0.88));
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.94);
}

.spend-currency-btn {
    height: 24px;
    padding: 0 12px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: var(--ink-dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.spend-display-amount {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.04em;
}

.add-spend-panel .spend-category-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 4px;
}

.add-spend-panel .spend-note-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 13px;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    background: rgba(248,250,252,0.88);
    color: var(--ink);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.add-spend-panel .spend-note-input:focus {
    outline: none;
    background: #fff;
    border-color: rgba(79, 70, 229, 0.26);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.add-spend-panel .spend-keypad-wrap {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.spend-keypad-btn {
    height: 44px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.9));
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 12px 24px -24px rgba(15, 23, 42, 0.24);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.spend-keypad-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 16px 28px -24px rgba(15, 23, 42, 0.32);
}

.spend-keypad-btn:active {
    transform: scale(0.97);
}

.spend-keypad-btn.is-delete {
    color: var(--warn-ink);
    background: linear-gradient(180deg, rgba(255,245,245,0.98), rgba(254,226,226,0.92));
    border-color: #fecaca;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.add-spend-panel .spend-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    gap: 10px;
    margin-top: 2px;
}

.spend-cancel-btn {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.9));
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}


.spending-intro {
    margin: 0;
}

.spend-category-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cost-accent) 24%, rgba(15,23,42,0.1));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cost-surface) 180%, #ffffff) 0%, rgba(255,255,255,0.97) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 12px 20px -22px var(--cost-glow, rgba(15,23,42,0.18));
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    text-align: center;
}

.spend-category-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 14px 22px -20px var(--cost-glow, rgba(15,23,42,0.2));
}

.spend-category-btn.is-active {
    border-color: color-mix(in srgb, var(--cost-accent) 68%, rgba(79, 70, 229, 0.22));
    background: linear-gradient(135deg, color-mix(in srgb, var(--cost-surface) 340%, #ffffff) 0%, color-mix(in srgb, var(--cost-surface) 220%, #ffffff) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cost-accent) 22%, rgba(255,255,255,0.8)), 0 16px 26px -18px var(--cost-glow, rgba(79, 70, 229, 0.24));
    transform: translateY(-1px);
}

.spend-category-btn.is-active .spend-category-pill-text {
    color: color-mix(in srgb, var(--cost-accent) 90%, #0f172a);
}

.spend-category-pill-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cost-accent, var(--primary-bg));
}

.spend-category-copy,
.spend-category-title,
.spend-category-caption {
    display: none;
}

/* HERO TOTAL DISPLAY */
.cost-detail-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.cost-detail-total-amount {
    font-family: var(--font-display);
    font-size: 48px; /* Huge hero font */
    font-weight: 800;
    color: var(--primary-bg); /* Brand color for total */
    line-height: 1;
    letter-spacing: -0.04em;
}

.cost-detail-total-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 8px;
}

/* CATEGORY GROUPS (Card Style) */
.cost-detail-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 40vh; /* Limit height for scrolling */
    overflow-y: auto;
    padding-right: 4px;
}

.cost-detail-category-group {
    background: var(--panel2);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid var(--laneGrid);
}

.cost-detail-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cost-detail-cat-icon { font-size: 18px; }
.cost-detail-cat-name { font-weight: 700; font-size: 14px; flex: 1; color: var(--ink); }
.cost-detail-cat-amount { font-weight: 700; font-size: 14px; color: var(--ink); }

.cost-detail-transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* INDIVIDUAL ITEMS (Clean Rows) */
.cost-detail-transaction-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 8px;
    font-size: 13px;
    color: var(--ink);
    padding: 5px 0;
}

.cost-detail-transaction-item.is-editable {
    cursor: default;
}

.cost-detail-transaction-item.is-editable:hover {
    background: rgba(241,245,249,0.88);
    border-radius: 12px;
}

.cost-detail-tx-desc {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
    margin-right: 0;
    font-weight: 500;
}

.cost-detail-tx-desc .cost-category-pill {
    flex-shrink: 0;
}

.cost-detail-transaction-item.is-editable .cost-detail-tx-desc,
.cost-detail-transaction-item.is-editable .cost-detail-tx-amount {
    cursor: pointer;
}

.cost-detail-tx-text {
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.28;
}


.cost-detail-tx-amount {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ink-dim);
    gap: 4px;
    padding-top: 1px;
}

.cost-detail-tx-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-top: 1px;
}

.cost-detail-tx-amount-base {
    color: rgba(0,0,0,0.6);
}

.cost-detail-tx-amount-local {
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
}

/* Delete Button (Hover Reveal) */
.cost-detail-tx-del {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--ink-dim);
    cursor: pointer;
    font-size: 16px;
    margin-left: 0;
    padding: 0;
    border-radius: 999px;
    opacity: 0.45;
    transition: all 0.2s ease;
}

.cost-detail-tx-del:hover {
    opacity: 1;
    background: var(--warn-bg);
    color: var(--warn-ink);
}

.spend-footer {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

/* Primary Action Button (Close) */
.spend-add-btn {
    background: var(--primary-bg);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: transform 0.1s;
}
.spend-add-btn:active { transform: scale(0.98); }

/* Close Icon (Top Right) */
.panel-close-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel2);
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink-dim);
    transition: background 0.2s;
}
.panel-close-icon:hover {
    background: #e5e7eb;
    color: var(--ink);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }




/* --- Palette Panel Theme Studio Redesign --- */
.dock-pane.colors .color-panel-body {
    gap: 18px;
}

.color-panel-intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--laneGrid);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,245,240,0.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.color-panel-eyebrow,
.color-family-label,
.color-target-label {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-dim);
}

.color-panel-copy,
.color-library-copy,
.color-target-help,
.color-preview-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-dim);
}

.color-studio {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.color-control-shell,
.color-library {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--laneGrid);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,243,238,0.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.color-target-field,
.color-preview-meta,
.color-library-head,
.color-family-section {
    display: flex;
    flex-direction: column;
}

.color-target-field {
    gap: 6px;
}

.color-target-select-wrap {
    position: relative;
}

.color-target-select-wrap::after {
    content: 'v';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-52%);
    font-size: 11px;
    color: var(--ink-dim);
    pointer-events: none;
}

.color-target-select {
    appearance: none;
    width: 100%;
    height: 42px;
    padding: 0 38px 0 14px;
    border-radius: 14px;
    border: 1px solid var(--inputBorder);
    background: linear-gradient(180deg, #FFFFFF, var(--panel));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    outline: none;
}

.color-target-select:focus {
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.color-preview-card {
    --preview-top: #F7F4EF;
    --preview-bottom: #FFFFFF;
    --preview-border: #D6CDC1;
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(115, 126, 145, 0.16);
    background: linear-gradient(180deg, var(--preview-top), var(--preview-bottom));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.color-preview-chip {
    --preview-chip: #FFFFFF;
    width: 44px;
    min-width: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.74);
    background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0)), var(--preview-chip);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.color-preview-meta {
    gap: 3px;
    min-width: 0;
}

.color-preview-kicker {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-weight: 700;
}

.color-preview-target {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.color-preview-hex {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 2px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(115, 126, 145, 0.14);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-dim);
}

.color-library {
    gap: 14px;
}

.color-library-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.color-family-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.color-family-section {
    gap: 8px;
}

.color-family-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.palette-swatch {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(115, 126, 145, 0.18);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.palette-swatch:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, 0.18);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.08);
}

.palette-swatch.active {
    border-color: var(--primary-bg);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.14), 0 14px 24px rgba(15, 23, 42, 0.1);
}

.palette-swatch-sample {
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.74);
    border-left: 4px solid var(--sw-border);
    background: linear-gradient(180deg, var(--sw-top), var(--sw-bottom));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.palette-swatch-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.palette-swatch-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette-swatch-hex {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

@media (max-width: 560px) {
    .color-family-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Palette Panel Overflow Alignment Fix --- */
.dock-pane.colors {
    overflow: hidden;
}

.dock-pane.colors .color-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--chipBorder) transparent;
}

.dock-pane.colors .color-studio {
    padding-bottom: 4px;
}

@media (max-width: 768px) {
    .dock-pane.colors .color-panel-body {
        padding-right: 0;
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 12px);
    }
}

/* --- Premium FX + Checklist Uplift --- */
.dock-pane.fx .pane-head,
.dock-pane.checklist .pane-head {
    margin-bottom: 12px;
}

.dock-pane.fx .fx-panel-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dock-pane.fx .fx-summary {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) auto;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 244, 245, 0.88));
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 20px 40px -30px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    isolation: isolate;
}

.dock-pane.fx .fx-summary::before,
.dock-pane.checklist .checklist-summary::before {
    content: '';
    position: absolute;
    inset: -40% auto auto 65%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.16), transparent 68%);
    pointer-events: none;
    z-index: -1;
}

.dock-pane.fx .fx-summary-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dock-pane.fx .fx-summary-kicker,
.dock-pane.checklist .checklist-summary-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.dock-pane.fx .fx-summary-base {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    color: var(--ink);
}

.dock-pane.fx .fx-summary-caption,
.dock-pane.checklist .checklist-summary-caption {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-dim);
    max-width: 36ch;
}

.dock-pane.fx .fx-summary-stats {
    display: grid;
    grid-auto-flow: column;
    gap: 10px;
    align-self: end;
}

.dock-pane.fx .fx-summary-stat,
.dock-pane.checklist .checklist-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 78px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dock-pane.fx .fx-summary-stat-label,
.dock-pane.checklist .checklist-summary-stat span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.dock-pane.fx .fx-summary-stat-value,
.dock-pane.checklist .checklist-summary-stat strong {
    font-size: 15px;
    line-height: 1.1;
    color: var(--ink);
}

.dock-pane.fx .fx-action-btn {
    border-radius: 999px;
    padding: 0 14px;
    height: 34px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.45);
}

.dock-pane.fx .fx-action-btn-primary {
    background: linear-gradient(135deg, #111827, #374151);
    color: #ffffff;
    border-color: rgba(17, 24, 39, 0.9);
}

.dock-pane.fx .fx-action-btn-primary:hover {
    background: linear-gradient(135deg, #0f172a, #1f2937);
    color: #ffffff;
}

.dock-pane.fx .fx-action-btn-secondary {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(203, 213, 225, 0.72);
}

.dock-pane.fx .fx-chips {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 14px;
}

.dock-pane.fx .fx-card {
    position: relative;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 114px;
    padding: 18px 14px 14px;
    text-align: left;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(203, 213, 225, 0.78);
    box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.45);
    overflow: hidden;
}

.dock-pane.fx .fx-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #111827, #4f46e5 70%, #a5b4fc);
    opacity: 0.9;
}

.dock-pane.fx .fx-card:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, 0.32);
    box-shadow: 0 24px 40px -30px rgba(79, 70, 229, 0.42);
}

.dock-pane.fx .fx-card-content {
    align-items: flex-start;
    gap: 6px;
}

.dock-pane.fx .fx-code {
    font-size: 15px;
    letter-spacing: 0.08em;
}

.dock-pane.fx .fx-rate {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}

.dock-pane.fx .fx-card-caption {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.dock-pane.fx .fx-card-del {
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(248, 113, 113, 0.34);
    box-shadow: 0 10px 18px -16px rgba(239, 68, 68, 0.7);
}

.dock-pane.fx .fx-empty-state,
.dock-pane.checklist .checklist-empty-state {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 244, 245, 0.88));
    color: var(--ink-dim);
}

.dock-pane.fx .fx-empty-state {
    grid-column: 1 / -1;
}

.dock-pane.fx .fx-empty-state strong,
.dock-pane.checklist .checklist-empty-state strong {
    color: var(--ink);
    font-size: 14px;
}

.dock-pane.checklist .checklist-summary {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(244, 244, 245, 0.9));
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.46);
    overflow: hidden;
    isolation: isolate;
}

.dock-pane.checklist .checklist-summary-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.dock-pane.checklist .checklist-summary-title {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    color: var(--ink);
}

.dock-pane.checklist .checklist-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.dock-pane.checklist .checklist-summary-progress {
    height: 10px;
    margin-top: 4px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.85);
    overflow: hidden;
}

.dock-pane.checklist .checklist-summary-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #111827, #4f46e5 72%, #818cf8);
    box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 0.8);
}

.dock-pane.checklist .checklist-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dock-pane.checklist .checklist-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dock-pane.checklist .checklist-section h3 {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: 0.18em;
}

.dock-pane.checklist .category-block {
    margin-bottom: 0;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(226, 232, 240, 0.88);
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.35);
}

.dock-pane.checklist .category-header {
    margin-bottom: 14px;
}

.dock-pane.checklist .category-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dock-pane.checklist .category-title-group h4 {
    min-width: 0;
}

.dock-pane.checklist .category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.06);
    border: 1px solid rgba(203, 213, 225, 0.88);
    color: var(--ink-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dock-pane.checklist .category-controls {
    gap: 6px;
}

.dock-pane.checklist .header-add-btn,
.dock-pane.checklist .del-cat-btn,
.dock-pane.checklist .del-btn,
.dock-pane.checklist .more-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 12px 24px -22px rgba(15, 23, 42, 0.46);
    opacity: 1;
}

.dock-pane.checklist .header-add-btn:hover,
.dock-pane.checklist .more-btn:hover {
    background: #ffffff;
    color: var(--primary-bg);
}

.dock-pane.checklist .checklist-add {
    margin-top: 0;
    margin-bottom: 4px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(244, 244, 245, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.dock-pane.checklist .checklist-add input {
    border-radius: 12px;
    padding: 10px 12px;
    border-color: rgba(203, 213, 225, 0.88);
}

.dock-pane.checklist .checklist-add button,
.dock-pane.checklist .checklist-button-container .add-category-btn {
    border-radius: 999px;
    padding: 0 14px;
    min-width: 110px;
}

.dock-pane.checklist .checklist-button-container {
    display: flex;
    margin-top: 2px;
}

.dock-pane.checklist .checklist-button-container .add-category-btn {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-color: rgba(203, 213, 225, 0.88);
}

.dock-pane.checklist .checklist-list {
    gap: 10px;
}

.dock-pane.checklist .checklist-list li {
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.94));
    box-shadow: 0 16px 28px -28px rgba(15, 23, 42, 0.4);
}

.dock-pane.checklist .checklist-list li:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.42);
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.42);
}

.dock-pane.checklist .checklist-list li.done {
    background: linear-gradient(180deg, rgba(250, 250, 250, 0.95), rgba(244, 244, 245, 0.88));
    opacity: 0.9;
}

.dock-pane.checklist .checklist-list label {
    font-weight: 600;
}

.dock-pane.checklist .checklist-list input[type="checkbox"] {
    width: 19px;
    height: 19px;
}

.dock-pane.checklist .checklist-indicator-wrap {
    gap: 6px;
}

.dock-pane.checklist .icon-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(199, 210, 254, 0.85);
}

.dock-pane.checklist .itinerary-task-item {
    margin-bottom: 0;
    border-radius: 18px;
    padding: 14px;
}

.dock-pane.checklist .itinerary-task-context {
    padding-bottom: 10px;
    border-bottom-style: solid;
}

.dock-pane.checklist .context-subtype {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.06), rgba(148, 163, 184, 0.08));
    border-color: rgba(203, 213, 225, 0.9);
}

.dock-pane.checklist .context-link:hover {
    color: var(--primary-bg);
}

.dock-pane.checklist .day-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dock-pane.checklist .day-group h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.dock-pane.checklist .drag-grip {
    width: 26px;
    height: 26px;
    margin-right: 0;
    border-radius: 999px;
    justify-content: center;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.dock-pane.checklist .category-header.drag-over,
.dock-pane.checklist .checklist-list li.drag-over {
    border-color: rgba(79, 70, 229, 0.45);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

@media (max-width: 640px) {
    .dock-pane.fx .fx-summary,
    .dock-pane.checklist .checklist-summary {
        grid-template-columns: 1fr;
    }

    .dock-pane.fx .fx-summary-stats,
    .dock-pane.checklist .checklist-summary-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-flow: initial;
    }

    .dock-pane.fx .fx-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* --- Luggage Panel --- */
.dock-pane.luggage {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0) 34%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 28px 56px -32px rgba(15, 23, 42, 0.42), 0 20px 36px -30px rgba(79, 70, 229, 0.2);
}
.luggage-panel-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--chipBorder) transparent;
}
.luggage-section { display: grid; gap: 12px; }
.luggage-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.luggage-section-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.luggage-section-copy { font-size: 12px; line-height: 1.55; color: var(--ink-dim); max-width: 38ch; }
.luggage-inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.luggage-slot-card, .luggage-summary-card, .luggage-day-card { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid rgba(203, 213, 225, 0.72); background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(244,244,245,0.9)); box-shadow: 0 20px 40px -34px rgba(15, 23, 42, 0.28); }
.luggage-slot-card { display: grid; gap: 12px; padding: 14px; }
.luggage-slot-card.is-inactive { opacity: 0.78; }
.luggage-slot-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.luggage-slot-code, .luggage-day-row-code { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.luggage-slot-code { font-size: 20px; }
.luggage-day-row-code { font-size: 18px; }
.luggage-slot-code::before, .luggage-day-row-code::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--luggage-accent, #4F46E5); }
.luggage-slot-caption { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.luggage-toggle-btn, .luggage-size-btn, .luggage-start-btn, .luggage-hide-btn, .luggage-plan-select, .luggage-filter-select, .luggage-day-card { border: 1px solid rgba(203, 213, 225, 0.78); background: rgba(255,255,255,0.92); color: var(--ink); box-shadow: var(--shadow-sm); }
.luggage-toggle-btn, .luggage-size-btn, .luggage-start-btn, .luggage-hide-btn { height: 32px; border-radius: 999px; padding: 0 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.luggage-toggle-btn:hover, .luggage-size-btn:hover, .luggage-start-btn:hover, .luggage-hide-btn:hover, .luggage-day-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.luggage-toggle-btn.is-active, .luggage-size-btn.is-active, .luggage-start-btn.is-active { background: color-mix(in srgb, var(--luggage-accent, #4F46E5) 14%, white); border-color: color-mix(in srgb, var(--luggage-accent, #4F46E5) 36%, white); color: color-mix(in srgb, var(--luggage-accent, #4F46E5) 78%, black); }
.luggage-size-toggle, .luggage-start-toggle, .luggage-day-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.luggage-filter-select, .luggage-plan-select { appearance: none; min-height: 34px; padding: 0 12px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.luggage-summary-card { padding: 16px; display: grid; gap: 10px; }
.luggage-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.luggage-summary-stat { display: grid; gap: 4px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,0.82); border: 1px solid rgba(226, 232, 240, 0.9); }
.luggage-summary-stat strong { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--ink); }
.luggage-summary-stat span { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.luggage-token-groups { display: grid; gap: 8px; }
.luggage-token-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.luggage-token-group-label { min-width: 48px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.luggage-token-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.luggage-day-rows, .luggage-day-list { display: grid; gap: 10px; }
.luggage-day-row { display: grid; grid-template-columns: minmax(0, 84px) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,0.84); border: 1px solid rgba(226, 232, 240, 0.9); }
.luggage-day-row-size { font-size: 11px; color: var(--ink-dim); }
.luggage-field { display: grid; gap: 6px; }
.luggage-field-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.luggage-status-pill { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 14px; background: rgba(255,255,255,0.86); border: 1px solid rgba(226, 232, 240, 0.92); font-size: 12px; font-weight: 600; color: var(--ink); }
.luggage-day-card { width: 100%; text-align: left; padding: 14px 16px; display: grid; gap: 10px; cursor: pointer; }
.luggage-day-card.is-active { border-color: rgba(79, 70, 229, 0.28); box-shadow: 0 22px 40px -34px rgba(79, 70, 229, 0.28); }
.luggage-day-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.luggage-day-card-date { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); }
.luggage-day-card-route { font-size: 12px; line-height: 1.55; color: var(--ink-dim); }
.luggage-empty-state { padding: 18px; border-radius: 18px; border: 1px dashed rgba(148, 163, 184, 0.44); background: rgba(255,255,255,0.6); color: var(--ink-dim); font-size: 12px; line-height: 1.65; }
.luggage-day-row.is-locked { background: rgba(248,250,252,0.92); }
.luggage-conflict-note { grid-column: 2 / -1; padding: 9px 11px; border-radius: 14px; background: rgba(255,247,237,0.92); border: 1px solid rgba(251,146,60,0.24); color: #9A3412; font-size: 11px; line-height: 1.45; }
@media (max-width: 768px) { .dock-pane.luggage .luggage-panel-body { padding-right: 0; padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 12px); } .luggage-inventory-grid, .luggage-summary-grid, .luggage-day-row { grid-template-columns: 1fr; } .luggage-conflict-note { grid-column: auto; } }
@media (max-width: 560px) { .luggage-slot-card, .luggage-summary-card, .luggage-day-card { border-radius: 18px; } .luggage-slot-card { padding: 12px; } .luggage-day-card-date { font-size: 16px; } .dock-pane.luggage .luggage-day-row { grid-template-columns: 1fr; } .dock-pane.luggage .luggage-day-controls { width: 100%; } .dock-pane.luggage .luggage-filter-select { width: 100%; } }
/* --- Luggage Field Overflow Fix --- */
.luggage-day-row > * {
    min-width: 0;
}
.luggage-field {
    min-width: 0;
}
.luggage-panel-body {
    overflow-x: hidden;
}
.luggage-section-head {
    flex-wrap: wrap;
}
.luggage-day-row {
    overflow: hidden;
}
.luggage-day-row-head {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.luggage-field > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.luggage-plan-select,
.luggage-filter-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.luggage-plan-trigger,
.luggage-status-pill {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.dock-pane.luggage {
    overflow-x: hidden;
}

/* --- Premium Checklist / Packing / Luggage Refinements --- */
.luggage-slot-top {
    flex-wrap: wrap;
    align-items: flex-start;
}
.luggage-slot-top > :first-child {
    min-width: 0;
}
.luggage-toggle-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.dock-pane.checklist .checklist-indicator-wrap {
    gap: 8px;
}
.dock-pane.checklist .icon-indicator {
    width: 24px;
    height: 24px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,245,249,0.92));
    border: 1px solid rgba(203, 213, 225, 0.92);
    box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.45);
    color: var(--ink-dim);
}
.dock-pane.checklist .icon-indicator svg {
    width: 13px;
    height: 13px;
}
.dock-pane.checklist .icon-indicator.icon-link {
    color: color-mix(in srgb, var(--primary-bg) 70%, #0f172a);
    border-color: rgba(199, 210, 254, 0.95);
    background: linear-gradient(180deg, rgba(238,242,255,0.94), rgba(224,231,255,0.72));
}
.dock-pane.checklist .icon-indicator.icon-note {
    color: #9A3412;
    border-color: rgba(253, 186, 116, 0.7);
    background: linear-gradient(180deg, rgba(255,247,237,0.96), rgba(255,237,213,0.8));
}

.dock-pane.packing .packing-mode-toggle {
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.9));
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.42);
}
.dock-pane.packing .packing-mode-toggle button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
}
.dock-pane.packing .packing-mode-toggle button.active {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: #fff;
    box-shadow: 0 16px 28px -22px rgba(79, 70, 229, 0.65);
}
.dock-pane.packing .packing-empty-state {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(244,244,245,0.92));
    border-color: rgba(203, 213, 225, 0.9);
}
.dock-pane.packing .packing-event {
    margin-bottom: 14px;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.94);
    background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,250,252,0.94));
    box-shadow: 0 24px 44px -36px rgba(15, 23, 42, 0.34);
}
.dock-pane.packing .packing-event summary {
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.88));
}
.dock-pane.packing .packing-event[open] summary {
    background: linear-gradient(180deg, rgba(245,247,255,0.98), rgba(238,242,255,0.86));
    border-bottom-color: rgba(226, 232, 240, 0.92);
}
.dock-pane.packing .packing-event-toggle {
    width: 24px;
    height: 24px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(199, 210, 254, 0.88);
}
.dock-pane.packing .packing-event[open] > summary .packing-event-toggle {
    box-shadow: 0 12px 22px -16px rgba(79, 70, 229, 0.7);
}
.dock-pane.packing .packing-event-date {
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.94);
}
.dock-pane.packing .packing-category-block-pack,
.dock-pane.packing .packing-category-block-edit {
    padding: 16px;
}
.dock-pane.packing .packing-category-block-edit {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.94);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,244,245,0.9));
    box-shadow: 0 18px 32px -30px rgba(15, 23, 42, 0.28);
}
.dock-pane.packing .packing-category-header {
    margin-bottom: 14px;
}
.dock-pane.packing .packing-list,
.dock-pane.packing .packing-list-edit {
    gap: 10px;
}
.dock-pane.packing .packing-list li {
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,250,252,0.94));
    box-shadow: 0 16px 28px -28px rgba(15, 23, 42, 0.34);
}
.dock-pane.packing .packing-list li.done {
    background: linear-gradient(180deg, rgba(250,250,250,0.96), rgba(241,245,249,0.88));
    opacity: 0.88;
}
.dock-pane.packing .packing-list-edit li {
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
    box-shadow: 0 14px 26px -28px rgba(15, 23, 42, 0.32);
}
.dock-pane.packing .packing-add {
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(244,244,245,0.78);
    border: 1px solid rgba(226, 232, 240, 0.9);
}
.dock-pane.packing .drag-grip,
.dock-pane.packing .quantity-btn,
.dock-pane.packing .del-item-btn,
.dock-pane.packing .del-cat-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
}
.dock-pane.packing .drag-grip {
    justify-content: center;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.92);
}
/* --- Premium Attachment Icon System --- */
.card .top .iconbtn.docs,
.incidental-item .incidental-doc-btn.iconbtn {
    width: 22px;
    height: 22px;
    border-radius: 10px;
    border: 1px solid rgba(253, 186, 116, 0.7);
    background: linear-gradient(180deg, rgba(255,247,237,0.96), rgba(255,237,213,0.82));
    color: #9A3412;
    box-shadow: 0 12px 22px -18px rgba(154, 52, 18, 0.34);
}
.card .top .iconbtn.docs svg,
.incidental-item .incidental-doc-btn.iconbtn svg,
.doc-icon svg {
    width: 13px;
    height: 13px;
}
.card .top .iconbtn.docs:hover,
.incidental-item .incidental-doc-btn.iconbtn:hover {
    background: linear-gradient(180deg, rgba(255,251,235,0.98), rgba(254,215,170,0.92));
    border-color: rgba(251, 146, 60, 0.72);
    color: #7C2D12;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -20px rgba(154, 52, 18, 0.42);
}
.doc-icon {
    width: 24px;
    height: 24px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,247,237,0.96), rgba(255,237,213,0.82));
    border: 1px solid rgba(253, 186, 116, 0.7);
    color: #9A3412;
    box-shadow: 0 12px 20px -18px rgba(154, 52, 18, 0.32);
}
/* --- Mobile FAB Redesign --- */
.tools-menu-desktop {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
}
.tools-menu-mobile,
.tools-more-menu {
    display: none;
}
.tool-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 74px;
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.94);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
    color: var(--ink);
    box-shadow: 0 14px 26px -26px rgba(15, 23, 42, 0.34);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.tool-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -24px rgba(15, 23, 42, 0.4);
}
.tool-pill .tools-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: currentColor;
}
.tool-pill .tools-icon-wrap svg {
    width: 18px;
    height: 18px;
}
.tool-pill .tools-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.tool-pill.tool-pill-costs {
    color: #9A3412;
    border-color: rgba(253, 186, 116, 0.72);
    background: linear-gradient(180deg, rgba(255,247,237,0.98), rgba(255,237,213,0.82));
}
.tool-pill.tool-pill-packing {
    color: #4338CA;
    border-color: rgba(199, 210, 254, 0.92);
    background: linear-gradient(180deg, rgba(238,242,255,0.98), rgba(224,231,255,0.8));
}
.tool-pill.tool-pill-more,
.tool-pill.tool-overflow-btn {
    color: var(--ink);
}
.tool-pill.is-active,
.dock-fab.more-open .tool-pill.tool-pill-more {
    border-color: rgba(99, 102, 241, 0.38);
    box-shadow: 0 16px 30px -24px rgba(79, 70, 229, 0.34);
    background: linear-gradient(180deg, rgba(245,247,255,0.98), rgba(232,238,255,0.88));
    color: #4338CA;
}
.tools-more-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(244px, calc(100vw - 32px));
    padding: 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.62);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 26px 48px -30px rgba(15, 23, 42, 0.36);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.tool-overflow-btn {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
}
.dock-fab.more-open .tools-more-menu {
    display: grid;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 768px) {
    .dock-fab .dock-pane {
        right: calc(100% + 12px);
        padding: 6px;
        gap: 0;
        height: 56px;
    }
    .tools-menu-desktop {
        display: none;
    }
    .tools-menu-mobile {
        display: flex;
        flex-direction: row;
        gap: 6px;
        align-items: center;
    }
}
/* --- FAB Interaction And Tool Identity Overrides --- */
.dock-btn.tools-btn {
    outline: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dock-btn.tools-btn:focus {
    outline: none;
}

.dock-btn.tools-btn:focus-visible {
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(79, 70, 229, 0.4);
}

.tool-pill {
    outline: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.tool-pill:focus {
    outline: none;
}

.tool-pill:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16), 0 16px 28px -24px rgba(15, 23, 42, 0.4);
}

.tool-pill.tool-pill-luggage {
    color: #0F766E;
    border-color: rgba(153, 246, 228, 0.92);
    background: linear-gradient(180deg, rgba(240,253,250,0.98), rgba(204,251,241,0.82));
}

.tool-pill.tool-pill-checklist {
    color: #334155;
    border-color: rgba(226, 232, 240, 0.96);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.9));
}

.tool-pill.tool-pill-colors {
    color: #7C2D12;
    border-color: rgba(253, 186, 116, 0.76);
    background: linear-gradient(180deg, rgba(255,247,237,0.98), rgba(254,215,170,0.74));
}

.tool-pill.tool-pill-fx {
    color: #155E75;
    border-color: rgba(165, 243, 252, 0.92);
    background: linear-gradient(180deg, rgba(236,254,255,0.98), rgba(207,250,254,0.82));
}

.tool-pill.tool-pill-conflicts {
    color: #991B1B;
    border-color: rgba(254, 202, 202, 0.92);
    background: linear-gradient(180deg, rgba(254,242,242,0.98), rgba(254,226,226,0.84));
}

/* --- Cost Matrix Typography Alignment --- */
.cost-matrix th,
.cost-matrix td {
    font-size: 12px;
    line-height: 1.35;
}

.cost-matrix .matrix-budget-label,
.cost-matrix .matrix-currency-btn {
    font-size: 10px;
    line-height: 1;
}

.cost-matrix .matrix-cell-input,
.cost-matrix .matrix-budget-base,
.cost-matrix .matrix-money-value,
.cost-matrix .cost-inline,
.cost-matrix .cost-inline-single,
.cost-matrix .matrix-money-empty {
    font-size: 12px;
    line-height: 1.28;
    font-weight: 600;
}

.cost-matrix .matrix-cell-input {
    font-variant-numeric: tabular-nums;
}

.cost-matrix .cost-inline .cost-base {
    font-size: 12px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.58);
}

/* --- Luggage Destination Picker Upgrade --- */
.luggage-plan-trigger {
    min-height: 34px;
    width: 100%;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    background: rgba(255,255,255,0.92);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.luggage-plan-trigger:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.luggage-plan-trigger.is-placeholder {
    color: var(--ink-dim);
}

.luggage-plan-trigger-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luggage-plan-trigger-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: rgba(15, 23, 42, 0.52);
}

.luggage-plan-trigger-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.luggage-picker-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(248, 250, 252, 0.74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: inherit;
}

.luggage-picker-sheet {
    width: min(100%, 420px);
    max-height: min(72vh, 560px);
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
    box-shadow: 0 28px 54px -30px rgba(15, 23, 42, 0.38);
}

.luggage-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.luggage-picker-title {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.luggage-picker-close {
    flex: 0 0 auto;
}

.luggage-picker-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

.luggage-picker-option {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255,255,255,0.9);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.luggage-picker-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -28px rgba(15, 23, 42, 0.34);
}

.luggage-picker-option.is-active {
    border-color: color-mix(in srgb, var(--luggage-accent, #4F46E5) 34%, white);
    background: color-mix(in srgb, var(--luggage-accent, #4F46E5) 10%, white);
    box-shadow: 0 18px 30px -28px color-mix(in srgb, var(--luggage-accent, #4F46E5) 34%, white);
}

.luggage-picker-option-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.luggage-picker-option-meta {
    font-size: 11px;
    line-height: 1.45;
    color: var(--ink-dim);
}

@media (max-width: 768px) {
    .luggage-picker-overlay {
        inset: auto 0 0 0;
        align-items: flex-end;
        padding: 12px;
        border-radius: 0;
    }

    .luggage-picker-sheet {
        width: 100%;
        max-height: min(68vh, 520px);
        border-radius: 22px 22px 18px 18px;
    }
}

/* --- Luggage Picker Scroll Override --- */
.luggage-picker-sheet {
    overflow: hidden;
}

.luggage-picker-list {
    max-height: min(46vh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-right: 4px;
}

@media (max-width: 768px) {
    .luggage-picker-list {
        max-height: min(44vh, 340px);
    }
}
