:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #5d6670; --line: #e3e6ea;
  --accent: #2563eb; --accent-text: #fff; --ok: #15803d; --bad: #c62828; --warn: #b45309;
  --code: #f0f2f5; --logbg: #0f1419; --logtext: #d6dde4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #8b949e; --line: #2a313a;
    --accent: #3b82f6; --ok: #3fb950; --bad: #f85149; --warn: #d29922; --code: #1f262e;
    --logbg: #090c10;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 10px; }
.wrapgap { flex-wrap: wrap; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.top { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.top .wrap { height: 56px; justify-content: space-between; }
.brand { font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
nav { display: flex; gap: 18px; align-items: center; font-size: .92rem; }
nav form { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px; margin-bottom: 18px; }
.narrow { max-width: 460px; margin: 48px auto; }
.hero { text-align: center; padding: 40px 22px; }
.hero p { max-width: 460px; margin: 0 auto 20px; }
label { display: block; font-weight: 550; font-size: .9rem; margin-bottom: 14px; }
label small { font-weight: 400; color: var(--muted); }
input, select { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; font: inherit; font-weight: 560; cursor: pointer; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 7px; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.gh { background: #24292f; border-color: #24292f; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.full { width: 100%; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent);
  padding: 9px 12px; border-radius: 7px; }
.perms { padding-left: 20px; }
.pill { font-size: .78rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.live { color: var(--ok); border-color: var(--ok); }
.repo-line { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 1.05rem; margin: 2px 0; }
.repos { display: grid; gap: 8px; margin-bottom: 16px; max-height: 360px; overflow: auto; }
.repo { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 7px; margin: 0; cursor: pointer; font-weight: 400; }
.repo input { width: auto; margin: 0; }
.repo span { display: flex; flex-direction: column; }
.deploys { list-style: none; margin: 0; padding: 0; }
.deploys li { display: grid; grid-template-columns: 82px 1fr auto; gap: 4px 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line); }
.deploys li:first-child { border-top: 0; }
.deploys .msg { color: var(--text); font-weight: 520; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deploys .meta { grid-column: 2 / -1; }
.status { font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.s-success { color: var(--ok); } .s-failed { color: var(--bad); }
.s-building, .s-queued { color: var(--warn); } .s-skipped { color: var(--muted); }
.s-building::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-right: 5px; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }
.msg-title { font-size: 1.15rem; word-break: break-word; }
.log { background: var(--logbg); color: var(--logtext); padding: 14px; border-radius: 8px; margin: 16px 0 0;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap;
  word-break: break-all; max-height: 65vh; overflow: auto; min-height: 120px; }
.danger-zone { margin: 8px 0 40px; color: var(--muted); }
.danger-zone summary { cursor: pointer; font-size: .9rem; }
.danger-zone form { margin-top: 8px; }

/* ---- phones ---- */
html { -webkit-text-size-adjust: 100%; }
.brand { min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { flex: none; }
nav { flex: none; }
.repo-line a, .msg-title, .card p { overflow-wrap: anywhere; }
.btn { min-height: 40px; }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .top { margin-bottom: 14px; }
  .top .wrap { height: auto; min-height: 52px; gap: 10px; padding-top: 6px; padding-bottom: 6px; }
  nav { gap: 14px; font-size: .9rem; }
  nav a, nav button.link { padding: 8px 0; }
  .card { padding: 16px; border-radius: 9px; margin-bottom: 12px; }
  .narrow { margin: 16px auto; }
  .hero { padding: 28px 16px; }
  h1 { font-size: 1.25rem; }
  /* 16px inputs stop iOS from zooming the page when a field is focused */
  input, select { font-size: 16px; padding: 11px 12px; }
  .btn { min-height: 46px; padding: 11px 16px; }
  .hero .btn, .card > .row .btn, .card > .row form, .card .row.gap, .card > .row > .row { width: 100%; }
  .card > .row form .btn { width: 100%; }
  .grid .row.gap { flex-direction: column; }
  .grid .row.gap .btn { width: 100%; }
  .deploys li { grid-template-columns: 1fr auto; gap: 3px 8px; padding: 12px 0; }
  .deploys .status { grid-column: 1; grid-row: 1; }
  .deploys .pill.live { grid-column: 2; grid-row: 1; }
  .deploys .msg { grid-column: 1 / -1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; padding: 2px 0; }
  .deploys .meta { grid-column: 1 / -1; }
  .repo { padding: 13px 12px; }
  .repos { max-height: 50vh; }
  .log { font-size: 11.5px; padding: 10px; margin-left: -6px; margin-right: -6px; max-height: 60vh; }
  .danger-zone { padding: 0 4px; }
  .danger-zone summary { padding: 10px 0; }
}
@media (max-width: 380px) {
  nav { gap: 10px; font-size: .84rem; }
}
.narrow .check { margin: -2px 0 16px; align-items: center; } .narrow .check input { margin: 0; width: 18px; height: 18px; }
[hidden] { display: none !important; }
