/* Phones and tablets (1024px and less): the pages laid out for a touch screen held in the hand, not a desktop page made
   smaller. Loaded on every page right after paper.css (seo.app_tags), for screens up to 1024px wide only. Every rule
   starts with html:root so it outranks style.css and the pages' own <style> blocks whatever order they load in.
   Only layout, spacing and touch behaviour change here; colours, words and the order of every page stay as they are.

   Measured on a 390px phone and an 820px tablet before this file (28 Nov 2026): nothing ran sideways, but tablets showed
   the desktop window (title bar, margins) and the desktop header line, tab rows left one tab alone on its row, chip
   lists took most of a phone screen, figure tiles stood one per row, cards kept their desktop padding inside other
   cards, and many buttons were under 32px tall. */

/* ---------------------------------------------------------------- every phone and tablet */
@media (max-width: 1024px) {
  /* turning the phone sideways never blows the text up; a tap never flashes a grey box */
  html:root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html:root body { -webkit-tap-highlight-color: transparent; }

  /* the header is one slim bar: the line under the logo belongs to wide screens */
  html:root .main-header .brand-title p { display: none; }

  /* no frosted glass: the paper behind every card is plain, and a blur costs a repaint on every scroll */
  html:root .glass-panel, html:root .glass-card, html:root .kpi-card, html:root .exp-kpi-card, html:root .ws-kpi-card {
    -webkit-backdrop-filter: none; backdrop-filter: none; }

  /* a hover lift stays stuck after a tap on a touch screen */
  html:root .exp-kpi-card:hover, html:root .ws-kpi-card:hover, html:root .glass-card:hover, html:root .lp-card:hover,
  html:root .tm-card:hover { transform: none; }

  /* Tab rows (the big tabs paper.css draws): they still wrap rather than scroll, but every row is full, so no tab is
     left alone on a row: the last row's tabs share its width. Each tab reads as a button of its own on a faint fill. */
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs) {
    display: flex !important; flex-wrap: wrap; gap: 6px; overflow: visible !important; }
  html:root :is(.tier-btn, .sub-nav-btn, .page-tab, .lu-level, .jb-level, .ws-nav-tab, .exp-cat-tab, .ps-tab) {
    flex: 1 1 calc(25% - 4.5px); justify-content: center; text-align: center;
    background: color-mix(in srgb, var(--paper-band, #efe7dc) 62%, transparent) !important;
    touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  html:root :is(.ws-nav-tab, .exp-cat-tab) .tab-badge { margin-left: 2px; }
  /* how many to a row, by how many tabs there are: 2, 3 and 4 in one row; 5, 6 and 9 three to a row; 10 five to a row */
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs):has(> :nth-child(2):last-child) > * {
    flex-basis: calc(50% - 3px); }
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs):is(
    :has(> :nth-child(3):last-child), :has(> :nth-child(5):last-child), :has(> :nth-child(6):last-child), :has(> :nth-child(9):last-child)) > * {
    flex-basis: calc(33.333% - 4px); }
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs):has(> :nth-child(10):last-child) > * {
    flex-basis: calc(20% - 4.8px); }

  /* plain list boxes (styled for every screen in paper.css) are a little taller for a thumb */
  html:root select:not(.lang-select):not(.fs-native):not([multiple]):not([size]) { min-height: 44px; font-size: 15px; }

  /* small controls made big enough for a thumb (at least 38px tall; chart buttons were 25px, links in lists 21px) */
  html:root .jv-tool { min-height: 36px; padding: 6px 12px; }
  html:root .jv-bars-more { min-height: 40px; padding: 8px 6px; }
  html:root :is(.tm-chip, .lp-chip, .filter-chip, .ob-year, .jm-chip, .sa-how-btn, .sa-apply-sm) { min-height: 38px; }
  html:root a.nw-chip { display: inline-flex; align-items: center; min-height: 38px; }
  html:root .nw-statelist { gap: 4px 6px; }
  html:root .nw-statelist a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 8px; }
  html:root button.acc-link { min-height: 34px; padding: 6px 2px; }
  /* the About slides' dots: the dot stays small, the place to tap round it is 24px */
  html:root .fs-dots { gap: 0; bottom: 0; }
  html:root .fs-dots button { box-sizing: border-box; width: 24px; height: 24px; padding: 8.5px; background-clip: content-box; }
  html:root .fs-dots button[aria-selected="true"] { width: 39px; }

  /* a press shows at once, as in an app */
  html:root :is(.btn, .lp-card, .tm-card, .tm-chip, .lp-chip, .filter-chip, a.nw-chip, .jv-tool, .fs-trigger, .m-tab, .lp-hub-fold > summary):active {
    transform: scale(0.97) !important; transition: transform 0.08s; }
  html:root :is(.lp-card, .tm-card):active { transform: scale(0.985) !important; }

  /* tables that scroll sideways keep the scroll to themselves (a swipe in a table never pulls the page back) */
  html:root :is(.data-table-container, .table-scroll, .jv-table-wrap) { overscroll-behavior-x: contain; }

  /* Job notices: what it is, then what to do, one under the other (the side-by-side layout left a wide empty middle) */
  html:root .jb-list > .jb-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr;
    grid-template-areas: "badges" "title" "meta" "details" "reach" "actions"; }
  html:root .jb-list > .jb-card > .jb-actions { justify-content: flex-start; max-width: none; margin-top: 4px; align-self: end; }
}

/* iPhones and iPads zoom into any text box under 16px when it is tapped, and stay zoomed: their boxes take 16px */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 1024px) {
    html:root :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]), select, textarea) {
      font-size: 16px !important; }
  }
}

/* ---------------------------------------------------------------- tablets (641 to 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  html:root .app-container { padding-left: 24px; padding-right: 24px; }
  /* the bottom bar keeps its five tabs together in the middle, as a tablet app does, not spread over the whole width */
  html:root .m-tabbar { grid-template-columns: repeat(5, minmax(0, 124px)); justify-content: center; column-gap: 10px; }
  html:root .m-tab { font-size: 12.5px; }
  /* job notices two to a row, each a card with its buttons at the foot */
  html:root .jb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  html:root .jb-list > :not(.jb-card) { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- phones (640px and less) */
@media (max-width: 640px) {
  /* tab rows: two to a row (three when there are three), the last tab taking a row's width when it is on its own */
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs) > * {
    flex-basis: calc(50% - 3px) !important; }
  html:root :is(.tier-nav, .sub-nav-tabs, .page-tabs, .lu-levels, .jb-levels, .ws-nav-tabs, .exp-cat-tabs, .ps-tabs):has(> :nth-child(3):last-child) > * {
    flex-basis: calc(33.333% - 4px) !important; padding: 8px 6px !important; font-size: 13.5px !important; }

  /* chip lists that filter what is below: one line to swipe through, fading at the edge, instead of five or six lines
     of chips before the first result (the Tourism quick links already work this way) */
  html:root :is(.tm-chips, .nw-chips), html:root div:has(> .filter-chip) {
    flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
    scroll-snap-type: x proximity; margin-right: -12px; padding: 2px 32px 4px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  html:root :is(.tm-chips, .nw-chips)::-webkit-scrollbar, html:root div:has(> .filter-chip)::-webkit-scrollbar { display: none; }
  html:root :is(.tm-chips, .nw-chips) > *, html:root div:has(> .filter-chip) > * { flex: none; scroll-snap-align: start; white-space: nowrap; }
  /* the kinds of help on Schemes are ticks: two to a row, all in sight */
  html:root .sf-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html:root .sf-chips > .sf-chip { min-width: 0; border-radius: 12px; text-align: left; }
  html:root .sf-chips > .sf-chip .sf-chip-n { margin-left: auto; }

  /* figure tiles two to a row, not one per screen line */
  html:root :is(.lg-tiles, .ws-kpi-row, .sw-hero, .exp-kpi-row) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  html:root :is(.lg-tiles, .ws-kpi-row, .sw-hero, .exp-kpi-row) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  html:root :is(.lg-tile, .ws-kpi-card, .exp-kpi-card, .sw-hero > div) { padding: 12px 13px !important; min-width: 0; overflow-wrap: anywhere; }
  /* the figure keeps to one line in a half-width tile (a figure and its unit were splitting over two lines) */
  html:root .ws-kpi-value, html:root .exp-kpi-value { font-size: 18px !important; letter-spacing: -0.02em; }
  html:root .lg-tile > strong { font-size: 19px; letter-spacing: -0.015em; }
  html:root .sw-hero strong { font-size: 19px; }

  /* page heads that kept their desktop padding and type */
  html:root :is(.exp-hero, .ws-hero) { padding: 20px 18px; margin-top: 6px; margin-bottom: 18px; border-radius: 16px; }
  html:root :is(.exp-hero, .ws-hero) h1 { font-size: 24px !important; line-height: 1.22; }
  html:root .vacancy-hero-panel { padding: 18px 16px !important; margin-top: 18px !important; }

  /* cards: 16px at the sides on a phone (they had 22 to 34px), and less again for a card inside a card */
  html:root .glass-panel:not(.ex-wrap):not(.chat-window):not(.am-chat-window) { padding-left: 16px !important; padding-right: 16px !important; }
  html:root .glass-panel :is(.glass-panel, .kpi-card, .alert-card, .cadre-card, .barometer-item):not(.chat-window):not(.am-chat-window) {
    padding-left: 13px !important; padding-right: 13px !important; }

  /* table heads readable on a phone */
  html:root .app-container table th { font-size: 0.75rem; }
}
