:root {
  --bg: #091113;
  --surface: #101c20;
  --surface-bright: #17272b;
  --line: #25383b;
  --text: #e4ecdf;
  --muted: #879b92;
  --accent: #77d49e;
  --danger: #e78d77;
  --shadow: rgba(0, 0, 0, 0.3);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, #173b33 0, transparent 36%),
    linear-gradient(120deg, #091113, #0b171a);
}

.topbar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 34px max(calc((100vw - 1240px) / 2), 28px) 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.22em;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(29px, 4vw, 38px);
  font-weight: 550;
  margin: 0;
}

.auth, .account {
  align-items: end;
  display: flex;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.login {
  background: var(--accent);
  border-radius: 7px;
  color: #072014;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 17px;
  text-decoration: none;
}

.login:hover {
  filter: brightness(1.08);
}

.account {
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.account .ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

label {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 7px;
}

input {
  background: #0a1417;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
}

input:focus {
  border-color: var(--accent);
  outline: none;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  color: #072014;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 17px;
}

button:hover {
  filter: brightness(1.08);
}

main {
  margin: 0 auto;
  max-width: 1296px;
  padding: 28px;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px var(--shadow);
  display: flex;
  gap: 52px;
  margin-bottom: 22px;
  padding: 19px 22px;
}

.summary .ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  margin-left: auto;
}

.label {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.value {
  font-size: 24px;
  margin: 0;
}

#status {
  color: var(--accent);
  font-size: 16px;
  padding-top: 6px;
}

#status.error {
  color: var(--danger);
}

.layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(420px, 1fr) 360px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px var(--shadow);
  padding: 22px;
}

.login-panel {
  margin: 48px auto;
  max-width: 470px;
  padding: 38px;
  text-align: center;
}

.login-panel h2 {
  font-size: 24px;
  font-weight: 550;
  margin: 10px 0;
}

.login-panel > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 28px;
}

.panel-header h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 0 0 4px;
}

.panel-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 22px;
}

.interface {
  background: var(--surface-bright);
  border-radius: 9px;
  margin-bottom: 14px;
  padding: 18px;
}

.interface:last-child {
  margin-bottom: 0;
}

.interface-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.interface-title h3 {
  color: var(--accent);
  font-size: 18px;
  margin: 0;
}

.meta, .empty {
  color: var(--muted);
  font-size: 13px;
}

.peer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 13px 0 4px;
}

.peer code {
  color: var(--text);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.peer button {
  background: transparent;
  border: 1px solid #653b36;
  color: var(--danger);
  font-size: 12px;
  padding: 7px 10px;
}

#peer-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#message {
  color: var(--accent);
  font-size: 13px;
  min-height: 18px;
}

#message.error {
  color: var(--danger);
}

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

  .auth {
    width: 100%;
  }

  .auth label {
    flex: 1;
  }

  .summary {
    gap: 25px;
  }

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