:root {
  --bg: #12141a;
  --panel: #1a1e28;
  --line: #2a3140;
  --text: #e8edf7;
  --muted: #8b95a8;
  --accent: #7aa2ff;
  --danger: #e07070;
  --ok: #6bcb8f;
  --font: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #1c2436 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

header {
  padding: 1rem 1.1rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  font-weight: 650;
}

header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem 1.2rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

button {
  background: var(--accent);
  color: #0d1220;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  font-weight: 650;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.panel {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sessions li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid var(--line);
}

.sessions li:last-child {
  border-bottom: 0;
}

.sessions .meta {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
  word-break: break-all;
}

#log {
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 160px;
  max-height: 45dvh;
  overflow: auto;
  line-height: 1.45;
}

.status {
  font-size: 0.8rem;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: var(--danger);
}

.hidden {
  display: none !important;
}
