/* Agent Release — Agentic Live house style (shared with coach + share):
   near-black canvas, Agentic Orange (#f87f2e — never raw Tailwind orange),
   mono chrome, soft corner glow. Mobile-first portrait. */

:root {
  --bg: #0a0a0a;
  --panel: #141418;
  --panel-2: #1c1c20;
  --fg: #ededef;
  --muted: #a1a1aa;
  --faint: #71717a;
  --hairline: #27272a;

  --brand-orange: #f87f2e;  /* Agentic Orange */
  --orange: var(--brand-orange);
  --ember: #ffa85e;
  --forge: #d66a1f;
  --orange-12: rgba(248, 127, 46, 0.12);
  --orange-22: rgba(248, 127, 46, 0.22);
  --orange-35: rgba(248, 127, 46, 0.35);

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;

  --mono: "Geist Mono", ui-monospace, "SF Mono", "Menlo", "Cascadia Code", monospace;
  --sans: "Geist", -apple-system, system-ui, "Segoe UI", Roboto, "Inter", sans-serif;

  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overscroll-behavior-y: contain;
}

.glow {
  position: fixed;
  top: -220px; left: -220px;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orange-12) 0%, rgba(248,127,46,0) 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 16px) 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--hairline);
}
.brand { font-family: var(--mono); font-size: 14px; letter-spacing: .02em; color: var(--fg); }
.brand-dot { color: var(--orange); }
.status { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }

/* ---- views ---- */
.view { padding-top: 18px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
.lede { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.hint { color: var(--faint); font-size: 12.5px; line-height: 1.5; margin: 14px 2px 0; }
.hint.nomargin { margin: 2px 0 10px; }
.link-btn { background: none; border: none; color: var(--ember); font-size: 14px; padding: 0 0 14px; cursor: pointer; }
.gate-alt { padding: 12px 0 0; }

/* ---- cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.card-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; }

.row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.row.spread { justify-content: space-between; }

/* ---- buttons ---- */
.btn { font-family: var(--sans); font-size: 14px; font-weight: 600; border: none; border-radius: 11px; padding: 11px 16px; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #1a0f06; }
.btn-primary:active:not(:disabled) { background: var(--forge); }
.btn-ghost { background: var(--panel-2); color: var(--fg); border: 1px solid var(--hairline); }
.btn-block { display: block; width: 100%; margin-top: 12px; }
.linkbtn { text-align: center; text-decoration: none; }

/* ---- CI status dots ---- */
.ci-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ci-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,.5); }
.ci-dot.amber { background: var(--warning); box-shadow: 0 0 8px rgba(251,191,36,.4); }
.ci-dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(251,113,133,.4); }

/* ---- release PR cards ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--faint); text-align: center; padding: 40px 0; font-size: 14px; }
.pr-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px;
  color: var(--fg);
  cursor: pointer;
}
.pr-card:active { background: var(--panel-2); }
.pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pr-repo { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bump { font-family: var(--mono); font-size: 15px; color: var(--fg); }
.bump strong { color: var(--ember); font-weight: 700; }
.bump-arr { color: var(--orange); }
.pr-age { font-family: var(--mono); font-size: 11px; color: var(--faint); flex: none; }

/* ---- empty / all-released state ---- */
.empty-state { text-align: center; padding: 36px 0 12px; }
.empty-check {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--orange-12);
  border: 1px solid var(--orange-35);
  color: var(--ember);
  font-size: 30px;
  display: grid; place-items: center;
}
.empty-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.empty-sub { color: var(--faint); font-size: 13px; margin: 0 0 24px; }
.latest { display: flex; flex-direction: column; gap: 8px; }
.latest-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
}
.latest-repo { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-ver { font-family: var(--mono); font-size: 13px; color: var(--ember); font-weight: 700; }

/* ---- arm banner (home) ---- */
.arm-banner {
  font-family: var(--mono); font-size: 12px;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
}
.arm-banner.armed { background: var(--orange-12); border: 1px solid var(--orange-35); color: var(--ember); }

/* ---- PR detail ---- */
.pr-head { margin-bottom: 14px; }
.prd-repo { font-family: var(--mono); font-size: 16px; margin: 0 0 6px; color: var(--fg); word-break: break-all; }
.prd-version .bump { font-size: 20px; }
.prd-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin: 8px 0 0; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.check-row.linky { cursor: pointer; }
.check-name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-state { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.prd-actions { margin-top: 4px; }
.prd-actions .btn-ghost { flex: 1; }
.prd-actions .btn-primary { flex: 2; }

/* ---- changelog / markdown ---- */
.changelog { font-size: 13.5px; line-height: 1.6; color: var(--muted); word-break: break-word; }
.changelog h3, .changelog h4, .changelog h5 { color: var(--fg); font-size: 14px; margin: 14px 0 6px; }
.changelog p { margin: 6px 0; }
.changelog ul { margin: 6px 0; padding-left: 20px; }
.changelog li { margin: 3px 0; }
.changelog a { color: var(--ember); }
.changelog code { font-family: var(--mono); font-size: 12px; color: var(--ember); background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.changelog pre { background: var(--bg); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px; overflow-x: auto; }
.changelog pre code { background: none; padding: 0; }

/* ---- historik ---- */
.event-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
}
.event-row.linky { cursor: pointer; }
.event-ico { font-size: 16px; line-height: 1.3; }
.event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-title { font-size: 13.5px; }
.event-repo { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---- profil: GitHub + arming ---- */
.gh-login { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.gh-ok { font-family: var(--mono); font-size: 12px; color: var(--success); }
.arm-row { border-top: 1px solid var(--hairline); margin-top: 14px; padding-top: 12px; }
.arm-state { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.armdot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; }
.armdot.on { background: var(--orange); box-shadow: 0 0 8px var(--orange-35); animation: armpulse 2s ease infinite; }
@keyframes armpulse { 50% { box-shadow: 0 0 14px var(--orange-35); } }
.mono-inline { font-family: var(--mono); color: var(--ember); }
.mono-faint { font-family: var(--mono); font-size: 12px; color: var(--faint); word-break: break-all; }

/* ---- snippet ---- */
.snippet {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ember);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ---- switch ---- */
.switch { width: 48px; height: 28px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--hairline); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch span { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--faint); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] { background: var(--orange-22); border-color: var(--orange-35); }
.switch[aria-checked="true"] span { transform: translateX(20px); background: var(--orange); }

/* ---- tab bar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(10,10,10,.86);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--hairline);
  z-index: 5;
  max-width: 540px; margin: 0 auto;
}
.tab {
  flex: 1; background: none; border: none; color: var(--faint);
  font-size: 11px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--orange); }

/* ---- sheets (merge confirm + event detail) ---- */
.sheet {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; } /* [hidden] must win over display:flex */
.sheet-panel {
  width: 100%; max-width: 540px;
  max-height: 92dvh;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: sheetup .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hairline);
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-x { background: var(--panel-2); border: 1px solid var(--hairline); color: var(--fg); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.sheet-body { padding: 18px 20px calc(env(safe-area-inset-bottom) + 24px); overflow-y: auto; }
.guide-intro { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--hairline); color: var(--fg);
  padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 40;
  opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; }

/* ---- auth gate ---- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.gate[hidden] { display: none; } /* [hidden] must win over display:flex */
.gate-card {
  width: 100%; max-width: 360px;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 18px; padding: 30px 22px; text-align: center;
}
.gate-brand { font-family: var(--mono); font-size: 18px; letter-spacing: .02em; color: var(--fg); margin-bottom: 20px; }
.gate-lede { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 22px; }
.gate .btn-block { margin-top: 10px; }
