/* Only what the demo adds. Everything else is the app's own globals.css, aso-audit.css and polish.css, copied in by build.mjs. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Keep global /chat screen transparent on --bg while slide-over .chat-panel keeps --surface */
.content > .chat { background: transparent; height: auto; }
.chat-panel.chat { height: auto; }

.demo-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 980px;
  pointer-events: none;
}

.demo-chart { display: block; width: 100%; height: auto; color: var(--series-1); }
.demo-chart text { font-size: 11px; fill: var(--muted); }
.demo-chart .grid { stroke: var(--hairline); }
.demo-chart.rank { color: var(--good); }
.demo-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.demo-app-icon { display: block; border-radius: 22%; flex: none; }

.side-link.is-active,
.sidebar .side-site[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.tabbar a.is-active,
.tabbar a[aria-current="page"] { color: var(--accent); }
.composer-foot .model-picker { position: relative; }
.demo-md-link { display: inline-flex; margin-top: 2px; }

/* Sidebar theme footer */
.demo-side-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.demo-theme-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.demo-theme-seg button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
}
.demo-theme-seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

/* App Settings (.set) & Import helpers */
.set { display: grid; gap: 20px; }
.set-row { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 14px 24px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--hairline); }
.set-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.set-label { display: grid; gap: 4px; }
.set-label b { font-size: 14px; font-weight: 600; }
.set-label span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.set-markets { display: grid; gap: 10px; }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--hairline); }
.set-chip button { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; min-height: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); box-shadow: none; cursor: pointer; }
.set-chip button:hover { background: var(--hairline); color: var(--text); }
.set-add { position: relative; display: flex; align-items: center; gap: 8px; max-width: 320px; }
.set-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.set-presets button { padding: 4px 10px; min-height: 28px; font-size: 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text); box-shadow: none; cursor: pointer; }
.set-presets button:hover { border-color: var(--accent); color: var(--accent); }
.set-ai { display: flex; flex-wrap: wrap; gap: 10px; }
.set-footer { display: flex; justify-content: flex-end; }
.set-danger { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.set-danger > div { display: grid; gap: 3px; }
.set-danger > div span { font-size: 12.5px; color: var(--muted); }

/* Studio canvas crisp sizing & Pricing table fit inside embedded frame */
.studio-card-canvas canvas { display: block; width: auto; border-radius: 12px; }
.aso-page .price-table { min-width: 0; }
.aso-page .price-table th, .aso-page .price-table td { padding-inline: 11px; }
.content .aso-input { --aso-control: var(--surface-2); --aso-line: var(--hairline); }

/* Command palette crisp border & Research hero grid (overrides polish.css flex rule so .rx-map spans full width) */
.palette { border: 1px solid var(--hairline); }
.rx-page .rx-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; padding: 22px 24px; }
.rx-page .rx-main { gap: 32px; }
.rx-page button.rx-open, .rx-page button.rx-rail-open { justify-content: flex-start; text-align: left; }
.rx-sky-tip[hidden], .rx-scatter-tip[hidden] { display: none; }
.aso-table tr.aso-group td { position: static; padding-block: 8px; }
@media (max-width: 1040px) { .rx-page .rx-hero { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 820px) {
  .demo-badge { bottom: 70px; }
  .set-row { grid-template-columns: minmax(0, 1fr); }
}

/* The frame on a phone is narrower than the phone itself, so controls wrap cleanly. */
@media (max-width: 440px) {
  .content:has(.aso-page) { padding-inline: 14px; }
  .aso-page { grid-template-columns: minmax(0, 1fr); }
  .aso-tabs, .workspace-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .aso-tabs a, .workspace-tabs a { flex: none; padding-inline: 10px; }
  .aso-actions { flex-wrap: wrap; }
  .aso-actions .aso-btn { flex: 1 1 130px; min-width: 0; padding-inline: 10px; white-space: nowrap; }
  :root[data-embedded] .demo-badge { display: none; }
}
