:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f6f4;
  color: #18221e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
textarea,
input {
  font: inherit;
}

button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: #176b52;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #12543f;
}

.secondary {
  background: #e8efec;
  color: #25372f;
}

.secondary:hover {
  background: #d8e3de;
}

.layout {
  width: min(1500px, calc(100% - 28px));
  margin: 20px auto;
}

.header,
.notice,
.sidebar,
.steps,
.logPanel {
  border: 1px solid #dce6e1;
  border-radius: 8px;
  background: #fff;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

h3 {
  margin: 18px 0 10px;
  font-size: 15px;
  color: #536860;
}

.header p,
.stepsHeader p,
.note {
  margin-top: 5px;
  color: #61736b;
  font-size: 13px;
}

.status {
  min-width: 72px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #edf3f0;
  color: #51645b;
  text-align: center;
  font-size: 13px;
}

.status.ok,
.result.ok {
  background: #ddf7e8;
  color: #0c6637;
}

.status.bad,
.result.bad {
  background: #ffe6e1;
  color: #a3311d;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

code,
pre {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

code {
  border-radius: 4px;
  background: #f0f5f2;
  padding: 2px 5px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(460px, 1fr) minmax(360px, 470px);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.sidebar,
.steps,
.logPanel {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.sideBlock {
  padding: 14px;
  border-bottom: 1px solid #e6eeea;
}

.sideBlock:last-child {
  border-bottom: 0;
}

.vars {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.varRow {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.varRow span {
  color: #52665e;
}

.varRow code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wsActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.wsActions .secondary {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  border: 1px solid #cedbd5;
  border-radius: 6px;
  padding: 10px;
  background: #fbfdfc;
  color: #16231d;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid #8bd3b4;
  border-color: #176b52;
}

.stepsHeader,
.logHeader {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e6eeea;
  background: #fff;
}

#steps {
  padding: 0 14px 14px;
}

.step {
  border: 1px solid #e0e9e5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fbfdfc;
}

.stepTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.stepMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.historyHint {
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef4f1;
  color: #5d7068;
  font-size: 12px;
}

.method {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 24px;
  margin-right: 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.method.get {
  background: #2563eb;
}

.method.post {
  background: #16834f;
}

.method.patch {
  background: #a15c09;
}

.method.delete {
  background: #b42318;
}

.url {
  margin-top: 8px;
  color: #40544c;
  word-break: break-word;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.varTags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.varTagTitle {
  color: #5d7068;
  font-size: 12px;
  font-weight: 700;
}

.varTag {
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.varTag.uses {
  background: #e8f1ff;
  color: #174ea6;
}

.varTag.saves {
  background: #e9f8ee;
  color: #12623c;
}

.varTag.empty {
  background: #fff0df;
  color: #96520a;
}

.varTag.ready {
  border: 1px solid rgb(18 98 60 / 18%);
}

.bodyInput {
  margin: 10px 0;
  min-height: 44px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.bodyInput:disabled {
  background: #eef4f1;
}

.result {
  min-width: 72px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef4f1;
  color: #53665e;
  text-align: center;
  font-size: 12px;
}

.result.running {
  background: #fff5d6;
  color: #875800;
}

.stepActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.logPanel {
  min-height: calc(100vh - 150px);
}

#log {
  margin: 0;
  padding: 14px;
  min-height: 520px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

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

  .sidebar,
  .steps,
  .logPanel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .layout {
    width: min(100% - 16px, 1500px);
    margin: 8px auto;
  }

  .header,
  .stepsHeader,
  .logHeader {
    align-items: stretch;
    flex-direction: column;
  }

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