/* 31mobile v2 — geometry and layout tokens */

:root {
  /* ---- Reference viewport ---------------------------------- */
  --frame-w: 390px;
  --frame-h: 844px;   /* reference only — not used in calculations */

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* ---- Shell bands ----------------------------------------- */
  --topnav-h:  48px;
  --tabbar-h:  56px;
  --invite-h:  0px;

  /* ---- Photo tile grid ------------------------------------- */
  --box-w:        170px;
  --box-h:        212px;
  --grid-gap-x:   18px;
  --grid-row-gap: 10px;
  --photo-ratio:  0.80;   /* 4:5 */

  /* THE CONTENT COLUMN — 170 + 170 + 18 gutter = 358, centred in 390.
     hero and grids both resolve to this width so their margins agree. */
  --content-w: calc(2 * var(--box-w) + var(--grid-gap-x));

  --hero-h: calc(var(--content-w) * 5 / 4);   /* 4:5 ceiling, not fixed height */

  /* ---- Tile label rows ------------------------------------- */
  --tile-name-h:  28px;
  --tile-sub-h:   34px;
  --tile-row-h:  276px;   /* 212 + 28 + 34 + 2 gap */

  /* ---- Band heights ---------------------------------------- */
  --label-h:      26px;
  --label-h-home: 40px;
  --chips-h:      46px;
  
  --rail-h:      220px;   /* 212 card + 8 */
  --grid-h:      672px;

  /* ---- Panels ---------------------------------------------- */
  --panel-w:          min(86%, 338px);
  --panel-head-h:     56px;
  --panel-row-h:      64px;
  --menu-row-h:       50px;
  --menu-row-open-h:  46px;
  --menu-sub-h:       36px;
  --menu-sub-indent:  32px;
  --allstate-row-h:   40px;
  --allstate-sub-h:   36px;
  --allstate-sub-indent: 30px;
  --allstate-mkt-h:   38px;

  /* ---- Detail sheet ---------------------------------------- */
  --sheet-ad-w:   320px;
  --sheet-ad-h:   100px;
  --ad-banner-h:   50px;
  --ad-top-slot-h: calc(var(--ad-banner-h) + 16px);
  --sheet-r:       20px;
  --hub-copy-b:    20px;
  --sheet-clear:    6px;
  --sheet-pad-x:   calc(50vw - var(--content-w) / 2 + 20px);

  /* ---- Controls -------------------------------------------- */
  --tap-min:   44px;
  --tab-min:   48px;
  --chip-h:    30px;
  --pill-h:    22px;
  --pill-h-sm: 21px;
  --when-h:    19px;
  --btn-h:     36px;
  --field-h:   46px;
  --icon-btn:  40px;
  --menu-btn-w:34px;

  /* ---- Icon sizes ------------------------------------------ */
  --ico-rail:  24px;
  --ico-tab:   22px;
  --ico-menu:  21px;
  --ico-close: 17px;
  --ico-caret: 15px;
  --ico-fact:  14px;
  --ico-pin:   11px;

  /* ---- Gutters --------------------------------------------- */
  --pad-frame: 16px;
  --pad-band:  16px;
  --pad-panel: 18px;
  --pad-card:  12px;
  --gap-chip:   5px;
  --gap-rail:  10px;
}
