:root {
  --reference-white: rgba(255, 255, 255, 0.92);
  --reference-soft: rgba(255, 255, 255, 0.78);
  --reference-muted: rgba(255, 255, 255, 0.64);
  --reference-line: rgba(255, 255, 255, 0.19);
  --reference-panel: rgba(240, 235, 229, 0.9);
  --reference-ink: #5f574f;
  --reference-gutter: 5.45vw;
  --reference-left: 11.55vw;
}

html:has(.reference-home) {
  background: #776658;
}

.reference-home {
  min-width: 320px;
  color: var(--reference-white);
  background: #776658;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
}

.reference-home a {
  color: inherit;
}

.reference-home h1,
.reference-home h2,
.reference-home h3,
.reference-home p {
  margin: 0;
  font-family: inherit;
}

.reference-page {
  position: relative;
  min-height: auto;
  overflow: hidden;
  isolation: isolate;
  background: #6f5e50;
}

/* Photographic backdrop, softened (depth-of-field + grade) so it reads as a
   premium out-of-focus set, not a sharp AI render. */
.reference-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(135% 95% at 50% 6%, transparent 50%, rgba(38, 27, 19, 0.55) 100%),
    linear-gradient(rgba(64, 49, 39, 0.3), rgba(64, 49, 39, 0.3)),
    url("assets/background/meridian-background-crisp-3x.webp") top center / 100% 100% no-repeat;
  filter: blur(3px) saturate(0.9) brightness(0.97);
  transform: scale(1.05);
  transform-origin: center top;
}

/* Fine film grain — the de-AI move; kills the plastic sheen, adds editorial texture. */
.reference-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* Whole-page film grain — one fixed overlay over everything (incl. the work
   screenshots + type) so the page reads as a single crafted, analog surface
   rather than clean AI-rendered layers. Very low opacity; invisible on text. */
.reference-home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

.reference-header {
  display: flex;
  height: 72px;
  min-height: 0;
  align-items: center;
  padding: 0 var(--reference-gutter);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.reference-brand {
  font-size: clamp(13px, 0.94vw, 16px);
  font-weight: 500;
  letter-spacing: -0.065em;
}

.reference-nav {
  display: flex;
  gap: 2.15vw;
  margin-left: auto;
}

.reference-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(10px, 0.7vw, 12px);
  font-weight: 500;
  letter-spacing: -0.025em;
  transition: color 150ms ease;
}

.reference-nav a:hover,
.reference-nav a:focus-visible {
  color: #fff;
}

.reference-copy p,
.reference-intro,
.reference-work-copy p,
.reference-booking-copy p,
.reference-service-grid p,
.reference-process-grid p,
.reference-footer p,
.reference-footer a {
  color: var(--reference-soft);
  font-size: clamp(12px, 0.92vw, 16px);
  letter-spacing: -0.035em;
  line-height: 1.62;
}

.reference-eyebrow,
.reference-number {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(8px, 0.78vw, 13px);
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.reference-button {
  display: inline-flex;
  min-height: clamp(46px, 3.3vw, 54px);
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0 clamp(18px, 1.5vw, 26px);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  font-size: clamp(13px, 0.86vw, 15px);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.reference-button:hover,
.reference-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.08);
}

.reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 1.3vw, 22px);
  align-items: center;
  margin-top: clamp(22px, 1.9vw, 30px);
}

.reference-home .reference-button-primary {
  color: #3c332b;
  border-color: #fff;
  background: #fbf8f3;
  box-shadow: 0 12px 28px rgba(33, 22, 14, 0.3);
}

.reference-home .reference-button-primary:hover,
.reference-home .reference-button-primary:focus-visible {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 16px 34px rgba(33, 22, 14, 0.38);
}

.reference-text-link {
  display: inline-flex;
  min-height: clamp(46px, 3.3vw, 54px);
  gap: 0.5em;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(13px, 0.84vw, 14.5px);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 150ms ease;
}

.reference-text-link .icon-arrow {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reference-text-link:hover,
.reference-text-link:focus-visible {
  color: #fff;
}

.reference-text-link:hover .icon-arrow,
.reference-text-link:focus-visible .icon-arrow {
  transform: translateY(3px);
}

.icon-arrow {
  position: relative;
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  flex: 0 0 auto;
}

.icon-arrow::before,
.icon-arrow::after {
  position: absolute;
  display: block;
  content: "";
}

.icon-arrow-up-right {
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.35;
}

.icon-arrow-down::before {
  top: 0;
  left: 50%;
  width: 1px;
  height: 0.65em;
  background: currentColor;
  transform: translateX(-50%);
}

.icon-arrow-down::after {
  right: 0.13em;
  bottom: 0.04em;
  width: 0.38em;
  height: 0.38em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.reference-home a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

/* Hero */
.reference-hero {
  min-height: calc(100vh - 72px);
  padding: clamp(130px, 17vh, 190px) 0 0 var(--reference-left);
}

.reference-copy {
  width: 27vw;
}

.reference-copy h1 {
  width: 34vw;
  font-size: clamp(32px, 4.2vw, 69px);
  font-weight: 300;
  letter-spacing: -0.08em;
  line-height: 1.03;
}

.reference-copy p {
  margin-top: 1.6vw;
}

/* Services */
.reference-services {
  width: 44.6vw;
  min-height: 100vh;
  margin-left: 50.2vw;
  padding-top: 15vh;
}

.reference-services h2,
.reference-process h2,
.reference-work-copy h2,
.reference-booking-copy h2 {
  margin-top: 1.7vw;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(22px, 3.13vw, 51px);
  font-weight: 300;
  letter-spacing: -0.085em;
  line-height: 0.98;
}

.reference-services .reference-intro {
  width: 34vw;
  margin-top: 1.5vw;
}

.reference-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4.2vw;
}

.reference-service-grid article {
  min-height: 14vw;
  padding: 0 1.9vw 0 0;
}

.reference-service-grid article + article {
  padding-left: 1.9vw;
  border-left: 1px solid var(--reference-line);
}

.reference-service-grid h3,
.reference-process-grid h3 {
  margin-top: 1.75vw;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(10px, 1.05vw, 18px);
  font-weight: 300;
  letter-spacing: -0.07em;
  line-height: 1.15;
}

.reference-service-grid article > p:last-child,
.reference-process-grid article > p:last-child {
  margin-top: 1.05vw;
}

/* Process */
.reference-process {
  width: 83vw;
  min-height: 100vh;
  margin-left: var(--reference-left);
  padding-top: 15vh;
}

.reference-process .reference-intro {
  width: 48vw;
  margin-top: 1.4vw;
}

.reference-process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 61vw;
  margin-top: 4vw;
}

.reference-process-grid article {
  min-height: 12.5vw;
  padding-right: 1.25vw;
}

.reference-process-grid article + article {
  padding-left: 1.25vw;
  border-left: 1px solid var(--reference-line);
}

/* Work */
.reference-work {
  position: relative;
  min-height: 100vh;
  padding-top: 8vh;
}

.screenshot-slot {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screenshot-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.94) contrast(0.97) brightness(0.985);
}

.reference-work-primary {
  position: absolute;
  top: 6vh;
  left: 5.45vw;
  width: min(52.8vw, 63vh);
  height: min(39.6vw, 47.25vh);
  aspect-ratio: 4 / 3;
  z-index: 1;
  container-type: inline-size;
  border-radius: 0.7vw;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #15110c;
  box-shadow: 0 1.5vw 3.2vw rgba(34, 23, 16, 0.32);
}

.reference-work-primary img {
  object-position: top center;
}

.reference-work-copy {
  position: absolute;
  top: 27vh;
  left: 64vw;
  width: 27.5vw;
}

.reference-work-copy h2 {
  margin-top: 1.3vw;
}

.reference-work-copy > p:not(.reference-eyebrow) {
  margin-top: 1.55vw;
}

.reference-work-copy .reference-button {
  margin-top: 1.7vw;
}

.reference-work-secondary {
  position: absolute;
  top: 46vh;
  left: 28vw;
  width: min(46vw, 52vh);
  height: min(34.5vw, 39vh);
  aspect-ratio: 4 / 3;
  z-index: 2;
  border-radius: 0.7vw;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2vw 4vw rgba(34, 23, 16, 0.42);
}

.reference-work-secondary img {
  object-position: center center;
}

/* Booking */
.reference-booking {
  /* Full-width Cal embed (event details + calendar + slots, Cal's own layout) — no Meridian copy. */
  max-width: 1160px;
  margin-inline: auto;
  padding: 12vh 24px 9vh;
}

.reference-booking-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.reference-booking-head .reference-eyebrow {
  display: block;
  margin-bottom: 12px;
}

.reference-booking-head h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(30px, 3.4vw, 52px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.reference-booking-head p {
  margin-top: 16px;
  color: var(--reference-soft);
  font-size: clamp(13px, 0.95vw, 16px);
  letter-spacing: -0.03em;
  line-height: 1.6;
}

.reference-booking-copy {
  max-width: 640px;
  margin-bottom: 40px;
}

.reference-booking-copy h2 {
  margin-top: 0;
}

.reference-booking-copy p {
  margin-top: 1.65vw;
}

.booking-embed {
  width: 100%;
  min-height: 420px;
  margin-top: 0;
  background: transparent;
}

.booking-embed iframe {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border: 0;
  background: transparent;
}

.booking-embed-fallback {
  color: var(--reference-white);
  font-size: clamp(9px, 0.9vw, 15px);
  font-weight: 600;
}

/* Quick-context chips under the booking copy */
.booking-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6vw;
  margin-top: 1.8vw;
  padding: 0;
  list-style: none;
}

.booking-pill {
  padding: 0.45vw 0.95vw;
  border: 1px solid var(--reference-line);
  border-radius: 999px;
  font-size: clamp(11px, 0.78vw, 13px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--reference-soft);
  background: rgba(255, 255, 255, 0.05);
}

.booking-pill-link a {
  color: inherit;
  text-decoration: none;
}

.booking-pill-link:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.booking-pill-link:hover a {
  color: var(--reference-white);
}

/* Footer */
.reference-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1.22fr 0.96fr 0.96fr 1.21fr;
  gap: 4vw;
  min-height: auto;
  margin: 0 5.45vw;
  padding: 4vw 0 6.5vw;
  border-top: 1px solid var(--reference-line);
}

.reference-footer h2 {
  margin-bottom: 1.5vw;
  color: rgba(255, 255, 255, 0.87);
  font-size: clamp(11px, 1.1vw, 18px);
  font-weight: 300;
  letter-spacing: -0.065em;
}

.reference-footer a {
  display: block;
  width: fit-content;
}

.reference-copyright {
  position: absolute;
  bottom: 4.2vw;
  left: 0;
}

.reference-socials {
  position: absolute;
  right: 0;
  bottom: 4vw;
  display: flex;
  gap: 2vw;
  align-items: center;
}

.reference-socials a {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(13px, 1.6vw, 26px);
  font-weight: 500;
}

@media (max-width: 560px) {
  :root {
    --reference-gutter: 20px;
    --reference-left: 20px;
  }

  .reference-page {
    min-height: auto;
    background-size: auto 100%;
  }

  .reference-header {
    height: 58px;
    padding-inline: 20px;
  }

  .reference-brand {
    font-size: 14px;
  }

  .reference-nav {
    gap: 18px;
  }

  .reference-nav a {
    font-size: 12.5px;
  }

  /* Mobile: keep only the essentials (Work · Services · Contact) at a readable size,
     instead of squeezing all six links down to a tiny 9px. */
  .reference-nav a:nth-child(3),
  .reference-nav a:nth-child(4),
  .reference-nav a:nth-child(5) {
    display: none;
  }

  .reference-copy p,
  .reference-intro,
  .reference-work-copy p,
  .reference-booking-copy p,
  .reference-service-grid p,
  .reference-process-grid p,
  .reference-footer p,
  .reference-footer a {
    font-size: 12px;
  }

  .reference-eyebrow,
  .reference-number {
    font-size: 10px;
  }

  .reference-button {
    min-height: 38px;
    gap: 14px;
    padding-inline: 15px;
    font-size: 10px;
  }

  .reference-hero {
    min-height: 580px;
    padding: 102px 20px 50px;
  }

  .reference-copy {
    width: min(100%, 330px);
  }

  .reference-copy h1 {
    width: auto;
    font-size: 49px;
  }

  .reference-copy p,
  .reference-actions {
    margin-top: 19px;
  }

  .reference-actions {
    flex-wrap: wrap;
    gap: 15px;
  }

  .reference-text-link {
    font-size: 11px;
  }

  .reference-services,
  .reference-process,
  .reference-work,
  .reference-booking {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 58px 20px;
  }

  .reference-services h2,
  .reference-process h2,
  .reference-work-copy h2,
  .reference-booking-copy h2 {
    margin-top: 13px;
    font-size: 36px;
  }

  .reference-services .reference-intro,
  .reference-process .reference-intro {
    width: min(100%, 480px);
    margin-top: 16px;
  }

  .reference-service-grid,
  .reference-process-grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 31px;
  }

  .reference-service-grid article,
  .reference-process-grid article,
  .reference-service-grid article + article,
  .reference-process-grid article + article {
    min-height: auto;
    padding: 16px 0;
    border-top: 1px solid var(--reference-line);
    border-left: 0;
  }

  .reference-service-grid h3,
  .reference-process-grid h3 {
    margin-top: 7px;
    font-size: 17px;
  }

  .reference-service-grid article > p:last-child,
  .reference-process-grid article > p:last-child {
    margin-top: 7px;
  }

  .reference-work {
    display: grid;
    gap: 23px;
  }

  .reference-work-primary,
  .reference-work-copy,
  .reference-work-secondary {
    position: static;
    width: 100%;
  }

  .reference-work-primary {
    height: auto;
  }

  .reference-work-copy {
    order: -1;
  }

  .reference-work-copy h2 {
    margin-top: 13px;
  }

  .reference-work-copy > p:not(.reference-eyebrow),
  .reference-work-copy .reference-button {
    margin-top: 16px;
  }

  .reference-work-secondary {
    width: 82%;
    height: auto;
    margin-inline: auto;
  }

  .screenshot-slot {
    aspect-ratio: 4 / 3;
  }

  .reference-booking {
    display: grid;
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .reference-booking-copy p {
    margin-top: 16px;
  }

  .booking-pills {
    gap: 8px;
    margin-top: 18px;
  }

  .booking-pill {
    padding: 7px 13px;
    font-size: 12px;
  }

  .booking-embed {
    min-height: 380px;
    margin-top: 0;
  }

  .reference-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
    margin-inline: 20px;
    padding: 23px 0 62px;
  }

  .reference-footer h2 {
    margin-bottom: 9px;
    font-size: 15px;
  }

  .reference-footer p,
  .reference-footer a {
    font-size: 10px;
  }

  .reference-copyright {
    bottom: 24px;
  }

  .reference-socials {
    right: 0;
    bottom: 21px;
    gap: 18px;
  }

  .reference-socials a {
    font-size: 16px;
  }
}

/* ---------------------------------------------------------------- premium motion */
/* Reveal-on-scroll. Hidden only once JS has set <html class="js"> (see the head
   inline script), so with JS off or disabled the content always shows. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
  will-change: opacity, transform;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Tactile hover micro-interactions */
.reference-service-grid article,
.reference-process-grid article {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.reference-service-grid article:hover,
.reference-process-grid article:hover {
  transform: translateY(-4px);
}

.reference-service-grid h3,
.reference-process-grid h3 {
  transition: color 0.25s ease;
}

.reference-service-grid article:hover h3,
.reference-process-grid article:hover h3 {
  color: #fff;
}

.reference-button {
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reference-button:hover,
.reference-button:focus-visible {
  transform: translateY(-1px);
}

/* Accessibility: honour reduced-motion — show everything, no movement. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reference-service-grid article:hover,
  .reference-process-grid article:hover,
  .reference-button:hover,
  .reference-button:focus-visible {
    transform: none;
  }
}

/* ----------------------------------------------------------------------------
   Coded operations dashboard (replaces the static screenshot in Selected Work).
   Everything is sized in container-query units (cqw) against the framed slot,
   so it reads as a crisp product screenshot at any size. 100cqw = slot width;
   the slot is locked to 4 / 3, so 75cqw = slot height.
---------------------------------------------------------------------------- */
.mock-dashboard {
  --md-hi: rgba(255, 255, 255, 0.93);
  --md-mid: rgba(255, 255, 255, 0.6);
  --md-low: rgba(255, 255, 255, 0.4);
  --md-border: rgba(255, 255, 255, 0.09);
  --md-surface: rgba(255, 255, 255, 0.04);
  --md-gold: #d8b87f;
  --md-green: #84c9a3;
  --md-warn: #d79a6b;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--md-hi);
  background:
    radial-gradient(115% 80% at 100% 0%, rgba(216, 184, 127, 0.11), transparent 55%),
    radial-gradient(85% 75% at 0% 100%, rgba(132, 201, 163, 0.06), transparent 60%),
    linear-gradient(180deg, #1d1610, #131009);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  text-align: left;
}

/* Icon rail */
.md-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3cqw;
  width: 8.6cqw;
  padding: 3.6cqw 0;
  border-right: 1px solid var(--md-border);
  background: rgba(0, 0, 0, 0.2);
}

.md-mark {
  width: 3.6cqw;
  height: 3.6cqw;
  border-radius: 1.1cqw;
  background: linear-gradient(135deg, var(--md-gold), #ad7c41);
  box-shadow: 0 0 0 0.5cqw rgba(216, 184, 127, 0.15);
}

.md-nav {
  width: 2.5cqw;
  height: 2.5cqw;
  border-radius: 0.75cqw;
  background: rgba(255, 255, 255, 0.13);
}

.md-nav.is-active {
  background: var(--md-gold);
  box-shadow: 0 0 2cqw rgba(216, 184, 127, 0.55);
}

.md-rail-spacer {
  flex: 1;
}

.md-nav-foot {
  border-radius: 50%;
}

/* Main column */
.md-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3cqw;
  min-width: 0;
  padding: 3.6cqw 3.9cqw;
}

.md-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2cqw;
}

.md-eyebrow {
  color: var(--md-gold);
  font-size: 1.85cqw;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.md-h {
  margin-top: 1cqw;
  color: var(--md-hi);
  font-size: 3.5cqw;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.md-top-tools {
  display: flex;
  align-items: center;
  gap: 1.5cqw;
}

.md-pill,
.md-range {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
  padding: 1.15cqw 1.85cqw;
  color: var(--md-mid);
  border: 1px solid var(--md-border);
  border-radius: 999px;
  background: var(--md-surface);
  font-size: 1.85cqw;
  white-space: nowrap;
}

.md-live i {
  width: 1.4cqw;
  height: 1.4cqw;
  border-radius: 50%;
  background: var(--md-green);
  box-shadow: 0 0 1.6cqw var(--md-green);
}

.md-ava {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.7cqw;
  height: 4.7cqw;
  color: var(--md-gold);
  border: 1px solid var(--md-border);
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3027, #211912);
  font-size: 1.8cqw;
  font-weight: 600;
}

/* KPI row */
.md-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.2cqw;
}

.md-kpi {
  padding: 2.4cqw 2.3cqw 2.7cqw;
  border: 1px solid var(--md-border);
  border-radius: 2cqw;
  background: var(--md-surface);
}

.md-kpi-l {
  color: var(--md-mid);
  font-size: 1.95cqw;
}

.md-kpi-v {
  margin-top: 1.5cqw;
  color: var(--md-hi);
  font-size: 5.2cqw;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.md-kpi-d {
  margin-top: 1.1cqw;
  color: var(--md-low);
  font-size: 2cqw;
  font-weight: 600;
}

.md-kpi-d.up {
  color: var(--md-green);
}

.md-kpi-d.flat {
  color: var(--md-gold);
}

/* Chart + side grid */
.md-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 2.2cqw;
  flex: 1;
  min-height: 0;
}

.md-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 2.7cqw;
  border: 1px solid var(--md-border);
  border-radius: 2cqw;
  background: var(--md-surface);
}

.md-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5cqw;
}

.md-panel-t {
  color: var(--md-hi);
  font-size: 2.5cqw;
  font-weight: 600;
}

.md-chip {
  padding: 0.85cqw 1.7cqw;
  color: var(--md-mid);
  border: 1px solid var(--md-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.8cqw;
  white-space: nowrap;
}

/* Area chart */
.md-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 2cqw;
}

.md-area {
  display: block;
  width: 100%;
  height: 100%;
}

.md-grid-line {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.md-area-line {
  fill: none;
  stroke: var(--md-gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.md-marker {
  position: absolute;
  top: calc(9% - 1cqw);
  right: -1cqw;
  width: 2cqw;
  height: 2cqw;
  border-radius: 50%;
  background: var(--md-gold);
  box-shadow:
    0 0 0 0.7cqw rgba(216, 184, 127, 0.18),
    0 0 3cqw rgba(216, 184, 127, 0.6);
  animation: mdPulse 2.6s ease-in-out infinite;
}

@keyframes mdPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0.7cqw rgba(216, 184, 127, 0.18),
      0 0 3cqw rgba(216, 184, 127, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 1.5cqw rgba(216, 184, 127, 0.05),
      0 0 4.4cqw rgba(216, 184, 127, 0.72);
  }
}

.md-x {
  display: flex;
  justify-content: space-between;
  margin-top: 1.8cqw;
  color: var(--md-low);
  font-size: 1.7cqw;
}

/* Active builds list */
.md-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2.1cqw;
  margin-top: 2.5cqw;
  min-height: 0;
  list-style: none;
}

.md-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.3cqw 1.5cqw;
}

.md-dot {
  width: 1.6cqw;
  height: 1.6cqw;
  border-radius: 50%;
}

.md-dot.on {
  background: var(--md-green);
}

.md-dot.rev {
  background: var(--md-gold);
}

.md-dot.risk {
  background: var(--md-warn);
}

.md-name {
  overflow: hidden;
  color: var(--md-hi);
  font-size: 2.1cqw;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.md-stat {
  justify-self: end;
  padding: 0.7cqw 1.4cqw;
  border-radius: 999px;
  font-size: 1.65cqw;
  font-weight: 600;
  white-space: nowrap;
}

.md-stat.on {
  color: var(--md-green);
  background: rgba(132, 201, 163, 0.12);
}

.md-stat.rev {
  color: var(--md-gold);
  background: rgba(216, 184, 127, 0.12);
}

.md-stat.risk {
  color: var(--md-warn);
  background: rgba(215, 154, 107, 0.14);
}

.md-bar {
  grid-column: 1 / -1;
  height: 1.2cqw;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.md-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--md-gold), #ad7c41);
}

.md-side-foot {
  display: flex;
  gap: 1.4cqw;
  margin-top: 2.4cqw;
  padding-top: 2.4cqw;
  border-top: 1px solid var(--md-border);
}

.md-tag {
  padding: 0.9cqw 1.6cqw;
  border-radius: 0.9cqw;
  font-size: 1.75cqw;
  font-weight: 600;
}

.md-tag.on {
  color: var(--md-green);
  background: rgba(132, 201, 163, 0.1);
}

.md-tag.risk {
  color: var(--md-warn);
  background: rgba(215, 154, 107, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .md-marker {
    animation: none;
  }
}
