/*
 * MeterSenseGB portal — Apple-like chrome on MeterSense tokens.
 * Montserrat 600/700 · no gradients · AA contrast both themes.
 *
 * Lite triad (keep it tight):
 *   blue  #2164B3 — structure / text
 *   green #146C32 — data + success only (charts, active)
 *   cyan  #1AA4D5 — the one contrast accent (nav, CTAs, icons)
 */

/*
 * Auth flow:
 * - Login: marketplace header + form (pending hides form until ready).
 * - Portal shell: loading card until /me; then sidebar shell only.
 */
body.ms-lite-auth-pending .lite-page-head,
body.ms-lite-auth-pending .lite-section,
body.ms-lite-auth-pending .lite-auth,
body.ms-lite-auth-pending .ms-hero,
body.ms-lite-auth-pending .ms-section,
body.ms-lite-auth-pending .lite-workspace,
body.ms-lite-auth-pending .lite-stats,
body.ms-lite-auth-pending .lite-dashboard,
body.ms-lite-auth-pending .lite-panel-connections,
body.ms-lite-auth-pending .lite-keys-grid,
body.ms-lite-auth-pending .lite-settings-grid,
body.ms-lite-auth-pending .lite-invoices,
body.ms-lite-auth-pending .lite-invoice-table,
body.ms-lite-auth-pending main,
body.ms-lite-auth-pending .lite-shell__main {
  visibility: hidden;
}

body.ms-lite-auth-pending #ms-lite-shell {
  display: none !important;
}

/* Fail closed: never paint protected chrome until auth-ready. */
body.ms-lite-shell.ms-lite-auth-pending #ms-lite-shell,
body.ms-lite-shell:not(.ms-lite-auth-ready) #ms-lite-shell {
  display: none !important;
}

body.ms-lite-auth-ready .lite-page-head,
body.ms-lite-auth-ready .lite-section,
body.ms-lite-auth-ready .lite-auth,
body.ms-lite-auth-ready .ms-hero,
body.ms-lite-auth-ready .ms-section,
body.ms-lite-auth-ready .lite-workspace,
body.ms-lite-auth-ready .lite-stats,
body.ms-lite-auth-ready .lite-dashboard,
body.ms-lite-auth-ready .lite-panel-connections,
body.ms-lite-auth-ready .lite-pane-usage,
body.ms-lite-auth-ready .lite-keys-grid,
body.ms-lite-auth-ready .lite-settings-grid {
  visibility: visible;
}

body.ms-lite-auth-ready:not(.ms-lite-login) #ms-lite-shell {
  display: flex;
}

body.ms-lite-auth-ready #lite-auth-loading,
body.ms-lite-login #lite-auth-loading {
  display: none !important;
}

body.ms-lite-login.ms-lite-auth-ready .lite-auth,
body.ms-lite-login.ms-lite-auth-ready .ms-hero,
body.ms-lite-login.ms-lite-auth-ready .ms-section {
  visibility: visible;
}

/* Portal colour roles — blue structure, green data, cyan contrast */
body.ms-lite {
  --ms-lite-contrast: #1AA4D5;
  --ms-lite-contrast-btn: #0B6F94;
  --ms-lite-contrast-btn-hover: #095F7F;
  --ms-lite-contrast-fg: #0B6F94;
  --ms-10: #0B6F94;
  --ms-kicker: #0B6F94;
  --ms-hot-border: #1AA4D5;
  --ms-link-hover: #0B6F94;
}

html[data-theme="dark"] body.ms-lite {
  --ms-lite-contrast-fg: #7ED4F0;
  --ms-kicker: #7ED4F0;
  --ms-link-hover: #7ED4F0;
}

body.ms-lite .ms-btn {
  background: var(--ms-lite-contrast-btn);
  border-color: var(--ms-lite-contrast-btn);
  color: #fff;
}

body.ms-lite .ms-btn:hover {
  background: var(--ms-lite-contrast-btn-hover);
  border-color: var(--ms-lite-contrast-btn-hover);
  color: #fff;
}

body.ms-lite .ms-btn-ghost,
body.ms-lite .ms-btn-transparent {
  background: transparent;
  border-color: var(--ms-30);
  color: var(--ms-30);
}

body.ms-lite .ms-btn-ghost:hover,
body.ms-lite .ms-btn-transparent:hover {
  background: transparent;
  border-color: var(--ms-lite-contrast);
  color: var(--ms-lite-contrast-fg);
}

html[data-theme="dark"] body.ms-lite .ms-btn-ghost,
html[data-theme="dark"] body.ms-lite .ms-btn-transparent {
  border-color: var(--ms-lite-contrast-fg);
  color: var(--ms-lite-contrast-fg);
}

html[data-theme="dark"] body.ms-lite .ms-btn-ghost:hover,
html[data-theme="dark"] body.ms-lite .ms-btn-transparent:hover {
  border-color: var(--ms-lite-contrast);
  color: var(--ms-lite-contrast);
}

body.ms-lite .ms-theme-toggle[aria-expanded="true"],
body.ms-lite .ms-theme-toggle[aria-pressed="true"] {
  background: var(--ms-lite-contrast-btn);
  border-color: var(--ms-lite-contrast-btn);
  color: #fff;
}

.lite-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, color-mix(in srgb, var(--ms-lite-contrast) 12%, transparent), transparent 70%),
    var(--ms-bg);
}

.lite-auth-loading__card {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  text-align: center;
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--ms-border);
  background: color-mix(in srgb, var(--ms-panel) 92%, transparent);
  box-shadow: 0 12px 32px color-mix(in srgb, #000 18%, transparent);
  min-width: min(18rem, 100%);
}

.lite-auth-loading__card p {
  margin: 0;
  font-weight: 700;
  color: var(--ms-text);
}

.lite-auth-loading__spinner {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 980px;
  border: 2px solid color-mix(in srgb, var(--ms-lite-contrast) 28%, var(--ms-border));
  border-top-color: var(--ms-lite-contrast);
  animation: lite-spin 0.7s linear infinite;
}

@keyframes lite-spin {
  to { transform: rotate(360deg); }
}

/*
 * Login / reset: same wave + split layout.
 * 60/30/10 — neutrals · blue structure · cyan contrast (green reserved for data)
 */
body.ms-lite-login {
  --ms-bg: #F4F8FB;
  --ms-top-bg: rgba(255, 255, 255, 0.88);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #F4F8FB;
}

html[data-theme="dark"] body.ms-lite-login {
  --ms-bg: #00316B;
  --ms-top-bg: rgba(0, 49, 107, 0.86);
  background: #00316B;
}

body.ms-lite-login > .ms-top,
body.ms-lite-login > .ms-footer {
  flex-shrink: 0;
}

body.ms-lite-login > .ms-top {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: #c5d4e8;
}

html[data-theme="dark"] body.ms-lite-login > .ms-top {
  background: rgba(0, 49, 107, 0.92);
  border-bottom-color: #2A5F9E;
}

body.ms-lite-login .lite-auth {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: clamp(1.25rem, 3.5vh, 2.25rem) 0;
}

body.ms-lite-login .lite-auth.ms-hero--panel {
  min-height: 0;
  background: #F4F8FB;
}

/* Keep wave art; neutral wash so teal stays ~10% accent */
body.ms-lite-login .lite-auth.ms-hero--panel::after {
  background: rgba(244, 248, 251, 0.55);
}

html[data-theme="dark"] body.ms-lite-login .lite-auth.ms-hero--panel {
  background: #00316B;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth.ms-hero--panel::after {
  background: rgba(0, 49, 107, 0.42);
}

body.ms-lite-login .lite-auth__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17.5rem, 22rem);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: center;
  width: min(1120px, calc(100% - 2rem));
}

body.ms-lite-login .lite-auth__copy {
  text-align: left;
}

body.ms-lite-login .lite-auth__copy .ms-kicker {
  margin-bottom: 0.55rem;
  color: #0B6F94;
}

body.ms-lite-login .lite-auth__copy h1 {
  margin: 0 0 0.55rem;
  max-width: 14ch;
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #2164B3;
  font-weight: 700;
  text-shadow: 0 1px 18px rgba(244, 248, 251, 0.7);
}

body.ms-lite-login .lite-auth__copy p {
  margin: 0;
  max-width: 32rem;
  color: #3d5f8a;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  font-weight: 600;
}

body.ms-lite-login .lite-auth__form {
  min-width: 0;
}

body.ms-lite-login .lite-auth__form .lite-panel {
  padding: 1.15rem 1.2rem 1.25rem;
  background: #ffffff;
  border: 1px solid #c5d4e8;
  box-shadow: 0 10px 28px color-mix(in srgb, #2164B3 12%, transparent);
}

body.ms-lite-login .lite-auth__form .lite-form-row label {
  color: #2164B3;
}

body.ms-lite-login .lite-auth__form .lite-form-row input {
  background: #F4F8FB;
  border-color: #c5d4e8;
  color: #2164B3;
}

body.ms-lite-login .lite-auth__form .lite-form-row input:focus {
  outline: 2px solid #2164B3;
  outline-offset: 1px;
}

body.ms-lite-login .lite-auth__form input:-webkit-autofill,
body.ms-lite-login .lite-auth__form input:-webkit-autofill:hover,
body.ms-lite-login .lite-auth__form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #2164B3;
  caret-color: #2164B3;
  box-shadow: 0 0 0 1000px #F4F8FB inset;
  transition: background-color 99999s ease-out;
}

body.ms-lite-login .lite-auth__form .ms-btn,
body.ms-lite-login > .ms-top .ms-btn:not(.ms-btn-transparent) {
  background: #0B6F94;
  border-color: #0B6F94;
  color: #ffffff;
}

body.ms-lite-login .lite-auth__form .ms-btn {
  width: 100%;
  margin-top: 0.85rem;
  justify-content: center;
}

body.ms-lite-login .lite-auth__form .ms-btn:hover,
body.ms-lite-login > .ms-top .ms-btn:not(.ms-btn-transparent):hover {
  background: #095F7F;
  border-color: #095F7F;
  color: #ffffff;
}

body.ms-lite-login .lite-auth__form .lite-text-btn,
body.ms-lite-login .lite-auth__form a {
  color: #2164B3;
}

body.ms-lite-login .lite-auth__form .lite-text-btn:hover,
body.ms-lite-login .lite-auth__form a:hover {
  color: #0B6F94;
}

body.ms-lite-login .lite-flash {
  margin-bottom: 0.75rem;
}

body.ms-lite-login > .ms-footer {
  padding: 1rem 0 1.15rem;
  background: color-mix(in srgb, #F4F8FB 88%, #ffffff);
  border-top: 1px solid #c5d4e8;
  color: #2164B3;
}

body.ms-lite-login > .ms-footer strong,
body.ms-lite-login > .ms-footer a {
  color: #2164B3;
}

body.ms-lite-login > .ms-footer a:hover {
  color: #0B6F94;
}

body.ms-lite-login > .ms-footer .ms-footer-inner {
  gap: 0.85rem 1.5rem;
  align-items: start;
}

body.ms-lite-login > .ms-footer p {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3d5f8a;
}

body.ms-lite-login > .ms-footer .ms-footer-links {
  gap: 0.35rem;
  font-size: 0.82rem;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__copy .ms-kicker {
  color: #7ED4F0;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__copy h1 {
  color: #E8F2FA;
  text-shadow: 0 2px 24px rgba(0, 49, 107, 0.55);
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__copy p {
  color: #B7D0E4;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-panel {
  background: #0A4180;
  border-color: #2A5F9E;
  box-shadow: 0 10px 28px color-mix(in srgb, #000 28%, transparent);
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-form-row label,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-form-row input,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-text-btn,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form a {
  color: #E8F2FA;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-form-row input {
  background: #002857;
  border-color: #2A5F9E;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__form input:-webkit-autofill,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form input:-webkit-autofill:hover,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #E8F2FA;
  caret-color: #E8F2FA;
  box-shadow: 0 0 0 1000px #002857 inset;
}

html[data-theme="dark"] body.ms-lite-login .lite-auth__form .lite-text-btn:hover,
html[data-theme="dark"] body.ms-lite-login .lite-auth__form a:hover {
  color: #7ED4F0;
}

html[data-theme="dark"] body.ms-lite-login > .ms-footer {
  background: #0A4180;
  border-top-color: #2A5F9E;
  color: #E8F2FA;
}

html[data-theme="dark"] body.ms-lite-login > .ms-footer strong,
html[data-theme="dark"] body.ms-lite-login > .ms-footer a,
html[data-theme="dark"] body.ms-lite-login > .ms-footer p {
  color: #E8F2FA;
}

html[data-theme="dark"] body.ms-lite-login > .ms-footer a:hover {
  color: #7ED4F0;
}

@media (max-width: 820px) {
  body.ms-lite-login .lite-auth__grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  body.ms-lite-login .lite-auth__copy h1 {
    max-width: none;
  }

  body.ms-lite-login .lite-auth__form {
    max-width: 28rem;
  }

  body.ms-lite-login > .ms-footer .ms-footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 720px) {
  body.ms-lite-login .lite-auth {
    padding: 0.85rem 0;
  }

  body.ms-lite-login .lite-auth__copy h1 {
    font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  }

  body.ms-lite-login .lite-auth__form .lite-panel {
    padding: 1rem 1.05rem 1.1rem;
  }

  body.ms-lite-login > .ms-footer {
    padding: 0.75rem 0 0.9rem;
  }
}

body[data-lite-page] .ms-wrap {
  width: min(1280px, calc(100% - 2rem));
}

/* —— Authenticated shell (sidebar + main) —— */
body.ms-lite-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.lite-shell {
  display: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 45% 35% at 100% 0%, color-mix(in srgb, var(--ms-lite-contrast) 10%, transparent), transparent 70%),
    var(--ms-bg);
}

.lite-sidebar {
  width: 15.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1rem 1.15rem;
  background: color-mix(in srgb, var(--ms-ink) 88%, #000);
  border-right: 1px solid var(--ms-border);
}

html[data-theme="light"] .lite-sidebar {
  background: #001529;
  border-right-color: #0A4180;
  color: #E8F2FA;
}

.lite-sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  padding: 0.25rem 0.4rem;
}

.lite-sidebar__brand .ms-brand-suffix {
  color: #7ED4F0;
  font-weight: 700;
}

.lite-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 auto;
}

.lite-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  color: #B7D0E4;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.lite-sidebar__link:hover {
  color: #E8F2FA;
  background: color-mix(in srgb, #fff 6%, transparent);
  text-decoration: none;
}

.lite-sidebar__link.is-active {
  color: #E8F2FA;
  background: color-mix(in srgb, var(--ms-lite-contrast) 18%, transparent);
  border-color: color-mix(in srgb, var(--ms-lite-contrast) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ms-lite-contrast) 22%, transparent);
}

.lite-sidebar__link .bi {
  font-size: 1.05rem;
  width: 1.15rem;
  text-align: center;
}

.lite-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.65rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #fff 10%, transparent);
  background: color-mix(in srgb, #fff 4%, transparent);
  text-decoration: none;
  color: inherit;
}

.lite-sidebar__user:hover {
  background: color-mix(in srgb, #fff 8%, transparent);
  text-decoration: none;
  color: inherit;
}

.lite-sidebar__avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 980px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ms-lite-contrast) 22%, transparent);
  color: #7ED4F0;
  flex-shrink: 0;
}

.lite-sidebar__user-meta {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.lite-sidebar__user-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #8eb0cc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lite-sidebar__user-meta strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #E8F2FA;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lite-shell__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lite-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--ms-border);
  background: color-mix(in srgb, var(--ms-panel) 72%, transparent);
  backdrop-filter: blur(10px);
}

.lite-topbar__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ms-text);
  letter-spacing: -0.01em;
}

.lite-topbar__spacer {
  flex: 1 1 auto;
}

.lite-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.lite-topbar__actions #ms-lite-cta {
  cursor: pointer;
}

.lite-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: transparent;
  color: var(--ms-text);
  cursor: pointer;
}

.lite-shell__main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.85rem clamp(0.85rem, 2vw, 1.35rem) 1rem;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-lite-page="docs"] .lite-shell__main {
  overflow-y: auto;
}

body[data-lite-page="docs"] .ms-docs-hero {
  padding: 0.25rem 0 1rem;
}

body[data-lite-page="docs"] .ms-docs-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  max-width: 22ch;
}

body[data-lite-page="docs"] .ms-docs-hero .ms-docs-quicklinks {
  justify-content: flex-start;
}

body[data-lite-page="docs"] .ms-section {
  padding: 1.25rem 0 2rem;
}

@media (max-width: 960px) {
  .lite-shell {
    position: relative;
  }

  .lite-sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    height: 100%;
  }

  body.lite-sidebar-open .lite-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 40px color-mix(in srgb, #000 35%, transparent);
  }

  .lite-sidebar-toggle {
    display: inline-flex;
  }
}

.lite-page-head {
  padding: 0.35rem 0 1rem;
  text-align: left;
}

.lite-page-head .ms-kicker {
  margin-bottom: 0.45rem;
  color: var(--ms-lite-contrast-fg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.lite-page-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ms-text);
  font-weight: 700;
}

.lite-page-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}

.lite-page-head__row .ms-btn {
  gap: 0.4rem;
}

.lite-workspace {
  margin: 0;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid var(--ms-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ms-panel) 94%, transparent);
  min-width: 0;
}

.lite-workspace--fit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow: hidden;
}

.lite-fit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  flex-shrink: 0;
}

.lite-fit-head__title {
  min-width: 0;
  flex: 1 1 12rem;
}

.lite-fit-head__title h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ms-text);
  font-weight: 700;
}

.lite-fit-head__title .lite-muted {
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.lite-fit-head__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.lite-stats--compact {
  display: inline-flex !important;
  grid-template-columns: none;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  flex: 2 1 18rem;
  border: 1px solid color-mix(in srgb, var(--ms-border) 80%, transparent);
  border-radius: 12px;
  overflow: hidden;
}

.lite-stats--compact .lite-stat {
  flex: 1 1 5.5rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--ms-border) 75%, transparent);
  border-radius: 0;
  background: transparent;
}

.lite-stats--compact .lite-stat:first-child,
.lite-stats--compact .lite-stat:last-child {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.lite-stats--compact .lite-stat:last-child {
  border-right: 0;
}

@media (max-width: 1100px) {
  .lite-stats--compact .lite-stat {
    border-bottom: 0;
  }
}

.lite-stats--compact .lite-stat__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lite-stats--compact .lite-stat__value {
  font-size: 1.05rem;
  margin-top: 0.1rem;
}

.lite-stats--compact .lite-stat__value--sm {
  font-size: 0.82rem;
}

.lite-browser {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ms-border) 85%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ms-panel) 96%, transparent);
}

.lite-tabstrip {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.3rem;
  padding: 0.45rem 0.55rem 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--ms-border);
  background: color-mix(in srgb, var(--ms-60) 70%, transparent);
  flex-shrink: 0;
}

html[data-theme="dark"] .lite-tabstrip {
  background: color-mix(in srgb, var(--ms-ink) 55%, transparent);
}

.lite-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 14rem;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--ms-muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.lite-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lite-tab:hover {
  color: var(--ms-text);
  background: color-mix(in srgb, var(--ms-lite-contrast) 8%, transparent);
}

.lite-tab.is-active {
  color: var(--ms-text);
  background: var(--ms-panel);
  border-color: var(--ms-border);
  box-shadow: 0 1px 0 var(--ms-panel);
}

.lite-tab__close {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.7;
}

.lite-tab__close:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--ms-text) 10%, transparent);
}

.lite-fit-stage,
.lite-browser__stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.lite-pane {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  margin: 0;
  padding: 0.95rem 1.05rem 1rem;
  border: 0;
  overflow: hidden;
}

.lite-pane.is-active {
  display: flex;
}

.lite-workspace--fit .lite-panel-connections {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: none;
  flex-direction: column;
  margin: 0;
  padding: 0.95rem 1.05rem 1rem;
  border: 0;
}

.lite-workspace--fit .lite-panel-connections.is-active {
  display: flex;
}

.lite-workspace--fit .lite-connections-toolbar {
  flex-shrink: 0;
  margin-bottom: 0.7rem;
}

.lite-workspace--fit .lite-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.lite-workspace--fit .lite-table-footer {
  flex-shrink: 0;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
}

.lite-pane-usage {
  gap: 0.7rem;
}

.lite-pane-usage .lite-usage-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.15rem;
  flex-shrink: 0;
}

.lite-pane-usage .lite-usage-panel__head .lite-panel__head {
  margin-bottom: 0;
  min-width: 0;
}

.lite-pane-usage .lite-panel__head h2 {
  margin-bottom: 0.3rem;
}

.lite-pane-usage .lite-chart-controls {
  gap: 0.75rem 1rem;
}

.lite-panel-close {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: transparent;
  color: var(--ms-text);
  cursor: pointer;
}

.lite-panel-close:hover {
  border-color: var(--ms-lite-contrast);
  color: var(--ms-lite-contrast-fg);
}

.lite-pane-usage .lite-chart-wrap {
  flex: 1 1 auto;
  min-height: 14rem;
  height: auto;
  padding-top: 0.25rem;
}

.lite-pane-usage .lite-chart-caption,
.lite-pane-usage .lite-chart-hover,
.lite-pane-usage .lite-chart-axis-hint,
.lite-pane-usage .lite-unit-note {
  flex-shrink: 0;
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.lite-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(28rem, calc(100vw - 1.5rem));
  color: inherit;
}

.lite-modal::backdrop {
  background: color-mix(in srgb, #000C18 55%, transparent);
}

.lite-modal__card {
  margin: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--ms-border);
  border-radius: 16px;
  background: var(--ms-panel);
  box-shadow: 0 18px 48px color-mix(in srgb, #000 28%, transparent);
  display: grid;
  gap: 0.75rem;
}

.lite-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.lite-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ms-text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lite-modal[open] {
  animation: lite-modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes lite-modal-in {
  from {
    opacity: 0;
    transform: translateY(0.4rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lite-modal[open] {
    transition: none;
    animation: none;
  }
}

.lite-workspace > .lite-stats,
.lite-workspace > .lite-dashboard,
.lite-workspace > .lite-section {
  margin: 0;
}

.lite-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 1.15rem;
}

@media (max-width: 1100px) {
  .lite-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .lite-stats {
    grid-template-columns: 1fr;
  }
}

.lite-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 1rem;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--ms-border) 75%, transparent);
  border-radius: 0;
  background: transparent;
  min-width: 0;
}

.lite-stat:last-child {
  border-right: 0;
  padding-right: 0;
}

.lite-stat:first-child {
  padding-left: 0;
}

@media (max-width: 1100px) {
  .lite-stat {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--ms-border) 75%, transparent);
    padding: 0.85rem 0.25rem;
  }

  .lite-stat:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .lite-stat {
    border-bottom: 1px solid color-mix(in srgb, var(--ms-border) 75%, transparent);
  }

  .lite-stat:last-child {
    border-bottom: 0;
  }
}

.lite-stat__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ms-lite-contrast) 14%, transparent);
  color: var(--ms-lite-contrast-fg);
  flex-shrink: 0;
  font-size: 1.05rem;
}

.lite-stat__label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ms-muted);
  letter-spacing: 0.01em;
}

.lite-stat__value {
  margin: 0.15rem 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ms-text);
  line-height: 1.1;
}

.lite-stat__value--sm {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lite-grid {
  display: grid;
  gap: 1.25rem;
}

.lite-dashboard {
  grid-template-columns: 1fr;
  margin-bottom: 0;
  gap: 1.25rem;
}

@media (min-width: 1100px) {
  .lite-dashboard {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.32fr);
    gap: 1.75rem;
    align-items: stretch;
  }

  .lite-dashboard > .lite-section + .lite-section {
    padding-left: 1.75rem;
    border-left: 1px solid color-mix(in srgb, var(--ms-border) 80%, transparent);
  }
}

.lite-keys-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .lite-keys-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  }
}

.lite-settings-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .lite-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lite-panel--danger {
  border-color: color-mix(in srgb, var(--ms-error) 35%, var(--ms-border));
}

.ms-btn.is-danger,
button.is-danger {
  color: var(--ms-error);
  border-color: color-mix(in srgb, var(--ms-error) 45%, var(--ms-border));
}

.ms-btn.is-danger:hover,
button.is-danger:hover {
  background: color-mix(in srgb, var(--ms-error) 12%, transparent);
  color: var(--ms-error);
}

.lite-panel {
  background: color-mix(in srgb, var(--ms-panel) 92%, transparent);
  border: 1px solid var(--ms-border);
  border-radius: 18px;
  padding: 1.25rem 1.3rem 1.35rem;
  min-width: 0;
  box-shadow: 0 10px 28px color-mix(in srgb, #000 12%, transparent);
}

.lite-workspace .lite-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  min-width: 0;
}

.lite-panel__head {
  margin-bottom: 1rem;
}

.lite-panel__head--spaced {
  margin-top: 1.35rem;
  margin-bottom: 0.65rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--ms-border);
}

.lite-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.lite-inline-field {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.lite-inline-field input {
  flex: 1 1 auto;
  min-width: 0;
}

.lite-actions--stack {
  display: grid;
  gap: 0.55rem;
}

.lite-actions--stack .ms-btn {
  width: 100%;
  justify-content: center;
}

.lite-connections-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.lite-connections-toolbar .lite-panel__head {
  margin-bottom: 0;
}

.lite-connections-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.lite-search {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: min(22rem, 100%);
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-60-raised);
  color: var(--ms-muted);
}

.lite-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ms-text);
  font: inherit;
  font-weight: 600;
  outline: none;
}

.lite-filter-select,
.lite-assign-company {
  min-width: 10rem;
  max-width: 14rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-60-raised);
  color: var(--ms-text);
  font: inherit;
  font-weight: 600;
}

.lite-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ms-border);
}

.lite-pager {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.lite-pager button {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: transparent;
  color: var(--ms-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lite-pager button.is-active,
.lite-pager button:hover {
  border-color: var(--ms-lite-contrast);
  background: color-mix(in srgb, var(--ms-lite-contrast) 14%, transparent);
}

.lite-flash {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.lite-flash[hidden],
.lite-flash:not(.is-visible) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  opacity: 0;
}

.lite-flash.is-visible {
  display: flex !important;
  animation: lite-flash-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.lite-flash__close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.85;
}

.lite-flash__close:hover {
  opacity: 1;
}

.lite-flash__msg {
  min-width: 0;
}

.lite-dots {
  display: inline-flex;
  gap: 0.05em;
  margin-left: 0.05em;
  letter-spacing: 0;
  font-weight: 700;
}

.lite-dots span {
  display: inline-block;
  opacity: 0.25;
  transform: translateY(0);
  animation: lite-dot-bounce 1.05s ease-in-out infinite;
}

.lite-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.lite-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lite-dot-bounce {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-0.12em);
  }
}

@keyframes lite-flash-in {
  from {
    opacity: 0;
    transform: translateY(-0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lite-panel__head h2,
.lite-panel__head h3,
.lite-panel h2,
.lite-panel h3,
.lite-section h2,
.lite-section h3 {
  margin: 0 0 0.35rem;
  color: var(--ms-text);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.lite-panel__head h2 .bi,
.lite-panel h2 .bi,
.lite-section h2 .bi {
  color: var(--ms-kicker);
  font-size: 1.05em;
}

.lite-muted {
  margin: 0;
  color: var(--ms-muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.lite-connect-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 640px) {
  .lite-panel-connections .lite-connect-form {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
  }
}

.lite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
}

.lite-actions--primary {
  margin-bottom: 0.25rem;
}

.lite-actions--primary .ms-btn {
  gap: 0.45rem;
}

.lite-actions .ms-btn {
  white-space: nowrap;
}

.lite-icon-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.lite-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  border-radius: 980px;
  border: 1px solid var(--ms-border);
  background: transparent;
  color: var(--ms-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.lite-icon-btn:hover {
  border-color: var(--ms-30);
  color: var(--ms-link-hover);
  text-decoration: none;
}

.lite-icon-btn.is-danger:hover {
  border-color: var(--ms-error);
  color: var(--ms-error);
}

.lite-icon-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.lite-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.lite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-weight: 600;
}

.lite-table th,
.lite-table td {
  text-align: left;
  padding: 0.75rem 0.45rem;
  border-bottom: 1px solid var(--ms-border);
  vertical-align: middle;
  color: var(--ms-text);
}

.lite-table th {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ms-muted);
}

.lite-table th.lite-th-num,
.lite-table td.lite-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lite-table td.lite-num {
  color: var(--ms-muted);
  font-size: 0.88rem;
}

/* Override .lite-actions { display:flex } — flex on <td> breaks row borders. */
.lite-table td.lite-actions {
  display: table-cell;
  min-width: 11rem;
  vertical-align: middle;
}

.lite-table td.lite-actions .lite-actions__row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  vertical-align: middle;
}

.lite-table tr.is-selected {
  background: color-mix(in srgb, var(--ms-lite-contrast) 12%, transparent);
}

.lite-table tr.is-selected td {
  border-bottom-color: color-mix(in srgb, var(--ms-lite-contrast) 32%, var(--ms-border));
}

body.ms-lite .ms-top--lite {
  border-bottom-color: var(--ms-border);
}

body.ms-lite .ms-footer--lite .ms-footer-links {
  align-content: start;
}

body.ms-lite .ms-hero h1,
body.ms-lite .lite-panel h2,
body.ms-lite .lite-panel h3,
body.ms-lite .lite-section h2,
body.ms-lite .lite-section h3,
body.ms-lite .lite-muted,
body.ms-lite .lite-table,
body.ms-lite .lite-form-row label,
body.ms-lite .lite-page-head {
  text-align: left;
}

body.ms-lite .ms-hero,
body.ms-lite .ms-hero .ms-wrap,
body.ms-lite .ms-hero__content {
  text-align: left;
  align-items: flex-start;
}

body.ms-lite .ms-section h2,
body.ms-lite .ms-heading-row {
  text-align: left;
  justify-content: flex-start;
}

.lite-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 980px;
  font-size: 0.75rem;
  font-weight: 700;
  background: transparent;
  color: var(--ms-text);
  border: 1px solid var(--ms-border);
}

.lite-status.is-active {
  background: var(--ms-btn-green);
  color: #ffffff;
  border-color: var(--ms-btn-green);
}

.lite-status.is-pending {
  background: transparent;
  color: var(--ms-warn-fg);
  border-color: var(--ms-warn-fg);
}

.lite-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.lite-chart-toolbar .lite-panel__head {
  margin-bottom: 0;
  flex: 1 1 14rem;
}

.lite-chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
}

.lite-control {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ms-muted);
}

/* .lite-control { display:grid } overrides UA [hidden]; keep these really hidden. */
.lite-control[hidden],
#lite-location-control[hidden] {
  display: none !important;
}

.lite-control select {
  min-width: 8.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 980px;
  border: 1px solid var(--ms-border);
  background: var(--ms-60-raised);
  color: var(--ms-text);
  font: inherit;
  font-weight: 600;
}

html[data-theme="dark"] .lite-control select {
  background: var(--ms-panel);
  color: var(--ms-text);
}

.lite-control select:focus {
  outline: 2px solid #2164B3;
  outline-offset: 1px;
}

.lite-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 980px;
  border: 1px solid color-mix(in srgb, var(--ms-lite-contrast) 35%, var(--ms-border));
  background: color-mix(in srgb, var(--ms-lite-contrast) 12%, transparent);
  color: var(--ms-lite-contrast-fg);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.lite-location-badge:hover,
.lite-location-badge:focus-visible {
  background: color-mix(in srgb, var(--ms-lite-contrast) 20%, transparent);
  outline: 2px solid var(--ms-lite-contrast);
  outline-offset: 1px;
}

.lite-locations-list {
  display: grid;
  gap: 0.55rem;
  max-height: min(50vh, 22rem);
  overflow: auto;
  margin: 0.75rem 0 1rem;
}

.lite-locations-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ms-border);
  border-radius: 0.85rem;
  background: var(--ms-60-raised);
}

html[data-theme="dark"] .lite-locations-item {
  background: var(--ms-panel);
}

.lite-locations-item__text {
  min-width: 0;
}

.lite-locations-item__text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ms-text);
}

.lite-locations-item__text span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ms-muted);
  word-break: break-word;
}

#lite-location-control select {
  min-width: 14rem;
  max-width: min(28rem, 70vw);
}

#lite-fetch-locations {
  align-self: flex-end;
  white-space: nowrap;
}

.lite-chart-caption {
  margin: 0 0 0.35rem;
  color: var(--ms-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.lite-unit-note {
  margin: 0 0 0.45rem;
  color: var(--ms-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.lite-chart-axis-hint {
  margin: 0.45rem 0 0;
  color: var(--ms-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.lite-chart-wrap {
  position: relative;
  width: 100%;
  height: min(48vh, 460px);
  min-height: 320px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0 0;
  box-sizing: border-box;
  overflow: visible;
}

.lite-chart-wrap.is-loading canvas {
  opacity: 0.35;
  filter: saturate(0.7);
  transition: opacity 0.2s ease;
}

.lite-chart-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, color-mix(in srgb, var(--ms-panel) 72%, transparent), transparent 75%);
}

.lite-chart-loading[hidden] {
  display: none !important;
}

.lite-chart-loading__card {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  text-align: center;
  min-width: min(15rem, 100%);
  max-width: 22rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--ms-border);
  background: color-mix(in srgb, var(--ms-panel) 94%, transparent);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 18%, transparent);
  pointer-events: none;
}

.lite-chart-loading__card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ms-text);
  line-height: 1.35;
}

.lite-chart-loading__spinner {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 980px;
  border: 2px solid color-mix(in srgb, var(--ms-lite-contrast) 28%, var(--ms-border));
  border-top-color: var(--ms-lite-contrast);
  animation: lite-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lite-chart-wrap.is-loading canvas {
    transition: none;
  }

  .lite-chart-loading__spinner {
    animation: none;
    border-top-color: color-mix(in srgb, var(--ms-lite-contrast) 55%, var(--ms-border));
  }
}

html[data-theme="dark"] .lite-chart-wrap {
  background: transparent;
}

.lite-chart-tooltip {
  position: absolute;
  z-index: 2147483000;
  min-width: 9rem;
  max-width: 16rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-panel);
  color: var(--ms-text);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 24%, transparent);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

.lite-chart-tooltip strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.lite-chart-hover {
  margin: 0.65rem 0 0;
  min-height: 1.35em;
  color: var(--ms-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.lite-chart-hover.is-empty {
  color: var(--ms-muted);
  font-weight: 600;
}

@media (max-width: 720px) {
  .lite-chart-wrap {
    height: 340px;
  }
}

.lite-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.lite-form-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0;
}

.lite-form-row label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ms-text);
}

.lite-form-row input,
.lite-form-row select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--ms-border);
  background: var(--ms-60-raised);
  color: var(--ms-text);
  font: inherit;
  font-weight: 600;
}

.lite-password-wrap {
  position: relative;
}

.lite-password-wrap input {
  padding-right: 2.75rem;
}

.lite-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ms-muted);
  cursor: pointer;
}

.lite-password-toggle:hover,
.lite-password-toggle:focus-visible {
  color: var(--ms-text);
  background: color-mix(in srgb, var(--ms-text) 8%, transparent);
}

.lite-password-toggle:focus-visible {
  outline: 2px solid #2164B3;
  outline-offset: 1px;
}

.lite-password-toggle .bi {
  font-size: 1.1rem;
  line-height: 1;
}

.lite-text-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ms-accent, #2164B3);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.lite-text-btn:hover,
.lite-text-btn:focus-visible {
  color: var(--ms-text);
}

.lite-text-btn:focus-visible {
  outline: 2px solid #2164B3;
  outline-offset: 2px;
}

html[data-theme="dark"] .lite-form-row input,
html[data-theme="dark"] .lite-form-row select {
  background: var(--ms-panel);
  color: var(--ms-text);
}

.lite-form-row input:focus,
.lite-form-row select:focus {
  outline: 2px solid #2164B3;
  outline-offset: 1px;
}

.lite-flash.is-visible {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--ms-ok);
  background: color-mix(in srgb, var(--ms-ok) 14%, var(--ms-panel));
  color: var(--ms-ok-fg);
  font-weight: 600;
}

.lite-flash.is-visible.is-error {
  border-color: var(--ms-error);
  background: color-mix(in srgb, #B91C1C 82%, #7f1d1d);
  color: #fff;
}

/* Shell / dashboard motion */
@media (prefers-reduced-motion: no-preference) {
  body.ms-lite-auth-ready .lite-shell {
    animation: lite-shell-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.ms-lite-auth-ready .lite-page-head,
  body.ms-lite-auth-ready .lite-workspace,
  body.ms-lite-auth-ready .lite-keys-grid {
    animation: lite-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.ms-lite-auth-ready .lite-page-head { animation-delay: 0.02s; }
  body.ms-lite-auth-ready .lite-workspace { animation-delay: 0.08s; }
  body.ms-lite-auth-ready .lite-keys-grid { animation-delay: 0.12s; }

  .lite-stat {
    transition: color 0.18s ease, background 0.18s ease;
  }

  .lite-stat:hover .lite-stat__value {
    color: var(--ms-lite-contrast-fg);
  }

  .lite-sidebar__link {
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  }

  .lite-sidebar__link:hover {
    transform: translateX(2px);
  }

  .lite-icon-btn,
  .ms-btn {
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .lite-icon-btn:active,
  .ms-btn:active {
    transform: scale(0.97);
  }

  .lite-table tbody tr {
    animation: lite-rise 0.28s ease both;
  }

  .lite-auth-loading__card {
    animation: lite-rise 0.35s ease both;
  }
}

@keyframes lite-shell-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lite-rise {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .lite-panel-connect .lite-connect-form {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .lite-search,
html[data-theme="dark"] .lite-filter-select,
html[data-theme="dark"] .lite-assign-company {
  background: var(--ms-panel);
}

.lite-key-once {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--ms-code-bg);
  color: var(--ms-code-fg);
  border: 1px solid var(--ms-border);
}
