:root {
  --bg: #161616;
  --panel: #212121;
  --rule: #343434;
  --field: #111;
  --field-line: #474747;
  --text: #ededed;
  --muted: #a3a3a3;
  --accent: #ff3131;
  --accent-ink: #fff;
  --ok: #4fd67a;
  --warn: #ffb547;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 Archivo, "Segoe UI", system-ui, sans-serif;
  font-stretch: 100%;
}

b { font-weight: 700; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 16px 8px;
}
.logo { width: 104px; height: 104px; flex: none; }
.word h1 {
  margin: 0;
  font-size: 72px;
  line-height: 0.95;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.02em;
}
.word p {
  margin: 4px 0 0 4px;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  font-stretch: 112%;
  color: var(--muted);
}

.intro {
  max-width: 980px;
  margin: 26px auto 34px;
  padding: 0 16px;
  font-size: 18px;
  line-height: 1.6;
  color: #d6d6d6;
}
.intro b { color: #fff; }

/* ---------- panel ---------- */

.panel {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 48px 34px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

input[type="text"], input[type="number"], select {
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 4px;
}
input:focus-visible, select:focus-visible, button:focus-visible, .sw input:focus-visible + i {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.channel { text-align: center; }
#c {
  width: min(420px, 100%);
  padding: 10px 14px;
  font-size: 22px;
  text-align: center;
}
#c::placeholder { color: #8a8a8a; }
.status {
  min-height: 1.5em;
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}
.status.ok { color: var(--ok); }
.status.idle { color: #d6d6d6; }
.status.bad { color: var(--warn); }

.opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 12px;
  max-width: 760px;
  margin: 28px auto 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
}
.row.rt, .sw.rt { justify-content: flex-end; text-align: right; }
.row select {
  width: 190px;
  padding: 5px 8px;
  font-size: 15px;
}

/* switches */
.switches { row-gap: 14px; margin-top: 30px; }
.sw, .sw-in {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
}
.sw input, .sw-in input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i, .sw-in i {
  position: relative;
  flex: none;
  width: 46px;
  height: 24px;
  border-radius: 12px;
  background: #474747;
  transition: background 0.15s;
}
.sw i::after, .sw-in i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cfcfcf;
  transition: transform 0.15s, background 0.15s;
}
.sw input:checked + i, .sw-in input:checked + i { background: var(--accent); }
.sw input:checked + i::after, .sw-in input:checked + i::after { transform: translateX(22px); background: #fff; }
div.sw { cursor: default; gap: 16px; }
.fade-for { font-size: 15px; color: var(--muted); }
.fade-for input { width: 64px; padding: 2px 6px; font-size: 15px; text-align: right; }

/* extras */
.extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 760px;
  margin: 30px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.field { display: block; font-size: 15px; color: var(--muted); }
.field > span { display: block; margin-bottom: 6px; color: var(--text); font-size: 16px; }
.field small { color: var(--muted); font-size: 13px; }
.field input { width: 100%; padding: 7px 10px; font-size: 15px; }
.hint { display: block; min-height: 1.4em; margin-top: 4px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--warn); }

/* ---------- preview ---------- */

.preview-wrap { margin-top: 30px; }
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 24px;
  margin-bottom: 10px;
}
.preview-bar h2 { margin: 0 auto 0 0; font-size: 20px; font-weight: 600; }
.seg { display: flex; gap: 2px; }
.seg button {
  font: inherit;
  font-size: 14px;
  padding: 3px 9px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.preview {
  height: 340px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
/* Same colour scheme as the overlay page, otherwise Chrome paints an opaque backdrop behind it. */
.preview iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.bg-dark { background: #0d0d0d; }
.bg-light { background: #e9e9e9; }
.bg-check {
  background-color: #8c8c8c;
  background-image:
    linear-gradient(45deg, #6f6f6f 25%, transparent 25%, transparent 75%, #6f6f6f 75%),
    linear-gradient(45deg, #6f6f6f 25%, transparent 25%, transparent 75%, #6f6f6f 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}
.preview-status { min-height: 1.4em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- generate and result ---------- */

.go { text-align: center; margin-top: 26px; }
button.primary {
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  padding: 10px 34px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button.primary:hover { background: #e62a2a; }

.result {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.url { display: flex; gap: 8px; }
.url input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font: 14px/1.4 ui-monospace, Consolas, monospace;
}
.url button {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 0 20px;
  color: #111;
  background: #ededed;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.url button:hover { background: #fff; }
.steps { margin: 20px 0 0; padding-left: 1.4em; line-height: 1.6; }
.steps li { margin-bottom: 6px; padding-left: 4px; }
.test { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.test a { color: var(--text); }

footer { padding: 34px 16px 44px; text-align: center; font-size: 14px; color: #8a8a8a; }
footer p { margin: 0; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top { gap: 12px; padding-top: 28px; }
  .logo { width: 72px; height: 72px; }
  .word h1 { font-size: 50px; }
  .word p { font-size: 22px; }
  .intro { font-size: 16px; margin: 18px auto 24px; }
  .panel { padding: 22px 16px 26px; border-radius: 0; border-left: 0; border-right: 0; }
  .opts, .extras { grid-template-columns: 1fr; column-gap: 0; gap: 12px; }
  .row, .sw, .sw-in { font-size: 17px; }
  .row.rt, .sw.rt { flex-direction: row-reverse; justify-content: flex-end; text-align: left; }
  div.sw.rt { flex-direction: row; justify-content: flex-start; }
  div.sw.rt .sw-in { flex-direction: row-reverse; order: -1; }
  .row select { width: 170px; }
  .preview { height: 300px; }
  .url { flex-direction: column; }
  .url button { padding: 9px; }
}
