:root {
  --bg: #07090d;
  --surface: #0d1117;
  --line: #ffffff16;
  --muted: #a8b0bd;
  --blue: #5b7cff;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #f5f7fa;
  font:
    15px/1.6 Inter,
    system-ui,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--blue);
  color: white;
  font-weight: 650;
  cursor: pointer;
  min-height: 46px;
}
button:hover,
.button:hover {
  filter: brightness(1.15);
}
button.secondary,
.button.secondary {
  background: #171e29;
  border-color: var(--line);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8eabff;
  outline-offset: 3px;
}
input,
textarea,
select {
  width: 100%;
  background: #080c13;
  color: #fff;
  border: 1px solid #354052;
  border-radius: 10px;
  padding: 13px;
  margin-top: 6px;
}
textarea {
  min-height: 90px;
}
label {
  display: block;
  margin: 14px 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.035em;
}
h1 {
  font-size: 38px;
  margin: 12px 0;
}
h2 {
  font-size: 24px;
}
p {
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}
.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand span span {
  color: #8ca3ff;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  gap: 15px;
  background: var(--surface);
}
.demo {
  background: #141b2b;
  border-bottom: 1px solid #24314d;
  color: #bdc9e4;
  padding: 8px 24px;
  font-size: 12px;
  text-align: center;
}
.layout {
  display: grid;
  grid-template-columns: 225px 1fr;
  min-height: calc(100vh - 114px);
}
aside {
  padding: 28px 16px;
  border-right: 1px solid var(--line);
}
aside a {
  display: block;
  padding: 11px 16px;
  margin: 4px 0;
  border-radius: 9px;
  color: #a8b0bd;
}
aside a.active {
  background: #5b7cff20;
  color: #b9c7ff;
}
aside small {
  display: block;
  padding: 20px 16px;
  color: #78849a;
}
.content {
  max-width: 1450px;
  width: 100%;
  padding: 40px;
}
.eyebrow {
  color: #91a6ff;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 25px;
  border-radius: 16px;
}
.card h3 {
  margin: 8px 0 14px;
}
.metric {
  font-size: 34px;
  font-weight: 700;
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: #5b7cff20;
  color: #b2c0ff;
  font-size: 12px;
}
.hero-card {
  background:
    radial-gradient(ellipse at right top, #313b7155, transparent 65%),
    var(--surface);
  padding: 32px;
  border: 1px solid #5b7cff40;
  border-radius: 18px;
}
.auth {
  max-width: 470px;
  margin: 65px auto;
  padding: 30px;
}
.auth h1 {
  font-size: 32px;
}
.auth button {
  width: 100%;
  margin-top: 12px;
}
.muted,
small {
  color: var(--muted);
}
.onboarding {
  max-width: 800px;
  margin: auto;
}
.progress {
  height: 5px;
  border-radius: 4px;
  background: #222b3a;
  margin: 20px 0;
}
.progress div {
  height: 100%;
  background: var(--blue);
}
.bubble {
  padding: 17px 20px;
  border-radius: 14px;
  background: #171e29;
  margin: 12px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  background: #293761;
  margin-left: 40px;
}
.bubble.assistant {
  margin-right: 20px;
}
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #5b7cff, #7c5cff);
  font-size: 22px;
}
.choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.editor {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.chat {
  display: flex;
  flex-direction: column;
  min-height: 650px;
  max-height: 850px;
}
.messages {
  flex: 1;
  overflow: auto;
  max-height: 520px;
  margin: 15px 0;
}
.chat form {
  margin-top: auto;
}
.preview-wrap {
  background: #1d2532;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
}
.toolbar {
  display: flex;
  gap: 6px;
  padding: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.toolbar button {
  min-height: 35px;
  padding: 6px 12px;
  font-size: 12px;
}
.toolbar button.selected {
  background: var(--blue);
}
.frame-stage {
  overflow: auto;
  padding: 12px;
  display: flex;
  justify-content: center;
}
iframe {
  border: 0;
  background: white;
  width: 100%;
  height: 730px;
  flex-shrink: 0;
  border-radius: 8px;
}
.table {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
th,
td {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
td p {
  margin: 0;
  max-width: 250px;
  white-space: normal;
  font-size: 12px;
}
td select {
  min-width: 135px;
}
.price {
  font-size: 38px;
  font-weight: 750;
}
.price small {
  font-size: 14px;
  font-weight: 400;
}
.card ul {
  padding-left: 18px;
  color: var(--muted);
  min-height: 170px;
}
.card li {
  margin: 10px 0;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: #283a5b;
  border-radius: 12px;
  z-index: 100;
  display: none;
  max-width: 90%;
}
.public {
  height: 100vh;
  width: 100%;
  border-radius: 0;
}
.empty {
  padding: 35px;
  text-align: center;
}
.error {
  color: #ffb5bc;
}
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (min-width: 1600px) {
  .editor {
    grid-template-columns: 390px minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 180px 1fr;
  }
  .content {
    padding: 25px;
  }
  .editor {
    grid-template-columns: 1fr;
  }
  .chat {
    min-height: 300px;
    max-height: 500px;
  }
  .messages {
    max-height: 230px;
  }
}
@media (max-width: 650px) {
  .top {
    padding: 12px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 18px;
  }
  .layout {
    display: block;
  }
  aside {
    display: flex;
    overflow: auto;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  aside a {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 12px;
  }
  aside small {
    display: none;
  }
  .content {
    padding: 22px 16px;
  }
  h1 {
    font-size: 30px;
  }
  .card {
    padding: 20px;
  }
  .auth {
    margin: 25px 16px;
  }
  .editor {
    gap: 12px;
  }
  .demo {
    padding: 8px 12px;
  }
  .frame-stage {
    justify-content: flex-start;
  }
  iframe {
    height: 620px;
  }
  .hero-card {
    padding: 24px;
  }
}

.content,
.card {
  min-width: 0;
}
.card {
  overflow-wrap: anywhere;
}
#answer {
  white-space: pre-wrap;
}
.demo-publication {
  margin-top: 24px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.frame-stage {
  justify-content: flex-start;
}
.frame-stage iframe {
  margin-inline: auto;
}
@media (max-width: 650px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth {
    max-width: calc(100% - 32px);
  }
}

dialog#share-dialog {
  width: min(600px, calc(100% - 32px));
  background: var(--surface);
  color: #f5f7fa;
  border: 1px solid #354052;
  border-radius: 18px;
  padding: 28px;
}
dialog#share-dialog::backdrop {
  background: #000a;
}
#share-status {
  min-height: 26px;
}

.readiness {margin:18px 0;padding:18px 22px}
.readiness summary {cursor:pointer;font-size:16px;min-height:30px}
.readiness-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;list-style:none;padding:0}
.recommendation {border-top:1px solid var(--line);padding:10px 0;display:flex;align-items:center;gap:12px;justify-content:space-between}
.recommendation p {margin:0}
.recommendation button {flex-shrink:0}
#launch-dialog {width:min(580px,calc(100% - 28px));max-height:90dvh;overflow:auto;background:var(--surface);color:#f5f7fa;border:1px solid #354052;border-radius:18px;padding:28px}
#launch-dialog::backdrop {background:#000a}
#launch-dialog li,.lead-card small {line-height:1.8}
#launch-dialog button,#launch-dialog .button {margin:6px 0}
button,.button {min-height:44px}
.messages {white-space:pre-wrap}
.frame-stage {max-width:100%;overflow:hidden}
.frame-stage iframe {max-width:100%}
@media(max-width:650px){
  body {overflow-x:hidden}
  aside {flex-wrap:wrap;overflow:visible}
  aside a {white-space:normal;font-size:14px;min-height:44px}
  .top {gap:8px;flex-wrap:wrap}
  .top .brand {font-size:20px}
  .stats {flex-wrap:wrap;max-width:100%}
  .readiness-list {grid-template-columns:1fr}
  .readiness {padding:16px}
  .chat {position:static}
  .messages {max-height:45dvh}
  .toolbar {flex-wrap:wrap}
  .recommendation {align-items:flex-start}
  .editor {grid-template-columns:minmax(0,1fr)}
  input,textarea,select {font-size:16px;max-width:100%;min-width:0}
}
.mobile-menu {display:none}
@media(max-width:650px){.mobile-menu{display:inline-flex}aside{display:none}aside.is-open{display:flex}}
