/* ===========================================================================
   GenkiCars, phone app shell
   On a phone the site behaves like an app: a bottom tab bar instead of a
   hamburger, a menu that rises as a sheet, room for the notch and the home
   indicator. Installed from the home screen (display-mode: standalone) it
   also gets its own back button, because there is no browser chrome left.
   Desktop is untouched: everything here is inside the phone breakpoint or the
   standalone query.
   =========================================================================== */

.app-tabs, .app-back { display: none; }

/* Language switch: a quiet pill in the header. */
.footer-blurb { font-size: .9rem; max-width: 44ch; line-height: 1.6; }

/* Japanese reads best with more line height, no Latin-style tight tracking, and
   line breaks at natural phrase boundaries where the browser supports it. */
.lang-ja body, body.lang-ja { line-height: 1.85; }
.lang-ja h1, .lang-ja h2, .lang-ja h3 { line-height: 1.4; letter-spacing: .01em; word-break: auto-phrase; }
.lang-ja p, .lang-ja li { line-break: strict; }

.footer-disclaimer {
  margin: 2rem 0 0; max-width: 70ch;
  color: var(--ink-3); font-size: .82rem;
}

@media (max-width: 999px) {
  /* ---- bottom tab bar ---------------------------------------------------- */
  .app-tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 120;
    padding-bottom: env(safe-area-inset-bottom);
    /* Solid, not blurred: a blur here is redrawn on every frame of a scroll. */
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(16,20,24,.08);
  }
  .app-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 56px; padding: 6px 2px 4px;
    background: none; border: 0; cursor: pointer;
    font: inherit; font-size: .68rem; font-weight: 600; letter-spacing: .01em;
    color: var(--ink-3);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none; user-select: none;
  }
  .app-tab:hover { text-decoration: none; color: var(--ink); }
  .app-tab svg {
    width: 24px; height: 24px;
  }
  .app-tab[aria-current="page"], .app-tab[aria-expanded="true"] { color: var(--ink); }
  .app-tab[aria-current="page"] svg { color: var(--green); }
  .app-tab:active svg { transform: scale(.92); }

  /* Room under the content for the bar, given to the footer itself so the
     page ends in the footer's white, not in a grey strip below it. */
  .site-footer { padding-bottom: calc(1.5rem + 56px + env(safe-area-inset-bottom)); }
  /* No rubber-band stretch past the footer (it read as the page scrolling
     on forever on iPhone). */
  html, body { overscroll-behavior-y: none; }

  /* ---- menu button, top right: round, 40px, no border (Lay, 2026-11-15) -- */
  .nav-toggle {
    display: inline-flex; flex: 0 0 auto; width: 40px; height: 40px;
    border: 0; border-radius: 50%; margin-inline-end: -6px;
  }
  .nav-toggle:active { background: var(--bg-soft); }
  .nav-toggle span { transition: background-color .18s ease; }
  .nav-toggle span::before, .nav-toggle span::after { transition: top .18s ease, transform .18s ease; }
  /* Open: the three lines turn into an X. */
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

  /* ---- the menu: a drop-down just under the header, inside it ------------ */
  .mobile-nav {
    position: absolute; inset-inline: 0; top: 100%;
    max-height: calc(100dvh - 60px - 56px - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-top: 1px solid var(--line);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 14px 32px rgba(16,20,24,.14);
    padding-block: 4px 8px;
  }
  .mobile-nav.is-open { display: block; animation: menu-drop .18s ease-out; }
  @keyframes menu-drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { .mobile-nav.is-open { animation: none; } }
  .mobile-nav a { padding-block: 1rem; }
  .mobile-nav a:last-child { border-bottom: 0; }
  .mobile-nav > a:has(+ .lang-switch) { border-bottom: 0; }   /* one line above the languages, not two */
  /* The page behind is dimmed; the layer sits under the header (100), so the
     header and the menu stay bright. */
  .app-scrim {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(16,20,24,.28);
  }

  /* ---- accounting firms button in the phone header ------------------------ */
  .header-dealer {
    display: inline-flex; align-items: center; gap: .4rem; flex: 0 1 auto; min-width: 0;
    padding: .45rem .85rem; border-radius: var(--r-pill);
    background: #111111; color: #fff; font-size: .82rem; font-weight: 700; line-height: 1.15;
    text-align: center;   /* the full wording always shows: on a narrow phone it wraps to two lines */
  }
  .header-dealer:hover { color: #fff; text-decoration: none; background: #262626; }
  .header-dealer .dealer-btn__icon { flex: 0 0 auto; color: #fff; }

  /* Tighter header on phones: the tab bar carries the navigation now. */
  .site-header { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header__inner { min-height: 60px; gap: .75rem; }
  /* Logo on the left and smaller, the menu button on the right (Lay, 2026-11-15). */
  .site-logo img { height: 30px; }
  .site-logo__name { font-size: 1rem; }
  .header-actions { margin-inline-start: auto; gap: .5rem; min-width: 0; }
}
/* The accounting firms pill is for phones only: the computer top bar keeps its own. */
@media (min-width: 1000px) { .header-dealer { display: none; } }
/* Small phones: no icon, a smaller pill and logo, tighter gaps, so the menu
   button never goes off screen. */
@media (max-width: 379px) {
  .site-header__inner { gap: .5rem; }
  .site-logo img { height: 26px; }
  .site-logo__name { font-size: .92rem; }
  .header-actions { gap: .35rem; }
  .header-dealer { padding: .4rem .7rem; font-size: .76rem; }
  .header-dealer .dealer-btn__icon { display: none; }
}

/* ---- installed on the home screen ---------------------------------------- */
@media (display-mode: standalone) {
  /* The status bar sits above the page (style "default"); this is 0 then,
     and only matters on devices that still overlay it. */
  .site-header { padding-top: env(safe-area-inset-top); }
  .topbar { display: none !important; }
  .app-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-inline-start: -8px;
    color: var(--ink); border-radius: 50%;
  }
  .app-back svg { width: 24px; height: 24px; }
  [dir="rtl"] .app-back svg { transform: scaleX(-1); }
  .app-back:active { background: var(--bg-soft); }
  /* No rubber-band pull revealing a blank page behind the app. */
  html, body { overscroll-behavior-y: none; }
  /* The footer is web furniture; in the app the tabs and More sheet cover it. */
  .site-footer .footer-grid { display: none; }
  .site-footer { margin-top: 2rem; padding-top: 1rem; }
}

/* ---- Touch screens: feel like an app ----------------------------------------
   touch-action: manipulation tells the phone a tap is never the start of a
   double-tap zoom, so it answers at once instead of waiting to see. */
a, button, label, input, select, textarea, summary, [role="button"] { touch-action: manipulation; }
@media (hover: none) {
  .btn:hover { transform: none; }
  .app-tab { transition: color .15s ease; }
  .app-tab svg { transition: transform .16s cubic-bezier(.32, .72, 0, 1); }
  .app-tab:active svg { transform: scale(.86); }
}

/* Header: the buyer's Sign in / My requests link, on every page (not only the match pages). */
/* Computer header: logo | links + "Send a request" | divider | account.
   White, black type, the green only on the one button that matters. */
@media (min-width: 1000px) {
  .site-header { background: rgba(255,255,255,.96); box-shadow: 0 1px 0 rgba(16,20,24,.04), 0 10px 30px rgba(16,20,24,.06); }
  .site-header__inner { min-height: 74px; gap: 1rem; }
  .site-nav { gap: .35rem; }
  .site-nav a:not(.btn) { padding: .6rem 1rem; border-radius: var(--r-pill); color: var(--ink); font-weight: 600; font-size: .95rem; }
  .site-nav a:not(.btn):hover { background: var(--bg-soft); }
  .site-nav a:not(.btn)[aria-current="page"] { background: var(--bg-soft); }
  .site-nav a:not(.btn)[aria-current="page"]::after { display: none; }
  .header-actions { padding-inline-start: 1rem; margin-inline-start: .25rem; border-inline-start: 1px solid var(--line); }
}
/* The nav's link styles must not reach the button inside it. */
.site-nav a.btn, .site-nav a.btn:hover { color: var(--btn-fg); background: var(--btn-bg); }
.site-nav a.btn::after { display: none; }
.site-nav .header-cta, .header-cta { white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.15rem .6rem .7rem; border-radius: var(--r-pill); font-weight: 700; }
.header-cta__plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--logo-ink); color: #fff; }
.header-cta[aria-current="page"] { box-shadow: 0 0 0 3px var(--green-ring); }
/* The account: a black disc with the person, the words beside it. */
.header-account {
  display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .95rem .3rem .3rem; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink); font-weight: 600; font-size: .92rem; white-space: nowrap;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.header-account:hover, .header-account[aria-current="page"] { border-color: var(--ink); box-shadow: var(--shadow-sm); text-decoration: none; }
.header-account__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--logo-ink); color: #fff; position: relative; }
.header-account.is-in .header-account__icon::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px #fff; }
.header-account__name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
/* Sign out (signed in only): a quiet text button beside the account. */
.header-signout { margin: 0; }
.header-signout button { border: 0; background: none; padding: .4rem .2rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.header-signout button:hover { color: var(--ink); text-decoration: underline; }
.mobile-nav__hi { margin: 0; padding: .55rem 0; font-weight: 700; color: var(--ink); }
.mobile-nav__signout .header-signout button { padding-inline: 0; font-size: 1rem; }
/* Phones: the tab bar carries both; Sign out is in the menu. */
@media (max-width: 999px) { .header-account, .header-cta, .header-actions > .header-signout { display: none; } }

/* ---- Footer in deep navy (Lay, 2026-11-09) -----------------------------------
   Loaded after site.css, so these win over its white footer. The logo is
   turned white here, so any logo uploaded in the admin still reads on navy. */
/* Black with red touches since 2026-11-17 (Lay: green footer looked strange). */
.site-footer { background: #111111; color: rgba(255,255,255,.72); border-top: 4px solid var(--red, #B5462A); }
.site-footer a, .footer-copyright a { color: rgba(255,255,255,.88); }
.site-footer a:hover, .footer-copyright a:hover { color: #E8957C; }   /* a red that reads on black */
.site-footer h3, .footer-name { color: #fff; }
.site-footer h3::after { content: ""; display: block; width: 28px; height: 3px; margin-top: .55rem; border-radius: 2px; background: var(--red, #B5462A); }
.footer-bottom { border-top-color: rgba(255,255,255,.14); }
.footer-disclaimer { color: rgba(255,255,255,.6); }
.footer-logo { filter: brightness(0) invert(1); }
.footer-logo--white { filter: none; }   /* the designer's white logo needs no filter */
