:root {
  --bg: #f3f7f7;
  --ink: #181a1f;
  --muted: #6c7280;
  --line: #d8e0e2;
  --panel: #fbfdfd;
  --panel-strong: #ffffff;
  --accent: #0d766e;
  --accent-dark: #064e49;
  --warn: #b43f2a;
  --success: #0c7a4b;
  --processing: #244c86;
  --blue: #244c86;
  --shadow: 0 20px 64px rgba(19, 32, 39, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(120deg, rgba(13, 118, 110, 0.12), transparent 34%),
    linear-gradient(280deg, rgba(36, 76, 134, 0.1), transparent 46%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 2px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
  font-weight: 850;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill {
  min-width: 112px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-pill.ok {
  border-color: rgba(13, 118, 110, 0.28);
  color: var(--accent-dark);
}

.status-pill.warn {
  border-color: rgba(180, 63, 42, 0.28);
  color: var(--warn);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.form-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

.result-panel {
  position: sticky;
  top: 18px;
  padding: 22px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.result-panel.is-success {
  border-color: rgba(12, 122, 75, 0.42);
  box-shadow: 0 20px 64px rgba(12, 122, 75, 0.13);
}

.result-panel.is-processing {
  border-color: rgba(36, 76, 134, 0.36);
  box-shadow: 0 20px 64px rgba(36, 76, 134, 0.12);
}

.result-panel.is-failed {
  border-color: rgba(180, 63, 42, 0.38);
  box-shadow: 0 20px 64px rgba(180, 63, 42, 0.11);
}

.panel-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

output {
  white-space: nowrap;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 850;
}

.plans {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plan-option {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.plan-option:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 118, 110, 0.42);
}

.plan-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.plan-option input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--accent);
}

.plan-option span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.plan-option strong {
  font-size: 15px;
}

.plan-option small {
  color: var(--muted);
  font-size: 12px;
}

.span-all {
  grid-column: 1 / -1;
}

.span-2 {
  grid-column: span 2;
}

[hidden] {
  display: none !important;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #30343b;
  font-size: 13px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

textarea {
  min-height: 162px;
  resize: vertical;
  padding: 12px 13px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 118, 110, 0.12);
  background: #fff;
}

.inline-actions,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.primary-button {
  min-height: 52px;
  background: var(--accent);
  color: white;
  font-weight: 820;
  box-shadow: 0 14px 34px rgba(13, 118, 110, 0.24);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.72;
  transform: none;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #252932;
  font-weight: 760;
}

.icon-button {
  inline-size: 34px;
  block-size: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-weight: 850;
}

.button-icon {
  inline-size: 20px;
  block-size: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 900;
}

.ghost-button .button-icon {
  background: rgba(13, 118, 110, 0.1);
  color: var(--accent-dark);
}

.summary-list {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.summary-list div {
  min-height: 52px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 720;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.timings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.timings div {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.timings span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.timings strong {
  font-size: 14px;
}

.history {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216, 211, 200, 0.72);
}

.history-item[data-status="success"] > span {
  color: var(--success);
}

.history-item[data-status="processing"] > span {
  color: var(--processing);
}

.history-item[data-status="failed"] > span {
  color: var(--warn);
}

.history-item strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  animation: settle 220ms ease;
}

.error-text {
  color: var(--warn);
}

.is-success #statusValue,
.is-success #resultState {
  color: var(--success);
}

.is-processing #statusValue,
.is-processing #resultState {
  color: var(--processing);
}

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

@media (max-width: 940px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 16px 0;
  }

  .workspace {
    min-height: calc(100svh - 32px);
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .form-panel,
  .result-panel {
    padding: 16px;
  }

  .plans,
  .timings {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .panel-head,
  output {
    white-space: normal;
  }
}
