* {
  box-sizing: border-box;
}

:root {
  --bg: #0a0b0d;
  --panel: #141820;
  --panel-2: #1a202a;
  --border: #333b48;
  --text: #f3efe6;
  --muted: #aab0ba;
  --accent: #ff5910;
  --blue: #58a6ff;
  --green: #3fb950;
  --gold: #d29922;
  --red: #f85149;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 89, 16, 0.14), transparent 360px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.09), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.topbar.compact {
  align-items: center;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: clamp(2.35rem, 7vw, 5.9rem);
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.45rem, 3vw, 2.6rem);
}

.operator-link,
.nav-links a,
.app-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.62rem 0.82rem;
  text-decoration: none;
  color: var(--text);
  background: rgba(20, 24, 32, 0.75);
}

.operator-link:hover,
.nav-links a:hover,
.app-tile:hover {
  border-color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--border);
  background: var(--border);
}

.status-strip > div {
  background: rgba(20, 24, 32, 0.88);
  padding: 16px;
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}

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

.status-warn {
  color: var(--gold);
}

.status-bad {
  color: var(--red);
}

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

.app-tile {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(20, 24, 32, 0.86);
  text-decoration: none;
}

.app-tile.primary {
  background:
    linear-gradient(180deg, rgba(255, 89, 16, 0.18), transparent),
    rgba(20, 24, 32, 0.9);
}

.app-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-title {
  display: block;
  margin-top: auto;
  font-size: clamp(1.7rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 0.95;
}

.app-copy {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.app-action {
  align-self: flex-start;
  color: var(--accent);
}

.now,
.scoreboard-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(20, 24, 32, 0.82);
  padding: 20px;
}

pre {
  min-height: 92px;
  overflow-x: auto;
  margin: 18px 0 0;
  padding: 16px;
  border-radius: 6px;
  background: #07090c;
  color: var(--muted);
  white-space: pre-wrap;
}

.scoreboard-layout {
  display: grid;
  grid-template-columns: minmax(300px, 520px) 1fr;
  gap: 18px;
  margin-top: 18px;
}

.matrix-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #07090c;
}

.matrix-screen {
  aspect-ratio: 2 / 1;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.matrix-screen span {
  position: absolute;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.matrix-font-small {
  font-size: clamp(0.66rem, 2vw, 1.05rem);
}

.matrix-font-medium {
  font-size: clamp(0.82rem, 2.7vw, 1.5rem);
}

.matrix-font-clock {
  font-size: clamp(1rem, 4vw, 2.25rem);
}

.details {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.device-picker {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.device-picker span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.device-picker select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: #07090c;
  color: var(--text);
  font: inherit;
}

.details div {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.details dt {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.details dd {
  margin: 4px 0 0;
  color: var(--text);
}

@media (max-width: 820px) {
  .topbar,
  .topbar.compact {
    display: block;
  }

  .operator-link,
  .nav-links {
    margin-top: 18px;
  }

  .status-strip,
  .apps,
  .scoreboard-layout {
    grid-template-columns: 1fr;
  }

  .app-tile {
    min-height: 220px;
  }
}
