/* Device Performance Monitor — the stages stage.css does not ship.
   Everything here reads the palette variables, so the page retints as one. */

code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.92em;
  color: var(--accent-text);
}

/* ── the hero rig: a phone wired into a live readout ─────────────────── */

.rig {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  max-width: 880px;
  margin: 18px auto 10px;
}

.rig-phone {
  position: relative;
  width: 178px;
  height: 356px;
  border-radius: 30px;
  padding: 9px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.04));
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.95), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.rig-notch {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 54px;
  height: 7px;
  margin-left: -27px;
  border-radius: 99px;
  background: rgb(0 0 0 / 0.65);
  z-index: 2;
}

.rig-phone.is-android { border-radius: 22px; }
.rig-phone.is-android .rig-notch { top: 18px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; }
.rig-phone.is-android .rig-screen { border-radius: 16px; }

.rig-phone.is-iphone { border-radius: 38px; }
.rig-phone.is-iphone .rig-notch { top: 16px; width: 62px; height: 18px; margin-left: -31px; }
.rig-phone.is-iphone .rig-screen { border-radius: 31px; padding-top: 42px; }

/* A simulator is a window on your Mac, so it wears a window's chrome. */
.rig-phone.is-simulator { border-radius: 16px; padding-top: 26px; }
.rig-phone.is-simulator::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 26px;
  border-radius: 16px 16px 0 0;
  background: rgb(255 255 255 / 0.07);
}
.rig-phone.is-simulator .rig-notch {
  top: 10px;
  left: 15px;
  margin-left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 11px 0 0 #febc2e, 22px 0 0 #28c840;
}
.rig-phone.is-simulator .rig-screen { border-radius: 10px; padding-top: 16px; }

.rig-screen {
  position: relative;
  height: 100%;
  border-radius: 23px;
  padding: 30px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  background: linear-gradient(170deg, #121428, #090a16 60%);
}

.rig-screen-name {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}

.rig-row { height: 9px; border-radius: 5px; background: rgb(255 255 255 / 0.1); }
.rig-row.w55 { width: 55%; }
.rig-row.w70 { width: 70%; }
.rig-row.w80 { width: 80%; }
.rig-row.w90 { width: 90%; }
.rig-card { flex: 1; border-radius: 12px; background: linear-gradient(150deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.03)); }

.rig-panel { min-width: 0; text-align: left; }

.rig-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.rig-chips button {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.04);
  color: var(--pal-text2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rig-chips button:hover { color: #fff; border-color: rgb(255 255 255 / 0.3); }
.rig-chips button.on {
  background: color-mix(in srgb, var(--pal-accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--pal-accent) 55%, transparent);
  color: #fff;
}

.rig-device {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 13px 0 12px;
  font-size: 13px;
  color: var(--pal-text3);
}

.rig-device b { color: var(--pal-text); font-weight: 600; }
.rig-device span[data-rig-serial] { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

.rig-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fd27f;
  box-shadow: 0 0 0 0 rgb(47 210 127 / 0.5);
  animation: chart-pulse 2s ease-out infinite;
}

.rig-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rig-tiles li {
  position: relative;
  padding: 11px 13px 8px;
  border-radius: 14px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.035);
  overflow: hidden;
}

.rig-label { display: block; font-size: 11px; color: var(--pal-text3); }
.rig-tiles b { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rig-unit { margin-left: 3px; font-size: 11.5px; color: var(--pal-text3); }
.rig-spark { display: block; width: 100%; height: 26px; margin-top: 2px; opacity: 0.9; }

.rig-tiles li.off { opacity: 0.52; }
.rig-tiles li.off b { color: var(--pal-text3); font-size: 13px; font-weight: 500; }
.rig-tiles li.off .rig-spark, .rig-tiles li.off .rig-unit { display: none; }

.rig-foot { margin: 12px 0 0; font-size: 12.5px; color: var(--pal-text3); }

@media (max-width: 860px) {
  .rig { grid-template-columns: 1fr; justify-items: center; gap: 26px; }
  .rig-panel { width: 100%; max-width: 420px; }
  .rig-phone { width: 150px; height: 300px; }
}

/* ── the animated tool demos ──────────────────────────────────────────── */

.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.demo-card {
  padding: 0 0 18px;
  border-radius: 18px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.03);
  overflow: hidden;
}

.demo-card h3 { margin: 16px 18px 4px; font-size: 16px; font-weight: 650; }
.demo-card p { margin: 0 18px; font-size: 13.5px; line-height: 1.55; color: var(--pal-text2); }

.demo {
  position: relative;
  height: 128px;
  margin: 0;
  padding: 14px;
  overflow: hidden;
  background: linear-gradient(165deg, rgb(255 255 255 / 0.05), rgb(0 0 0 / 0.25));
  border-bottom: 1px solid var(--pal-rule);
}

/* each loop only runs while its section is on screen */
.sec:not(.live) .demo * { animation-play-state: paused !important; }

/* bundle — a treemap settling */
.demo-bundle { display: grid; grid-template-columns: 1.6fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.demo-bundle .b { border-radius: 7px; background: linear-gradient(150deg, #7FB4FF, #3C67C4); opacity: 0; transform: scale(0.82); animation: tm 5s ease-in-out infinite; }
.demo-bundle .b1 { grid-row: span 2; }
.demo-bundle .b2 { background: linear-gradient(150deg, #B58BFF, #6A40C8); animation-delay: 0.12s; }
.demo-bundle .b3 { background: linear-gradient(150deg, #5BE7B0, #1D8E6A); animation-delay: 0.24s; }
.demo-bundle .b4 { background: linear-gradient(150deg, #FFC46B, #C07C12); animation-delay: 0.36s; }
.demo-bundle .b5 { background: linear-gradient(150deg, #FF8AB0, #C0356B); animation-delay: 0.48s; }
.demo-bundle .b6 { background: linear-gradient(150deg, #8FA2C8, #4B5A7A); animation-delay: 0.6s; }

@keyframes tm {
  0%, 6% { opacity: 0; transform: scale(0.82); }
  18%, 86% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* startup — launches racing */
.demo-startup { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.demo-startup .run { display: flex; align-items: center; gap: 10px; }
.demo-startup i { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #FFC46B, #FF8AB0); width: 0; animation: race 4.4s cubic-bezier(.2,.8,.3,1) infinite; }
.demo-startup .run:nth-child(2) i { animation-delay: 0.25s; }
.demo-startup .run:nth-child(3) i { animation-delay: 0.5s; }
.demo-startup em { flex: none; font-style: normal; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--pal-text3); opacity: 0; animation: ms 4.4s ease infinite; }
.demo-startup .run i { flex: 0 1 auto; min-width: 0; }
.demo-startup .run:nth-child(2) em { animation-delay: 0.25s; }
.demo-startup .run:nth-child(3) em { animation-delay: 0.5s; }

@keyframes race { 0%, 4% { width: 0; } 34%, 88% { width: var(--w); } 100% { width: 0; } }
@keyframes ms { 0%, 30% { opacity: 0; } 40%, 88% { opacity: 1; } 100% { opacity: 0; } }

/* benchmark — a distribution with the p95 marker landing */
.demo-bench { display: flex; align-items: flex-end; gap: 5px; padding-bottom: 20px; }
.demo-bench .bar { flex: 1; height: var(--h); border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #5BE7B0, rgb(91 231 176 / 0.25)); transform-origin: bottom; transform: scaleY(0.1); animation: grow 5s ease-in-out infinite; }
.demo-bench .bar:nth-child(2) { animation-delay: 0.07s; }
.demo-bench .bar:nth-child(3) { animation-delay: 0.14s; }
.demo-bench .bar:nth-child(4) { animation-delay: 0.21s; }
.demo-bench .bar:nth-child(5) { animation-delay: 0.28s; }
.demo-bench .bar:nth-child(6) { animation-delay: 0.35s; }
.demo-bench .bar:nth-child(7) { animation-delay: 0.42s; }
.demo-bench .bar:nth-child(8) { animation-delay: 0.49s; }
.demo-bench .p95 { position: absolute; left: 14px; right: 14px; bottom: 14px; border-top: 1.5px dashed rgb(255 255 255 / 0.4); opacity: 0; animation: p95in 5s ease infinite; }
.demo-bench .p95 em { position: absolute; right: 0; top: -17px; font-style: normal; font-size: 10.5px; color: var(--pal-text3); }

@keyframes grow { 0%, 8% { transform: scaleY(0.1); } 30%, 86% { transform: scaleY(1); } 100% { transform: scaleY(0.1); } }
@keyframes p95in { 0%, 40% { opacity: 0; bottom: 14px; } 56%, 86% { opacity: 1; bottom: 78px; } 100% { opacity: 0; bottom: 78px; } }

/* jank — frames scrolling past, the slow ones in red */
.demo-jank { display: flex; align-items: flex-end; }
.demo-jank .track { display: flex; align-items: flex-end; gap: 4px; height: 76px; animation: slide 9s linear infinite; }
.demo-jank .track i { width: 7px; height: 26px; border-radius: 3px; background: rgb(124 212 255 / 0.55); }
.demo-jank .track i:nth-child(3n) { height: 34px; }
.demo-jank .track i:nth-child(4n) { height: 20px; }
.demo-jank .track i.bad { height: 72px; background: linear-gradient(180deg, #FF7A7A, rgb(255 122 122 / 0.35)); }
.demo-jank .line { position: absolute; left: 14px; right: 14px; bottom: 48px; border-top: 1.5px dashed rgb(255 255 255 / 0.22); }

@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-132px); } }

/* battery — a cell draining while the temperature climbs */
.demo-battery { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.demo-battery .cell { position: relative; width: 74px; height: 30px; border-radius: 7px; border: 2px solid rgb(255 255 255 / 0.3); padding: 3px; }
.demo-battery .cell::after { content: ""; position: absolute; right: -6px; top: 9px; width: 4px; height: 10px; border-radius: 0 2px 2px 0; background: rgb(255 255 255 / 0.3); }
.demo-battery .cell i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #5BE7B0, #FFC46B); animation: drain 6s ease-in-out infinite; }
.demo-battery svg { width: 100%; height: 40px; }
.demo-battery svg path { stroke-dasharray: 150; stroke-dashoffset: 150; animation: draw 6s ease-in-out infinite; }
.demo-battery em { position: absolute; right: 14px; top: 16px; font-style: normal; font-size: 12px; color: #FF8AB0; opacity: 0; animation: ms 6s ease infinite; }

@keyframes drain { 0%, 8% { width: 100%; } 86%, 100% { width: 22%; } }
@keyframes draw { 0%, 6% { stroke-dashoffset: 150; } 70%, 100% { stroke-dashoffset: 0; } }

/* logs — a feed scrolling up */
.demo-logs { padding: 0; }
.demo-logs .feed { display: block; padding: 10px 14px; animation: feed 11s linear infinite; }
.demo-logs i {
  display: block;
  font-style: normal;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 2;
  color: var(--pal-text2);
  white-space: nowrap;
}
.demo-logs b { display: inline-block; width: 15px; font-weight: 700; }
.demo-logs .e { color: #FF7A7A; }
.demo-logs .w { color: #FFC46B; }
.demo-logs .i { color: #7CD4FF; }
.demo-logs .d { color: var(--pal-text3); }

@keyframes feed { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* ai — a verdict typing itself */
.demo-ai { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.demo-ai .verdict { display: flex; flex-direction: column; gap: 7px; }
.demo-ai .verdict b { font-size: 14px; color: #C79BFF; }
.demo-ai .typing { height: 8px; border-radius: 4px; background: rgb(255 255 255 / 0.16); width: 0; animation: type 5s steps(28) infinite; }
.demo-ai .chips { display: flex; gap: 6px; }
.demo-ai .chips i { font-style: normal; font-size: 10.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--pal-border); color: var(--pal-text3); opacity: 0; animation: ms 5s ease infinite; }
.demo-ai .chips i:nth-child(2) { animation-delay: 0.3s; }
.demo-ai .chips i:nth-child(3) { animation-delay: 0.6s; }

@keyframes type { 0%, 4% { width: 0; } 50%, 86% { width: 86%; } 100% { width: 0; } }

/* alerts — a reading crossing the ceiling, then the notification */
.demo-alert svg { width: 100%; height: 60px; }
.demo-alert svg path { stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw 6s ease-in-out infinite; }
.demo-alert .toast {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgb(18 16 30 / 0.95);
  border: 1px solid rgb(255 196 107 / 0.45);
  font-size: 11.5px;
  opacity: 0;
  transform: translateY(8px);
  animation: toast 6s ease infinite;
}

@keyframes toast {
  0%, 56% { opacity: 0; transform: translateY(8px); }
  66%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1100px) { .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .demo-grid { grid-template-columns: 1fr; } }

/* A frozen demo has to show its end state, or a screenshot and a
   reduced-motion visitor both get an empty box. */
.static .demo-startup i, .rm .demo-startup i { width: var(--w); }
.static .demo-bench .bar, .rm .demo-bench .bar { transform: none; }
.static .demo-bench .p95, .rm .demo-bench .p95 { opacity: 1; bottom: 78px; }
.static .demo-bundle .b, .rm .demo-bundle .b { opacity: 1; transform: none; }
.static .demo-ai .typing, .rm .demo-ai .typing { width: 86%; }
.static :is(.demo-ai .chips i, .demo-startup em, .demo-battery em),
.rm :is(.demo-ai .chips i, .demo-startup em, .demo-battery em) { opacity: 1; }
.static :is(.demo-battery svg path, .demo-alert svg path),
.rm :is(.demo-battery svg path, .demo-alert svg path) { stroke-dashoffset: 0; }
.static .demo-battery .cell i, .rm .demo-battery .cell i { width: 34%; }
.static .demo-alert .toast, .rm .demo-alert .toast { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .demo * { animation: none !important; }
  .demo-startup i { width: var(--w); }
  .demo-bench .bar { transform: none; }
  .demo-bench .p95 { opacity: 1; bottom: 78px; }
  .demo-bundle .b { opacity: 1; transform: none; }
  .demo-ai .typing { width: 86%; }
  .demo-ai .chips i, .demo-startup em, .demo-battery em { opacity: 1; }
  .demo-battery svg path, .demo-alert svg path { stroke-dashoffset: 0; }
  .demo-battery .cell i { width: 34%; }
  .demo-alert .toast { opacity: 1; transform: none; }
}

/* ── the platform matrix ──────────────────────────────────────────────── */

.matrix {
  border: 1px solid var(--pal-border);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.03);
  padding: 8px 22px 18px;
  overflow-x: auto;
}

.matrix table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

.matrix th[scope="col"] {
  padding: 14px 10px 10px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pal-text3);
  border-bottom: 1px solid var(--pal-border);
}

.matrix th[scope="col"]:first-child { text-align: left; }

.matrix th[scope="row"] {
  padding: 11px 10px;
  text-align: left;
  font-weight: 550;
  color: var(--pal-text);
  border-bottom: 1px solid var(--pal-rule);
  white-space: nowrap;
}

.matrix th[scope="row"] em {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--pal-text3);
}

.matrix td {
  padding: 11px 10px;
  text-align: center;
  border-bottom: 1px solid var(--pal-rule);
  font-size: 15px;
}

.matrix td.y { color: #4fd98a; }
.matrix td.n { color: rgb(255 255 255 / 0.26); }
.matrix tr:last-child :is(th, td) { border-bottom: 0; }
.matrix-note { margin: 14px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--pal-text3); }

@media (max-width: 640px) {
  .matrix th[scope="row"] { white-space: normal; }
  .matrix th[scope="row"] em { display: block; margin: 2px 0 0; }
}

/* ── the session chart ────────────────────────────────────────────────── */

.appwin {
  max-width: 940px;
  margin: 0 auto 46px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--pal-border);
  background: linear-gradient(170deg, #1a1226, #120d1d 55%, #0d0a16);
  box-shadow: 0 44px 90px -46px rgb(0 0 0 / 0.95);
  text-align: left;
}

.appwin-bar { display: flex; gap: 7px; padding: 12px 14px 0; }
.appwin-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgb(255 255 255 / 0.16); }
.appwin-bar span:first-child { background: #ff5f57; }
.appwin-bar span:nth-child(2) { background: #febc2e; }
.appwin-bar span:nth-child(3) { background: #28c840; }

.appwin-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px; }

.appwin-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, #2fd27f, #0b7a5e);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
}

.appwin-name { display: flex; flex-direction: column; line-height: 1.25; }
.appwin-name b { font-size: 17px; font-weight: 650; }
.appwin-name i { font-style: normal; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: var(--pal-text3); }
.appwin-status { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.appwin-chip,
.appwin-live {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--pal-border);
  color: var(--pal-text2);
}

.appwin-live { display: inline-flex; align-items: center; gap: 6px; color: #8af0bb; border-color: rgb(47 210 127 / 0.4); }
.appwin-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2fd27f; animation: chart-pulse 2s ease-out infinite; }
.appwin-live.done::before { animation: none; }

.appwin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 18px 14px; }

.appwin-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgb(255 255 255 / 0.05); }
.appwin-seg i { font-style: normal; padding: 4px 10px; border-radius: 7px; font-size: 11.5px; color: var(--pal-text3); }
.appwin-seg i.on { background: color-mix(in srgb, var(--pal-accent) 26%, transparent); color: #fff; }

.appwin-pill,
.appwin-acts i {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.04);
  font-size: 11.5px;
  color: var(--pal-text2);
  font-style: normal;
}

.appwin-acts { margin-left: auto; display: inline-flex; gap: 6px; }
.appwin-acts i.stop { color: #fff; }

.appwin-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 18px 14px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgb(255 122 122 / 0.35);
  background: linear-gradient(90deg, rgb(255 90 110 / 0.18), rgb(255 90 110 / 0.04));
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.appwin-banner.show { opacity: 1; transform: none; }
.appwin-banner b { font-size: 13.5px; }
.appwin-banner span { font-size: 12px; color: var(--pal-text2); }

.appwin-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 18px 14px;
  padding: 0;
  list-style: none;
}

.appwin-tiles li {
  padding: 10px 13px 11px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  border: 1px solid var(--pal-rule);
}

.appwin-tiles span { display: block; font-size: 11px; color: var(--pal-text3); }
.appwin-tiles b { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.appwin-tiles i { font-style: normal; margin-left: 3px; font-size: 11px; color: var(--pal-text3); }

.appwin-panel { margin: 0 18px 18px; padding: 14px; border-radius: 14px; background: rgb(255 255 255 / 0.03); }
.appwin-panel-head { display: flex; flex-direction: column; margin-bottom: 10px; }
.appwin-panel-head b { font-size: 14px; }
.appwin-panel-head span { font-size: 11.5px; color: var(--pal-text3); }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.chart-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--pal-text);
}

.chart-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(160deg, #2fd27f, #0b7a5e);
}

.chart-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--pal-text2);
  background: var(--pal-chip);
  border: 1px solid var(--pal-border);
}

.chart-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fd27f;
  box-shadow: 0 0 0 0 rgb(47 210 127 / 0.5);
  animation: chart-pulse 2s ease-out infinite;
}

.chart-live.done::before {
  animation: none;
}

@keyframes chart-pulse {
  70% { box-shadow: 0 0 0 7px rgb(47 210 127 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(47 210 127 / 0); }
}

.chart-plot {
  position: relative;
  border-radius: 14px;
  background: rgb(0 0 0 / 0.26);
  border: 1px solid var(--pal-rule);
  overflow: hidden;
  cursor: crosshair;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 260px;
}

.chart-bandrow {
  position: absolute;
  inset: 8px 0 auto 0;
  height: 16px;
  pointer-events: none;
}

.chart-bandrow span {
  position: absolute;
  top: 0;
  padding-left: 8px;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--pal-text3);
  white-space: nowrap;
  overflow: hidden;
}

.chart-readout {
  position: absolute;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgb(10 10 20 / 0.92);
  border: 1px solid var(--pal-border);
  pointer-events: none;
  transform: translateX(-50%);
}

.chart-readout[hidden] { display: none; }
.chart-readout b { font-size: 14px; color: var(--pal-text); }
.chart-readout span { font-size: 11px; color: var(--pal-text3); }

.chart-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.chart-stats li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.03);
}

.chart-stats span {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pal-text3);
}

.chart-stats b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--pal-text);
}

/* ── the terminal ─────────────────────────────────────────────────────── */

.term {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pal-border);
  background: rgb(6 6 14 / 0.92);
  box-shadow: 0 34px 80px -44px rgb(0 0 0 / 0.95);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pal-rule);
  background: rgb(255 255 255 / 0.04);
}

.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgb(255 255 255 / 0.18); }
.term-bar span:first-child { background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { margin-left: 8px; font-style: normal; font-size: 12px; color: var(--pal-text3); }

.term-body {
  height: 300px;
  overflow: auto;
  padding: 14px 16px 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: rgb(255 255 255 / 0.9);
}

.term-line { white-space: pre; }
.term-line.cmd { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line.cmd { color: #fff; }
.term-line.dim { color: rgb(255 255 255 / 0.5); }
.term-line.bad { color: #ff7a7a; }
.term-line.good { color: #4fd98a; }

.term-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--pal-rule);
}

.term-prompt { color: var(--pal-accent); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

.term-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 13px;
}

.term-input input::placeholder { color: rgb(255 255 255 / 0.3); }
.term-input:focus-within { background: rgb(255 255 255 / 0.03); }

/* ── agent prompts ────────────────────────────────────────────────────── */

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.prompt-card {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.03);
}

.prompt-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.prompt-card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--pal-text2); }

/* ── the brew line in the closing band ────────────────────────────────── */

.brew {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 640px;
  margin: 20px auto 0;
  padding: 11px 12px 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--pal-border);
  background: rgb(0 0 0 / 0.3);
  text-align: left;
}

.brew code { color: #fff; font-size: 12.5px; overflow-wrap: anywhere; }

.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--pal-border);
  background: rgb(255 255 255 / 0.08);
  color: rgb(255 255 255 / 0.85);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover { background: rgb(255 255 255 / 0.15); }
.copy-btn.copied { color: #4fd98a; border-color: rgb(79 217 138 / 0.45); }

@media (max-width: 900px) {
  .chart-stats, .appwin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appwin-acts { display: none; }
  .term-body { height: 250px; }
}

@media (max-width: 560px) {
  .chart-bandrow { display: none; }
  .brew { flex-direction: column; align-items: stretch; }
}

/* ── the one real window shot ─────────────────────────────────────────── */

.shot {
  margin: 0;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pal-border);
  box-shadow: 0 40px 90px -46px rgb(0 0 0 / 0.95);
  background: rgb(0 0 0 / 0.3);
}

.shot img { display: block; width: 100%; height: auto; }

.rig-tiles.swapping li { animation: rig-swap 0.24s ease; }

@keyframes rig-swap {
  0% { opacity: 0.25; transform: translateY(4px); }
  100% { opacity: 1; transform: none; }
}

.rig-cmd {
  margin: 12px 0 0;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgb(0 0 0 / 0.32);
  border: 1px solid var(--pal-rule);
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 11.5px;
  color: var(--pal-text2);
  overflow-wrap: anywhere;
}

.rig-cmd::before { content: "$ "; color: var(--pal-accent); }
