/* Bloxnari app: where you build. Same palette as the home page. */
body.app-page {
  --a-bg: #0a1226;
  --a-side: #0d1730;
  --a-card: rgba(255, 255, 255, 0.045);
  --a-card-2: rgba(255, 255, 255, 0.075);
  --a-solid: #13224a;
  --a-line: rgba(255, 255, 255, 0.1);
  --a-line-strong: rgba(255, 255, 255, 0.18);
  --a-text: #eef3ff;
  --a-text-2: #c3cfe6;
  --a-muted: #8fa3c9;
  --a-grad: linear-gradient(100deg, #174ab8 0%, #1d5bd6 100%);
  --a-ok: #5fe08a;
  --display: "Archivo", "Inter", system-ui, sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}
.app-page a {
  color: #9fd8ff;
}
.app-page h1,
.app-page h2,
.app-page h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.015em;
}
kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--a-line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8em;
  line-height: 1.5;
  color: var(--a-text-2);
}
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfe0ff;
  font-size: 0.86em;
}
.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--a-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 14.5px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}
.btn-grad {
  /* Start the gradient at the outer edge, so its blue end doesn't repeat into the transparent border. */
  background: var(--a-grad) border-box;
  color: #fff !important;
  box-shadow: 0 3px 0 #12398f;
}
.btn-grad:hover {
  filter: brightness(1.1);
}
.btn-ghost {
  background: var(--a-card);
  border-color: var(--a-line-strong);
  color: var(--a-text) !important;
}
.btn-ghost:hover {
  background: var(--a-card-2);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.icon-btn {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-card);
  color: var(--a-text);
  cursor: pointer;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Status dots ---------- */
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d6894;
}
.dot.on {
  background: var(--a-ok);
  box-shadow: 0 0 0 3px rgba(95, 224, 138, 0.18);
}
.dot.busy {
  background: #ffc145;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--a-line);
  background: var(--a-side);
  overflow-y: auto;
}
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--a-text) !important;
}
.brand .logo-mark {
  width: 30px;
  height: auto;
}
.wordmark {
  font: 800 19px var(--display);
  letter-spacing: -0.02em;
}
.wordmark .tld {
  background: var(--a-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.side-card {
  padding: 12px;
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
}
.side-label {
  margin: 0 0 8px;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.studio-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  overflow: hidden;
}
.studio-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-select {
  width: 100%;
  margin-top: 10px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--a-line-strong);
  border-radius: 9px;
  background: var(--a-solid);
  color: var(--a-text);
  font: 500 13.5px var(--font-body);
}
.side-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.totals dt {
  font-size: 11.5px;
  color: var(--a-muted);
}
.totals dd {
  margin: 0;
  font: 700 17px var(--display);
}
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #3a3760;
  transition: background 0.15s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track {
  background: #1d5bd6;
}
.switch input:checked + .switch-track::after {
  transform: translateX(14px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid #22e6ff;
  outline-offset: 2px;
}
.side-spacer {
  flex: 1;
}
.account-box {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(90, 162, 255, 0.35);
  background: linear-gradient(160deg, rgba(29, 91, 214, 0.16), rgba(34, 230, 255, 0.06));
}
.account-box .side-label {
  margin-bottom: 2px;
}
.account-credits {
  margin: 0;
  font: 800 26px/1.1 var(--display);
}
.account-credits.low {
  color: #ffc145;
}
.account-box .hint {
  margin-top: 2px;
}
.side-foot {
  margin: 0;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--a-muted);
}
.scrim {
  display: none;
}

/* ---------- Chat column ---------- */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  isolation: isolate;
}
.chat-glow {
  position: absolute;
  z-index: -1;
  inset: -120px 0 auto;
  height: 420px;
  background: radial-gradient(ellipse 55% 60% at 50% 0%, rgba(29, 91, 214, 0.28), rgba(29, 91, 214, 0) 70%);
  pointer-events: none;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--a-line);
  background: rgba(10, 18, 38, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.chat-title h1 {
  font-size: 17px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--a-line-strong);
  background: var(--a-card);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--a-text-2);
}
.transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 24px 12px;
  scroll-behavior: smooth;
}

/* ---------- Empty states ---------- */
.empty {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.connect-card {
  max-width: 520px;
  margin: 4vh auto 0;
  padding: 26px 28px 24px;
  border: 1px solid var(--a-line);
  border-radius: 20px;
  background: var(--a-card);
  text-align: left;
}
.connect-art {
  height: 150px;
  margin: -6px -8px 14px;
  border-radius: 14px;
  overflow: hidden;
}
.connect-art svg {
  width: 100%;
  height: 100%;
}
.connect-card h2 {
  font-size: 24px;
  font-weight: 900;
}
.connect-steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.connect-steps li {
  position: relative;
  padding: 6px 0 6px 38px;
  counter-increment: step;
  color: var(--a-text-2);
}
.connect-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 5px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--a-grad);
  color: #fff;
  font: 800 13px var(--display);
}
.pair-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.pair-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--a-line-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--a-text);
  font: 600 18px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pair-form input:focus {
  outline: none;
  border-color: #5aa2ff;
}
.pair-form .btn {
  height: 44px;
}
.ready-title {
  margin-top: 3vh;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.1;
}
.ready-title .place {
  background: var(--a-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin: 10px 0 24px;
  color: var(--a-text-2);
}
.templates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.template {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--a-line-strong);
  border-radius: 14px;
  background: var(--a-solid);
  color: var(--a-text);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.template:hover,
.template:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(90, 162, 255, 0.7);
  box-shadow: 0 16px 34px -18px rgba(29, 91, 214, 0.7);
}
.template svg {
  display: block;
  width: 100%;
  height: auto;
}
.template-text {
  padding: 10px 12px 12px;
}
.template strong {
  display: block;
  font: 800 16px var(--display);
}
.template-text span {
  font-size: 13px;
  color: var(--a-muted);
}
.ideas-label {
  margin: 26px 0 10px;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  padding: 8px 13px;
  border: 1px solid var(--a-line-strong);
  border-radius: 999px;
  background: var(--a-card);
  color: var(--a-text-2);
  font: 500 13.5px var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover {
  background: var(--a-card-2);
  border-color: rgba(90, 162, 255, 0.6);
  color: var(--a-text);
}

/* ---------- Messages ---------- */
.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
}
.messages:empty {
  display: none;
}
.msg-user {
  align-self: flex-end;
  max-width: 78%;
  padding: 10px 15px;
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, #1d5bd6, #174ab8);
  color: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-meta {
  align-self: flex-end;
  margin-top: -9px;
  font-size: 12px;
  color: var(--a-muted);
}
.run {
  border: 1px solid var(--a-line);
  border-radius: 16px;
  background: var(--a-card);
  overflow: hidden;
}
.run-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--a-line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
}
.run-head img {
  width: 20px;
  height: auto;
}
.run-name {
  font: 800 14px var(--display);
}
.run-model {
  color: var(--a-muted);
}
.run-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-weight: 600;
  color: var(--a-text-2);
  font-variant-numeric: tabular-nums;
}
.run-body {
  padding: 12px 16px 14px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #9cc3ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps + .msg-ai,
.msg-ai + .steps,
.callout-error + .steps {
  margin-top: 10px;
}
.step {
  display: grid;
  grid-template-columns: 24px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13.5px;
  color: var(--a-text-2);
  animation: step-in 0.25s ease;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}
.step-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  font: 700 12px var(--font-mono);
  color: #c3cfe6;
}
.step.k-make .step-icon {
  background: rgba(95, 224, 138, 0.15);
  color: #7ff0a3;
}
.step.k-script .step-icon {
  background: rgba(90, 162, 255, 0.2);
  color: #b9d3ff;
}
.step.k-delete .step-icon {
  background: rgba(255, 93, 108, 0.15);
  color: #ff8d98;
}
.step.k-check .step-icon {
  background: rgba(34, 230, 255, 0.14);
  color: #7eeeff;
}
.step-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 12.5px var(--font-mono);
  color: var(--a-muted);
}
.step.err .step-icon {
  background: rgba(255, 93, 108, 0.2);
  color: #ff8d98;
}
.step-err-text {
  margin: 0 0 4px 32px;
  font-size: 12.5px;
  color: #ff9aa3;
}
.step.folded,
.step-err-text.folded {
  display: none;
}
.steps-more {
  margin: 4px 0 0 32px;
  padding: 0;
  border: none;
  background: none;
  color: #9fd8ff;
  font: 600 12.5px var(--font-body);
  cursor: pointer;
}
.msg-ai {
  color: var(--a-text);
  overflow-wrap: anywhere;
}
.msg-ai p {
  margin: 0 0 8px;
}
.msg-ai p:last-child,
.msg-ai ul:last-child,
.msg-ai ol:last-child {
  margin-bottom: 0;
}
.msg-ai ul,
.msg-ai ol {
  margin: 0 0 8px;
  padding-left: 22px;
}
.msg-ai pre {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--a-line);
  overflow-x: auto;
}
.msg-ai pre code {
  padding: 0;
  background: none;
}
.callout-error {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 93, 108, 0.35);
  background: rgba(255, 93, 108, 0.1);
  color: #ffc2c8;
  font-size: 13.5px;
}
.run-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--a-line);
  font-size: 12.5px;
  color: var(--a-muted);
}
.badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--a-text);
  font-weight: 700;
}
.badge.ok {
  background: rgba(95, 224, 138, 0.16);
  color: #8ff0b0;
}
.badge.warn {
  background: rgba(255, 193, 69, 0.16);
  color: #ffd27a;
}
.badge.bad {
  background: rgba(255, 93, 108, 0.16);
  color: #ff9aa3;
}
.run-summary {
  color: var(--a-text-2);
}
.next-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}
.next-ideas .chip {
  font-size: 13px;
  padding: 6px 12px;
}

/* ---------- Composer ---------- */
.composer {
  padding: 8px 24px 16px;
}
.composer-box {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 12px 10px 16px;
  border: 1px solid var(--a-line-strong);
  border-radius: 18px;
  background: rgba(20, 18, 48, 0.92);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer-box:focus-within {
  border-color: rgba(90, 162, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(29, 91, 214, 0.16), 0 20px 50px -30px rgba(0, 0, 0, 0.9);
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 26px;
  max-height: 220px;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--a-text);
  font: 400 15.5px/1.5 var(--font-body);
  resize: none;
  outline: none;
}
.composer textarea::placeholder {
  color: #7488b0;
}
.composer textarea:disabled {
  cursor: not-allowed;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.estimate {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--a-muted);
  white-space: nowrap;
}
.send-btn,
.stop-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.send-btn {
  background: var(--a-grad);
  box-shadow: 0 3px 0 #12398f;
}
.send-btn:disabled {
  background: #2c2952;
  box-shadow: none;
  cursor: not-allowed;
}
.send-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stop-btn {
  background: #eef3ff;
}
.stop-btn svg {
  width: 18px;
  height: 18px;
  fill: #14122e;
}
.composer-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: 7px auto 0;
  font-size: 12px;
  color: var(--a-muted);
}
.composer-hint .keys {
  flex: none;
}
.composer-error {
  max-width: 820px;
  margin: 8px auto 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 93, 108, 0.12);
  color: #ffc2c8;
  font-size: 13.5px;
}

/* Model picker (inside the composer) */
.model-picker {
  position: relative;
  min-width: 0;
}
.model-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--a-line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--a-text);
  font: 600 13.5px var(--font-body);
  cursor: pointer;
}
.model-btn:hover,
.model-picker.open .model-btn {
  background: rgba(90, 162, 255, 0.14);
  border-color: rgba(90, 162, 255, 0.6);
}
.model-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-btn .caret {
  flex: none;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: #c3cfe6;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: transform 0.15s ease;
}
.model-picker.open .caret {
  transform: rotate(180deg);
}
.fam-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--a-grad);
}
.fam-claude {
  background: #d0714a;
}
.fam-gpt {
  background: #10a37f;
}
.fam-gemini {
  background: #4a80f0;
}
.fam-grok {
  background: #8d8d9c;
}
.fam-deepseek {
  background: #5a6cf0;
}
/* The pop-up: the list of AIs on the left, what the pointed-at AI is good at on the right */
.model-pop {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 10px);
  left: 0;
  display: flex;
  width: 640px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111e3d;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.16s ease;
}
.model-picker.open .model-pop {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.model-menu {
  flex: 0 0 320px;
  min-width: 0;
  max-height: min(470px, 62vh);
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}
.model-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(170deg, rgba(29, 91, 214, 0.12), rgba(34, 230, 255, 0.03) 60%);
}
.info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.info-head strong {
  font: 800 17px var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-sub {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--a-muted);
}
.info-label {
  margin: 6px 0 4px;
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13.5px;
  color: var(--a-text-2);
}
.skill-bar {
  display: flex;
  gap: 4px;
}
.skill-bar span {
  width: 20px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}
.skill-bar span.on {
  background: linear-gradient(90deg, #1d5bd6, #5aa2ff);
  box-shadow: 0 0 8px rgba(34, 230, 255, 0.35);
}
.info-cost {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--a-text-2);
}
.info-cost .dollars {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffd27a;
}
.info-cost .dollars .off {
  color: rgba(255, 255, 255, 0.18);
}
.info-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 196, 64, 0.1);
  color: #ffe3a3;
  font-size: 12.5px;
}
.info-foot {
  margin: auto 0 0;
  padding-top: 10px;
  font-size: 11.5px;
  color: #77729e;
}
@media (max-width: 720px) {
  .model-info {
    display: none;
  }
  .model-pop {
    width: 330px;
  }
  .model-menu {
    flex-basis: 100%;
  }
}
.menu-h {
  padding: 8px 10px 4px;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.model-menu [role="option"] {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.model-menu [role="option"].active {
  background: rgba(255, 255, 255, 0.07);
}
.model-menu [role="option"][aria-selected="true"] {
  background: rgba(90, 162, 255, 0.16);
}
.model-menu [role="option"][aria-disabled="true"] {
  opacity: 0.55;
}
.opt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.opt-text strong {
  font-size: 14px;
  font-weight: 600;
}
.opt-text small {
  font-size: 12px;
  color: var(--a-muted);
}
.opt-plan {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfe0ff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.opt-plan.plan-max {
  background: var(--a-grad);
  color: #fff;
}
.opt-plan.locked::before {
  content: "🔒 ";
}

/* ---------- Credits next to the AI picker ---------- */
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 210, 90, 0.35);
  border-radius: 10px;
  background: rgba(255, 196, 64, 0.1);
  color: #ffe3a3 !important;
  font: 700 13.5px var(--font-body);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
}
.credit-pill:hover {
  background: rgba(255, 196, 64, 0.18);
}
.credit-pill svg {
  width: 16px;
  height: 16px;
  fill: #ffc445;
  stroke: #7a5200;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.credit-word {
  font-weight: 500;
  color: #e9d6a6;
}
.credit-pill.is-low {
  border-color: rgba(255, 150, 60, 0.6);
  background: rgba(255, 130, 40, 0.16);
  color: #ffc18f !important;
}
.credit-pill.is-empty {
  border-color: rgba(255, 93, 108, 0.6);
  background: rgba(255, 93, 108, 0.16);
  color: #ffb3bb !important;
}
.get-credits {
  flex: none;
  height: 40px;
}

/* ---------- Get credits dialog ---------- */
.buy-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 22px;
  border: 1px solid var(--a-line-strong);
  border-radius: 18px;
  background: var(--a-solid);
  color: var(--a-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.buy-dialog::backdrop {
  background: rgba(5, 4, 16, 0.7);
  backdrop-filter: blur(3px);
}
.buy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.buy-head h2 {
  margin: 0;
  font: 800 22px var(--display);
}
.buy-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-card);
  cursor: pointer;
}
.buy-close:hover {
  background: var(--a-card-2);
}
.buy-close svg {
  width: 16px;
  height: 16px;
  stroke: var(--a-text-2);
  stroke-width: 2;
  stroke-linecap: round;
}
.buy-sub {
  margin: 6px 0 16px;
  color: var(--a-muted);
  font-size: 14px;
}
.buy-packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.buy-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 14px 14px;
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
  color: var(--a-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.buy-pack:hover:not(:disabled) {
  border-color: rgba(255, 210, 90, 0.55);
  background: rgba(255, 196, 64, 0.08);
  transform: translateY(-2px);
}
.buy-pack:disabled {
  cursor: default;
  opacity: 0.55;
}
.buy-pack.busy {
  opacity: 1;
  border-color: rgba(255, 210, 90, 0.55);
}
.buy-pack.best {
  border-color: rgba(29, 91, 214, 0.55);
  background: rgba(29, 91, 214, 0.1);
}
.buy-tag {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--a-grad) border-box;
  color: #fff;
  font: 700 11px var(--font-body);
}
.buy-credits {
  color: #ffe3a3;
  font: 800 22px var(--display);
  font-variant-numeric: tabular-nums;
}
.buy-credits small {
  color: #e9d6a6;
  font: 500 13px var(--font-body);
}
.buy-price {
  font: 700 17px var(--font-body);
}
.buy-builds {
  color: var(--a-muted);
  font-size: 12px;
  line-height: 1.35;
}
.buy-guardian {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 210, 90, 0.35);
  border-radius: 12px;
  background: rgba(255, 196, 64, 0.08);
  color: var(--a-text-2);
  font-size: 13.5px;
  line-height: 1.4;
}
.buy-guardian input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: #1d5bd6;
}
.buy-error {
  margin: 12px 0 0;
  color: #ffb3bb;
  font-size: 13.5px;
}
.buy-foot {
  margin: 16px 0 0;
  color: var(--a-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.buy-foot a {
  color: var(--a-text-2);
}
@media (max-width: 560px) {
  .buy-packs {
    grid-template-columns: 1fr;
  }
  .buy-tag {
    top: 10px;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 64px; /* below the top bar, clear of the prompt box and credits */
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(95, 224, 138, 0.45);
  border-radius: 12px;
  background: #12301f;
  color: #c9f7d8;
  font: 600 14px var(--font-body);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}
.toast-info {
  border-color: var(--a-line-strong);
  background: var(--a-solid);
  color: var(--a-text-2);
}

/* ---------- Your games (saved conversations) ---------- */
.side-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--a-muted);
  font: 600 12px var(--font-body);
  cursor: pointer;
}
.link-btn:hover {
  color: var(--a-text);
}
.games-count {
  font: 600 11.5px var(--font-mono);
  color: var(--a-muted);
}
.games-count.full {
  color: #ffc65c;
}
.games-search {
  width: 100%;
  height: 32px;
  margin: 2px 0 8px;
  padding: 0 10px;
  border: 1px solid var(--a-line-strong);
  border-radius: 9px;
  background: var(--a-solid);
  color: var(--a-text);
  font: 500 13px var(--font-body);
}
.games {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  margin: 0 -4px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.game {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 9px;
}
.game:hover,
.game:focus-within {
  background: var(--a-card-2);
}
.game.active {
  background: rgba(29, 91, 214, 0.28);
  box-shadow: inset 2px 0 0 #6aa2ff;
}
.game-open {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 7px 8px;
  border: none;
  background: none;
  color: var(--a-text-2);
  text-align: left;
  cursor: pointer;
}
.game.active .game-open,
.game-open:hover {
  color: var(--a-text);
}
.game-title {
  overflow: hidden;
  font: 600 13.5px/1.3 var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-meta {
  font-size: 11.5px;
  color: var(--a-muted);
}
.game-tools {
  display: flex;
  gap: 2px;
  padding-right: 4px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.game:hover .game-tools,
.game:focus-within .game-tools,
.game.active .game-tools {
  opacity: 1;
}
@media (hover: none) {
  .game-tools {
    opacity: 1;
  }
}
.game-tool {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--a-muted);
  cursor: pointer;
}
.game-tool svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.game-tool:hover {
  background: var(--a-card-2);
  color: var(--a-text);
}
.game-tool.danger:hover {
  color: #ff8a8a;
}
.game.confirming {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 90, 90, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.3);
}
.game-confirm {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--a-text-2);
}
.game-confirm-row {
  display: flex;
  gap: 6px;
}
.mini-btn.danger {
  border-color: rgba(255, 120, 120, 0.45);
  background: rgba(255, 90, 90, 0.18);
  color: #ffd4d4;
}
.mini-btn.danger:hover {
  background: rgba(255, 90, 90, 0.3);
  color: #fff;
}
.game-rename {
  display: flex;
  flex: 1;
  gap: 6px;
  padding: 4px;
}
.game-rename input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #6aa2ff;
  border-radius: 7px;
  background: var(--a-solid);
  color: var(--a-text);
  font: 600 13px var(--font-body);
}
.games-empty {
  margin: 0;
}
.games-limit {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 198, 92, 0.1);
  color: #ffe2a8;
  font-size: 12.5px;
  line-height: 1.45;
}
.games-limit a {
  color: #fff;
  font-weight: 700;
}
.games-card.flash {
  animation: games-flash 1.4s ease 2;
}
@keyframes games-flash {
  50% {
    border-color: #ffc65c;
    box-shadow: 0 0 0 3px rgba(255, 198, 92, 0.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  .games-card.flash {
    animation: none;
    border-color: #ffc65c;
  }
}
.switch-gap {
  margin-top: 14px;
}
.switch input:disabled ~ span {
  opacity: 0.5;
}
.export-btn {
  padding-inline: 9px;
}

/* ---------- Message actions ---------- */
.msg-user-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.msg-user-wrap .msg-user {
  max-width: 78%;
}
.msg-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.msg-user-wrap:hover .msg-actions,
.msg-user-wrap:focus-within .msg-actions {
  opacity: 1;
}
@media (hover: none) {
  .msg-actions {
    opacity: 1;
  }
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--a-line);
  border-radius: 8px;
  background: var(--a-card);
  color: var(--a-muted);
  font: 600 12px var(--font-body);
  cursor: pointer;
}
.mini-btn:hover {
  color: var(--a-text);
  border-color: var(--a-line-strong);
}
.code-wrap {
  position: relative;
}
.code-wrap .mini-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ---------- Tips ---------- */
.tips {
  max-width: 640px;
  margin: 22px auto 0;
  padding: 0 4px;
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
  text-align: left;
}
.tips summary {
  padding: 11px 12px;
  font-weight: 700;
  cursor: pointer;
}
.tips ul {
  margin: 0;
  padding: 0 16px 14px 32px;
  color: var(--a-text-2);
  font-size: 14px;
}
.tips li + li {
  margin-top: 6px;
}

/* ---------- Phones and small windows ---------- */
@media (max-width: 1100px) {
  .templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .app.side-open .sidebar {
    transform: none;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5);
  }
  .scrim {
    display: block;
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(4, 8, 20, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .app.side-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .icon-btn {
    display: grid;
  }
  .chat-head {
    padding: 10px 14px;
  }
  .transcript {
    padding: 20px 14px 10px;
  }
  .composer {
    padding: 6px 12px 12px;
  }
  .composer-hint .keys {
    display: none;
  }
  #new-chat {
    padding: 0 10px;
  }
}
@media (max-width: 520px) {
  .templates {
    gap: 8px;
  }
  .template-text {
    padding: 8px 10px 10px;
  }
  .template-text span {
    display: none;
  }
  .new-chat-label {
    display: none;
  }
  #new-chat {
    width: 34px;
    padding: 0;
  }
  .msg-user {
    max-width: 90%;
  }
  .estimate,
  .credit-word {
    display: none;
  }
  .model-picker {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .step,
  .dot.busy,
  .spinner {
    animation: none;
  }
  .template,
  .model-menu {
    transition: none;
  }
}

/* AI list rows: short description on wide screens, cost line on phones (where the details panel is hidden) */
.opt-text .opt-cost {
  display: none;
}
@media (max-width: 720px) {
  .opt-text .opt-tag {
    display: none;
  }
  .opt-text .opt-cost {
    display: block;
  }
}

/* ---------- Game mind map ---------- */
.map-btn {
  position: relative;
}
.map-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fe08a;
  box-shadow: 0 0 6px #5fe08a;
}
.map-view {
  position: absolute;
  z-index: 25;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 70% 60% at 40% 45%, #1a1650 0%, #0a1226 70%);
}
.map-view[hidden] {
  display: none;
}
.map-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--a-line);
  background: rgba(10, 18, 38, 0.7);
}
.map-titles {
  flex: 1;
  min-width: 0;
}
.map-titles h2 {
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--a-muted);
}
.map-legend {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  color: var(--a-text-2);
}
.lg::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 0;
}
.lg-built::before {
  background: #5fe08a;
  box-shadow: 0 0 6px #5fe08a;
}
.lg-partial::before {
  background: #ffc145;
  box-shadow: 0 0 6px #ffc145;
}
.lg-idea::before {
  background: #7fb2ff;
  box-shadow: 0 0 6px #7fb2ff;
}
.map-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-view .map-close {
  display: grid;
}
.map-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
}
.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}
#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.map-empty,
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.map-empty[hidden],
.map-loading[hidden] {
  display: none;
}
.map-empty h3 {
  font-size: 24px;
  font-weight: 900;
}
.map-empty p {
  max-width: 440px;
  margin: 0;
  color: var(--a-text-2);
}
.map-empty .map-cost {
  font-size: 12.5px;
  color: var(--a-muted);
}
.map-loading {
  flex-direction: row;
  font-weight: 600;
  color: var(--a-text-2);
  background: rgba(10, 18, 38, 0.35);
}
.map-help {
  position: absolute;
  left: 16px;
  bottom: 12px;
  margin: 0;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7488b0;
  pointer-events: none;
}
.map-zoom {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zoom button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--a-line-strong);
  border-radius: 9px;
  background: rgba(20, 18, 48, 0.9);
  color: var(--a-text);
  font: 700 16px var(--font-body);
  cursor: pointer;
}
.map-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid var(--a-line);
  background: rgba(14, 12, 36, 0.92);
}
.map-panel h3 {
  margin: 6px 0 4px;
  font-size: 20px;
  font-weight: 900;
}
.map-panel h4 {
  margin: 16px 0 6px;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.map-panel p {
  margin: 0;
  color: var(--a-text-2);
  font-size: 14px;
}
.fp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--a-muted);
}
.status-chip {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.s-built {
  background: rgba(95, 224, 138, 0.16);
  color: #8ff0b0;
}
.s-partial {
  background: rgba(255, 193, 69, 0.16);
  color: #ffd27a;
}
.s-idea {
  background: rgba(127, 178, 255, 0.18);
  color: #c6dbff;
}
.imp {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--a-muted);
  letter-spacing: 0.1em;
}
.imp b {
  color: #22e6ff;
  font-weight: 400;
}
.where {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.where code {
  font-size: 12px;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.link-chip {
  padding: 4px 10px;
  border: 1px solid var(--a-line-strong);
  border-radius: 999px;
  background: var(--a-card);
  color: var(--a-text-2);
  font: 500 12.5px var(--font-body);
  cursor: pointer;
}
.link-chip:hover {
  border-color: rgba(90, 162, 255, 0.6);
  color: var(--a-text);
}
.link-chip small {
  color: var(--a-muted);
}
.tip {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--a-line);
  border-radius: 12px;
  background: var(--a-card);
}
.tip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.tip p {
  font-size: 13.5px;
}
.tip .btn {
  margin-top: 10px;
}
.overview-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.overview-counts div {
  padding: 10px;
  border-radius: 10px;
  background: var(--a-card);
  text-align: center;
}
.overview-counts b {
  display: block;
  font: 800 20px var(--display);
}
.overview-counts span {
  font-size: 12px;
  color: var(--a-muted);
}
.next-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.next-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-card);
  color: var(--a-text);
  font: 600 13.5px var(--font-body);
  text-align: left;
  cursor: pointer;
}
.next-list button:hover {
  border-color: rgba(90, 162, 255, 0.6);
}
.map-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 93, 108, 0.12);
  color: #ffc2c8;
  font-size: 13.5px;
}
@media (max-width: 980px) {
  .map-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 42%);
  }
  .map-panel {
    border-left: none;
    border-top: 1px solid var(--a-line);
  }
  .map-legend {
    display: none;
  }
}
@media (max-width: 520px) {
  .map-btn-label {
    display: none;
  }
  .map-btn {
    width: 34px;
    padding: 0;
  }
}
/* ---------- Auto, Plan first, pictures, restore points ---------- */
.fam-auto {
  border-radius: 50%;
  background: var(--a-grad);
  box-shadow: 0 0 8px rgba(29, 91, 214, 0.6);
}
.opt-plan.plan-auto {
  background: var(--a-grad) border-box;
  color: #fff;
}
.auto-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--a-grad) border-box;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.auto-note {
  margin: 0 0 8px;
  color: var(--a-muted);
  font-size: 12.5px;
}
.auto-picks {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.auto-picks div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--a-card);
  font-size: 12.5px;
}
.auto-picks span {
  color: var(--a-muted);
}
.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-card);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--a-card-2);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--a-text-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plan-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-card);
  color: var(--a-text-2);
  font: 600 13px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.plan-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.plan-chip.on {
  border-color: rgba(34, 230, 255, 0.55);
  background: rgba(34, 230, 255, 0.12);
  color: #bff6ff;
}
.attach-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.attach-item {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--a-line-strong);
  border-radius: 10px;
  overflow: hidden;
}
.attach-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(10, 18, 38, 0.85);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.attach-hint {
  color: var(--a-muted);
  font-size: 12.5px;
}
.composer-box.drop {
  outline: 2px dashed rgba(34, 230, 255, 0.7);
  outline-offset: 2px;
}
.plan-status {
  margin: 10px 14px;
  color: var(--a-muted);
  font-size: 13.5px;
}
.plan-body {
  padding: 4px 16px 14px;
}
.plan-body h3 {
  margin: 8px 0 4px;
  font: 800 18px var(--display);
}
.plan-body p {
  margin: 4px 0 8px;
  color: var(--a-text-2);
  font-size: 14px;
}
.plan-steps {
  margin: 6px 0 10px;
  padding-left: 20px;
  font-size: 14px;
}
.plan-steps li {
  margin: 3px 0;
}
.plan-h {
  margin: 10px 0 2px !important;
  color: var(--a-muted) !important;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-list {
  margin: 2px 0 8px;
  padding-left: 18px;
  color: var(--a-text-2);
  font-size: 13.5px;
}
.plan-cost {
  padding: 9px 12px;
  border: 1px solid rgba(255, 210, 90, 0.35);
  border-radius: 10px;
  background: rgba(255, 196, 64, 0.08);
}
.plan-cost strong {
  color: #ffe3a3;
}
.plan-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.restore-btn {
  margin-left: auto;
}
.chat-note {
  margin: 8px auto;
  padding: 7px 12px;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--a-card);
  color: var(--a-text-2);
  font-size: 13px;
}
@media (max-width: 560px) {
  .plan-chip span {
    display: none;
  }
}
/* The builder's sidebar is narrow: a slightly smaller logo. */
.brand .logo-full {
  height: 30px;
}

/* ---------- Prompt queue ---------- */
.queue {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
}
.queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.queue-title {
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.queue-paused {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: #ffe2a8;
}
.queue-head .link-btn {
  margin-left: auto;
}
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 150px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  counter-reset: q;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0 3px 2px;
  font-size: 13.5px;
  color: var(--a-text-2);
  counter-increment: q;
}
.queue-item::before {
  content: counter(q);
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--a-card-2);
  font: 700 11px var(--font-mono);
  color: var(--a-muted);
}
.queue-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-btn {
  white-space: nowrap;
}

/* ---------- My prompts ---------- */
.prompts-picker {
  position: relative;
}
.prompts-picker .icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.prompts-pop {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 10px);
  left: -120px;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #111e3d;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.85);
}
.prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.prompts-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.prompt-item {
  display: flex;
  align-items: center;
  border-radius: 9px;
}
.prompt-item:hover,
.prompt-item:focus-within {
  background: var(--a-card-2);
}
.prompt-use {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: none;
  background: none;
  color: var(--a-text-2);
  text-align: left;
  cursor: pointer;
}
.prompt-use:hover {
  color: var(--a-text);
}
.prompt-title {
  display: block;
  overflow: hidden;
  font: 500 13.5px/1.35 var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prompts-empty {
  margin: 4px 2px;
}
@media (max-width: 600px) {
  .prompts-pop {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 120px;
    width: auto;
  }
}

/* ---------- Version history ---------- */
.history-dialog {
  width: min(640px, calc(100vw - 32px));
}
.timeline {
  max-height: min(60vh, 560px);
  margin: 14px 0 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
}
.tl-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 16px;
}
.tl-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: var(--a-line-strong);
}
.tl-dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: #6aa2ff;
  box-shadow: 0 0 0 3px rgba(106, 162, 255, 0.2);
}
.tl-restore .tl-dot {
  background: #ffc65c;
  box-shadow: 0 0 0 3px rgba(255, 198, 92, 0.2);
}
.tl-body {
  flex: 1;
  min-width: 0;
}
.tl-prompt {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.tl-meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--a-muted);
}
.tl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.tl-actions:empty {
  display: none;
}
.tl-note {
  font-size: 12px;
  color: var(--a-muted);
}
