/* ==========================================================================
   Whoopie demo (WAIR case): an interactive rebuild of the financial
   planning flow, matched 1:1 to the Figma design. The app is laid out at
   its real design size (1440x1024) and scaled to fit, like a screenshot
   you can click.
   ========================================================================== */

/* Inter 3.19 (the product font, same generation as Figma's), self-hosted.
   Variable font: 400, 500 and 600. In Inter 4 the tabular "1" has a foot;
   in 3.19 it doesn't, like in Figma. */
@font-face {
  font-family: "Inter WD";
  src: url("../fonts/Inter-3.19-roman.var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.wdemo-figure {
  /* The script widens the demo to the page container (max 1200px).
     20px + the heading's 4px = the 24px other images keep below text. */
  width: 100%;
  margin: 20px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wdemo-figure figcaption {
  font-size: 14px;
  color: var(--color-text-muted);
}

.wdemo {
  --wd-scale: 0.8333;
  position: relative;
  width: 100%;
  padding: calc(4px * var(--wd-scale) + 1px);
  border-radius: calc(16px * var(--wd-scale) + 2px);
  background: #121212;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.12), 0 24px 48px -8px rgba(0, 0, 0, 0.22);
  isolation: isolate;
}

/* The screen inside the device border. */
.wdemo__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 1024;
  border-radius: calc(12px * var(--wd-scale) + 1px);
  overflow: hidden;
  /* Same as the device border: the anti-aliased rounded corners would
     otherwise show a light hairline. */
  background: #121212;
  /* The app itself is always light, also when the site is in dark mode, so
     text selection, carets and form controls use the light system colours. */
  color-scheme: light;
}

.wd-stage {
  /* Design tokens (Figma variables). */
  --wd-white: #fff;
  --wd-black: #000;
  --wd-gb-25: #f9f9fb;
  --wd-gb-50: #f2f2f7;
  --wd-gb-200: #e0e0eb;
  --wd-gb-300: #c2c2d6;
  --wd-gb-500: #9494b7;
  --wd-gb-600: #7676a3;
  --wd-gb-800: #52527a;
  --wd-gb-950: #29293d;
  --wd-gg-200: #e0ebe6;
  --wd-gg-300: #c2d6cd;
  --wd-gg-400: #a3c2b5;
  --wd-gg-500: #7ea997;
  --wd-gg-800: #2d433a;
  --wd-gg-900: #20312a;
  --wd-gg-950: #101915;
  --wd-sidebar: #161d1a;
  --wd-whoopie-border: #1a231f;
  --wd-tg-400: #25fda3;
  --wd-tg-500: #00d67d;
  --wd-tg-600: #03ab60;
  --wd-tg-700: #00854e;
  --wd-tg-800: #03633d;
  --wd-blue-25: #f5f5ff;
  --wd-blue-400: #8080ff;
  --wd-blue-500: #5757ff;
  --wd-blue-600: #33f;
  --wd-blue-700: #1a1aff;
  --wd-blue-800: #0000d6;
  --wd-pink-600: #ff0050;
  --wd-error-100: #ffe5e0;
  --wd-error-200: #ffd4cc;
  --wd-error-500: #ff4c29;
  --wd-error-700: #b21e00;
  --wd-yellow-200: #f9f6cd;
  --wd-yellow-300: #f3ec9a;
  --wd-yellow-500: #c9b903;
  --wd-yellow-600: #978b02;
  --wd-ai-border: #ffb2a3;
  --wd-tip: #121217;
  --wd-tip-green: #121715;
  --wd-shadow-input: 0 1px 1px rgba(61, 61, 92, 0.04), 0 2px 2px rgba(61, 61, 92, 0.04);
  --wd-shadow-card: 0 2px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  /* Motion tokens (curves from the UX animation guidelines). */
  --wd-ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --wd-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --wd-ease-swap: cubic-bezier(0.25, 0.1, 0, 1);
  /* AI gradient strokes (Figma styles "AI Light/Dark button border"),
     as conic gradients with the stops on the element's corners. */
  --wd-ring-light-card: conic-gradient(#feb7a2 0deg, #f4e99b 54deg, #fa9abe 126deg, #c6a2e6 180deg, #aaa9fe 234deg, #79fcc4 306deg, #feb7a2 360deg);
  --wd-ring-light-btn: conic-gradient(#feb7a2 0deg, #f4e99b 78deg, #fa9abe 102deg, #c6a2e6 180deg, #aaa9fe 258deg, #79fcc4 282deg, #feb7a2 360deg);
  --wd-ring-dark-btn: conic-gradient(#fd8262 0deg, #e5d80d 80deg, #f5689e 100deg, #c070c8 180deg, #827ffb 260deg, #40efa0 280deg, #fd8262 360deg);

  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 1024px;
  transform: scale(var(--wd-scale));
  transform-origin: 0 0;
  display: grid;
  grid-template-columns: 240px 1200px;
  font-family: "Inter WD", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.02em;
  /* Figma: Numbers = Monospace uppercase/lining, on every text style */
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--wd-gb-950);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  cursor: default;
  user-select: none;
}

.wd-stage *,
.wd-stage *::before,
.wd-stage *::after {
  box-sizing: border-box;
}

.wd-stage :where(img) { display: block; max-width: none; }
.wd-ico { width: 14px; height: 14px; flex: 0 0 14px; }
.wd-tx { padding: 0 2px; white-space: nowrap; }

.wd-stage :where(button) {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  border: 0;
  background: none;
  padding: 0;
  text-align: inherit;
}

.wd-stage :where(:focus) { outline: none; }
.wd-stage :where(:focus-visible) {
  outline: 2px solid var(--wd-blue-400);
  outline-offset: 2px;
}

/* Text trimmed to cap height, like Figma's "text-box trim". */
.wd-trim {
  text-box: trim-both cap alphabetic;
  line-height: 20px;
  white-space: nowrap;
}

/* ==========================================================================
   Sidebar (static)
   ========================================================================== */

.wd-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 1024px;
  background: var(--wd-sidebar);
  box-shadow: inset -1px 0 0 var(--wd-gg-900);
  color: var(--wd-white);
}

.wd-side__logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 10px 0 20px;
  box-shadow: inset 0 -1px 0 var(--wd-gg-900);
}

.wd-side__logo > img:first-child { width: 20px; height: 20px; flex: 0 0 20px; }

.wd-side__ws {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  line-height: 16px;
}

.wd-side__collapse {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-side__search { padding: 8px 20px 16px; }

.wd-side__input {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--wd-gg-950);
  box-shadow: inset 0 0 0 1px var(--wd-gg-800), var(--wd-shadow-input);
  color: var(--wd-gg-500);
  font-weight: 400;
}

.wd-side__input .wd-grow { flex: 1; padding: 0 2px; }

.wd-kbd {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--wd-gg-950);
  box-shadow: inset 0 0 0 1px var(--wd-whoopie-border);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.wd-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px;
}

.wd-nav__group { display: flex; flex-direction: column; }
.wd-nav__wrap { padding: 2px 0; }

.wd-nav__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  line-height: 16px;
}

.wd-nav__item.is-active { background: var(--wd-gg-900); }

.wd-nav__label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 16px;
  color: var(--wd-gg-500);
}

.wd-agents {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

.wd-agent { display: flex; flex-direction: column; gap: 8px; }

.wd-agent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 14px;
}

.wd-agent__name { display: flex; align-items: center; }
.wd-agent__name > span { display: flex; align-items: center; gap: 4px; }
.wd-agent__val { display: flex; align-items: center; gap: 8px; }

.wd-bar {
  position: relative;
  height: 2px;
  border-radius: 8px;
  background: var(--wd-gg-900);
  overflow: hidden;
}

.wd-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px;
  background: var(--wd-tg-400);
}

.wd-bar i.is-warn { background: var(--wd-yellow-500); }

.wd-whoopie {
  box-shadow: inset 0 1px 0 var(--wd-gg-900);
  padding: 16px 20px 20px;
}

.wd-whoopie__card {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 8px;
  border-radius: 8px;
  background: var(--wd-whoopie-border);
  box-shadow: inset 0 0 0 1px var(--wd-gg-900);
}

.wd-whoopie__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px;
  border-radius: 4px;
}

.wd-whoopie__id { flex: 1; display: flex; align-items: center; gap: 8px; }

.wd-whoopie__avatar {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 20px;
  background: var(--wd-sidebar);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* In Figma the ring is a 1.5px border and the silhouette sits 0.5/2.5px from
   its inner edge, clipped to the inner circle (r 10.5px). The ring stays a
   shadow here (browsers round a 1.5px border down to 1px), so the offset and
   the clip are done on the image itself. */
.wd-whoopie__avatar img {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 20.311px;
  height: 20.729px;
  clip-path: circle(10.5px at 10px 8px);
}

.wd-whoopie__who { flex: 1; font-size: 12px; line-height: 14px; }
.wd-whoopie__who span { display: block; }
.wd-whoopie__who span + span { font-weight: 400; color: var(--wd-gg-500); }

.wd-whoopie__div { padding: 0 4px; }
.wd-whoopie__div::before { content: ""; display: block; height: 1px; background: var(--wd-gg-800); border-radius: 10px; }

.wd-whoopie__data {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
}

.wd-whoopie__row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 14px;
}

.wd-ask-wrap { padding: 0 4px; }

.wd-ask {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #121217;
  --ring: var(--wd-ring-dark-btn);
}

/* ==========================================================================
   Main area: header
   ========================================================================== */

.wd-main {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 1200px;
  height: 1024px;
  background: var(--wd-gb-25);
}

.wd-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  flex: 0 0 48px;
  padding: 12px 20px 12px 16px;
  background: var(--wd-gb-25);
  box-shadow: inset 0 -1px 0 var(--wd-gb-200);
}

.wd-crumbs { display: flex; align-items: center; gap: 6px; line-height: 18px; color: var(--wd-gb-600); }
.wd-crumb { display: flex; align-items: center; gap: 4px; }
.wd-crumb.is-current { color: var(--wd-gb-950); }

.wd-actions { display: flex; align-items: center; gap: 12px; color: var(--wd-gb-600); }
.wd-action { display: flex; align-items: center; gap: 4px; height: 20px; }
.wd-action--icon { width: 20px; justify-content: center; }

.wd-divider { display: flex; flex-direction: column; justify-content: center; height: 14px; padding: 0 4px; }
.wd-divider::before { content: ""; width: 1px; height: 14px; background: var(--wd-gb-200); border-radius: 10px; }

.wd-avatar {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 20px;
  overflow: hidden;
}

.wd-avatar img {
  /* avatar.jpg is pre-cropped to the Figma framing (96x96 for retina). */
  width: 100%;
  height: 100%;
}

.wd-count {
  display: inline-flex;
  align-items: center;
  height: 14px;
  padding: 0 2px;
  border-radius: 4px;
  background: var(--wd-gb-200);
  font-size: 10px;
  line-height: 14px;
  color: var(--wd-gb-600);
}

/* Wizard steps */
.wd-steps { display: flex; align-items: center; gap: 8px; }

.wd-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--wd-gb-600);
  line-height: 20px;
}

.wd-step.is-current { color: var(--wd-black); }

.wd-dot { position: relative; width: 8px; height: 8px; flex: 0 0 8px; }
.wd-dot img { position: absolute; }
.wd-dot img[data-k="done"] { inset: 0; width: 8px; height: 8px; }
.wd-dot img[data-k="current"] { display: none; }
.wd-dot.is-current::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--wd-tg-600);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #aeffde;
}
.wd-dot img[data-k="todo"] { inset: -1px; width: 10px; height: 10px; }

button.wd-step { cursor: pointer; border-radius: 4px; transition: color 0.15s ease; }
button.wd-step:hover { color: var(--wd-gb-950); }
button.wd-step.is-current { cursor: default; }

.wd-line { position: relative; width: 32px; height: 0; flex: 0 0 32px; }
.wd-line img { position: absolute; left: -1px; top: -1px; width: 34px; height: 2px; }

/* Tabs bar on the summary step: looks like a third header row, but lives
   in the summary screen (sticky), so it slides in with that screen. */
.wd-sumbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  flex: 0 0 48px;
  margin: 0 -20px 0 -16px;
  padding: 0 20px 0 16px;
  background: var(--wd-gb-25);
  box-shadow: inset 0 -1px 0 var(--wd-gb-200);
}

/* Scroll area */
.wd-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 16px 16px;
  scrollbar-width: none;
}

.wd-body::-webkit-scrollbar { display: none; }

.wd-screen { display: none; flex-direction: column; gap: 16px; }
.wd-screen.is-active { display: flex; }

/* ==========================================================================
   Shared components
   ========================================================================== */

.wd-card {
  position: relative;
  background: var(--wd-white);
  border-radius: 8px;
  box-shadow: var(--wd-shadow-card);
}

/* Figma draws strokes inside the frame; an overlay keeps the size exact. */
.wd-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--wd-gb-200);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

.wd-title { color: var(--wd-black); line-height: 20px; white-space: nowrap; }

.wd-widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.wd-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
}

.wd-widgets .wd-widget {
  background: var(--wd-white);
  box-shadow: inset 0 0 0 1px var(--wd-gb-200), 0 12px 10px rgba(61, 61, 92, 0.02), 0 4px 2px rgba(61, 61, 92, 0.04), 0 1px 1px rgba(61, 61, 92, 0.02);
}

.wd-widget__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 14px;
  color: var(--wd-gb-600);
  white-space: nowrap;
}

.wd-widget__value { line-height: 14px; color: var(--wd-gb-950); white-space: nowrap; }
.wd-neg { color: var(--wd-pink-600) !important; }
.wd-pos { color: var(--wd-tg-600) !important; }

/* Info icon that opens a tooltip */
.wd-info {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  cursor: help;
}

.wd-info img { transition: opacity 0.15s ease; }
.wd-info:hover img { opacity: 0.6; }

/* Buttons */
.wd-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  line-height: 20px;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.wd-btn--primary {
  background: var(--wd-blue-600);
  color: var(--wd-white) !important;
  box-shadow: inset 0 0 0 1px var(--wd-blue-800), 0 2px 4px rgba(51, 51, 255, 0.1), 0 4px 8px rgba(51, 51, 255, 0.1);
}

.wd-btn--primary:hover { background: var(--wd-blue-700); }
.wd-btn--primary:active { background: var(--wd-blue-800); }

.wd-btn--secondary {
  background: var(--wd-white) !important;
  color: var(--wd-black) !important;
  box-shadow: inset 0 0 0 1px var(--wd-gb-200), 0 1px 2px rgba(61, 61, 92, 0.04), 0 2px 4px rgba(61, 61, 92, 0.04);
}

.wd-btn--secondary:hover { background: var(--wd-gb-50) !important; }

/* AI button: white with a soft coral glow (Figma: four blurred borders). */
.wd-btn--ai {
  background: var(--wd-white) !important;
  color: var(--wd-black) !important;
  --ring: var(--wd-ring-light-btn);
}



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

.wd-link {
  height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  color: var(--wd-blue-600);
  line-height: 20px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.wd-link:hover { color: var(--wd-blue-800); }

/* Scenario tabs */
.wd-tabs { display: flex; align-items: center; gap: 6px; }

.wd-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--wd-gb-600) !important;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wd-tab:hover { background: var(--wd-gb-50) !important; color: var(--wd-gb-950) !important; }

.wd-tab.is-active {
  background: var(--wd-gb-50) !important;
  box-shadow: inset 0 0 0 1px var(--wd-gb-200);
  color: var(--wd-gb-950) !important;
  cursor: default;
}

.wd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 8px 8px 8px 16px;
}

/* ==========================================================================
   Screen 1: margin & inventory
   ========================================================================== */

.wd-inputs { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.wd-inputs__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wd-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wd-field__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 20px; }
.wd-field__label { display: flex; align-items: center; gap: 4px; color: var(--wd-gb-600); white-space: nowrap; }
.wd-req { color: var(--wd-blue-500); }

.wd-field__box {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 6px 8px;
  background: var(--wd-white);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--wd-gb-200), var(--wd-shadow-input);
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wd-field__box:hover { box-shadow: inset 0 0 0 1px var(--wd-gb-300), var(--wd-shadow-input); }

.wd-field__box:focus-within {
  box-shadow: inset 0 0 0 1px var(--wd-blue-400), 0 0 0 2px var(--wd-blue-25), var(--wd-shadow-input);
}

.wd-field__box input {
  flex: 1;
  min-width: 0;
  height: 20px;
  padding: 0 2px;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  line-height: 20px;
  color: var(--wd-gb-950);
  outline: none;
}

.wd-field__box input::placeholder { color: var(--wd-gb-600); opacity: 1; }
.wd-field__suffix { color: var(--wd-gb-500); }

/* Table */
.wd-table { overflow: visible; }
.wd-table table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }

.wd-table th,
.wd-table td {
  height: 40px;
  padding: 0 8px;
  border-bottom: 1px solid var(--wd-gb-200);
  text-align: right;
  white-space: nowrap;
  line-height: 16px;
  font-weight: 500;
  vertical-align: middle;
}

.wd-table thead th {
  background: var(--wd-white);
  border-top: 1px solid var(--wd-gb-200);
  color: var(--wd-gb-600);
}

.wd-table th:first-child,
.wd-table td:first-child { text-align: left; padding-left: 16px; padding-right: 16px; }

.wd-table tbody tr:last-child > * { border-bottom: 0; }
.wd-table tbody tr:last-child > *:first-child { border-bottom-left-radius: 7px; }
.wd-table tbody tr:last-child > *:last-child { border-bottom-right-radius: 7px; }

.wd-th { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.wd-th--name { gap: 8px; }
.wd-th__text { display: inline-flex; gap: 4px; padding: 0 2px; }
.wd-th__muted { color: var(--wd-gb-500); }

.wd-table tbody tr > * { background: var(--wd-white); color: var(--wd-gb-950); }
.wd-table tbody tr.is-cluster > * { background: var(--wd-gb-25); }

.wd-name { display: inline-flex; gap: 4px; padding: 0 2px; }
.wd-muted { color: var(--wd-gb-500); }

.wd-val { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.wd-val > span:first-child { padding: 0 2px; }
.wd-pct { color: var(--wd-gb-500); }

.wd-cell {
  position: relative;
  cursor: text;
  transition: background-color 0.12s ease;
}

.wd-table tbody tr > .wd-cell:hover { background: var(--wd-gb-50); }

/* Focused cell: 2px blue stroke inside the cell, over its own bottom line. */
.wd-table tbody tr > .wd-cell.is-selected { background: var(--wd-blue-25); }

.wd-cell.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--wd-blue-400);
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
}

.wd-cell .wd-val { position: relative; z-index: 1; }
.wd-cell:focus-visible { outline: none !important; background: var(--wd-gb-50); }

.wd-edit {
  outline: none;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  caret-color: var(--wd-blue-600);
}

.wd-ai-val b {
  font-weight: 500;
  background-image: linear-gradient(83.79deg, #00d67d 1.1%, #03ab60 50%, #03633d 98.9%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wd-reset {
  position: absolute !important;
  top: 48px;
  right: 1px;
  z-index: 5;
}

/* ==========================================================================
   Screen 2: summary
   ========================================================================== */

.wd-section { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.wd-tiles { display: flex; flex-direction: column; gap: 8px; }
.wd-tiles__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wd-tiles__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wd-tile { background: var(--wd-gb-25); }

.wd-overviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wd-overview { display: flex; flex-direction: column; gap: 8px; padding: 16px; min-width: 0; }
.wd-overview__sub { padding-top: 4px; font-size: 12px; line-height: 16px; color: var(--wd-gb-800); white-space: nowrap; }
.wd-overview__chart { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 12px; }

.wd-seg { display: flex; gap: 2px; height: 16px; }

.wd-seg i {
  height: 16px;
  flex: 0 0 auto;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.wd-seg i.is-rest { flex: 1 1 auto; cursor: default; }
/* Dim the other bars only while a bar itself is hovered (not the 2px gaps). */
.wd-seg:has(i:not(.is-rest):hover) i:not(.is-rest):not(:hover) { opacity: 0.55; }

.wd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  line-height: 14px;
  color: var(--wd-gb-600);
}

.wd-legend span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.wd-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.wd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.wd-finding {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  min-width: 0;
  background: var(--wd-white);
  border-radius: 8px;
  position: relative;
  --ring: var(--wd-ring-light-card);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.wd-finding.is-fixed { --ring: linear-gradient(var(--wd-gb-200), var(--wd-gb-200)); }

.wd-finding__head { display: flex; align-items: center; gap: 4px; height: 20px; }

.wd-finding__head > .wd-grad {
  flex: 1;
  line-height: 14px;
  white-space: nowrap;
}

.wd-grad span {
  background-image: linear-gradient(89.85deg, #00d67d 0%, #5c8a76 50%, #2d433a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wd-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--bd);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.wd-badge--alert { background: var(--wd-yellow-200); --bd: var(--wd-yellow-300); color: var(--wd-yellow-600); }
.wd-badge--fail { background: var(--wd-error-100); --bd: var(--wd-error-200); color: var(--wd-error-700); }
.wd-badge--fixed { background: #e5fbf1; --bd: #b8f2d8; color: var(--wd-tg-700); }

.wd-finding__copy { display: flex; flex-direction: column; gap: 2px; }
.wd-finding__title { color: var(--wd-gb-800); line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-finding__text { color: var(--wd-gb-600); font-weight: 400; line-height: 18px; min-height: 36px; }

.wd-impact { display: flex; flex-direction: column; gap: 8px; }
.wd-impact__title { color: var(--wd-gb-800); line-height: 20px; }
.wd-impact__rows { display: flex; flex-direction: column; gap: 2px; }
.wd-impact__row { display: flex; justify-content: space-between; line-height: 20px; }
.wd-impact__row span:first-child { width: 72px; color: var(--wd-gb-600); }
.wd-impact__row span:last-child { width: 100px; text-align: right; }
.wd-impact__div { height: 1px; background: var(--wd-gb-200); border-radius: 10px; }
.wd-err { color: var(--wd-error-500); }

.wd-finding__actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 8px; }

/* ==========================================================================
   Tooltip and toast
   ========================================================================== */

.wd-tip {
  position: absolute;
  z-index: 50;
  width: max-content;
  max-width: 260px;
  padding: 12px;
  border-radius: 8px;
  background: var(--wd-tip);
  color: var(--wd-gb-300);
  font-size: 12px;
  line-height: 14px;
  font-weight: 500;
  filter: drop-shadow(0 2px 2px rgba(22, 22, 29, 0.14)) drop-shadow(0 8px 4px rgba(22, 22, 29, 0.14));
  pointer-events: none;
  opacity: 0;
  transform: scale(0.97);
  transform-origin: var(--arrow, 50%) calc(100% + 6px);
  transition: opacity 90ms var(--wd-ease-in), transform 90ms var(--wd-ease-in);
}

.wd-tip.is-on {
  opacity: 1;
  transform: none;
  transition-duration: 125ms;
  transition-timing-function: var(--wd-ease-out);
}
.wd-tip.is-green { background: var(--wd-tip-green); color: var(--wd-gg-300); min-width: 0; max-width: none; }

/* Arrow from the Figma component, overlapping the box by 1px (no seam). */
.wd-tip__arrow {
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 24px;
  height: 6px;
  margin-left: -12px;
}

.wd-tip.is-below { transform-origin: var(--arrow, 50%) -6px; }
.wd-tip.is-below .wd-tip__arrow { bottom: auto; top: -5px; transform: rotate(180deg); }


.wd-tip__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 14px;
  color: var(--wd-white);
  white-space: nowrap;
}

.wd-tip__label { line-height: 14px; margin-bottom: 8px; }
.wd-tip__rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wd-tip__row { display: flex; align-items: stretch; gap: 8px; line-height: 14px; }
.wd-tip__row::before { content: ""; flex: none; width: 4px; border-radius: 2px; background: var(--c); } /* never squeezed while the box glides wider */
.wd-tip__row span { flex: 1; }
.wd-tip__row b { flex: none; font-weight: 500; color: var(--wd-white); text-align: right; margin-left: 8px; }

.wd-tip__badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  box-shadow: inset 0 0 0 1px var(--wd-gg-900);
  border-radius: 8px;
  color: var(--wd-gg-400);
  line-height: 16px;
}



@media (prefers-reduced-motion: reduce) {
  .wd-stage *, .wd-tip, .wd-toast { transition: none !important; animation: none !important; }
}

/* On a phone the app becomes too small to use, so we say so. */
.wdemo__hint { display: none; }

/* Mobile hint under the caption, at the site's mobile breakpoint. */
@media (max-width: 767px) {
  .wdemo__hint { display: block; }
}

/* Figma: the last column keeps 16px on the right, header text sits 2px
   further from its info icon. */
.wd-table th:last-child, .wd-table td:last-child { padding-right: 16px; }
.wd-table thead th:not(:first-child) .wd-th { gap: 6px; }

/* ==========================================================================
   AI buttons and cards: gradient stroke + "Gradient blurs" (Figma builds
   these from four blurred copies of the stroke: 6/4/2/1px wide, blurred
   6/4/2/1px). Same here: each .wd-glow is a blurred, masked ring.
   ========================================================================== */

.wd-ring,
.wd-glow > i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--w, 1px);
  background: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.wd-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(var(--b));
  opacity: var(--o);
  pointer-events: none;
}

.wd-btn--ai > .wd-tx, .wd-btn--ai > .wd-ico, .wd-btn--ai > .wd-swap,
.wd-ask .wd-tx, .wd-ask .wd-ico { position: relative; z-index: 1; }

/* AI Light: the blurs sit under a white top layer, so they only show
   around the button, never inside it. */
.wd-btn--ai { background: transparent !important; }
.wd-btn--ai > .wd-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--wd-white);
  transition: background-color 0.15s ease;
}
.wd-btn--ai > .wd-ring { z-index: 1; }

.wd-ask { overflow: hidden; }
.wd-btn--ai:hover > .wd-fill, .wd-btn--ai:focus-visible > .wd-fill { background: var(--wd-gb-25); }
.wd-btn--ai:active > .wd-fill { background: var(--wd-gb-50); }



/* ==========================================================================
   Motion
   ========================================================================== */

/* AI button loading: the label box eases to the new label's width while
   the old label blurs out and the new one blurs in, both at once. */
.wd-layers {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  height: 20px;
  /* same clock and curve as the incoming label, so they land together */
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1) 80ms;
}
.wd-layer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  /* incoming label: starts 80ms after the old one begins to leave, and
     lands together with the width (80 + 240 = 320ms) */
  transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1) 80ms, filter 240ms cubic-bezier(0.22, 1, 0.36, 1) 80ms, transform 240ms cubic-bezier(0.22, 1, 0.36, 1) 80ms;
}
.wd-layer.is-out {
  position: absolute;
  inset: 0;
  justify-content: center;
  opacity: 0;
  filter: blur(2px);
  transform: scale(0.85);
  pointer-events: none;
  /* outgoing label: quicker, no delay */
  transition: opacity 160ms var(--wd-ease-in), filter 160ms var(--wd-ease-in), transform 160ms var(--wd-ease-in);
}
.wd-layer .wd-ico, .wd-layer .wd-spinner { transition: transform 300ms var(--wd-ease-swap); }
.wd-layer.is-out .wd-ico, .wd-layer.is-out .wd-spinner { transform: scale(0.3); }

.wd-spinner { transition: transform 300ms var(--wd-ease-swap); }
.wd-layer.is-out .wd-ico, .wd-layer.is-out .wd-spinner { transform: scale(0.3); }

.wd-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 1.5px solid var(--wd-gb-200);
  border-top-color: var(--wd-gb-600);
  animation: wd-spin 0.8s linear infinite;
}

.wd-btn.is-loading { cursor: progress; }

/* Values that change (case switch, fixes, edits) clear up from a blur. */
@keyframes wd-blur-in {
  from { opacity: 0.4; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); }
}
.wd-changed { animation: wd-blur-in 420ms cubic-bezier(0.22, 1, 0.36, 1); }

/* Screen change on Next: a horizontal slide, both screens as one track
   (ease-in-out, 400ms, for a move across the screen). */
.wd-body { position: relative; overflow-x: hidden; }
.wd-screen.is-leaving { position: absolute; left: 16px; right: 20px; display: flex; pointer-events: none; }
.wd-screen.is-sliding { transition: transform 400ms cubic-bezier(0.77, 0, 0.175, 1); will-change: transform; }

/* Undo / Reset under a cell: popover-like entrance and a quicker exit. */
@keyframes wd-pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.wd-reset { animation: wd-pop-in 160ms var(--wd-ease-out); transform-origin: right top; }
.wd-reset.is-static { animation: none; }
.wd-reset.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transition: opacity 120ms var(--wd-ease-in), transform 120ms var(--wd-ease-in);
  pointer-events: none;
}

/* Toaster (Figma: Type=Default, Form=Wide), bottom centre of the app. */
.wd-toast {
  position: absolute;
  left: 274px;
  bottom: 16px;
  z-index: 60;
  width: 1132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 8px;
  background: var(--wd-tip);
  filter: drop-shadow(0 2px 2px rgba(18, 18, 23, 0.14)) drop-shadow(0 8px 4px rgba(18, 18, 23, 0.14));
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 170ms var(--wd-ease-in), transform 170ms var(--wd-ease-in);
}
.wd-toast.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-duration: 240ms;
  transition-timing-function: var(--wd-ease-out);
}
.wd-toast__left, .wd-toast__right { display: flex; align-items: center; }
.wd-toast__left { gap: 12px; }
.wd-toast__right { gap: 16px; }
.wd-toast__label { line-height: 14px; color: var(--wd-white); white-space: nowrap; }
.wd-toast__action { display: inline-flex; align-items: center; gap: 4px; height: 20px; line-height: 20px; color: #b3b3cc; cursor: pointer; border-radius: 4px; transition: color 150ms ease; }
.wd-toast__action:hover { color: var(--wd-white); }
.wd-toast__close { display: inline-flex; width: 14px; height: 14px; cursor: pointer; border-radius: 4px; }
.wd-toast__close img { transition: opacity 150ms ease; }
.wd-toast__close:hover img { opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .wd-changed, .wd-reset { animation: none; }
  .wd-layer, .wd-screen, .wd-toast, .wd-tip { transition-duration: 0ms !important; }
  .wd-layer.is-out, .wd-screen.is-leaving, .wd-screen.is-entering { filter: none; transform: none; }
}

/* The body has no top padding so the summary's tabs bar can stick to the
   top; the margin screen keeps its 16px. */
.wd-screen[data-screen="margin"] { padding-top: 16px; }

/* Tabular figures on numbers only (so values don't shift when they change);
   running text keeps normal figures. */
.wd-widget__value, .wd-table td, .wd-impact__row span:last-child,
.wd-tip__row b, .wd-whoopie__row, .wd-agent__val, .wd-edit { font-variant-numeric: tabular-nums lining-nums; } /* Figma: Monospace uppercase/lining */

/* Badge after a fix: one after the other, in place. The old badge fades
   and shrinks a little (140ms); then the new "Fixed" badge fades in from a
   slight blur (240ms). Scaled from the centre, so nothing slides. */
@keyframes wd-badge-in {
  from { opacity: 0; transform: scale(0.92); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.wd-badge.is-entering { animation: wd-badge-in 240ms cubic-bezier(0.22, 1, 0.36, 1) 140ms both; transform-origin: center; }
.wd-badge.is-ghost {
  animation: none;
  position: absolute;
  margin: 0;
  transform-origin: center;
  transition: opacity 140ms var(--wd-ease-in), transform 140ms var(--wd-ease-in), filter 140ms var(--wd-ease-in);
  pointer-events: none;
}
.wd-badge.is-ghost.is-leaving { opacity: 0; transform: scale(0.92); filter: blur(2px); }

/* Inputs and labels use the same value blur (an input has no text node of
   its own to animate, so the whole field text clears up). */
.wd-link .wd-tx { display: inline-block; }

.wd-field__box { position: relative; }
.wd-input-ghost {
  position: absolute;
  top: 6px;
  line-height: 20px;
  color: var(--wd-gb-950);
  pointer-events: none;
  white-space: nowrap;
}
.wd-field__box input.is-veiled { color: transparent; }

/* "Resetted!" / "Reset" swap: 1.5x the value blur (420ms -> 630ms). */
.wd-link .wd-tx.wd-changed { animation-duration: 630ms; }

/* Moving from one item to the next while a tooltip is open: it glides
   (position, width, arrow) and its text clears up from a short blur. */
.wd-tip.is-moving {
  transition: opacity 125ms var(--wd-ease-out), transform 125ms var(--wd-ease-out),
    left 240ms cubic-bezier(0.22, 1, 0.36, 1), top 240ms cubic-bezier(0.22, 1, 0.36, 1), width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.wd-tip.is-moving .wd-tip__arrow { transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.wd-tip__inner.wd-changed { animation-duration: 280ms; }
.wd-tip.is-green .wd-tip__row, .wd-tip.is-green .wd-tip__badge { white-space: nowrap; }

/* Toaster: label + support text side by side (Figma, Form=Wide). */
.wd-toast__left { gap: 12px; }
.wd-toast__support { line-height: 14px; color: #b3b3cc; white-space: nowrap; margin-left: -4px; }
.wd-seg i { transition: opacity 0.15s ease, width 420ms cubic-bezier(0.22, 1, 0.36, 1); }

/* Actions menu under an edited AI value (Figma: Dropdown list). */
.wd-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: max-content;
  padding: 2px;
  border-radius: 8px;
  background: var(--wd-white);
  /* Figma: 1px stroke OUTSIDE the frame, #000 at 5% */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 6px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  text-align: left;
}
.wd-menu__head { height: 24px; padding: 6px 10px 2px; line-height: 16px; color: var(--wd-gb-600); }
.wd-menu__item {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px !important;
  border-radius: 6px;
  line-height: 16px;
  color: #3d3d5c !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.wd-menu__item span { padding: 0 2px; }
.wd-menu__item:hover, .wd-menu__item:focus-visible { background: var(--wd-gb-25) !important; }

/* Primary disabled (Figma: blue/200, no stroke or shadow), eased. */
.wd-btn--primary { transition: background-color 200ms ease, box-shadow 200ms ease; }
.wd-stage .wd-btn--primary:disabled {
  background: #ccf;
  box-shadow: none;
  cursor: not-allowed;
}
button.wd-step:disabled { cursor: not-allowed; color: var(--wd-gb-600); }
