:root {
  color-scheme: dark;
  /* Fluent semantic roles mapped to the existing LB Metrics palette. */
  --font-family: "Segoe UI", system-ui, sans-serif;
  --font-caption: .75rem;
  --font-body: .875rem;
  --font-heading: 1.1875rem;
  --font-semibold: 600;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --radius-control: 6px;
  --radius-interactive: 8px;
  --radius-surface: 10px;
  --stroke-width: 1px;
  --focus-width: 2px;
  --focus-offset: var(--space-1);
  --focus-ring: #d3caff;
  --canvas: #13141c;
  --foreground: #f1f0f8;
  --surface: #1b1d2a;
  --surface-navigation: #171925;
  --surface-control: #202233;
  --surface-control-subtle: #242635;
  --surface-hover: #232538;
  --surface-selected: #30284f;
  --border: #343647;
  --border-subtle: #2a2d3f;
  --border-control: #8588a6;
  --muted: #b5b7cb;
  --accent: #c4b8ff;
  --accent-strong: #b8a8ff;
  --accent-hover: #d1c4ff;
  --accent-on-strong: #211a38;
  --accent-selected-text: #e2d9ff;
  --elevation-panel: 0 2px 8px rgb(0 0 0 / .2);
  font-family: var(--font-family);
  color: var(--foreground);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 1; background: var(--surface-selected); padding: var(--space-3) var(--space-4); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { min-width: 0; background: var(--surface-navigation); border-right: var(--stroke-width) solid var(--border-subtle); display: flex; flex-direction: column; padding: 27px 17px; gap: 34px; }
.brand { display: flex; align-items: center; gap: var(--space-3); margin-inline: 9px; font-size: 20px; font-weight: 700; letter-spacing: -.45px; }
.brand-icon { background: #7962e4; height: 34px; width: 34px; border-radius: 9px; display: flex; gap: 3px; align-items: end; justify-content: center; padding-bottom: 9px; }
.brand-icon i { width: 4px; height: 7px; background: white; border-radius: 2px; }
.brand-icon i:nth-child(2) { height: 12px; }
.brand-icon i:nth-child(3) { height: 17px; }
.nav-current { display: flex; gap: 11px; align-items: center; background: var(--surface-selected); color: var(--accent-selected-text); border-radius: var(--radius-interactive); padding: var(--space-3) 13px; font-size: var(--font-body); font-weight: var(--font-semibold); }
.nav-icon { flex-shrink: 0; font-size: 19px; line-height: 1; }
.local { margin: auto 9px 0; color: var(--muted); font-size: var(--font-caption); display: flex; align-items: center; gap: 9px; }
.local span { width: 8px; height: 8px; border-radius: 50%; background: #aca0f7; }
.topbar { min-height: 64px; border-bottom: var(--stroke-width) solid var(--border-subtle); display: flex; align-items: center; padding-inline: 36px; gap: var(--space-3); color: var(--muted); font-size: var(--font-body); }
.topbar strong { min-width: 0; overflow-wrap: anywhere; color: var(--foreground); font-weight: var(--font-semibold); }
main { max-width: 1260px; margin-inline: auto; padding: 39px 36px 64px; }
.intro h1 { margin: 0; font-size: clamp(32px, 4vw, 43px); letter-spacing: -.045em; overflow-wrap: anywhere; }
.intro p { color: var(--muted); margin: 9px 0 25px; line-height: 1.5; }
.demo-banner { padding: 13px 15px; margin: 0 0 31px; background: #26213b; border: 1px solid #514374; border-radius: 8px; color: #e1d7ff; font-size: 12px; font-weight: 700; letter-spacing: .045em; display: flex; align-items: center; gap: 9px; }
.demo-banner span { font-size: 17px; line-height: 1; }
h2 { font-size: var(--font-heading); margin: 0 0 13px; letter-spacing: -.015em; }
h3 { font-size: 16px; margin: 0; }
.import-control { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.import-control p { margin: 0; color: var(--muted); font-size: 13px; }
.primary { background: var(--accent-strong); color: var(--accent-on-strong); border: var(--stroke-width) solid transparent; border-radius: var(--radius-interactive); padding: 10px 17px; font-weight: 700; cursor: pointer; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
.empty-icon { color: var(--accent); background: #322950; border-radius: 8px; display: grid; place-items: center; }
.preview { margin-top: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.preview-head { padding: 16px 20px; min-height: 62px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-head h2 { margin: 0; }
.secondary { border: var(--stroke-width) solid var(--border-control); border-radius: var(--radius-control); color: var(--foreground); background: var(--surface-control-subtle); padding: 7px var(--space-3); cursor: pointer; font-size: var(--font-body); }
.secondary:hover { border-color: var(--accent); }
.empty { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 44px 16px 51px; }
.empty-icon { margin-bottom: 5px; width: 55px; height: 50px; font-size: 26px; }
.empty p, .muted { color: var(--muted); margin: 0; font-size: 14px; }
.message { margin: 0; padding: 23px 20px; }
.note { margin: 0; padding: 0 20px 12px; color: var(--muted); font-size: 13px; }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 12px; }
.summary h3 { margin-bottom: 4px; }
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 16px; }
.distribution h3 { font-size: 13px; margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 0; }
.tags li, .pill { display: inline-block; background: #303146; color: #e3defc; border-radius: 6px; padding: 4px 8px; font-size: 12px; line-height: 1.5; }
.caution { color: #ffe0a2; background: #3c2e21; }
.alerts { margin: 0 20px 16px; padding: 12px 14px; border: 1px solid #6a5034; border-radius: 7px; background: #30251e; color: #ffe0a2; }
.alerts h3 { font-size: 14px; }
.alerts ul { margin: 5px 0 0; padding-left: 19px; font-size: 13px; line-height: 1.6; }
[data-login] .preview { box-shadow: var(--elevation-panel); }
[data-login] .primary { display: inline-block; }
.import-history-entry { overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; max-width: 100%; border-radius: 0 0 12px 12px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
table { width: 100%; min-width: 690px; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 11px 13px; border-top: 1px solid var(--border); }
th:first-child, td:first-child { padding-left: 20px; }
th { background: #202233; color: #d1cde3; font-weight: 600; white-space: nowrap; }
td:nth-child(5) { white-space: pre-line; }
td, .tags li { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 170px minmax(0, 1fr); }
  main, .topbar { padding-inline: 22px; }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .sidebar { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; border-right: 0; border-bottom: var(--stroke-width) solid var(--border-subtle); gap: var(--space-3); }
  .brand { margin: 0; font-size: 17px; }
  .nav-current { padding: var(--space-2) 10px; }
  .local, .topbar { display: none; }
  main { padding: 25px 16px 40px; }
  .preview-head { padding-inline: 12px; }
  .preview-head h2 { font-size: 16px; }
  .groups { grid-template-columns: 1fr; }
}
.pill.impact-green { background: #dcfce7; color: #14532d; }
.pill.impact-yellow { background: #fef9c3; color: #713f12; }
.pill.impact-orange { background: #ffedd5; color: #7c2d12; }
.pill.impact-red { background: #fee2e2; color: #7f1d1d; }
