:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #66736b;
  --line: #d9e0d8;
  --accent: #1c7c54;
  --accent-strong: #125f3e;
  --warn: #8a4d0b;
  --danger: #9c2f24;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

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

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: #edf2ec;
}

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

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 300px;
  resize: vertical;
  padding: 12px;
  white-space: pre;
  overflow: auto;
}

textarea.compact-textarea {
  min-height: 160px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
}

.auth-panel h1,
.topbar h1,
.panel h2 {
  margin: 0;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  background: var(--panel);
}

.panel-heading,
.actions,
.inline-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.actions,
.inline-controls {
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline-controls input {
  width: 150px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.badge {
  min-width: 70px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #edf2ec;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 800;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.badge.busy {
  background: #fff4df;
  color: var(--warn);
}

.badge.ok {
  background: #e5f5ec;
  color: var(--accent-strong);
}

.badge.error {
  background: #fde9e7;
  color: var(--danger);
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

pre {
  min-height: 180px;
  margin: 0;
  overflow: auto;
  border-radius: 6px;
  padding: 14px;
  background: #111814;
  color: #dcefe4;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions button,
  .inline-controls button,
  .inline-controls input {
    width: 100%;
  }
}
