/* noocyte — minimal, server-rendered, no build chain. */
:root {
  --bg: #ffffff; --fg: #1a1a24; --muted: #667; --line: #e2e2ea;
  --accent: #7a1f2b; /* blood music */ --accent-soft: #f7ecee;
  --code-bg: #f6f6f9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14141a; --fg: #e8e8ee; --muted: #99a; --line: #2c2c36;
    --accent: #d76a78; --accent-soft: #2a1b1e; --code-bg: #1d1d26;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; align-items: center; gap: 1rem;
  max-width: 72rem; margin: 0 auto; padding: .6rem 1rem; }
.brand { font-weight: 700; letter-spacing: .04em; }
.spacer { flex: 1; }
.searchbox input { padding: .35rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); min-width: 18rem; }
.linklike { background: none; border: none; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0; }

.container { max-width: 72rem; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.flash { padding: .6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.notice { background: var(--accent-soft); }
.flash.alert { background: #fde8e8; color: #7a1f1f; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .45rem .6rem;
  border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.doc-body pre, pre { background: var(--code-bg); padding: .8rem 1rem;
  border-radius: 8px; overflow-x: auto; }
.doc-body code, code { background: var(--code-bg); border-radius: 4px;
  padding: .1em .3em; font-size: .92em; }
.doc-body pre code { padding: 0; background: none; }
.doc-body img { max-width: 100%; }
.doc-body blockquote { border-left: 3px solid var(--accent);
  margin-left: 0; padding-left: 1rem; color: var(--muted); }
.doc-meta { color: var(--muted); font-size: .85rem; margin: .3rem 0 1.2rem; }
.doc-layout { display: grid; grid-template-columns: 1fr 16rem; gap: 2rem; }
@media (max-width: 60rem) { .doc-layout { grid-template-columns: 1fr; } }
.sidebar h4 { margin: .4rem 0; color: var(--muted); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .05em; }
.sidebar ul { list-style: none; padding-left: 0; margin: 0 0 1rem; }
.sidebar li { padding: .15rem 0; font-size: .9rem; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 99px; padding: .05rem .6rem; font-size: .8rem; margin: 0 .2rem .2rem 0; }

.result { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.result .prov { color: var(--muted); font-size: .82rem; }
.result pre.snippet { max-height: 10rem; overflow: hidden; }
.score { color: var(--muted); font-size: .8rem; }

form.stacked label { display: block; margin: .8rem 0 .2rem; font-weight: 600; }
form.stacked input[type=text], form.stacked input[type=number],
form.stacked textarea, form.stacked select {
  width: 100%; max-width: 34rem; padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--fg); font: inherit; }
button, input[type=submit] { background: var(--accent); color: #fff;
  border: none; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; font: inherit; }
button.linklike { background: none; color: var(--accent); padding: 0; }

.sealbox { background: var(--accent-soft); border-radius: 8px;
  padding: 1rem; margin-bottom: 1rem; word-break: break-all; }
.viewer-frame { width: 100%; height: 80vh; border: 1px solid var(--line);
  border-radius: 8px; }
.login-card { max-width: 22rem; margin: 15vh auto; text-align: center; }

.rouge-code table, td.rouge-gutter { border: none; }
td.rouge-gutter { color: var(--muted); padding-right: .8rem;
  user-select: none; text-align: right; }

/* crons & background jobs (ops view) */
.crons-section { margin: 1.6rem 0; }
.crons-section h2 { margin: 0 0 .6rem; }
.jobcard { border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1rem; margin-bottom: 1rem; }
.jobcard.recurring { border-left: 3px solid var(--accent); }
.jobcard-head { display: flex; align-items: center; flex-wrap: wrap;
  gap: .4rem; margin-bottom: .5rem; }
.jobcard-name { font-size: 1.05rem; }
.badge { display: inline-block; background: var(--code-bg); color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px;
  padding: .05rem .55rem; font-size: .78rem; }
.badge.recurring, .badge.state { background: var(--accent-soft);
  color: var(--accent); border-color: transparent; }
/* run status badges — colored by outcome */
.badge.status { border-color: transparent; font-weight: 600; }
.badge.status.ok { background: #e6f4ea; color: #1b5e2f; }
.badge.status.blocked { background: #fdf1dc; color: #8a5a00; }
.badge.status.error { background: #fde8e8; color: #7a1f1f; }
@media (prefers-color-scheme: dark) {
  .badge.status.ok { background: #17301f; color: #7fd39a; }
  .badge.status.blocked { background: #33260f; color: #e0b463; }
  .badge.status.error { background: #331a1a; color: #e08585; }
}
.jobmeta { display: grid; grid-template-columns: auto 1fr;
  gap: .1rem .8rem; margin: .3rem 0 .6rem; font-size: .88rem; }
.jobmeta dt { color: var(--muted); }
.jobmeta dd { margin: 0; word-break: break-word; }
.jobcard details summary { cursor: pointer; color: var(--muted);
  font-size: .85rem; }
pre.jobdetail { white-space: pre-wrap; word-break: break-word;
  margin: .5rem 0 0; max-height: 32rem; overflow-y: auto; }

/* per-job durable run history (drill-down from a job card) */
.jobruns-frame { display: block; margin-top: .6rem; }
.jobruns-toggle { font-size: .85rem; color: var(--accent); text-decoration: none; }
.jobruns-toggle:hover { text-decoration: underline; }
.jobruns-frame.open { border-top: 1px solid var(--line); padding-top: .6rem; }
.jobruns-head { display: flex; align-items: baseline; gap: .6rem;
  flex-wrap: wrap; margin-bottom: .4rem; }
.jobruns-head .jobruns-toggle { margin-left: auto; }
table.jobruns-table td { vertical-align: top; }
table.jobruns-table a { text-decoration: none; color: var(--fg); }
table.jobruns-table a:hover { text-decoration: underline; color: var(--accent); }
.jobruns-summary { color: var(--muted); max-width: 40rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* run drill-down modal (CSS-only; opened/closed by the modal Stimulus ctrl) */
.cron-modal-backdrop { position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .5); display: flex; align-items: flex-start;
  justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.cron-modal { background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  width: min(760px, 100%); max-height: 90vh; overflow-y: auto;
  padding: 1rem 1.2rem 1.4rem; }
.cron-modal-head { display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin-bottom: .6rem; }
.cron-modal-head > div { display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap; }
.cron-modal-close { background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--muted); padding: 0 .2rem; }
.cron-modal-close:hover { color: var(--accent); }
.cron-modal-meta { margin: .2rem 0 .8rem; }
.cron-modal-block { margin-top: 1rem; }
.cron-modal-block h3 { margin: 0 0 .3rem; font-size: .95rem; }
