:root {
  color-scheme: dark;
  --bg: #080b0b;
  --panel: rgba(16, 21, 20, 0.88);
  --panel-strong: #111715;
  --line: rgba(193, 234, 215, 0.12);
  --line-bright: rgba(119, 255, 185, 0.28);
  --text: #edf7f1;
  --muted: #80938a;
  --green: #6df3ad;
  --green-dim: #1c9b61;
  --amber: #f3c66d;
  --red: #ff7c72;
  --blue: #80c7ff;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(109, 243, 173, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 243, 173, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--sans);
}

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

.ambient { position: fixed; pointer-events: none; filter: blur(100px); opacity: .11; border-radius: 50%; }
.ambient-one { width: 420px; height: 420px; top: -180px; right: 8%; background: var(--green); }
.ambient-two { width: 360px; height: 360px; bottom: 5%; left: -180px; background: #2a78ff; opacity: .07; }

.shell { position: relative; z-index: 1; width: min(1500px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 100px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 16px; align-items: center; }
.mark { position: relative; width: 44px; height: 44px; border: 1px solid var(--line-bright); border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 22px rgba(109,243,173,.08); }
.mark::before, .mark::after, .mark span { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--green); }
.mark::before { width: 25px; height: 25px; border-left-color: transparent; transform: rotate(35deg); }
.mark::after { width: 9px; height: 9px; background: var(--green); box-shadow: 0 0 13px var(--green); }
.mark span { width: 34px; height: 34px; border-color: rgba(109,243,173,.18); }
.eyebrow { margin: 0 0 6px; color: var(--green); font: 600 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; } h1 span { color: var(--muted); font-weight: 450; }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 12px var(--mono); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.pulse.online { background: var(--green); box-shadow: 0 0 10px var(--green); }
.pulse.offline { background: var(--red); box-shadow: 0 0 10px var(--red); }

main { padding: 16px 0 50px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.16); backdrop-filter: blur(16px); }
.workspace-bar { margin-top: 20px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.project-picker { min-width: min(460px, 100%); }
.project-picker .eyebrow { margin-bottom: 5px; }
.project-picker select { height: 35px; border-color: var(--line-bright); }
.workspace-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.workspace-path { max-width: 340px; margin-right: 7px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hero { padding: 34px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, .7fr); gap: 40px; background: radial-gradient(circle at 10% 0, rgba(109,243,173,.08), transparent 34%), var(--panel); }
.status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; }
.status-badge { padding: 7px 11px; border-radius: 999px; background: rgba(128,199,255,.1); border: 1px solid rgba(128,199,255,.24); color: var(--blue); font: 600 11px var(--mono); text-transform: uppercase; }
.status-badge.running { color: var(--green); border-color: rgba(109,243,173,.3); background: rgba(109,243,173,.1); }
.status-badge.failed, .status-badge.interrupted { color: var(--red); border-color: rgba(255,124,114,.3); background: rgba(255,124,114,.1); }
.runtime-label { color: var(--muted); font: 12px var(--mono); }
.hero h2 { margin-bottom: 8px; max-width: 720px; font-size: clamp(34px, 5vw, 62px); line-height: .98; letter-spacing: -.055em; }
.project-path { color: var(--muted); font-size: 12px; word-break: break-all; }
.mono { font-family: var(--mono); }
.active-phase { display: flex; gap: 15px; align-items: center; max-width: 700px; margin-top: 35px; padding-top: 22px; border-top: 1px solid var(--line); }
.phase-index { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-bright); color: var(--green); border-radius: 11px; font: 600 12px var(--mono); }
.active-phase strong { font-size: 14px; }
.active-phase p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.run-card { align-self: stretch; background: rgba(4,8,7,.48); border: 1px solid var(--line); border-radius: 13px; padding: 22px; }
.run-card-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.run-card h3, .section-heading h3 { margin-bottom: 0; font-size: 18px; letter-spacing: -.025em; }
.run-indicator { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #34423b; }
.run-indicator.running { background: var(--green); box-shadow: 0 0 13px var(--green); animation: breathe 1.7s infinite; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 22px 0 17px; }
label span { display: block; margin-bottom: 7px; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
input, select, textarea { width: 100%; padding: 0 11px; color: var(--text); background: #0a0f0d; border: 1px solid var(--line); border-radius: 8px; outline: none; }
input, select { height: 39px; }
textarea { min-height: 88px; padding-top: 10px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--green-dim); box-shadow: 0 0 0 3px rgba(109,243,173,.06); }
.input-unit { position: relative; }.input-unit small { position: absolute; right: 11px; top: 11px; color: var(--muted); font-family: var(--mono); }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { color: var(--muted); font: 11px var(--mono); cursor: pointer; }
.advanced-grid { margin-bottom: 4px; }
.completion-feedback { margin-top: 17px; padding: 15px; border: 1px solid rgba(243,198,109,.24); border-radius: 10px; background: rgba(243,198,109,.045); }
.completion-feedback textarea { min-height: 105px; }
.completion-feedback > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
button { border: 0; border-radius: 9px; }
.primary { flex: 1; height: 43px; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; background: var(--green); color: #07110c; font-weight: 750; }
.primary:hover { background: #8bffc1; }.primary:disabled { opacity: .38; cursor: not-allowed; }
.primary.compact { flex: 0 0 auto; gap: 20px; height: 36px; }
.secondary { height: 36px; padding: 0 13px; color: var(--text); background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.secondary:hover { border-color: var(--line-bright); background: rgba(109,243,173,.04); }
.danger { padding: 0 17px; color: var(--red); border: 1px solid rgba(255,124,114,.25); background: rgba(255,124,114,.07); }
.danger:disabled { opacity: .3; cursor: not-allowed; }
.form-message { min-height: 16px; margin: 10px 0 0; color: var(--red); font: 11px var(--mono); }

.metrics { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric { padding: 19px 21px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; width: 60px; height: 60px; right: -24px; bottom: -30px; border: 1px solid var(--line-bright); transform: rotate(45deg); }
.metric span, .metric small { display: block; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin: 8px 0 3px; font-size: 31px; letter-spacing: -.04em; }

.content-grid { margin-top: 16px; display: grid; grid-template-columns: 1.45fr .75fr; gap: 16px; }
.content-grid > .panel, .console-panel { padding: 24px; }
.count { color: var(--muted); font: 10px var(--mono); }
.timeline { margin-top: 22px; }
.timeline-item { width: 100%; display: grid; grid-template-columns: 21px 1fr auto 18px; gap: 12px; padding: 9px 8px 20px 0; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; }
.timeline-item:hover, .timeline-item:focus-visible { background: rgba(109,243,173,.035); border-color: var(--line); outline: none; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-node { position: relative; width: 10px; height: 10px; margin: 4px auto 0; border: 2px solid var(--green); border-radius: 50%; background: var(--panel-strong); }
.timeline-node::after { content: ""; position: absolute; top: 11px; left: 3px; width: 1px; height: calc(100% + 16px); background: var(--line); }
.timeline-item:last-child .timeline-node::after { display: none; }
.timeline-main strong { display: block; font-size: 13px; text-transform: capitalize; }
.timeline-main p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.outcome { align-self: start; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.outcome.accept, .outcome.verified, .outcome.complete { color: var(--green); border-color: rgba(109,243,173,.25); }
.outcome.error, .outcome.reject { color: var(--red); border-color: rgba(255,124,114,.25); }
.timeline-arrow { align-self: start; color: var(--green); font: 13px var(--mono); opacity: .55; transition: transform .15s ease, opacity .15s ease; }
.timeline-item:hover .timeline-arrow, .timeline-item:focus-visible .timeline-arrow { opacity: 1; transform: translateX(2px); }
.uncertainty { min-height: 90px; margin: 24px 0; padding: 17px; background: rgba(243,198,109,.05); border-left: 2px solid var(--amber); color: #d8c99f; font-size: 13px; line-height: 1.55; }
.target-profile { padding-top: 18px; border-top: 1px solid var(--line); }
.target-profile > span { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }.target-profile > strong { display: block; margin: 7px 0 12px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }.chip { padding: 5px 7px; color: var(--green); background: rgba(109,243,173,.06); border: 1px solid rgba(109,243,173,.16); border-radius: 5px; font: 9px var(--mono); }

.lower-grid { grid-template-columns: 1.3fr .9fr; }
.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 9px 10px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font: 9px var(--mono); text-transform: uppercase; }
td { padding: 12px 10px; border-bottom: 1px solid rgba(193,234,215,.07); }
td:first-child { color: var(--muted); font-family: var(--mono); }
.result-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--muted); }.state-dot.success, .state-dot.pass { background: var(--green); }.state-dot.error, .state-dot.fail { background: var(--red); }.state-dot.inconclusive, .state-dot.skipped { background: var(--amber); }
.test-list { margin-top: 17px; display: grid; gap: 8px; }
.test-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 10px; background: rgba(255,255,255,.018); border-radius: 8px; }
.test-row strong { font-size: 11px; font-weight: 600; }.test-row small { color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }

.console-panel { margin-top: 16px; }
.console-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font: 10px var(--mono); }
.console-meta button { padding: 5px 8px; color: var(--muted); background: transparent; border: 1px solid var(--line); }
pre { height: 250px; margin: 18px 0 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #050807; color: #a9c7b8; font: 11px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.empty { color: var(--muted); font-size: 12px; }
footer { display: flex; justify-content: space-between; padding: 17px 0 28px; border-top: 1px solid var(--line); color: #52635b; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }

dialog { width: min(620px, calc(100% - 30px)); max-height: min(880px, calc(100vh - 30px)); padding: 0; overflow: auto; color: var(--text); background: #0d1311; border: 1px solid var(--line-bright); border-radius: 16px; box-shadow: 0 30px 100px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(1,4,3,.78); backdrop-filter: blur(5px); }
.dialog-card { padding: 26px; }
.dialog-card.create-card { width: min(920px, calc(100vw - 30px)); }
#newProjectDialog { width: min(920px, calc(100% - 30px)); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 0; font-size: 25px; letter-spacing: -.035em; }
.dialog-copy { margin: 14px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dialog-copy code { color: var(--green); font-family: var(--mono); }
.icon-button { width: 33px; height: 33px; flex: 0 0 auto; color: var(--muted); background: transparent; border: 1px solid var(--line); font-size: 21px; }
.wizard-section { display: flex; align-items: center; gap: 13px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-section:first-of-type { margin-top: 0; }
.wizard-section h3 { margin-bottom: 3px; font-size: 15px; }
.wizard-section p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.section-number { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; color: var(--green); border: 1px solid var(--line-bright); border-radius: 9px; font: 600 10px var(--mono); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 17px; }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .wide { grid-column: span 2; }
.checkbox-label { min-height: 39px; display: flex; align-items: center; gap: 9px; align-self: end; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.checkbox-label input { width: 15px; height: 15px; accent-color: var(--green); }
.checkbox-label span { margin: 0; color: var(--text); font-size: 9px; }
.hidden { display: none !important; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.dialog-actions .primary { min-width: 170px; }
.iteration-dialog { width: min(920px, calc(100% - 30px)); }
.iteration-dialog-card { padding: 28px; }
.iteration-detail-summary { margin: 8px 0 0; color: var(--muted); font: 11px var(--mono); }
.iteration-detail-content { display: grid; gap: 14px; margin-top: 24px; }
.iteration-record { padding: 18px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 11px; }
.iteration-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.iteration-record-heading h3 { margin: 0; font-size: 15px; text-transform: capitalize; }
.iteration-record-fields { display: grid; gap: 14px; margin-top: 15px; }
.iteration-detail-field { min-width: 0; }
.iteration-detail-label { display: block; margin-bottom: 6px; color: var(--green); font: 600 9px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.iteration-detail-value { margin: 0; color: #d7e6de; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.iteration-detail-json { height: auto; max-height: 420px; margin: 0; padding: 13px; color: #b8d1c4; font-size: 10px; line-height: 1.55; }

@keyframes breathe { 50% { opacity: .4; transform: scale(.8); } }

@media (max-width: 980px) {
  .hero, .content-grid, .lower-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .status-row { margin-bottom: 28px; }
  .workspace-bar { align-items: stretch; flex-direction: column; }
  .workspace-actions { justify-content: flex-start; flex-wrap: wrap; }
  .workspace-path { width: 100%; max-width: none; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1500px); }
  .topbar { height: 80px; }.connection { font-size: 0; }
  .hero { padding: 21px; }.hero h2 { font-size: 36px; }
  .field-grid { grid-template-columns: 1fr; }
  .form-grid.three-columns { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }.metric { padding: 15px; }
  .content-grid > .panel, .console-panel { padding: 18px; }
  .actions { flex-direction: column; }.danger { height: 40px; }
  .workspace-actions .secondary, .workspace-actions .primary { flex: 1; }
  .dialog-card { padding: 20px; }
}
