:root {
  --bg: #071019;
  --bg-soft: #0a1520;
  --surface: rgba(15, 27, 39, 0.92);
  --surface-solid: #0f1b27;
  --surface-raised: #142231;
  --surface-hover: #182a3b;
  --border: rgba(137, 170, 202, 0.16);
  --border-strong: rgba(137, 170, 202, 0.28);
  --text: #edf5fb;
  --text-soft: #c4d2df;
  --muted: #8193a6;
  --accent: #55b8ff;
  --accent-strong: #2f9be8;
  --accent-soft: rgba(85, 184, 255, 0.12);
  --green: #42d392;
  --green-soft: rgba(66, 211, 146, 0.12);
  --red: #ff6b78;
  --red-soft: rgba(255, 107, 120, 0.12);
  --yellow: #f4bd63;
  --yellow-soft: rgba(244, 189, 99, 0.12);
  --orange: #ff9872;
  --state-running: var(--accent);
  --state-success: var(--green);
  --state-warning: var(--yellow);
  --state-error: var(--red);
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 18% -10%, rgba(52, 137, 214, 0.17), transparent 36%),
    radial-gradient(circle at 90% 12%, rgba(41, 191, 157, 0.10), transparent 30%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  color: var(--text);
  font: 14px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(85, 184, 255, 0.28);
  color: #fff;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(126, 151, 177, 0.28);
  background-clip: padding-box;
}

.page-orb {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
}

.page-orb-a {
  top: 90px;
  left: -180px;
  background: #2386d1;
}

.page-orb-b {
  right: -220px;
  bottom: 80px;
  background: #1c9e79;
}

.top {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(140, 170, 199, 0.12);
  background: rgba(7, 16, 25, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.top-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.top-meta,
.service-state,
.panel-title-wrap,
.field-footer,
.proxy-pool-label,
.btn-row,
.run-actions,
.runtime-top,
.runtime-progress-label,
.result-label-row,
.result-hero,
.queue-head,
.qtop,
.log-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(92, 190, 255, 0.38);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(70, 168, 237, 0.26), rgba(39, 100, 155, 0.08));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 8px 26px rgba(22, 108, 174, 0.2);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 4px;
  background: linear-gradient(135deg, #86d2ff, #40a7ed);
}

.brand-mark::before {
  left: 9px;
  top: 9px;
  width: 9px;
  height: 9px;
}

.brand-mark::after {
  right: 9px;
  bottom: 9px;
  width: 9px;
  height: 9px;
}

.brand-mark span {
  right: 9px;
  top: 9px;
  width: 9px;
  height: 9px;
  opacity: 0.48;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-copy p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.top-meta {
  justify-content: flex-end;
  gap: 10px;
}

.version-badge,
.service-state,
.hero-pills span,
.token-mode,
.green-pool-count,
.runtime-badge,
.result-status-pill,
.qstatus {
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
}

.version-badge {
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11px;
}

.service-state {
  min-height: 30px;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(66, 211, 146, 0.2);
  background: rgba(66, 211, 146, 0.07);
  color: var(--text-soft);
  font-size: 11px;
}

.dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(244, 189, 99, 0.10);
}

.dot.online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(66, 211, 146, 0.10), 0 0 14px rgba(66, 211, 146, 0.38);
}

.dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 107, 120, 0.10);
}

.main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 50px 0 58px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 28px;
}

.hero > div:first-child {
  max-width: 720px;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.hero h2 {
  margin-top: 9px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero p {
  max-width: 680px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.hero-pills {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-pills span {
  padding: 7px 11px;
  border: 1px solid var(--border);
  background: rgba(14, 27, 39, 0.72);
  color: var(--text-soft);
  font-size: 11px;
}

.panel,
.action-panel,
.res {
  border: 1px solid var(--border);
  background: linear-gradient(155deg, rgba(17, 31, 44, 0.96), rgba(11, 22, 32, 0.94));
  box-shadow: var(--shadow-sm);
}

.panel {
  margin-bottom: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-title-wrap {
  gap: 13px;
  min-width: 0;
}

.panel-step {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(85, 184, 255, 0.26);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #91d4ff;
  font-size: 11px;
  font-weight: 850;
}

.panel-title-wrap h3,
.proxy-heading strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.panel-title-wrap p,
.proxy-heading small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.token-mode {
  padding: 7px 12px;
  border: 1px solid rgba(85, 184, 255, 0.28);
  background: var(--accent-soft);
  color: #91d4ff;
  font-size: 11px;
}

.field-label,
.field-group label,
.proxy-pool-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.field-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(5, 13, 21, 0.68);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  display: block;
  min-height: 215px;
  resize: vertical;
  padding: 16px 17px;
  font: 13px/1.72 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.proxy-card textarea {
  min-height: 132px;
  padding: 13px 14px;
  font-size: 11px;
}

select,
input {
  min-height: 46px;
  padding: 0 42px 0 13px;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

textarea::placeholder,
input::placeholder {
  color: #526477;
}

textarea:hover,
select:hover,
input:hover {
  border-color: rgba(137, 178, 215, 0.38);
}

textarea:focus,
select:focus,
input:focus {
  border-color: rgba(85, 184, 255, 0.66);
  background-color: rgba(7, 17, 26, 0.88);
  box-shadow: 0 0 0 4px rgba(85, 184, 255, 0.08);
}

.field-footer {
  min-height: 36px;
  justify-content: space-between;
  gap: 14px;
  margin-top: 11px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.mode-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-group label {
  display: block;
  margin-bottom: 8px;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn-primary {
  border-color: rgba(111, 204, 255, 0.36);
  background: linear-gradient(135deg, #349fe7, #257fc1);
  color: #fff;
  box-shadow: 0 10px 28px rgba(38, 139, 207, 0.23);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4aafea, #2c8acf);
  box-shadow: 0 13px 34px rgba(38, 139, 207, 0.31);
}

.btn-secondary {
  border-color: rgba(85, 184, 255, 0.24);
  background: var(--accent-soft);
  color: #a7ddff;
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(85, 184, 255, 0.42);
  background: rgba(85, 184, 255, 0.18);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(143, 182, 218, 0.42);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-stop {
  border-color: rgba(255, 107, 120, 0.32);
  background: var(--red-soft);
  color: #ffadb5;
}

.btn-stop:hover:not(:disabled) {
  background: rgba(255, 107, 120, 0.18);
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.btn-lg {
  min-height: 50px;
  padding: 0 23px;
  font-size: 13px;
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
}

.btn-row,
.run-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.acct-info {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  word-break: break-word;
}

.acct-info.ok {
  color: var(--green);
}

.acct-info.err {
  color: var(--red);
}

.acct-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.acct-chip.email {
  cursor: pointer;
}

.proxy-panel {
  padding: 0;
  overflow: hidden;
}

.sec-h {
  width: 100%;
  min-height: 86px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.sec-h:hover {
  background: rgba(255, 255, 255, 0.018);
}

.proxy-heading {
  min-width: 0;
}

.fold-action {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ar {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 17px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.sec-h:not(.fold) .ar {
  transform: rotate(180deg);
  border-color: rgba(85, 184, 255, 0.32);
}

.sec-h.fold + .sec-b {
  display: none;
}

.sec-b {
  padding: 4px 24px 24px;
  border-top: 1px solid rgba(137, 170, 202, 0.1);
}

.proxy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 20px;
}

.proxy-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(5, 14, 22, 0.42);
}

.proxy-pool-label {
  justify-content: space-between;
  gap: 10px;
}

.proxy-help {
  min-height: 39px;
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.green-pool-count {
  display: inline-flex;
  min-width: 70px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 9px;
}

.green-pool-count.probing {
  border-color: rgba(244, 189, 99, 0.26);
  background: var(--yellow-soft);
  color: #ffd38a;
}

.green-pool-count.ready {
  border-color: rgba(66, 211, 146, 0.28);
  background: var(--green-soft);
  color: #8ce9bb;
}

.green-pool-count.empty {
  border-color: rgba(255, 107, 120, 0.28);
  background: var(--red-soft);
  color: #ffadb5;
}

.proxy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 22px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.action-copy {
  min-width: 220px;
}

.action-copy strong,
.action-copy > span:last-child {
  display: block;
}

.action-copy strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 16px;
}

.action-copy > span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.action-controls {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.res {
  display: none;
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.res.show {
  display: block;
}

.res.ok {
  border-color: rgba(66, 211, 146, 0.25);
}

.res.err {
  border-color: rgba(255, 107, 120, 0.28);
}

.progress-container {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.log-head {
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 9px;
  color: var(--muted);
  font-size: 10px;
}

.log-title {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.runtime-shell {
  --state: var(--state-running);
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(17, 31, 45, 0.98), rgba(8, 19, 29, 0.98));
  box-shadow: var(--shadow-lg);
}

.runtime-shell::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--state);
  box-shadow: 0 0 24px color-mix(in srgb, var(--state) 42%, transparent);
}

.runtime-shell.is-success {
  --state: var(--state-success);
}

.runtime-shell.is-error {
  --state: var(--state-error);
}

.runtime-shell.is-cancelled {
  --state: var(--state-warning);
}

.runtime-top {
  gap: 12px;
  margin-bottom: 18px;
}

.runtime-icon {
  display: flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--state) 34%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--state) 12%, transparent);
  color: var(--state);
  font-size: 18px;
  font-weight: 900;
}

.runtime-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
}

.runtime-badge {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--state) 26%, transparent);
  background: color-mix(in srgb, var(--state) 10%, transparent);
  color: var(--state);
  font-size: 10px;
}

.runtime-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.runtime-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 20, 0.34);
}

.runtime-ring {
  --pct: 0;
  position: relative;
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: conic-gradient(var(--state) calc(var(--pct) * 1%), rgba(78, 101, 124, 0.22) 0);
  box-shadow: 0 0 34px color-mix(in srgb, var(--state) 15%, transparent);
}

.runtime-ring::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #0b1824;
}

.runtime-ring-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.runtime-percent {
  color: var(--text);
  font-size: 37px;
  font-weight: 900;
  letter-spacing: -0.055em;
}

.runtime-state {
  max-width: 118px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.runtime-linear {
  width: 100%;
  height: 6px;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 116, 139, 0.18);
}

.runtime-linear > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--state);
  transition: width 0.25s ease;
}

.runtime-progress-label {
  width: 100%;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.runtime-progress-label strong {
  color: var(--state);
}

.runtime-detail {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 20, 0.34);
}

.runtime-detail-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.detail-log {
  height: 285px;
  overflow: auto;
  padding-right: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.detail-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(137, 170, 202, 0.13);
  line-height: 1.55;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-time {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.detail-msg {
  min-width: 0;
  color: var(--text-soft);
  font-size: 10px;
  word-break: break-word;
}

.detail-row.ok .detail-msg {
  color: #8ce9bb;
}

.detail-row.warn .detail-msg {
  color: #ffd18a;
}

.detail-row.err .detail-msg {
  color: #ffabb4;
}

.runtime-steps {
  margin-top: 15px;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.pstep {
  display: inline-flex;
  min-width: 100px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(4, 12, 20, 0.34);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.pstep-num {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(130, 154, 178, 0.16);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 850;
}

.pstep.done {
  border-color: rgba(66, 211, 146, 0.22);
  background: rgba(66, 211, 146, 0.06);
  color: #a2efca;
}

.pstep.done .pstep-num {
  background: var(--green);
  color: #062016;
}

.pstep.run {
  border-color: rgba(85, 184, 255, 0.30);
  background: rgba(85, 184, 255, 0.08);
  color: #9edcff;
}

.pstep.run .pstep-num {
  background: var(--accent);
  color: #061725;
}

.pstep.fail {
  border-color: rgba(255, 107, 120, 0.30);
  background: var(--red-soft);
  color: #ffb7be;
}

.pstep.fail .pstep-num {
  background: var(--red);
  color: #24070a;
}

.pstep.cancelled {
  border-color: rgba(244, 189, 99, 0.30);
  background: var(--yellow-soft);
  color: #ffd18a;
}

.pstep.cancelled .pstep-num {
  background: var(--yellow);
  color: #2b1b05;
}

.pstep.skipped {
  opacity: 0.5;
  border-style: dashed;
}

.runtime-raw,
.result-details {
  margin-top: 13px;
}

.runtime-raw summary,
.result-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  list-style: none;
}

.runtime-raw summary::-webkit-details-marker,
.result-details summary::-webkit-details-marker {
  display: none;
}

.runtime-raw summary::before,
.result-details summary::before {
  content: "+";
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
}

.runtime-raw[open] summary::before,
.result-details[open] summary::before {
  content: "−";
}

.runtime-raw pre {
  max-height: 250px;
  overflow: auto;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(3, 10, 17, 0.7);
  color: #91a8bd;
  font: 10px/1.55 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-container {
  padding: 24px;
}

.result-hero {
  gap: 13px;
  margin-bottom: 18px;
}

.result-hero-icon {
  display: flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(66, 211, 146, 0.30);
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.result-kicker {
  color: var(--green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.result-hero h2 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.25;
}

.result-hero p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.result-primary {
  padding: 16px;
  border: 1px solid rgba(66, 211, 146, 0.22);
  border-radius: var(--radius-md);
  background: rgba(66, 211, 146, 0.055);
}

.result-label-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}

.result-status-pill {
  padding: 4px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
}

.result-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-value {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(4, 12, 20, 0.46);
  color: var(--text-soft);
  font: 650 10px/1.55 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.result-value.link {
  padding: 12px 13px;
  border-color: rgba(66, 211, 146, 0.20);
  background: rgba(3, 20, 14, 0.58);
  color: #9cf0c5;
  font-size: 11px;
}

.result-value.status {
  color: var(--green);
}

.result-session {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  word-break: break-word;
}

.result-session strong {
  color: var(--text-soft);
}

.racts {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.result-details {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 20, 0.28);
}

.result-details summary {
  display: flex;
  align-items: center;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.result-field {
  min-width: 0;
}

.feedback-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.feedback-icon {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 900;
}

.feedback-card.error .feedback-icon {
  border: 1px solid rgba(255, 107, 120, 0.28);
  background: var(--red-soft);
  color: var(--red);
}

.feedback-card.warning .feedback-icon {
  border: 1px solid rgba(244, 189, 99, 0.28);
  background: var(--yellow-soft);
  color: var(--yellow);
}

.feedback-copy h3 {
  margin-top: 1px;
  font-size: 15px;
}

.feedback-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  word-break: break-word;
}

.rlink {
  display: none;
}

.queue-card {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.queue-card.show {
  display: block;
}

.queue-head,
.qtop {
  justify-content: space-between;
  gap: 10px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.qitem {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(4, 12, 20, 0.42);
}

.qemail {
  min-width: 0;
  color: var(--text-soft);
  font-weight: 750;
  word-break: break-all;
}

.qstatus {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 9px;
}

.qitem.run .qstatus {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.qitem.ok .qstatus {
  background: var(--green-soft);
  color: var(--green);
}

.qitem.err .qstatus {
  background: var(--red-soft);
  color: var(--red);
}

.qmeta,
.qurl,
.qerr {
  margin-top: 6px;
  font-size: 10px;
}

.qmeta {
  color: var(--muted);
}

.qurl {
  color: var(--green);
  font-family: monospace;
  word-break: break-all;
}

.qerr {
  color: var(--red);
}

.qacts {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(14, 27, 39, 0.96);
  box-shadow: var(--shadow-lg);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.toast.show {
  display: block;
  animation: toast-in 0.2s ease-out;
}

.toast.ok {
  border-color: rgba(66, 211, 146, 0.28);
  color: #a2efca;
}

.toast.err {
  border-color: rgba(255, 107, 120, 0.28);
  color: #ffb7be;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ft {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(137, 170, 202, 0.10);
  color: #607386;
  font-size: 10px;
}

@media (max-width: 960px) {
  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proxy-grid {
    grid-template-columns: 1fr;
  }

  .proxy-help {
    min-height: 0;
  }

  .action-panel,
  .action-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-controls {
    width: 100%;
  }

  .runtime-body {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .top-inner,
  .main,
  .ft {
    width: min(calc(100% - 24px), 1100px);
  }

  .top-inner {
    min-height: 66px;
  }

  .brand-copy p,
  .version-badge {
    display: none;
  }

  .main {
    padding: 32px 0 40px;
  }

  .hero {
    display: block;
    margin-bottom: 22px;
  }

  .hero p {
    font-size: 12px;
  }

  .hero-pills {
    justify-content: flex-start;
    margin-top: 15px;
  }

  .panel,
  .result-container {
    padding: 18px;
    border-radius: var(--radius-md);
  }

  .mode-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .field-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .field-footer,
  .proxy-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .sec-h {
    min-height: 78px;
    padding: 17px 18px;
  }

  .fold-action > span:first-child,
  .proxy-heading small {
    display: none;
  }

  .sec-b {
    padding: 4px 18px 18px;
  }

  .action-panel {
    padding: 18px;
  }

  .run-actions,
  .run-actions .btn {
    width: 100%;
  }

  .run-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .runtime-shell {
    padding: 17px;
    border-radius: var(--radius-md);
  }

  .runtime-body {
    grid-template-columns: 1fr;
  }

  .runtime-overview {
    max-width: 330px;
    width: 100%;
    margin: 0 auto;
  }

  .detail-log {
    height: 260px;
  }

  .progress-steps {
    grid-auto-flow: column;
    grid-auto-columns: minmax(110px, 42vw);
    grid-template-columns: none;
    scroll-snap-type: x proximity;
  }

  .pstep {
    scroll-snap-align: start;
  }

  .racts {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .racts .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-copy h1 {
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .service-state {
    padding: 5px 8px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .hero-pills span {
    padding: 6px 9px;
    font-size: 9px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-title-wrap {
    gap: 10px;
  }

  .token-mode {
    padding: 5px 8px;
  }

  textarea {
    min-height: 180px;
  }

  .proxy-card textarea {
    min-height: 118px;
  }

  .runtime-top {
    align-items: flex-start;
  }

  .runtime-title {
    font-size: 16px;
  }

  .runtime-badge {
    padding: 6px 9px;
  }

  .runtime-ring {
    width: 140px;
    height: 140px;
  }

  .runtime-percent {
    font-size: 32px;
  }

  .detail-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 7px;
  }

  .result-primary,
  .result-details {
    padding: 12px;
  }

  .racts {
    grid-template-columns: 1fr;
  }

  .toast {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .ft {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
