:root { --wiz-blue: #2563eb; --wiz-bg: #f3f4f6; --urgent: #ef4444; --success: #10b981; --share: #f59e0b; --maya-teal: #00b8c4; --wiz-sticky-top: 100px; }
    #wiz-hub { font-family: 'Segoe UI', sans-serif; background: var(--wiz-bg); color: #1e293b; direction: ltr; max-width: 800px; margin: 40px auto; padding: 25px; border-radius: 20px; }
    .sticky-progress { position: sticky; top: var(--wiz-sticky-top); z-index: 999; background: white; padding: 15px 25px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-bottom: 25px; border-bottom: 3px solid var(--wiz-blue); }
    .wiz-card { background: white; border-radius: 12px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }
    .progress-container { position: relative; height: 10px; background: #e2e8f0; border-radius: 5px; margin: 15px 0 5px; }
    .progress-fill { height: 100%; background: var(--wiz-blue); width: 0%; border-radius: 5px; transition: width 0.5s ease; }
    .plane-icon { position: absolute; top: -10px; left: 0%; transform: translateX(-50%); font-size: 20px; transition: left 0.5s ease; }
    .progress-split { display: flex; gap: 15px; font-size: 0.72rem; color: #64748b; margin-top: 6px; font-weight: 600; }
    .sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-right: 5px; vertical-align: middle; }
    .sync-dot.ok { background: var(--success); } .sync-dot.busy { background: var(--share); } .sync-dot.err { background: var(--urgent); }
    #syncStatus { font-size: 0.7rem; color: #64748b; font-weight: 600; }

    .filter-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
    .tag-btn { border: 1.5px solid #cbd5e1; background: white; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: 0.2s; color: #1e293b; }
    .tag-btn.active { background: var(--wiz-blue); color: white; border-color: var(--wiz-blue); }
    /* Override theme button focus/active styles (fixes the "turns red" bug) */
    #wiz-hub .tag-btn:focus, #wiz-hub .tag-btn:active,
    #wiz-hub .tag-btn:focus-visible, #wiz-hub .tag-btn:hover {
        background: white !important; color: #1e293b !important; border-color: #94a3b8 !important; outline: none !important; box-shadow: none !important;
    }
    #wiz-hub .tag-btn.active:focus, #wiz-hub .tag-btn.active:active,
    #wiz-hub .tag-btn.active:focus-visible, #wiz-hub .tag-btn.active:hover {
        background: var(--wiz-blue) !important; color: white !important; border-color: var(--wiz-blue) !important;
    }
    .sub-filter-label { width: 100%; margin-top: 10px; font-size: 0.75rem; font-weight: bold; color: var(--wiz-blue); text-transform: uppercase; }

    .leg-row { border: 1px solid #e2e8f0; border-radius: 10px; padding: 15px; margin-top: 12px; background: #fafbfc; }
    .leg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: bold; font-size: 0.9rem; color: var(--wiz-blue); }
    .leg-remove { background: none; border: none; color: #94a3b8; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0 6px; }
    .leg-remove:hover { color: var(--urgent); }
    /* !important throughout — the theme styles bare <button> elements and would
       otherwise repaint this solid. Same reason as the .tag-btn overrides below. */
    #wiz-hub .add-leg-btn { margin-top: 12px; background: white !important; border: 1.5px dashed var(--wiz-blue) !important; color: var(--wiz-blue) !important; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 0.85rem; width: 100%; box-shadow: none !important; }
    #wiz-hub .add-leg-btn:hover, #wiz-hub .add-leg-btn:focus, #wiz-hub .add-leg-btn:active, #wiz-hub .add-leg-btn:focus-visible { background: #eff6ff !important; border-color: var(--wiz-blue) !important; color: var(--wiz-blue) !important; outline: none !important; box-shadow: none !important; }

    .setup-row { display: flex; gap: 15px; margin-top: 10px; flex-wrap: wrap; }
    .setup-col { flex: 1; min-width: 220px; }
    .setup-col label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.85rem; }
    .dest-search-wrapper { position: relative; width: 100%; }
    .setup-col input { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 8px; outline: none; font-size: 1rem; box-sizing: border-box; background: white; }
    /* Two date inputs side by side: min-width:0 lets them shrink below their
       intrinsic width (a date input is ~150px by default) instead of overflowing
       the card. The wider min-width on the column makes it wrap first. */
    .setup-col.dates-col { min-width: 310px; }
    .dates-pair { display: flex; gap: 10px; min-width: 0; }
    .dates-pair > div { flex: 1; min-width: 0; }
    .dates-pair input[type="date"] { padding-left: 10px; padding-right: 8px; font-size: 0.95rem; }
    .autocomplete-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #cbd5e1; border-top: none; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 250px; overflow-y: auto; z-index: 1000; display: none; }
    .autocomplete-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; }
    .autocomplete-item:hover { background: #f0fdfa; color: var(--maya-teal); font-weight: bold; }

    .wiz-notice { border-radius: 8px; padding: 12px 15px; margin-top: 12px; font-size: 0.85rem; line-height: 1.5; }
    .wiz-notice.warn { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
    .wiz-notice.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
    .wiz-notice.suggest { background: #f0fdfa; border: 1px solid #99f6e4; color: #0f766e; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .wiz-notice .mini-btn { border: none; border-radius: 6px; padding: 6px 12px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
    .mini-btn.yes { background: var(--maya-teal); color: white; }
    .mini-btn.no { background: transparent; color: #64748b; text-decoration: underline; }

    #mayaBox { display: none; background: #f0fdfa; border-left: 4px solid var(--maya-teal); padding: 20px; margin-top: 15px; border-radius: 0 8px 8px 0; font-size: 0.85rem; }
    .maya-header { font-weight: bold; color: #064e3b; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
    .maya-leg-block { margin-bottom: 15px; }
    .maya-leg-block:last-child { margin-bottom: 0; }
    .maya-leg-title { font-weight: 800; color: #0f766e; margin: 10px 0 8px; font-size: 0.9rem; border-bottom: 1px solid #ccfbf1; padding-bottom: 4px; }
    .maya-item { display: flex; align-items: flex-start; margin-bottom: 10px; color: #065f46; line-height: 1.5; }
    .maya-item strong { flex-shrink: 0; width: 110px; color: #047857; }
    .maya-text { flex-grow: 1; }

    .legend-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 15px; background: white; padding: 12px 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); border: 1px solid #e2e8f0; font-size: 0.8rem; color: #475569; }
    .legend-bar strong { color: #1e293b; margin-right: 5px; }
    .legend-item { display: flex; align-items: center; gap: 6px; }
    .legend-item .badge { margin: 0; }

    .maya-tooltip-wrap { position: relative; display: inline-block; cursor: help; border-bottom: 1px dashed var(--maya-teal); color: var(--maya-teal); font-weight: bold; }
    .maya-tooltip-wrap:hover::after, .maya-tooltip-wrap.tt-open::after { content: "Maya is TravelingWiz's human-verified expert, ensuring your trip is perfectly planned."; position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 0.75rem; white-space: normal; width: 220px; text-align: center; z-index: 1000; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
    .maya-tooltip-wrap:hover::before, .maya-tooltip-wrap.tt-open::before { content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #1e293b; z-index: 1000; }

    .item-row { display: flex; align-items: center; padding: 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; justify-content: space-between; gap: 10px; }
    .item-info { display: flex; align-items: flex-start; gap: 12px; flex: 1; }
    .item-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--wiz-blue); cursor: pointer; margin-top: 3px; }
    .item-text-group { display: flex; flex-direction: column; }
    .tip-text { display: block; font-size: 0.85rem; color: var(--maya-teal); margin-top: 4px; font-weight: 500; font-style: italic; }
    .badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; color: white; font-weight: bold; margin-top: 4px; display: inline-block; text-transform: uppercase; align-self: flex-start; }
    .bg-backpack { background: #8b5cf6; } .bg-checked { background: #64748b; } .bg-smart { background: var(--maya-teal); }
    .right-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
    .info-btn { font-size: 1.4rem; text-decoration: none; transition: transform 0.2s; line-height: 1; }
    .affiliate-btn { font-size: 0.75rem; background: #fffbeb; color: #d97706; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-weight: bold; border: 1px solid #fde68a; transition: 0.2s; white-space: nowrap; }
    .delete-btn { color: #94a3b8; font-size: 1.2rem; cursor: pointer; padding: 0 10px; }

    .custom-add { display: flex; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px dashed #e2e8f0; }
    .custom-add input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
    .section-header { font-weight: bold; color: #475569; margin-bottom: 10px; font-size: 1.1rem; border-left: 4px solid var(--wiz-blue); padding-left: 10px; margin-top: 10px; }
    .reset-btn { font-size: 0.7rem; color: #94a3b8; cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; }

    .twiz-share-btn:hover { background: #f7fafc !important; border-color: #a0aec0 !important; color: #1a202c !important; box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important; }

    @media (max-width: 600px) {
        .maya-header { align-items: flex-start; }
        .maya-header > div { line-height: 1.4; }
        .maya-item { flex-direction: column; gap: 4px; margin-bottom: 15px; }
        .maya-item strong { width: 100%; border-bottom: 1px solid #ccfbf1; padding-bottom: 4px; }
        .legend-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
        .setup-row { flex-direction: column; gap: 10px; }
    }
