:root {
      --brand-color: #4285f4;
      --background-light: #f8f9fa;
      --border-color: #e0e0e0;
      --text-primary: #202124;
      --text-secondary: #5f6368;
      --error-color: #d93025;
      --success-color: #34a853;
      --warning-color: #f9ab00;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html, body {
      width: 100%;
      height: 100%;
      position: relative;
    }
    body {
      font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
      background: transparent;
    }
.ai-message {
    position: relative;
}

.info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-block;
    margin-left: 10px;
    cursor: pointer;
    font-style: italic;
    color: #5f6368;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
}

.tooltip {
    display: none;
    position: absolute;
    top: 35px;
    left: 10px;
    right: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
    font-size: 13px;
    line-height: 1.4;
    max-width: calc(100vw - 40px);
    word-wrap: break-word;
}

/* Rating star styles */
.rating-star:hover,
.rating-star.highlighted,
.truck-rating-star:hover,
.truck-rating-star.highlighted {
    color: #f9ab00 !important;
    transform: scale(1.1);
}

#menuIcons {
    max-width: 0;
    transition: max-width 0.5s ease-out, opacity 0.3s ease-out;
    transform-origin: right center;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
    z-index: 1002;
}
#menuIcons.open {
    /* Limit the expanded menu to the same width as the chat container */
    max-width: 400px;
    opacity: 1;
    pointer-events: auto;
    transition: max-width 0.5s ease-in, opacity 0.5s ease-in;
}
#triggerIcon {
    transition: transform 0.3s ease-in-out;
}
#triggerIcon.rotated {
    transform: rotate(45deg);
}

#triggerButton {
    position: relative;
    z-index: 1003;
}
    /* Welcome tooltip shown on first visit */
#welcome-bubble {
  position: fixed;
  bottom: 100px;          /* ~40 px above the chat icon */
  right: 20px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 20px 24px;
  z-index: 1000;
  display: none;          /* default hidden */
  font-size: 15px;
  line-height: 1.4;
}
#welcome-bubble p { margin-bottom: 10px; font-weight: 500; color: var(--text-primary); }
#welcome-bubble small { font-size: 12px; color: var(--text-secondary); }
#welcome-bubble a { text-decoration: underline; }
#welcome-bubble .close-bubble {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}
    /* Floating chat icon */
    .chat-overlay.show ~ .chat-icon { display: none; }
    .chat-icon {
      position: absolute;
      bottom: 5px;
      right: 5px;
      width: 60px;
      height: 60px;
      background: var(--brand-color);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 20px rgba(66, 133, 244, 0.4);
      transition: all 0.3s ease;
      z-index: 1000;
    }
    .chat-icon:hover { transform: scale(1.1); }
    .chat-icon svg { width: 28px; height: 28px; fill: #fff; pointer-events: none; }

    .message-toast {
      position: fixed;
      bottom: 90px;
      right: 20px;
      max-width: 320px;
      background: #fff;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      padding: 16px;
      z-index: 999;
      display: none;
      opacity: 0;
      transition: opacity 0.3s, transform 0.3s;
      transform: translateY(20px);
    }

    .message-toast.show {
      display: block;
      opacity: 1;
      transform: translateY(0);
    }

    .notification-badge-closed {
      position: absolute;
      top: -2px;
      right: -2px;
      background-color: var(--error-color);
      color: white;
      border-radius: 50%;
      width: 20px;
      height: 20px;
      font-size: 12px;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid var(--brand-color);
      z-index: 1001;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% {
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.7);
      }
      70% {
        box-shadow: 0 0 0 10px rgba(217, 48, 37, 0);
      }
      100% {
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0);
      }
    }

    /* Overlay & container */
    .chat-overlay {
      position: fixed;
      top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      z-index: 1001;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .chat-overlay.show { display: flex; opacity: 1; }

    .chat-container {
      position: fixed;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
      display: flex;
      flex-direction: column;
      transform: scale(0.95);
      transition: transform 0.3s ease, opacity 0.3s ease;
      opacity: 0;
      bottom: 90px;
      right: 20px;
      width: 400px;
      height: 600px;
      max-height: calc(100vh - 110px);
    }
    .chat-overlay.show .chat-container { transform: scale(1); opacity: 1; }
    @media (max-width: 768px) {
      .chat-container {
        width: 100%; height: 100%; border-radius: 0;
        top: 0; left: 0; bottom: 0; right: 0; max-height: 100%;
      }
    }

    /* Header */
    .chat-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 8px 8px 16px;
      border-bottom: 1px solid var(--border-color);
      flex-shrink: 0;
    }
    .header-title { display: flex; align-items: center; gap: 8px; font-weight: 500; }

    .status-dot {
      width: 10px; height: 10px; border-radius: 50%;
      background: #ccc; transition: background-color 0.5s ease;
    }
    .status-dot.online  { background: var(--success-color); }
    .status-dot.offline { background: var(--error-color); }

    .close-button {
      background: none; border: none; cursor: pointer; padding: 8px;
    }
    .close-button svg {
      width: 20px; height: 20px; fill: var(--text-secondary); pointer-events: none;
    }

    .settings-container {
        position: relative;
    }

    .settings-button {
        background: none; border: none; cursor: pointer; padding: 8px;
    }

    .settings-button svg {
        width: 20px; height: 20px; fill: var(--text-secondary);
    }

    .settings-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        padding: 8px;
        z-index: 1002;
    }

    .settings-menu label {
        display: block;
        padding: 8px 12px;
        cursor: pointer;
    }

    /* Icon Menu */
    .icon-menu-container {
      display: flex;
      overflow-x: auto;
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      flex-shrink: 0;
      -ms-overflow-style: none;
      scrollbar-width: none;
    }
    .icon-menu-container::-webkit-scrollbar {
      display: none;
    }
    .icon-menu-btn {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      padding: 4px 12px;
      font-size: 12px;
      color: var(--text-secondary);
      flex-shrink: 0;
      transition: color 0.2s, border-color 0.2s;
    }
    .notification-badge {
      position: absolute;
      top: 2px;
      right: 12px;
      background-color: var(--error-color);
      color: white;
      border-radius: 50%;
      width: 18px;
      height: 18px;
      font-size: 12px;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid white;
      z-index: 1;
    }
    .icon-menu-btn:hover {
      color: var(--text-primary);
    }
    .icon-menu-btn.active {
      color: var(--brand-color);
      border-bottom-color: var(--brand-color);
    }
    .icon-menu-btn svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
    }

    .collapsible-menu {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      flex-shrink: 0;
    }
    .menu-toggle-btn {
      display: none;
      background: none;
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 6px 12px;
      font-size: 13px;
      cursor: pointer;
      color: var(--text-secondary);
    }
    .collapsible-menu.collapsed .icon-menu-container {
      display: none;
    }
    .collapsible-menu.collapsed .menu-toggle-btn {
      display: inline-block;
    }

    /* Views */
    .chat-main     { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    .view          { padding: 16px; height: 100%; overflow-y: auto; display: none; flex-direction: column; }
    #trends-view   { display: flex; }

    /* Main menu buttons (styled like info cards) */
    .menu-button {
      width: 100%;
      text-align: left;
      background: #fff;
      border: 1px solid var(--border-color);
      padding: 16px;
      border-radius: 8px;
      font-size: 16px;
      cursor: pointer;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--text-primary);
      transition: all 0.2s ease;
    }
    .menu-button:hover {
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border-color: var(--brand-color);
      background: #fff;
    }

    /* Submit buttons (feedback/report) */
    .submit-form-btn {
      width: 100%; text-align: center;
      background: var(--brand-color); color: #fff;
      border: 1px solid var(--brand-color);
      padding: 14px;
      border-radius: 20px;
      font-size: 16px;
      cursor: pointer;
      margin-bottom: 12px;
    }
    .submit-form-btn:hover {
      background: #1a73e8; border-color: var(--brand-color);
    }

    .feedback-input {
      width: 100%; flex-grow: 1; font-family: inherit;
      font-size: 16px; padding: 8px;
      border: 1px solid var(--border-color); border-radius: 4px; margin-top: 1em;
    }
    select.feedback-input {
      flex-grow: 0;
    }

    /* Chat area */
    #chat-interface-view { padding: 0; display: none; position: relative; }
    .scrollable-content  { flex-grow: 1; overflow-y: auto; padding: 16px; position: relative; }
    .chat-view           { display: block; }

    .scroll-to-bottom-btn {
      position: absolute;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      display: none; /* Hidden by default */
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin: 0;
      padding: 8px 16px;
      background: var(--brand-color);
      color: white;
      border: none;
      border-radius: 20px;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(0,0,0,0.2);
      z-index: 10;
      font-size: 14px;
    }
    .scroll-to-bottom-btn svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
    }
    .unread-count-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      background: var(--brand-color);
      color: #fff;
      border-radius: 50%;
      font-size: 11px;
      font-weight: 500;
      min-width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2px;
    }

    /* Trends Table (minimalistic like homepage) */
    .trends-table-wrapper {
      background: #fff;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
      margin: 0;
      width: 100%;
      flex: 1;
    }
    #trends-view {
      padding: 8px;
    }
    .trends-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }
    .trends-table thead th {
      background: #f8fafc;
      padding: 12px 10px;
      text-align: left;
      font-weight: 600;
      color: #374151;
      border-bottom: 2px solid #e5e7eb;
      font-size: 13px;
    }
    .trends-table thead th:nth-child(2),
    .trends-table thead th:nth-child(3) {
      text-align: center;
      width: 70px;
    }
    .trends-row {
      border-bottom: 1px solid #f3f4f6;
      cursor: pointer;
      transition: background-color 0.15s ease;
    }
    .trends-row:hover {
      background-color: #f9fafb;
    }
    .trends-row:last-child {
      border-bottom: none;
    }
    .trends-checkpoint {
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .trends-checkpoint .checkpoint-name {
      font-weight: 500;
      color: var(--text-primary);
    }
    .trends-checkpoint .checkpoint-time {
      font-size: 11px;
      color: var(--text-secondary);
    }
    .trends-queue {
      padding: 10px 8px;
      text-align: center;
      font-weight: 600;
      color: #2563eb;
    }
    .trends-wait {
      padding: 10px 8px;
      text-align: center;
      font-weight: 500;
      font-size: 13px;
    }
    /* Row status colors (left border indicator) */
    .trends-row.status-clear {
      border-left: 3px solid var(--success-color);
    }
    .trends-row.status-clear .trends-wait { color: var(--success-color); }
    .trends-row.status-moderate {
      border-left: 3px solid var(--warning-color);
    }
    .trends-row.status-moderate .trends-wait { color: var(--warning-color); }
    .trends-row.status-busy {
      border-left: 3px solid #e65100;
    }
    .trends-row.status-busy .trends-wait { color: #e65100; }
    .trends-row.status-critical {
      border-left: 3px solid var(--error-color);
    }
    .trends-row.status-critical .trends-wait { color: var(--error-color); }

    /* Checkpoint link */
    .checkpoint-link {
      color: var(--text-primary);
      text-decoration: none;
      font-weight: 500;
      transition: color 0.15s ease;
    }
    .checkpoint-link:hover {
      color: var(--brand-color);
      text-decoration: underline;
    }

    /* Three-dot menu */
    .trends-menu-cell {
      width: 32px;
      padding: 4px !important;
      position: relative;
    }
    .trends-menu-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.15s ease;
    }
    .trends-menu-btn:hover {
      background-color: #f0f0f0;
    }
    .trends-menu-btn svg {
      fill: var(--text-secondary);
    }

    /* Dropdown menu */
    .trends-dropdown {
      display: none;
      position: absolute;
      right: 8px;
      top: 100%;
      background: #fff;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      z-index: 100;
      min-width: 140px;
      overflow: hidden;
    }
    .trends-dropdown.open {
      display: block;
    }
    .trends-dropdown-item {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 10px 12px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 13px;
      color: var(--text-primary);
      text-align: left;
      transition: background-color 0.15s ease;
    }
    .trends-dropdown-item:hover {
      background-color: #f5f5f5;
    }
    .trends-dropdown-item svg {
      fill: var(--text-secondary);
      flex-shrink: 0;
    }
    .trends-dropdown-item:first-child {
      border-bottom: 1px solid #f0f0f0;
    }

    /* Legacy location cards (keep for compatibility) */
    .location-card {
      background: #fff; border: 1px solid var(--border-color);
      border-radius: 8px; padding: 16px; margin-bottom: 12px;
      cursor: pointer; transition: all 0.2s ease;
    }
    .location-card:hover {
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border-color: var(--brand-color);
    }
    .location-name    { font-weight: 500; margin-bottom: 4px; }
    .location-details { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }

    .status-indicator {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 8px; border-radius: 12px;
      font-size: 12px; font-weight: 500;
    }
    .status-clear    { background: #e8f5e8; color: var(--success-color); }
    .status-moderate { background: #fef7e0; color: var(--warning-color); }
    .status-busy     { background: #fff3e0; color: #e65100; }
    .status-critical { background: #fce8e6; color: var(--error-color); }

    /* Messages */
    .chat-log-container { display: flex; flex-direction: column; gap: 16px; }
    .user-message,
    .ai-message {
      max-width: 90%; padding: 12px 16px; border-radius: 18px;
      line-height: 1.5; word-wrap: break-word;
      position: relative;
    }
    .user-message { background: var(--background-light); align-self: flex-end; border-bottom-right-radius: 4px; }
    .ai-message   { background: #fff; align-self: flex-start; border: 1px solid var(--border-color); border-top-left-radius: 4px; }

    .eco-leaf-label {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 20px;
      height: 20px;
    }
    .eco-leaf-label svg {
      fill: var(--success-color);
      opacity: 0.7;
    }

    /* Citations inside AI answer */
    .ai-message .answer-text .citation {
      font-size: 0.8em; vertical-align: super; color: var(--brand-color);
      font-weight: 500; cursor: default; padding: 0 2px;
    }

    .ai-message .answer-text a {
      color: var(--brand-color);
      text-decoration: underline;
      word-break: break-all;
    }
    .ai-message .answer-text a:hover {
      color: #1a73e8;
    }

    /* Enhanced Loading State */
    .ai-loading-container {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
      padding: 4px 0;
    }

    .ai-loading-visual {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .ai-loading-spinner {
      position: relative;
      width: 36px;
      height: 36px;
    }

    .ai-loading-spinner svg {
      width: 36px;
      height: 36px;
      animation: spin-smooth 2s linear infinite;
    }

    .ai-loading-spinner .spinner-track {
      fill: none;
      stroke: #e8eaed;
      stroke-width: 3;
    }

    .ai-loading-spinner .spinner-progress {
      fill: none;
      stroke: var(--brand-color);
      stroke-width: 3;
      stroke-linecap: round;
      stroke-dasharray: 80 200;
      stroke-dashoffset: 0;
      animation: spinner-dash 1.5s ease-in-out infinite;
    }

    @keyframes spin-smooth {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    @keyframes spinner-dash {
      0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
      }
      50% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -35;
      }
      100% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -124;
      }
    }

    .ai-loading-text {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .ai-loading-status {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-primary);
      min-height: 20px;
    }

    .ai-loading-status span {
      display: inline-block;
      animation: fade-text 0.4s ease-out;
    }

    @keyframes fade-text {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .ai-loading-estimate {
      font-size: 12px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .ai-loading-estimate .estimate-icon {
      width: 12px;
      height: 12px;
      fill: var(--text-secondary);
    }

    .ai-loading-elapsed {
      font-size: 14px;
      font-weight: 600;
      color: var(--brand-color, #1a73e8);
      margin-top: 4px;
    }

    .ai-loading-elapsed .elapsed-time {
      font-variant-numeric: tabular-nums;
    }

    .ai-loading-progress-bar {
      width: 100%;
      max-width: 200px;
      height: 3px;
      background: #e8eaed;
      border-radius: 2px;
      overflow: hidden;
      margin-top: 4px;
    }

    .ai-loading-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--brand-color), #34a853);
      border-radius: 2px;
      width: 0%;
      transition: width 0.5s ease-out;
    }

    /* Shimmer effect for the progress bar */
    .ai-loading-progress-fill::after {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
      );
      animation: shimmer 2s infinite;
    }

    @keyframes shimmer {
      0% { left: -100%; }
      100% { left: 100%; }
    }

    /* Stage indicators */
    .ai-loading-stages {
      display: flex;
      gap: 6px;
      margin-top: 8px;
    }

    .ai-loading-stage {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #e0e0e0;
      transition: background 0.3s ease, transform 0.3s ease;
    }

    .ai-loading-stage.active {
      background: var(--brand-color);
      transform: scale(1.2);
    }

    .ai-loading-stage.completed {
      background: var(--success-color);
    }

    /* Legacy loading dots (fallback) */
    .loading-dots { display: inline-flex; gap: 4px; align-items: center; }
    .loading-dots span {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--brand-color);
      animation: bounce 1.4s infinite ease-in-out both;
    }
    .loading-dots span:nth-child(1) { animation-delay: -0.32s; }
    .loading-dots span:nth-child(2) { animation-delay: -0.16s; }
    @keyframes bounce { 0%,80%,100% { transform: scale(0);} 40% { transform: scale(1);} }

    .error-message { color: var(--error-color); }
    .error-message a {
      font-weight: 500;
      text-decoration: underline;
    }
    .error-message a:hover {
      text-decoration: none;
    }

    /* Footer actions */
    .response-actions {
      display: flex; gap: 8px;
    }
    .response-actions button {
      background: none; border: none; cursor: pointer;
      padding: 6px; display: flex; align-items: center; justify-content: center;
      opacity: 0.7; min-height: 32px; min-width: 32px;
    }
    .response-actions button:hover { opacity: 1; }
    .response-actions button.active svg { fill: var(--brand-color); }
    .response-actions button:disabled svg { fill: #ccc; }
    .response-actions button svg { width: 20px; height: 20px; }

    .sources-container { text-align: left; margin-top: 0; }
    .message-footer    { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
    .message-timestamp { font-size: 12px; color: var(--text-secondary); }
    .user-message .message-footer { justify-content: flex-end; }
    .eco-leaf { width: 20px; height: 20px; fill: var(--success-color); opacity: 0.8; }

    .sources-toggle {
      background: none; border: 1px solid var(--border-color);
      color: var(--text-secondary); font-size: 12px;
      padding: 4px 10px; border-radius: 12px; cursor: pointer;
    }
    .sources-list {
      display: none; text-align: left;
      border: 1px solid var(--border-color); border-radius: 8px;
      list-style: none; padding: 8px; margin-top: 8px;
      background: var(--background-light);
    }
    .sources-list .close-sources {
      float: right; border: none; background: none;
      font-size: 1.4em; line-height: 1; cursor: pointer;
      opacity: 0.5; padding: 0 4px;
    }
    .sources-list .close-sources:hover { opacity: 1; }
    .sources-list ul { padding: 0; margin: 0; margin-top: 20px; }
    .sources-list li {
      padding: 4px; font-size: 13px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sources-list a { color: var(--brand-color); text-decoration: none; }
    .sources-list a:hover { text-decoration: underline; }

    /* Suggested questions */
    .suggested-questions {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border-color);
    }
    .suggestions-label {
      font-size: 12px;
      color: var(--text-secondary);
      margin-bottom: 8px;
    }
    .suggestion-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .suggestion-chip {
      background: var(--background-light);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 6px 14px;
      font-size: 13px;
      color: var(--text-primary);
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: left;
      line-height: 1.3;
    }
    .suggestion-chip:hover {
      background: var(--brand-color);
      color: white;
      border-color: var(--brand-color);
    }
    .suggestion-chip:active {
      transform: scale(0.97);
    }

    /* Input area */
    .chat-input-area {
      padding: 12px 16px; border-top: 1px solid var(--border-color);
      background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); flex-shrink: 0;
    }
    .input-wrapper {
      display: flex; align-items: center;
      background: var(--background-light); border-radius: 24px; padding: 4px 4px 4px 16px;
    }
    .chat-input {
      flex: 1; border: none; background: none; outline: none;
      font-size: 16px; padding: 8px;
    }
    .send-button {
      background: var(--brand-color);
      border: none; border-radius: 50%;
      width: 40px; height: 40px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: background-color 0.2s; flex-shrink: 0;
    }
    .send-button svg { width: 20px; height: 20px; fill: #fff; }
    .send-button:disabled { background: #ccc; cursor: not-allowed; }

    .presets-container {
      display: none;
      overflow-x: auto;
      white-space: nowrap;
      padding-bottom: 8px;
      -ms-overflow-style: none;  /* IE and Edge */
      scrollbar-width: none;  /* Firefox */
    }
    .presets-container::-webkit-scrollbar {
      display: none; /* Chrome, Safari and Opera */
    }
    .preset-btn {
      display: inline-block;
      background: var(--background-light);
      border: 1px solid var(--border-color);
      padding: 6px 12px;
      border-radius: 16px;
      font-size: 13px;
      cursor: pointer;
      margin-right: 8px;
      color: var(--text-primary);
    }
    .preset-btn:hover {
      background: #e0e0e0;
    }
    .preset-btn:disabled, .icon-menu-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

    /* Thinking dots animation */
    .thinking-dots {
        display: inline-flex;
        gap: 4px;
        padding: 8px 12px;
    }
    .thinking-dots span {
        width: 8px;
        height: 8px;
        background: var(--brand-color);
        border-radius: 50%;
        animation: thinking-bounce 1.4s infinite ease-in-out both;
    }
    .thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
    .thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
    .thinking-dots span:nth-child(3) { animation-delay: 0s; }
    @keyframes thinking-bounce {
        0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
        40% { transform: scale(1); opacity: 1; }
    }
    .thinking-message {
        background: var(--background-light);
        border-radius: 12px;
        margin: 8px 0;
        display: inline-block;
    }

    /* Queue input container */
    .queue-input-container {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .queue-number-input {
        width: 70px;
        min-width: 60px;
        max-width: 80px;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 14px;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    .queue-number-input:focus {
        outline: none;
        border-color: var(--brand-color);
    }
    .queue-unit-select {
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 14px;
        background: #fff;
        cursor: pointer;
        box-sizing: border-box;
        flex-shrink: 1;
        min-width: 0;
        max-width: 100px;
    }
    .queue-unit-select:focus {
        outline: none;
        border-color: var(--brand-color);
    }
    .submit-queue-btn {
        background: var(--brand-color);
        color: #fff;
        border: none;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 14px;
        cursor: pointer;
        box-sizing: border-box;
        flex-shrink: 0;
        white-space: nowrap;
    }
    .submit-queue-btn:hover {
        background: #3367d6;
    }
    .confirm-queue-btn {
        background: var(--success-color);
        color: #fff;
        border: none;
    }
    .confirm-queue-btn:hover {
        background: #2d8a47;
    }

    .cooldown-timer {
      text-align: center; font-size: 12px; color: var(--text-secondary); padding-top: 8px;
    }

    .disclaimer-text {
      font-size: 10px;
      color: var(--text-secondary);
      text-align: center;
      padding: 8px 16px 0;
    }
    .disclaimer-text a {
      color: var(--text-secondary);
      text-decoration: underline;
    }

    /* Toast */
    .feedback-toast {
      position: absolute;
      bottom: 100px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(32, 33, 36, 0.9);
      color: #fff;
      padding: 10px 20px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
      z-index: 2000;
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      white-space: nowrap;
    }

    /* Follow-up prompts */
    .follow-up-prompt {
      background: var(--background-light);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 16px;
      margin-top: 12px;
      max-width: 90%;
      align-self: flex-start;
    }
    .follow-up-prompt p {
      margin-bottom: 12px;
      font-size: 14px;
      color: var(--text-primary);
      line-height: 1.4;
    }
    .follow-up-buttons {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .follow-up-buttons button {
      background: var(--brand-color);
      color: #fff;
      border: none;
      padding: 8px 20px;
      border-radius: 18px;
      font-size: 14px;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    .follow-up-buttons button:hover {
      background: #1a73e8;
    }
    .follow-up-buttons button:last-child {
      background: #fff;
      color: var(--text-primary);
      border: 1px solid var(--border-color);
    }
    .follow-up-buttons button:last-child:hover {
      background: var(--background-light);
      border-color: var(--text-secondary);
    }
    #menu-component {
      position: absolute;      /* Overlay the menu on top of chat */
      top: 56px;               /* Align just below the header */
      left: 0;
      right: 0;
      width: 100%;
      z-index: 1003;
      pointer-events: none; /* Make container non-interactive */
    }
    #triggerButton, #menuIcons {
        pointer-events: auto; /* Make children interactive */
    }


/* Local feedback form for data reports */
.local-feedback-container {
  margin-top: 12px;
  padding: 12px;
  background: var(--background-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.local-feedback-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.local-feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}
.local-feedback-textarea:focus {
  outline: none;
  border-color: var(--brand-color);
}
.local-feedback-buttons {
  display: flex;
  gap: 8px;
}
.local-feedback-submit {
  background: var(--brand-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.local-feedback-submit:hover {
  background: #1a73e8;
}
.local-feedback-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.local-feedback-cancel {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.local-feedback-cancel:hover {
  background: var(--background-light);
}

/* Queue Report Confirmation */
.queue-confirm-message {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f4fd 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-color);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 8px 0;
}
.queue-confirm-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.queue-confirm-buttons {
  display: flex;
  gap: 10px;
}
.queue-confirm-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}
.queue-confirm-yes {
  background: var(--success-color, #34a853);
  color: #fff;
}
.queue-confirm-yes:hover {
  background: #2d8a47;
  transform: translateY(-1px);
}
.queue-confirm-no {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.queue-confirm-no:hover {
  background: #f5f5f5;
}

/* AI Suggested Questions */
.ai-suggestions {
  margin: 12px 0;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f4fd 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-color);
  border-radius: 8px;
}
.ai-suggestions-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.ai-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-suggestion-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.4;
}
.ai-suggestion-btn:hover {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
  transform: translateX(4px);
}
.ai-suggestion-btn:active {
  transform: translateX(2px);
}

/* Scroll hint indicator */
.scroll-hint {
  text-align: center;
  padding: 12px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--brand-color);
  animation: bounce 1.5s ease-in-out infinite;
  transition: opacity 0.3s ease;
}
.scroll-hint.fade-out {
  opacity: 0;
  pointer-events: none;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* POI Submission View Styles */
.poi-location-status {
  font-size: 13px;
  padding: 4px 0;
}
.poi-location-status.loading {
  color: #666;
}
.poi-location-status.success {
  color: #2e7d32;
}
.poi-location-status.error {
  color: #c62828;
}
#poi-view .feedback-input {
  margin-bottom: 12px;
}
#poi-view label {
  display: block;
  margin-bottom: 6px;
}

/* Navigator Action Button */
.navigator-action {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.navigator-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}
.navigator-action-btn:hover {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.navigator-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}
.navigator-action-btn i {
  font-size: 14px;
}
.navigator-action-btn .navigator-external-icon {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 2px;
}

