:root {
  --bg: #221633;
  --bg-deep: #170e26;
  --panel: rgba(45, 29, 72, 0.74);
  --panel-solid: #2b1c44;
  --panel-2: #35224f;
  --border: rgba(178, 146, 255, 0.22);
  --border-soft: rgba(178, 146, 255, 0.13);
  --border-strong: rgba(217, 122, 224, 0.45);
  --text: #f2eaff;
  --muted: #b8a5d8;
  --muted-2: #8f7bab;
  --accent: #d97ae0;
  --accent-2: #a78bfa;
  --ok: #7fe3c3;
  --warn: #f2c66d;
  --danger: #ff8fae;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "URW Gothic", "Century Gothic", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #170e26; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background-color: #1b1129;
  background-repeat: no-repeat;
  background-size: cover;
  background-image:
    radial-gradient(1100px 700px at 85% -10%, rgba(140, 92, 220, 0.30), transparent 62%),
    radial-gradient(900px 620px at 8% 0%, rgba(217, 122, 224, 0.16), transparent 58%),
    radial-gradient(1200px 900px at 50% 115%, rgba(120, 80, 190, 0.20), transparent 65%),
    linear-gradient(180deg, #2a1c41 0%, #221633 42%, #1b1129 100%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1.2px 1.2px at 18% 22%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 72% 14%, rgba(255, 255, 255, 0.75), transparent 60%),
    radial-gradient(1.4px 1.4px at 41% 68%, rgba(230, 214, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 88% 54%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 12% 82%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 63% 91%, rgba(255, 255, 255, 0.7), transparent 60%);
  background-size: 420px 420px, 360px 360px, 520px 520px, 300px 300px, 460px 460px, 380px 380px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 49.7%, rgba(167, 139, 250, 0.05) 50%, transparent 50.3%),
    linear-gradient(60deg, transparent 49.8%, rgba(217, 122, 224, 0.04) 50%, transparent 50.2%);
  background-size: 640px 640px, 780px 780px;
  opacity: 0.6;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #cbb8ff; text-decoration: underline; }

.wrap { position: relative; z-index: 1; width: min(1000px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 80px;
  min-height: 100vh; display: flex; flex-direction: column; }
.wrap > * { flex: none; }
.wrap > .footer { margin-top: auto; }
.wrap.wide { width: min(1240px, calc(100% - 32px)); }

header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 42px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; display: grid; place-items: center; color: #f6ecff; flex: none;
  background: linear-gradient(145deg, rgba(217, 122, 224, 0.75), rgba(167, 139, 250, 0.45));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 0 32px rgba(217, 122, 224, 0.35);
}
.brand h1 { font-size: 15px; margin: 0; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; }
.brand p { margin: 4px 0 0; font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.2em; text-transform: uppercase; }
.header-links { display: flex; gap: 20px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.header-links a { color: var(--muted); }

.hero { position: relative; margin-bottom: 40px; padding: 8px 0 0; }
.hero::before,
.hero::after {
  content: ""; position: absolute; pointer-events: none; z-index: -1;
}
.hero::before {
  right: 2%; top: -26px; width: 170px; height: 170px;
  background: linear-gradient(140deg, rgba(217, 122, 224, 0.30), rgba(167, 139, 250, 0.02));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform: rotate(14deg);
}
.hero::after {
  right: 24%; top: 70px; width: 64px; height: 64px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(167, 139, 250, 0.05);
}
.overline {
  display: block; margin-bottom: 14px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.42em; text-transform: uppercase; color: var(--accent);
}
.hero h2 {
  font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 16px;
  letter-spacing: 0.01em; font-weight: 700;
  background: linear-gradient(100deg, #ffffff 12%, #e7d4ff 52%, #d97ae0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 640px; line-height: 1.75; }

.grid { display: grid; gap: 22px; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 1.15fr 0.85fr; align-items: start; } }

.card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(60, 39, 92, 0.62), rgba(32, 20, 50, 0.86));
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 60px -42px rgba(0, 0, 0, 0.95);
}
.card::before {
  content: ""; position: absolute; top: -1px; left: 22px; right: 45%;
  height: 1px; background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.8;
}
.card + .card { margin-top: 22px; }
.card h3 {
  margin: 0 0 6px; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: #f4eaff; font-weight: 600;
}
.card .sub { margin: 0 0 22px; color: var(--muted-2); font-size: 12.5px; line-height: 1.6; }

label.field { display: block; margin-bottom: 18px; }
label.field > span {
  display: block; margin-bottom: 8px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
label.field small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 11.5px; line-height: 1.55; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], select {
  width: 100%; padding: 12px 14px; border-radius: 8px; font-size: 14px;
  background: rgba(18, 10, 30, 0.62); color: var(--text);
  border: 1px solid var(--border); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font-family: var(--sans);
}
input::placeholder { color: #6d5b8a; }
input:focus, select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(217, 122, 224, 0.14);
  background: rgba(18, 10, 30, 0.85);
}
input:disabled { opacity: 0.55; }

.row { display: grid; gap: 16px; }
@media (min-width: 620px) { .row.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 620px) { .row.three { grid-template-columns: 1fr 1fr 1fr; } }

button {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; cursor: pointer;
  letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: 8px; border: 1px solid var(--border); padding: 11px 18px;
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: transform 0.06s, border-color 0.15s, background 0.15s, filter 0.15s;
}
button:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(217, 122, 224, 0.08); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary {
  width: 100%; padding: 15px 20px; color: #1b0e2b; border: none;
  background: linear-gradient(100deg, #d97ae0 0%, #c48cf5 48%, #a78bfa 100%);
  box-shadow: 0 16px 40px -22px rgba(217, 122, 224, 0.9);
}
button.primary:hover:not(:disabled) { filter: brightness(1.07); }
button.ghost { background: transparent; }
button.danger { color: var(--danger); border-color: rgba(255, 143, 174, 0.35); background: rgba(255, 143, 174, 0.06); }
button.sm { padding: 7px 12px; font-size: 10px; border-radius: 6px; letter-spacing: 0.12em; }

.consent { display: flex; gap: 11px; align-items: flex-start; margin: 6px 0 22px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.consent input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--muted); background: rgba(255, 255, 255, 0.02);
}
.badge.ok { color: var(--ok); border-color: rgba(127, 227, 195, 0.35); background: rgba(127, 227, 195, 0.08); }
.badge.err { color: var(--danger); border-color: rgba(255, 143, 174, 0.35); background: rgba(255, 143, 174, 0.08); }
.badge.warn { color: var(--warn); border-color: rgba(242, 198, 109, 0.35); background: rgba(242, 198, 109, 0.08); }
.badge.run { color: var(--accent-2); border-color: rgba(167, 139, 250, 0.4); background: rgba(167, 139, 250, 0.1); }

.steps { display: grid; gap: 9px; margin: 0 0 24px; }
.steps .step {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  border: 1px solid var(--border-soft); border-radius: 8px;
  background: rgba(255, 255, 255, 0.015); color: var(--muted-2);
}
.steps .step .dot {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: rgba(167, 139, 250, 0.10);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.steps .step .txt { font-size: 12.5px; letter-spacing: 0.02em; }
.steps .step .txt small { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 3px; letter-spacing: 0.02em; }
.steps .step.active { border-color: rgba(167, 139, 250, 0.45); background: rgba(167, 139, 250, 0.07); color: var(--text); }
.steps .step.active .dot { background: rgba(167, 139, 250, 0.35); color: #fff; box-shadow: 0 0 18px rgba(167, 139, 250, 0.45); }
.steps .step.done { color: var(--text); }
.steps .step.done .dot { background: linear-gradient(140deg, rgba(217, 122, 224, 0.55), rgba(167, 139, 250, 0.5)); color: #fff; }
.steps .step.fail { border-color: rgba(255, 143, 174, 0.35); background: rgba(255, 143, 174, 0.06); color: var(--text); }
.steps .step.fail .dot { background: rgba(255, 143, 174, 0.3); color: #fff; }

.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.8;
  background: rgba(12, 6, 21, 0.72); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  color: #bda9dd;
}
.log .ev { display: block; }
.log .ev.step { color: #b9a0ff; }
.log .ev.ok { color: var(--ok); }
.log .ev.warn { color: var(--warn); }
.log .ev.error { color: var(--danger); }
.log .ev.info { color: #c3b2dc; }
.log .empty { color: var(--muted-2); font-style: italic; }

.result {
  position: relative; padding: 24px; margin-bottom: 20px; border-radius: 10px;
  border: 1px solid rgba(127, 227, 195, 0.35);
  background: linear-gradient(160deg, rgba(127, 227, 195, 0.10), rgba(45, 29, 72, 0.3) 62%);
}
.result::after {
  content: ""; position: absolute; top: 0; right: 0; width: 86px; height: 86px;
  background: linear-gradient(225deg, rgba(127, 227, 195, 0.18), transparent 65%);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.result.fail { border-color: rgba(255, 143, 174, 0.4); background: linear-gradient(160deg, rgba(255, 143, 174, 0.10), rgba(45, 29, 72, 0.3) 62%); }
.result.fail::after { background: linear-gradient(225deg, rgba(255, 143, 174, 0.2), transparent 65%); }
.result.warn { border-color: rgba(242, 198, 109, 0.4); background: linear-gradient(160deg, rgba(242, 198, 109, 0.09), rgba(45, 29, 72, 0.3) 62%); }
.result.warn::after { background: linear-gradient(225deg, rgba(242, 198, 109, 0.18), transparent 65%); }
.result .caption { color: var(--muted-2); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.result .big {
  font-size: 28px; font-weight: 700; letter-spacing: 0.01em; margin: 6px 0 6px; color: var(--ok);
}
.result.warn .big { color: var(--warn); }
.result.fail .big { color: var(--danger); }
#result-text, #status-text {
  text-transform: none; letter-spacing: 0.01em; font-size: 12.5px; line-height: 1.65;
  color: var(--muted); margin-top: 2px;
}
.kv { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: 18px; }
.kv div { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); }
.kv div b { display: block; color: var(--text); font-size: 13px; font-weight: 600; margin-top: 5px; font-family: var(--mono); letter-spacing: 0.02em; text-transform: none; }

.note {
  border-left: 2px solid rgba(167, 139, 250, 0.6); padding: 11px 15px;
  background: rgba(167, 139, 250, 0.06); border-radius: 0 8px 8px 0;
  color: var(--muted); font-size: 12px; line-height: 1.65;
}
.note.warn { border-color: rgba(242, 198, 109, 0.65); background: rgba(242, 198, 109, 0.07); }
.note + .note { margin-top: 10px; }

.hint-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.hint-list li { display: flex; gap: 13px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.hint-list .n {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: var(--accent); background: rgba(217, 122, 224, 0.10);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
code, .code {
  font-family: var(--mono); font-size: 11.5px; background: rgba(12, 6, 21, 0.65);
  border: 1px solid var(--border-soft); padding: 3px 7px; border-radius: 5px; color: #d9c6ff;
  overflow-wrap: anywhere;
}
.codeblock {
  position: relative; background: rgba(12, 6, 21, 0.72); border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 14px 48px 14px 14px; font-family: var(--mono); font-size: 11.5px;
  color: #d9c6ff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6;
}
.codeblock button { position: absolute; top: 8px; right: 8px; padding: 5px 9px; font-size: 9px; }

.alert { padding: 12px 15px; border-radius: 8px; font-size: 12.5px; margin-bottom: 18px; display: none; }
.alert.show { display: block; }
.alert.err { background: rgba(255, 143, 174, 0.08); border: 1px solid rgba(255, 143, 174, 0.32); color: #ffd1dd; }
.alert.ok { background: rgba(127, 227, 195, 0.08); border: 1px solid rgba(127, 227, 195, 0.32); color: #c8f7e8; }

.session-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 24px; border-radius: 8px;
  border: 1px solid rgba(217, 122, 224, 0.3);
  background: linear-gradient(100deg, rgba(217, 122, 224, 0.12), rgba(167, 139, 250, 0.05));
}
.session-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.session-info b { font-family: var(--mono); font-size: 12px; color: #f3d9ff; font-weight: 600; }
.session-label { color: var(--muted-2); font-size: 11px; }
.button-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 6px 0 12px; }
@media (max-width: 420px) { .button-row { grid-template-columns: 1fr; } }

.hidden { display: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--muted-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid var(--border-soft); color: var(--muted); vertical-align: middle; }
tr:hover td { background: rgba(217, 122, 224, 0.03); }
td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.table-wrap { overflow-x: auto; margin: 0 -8px; }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  position: relative; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(180deg, rgba(60, 39, 92, 0.5), rgba(32, 20, 50, 0.8));
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.stat span { font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.18em; padding-left: 10px; }
.stat b { display: block; font-size: 30px; margin-top: 8px; padding-left: 10px; letter-spacing: -0.01em; font-weight: 700; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 10px 16px; color: var(--muted-2); font-size: 10.5px; letter-spacing: 0.18em;
}
.tab:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--muted); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 5, 18, 0.82); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  width: min(900px, 100%); max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, #30204a, #221633);
  border: 1px solid var(--border); border-radius: 12px; padding: 26px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}
.modal h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }
.modal .pre {
  font-family: var(--mono); font-size: 11px; line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; background: rgba(12, 6, 21, 0.75); border: 1px solid var(--border-soft);
  padding: 14px; border-radius: 8px; max-height: 46vh; overflow: auto; color: #bda9dd;
}
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.section-title { margin: 22px 0 10px; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.activity-list { display: grid; gap: 8px; margin-bottom: 6px; }
.activity { border: 1px solid var(--border-soft); border-radius: 8px; background: rgba(255, 255, 255, 0.015); padding: 0 12px; }
.activity summary { display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; font-size: 12px; list-style: none; flex-wrap: wrap; }
.activity summary::-webkit-details-marker { display: none; }
.activity-n {
  width: 22px; height: 22px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: rgba(217, 122, 224, 0.12); color: var(--accent); flex: none;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.activity-kind { font-weight: 600; color: var(--text); letter-spacing: 0.04em; }
.activity-time { color: var(--muted-2); font-size: 10.5px; margin-left: auto; letter-spacing: 0.04em; }
.activity-body { padding: 0 0 12px 32px; display: grid; gap: 8px; }
.activity-body .pre { max-height: 260px; }

.codes { display: grid; gap: 8px; margin-top: 14px; }
.code-row {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: rgba(12, 6, 21, 0.6); border: 1px dashed rgba(217, 122, 224, 0.4);
  border-radius: 8px; padding: 10px 14px; font-family: var(--mono); font-size: 12.5px; color: #f0d8ff;
}

.footer {
  margin-top: 42px; text-align: center; font-size: 9.5px; color: var(--muted-2);
  letter-spacing: 0.26em; text-transform: uppercase; line-height: 1.9;
}
.spin {
  width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor; border-radius: 50%; display: inline-block;
  animation: spin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .wrap { padding-top: 26px; }
  .card { padding: 20px; }
  header.top { margin-bottom: 30px; }
  .header-links { font-size: 10px; gap: 12px; }
  .hero::before { width: 110px; height: 110px; right: -8px; opacity: 0.6; }
  .hero::after { display: none; }
  .brand p { display: none; }
  .result .big { font-size: 24px; }
  .activity-time { width: 100%; margin-left: 32px; }
}
