/* FixedYet demo page. Light theme only: the owner dislikes dark backgrounds. */

:root {
  color-scheme: light;
  --bg: #fbfbf8;
  --surface: #ffffff;
  --surface-2: #f5f4ef;
  --border: #e2e0d8;
  --border-strong: #cfccc1;
  --text: #1c1b18;
  --muted: #666258;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fc;

  --good: #146c43;
  --good-bg: #e4f4ea;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --warn: #8a5300;
  --warn-bg: #fff3d6;
  --info: #5236a8;
  --info-bg: #eeeafc;
  --neutral: #3d4a5c;
  --neutral-bg: #e9eef4;
  --muted-ink: #55524a;
  --muted-bg: #eceae3;

  --code-bg: #f6f5f0;
  --diff-add-bg: #e3f4e8;
  --diff-add-ink: #0f5132;
  --diff-del-bg: #fce8e6;
  --diff-del-ink: #8a1c13;
  --diff-hunk-bg: #f0edfb;
  --tok-keyword: #b3261e;
  --tok-string: #0a3069;
  --tok-comment: #6a737d;
  --tok-number: #0550ae;
  --tok-def: #6f42c1;
  --tok-deco: #953800;
  --tok-builtin: #0b6e6e;

  --radius: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  overflow-wrap: break-word;
}

/* Full width: 16px at the sides on a phone, 32px from tablet size up. Only the run form's hero
   keeps a reading width. Code blocks scroll inside themselves, never the page. */
.wrap { width: 100%; margin: 0; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #8db4ee; outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
code, pre, kbd { font-family: var(--mono); }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text);
  font-weight: 650; text-decoration: none; font-family: var(--mono); font-size: 1rem;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.bar-nav { display: flex; align-items: center; gap: 20px; }
.bar-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.bar-link:hover { color: var(--text); }

/* hero */
.hero { padding: 48px 0 24px; max-width: 880px; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); font-weight: 750; letter-spacing: -0.025em; }
.lead { margin-top: 14px; font-size: 1.1rem; color: var(--muted); max-width: 46em; }

.run-form { display: flex; gap: 10px; margin-top: 24px; }
.run-form input {
  flex: 1 1 auto; min-width: 0; padding: 12px 14px; font: 1rem var(--mono);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.run-form input::placeholder { color: #9a968a; }
.run-form input:focus { border-color: var(--accent); outline: 3px solid #cfe0f8; outline-offset: 0; }

.btn {
  font: 600 1rem var(--sans); padding: 12px 22px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #1a52a5; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.small { font-size: 0.85rem; padding: 5px 12px; font-weight: 550; }

.hint { margin: 10px 2px 0; font-size: 0.875rem; color: var(--muted); min-height: 1.4em; }
.scope { margin: 10px 2px 0; font-size: 0.9rem; color: var(--text); }
.judge-line { margin: 10px 2px 0; font-size: 0.875rem; }
.judge-line .muted { margin-left: 8px; }
.notice {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--warn-bg); color: #5e3900; border: 1px solid #f0d99a;
}
.notice.error { background: var(--bad-bg); color: #7a1914; border-color: #f2c4c1; }
.notice a { color: inherit; font-weight: 600; }

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin: 16px 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card > h3, .card-head h3 { margin-bottom: 10px; }
.clock { font: 0.9rem var(--mono); color: var(--muted); }

/* timeline */
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 22px 1fr auto; column-gap: 12px; padding: 7px 0;
  align-items: start;
}
.timeline .dot {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 4px;
  border: 2px solid var(--border-strong); background: var(--surface);
}
.timeline .label { font-weight: 600; }
.timeline .msg { display: block; color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.timeline .time { font: 0.8rem var(--mono); color: var(--muted); padding-top: 3px; }
.timeline li.pending .label { color: #8d897d; font-weight: 500; }
.timeline li.active .dot {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 0 rgba(31, 95, 191, 0.35); animation: pulse 1.6s infinite;
}
.timeline li.done .dot { border-color: var(--good); background: var(--good); }
.timeline li.failed .dot { border-color: var(--bad); background: var(--bad); }
.timeline li.failed .msg { color: var(--bad); }
.timeline li.skipped .dot { border-style: dashed; }
.timeline li.skipped .label { color: #8d897d; font-weight: 500; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(31, 95, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 95, 191, 0); }
}

/* badges */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.82rem;
  font-weight: 650; white-space: nowrap; border: 1px solid transparent;
}
.badge.good { background: var(--good-bg); color: var(--good); border-color: #bfe3cc; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: #f2c4c1; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #efd69a; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: #d6cdf6; }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral); border-color: #cfd8e3; }
.badge.muted { background: var(--muted-bg); color: var(--muted-ink); border-color: #dcd9cf; }
.badge.big { font-size: 1.05rem; padding: 6px 16px; }
.badge.outline { background: var(--surface); color: var(--muted); border-color: var(--border-strong); }

/* report */
.verdict-card { border-top: 4px solid var(--border-strong); }
.verdict-card.good { border-top-color: var(--good); }
.verdict-card.bad { border-top-color: var(--bad); }
.verdict-card.warn { border-top-color: #d99a1c; }
.verdict-card.info { border-top-color: var(--info); }
.verdict-card.neutral { border-top-color: var(--neutral); }
.verdict-card.muted { border-top-color: #9a968a; }
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.issue-title { margin: 14px 0 2px; font-size: 1.25rem; font-weight: 650; line-height: 1.3; }
.issue-link { font: 0.85rem var(--mono); color: var(--muted); word-break: break-all; }
.blurb { margin: 12px 0 0; }
.basis { margin: 10px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 0.9rem; }
.banner {
  background: var(--info-bg); color: #3d2a85; border: 1px solid #d6cdf6;
  border-radius: var(--radius); padding: 10px 14px; margin: 16px 0 0; font-size: 0.9rem;
}
.banner .md { font-size: inherit; }
.banner .md > :last-child { margin-bottom: 0; }
.banner ul.plain { padding-left: 1.2em; }
.banner ul.plain li { margin: 0.2em 0; }
.banner a { color: #2a3f9e; }

.sides { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.side { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.side-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.side-ref { font: 600 1.05rem var(--mono); margin: 4px 0 10px; word-break: break-all; }
.side-ref a { color: var(--accent); }
.runs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  font: 650 0.8rem var(--mono); padding: 3px 9px; border-radius: 6px; border: 1px solid transparent;
}
.chip.pass { background: var(--good-bg); color: var(--good); border-color: #bfe3cc; }
.chip.fail { background: var(--bad-bg); color: var(--bad); border-color: #f2c4c1; }
.chip.error { background: var(--warn-bg); color: var(--warn); border-color: #efd69a; }
.chip.none { background: var(--muted-bg); color: var(--muted-ink); }
.side-note { margin: 0; font-size: 0.9rem; color: var(--muted); }

details { margin-top: 10px; }
summary { cursor: pointer; font-size: 0.875rem; color: var(--muted); }
summary:hover { color: var(--text); }

pre.code {
  margin: 0; padding: 14px; background: var(--code-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; overflow-x: auto;
  font-size: 0.85rem; line-height: 1.6; tab-size: 4; max-width: 100%;
}
pre.code code { font: inherit; white-space: pre; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.code-path { font: 0.85rem var(--mono); color: var(--muted); word-break: break-all; }
/* diffs: light, a tint per line (never a dark block) */
pre.code.diff code { display: block; min-width: max-content; }
.d-line { display: block; padding: 0 14px; margin: 0 -14px; white-space: pre; }
.d-add { background: var(--diff-add-bg); color: var(--diff-add-ink); }
.d-del { background: var(--diff-del-bg); color: var(--diff-del-ink); }
.d-hunk { background: var(--diff-hunk-bg); color: var(--info); }
.d-meta { color: var(--muted); font-weight: 600; }
.tok-k { color: var(--tok-keyword); }
.tok-s { color: var(--tok-string); }
.tok-c { color: var(--tok-comment); font-style: italic; }
.tok-n { color: var(--tok-number); }
.tok-d { color: var(--tok-def); }
.tok-a { color: var(--tok-deco); }
.tok-b { color: var(--tok-builtin); }

.evidence { list-style: none; margin: 0; padding: 0; }
.evidence li { padding: 10px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.evidence li:first-child { border-top: 0; padding-top: 0; }
.evidence .e-title { font-weight: 600; word-break: break-word; }
.evidence .e-why { color: var(--muted); font-size: 0.9rem; }
.evidence .badge { justify-self: start; font-size: 0.72rem; padding: 1px 9px; }

ul.plain { margin: 0; padding-left: 1.2em; }
ul.plain li { margin: 0.25em 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px 24px; margin: 0; }
.facts > div, .sides > *, .example-list > * { min-width: 0; }
.facts dd a { color: var(--accent); }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.facts dd { margin: 0; font: 600 1rem var(--mono); overflow-wrap: anywhere; }

/* rendered markdown */
.md { font-size: 0.95rem; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 0.4em; }
.md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.15rem; } .md h3, .md h4 { font-size: 1rem; }
.md > :first-child { margin-top: 0; }
.md blockquote { margin: 0 0 0.8em; padding: 0.2em 1em; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md code:not(pre code) { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.88em; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md table { border-collapse: collapse; margin: 0 0 0.8em; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); }
.md .table-scroll { overflow-x: auto; }

/* examples */
.examples { margin: 40px 0 8px; }
.examples h2 { margin-bottom: 4px; }
.example-list { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.example {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.example.attention { border-color: var(--accent); box-shadow: 0 0 0 3px #cfe0f8; }
.example .ex-title { font-weight: 600; line-height: 1.35; }
.example .ex-repo { font: 0.8rem var(--mono); color: var(--muted); word-break: break-all; }
.example .ex-title { overflow-wrap: anywhere; }
.example .ex-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.example .ex-pr { font-size: 0.875rem; font-weight: 600; }
.example .ex-label { font-size: 0.875rem; color: var(--muted); }
.example .ex-actions .btn { text-decoration: none; }
.example .tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* reports page */
.page-head { padding: 28px 0 4px; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 750; letter-spacing: -0.02em; }
.page-head p { margin: 8px 0 0; max-width: 60em; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 18px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; font: 600 0.875rem var(--sans);
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn .count { font: 600 0.75rem var(--mono); opacity: 0.8; }
.search {
  flex: 1 1 260px; max-width: 460px; min-width: 0; padding: 9px 14px; font: 1rem var(--sans);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.search:focus { border-color: var(--accent); outline: 3px solid #cfe0f8; outline-offset: 0; }

.report-list { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; gap: 10px; }
.report-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
}
.report-row:hover { border-color: var(--border-strong); background: #fffefb; }
.rr-main { min-width: 0; }
.rr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.rr-title { display: block; font-weight: 650; line-height: 1.35; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.rr-title:hover { color: var(--accent); text-decoration: underline; }
.rr-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font: 0.82rem var(--mono); color: var(--muted); }
.rr-issue { color: var(--muted); word-break: break-all; }
.rr-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; align-self: stretch; gap: 8px; min-width: 0; }
.rr-action { display: flex; justify-content: flex-end; align-items: flex-start; min-height: 30px; max-width: 280px; text-align: right; }
.rr-meta { display: flex; justify-content: flex-end; align-items: baseline; gap: 4px 14px; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.rr-pr { font-weight: 650; }
.rr-sub .rr-earlier { font: 600 0.82rem var(--sans); }
.report-row.earlier { margin-left: 28px; background: var(--surface-2); border-style: dashed; }
.report-row.earlier:hover { background: #f1f0ea; }
.rr-nobp { font-size: 0.82rem; }
.rr-action .btn { text-decoration: none; }

.back-link { display: inline-block; margin: 20px 0 0; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.detail-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.detail-bar .spacer { flex: 1 1 auto; }
.backport-card .pr-line { font-size: 1.05rem; margin: 0 0 6px; }
.fix-card .fix-summary { margin: 4px 0 10px; }
.fix-card .fix-lead { margin: 0 0 12px; }
.fix-card .fix-lead .badge { margin-right: 6px; }
.fix-card .facts { margin: 4px 0 12px; }
.fix-card .fix-note { margin: 12px 0 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid #d6cdf6; color: #3d2a85; }
.fix-card .fix-note .md > :last-child { margin-bottom: 0; }
.fix-card .fix-note a { color: #2a3f9e; }
.fix-card .other-callers { margin-top: 10px; }
.fix-card .fix-explain { color: var(--muted); font-size: 0.92rem; }
.fix-card pre.code.diff { margin: 6px 0 4px; }
.attempt-detail { font-size: 0.85rem; overflow-wrap: anywhere; }
.backport-card details > :not(summary) { margin-top: 12px; }
.backport-area, .fix-area { margin-top: 14px; }
.backport-card .facts { margin: 4px 0 14px; }
.backport-card .facts dd a { color: var(--accent); }
.warn-box { margin: 0 0 14px; }
.pr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.panel { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
.panel > :last-child { margin-bottom: 0; }
.job-title { font-weight: 600; margin: 0; }
.job-log { list-style: none; margin: 8px 0 0; padding: 0; font: 0.85rem var(--mono); }
.job-log li { display: flex; gap: 12px; padding: 3px 0; border-top: 1px solid var(--border); }
.job-stage { flex: 0 0 6.5em; color: var(--muted); }
.job-msg { min-width: 0; overflow-wrap: anywhere; }
.linklike {
  font: inherit; background: none; border: 0; padding: 0; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.admin-line { margin-top: 12px; }
.admin-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-width: 520px; }
.admin-form input {
  flex: 1 1 220px; min-width: 0; padding: 7px 12px; font: 0.95rem var(--mono);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px;
}

/* how */
.how { margin: 40px 0 16px; }
.how h2 { margin-bottom: 12px; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.matrix { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.matrix th, .matrix td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.92rem; }
.matrix th { background: var(--surface-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.matrix tr:last-child td { border-bottom: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0 34px; background: var(--surface); color: var(--muted); font-size: 0.875rem; }
.site-footer p { margin: 0 0 6px; }

@media (max-width: 520px) {
  .hero { padding-top: 32px; }
  .run-form { flex-direction: column; }
  .btn { width: 100%; }
  .btn.small { width: auto; }
  .card { padding: 14px; }
  .timeline li { grid-template-columns: 22px 1fr; }
  .timeline .time { grid-column: 2; padding-top: 0; }
  .bar-nav { gap: 14px; }
}

@media (max-width: 640px) {
  /* narrow: tags, title, repo line, then the meta, then the action, all from the left */
  .report-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rr-side { flex-direction: column-reverse; justify-content: flex-start; align-items: flex-start; gap: 8px; }
  .rr-meta { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .rr-action { justify-content: flex-start; min-height: 0; max-width: none; text-align: left; }
  .rr-action:empty { display: none; }
  .report-row.earlier { margin-left: 14px; }
  .job-log li { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .timeline li.active .dot { animation: none; }
}
.confirm-row { margin-top: 12px; display: grid; gap: 8px; }
.confirm-row label { font-size: 0.9rem; }
.confirm-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-input { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border, #ccc); border-radius: 8px; font: 0.95rem var(--mono); }
.pr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
