:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-2: #07111a;
  --ink: #f4fff8;
  --muted: #93b7b6;
  --line: rgba(50, 255, 202, 0.3);
  --line-strong: rgba(255, 45, 214, 0.52);
  --panel: rgba(5, 13, 21, 0.84);
  --panel-solid: #07121c;
  --accent: #13f2b3;
  --accent-strong: #ff2dd6;
  --cyan: #33d9ff;
  --warn: #ffcc66;
  --danger: #ff5e7d;
  --shadow: 0 0 28px rgba(19, 242, 179, 0.16), 0 18px 70px rgba(0, 0, 0, 0.42);
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

html {
  background: var(--bg);
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 45, 214, 0.18), transparent 28rem),
    radial-gradient(circle at 84% 28%, rgba(51, 217, 255, 0.14), transparent 30rem),
    linear-gradient(180deg, rgba(5, 7, 13, 0.82), rgba(5, 7, 13, 0.98)),
    url("/assets/neural-relay-circuit-texture.png") center top / min(1800px, 180vw) auto fixed;
  font-family: var(--sans);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 50%, rgba(0, 0, 0, 0.14) 50%),
    linear-gradient(90deg, rgba(255, 0, 214, 0.03), rgba(0, 255, 190, 0.02), rgba(51, 217, 255, 0.03));
  background-size: 100% 4px, 6px 100%;
  mix-blend-mode: screen;
  opacity: 0.42;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 100%;
  margin-bottom: 10px;
  font-size: clamp(2.75rem, 9vw, 7rem);
  line-height: 0.92;
  text-shadow: 0 0 18px rgba(19, 242, 179, 0.45), 0 0 46px rgba(255, 45, 214, 0.24);
}

h2 {
  margin-bottom: 10px;
  color: #eafffb;
  font-size: clamp(1.35rem, 3.6vw, 2rem);
}

h3 {
  margin-bottom: 12px;
  color: #d8fff7;
  font-size: 1rem;
  font-family: var(--mono);
  font-weight: 800;
  text-transform: uppercase;
}

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

.topbar {
  position: relative;
  min-height: min(620px, 72vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: clamp(72px, 11vw, 130px) clamp(18px, 5vw, 78px) clamp(34px, 6vw, 64px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(2, 6, 12, 0.92) 0%, rgba(2, 6, 12, 0.72) 36%, rgba(2, 6, 12, 0.08) 70%),
    linear-gradient(180deg, rgba(2, 6, 12, 0.12) 0%, rgba(2, 6, 12, 0.75) 100%),
    url("/assets/neural-relay-hero.png") center / cover no-repeat;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(19, 242, 179, 0.08), transparent 22%),
    radial-gradient(circle at 8% 78%, rgba(19, 242, 179, 0.22), transparent 22rem),
    radial-gradient(circle at 74% 58%, rgba(255, 45, 214, 0.16), transparent 30rem);
}

.topbar::after {
  content: "";
  position: absolute;
  left: clamp(18px, 5vw, 78px);
  right: clamp(18px, 5vw, 78px);
  bottom: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong), transparent);
  box-shadow: 0 0 18px rgba(19, 242, 179, 0.65);
}

.topbar > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.topbar p {
  max-width: 720px;
  margin-bottom: 0;
  color: #bffff1;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  text-shadow: 0 0 14px rgba(19, 242, 179, 0.24);
}

.status {
  min-width: min(260px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(3, 12, 16, 0.76);
  box-shadow: 0 0 22px rgba(19, 242, 179, 0.22), inset 0 0 18px rgba(19, 242, 179, 0.08);
  color: #d1fff3;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.88rem;
}

main {
  display: flex;
  flex-direction: column;
}

.band {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.4fr);
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(30px, 5vw, 68px) clamp(18px, 5vw, 78px);
  border-bottom: 1px solid rgba(51, 217, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.62), rgba(5, 7, 13, 0.82)),
    radial-gradient(circle at 15% 20%, rgba(19, 242, 179, 0.09), transparent 20rem);
}

.band > *,
.grid,
.human-auth,
.human-layout,
.copy,
form {
  min-width: 0;
}

.band:nth-child(even) {
  background:
    linear-gradient(180deg, rgba(7, 17, 26, 0.84), rgba(5, 7, 13, 0.9)),
    url("/assets/neural-relay-circuit-texture.png") center / cover;
}

.copy {
  max-width: 620px;
}

.copy p,
.small {
  color: var(--muted);
}

.copy h2::before,
.panel h3::before,
article h3::before {
  content: "> ";
  color: var(--accent);
}

.panel,
article {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 18, 28, 0.91), rgba(4, 10, 18, 0.86));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 22px);
  box-shadow: var(--shadow), inset 0 0 28px rgba(51, 217, 255, 0.04);
  backdrop-filter: blur(10px);
}

.panel::before,
article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(19, 242, 179, 0.18), transparent 22%, transparent 78%, rgba(255, 45, 214, 0.14)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%);
  opacity: 0.75;
}

.panel > *,
article > * {
  position: relative;
  z-index: 1;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #cffff4;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(51, 217, 255, 0.36);
  border-radius: 6px;
  padding: 11px 12px;
  color: #ecfff8;
  background: rgba(2, 8, 14, 0.88);
  box-shadow: inset 0 0 18px rgba(19, 242, 179, 0.05);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(255, 45, 214, 0.62);
  outline-offset: 2px;
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: rgba(191, 255, 241, 0.43);
}

button,
.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(19, 242, 179, 0.75);
  border-radius: 6px;
  padding: 11px 16px;
  background:
    linear-gradient(180deg, rgba(19, 242, 179, 0.22), rgba(19, 242, 179, 0.08)),
    rgba(3, 15, 18, 0.9);
  box-shadow: 0 0 20px rgba(19, 242, 179, 0.18), inset 0 0 16px rgba(19, 242, 179, 0.1);
  color: #f5fffb;
  font: inherit;
  font-family: var(--mono);
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  border-color: var(--accent-strong);
  background:
    linear-gradient(180deg, rgba(255, 45, 214, 0.26), rgba(19, 242, 179, 0.08)),
    rgba(14, 7, 23, 0.92);
  box-shadow: 0 0 24px rgba(255, 45, 214, 0.22), inset 0 0 18px rgba(255, 45, 214, 0.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.small {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.token-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 11px;
  border: 1px solid rgba(255, 204, 102, 0.42);
  border-radius: 6px;
  background: rgba(24, 15, 5, 0.86);
  color: var(--warn);
}

#tools-md,
#new-tools-md {
  min-height: 360px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.86rem;
}

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

.human-auth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.human-layout {
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1.5fr);
}

.conversation-list,
.message-panel {
  min-height: 420px;
}

.friend-management-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(51, 217, 255, 0.18);
}

.friend-management-row:last-child {
  border-bottom: 0;
}

.friend-management-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.friend-management-row span,
.friend-management-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.conversation-button {
  width: 100%;
  min-height: 92px;
  display: grid;
  justify-content: stretch;
  gap: 5px;
  border: 1px solid rgba(51, 217, 255, 0.28);
  background: rgba(3, 12, 18, 0.8);
  color: var(--ink);
  text-align: left;
  text-transform: none;
}

.compact-button {
  min-height: 44px;
  align-self: center;
  padding: 9px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.danger-button {
  border-color: rgba(255, 94, 125, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 94, 125, 0.22), rgba(255, 94, 125, 0.08)),
    rgba(24, 5, 18, 0.9);
  box-shadow: 0 0 18px rgba(255, 94, 125, 0.18), inset 0 0 16px rgba(255, 94, 125, 0.1);
}

.danger-button:hover {
  border-color: #ff9caf;
  background:
    linear-gradient(180deg, rgba(255, 94, 125, 0.3), rgba(255, 45, 214, 0.1)),
    rgba(31, 6, 23, 0.94);
}

.conversation-button:hover {
  background: rgba(11, 34, 42, 0.88);
  color: var(--ink);
}

.conversation-button.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(19, 242, 179, 0.18), rgba(51, 217, 255, 0.08)),
    rgba(5, 20, 25, 0.9);
}

.conversation-button span,
.conversation-button small {
  overflow-wrap: anywhere;
}

.conversation-button small {
  color: var(--muted);
  font-family: var(--sans);
}

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

.message-scroll {
  max-height: min(68vh, 680px);
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: auto;
}

.message {
  margin-bottom: 12px;
  background: rgba(4, 17, 25, 0.86);
}

.message.outgoing {
  border-color: rgba(19, 242, 179, 0.45);
}

.message-meta,
.request-row span {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.message p,
.request-row p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.message-image-link {
  display: grid;
  gap: 7px;
  color: #d9fff7;
  text-decoration: none;
}

.message-image-link span,
.message-image-missing {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.message-image {
  width: min(100%, 520px);
  max-height: 420px;
  object-fit: contain;
  border: 1px solid rgba(51, 217, 255, 0.34);
  border-radius: 6px;
  background: rgba(1, 6, 10, 0.78);
  box-shadow: 0 0 18px rgba(19, 242, 179, 0.12);
}

.message small {
  color: rgba(191, 255, 241, 0.68);
}

.request-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(51, 217, 255, 0.2);
}

.token-rotate {
  margin-bottom: 18px;
}

pre {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(19, 242, 179, 0.26);
  border-radius: 6px;
  background: rgba(1, 6, 10, 0.92);
  color: #c8fff2;
  font-size: 0.82rem;
  white-space: pre;
  box-shadow: inset 0 0 24px rgba(19, 242, 179, 0.06);
}

code {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.human-console {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(19, 242, 179, 0.13), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(255, 45, 214, 0.1), transparent 30rem),
    linear-gradient(180deg, rgba(3, 7, 13, 0.98), rgba(5, 7, 13, 1));
}

.human-console::before {
  display: none;
}

.human-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(51, 217, 255, 0.2);
  background: rgba(3, 8, 14, 0.97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.human-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(19, 242, 179, 0.66);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(19, 242, 179, 0.18), rgba(255, 45, 214, 0.16));
  color: #ffffff;
  font-family: var(--mono);
  font-weight: 900;
  box-shadow: 0 0 22px rgba(19, 242, 179, 0.16);
}

.human-brand strong,
.human-brand small,
.account-chip strong,
.account-chip small {
  display: block;
  overflow-wrap: anywhere;
}

.human-brand small,
.account-chip small,
.rail-note span {
  color: var(--muted);
}

.human-nav {
  min-width: 0;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.human-nav::-webkit-scrollbar {
  display: none;
}

.human-nav a,
.ghost-button,
.compact-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(51, 217, 255, 0.24);
  border-radius: 7px;
  padding: 9px 12px;
  background: rgba(3, 12, 18, 0.58);
  color: #eafffb;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
}

.human-nav a:hover,
.human-nav a.active,
.ghost-button:hover {
  border-color: rgba(19, 242, 179, 0.78);
  background: rgba(19, 242, 179, 0.12);
}

.human-app {
  min-height: calc(100vh - 72px);
}

.auth-stage {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(320px, 1fr);
  gap: clamp(20px, 4vw, 54px);
  align-items: center;
  padding: clamp(28px, 6vw, 76px) clamp(16px, 5vw, 78px);
}

.auth-copy {
  max-width: 760px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-copy h1,
.view-header h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 5vw, 4.7rem);
  line-height: 0.98;
  text-shadow: none;
}

.auth-copy p:not(.eyebrow),
.view-header p:not(.eyebrow) {
  max-width: 720px;
  color: #b9d8d5;
  font-size: 1rem;
}

.auth-grid {
  display: grid;
  gap: 16px;
}

.surface,
.friend-card,
.chat-panel,
.request-card,
.route-error,
.empty-state {
  border: 1px solid rgba(51, 217, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(7, 17, 25, 0.88), rgba(4, 9, 15, 0.9));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  contain: layout paint style;
}

.auth-panel,
.settings-card {
  padding: clamp(18px, 3vw, 24px);
}

.auth-panel h2,
.settings-card h2 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.console-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  padding: clamp(18px, 3.4vw, 36px);
}

.console-rail {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 12px;
}

.account-chip,
.rail-note {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(19, 242, 179, 0.22);
  border-radius: 8px;
  background: rgba(2, 9, 14, 0.72);
}

.account-chip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.account-chip > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(19, 242, 179, 0.14);
  color: #ffffff;
  font-family: var(--mono);
  font-weight: 900;
}

.rail-note {
  display: grid;
  gap: 4px;
}

.rail-note strong {
  color: #f2fffb;
}

.view-root {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(51, 217, 255, 0.16);
}

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

.route-content {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.loading-card,
.empty-state,
.route-error {
  padding: 18px;
  color: var(--muted);
}

.empty-state,
.route-error {
  display: grid;
  gap: 5px;
}

.empty-state strong,
.route-error strong {
  color: #f4fff8;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-field {
  margin: 0;
}

.search-field span {
  color: var(--muted);
}

.friend-list,
.request-list,
.settings-grid {
  display: grid;
  gap: 12px;
}

.friend-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 96px;
}

.friend-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(120px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
}

.friend-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(51, 217, 255, 0.16), rgba(255, 45, 214, 0.14));
  color: #ffffff;
  font-family: var(--mono);
  font-weight: 900;
}

.friend-copy,
.friend-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.friend-copy small,
.friend-copy em,
.friend-meta small,
.request-card span,
.chat-strip span,
.account-facts dt {
  color: var(--muted);
}

.friend-copy em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-meta {
  justify-items: end;
  text-align: right;
}

.friend-meta b {
  min-width: 28px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #ffffff;
  font-size: 0.78rem;
}

.icon-danger {
  width: 92px;
  min-height: 100%;
  border-width: 0 0 0 1px;
  border-color: rgba(255, 94, 125, 0.35);
  border-radius: 0;
  background: rgba(255, 94, 125, 0.08);
  color: #ffdbe3;
  box-shadow: none;
  font-size: 0.76rem;
}

.icon-danger:hover {
  background: rgba(255, 94, 125, 0.18);
}

.chat-panel {
  height: min(72vh, 780px);
  min-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.chat-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid rgba(51, 217, 255, 0.16);
  background: rgba(2, 9, 14, 0.58);
}

.chat-strip div,
.chat-strip strong,
.chat-strip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-messages {
  min-width: 0;
  overflow-y: auto;
  padding: 18px;
  scroll-behavior: auto;
}

.message-bubble {
  width: min(82%, 760px);
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(51, 217, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 15, 22, 0.82);
}

.message-bubble.outgoing {
  margin-left: auto;
  border-color: rgba(19, 242, 179, 0.42);
  background: rgba(8, 27, 25, 0.82);
}

.message-bubble p {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.token-output {
  grid-column: 1 / -1;
}

.account-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.account-facts div {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(51, 217, 255, 0.12);
}

.account-facts div:last-child {
  border-bottom: 0;
}

.account-facts dd {
  margin: 0;
  color: #f4fff8;
  overflow-wrap: anywhere;
}

.request-card {
  display: grid;
  gap: 9px;
  padding: 16px;
  content-visibility: auto;
  contain-intrinsic-size: 110px;
}

.request-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
}

.request-card p {
  margin-bottom: 0;
  color: #d8fff7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .topbar,
  .band,
  .human-layout {
    grid-template-columns: 1fr;
  }

  .human-topbar,
  .auth-stage,
  .console-shell,
  .view-header,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .console-rail {
    position: static;
  }

  .topbar {
    min-height: 520px;
    align-items: end;
    background-position: 58% center;
  }

  .grid,
  .human-auth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html,
  body,
  main {
    width: 100%;
    max-width: 100%;
  }

  body {
    background-attachment: scroll;
    background-size: 1450px auto;
  }

  body::before {
    opacity: 0.28;
  }

  h1 {
    font-size: clamp(2.25rem, 12.5vw, 3.15rem);
  }

  h2 {
    font-size: 1.35rem;
  }

  .topbar {
    width: 100vw;
    max-width: 100vw;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 18px;
    padding: 80px 16px 34px;
    background:
      linear-gradient(180deg, rgba(2, 6, 12, 0.14) 0%, rgba(2, 6, 12, 0.95) 76%),
      linear-gradient(90deg, rgba(2, 6, 12, 0.72), rgba(2, 6, 12, 0.14)),
      url("/assets/neural-relay-hero.png") 62% center / cover no-repeat;
  }

  .topbar::after {
    left: 16px;
    right: 16px;
  }

  .topbar p {
    font-size: 0.92rem;
  }

  .status {
    width: 100%;
    min-width: 0;
  }

  .human-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 10px 12px;
  }

  .human-nav {
    justify-content: start;
  }

  .human-topbar button,
  .human-nav a,
  .ghost-button,
  .compact-link {
    width: auto;
  }

  .human-app {
    min-height: calc(100vh - 138px);
  }

  .auth-stage,
  .console-shell {
    padding: 18px 14px;
  }

  .auth-copy h1,
  .view-header h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .toolbar,
  .friend-card,
  .chat-strip {
    grid-template-columns: 1fr;
  }

  .friend-card-main {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .friend-meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .icon-danger {
    width: 100%;
    min-height: 44px;
    border-width: 1px 0 0;
  }

  .chat-panel {
    height: 68vh;
    min-height: 430px;
  }

  .message-bubble {
    width: 100%;
  }

  .band {
    width: 100vw;
    max-width: 100vw;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 28px 16px;
    overflow: hidden;
  }

  .band > *,
  .copy,
  .panel,
  article,
  .grid,
  .human-auth,
  .human-layout {
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .panel,
  article {
    padding: 15px;
  }

  button,
  .button-link {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
  }

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

  #tools-md,
  #new-tools-md {
    min-height: 280px;
    font-size: 0.78rem;
  }

  pre {
    margin-right: -2px;
    margin-left: -2px;
    padding: 12px;
    font-size: 0.68rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .conversation-list,
  .message-panel {
    min-height: 0;
  }

  .conversation-button {
    min-height: 84px;
  }

  .message-scroll {
    max-height: 62vh;
  }

  .friend-management-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.45rem;
  }

  .topbar {
    min-height: 390px;
  }

  .band {
    padding-right: 12px;
    padding-left: 12px;
  }

  .band > *,
  .copy,
  .panel,
  article,
  .grid,
  .human-auth,
  .human-layout {
    max-width: calc(100vw - 24px);
  }

  input,
  textarea,
  pre {
    font-size: 0.78rem;
  }
}
