/* Partner portals - logistics (public/logistics/) and finance (public/finance/). Built on main.css
   (inputs, buttons, badges, modals); this file is the portal's own shell
   and pages. Mobile first: carriers post updates from the road. */

:root { --lx-ink: #12233d; --lx-ink-2: #1c3254; }

.lx-body { min-height: 100vh; background: var(--bg); }
.lx-body [hidden] { display: none !important; }

/* ---------- Top bar ----------
   White, like the landing page header, so the logo uses the brand colours
   exactly as on the landing page (main.css .tfl-logo: "TFL" accent orange,
   "Nexus" slate). */
.lx-top { position: sticky; top: 0; z-index: 30; background: var(--bg-elevated); color: var(--text); border-bottom: 1px solid var(--border); }
.lx-top-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 20px; }
.lx-logo-wrap { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.lx-logo-wrap .tfl-logo:hover { text-decoration: none; }
.lx-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(241, 90, 44, 0.1); color: #c2410c; }
.lx-nav { display: flex; gap: 4px; }
.lx-nav a { color: var(--text-muted); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.lx-nav a:hover, .lx-nav a.active { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.lx-nav a.active { color: var(--accent); }
.lx-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lx-org { color: var(--text-muted); font-size: 13.5px; font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-org-select { width: auto; max-width: 240px; padding: 7px 10px; font-size: 13px; }
.lx-icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; }
.lx-icon-btn:hover { background: var(--surface-hover); }
.lx-icon-btn svg { width: 20px; height: 20px; }
.lx-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }

.lx-pop { position: absolute; top: 60px; right: 12px; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px rgba(16, 24, 40, 0.18); overflow: hidden; }
.lx-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.lx-pop-head button { background: none; border: none; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lx-pop-list { max-height: 420px; overflow-y: auto; }
.lx-note { display: block; width: 100%; text-align: left; padding: 12px 14px 12px 26px; border: none; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); position: relative; cursor: pointer; font: inherit; border-radius: 0; }
.lx-note:hover { background: var(--surface-hover); }
.lx-note.unread::before { content: ''; position: absolute; left: 11px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lx-note strong { display: block; font-size: 13.5px; }
.lx-note span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.lx-note time { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.lx-pop-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.lx-menu a, .lx-menu button { display: block; width: 100%; text-align: left; padding: 11px 14px; font-size: 14px; color: var(--text); background: none; border: none; border-bottom: 1px solid var(--border); border-radius: 0; cursor: pointer; font-weight: 500; }
.lx-menu a:hover, .lx-menu button:hover { background: var(--surface-hover); text-decoration: none; }
.lx-menu .lx-menu-email { padding: 12px 14px; font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }

/* ---------- Page ---------- */
.lx-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.lx-eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.lx-title { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.lx-sub { margin: 4px 0 0; color: var(--text-muted); }

.lx-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 20px 0 24px; }
.lx-kpi { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); cursor: pointer; font: inherit; color: var(--text); }
.lx-kpi:hover { border-color: var(--text-faint); }
.lx-kpi b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lx-kpi span { display: block; margin-top: 4px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.lx-kpi.hot { background: var(--lx-ink); border-color: var(--lx-ink); color: #fff; }
.lx-kpi.hot span { color: rgba(255, 255, 255, 0.75); }
.lx-kpi.hot b { color: #ffb59c; }

.lx-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.lx-tabs::-webkit-scrollbar { display: none; }
.lx-tab { flex-shrink: 0; padding: 11px 14px; background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.lx-tab:hover { color: var(--text); }
.lx-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.lx-tab em { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-hover); font-size: 12px; }
.lx-tab.active em { background: rgba(241, 90, 44, 0.14); color: #c2410c; }

.lx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.lx-job { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); color: var(--text); }
.lx-job:hover { border-color: var(--text-faint); text-decoration: none; }
.lx-job-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lx-track { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.lx-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-hover); color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
.lx-job h3 { margin: 0; font-size: 16.5px; line-height: 1.3; color: var(--text); text-transform: none; letter-spacing: normal; }
.lx-job h3 small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.lx-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; }
.lx-route > div { min-width: 0; }
.lx-route .k { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.lx-route strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-route .to { text-align: right; }
.lx-route svg { width: 18px; height: 18px; color: var(--accent); }
.lx-job-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); margin-top: auto; }
.lx-job-foot > span:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lx-job-foot .btn, .lx-job-foot button { padding: 9px 14px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.lx-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 12px; background: var(--surface); }
.lx-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.lx-req-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.lx-req-meta span { color: var(--text-muted); }
.lx-req-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lx-req-actions button { padding: 8px 14px; font-size: 13px; }
.lx-req-wait { margin: 0; font-size: 13px; color: var(--text-muted); background: var(--bg); border-radius: 8px; padding: 9px 12px; }

/* ---------- Shipment page ---------- */
.lx-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }
.lx-ship-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lx-ship-head h1 { margin: 0; font-size: 24px; }
.lx-party h3 { text-transform: uppercase; }
.lx-ship-head .lx-track { font-size: 14px; }
.lx-ship-grid > * { min-width: 0; }
.lx-ship-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lx-card { padding: 20px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.lx-card + .lx-card { margin-top: 16px; }
.lx-card h2 { margin: 0 0 12px; font-size: 16px; }
.lx-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.lx-facts dt { color: var(--text-muted); }
.lx-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.lx-party + .lx-party { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.lx-party h3 { margin: 0 0 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.lx-party strong { display: block; font-size: 14.5px; }
.lx-party p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.lx-party .lx-contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lx-party .lx-contact a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text); }
.lx-party .lx-contact a:hover { border-color: var(--accent); text-decoration: none; }
.lx-handoff { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(241, 90, 44, 0.08); font-size: 13.5px; }

.lx-update { border: 2px solid var(--accent); }
.lx-update h2 { display: flex; align-items: center; gap: 8px; }
.lx-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.lx-type { position: relative; margin: 0; }
.lx-type input { position: absolute; opacity: 0; pointer-events: none; }
.lx-type span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.lx-type input:checked + span { border-color: var(--accent); background: rgba(241, 90, 44, 0.1); color: #c2410c; }
.lx-type input:focus-visible + span { box-shadow: 0 0 0 3px rgba(241, 90, 44, 0.25); }
.lx-type.danger input:checked + span { border-color: var(--danger); background: rgba(220, 38, 38, 0.08); color: #b91c1c; }
.lx-loc-row { display: flex; gap: 8px; }
.lx-loc-row input { flex: 1; min-width: 0; }
.lx-loc-row button { flex-shrink: 0; padding: 0 12px; font-size: 13px; }
.lx-proof-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.lx-proof-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 10px; border: 1.5px dashed var(--text-faint); background: var(--bg); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; margin: 0; }
.lx-proof-btn:hover { border-color: var(--accent); color: var(--accent); }
.lx-proof-btn svg { width: 20px; height: 20px; }
.lx-proof-btn input { display: none; }
.lx-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.lx-tray-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-size: 11px; color: var(--text-muted); text-align: center; }
.lx-tray-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lx-tray-item svg { width: 26px; height: 26px; color: var(--danger); }
.lx-tray-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lx-tray-item button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: none; background: rgba(16, 24, 40, 0.75); color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; z-index: 1; }
.lx-tray-count { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.lx-submit { width: 100%; margin-top: 16px; padding: 14px; font-size: 15px; }
.lx-wait { display: flex; gap: 12px; align-items: flex-start; }
.lx-wait svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-faint); margin-top: 2px; }
.lx-wait p { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; }

/* ---------- Sign in ---------- */
.lx-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
.lx-auth-hero { position: relative; background: linear-gradient(160deg, #12233d 0%, #1c3254 60%, #27416b 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.lx-auth-hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(241, 90, 44, 0.14); }
/* Portal sign-in photo backgrounds (public/img/portals/<portal>-login.webp + .jpg fallback) under a
   navy tint - darker on the left where the headline and steps sit, lighter to the right so the photo
   shows. To add a portal: its two image files, a rule below and in the 900px block, and
   class="lx-auth-hero lx-auth-hero--<portal>" on its login page. */
.lx-auth-hero--exporter, .lx-auth-hero--importer, .lx-auth-hero--logistics, .lx-auth-hero--finance, .lx-auth-hero--insurance, .lx-auth-hero--custody, .lx-auth-hero--fx, .lx-auth-hero--payments { background-color: #12233d; background-size: cover; background-position: center; }
.lx-auth-hero--exporter::after, .lx-auth-hero--importer::after, .lx-auth-hero--logistics::after, .lx-auth-hero--finance::after, .lx-auth-hero--insurance::after, .lx-auth-hero--custody::after, .lx-auth-hero--fx::after, .lx-auth-hero--payments::after { display: none; }
.lx-auth-hero--exporter {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/exporter-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/exporter-login.webp) type('image/webp'), url(/img/portals/exporter-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--importer {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/importer-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/importer-login.webp) type('image/webp'), url(/img/portals/importer-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--logistics {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/logistics-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/logistics-login.webp) type('image/webp'), url(/img/portals/logistics-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--finance {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/finance-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/finance-login.webp) type('image/webp'), url(/img/portals/finance-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--insurance {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/insurance-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/insurance-login.webp) type('image/webp'), url(/img/portals/insurance-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--custody {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/custody-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/custody-login.webp) type('image/webp'), url(/img/portals/custody-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--fx {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/fx-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/fx-login.webp) type('image/webp'), url(/img/portals/fx-login.jpg) type('image/jpeg'));
}
.lx-auth-hero--payments {
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), url(/img/portals/payments-login.jpg);
  background-image: linear-gradient(100deg, rgba(14, 28, 50, 0.94) 0%, rgba(18, 35, 61, 0.86) 45%, rgba(18, 35, 61, 0.55) 100%), image-set(url(/img/portals/payments-login.webp) type('image/webp'), url(/img/portals/payments-login.jpg) type('image/jpeg'));
}
.lx-auth-hero h1 { margin: 0; font-size: 40px; line-height: 1.12; letter-spacing: -0.02em; max-width: 520px; }
.lx-auth-hero h1 span { color: #ff9a76; }
.lx-auth-hero p { margin: 16px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 16px; max-width: 480px; line-height: 1.6; }
.lx-auth-steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; max-width: 460px; position: relative; z-index: 1; }
.lx-auth-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: rgba(255, 255, 255, 0.88); }
.lx-auth-steps b { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(241, 90, 44, 0.22); color: #ffb59c; font-size: 13px; }
.lx-auth-foot { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); position: relative; z-index: 1; }
.lx-auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: var(--surface); }
.lx-auth-form h2 { margin: 0 0 6px; font-size: 26px; }
.lx-auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.lx-auth-form .btn-primary.full { margin-top: 24px; padding: 13px; font-size: 15px; }
.lx-auth-links { margin-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }

@media (max-width: 1080px) {
  .lx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .lx-ship-grid { grid-template-columns: minmax(0, 1fr); }
  .lx-auth { grid-template-columns: 1fr; }
  .lx-auth-hero { padding: 32px 24px; }
  .lx-auth-hero h1 { font-size: 30px; }
  .lx-auth-steps { display: none; }
  /* Stacked under the form: an even, stronger tint so the photo's own text doesn't compete with ours. */
  .lx-auth-hero--exporter {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/exporter-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/exporter-login.webp) type('image/webp'), url(/img/portals/exporter-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--importer {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/importer-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/importer-login.webp) type('image/webp'), url(/img/portals/importer-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--logistics {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/logistics-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/logistics-login.webp) type('image/webp'), url(/img/portals/logistics-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--finance {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/finance-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/finance-login.webp) type('image/webp'), url(/img/portals/finance-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--insurance {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/insurance-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/insurance-login.webp) type('image/webp'), url(/img/portals/insurance-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--custody {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/custody-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/custody-login.webp) type('image/webp'), url(/img/portals/custody-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--fx {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/fx-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/fx-login.webp) type('image/webp'), url(/img/portals/fx-login.jpg) type('image/jpeg'));
  }
  .lx-auth-hero--payments {
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), url(/img/portals/payments-login.jpg);
    background-image: linear-gradient(rgba(14, 28, 50, 0.88), rgba(14, 28, 50, 0.88)), image-set(url(/img/portals/payments-login.webp) type('image/webp'), url(/img/portals/payments-login.jpg) type('image/jpeg'));
  }
  .lx-auth-foot { display: none; }
  .lx-auth-form { padding: 32px 24px; order: -1; }
  .lx-auth-logo { margin-bottom: 24px; }
}
@media (max-width: 720px) {
  .lx-top-inner { padding: 0 12px; gap: 10px; }
  .lx-top .lx-tag { display: none; }
  .lx-org, .lx-org-select { display: none; }
  .lx-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg-elevated); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06); }
  .lx-nav a { font-size: 12.5px; padding: 8px 10px; }
  .lx-main { padding: 18px 16px 96px; }
  .lx-title { font-size: 22px; }
  .lx-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lx-kpi { padding: 12px; }
  .lx-kpi b { font-size: 24px; }
  .lx-grid { grid-template-columns: 1fr; }
  .lx-card { padding: 16px; }
  .lx-req-meta { grid-template-columns: 1fr; }
}

/* ---------- Finance portal (public/finance/) ---------- */
.fx-amount { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fx-amount b { font-size: 24px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.fx-amount span { color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.fx-due { font-weight: 700; color: #c2410c; }
.fx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(91, 100, 120, 0.12); color: var(--text-muted); }
.fx-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fx-pill-hot { background: rgba(241, 90, 44, 0.12); color: #c2410c; }
.fx-pill-info { background: rgba(2, 132, 199, 0.12); color: #0369a1; }
.fx-pill-good { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.fx-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 20px; }
.fx-hero > div { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.fx-hero span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.fx-hero b { display: block; margin-top: 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.fx-hero .hot { background: var(--lx-ink); border-color: var(--lx-ink); color: #fff; }
.fx-hero .hot span { color: rgba(255, 255, 255, 0.65); }
.fx-hero .hot b { color: #ffb59c; font-size: 22px; }
.fx-verified { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(22, 163, 74, 0.12); color: #15803d; font-size: 11.5px; font-weight: 700; }
.fx-quote { white-space: pre-wrap; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 13.5px; line-height: 1.55; }
.fx-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fx-form label { margin: 14px 0 6px; }
.fx-form .co-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); }
.fx-calc { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--bg); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.fx-calc dt { color: var(--text-muted); }
.fx-calc dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-calc .total { font-weight: 800; color: var(--text); }
.fx-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.fx-actions > * { flex: 1; }
@media (max-width: 720px) {
  .fx-hero { grid-template-columns: 1fr 1fr; }
  .fx-form .row2 { grid-template-columns: 1fr; }
}
.fc-list { margin-top: 10px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.fc-list-open { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border: none; gap: 8px; }
.fc-list label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border-top: 1px solid var(--border); font-weight: 500; color: var(--text); cursor: pointer; }
.fc-list label:first-child { border-top: none; }
.fc-list-open label { border: 1px solid var(--border); border-radius: 10px; }
.fc-list-open label:first-child { border-top: 1px solid var(--border); }
.fc-list label:has(input:checked) { background: rgba(241, 90, 44, 0.08); border-color: rgba(241, 90, 44, 0.4); }
.fc-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fc-chips button { padding: 4px 10px; border-radius: 999px; background: rgba(241, 90, 44, 0.12); color: #c2410c; border: none; font-size: 12.5px; font-weight: 700; }
.fc-save { position: sticky; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12); }
.fx-note { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: rgba(2, 132, 199, 0.08); border: 1px solid rgba(2, 132, 199, 0.25); font-size: 14px; }
.fx-fit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; font-size: 13px; }
.fx-docs a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.fx-docs a + a { margin-top: 8px; }
.fx-docs a:hover { border-color: var(--accent); text-decoration: none; }
.fx-docs svg { width: 20px; height: 20px; color: var(--danger); flex-shrink: 0; }
.fx-docs strong { display: block; font-size: 14px; }
.fx-docs small { color: var(--text-muted); font-size: 12px; }
.fx-loanbar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 10px 0 4px; }
.fx-loanbar span { display: block; height: 100%; background: var(--success); }
.fx-pays { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; }
.fx-pay { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; flex-wrap: wrap; }
.fx-pay + .fx-pay { border-top: 1px solid var(--border); }
.fx-pay small { display: block; color: var(--text-muted); font-size: 12px; }
.fx-pay .fx-actions { margin: 0; flex: 0 0 auto; }
.fx-pay .fx-actions button { padding: 6px 12px; font-size: 12.5px; flex: 0 0 auto; }
.fx-pill-bad { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

/* ---------- Company setup (logistics/onboarding.html, finance/onboarding.html) ---------- */
.ob-main { max-width: 920px; }
.ob-steps { display: flex; list-style: none; margin: 20px 0 22px; padding: 0; counter-reset: step; }
.ob-steps li { flex: 1; position: relative; padding-top: 34px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-faint); counter-increment: step; }
.ob-steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); font-size: 12px; z-index: 1; color: var(--text-muted); }
.ob-steps li::after { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.ob-steps li:first-child::after { display: none; }
.ob-steps li.done { color: var(--text); }
.ob-steps li.done::before { content: '✓'; background: var(--success); border-color: var(--success); color: #fff; }
.ob-steps li.done::after, .ob-steps li.current::after { background: var(--success); }
.ob-steps li.current { color: var(--accent); }
.ob-steps li.current::before { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgba(241, 90, 44, 0.15); }
.ob-steps button { all: unset; cursor: pointer; }
.ob-card h2 { margin: 0 0 4px; font-size: 19px; }
.ob-card > p.muted { margin: 0 0 6px; font-size: 14px; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ob-grid .full { grid-column: 1 / -1; }
.ob-card label { margin: 16px 0 6px; }
.ob-req { color: var(--danger); }
.ob-sub { margin: 22px 0 2px; font-size: 15px; padding-top: 18px; border-top: 1px solid var(--border); }
.ob-sub-hint { margin: 0 0 10px; font-size: 13px; }
.addr-opt { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.ob-same { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-weight: 500; color: var(--text); }
.ob-same input { width: auto; margin: 0; }
.ob-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ob-caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.ob-caps label, .ob-types label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 600; color: var(--text); cursor: pointer; }
.ob-caps label:has(input:checked), .ob-types label:has(input:checked) { border-color: var(--accent); background: rgba(241, 90, 44, 0.06); }
.ob-caps input, .ob-types input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.ob-caps small, .ob-types small { display: block; font-weight: 400; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.ob-doc { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; }
.ob-doc strong { display: block; }
.ob-doc small { color: var(--text-muted); font-size: 12.5px; }
.ob-doc .ok { color: #15803d; font-weight: 700; font-size: 13px; }
.ob-doc label.btn { margin: 0; cursor: pointer; }
.ob-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.ob-check { list-style: none; margin: 12px 0 0; padding: 0; }
.ob-check li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.ob-check li:first-child { border-top: none; }
.ob-check .mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(22, 163, 74, 0.14); color: #15803d; }
.ob-check .mark.no { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.ob-check button { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; margin-left: auto; font-size: 13px; }
.ob-status { text-align: center; padding: 40px 24px; }
.ob-status .big { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: rgba(2, 132, 199, 0.12); color: #0369a1; }
.ob-status ol { text-align: left; max-width: 460px; margin: 20px auto 0; padding-left: 20px; color: var(--text-muted); line-height: 1.7; font-size: 14px; }
.ob-top { position: sticky; top: 0; z-index: 30; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.ob-top .lx-top-inner { justify-content: space-between; }
.ob-top button { padding: 7px 12px; font-size: 13px; }
.ob-top .ob-email { color: var(--text-muted); font-size: 13px; }
@media (max-width: 720px) {
  .ob-grid, .ob-types { grid-template-columns: 1fr; }
  .ob-steps li { font-size: 10.5px; }
  .ob-top .ob-email { display: none; }
}

/* ---------- Messages inside a portal (/<portal>/messages.html) ---------- */
.lx-messages .app-topbar h1 { margin: 0 0 4px; font-size: 26px; }
.lx-nav-badge { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
@media (max-width: 900px) {
  .lx-messages .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
.lx-messages .thread-item { display: block; }
.lx-messages .thread-item > div + div { margin-top: 2px; }
/* Providers stay in their portal - no jump to the main app's full transaction page. */
.lx-messages .open-transaction-link { display: none; }

/* ---------- Importer / exporter home (public/importer/, public/exporter/) ---------- */
.th-quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.th-quick .btn:hover { text-decoration: none; }
.th-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.lx-kpi { display: flex; flex-direction: column; color: var(--text); }
a.lx-kpi:hover { text-decoration: none; border-color: var(--text-faint); }
.th-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.th-grid > * { min-width: 0; }
.th-grid aside .lx-card + .lx-card { margin-top: 16px; }
.th-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); color: var(--text); }
.th-item:first-child { border-top: none; padding-top: 0; }
.th-item:hover { text-decoration: none; }
.th-item:hover strong { color: var(--accent); }
.th-ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(241, 90, 44, 0.1); font-size: 17px; }
.th-item div { flex: 1; min-width: 0; }
.th-item strong { display: block; font-size: 14.5px; }
.th-item small { display: block; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-item .chev { color: var(--text-faint); font-size: 18px; }
.th-recent { margin-top: 10px; }
.th-recent a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); color: var(--text); font-size: 13.5px; }
.th-recent a:first-child { border-top: none; }
.th-recent a:hover { text-decoration: none; color: var(--accent); }
.th-recent small { display: block; color: var(--text-muted); font-size: 12.5px; }
.th-more { font-size: 13px; font-weight: 600; }
.th-done { padding: 26px 12px; text-align: center; color: var(--text-muted); }
.th-done strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
@media (max-width: 900px) {
  .th-grid { grid-template-columns: minmax(0, 1fr); }
  .th-kpis { grid-template-columns: 1fr 1fr; }
}
/* Hidden badges, dots and popovers stay hidden on app pages too (portal pages already have .lx-body [hidden]). */
.lx-top [hidden], .lx-pop[hidden] { display: none !important; }
@media (max-width: 720px) {
  /* Up to six portal sections fit (and scroll if needed) in the bottom bar. */
  .lx-nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .lx-nav::-webkit-scrollbar { display: none; }
  .lx-nav a { flex: 1 0 auto; text-align: center; font-size: 12px; padding: 8px 9px; white-space: nowrap; }
}

/* "Write with Jozie AI" on company setup (portal-onboarding.js#wireDescribeAi) */
.ob-describe-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ob-describe-head label { margin-bottom: 0; }
.ob-ai-btn { border: 1px solid rgba(241, 90, 44, .35); background: rgba(241, 90, 44, .07); color: var(--accent); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ob-ai-btn:hover { background: rgba(241, 90, 44, .14); }
.ob-ai { margin: 8px 0 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(241, 90, 44, .3); background: rgba(241, 90, 44, .04); }
.ob-ai[hidden], .ob-ai-done[hidden] { display: none; }
.ob-ai label { font-weight: 500; font-size: 13px; color: var(--text); }
.ob-ai textarea { margin-top: 6px; }
.ob-ai-note { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }
.ob-ai-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ob-ai-actions button { padding: 7px 14px; font-size: 13px; }
.ob-describe > textarea { margin-top: 6px; }
.ob-ai-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; color: #166534; }
.ob-ai-done button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.ob-flash { animation: ob-flash 1.2s ease-out; }
@keyframes ob-flash { from { box-shadow: 0 0 0 3px rgba(241, 90, 44, .45); } to { box-shadow: 0 0 0 0 rgba(241, 90, 44, 0); } }
@media (prefers-reduced-motion: reduce) { .ob-flash { animation: none; } }

/* "+ Add a company" in the account menu (portal-shell.js#addCompanyLinks) */
.lx-menu #lx-add-company { color: var(--accent); font-weight: 600; }
.lx-add-company { background: var(--bg); border-bottom: 1px solid var(--border); max-height: 320px; overflow-y: auto; }
.lx-add-company[hidden] { display: none; }
.lx-menu .lx-add-company a { padding: 9px 14px 9px 26px; font-size: 13.5px; border-bottom: 0; }
.lx-add-label { padding: 8px 14px 2px 26px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.ob-new-note { margin: -4px 0 14px; padding: 10px 14px; border-radius: 10px; background: rgba(241, 90, 44, .06); border: 1px solid rgba(241, 90, 44, .25); font-size: 13.5px; }

/* Company setup: industry "Other" box and the countries tools (portal-onboarding.js) */
#industry-other { margin-top: 8px; }
#industry-other[hidden] { display: none; }
.ob-served-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; }
.ob-served-tools button { padding: 7px 14px; font-size: 13px; }
.ob-served-tools select { width: auto; margin: 0; padding: 7px 10px; font-size: 13px; }
.ob-served-count { font-size: 12.5px; color: var(--text-muted); margin-left: auto; }
.ob-served-match { display: block; margin: 8px 0 0; border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ob-served-match[hidden] { display: none; }
.ob-served-more { display: inline-flex; align-items: center; padding: 4px 10px; font-size: 12.5px; color: var(--text-muted); }
