:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --ink: #172026;
  --muted: #667681;
  --line: #d8e2e7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --amber: #c17700;
  --coral: #c2412f;
  --success: #157f3b;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 0%, rgba(15, 118, 110, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(193, 119, 0, 0.10), transparent 38%),
    var(--bg);
  color: var(--ink);
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(100% - 32px, 1680px);
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.topbar-meta {
  color: var(--muted);
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  padding: 16px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.status-panel,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.status-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 18px;
}

.status-panel span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.94rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--amber);
}

.status-dot.loading {
  animation: pulse 900ms infinite alternate;
}

.status-dot.success {
  background: var(--success);
}

.status-dot.failure {
  background: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(640px, 1.35fr) minmax(380px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 1.3rem;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.preset-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.preset-button,
.segment-button,
.mini-button,
.text-button,
.icon-button,
.primary {
  border: 0;
  cursor: pointer;
}

.preset-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #f8fafb;
  color: #26343c;
  font-size: 0.86rem;
  font-weight: 850;
}

.preset-button.active {
  border-color: var(--accent);
  background: #eaf7f4;
  color: var(--accent-strong);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.compact-select {
  display: none;
}

label,
.field-group,
.password-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: #2d3a42;
  font-weight: 750;
  font-size: 0.92rem;
}

.field-label {
  color: #2d3a42;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd7dd;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfd;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 112px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf3f5;
}

.segment-button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: #3c4d56;
  font-weight: 850;
}

.segment-button.active {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(23, 32, 38, 0.12);
}

.hint {
  margin: -4px 0 18px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #eef8f6;
  color: #244b49;
  border-radius: 4px;
  line-height: 1.45;
}

.input-action {
  position: relative;
}

.input-action input {
  padding-right: 66px;
}

.mini-button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 52px;
  height: 32px;
  border-radius: 5px;
  background: #e9f0f2;
  color: #25343d;
  font-size: 0.8rem;
  font-weight: 850;
}

.divider {
  height: 1px;
  margin: 8px 0 20px;
  background: var(--line);
}

.options-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: end;
}

.check {
  min-height: 44px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.timeout {
  margin-bottom: 16px;
}

.readiness {
  position: relative;
  height: 8px;
  overflow: hidden;
  margin: 2px 0 16px;
  border-radius: 999px;
  background: #dfe8ed;
}

.readiness span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--amber), var(--accent));
  transition: width 180ms ease;
}

.primary {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.primary:hover {
  background: var(--accent-strong);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.68;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #e9f0f2;
  color: var(--ink);
  font-size: 1.1rem;
}

.duration {
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 999px;
  background: #edf2f4;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
}

.meter-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.7fr;
  gap: 8px;
  margin-bottom: 16px;
}

.meter-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.meter-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafb;
  line-height: 1.45;
}

.result span {
  color: var(--muted);
}

.result code {
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  color: #4a1f17;
}

.result.success {
  border-color: rgba(21, 127, 59, 0.35);
  background: #eef9f2;
}

.result.failure {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff2f1;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
  padding-left: 22px;
}

.steps li {
  padding-left: 4px;
  color: #33424a;
  animation: rise 220ms ease both;
}

.history {
  margin-bottom: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.history h3,
.notes h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.text-button {
  background: transparent;
  color: var(--accent-strong);
  font-weight: 850;
}

.history ul,
.notes ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.history ul {
  display: grid;
  gap: 8px;
}

.history li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.history li span {
  grid-row: span 2;
  width: 36px;
  padding: 4px 0;
  border-radius: 999px;
  text-align: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.history-success span {
  background: var(--success);
}

.history-failure span {
  background: var(--danger);
}

.history li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history li em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.history .history-empty {
  display: block;
  color: var(--muted);
}

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

.notes ul {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.notes li {
  position: relative;
  padding-left: 16px;
}

.notes li::before {
  content: "";
  position: absolute;
  top: 0.64em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--amber);
}

@keyframes pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

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

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

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

  .topbar,
  .hero,
  .workspace,
  .grid.two,
  .options-row,
  .meter-row {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: stretch;
  }

  .panel {
    padding: 18px;
  }

  .preset-bar {
    display: none;
  }

  .compact-select {
    display: grid;
  }
}
