/* codemany.com /demo: the three scenes inside the window (connect, pick a repo, workflow)
 * and the "Try it" dialog with the sample workflow. demo.js toggles the state classes. */
.sc-h { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.04em; line-height: 1.2; }
.sc-sub { margin: -6px 0 4px; font-size: 12px; color: var(--muted-foreground); }
.sc-foot { margin-top: auto; display: flex; justify-content: flex-end; }

/* small app-style buttons (not links: the window is a picture of the app) */
.mbtn {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground);
  font: 500 12px/1 var(--font); white-space: nowrap; transition: background-color .25s, color .25s, transform .12s;
}
.mbtn.ready, .mbtn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.mbtn.press { transform: scale(.96); opacity: .85; }
button.mbtn { cursor: pointer; }
button.mbtn:hover { opacity: .9; }

/* ---------- 1: connect ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  position: relative; display: grid; gap: 4px; align-content: start; padding: 12px 14px; min-width: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--background); font-size: 13px;
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.choice b { font-weight: 500; margin-top: 6px; }
.ch-sub { font-size: 12px; color: var(--muted-foreground); }
.tick { color: var(--foreground); font-weight: 700; }
.ch-ico {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--muted); font-size: 11px; font-weight: 700;
}
.ch-ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.radio {
  position: absolute; top: 12px; right: 12px; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--ring); transition: border-color .25s, box-shadow .25s;
}
.choice.hover { background: var(--muted); }
.choice.on { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground); background: var(--background); }
.choice.on .radio { border-color: var(--foreground); box-shadow: inset 0 0 0 3px var(--background), inset 0 0 0 8px var(--foreground); }

/* ---------- 2: pick a repo ---------- */
.field { position: relative; z-index: 2; }
.sel {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--background); font-size: 13px;
  transition: box-shadow .2s, border-color .2s;
}
.sel-v { color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel.picked .sel-v { color: var(--foreground); font-weight: 500; }
.sel svg { width: 10px; height: 14px; flex: none; fill: none; stroke: var(--muted-foreground); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sel.open { border-color: var(--foreground); box-shadow: 0 0 0 3px color-mix(in srgb, var(--foreground) 12%, transparent); }
.menu {
  position: absolute; left: 0; right: 0; top: 40px; margin: 0; padding: 4px; list-style: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--background); box-shadow: var(--shadow);
  font-size: 13px; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility 0s .18s;
}
.menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s; }
.menu li { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 10px; border-radius: 5px; }
.menu li span { font-size: 11px; color: var(--muted-foreground); }
.menu li.hi { background: var(--muted); }
.repo {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--background);
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s;
}
.repo.on { opacity: 1; transform: none; }
.repo-ico { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--muted); }
.repo-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.repo-t { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.repo-t b { font-weight: 500; }
.badge { padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; line-height: 18px; color: var(--muted-foreground); }
.repo-m { margin: 2px 0 0; font-size: 12px; color: var(--muted-foreground); }
.repo-m code { font-size: 11px; }

/* ---------- 3: workflow ---------- */
.code { border: 1px solid var(--border); border-radius: 8px; background: var(--background); }
.code-h {
  height: 30px; padding: 0 12px; display: flex; align-items: center; border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0; background: var(--muted); font-size: 11px; color: var(--muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.code-b { margin: 0; padding: 8px 0; font: 12px/1.75 var(--font); }
.ln { display: block; padding: 0 12px; white-space: pre; transition: background-color .4s, box-shadow .4s; }
.chg.edit { background: color-mix(in srgb, var(--foreground) 7%, transparent); box-shadow: inset 2px 0 var(--foreground); }
#chg-v.typing::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -2px; background: var(--foreground); }
.run {
  display: grid; grid-template-columns: 16px auto minmax(0, 1fr); align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; white-space: nowrap;
}
.run b { font-weight: 500; }
.run-s { justify-self: end; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.run[data-state="done"] .run-s { color: var(--foreground); }
.r-icon { position: relative; width: 16px; height: 16px; display: grid; place-items: center; }
.r-icon::before { content: ""; position: absolute; inset: 2px; border: 1.5px solid var(--ring); border-radius: 3px; transition: background-color .3s, border-color .3s; }
.run[data-state="idle"] .r-icon::before { border-style: dashed; }
.r-icon svg { position: relative; width: 12px; height: 12px; opacity: 0; transition: opacity .25s; }
.r-icon path { fill: none; stroke: var(--background); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.run[data-state="running"] .r-icon::before { inset: 1px; border-radius: 50%; border-color: var(--foreground); border-right-color: transparent; animation: r-spin 1.1s linear infinite; }
.run[data-state="done"] .r-icon::before { inset: 0; border-radius: 50%; border-color: var(--foreground); background: var(--foreground); }
.run[data-state="done"] .r-icon svg { opacity: 1; }
@keyframes r-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .run[data-state="running"] .r-icon::before { animation: none; border-style: dotted; border-right-color: var(--foreground); }
}
.try-strip {
  margin: auto calc(-1 * clamp(16px, 2.4vw, 28px)) calc(-1 * clamp(16px, 3vh, 28px)); padding: 10px clamp(16px, 2.4vw, 28px);
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; background: var(--muted); font-size: 12px;
}
.try-l { margin-right: auto; font-weight: 500; }
.try-dl { color: var(--muted-foreground); text-underline-offset: 3px; }
.try-dl:hover { color: var(--foreground); }

/* ---------- the "Try it" dialog ---------- */
.try {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; margin: auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--background); color: var(--foreground);
  box-shadow: var(--shadow), 0 30px 80px -20px #00000066; font: 13px/1.6 var(--font);
}
.try[open] { display: flex; flex-direction: column; }
.try::backdrop { background: #09090b73; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 0 18px; }
.try-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.03em; }
.try-where { margin: 4px 18px 12px; font-size: 12px; color: var(--muted-foreground); }
.try-where code { font-size: 11px; }
.try-code {
  flex: 1 1 auto; min-height: 0; margin: 0 18px; padding: 12px 14px; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--muted); font: 12px/1.6 var(--font);
}
.try-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 18px 16px; }
.try-msg { font-size: 12px; color: var(--muted-foreground); }

@media (max-width: 600px) {
  .choices { gap: 8px; }
  .choice { padding: 10px 12px; font-size: 12px; }
  .ch-sub { font-size: 11px; }
  .code-b { font-size: 11.5px; line-height: 1.7; }
  .try-code { font-size: 11px; margin: 0 14px; padding: 10px 12px; }
  .try-head { padding-left: 14px; }
  .try-where { margin: 2px 14px 10px; }
  .try-actions { padding: 12px 14px 14px; }
}
