/* Live Solv3R Thor GPU Studio — blends HF Space workflow into Keep Solving's studio palette. */
.studio-head {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 20px; align-items: start;
  margin-bottom: 22px;
}
@media (min-width: 860px) {
  .studio-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}
.studio-head h2 { margin-bottom: 8px; }
.studio-lede { max-width: none; color: var(--ink-soft); margin: 0; font-size: 0.99rem; line-height: 1.58; }
.studio-hw {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--rule-strong);
  font: 600 0.78rem/1 var(--f-mono); color: var(--ink-soft);
}
.studio-hw .hw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.studio-hw[data-state="ready"] { border-color: color-mix(in srgb, var(--good) 45%, var(--rule)); color: var(--ink); }
.studio-hw[data-state="ready"] .hw-dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.studio-hw[data-state="loading"] .hw-dot { background: var(--active); animation: st-pulse 1.1s ease-in-out infinite; }
.studio-hw[data-state="static"] { border-color: color-mix(in srgb, var(--active) 42%, var(--rule)); }
.studio-hw[data-state="static"] .hw-dot { background: var(--active); }
@keyframes st-pulse { 50% { opacity: 0.3; } }

/* Main two-column workbench */
.st-work {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start;
}
@media (min-width: 980px) {
  .st-work { grid-template-columns: 365px minmax(0, 1fr); gap: 20px; }
}
.st-in, .st-out { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.st-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 13px;
  padding: 13px; display: flex; flex-direction: column; gap: 10px;
}
.st-card-h { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.st-card-h span { font-family: var(--f-display); font-weight: 700; color: var(--ink); }
.st-card-h em { flex: 1; font: 500 0.72rem/1 var(--f-mono); font-style: normal; color: var(--muted); }
.st-link {
  border: 0; background: none; color: var(--solved); font: 600 0.76rem/1 var(--f-mono);
  cursor: pointer; padding: 2px 4px;
}
.st-link:hover { text-decoration: underline; }

/* Drop zones */
.st-drop {
  display: flex; align-items: center; gap: 11px; padding: 12px;
  border: 1.5px dashed var(--rule-strong); border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.st-drop svg { width: 22px; height: 22px; flex: none; color: var(--solved); }
.st-drop div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-drop b { font-weight: 700; color: var(--ink); font-size: 0.88rem; }
.st-drop span { font-size: 0.76rem; line-height: 1.45; }
.st-drop u { color: var(--solved); text-decoration: none; font-weight: 600; }
.st-drop:hover, .st-drop.over, .st-drop:focus-visible {
  border-color: var(--solved); border-style: solid; background: var(--tint);
}
.st-drop-main {
  flex-direction: column; text-align: center; justify-content: center; min-height: 168px; padding: 20px;
}
.st-drop-main svg { width: 30px; height: 30px; }
.st-drop-compact { padding: 9px 11px; }
.st-drop-compact svg { width: 17px; height: 17px; }

.st-in-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.st-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.st-strip:empty { display: none; }
.st-strip i {
  display: block; aspect-ratio: 1; border-radius: 5px;
  background: var(--surface-2) center / cover no-repeat;
  border: 1px solid var(--rule);
}
.st-strip i.up { opacity: 0.45; }
.st-strip i.more {
  display: grid; place-items: center; font: 600 0.7rem var(--f-mono); font-style: normal; color: var(--muted);
}
.st-in-info { font-size: 0.78rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.st-in-info .ok { color: var(--good); font-weight: 600; }
.st-in-info .wait { color: var(--active); font-weight: 600; }
.st-vid-preview {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--rule); margin-top: 6px;
}
.st-vid-preview video { width: 84px; height: 50px; object-fit: cover; border-radius: 5px; background: #000; }
.st-vid-ctl { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.st-mini-btn {
  align-self: flex-start; font: 600 0.76rem/1 var(--f-mono); padding: 6px 11px; border-radius: 7px;
  border: 1px solid var(--rule-strong); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.st-mini-btn:hover { border-color: var(--solved); }

/* Mode selector buttons */
.st-modes-main { display: flex; flex-direction: column; gap: 6px; }
.st-modes-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--rule);
  background: var(--surface-2); text-align: left; cursor: pointer; transition: all 0.14s;
}
.st-mode b { font-weight: 700; font-size: 0.84rem; color: var(--ink); }
.st-mode em { font-style: normal; font-size: 0.72rem; color: var(--muted); line-height: 1.25; }
.st-mode:hover { border-color: var(--rule-strong); }
.st-mode.on {
  border-color: var(--solved); background: var(--tint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--solved) 25%, transparent);
}
.st-mode.on b { color: var(--solved); }
.st-mode:disabled { opacity: 0.5; cursor: default; }

/* Params */
.st-params { display: flex; flex-direction: column; gap: 11px; padding-top: 4px; border-top: 1px solid var(--rule); }
.st-field { display: flex; flex-direction: column; gap: 4px; }
.st-field.dim { opacity: 0.48; }
.st-frow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.8rem; }
.st-frow label { color: var(--ink-soft); font-weight: 600; }
.st-frow output { font: 600 0.78rem/1 var(--f-mono); color: var(--solved); font-variant-numeric: tabular-nums; }
.st-field input[type="range"] { width: 100%; accent-color: var(--solved); cursor: pointer; margin: 0; }
.st-fhint { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

.st-seg { display: flex; padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; }
.st-seg button {
  flex: 1; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted);
  font: 600 0.76rem/1 var(--f-mono); cursor: pointer;
}
.st-seg button.on { background: var(--surface-2); color: var(--solved); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--solved) 40%, transparent); }

.st-tg { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; color: var(--ink-soft); font-size: 0.81rem; }
.st-tg input { display: none; }
.st-tg i {
  width: 28px; height: 16px; margin-top: 2px; border-radius: 9px; background: var(--rule-strong);
  position: relative; flex: none; transition: background 0.15s;
}
.st-tg i::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #d8e2ec; transition: transform 0.15s;
}
.st-tg input:checked + i { background: var(--solved); }
.st-tg input:checked + i::after { transform: translateX(12px); background: #04201c; }
.st-tg span { display: flex; flex-direction: column; gap: 1px; font-weight: 600; }
.st-tg em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }

/* Run / Stop / Status */
.st-run-row { display: flex; gap: 8px; }
.st-run {
  position: relative; flex: 1; height: 42px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #2cc8b1, #19a38f); color: #041d19;
  font-family: var(--f-display); font-weight: 800; font-size: 0.95rem;
  cursor: pointer; overflow: hidden; transition: filter 0.15s, transform 0.1s;
}
.st-run:hover { filter: brightness(1.08); }
.st-run:disabled { opacity: 0.55; cursor: default; }
.st-run-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #fff; transition: width 0.18s; }
.st-stop {
  flex: 1; height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--bad) 60%, transparent);
  background: color-mix(in srgb, var(--bad) 15%, transparent); color: #ffb3c4;
  font-family: var(--f-display); font-weight: 700; font-size: 0.92rem; cursor: pointer;
}
.st-stop svg { width: 13px; height: 13px; }
.st-stop:hover { background: color-mix(in srgb, var(--bad) 25%, transparent); }

.st-status {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 2px 0; font: 500 0.75rem/1.4 var(--f-mono); color: var(--muted);
}
.st-sp { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--solved); transition: width 0.2s; border-radius: 2px; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); flex: none; }
.st-status[data-kind="run"] .st-dot { background: var(--solved); animation: st-pulse 1s ease-in-out infinite; }
.st-status[data-kind="ok"] .st-dot { background: var(--good); }
.st-status[data-kind="err"] .st-dot { background: var(--bad); }
.st-status[data-kind="err"] .st-st { color: var(--bad); }
.st-st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Right 3D stage & overlays */
.st-stage-box { height: 760px; position: relative; }
@media (max-width: 640px) { .st-stage-box { height: 520px; } }
.st-stage { width: 100%; height: 100%; }

/* Export dropdown inside .s3r-slot */
.st-dl { position: relative; pointer-events: auto; }
.st-dl-btn {
  width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px;
  background: none; color: #c4d1df; cursor: pointer; padding: 0;
}
.st-dl-btn svg { width: 16px; height: 16px; }
.st-dl-btn:hover { color: #fff; background: rgba(56, 210, 188, 0.22); }
.st-dl-menu {
  position: absolute; right: 0; top: 34px; width: 290px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; border-radius: 11px;
  background: rgba(11, 15, 22, 0.97); border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65); z-index: 9; color: #e4ebf3;
}
.st-dl-note { margin: 0 0 4px; font-size: 11.5px; color: #8c9bae; }
.st-dl-note b { color: #6ce5d3; font-family: var(--f-mono); }
.st-exp {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04); color: #eef4fa; cursor: pointer; text-align: left;
}
.st-exp:hover { border-color: #38d2bc; background: rgba(56, 210, 188, 0.13); }
.st-exp span { display: flex; flex-direction: column; }
.st-exp b { font-size: 12.5px; font-weight: 700; }
.st-exp em { font-style: normal; font-size: 10.5px; color: #8c9bae; font-family: var(--f-mono); }
.st-dl-ic { font-family: var(--f-mono); font-size: 14px; color: #6ce5d3; }

/* Continue from here floating button above .s3r-foot */
.st-cont {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  display: none; align-items: center; gap: 6px; height: 32px; padding: 0 13px 0 10px;
  border-radius: 9px; border: 1px solid rgba(56, 210, 188, 0.55);
  background: rgba(11, 20, 26, 0.90); color: #e8fffb;
  font: 600 12px/1 var(--f-body); cursor: pointer; pointer-events: auto;
  backdrop-filter: blur(8px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.st-cont svg { width: 14px; height: 14px; color: #6ce5d3; }
.st-cont:hover, .st-cont.on { background: rgba(56, 210, 188, 0.24); border-color: #6ce5d3; color: #fff; }
.st-work.kept .s3r.has .st-cont { display: inline-flex; }

/* Below-stage summary, sparkline & Continue panel */
.st-below { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.st-sum-wrap { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.st-sumline { font: 500 0.78rem/1.5 var(--f-mono); color: var(--ink-soft); }
.st-sumline:empty { display: none; }
.st-sumline b { color: var(--solved); }
.st-spark {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 8px 10px;
}
.st-spark-h { display: flex; justify-content: space-between; font: 600 0.7rem/1 var(--f-mono); color: var(--muted); margin-bottom: 4px; }
.st-spark svg { width: 100%; height: 54px; display: block; }

.st-lab {
  width: 100%; max-width: 450px; margin-left: auto;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--solved) 45%, var(--rule));
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.st-lab-h { display: flex; flex-direction: column; gap: 2px; }
.st-lab-h b { font-size: 0.88rem; color: var(--ink); }
.st-lab-h span { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }
.st-add-list:empty { display: none; }
.st-lab-foot { display: flex; justify-content: flex-end; }
.st-go {
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--solved);
  background: var(--tint); color: var(--solved);
  font: 700 0.82rem/1 var(--f-mono); cursor: pointer;
}
.st-go:hover { background: var(--solved); color: var(--accent-ink); }
.st-go:disabled { opacity: 0.45; cursor: default; }

/* Built-in examples grid */
.st-examples { margin-top: 22px; }
.st-ex-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.st-ex-head b { font-family: var(--f-display); font-size: 1rem; color: var(--ink); }
.st-ex-head span { font-size: 0.84rem; color: var(--muted); }
.st-ex-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 820px) { .st-ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-ex {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 11px; border: 1px solid var(--rule);
  background: var(--surface); text-align: left; cursor: pointer; transition: all 0.14s;
}
.st-ex:hover { border-color: var(--rule-strong); background: var(--surface-2); }
.st-ex.on { border-color: var(--solved); background: var(--tint); }
.st-ex:disabled { opacity: 0.5; cursor: default; }
.st-ex-th { display: flex; gap: 3px; }
.st-ex-th i {
  display: block; width: 42px; height: 32px; border-radius: 4px;
  background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--rule);
}
.st-ex-txt { display: flex; flex-direction: column; min-width: 0; }
.st-ex-txt b { font-size: 0.86rem; color: var(--ink); font-weight: 700; }
.st-ex-txt em { font-style: normal; font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ex-mode {
  font: 600 0.7rem/1 var(--f-mono); padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--rule-strong); color: var(--solved);
  white-space: nowrap;
}

/* Toasts */
.st-toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.st-toast {
  padding: 9px 14px; border-radius: 10px; max-width: 360px;
  background: rgba(13, 20, 29, 0.96); border: 1px solid rgba(56, 210, 188, 0.45);
  color: #edf5fb; font: 500 0.8rem/1.4 var(--f-body);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s;
}
.st-toast.on { opacity: 1; transform: translateY(0); }
.st-toast.err { border-color: rgba(255, 102, 139, 0.65); color: #ffd4df; }
