:root {
  color-scheme: dark;
  --bg: #101114;
  --card: #181a20;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #2a2d36;
  --accent: #7dd3fc;
  --error: #fca5a5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 32px auto;
}

.container.narrow {
  width: min(420px, calc(100% - 32px));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

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

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

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

h1,
h2 {
  margin-top: 0;
}

h2 {
  margin-top: 28px;
}

.muted {
  color: var(--muted);
}

.error {
  background: rgba(252, 165, 165, 0.12);
  border: 1px solid rgba(252, 165, 165, 0.35);
  color: var(--error);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0d10;
  color: var(--text);
  margin-bottom: 16px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #001018;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #272a33;
  color: var(--text);
  border: 1px solid var(--border);
}

button.danger,
.button.danger {
  background: rgba(252, 165, 165, 0.14);
  color: var(--error);
  border: 1px solid rgba(252, 165, 165, 0.35);
}

button.small,
.button.small {
  padding: 7px 10px;
  font-size: 0.9rem;
}

.inline-form {
  display: inline-block;
  margin-left: 8px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

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

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

a {
  color: var(--accent);
}

td form {
  display: inline-block;
}

.meta {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
}

.text-block,
.log-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0c0d10;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  max-height: 520px;
  overflow: auto;
}

.log-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: space-between;
  }

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

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