:root {
  --bg: #101316;
  --panel: #1a2026;
  --field: #0e1318;
  --line: rgba(210, 220, 230, 0.14);
  --text: #eef3f8;
  --muted: #9aa8b6;
  --accent: #35d39a;
  --accent-2: #49a7ff;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}
h1, h2, p { margin: 0; }
button, input, textarea { font: inherit; }

.shell {
  min-height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.topbar, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand, .actions, .head, .inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-2);
  background: #142335;
  font-weight: 900;
}

.brand h1, .head h2 { font-size: 18px; letter-spacing: 0; }
.brand p, .head p, .field span, .notice { color: var(--muted); font-size: 12px; line-height: 1.35; }
.head { justify-content: space-between; margin-bottom: 10px; }

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr) minmax(340px, 0.8fr);
  gap: 12px;
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wide { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; }

input, textarea {
  width: 100%;
  border: 1px solid rgba(210, 220, 230, 0.18);
  border-radius: 6px;
  color: var(--text);
  background: var(--field);
  padding: 9px 10px;
  outline: none;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, textarea:focus {
  border-color: rgba(53, 211, 154, 0.72);
  box-shadow: 0 0 0 3px rgba(53, 211, 154, 0.08);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  color: #06120d;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
button.secondary { color: var(--text); background: #344052; }
button.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .72; cursor: default; }

.state, .pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,.06);
}
.state.live, .pill.ok { color: #bbf7d0; background: rgba(34,197,94,.16); }
.notice {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: rgba(255,255,255,.025);
  overflow-wrap: anywhere;
}
.save-line { align-self: end; justify-content: flex-end; }

.logs {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
}
.log {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #0d1217;
}
.log-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  border-left: 3px solid #94a3b8;
  border-radius: 6px;
  padding: 7px 9px;
  background: rgba(255,255,255,.035);
  font-size: 13px;
  line-height: 1.3;
}
.log-line.ok { border-left-color: var(--accent); }
.log-line.error { border-left-color: var(--danger); }
.log-time { color: var(--muted); font-size: 11px; }

@media (max-width: 1120px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .shell { padding: 8px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .actions, .inline { flex-wrap: wrap; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
}
