    body {
      /* Shopify theme body is pure white — no gradient, no gray. */
      background: #ffffff;
      color: #000000;
      height: 100vh;
      height: 100dvh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* Header */
    .header {
      background: var(--brand-navy);
      padding: 1rem 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: var(--shadow-md);
      flex-shrink: 0;
    }

    .header h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
      color: white;
      font-size: 1.25rem;
      font-weight: 700;
      margin: 0;
    }

    .header .customer-name {
      color: var(--brand-gold);
      font-size: 0.875rem;
      font-weight: 500;
    }

    /* Full Page link: inline in header next to New Chat (never floating overlay) */
    .portal-quote-link {
      position: static !important;
      display: inline-flex !important;
      align-items: center;
      gap: 0.35rem;
    }

    /* Main container — white background matching Shopify page body.
       No padding gap between chat + sidebar; the border-left on
       .quote-sidebar provides the visual separation (same pattern
       as the Shopify cart drawer vs. main content). */
    .main-container {
      display: flex;
      flex: 1;
      overflow: hidden;
      gap: 0;
      padding: 0;
      background: #ffffff;
    }

    /* Chat area */
    .chat-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: #ffffff;
      overflow: hidden;
      /* No border-radius or box-shadow — the chat area is the main
         content column, not a floating card. Matches how Shopify's
         collection page sits flush against the page edge. */
    }

    #messages {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      padding: 1rem;
      min-height: 0;
    }

    .chat-bubble {
      animation: slideIn 0.3s ease-out;
      margin-bottom: 1rem;
    }

    @keyframes slideIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .user-message {
      background: var(--brand-navy);
      color: white;
      padding: 0.75rem 1rem;
      border-radius: 18px 18px 4px 18px;
      display: inline-block;
      max-width: 70%;
      margin-left: auto;
    }

    .ai-message {
      background: var(--gray-100);
      color: var(--text);
      padding: 0.75rem 1rem;
      border-radius: 18px 18px 18px 4px;
      display: inline-block;
      max-width: 85%;
    }

    /* Product card — Shopify-website visual treatment.
       Subtle navy-tinted border + soft resting shadow that lifts on
       hover. Typography uses Montserrat (uppercase weight 700) for
       the title and price, matching the grid-product cards on
       onshorecellars.com. These CSS rules are the fallback — the
       createProductCard() function in shopify-customer-quote-builder
       .html overrides most of these via inline styles, but we keep
       them in sync so any card rendered through a different path
       (e.g. the search results section) also gets the brand look. */
    .product-card {
      border: 1px solid rgba(1, 22, 56, 0.08);
      border-radius: 0.75rem;
      padding: 0.875rem;
      margin: 0.5rem 0;
      background: var(--white);
      display: flex;
      gap: 0.875rem;
      align-items: flex-start;
      box-shadow: 0 1px 3px rgba(1, 22, 56, 0.04);
      transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .product-card:hover {
      box-shadow: 0 6px 20px rgba(1, 22, 56, 0.10);
      transform: translateY(-1px);
    }

    .product-card img {
      width: 80px;
      height: 100px;
      object-fit: cover;
      border-radius: 0.5rem;
    }

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

    .product-name {
      font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
      font-weight: 700;
      font-size: 0.9375rem;
      line-height: 1.25;
      letter-spacing: 0.01em;
      color: var(--brand-navy);
      margin-bottom: 0.3125rem;
    }

    .product-details {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 0.5rem;
    }

    .price-display {
      font-family: 'Montserrat', sans-serif;
      font-size: 1.1875rem;
      font-weight: 800;
      letter-spacing: -0.01em;
      color: var(--brand-navy);
    }

    .price-stale {
      font-size: 0.875rem;
      color: var(--text-muted);
      font-style: italic;
    }

    .add-btn {
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      padding: 0 1.125rem;
      height: 2.25rem;
      border-radius: 0.5rem;
      font-family: 'Montserrat', sans-serif;
      font-size: 0.8125rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      cursor: pointer;
      transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
      box-shadow: 0 1px 2px rgba(1, 22, 56, 0.08);
      white-space: nowrap;
    }

    .add-btn:hover {
      background: var(--brand-gold-hover, #b07d3c);
      box-shadow: 0 3px 8px rgba(1, 22, 56, 0.15);
    }
    .add-btn:active {
      transform: translateY(1px);
    }

    /* Input area */
    .input-area {
      flex-shrink: 0;
      background: var(--white);
      border-top: 1px solid var(--border);
      padding: 1rem;
    }

    .input-container {
      display: flex;
      gap: 0.75rem;
      align-items: stretch;
    }

    #input {
      flex: 1;
      padding: 0.75rem 1rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-lg);
      font-size: 1rem;
      font-family: var(--f-ui);
      resize: none;
      min-height: 44px;
      max-height: 120px;
    }

    #input:focus {
      outline: none;
      border-color: var(--brand-gold);
    }

    #sendBtn {
      background: var(--brand-navy);
      color: white;
      border: none;
      padding: 0 1.5rem;
      border-radius: var(--radius-lg);
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
      white-space: nowrap;
    }

    #sendBtn:hover {
      background: var(--brand-navy-light);
    }

    #sendBtn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* ─── Quote sidebar — styled to match the Shopify cart drawer ────
       The cart drawer on onshorecellars.com uses a clean white
       panel with subtle borders, minimal shadows, and the gold
       Checkout/Request button at the bottom. We mirror that here
       so "Build a Quote" feels like the same site as the product
       pages / cart drawer the customer already knows.
       ───────────────────────────────────────────────────────────── */
    .quote-sidebar {
      width: 350px;
      min-width: 280px;
      background: #ffffff;
      border-left: 1px solid #e7e7e7;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .import-cart-section {
      border-bottom: 1px solid #e7e7e7;
    }

    .quote-header {
      /* Shopify cart drawer header is white with dark text — NOT navy.
         This matches the .site-header__cart layout. */
      background: #ffffff;
      color: #000000;
      padding: 1rem 1.25rem;
      font-family: 'Montserrat', system-ui, sans-serif;
      font-weight: 700;
      font-size: 0.875rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #e7e7e7;
    }

    .quote-items {
      flex: 1;
      overflow-y: auto;
      padding: 0;
    }

    .quote-item {
      /* Match the Shopify cart__item row layout:
         horizontal image + info + qty stepper / remove. */
      border-bottom: 1px solid #e7e7e7;
      padding: 1rem 1.25rem;
      display: flex;
      gap: 0.875rem;
      align-items: flex-start;
    }

    .quote-item:last-child {
      border-bottom: none;
    }

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

    .quote-item-name {
      font-family: 'Open Sans', system-ui, sans-serif;
      font-weight: 400;
      font-size: 0.875rem;
      line-height: 1.4;
      color: #000000;
      margin-bottom: 0.25rem;
    }

    .quote-item-sku {
      font-size: 0.75rem;
      color: var(--oc-gray-400, #9ca3af);
    }

    .qty-input { /* 16px: iOS zoom guard */
      width: 60px;
      padding: 0.375rem 0.5rem;
      border: 1px solid #e7e7e7;
      border-radius: 6px;
      text-align: center;
      font-size: 16px;
      font-family: 'Open Sans', sans-serif;
    }

    .remove-btn {
      background: none;
      border: none;
      color: var(--oc-gray-400, #9ca3af);
      cursor: pointer;
      padding: 0.25rem;
      font-size: 0.75rem;
      text-decoration: underline;
      font-family: 'Open Sans', sans-serif;
    }

    .remove-btn:hover {
      color: #000000;
    }

    .quote-footer {
      /* Matches the Shopify .cart__footer — subtle top border,
         white background, not gray. */
      border-top: 1px solid #e7e7e7;
      padding: 1rem 1.25rem;
      background: #ffffff;
    }

    .quote-total {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.75rem;
      font-family: 'Open Sans', sans-serif;
      font-size: 1rem;
      font-weight: 400;
      color: #000000;
    }
    .quote-total strong {
      font-weight: 700;
    }

    /* Primary CTA — matches the Shopify theme .btn / .cart__checkout
       (gold background, white text, Montserrat uppercase 700). */
    .submit-quote-btn {
      width: 100%;
      background: var(--brand-gold, var(--oc-gold, #C6904D));
      color: #ffffff;
      border: none;
      padding: 11px 25px;
      border-radius: 6px;
      font-family: 'Montserrat', system-ui, sans-serif;
      font-size: 0.875rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      line-height: 1.42;
      cursor: pointer;
      transition: background 0.2s, box-shadow 0.2s;
    }

    .submit-quote-btn:hover {
      background: #a87539;
      box-shadow: 0 4px 12px rgba(198, 144, 77, 0.3);
    }

    .submit-quote-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .empty-quote {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--text-muted);
    }

    .empty-quote i {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    /* Loading spinner */
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid rgba(255,255,255,.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Full Page link: inline in header next to New Chat */
    .portal-quote-link {
      display: none; /* hidden by default; shown via JS when embedded in portal */
      align-items: center;
      gap: 0.35rem;
      color: rgba(255,255,255,0.95);
      text-decoration: none;
      font-weight: 500;
      font-size: 0.875rem;
    }
    .portal-quote-link:hover { color: var(--brand-gold); }

    /* Clickable detail chips on product cards (category, country, region, appellation) */
    .detail-chip-link {
      cursor: pointer;
      color: var(--text-soft);
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 2px;
      text-decoration-color: var(--gray-300);
      transition: color 0.15s, text-decoration-color 0.15s;
    }
    .detail-chip-link:hover {
      color: var(--brand-gold);
      text-decoration-color: var(--brand-gold);
      text-decoration-style: solid;
    }

    /* New Chat / button labels: icon-only on mobile (all main buttons have icons) */
    .chat-btn-label,
    .btn-label-mobile {
      display: inline;
    }
    
    /* Show Your Quote tab on all screen sizes */
    .quote-tab-mobile {
      display: inline-flex;
    }
    
    @media (max-width: 640px) {
      .chat-btn-label,
      .btn-label-mobile {
        display: none;
      }
      
      /* Enhance icon-only buttons for mobile: larger icons and proper touch targets */
      .header button,
      .header a,
      .tab-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 0.75rem 1rem !important;
      }
      
      .header button i,
      .header a i,
      .tab-btn i {
        font-size: 1.25rem;
      }
      
      /* Ensure icon-only buttons maintain proper spacing */
      .header > div:last-child {
        gap: 0.5rem;
      }
    }

    /* Quote sidebar shown as tab on mobile */
    @media (max-width: 768px) {
      .main-container {
        flex-direction: column;
        min-height: 0;
        flex: 1;
        overflow: hidden;
      }

      /* Chat area takes most of the space; hide sidebar on mobile by default */
      .chat-area {
        flex: 1 1 0;
        min-height: 0;
        order: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      #messages {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      
      /* Increase chat message font sizes for better readability on mobile */
      .user-message,
      .ai-message {
        font-size: 1rem;
        padding: 0.875rem 1.125rem;
      }
      
      .product-name {
        font-size: 1.0625rem;
      }
      
      .product-details {
        font-size: 0.9375rem;
      }
      
      .price-display {
        font-size: 1.375rem;
      }

      /* Quote sidebar: hidden by default on mobile, shown as full-page tab when active */
      .quote-sidebar {
        display: none; /* Hidden by default on mobile */
        width: 100%;
        height: 100%;
        flex: 1;
        order: 2;
        overflow: hidden;
        flex-direction: column;
      }
      
      .quote-sidebar.active {
        display: flex; /* Show when tab is active */
      }

      .quote-sidebar .quote-header {
        flex-shrink: 0;
        padding: 0.75rem;
        font-size: 1.125rem;
      }

      .quote-sidebar .import-cart-section {
        flex-shrink: 0;
      }

      .quote-sidebar .quote-items {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
      }
      
      /* Increase quote item font sizes specifically for mobile */
      .quote-item-name {
        font-size: 1rem;
      }
      
      .quote-item-sku {
        font-size: 0.8125rem;
      }
      
      .qty-input {
        font-size: 1rem;
        width: 70px;
        padding: 0.375rem 0.625rem;
      }

      .quote-sidebar .quote-footer {
        flex-shrink: 0;
        padding: 0.75rem;
      }

      .quote-sidebar .quote-footer .quote-total {
        margin-bottom: 0.75rem;
        font-size: 1.25rem;
      }

      .quote-sidebar .quote-footer .submit-quote-btn {
        padding: 0.875rem;
        font-size: 1.0625rem;
      }
      
      /* Show Your Quote tab only on mobile */
      .quote-tab-mobile {
        display: inline-flex !important;
      }

      /* Compact header and tabs on mobile so more room for chat */
      .header {
        padding: 0.375rem 0.75rem;
      }
      .header h1 { font-size: 0.9375rem; }
      .header .customer-name { font-size: 0.6875rem; }
      .header .delivery-date-header { font-size: 0.6875rem; }
      .tab-btn { padding: 0.5rem 0; font-size: 0.8125rem; }
      .guest-contact-form { padding: 0.375rem 0.75rem; }
      .guest-contact-form.collapsed { padding: 0.25rem 0.75rem; }

      /* Full-page quote: stack columns on mobile */
      #quoteFullPage > div > div > div:last-child {
        width: 100% !important;
        min-width: 0 !important;
      }

      /* Input area: tighter on mobile */
      .input-area { padding: 0.375rem 0.5rem; }
      .input-container textarea { font-size: 16px; padding: 0.5rem 0.625rem; }
    }

    /* Toast notification */
    .toast {
      position: fixed;
      top: 80px;
      right: 20px;
      background: var(--white);
      padding: 1rem 1.5rem;
      border-radius: 10px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      z-index: var(--z-toast, 100000);
      animation: slideInRight 0.3s ease-out;
    }

    @keyframes slideInRight {
      from { opacity: 0; transform: translateX(100px); }
      to { opacity: 1; transform: translateX(0); }
    }

    .toast.success {
      border-left: 4px solid var(--accent-green-light);
    }

    .toast.error {
      border-left: 4px solid var(--accent-red);
    }

    /* App always visible (no login screen when used in Shopify) */
    .app-content {
      display: flex;
      width: 100%;
      height: 100vh;
      height: 100dvh;
    }

    /* Guest contact form */
    .guest-contact-form {
      background: linear-gradient(135deg, var(--bg) 0%, var(--gray-200) 100%);
      border-bottom: 2px solid var(--border);
      padding: 1.5rem;
    }

    .guest-contact-form.collapsed {
      padding: 0.75rem 1.5rem;
    }

    .form-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
      cursor: pointer;
    }

    .guest-contact-form.collapsed .form-header {
      margin-bottom: 0;
    }

    .form-header h3 {
      color: var(--brand-navy);
      font-size: 1.125rem;
      font-weight: 700;
      margin: 0;
    }

    .form-header-status {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--accent-green-light);
      font-size: 0.875rem;
      font-weight: 600;
    }

    .form-content {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1rem;
    }

    .guest-contact-form.collapsed .form-content {
      display: none;
    }

    .form-field {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .form-field.full-width {
      grid-column: 1 / -1;
    }

    .form-field label {
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--brand-navy);
    }

    .form-field label .required {
      color: var(--accent-red);
    }

    .form-field input,
    .form-field textarea,
    .form-field select {
      padding: 0.75rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 1rem;
      font-family: var(--f-ui);
      transition: border-color 0.2s;
    }

    .form-field input:focus,
    .form-field textarea:focus,
    .form-field select:focus {
      outline: none;
      border-color: var(--brand-gold);
    }

    .form-field textarea {
      resize: vertical;
      min-height: 80px;
    }

    .save-contact-btn {
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 6px;
      font-family: 'Montserrat', sans-serif;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      cursor: pointer;
      transition: background 0.2s;
      justify-self: start;
    }

    .save-contact-btn:hover {
      background: #b07d3c;
    }

    @media (max-width: 768px) {
      .form-content {
        grid-template-columns: 1fr;
      }
    }

    /* Tab styles */
    .tab-btn {
      transition: all 0.2s;
    }

    .tab-btn.active {
      color: var(--brand-navy) !important;
    }

    .tab-btn.active::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--brand-gold);
    }

    .tab-btn:hover {
      color: var(--brand-navy) !important;
    }

    /* History view */
    .history-view {
      display: none;
      flex: 1;
      flex-direction: column;
      overflow: hidden;
    }

    .history-view.active {
      display: flex;
    }

    .history-loading {
      text-align: center;
      padding: 3rem;
      color: var(--text-muted);
    }

    .history-empty {
      text-align: center;
      padding: 3rem;
      color: var(--text-muted);
    }

    .history-empty i {
      font-size: 4rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    /* Filter panel */
    .filter-panel {
      background: var(--bg-soft);
      border-bottom: 1px solid var(--border);
      padding: 0.75rem 1.5rem;
    }

    .filter-row {
      display: flex;
      gap: 0.75rem;
      align-items: flex-start;
      flex-wrap: wrap;
    }

    /* Multi-select dropdown (CoreUI-inspired) */
    .ms-wrapper {
      position: relative;
      min-width: 150px;
      flex: 1;
      max-width: 260px;
    }
    .ms-label {
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin-bottom: 0.25rem;
    }
    .ms-trigger {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.25rem;
      min-height: 38px;
      padding: 0.25rem 0.5rem;
      border: 1px solid var(--gray-300);
      border-radius: 0.375rem;
      background: var(--white);
      cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .ms-trigger:hover {
      border-color: var(--brand-gold);
    }
    .ms-wrapper.open .ms-trigger {
      border-color: var(--brand-gold);
      box-shadow: 0 0 0 3px rgba(198,144,77,0.15);
    }
    .ms-tag {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.125rem 0.375rem;
      background: var(--brand-gold);
      color: #ffffff;
      border-radius: 0.25rem;
      font-size: 0.75rem;
      font-weight: 500;
      line-height: 1.4;
      white-space: nowrap;
    }
    .ms-tag-remove {
      background: none;
      border: none;
      color: var(--brand-navy);
      cursor: pointer;
      padding: 0;
      font-size: 0.875rem;
      line-height: 1;
      opacity: 0.8;
    }
    .ms-tag-remove:hover { opacity: 1; }
    .ms-search {
      flex: 1;
      min-width: 60px;
      border: none;
      outline: none;
      font-size: 0.8125rem;
      padding: 0.125rem 0;
      background: transparent;
      color: var(--brand-navy);
    }
    .ms-search::placeholder { color: var(--text-muted); }
    .ms-chevron {
      margin-left: auto;
      flex-shrink: 0;
      width: 0;
      height: 0;
      border: 4px solid transparent;
      border-top-color: var(--text-muted);
      transition: transform 0.15s;
    }
    .ms-wrapper.open .ms-chevron {
      transform: rotate(180deg);
      margin-top: -4px;
    }
    .ms-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      min-width: 220px;
      max-height: 260px;
      overflow-y: auto;
      background: var(--white);
      border: 1px solid var(--gray-300);
      border-radius: 0.375rem;
      box-shadow: 0 10px 25px rgba(0,0,0,0.1);
      z-index: 100;
    }
    .ms-wrapper.open .ms-dropdown { display: block; }
    .ms-option {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4375rem 0.75rem;
      font-size: 0.8125rem;
      color: var(--brand-navy);
      cursor: pointer;
      transition: background 0.1s;
    }
    .ms-option:hover { background: var(--gray-100); }
    .ms-option.selected { background: rgba(198,144,77,0.08); font-weight: 500; }
    .ms-option-check {
      width: 16px;
      height: 16px;
      border: 2px solid var(--gray-300);
      border-radius: 6px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s;
    }
    .ms-option.selected .ms-option-check {
      background: var(--brand-gold);
      border-color: var(--brand-gold);
    }
    .ms-option.selected .ms-option-check::after {
      content: '✓';
      color: white;
      font-size: 0.6875rem;
      font-weight: 700;
    }
    .ms-option-label { flex: 1; }
    .ms-option-count {
      color: var(--text-muted);
      font-size: 0.75rem;
    }
    .ms-empty {
      padding: 0.75rem;
      text-align: center;
      color: var(--text-muted);
      font-size: 0.8125rem;
    }

    .clear-filters-btn {
      padding: 0.5rem 1rem;
      background: transparent;
      color: var(--brand-navy);
      border: 1.5px solid var(--brand-navy);
      border-radius: 6px;
      font-size: 0.8125rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
      display: flex;
      align-items: center;
      gap: 0.375rem;
      align-self: flex-end;
      margin-top: 1.125rem;
    }

    .clear-filters-btn:hover {
      background: var(--brand-navy);
      color: #ffffff;
    }

    /* History content */
    .history-content {
      flex: 1;
      overflow-y: auto;
      padding: 1.5rem;
    }

    .history-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1rem;
    }

    @media (max-width: 768px) {
      .history-grid {
        grid-template-columns: 1fr;
      }
      
      .filter-row {
        flex-direction: column;
        align-items: stretch;
      }
      .ms-wrapper {
        max-width: 100%;
      }
      .card-qty-input {
        display: none !important;
      }
    }
    /* Product group header: wraps on mobile so sort+addAll go to second row */
    .product-group-header {
      display: flex; align-items: center; justify-content: space-between;
      flex-wrap: wrap; gap: 0.25rem 0.5rem; cursor: pointer; padding: 0.25rem 0;
    }
    .product-group-header-title { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
    .product-group-header-controls {
      display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
    }
    .result-count-badge {
      font-size: 0.75rem; color: var(--text-muted); background: var(--gray-100);
      border-radius: 9999px; padding: 0.125rem 0.5rem; flex-shrink: 0;
    }
    @media (max-width: 640px) {
      .product-group-header-title { flex-basis: 100%; }
      .result-count-badge { display: none; }
    }
    /* Sort controls: icon buttons always visible, dropdown hidden */
    .sort-desktop { display: none; align-items: center; gap: 0.5rem; }
    .sort-mobile { display: flex; gap: 0.25rem; }

    /* ─── Filter chips on product card groups ─────────── */
    .product-filter-bar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem;
      padding: 0.5rem 0; border-bottom: 1px solid var(--border-soft);
    }
    .product-filter-chip {
      display: inline-flex; align-items: center; gap: 0.25rem;
      padding: 0.25rem 0.625rem; border-radius: 9999px;
      font-size: 0.75rem; font-weight: 500; line-height: 1.2;
      border: 1px solid var(--gray-300); color: var(--text-soft);
      background: var(--bg-soft); cursor: pointer;
      transition: all 0.15s ease; white-space: nowrap;
    }
    .product-filter-chip:hover {
      border-color: var(--text-muted); background: var(--gray-100);
    }
    .product-filter-chip.active {
      background: var(--brand-gold); color: var(--brand-navy); border-color: var(--brand-gold);
    }
    .product-filter-chip.active:hover {
      background: var(--brand-gold-dark);
    }
    .product-filter-clear {
      font-size: 0.7rem; color: var(--accent-red); font-weight: 600;
      cursor: pointer; padding: 0.25rem 0.5rem; border: none;
      background: none; display: none;
    }
    .product-filter-clear:hover { color: var(--accent-red); }
    @media (max-width: 640px) {
      .product-filter-bar { gap: 0.25rem; padding: 0.375rem 0; }
      .product-filter-chip { font-size: 0.675rem; padding: 0.2rem 0.5rem; }
    }

    /* Delivery Date Modal */
    .delivery-date-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: var(--z-modal, 9500);
    }

    .delivery-date-card {
      background: var(--white);
      border-radius: 16px;
      padding: 2rem;
      max-width: 500px;
      width: 90%;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .delivery-date-card h2 {
      color: var(--brand-navy);
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .delivery-date-card p {
      color: var(--text-muted);
      margin-bottom: 1.5rem;
    }

    .date-input-group {
      margin-bottom: 1.5rem;
    }

    .date-input-group label {
      display: block;
      font-weight: 600;
      color: var(--brand-navy);
      margin-bottom: 0.5rem;
    }

    .date-input-group input {
      width: 100%;
      padding: 0.75rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 1rem;
      font-family: var(--f-ui);
      box-sizing: border-box;
    }

    .date-input-group input:focus {
      outline: none;
      border-color: var(--brand-gold);
    }

    .date-actions {
      display: flex;
      gap: 1rem;
    }

    .date-actions button {
      width: 100%;
      padding: 0.75rem;
      border: none;
      border-radius: var(--radius-md);
      font-weight: 600;
      cursor: pointer;
      font-family: var(--f-ui);
      box-sizing: border-box;
    }

    .date-actions .skip-btn {
      background: var(--gray-100);
      color: var(--text-muted);
    }

    .date-actions .confirm-btn {
      background: var(--brand-gold);
      color: #ffffff;
    }

    .date-actions .confirm-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* ═══════════════════════════════════════════
       EVENT PLANNER TAB
       ═══════════════════════════════════════════ */
    .event-planner-view {
      display: none;
      flex: 1;
      flex-direction: column;
      overflow: hidden;
      background: var(--bg-soft);
    }
    .event-planner-view.active { display: flex; }

    /* Settings Bar */
    .ep-settings {
      background: var(--white);
      border-bottom: 2px solid var(--border);
      padding: 1rem 1.5rem;
      flex-shrink: 0;
    }
    .ep-settings-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 0.75rem;
      align-items: end;
    }
    .ep-field label {
      display: block;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--brand-navy);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 0.25rem;
    }
    .ep-field select,
    .ep-field input {
      width: 100%;
      padding: 0.5rem 0.625rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 16px;
      font-family: var(--f-ui);
      background: var(--white);
      color: var(--text);
    }
    .ep-field select:focus,
    .ep-field input:focus {
      outline: none;
      border-color: var(--brand-gold);
    }

    /* Budget Mode Tabs */
    .ep-budget-mode {
      display: flex;
      gap: 0;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    .ep-budget-mode button {
      flex: 1;
      padding: 0.5rem 0.25rem;
      border: none;
      background: var(--white);
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s;
    }
    .ep-budget-mode button.active {
      background: var(--brand-gold);
      color: #ffffff;
    }

    /* AI Tip Bar */
    .ep-tip {
      background: linear-gradient(135deg, var(--status-warning-bg) 0%, var(--draft-border) 100%);
      border-bottom: 1px solid var(--accent-orange-light);
      padding: 0.5rem 1.5rem;
      font-size: 0.8125rem;
      color: var(--status-warning-text);
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-shrink: 0;
    }
    .ep-tip i { color: var(--accent-orange); }

    /* Main Content: Sidebar + Browse + Cart */
    .ep-body {
      flex: 1;
      display: flex;
      overflow: hidden;
    }
    /* Left category sidebar (visible in planning mode) */
    .ep-sidebar {
      width: 160px;
      background: var(--bg-soft);
      border-right: 1.5px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      flex-shrink: 0;
      padding: 0.5rem;
      gap: 0.375rem;
    }
    .ep-sidebar .ep-sidebar-title {
      font-size: 0.6875rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 0.25rem 0.375rem;
    }
    .ep-main {
      flex: 1;
      overflow-y: auto;
      padding: 1rem 1.5rem;
      -webkit-overflow-scrolling: touch;
    }

    /* Category Cards Grid (setup mode) */
    .ep-categories {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 0.75rem;
      margin-bottom: 1rem;
    }
    .ep-cat-card {
      background: var(--white);
      border: 2px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 0.875rem;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
      position: relative;
    }
    .ep-cat-card:hover {
      border-color: var(--brand-gold);
      box-shadow: 0 2px 8px rgba(198, 144, 77, 0.15);
    }
    .ep-cat-card.selected {
      border-color: var(--brand-gold);
      background: rgba(255, 255, 255, 0.75);
    }
    .ep-cat-card.active {
      border-color: var(--brand-navy);
      box-shadow: 0 0 0 2px rgba(26, 34, 56, 0.2);
    }
    .ep-cat-card .ep-cat-icon {
      font-size: 1.75rem;
      margin-bottom: 0.25rem;
    }
    .ep-cat-card .ep-cat-name {
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--brand-navy);
      margin-bottom: 0.25rem;
    }
    .ep-cat-card .ep-cat-progress {
      font-size: 0.6875rem;
      color: var(--text-muted);
    }
    .ep-cat-card .ep-cat-bar {
      height: 4px;
      background: var(--gray-200);
      border-radius: 2px;
      margin-top: 0.5rem;
      overflow: hidden;
    }
    .ep-cat-card .ep-cat-bar-fill {
      height: 100%;
      background: var(--brand-gold);
      border-radius: 2px;
      transition: width 0.3s;
    }
    .ep-cat-card .ep-cat-check {
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      width: 1.25rem;
      height: 1.25rem;
      border: 2px solid var(--gray-300);
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.625rem;
      color: transparent;
      transition: all 0.2s;
    }
    .ep-cat-card.selected .ep-cat-check {
      background: var(--brand-gold);
      border-color: var(--brand-gold);
      color: white;
    }
    /* Sidebar category item (planning mode) */
    .ep-sidebar-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.625rem;
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: all 0.15s;
      border: 1.5px solid transparent;
      position: relative;
    }
    .ep-sidebar-item:hover {
      background: var(--white);
      border-color: var(--border);
    }
    .ep-sidebar-item.active {
      background: var(--white);
      border-color: var(--brand-navy);
      box-shadow: 0 1px 4px rgba(26, 34, 56, 0.12);
    }
    .ep-sidebar-item .ep-sb-name {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--brand-navy);
      line-height: 1.2;
    }
    .ep-sidebar-item.active .ep-sb-name {
      color: var(--brand-navy);
    }
    .ep-sidebar-item .ep-sb-count {
      font-size: 0.625rem;
      color: var(--text-muted);
    }
    .ep-sidebar-item .ep-sb-bar {
      position: absolute;
      bottom: 0.25rem;
      left: 0.625rem;
      right: 0.625rem;
      height: 3px;
      background: var(--gray-200);
      border-radius: 2px;
      overflow: hidden;
    }
    .ep-sidebar-item .ep-sb-bar-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.3s;
    }

    /* Browse Panel */
    .ep-browse {
      background: var(--white);
      border: 2px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }
    .ep-browse-header {
      background: var(--brand-navy);
      color: white;
      padding: 0.75rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 700;
      font-size: 0.9375rem;
    }
    .ep-browse-search {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--border);
    }
    .ep-browse-search input {
      width: 100%;
      padding: 0.625rem 0.875rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 0.875rem;
      font-family: var(--f-ui);
    }
    .ep-browse-search input:focus {
      outline: none;
      border-color: var(--brand-gold);
    }
    .ep-browse-results {
      padding: 0.5rem;
      max-height: 400px;
      overflow-y: auto;
    }
    /* Rich product cards */
    .ep-card {
      background: var(--white);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 0.75rem;
      transition: border-color 0.15s, box-shadow 0.15s;
      margin-bottom: 0.5rem;
    }
    .ep-card:hover {
      border-color: var(--brand-gold);
      box-shadow: 0 2px 8px rgba(198, 144, 77, 0.12);
    }
    .ep-card-top { display: flex; gap: 0.625rem; }
    .ep-card-img { width: 3.5rem; height: 4.5rem; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
    .ep-card-body { flex: 1; min-width: 0; }
    .ep-card-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 0.125rem; word-break: break-word; }
    .ep-card-location { font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 0.125rem; }
    .ep-card-details { font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
    .ep-card-abv { color: var(--text-muted); font-weight: 600; }
    .ep-card-tasting { font-size: 0.6875rem; color: var(--text-soft); font-style: italic; line-height: 1.3; margin-bottom: 0.25rem; }
    .ep-card-keywords { display: flex; flex-wrap: wrap; gap: 0.1875rem; margin-bottom: 0.25rem; }
    .ep-card-kw { display: inline-block; background: var(--gray-100); color: var(--text); padding: 0.0625rem 0.375rem; border-radius: 0.75rem; font-size: 0.5625rem; font-weight: 500; border: 1px solid var(--border); }
    .ep-card-pairs { font-size: 0.625rem; color: var(--text-muted); }
    .ep-card-pairs i { font-size: 0.5625rem; color: var(--brand-gold); margin-right: 0.125rem; }
    .ep-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.375rem; border-top: 1px solid var(--border-soft); }
    .ep-card-pricing { display: flex; align-items: center; gap: 0.5rem; }
    .ep-card-price { font-size: 1rem; font-weight: 700; color: var(--brand-navy); }
    .ep-card-parker { background: var(--accent-orange-light); color: var(--text); font-size: 0.625rem; font-weight: 700; padding: 0.0625rem 0.3125rem; border-radius: 3px; }
    .ep-card-stock { font-size: 0.6875rem; font-weight: 600; }
    .ep-product-add {
      display: flex;
      align-items: center;
      gap: 0.375rem;
    }
    .ep-product-add input {
      width: 3rem;
      padding: 0.25rem;
      text-align: center;
      border: 1.5px solid var(--gray-300);
      border-radius: 6px;
      font-size: 0.8125rem;
    }
    .ep-product-add button {
      padding: 0.375rem 0.625rem;
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-size: 0.75rem;
      font-weight: 700;
      cursor: pointer;
    }
    .ep-product-add button:hover {
      background: #b07d3c;
    }

    /* Event Cart Sidebar */
    .ep-cart {
      width: 280px;
      background: var(--white);
      border-left: 2px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      overflow: hidden;
    }
    .ep-cart-header {
      background: var(--brand-navy);
      color: white;
      padding: 0.75rem 1rem;
      font-weight: 700;
      font-size: 0.9375rem;
      flex-shrink: 0;
    }
    .ep-cart-summary {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .ep-cart-budget {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
    }
    .ep-cart-budget-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 600;
    }
    .ep-cart-budget-val {
      font-size: 0.9375rem;
      font-weight: 700;
      color: var(--brand-navy);
    }
    .ep-cart-bar {
      height: 8px;
      background: var(--gray-200);
      border-radius: 4px;
      overflow: hidden;
      margin-bottom: 0.25rem;
    }
    .ep-cart-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 0.3s, background-color 0.3s;
    }
    .ep-cart-alerts {
      padding: 0.5rem 1rem;
      flex-shrink: 0;
    }
    .ep-alert {
      font-size: 0.75rem;
      padding: 0.375rem 0.5rem;
      border-radius: 6px;
      margin-bottom: 0.375rem;
      display: flex;
      align-items: center;
      gap: 0.375rem;
    }
    .ep-alert.warning {
      background: var(--status-warning-bg);
      color: var(--status-warning-text);
    }
    .ep-alert.success {
      background: var(--status-success-bg);
      color: var(--status-success-text);
    }
    .ep-alert.info {
      background: var(--status-info-bg);
      color: var(--status-info-text);
    }
    .ep-cart-items {
      flex: 1;
      overflow-y: auto;
      padding: 0.5rem;
      -webkit-overflow-scrolling: touch;
    }
    .ep-cart-cat-group {
      margin-bottom: 0.75rem;
    }
    .ep-cart-cat-label {
      font-size: 0.6875rem;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--text-muted);
      padding: 0.25rem 0.5rem;
      display: flex;
      justify-content: space-between;
    }
    .ep-cart-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.375rem 0.5rem;
      font-size: 0.75rem;
      border-radius: 6px;
    }
    .ep-cart-item:hover { background: var(--bg-soft); }
    .ep-cart-item-name {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--text);
    }
    .ep-cart-item-qty {
      width: 2.5rem;
      text-align: center;
      padding: 0.125rem;
      border: 1px solid var(--gray-300);
      border-radius: 4px;
      font-size: 0.75rem;
    }
    .ep-cart-item-price {
      font-weight: 600;
      color: var(--brand-navy);
      white-space: nowrap;
    }
    .ep-cart-item-remove {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.75rem;
      padding: 0.125rem;
    }
    .ep-cart-item-remove:hover { color: var(--accent-red); }
    .ep-cart-footer {
      border-top: 2px solid var(--border);
      padding: 0.75rem 1rem;
      flex-shrink: 0;
    }
    .ep-cart-total {
      display: flex;
      justify-content: space-between;
      font-weight: 700;
      font-size: 1.125rem;
      color: var(--brand-navy);
      margin-bottom: 0.5rem;
    }
    .ep-cart-per-head {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 0.75rem;
    }
    .ep-send-quote-btn {
      width: 100%;
      padding: 0.75rem;
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 0.875rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.375rem;
    }
    .ep-send-quote-btn:hover { background: #b07d3c; }
    .ep-send-quote-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    /* Setup mode: before categories are chosen */
    .ep-setup-mode .ep-browse,
    .ep-setup-mode .ep-cart { display: none; }
    .ep-setup-start-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 2rem;
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      cursor: pointer;
      margin-top: 1rem;
    }
    .ep-setup-start-btn:hover { background: #b07d3c; }
    .ep-setup-start-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    /* No-category empty state */
    .ep-empty {
      text-align: center;
      padding: 3rem 1rem;
      color: var(--text-muted);
    }
    .ep-empty i {
      font-size: 3rem;
      margin-bottom: 0.75rem;
    }

    /* ── AI Chat Panel ─────────────────────── */
    .ep-ai-panel {
      border-bottom: 1px solid var(--border);
      background: var(--bg-soft);
    }
    .ep-ai-toggle {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.625rem 1rem;
      cursor: pointer;
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--brand-navy);
      user-select: none;
    }
    .ep-ai-toggle i.fa-chevron-down { transition: transform 0.2s; }
    .ep-ai-toggle.collapsed i.fa-chevron-down { transform: rotate(-90deg); }
    .ep-ai-body {
      padding: 0 1rem 0.75rem;
    }
    .ep-ai-messages {
      max-height: 220px;
      overflow-y: auto;
      margin-bottom: 0.5rem;
      scroll-behavior: smooth;
    }
    .ep-ai-msg {
      margin-bottom: 0.5rem;
      padding: 0.5rem 0.75rem;
      border-radius: 10px;
      font-size: 0.8125rem;
      line-height: 1.45;
      max-width: 92%;
    }
    .ep-ai-msg.assistant {
      background: var(--white);
      border: 1px solid var(--border);
      color: var(--text);
    }
    .ep-ai-msg.user {
      background: var(--brand-navy);
      color: white;
      margin-left: auto;
    }
    .ep-ai-msg strong, .ep-ai-msg b { font-weight: 700; }
    .ep-ai-msg .ep-ai-search-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      margin-top: 0.375rem;
      padding: 0.25rem 0.625rem;
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-size: 0.75rem;
      font-weight: 700;
      cursor: pointer;
    }
    .ep-ai-msg .ep-ai-search-btn:hover { background: #b07d3c; }
    .ep-ai-followups {
      display: flex;
      flex-wrap: wrap;
      gap: 0.375rem;
      margin-top: 0.375rem;
    }
    .ep-ai-followup-btn {
      padding: 0.25rem 0.625rem;
      background: var(--gray-100);
      border: 1.5px solid var(--gray-300);
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s;
    }
    .ep-ai-followup-btn:hover {
      border-color: var(--brand-gold);
      background: rgba(255, 255, 255, 0.75);
      color: var(--brand-navy);
    }
    .ep-ai-input-row {
      display: flex;
      gap: 0.375rem;
    }
    .ep-ai-input-row input {
      flex: 1;
      padding: 0.5rem 0.75rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 0.8125rem;
      font-family: var(--f-ui);
    }
    .ep-ai-input-row input:focus {
      outline: none;
      border-color: var(--brand-gold);
    }
    .ep-ai-input-row button {
      padding: 0.5rem 0.75rem;
      background: var(--brand-navy);
      color: white;
      border: none;
      border-radius: var(--radius-md);
      font-size: 0.8125rem;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
    }
    .ep-ai-input-row button:hover { opacity: 0.9; }
    .ep-ai-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }
    .ep-ai-typing {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      padding: 0.375rem 0.75rem;
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .ep-ai-typing .dot {
      width: 6px; height: 6px;
      background: var(--gray-400);
      border-radius: 50%;
      animation: epTypingDot 1.2s infinite;
    }
    .ep-ai-typing .dot:nth-child(2) { animation-delay: 0.2s; }
    .ep-ai-typing .dot:nth-child(3) { animation-delay: 0.4s; }
    @keyframes epTypingDot {
      0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
      30% { opacity: 1; transform: scale(1); }
    }

    /* ── Preference Pills ──────────────────── */
    .ep-prefs-row {
      padding: 0.5rem 1rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-wrap: wrap;
      gap: 0.375rem;
      align-items: center;
    }
    .ep-prefs-row .ep-pref-label {
      font-size: 0.6875rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-right: 0.25rem;
    }
    .ep-pref-pill {
      padding: 0.1875rem 0.5rem;
      background: var(--white);
      border: 1.5px solid var(--gray-300);
      border-radius: 999px;
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s;
    }
    .ep-pref-pill:hover {
      border-color: var(--brand-gold);
      background: rgba(255, 255, 255, 0.75);
    }
    .ep-pref-pill.active {
      background: var(--brand-gold);
      color: #ffffff;
      border-color: var(--brand-gold);
    }
    .ep-pref-pill .ep-pill-name { margin-right: 0.25rem; }
    .ep-pref-pill .ep-pill-count {
      font-size: 0.5625rem;
      opacity: 0.7;
    }
    .ep-pref-pill.active .ep-pill-count { opacity: 0.9; }

    /* ── Guest Notes ──────────────────────── */
    .ep-guest-notes-row {
      padding: 0 1.5rem 0.5rem;
      overflow: hidden;
      background: var(--white);
      border-bottom: 2px solid var(--border);
    }
    .ep-notes-toggle {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: none;
      border: none;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      padding: 0.375rem 0;
      font-family: var(--f-ui);
    }
    .ep-notes-toggle:hover { color: var(--brand-navy); }
    .ep-notes-chevron {
      transition: transform 0.2s;
      font-size: 0.625rem;
      margin-left: auto;
    }
    .ep-guest-notes-row.open .ep-notes-chevron { transform: rotate(180deg); }
    .ep-notes-body {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.25s ease;
    }
    .ep-guest-notes-row.open .ep-notes-body { max-height: 120px; }
    .ep-notes-body textarea {
      width: 100%;
      padding: 0.5rem 0.625rem;
      border: 2px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 0.8125rem;
      font-family: var(--f-ui);
      resize: none;
      color: var(--text);
      background: var(--bg-soft);
    }
    .ep-notes-body textarea:focus { outline: none; border-color: var(--brand-gold); background: var(--white); }
    .ep-notes-hint {
      font-size: 0.625rem;
      color: var(--text-muted);
      margin-top: 0.25rem;
      margin-bottom: 0.25rem;
    }

    /* ── Variety Hint Banner ──────────────── */
    .ep-variety-hint {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: linear-gradient(135deg, var(--status-warning-bg), var(--bg-gold-lightest));
      border: 1px solid var(--accent-orange-light);
      border-radius: var(--radius-md);
      margin: 0 1rem 0.5rem;
      font-size: 0.75rem;
      color: var(--status-warning-text);
    }
    .ep-variety-hint i { color: var(--accent-orange-light); flex-shrink: 0; }
    .ep-variety-hint span { flex: 1; }
    .ep-variety-hint button {
      background: none;
      border: none;
      color: var(--status-warning-text);
      font-size: 1rem;
      cursor: pointer;
      padding: 0;
      line-height: 1;
      flex-shrink: 0;
    }

    /* ── Cocktail Planner ──────────────────── */
    .ep-cocktail-planner {
      padding: 1rem;
    }
    .ep-cocktail-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 0.625rem;
      margin-bottom: 1rem;
    }
    .ep-cocktail-card {
      background: var(--white);
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 0.75rem;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }
    .ep-cocktail-card:hover {
      border-color: var(--accent-purple-light);
      box-shadow: 0 2px 8px rgba(139,92,246,0.15);
    }
    .ep-cocktail-card.selected {
      border-color: var(--accent-purple-light);
      background: var(--status-purple-bg);
    }
    .ep-cocktail-card .ep-ck-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
    .ep-cocktail-card .ep-ck-name { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
    .ep-cocktail-card .ep-ck-spirit { font-size: 0.6875rem; color: var(--text-muted); }
    .ep-cocktail-card .ep-ck-servings {
      margin-top: 0.375rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
    }
    .ep-cocktail-card .ep-ck-servings input {
      width: 3rem;
      padding: 0.125rem;
      text-align: center;
      border: 1.5px solid var(--gray-300);
      border-radius: 4px;
      font-size: 0.8125rem;
    }
    .ep-cocktail-card .ep-ck-servings label {
      font-size: 0.625rem;
      color: var(--text-muted);
    }
    .ep-cocktail-req {
      background: var(--white);
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 1rem;
      margin-top: 0.75rem;
    }
    .ep-cocktail-req h4 {
      margin: 0 0 0.5rem;
      font-size: 0.875rem;
      color: var(--brand-navy);
    }
    .ep-cocktail-req-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.375rem 0;
      border-bottom: 1px solid var(--border-soft);
      font-size: 0.8125rem;
    }
    .ep-cocktail-req-item:last-child { border-bottom: none; }
    .ep-cocktail-req-item .bottles {
      font-weight: 700;
      color: var(--brand-navy);
    }
    .ep-cocktail-req-item button {
      padding: 0.25rem 0.5rem;
      background: var(--brand-gold);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-size: 0.6875rem;
      font-weight: 700;
      cursor: pointer;
    }

    /* Mobile adjustments */
    @media (max-width: 768px) {
      .ep-settings-grid {
        grid-template-columns: 1fr 1fr;
      }
      .ep-body {
        flex-direction: column;
      }
      .ep-cart {
        width: 100%;
        border-left: none;
        border-top: 2px solid var(--border);
        max-height: 40vh;
      }
      .ep-categories {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
      }
      .ep-browse-results {
        max-height: 300px;
      }
    }

/* ═══ MOBILE polish — shopify-quote-builder ═══ */
@media (max-width: 768px) {
  /* iOS-zoom safety */
  input, textarea, select,
  .qty-input,
  .card-qty-input,
  .estimate-field-input { font-size: 16px; }

  /* Bigger tap targets */
  button, .btn { min-height: 36px; }

  /* Slightly bigger keyword chips for readability */
  .ep-card-kw { font-size: 0.7rem; padding: 2px 8px; }
  .ep-card-name { font-size: 0.9rem; }
  .ep-card-tasting { font-size: 0.75rem; }

  /* Position-fixed floating elements respect safe-area */
  .ep-fab,
  .toast-notification,
  .floating-action {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
  }

  /* Catalog/estimate panels stack on mobile */
  .catalog-panel, .estimate-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 480px) {
  /* Each line-item field gets its own row */
  .estimate-item-fields { flex-direction: column; gap: 0.5rem; }
  .estimate-item-fields > div {
    flex: 1 1 100% !important;
    min-width: 0;
    width: 100%;
  }
  .qty-input,
  .estimate-field-input { width: 100%; }
  .ep-card-img { width: 3rem; height: 4rem; }
}


/* ═══ Brand-parity additions (quote-builder audit 2026-07-07) ═══ */

/* Keyboard focus ring — the gold ring pattern (already used on one input)
   applied to the controls that had outline:none with border-only fallback */
.qty-input:focus,
.ep-field input:focus,
.ep-field select:focus,
.ep-field textarea:focus,
.search-input:focus,
.confirm-btn:focus-visible,
.save-contact-btn:focus-visible,
.submit-quote-btn:focus-visible,
.ep-send-quote-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(198, 144, 77, 0.15);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
