/* EgySwiss · phone and tablet layer · Hana, 2026-11-03 (EG-3).
   The approved prototype was drawn for desktop with inline styles; this file makes it work from
   390px up without touching the desktop design. Rules here only apply under 900px (tablet) and
   560px (phone). Inline styles are overridden by attribute selectors with !important, on purpose:
   it is the one place the layout changes, so the desktop stays exactly as approved. */

/* Header: burger and phone panel (hidden on desktop). */
.hd-burger { display: none; }
.hd-mnav { display: none; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .hd-b .hd-row { height: 64px; padding: 0 20px; }
  .hd-logo img { height: 32px; }
  .hd-act { display: none !important; }
  .hd-burger { display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 44px; height: 44px; border: 1px solid var(--es-line); background: #fff; color: var(--es-ink, #1a1a1a);
    font-size: 18px; cursor: pointer; border-radius: 0; }
  .hd-mnav.open { display: grid; padding: 8px 20px 20px; background: #fff; border-top: 1px solid var(--es-line);
    max-height: calc(100vh - 64px); overflow-y: auto; }
  .hd-mnav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--es-line); text-decoration: none;
    font-family: var(--font-text); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--es-slate); }
  .hd-mnav a.on { color: var(--es-red); }
  .hd-mnav .hd-mtel { border-bottom: 0; color: var(--es-red); display: flex; gap: 10px; align-items: center; }

  /* Top bar: only the e-mail on small screens. */
  [data-screen-label] > div:first-child > div > div:first-child > span:nth-child(2) { display: none !important; }

  /* Every inline grid of two or more columns becomes two columns, then one on a phone. */
  #root [style*="grid-template-columns"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #root [style*="grid-template-columns"][style*="1fr 1fr"]:not([style*="repeat"]) { grid-template-columns: 1fr !important; }
  /* Fixed widths and min-widths never exceed the screen. */
  #root [style*="width"] { max-width: 100% !important; }
  #root [style*="min-width"] { min-width: 0 !important; }
  #root img, #root video, #root svg { max-width: 100%; }
  /* Side padding of the kit's containers drops from 32px to 20px. */
  #root [style*="padding: 0px 32px"], #root [style*="padding:0 32px"] { padding-left: 20px !important; padding-right: 20px !important; }
  #root section, #root footer { overflow-x: clip; }
  /* Big headings scale down. */
  #root h1 { font-size: clamp(30px, 8vw, 44px) !important; line-height: 1.08 !important; }
  #root h2 { font-size: clamp(26px, 6.4vw, 36px) !important; line-height: 1.12 !important; }
  /* Sticky side columns and tall fixed heights relax. */
  #root [style*="position: sticky"] { position: static !important; }
  #root section [style*="height: 100vh"], #root section [style*="min-height"] { min-height: 0 !important; }
}

@media (max-width: 560px) {
  #root [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  #root [style*="grid-template-columns"] > * { min-width: 0; }
  #root input, #root select, #root textarea { max-width: 100%; min-width: 0; }
  #root [style*="display: flex"][style*="gap"]:not([style*="column"]) { flex-wrap: wrap !important; }
  #root [style*="padding"][style*="32px"] { padding-left: 20px !important; padding-right: 20px !important; }
  #root [style*="padding"][style*="96px"], #root [style*="padding"][style*="88px"], #root [style*="padding"][style*="80px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  #root [style*="font-size: 6"], #root [style*="font-size: 7"], #root [style*="font-size: 8"] { font-size: 40px !important; }
  #root [style*="font-size: 4"], #root [style*="font-size: 5"] { font-size: 32px !important; line-height: 1.1 !important; }
  /* Product and card grids keep two columns on a phone. */
  .es-td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Class-based grids of the approved sections (home-variants.css, variants.css). */
@media (max-width: 900px) {
  .es-bf, .es-bq { grid-template-columns: 1fr !important; gap: 32px !important; }
  .es-bf-pack { display: none !important; } /* EG-49.8: the floating pack card sat over the list on phones; the grid below shows every product */
  .es-cs-grid, .es-ab-snaps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .es-cs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .es-cs-tabs { flex-wrap: wrap; }
  .es-td-head { flex-wrap: wrap; }
  .es-td-search { width: 100% !important; flex: 1 1 100% !important; }
  .hqd-head, .hqd-row { grid-template-columns: 30px minmax(0, 1fr) 16px !important; }
  .hqd-head > :nth-child(2), .hqd-head > :nth-child(4), .hqd-row > :nth-child(2), .hqd-row > :nth-child(4) { display: none !important; }
}
@media (max-width: 560px) {
  .es-cs-grid, .es-ab-snaps-grid { grid-template-columns: 1fr !important; }
  .es-bf-points { grid-template-columns: 1fr !important; }
  .es-bq-item button { grid-template-columns: 32px minmax(0, 1fr) 28px !important; padding: 16px 12px !important; }
  /* Fields that spanned two or three desktop columns sit in the single phone column. */
  #root [style*="grid-column"] { grid-column: auto !important; }
}
@media (max-width: 900px) {
  .hcd { grid-template-columns: 1fr !important; min-height: 0 !important; }
  .es-cs-card.wide { grid-column: auto !important; grid-template-columns: 1fr !important; }
  .es-cs-card.wide .es-cs-quote { grid-column: auto !important; grid-row: auto !important; }
}
@media (max-width: 560px) {
  [data-quote-form], .hcd-form, .hcd-ink { padding-left: 20px !important; padding-right: 20px !important; }
  .es-chan { grid-template-columns: repeat(2, 1fr); } /* the picker is a grid: four columns stuck out 39px at 390 (EG-3, 2026-11-05) */
}
@media (max-width: 900px) {
  .hbw-row, .hbw-flip { grid-template-columns: 1fr !important; gap: 24px !important; }
  .hbw-flip .hbw-copy { order: 0 !important; }
  .hbw-cards { position: static !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; margin: 12px 0 0 !important; gap: 8px !important; }
  .hbw-p-img { height: 84px !important; } .hbw-p-img img { max-height: 84px !important; }
}
@media (max-width: 560px) {
  #root .hp-wall > div > div[style*="grid-template-columns"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #root [data-section="home.intro"] [style*="padding"] { padding-top: 24px !important; padding-bottom: 24px !important; }
  #root [data-section="home.intro"] [style*="gap"] { gap: 20px !important; }
}
@media (max-width: 560px) {
  .es-td-grid > * { min-width: 0; }
  .es-td-top { flex-wrap: wrap; row-gap: 2px; }
  .es-td-top span { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 900px) {
  /* Brand pages: the fixed side tab would float over the content; the burger menu replaces it. */
  #root aside[style*="position: fixed"] { display: none !important; }
  /* Range: filters above the products, products two per row. */
  .es-td-body { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .es-td-side { position: static !important; }
  .es-td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* note 193: grouped register, four columns (thumb, standard, system, icon); on phones keep the standard */
@media (max-width: 900px) {
  #root .hqd-groups .hqd-head > :nth-child(2), #root .hqd-groups .hqd-row > :nth-child(2), #root .hqd-groups .hqd-row > :nth-child(4) { display: block !important; }
  #root .hqd-groups .hqd-head > :nth-child(3), #root .hqd-groups .hqd-row > :nth-child(3) { display: none !important; }
}

/* ===== EG-49, the cto's mobile review EG-48 (Hana, 2026-11-09). One block, numbered as the review. ===== */
.es-map-open { display: none; }
@media (max-width: 560px) {
  /* 14. Nothing a visitor reads under 12px: the label token goes from 11 to 12px on phones, and the small classes follow. */
  :root { --fs-label: 12px; }
  #root [style*="font-size: 10px"], #root [style*="font-size: 10.5px"], #root [style*="font-size: 11px"], #root [style*="font-size: 11.5px"] { font-size: 12px !important; }
  .es-td-top, .hbw-p-cat, .es-bf-pack span, .es-td-label, .hcd-phone small, .hcd-facts small { font-size: 12px !important; }
  .hbw-p-name { font-size: 12.5px; min-height: 33px; }
  .hbw-cats > span { font-size: 12px; }
}
@media (max-width: 900px) {
  /* 1. Footer group headings: the phone h2 rule made them 26px; they are labels. */
  #root footer h2 { font-size: 12px !important; line-height: 1.4 !important; margin: 0 0 4px !important; }
  #root footer p + h2 { margin-top: 28px !important; }
  #root footer p { margin-bottom: 0 !important; }
  /* 2. Tap targets: every footer and top bar link at least 40px high, by padding. */
  #root footer .es-ft-link, #root .es-credit a { display: inline-flex; align-items: center; min-height: 44px; }
  #root footer [style*="gap: 10px"] { gap: 0 !important; }
  #root .es-tb-mail { min-height: 40px; }
  #root .es-tb-li { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -12px; }
  #root div:has(> div > .es-tb-mail) { padding-top: 0 !important; padding-bottom: 0 !important; align-items: center; }
  /* 6. Brand cards on the home page: no padding kept for cards that no longer overlap the photo. */
  .hbw { padding: 40px 0 !important; }
  .hbw-visual { padding-bottom: 0 !important; }
  .hbk .hbw-row { margin-top: 32px !important; }
  .hbk .hbw-row + .hbw-row { margin-top: 40px !important; padding-top: 40px !important; }
  /* 7. A two column desktop grid stacked on a phone keeps its wide column gap as a row gap (72px under a heading). */
  #root [style*="grid-template-columns"][style*="gap: 56px"], #root [style*="grid-template-columns"][style*="gap: 64px"],
  #root [style*="grid-template-columns"][style*="gap: 72px"], #root [style*="grid-template-columns"][style*="gap: 80px"],
  #root [style*="grid-template-columns"][style*="gap: 96px"] { row-gap: 20px !important; }
  /* 11. Text sized buttons in the FAQ blocks are 44px high. */
  .es-bq-tel { min-height: 44px; }
  #root .es-bq-side button, #root [data-section^="faqs."] [style*="justify-items: start"] > button { min-height: 44px; display: inline-flex; align-items: center; }
  /* 10. Filter rows 44px, the box on the left and larger, the count next to the name. */
  .es-td-opt { min-height: 44px; padding: 8px 0; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; }
  .es-td-opt i { font-size: 20px; width: 22px; }
}
@media (max-width: 560px) {
  /* 3. Hero: headline, paragraph, button and logos on the first screen at 375x667; the figures start at the fold, never cut. */
  .hv-heroc { min-height: 0 !important; }
  .hv-heroc > div[style*="flex: 1"] { min-height: calc(100svh - 94px); }
  .hv-heroc [style*="padding: 64px 32px"] { padding-top: 24px !important; padding-bottom: 24px !important; }
  .hv-heroc [style*="max-width: 780px"] { gap: 14px !important; }
  .hv-heroc p { font-size: 15px !important; line-height: 1.55 !important; }
  .hv-brandmarks { gap: 12px; padding-left: 0; }
  .hv-brandmarks img { height: 60px; }
  .hv-brandmarks img.hv-bm-swisschoice { height: 66px; } /* EG-61: 10% larger */
  /* 15. The eyebrow stays white on the photo, over a darker veil. */
  .hv-heroc [style*="max-width: 780px"] > div:first-child { color: #fff !important; }
  .hv-heroc > div[style*="linear-gradient(90deg"] { background: linear-gradient(180deg, rgba(20,19,19,.82), rgba(20,19,19,.7)) !important; }
  /* 4. Figures: number above its label, labels on two lines at most, four equal cells. */
  .hv-figrow { grid-template-columns: 1fr 1fr !important; grid-auto-rows: 1fr; row-gap: 0 !important; }
  .hv-figrow > div { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 12px 14px 16px !important; border-left: 1px solid rgba(255,255,255,.14) !important; }
  .hv-figrow > div:nth-child(odd) { padding-left: 0 !important; border-left: 0 !important; }
  .hv-figrow > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); }
  .hv-figrow b { font-size: 26px; }
  .hv-figrow span { font-size: 12px; letter-spacing: 1px; line-height: 1.35; }
  /* 5. Partner logos (EG-60, 2026-11-24, replaces EG-49's still three column grid): on phones the two rows
     slide like on the desktop, in opposite directions, with smaller logos and a softer edge fade.
     Reduced motion keeps home-variants.css's still, swipeable row. */
  .hp-rows { gap: 18px; margin-top: 32px; }
  .hp-track { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
  .hp-belt { animation-duration: calc(var(--hp-n, 9) * 2.7s); } /* EG-62: same speed on every row */
  .hp-logo { width: 108px; height: 56px; margin-right: 18px; }
  .hp-logo img { max-width: 92px; max-height: 40px; }
  /* 9. Product grid: equal cards, pack shots larger, names clamped to two lines. */
  .es-td-grid { grid-auto-rows: 1fr; }
  .es-td-img { margin: 6px 6px 0 !important; aspect-ratio: 1 / 1 !important; }
  .es-td-img img { max-width: 92% !important; max-height: 92% !important; }
  .es-td-card h3 { font-size: 13px !important; line-height: 1.3 !important; padding: 8px 10px 10px !important; -webkit-line-clamp: 2; min-height: calc(2 * 1.3em + 18px); }
  /* 12. Maps: the embed gives way to an Open in Maps button for each place. */
  .es-map iframe { display: none !important; }
  .es-maps { margin-top: 24px; gap: 20px; }
  .es-map-open { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; justify-self: start;
    border: 1px solid var(--es-ink); font: 700 12px var(--font-text); letter-spacing: 1.4px; text-transform: uppercase; color: var(--es-ink); text-decoration: none; }
  .es-map-open i { color: var(--es-red); }
  /* 13. Form: labels 12px (token), selects as tall as inputs, a field left wrong shows red. */
  #root form select { min-height: 48px; }
  #root form :is(input, select, textarea):user-invalid { border-color: var(--es-red) !important; }
  /* 2. The office line leaves the top bar on phones (it is in the footer); the e-mail and LinkedIn stay. */
  #root .es-tb-office { display: none !important; }
}
@media (max-width: 900px) {
  /* 2. (second pass) every phone and e-mail link, the jump links, the Instagram mark, the logo link, buttons and certificate rows reach 44px */
  #root a[href^="tel:"], #root a[href^="mailto:"], #root .wws-jump a, #root .hd-logo { display: inline-flex; align-items: center; min-height: 44px; }
  #root .es-brand-ig { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  #root button:not(.htc-dot) { min-height: 44px; }
  #root .hqd-row { min-height: 44px; }
}
@media (max-width: 560px) {
  .hqd-head, .hqd-brand span { font-size: 12px !important; }
}
@media (max-width: 560px) {
  /* EG-49.7 and 6 (recheck): the kit's 136px section padding (Chrome.jsx Section) is a desktop size; 56px on phones */
  #root section[style*="padding: 136px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  /* EG-49.7 (recheck): Our story, the text column keeps no desktop top padding under its heading */
  #root [data-section="about.story"] [style*="grid-template-columns"] > div[style*="padding"]:nth-child(2) { padding-top: 0 !important; padding-bottom: 0 !important; }
  /* EG-49.7 (Lina's recheck): Home, Who we are, the text column sits 20px under its heading (the row gap), no desktop top padding */
  #root [data-section="home.intro"] [style*="grid-template-columns"] > div[style*="padding"]:nth-child(2) { padding-top: 0 !important; }
  /* EG-49.8 (recheck): with the pack card gone, the photo box ends with the photo, no 56px band under it */
  .es-bf-visual { height: 300px; }
  .es-bf-photo { inset: 0 0 0 24px; }
}

/* EG-59 (2026-11-24): certificate expiry under the standard where the system column is hidden; org chart on phones */
@media (max-width: 900px) {
  #root .hqd-groups .hqd-meta-m { display: block; }
  .es-org-r2, .es-org-r3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .es-org-r3 { margin-top: 12px; }
  .es-org-r2 { padding-top: 0; }
  .es-org-r2::before, .es-org-r2 .es-org-card::before { display: none; }
  .es-org-stem { height: 20px; }
  .es-org-r3 .es-org-card:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
  .es-org-card { padding: 16px 10px 14px; }
  .es-org-name { font-size: 16px; }
  .es-org-top .es-org-name { font-size: 19px; }
}
@media (max-width: 900px) {
  #root .hqd-groups .hqd-head > .hqd-valid, #root .hqd-groups .hqd-row > .hqd-valid { display: none !important; }
  #root .hqd-groups .hqd-row > i { display: block !important; }
  .hqd-by { max-width: 200px; }
}

/* EG-60 (2026-11-24): the EG-59 additions keep the phone rule "nothing a visitor reads under 12px" (EG-49.14) */
@media (max-width: 560px) {
  .es-org-title, .hqd-by, .hqd-meta-m, #root .hqd-groups .hqd-meta-m * { font-size: 12px !important; }
}

/* EG-60 (2026-11-24): Who We Supply, the client logos in each audience block slide on phones and tablets, like the home rows */
@media (max-width: 900px) {
  .wws-logos { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .wws-belt, .wws-dup { display: flex; flex-wrap: nowrap; gap: 0; align-items: center; }
  .wws-belt { width: max-content; animation: hpSlide 26s linear infinite; }
  .wws-logos img { flex: 0 0 auto; width: 96px; height: 40px; max-width: none !important; object-fit: contain; margin-right: 24px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .wws-belt { animation: none; } .wws-dup { display: none; } .wws-logos { overflow-x: auto; }
}
@media (max-width: 560px) {
  .wws-jump { row-gap: 0; column-gap: 24px; } /* EG-60: the three jump links read as one row, no 70px hole when the third wraps */
}

/* ===== EG-60, tablet pass (Hana, 2026-11-24). The 900px rule above turns every inline grid into two equal
   columns; at 561 to 900px that split the home hero, squeezed the call to action strips and pushed the careers
   button over the e-mail line. Numbered as the findings in agents/logs/hana.md (EG-60). ===== */
@media (max-width: 900px) {
  /* T1. A grid drawn as one column stays one column (home hero copy). */
  #root [style*="grid-template-columns: minmax(0px, 1fr);"], #root [style*="grid-template-columns:minmax(0,1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  /* T2. Two panel desktop grids (5/7, 7/5, 4/8) stack: text gets the full width instead of half. */
  #root [style*="grid-template-columns: 5fr 7fr"], #root [style*="grid-template-columns: 7fr 5fr"], #root [style*="grid-template-columns: 4fr 8fr"] { grid-template-columns: minmax(0, 1fr) !important; }
  /* T4. Hero figures: number above its label, as on phones. */
  .hv-figrow > div { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (min-width: 561px) and (max-width: 900px) {
  /* T3. A text plus button row keeps the button at its own width (careers contact line); on phones it stacks. */
  #root [style*="grid-template-columns: 1fr auto"] { grid-template-columns: minmax(0, 1fr) auto !important; }
  /* T5. Footer in two columns on tablets, not the phone's single column. */
  #root footer [style*="1.4fr 1fr 1fr 1fr"], #root footer [style*="0.7fr 1.5fr"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* T6. Brand hero photo: a wide band above the heading, not a 4:5 portrait taller than the screen. */
  #root [data-section$="hero"] [style*="aspect-ratio: 4 / 5"] { aspect-ratio: 16 / 9 !important; }
  /* T7. "Why partners choose": with the pack card hidden, the photo box ends with the photo. */
  .es-bf-visual { height: 420px; }
  .es-bf-photo { inset: 0 0 0 24px; }
}
@media (max-width: 560px) {
  /* T8. A phone number never breaks in the middle. */
  #root a[href^="tel:"] { white-space: nowrap; }
  #root .hcd-phone { font-size: min(40px, 8.2vw); } /* the 40px number fits on one line from 360px */
}
