:root {
  --background: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #f0f0ed;
  --text: #1e1f1c;
  --muted: #686b63;
  --border: #d9d9d4;
  --border-strong: #b8bbb0;
  --primary: #176c5f;
  --primary-hover: #12574d;
  --danger: #a33a30;
  --focus: rgba(23, 108, 95, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

.layout {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.title-row,
.field-head,
.submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-row {
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
}

.state {
  min-width: 76px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}

.state.loading {
  color: var(--primary);
  border-color: rgba(23, 108, 95, 0.35);
  background: #eef6f3;
}

.form {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 620;
}

.submit-row {
  align-items: stretch;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
}

input {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

button {
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.secondary,
.copy {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}

.secondary:hover,
.copy:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.copy {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.result-panel {
  display: grid;
  gap: 16px;
}

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

.field-head {
  justify-content: space-between;
}

.error {
  margin: 12px 0 0;
  color: var(--danger);
}

@media (max-width: 720px) {
  .layout {
    width: calc(100% - 20px);
    margin: 10px auto;
  }

  .panel {
    padding: 14px;
  }

  .title-row,
  .submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .state {
    text-align: left;
  }
}
