/* ══════════════════════════════════════════════════════
   MOBILE.CSS
   Single source of truth for all mobile layout.
   Zero media queries exist in any other CSS file.
   Breakpoint: max-width 768px.
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── BACKGROUND — reposition to golden sunset crop ── */
  body {
    background:
      linear-gradient(rgba(247, 240, 226, 0.15), rgba(247, 240, 226, 0.15)),
      url('/static/chatbot/banner.jpg') 75% 20% / cover no-repeat;
    background-attachment: fixed;
  }

  /* ── FOUNDATION ── */
  html, body {
    height: 100%;
    overflow: hidden;
  }

  /* ── PAGE — fixed full-height flex column ── */
  #page {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── HERO LAYER — compact fixed bar ── */
  #hero-layer {
    height: 96px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    pointer-events: none;
  }

  /* Blue gradient replaces the desktop SVG curve */
  #hero-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to right,
      rgba(0, 116, 168, 0.72) 0%,
      rgba(0, 116, 168, 0.45) 55%,
      rgba(92, 61, 30, 0.10) 100%
    );
    z-index: 0;
  }

  /* Desktop SVG curve hidden on mobile */
  .hero-svg {
    display: none;
  }

  /* ── HERO PHOTO — circle avatar, top-left ── */
  .hero-photo {
    position: absolute;
    top: 8px;
    left: 12px;
    width: 76px;
    height: 88px;
    border-radius: 0;
    border: none;
    background: transparent;
    object-fit: cover;
    object-position: center top;
    z-index: 3;
    pointer-events: none;
    filter: brightness(1.08) contrast(1.05) saturate(1.05);
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    bottom: auto;
  }

  /* ── HERO TEXT — beside avatar ── */
  .hero-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 98px;
    right: 12px;
    z-index: 3;
    padding: 0;
    gap: 2px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
  }

  .hero-name {
    font-size: clamp(16px, 4.5vw, 22px);
    letter-spacing: 0.02em;
    line-height: 1.1;
  }

  .hero-title {
    font-size: clamp(11px, 3vw, 14px);
    letter-spacing: 0.06em;
    line-height: 1.45;
    text-shadow:
      1px 1px 2px rgba(0, 0, 0, 0.85),
      0 0 8px rgba(0, 0, 0, 0.6);
  }

  /* Tagline too long for mobile — hidden */
  .hero-tagline {
    display: none;
  }

  /* ── HERO SPACER — matches fixed hero height ── */
  #hero-spacer {
    height: 96px;
    flex-shrink: 0;
  }

  /* ── MOBILE NAV BAR — shown on mobile, hidden on desktop ── */
  #mobile-nav {
    display: block;
    flex-shrink: 0;
    background: rgba(0, 116, 168, 0.55);
    border-bottom: 1px solid rgba(212, 168, 75, 0.30);
    z-index: 15;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  /* Toggle button — shows current view name + chevron */
  #mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: rgba(247, 240, 226, 0.95);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  }

  #mobile-nav-toggle .nav-current {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #mobile-nav-toggle .nav-chevron {
    font-size: 18px;
    color: rgba(212, 168, 75, 0.9);
    transition: transform 0.22s ease;
    line-height: 1;
  }

  #mobile-nav-toggle.open .nav-chevron {
    transform: rotate(180deg);
  }

  /* Drawer — collapsed by default, opened by JS toggle ── */
  #mobile-nav-drawer {
    display: none;
    flex-direction: column;
    border-top: 0.5px solid rgba(212, 168, 75, 0.2);
  }

  #mobile-nav-drawer.open {
    display: flex;
  }

  .mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: none;
    border: none;
    border-bottom: 0.5px solid rgba(212, 168, 75, 0.12);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 15px;
    color: rgba(247, 240, 226, 0.88);
    text-align: left;
    width: 100%;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn:last-child {
    border-bottom: none;
  }

  .mobile-nav-btn.active {
    background: rgba(212, 168, 75, 0.22);
    color: #D4A84B;
  }

  /* ── LEFT PANEL — replaced by mobile nav, hidden ── */
  #left-panel {
    display: none;
  }

  /* ── BODY ROW — single column, fills remaining height ── */
  #body-row {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    display: flex;
  }

  /* ── RIGHT PANEL — hidden ── */
  #right-panel {
    display: none;
  }

  /* ── RIGHT CONTENT — fills all remaining space ── */
  #right-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Cream fill — slimmer on mobile ── */
  #cream-fill {
    height: 6px;
    background: rgba(247, 240, 226, 0.75);
  }

  /* Accent line — full width, no side fades ── */
  #accent-line {
    height: 4px;
    background: linear-gradient(
      90deg,
      rgba(166, 61, 47, 0.55) 0%,
      rgba(212, 168, 75, 0.85) 50%,
      rgba(139, 105, 20, 0.55) 100%
    );
  }

  /* Main content — full width, solid cream bg for readability ── */
  #main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
    background: rgba(247, 240, 226, 0.72);
    -webkit-overflow-scrolling: touch;
  }

  /* ── FOOTER — hidden, saves space ── */
  #site-footer {
    display: none;
  }

  /* ── CHAT ── */
  .chat-shell {
    max-width: 100%;
    height: 100%;
  }

  .chat-intro {
    font-size: 13px;
    padding: 0 0.25rem;
  }

  .msg-bubble {
    max-width: 88%;
    font-size: 16px;
  }

  .msg-bubble-user {
    max-width: 80%;
    font-size: 16px;
  }

  .prompts-row {
    gap: 6px;
    margin-bottom: 0.75rem;
  }

  .prompt-chip {
    font-size: 13px;
    padding: 0.4rem 0.8rem;
  }

  .input-bar {
    padding: 0.6rem 0;
  }

  /* 16px prevents iOS auto-zoom on input focus */
  .chat-input {
    font-size: 16px;
  }

  .send-btn {
    padding: 0.5rem 1rem;
    font-size: 14px;
  }

  /* ── DATA DISCLAIMER — mobile ── */
  .chat-disclaimer {
    font-size: 10px;
    padding: 0.4rem 0.5rem 0.2rem;
  }

}