:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #202124;
  background: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.container {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

p {
  margin: 0;
  color: #5f6368;
}

.panel,
.diagnostics,
#resultSection {
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(32 33 36 / 5%);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  resize: vertical;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  font: inherit;
  line-height: 1.5;
}

textarea:focus,
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgb(26 115 232 / 25%);
  outline-offset: 1px;
}

input[type="url"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  font: inherit;
}

.endpoint-setting {
  max-width: 760px;
  margin-top: 18px;
}

.endpoint-setting label {
  margin-bottom: 6px;
}

.endpoint-setting small {
  display: block;
  margin-top: 6px;
  color: #5f6368;
}

.input-meta,
.actions,
.result-actions,
.summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-meta {
  justify-content: space-between;
  margin-top: 8px;
  color: #5f6368;
  font-size: .9rem;
}

.actions,
.result-actions {
  margin-top: 14px;
}

button,
select {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  font: inherit;
}

button {
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
}

.primary {
  color: #fff;
  background: #1769e0;
}

.primary:hover:not(:disabled) {
  background: #0d57c7;
}

.secondary {
  color: #3c4043;
  background: #fff;
  border-color: #b8c0cc;
}

.disabled,
.disabled:disabled {
  color: #7b8188;
  background: #e4e7eb;
  border-color: #d1d5da;
}

.status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.status-ok {
  color: #137333;
  background: #e6f4ea;
}

.status-error {
  color: #b3261e;
  background: #fce8e6;
}

.status-neutral {
  color: #5f6368;
  background: #f1f3f4;
}

.message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  white-space: pre-wrap;
}

.message.error {
  color: #8c1d18;
  background: #fce8e6;
  border: 1px solid #f4b4af;
}

.message.info {
  color: #174ea6;
  background: #e8f0fe;
  border: 1px solid #aecbfa;
}

.summary {
  flex-wrap: wrap;
  padding: 0 0 16px;
}

.summary-item {
  padding: 8px 12px;
  background: #f1f3f4;
  border-radius: 6px;
}

.summary-item strong {
  margin-right: 4px;
}

.diagnostics {
  margin-top: 0;
  color: #5f1a16;
  background: #fff8f7;
  border-color: #f4b4af;
}

.diagnostic {
  padding: 10px 0;
  border-top: 1px solid #f4d0cd;
}

.diagnostic:first-child {
  border-top: 0;
}

.diagnostic p {
  margin: 4px 0 0;
  color: #5f1a16;
}

.group-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
}

.group-control label {
  margin: 0;
}

select {
  min-width: 240px;
  border: 1px solid #b8c0cc;
  background: #fff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #dfe3e8;
}

dialog {
  width: min(520px, calc(100% - 32px));
  padding: 22px;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgb(32 33 36 / 25%);
}

dialog::backdrop {
  background: rgb(32 33 36 / 45%);
}

dialog p {
  line-height: 1.6;
}

.send-details {
  margin: 16px 0;
  padding: 12px;
  background: #f1f3f4;
  border-radius: 6px;
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: .9rem;
}

th,
td {
  padding: 9px 10px;
  border: 1px solid #dfe3e8;
  vertical-align: top;
  text-align: left;
  white-space: pre-wrap;
}

th {
  position: sticky;
  top: 0;
  color: #3c4043;
  background: #f1f3f4;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 20px, 1500px);
    padding-top: 18px;
  }

  .panel,
  .diagnostics,
  #resultSection {
    padding: 14px;
  }

  .actions,
  .result-actions {
    flex-wrap: wrap;
  }

  .group-control {
    align-items: flex-start;
    flex-direction: column;
  }
}
