:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --border: #d9dde3;
  --text: #1f2937;
  --muted: #6b7280;
  --green: #2f9e44;
  --green-dark: #24813a;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 158, 68, 0.08), transparent 20%),
    linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%);
  padding: 24px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.title-block h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
}

.title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.6;
}

.brand {
  color: var(--green);
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.left {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.right {
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(47, 158, 68, 0.75);
  box-shadow: 0 0 0 4px rgba(47, 158, 68, 0.12);
}

button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--green-dark);
}

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

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.response-title {
  font-size: 18px;
  font-weight: 800;
}

.response-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-btn {
  width: auto;
  background: #eef8f0;
  color: var(--green-dark);
  border: 1px solid rgba(47, 158, 68, 0.18);
  padding: 10px 14px;
  font-weight: 700;
}

.secondary-btn:hover:not(:disabled) {
  background: #e3f4e6;
}

.response-box {
  flex: 1;
  min-height: 560px;
  max-height: 560px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-soft);
  overflow: auto;
}

pre {
  margin: 0;
  padding: 18px;
  min-height: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
}

.badge.ok {
  color: #166534;
  background: #edf9ef;
  border-color: #ccefd4;
}

.badge.error {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecdd3;
}

.chat-id-field {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.chat-id-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.chat-id-field select:focus {
  outline: none;
  border-color: rgba(47, 158, 68, 0.75);
  box-shadow: 0 0 0 4px rgba(47, 158, 68, 0.12);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  body {
    padding: 14px;
  }

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

  .title-block h1 {
    font-size: 26px;
  }

  .response-box {
    min-height: 380px;
  }
  
  .chat-id-field {
    grid-template-columns: 1fr;
  }
}
