/* VenueOS — Header styles */

    /* Header - mobile-first */
    .header {
      width: 100%;
      margin: 0;
      box-sizing: border-box;
      padding: 16px 20px 20px;
      padding-top: max(16px, env(safe-area-inset-top));
      background: var(--header-bg);
    }

    .header-top {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 16px;
      margin-bottom: 20px;
    }

    .crest-block {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      min-width: 0;
      justify-self: start;
    }

    .crest-icon {
      width: 140px;
      height: auto;
      filter: invert(1);
      opacity: 0.9;
    }

    .crest-venue {
      font-size: 20px;
      font-weight: 500;
      letter-spacing: 0.15em;
      color: var(--ink);
      display: block;
      text-align: center;
      line-height: 1.2;
    }
    .crest-venue:empty {
      display: none;
    }

    .logo-block {
      text-align: center;
      padding: 0 12px;
      min-width: 0;
      justify-self: center;
    }

    .logo-main {
      font-size: 24px;
      font-weight: 600;
      letter-spacing: 0.08em;
      color: var(--ink);
      display: block;
      line-height: 1.2;
    }

    .logo-sub {
      font-size: 14px;
      font-weight: 500;
      letter-spacing: 0.15em;
      color: var(--ink);
      margin-left: 8px;
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 12px;
      justify-self: end;
    }

    .quiz-btn {
      width: auto;
      height: 28px;
      min-width: auto;
      min-height: 28px;
      padding: 0 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      background: none;
      border: none;
      border-radius: 0;
      cursor: pointer;
      flex-shrink: 0;
      transition: opacity 0.2s;
      box-shadow: none;
    }

    .quiz-btn .quiz-btn-emoji {
      display: inline-block;
      filter: sepia(0.4) saturate(2) hue-rotate(260deg);
      animation: quiz-emoji-vibrate 0.4s ease-in-out infinite;
    }

    @keyframes quiz-emoji-vibrate {
      0%, 100% { transform: translate(0, 0); }
      20% { transform: translate(-1px, 1px); }
      40% { transform: translate(1px, -1px); }
      60% { transform: translate(-1px, -1px); }
      80% { transform: translate(1px, 1px); }
    }

    .quiz-btn:hover, .quiz-btn:focus {
      opacity: 0.85;
    }

    .quiz-btn:focus-visible {
      outline: 2px solid var(--quiz-cyan);
      outline-offset: 2px;
    }


    @keyframes quiz-btn-shake {
      0%, 90%, 100% { transform: rotate(0deg); }
      92% { transform: rotate(-8deg); }
      94% { transform: rotate(8deg); }
      96% { transform: rotate(-6deg); }
      98% { transform: rotate(6deg); }
    }

    @keyframes quiz-btn-pulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(77, 208, 225, 0.2); }
      50% { box-shadow: 0 0 16px 4px rgba(77, 208, 225, 0.15); }
    }

    @media (prefers-reduced-motion: reduce) {
      .quiz-btn { animation: none; }
      .quiz-btn .quiz-btn-emoji { animation: none; }
      .item-card:hover,
      .wine-detail-card:hover { transform: none; }
      .item-card:hover .item-card-img,
      .cocktail-card:hover .item-card-img,
      .wine-detail-card:hover .wine-card-image img { transform: none; }
      .quiz-q-block.slide-out,
      .quiz-q-block.slide-in { animation: none; }
      .quiz-heart.heartbeat,
      .quiz-heart.losing { animation: none; }
      .quiz-challenge-ico { animation: none; transform: scale(1); }
      .quiz-challenge-card.reveal { animation: none; transform: scale(1); opacity: 1; }
      .quiz-sparkle.active { animation: none; }
      .quiz-end-msg.master { animation: none; }
      .quiz-lvl:hover { transform: none; }
      .quiz-done-btn:hover,
      .quiz-play-again:hover { transform: none; }
      .quiz-sparkle.active { animation: none; opacity: 0; }
      .quiz-end-msg.master { animation: none; }
    }

    .mode-toggle {
      width: 48px;
      height: 28px;
      min-width: 48px;
      background: var(--toggle-track);
      border: none;
      border-radius: 12px;
      cursor: pointer;
      position: relative;
      transition: background 0.2s;
    }

    .mode-toggle::after {
      content: '';
      position: absolute;
      top: 2px;
      right: 2px;
      width: 22px;
      height: 22px;
      background: var(--brass-light);
      border-radius: 50%;
      transition: transform 0.2s;
    }

    body.dinner-mode .mode-toggle::after {
      left: 2px;
      right: auto;
      transform: none;
    }

    .mode-toggle:focus-visible {
      outline: 2px solid var(--brass-light);
      outline-offset: 2px;
    }

    .lang-toggle {
      min-width: 44px;
      min-height: 28px;
      height: 28px;
      padding: 0 10px;
      background: var(--input-bg);
      border: 1px solid var(--border-inactive);
      border-radius: 8px;
      color: var(--text-primary);
      font-family: inherit;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.05em;
      cursor: pointer;
      transition: all 0.2s;
    }
    .lang-toggle:hover, .lang-toggle:focus-visible {
      border-color: var(--border-inactive-strong);
    }
    .lang-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .allergy-filter-btn {
      width: 36px;
      height: 28px;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--input-bg);
      border: 1px solid var(--border-inactive);
      border-radius: 8px;
      color: var(--text-primary);
      cursor: pointer;
      transition: all 0.2s;
    }
    .allergy-filter-btn:hover, .allergy-filter-btn:focus-visible {
      border-color: var(--border-inactive-strong);
      color: var(--accent);
    }
    .allergy-filter-btn.active {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--gold-subtle);
    }
    body:not(.dinner-mode) .allergy-filter-btn.active {
      background: #c5d4d0;
      border-color: #1a4a3d;
      color: #1a4a3d;
      border-width: 1.5px;
      box-shadow: 0 1px 3px rgba(26,74,61,.25);
    }
    .allergy-filter-btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    /* Search row: search bar (filter inside on mobile) */
    .search-row {
      display: flex;
      align-items: center;
      width: 100%;
      min-width: 0;
      margin: 0 0 12px;
      box-sizing: border-box;
    }
    .search-row .search-bar {
      flex: 1;
      min-width: 0;
      margin: 0;
    }
    /* Allergy filter inside search bar: no extra border, blend with bar */
    .search-bar .allergy-filter-btn {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      margin: -4px -8px -4px 0;
      padding: 0;
      background: none;
      border: none;
      border-radius: 50%;
      color: var(--text-muted);
    }
    .search-bar .allergy-filter-btn:hover,
    .search-bar .allergy-filter-btn:focus-visible {
      color: var(--accent);
      background: rgba(26,74,61,0.08);
    }
    body.dinner-mode .search-bar .allergy-filter-btn:hover,
    body.dinner-mode .search-bar .allergy-filter-btn:focus-visible {
      background: rgba(212,184,114,0.2);
    }
    .search-bar .allergy-filter-btn.active {
      color: var(--accent);
      background: var(--gold-subtle);
    }
    body:not(.dinner-mode) .search-bar .allergy-filter-btn.active {
      color: #1a4a3d;
      background: #c5d4d0;
    }
    .search-bar .allergy-filter-btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    /* Allergy filter inside search bar on all viewports */
    .search-bar .allergy-filter-btn { display: inline-flex; }

    /* Search bar */
    .search-bar {
      max-width: 90%;
      margin: 0 auto 12px;
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--input-bg);
      border: 1px solid var(--border-inactive);
      border-radius: 999px;
      padding: 12px 20px;
      min-height: 44px;
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    @media (min-width: 769px) {
      .search-row {
        justify-content: center;
      }
      .search-row .search-bar {
        flex: 0 0 auto;
        width: 100%;
        max-width: 640px;
        margin: 0 auto 12px;
      }
    }

    .search-bar svg {
      width: 18px;
      height: 18px;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .search-bar input {
      flex: 1;
      background: none;
      border: none;
      color: var(--text-primary);
      font-family: inherit;
      font-size: 14px;
      outline: none;
    }

    .search-bar input::placeholder {
      color: var(--text-muted);
    }

    .search-bar input:focus {
      outline: none;
    }

    .search-bar:focus-within {
      border-color: var(--border-inactive-strong);
      box-shadow: 0 0 0 2px rgba(26,74,61,0.12);
    }
    body.dinner-mode .search-bar:focus-within {
      box-shadow: 0 0 0 2px rgba(212,184,114,0.2);
    }

    /* Filter button */
    .filter-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 20px;
    }

    .filter-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--input-bg);
      color: var(--text-primary);
      border: 1px solid var(--border-inactive);
      border-radius: 999px;
      padding: 12px 20px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      cursor: pointer;
      transition: all 0.2s ease;
      min-height: 44px;
      touch-action: manipulation;
    }

    .filter-btn:hover, .filter-btn:focus-visible {
      border-color: var(--border-inactive-strong);
    }

    .filter-btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .filter-btn svg {
      width: 18px;
      height: 18px;
    }

    /* Navigation */
    .nav-wrap {
      position: sticky;
      top: 0;
      z-index: 100;
      width: 100%;
      margin: 0;
      box-sizing: border-box;
      background: var(--page-bg);
      border-bottom: 1px solid var(--border-inactive);
      padding: 16px 20px 12px;
    }
    body.dinner-mode .nav-wrap {
      background: var(--header-bg);
      border-bottom-color: rgba(255,255,255,.08);
    }

    .main-tabs {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 24px;
      margin-bottom: 16px;
    }

    .main-tab {
      background: none;
      border: none;
      color: var(--accent);
      font-family: inherit;
      font-size: 16px;
      font-weight: 500;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      cursor: pointer;
      padding: 8px 0 10px;
      min-height: 44px;
      position: relative;
      transition: color 0.2s;
      touch-action: manipulation;
    }

    .main-tab:hover {
      color: var(--text-secondary);
    }

    .main-tab.active {
      font-weight: 600;
    }
    .main-tab.active::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--accent);
    }

    .main-tab:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 4px;
    }

    .sub-pills {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-bottom: 4px;
    }

    .sub-pills::-webkit-scrollbar {
      display: none;
    }

    .sub-pill {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--toggle-track);
      border: 1px solid var(--border-inactive);
      color: var(--text-primary);
      border-radius: 999px;
      padding: 10px 18px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: 0.06em;
      cursor: pointer;
      transition: all 0.2s ease;
      min-height: 44px;
      touch-action: manipulation;
      scroll-snap-align: start;
    }

    .sub-pill:hover:not(.active) {
      border-color: var(--border-inactive-strong);
      background: var(--card);
    }

    .sub-pill.active {
      background: var(--accent);
      border-color: var(--accent);
      color: var(--sub-pill-active-fg, var(--text-primary));
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(26,74,61,0.25);
    }
    body.dinner-mode .sub-pill.active {
      box-shadow: 0 2px 12px rgba(212,184,114,0.2);
    }

    .sub-pill.active .sub-pill-icon {
      color: var(--text-primary);
    }

    .sub-pill .sub-pill-icon {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    .sub-pill .sub-pill-icon.rose { color: var(--rose-pink); }
    .sub-pill.active .sub-pill-icon.rose { color: var(--sub-pill-active-fg, var(--text-primary)); }

    .sub-pills-food,
    .sub-pills-drinks {
      justify-content: center;
    }

    .sub-pills-food,
    .sub-pills-drinks {
      display: none;
    }
    .nav-wrap.tab-food .sub-pills-food {
      display: flex;
    }
    .nav-wrap.tab-drinks .sub-pills-drinks {
      display: flex;
    }
    .nav-wrap.tab-drinks .sub-pills-food {
      display: none;
    }
    .nav-wrap.tab-food .sub-pills-drinks {
      display: none;
    }
    .nav-wrap.tab-standards .sub-pills-food,
    .nav-wrap.tab-standards .sub-pills-drinks {
      display: none;
    }

    .sub-pill:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    /* Mobile overrides for header */
    @media (max-width: 768px) {
      .header {
        width: 100%;
        padding: 12px 12px 14px 6px;
        margin: 0;
        box-sizing: border-box;
      }

      .search-row {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
      }

      .header-top {
        gap: 4px;
        align-items: center;
        flex-wrap: nowrap;
      }

      .crest-block {
        flex-shrink: 0;
      }

      .crest-icon {
        width: 90px;
      }

      .crest-venue {
        font-size: 10px;
        letter-spacing: 0.1em;
      }

      .header-controls {
        flex-shrink: 0;
        gap: 4px;
      }

      .header-controls .lang-toggle {
        min-width: 32px;
        padding: 0 5px;
        font-size: 11px;
      }

      .quiz-btn,
      .mode-toggle {
        width: 40px;
        height: 24px;
        min-width: 40px;
        min-height: 24px;
      }

      .logo-block {
        padding: 0 6px 0 2px;
        min-width: 0;
        text-align: center;
      }

      .logo-main {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .logo-sub {
        font-size: 10px;
        margin-left: 4px;
        letter-spacing: 0.1em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .search-bar {
        padding: 10px 14px;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
      }

      .nav-wrap {
        width: 100%;
        margin: 0;
        padding: 10px 12px 8px;
        box-sizing: border-box;
      }

      .nav-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      .filter-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
      }

      .main-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 10px;
      }

      .main-tab {
        text-align: center;
        min-height: 40px;
        font-size: 11px;
        letter-spacing: 0.08em;
      }

      .nav-wrap.tab-food .sub-pills-food,
      .nav-wrap.tab-drinks .sub-pills-drinks {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding-bottom: 8px;
        overflow-x: visible;
        scroll-snap-type: none;
      }

      .sub-pill {
        min-height: 40px;
        padding: 6px 6px;
        font-size: 11px;
        letter-spacing: 0.02em;
        justify-content: center;
        text-align: center;
        min-width: 0;
      }

      .sub-pill .sub-pill-icon {
        width: 12px;
        height: 12px;
      }

      .header-controls .quiz-btn,
      .header-controls .mode-toggle {
        min-width: 40px;
        min-height: 24px;
      }
    }

    @media (min-width: 600px) {
      .logo-main { font-size: 28px; }
      .sub-pills { padding-bottom: 8px; }
    }
