/* halpha_mobile.css — H Alpha phone layer (2026-09-08)
   ---------------------------------------------------------------------------
   ONE stylesheet, linked last in the head of every H Alpha document, holding
   every rule that only applies to a hand-held screen. Nothing here fires above
   860px, so the desk layouts, the themes and the type scale are untouched on a
   laptop; this file cannot change what Rajiv already approved.

   It is the STATIC half of the phone layer. The other half, halpha_mobile.js,
   reads each page's own stylesheet at load and derives the overrides that
   cannot be written by hand here — the pages share a palette and a typeface
   but not a class vocabulary (`.lpanel` on freight, `.frow` on the cover,
   `.tc` on the register), so a hand-written rule per page would be wrong by
   the next page that ships. What CAN be written once is written here.

   Breakpoint 860px: a phone in landscape is 844 wide (iPhone 14/15, and the
   Huawei/Xiaomi/Honor sizes that dominate the Chinese market), so 860 catches
   both orientations and leaves tablets on the desk layout.
   --------------------------------------------------------------------------- */

/* ── always on, any width ─────────────────────────────────────────────────── */

/* A table wider than the screen must scroll INSIDE its own box; a page that
   scrolls sideways as a whole is the single most common way a desk layout
   fails on a phone. halpha_mobile.js puts this wrapper around every table it
   finds, so no page markup has to change. */
.ha-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;}
.ha-scroll>table{margin:0;}

img,svg,canvas,video,iframe{max-width:100%;}

@media (max-width:860px){

/* ── page frame ───────────────────────────────────────────────────────────── */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
html,body{max-width:100%;overflow-x:hidden !important;}

/* Long unbroken tokens — HS codes, vessel IMOs, lane ids, URLs, pinyin port
   names — are what actually force the sideways scroll once the containers are
   fluid. Break them rather than let one cell set the page width. */
body{overflow-wrap:break-word;word-break:break-word;}
td,th,code,pre,.mono{overflow-wrap:break-word;}
pre{white-space:pre-wrap;}

/* ── navigation ───────────────────────────────────────────────────────────── */
/* The tab strip is not wrapped and it is not folded into a hamburger: every
   desk here has 4-8 tabs and a folded menu would hide the module the reader
   came for. It scrolls sideways, which is the gesture a phone reader already
   uses, and the strip keeps the charcoal/gold treatment unchanged. */
nav{padding-left:12px !important;padding-right:12px !important;height:auto !important;
    min-height:48px;flex-wrap:wrap !important;row-gap:2px;}
.nav-tabs,.nav-links,.tabs,.tabbar{
    display:flex !important;flex-wrap:nowrap !important;
    overflow-x:auto !important;-webkit-overflow-scrolling:touch;
    scrollbar-width:none;max-width:100%;margin-left:0 !important;
    padding-bottom:4px;}
.nav-tabs::-webkit-scrollbar,.nav-links::-webkit-scrollbar,
.tabs::-webkit-scrollbar,.tabbar::-webkit-scrollbar{display:none;}
.nav-tab,.nav-links a{flex:0 0 auto;padding:9px 12px !important;}
/* The tab strip is nested one div deep inside <nav> on every desk. That wrapper
   is 1,400px wide because the tabs are, and a scroll box inside an oversized
   wrapper never scrolls — the wrapper simply overflowed and was clipped, which
   put every tab past the fourth out of reach on a phone. The wrapper has to be
   allowed to shrink before .nav-tabs can do its job. */
nav>div,nav>span,.nav-in>div{min-width:0 !important;max-width:100% !important;
    flex:0 1 auto !important;flex-wrap:wrap !important;display:flex;align-items:center;}
/* and it gets a row to itself. Sharing the row with the brand left the strip
   184px wide on the buyer desk — a scroll box the width of two tabs. */
.nav-tabs{flex:1 0 100% !important;order:9;margin-top:2px;}
/* the strip is scrollable, so say so: a gold hairline at the right edge */
.nav-tabs{-webkit-mask-image:linear-gradient(to right,#000 88%,rgba(0,0,0,.35));
          mask-image:linear-gradient(to right,#000 88%,rgba(0,0,0,.35));}
.nav-sep{display:none;}
.nav-in{padding:0 14px !important;height:auto !important;
        flex-wrap:wrap !important;row-gap:8px;padding-top:10px !important;
        padding-bottom:10px !important;}
.nav-time,.nav-module-label{display:none;}

/* ── touch targets ────────────────────────────────────────────────────────── */
/* 44px is the floor a thumb needs. These controls are 22-28px tall on the desk
   layouts, which is fine for a cursor and a miss on a phone. */
button,.btn,input[type=submit],input[type=button],select,summary,
.chip[onclick],[role=button]{min-height:40px;}
input,select,textarea{font-size:16px !important;}  /* below 16px iOS zooms the
                                                      whole page on focus */
a{-webkit-tap-highlight-color:rgba(184,134,11,.18);}

/* A desk page sets `body{height:100%}` next to `min-height:100vh` so the shell
   fills the window and the centre pane owns the scroll. On a phone that pins
   the body box to one screen and the footer lands on top of the content under
   it. The page scrolls instead. */
body{height:auto !important;}

/* ── the desk shells ──────────────────────────────────────────────────────── */
/* Every desk page here is the same shape: a full-height flex row with one or
   two fixed-width side panels around a centre pane that owns the scroll. On a
   390px screen the two panels alone are 500px. Stack them, give the scroll
   back to the page, and the reading order becomes centre-then-panels only
   where the markup already puts it that way. */
.main,.shell,.wrap-main,.body-row{
    display:block !important;height:auto !important;overflow:visible !important;}
.lpanel,.rpanel,.sidebar,.side,.rail,.panel-side{
    width:100% !important;max-width:100% !important;flex:none !important;
    height:auto !important;max-height:none !important;overflow:visible !important;
    border-right:none !important;border-left:none !important;}

/* A KPI strip of five cells across is unreadable at 78px each. Two up. */
.top-stats,.kpi-band,.stat-row,.statbar{
    display:grid !important;grid-template-columns:1fr 1fr !important;
    gap:0 !important;}
.top-stat,.kpi{border-right:1px solid var(--border,rgba(184,134,11,.18)) !important;
    border-bottom:1px solid var(--border,rgba(184,134,11,.18)) !important;
    padding:.55rem .7rem !important;}

/* ── maps and charts ──────────────────────────────────────────────────────── */
/* A 100vh map on a phone is the whole screen with no way to know a page is
   under it. Bound it, and let the page scroll past. Leaflet and the d3 maps
   both read the container height, so this is the only place it has to be set. */
/* Every container the tree actually initialises a map into — 23 pages use
   `#map`, the rest are named per page. A Leaflet or d3 map reads the box it is
   given, so the box is set here rather than left to collapse. */
.map-section,.mapwrap,.map-wrap,.map-area,.mapbox,.map-pane{
    height:auto !important;max-height:none !important;overflow:visible !important;}
#map,#lmap,#pmap,#wmap,#mapview,#mapView,#world-map,#routemap,#satmap,#ha-map,
.leaflet-container,.map-section>svg,.map-wrap>svg,.mapwrap>svg,.map-area>svg{
    height:58vh !important;min-height:260px !important;max-height:520px !important;
    width:100% !important;}
/* the floating legend and tooltip sit over a 58vh map, not a full screen */
.maplegend,.map-legend,.map-overlay{max-width:62vw !important;font-size:11px !important;}

/* ── drawers and overlays ─────────────────────────────────────────────────── */
/* The stress-point dossier and its siblings slide in at 360px against a 390px
   screen, which leaves a 30px sliver of the page behind it. Full width. */
#sdrawer,.drawer,.dossier-drawer,.side-drawer{
    width:100% !important;max-width:100% !important;
    position:fixed !important;top:0 !important;right:0 !important;
    height:100dvh !important;z-index:900 !important;}
.sd-x,.drawer-close{width:40px !important;height:40px !important;font-size:1.5rem !important;}
.sd-grid{grid-template-columns:1fr 1fr !important;}

/* ── the public cover and the login ───────────────────────────────────────── */
/* These two are what a visitor who typed halpha.co on a phone sees first. */
.hero{min-height:auto !important;padding-bottom:56px;}
.hero-grid{padding-top:76px !important;}
.hero-stats-in,.nav-in,.hero-in,.sec-in,.panel-hd{padding-left:18px !important;padding-right:18px !important;}
.hero-stats-in{grid-template-columns:1fr 1fr !important;}
.hero-ctas{flex-direction:column !important;align-items:stretch !important;}
.hero-ctas>a,.hero-ctas>button{text-align:center;padding:14px 18px !important;}
.duo,.duo3,.tilecol{margin-top:36px !important;}
.frow{grid-template-columns:1fr !important;gap:6px !important;padding:14px 18px !important;}
.lightbox.on{padding:12px !important;}
.card{width:100% !important;}
.signin,.fld input{min-height:46px;}

/* ── density ──────────────────────────────────────────────────────────────── */
/* The desk pages are set at 0.52-0.66rem in DM Mono, which is legible at
   arm's length on a 27" panel and not on a phone. Nothing here changes the
   typeface, the colour or the case — only the floor. Chinese glyphs carry
   more strokes in the same em than Latin letters do, so the floor matters
   more here than it would on an English-only desk. */
body{font-size:15px;}
.section,section,.panel,.card,.blk,.box{padding-left:0;padding-right:0;}

/* Tables stay in DM Mono and stay dense — they scroll instead of shrinking. */
.ha-scroll table{font-size:.72rem;}
.ha-scroll th,.ha-scroll td{padding:.42rem .5rem !important;white-space:nowrap;}

/* ── print/legacy dossier documents ───────────────────────────────────────── */
.doc,.dossier,.report-body{max-width:100% !important;padding:20px 16px !important;}

} /* end 860 */

/* ── tablet tier: halve the wide grids, keep two columns ──────────────────── */
@media (min-width:861px) and (max-width:1100px){
  .hero-stats-in{grid-template-columns:1fr 1fr !important;}
  .lpanel,.rpanel{width:200px !important;}
}
