:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #17191d;
  --muted: #68707c;
  --line: #d8dee7;
  --accent: #126b5f;
  --accent-strong: #0e564d;
  --danger: #b42318;
  --danger-strong: #8f1d14;
  --focus: #3b82f6;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

.shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 28px 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.3rem;
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
}

p {
  color: var(--muted);
  margin-top: 3px;
}

.status-pill {
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

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

.join-form {
  display: grid;
  gap: 9px;
}

label,
.metric span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
}

input:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 2px;
}

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

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary {
  background: #2f4052;
}

.secondary:hover:not(:disabled) {
  background: #23313f;
}

.danger {
  background: var(--danger);
}

.danger:hover:not(:disabled) {
  background: var(--danger-strong);
}

.ghost {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.metric strong {
  display: block;
  min-height: 26px;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.activity-log {
  display: grid;
  gap: 8px;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.activity-log li {
  border-left: 3px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  background: #fbfcfd;
}

.activity-log strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 980px);
    padding: 18px 0;
  }

  .toolbar,
  .input-row,
  .actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .status-pill {
    width: 100%;
  }
}
