:root {
  color-scheme: dark;
  --bg: #090b0c;
  --surface: #111415;
  --raised: #171a1b;
  --line: #2b2f30;
  --text: #f5f3ee;
  --muted: #8d9390;
  --interactive: #1d2021;
  --accent: #f47a2a;
  --success: #65d59b;
  --warning: #ffb340;
  --danger: #f25587;
  --offline: #747a78;
}

* {
  box-sizing: border-box;
}

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

button,
a {
  font: inherit;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 12, 0.96);
}

.brand img {
  width: 156px;
  display: block;
  filter: invert(1) brightness(1.35);
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-link,
button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button {
  border-color: var(--accent);
  background: var(--accent);
  color: #140a04;
}

button:disabled {
  border-color: var(--line);
  background: var(--raised);
  color: var(--muted);
  cursor: not-allowed;
}

.nav-link:hover,
button:not(:disabled):hover {
  border-color: var(--accent);
}

.nav-link:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.workspace {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-rows: auto auto minmax(520px, 1fr);
}

.bridge-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  gap: 22px;
  align-items: end;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #0d1011, #111415);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.08;
}

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

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

dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #080a0b;
}

.status.ok {
  color: var(--success);
}

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

.frame-shell {
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: block;
  border: 0;
  background: var(--bg);
}

@media (max-width: 920px) {
  .topbar,
  nav,
  .bridge-band,
  .facts {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: stretch;
  }

  .nav-link,
  button {
    flex: 1 1 auto;
  }

  .workspace {
    min-height: calc(100vh - 132px);
  }
}

@media (max-width: 560px) {
  .topbar,
  .bridge-band,
  .status {
    padding-left: 14px;
    padding-right: 14px;
  }

  nav {
    flex-direction: column;
  }

  .nav-link,
  button {
    width: 100%;
  }
}
