/* =========================================================================
   Invictus 2.0 — Dashboard Foundation
   Faithful to Figma "Home —Layout" (node 765:22969).
   ========================================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Roboto Condensed", system-ui, sans-serif;
  color: var(--text, #fff);
  background: var(--bg-canvas-base, #0a0f10);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- App shell ---------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.access-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-canvas-glow);
}

.access-gate__panel {
  width: min(100%, 460px);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(8, 15, 17, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.access-gate__eyebrow {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.access-gate__title {
  margin: 0 0 20px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 500;
  line-height: 1.1;
}

.access-gate__controls {
  display: flex;
  gap: 12px;
}

.access-gate__field {
  flex: 1 1 auto;
}

.access-gate__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
}

.access-gate__input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.75);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.access-gate__button {
  height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #052e24;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.access-gate__button:hover {
  filter: brightness(1.04);
}

.access-gate__error {
  margin: 12px 0 0;
  font-size: 14px;
  color: #fca5a5;
}

@media (max-width: 640px) {
  .access-gate__panel {
    padding: 24px;
  }

  .access-gate__controls {
    flex-direction: column;
  }

  .access-gate__button {
    width: 100%;
  }
}

.app {
  position: relative;
  width: 100vw;
  min-width: 1280px;
  min-height: 100vh;
  background: var(--bg-canvas-glow);
  display: flex;
  flex-direction: column;
}

/* ---- NavBar (h82, transparent) ------------------------------------------ */
.navbar {
  height: 82px;
  flex: 0 0 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px;
  background: transparent;
}
/* 3 slots: logo (left), version+view stack (center), icons (right) */
.navbar__slot { display: flex; align-items: center; }
.navbar__slot--left { flex: 1 1 0; justify-content: flex-start; gap: 8px; }
.navbar__slot--center {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.navbar__slot--right { flex: 1 1 0; justify-content: flex-end; gap: 16px; padding: 4px 16px; }

.brand { display: flex; align-items: center; text-decoration: none; }
.brand svg { display: block; height: 32px; width: auto; color: #fff; }

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 6, 3, 0.50);
  border: none;
  border-radius: 100px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}
.version-pill svg { display: block; height: 13px; width: 13px; color: #fff; }

/* Version switcher dropdown */
.version-wrap { position: relative; }
.ver-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 131px;
  background: #05080A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 900;
}
.ver-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}
.ver-item:hover { background: rgba(255,255,255,0.12); }
.ver-item--active { background: rgba(255,255,255,0.30); }
.ver-item--active:hover { background: rgba(255,255,255,0.35); }
.ver-item svg { display: block; width: 16px; height: 16px; flex-shrink: 0; color: #fff; }

.custom-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}
.custom-view svg { display: block; height: 11px; width: 11px; color: #fff; }

.custom-view-wrap {
  position: relative;
  display: inline-flex;
}

.cv-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-height: 300px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: #05080a;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.62);
  z-index: 940;
}

.cv-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.cv-item:hover { background: rgba(255, 255, 255, 0.12); }
.cv-item--active { background: rgba(255, 255, 255, 0.22); }
.cv-item svg { display: block; width: 16px; height: 16px; flex-shrink: 0; }

.cv-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 255, 128, 0.35);
  border-radius: 6px;
  background: rgba(0, 255, 128, 0.08);
}
.cv-banner__text {
  font-size: 13px;
  font-weight: 500;
  color: #e7fff4;
}
.cv-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cv-banner--success {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.cv-gallery {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cv-gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cv-gallery__title {
  margin: 0;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  color: #fff;
}
.cv-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
}
.cv-gallery__card {
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  position: relative;
}
.cv-gallery__preview {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  border-radius: 2px;
  border: 4px solid #2e7185;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06)),
    #18323b;
}
.cv-gallery__card.is-active .cv-gallery__preview {
  border-color: #b4b9c2;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1)),
    #2e3541;
}
.cv-gallery__name {
  font-size: 20px;
  line-height: 1.2;
}
.cv-gallery__desc {
  font-size: 16px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.75);
}
.cv-gallery__actions {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.cv-gallery__card:hover .cv-gallery__actions,
.cv-gallery__card:focus-within .cv-gallery__actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.cv-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 0;
  background: #f5f6f8;
  color: #5c6370;
  cursor: pointer;
  padding: 4px;
}
.cv-act:hover:not([disabled]) { background: #ffffff; color: #444d59; }
.cv-act[disabled] { opacity: 0.45; cursor: default; }
.cv-act svg { display: block; width: 13px; height: 13px; }
@media (max-width: 1100px) {
  .cv-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cv-gallery { padding: 14px 16px; }
  .cv-gallery__title { font-size: 30px; }
  .cv-gallery__grid { grid-template-columns: 1fr; gap: 18px; }
}

.cv-modal {
  width: min(480px, calc(100vw - 24px));
  border: none;
  border-radius: 10px;
  padding: 0;
  background: #05080a;
  color: #fff;
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.72);
}
.cv-modal::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(3px);
}
.cv-modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}
.cv-modal__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}
.cv-modal__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.4;
}
.cv-modal__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.cv-modal__input {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.cv-modal__input:focus { border-color: rgba(0, 255, 128, 0.6); }
.cv-modal__actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.cv-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv-modal__choice {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}
.cv-modal__choice.is-selected {
  border-color: rgba(0, 255, 128, 0.6);
  background: rgba(0, 255, 128, 0.08);
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: #ebedf0;
  cursor: pointer;
}
.icon-btn:hover { color: #fff; }
.icon-btn svg { display: block; height: 24px; width: 24px; }

/* ---- Button system (Figma "Button" set 865:343) -------------------------
   Base + tier (primary/secondary/tertiary, destructive filled/outline) +
   size (xs/sm/md/lg). md is the locked base; xs/sm/lg scale around it.
   All share radius-sm (2px) and Inter Medium. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap, 4px);
  padding: var(--btn-pad-v, 8px) var(--btn-pad-h, 16px);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 2px);
  background: transparent;
  font-family: "Roboto Condensed", system-ui, sans-serif;
  font-size: var(--btn-font, 13px);
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn svg { display: block; height: 1.2em; width: 1.2em; flex: 0 0 auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Sizes — drive padding/font/gap via custom props. */
.btn--xs { --btn-pad-v: 2px;  --btn-pad-h: 8px;  --btn-font: 11px; --btn-gap: 4px; }
.btn--sm { --btn-pad-v: 6px;  --btn-pad-h: 12px; --btn-font: 12px; --btn-gap: 4px; }
.btn--md { --btn-pad-v: 8px;  --btn-pad-h: 16px; --btn-font: 13px; --btn-gap: 4px; }
.btn--lg { --btn-pad-v: 12px; --btn-pad-h: 20px; --btn-font: 14px; --btn-gap: 6px; }

/* Primary — solid white, dark-teal label. */
.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn--primary:hover { background: var(--btn-primary-bg-hover); }

/* Secondary — white outline, transparent fill. */
.btn--secondary {
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}
.btn--secondary:hover { background: var(--btn-secondary-bg-hover); }

/* Tertiary — bare text, no chrome. */
.btn--tertiary {
  color: var(--btn-tertiary-text);
  padding-left: 0;
  padding-right: 0;
}
.btn--tertiary:hover { text-decoration: underline; }

/* Destructive (filled) — red solid. */
.btn--destructive {
  background: var(--btn-destructive-bg);
  color: var(--btn-destructive-text);
}
.btn--destructive:hover { background: var(--btn-destructive-bg-hover); }

/* Destructive (outline) — red outline + label. */
.btn--destructive-outline {
  border-color: var(--btn-destructive-outline);
  color: var(--btn-destructive-outline);
}
.btn--destructive-outline:hover { background: var(--btn-destructive-outline-bg-hover); }

/* Red notification dot (matches the Bell's built-in dot for the Chat icon) */
.icon-btn.has-badge { overflow: visible; }
.badge-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 100px;
  background: #ee433a;
  pointer-events: none;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.70);
}

/* ---- ProductsNav (h44, transparent) ------------------------------------- */
.products-nav {
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
}
.products-nav__tabs,
.products-nav__actions { display: flex; align-items: center; gap: 8px; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab svg { display: block; height: 16px; width: 16px; }
.tab:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tab[data-active] { background: rgba(255, 255, 255, 0.30); color: #fff; }

/* Close X: hidden by default, revealed on tab hover/focus */
.tab__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  margin-left: -6px;
  overflow: hidden;
  opacity: 0;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 0;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.12s ease, width 0.12s ease, margin 0.12s ease;
}
.tab:hover .tab__close,
.tab:focus-within .tab__close,
.tab[data-active] .tab__close {
  width: 16px;
  margin-left: 0;
  opacity: 1;
}
.tab__close:hover { background: rgba(255, 255, 255, 0.20); }
.tab__close svg { display: block; height: 14px; width: 14px; }

/* Add-tab button (icon only) */
.tab--add { color: rgba(255, 255, 255, 0.70); }

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 6px;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}
.icon-action:hover { color: #fff; }
.icon-action svg { display: block; height: 18px; width: 18px; }
.icon-action[data-active] { background: rgba(255, 255, 255, 0.30); color: #fff; }

.add-widget-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 6, 3, 0.50);
  border: none;
  border-radius: 2px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}
.add-widget-btn svg { display: block; height: 16px; width: 16px; }

/* ---- Tab overflow switcher (caret on last visible tab) ------------------ */
.tab-switcher { position: relative; display: inline-flex; }
.tab__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  color: inherit;
  cursor: pointer;
}
.tab__caret svg { display: block; height: 13px; width: 13px; }

.overflow-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--bg-canvas-base, #05080a);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px;
  z-index: 40;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.overflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}
.overflow-item svg { display: block; height: 14px; width: 14px; }
.overflow-item:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.overflow-item.is-active { background: rgba(255, 255, 255, 0.20); color: #fff; }

/* ---- "Available Products" popup (Figma 809:15030) ----------------------- */
.add-tab-wrap { position: relative; display: inline-flex; }
.add-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #05080a;
  border-radius: 4px;
  padding: 24px;
  z-index: 50;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.add-popup__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}
.add-popup__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(85px, 1fr));
  gap: 12px;
}
.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 85px;
  height: 93px;
  background: rgba(255, 255, 255, 0.10);
  border: 0.5px solid #373634;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.product-card:hover { background: rgba(255, 255, 255, 0.18); }
.product-card__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-card__icon {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.70);
}
.product-card__icon svg { display: block; height: 13px; width: 13px; }
.product-card__label {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  text-align: left;
}
.product-card__action {
  display: flex;
  justify-content: flex-end;
}
.product-card__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.30);
  color: #fff;
}
.product-card__plus svg { display: block; height: 12px; width: 12px; }
.product-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

/* =========================================================================
   Add Widget modal (Figma 796:19907) — native <dialog> in the top layer
   ========================================================================= */

/* Native <dialog> backdrop — dark scrim over the full viewport. */
.wadd::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
}

/* Panel — #05080A, rounded-8, max 933px wide, flex-column.
   <dialog> centres itself in the viewport automatically via its UA stylesheet;
   we just set the size, background, and layout. */
.wadd {
  width: min(933px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #05080a;
  border-radius: 8px;
  border: none;
  padding: 0;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  color: #fff;
}

/* Header row — white@20% backdrop, title + close. */
.wadd__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.wadd__heading {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}
.wadd__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}
.wadd__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.wadd__close svg { display: block; }

/* Scrollable body — padding 24, gap 24. */
.wadd__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Search row — white@10%, radius 4, height 40, pad 8 16. */
.wadd__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 8px 16px;
  flex-shrink: 0;
}
.wadd__search-ic {
  display: inline-flex;
  align-items: center;
  color: #898989;
  flex-shrink: 0;
}
.wadd__search-ic svg { display: block; width: 20px; height: 20px; }
.wadd__search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: #fafafa;
}
.wadd__search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.wadd__search-clear {
  flex-shrink: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0 4px;
}
.wadd__search-clear:hover { color: #fff; }

/* 3-column card grid. */
.wadd__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .wadd__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Empty search state. */
.wadd__empty {
  padding: 32px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

/* Widget card — white@30%, radius 4. */
.wadd-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 8px;
  transition: background 0.12s, border-color 0.12s;
}
.wadd-card:hover { background: rgba(255, 255, 255, 0.13); }
.wadd-card--staged { border-color: rgba(255, 255, 255, 0.4); }
.wadd-card--added { opacity: 0.55; cursor: default; }

/* Card header — title + add/check badge. */
.wadd-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wadd-card__title {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Add pill (idle state) — white@30%, radius 100, 24×24. */
.wadd-card__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 100px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 0.1s;
}
.wadd-card__add:hover { background: rgba(255, 255, 255, 0.3); }
.wadd-card__add.is-staged {
  background: rgba(0, 255, 128, 0.22);
  color: #00FF80;
  border: 1px solid rgba(0, 255, 128, 0.45);
}
.wadd-card__add svg { display: block; width: 14px; height: 14px; }

/* Already-added checkmark badge (no button). */
.wadd-card__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.4);
}
.wadd-card__check svg { display: block; width: 14px; height: 14px; }

/* Mini chart preview area — fills remaining card height. */
.wadd-card__preview {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
  min-height: 100px;
}
.wadd-card__preview .pv {
  width: 100%;
  height: 100%;
  display: block;
}

/* Footer — white@20%, pad 6 12, space-between. */
.wadd__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.wadd__reset {
  border: none;
  background: transparent;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 2px;
  padding-left: 0;
  padding-right: 0;
  transition: color 0.1s, background 0.1s;
}
.wadd__reset:hover:not([disabled]) { color: #fff; text-decoration: underline; background: transparent; }
.wadd__reset[disabled] { opacity: 0.35; cursor: default; }
.wadd__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wadd__cancel {
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}
.wadd__cancel:hover:not([disabled]) { background: var(--btn-secondary-bg-hover); }
/* Apply button — white fill, dark text (Figma: #fff bg, #01160a text). */
.wadd__apply {
  border: none;
  background: #fff;
  color: rgba(1, 22, 10, 0.9);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
  min-width: 80px;
  border-radius: 2px;
}
.wadd__apply:hover:not([disabled]) { background: rgba(255, 255, 255, 0.88); }
.wadd__apply[disabled] { opacity: 0.35; cursor: default; }

/* ---- Example widget body (placed on board) ------------------------------ */
.exwidget {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.exwidget__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exwidget__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.exwidget__tag {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 2px 6px;
}
.exwidget__sub {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.exwidget__chart {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.exwidget__chart .pv {
  width: 100%;
  max-height: 260px;
  display: block;
}

/* ---- Grid --------------------------------------------------------------- */
.grid-wrap { flex: 1 1 auto; padding: 4px 12px 12px; overflow-y: auto; }

/* Row-based layout: rows stack vertically; each row is its own grid. */
.grid-rows {
  display: flex;
  flex-direction: column;
}
.grid-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 4px;
  justify-content: start;
  /* Q4: every widget in a row matches the tallest one in that row. */
  align-items: stretch;
}

/* Thin gap between rows; becomes a real drop target while dragging. */
.row-dropzone {
  height: 4px;
  border-radius: 4px;
  transition: height 0.12s ease, background 0.12s ease;
}
body.is-dragging .row-dropzone {
  height: 18px;
  background: rgba(255, 255, 255, 0.06);
  outline: 1px dashed rgba(255, 255, 255, 0.18);
  outline-offset: -3px;
}
/* Hovered gap → preview a full-height widget slot with the green dashed border. */
body.is-dragging .row-dropzone.is-over {
  height: var(--widget-min-h, calc((100vh - 150px) / 2));
  margin: 4px 0;
  background: rgba(78, 222, 128, 0.10);
  outline: 2px dashed rgba(110, 231, 168, 0.8);
  outline-offset: -2px;
}

/* Vertical (stack) fallback keeps the legacy single grid. */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 4px;
  align-content: start;
  justify-content: start;
  align-items: stretch;
}

/* ---- Widget (glass, 0 radius, vertical) --------------------------------- */
.widget {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-widget-glass);
  border-radius: 0;
  /* One row fills ~1/2.5 of the viewport (minus the two nav bars + gaps). */
  min-height: var(--widget-min-h, calc((100vh - 150px) / 2));
  max-height: 40vh;
  overflow: hidden;
}
.widget.dragging { opacity: 0.4; }
.widget.drag-over {
  outline: 2px dashed rgba(110, 231, 168, 0.8);
  outline-offset: -2px;
}

/* Q7 — drag-resize grip on the widget's right edge (below the header so it
   never overlaps the ⋮ menu). Faint until the widget is hovered. */
.widget__resize {
  position: absolute;
  top: 40px;
  right: 0;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.widget__resize::before {
  content: "";
  width: 2px;
  height: 28px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.12s ease, height 0.12s ease;
}
.widget:hover .widget__resize::before { background: rgba(255, 255, 255, 0.40); }
.widget__resize:hover::before {
  background: var(--accent-brand, #4ede80);
  height: 44px;
}
/* While actively resizing, lock the cursor and kill text selection. */
body.is-resizing { cursor: col-resize; user-select: none; }
body.is-resizing * { cursor: col-resize !important; }

.widget__header {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.30);
}
.widget__drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.70);
  cursor: grab;
}
.widget__drag svg { display: block; height: 16px; width: 16px; }
.widget__title {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.widget__menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.widget__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}
.widget__menu-btn:hover { color: #fff; }
.widget__menu-btn svg { display: block; height: 16px; width: 16px; }

/* Minimize / exit-fullscreen button — hidden by default, shown only inside :fullscreen */
.widget__minimize {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.widget__minimize:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.widget__minimize svg { display: block; height: 16px; width: 16px; }
.widget:fullscreen .widget__minimize { display: inline-flex; }

/* Fullscreen widget style tweaks — fill the viewport with the dark surface. */
.widget:fullscreen {
  background: var(--surface);
  border-radius: 0;
  max-height: none;
}
.widget:fullscreen .widget__body { max-height: none; overflow-y: auto; }

.menu-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 191px;
  display: flex;
  flex-direction: column;
  background: #05080a;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.menu-pop__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.menu-pop__item:hover { background: rgba(255, 255, 255, 0.20); }
.menu-pop__item--danger { color: #ee433a; }
.menu-pop__item--danger:hover { background: rgba(238, 67, 58, 0.16); }

.widget__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 16px 24px;
  overflow-y: auto;
}
.widget__placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

/* ---- Executive Summary widget content (Figma 801:317) ------------------- */
.exec {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.exec__block {
  display: flex;
  flex-direction: column;
}
.exec__block:first-child { gap: 32px; }
.exec__block:last-child { gap: 16px; }
.exec__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.exec__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px;
}
.metric-slot {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.70);
}
.metric__close {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
}
.metric__close:hover { background: rgba(238, 67, 58, 0.85); }
.metric__close svg { display: block; height: 9px; width: 9px; }
.metric:hover .metric__close { display: inline-flex; }
.metric__label {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.70);
}
.metric__value-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.metric__value {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
}
.metric__delta {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.metric__delta--up {
  color: var(--tag-up-text);
  background: var(--tag-up-bg);
}
.metric__delta--down {
  color: var(--tag-down-text);
  background: var(--tag-down-bg);
}
.metric__sub {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.70);
}

/* + button that opens the add-metric popup — tagged to the last metric */
.exec__add-wrap { position: relative; display: inline-flex; align-self: flex-end; margin-bottom: 12px; }
.exec__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: none;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.30);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s ease;
}
.exec__add:hover { background: rgba(255, 255, 255, 0.45); }
.exec__add svg { display: block; height: 16px; width: 16px; }

/* Add-metric popup (Figma 796:19810) — solid #05080A, fixed top layer */
.metric-popup {
  position: fixed;
  display: grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 17px;
  width: max-content;
  max-width: min(420px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: #05080a;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 24px;
  z-index: 1000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.metric-add-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.70);
}
.metric-add-card .metric { border-bottom: none; padding-bottom: 0; }
.metric-add-card__action {
  display: flex;
  justify-content: flex-end;
}
.metric-add-card__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.30);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s ease;
}
.metric-add-card__plus:hover { background: rgba(255, 255, 255, 0.45); }
.metric-add-card__plus svg { display: block; height: 10px; width: 10px; }

.exec__narrative {
  padding: 4px;
  border-radius: 4px;
}
.exec__narrative p {
  margin: 0;
  font-size: 14px;
  line-height: 25px;
  color: rgba(255, 255, 255, 0.92);
}
.exec__narrative strong { font-weight: 600; color: #fff; }
/* Colour-coded callouts: brighter text + subtle tinted chip for legibility. */
.exec__narrative .hl-amber,
.exec__narrative .hl-red,
.exec__narrative .hl-green {
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  white-space: normal;
}
.exec__narrative .hl-amber { color: var(--tag-warn-text); background: var(--tag-warn-bg); }
.exec__narrative .hl-red   { color: var(--tag-neg-text); background: var(--tag-neg-bg); }
.exec__narrative .hl-green { color: var(--tag-pos-text); background: var(--tag-pos-bg); }

/* ---- Key Flags widget content (Figma 801:318) --------------------------- */
.flags {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.flags__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.flags__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.flag {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.70);
}
.flag__dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 2px;
  background: var(--accent-warning);
}
.flag__dot--warn { background: var(--accent-warning); }
.flag__dot--negative { background: var(--accent-negative); }
.flag__dot--positive { background: var(--accent-positive); }
.flag__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.flag__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
}
.flag__sub {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.70);
}

/* ---- ACL Trend widget content (Figma 825:334 / chart 828:336) ----------- */
/* Header filter pills (centre cluster between drag handle and more-menu). */
.acl-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.acl-pill {
  border: none;
  border-radius: 100px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.20);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.acl-pill:hover { background: rgba(255, 255, 255, 0.30); }
.acl-pill.is-active {
  background: #d9d9d9;
  color: #002d14;
  font-weight: 500;
}
.acl-slider {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}
.acl-slider:hover { color: #fff; }
.acl-slider svg { display: block; height: 18px; width: 20px; }
.acl-slider__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.40);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}

.acl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  /* Fill the widget body so the chart can grow with it. */
  flex: 1 1 auto;
  min-height: 0;
}
.acl__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.acl__legend {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.80);
}
.acl__legend-item { display: inline-flex; align-items: center; gap: 8px; }
.acl__swatch {
  width: 18px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
}
.acl__swatch--acl { border-top-color: #00ff80; }
.acl__swatch--cov { border-top-color: #33c5ff; border-top-style: dashed; }

/* Chart fills the remaining widget height; SVG is drawn to this box's size. */
.acl-chart-wrap {
  flex: 1 1 auto;
  min-height: 120px;
  position: relative;
}
.acl-chart {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.acl-grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.acl-area { fill: rgba(0, 255, 128, 0.10); stroke: none; }
.acl-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.acl-line--acl { stroke: #00ff80; }
.acl-line--cov { stroke: #33c5ff; stroke-dasharray: 5 4; }
.acl-dot--acl { fill: #00ff80; }
.acl-dot--cov { fill: #33c5ff; }
.acl-dot-ring { fill: none; stroke: #00ff80; stroke-width: 1.5; opacity: 0.5; }
.acl-axis {
  fill: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-family: inherit;
}
.acl-axis--l { text-anchor: end; }
.acl-axis--r { text-anchor: start; }
.acl-axis--x { text-anchor: middle; }
.acl-callout__bg {
  fill: rgba(5, 8, 10, 0.92);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.5;
}
.acl-callout__q   { fill: rgba(255, 255, 255, 0.70); font-size: 10px; }
.acl-callout__acl { fill: #00ff80; font-size: 12px; font-weight: 600; }
.acl-callout__cov { fill: #33c5ff; font-size: 12px; font-weight: 600; }
.acl-callout[hidden] { display: none; }

/* Hover crosshair + dual-line tooltip (snaps to the hovered quarter) */
.acl-hit { fill: transparent; cursor: crosshair; }
.acl-hover { pointer-events: none; }
.acl-hover[hidden] { display: none; }
.acl-hover__line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.acl-hover__dot { stroke: #05080a; stroke-width: 1.5; }
.acl-hover__dot--acl { fill: #00ff80; }
.acl-hover__dot--cov { fill: #33c5ff; }
.acl-hover__bg {
  fill: rgba(5, 8, 10, 0.96);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.5;
}
.acl-hover__q   { fill: rgba(255, 255, 255, 0.70); font-size: 10px; }
.acl-hover__acl { fill: #00ff80; font-size: 12px; font-weight: 600; }
.acl-hover__cov { fill: #33c5ff; font-size: 12px; font-weight: 600; }

/* ---- Capital Adequacy widget (stress-test bar chart) -------------------- */
.cap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.cap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cap__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}

.cap__rows {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 1 auto;
  justify-content: center;
}
.cap-row { display: flex; flex-direction: column; gap: 6px; }
.cap-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cap-row__label { font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.cap-row__cluster { display: inline-flex; align-items: center; gap: 8px; }

.cap-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.70);
}
.cap-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.cap-dot--current { background: #f9912a; }
.cap-sq { width: 6px; height: 6px; flex: 0 0 6px; }
.cap-sq--stressed { background: #ee433a; }

.cap-pill {
  font-size: 10px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 2px;
}
.cap-pill--amber { color: #f9912a; background: rgba(249, 145, 42, 0.10); }
.cap-pill--red   { color: #ee433a; background: rgba(238, 67, 58, 0.10); }

/* Bar track: full width, the Current bar fills width%, markers/lines are
   positioned by left% along the same 0..CAP_AXIS_MAX axis. */
.cap-track {
  position: relative;
  height: 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.10);
}
.cap-bar {
  position: absolute;
  left: 0;
  top: 1px;
  height: 12px;
  border-radius: 100px;
}
.cap-bar--amber { background: #f9912a; }
.cap-bar--red   { background: #ee433a; }

.cap-line {
  position: absolute;
  top: -2px;
  width: 0;
  height: 18px;
  border-left-width: 1.5px;
  border-left-style: dashed;
  transform: translateX(-50%);
}
.cap-line--min    { border-left-color: rgba(255, 255, 255, 0.55); }
.cap-line--target { border-left-color: rgba(51, 197, 255, 0.80); }

.cap-marker--stressed {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  background: #ee433a;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px #05080a;
}

.cap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.cap-leg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.70);
}
.cap-leg__line {
  position: static;
  display: inline-block;
  width: 14px;
  height: 0;
  top: auto;
  transform: none;
  border-left: none;
  border-top-width: 1.5px;
  border-top-style: dashed;
}
.cap-leg .cap-line--min    { border-top-color: rgba(255, 255, 255, 0.55); }
.cap-leg .cap-line--target { border-top-color: rgba(51, 197, 255, 0.80); }

/* ---- ECL Reserve by Segment widget (categorical bar chart) -------------- */
.ecl {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.ecl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ecl__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
/* Chart fills the remaining body; bars + axis share one grid for alignment. */
.ecl__chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  justify-content: center;
}
.ecl__rows { display: flex; flex-direction: column; gap: 12px; }

/* Shared 2-col grid: [right-aligned label] [bar track]. The axis row reuses it
   so ticks line up under the bars. */
.ecl-row,
.ecl__axis {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
}
.ecl-row { outline: none; }
.ecl-row__label {
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.80);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ecl-row__track {
  position: relative;
  height: 15px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.10);
}
.ecl-row__bar {
  height: 15px;
  border-radius: 50px;
  min-width: 6px;
  transition: width 0.12s ease, filter 0.12s ease;
}
.ecl-row:hover .ecl-row__bar,
.ecl-row:focus-visible .ecl-row__bar { filter: brightness(1.12); }

/* Dark value tooltip (Figma "Box"), shown on row hover/focus. */
.ecl-row__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(1, 22, 10, 0.92);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}
.ecl-row__tip b { font-weight: 600; }
.ecl-row:hover .ecl-row__tip,
.ecl-row:focus-visible .ecl-row__tip { opacity: 1; }

/* X-axis: spacer aligns with the label column, ticks span the bar column. */
.ecl__axis-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.80);
}

/* ---- Top Movers widget (driver list) ----------------------------------- */
.movers {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.movers__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.movers__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;            /* real space between movers; divider sits centered */
  flex: 1 1 auto;
}
/* Each row is a self-contained block: the colored left-accent bar hugs the
   content height (no full-rail effect), so blocks read as separated. A
   centered hairline floats in the 24px gap — 12px above + 12px below — to
   match Figma's Frame 8371 (gap 12 with the Line as its own child). */
.mover {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--mover-accent);
}
.mover:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;        /* centered in the 24px gap */
  border-top: 0.5px solid rgba(255, 255, 255, 0.20);
}
.mover__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mover__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.70);
}
.mover__value {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.80);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mover__tag {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1.2;
  padding: 2px;
  border-radius: 2px;
  color: var(--mover-accent);
  white-space: nowrap;
}

/* ---- Scenario Snapshot widget (stress-scenario list) ------------------- */
.scn-snap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.scn-snap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.scn-snap__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.scn-snap__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;            /* rows separated by gap; no dividers (matches Figma) */
  flex: 1 1 auto;
}
/* Each scenario row: colored left-accent bar (hugs content) + a name over a
   3-cell metric grid, with a status tag on the right (top-aligned). */
.scn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--scn-accent);
}
.scn__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.scn__name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.80);
}
.scn__metrics { display: flex; gap: 24px; }
.scn__metric { display: flex; flex-direction: column; gap: 4px; }
.scn__metric-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.70);
}
.scn__metric-value { font-size: 12px; font-weight: 500; }
.scn__tag {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1.2;
  padding: 2px;
  border-radius: 2px;
  white-space: nowrap;
}

/* =========================================================================
   Loan level ST tab widgets (Figma 908:23975)
   Narrative · Total Exposure & Loss (donuts) · Loss Severity Heat map ·
   Top 25 Risk Hotspots.
   Tables sit on a solid dark surface (Figma: black) so they don't read as
   transparent over the glass; sticky header + row-head use a lighter tone.
   ========================================================================= */
:root {
  --loan-surface: #1e2127;       /* legacy alias */
  --loan-table:   #0a0d10;       /* solid table body surface (≈ Figma black) */
  --loan-head:    #2a2e35;       /* sticky header row */
  --loan-rowhead: #20242a;       /* sticky first column (segment labels) */
}

/* ---- Narrative --------------------------------------------------------- */
.narr {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.narr__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
/* Dark callout box around the paragraph (Figma Frame 35: black@45%, pad 4). */
.narr__body {
  /* background: rgba(0, 0, 0, 0.45); */
  border-radius: 4px;
  padding: 12px;
}
.narr__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}
/* Inline highlight — amber + bold, matching the Figma text segments. */
.narr__hi { color: #d39e44; font-weight: 600; }

/* ---- Total Exposure & Loss (scenario tabs + two donuts) ---------------- */
.expl {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
/* Scenario segmented control — sits in the widget HEADER (Slot), centered.
   Active = white@10% bg + scenario-color text; inactive = scenario-color@30%
   bg + white@90% text (colors applied inline per scenario). */
.loan-scn-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.loan-scn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 4px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s ease;
}
.loan-scn:hover { filter: brightness(1.15); }
.loan-scn__dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.expl__pies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;                 /* Figma Frame 27 gap between the two pie columns */
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-width: 760px) { .expl__pies { grid-template-columns: 1fr; gap: 32px; } }

.pie { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.pie__head {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* title left · scenario tag right (Figma) */
  gap: 8px;
}
.pie__title {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.pie__tag {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  white-space: nowrap;
  /* color set inline to the active scenario color */
}
.pie__donut {
  position: relative;
  align-self: center;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.donut { display: block; width: 100%; height: 100%; }
.pie__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.pie__center b { font-size: 26px; font-weight: 500; color: #fff; line-height: 1; }
.pie__center span {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.70);
}
.pie-leg {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
.pie-leg__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
}
.pie-leg__key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pie-leg__sw { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.pie-leg__val {
  flex: 0 0 auto;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.60);
  font-variant-numeric: tabular-nums;
}

/* ---- Loss Severity Heat map (sticky first col + header) ---------------- */
.heat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.heat__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* title + tag grouped on the left (Figma) */
  gap: 8px;
}
.heat__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.heat__sub { font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.heat__tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 100px;          /* pill (Figma Frame 2, radius 100) */
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  white-space: nowrap;
}
.heat__scroll {
  overflow: auto;
  background: var(--loan-table);   /* solid surface — not transparent */
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
}
.heat__table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 11px;
}
.heat__table th,
.heat__table td {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
  border-right: 0.5px solid rgba(255, 255, 255, 0.10);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.10);
}
.heat__col {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--loan-head);
  color: rgba(255, 255, 255, 0.80);
  font-weight: 600;
}
.heat__corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  background: var(--loan-head);
}
.heat__rowhead {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--loan-rowhead);
  text-align: left !important;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  border-left: 3px solid var(--seg, #888);
}
.heat__cell { color: #fff; font-variant-numeric: tabular-nums; }

/* ---- Top 25 Risk Hotspots (sticky header table) ------------------------ */
.risk {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.risk__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* title + tag grouped on the left (Figma) */
  gap: 8px;
}
.risk__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
}
.risk__tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 100px;          /* pill (Figma Frame 2, radius 100) */
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  white-space: nowrap;
}
.risk__scroll {
  overflow: auto;
  background: var(--loan-table);   /* solid surface — not transparent */
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
}
.risk__table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 11px;
}
.risk__table th,
.risk__table td {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.10);
}
/* Zebra striping — even rows get a faint wash (Figma alternates blank / white@5%). */
.risk__table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.05); }
.risk__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--loan-head);
  color: rgba(255, 255, 255, 0.80);
  font-weight: 600;
  font-size: 11px;
}
.risk__table tbody tr:hover td { background: rgba(255, 255, 255, 0.10); }
.risk__num { text-align: right !important; font-variant-numeric: tabular-nums; }
.risk__mono { color: #fff; font-variant-numeric: tabular-nums; }
.risk__table td { color: #fff; }
.risk__seg { display: inline-flex; align-items: center; gap: 6px; }
.risk__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.risk__rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.risk__rating--high { background: rgba(238, 67, 58, 0.18);  color: #ff8a82; }
.risk__rating--mid  { background: rgba(249, 145, 42, 0.18); color: #f9b66a; }
.risk__rating--low  { background: rgba(0, 255, 128, 0.14);  color: #6ee7a8; }
.risk__loss { color: #fff !important; font-weight: 600; }

/* =========================================================================
   Capital ST tab widgets (Figma 937:24813)
   CET1 Ratio Projections (responsive line chart) · Breach Analysis (2×2 cards)
   ========================================================================= */

/* ---- CET1 Ratio Projections -------------------------------------------- */
.cet1 { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; min-width: 0; }
.cet1__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cet1__titles { display: flex; align-items: center; gap: 8px; }
.cet1__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.cet1__tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.90);
  white-space: nowrap;
}
.cet1__legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cet1-leg__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.80);
  white-space: nowrap;
}
.cet1-leg__sw { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.cet1-leg__sw--dash {
  width: 12px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.55);
}
.cet1-chart-wrap { flex: 1 1 auto; min-height: 220px; position: relative; }
.cet1-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.cet1-grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.cet1-axis { fill: rgba(255, 255, 255, 0.70); font-size: 11px; font-variant-numeric: tabular-nums; }
.cet1-axis--y { text-anchor: end; }
.cet1-axis--x { text-anchor: middle; }
.cet1-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cet1-line--dash { stroke-width: 1.5; stroke-dasharray: 5 4; }
.cet1-dot { stroke: #14171c; stroke-width: 1.5; }
.cet1-cross { stroke: rgba(255, 255, 255, 0.30); stroke-width: 1; stroke-dasharray: 3 3; }
.cet1-callout__bg { fill: rgba(10, 13, 16, 0.92); stroke: rgba(255, 255, 255, 0.14); }
.cet1-callout__q { fill: #fff; font-size: 14px; font-weight: 600; }
.cet1-callout__row { fill: rgba(255, 255, 255, 0.92); font-size: 12px; }
.cet1-callout__dot { font-size: 11px; }

/* ---- Breach Analysis (2×2 metric cards) -------------------------------- */
.breach { display: flex; flex-direction: column; height: 100%; gap: 16px; }
.breach__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.breach__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  flex: 1 1 auto;
  align-content: start;
}
.breach-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 8px;
  background: #20242a;
  border: 0.5px solid rgba(255, 255, 255, 0.10);
}
.breach-card--breach { border-color: rgba(238, 67, 58, 0.45); }
.breach-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.breach-card__title { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.breach-card__status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.breach-card__status--ok     { background: rgba(0, 255, 128, 0.14); color: #00ff80; }
.breach-card__status--breach { background: rgba(238, 67, 58, 0.18); color: #ee433a; }
.breach-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.breach-metric { display: flex; flex-direction: column; gap: 4px; }
.breach-metric__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.70);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.breach-metric__val { font-size: 24px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
.breach-metric__val.is-pos { color: #00ff80; }
.breach-metric__val.is-neg { color: #ee433a; }

/* =========================================================================
   ACL Cal tab widgets (Figma 937:27760)
   Narrative (KPIs + paragraph) · ACL by Segment (donut) · ACL Bridge
   (waterfall) · Segment Summary (table)
   ========================================================================= */

/* ---- Narrative (KPI strip + commentary) -------------------------------- */
.acln { display: flex; flex-direction: column; gap: 24px; }
.acln__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.acln__kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
}
.aclk { display: flex; flex-direction: column; gap: 4px; }
.aclk__label { font-size: 12px; color: rgba(255, 255, 255, 0.70); }
.aclk__row { display: flex; align-items: baseline; gap: 8px; }
.aclk__value { font-size: 24px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
.aclk__delta { font-size: 10px; font-weight: 500; white-space: nowrap; }
.aclk__delta--pos { color: #00ff80; }
.aclk__delta--neg { color: #ee433a; }

/* ---- ACL by Segment (donut) -------------------------------------------- */
.aclseg { display: flex; flex-direction: column; gap: 16px; height: 100%; }
.aclseg__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.aclseg__body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.aclseg__donut { position: relative; width: 200px; height: 200px; flex: 0 0 auto; }
.aclseg__donut .donut { width: 100%; height: 100%; }
.aclseg__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.aclseg__center b { font-size: 24px; font-weight: 500; color: #fff; }
.aclseg__center span { font-size: 12px; color: rgba(255, 255, 255, 0.70); }
.aclseg-leg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.aclseg-leg__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.aclseg-leg__sw { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }

/* ---- ACL Bridge (waterfall) -------------------------------------------- */
.brg { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; min-width: 0; }
.brg__head { display: flex; align-items: center; gap: 12px; }
.brg__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.brg__tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.90);
  white-space: nowrap;
}
.brg-chart-wrap { flex: 1 1 auto; min-height: 320px; position: relative; }
.brg-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.brg-grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.brg-link { stroke: rgba(255, 255, 255, 0.30); stroke-width: 1; stroke-dasharray: 3 3; }
.brg-axis { fill: rgba(255, 255, 255, 0.80); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.brg-axis--y { text-anchor: end; }
.brg-axis--x { text-anchor: middle; font-weight: 600; }
.brg-val { fill: #fff; font-size: 11px; font-weight: 600; text-anchor: middle; }
.brg-val--pos { fill: #00ff80; }
.brg-val--neg { fill: #ee433a; }

/* ---- Segment Summary (table) ------------------------------------------- */
.seg-sum { display: flex; flex-direction: column; gap: 16px; height: 100%; min-height: 0; }
.seg-sum__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.seg-sum__heading { margin: 0; font-size: 20px; font-weight: 400; color: #fff; }
.seg-sum__explore {
  border: 0.5px solid rgba(255, 255, 255, 0.30);
  border-radius: 100px;
  padding: 6px 14px;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.90);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.seg-sum__explore:hover { background: rgba(255, 255, 255, 0.10); }
.seg-sum__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--loan-table);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
}
.seg-sum__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.seg-sum__table th,
.seg-sum__table td {
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.10);
}
.seg-sum__table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.05); }
.seg-sum__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--loan-head);
  color: rgba(255, 255, 255, 0.80);
  font-weight: 600;
  font-size: 11px;
}
.seg-sum__table tbody tr:hover td { background: rgba(255, 255, 255, 0.10); }
.seg-sum__table td { color: #fff; }
.seg-sum__num { text-align: right !important; font-variant-numeric: tabular-nums; }
.seg-sum__seg { display: inline-flex; align-items: center; gap: 8px; }
.seg-sum__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.seg-sum__delta {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.seg-sum__delta--pos { background: rgba(0, 255, 128, 0.14); color: #00ff80; }
.seg-sum__delta--neg { background: rgba(238, 67, 58, 0.18); color: #ee433a; }
.seg-sum__method { font-size: 12px; color: rgba(255, 255, 255, 0.70); }

.widget__footer {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 24px 6px 12px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.30);
}
.widget__footer .icon-btn { color: rgba(255, 255, 255, 0.70); }
.widget__foot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}
.widget__foot-btn:hover { color: #fff; }
.widget__foot-btn svg { display: block; height: 16px; width: 16px; }

/* ---- Vertical (single-column stack) mode -------------------------------- */
/* Vertical now uses the same row model (.grid-rows.is-vertical), one widget
   per row at full width. Let stacked widgets grow past the 40vh row cap. */
.grid-rows.is-vertical .grid-row { --cols: 1; }
.grid-rows.is-vertical .widget { max-height: none; }
.grid.is-vertical { --cols: 1; }
.grid.is-vertical .widget { max-height: none; }

/* ---- Empty state -------------------------------------------------------- */
.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 0;
  color: rgba(255, 255, 255, 0.5);
}
.empty svg { height: 48px; width: 48px; opacity: 0.5; }

/* =========================================================================
   ACL Trend Filter Popup (Figma 1031:7115) — fixed positioned popup
   ========================================================================= */

/* ACL Trend Filter Popup — fixed positioned, not modal */
.acl-filt__popup {
  position: fixed;
  z-index: 1000;
  width: 383px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  pointer-events: auto;
}

.acl-filt__arrow {
  position: absolute;
  top: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: #05080a;
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: -2px -2px 8px rgba(0, 0, 0, 0.4);
}

.acl-filt__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #05080a;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  color: #fff;
}

.acl-filt__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.acl-filt__title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.acl-filt__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.acl-filt__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.acl-filt__close svg { display: block; width: 16px; height: 16px; }

.acl-filt__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.acl-filt__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.acl-filt__label-section {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.acl-filt__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acl-filt__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-left: 24px;
}

.acl-filt__option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.acl-filt__checkbox,
.acl-filt__radio {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  accent-color: #fff;
  flex-shrink: 0;
}

.acl-filt__radio {
  border-radius: 50%;
}

.acl-filt__label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  line-height: 1.5;
  flex: 1 1 auto;
}

.acl-filt__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

.acl-filt__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  gap: 12px;
}

.acl-filt__footer .btn {
  flex: 1 1 0;
}

/* =========================================================================
   Library Screen (Figma 999:27830)
   ========================================================================= */
.library-page {
  margin: 4px 4px 0;
  padding: 16px 24px 24px;
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.library-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.library-page__title {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  font-weight: 400;
  color: #ffffff;
}

.library-upload {
  height: 174px;
  border: 1px dashed rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(250, 250, 251, 0.3);
}

.library-upload__icon {
  width: 57px;
  height: 57px;
  border-radius: 999px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(1, 22, 10, 0.9);
}

.library-upload__icon svg { width: 24px; height: 24px; stroke-width: 2; }

.library-upload__title {
  margin: 0;
  width: 206px;
  text-align: center;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  color: #ebedf0;
}

.library-upload__btn {
  height: 32px;
  border-radius: 4px;
  border: 2px solid #ffffff;
  background: transparent;
  color: #ffffff;
  padding: 0 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.library-files {
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 6, 3, 0.2);
}

.library-files__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.library-files__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  color: #ebedf0;
}

.library-files__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-search {
  width: 356px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.55);
}

.library-search svg { width: 20px; height: 20px; }

.library-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fafafa;
  font-size: 13px;
  font: inherit;
  outline: none;
}

.library-search input::placeholder { color: #fafafa; opacity: 0.9; }

.library-filter {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.library-filter svg { width: 20px; height: 18px; }

.library-table-wrap {
  overflow: auto;
  border-top: 0.5px solid rgba(255, 255, 255, 0.2);
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.library-table th,
.library-table td {
  text-align: left;
  padding: 8px;
  height: 32px;
  font-size: 11px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.14);
}

.library-table th {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.library-table td { color: #ebedf0; }

.lib-tag {
  height: 20px;
  border-radius: 100px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.lib-tag--receive { background: rgba(0, 141, 210, 0.2); color: #7ed5ff; }
.lib-tag--sent { background: rgba(238, 67, 58, 0.2); color: #ff9d96; }

.lib-new {
  margin-left: 8px;
  height: 15px;
  border-radius: 100px;
  padding: 0 4px;
  background: rgba(91, 177, 74, 0.2);
  color: #8ddf7b;
  font-size: 9px;
  line-height: 15px;
  display: inline-block;
}

.lib-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lib-icon-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lib-icon-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

.lib-icon-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.library-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.55) !important;
  height: 72px !important;
}

.library-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  height: 48px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.library-pagination__left {
  display: inline-flex;
  align-items: center;
  height: 48px;
  width: 276px;
}

.lib-page-nav {
  display: inline-flex;
  align-items: center;
  height: 48px;
}

.lib-page-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lib-page-btn svg { width: 24px; height: 24px; }

.lib-page-nav + .lib-page-nav,
.lib-page-current,
.library-pagination__left .lib-page-nav:first-child {
  border-left: 0.5px solid rgba(255, 255, 255, 0.5);
}

.lib-page-current {
  width: 80px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Proxima Nova', 'Roboto Condensed', sans-serif;
  font-size: 14px;
  line-height: 1.3;
  color: #ffffff;
}

.library-pagination__right {
  flex: 1 1 auto;
  height: 48px;
  padding: 0 16px;
  color: #ffffff;
  font-family: 'Proxima Nova', 'Roboto Condensed', sans-serif;
  font-size: 14px;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.lib-items-btn {
  border: none;
  background: transparent;
  color: #ffffff;
  font: inherit;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.lib-items-btn svg { width: 16px; height: 16px; }

/* ---- Responsive (desktop-first) ----------------------------------------- */
@media (max-width: 1320px) {
  .app { width: 100%; }
}
