/* Interactive sample workspaces. Scoped to demo-showcase only. */
.demo-showcase {
  padding: clamp(76px, 9vw, 128px) 0;
  background: #eef4fc;
  border-block: 1px solid #d9e3f0;
}

.demo-showcase--project {
  background: #f7f9fc;
}

.demo-wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.demo-heading {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(300px, .58fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
  margin-bottom: clamp(34px, 5vw, 58px);
}

.demo-heading h2 {
  max-width: 760px;
  margin: .7rem 0 0;
  color: #1d2a3e !important;
  font-size: clamp(2rem, 3.7vw, 3.65rem) !important;
  line-height: 1.13 !important;
}

.demo-heading p {
  max-width: 520px;
  margin: 0;
  color: #61738b !important;
  font-size: 1rem;
  line-height: 1.82;
}

.demo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #2455d6;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.demo-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34ad82;
}

.demo-disclaimer {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 1rem;
  padding: .38rem .62rem;
  border: 1px solid #ccdaea;
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  color: #66778d;
  font-size: .74rem;
  font-weight: 800;
}

.demo-tabs {
  display: flex;
  gap: .55rem;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.demo-tabs::-webkit-scrollbar { display: none; }

.demo-tab {
  appearance: none;
  min-width: 166px;
  min-height: 48px;
  padding: .72rem 1rem;
  border: 1px solid #cad7e8;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  color: #53657d;
  font: inherit;
  font-size: .88rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.demo-tab:hover,
.demo-tab:focus-visible {
  border-color: #7ca2e9;
  color: #1f4cc8;
  outline: 0;
}

.demo-tab[aria-selected="true"] {
  border-color: #2557d6;
  background: #2557d6;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 87, 214, .2);
}

.demo-workspace {
  overflow: hidden;
  border: 1px solid #26384a;
  border-radius: 8px;
  background: #101922;
  box-shadow: 0 32px 72px rgba(35, 53, 79, .18);
}

.demo-windowbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: #14212d;
}

.demo-windowbar__brand,
.demo-windowbar__status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: rgba(238, 244, 249, .75);
  font-size: .75rem;
  font-weight: 850;
}

.demo-windowbar__brand::before,
.demo-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fbd8e;
  box-shadow: 0 0 0 5px rgba(63, 189, 142, .12);
}

.demo-windowbar__status {
  color: rgba(238, 244, 249, .5);
}

.demo-panel[hidden] { display: none !important; }

.demo-panel {
  animation: demoPanelIn .34s ease both;
}

@keyframes demoPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.demo-screen {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 600px;
}

.demo-sidebar {
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, .09);
  background: #0c151e;
}

.demo-sidebar__title {
  margin-bottom: 1rem;
  color: rgba(244, 248, 251, .42);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 44px;
  padding: .65rem .7rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: rgba(238, 244, 249, .68);
  font-size: .78rem;
  font-weight: 750;
}

.demo-filter.is-current {
  border: 1px solid rgba(72, 129, 240, .45);
  border-radius: 5px;
  background: rgba(49, 100, 207, .16);
  color: #eef4ff;
}

.demo-filter span:last-child {
  color: rgba(238, 244, 249, .36);
  font-size: .68rem;
}

.demo-main {
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
}

.demo-mainhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.demo-mainhead h3 {
  margin: 0 0 .35rem;
  color: #f5f8fb !important;
  font-size: clamp(1.25rem, 2vw, 1.7rem) !important;
}

.demo-mainhead p {
  margin: 0;
  color: rgba(230, 237, 243, .52) !important;
  font-size: .82rem;
}

.demo-live {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #83dcba;
  font-size: .72rem;
  font-weight: 850;
  white-space: nowrap;
}

.demo-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid rgba(255, 255, 255, .09);
  margin-bottom: 1.35rem;
}

.demo-metric {
  min-width: 0;
  padding: 1.15rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, .09);
}

.demo-metric:last-child { border-right: 0; }

.demo-metric span {
  display: block;
  margin-bottom: .42rem;
  color: rgba(231, 238, 244, .46);
  font-size: .7rem;
  font-weight: 800;
}

.demo-metric strong {
  display: block;
  color: #f4f8fb;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  letter-spacing: 0;
}

.demo-metric em {
  display: block;
  margin-top: .3rem;
  color: #6dd1aa;
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
}

.demo-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .52fr);
  gap: 1rem;
}

.demo-pane {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 6px;
  background: #121e29;
}

.demo-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
  color: rgba(240, 245, 249, .78);
  font-size: .78rem;
  font-weight: 850;
}

.demo-pane__head span:last-child {
  color: rgba(240, 245, 249, .36);
  font-size: .66rem;
}

.demo-bars {
  height: 154px;
  display: flex;
  align-items: end;
  gap: clamp(6px, 1.2vw, 14px);
  padding-top: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.demo-bars i {
  flex: 1;
  min-width: 8px;
  height: var(--bar, 40%);
  border-radius: 3px 3px 0 0;
  background: #3c72df;
  transition: height .4s ease, background .2s ease;
}

.demo-bars i:nth-child(3n) { background: #35a983; }

.demo-axis {
  display: flex;
  justify-content: space-between;
  margin-top: .5rem;
  color: rgba(235, 241, 246, .32);
  font-size: .62rem;
}

.demo-feed {
  display: grid;
  gap: .72rem;
}

.demo-feed__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  min-width: 0;
  padding-bottom: .72rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.demo-feed__item:last-child { border-bottom: 0; padding-bottom: 0; }

.demo-feed__mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3eb78b;
}

.demo-feed__mark.is-alert { background: #e5aa4e; }
.demo-feed__mark.is-down { background: #e66c78; }

.demo-feed__item b {
  display: block;
  overflow: hidden;
  color: rgba(244, 248, 251, .8);
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-feed__item small {
  display: block;
  margin-top: .22rem;
  color: rgba(233, 239, 244, .36);
  font-size: .64rem;
}

.demo-feed__value {
  color: rgba(244, 248, 251, .68);
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
}

.demo-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 6px;
}

.demo-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  color: rgba(239, 244, 248, .7);
  font-size: .72rem;
}

.demo-table th,
.demo-table td {
  padding: .72rem .8rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  text-align: left;
}

.demo-table th {
  background: rgba(255, 255, 255, .025);
  color: rgba(238, 244, 249, .38);
  font-size: .64rem;
  text-transform: uppercase;
}

.demo-table tr:last-child td { border-bottom: 0; }
.demo-up { color: #e98283; font-weight: 850; }
.demo-down { color: #75b6f3; font-weight: 850; }
.demo-flat { color: rgba(239, 244, 248, .45); font-weight: 850; }

.demo-progress-list {
  display: grid;
  gap: .9rem;
}

.demo-progress-row {
  display: grid;
  grid-template-columns: 90px 1fr 46px;
  gap: .7rem;
  align-items: center;
  color: rgba(239, 244, 248, .58);
  font-size: .7rem;
}

.demo-progress-row i {
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
}

.demo-progress-row i::after {
  content: "";
  display: block;
  width: var(--value, 50%);
  height: 100%;
  background: #3f7adf;
}

.demo-progress-row:nth-child(2n) i::after { background: #35aa83; }

/* Project demos */
.project-demo {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 620px;
}

.project-brief {
  padding: clamp(24px, 3vw, 36px);
  border-right: 1px solid rgba(255, 255, 255, .09);
  background: #0c151e;
}

.project-brief small {
  color: #68cda7;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-brief h3 {
  margin: .75rem 0 1rem;
  color: #f4f8fb !important;
  font-size: 1.5rem !important;
  line-height: 1.3 !important;
}

.project-brief > p {
  margin: 0 0 1.5rem;
  color: rgba(232, 239, 244, .58) !important;
  font-size: .83rem;
  line-height: 1.75;
}

.project-spec {
  padding: .8rem 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.project-spec span,
.project-spec b {
  display: block;
}

.project-spec span {
  margin-bottom: .32rem;
  color: rgba(233, 240, 245, .35);
  font-size: .65rem;
  font-weight: 800;
}

.project-spec b {
  color: rgba(244, 248, 251, .74);
  font-size: .76rem;
  line-height: 1.5;
}

.project-output {
  min-width: 0;
  padding: clamp(22px, 4vw, 42px);
}

.project-output__label {
  margin-bottom: 1rem;
  color: rgba(238, 244, 249, .38);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-query {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: #15232f;
  color: rgba(248, 250, 252, .88);
  font-size: .86rem;
  font-weight: 750;
}

.project-answer {
  margin-top: 1rem;
  padding: 1.2rem;
  border-left: 3px solid #3eb78b;
  background: rgba(255, 255, 255, .035);
}

.project-answer b {
  display: block;
  margin-bottom: .65rem;
  color: #f5f8fa;
  font-size: .85rem;
}

.project-answer p {
  margin: 0;
  color: rgba(235, 241, 246, .68) !important;
  font-size: .8rem;
  line-height: 1.72;
}

.project-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-top: 1rem;
}

.project-source {
  min-width: 0;
  padding: .8rem;
  border-top: 2px solid #447ae0;
  background: rgba(255, 255, 255, .035);
}

.project-source b,
.project-source span { display: block; }
.project-source b { overflow: hidden; color: rgba(245, 248, 250, .72); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.project-source span { margin-top: .35rem; color: rgba(235, 241, 246, .34); font-size: .62rem; }

.agent-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
  margin: 1rem 0 1.3rem;
}

.agent-node {
  position: relative;
  min-height: 112px;
  padding: .9rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  background: #14222e;
}

.agent-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -.58rem;
  width: .5rem;
  border-top: 1px solid #4b80dd;
}

.agent-node small,
.agent-node b { display: block; }
.agent-node small { color: #66cba6; font-size: .62rem; font-weight: 900; }
.agent-node b { margin-top: .55rem; color: rgba(245, 248, 250, .76); font-size: .75rem; line-height: 1.45; }

.agent-log {
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.agent-log__row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: .8rem;
  padding: .72rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: rgba(238, 244, 248, .58);
  font-size: .7rem;
}

.agent-log__row span:last-child { color: #6dd1aa; font-weight: 850; }

.vision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1rem;
}

.vision-feed {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.05) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(255,255,255,.05) 50%, transparent 50.5%),
    #17242f;
  background-size: 48px 48px;
}

.vision-product {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(58%, 330px);
  height: 48%;
  transform: translate(-50%, -50%) skewX(-6deg);
  border: 2px solid rgba(183, 202, 219, .5);
  background: #2b3a46;
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, .025);
}

.vision-defect {
  position: absolute;
  width: 54px;
  height: 38px;
  border: 2px solid #e66f78;
}

.vision-defect::after {
  content: attr(data-label);
  position: absolute;
  left: -2px;
  bottom: calc(100% + 5px);
  padding: .2rem .35rem;
  background: #d75c68;
  color: #fff;
  font-size: .56rem;
  font-weight: 850;
  white-space: nowrap;
}

.vision-defect--one { top: 34%; left: 31%; }
.vision-defect--two { right: 26%; bottom: 30%; width: 42px; }

.vision-readout {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  background: #14222e;
}

.vision-readout strong {
  display: block;
  margin-bottom: 1rem;
  color: #f4f8fb;
  font-size: 1.5rem;
}

.vision-readout dl { margin: 0; }
.vision-readout dl div { display: flex; justify-content: space-between; gap: .6rem; padding: .65rem 0; border-top: 1px solid rgba(255,255,255,.08); }
.vision-readout dt { color: rgba(235,241,246,.4); font-size: .66rem; }
.vision-readout dd { margin: 0; color: rgba(245,248,250,.72); font-size: .68rem; font-weight: 850; }

@media (max-width: 900px) {
  .demo-heading,
  .demo-screen,
  .project-demo {
    grid-template-columns: 1fr;
  }
  .demo-sidebar,
  .project-brief {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
  }
  .demo-sidebar {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    overflow-x: auto;
  }
  .demo-sidebar__title { grid-column: 1 / -1; margin-bottom: 0; }
  .project-sources { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .demo-wrap { width: min(100% - 28px, 1180px); }
  .demo-heading { grid-template-columns: 1fr; }
  .demo-heading h2 { font-size: clamp(2rem, 11vw, 3rem) !important; }
  .demo-tab { min-width: 148px; }
  .demo-windowbar__status { display: none; }
  .demo-screen { min-height: auto; }
  .demo-main { padding: 18px 14px; }
  .demo-mainhead { display: grid; }
  .demo-metrics { grid-template-columns: 1fr; }
  .demo-metric { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .demo-metric:last-child { border-bottom: 0; }
  .demo-content-grid,
  .vision-layout { grid-template-columns: 1fr; }
  .demo-progress-row { grid-template-columns: 78px 1fr 42px; }
  .project-output { padding: 22px 14px; }
  .project-sources { grid-template-columns: 1fr; }
  .agent-flow { grid-template-columns: 1fr 1fr; }
  .agent-node:not(:last-child)::after { display: none; }
  .agent-log__row { grid-template-columns: 52px 1fr; }
  .agent-log__row span:last-child { grid-column: 2; }
  .vision-feed { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-panel { animation: none; }
  .demo-tab,
  .demo-bars i { transition: none; }
}
