:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #1769aa;
  --accent-strong: #0f4f82;
  --good: #19744a;
  --warn: #a15c00;
  --danger: #9d1c1c;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-strong);
  font-weight: 700;
}

header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 1.1rem;
}

.brand span,
.muted {
  color: var(--muted);
}

main {
  padding: 28px 0 44px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 2.8vw, 2.4rem);
  line-height: 1.1;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

p {
  margin-top: 0;
}

.lede {
  color: var(--muted);
  max-width: 760px;
  margin-bottom: 22px;
}

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

/* Section heading row */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-head .hint {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Module launcher grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.module {
  --tile: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--tile);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

a.module:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.12);
}

.module.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.module .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.5rem;
  line-height: 1;
  background: color-mix(in srgb, var(--tile) 16%, #fff);
  border: 1px solid color-mix(in srgb, var(--tile) 30%, #fff);
}

.module h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.module p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: auto;
}

.module .go {
  font-weight: 700;
  color: var(--tile);
  font-size: 0.86rem;
}

/* Status pills */
.pill {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill.live {
  background: #e8f6ee;
  color: var(--good);
  border: 1px solid #b9dec9;
}

.pill.wiring {
  background: #fff4e3;
  color: var(--warn);
  border: 1px solid #f0d4a3;
}

.pill.soon {
  background: #eef1f6;
  color: var(--muted);
  border: 1px solid var(--line);
}

.pill.design {
  background: #fdeced;
  color: var(--danger);
  border: 1px solid #f3c4c4;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
}

.card p {
  color: var(--muted);
  margin-bottom: auto;
}

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

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

input,
select,
button {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--accent-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.22);
  outline-offset: 1px;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
}

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

.success-box {
  display: none;
  border: 1px solid #b9dec9;
  background: #f0faf4;
  border-radius: 8px;
  padding: 16px;
}

.success-box.show {
  display: block;
}

.join-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #b9dec9;
  color: var(--good);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.table-shell {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 820px) {
  .topbar,
  .toolbar,
  .form-grid,
  .grid {
    grid-template-columns: 1fr;
  }

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

