/* The service's pages: plain, readable, fine on a phone, light or dark as the system is. */

:root {
  --bg: #ffffff;
  --fg: #1b1d21;
  --muted: #5b6270;
  --line: #d9dce1;
  --panel: #f5f6f8;
  --accent: #1f5fbf;
  --accent-fg: #ffffff;
  --ok: #1d7a3a;
  --wait: #8a5a00;
  --bad: #b3261e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e8eaed;
    --muted: #a3a9b4;
    --line: #343840;
    --panel: #1e2125;
    --accent: #7aa7ff;
    --accent-fg: #0d1626;
    --ok: #6fd08c;
    --wait: #f0c060;
    --bad: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 16px 3rem;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
body.wide { max-width: 64rem; }

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.home { font-weight: 600; text-decoration: none; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.5rem 0; }
h2 { font-size: 1.25rem; margin-top: 2rem; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 0.25rem; }
h4 { margin: 0 0 0.25rem; }

.muted { color: var(--muted); }

button, .button {
  display: inline-block;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button.quiet { background: transparent; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
label.inline { display: inline-flex; gap: 0.25rem; margin-right: 1rem; font-weight: normal; }
input:not([type="radio"]), select, textarea {
  width: 100%;
  max-width: 32rem;
  min-height: 44px;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
form button { margin-top: 0.75rem; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0.5rem 0; }

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.9rem;
}
pre.task-text { white-space: pre-wrap; }
pre.held { max-height: 24rem; overflow: auto; }

.state { font-weight: 600; }
.state.ok { color: var(--ok); }
.state.waiting { color: var(--wait); }
.state.problem, .problem { color: var(--bad); }

.steps { padding-left: 1.25rem; }
.step { margin-bottom: 1.25rem; }
.step-title { font-weight: 600; margin: 0; }
.badge {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.8rem;
  font-weight: 600;
}
.step.done .badge { color: var(--ok); }
.step.problem .badge { color: var(--bad); }
.step.todo .badge { color: var(--wait); }
.commands h3 { font-size: 0.95rem; color: var(--muted); }

.rows { list-style: none; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.rows > li p { margin: 0.2rem 0; }
.place { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.place label { margin: 0; }
.place select { width: auto; }
.place button { margin: 0; }

.submission { border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem; margin: 0.75rem 0; }
blockquote { margin: 0.5rem 0; padding-left: 0.75rem; border-left: 3px solid var(--line); white-space: pre-wrap; }
details { margin: 0.4rem 0; }
summary { cursor: pointer; }

#status:empty { display: none; }
#status {
  position: sticky;
  top: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
}
#status[data-kind="error"] { color: var(--bad); border-color: var(--bad); }

.problems { padding-left: 1.25rem; margin: 0.5rem 0; }
code.secret { display: block; overflow-wrap: anywhere; font-size: 0.85rem; }
.rows .actions button { margin: 0; }

button:disabled { opacity: 0.45; cursor: not-allowed; }
button.danger { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.end, .revoke { border: 1px solid var(--bad); border-radius: 6px; padding: 0.75rem; margin: 0.75rem 0; }

.copy { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.copy input { flex: 1 1 16rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }
.copy button { margin: 0; }
.made { margin-top: 1rem; }

.badge.cohort-open { color: var(--ok); margin-left: 0.5rem; }
.badge.cohort-closed { color: var(--wait); margin-left: 0.5rem; }
.badge.cohort-ended { color: var(--muted); margin-left: 0.5rem; }
.state.cohort-open { color: var(--ok); }
.state.cohort-closed { color: var(--wait); }
.state.cohort-ended { color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0.5rem 0; }
table.boxes { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.boxes th, table.boxes td { text-align: left; vertical-align: top; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
table.boxes thead th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.boxes td.actions { white-space: nowrap; }
table.boxes td.actions button { margin: 0; min-height: 36px; padding: 0.3rem 0.7rem; }
table.boxes .revoke-row td { border-bottom: 1px solid var(--line); }
td.box-running { color: var(--ok); font-weight: 600; }
td.box-starting { color: var(--wait); font-weight: 600; }

.placeholder { padding: 0.75rem; border: 1px dashed var(--wait); border-radius: 6px; color: var(--wait); font-weight: 600; }

.foot { margin-top: 3rem; padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
[hidden] { display: none !important; }
