/* OmnisX operator product surface — AUTHORED-OMNISX-PRODUCT-SURFACE-1.
 *
 * No import, no font fetch, no CDN. Every byte the browser paints comes from
 * this file. The type stack is the system stack because a product that cannot
 * render without reaching a font host is a product with a network dependency
 * in its first paint.
 *
 * DARK, DENSE, DELIBERATE. This is an operator console for an intelligent-
 * labour platform: the operator is reading state, not browsing. Density is a
 * feature. What is NOT permitted is density that hides hierarchy, so the scale
 * below is small in absolute terms but wide in contrast ratio.
 */

:root {
  --bg:            #0b0d10;
  --bg-raised:     #12151a;
  --bg-sunken:     #08090b;
  --panel:         #14181e;
  --panel-hi:      #1b212a;
  --line:          #232a34;
  --line-soft:     #1a1f27;

  --ink:           #e8ecf1;
  --ink-dim:       #9aa5b3;
  --ink-faint:     #64707e;

  --accent:        #5ac8fa;
  --accent-dim:    #1d5f7a;

  --ok:            #4ade80;
  --ok-bg:         #0f2a1b;
  --warn:          #fbbf24;
  --warn-bg:       #2c2210;
  --bad:           #f87171;
  --bad-bg:        #2d1416;
  --info:          #a78bfa;
  --info-bg:       #201a33;

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- shell -- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-sunken);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.brand .wordmark {
  font-size: 15px; font-weight: 700; letter-spacing: .04em;
}
.brand .wordmark em {
  font-style: normal; color: var(--accent);
}
.brand .tagline {
  font-size: 11px; color: var(--ink-faint); margin-top: 3px;
  letter-spacing: .02em;
}

.nav { padding: 10px 8px; flex: 1; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-faint); padding: 12px 10px 5px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--ink-dim); text-decoration: none; font-size: 13px;
}
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.active {
  background: var(--panel-hi); color: var(--ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav .tally {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  background: var(--panel); border-radius: 20px; padding: 1px 7px;
  min-width: 22px; text-align: center;
}
.nav a.active .tally { color: var(--ink-dim); background: var(--bg-sunken); }
.nav .tally.alert { color: var(--warn); background: var(--warn-bg); }

.sidebar-foot {
  padding: 12px 16px 16px; border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--ink-faint);
}
.sidebar-foot .authority-line { margin-bottom: 8px; line-height: 1.45; }

/* ------------------------------------------------------------------ main -- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.topbar .sub { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.content { padding: 22px 26px 60px; max-width: 1280px; }

/* ----------------------------------------------------------------- bits -- */
button {
  font-family: inherit; font-size: 13px;
  background: var(--panel-hi); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 12px; cursor: pointer;
}
button:hover:not(:disabled) { background: #232b36; border-color: #2f3846; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary {
  background: var(--accent); color: #06222e; border-color: var(--accent);
  font-weight: 650;
}
button.primary:hover:not(:disabled) { background: #7ad5fb; }
button.danger { color: var(--bad); border-color: #3a2024; }
button.danger:hover:not(:disabled) { background: var(--bad-bg); }
button.ghost { background: transparent; }

input, textarea, select {
  font-family: inherit; font-size: 13px; width: 100%;
  background: var(--bg-sunken); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(90,200,250,.10);
}
textarea { resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-dim); margin-bottom: 5px;
  font-weight: 600;
}
label.field .help {
  display: block; font-size: 12px; color: var(--ink-faint);
  text-transform: none; letter-spacing: 0; font-weight: 400; margin-top: 4px;
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.card > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-dim); margin: 0 0 14px; font-weight: 650;
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 20px 12px; margin: 0; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 2.5px 7px; border-radius: 4px;
  background: var(--panel-hi); color: var(--ink-dim);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: #1d4430; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #4a3a15; }
.badge.bad  { background: var(--bad-bg);  color: var(--bad);  border-color: #4a2226; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: #33295c; }
.badge.dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

.quiet { color: var(--ink-dim); font-size: 12.5px; }
.faint { color: var(--ink-faint); font-size: 12px; }
.mono-sm { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); }

/* ------------------------------------------------------------- stat row -- */
.stats {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat .k {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 650;
}
.stat .v {
  font-family: var(--mono); font-size: 27px; line-height: 1.15;
  margin-top: 7px; font-weight: 600; letter-spacing: -.02em;
}
.stat .sub { font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; }
.stat.alert .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }
.stat.good .v { color: var(--ok); }

/* --------------------------------------------------------------- tables -- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-faint); font-weight: 650;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg-sunken); white-space: nowrap;
}
.tbl td {
  padding: 11px 16px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--panel-hi); }
.tbl td.num { font-family: var(--mono); text-align: right; }
.scroll-x { overflow-x: auto; }

/* ---------------------------------------------------------- entity list -- */
.entity {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 16px 18px; margin-bottom: 12px;
}
.entity-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 10px;
}
.entity-title { font-size: 14.5px; font-weight: 650; }
.entity-title .ver { color: var(--ink-faint); font-weight: 400; }
.entity-sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 3px; }
.entity-meta {
  display: grid; gap: 10px 22px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.entity-meta .k {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); font-weight: 650;
}
.entity-meta .v { font-size: 13px; margin-top: 3px; word-break: break-word; }
.entity-meta .v.mono { font-family: var(--mono); font-size: 11.5px; }

/* --------------------------------------------------------- empty states -- */
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center; background: var(--bg-sunken);
}
.empty h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 650; }
.empty p { margin: 0 auto; max-width: 46ch; color: var(--ink-dim); font-size: 13px; }
.empty .cta { margin-top: 16px; }

/* --------------------------------------------------------------- detail -- */
details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-top: 10px; background: var(--bg-sunken);
}
details > summary {
  cursor: pointer; padding: 9px 13px; font-size: 12.5px;
  color: var(--ink-dim); font-weight: 600; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--ink-faint); }
details[open] > summary::before { content: "▾ "; }
details > summary:hover { color: var(--ink); }
details .body { padding: 0 13px 13px; }

pre.payload {
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 11.5px; line-height: 1.55; overflow-x: auto;
  color: var(--ink-dim); margin: 0;
  max-height: 380px; overflow-y: auto;
}

/* --------------------------------------------------------------- notice -- */
.notice {
  border-radius: var(--radius); padding: 12px 15px; margin-bottom: 16px;
  font-size: 13px; border: 1px solid;
  display: flex; gap: 11px; align-items: flex-start;
}
.notice .icon { flex-shrink: 0; font-family: var(--mono); font-weight: 700; }
.notice.warn { background: var(--warn-bg); border-color: #4a3a15; color: #fde3a7; }
.notice.bad  { background: var(--bad-bg);  border-color: #4a2226; color: #fecaca; }
.notice.info { background: var(--info-bg); border-color: #33295c; color: #ddd2ff; }
.notice.ok   { background: var(--ok-bg);   border-color: #1d4430; color: #bbf7d0; }
.notice strong { display: block; margin-bottom: 3px; }

/* ------------------------------------------------------------ sign-in -- */
.signin-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 20px;
}
.signin {
  width: 100%; max-width: 470px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 30px 30px 26px;
}
.signin .wordmark {
  font-size: 20px; font-weight: 700; letter-spacing: .03em; margin-bottom: 4px;
}
.signin .wordmark em { font-style: normal; color: var(--accent); }
.signin .tagline { color: var(--ink-dim); font-size: 13px; margin-bottom: 22px; }
.signin h2 { font-size: 14px; margin: 0 0 8px; }
.signin .steps {
  counter-reset: s; list-style: none; padding: 0; margin: 0 0 18px;
  font-size: 12.5px; color: var(--ink-dim);
}
.signin .steps li {
  counter-increment: s; position: relative; padding-left: 26px;
  margin-bottom: 9px; line-height: 1.5;
}
.signin .steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel-hi); border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 10.5px; font-family: var(--mono);
  display: grid; place-items: center; font-weight: 700;
}
.signin code.cmd {
  display: block; background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px;
  font-size: 11.5px; color: var(--accent); overflow-x: auto;
  white-space: pre; user-select: all;
}
.signin .authority-note {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--ink-faint); line-height: 1.55;
}

/* ------------------------------------------------------------- toolbar -- */
.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip-filter {
  font-size: 12px; padding: 4px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink-dim); cursor: pointer;
}
.chip-filter.on {
  background: var(--panel-hi); color: var(--ink); border-color: #2f3846;
  font-weight: 600;
}

.provenance-strip {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-faint);
  padding: 9px 14px; background: var(--bg-sunken);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.spinner-line {
  font-size: 12.5px; color: var(--ink-faint); padding: 24px 0;
  text-align: center;
}

/* ------------------------------------------------------------- mobile -- */
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  /* Static, not sticky. A sticky bar costs scarce vertical space on a phone,
   * and it also overlays the content beneath it — which on a full-page capture
   * renders as a header floating over the middle of the page. The nav is a
   * tap away in the menu; pinning the title is not worth either cost. */
  .topbar { position: static; }
  .topbar h1 { font-size: 16px; }
  .topbar-actions { gap: 8px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 244px; z-index: 40;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30;
  }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 15.5px; }
  .content { padding: 16px 16px 60px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
  .stat .v { font-size: 23px; }
  .card { padding: 15px 16px; }
  .entity { padding: 14px 15px; }
  .entity-meta { grid-template-columns: 1fr 1fr; }
  .signin { padding: 24px 20px 20px; }
}

/* Capacity meter — a ceiling is not an answer; consumption against it is. */
.meter {
  height: 3px; border-radius: 2px; background: var(--line);
  margin-top: 6px; overflow: hidden; min-width: 68px;
}
.meter span { display: block; height: 100%; background: var(--ok); }
.meter span.warn { background: var(--warn); }
.meter span.bad  { background: var(--bad); }
.cap-out { color: var(--bad); }

/* --- iteration 2: findings from the independent critic pass -------------- */

.section-heading {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 650; margin: 26px 0 12px;
}
.section-heading:first-child { margin-top: 0; }

.card.muted { background: var(--bg-sunken); border-style: dashed; }
.card.muted > .row h2 { text-transform: none; letter-spacing: 0;
  font-size: 15px; color: var(--ink-dim); }

.req {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--warn); background: var(--warn-bg); border-radius: 3px;
  padding: 1px 5px; margin-left: 6px; font-weight: 700;
}

.svc-form {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft);
}

/* The execution chain reads as a sequence, because it is one. */
.chain { margin: 14px 0 4px; }
.hop {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.hop:last-child { border-bottom: none; }
.hop-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--panel-hi); border: 1px solid var(--line);
  color: var(--ink-faint); font-family: var(--mono); font-size: 10.5px;
  display: grid; place-items: center; font-weight: 700;
}
.hop-title { font-size: 13.5px; }
.hop-detail { margin-top: 2px; }

.next-action {
  margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.08);
}
.next-action .k {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700; opacity: .75; margin-bottom: 2px;
}

dl.defs { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; }
dl.defs dt { font-weight: 650; font-size: 12.5px; color: var(--ink); }
dl.defs dd { margin: 0; font-size: 12.5px; color: var(--ink-dim); }

#live-state.live { color: var(--ok); }
#live-state.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ok); margin-right: 6px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.signin-lead { font-size: 13px; color: var(--ink-dim); margin: 0 0 18px; line-height: 1.55; }
.signin-detail { margin-top: 18px; }

@media (max-width: 860px) {
  dl.defs { grid-template-columns: 1fr; gap: 2px 0; }
  dl.defs dd { margin-bottom: 10px; }
  .hop { grid-template-columns: 22px 1fr; }
  .hop > div:last-child { grid-column: 2; }
}

/* --- iteration 3: the candidate repeater --------------------------------- */
.field-label-row {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-dim); margin-bottom: 6px;
  font-weight: 600;
}
.repeater { display: flex; flex-direction: column; gap: 10px; }
.rep-row {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-sunken); padding: 12px 13px;
}
.rep-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.rep-n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--panel-hi);
  border: 1px solid var(--line); color: var(--ink-faint);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.rep-del { font-size: 11.5px; padding: 3px 9px; color: var(--ink-faint); }
.rep-del:hover { color: var(--bad); }
.rep-grid {
  display: grid; gap: 9px 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.rep-grid label { display: block; }
.rep-grid label > span {
  display: block; font-size: 10.5px; color: var(--ink-faint);
  margin-bottom: 3px; font-weight: 600;
}
@media (max-width: 860px) { .rep-grid { grid-template-columns: 1fr; } }

/* --- post-critic-3: approvals must be distinguishable at a glance --------- */
.ord {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-hi); border: 1px solid var(--line);
  color: var(--ink-dim); font-family: var(--mono); font-size: 11.5px;
  font-weight: 700; display: grid; place-items: center; margin-top: 1px;
}
.entity.is-copy { border-left: 3px solid var(--warn); }
.entity.is-copy .ord { background: var(--warn-bg); color: var(--warn);
  border-color: #4a3a15; }
dl.defs.consequences {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft);
  grid-template-columns: 96px 1fr;
}
dl.defs.consequences dt { color: var(--ink-dim); }
#sess-detail { margin-left: 4px; }
#sess-detail-body { display: block; margin-top: 6px; line-height: 1.5; }
