:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --line: #dfdfd8;
  --ink: #171716;
  --muted: #55554b;
  --ok: #e8f8ea;
  --ok-line: #96cc9e;
  --err: #fdeceb;
  --err-line: #e49f9a;
  --action: #0f766e;
  --action-hover: #0a5a54;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #ecece4, transparent 32%),
    radial-gradient(circle at 80% 0%, #e8ece8, transparent 30%),
    var(--bg);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

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

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

.narrow {
  max-width: 440px;
  margin: 60px auto 0;
}

h1,
h2 {
  margin: 0 0 10px;
}

h2 {
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.stats {
  margin: 6px 0;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.row-compact {
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  width: 100%;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #c9c9bf;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  background: #fff;
}

textarea {
  resize: vertical;
}

button,
.button-link {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--action);
  color: white;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--action-hover);
}

button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  background: #444;
}

.alert {
  border: 1px solid;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.alert-ok {
  background: var(--ok);
  border-color: var(--ok-line);
}

.alert-error {
  background: var(--err);
  border-color: var(--err-line);
}

.image-wrap {
  margin-bottom: 10px;
}

.image-wrap img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 8px;
  font-size: 0.92rem;
}

.logs {
  overflow: auto;
}

.cell-wrap {
  max-width: 260px;
  word-break: break-word;
}

pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

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

@media (max-width: 760px) {
  .container {
    padding: 18px 12px 30px;
  }

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

  th,
  td {
    font-size: 0.86rem;
  }
}
