:root {
  --bg: #0d0b0b;
  --surface: #171313;
  --surface-2: #211a1a;
  --line: #3a2b2b;
  --text: #ecdcdc;
  --muted: #a99292;
  --accent: #ff5a4f;
  --accent-soft: #3d1715;
  --ok: #7fcf8f;
  --warn: #e9b44c;
  --merged: #b99cff;
  --radius: 10px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf7f6;
    --surface: #ffffff;
    --surface-2: #f3eceb;
    --line: #e2d5d3;
    --text: #231b1a;
    --muted: #6e5f5d;
    --accent: #c62f25;
    --accent-soft: #fbe3e0;
    --ok: #237a38;
    --warn: #8a5b00;
    --merged: #6a3fd1;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
code, pre, .sha, .device { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { padding-top: 28px; }
.brand { font-weight: 700; letter-spacing: 0.04em; text-decoration: none; text-transform: uppercase; font-size: 0.85rem; }
h1 { margin: 4px 0 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; }
.lede { margin: 0 0 20px; color: var(--muted); max-width: 70ch; }

.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text); text-decoration: none; font-weight: 600;
  border: 1px solid transparent; border-bottom: 0;
}
.tabs a:hover { background: var(--surface-2); }
.count { color: var(--muted); font-weight: 400; font-size: 0.85em; margin-left: 2px; }

.status { margin: 20px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.status.warn { border-left: 3px solid var(--warn); }
.status.error, .error { color: var(--accent); }

.channel { padding-top: 28px; scroll-margin-top: 8px; }
.channel h2 { margin: 0 0 4px; font-size: 1.4rem; }
.explain { margin: 0 0 16px; color: var(--muted); max-width: 72ch; }
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); margin: 0; }

.list { display: grid; gap: 14px; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 10px;
  scroll-margin-top: 12px;
}
.card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card.gone { opacity: 0.6; }
.card header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.card h3 { flex-basis: 100%; margin: 4px 0 0; font-size: 1.12rem; line-height: 1.3; padding-right: 24px; }
.anchor { position: absolute; top: 12px; right: 14px; color: var(--muted); text-decoration: none; opacity: 0.5; }
.anchor:hover { opacity: 1; }

.kind, .pill {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.kind.release { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.open { color: var(--ok); }
.pill.merged { color: var(--merged); }
.pill.draft, .pill.closed { color: var(--muted); }

.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 0.93rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.device { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.rel { color: var(--muted); }

.summary { margin: 12px 0 4px; max-width: 75ch; }

.section { border-top: 1px solid var(--line); margin-top: 10px; }
.section > summary {
  cursor: pointer; padding: 9px 0; font-weight: 600; font-size: 0.95rem; list-style: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--muted); transition: transform 0.15s; }
.section[open] > summary::before { transform: rotate(90deg); }
.section > :not(summary) { margin-bottom: 12px; }

.markdown { overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 1.02rem; margin: 16px 0 6px; }
.markdown img { max-width: 100%; height: auto; }
.markdown pre, .plain { background: var(--surface-2); padding: 10px 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }
.markdown table { border-collapse: collapse; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 4px 8px; }
.markdown blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }

.commits { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.92rem; }
.commits li {
  display: grid; grid-template-columns: 4.6em 1fr; gap: 0 10px;
  padding: 6px 0; border-bottom: 1px solid var(--surface-2);
}
.commits .sha { text-decoration: none; padding-top: 1px; }
.commits .msg { overflow-wrap: anywhere; }
.commits .who, .commits .body { grid-column: 2; }
.who { color: var(--muted); font-size: 0.86em; }
.commits .body summary { cursor: pointer; color: var(--muted); font-size: 0.85em; }
.commits .body pre { white-space: pre-wrap; margin: 4px 0 0; color: var(--muted); }
.note { color: var(--muted); font-size: 0.9em; }

.tech { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.88rem; margin: 0; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; overflow-wrap: anywhere; }

.pending { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; }
.pending h3 { margin: 0 0 4px; font-size: 1rem; }
.pending p { margin: 0 0 8px; color: var(--muted); }
.pending ul { margin: 0; padding-left: 18px; }

.images { list-style: none; padding: 0; margin: 0; }
.images.all { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.images.all .image { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.images.all .image:last-child { border-bottom: 0; }
.card.recommended { border-color: var(--accent); }
.card.recommended .image { padding: 8px 0 6px; }
.image { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; }
.image-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.image-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.image-meta { grid-column: 1; font-size: 0.9rem; }
.image-get { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.button {
  display: inline-block; padding: 7px 14px; border-radius: 8px; background: var(--accent); color: var(--bg);
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.button span { font-weight: 400; opacity: 0.85; }
.kind.pr { color: var(--warn); }

.foot { padding-top: 32px; padding-bottom: 40px; color: var(--muted); font-size: 0.88rem; }

@media (max-width: 560px) {
  .image { grid-template-columns: 1fr; }
  .image-get { grid-column: 1; grid-row: auto; flex-wrap: wrap; margin-top: 6px; }
  .meta, .tech { grid-template-columns: 1fr; gap: 0; }
  .meta dt, .tech dt { margin-top: 6px; font-size: 0.82rem; }
  .card { padding: 14px 14px 8px; }
}
