:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #111);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --sep: color-mix(in srgb, var(--hint) 22%, transparent);
  --ok: #2ea44f; --bad: #d1242f; --warn: #d29922; --info: #8250df;
}
@media (prefers-color-scheme: dark) { :root:not(.tg) { --bg:#17191c; --bg2:#0e0f11; --text:#e8e8e8; --hint:#8a8f98; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg2); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
.muted { color: var(--hint); } .small { font-size: 12px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.ghost { color: var(--link); padding: 4px 6px; }
header { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 12px 0;
  border-bottom: 1px solid var(--sep); padding-top: calc(10px + var(--tg-content-safe-area-inset-top, 0px)); }
.title-row { display: flex; align-items: baseline; gap: 8px; }
h1 { font-size: 20px; margin: 0; }
#who { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-row { margin: 6px 0 2px; font-size: 13px; color: var(--hint); }
.as-row select { font: inherit; color: var(--text); background: var(--bg2); border: 0; border-radius: 6px; padding: 3px 6px; margin-left: 4px; }
nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 8px -12px 0; padding: 0 8px; }
nav::-webkit-scrollbar { display: none; }
nav button { white-space: nowrap; padding: 8px 10px 9px; color: var(--hint); border-bottom: 2px solid transparent; font-size: 14px; }
nav button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
nav .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px; line-height: 18px;
  background: var(--bg2); color: var(--hint); font-weight: 600; text-align: center; }
nav button.on .n.hot, nav .n.hot { background: var(--accent); color: var(--accent-text); }
main { padding: 8px 10px 24px; }
.state { text-align: center; padding: 48px 16px; color: var(--hint); }
.state .big { font-size: 34px; margin-bottom: 6px; }
.sec-h { margin: 14px 4px 6px; font-size: 13px; font-weight: 600; color: var(--hint); text-transform: uppercase; letter-spacing: .03em; }
.sec-h:first-child { margin-top: 4px; }
.card { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: block; color: inherit; text-decoration: none; }
.card:active { opacity: .7; }
.row1 { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--hint); }
.repo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ci { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ci.success { background: var(--ok); } .ci.failure { background: var(--bad); } .ci.pending { background: var(--warn); }
.ttl { font-weight: 600; margin: 3px 0 6px; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; margin-right: 4px; vertical-align: 1px; }
.b-prod { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.b-re { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.b-ready { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.b-why { background: var(--bg2); color: var(--hint); font-weight: 500; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--hint); flex-wrap: wrap; }
.appr { display: inline-flex; align-items: center; gap: 5px; }
.bar { display: inline-flex; gap: 2px; } .bar i { width: 10px; height: 4px; border-radius: 2px; background: var(--sep); }
.bar i.f { background: var(--ok); }
.revs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
  font-weight: 700; color: #fff; position: relative; box-shadow: 0 0 0 2px var(--bg); }
.av s { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; font-size: 9px; line-height: 13px;
  text-align: center; text-decoration: none; color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.chip { font-size: 12px; padding: 2px 7px; border-radius: 10px; background: var(--bg2); white-space: nowrap; }
.st-APPROVED { background: var(--ok) !important; } .st-CHANGES_REQUESTED { background: var(--bad) !important; }
.st-COMMENTED { background: var(--info) !important; } .st-WAIT { background: var(--hint) !important; } .st-STALE { background: var(--warn) !important; }
.chip.st-APPROVED, .chip.st-CHANGES_REQUESTED, .chip.st-COMMENTED, .chip.st-STALE { color: #fff; }
.chip.st-WAIT { background: var(--bg2) !important; color: var(--hint); }
.me-ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.compact .card { padding: 8px 12px; }
.compact .ttl { margin: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact .revs, .compact .meta .sz { display: none; }
.compact .row2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }
footer { text-align: center; font-size: 12px; padding: 0 0 calc(16px + var(--tg-safe-area-inset-bottom, 0px)); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-radius: 16px 16px 0 0;
  padding: 12px 14px calc(18px + var(--tg-safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 30px rgba(0,0,0,.18); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 9px; padding: 2px; }
.seg button { padding: 5px 10px; border-radius: 7px; font-size: 13px; }
.seg button.on { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
