/* Homepage product demo. Kept separate so the interactive editor cannot render without its matching styles. */
.hero:has(.product-demo) {
  grid-template-columns: minmax(300px, 0.62fr) minmax(760px, 1.55fr);
  max-width: 1560px;
  gap: 34px;
  align-items: start;
  padding-top: 88px;
}
.hero:has(.product-demo) h1 {
  max-width: 680px;
  font-size: clamp(3.2rem, 5.5vw, 5.7rem);
}

.product-demo {
  --app-window: #0d1513;
  --app-workspace: #111b18;
  --app-surface: #172521;
  --app-surface-alt: #1d2e29;
  --app-input: #09110f;
  --app-hover: #243a33;
  --app-pressed: #2c4a40;
  --app-border: #2f4a42;
  --app-border-strong: #477265;
  --app-text: #e1f3ec;
  --app-muted: #94b8aa;
  --app-accent: #4bd2a0;
  --app-accent-soft: #245440;
  --app-success: #71df9d;
  --app-danger: #ff7d73;
  --app-keyboard: #7db8ed;
  --app-delay: #e4c66e;
  --app-image: #ff8f9c;
  --app-screen: #5fdbd0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--app-border-strong);
  border-radius: 10px;
  background: var(--app-window);
  color: var(--app-text);
  box-shadow: 0 36px 95px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(75, 210, 160, 0.08);
  font-family: "Segoe UI", Inter, sans-serif;
  font-size: 10px;
  line-height: 1.3;
  transform: perspective(1600px) rotateY(-2deg) rotateX(1deg);
  transition: border-color 0.25s ease, box-shadow 0.35s ease, transform 0.45s ease;
}
.product-demo:hover {
  border-color: #5c8d7e;
  box-shadow: 0 42px 115px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(75, 210, 160, 0.13);
  transform: perspective(1600px) rotateY(0) rotateX(0) translateY(-3px);
}
.product-demo *,
.product-demo *::before,
.product-demo *::after {
  box-sizing: border-box;
}
.product-demo button {
  appearance: none;
  width: auto;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.product-demo button:focus-visible {
  outline: 1px solid var(--app-accent);
  outline-offset: -1px;
}
.product-demo svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-demo .fill-danger { fill: #d84d5d; stroke: #d84d5d; }
.product-demo .fill-success { fill: #4dc883; stroke: #4dc883; }
.product-demo .fill-muted { fill: #78948a; stroke: #78948a; }
.product-demo .fill-blue { fill: #6a9ed7; stroke: #6a9ed7; }

.product-titlebar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--app-border);
  background: #101c19;
  color: var(--app-muted);
}
.product-logo {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--app-accent);
  border-radius: 4px;
  color: var(--app-accent);
  font-size: 8px;
  font-weight: 900;
  box-shadow: inset 0 0 7px rgba(75, 210, 160, 0.18);
}
.product-titlebar strong {
  color: var(--app-text);
  font-size: 9px;
  font-weight: 650;
}
.product-file {
  overflow: hidden;
  padding-left: 6px;
  color: #76958a;
  font-size: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-window-buttons { display: flex; gap: 9px; align-items: center; }
.product-window-buttons i { width: 7px; height: 7px; border-radius: 50%; background: #36574d; }
.product-window-buttons i:last-child { background: #b3525a; }

.product-menubar {
  display: flex;
  gap: 1px;
  align-items: center;
  min-height: 25px;
  padding: 2px 4px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
}
.product-menubar > span {
  padding: 4px 7px;
  border-radius: 4px;
}
.product-menubar > span:hover { background: var(--app-hover); }
.product-menubar b {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(75, 210, 160, 0.2);
  border-radius: 99px;
  background: rgba(75, 210, 160, 0.07);
  color: var(--app-accent);
  font-size: 8px;
  font-weight: 700;
}
.product-menubar b i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(75, 210, 160, 0.11);
  animation: product-pulse 1.8s ease-in-out infinite;
}

.product-toolbar {
  position: relative;
  display: flex;
  gap: 2px;
  align-items: center;
  min-height: 35px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}
.product-toolbar > button {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 27px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #d8efe7;
  transition: 0.16s ease;
}
.product-toolbar > button:hover,
.product-toolbar > button.is-active {
  border-color: var(--app-border-strong);
  background: var(--app-hover);
}
.product-toolbar > button.is-primary {
  border-color: rgba(113, 223, 157, 0.22);
  background: rgba(113, 223, 157, 0.06);
}
.product-toolbar > button.is-primary:hover {
  border-color: var(--app-success);
  background: rgba(113, 223, 157, 0.13);
}
.product-toolbar > button > span {
  position: absolute;
  z-index: 8;
  top: 32px;
  left: 50%;
  padding: 4px 6px;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  background: #07100d;
  color: var(--app-text);
  font-size: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: 0.15s ease;
  white-space: nowrap;
}
.product-toolbar > button:hover > span { opacity: 1; transform: translate(-50%, 0); }
.product-toolbar > i {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--app-border);
}
.product-play-prompt {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid rgba(75, 210, 160, 0.22);
  border-radius: 6px;
  background: linear-gradient(120deg, rgba(75, 210, 160, 0.12), rgba(75, 210, 160, 0.03));
  color: var(--app-muted);
  font-size: 8px;
}
.product-play-prompt span { color: var(--app-accent); font-weight: 800; }
.product-play-prompt::before {
  color: var(--app-accent);
  content: "\2190";
  animation: product-nudge 1.3s ease-in-out infinite;
}
.product-demo[data-state="running"] .product-play-prompt {
  border-color: rgba(113, 223, 157, 0.36);
  color: var(--app-success);
}
.product-demo[data-state="running"] .product-play-prompt::before { content: "\25B6"; animation: none; }
.product-demo[data-state="running"] .product-play-prompt span { display: none; }

.product-main {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  min-height: 390px;
  background: var(--app-workspace);
}
.product-insertbar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  padding: 5px 3px;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface-alt);
}
.product-insertbar button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--app-muted);
  transition: 0.16s ease;
}
.product-insertbar button:hover {
  border-color: var(--app-border-strong);
  background: var(--app-hover);
  color: var(--app-accent);
  transform: translateX(1px);
}
.product-insertbar button:nth-of-type(1) { color: var(--app-success); }
.product-insertbar button:nth-of-type(2) { color: var(--app-keyboard); }
.product-insertbar button:nth-of-type(3) { color: var(--app-delay); }
.product-insertbar button:nth-of-type(4) { color: var(--app-image); }
.product-insertbar button:nth-of-type(5) { color: var(--app-screen); }
.product-insertbar > span {
  width: 22px;
  height: 1px;
  margin: 3px 0;
  background: var(--app-border);
}
.product-editor {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  padding: 6px 7px 7px;
  background: var(--app-workspace);
}
.product-workspacebar {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) minmax(105px, 0.5fr);
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding-bottom: 5px;
}
.product-workspacebar button,
.product-workspacebar strong,
.product-workspacebar > span {
  min-height: 22px;
  padding: 5px 7px;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
}
.product-workspacebar button {
  background: var(--app-accent-soft);
  color: var(--app-text);
  font-size: 8px;
  font-weight: 800;
}
.product-workspacebar label { color: var(--app-muted); font-size: 8px; font-weight: 650; }
.product-workspacebar strong {
  overflow: hidden;
  background: var(--app-input);
  color: var(--app-text);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-workspacebar > span {
  background: var(--app-surface-alt);
  color: #6f9185;
  font-size: 8px;
}
.product-scenarios {
  display: flex;
  gap: 4px;
  padding: 0 0 5px;
}
.product-scenarios button {
  padding: 4px 7px;
  border: 1px solid var(--app-border);
  border-radius: 4px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 8px;
  transition: 0.15s ease;
}
.product-scenarios button:hover,
.product-scenarios button.is-active {
  border-color: var(--app-border-strong);
  background: var(--app-hover);
  color: var(--app-text);
}
.product-scenarios button.is-active { color: var(--app-accent); }

.product-grid {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
  background: var(--app-input);
}
.product-grid-head,
.product-command-row {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) minmax(100px, 1fr) minmax(130px, 1.25fr) minmax(85px, 0.8fr);
  align-items: center;
}
.product-grid-head {
  min-height: 25px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-alt);
  color: var(--app-muted);
  font-size: 8px;
  font-weight: 650;
}
.product-grid-head span,
.product-command-row > span,
.product-command-row > b {
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-command-row {
  position: relative;
  width: 100%;
  min-height: 25px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  text-align: left;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.product-command-row:hover { background: var(--app-hover); }
.product-command-row.is-current {
  background: var(--app-accent-soft);
  color: #f1fff9;
}
.product-command-row.is-current::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 2px;
  border-radius: 0 99px 99px 0;
  background: var(--app-accent);
  content: "";
  box-shadow: 0 0 10px rgba(75, 210, 160, 0.8);
}
.product-command-row.is-complete:not(.is-current) { opacity: 0.6; }
.product-command-row.is-complete:not(.is-current)::after {
  position: absolute;
  right: 6px;
  color: var(--app-success);
  content: "\2713";
  font-weight: 900;
}
.product-command-row b {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--app-accent);
  font-size: 8px;
  font-weight: 750;
}
.product-command-row b svg { flex: 0 0 14px; width: 14px; height: 14px; }
.product-command-row.mouse b { color: var(--app-success); }
.product-command-row.keyboard b { color: var(--app-keyboard); }
.product-command-row.wait b { color: var(--app-delay); }
.product-command-row.image b { color: var(--app-image); }
.product-command-row.screen b { color: var(--app-screen); }
.product-command-row span { color: var(--app-muted); font-size: 8px; }
.product-command-row span:nth-child(2) { color: inherit; }
.product-empty-lines { position: absolute; z-index: 0; inset: 125px 0 0; pointer-events: none; }
.product-empty-lines i { display: block; height: 25px; border-bottom: 1px solid rgba(47, 74, 66, 0.72); }

.product-replay {
  position: absolute;
  z-index: 4;
  right: 13px;
  bottom: 14px;
  width: min(275px, 43%);
  overflow: hidden;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  background: var(--app-surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  opacity: 0.93;
  transform: translateY(0);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
.product-demo[data-state="running"] .product-replay,
.product-replay:hover {
  border-color: var(--app-accent);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.52), 0 0 0 3px rgba(75, 210, 160, 0.08);
  opacity: 1;
  transform: translateY(-2px);
}
.product-replay-title {
  display: flex;
  justify-content: space-between;
  padding: 5px 7px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-alt);
  color: var(--app-muted);
  font-size: 7px;
}
.product-replay-title b { color: var(--app-success); font-weight: 700; }
.product-replay-body {
  position: relative;
  min-height: 142px;
  padding: 14px 14px 12px;
  background: radial-gradient(circle at 100% 0, rgba(75, 210, 160, 0.12), transparent 45%), var(--app-surface);
}
.product-replay-body > span {
  color: var(--app-accent);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.product-replay h3 {
  margin: 3px 0 11px;
  color: var(--app-text);
  font-size: 12px;
  letter-spacing: -0.02em;
}
.product-replay label {
  display: grid;
  gap: 3px;
  color: var(--app-muted);
  font-size: 7px;
}
.product-replay input {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  outline: 0;
  background: var(--app-input);
  color: var(--app-text);
  font: inherit;
  font-size: 8px;
  transition: 0.18s ease;
}
.product-replay > .product-replay-body > button {
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid var(--app-accent);
  border-radius: 4px;
  background: var(--app-accent);
  color: #07100d;
  font-size: 8px;
  font-weight: 800;
  transition: 0.14s ease;
}
.product-replay > .product-replay-body > button.is-clicked {
  box-shadow: 0 0 0 5px rgba(75, 210, 160, 0.13);
  transform: scale(0.96);
}
.product-replay-result {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 3px 5px;
  border: 1px solid rgba(113, 223, 157, 0.28);
  border-radius: 99px;
  background: rgba(9, 17, 15, 0.86);
  color: var(--app-muted);
  font-size: 7px;
  opacity: 0;
  transform: translateY(4px);
  transition: 0.2s ease;
}
.product-replay-result i { width: 4px; height: 4px; border-radius: 50%; background: var(--app-success); }
.product-replay-result.is-visible { opacity: 1; transform: translateY(0); }
.product-replay-body.is-focused input {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 2px rgba(75, 210, 160, 0.09);
}
.product-replay-body.is-finding::after {
  position: absolute;
  z-index: 3;
  inset: 4px;
  border: 1px solid var(--app-accent);
  border-radius: 5px;
  content: "";
  animation: product-scan 0.75s ease-in-out infinite alternate;
  pointer-events: none;
}
.demo-cursor {
  position: absolute;
  z-index: 8;
  width: 12px;
  height: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-2px, -2px) rotate(-12deg);
  transition: top 0.5s cubic-bezier(0.2, 0.9, 0.25, 1), left 0.5s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.12s ease, transform 0.12s ease;
}
.demo-cursor::before {
  display: block;
  width: 0;
  height: 0;
  border-top: 13px solid white;
  border-right: 8px solid transparent;
  content: "";
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.65));
}
.demo-cursor.is-visible { opacity: 1; }
.demo-cursor.is-clicking { transform: translate(-2px, -2px) rotate(-12deg) scale(0.78); }

.product-statusbar {
  display: grid;
  grid-template-columns: auto auto auto minmax(160px, 1fr) 74px;
  align-items: center;
  min-height: 23px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-muted);
}
.product-statusbar > strong,
.product-statusbar > span {
  overflow: hidden;
  padding: 4px 7px;
  border-right: 1px solid var(--app-border);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-statusbar > strong { color: var(--app-success); font-weight: 700; }
.product-statusbar > div {
  overflow: hidden;
  height: 3px;
  margin: 0 7px;
  border-radius: 99px;
  background: var(--app-border);
}
.product-statusbar > div i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--app-accent);
  transition: width 0.25s ease;
}

.product-dialog-layer {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.product-dialog-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}
.product-dialog-backdrop {
  position: absolute;
  inset: 0;
  width: 100% !important;
  background: rgba(3, 8, 7, 0.7) !important;
  backdrop-filter: blur(2px);
}
.product-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(510px, calc(100% - 8px));
  max-height: calc(100% - 8px);
  overflow: hidden;
  border: 1px solid var(--app-border-strong);
  border-radius: 7px;
  background: var(--app-window);
  color: var(--app-text);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(75, 210, 160, 0.07);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 0.18s ease, transform 0.2s ease;
}
.product-dialog.is-wide { width: min(650px, calc(100% - 8px)); }
.product-dialog-layer.is-open .product-dialog { opacity: 1; transform: translateY(0) scale(1); }
.product-dialog-titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 29px;
  padding: 4px 5px 4px 7px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}
.product-dialog-titlebar strong {
  color: var(--app-text);
  font-size: 9px;
  font-weight: 650;
}
.product-dialog-titlebar button {
  display: grid;
  place-items: center;
  width: 23px !important;
  height: 21px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--app-muted);
  font-size: 15px;
}
.product-dialog-titlebar button:hover {
  border-color: #9e4048;
  background: #742b32;
  color: #fff;
}
.product-dialog-content {
  overflow: auto;
  padding: 10px;
  background: var(--app-window);
  scrollbar-color: var(--app-border-strong) transparent;
  scrollbar-width: thin;
}
.product-dialog-content p { margin: 0; }
.app-dialog-description {
  margin-bottom: 10px !important;
  color: var(--app-muted);
  font-size: 9px;
}
.app-dialog-heading {
  display: block;
  margin-bottom: 4px;
  color: var(--app-text);
  font-size: 10px;
}
.app-dialog-spacer { height: 16px; }
.product-dialog-content fieldset {
  margin: 9px 0;
  padding: 11px 9px 8px;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface-alt);
}
.product-dialog-content legend {
  padding: 0 5px;
  color: var(--app-text);
  font-size: 8px;
  font-weight: 650;
}
.product-dialog-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.product-dialog-content select,
.product-dialog-content textarea {
  width: 100%;
  min-width: 0;
  min-height: 23px;
  padding: 3px 6px;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  outline: 0;
  background: var(--app-input);
  color: var(--app-text);
  font: inherit;
  font-size: 8px;
}
.product-dialog-content textarea { min-height: 38px; resize: none; }
.product-dialog-content input:focus,
.product-dialog-content select:focus,
.product-dialog-content textarea:focus { border-color: var(--app-accent); }
.product-dialog-content input[type="checkbox"],
.product-dialog-content input[type="radio"] {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--app-accent);
}
.product-dialog-content input[type="range"] {
  width: 100%;
  accent-color: var(--app-accent);
}
.product-dialog-content button {
  min-height: 23px;
  padding: 3px 9px;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 8px;
}
.product-dialog-content button:hover {
  border-color: var(--app-accent);
  background: var(--app-hover);
}
.app-form-row {
  display: grid;
  grid-template-columns: minmax(125px, 0.85fr) minmax(140px, 1.15fr);
  gap: 8px;
  align-items: center;
  min-height: 29px;
  padding: 3px 0;
}
.app-form-row > label { color: var(--app-muted); font-size: 8px; }
.app-form-row > input[type="checkbox"] { justify-self: start; }
.app-inline-fields {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.app-inline-fields label { display: flex; gap: 5px; align-items: center; color: var(--app-muted); font-size: 8px; }
.app-inline-fields input:not([type="checkbox"]):not([type="radio"]) { width: 72px; }
.app-inline-fields select { flex: 1; }
.app-inline-fields span { flex: 0 0 auto; color: var(--app-muted); font-size: 8px; }
.app-choice {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 22px;
  color: var(--app-text);
  font-size: 8px;
}
.app-dialog-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  margin: 11px -10px -10px;
  padding: 7px 10px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
}
.app-dialog-actions span {
  flex: 1;
  color: var(--app-muted);
  font-size: 7px;
}
.app-dialog-actions button:nth-last-child(2) {
  border-color: var(--app-accent);
  background: var(--app-accent);
  color: #07100d;
  font-weight: 750;
}
.app-dialog-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin: -10px -10px 8px;
  padding: 5px 6px 0;
  border-bottom: 1px solid var(--app-border-strong);
  background: var(--app-surface-alt);
  scrollbar-width: none;
}
.app-dialog-tabs::-webkit-scrollbar { display: none; }
.app-dialog-tabs button {
  flex: 0 0 auto;
  border-color: transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: var(--app-muted);
}
.app-dialog-tabs button.is-active {
  border-color: var(--app-border-strong);
  background: var(--app-surface);
  color: var(--app-accent);
}
.app-dialog-page { display: none; min-height: 190px; }
.app-dialog-page.is-active { display: block; }
.app-dialog-note {
  margin: 7px 0;
  padding: 7px 8px;
  border: 1px solid rgba(75, 210, 160, 0.24);
  border-radius: 5px;
  background: rgba(75, 210, 160, 0.07);
  color: var(--app-muted);
  font-size: 8px;
}
.app-dialog-note strong { color: var(--app-accent); }
.app-image-setup {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 10px;
}
.app-image-preview,
.app-screen-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  background: radial-gradient(circle at 80% 0, rgba(75, 210, 160, 0.18), transparent 40%), var(--app-input);
  color: var(--app-muted);
  font-size: 7px;
}
.app-image-preview b {
  padding: 6px 9px;
  border: 1px solid var(--app-accent);
  border-radius: 4px;
  color: var(--app-text);
  font-size: 8px;
}
.app-screen-preview {
  background: linear-gradient(145deg, #1d3151, #18362d);
  color: #fff;
}
.app-screen-preview::after {
  position: absolute;
  inset: 15px;
  border: 1px dashed var(--app-delay);
  border-radius: 4px;
  content: "";
}
.app-screen-preview i {
  position: absolute;
  z-index: 1;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--app-accent);
}
.app-review-table {
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
  background: var(--app-input);
}
.app-review-head,
.app-review-table > div:not(.app-review-head) {
  display: grid;
  grid-template-columns: 36px 1fr 1.2fr 55px 1.3fr;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--app-border);
  font-size: 7px;
}
.app-review-head { background: var(--app-surface-alt); color: var(--app-muted); font-weight: 700; }
.app-review-table > div:last-child { border-bottom: 0; }
.app-review-table b { overflow: hidden; color: var(--app-text); text-overflow: ellipsis; white-space: nowrap; }
.app-review-table em { color: var(--app-success); font-style: normal; font-weight: 750; }
.app-review-table span { color: var(--app-muted); }
.app-smart-previews {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 7px;
}
.app-smart-previews > div,
.app-smart-previews > p {
  min-height: 76px;
  padding: 7px;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
  background: var(--app-input);
  color: var(--app-muted);
  font-size: 7px;
}
.app-smart-previews b {
  display: block;
  margin-top: 14px;
  padding: 5px;
  border: 1px solid var(--app-delay);
  border-radius: 3px;
  color: var(--app-text);
  text-align: center;
}
.app-recording-visual {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  background: var(--app-surface);
}
.app-recording-visual > i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--app-danger);
  box-shadow: 0 0 0 5px rgba(255, 125, 115, 0.1);
  animation: product-pulse 1s ease-in-out infinite;
}
.app-recording-visual div { display: grid; gap: 2px; }
.app-recording-visual strong { color: var(--app-danger); font-size: 9px; }
.app-recording-visual span { color: var(--app-muted); font-size: 7px; }
.app-waveform {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  height: 86px;
  margin: 8px 0;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
  background: var(--app-input);
}
.app-waveform i { width: 3px; height: 30%; border-radius: 99px; background: var(--app-accent); }
.app-waveform i:nth-child(2n) { height: 65%; }
.app-waveform i:nth-child(3n) { height: 45%; }
.app-waveform i:nth-child(5n) { height: 82%; }
.app-save-preview {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  background: var(--app-surface);
}
.app-save-preview strong { display: block; color: var(--app-text); font-size: 9px; }
.app-save-preview p { margin-top: 3px; color: var(--app-muted); font-size: 7px; }

.demo-intro {
  position: relative;
  overflow: hidden;
}
.demo-intro::after {
  position: absolute;
  z-index: -1;
  top: 20%;
  right: 4%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(75, 210, 160, 0.08);
  content: "";
  filter: blur(55px);
}

@keyframes product-pulse {
  50% { opacity: 0.38; transform: scale(0.75); }
}
@keyframes product-nudge {
  50% { transform: translateX(-3px); }
}
@keyframes product-scan {
  from { opacity: 0.3; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 1280px) {
  .hero:has(.product-demo) { grid-template-columns: minmax(285px, 0.6fr) minmax(700px, 1.5fr); gap: 28px; }
  .hero:has(.product-demo) h1 { font-size: clamp(3rem, 5.2vw, 5rem); }
}
@media (max-width: 1040px) {
  .hero:has(.product-demo) { grid-template-columns: 1fr; }
  .product-demo { transform: none; }
  .product-demo:hover { transform: translateY(-2px); }
}
@media (max-width: 720px) {
  .product-demo { font-size: 8px; }
  .product-file, .product-menubar > span:nth-of-type(3), .product-menubar > span:nth-of-type(4), .product-menubar > span:nth-of-type(5) { display: none; }
  .product-toolbar { overflow-x: auto; scrollbar-width: none; }
  .product-toolbar::-webkit-scrollbar { display: none; }
  .product-play-prompt { flex: 0 0 auto; }
  .product-main { min-height: 440px; }
  .product-workspacebar { grid-template-columns: auto auto 1fr; }
  .product-workspacebar > span { display: none; }
  .product-scenarios { overflow-x: auto; scrollbar-width: none; }
  .product-grid-head, .product-command-row { grid-template-columns: minmax(100px, 1fr) minmax(85px, 0.9fr) minmax(110px, 1.1fr); }
  .product-grid-head span:last-child, .product-command-row span:last-child { display: none; }
  .product-replay { right: 8px; bottom: 8px; width: calc(100% - 16px); }
  .product-statusbar { grid-template-columns: auto auto 1fr; }
  .product-statusbar > span:nth-of-type(2), .product-statusbar > div { display: none; }
  .product-dialog-layer { padding: 8px; }
  .product-dialog, .product-dialog.is-wide { width: 100%; max-height: 100%; }
  .app-form-row { grid-template-columns: minmax(105px, 0.8fr) minmax(120px, 1.2fr); }
  .app-review-head, .app-review-table > div:not(.app-review-head) { grid-template-columns: 30px 1fr 1fr 45px; }
  .app-review-head span:last-child, .app-review-table > div:not(.app-review-head) > span:last-child { display: none; }
}
@media (max-width: 470px) {
  .product-titlebar { grid-template-columns: auto 1fr auto; }
  .product-window-buttons { display: none; }
  .product-menubar b { font-size: 7px; }
  .product-main { grid-template-columns: 32px minmax(0, 1fr); }
  .product-insertbar button { width: 26px; }
  .product-editor { padding-right: 4px; padding-left: 4px; }
  .product-grid-head, .product-command-row { grid-template-columns: minmax(96px, 1fr) minmax(80px, 0.85fr) minmax(100px, 1fr); }
  .app-form-row, .app-image-setup, .app-smart-previews { grid-template-columns: 1fr; }
  .app-form-row { gap: 3px; }
  .app-inline-fields { flex-wrap: wrap; }
  .app-dialog-page { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .product-demo, .product-demo *, .product-demo *::before, .product-demo *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
