@font-face {
  font-family: "Phantom Sans";
  src: url("https://assets.hackclub.com/fonts/Phantom_Sans_0.7/Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Phantom Sans";
  src: url("https://assets.hackclub.com/fonts/Phantom_Sans_0.7/Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --red: #ec3750;
  --red-dark: #c8203a;
  --ink: #1f2d3d;
  --slate: #3c4858;
  --muted: #687587;
  --smoke: #e0e6ed;
  --snow: #f9fafc;
  --white: #ffffff;
  --green: #33d6a6;
  --orange: #ff8c37;
  --font: "Phantom Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }

h1 { font-size: 40px; line-height: 1.1; margin: 0 0 var(--s3); letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: var(--s5) 0 var(--s2); }
p { margin: 0 0 var(--s3); max-width: 64ch; }
code { font-size: 14px; background: var(--smoke); padding: 1px 5px; border-radius: 4px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 var(--s4); }

.top {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 0 var(--s3);
  border-bottom: 1px solid var(--smoke);
  margin-bottom: var(--s5);
}
.top .flag { display: block; width: 112px; height: auto; }
.top .product { font-weight: 700; text-decoration: none; font-size: 18px; margin-top: var(--s3); }
.top nav { margin-left: auto; margin-top: var(--s3); display: flex; gap: var(--s3); align-items: center; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--slate); }
.top nav a:hover { color: var(--red); }
.count { background: var(--red); color: var(--white); border-radius: 99px; padding: 0 7px; font-size: 13px; font-weight: 700; }

.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--red-dark); font-weight: 700; }
.notice { border-left: 4px solid var(--red); padding: var(--s2) var(--s3); background: var(--white); margin: 0 0 var(--s4); }
.notice.ok { border-color: var(--green); }

.channel { font-weight: 700; }
.channel::before { content: "#"; color: var(--muted); margin-right: 1px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: 1px; }
h1 .dot { width: 14px; height: 14px; margin-right: 10px; vertical-align: 0.2em; }
.dot.live { background: var(--green); }
.dot.pending { background: var(--orange); }
.dot.paused, .dot.rejected, .dot.expired { background: var(--muted); }

.rows { list-style: none; margin: 0 0 var(--s4); padding: 0; border-top: 1px solid var(--smoke); }
.rows > li { border-bottom: 1px solid var(--smoke); padding: var(--s3) 0; }
.row-main { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.row-main .grow { flex: 1; min-width: 12ch; }
.row-main .meta { color: var(--muted); font-size: 14px; }

.bot-name { font-size: 20px; font-weight: 700; text-decoration: none; }

.tabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--smoke); margin: var(--s3) 0 var(--s4); overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--slate); padding: var(--s2) 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-color: var(--red); }

.figures { display: flex; gap: var(--s5); flex-wrap: wrap; margin: var(--s4) 0; }
.figures div { display: flex; flex-direction: column; }
.figures strong { font-size: 40px; line-height: 1; }
.figures span { color: var(--muted); font-size: 14px; margin-top: var(--s1); }

.ticket summary { list-style: none; cursor: pointer; }
.ticket summary::-webkit-details-marker { display: none; }
.ticket .title { font-weight: 700; }
.ticket .age { font-weight: 700; color: var(--red-dark); min-width: 4ch; }
.wait { height: 4px; background: var(--smoke); margin-top: var(--s2); border-radius: 2px; }
.wait span { display: block; height: 100%; background: var(--red); border-radius: 2px; }
.thread { margin: var(--s3) 0 0 0; padding-left: var(--s3); border-left: 2px solid var(--smoke); }
.thread .msg { margin-bottom: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; }
.thread .who { font-weight: 700; margin-right: var(--s2); }

form.stack { display: flex; flex-direction: column; gap: var(--s4); max-width: 640px; }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field label, fieldset legend { font-weight: 700; }
fieldset { border: 1px solid var(--smoke); border-radius: var(--radius); padding: var(--s3); margin: 0; background: var(--white); }
fieldset .choice { display: flex; gap: var(--s2); align-items: center; margin: var(--s2) 0; }
input[type=text], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: var(--white);
  border: 1px solid #c0ccda; border-radius: var(--radius); padding: 10px 12px; width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(236, 55, 80, 0.25); }

.inline { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.inline input[type=text] { width: auto; flex: 1; min-width: 14ch; }

button, .button {
  font: 700 16px/1 var(--font); border: 0; border-radius: var(--radius); cursor: pointer;
  padding: 12px 18px; background: var(--red); color: var(--white); text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: var(--red-dark); color: var(--white); }
button.quiet, .button.quiet { background: transparent; color: var(--ink); border: 1px solid #c0ccda; }
button.quiet:hover, .button.quiet:hover { border-color: var(--ink); color: var(--ink); }
button.small { padding: 7px 12px; font-size: 14px; }

.signin { padding: var(--s6) 0; max-width: 560px; }
.signin h1 { font-size: 56px; }

.empty { padding: var(--s5) 0; color: var(--slate); }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { width: 9rem; text-align: left; color: var(--muted); font-weight: 400; padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--smoke); }
td { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--smoke); vertical-align: top; }

footer { margin: var(--s6) 0 var(--s4); color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  h1 { font-size: 32px; }
  .signin h1 { font-size: 40px; }
  .wrap { padding: 0 var(--s3); }
  .top { flex-wrap: wrap; margin-bottom: var(--s4); }
  .top nav { margin-left: 0; margin-top: var(--s2); width: 100%; }
  .figures { gap: var(--s4); }
  .figures strong { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
thead th { width: auto; }

.label-row { display: flex; align-items: center; gap: var(--s2); }
.label-row p, .label-row h2 { margin: 0; }
.label-row + .rows, .label-row + form { margin-top: var(--s3); }
.optional { color: var(--muted); font-size: 13px; margin-left: auto; }

.tip {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  background: var(--white); color: var(--muted); border: 1px solid #c0ccda;
  font: 700 12px/1 var(--font); cursor: help;
}
.tip:hover, .tip:focus-visible { background: var(--white); color: var(--ink); border-color: var(--ink); }
.tip-body {
  position: absolute; z-index: 10; left: -6px; bottom: calc(100% + 8px);
  width: max-content; max-width: min(300px, 80vw); padding: var(--s2) 12px; border-radius: var(--radius);
  background: var(--ink); color: var(--white); font: 400 14px/1.45 var(--font); text-align: left;
  visibility: hidden; opacity: 0; transition: opacity 120ms ease; pointer-events: none;
}
.tip:hover .tip-body, .tip:focus .tip-body { visibility: visible; opacity: 1; }

fieldset.pick { border: 0; padding: 0; background: none; display: flex; flex-direction: column; gap: var(--s2); }
fieldset.pick legend { font-weight: 700; padding: 0; margin-bottom: var(--s1); }
.seg { display: inline-flex; align-self: flex-start; border: 1px solid #c0ccda; border-radius: var(--radius); overflow: hidden; background: var(--white); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 14px; font-size: 15px; cursor: pointer; color: var(--slate); border-right: 1px solid var(--smoke); }
.seg label:last-of-type { border-right: 0; }
.seg input:checked + label { background: var(--ink); color: var(--white); font-weight: 700; }
.seg input:focus-visible + label { outline: 3px solid var(--red); outline-offset: -3px; }
.pick:has(input[value=existing]:checked) .if-create,
.pick:has(input[value=create]:checked) .if-existing,
.pick:has(input[value=none]:checked) .if-existing,
.pick:has(input[value=none]:checked) .if-create { display: none; }

details.more > summary, details.group > summary { cursor: pointer; font-weight: 700; }
details.more > summary { color: var(--slate); }
details.more[open] > summary { margin-bottom: var(--s3); }
details.group { border-bottom: 1px solid var(--smoke); }
details.group:first-of-type { border-top: 1px solid var(--smoke); margin-top: var(--s3); }
details.group > summary { display: flex; gap: var(--s3); align-items: baseline; padding: var(--s3) 0; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "+"; color: var(--muted); width: 1ch; }
details.group[open] > summary::before { content: "−"; }
details.group .meta { color: var(--muted); font-size: 14px; font-weight: 400; }
details.group .field { margin: 0 0 var(--s4); }

.danger-row { margin-top: var(--s5); }
