/* Trade portal (logged-in app pages): slimmer, lighter phone layout.
   2026-11-19 - the phone chrome (top bar, tab bar, sticky buy bar) had
   grown tall and heavy (72px dark header with boxed icons, 44px-wide
   bordered theme-toggle/heart buttons, a 60px+ sticky buy row with a
   big filled rectangular button, a "Zoom" pill in a dark box). This
   file is the single slimmer phone pass: loaded last (after portal.css
   and portal-density.css), scoped to body.portal and max-width:767px
   only, so every logged-in app page (dashboard, shop list, product,
   cart, orders, account) picks up the same lighter look from the one
   set of shared classes they already render with (.topbar/.tabbar,
   .wrap/.card/.list-row/.kicker, .btn/.btn-outline, .item-card).
   Desktop (>=1024px nav) and the 768-1023px tablet band are untouched;
   so are prices, checkout logic, translations and every feature flag -
   this file only ever sets layout/typography/colour-use properties.
   One spacing scale throughout: 8 / 12 / 16px. */
@media (max-width: 767px) {

  /* ---- 1. Top header: ~48px, smaller logo, thin unboxed icons ---- */
  body.portal { --bar-h: 48px; }
  body.portal .topbar-in { gap: 8px; }
  body.portal .logo img { height: 26px; }
  body.portal .back,
  body.portal .ibtn,
  body.portal .theme-toggle {
    width: 44px; height: 44px; min-height: 0;
    border: 0 !important; background: none !important; box-shadow: none !important;
  }
  body.portal .back:hover,
  body.portal .ibtn:hover,
  body.portal .theme-toggle:hover { background: none !important; }
  body.portal .back svg { width: 18px; height: 18px; }
  body.portal .ibtn svg,
  body.portal .theme-toggle svg { width: 18px; height: 18px; }
  body.portal .badge { min-width: 15px; height: 15px; font-size: 10px; line-height: 15px; top: 2px; right: 0; }

  /* ---- 2. Bottom tab bar: ~56px incl. safe area, thin 20px icons,
     11px labels, a subtle colour-only active state, light background ---- */
  body.portal .tabbar {
    background: color-mix(in srgb, var(--white) 94%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--slate-line);
  }
  body.portal .tabbar a { font-size: 11px; font-weight: 500; gap: 3px; padding: 6px 2px 4px; }
  body.portal .tabbar svg { width: 20px; height: 20px; }
  body.portal .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  body.portal .tabbar a[aria-current="page"]::before { left: 36%; right: 36%; height: 2px; background: var(--accent); }
  body.portal .tabbar .badge { top: 3px; right: calc(50% - 20px); min-width: 15px; height: 15px; font-size: 10px; line-height: 15px; }

  /* ---- 3. Sticky price + Add to Cart bar: one slim ~52px row,
     smaller price, a slim rounded button, a small unboxed heart,
     sitting just above the tab bar (bottom offset unchanged) ---- */
  body.portal .dd-buy {
    min-height: 52px; padding: 4px 12px; gap: 8px;
    border-top: 1px solid var(--slate-line); box-shadow: none;
    background: color-mix(in srgb, var(--white) 96%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  body.portal .dd-buy .dd-buy-m .amt { font-size: 14px; font-weight: 700; }
  body.portal .dd-buy .dd-buy-m .holdtxt { font-size: 11px; }
  body.portal .dd-buy .btn:not(.dd-save),
  body.portal .dd-buy button[type="submit"]:not(.dd-save) {
    min-height: 44px; height: 44px; padding: 0 18px;
    border-radius: 999px; font-size: 12px; letter-spacing: 0.02em;
  }
  /* The classless "Add to Cart" <button type=submit> only gets a solid
     fill from portal-density.css at <=430px - same colour applied here
     up to 767px so it doesn't fall back to an unstyled native button
     between 431-767px. */
  body.portal .dd-buy button[type="submit"]:not(.dd-save):not(.btn-outline) {
    background: var(--precision); border: 1px solid var(--precision); color: #fff;
  }
  body.portal .dd-buy .dd-save {
    width: 44px !important; height: 44px !important; padding: 0 !important;
    border: 0 !important; background: none !important;
    font-size: 17px !important; border-radius: 999px;
  }
  body.portal:has(.dd-buy) { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 52px + 8px); }

  /* ---- 4. Product title, category/SKU line, back link ---- */
  body.portal main.site h1,
  body.portal .pd-info h1 { font-size: 23px; line-height: 1.2; margin: 6px 0 0; letter-spacing: -0.01em; }
  body.portal .pd-info > p.muted { font-size: 12px; color: var(--ink-soft); margin: 4px 0 0; }
  body.portal .pd-back a { font-size: 13px; font-weight: 500; }
  body.portal .pd-back-mobile { margin: 4px 0 12px; }

  /* ---- 5. Zoom button: small semi-transparent icon, not a dark box ---- */
  body.portal .pd-zoom-hint {
    right: 10px; bottom: 10px; min-height: 0; padding: 7px;
    background: color-mix(in srgb, var(--obsidian, #15120f) 55%, transparent);
    border-radius: 999px; gap: 0;
  }
  body.portal .pd-zoom-hint-text { display: none; }
  body.portal .pd-zoom-hint svg { width: 16px; height: 16px; margin: 0; }

  /* ---- 6. One spacing scale (8/12/16px), fewer borders/boxes,
     applied through the shared classes shop/cart/orders/account all use ---- */
  body.portal main.site.wide { padding-left: 16px !important; padding-right: 16px !important; }
  body.portal .wrap { padding: 16px max(16px, env(safe-area-inset-left)) 16px max(16px, env(safe-area-inset-right)); }
  body.portal .card { padding: 12px; border-radius: 10px; }
  body.portal .card.tight { padding: 12px; }
  body.portal .kicker { margin: 16px 0 8px; }
  body.portal .list-row { padding: 12px 0; gap: 12px; }
  body.portal h1.page-h:not(.big) { font-size: 22px; margin: 4px 0 16px; }
  body.portal .btn,
  body.portal .btn-outline,
  body.portal main .btn,
  body.portal main .btn-outline,
  body.portal main button[type=submit] { border-radius: 999px; }
  body.portal .btn-outline:not(.dd-save),
  body.portal main .btn-outline:not(.dd-save) { border: 1px solid var(--slate-line) !important; background: transparent !important; color: var(--ink) !important; }
  body.portal .card-grid { gap: 12px; }
  body.portal .item-card { border-radius: 10px; }
  body.portal .item-body { padding: 12px; }
}
