:root {
  --lm-ink: #172033;
  --lm-muted: #5b687a;
  --lm-border: #dce3ed;
  --lm-surface: #ffffff;
  --lm-canvas: #f4f7fb;
  --lm-brand: #173b60;
  --lm-brand-2: #2f67a7;
  --lm-focus: #ffbf47;
  --lm-danger: #b42318;
  --lm-radius: 1rem;
  --lm-shadow: 0 .55rem 1.6rem rgba(20, 35, 60, .08);
}

html { overflow-x: hidden; scroll-padding-top: 6rem; }
body { min-width: 0; overflow-x: hidden; background: var(--lm-canvas); color: var(--lm-ink); }
a, button, input, select, textarea, summary { scroll-margin-top: 6rem; }
:focus-visible { outline: 3px solid var(--lm-focus) !important; outline-offset: 3px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 3000; transform: translateY(-150%); padding: .65rem 1rem; border-radius: .5rem; background: #fff; color: #111; font-weight: 800; }
.skip-link:focus { transform: none; }
.portal-shell { width: min(100% - 1.5rem, 1400px); margin-inline: auto; padding-block: 1.5rem 2.5rem; }
.portal-shell--narrow { max-width: 920px; }
.portal-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; padding: clamp(1.1rem, 3vw, 1.8rem); border-radius: var(--lm-radius); background: linear-gradient(135deg, var(--lm-brand), var(--lm-brand-2)); color: #fff; box-shadow: var(--lm-shadow); }
.portal-hero h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.25rem); }
.portal-hero p { max-width: 64rem; margin: .35rem 0 0; color: rgba(255,255,255,.82); }
.portal-card, .panel, .settings-widget { border: 1px solid var(--lm-border) !important; border-radius: var(--lm-radius) !important; background: var(--lm-surface); box-shadow: var(--lm-shadow); }
.portal-status { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.portal-status--ok { background: #dcfce7; color: #166534; }
.portal-status--warn { background: #fff3cd; color: #7a4d00; }
.portal-status--off { background: #e9ecef; color: #495057; }
.portal-empty { padding: clamp(2rem, 8vw, 4rem) 1rem; border: 2px dashed var(--lm-border); border-radius: var(--lm-radius); text-align: center; color: var(--lm-muted); }
.portal-message { border-left: .3rem solid #3975b8; border-radius: .6rem; padding: .85rem 1rem; background: #eef6ff; }
.portal-message--danger { border-color: var(--lm-danger); background: #fff0ef; }
.portal-danger-zone { border: 1px solid #f2b8b5; border-radius: var(--lm-radius); background: #fff7f6; }
.portal-danger-zone > summary { color: var(--lm-danger); }
.portal-disclosure { overflow: clip; border: 1px solid var(--lm-border); border-radius: var(--lm-radius); background: #fff; box-shadow: var(--lm-shadow); }
.portal-disclosure + .portal-disclosure { margin-top: 1rem; }
.portal-disclosure > summary { display: flex; align-items: center; gap: .75rem; min-height: 58px; padding: .9rem 1.1rem; cursor: pointer; list-style: none; font-weight: 800; }
.portal-disclosure > summary::-webkit-details-marker { display: none; }
.portal-disclosure > summary::after { content: "+"; margin-left: auto; font-size: 1.35rem; line-height: 1; }
.portal-disclosure[open] > summary { border-bottom: 1px solid var(--lm-border); background: #f8fafc; }
.portal-disclosure[open] > summary::after { content: "−"; }
.portal-disclosure__summary { min-width: 0; }
.portal-disclosure__summary small { display: block; margin-top: .15rem; color: var(--lm-muted); font-weight: 500; }
.portal-disclosure__body { padding: 1rem; }
.portal-bucket { margin-bottom: 1rem; border-color: #cbd6e5; }
.portal-bucket > summary { min-height: 68px; background: #eef3f8; color: var(--lm-brand); font-size: 1.08rem; }
.portal-bucket[open] > summary { background: var(--lm-brand); color: #fff; }
.portal-bucket[open] > summary small { color: rgba(255,255,255,.75); }
.portal-records { display: grid; gap: .75rem; }
.portal-record { padding: 1rem; border: 1px solid var(--lm-border); border-radius: .8rem; background: #fff; }
.portal-steps { display: flex; align-items: center; gap: .45rem; margin: 0 0 1.25rem; padding: 0; list-style: none; color: var(--lm-muted); font-size: .9rem; font-weight: 700; }
.portal-steps li { display: flex; align-items: center; gap: .45rem; }
.portal-steps li:not(:last-child)::after { content: "→"; color: #8290a3; }
.portal-steps [aria-current="step"] { color: var(--lm-brand); }
.portal-sticky-summary { position: sticky; top: 1rem; }
.portal-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .1rem .75rem; scrollbar-width: thin; }
.portal-tabs a { flex: 0 0 auto; min-height: 44px; padding: .6rem .85rem; border: 1px solid var(--lm-border); border-radius: 999px; background: #fff; color: var(--lm-brand); font-weight: 800; text-decoration: none; }
.portal-tabs a:hover, .portal-tabs a:focus-visible, .portal-tabs a[aria-current="page"] { border-color: var(--lm-brand-2); background: var(--lm-brand); color: #fff; }
.form-control, .form-select, .btn { min-height: 44px; }
.form-label, legend { font-weight: 700; }
.invalid-feedback, .portal-validation { font-weight: 650; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.table caption { color: var(--lm-muted); }
.pagination { flex-wrap: wrap; }
[aria-busy="true"] { cursor: progress; }
.portal-loading { display: grid; min-height: 9rem; place-items: center; color: var(--lm-muted); }

.portal-nav { position: relative; z-index: 1080; border-bottom: 1px solid #d8e0ea; background: #fff; box-shadow: 0 .25rem 1rem rgba(20,35,60,.08); }
.portal-nav .container-fluid { max-width: 1500px; }
.portal-brand { display: inline-flex; align-items: center; min-width: 0; gap: .55rem; color: var(--lm-brand); font-size: 1.2rem; font-weight: 900; text-decoration: none; }
.portal-brand img { display: block; width: 300px; max-width: 100%; height: auto; object-fit: contain; }
.portal-nav .nav-link { border-radius: .6rem; color: #314158; font-weight: 750; }
.portal-nav .nav-link:hover, .portal-nav .nav-link:focus-visible, .portal-nav .nav-link.active { background: #eaf1f8; color: #102f52; }
.portal-nav .nav-link.active { box-shadow: inset 0 -3px 0 var(--lm-brand-2); }
.portal-cart-link { display: inline-flex; align-items: center; gap: .4rem; }
.portal-cart-count { display: inline-grid; min-width: 1.45rem; height: 1.45rem; place-items: center; padding-inline: .3rem; border-radius: 999px; background: #c62828; color: #fff; font-size: .74rem; }
.portal-cart-count--empty { min-width: auto; height: auto; padding: 0; border-radius: 0; background: transparent; color: var(--lm-ink); font-size: .82rem; }
.portal-credit { display: flex; flex-direction: column; justify-content: center; padding: .35rem .65rem; border: 1px solid #b8c9df; border-radius: .65rem; background: #f4f8fc; color: #173b60; line-height: 1.1; }
.portal-credit strong { white-space: nowrap; font-size: .87rem; }
.portal-credit small { margin-top: .18rem; color: #5b687a; font-size: .66rem; }
.portal-mobile-actions { display: none; }
.portal-account-meta { max-width: 24rem; padding: .55rem 1rem; color: var(--lm-muted); font-size: .78rem; overflow-wrap: anywhere; }
.impersonation-banner { position: sticky; top: 0; z-index: 1035; border-width: 0 0 2px !important; }
.portal-credit-reminder { width: min(92vw, 34rem); max-height: min(90vh, 42rem); padding: 0; border: 0; border-radius: 1rem; color: var(--lm-ink); box-shadow: 0 1.25rem 4rem rgba(16,47,82,.3); }
.portal-credit-reminder::backdrop { background: rgba(15,28,45,.58); backdrop-filter: blur(2px); }
.portal-credit-reminder form { margin: 0; }
.portal-credit-reminder__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem .85rem; border-bottom: 1px solid var(--lm-border); }
.portal-credit-reminder__header h2 { margin: .55rem 0 0; color: var(--lm-brand); font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.2; }
.portal-credit-reminder__close { display: inline-grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid var(--lm-border); border-radius: 999px; background: #fff; color: var(--lm-brand); font-size: 1.65rem; line-height: 1; }
.portal-credit-reminder__close:hover, .portal-credit-reminder__close:focus-visible { background: #eaf1f8; }
.portal-credit-reminder__body { padding: 1.1rem 1.25rem .65rem; }
.portal-credit-reminder__body p { margin: 0 0 .65rem; }
.portal-credit-reminder__deadline { color: #8a3b12; }
.portal-credit-reminder__scope { color: var(--lm-muted); font-size: .88rem; }
.portal-credit-reminder__actions { display: flex; flex-wrap: wrap; gap: .65rem; padding: .65rem 1.25rem 1.25rem; }

@media (max-width: 991.98px) {
  .portal-nav .container-fluid { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
  .portal-brand { flex: 1 1 14rem; justify-content: center; width: auto; max-width: 300px; }
  .portal-brand img { width: 100%; max-width: none; }
  .portal-nav .navbar-toggler { position: relative; z-index: 2; flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: .25rem .4rem; }
  .portal-nav .navbar-collapse { flex-basis: 100%; width: 100%; max-height: calc(100vh - 96px); overflow-y: auto; padding: .75rem 0 1rem; }
  .portal-nav .dropdown-menu { position: static; border: 0; box-shadow: none; }
  .portal-credit { margin-block: .4rem; }
  .portal-mobile-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .35rem; min-width: 0; margin-left: auto; }
  .portal-mobile-credit { display: inline-flex; align-items: baseline; gap: .25rem; min-height: 44px; padding: .5rem .65rem; border: 1px solid #b8c9df; border-radius: 999px; background: #f4f8fc; color: var(--lm-brand); font-size: .78rem; white-space: nowrap; }
  .portal-mobile-cart { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: .5rem .65rem; border: 1px solid #bdc9d7; border-radius: 999px; color: var(--lm-brand); font-weight: 800; text-decoration: none; white-space: nowrap; }
}
@media (max-width: 575.98px) {
  .portal-mobile-actions { gap: .25rem; }
  .portal-mobile-credit, .portal-mobile-cart { padding-inline: .4rem; }
  .portal-mobile-credit__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}
@media (max-width: 400px) {
  .portal-mobile-cart__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}
@media (min-width: 992px) { .portal-mobile-actions { display: none; } }
@media (max-width: 767.98px) {
  .portal-shell { width: min(100% - 1rem, 1400px); padding-top: 1rem; }
  .portal-hero { border-radius: .8rem; }
  .portal-sticky-summary { position: static; }
  .portal-responsive-table thead { display: none; }
  .portal-responsive-table, .portal-responsive-table tbody, .portal-responsive-table tr, .portal-responsive-table td { display: block; width: 100%; }
  .portal-responsive-table tr { margin-bottom: .75rem; padding: .35rem .75rem; border: 1px solid var(--lm-border); border-radius: .8rem; background: #fff; }
  .portal-responsive-table td { display: grid; grid-template-columns: minmax(7rem, 38%) 1fr; gap: .75rem; border: 0; padding: .45rem 0; }
  .portal-responsive-table td::before { content: attr(data-label); color: var(--lm-muted); font-size: .75rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media print { .portal-nav, .impersonation-banner, .portal-footer, .btn, .lead-page-help { display: none !important; } body { background: #fff; } .portal-card, .panel { box-shadow: none; } }
