/* kepr — asha visual identity */

:root {
  --bg:           #0e0c09;
  --bg-raised:    #1a1510;
  --bg-border:    #2e2218;
  --text-primary: #c8a96e;
  --text-secondary:#6a5030;
  --text-muted:   #3a2a14;
  --accent:       #d4943a;
  --accent-dim:   #8a6a38;
  /* spec aliases used by new ops design system */
  --primary:   var(--text-primary);
  --secondary: var(--text-secondary);
  --muted:     var(--text-muted);
  --border:    var(--bg-border);
  --serif:     'Cormorant Garamond', Georgia, serif;
  --mono:      'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: #2e2218 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e2218; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a2a14; }
::-webkit-scrollbar-corner { background: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

nav {
  display: flex;
  align-items: center;
  padding: 24px 48px;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

nav .wordmark { display: flex; align-items: center; color: #e99541; }
nav .wordmark:hover { color: #cc3333; text-decoration: none; }
.wordmark-icon { display: block; height: 32px; width: 32px; }
.tri-outer { transform-origin: 16px 16px; animation: tri-ccw 12s linear infinite; }
.tri-inner { transform-origin: 16px 16px; animation: tri-cw 8s linear infinite, tri-redglow 9s ease-in-out infinite; }
@keyframes tri-ccw { to { transform: rotate(-360deg); } }
@keyframes tri-cw  { to { transform: rotate(360deg); } }
@keyframes tri-redglow {
  0%, 70%, 92%, 100% { color: #e99541; filter: none; }
  80% { color: #cc3333; filter: drop-shadow(0 0 6px #cc3333); }
}
nav .nav-links { margin-left: auto; }
nav .nav-links a { margin-left: 28px; color: var(--text-secondary); }
.wordmark-by {
  font-size: 10px;
  color: #4a3820;
  letter-spacing: 0.03em;
  margin-left: 10px;
  font-weight: 400;
  text-decoration: none;
}
.wordmark-by:hover { color: var(--text-secondary); text-decoration: none; }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 48px 120px;
}

footer {
  text-align: center;
  padding: 80px 24px 48px;
  color: var(--text-muted);
}

footer .credit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

h1, h2, h3 { font-weight: 400; margin: 0; font-family: 'Cormorant Garamond', serif; }
h1 { font-size: 56px; line-height: 1.1; margin-bottom: 12px; }
h2 { font-size: 32px; }

.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text-secondary); }
.muted { color: var(--text-muted); }

/* Command block — a whisper-darker strip the width of its content with an
   amber-mono command and a muted copy button on the right. */
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  background: #15130b;
  padding: 8px 14px;
  border: 1px solid var(--bg-border);
  border-radius: 2px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent);
  margin: 8px 0;
  overflow-x: auto;
}
.cmd .cmd-text {
  white-space: pre;
  color: var(--accent);
}
.cmd .copy-btn {
  margin-left: auto;
}

.repo-row {
  display: flex;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-border);
}

.repo-row:hover { background: var(--bg-raised); }
.repo-row .primary { flex: 1; font-size: 20px; }
.repo-row .secondary {
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  margin-left: 16px;
}

/* ----- browse repo cards ------------------------------------------------- */

.repo-card {
  display: block;
  padding: 16px 20px;
  margin: 0 -20px;
  border-bottom: 1px solid var(--bg-border);
  text-decoration: none;
}
.repo-card:hover { background: var(--bg-raised); }
.repo-card:hover { text-decoration: none; }
.repo-card-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}
.repo-card-name {
  font-size: 20px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repo-card-meta {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.repo-card-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.repo-card-msg {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-badges {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lang-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent-dim);
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 3px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
}
@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1.0; transform: scale(1.25); }
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 0.22em;
  margin-bottom: 1px;
  flex-shrink: 0;
}
.dot-active {
  background: var(--accent);
  animation: breathe 2.8s ease-in-out infinite;
}
.dot-inactive {
  background: #3a3530;
}
.repo-lang-badges {
  margin: 8px 0 6px;
}

/* ----- browse filters --------------------------------------------------- */

.browse-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  align-items: start;
}
.browse-sidebar {
  position: sticky;
  top: 24px;
}
.browse-main {
  min-width: 0;
}
.browse-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.filter-label {
  flex-basis: 100%;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
@media (max-width: 640px) {
  .browse-layout { grid-template-columns: 1fr; }
  .browse-sidebar { position: static; }
}
.filter-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--bg-border);
  border-radius: 3px;
  padding: 2px 9px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.filter-chip:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}
.filter-chip.chip-active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--bg-raised);
}

/* ----- face page header ------------------------------------------------- */

.repo-head {
  margin: 20px 0 24px;
}
.repo-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text-primary);
  animation: fadeUp 280ms ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}
@media (max-width: 768px) { .repo-name { font-size: 44px; } }
a.repo-name-back { color: inherit; text-decoration: none; }
a.repo-name-back:hover { color: var(--accent); }
.repo-desc {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  animation: fadeUp 280ms 30ms ease both;
}
.repo-desc a { color: var(--accent); text-decoration: none; }
.repo-desc a:hover { text-decoration: underline; }
.repo-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  animation: fadeUp 280ms 60ms ease both;
}

/* ----- face contributor handle ------------------------------------------ */

.repo-contributor {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  animation: fadeUp 280ms 40ms ease both;
}
.repo-contributor-link {
  color: var(--text-secondary);
  text-decoration: none;
}
.repo-contributor-link:hover { color: var(--accent); }

/* ----- face head tag badge ---------------------------------------------- */

.repo-head-tag {
  color: var(--accent);
  font-weight: 600;
}

/* ----- history view toggle (thread / timeline) --------------------------- */

.view-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  user-select: none;
  justify-content: flex-end;
  margin-bottom: 4px;
}
.view-toggle-btn {
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s;
}
.view-toggle-btn:hover { color: var(--text-secondary); }
.view-toggle-active { color: var(--accent) !important; }

/* ----- bundle download link --------------------------------------------- */

.bundle-link {
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
}
.bundle-link:hover { color: var(--text-secondary); }
.repo-download-link {
  color: var(--text-muted);
  text-decoration: none;
}
.repo-download-link:hover { color: var(--text-secondary); }

/* ----- koh / curl command toggle ---------------------------------------- */

.cmd-wrap {
  margin: 20px 0 0;
  display: inline-block;
  animation: fadeUp 280ms 120ms ease both;
}
.cmd-mode-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.cmd-sep {
  color: var(--text-muted);
  font-size: 11px;
}
.cmd-mode-btn {
  background: none;
  border: none;
  padding: 0 2px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 120ms;
}
.cmd-mode-btn:hover { color: var(--text-secondary); }
.cmd-mode-btn.active { color: var(--accent); }

/* ----- repo details section (markdown body on face page) ---------------- */

.repo-details {
  margin: 36px 0 0;
  animation: fadeIn 320ms 80ms ease both;
}
.repo-details-head {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 400;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-border);
}
.repo-details-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.repo-details-body h1,
.repo-details-body h2,
.repo-details-body h3,
.repo-details-body h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  margin: 1.4em 0 0.4em;
}
.repo-details-body h1 { font-size: 1.5rem; }
.repo-details-body h2 { font-size: 1.3rem; }
.repo-details-body h3 { font-size: 1.15rem; }
.repo-details-body p { margin: 0.8em 0; }
.repo-details-body ul,
.repo-details-body ol { margin: 0.8em 0 0.8em 1.5em; }
.repo-details-body li { margin: 0.2em 0; }
.repo-details-body a { color: var(--accent); text-decoration: none; }
.repo-details-body a:hover { text-decoration: underline; }
.repo-details-body code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.82em;
  background: var(--bg-raised);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.repo-details-body pre {
  background: var(--bg-raised);
  border-radius: 4px;
  padding: 1em 1.2em;
  overflow-x: auto;
  margin: 1em 0;
}
.repo-details-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}
.repo-details-body blockquote {
  border-left: 3px solid var(--bg-border);
  margin: 1em 0;
  padding: 0.1em 1em;
  color: var(--text-secondary);
}
.repo-details-body hr {
  border: none;
  border-top: 1px solid var(--bg-border);
  margin: 1.5em 0;
}
.ops-label {
  display: block;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ops-details-input { min-height: 160px; }

/* ----- face / save sections --------------------------------------------- */

.repo-section {
  margin: 36px 0 0;
  animation: fadeIn 320ms 80ms ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-border);
  margin-bottom: 4px;
}
.section-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.section-count {
  font-size: 11px;
}
/* ----- thread container (infinite scroll, session groups) --------------- */

#thread-container {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
}

.thread-session {
  margin-bottom: 2px;
}

.thread-saves {
  /* saves live here; no extra styling needed */
}

.thread-save {
  min-height: 36px;
}

/* New saves fade in rather than popping. */
.thread-save--new {
  animation: thread-save-appear 200ms ease forwards;
}

@keyframes thread-save-appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sentinel: invisible, just a scroll trigger at the bottom. */
#thread-sentinel {
  height: 1px;
  visibility: hidden;
}

/* End-of-history marker. */
.thread-end {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0 40px;
  letter-spacing: 0.08em;
}

/* ----- history list wrapper --------------------------------------------- */

.history-list {
  max-height: 180px;
  overflow-y: auto;
}

/* ----- history rows (face page) ----------------------------------------- */

.history-row {
  display: grid;
  grid-template-columns: 52px auto 1fr auto auto;
  align-items: baseline;
  gap: 0 10px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--bg-border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  transition: background 100ms;
  position: relative;
}
.history-row-link {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.history-row .op-controls {
  position:  absolute;
  right:     8px;
  top:       50%;
  transform: translateY(-50%);
  z-index:   2;
  background: rgba(14, 12, 9, 0.92);
  padding:   0 2px;
}
.history-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 120ms ease;
  border-radius: 0 1px 1px 0;
}
.history-row:hover {
  background: rgba(212, 148, 58, 0.04);
  text-decoration: none;
}
.history-row:hover::before { transform: scaleY(1); }
.history-id {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.history-cp {
  font-size: 12px;
  color: var(--accent);
}
.history-msg {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 100ms;
}
.history-row:hover .history-msg { color: var(--accent); }
.history-lane {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.history-when {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

/* ----- save detail page -------------------------------------------------- */

.page-save main {
  padding-top: 8px;
}
.save-message-head {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 36px;
  line-height: 1.3;
  margin: 16px 0 8px;
  color: var(--text-primary);
  max-width: 72ch;
  animation: fadeUp 280ms ease both;
}
.save-page-meta {
  margin: 0 0 20px;
  animation: fadeUp 280ms 60ms ease both;
}
.breadcrumb {
  margin: 0 0 4px;
  font-size: 12px;
  animation: fadeUp 280ms ease both;
}
.page-save .cmd { margin: 0 0 8px; }
.page-save .cmd:last-of-type { margin-bottom: 0; }

/* ----- save detail — extended ------------------------------------------- */

.save-cp-marker {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 6px;
}

.save-meta2 {
  margin: 0 0 16px;
  font-size: 12px;
  animation: fadeUp 280ms 90ms ease both;
}

.save-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
}

.save-tag {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: rgba(212, 148, 58, 0.07);
  border: 1px solid rgba(212, 148, 58, 0.22);
  padding: 2px 8px;
  border-radius: 2px;
}

.save-parent-link {
  margin: 8px 0 0;
  font-size: 12px;
}

/* save detail — diff file list */
.diff-file-list {
  padding: 0;
}

.diff-file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--bg-border);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
}

.diff-file-path {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
a.diff-file-path:hover { color: var(--accent); }
.diff-file-path.diff-status-added { color: var(--text-primary); }
a.diff-file-path.diff-status-added:hover { color: var(--accent); }
.diff-file-path.diff-status-deleted { color: var(--text-muted); text-decoration: line-through; }

.diff-stat {
  font-size: 12px;
  white-space: nowrap;
}

.diff-add { color: var(--accent); }
.diff-del { color: var(--text-secondary); }

.diff-bar {
  display: flex;
  gap: 1px;
  align-items: center;
  width: 60px;
  flex-shrink: 0;
}

.bar-seg {
  display: inline-block;
  width: 4px;
  height: 10px;
  border-radius: 1px;
}

.bar-add { background: var(--accent); }
.bar-del { background: var(--text-secondary); }

.diff-empty {
  padding: 12px 8px;
  font-size: 12px;
  margin: 0;
}

/* save detail — prev/next navigation */
.save-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 48px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--bg-border);
  min-height: 64px;
}

.save-nav-item {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 120ms;
  text-decoration: none;
}

.save-nav-item:hover { color: var(--accent); text-decoration: none; }
.save-nav-next { margin-left: auto; }

/* ----- file viewer page -------------------------------------------------- */

.file-page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 400;
  margin: 4px 0 20px;
}
.page-file .breadcrumb {
  margin: 0 0 4px;
  font-size: 12px;
}

hr.rule { border: none; border-top: 1px solid var(--bg-border); margin: 28px 0; }

/* ----- thread canvas (public) --------------------------------------------- */
/* Height is set in JS via computeCanvasHeight(saveCount). */
.thread-canvas {
  display: block;
  width: 100%;
  margin: 0.75rem 0;
}
.graph-view {
  width: 100%;
  margin: 0.75rem 0;
}

.graph-container {
  position: relative;
  width: 100%;
  height: 460px;
  background: transparent;
  overflow: hidden;
}

.graph-container--atlas {
  height: 560px;
}

.graph-map-scroll {
  width: 100%;
  height: 420px;
  overflow: hidden;
  border-top: 1px solid #2a2018;
  border-bottom: 1px solid #2a2018;
}

.graph-container--atlas .graph-map-scroll {
  height: 520px;
}

.graph-svg {
  display: block;
  min-width: 100%;
}

.graph-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}

.atlas-ref-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.atlas-ref-tab {
  background: #141210;
  border: 1px solid #2a2018;
  border-radius: 2px;
  color: #7A7060;
  cursor: pointer;
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 8px;
}

.atlas-ref-tab:hover,
.atlas-ref-tab--active {
  border-color: rgba(212, 168, 64, 0.45);
  color: #D4A840;
}
.atlas-ref-tab:hover {
  color: #b8472f;
}

.atlas-ref-tab:disabled {
  cursor: default;
  opacity: 0.85;
}

.graph-map-summary {
  color: #7A7060;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
}

.atlas-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.atlas-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: min(420px, 90vw);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #100d0a;
  border: 1px solid #3a2a14;
  box-shadow: 0 18px 48px rgba(0,0,0,0.48);
}

.atlas-picker-tabs {
  display: flex;
  border-bottom: 1px solid #2a2018;
}

.atlas-picker-tab {
  flex: 1;
  background: transparent;
  border: 0;
  border-right: 1px solid #2a2018;
  color: #7A7060;
  cursor: pointer;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  padding: 7px 10px;
  text-align: center;
}
.atlas-picker-tab:last-child { border-right: 0; }
.atlas-picker-tab:hover { color: #BEB6A8; }
.atlas-picker-tab--active {
  color: #D4A840;
  background: rgba(212, 168, 64, 0.06);
}

.atlas-picker-filter {
  flex: 0 0 auto;
  background: #141210;
  border: 0;
  border-bottom: 1px solid #2a2018;
  color: #E8E0D0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  padding: 8px 10px;
  outline: none;
}
.atlas-picker-filter::placeholder { color: #4A4038; }

.atlas-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.atlas-picker-row {
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(42, 32, 24, 0.4);
  color: #BEB6A8;
  cursor: pointer;
  text-align: left;
  align-items: center;
}
.atlas-picker-row:hover { color: #D4A840; background: rgba(212,168,64,0.06); }
.atlas-picker-row--active { color: #D4A840; background: rgba(212,168,64,0.1); }

.atlas-picker-id {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 9px;
  color: #7A7060;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atlas-picker-row--active .atlas-picker-id { color: #b8a050; }

.atlas-picker-msg {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #BEB6A8;
}
.atlas-picker-row--active .atlas-picker-msg { color: #D4A840; }

.atlas-picker-age {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 9px;
  color: #5d5550;
  white-space: nowrap;
}
  color: #5A5048;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  padding: 12px 10px;
}

.atlas-version-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.face-page-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid #1a1510;
}

.face-ref-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.face-save-id {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 13px;
  color: #d4a855;
}

.face-change-count {
  font-size: 11px;
}

.face-save-msg {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #a09080;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-version-button,
.atlas-ref-back {
  background: #141210;
  border: 1px solid rgba(212, 168, 64, 0.28);
  border-radius: 2px;
  color: #D4A840;
  cursor: pointer;
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 8px;
}

.atlas-version-button:hover,
.atlas-ref-back:hover {
  color: #b8472f;
  border-color: rgba(184, 71, 47, 0.55);
}

.atlas-version-button--historic {
  color: #e0b35a;
}

.atlas-ref-back {
  color: #7A7060;
}

.atlas-overlay-status {
  font-size: 10px;
  color: #7A7060;
  padding-left: 8px;
  align-self: center;
}

.atlas-overlay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.atlas-overlay-dot--modified { background: #c8a45a; }
.atlas-overlay-dot--added { background: #5a8f5a; }
.atlas-overlay-dot--deleted { background: #8f5a5a; }

.graph-file-line--overlay-modified { border-left: 2px solid rgba(200, 164, 90, 0.4); }
.graph-file-line--overlay-added { border-left: 2px solid rgba(90, 143, 90, 0.4); }
.graph-file-line--overlay-deleted { border-left: 2px solid rgba(143, 90, 90, 0.4); opacity: 0.6; }

.atlas-version-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: min(360px, 82vw);
  max-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  background: #100d0a;
  border: 1px solid #3a2a14;
  box-shadow: 0 18px 48px rgba(0,0,0,0.48);
}

.atlas-version-filter {
  grid-column: 1 / -1;
  min-width: 0;
  background: #141210;
  border: 1px solid #2a2018;
  color: #E8E0D0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  padding: 6px 8px;
}

.atlas-version-list {
  min-height: 0;
  overflow: auto;
}

.atlas-version-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(42, 32, 24, 0.6);
  color: #BEB6A8;
  cursor: pointer;
  text-align: left;
}

.atlas-version-row:hover,
.atlas-version-row--active {
  color: #D4A840;
  background: rgba(212, 168, 64, 0.08);
}

.atlas-version-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.atlas-version-meta,
.atlas-version-empty,
.atlas-version-detail-meta {
  color: #7A7060;
  font-size: 9px;
  line-height: 1.4;
}

.atlas-version-detail {
  border-left: 1px solid #2a2018;
  padding-left: 8px;
  min-width: 0;
}

.atlas-version-detail-name {
  color: #D4A840;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.atlas-version-detail-message {
  color: #BEB6A8;
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 14px;
  line-height: 1.35;
  margin: 8px 0 4px;
}

.atlas-version-view {
  background: transparent;
  border: 0;
  color: #D4A840;
  cursor: pointer;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  margin-top: 10px;
  padding: 0;
  text-align: left;
}
.atlas-version-view:hover { color: #b8472f; }
.atlas-version-view:disabled { color: #5A5048; cursor: default; }

.atlas-saves-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: min(420px, 90vw);
  max-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #100d0a;
  border: 1px solid #3a2a14;
  box-shadow: 0 18px 48px rgba(0,0,0,0.48);
}

.atlas-saves-filter {
  min-width: 0;
  background: #141210;
  border: 1px solid #2a2018;
  color: #E8E0D0;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  padding: 6px 8px;
}

.atlas-saves-list {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.atlas-saves-row {
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 5px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(42, 32, 24, 0.4);
  color: #BEB6A8;
  cursor: pointer;
  text-align: left;
  align-items: center;
}
.atlas-saves-row:hover { color: #D4A840; background: rgba(212,168,64,0.06); }
.atlas-saves-row--active { color: #D4A840; background: rgba(212,168,64,0.1); }

.atlas-saves-id {
  font-size: 9px;
  color: #7A7060;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atlas-saves-msg {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #BEB6A8;
}
.atlas-saves-empty {
  color: #5A5048;
  font-size: 10px;
  padding: 8px 4px;
}

.graph-atlas,
.graph-atlas button {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

.graph-atlas {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.graph-architecture-flow {
  padding: 8px 12px 6px;
  border-bottom: 1px solid #1a1510;
}

.graph-arch-title {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 9px;
  color: #5d5550;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.graph-arch-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: baseline;
}

.graph-arch-sep {
  color: #3d3530;
}

.graph-arch-group {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #a09080;
  white-space: nowrap;
}

.graph-arch-discipline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.graph-discipline-sig {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  color: #6a6055;
}

.graph-module-strip {
  display: flex;
  gap: 0;
  padding: 0 12px;
  margin-bottom: 12px;
  overflow-x: auto;
  border-bottom: 1px solid #1a1510;
  scrollbar-color: #5d4323 #141210;
}

.graph-module-strip::-webkit-scrollbar,
.graph-file-body::-webkit-scrollbar,
.graph-detail-pane::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.graph-module-strip::-webkit-scrollbar-thumb,
.graph-file-body::-webkit-scrollbar-thumb,
.graph-detail-pane::-webkit-scrollbar-thumb {
  background: #5d4323;
}

.graph-module-tab {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 84px;
  text-align: left;
  background: transparent;
  border: none;
  color: #BEB6A8;
  padding: 9px 16px 9px 0;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.graph-module-tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 16px;
  height: 1px;
  background: #D4A840;
}

.graph-module-tab-name,
.graph-module-tab-meta {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.graph-module-tab-name {
  color: #7A7060;
  font-size: 11px;
  line-height: 1.2;
  transition: color 100ms;
}
.graph-module-tab--active .graph-module-tab-name {
  color: #D4A840;
}

.graph-module-tab-meta {
  color: #7A7060;
  font-size: 9px;
  line-height: 1.4;
  opacity: 0.6;
  margin-top: 2px;
}

.graph-browser-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.68fr);
  gap: 0;
}

.graph-file-table {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2a2018;
  min-height: 0;
}

.graph-file-header,
.graph-file-line {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(60px, 0.4fr) minmax(106px, 0.6fr) minmax(130px, 0.9fr);
  align-items: center;
  column-gap: 12px;
}

.graph-file-header {
  min-height: 31px;
  padding: 0 12px;
  border-bottom: 1px solid #2a2018;
  color: #7A7060;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.graph-file-body {
  overflow: auto;
  min-height: 0;
  scrollbar-color: #5d4323 #141210;
}

.graph-file-line {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(42, 32, 24, 0.62);
  background: transparent;
  color: #BEB6A8;
  text-align: left;
  cursor: pointer;
}

.graph-file-line:hover,
.graph-file-line:focus {
  outline: none;
  background: rgba(212, 168, 64, 0.08);
}

.graph-file-line--selected {
  outline: none;
  background: rgba(212, 168, 64, 0.1);
  border-left: 3px solid #D4A840;
  padding-left: 9px;
}

.graph-file-line--related {
  background: rgba(124, 95, 36, 0.1);
}

.graph-file-line--pulse {
  animation: graph-row-pulse 1.5s ease-out;
}

@keyframes graph-row-pulse {
  0%   { background: #2a1f0a; }
  100% { background: transparent; }
}

.graph-file-cell {
  min-width: 0;
  overflow: hidden;
}

.graph-file-cell--touches {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #D4A840;
  font-size: 10px;
}

.graph-file-cell--module {
  color: #BEB6A8;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-file-cell--modules {
  display: flex;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.atlas-works-with {
  align-self: center;
  color: #7A7060;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-file-name {
  display: block;
  color: #E8E0D0;
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-file-path {
  display: block;
  color: #7A7060;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.graph-chip,
.graph-related-file {
  display: inline-block;
  max-width: 132px;
  color: #BEB6A8;
  background: rgba(212, 168, 64, 0.08);
  border: 1px solid rgba(124, 95, 36, 0.42);
  border-radius: 2px;
  padding: 2px 5px;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-chip--empty {
  display: inline-block;
  color: #5A5048;
  font-size: 10px;
}

.graph-file-more {
  padding: 9px 12px;
  color: #7A7060;
  font-size: 10px;
}

.graph-detail-pane {
  min-width: 0;
  overflow-y: auto;
  background: rgba(20, 18, 16, 0.3);
  scrollbar-color: #5d4323 #141210;
}

.graph-detail-title {
  color: #E8E0D0;
  font-size: 13px;
  line-height: 1.3;
  word-break: break-word;
}

.graph-detail-meta {
  color: #7A7060;
  font-size: 10px;
  line-height: 1.5;
}

.graph-detail-section {
  color: #5A5048;
  font-size: 9px;
  letter-spacing: 0.04em;
  margin: 13px 0 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.graph-detail-row,
.graph-detail-empty {
  color: #E8E0D0;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  margin-bottom: 3px;
}

.graph-detail-empty { color: #7A7060; }

.graph-detail-story {
  display: block;
  margin-top: 14px;
  color: #D4A840;
  text-decoration: none;
  border-top: 1px solid #2a2018;
  padding-top: 10px;
  font-size: 10px;
}
.graph-detail-story:hover {
  color: #e8c060;
}

/* touches bar in table rows — slim 2px feels lighter than the previous 3px */
.graph-touches-bar {
  display: inline-block;
  height: 2px;
  background: #D4A840;
  opacity: 0.45;
  vertical-align: middle;
  border-radius: 1px;
  flex-shrink: 0;
}

/* module tab touch-count bar (inactive tabs only) */
.graph-module-tab-bar {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: #D4A840;
  opacity: 0.2;
}

/* detail panel: sticky header + scrollable body */
.graph-detail-header {
  position: sticky;
  top: 0;
  background: #141210;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #2a2018;
  z-index: 1;
}
.graph-detail-filepath {
  color: #5A5048;
  font-size: 10px;
  margin-top: 2px;
  margin-bottom: 6px;
}
.graph-detail-body {
  padding: 4px 16px 14px;
}

/* character paragraph */
.graph-detail-char {
  color: #BEB6A8;
  font-size: 10px;
  line-height: 1.55;
  margin-bottom: 2px;
}

/* works-with rows in detail panel */
.graph-detail-works-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.graph-detail-works-count {
  color: #5A5048;
  font-size: 9px;
  margin-left: auto;
  flex-shrink: 0;
}

/* related file rows with bars in detail panel */
.graph-detail-relfile {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.graph-detail-relfile-name {
  color: #BEB6A8;
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.graph-detail-relfile-bar {
  display: inline-block;
  height: 3px;
  background: #D4A840;
  opacity: 0.5;
  border-radius: 1px;
  flex-shrink: 0;
}
.graph-detail-relfile-count {
  color: #7A7060;
  font-size: 9px;
  flex-shrink: 0;
  min-width: 16px;
  text-align: right;
}

/* empty state for filtered table */
.graph-file-empty {
  padding: 20px 12px;
  color: #5A5048;
  font-size: 10px;
}

.graph-empty--loading::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: atlas-loading-dots 1.2s steps(4, end) infinite;
}

@keyframes atlas-loading-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75%, 100% { content: '...'; }
}

/* keyboard-focusable table body */
.graph-file-body:focus {
  outline: none;
}

/* ----- atlas detail panel (intelligence-brief redesign) ------------------ */

.atlas-panel {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #7A7060;
  background: transparent;
  border-left: 1px solid #2a2018;
  padding: 0 0 0 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.atlas-panel--source {
  padding-left: 16px;
}

.atlas-panel-header {
  flex-shrink: 0;
  padding: 18px 16px 12px 0;
  border-bottom: 1px solid #1a1510;
}

.atlas-panel-filename {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  color: #E8E0D0;
  display: block;
  line-height: 1.15;
  word-break: break-word;
}

.atlas-panel-filepath {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  color: #7A7060;
  display: block;
  margin-top: 4px;
}

.atlas-panel-character {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 14px;
  color: #c8bfb0;
  font-style: normal;
  line-height: 1.5;
  margin-top: 10px;
}

.atlas-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 14px 0;
  scrollbar-width: none;
}
.atlas-panel-body::-webkit-scrollbar { display: none; }

.atlas-panel-doc {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 14px;
  color: #E8E0D0;
  font-style: normal;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.atlas-hint {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 9px;
  color: #3a3028;
  padding-top: 8px;
  letter-spacing: 0.05em;
}

.atlas-panel-section {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7A7060;
  margin: 18px 0 6px;
  display: block;
}
.atlas-panel-section:first-child {
  margin-top: 0;
}

.atlas-fn-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-bottom: 4px;
  align-items: baseline;
}

.atlas-session-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 4px;
}

.atlas-session-name {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #c8bfb0;
}

.atlas-session-age {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 10px;
  color: #7A7060;
}

.atlas-fn-name {
  color: #D4A840;
  font-size: 11px;
  white-space: nowrap;
}
.atlas-overlay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.atlas-overlay-dot--added { background: #5c8a5c; }
.atlas-overlay-dot--deleted { background: #8a5c5c; }
.atlas-overlay-dot--renamed { background: #5c6c8a; }
.atlas-overlay-dot--modified { background: #8a7a5c; }

.atlas-fn-comment {
  color: #7A7060;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.atlas-caller-row {
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.atlas-caller-file {
  color: #c8bfb0;
  font-size: 11px;
  white-space: nowrap;
}
.atlas-caller-fns {
  color: #7A7060;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-imports {
  color: #7A7060;
  font-size: 11px;
  line-height: 1.8;
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.atlas-import-project {
  color: #c8bfb0;
}

.atlas-error-name {
  color: #7A7060;
  font-size: 11px;
  display: inline;
  margin-right: 8px;
}

.atlas-error-list {
  color: #7A7060;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
}

.atlas-touches-bar {
  display: inline-block;
  height: 2px;
  background: #D4A840;
  opacity: 0.55;
  border-radius: 1px;
  flex-shrink: 0;
}

.atlas-metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.atlas-metric-chip {
  border: 1px solid rgba(124, 95, 36, 0.35);
  color: #BEB6A8;
  font-size: 10px;
  padding: 2px 5px;
}

.atlas-metric-chip--warn {
  border-color: rgba(184, 71, 47, 0.48);
  color: #d08a74;
}

.atlas-stability {
  font-size: 11px;
  line-height: 1.5;
}

.atlas-stability--stable { color: #9fb37a; }
.atlas-stability--active { color: #c8bfb0; }
.atlas-stability--neutral { color: #7A7060; }
.atlas-stability--warm { color: #BEB6A8; }
.atlas-stability--hot { color: #d08a74; }

.atlas-panel-metrics {
  font-size: 10px;
  color: #7A7060;
  margin-top: 22px;
  line-height: 1.8;
  padding-top: 12px;
  border-top: 1px solid #1a1510;
}

.atlas-story-link {
  display: block;
  margin-top: 12px;
  color: #D4A840;
  background: transparent;
  border: 0;
  font-size: 11px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 100ms;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.atlas-story-link:hover { opacity: 1; }

.atlas-link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.atlas-file-jump {
  border: 0;
  background: transparent;
  color: #c8bfb0;
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.atlas-file-jump:hover .atlas-file-jump-name,
.atlas-file-jump:focus .atlas-file-jump-name {
  color: #D4A840;
}

.atlas-file-jump-name {
  color: #c8bfb0;
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-file-jump-meta {
  color: #7A7060;
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-source-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
}

.atlas-source-header .atlas-panel-filepath {
  grid-column: 2;
}

.atlas-source-back {
  grid-row: span 2;
  align-self: start;
  background: transparent;
  border: 1px solid rgba(212, 168, 64, 0.28);
  color: #D4A840;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  padding: 3px 7px;
}

.atlas-source-body {
  padding-right: 0;
}

.atlas-source-message {
  color: #7A7060;
  font-size: 11px;
  padding: 18px 0;
}

.atlas-source-code {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.55;
  min-width: 0;
}

.atlas-source-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid rgba(42, 32, 24, 0.35);
}

.atlas-source-num {
  color: #5A5048;
  text-align: right;
  user-select: none;
}

.atlas-source-text {
  color: #E8E0D0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* ----- file viewer modal -------------------------------------------------- */

.fv-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 7, 5, 0.97);
  display: flex;
  flex-direction: column;
  outline: none;
  animation: fv-in 200ms ease both;
}

@keyframes fv-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fv-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 48px;
  border-bottom: 1px solid #2a2018;
  background: #0e0c09;
}

.fv-close {
  background: none;
  border: none;
  color: #5A5048;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  transition: color 100ms;
  flex-shrink: 0;
}
.fv-close:hover { color: #D4A840; }

.fv-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.fv-filename {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 20px;
  color: #E8E0D0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fv-filepath {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #5A5048;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fv-breadcrumb {
  background: transparent;
  border: 1px solid rgba(212,168,64,0.2);
  color: #7A7060;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
}
.fv-breadcrumb:hover { color: #D4A840; border-color: rgba(212,168,64,0.5); }

.fv-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fv-ctrl-btn {
  background: transparent;
  border: 1px solid rgba(212,168,64,0.2);
  border-radius: 2px;
  color: #7A7060;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 7px;
  transition: color 100ms, border-color 100ms;
  text-decoration: none;
}
.fv-ctrl-btn:hover { color: #D4A840; border-color: rgba(212,168,64,0.5); }
.fv-ctrl-btn--active { color: #D4A840; border-color: rgba(212,168,64,0.55); }

/* save-view now/diff/before segmented toggle */
.fv-view-seg {
  display: inline-flex;
  border: 1px solid rgba(212,168,64,0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 4px;
}
.fv-view-btn {
  background: transparent;
  border: none;
  color: #7A7060;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 9px;
  transition: color 100ms, background 100ms;
}
.fv-view-btn:not(:last-child) { border-right: 1px solid rgba(212,168,64,0.2); }
.fv-view-btn:hover { color: #D4A840; }
.fv-view-btn--active { color: #0e0c09; background: var(--accent); }

/* save-view inline diff */
.fv-diff {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  min-width: 0;
  padding-bottom: 24px;
}
.fv-diff-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  min-height: 1.6em;
}
.fv-diff--wrap .fv-diff-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fv-diff-sign {
  text-align: center;
  user-select: none;
  color: #5a4a30;
}
.fv-diff-text { color: #C8BFB0; white-space: pre; padding-right: 24px; }
.fv-diff-line--add { background: rgba(212,168,64,0.10); }
.fv-diff-line--add .fv-diff-sign { color: var(--accent); }
.fv-diff-line--del { background: rgba(150,110,90,0.12); }
.fv-diff-line--del .fv-diff-text { color: #9a8a7a; }
.fv-diff-line--del .fv-diff-sign { color: #b08068; }

/* detail-panel change indicator (save view) */
.atlas-panel-change {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid var(--bg-border);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
}
.atlas-change-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
}
.atlas-change-stat { font-size: 11px; }
.atlas-change-diff {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  margin-left: auto;
  padding: 0;
}
.atlas-change-diff:hover { text-decoration: underline; }

.fv-nav-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fv-nav-btn {
  background: transparent;
  border: 1px solid rgba(212,168,64,0.2);
  border-radius: 2px;
  color: #7A7060;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 8px;
  transition: color 100ms, border-color 100ms;
}
.fv-nav-btn:hover:not(:disabled) { color: #D4A840; border-color: rgba(212,168,64,0.5); }
.fv-nav-btn:disabled { opacity: 0.3; cursor: default; }

.fv-nav-pos {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #5A5048;
  min-width: 40px;
  text-align: center;
}

.fv-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.fv-source-area {
  min-height: 0;
  overflow: auto;
  padding: 16px 0 32px;
  scrollbar-color: #2e2218 transparent;
}

.fv-source-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #5A5048;
  padding: 24px 28px;
}

.fv-source-code {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  min-width: 0;
}

.fv-source-code--wrap .fv-source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fv-source-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0;
  min-height: 1.6em;
}
.fv-source-line:hover {
  background: rgba(212,168,64,0.04);
}

.fv-source-num {
  color: #3a2a14;
  text-align: right;
  padding-right: 16px;
  user-select: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
  padding-top: 0.05em;
}

.fv-source-text {
  color: #C8BFB0;
  padding-right: 24px;
  white-space: pre;
  overflow: visible;
}

/* detail panel inside file viewer */
.fv-detail-panel {
  border-left: 1px solid #2a2018;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0c0a07;
}

.fv-detail-header {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #1a1510;
}

.fv-detail-filename {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 20px;
  color: #E8E0D0;
  line-height: 1.2;
}

.fv-detail-filepath {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #5A5048;
  margin-top: 3px;
}

.fv-detail-character {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 13px;
  color: #c8bfb0;
  line-height: 1.5;
  margin-top: 10px;
}

.fv-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  font-family: 'IBM Plex Mono', monospace;
  scrollbar-width: thin;
  scrollbar-color: #2e2218 transparent;
}

.fv-detail-doc {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-size: 13px;
  color: #E8E0D0;
  font-style: normal;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 18px;
}

.fv-detail-section {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5A5048;
  margin: 18px 0 6px;
  display: block;
}
.fv-detail-section:first-child { margin-top: 0; }

.fv-detail-imports {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.fv-detail-std {
  font-size: 11px;
  color: #5A5048;
}

.fv-detail-metrics {
  font-size: 10px;
  color: #5A5048;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #1a1510;
  line-height: 1.8;
}

.fv-file-nav {
  background: transparent;
  border: 0;
  color: #c8bfb0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0 4px;
  text-align: left;
  transition: color 80ms;
}
.fv-file-nav:hover .fv-file-nav-name { color: #D4A840; }

.fv-file-nav-name {
  font-size: 11px;
  color: #c8bfb0;
}
.fv-file-nav-meta {
  font-size: 10px;
  color: #5A5048;
}

.fv-import-project .fv-file-nav-name {
  color: #c8bfb0;
}

.fv-related-row {
  background: transparent;
  border: 0;
  color: #c8bfb0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 4px;
  text-align: left;
}
.fv-related-row:hover { color: #D4A840; }

@media (max-width: 640px) {
  .fv-body { grid-template-columns: minmax(0, 1fr); }
  .fv-detail-panel { display: none; }
  .fv-filepath { display: none; }
}

.graph-panel {
  position: absolute;
  top: 0;
  width: 310px;
  background: #141210;
  border: 1px solid #2a2018;
  border-left: 3px solid #D4A840;
  padding: 16px;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  color: #E8E0D0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 10;
  max-width: calc(100% - 16px);
}
.graph-panel--visible {
  opacity: 1;
  pointer-events: auto;
}
.graph-panel-title {
  color: #D4A840;
  font-size: 13px;
  margin-bottom: 12px;
  word-break: break-all;
}
.graph-panel-meta {
  color: #7A7060;
  margin-bottom: 12px;
  line-height: 1.6;
}
.graph-panel-section {
  color: #7A7060;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 12px 0 4px;
}
.graph-panel-value {
  color: #E8E0D0;
  margin-bottom: 2px;
}
.graph-panel-bar {
  display: inline-block;
  height: 3px;
  background: #D4A840;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.7;
}
.graph-panel-story {
  display: block;
  margin-top: 16px;
  color: #D4A840;
  text-decoration: none;
  border-top: 1px solid #2a2018;
  padding-top: 12px;
}

.graph-empty {
  padding: 2rem 0;
  text-align: center;
}

@media (max-width: 600px) {
  .graph-container { height: 400px; }
  .graph-container--atlas { height: auto; min-height: 560px; }
  .graph-map-scroll { height: 360px; }
  .graph-container--atlas .graph-map-scroll { height: auto; min-height: 520px; overflow: visible; }
  .graph-toolbar { align-items: flex-start; flex-direction: column; gap: 6px; }
  .graph-module-tab { flex-basis: 118px; }
  .graph-browser-grid { grid-template-columns: minmax(0, 1fr); }
  .graph-detail-pane { display: none; }
  .atlas-panel {
    display: flex;
    min-height: 300px;
    border-left: 0;
    border-top: 1px solid #2a2018;
    padding-left: 12px;
  }
  .graph-file-table { border-right: 0; }
  .graph-file-header,
  .graph-file-line {
    grid-template-columns: minmax(150px, 1fr) 46px minmax(120px, 0.8fr);
  }
  .graph-file-cell--module { display: none; }
  .graph-panel {
    left: 0 !important;
    right: 0;
    bottom: 0;
    top: auto !important;
    width: auto;
    max-height: 45%;
    overflow: auto;
  }
}

/* ----- contribute page ---------------------------------------------------- */

.page-contribute p { max-width: 64ch; }

.contribute-main { padding-top: 24px; }
.contribute-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--text-primary);
}
.contribute-welcome {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 28px;
  max-width: 64ch;
  white-space: pre-wrap;
}
.contribute-id {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}
.contribute-known {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 28px 0;
  max-width: 64ch;
}
.contribute-keyform {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 28px;
  max-width: 720px;
}
.contribute-key-input {
  display: block;
  width: 100%;
  background: #15130b;
  color: var(--accent);
  border: 1px solid var(--bg-border);
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  border-radius: 2px;
}
.contribute-key-input::placeholder { color: var(--text-muted); }
.contribute-key-input:focus { outline: none; border-color: var(--accent-dim); }

.contribute-register {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  padding: 7px 18px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: lowercase;
  transition: color 120ms, border-color 120ms;
}
.contribute-register:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.open-faces { margin: 32px 0 0; }
.open-faces-list { list-style: none; margin: 0; padding: 0; }
.open-faces-list li { border-bottom: 1px solid var(--bg-border); }
.open-faces-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
}
.open-faces-list a:hover { background: rgba(255,255,255,0.02); }
.open-repo-name { font-family: 'Cormorant Garamond', serif; }
.open-repo-status {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* ----- ops UI -------------------------------------------------------- */

.ops-topbar {
  display:       flex;
  align-items:   center;
  padding:       0.6rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background:    #15130f;
  gap:           1.5rem;
}
.ops-wordmark {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.8rem;
  font-weight: 400;
  opacity:     0.6;
  white-space: nowrap;
  flex-shrink: 0;
}
.ops-wordmark .wordmark-icon { height: 18px; width: 18px; }
.ops-nav {
  display: flex;
  flex:    1;
  gap:     0;
}
.ops-nav a {
  padding:      0.6rem 0.85rem;
  color:        #8c887e;
  font-size:    0.75rem;
  border-bottom: 2px solid transparent;
  white-space:  nowrap;
}
.ops-nav a:hover { color: #e8e3d8; text-decoration: none; }
.ops-nav a.active {
  color:             var(--accent);
  border-bottom-color: var(--accent);
}
.ops-topbar .ops-domain {
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
  opacity:     0.5;
  margin-left: 2rem;
}

.ops-header {
  display:       flex;
  align-items:   center;
  padding:       0.6rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background:    #15130f;
  gap:           1.5rem;
}
.ops-header .wordmark {
  color:       var(--accent);
  font-family: var(--mono);
  font-size:   0.8rem;
  font-weight: 400;
  opacity:     0.8;
  white-space: nowrap;
}
.ops-header .wordmark:hover { color: var(--accent); text-decoration: none; opacity: 1; }
.ops-header .ops-domain {
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.7rem;
  white-space: nowrap;
  opacity:     0.5;
  margin-left: auto;
}

.ops-main {
  max-width: 80rem;
  margin:    0 auto;
  padding:   1.5rem 2rem 4rem;
}

.ops-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid #2a2823;
  border-radius: 4px;
  background: #15130f;
}
.ops-status-row {
  display: grid;
  grid-template-columns: 1.5rem 6rem 1fr auto;
  gap: 1rem;
  align-items: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9rem;
}
.ops-dot { text-align: center; }
.ops-dot.ok { color: #6cd28b; }
.ops-dot.warn { color: #d8a85a; }
.ops-dot.err { color: #d86c6c; }
.ops-status-label { color: #8c887e; }
.ops-status-value { color: #e8e3d8; }
.ops-status-meta  { color: #6c685e; text-align: right; }

.ops-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 50rem) { .ops-grid { grid-template-columns: 1fr; } }

.ops-card {
  border: 1px solid #2a2823;
  border-radius: 4px;
  background: #15130f;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.ops-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #8c887e;
}

.ops-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #1f1d18;
  align-items: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  color: #e8e3d8;
}
.ops-row:last-child { border-bottom: 0; }
.ops-row.attention { color: #d8a85a; }
.ops-row-name { font-weight: 500; }
.ops-row-meta { color: #8c887e; }
.ops-row-when { color: #6c685e; min-width: 6rem; text-align: right; }
.ops-empty { color: #6c685e; font-style: italic; margin: 0.25rem 0; }
.ops-spark {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1rem;
  color: #d8a85a;
}
.ops-trend-line {
  margin: 0.5rem 0 0;
  color: #8c887e;
  font-size: 0.85rem;
}

.ops-flash {
  background: #1f2a1f;
  color: #c8d8b8;
  border: 1px solid #2c3a2c;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.ops-flash.err, .ops-flash-error {
  background: #2a1818;
  border-color: #4a2828;
  color: #e0a8a8;
}

.ops-config-row {
  display: grid;
  grid-template-columns: 16rem 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1f1d18;
}
.ops-config-row:last-of-type { border-bottom: 0; }
.ops-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #b8b3a7;
  font-size: 0.82rem;
}
.ops-restart-banner {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #2a1f10;
  border: 1px solid #5a4220;
  color: #f0c98a;
  border-radius: 3px;
  margin-bottom: 1rem;
}
.ops-btn-warn {
  background: #5a3a18;
  border: 1px solid #d8a85a;
  color: #f0d098;
  padding: 0.3rem 0.9rem;
  border-radius: 2px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.ops-repo-card { padding: 1rem 1.25rem; }
.ops-repo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.ops-repo-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #e8e3d8;
  text-transform: none;
}
.ops-repo-head a { color: inherit; }
.ops-repo-head a:hover h2 { color: #d8a85a; }
.ops-repo-name {
  font-family:   var(--serif);
  font-size:     1.7rem;
  font-style:    italic;
  font-weight:   400;
  color:         var(--primary);
  margin:        0 0 0.25rem;
}
.ops-repo-meta { color: #8c887e; font-size: 0.85rem; }
.ops-repo-lanes {
  display: flex;
  gap: 1.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: #8c887e;
  margin: 0.25rem 0 0.75rem;
}
.ops-repo-lanes b { color: #e8e3d8; font-weight: 500; }
.ops-repo-when { margin-left: auto; }

.ops-repo-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ops-desc-form {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ops-desc-input {
  flex: 1;
  max-width: 400px;
  padding: 0.35rem 0.6rem;
  background: #161412;
  border: 1px solid #2a2823;
  border-radius: 3px;
  color: #d8cfc4;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}
.ops-desc-input::placeholder { color: #5a5650; }
.ops-desc-stacked { flex-direction: column; gap: 0.35rem; }
.ops-desc-row { display: flex; align-items: flex-start; gap: 0.5rem; }
.ops-inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ops-inline-form { min-width: 14rem; }
.ops-dialog-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; justify-content: flex-end; }

.ops-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid #2a2823;
  border-radius: 3px;
  background: #1a1815;
  color: #d8a85a;
  font-size: 0.85rem;
  cursor: pointer;
}
.ops-btn:hover {
  background: #221f1a;
  text-decoration: none;
}
.ops-btn.danger, .ops-btn-danger { color: #d86c6c; border-color: #3a2828; }
.ops-btn.danger:hover, .ops-btn-danger:hover { background: #2a1a1a; }

.ops-page-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #8c887e;
  margin: 0 0 1.5rem;
}

.ops-save-row {
  display: grid;
  grid-template-columns: 7rem 1fr 4rem auto auto auto;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1f1d18;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  align-items: center;
}
.ops-save-id   { color: #8c887e; }
.ops-save-msg  { color: #e8e3d8; }
.ops-save-lane { color: #6c685e; text-align: right; }
.ops-save-when { color: #6c685e; min-width: 5.5rem; text-align: right; }

input[type=text] {
  background: #0e0e0c;
  color: #e8e3d8;
  border: 1px solid #2a2823;
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  min-width: 12rem;
}
input[type=text]:focus { outline: none; border-color: #d8a85a; }
form { display: inline-block; margin: 0.5rem 0; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; color: #d8a85a; }
.ops-bar { font-family: "IBM Plex Mono", ui-monospace, monospace; color: #d8a85a; min-width: 16ch; }
.ops-subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #6c685e;
  text-transform: uppercase;
}
.ops-keyform { display: block; }
.ops-keyform textarea {
  display: block;
  width: 100%;
  background: #0e0e0c;
  color: #e8e3d8;
  border: 1px solid #2a2823;
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}
.ops-keyform textarea:focus { outline: none; border-color: #d8a85a; }
.ops-log-row {
  display:       flex;
  gap:           1.25rem;
  align-items:   baseline;
  padding:       0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-family:   var(--mono);
  font-size:     0.78rem;
}
.ops-log-when {
  color:       var(--muted);
  width:       60px;
  text-align:  right;
  flex-shrink: 0;
}
.ops-log-kind   { color: var(--accent); flex-shrink: 0; }
.ops-log-repo   { color: var(--primary); flex-shrink: 0; }
.ops-log-detail { color: var(--muted); }

.ops-log-controls {
  display:    flex;
  flex-wrap:  wrap;
  gap:        1.5rem;
  align-items: center;
  margin:     0.5rem 0 0.75rem;
}
.ops-log-filters, .ops-log-actions {
  display: flex;
  gap:     1rem;
  align-items: center;
}
.ops-log-filter, .ops-log-action {
  background:  none;
  border:      none;
  color:       var(--muted);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.72rem;
  padding:     0;
  transition:  color 80ms;
}
.ops-log-filter:hover, .ops-log-action:hover { color: var(--secondary); }
.ops-log-filter.active {
  color:           var(--accent);
  border-bottom:   1px solid var(--accent);
}
.ops-log-status {
  font-size: 0.78rem;
  color: #6c685e;
  margin-left: 0.5rem;
}
.ops-log-status[data-ok="1"] { color: #8fb564; }
.ops-log-stream {
  max-height: 70vh;
  overflow-y: auto;
}

.ops-config-raw {
  background: #0e0e0c;
  border: 1px solid #2a2823;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  margin: 0;
  overflow-x: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: #e8e3d8;
}

.ops-badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  background: #2a2823;
  color: #cfcabc;
  margin-right: 0.4rem;
}
.ops-badge.sev-info  { background: #1f2a35; color: #9bb3cd; }
.ops-badge.sev-low   { background: #2a2823; color: #cfcabc; }
.ops-badge.sev-med   { background: #3a2f1c; color: #d8a85a; }
.ops-badge.sev-high  { background: #3a1c1c; color: #d87474; }
.ops-badge.ag-pending{ background: #2a2823; color: #8c887e; }
.ops-badge.ag-run    { background: #1f2a1f; color: #9bcd9b; }
.ops-badge.ag-ok     { background: #1c3a1c; color: #b9e0b9; }
.ops-badge.ag-err    { background: #3a1c1c; color: #d87474; }
.ops-badge.ag-na     { background: #2a2823; color: #8c887e; }

.ops-btn.small {
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
}
.ops-btn.tiny {
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
}

.ops-save-actions { display: flex; gap: 0.3rem; align-items: center; }

.ops-dialog {
  border: 1px solid #2a2823;
  background: #1a1815;
  color: #e8e3d8;
  padding: 0;
  max-width: 50rem;
  width: 90vw;
}
.ops-dialog::backdrop { background: rgba(0,0,0,0.7); }
.ops-dialog-inner { padding: 1.25rem; }
.ops-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.ops-dialog-head h3 { margin: 0; font-size: 1rem; }
.ops-dialog-pre {
  background: #0e0e0c;
  border: 1px solid #2a2823;
  padding: 0.75rem;
  border-radius: 3px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  overflow: auto;
  max-height: 60vh;
  white-space: pre-wrap;
  word-break: break-all;
}
#delete-form input[type=text] {
  margin: 0.5rem 0;
}
.ops-diff-toggle { float: right; }
.ops-diff-toggle .ops-btn { margin-left: 0.3rem; }

.ops-diff-file { margin: 0.6rem 0 1rem; }
.ops-diff-file h3 { font-size: 0.9rem; }
.ops-diff-hunk {
  background: #0e0e0c;
  border: 1px solid #2a2823;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  margin: 0.4rem 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: #cfcabc;
  white-space: pre;
  overflow-x: auto;
}
.ops-diff-hunk-sbs {
  background: #0e0e0c;
  border: 1px solid #2a2823;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  margin: 0.4rem 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
}
.ops-diff-header { color: #6c685e; display: block; margin-bottom: 0.2rem; }
.ops-diff-sbs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; }
.ops-diff-side {
  margin: 0;
  padding: 0.05rem 0.25rem;
  white-space: pre;
  overflow-x: auto;
  color: #cfcabc;
}
.df-eq  { color: #cfcabc; }
.df-ins { color: #b9e0b9; background: rgba(28, 58, 28, 0.35); display: block; }
.df-del { color: #d87474; background: rgba(58, 28, 28, 0.35); display: block; }
.ops-diff-side.df-ins { background: rgba(28, 58, 28, 0.35); color: #b9e0b9; }
.ops-diff-side.df-del { background: rgba(58, 28, 28, 0.35); color: #d87474; }

.review-diff-section[data-mode="unified"] .ops-diff-sbs { display: none; }
.review-diff-section[data-mode="sbs"]    .ops-diff-unified { display: none; }
.review-decision .review-gate-note { color: #d8a85a; }
.review-accept-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ----- ops design system (redesign) --------------------------------------- */

/* flat cards — remove box chrome */
.ops-card {
  background:    transparent;
  border:        none;
  padding:       0;
  margin-bottom: 2.5rem;
}
.ops-card h2 {
  font-family:   var(--serif);
  font-size:     1.05rem;
  font-style:    italic;
  font-weight:   400;
  color:         var(--primary);
  letter-spacing: 0;
  margin-bottom: 1rem;
}

.ops-divider {
  border:     none;
  border-top: 1px solid var(--border);
  margin:     2rem 0;
  opacity:    0.25;
}

.ops-section-title {
  color:         var(--primary);
  font-family:   var(--serif);
  font-size:     1.05rem;
  font-style:    italic;
  font-weight:   400;
  margin-bottom: 1rem;
}

.ops-section-label {
  color:          var(--muted);
  font-family:    var(--mono);
  font-size:      0.65rem;
  letter-spacing: 0.08em;
  margin-bottom:  0.75rem;
  text-transform: uppercase;
}

/* custom checkbox */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance:         none;
  background:         transparent;
  border:             1px solid var(--secondary);
  cursor:             pointer;
  height:             13px;
  position:           relative;
  transition:         border-color 80ms, background 80ms;
  vertical-align:     middle;
  width:              13px;
}
input[type="checkbox"]:checked {
  background:   var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  color:     var(--bg);
  content:   '✓';
  font-size: 9px;
  left:      2px;
  position:  absolute;
  top:       -1px;
}
input[type="checkbox"]:hover { border-color: var(--accent); }

/* text inputs */
.page-ops input[type="text"],
.page-ops input[type="number"],
.page-ops input[type="password"],
.page-ops textarea,
.ops-input,
.ops-textarea {
  appearance:       none;
  -webkit-appearance: none;
  background:       var(--bg-raised);
  border:           1px solid var(--border);
  border-radius:    0;
  box-shadow:       none;
  color:            var(--primary);
  font-family:      var(--mono);
  font-size:        0.85rem;
  outline:          none;
  padding:          0.3rem 0.5rem;
  width:            100%;
  transition:       border-color 80ms;
}

.page-ops input[type="text"]:focus,
.page-ops input[type="number"]:focus,
.page-ops input[type="password"]:focus,
.page-ops textarea:focus,
.ops-input:focus,
.ops-textarea:focus {
  border-color: rgba(200, 169, 110, 0.45);
  outline:      none;
}

.page-ops input:-webkit-autofill,
.page-ops input:-webkit-autofill:focus,
.page-ops input:-webkit-autofill:hover,
.ops-input:-webkit-autofill,
.ops-input:-webkit-autofill:focus {
  -webkit-box-shadow:      0 0 0 1000px #1a1510 inset !important;
  -webkit-text-fill-color: var(--primary) !important;
}

/* textarea-only extras */
.ops-textarea,
.page-ops textarea {
  line-height: 1.6;
  min-height:  5rem;
  resize:      vertical;
}

/* inline forms: input takes remaining space, button stays on same row */
.ops-inline-form .ops-input,
.ops-inline-form input[type="text"],
.ops-inline-form input[type="number"],
.ops-inline-form input[type="password"] {
  flex:      1;
  min-width: 0;
  width:     auto;
}

/* buttons */
.page-ops button[type="submit"]:not(.ops-auth-btn),
.page-ops button:not([data-op]):not(.ops-auth-btn),
.ops-btn {
  appearance:  none;
  background:  transparent;
  border:      1px solid rgba(200, 169, 110, 0.3);
  border-radius: 0;
  color:       var(--secondary);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.75rem;
  padding:     0.25rem 0.75rem;
  transition:  color 80ms, border-color 80ms;
  display:     inline-block;
}
.page-ops button[type="submit"]:not(.ops-auth-btn):hover,
.page-ops button:not([data-op]):not(.ops-auth-btn):hover,
.ops-btn:hover {
  border-color:    var(--accent);
  color:           var(--accent);
  text-decoration: none;
  background:      transparent;
}

/* disabled buttons must look and behave as disabled */
.page-ops button:disabled,
.page-ops button[disabled] {
  opacity: 0.35;
  cursor:  not-allowed;
}

.ops-btn.small { padding: 0.1rem 0.5rem; font-size: 0.68rem; }
.ops-btn.tiny  { padding: 0.05rem 0.35rem; font-size: 0.65rem; }

.ops-btn.danger, .ops-btn-danger { color: #c87070; border-color: #4a2828; }
.ops-btn.danger:hover, .ops-btn-danger:hover { border-color: #8b3a3a; color: #e05c5c; background: transparent; }

/* protect borderless/block-layout components from the broad .page-ops button selector */
.ops-saves-dropdown button,
.ops-saves-dropdown a,
.ops-log-filter,
.ops-log-filter-text,
.ops-log-action,
.ops-saves-menu-btn {
  border: none !important;
  background: none !important;
}

/* restore block layout for dropdown — broad selector (0,3,1) beats (0,1,1) so needs !important */
.ops-saves-dropdown button {
  display: block !important;
  width:   100% !important;
}

.ops-action {
  background:      none;
  border:          none;
  color:           var(--muted);
  cursor:          pointer;
  font-family:     var(--mono);
  font-size:       0.75rem;
  padding:         0;
  text-decoration: none;
  transition:      color 80ms;
}
.ops-action:hover { color: var(--accent); }

.ops-save {
  background:  none;
  border:      none;
  color:       var(--secondary);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.7rem;
  padding:     0;
  transition:  color 80ms;
}
.ops-save:hover { color: var(--accent); }

/* status */
.ops-status-ok    { color: var(--accent); }
.ops-status-warn  { color: #c49a3a; }
.ops-status-error { color: #c45c5c; }
.ops-status-muted { color: var(--muted); }

.ops-badge-live    { color: var(--accent);  border-color: var(--accent); }
.ops-badge-restart { color: var(--muted);   border-color: var(--muted); }
.ops-badge-warning { color: #c49a3a;        border-color: #c49a3a; }

/* object web canvas */
.object-web-canvas {
  display:    block;
  width:      100%;
  height:     280px;
  background: var(--bg);
  margin:     0 0 2.5rem;
}

/* sparkline canvas */
.ops-sparkline-canvas {
  display: block;
  width:   100%;
  height:  56px;
}

/* ops status panel (redesigned) */
.ops-status-panel {
  margin-bottom: 2.5rem;
}
.ops-status-head {
  display:     flex;
  align-items: baseline;
  gap:         1rem;
  margin:      0 0 0.75rem;
}
.ops-status-name {
  font-family: var(--serif);
  font-size:   1.5rem;
  font-style:  italic;
  color:       var(--primary);
  margin:      0;
}
.ops-status-running {
  font-family: var(--mono);
  font-size:   0.75rem;
  color:       var(--accent);
}
.ops-status-version {
  font-family: var(--mono);
  font-size:   0.72rem;
  color:       var(--muted);
}
.ops-status-sub {
  display:         grid;
  grid-template-columns: 6rem 1fr auto;
  gap:             0.4rem 1rem;
  align-items:     baseline;
  font-family:     var(--mono);
  font-size:       0.72rem;
}
.ops-status-sub-key   { color: var(--muted); }
.ops-status-sub-value { color: var(--secondary); }
.ops-status-sub-meta  { color: var(--muted); text-align: right; }

/* repos table (dashboard) */
.ops-repos-table {
  width:           100%;
  border-collapse: collapse;
  margin-bottom:   0;
}
.ops-repos-table tr {
  border-bottom: 1px solid var(--border);
  opacity:       0.2; /* overridden per-row, just for the divider fade */
}
.ops-repos-table tr { opacity: 1; }
.ops-repos-table td {
  padding:     9px 0;
  font-family: var(--mono);
  font-size:   0.8rem;
  border-bottom: 1px solid rgba(46,34,24,0.3);
}
.ops-repos-table tr:last-child td { border-bottom: none; }
.ops-repos-name { color: var(--primary); }
.ops-repos-name a { color: inherit; }
.ops-repos-name a:hover { color: var(--accent); text-decoration: none; }
.ops-repos-count { color: var(--muted); padding: 0 1rem; }
.ops-repos-when  { color: var(--muted); text-align: right; }

/* dashboard two-col layout */
.ops-dash-grid {
  display:               grid;
  grid-template-columns: 2fr 1fr;
  gap:                   2.5rem;
  margin-bottom:         2.5rem;
}
@media (max-width: 50rem) { .ops-dash-grid { grid-template-columns: 1fr; } }

/* activity log rows */
.ops-activity-group {
  margin-bottom: 1.5rem;
}
.ops-activity-group-time {
  color:         var(--muted);
  font-family:   var(--mono);
  font-size:     0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin:        0 0 0.25rem;
}
.ops-activity-row {
  display:     grid;
  grid-template-columns: 5rem 8rem 1fr;
  gap:         0.5rem;
  padding:     5px 0;
  font-family: var(--mono);
  font-size:   0.78rem;
}
.ops-activity-kind        { color: var(--secondary); }
.ops-activity-kind.offer  { color: var(--accent); }
.ops-activity-kind.steal  { color: var(--secondary); }
.ops-activity-kind.auth_fail { color: #c45c5c; }
.ops-activity-kind.session_start { color: var(--muted); }
.ops-activity-kind.health { color: #c49a3a; }
.ops-activity-kind.disk   { color: #c49a3a; }
.ops-activity-repo { color: var(--primary); }
.ops-activity-detail { color: var(--muted); }

/* attention notice */
.ops-attention-notice {
  color:       var(--accent);
  font-family: var(--mono);
  font-size:   0.78rem;
  padding:     0.5rem 0;
  border-bottom: 1px solid rgba(212,148,58,0.2);
  margin-bottom: 0.4rem;
  display:     flex;
  gap:         1rem;
  align-items: center;
}
.ops-attention-notice a {
  color:       var(--secondary);
  margin-left: auto;
}
.ops-attention-notice a:hover { color: var(--accent); }

/* log page filter toggles */
.ops-log-filter-text {
  background:  none;
  border:      none;
  color:       var(--muted);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.78rem;
  padding:     0;
  transition:  color 80ms;
}
.ops-log-filter-text:hover { color: var(--secondary); }
.ops-log-filter-text.active {
  color:           var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* log time group */
.ops-log-group-label {
  color:         var(--muted);
  font-family:   var(--mono);
  font-size:     0.65rem;
  letter-spacing: 0.06em;
  margin:        1rem 0 0.2rem;
}
.ops-log-group-row {
  display:     flex;
  gap:         1.25rem;
  align-items: baseline;
  padding:     4px 0;
  font-family: var(--mono);
  font-size:   0.78rem;
}

/* saves table (repo detail) */
.ops-saves-table {
  width:           100%;
  border-collapse: collapse;
}
.ops-saves-table td {
  padding:       7px 0;
  border-bottom: 1px solid rgba(46,34,24,0.25);
  font-size:     0.85rem;
}
.ops-saves-table tr:last-child td { border-bottom: none; }
.ops-saves-table tr:hover { background: rgba(212,148,58,0.03); }
.ops-saves-id  {
  font-family: var(--mono);
  font-size:   0.75rem;
  color:       var(--secondary);
  width:       5rem;
}
.ops-saves-msg {
  font-family: var(--serif);
  font-style:  italic;
  color:       var(--primary);
}
.ops-saves-lane { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; width: 3.5rem; text-align: right; }
.ops-saves-when { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; width: 6rem;   text-align: right; }
.ops-saves-menu { width: 2rem; text-align: right; }

/* ··· action menu */
.ops-saves-menu-btn {
  background:  none;
  border:      none;
  color:       var(--muted);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.85rem;
  opacity:     0;
  padding:     0 0.25rem;
  transition:  opacity 80ms, color 80ms;
}
.ops-saves-table tr:hover .ops-saves-menu-btn { opacity: 1; }
.ops-saves-menu-btn:hover { color: var(--accent); }

.ops-saves-dropdown {
  position:   absolute;
  right:      0;
  top:        100%;
  background: var(--bg-raised);
  border:     1px solid var(--border);
  min-width:  9rem;
  z-index:    20;
  display:    none;
}
.ops-saves-dropdown.open { display: block; }
.ops-saves-dropdown button,
.ops-saves-dropdown a {
  display:    block;
  width:      100%;
  padding:    0.35rem 0.75rem;
  background: none;
  border:     none;
  color:      var(--muted);
  cursor:     pointer;
  font-family: var(--mono);
  font-size:  0.75rem;
  text-align: left;
  text-decoration: none;
  transition: color 80ms;
}
.ops-saves-dropdown button:hover,
.ops-saves-dropdown a:hover { color: var(--accent); }
.ops-saves-dropdown .danger:hover { color: #c45c5c; }
.ops-saves-dropdown hr {
  border:     none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin:     0.25rem 0;
}
.ops-saves-row-wrap { position: relative; }

/* by-repo storage bars */
.ops-storage-bars { margin-bottom: 1.5rem; }
.ops-storage-bar-row {
  display:     grid;
  grid-template-columns: 8rem 1fr auto auto;
  gap:         0.75rem;
  align-items: center;
  padding:     6px 0;
  font-family: var(--mono);
  font-size:   0.78rem;
}
.ops-storage-bar-name  { color: var(--primary); }
.ops-storage-bar-track { background: rgba(46,34,24,0.4); height: 6px; }
.ops-storage-bar-fill  { background: var(--accent); height: 6px; }
.ops-storage-bar-size  { color: var(--secondary); text-align: right; width: 5rem; }
.ops-storage-bar-pct   { color: var(--muted); width: 3rem; text-align: right; }

/* maintenance section */
.ops-maint-row {
  display:     flex;
  align-items: baseline;
  gap:         1rem;
  padding:     8px 0;
  border-bottom: 1px solid rgba(46,34,24,0.25);
  font-family: var(--mono);
  font-size:   0.78rem;
}
.ops-maint-row:last-child { border-bottom: none; }
.ops-maint-label { color: var(--primary); min-width: 6rem; }
.ops-maint-desc  { color: var(--muted); flex: 1; }
.ops-maint-btn   { margin-left: auto; }

/* config groups */
.ops-config-group { margin-bottom: 2rem; }
.ops-config-row {
  display:     grid;
  grid-template-columns: 220px 1fr 90px;
  gap:         1rem;
  align-items: center;
  padding:     0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ops-config-row:last-of-type { border-bottom: 0; }
.ops-config-key {
  color:       var(--secondary);
  font-family: var(--mono);
  font-size:   0.78rem;
}
.ops-config-restart {
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.65rem;
  text-align:  right;
  white-space: nowrap;
  opacity:     0.6;
}
.ops-config-badge-live {
  color:       var(--accent);
  font-family: var(--mono);
  font-size:   0.65rem;
  text-align:  right;
  white-space: nowrap;
  opacity:     0.5;
}
.ops-config-edited { border-left: 2px solid rgba(212,148,58,0.4); padding-left: 0.5rem; }
.ops-config-radio-group { display: flex; gap: 0.75rem; align-items: center; }
.ops-config-radio { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; cursor: pointer; }
.ops-config-radio input[type="radio"] { accent-color: var(--accent); cursor: pointer; margin-right: 0.2rem; }

/* custom toggle switch (bool config fields) */
input[type="checkbox"].ops-toggle-input {
  position: absolute;
  opacity:  0;
  width:    0 !important;
  height:   0 !important;
  border:   none !important;
  padding:  0;
}
.ops-toggle {
  display:     inline-flex;
  align-items: center;
  cursor:      pointer;
  gap:         0.6rem;
  user-select: none;
}
.ops-toggle-track {
  width:         32px;
  height:        16px;
  border-radius: 8px;
  border:        1px solid rgba(255,255,255,0.2);
  background:    transparent;
  position:      relative;
  transition:    border-color 150ms, background 150ms;
  flex-shrink:   0;
}
.ops-toggle-thumb {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--muted);
  position:      absolute;
  top:           2px;
  left:          2px;
  transition:    transform 150ms, background 150ms;
}
.ops-toggle-input:checked + .ops-toggle-track {
  border-color: var(--accent);
  background:   rgba(212,148,58,0.15);
}
.ops-toggle-input:checked + .ops-toggle-track .ops-toggle-thumb {
  transform:  translateX(16px);
  background: var(--accent);
}
.ops-toggle-value {
  color:       var(--secondary);
  font-family: var(--mono);
  font-size:   0.8rem;
}

/* repos list — clean rows */
.ops-repo-list { margin-bottom: 2.5rem; }
.ops-repo-row {
  display:         grid;
  grid-template-columns: 160px 1fr auto;
  align-items:     center;
  padding:         0.75rem 0;
  border-bottom:   1px solid rgba(255,255,255,0.05);
  text-decoration: none;
  color:           inherit;
  transition:      background 80ms;
  cursor:          pointer;
}
.ops-repo-row:hover { background: rgba(255,255,255,0.02); text-decoration: none; }
.ops-repo-row:first-child { border-top: 1px solid rgba(255,255,255,0.05); }
.ops-repo-row-name {
  color:       var(--primary);
  font-family: var(--serif);
  font-style:  italic;
  font-size:   1rem;
}
.ops-repo-row-meta {
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.75rem;
}
.ops-repo-row-arrow {
  color:      var(--muted);
  font-size:  0.9rem;
  transition: color 80ms;
}
.ops-repo-row:hover .ops-repo-row-arrow { color: var(--accent); }

/* keys section */
.ops-keys-row {
  display:     grid;
  grid-template-columns: 14rem 1fr auto auto;
  gap:         0.75rem;
  align-items: baseline;
  padding:     8px 0;
  border-bottom: 1px solid rgba(46,34,24,0.25);
  font-family: var(--mono);
  font-size:   0.78rem;
}
.ops-keys-row:last-child { border-bottom: none; }
.ops-keys-fp    { color: var(--secondary); }
.ops-keys-label { color: var(--primary); }
.ops-keys-when  { color: var(--muted); }
.ops-keys-badge-active  { color: var(--accent); font-size: 0.65rem; border: 1px solid var(--accent); padding: 0 0.35rem; }
.ops-keys-badge-revoked { color: var(--muted);  font-size: 0.65rem; }
.ops-keys-badge-blocked { color: #c45c5c; font-size: 0.65rem; border: 1px solid #c45c5c; padding: 0 0.35rem; }

/* ----- inline operator controls ------------------------------------------- */

.op-controls {
  opacity:    0;
  transition: opacity 80ms;
  text-align: right;
  white-space: nowrap;
}
.history-row:hover .op-controls,
.save-row:hover .op-controls { opacity: 1; }

/* Operator controls share one deliberate look: quiet mono pills that gain a
   faint border + tint on hover. The explicit background/border reset matters —
   without it a bare <button> falls back to native OS chrome. */
.op-controls button,
.op-edit-description {
  background:     none;
  border:         1px solid transparent;
  border-radius:  3px;
  color:          var(--muted);
  cursor:         pointer;
  font-family:    var(--mono);
  font-size:      0.7rem;
  letter-spacing: 0.02em;
  padding:        1px 6px;
  transition:     color 80ms, border-color 80ms, background 80ms;
}
.op-controls button:hover,
.op-controls button.active,
.op-edit-description:hover {
  color:        var(--accent);
  border-color: var(--border);
  background:   rgba(212, 148, 58, 0.06);
}

.op-actions {
  font-family: var(--mono);
  font-size:   0.75rem;
  color:       var(--muted);
  margin-top:  0.75rem;
}
.op-label {
  color:        var(--accent);
  margin-right: 0.25rem;
}
.op-actions a,
.op-actions button.op-link {
  color:           var(--muted);
  text-decoration: none;
  background:      none;
  border:          none;
  font:            inherit;
  cursor:          pointer;
  padding:         0;
  transition:      color 80ms;
}
.op-actions a:hover,
.op-actions button.op-link:hover { color: var(--accent); }
.op-disabled { color: var(--muted); opacity: 0.4; }

.op-inline-edit {
  background:    transparent;
  border:        none;
  border-bottom: 1px solid var(--accent);
  color:         var(--primary);
  font-family:   var(--serif);
  font-size:     inherit;
  outline:       none;
  padding:       0;
  width:         100%;
}
.op-edit-hint {
  color:       var(--muted);
  font-family: var(--mono);
  font-size:   0.7rem;
  margin-top:  0.25rem;
  opacity:     0.6;
}

.op-edit-description {
  margin-left:    0.5rem;
  opacity:        0;
  vertical-align: middle;
  transition:     opacity 80ms, color 80ms, border-color 80ms, background 80ms;
}
.repo-desc:hover + .op-edit-description,
.op-edit-description:hover { opacity: 1; }

.op-delete-confirm td {
  padding:       0.5rem 0;
  font-family:   var(--mono);
  font-size:     0.8rem;
  color:         var(--muted);
  border-bottom: 1px solid var(--border);
}
.op-confirm-input {
  background:    transparent;
  border:        none;
  border-bottom: 1px solid var(--muted);
  color:         var(--primary);
  font-family:   var(--mono);
  font-size:     0.8rem;
  margin:        0 0.5rem;
  outline:       none;
  padding:       0;
  width:         7rem;
}
.op-delete-btn,
.op-cancel-btn {
  background:  none;
  border:      1px solid var(--muted);
  color:       var(--muted);
  cursor:      pointer;
  font-family: var(--mono);
  font-size:   0.75rem;
  margin-left: 0.4rem;
  padding:     0.1rem 0.5rem;
  transition:  color 80ms, border-color 80ms;
}
.op-delete-btn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.op-delete-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.op-cancel-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ---- ops color context -------------------------------------------------- */
/* The global --secondary and --muted map to very dark amber values tuned    */
/* for the public page; widen them here so ops UI elements are readable.     */
.page-ops {
  --secondary: #9a8060;
  --muted:     #705840;
}

/* forms default to inline-block globally; ops needs block-level layout */
.page-ops form                  { display: block; }
.page-ops form.ops-inline-form  { display: flex; }

/* placeholder text for ops inputs and textareas */
.ops-textarea::placeholder { color: #6a5038; }
.ops-input::placeholder    { color: #6a5038; }

/* form field labels (repo meta, repo detail) */
.ops-field-label {
  color:        var(--secondary);
  font-family:  var(--mono);
  font-size:    0.8rem;
  margin:       0 0 0.25rem;
}

/* ----- auth pages (login / setup / totp) ---------------------------------- */

.ops-auth-card {
  max-width: 26rem;
  margin: 3rem auto;
}
.ops-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.ops-auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #8c887e;
}
.ops-auth-form input[type="password"],
.ops-auth-form input[type="text"] {
  padding: 0.45rem 0.6rem;
  background: #0e0d0a;
  border: 1px solid #2a2823;
  border-radius: 3px;
  color: #e8e3d8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}
.ops-auth-form input:focus {
  outline: none;
  border-color: #d8a85a;
}
.ops-auth-form button.ops-auth-btn {
  align-self:    flex-start;
  padding:       0.4rem 1rem;
  background:    #d8a85a !important;
  border:        none !important;
  border-radius: 3px !important;
  color:         #0e0d0a;
  font-size:     0.85rem;
  font-weight:   600;
  cursor:        pointer;
}
.ops-auth-form button.ops-auth-btn:hover { background: #e0b870 !important; }
.ops-auth-error {
  color: #d86c6c;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}
.ops-auth-hint {
  color: #6c685e;
  font-size: 0.82rem;
  margin: 0.25rem 0 0.5rem;
}
.ops-auth-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ops-auth-skip {
  font-size: 0.82rem;
  color: #6c685e;
}
.ops-totp-uri {
  font-size: 0.85rem;
  color: #d8a85a;
  word-break: break-all;
}
.ops-totp-secret-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: #0e0d0a;
  border: 1px solid #2a2823;
  border-radius: 3px;
  margin: 0.5rem 0;
}
.ops-totp-secret {
  font-size: 1rem;
  color: #e8e3d8;
  letter-spacing: 0.05em;
  user-select: all;
}
.ops-totp-algo {
  font-size: 0.75rem;
  color: #6c685e;
}

/* ----- file list / CHANGES section (legacy .changes class) --------------- */

/* Legacy .changes and .changes-head used by contribute page. */
.changes { margin: 24px 0; }
.changes-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--bg-border);
  padding-bottom: 8px;
}
.changes-label { color: var(--text-secondary); }
.changes-count { color: var(--text-muted); }

.file-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-secondary);
  max-height: 210px;
  overflow-y: auto;
}
.file-tree-list ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
}
.file-tree-list .t-file,
.file-tree-list .t-dir > details > summary {
  line-height: 30px;
}

.file-tree-list .t-file a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0 8px;
}
.file-tree-list .t-file a:hover {
  background: rgba(255,255,255,0.02);
  color: var(--accent);
}

.file-tree-list .t-dir > details > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: var(--text-primary);
  padding: 0 8px;
}
.file-tree-list .t-dir > details > summary::-webkit-details-marker { display: none; }
.file-tree-list .t-dir > details > summary::before {
  content: '▸ ';
  color: var(--accent);
  margin-right: 4px;
}
.file-tree-list .t-dir > details[open] > summary::before { content: '▾ '; }
.file-tree-list .t-dir > details > summary:hover { color: var(--accent); }

/* ----- file viewer (/:name/file?path=...) --------------------------------- */

.file-view {
  border: 1px solid var(--bg-border);
  overflow: hidden;
  margin: 0;
}

.file-view pre {
  margin: 0;
  padding: 0;
  overflow-x: auto;
  background: var(--bg-raised);
}

.file-view pre code {
  display: block;
  padding: 20px 24px;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-raised);
  tab-size: 4;
}

/* ----- file diff view --------------------------------------------------- */

.file-view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.fv-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0;
  letter-spacing: 0.05em;
}
.fv-btn.fv-btn-active { color: var(--accent); }
.fv-btn:hover { color: var(--text-secondary); }
.fv-sep { color: var(--text-muted); }
.fv-msg { margin: 12px 0; }

.file-diff-view {
  border: 1px solid var(--bg-border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}
.fv-hunk { border-bottom: 1px solid var(--bg-border); }
.fv-hunk:last-child { border-bottom: none; }
.fv-hunk-header {
  padding: 3px 12px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  border-bottom: 1px solid var(--bg-border);
}
.fv-line {
  display: grid;
  grid-template-columns: 36px 18px 1fr;
  min-height: 20px;
}
.fv-lnum {
  text-align: right;
  padding: 0 8px 0 0;
  color: var(--text-muted);
  user-select: none;
  font-size: 11px;
}
.fv-pfx {
  color: var(--text-muted);
  user-select: none;
  padding-right: 4px;
}
.fv-text { padding: 0 12px 0 0; white-space: pre; }
.fv-ctx  { background: var(--bg-raised); }
.fv-add  { background: #1a1808; }
.fv-add .fv-pfx  { color: var(--accent); }
.fv-add .fv-text { color: var(--text-primary); }
.fv-del  { background: #140e08; }
.fv-del .fv-pfx  { color: var(--text-secondary); }
.fv-del .fv-text { color: var(--text-muted); text-decoration: line-through; }

/* highlight.js overrides — map atom-one-dark palette to our warm browns */
.hljs                    { background: var(--bg-raised); color: var(--text-primary); }
.hljs-comment,
.hljs-quote              { color: var(--text-muted); font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in           { color: #e8b86a; }
.hljs-string,
.hljs-attr,
.hljs-literal            { color: #a8c878; }
.hljs-number,
.hljs-symbol             { color: #c8a0e8; }
.hljs-type,
.hljs-class .hljs-title  { color: #e8c898; }
.hljs-function .hljs-title,
.hljs-title.function_    { color: #d4943a; }
.hljs-variable,
.hljs-name               { color: var(--text-primary); }
.hljs-meta               { color: var(--accent-dim); }

/* ----- landing page (kepr.uk /) ------------------------------------------- */

/* Hero canvas — full-width, flush, no container constraint */
.page-landing nav {
  position: relative;
  z-index: 10;
}

.page-landing main {
  max-width: none;
  padding: 0;
}

.hero-viz {
  position: relative;
  width: 100%;
  height: 224px;
  background: var(--bg);
  border-bottom: 1px solid var(--bg-border);
  overflow: hidden;
}

.hero-viz canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-caption {
  position: absolute;
  bottom: 10px;
  right: 20px;
  font-size: 11px;
  margin: 0;
  opacity: 0.6;
}

.constellation-caption {
  position: absolute;
  bottom: 10px;
  right: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 640px) {
  .hero-viz { height: 154px; }
}

/* Headline section */
.headline {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 48px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.headline-text { min-width: 0; }

.headline-cloud {
  position: relative;
  height: 280px;
}

@media (max-width: 860px) {
  .headline { grid-template-columns: 1fr; }
  .headline-cloud { display: none; }
}

.headline h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 20px;
}

.headline .explanation {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.7;
}

.headline .install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

/* Tag cloud */
.tc-tag {
  position: absolute;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.03em;
  color: var(--accent-dim);
  white-space: nowrap;
  text-decoration: none;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s, text-shadow 0.2s;
  user-select: none;
}
.tc-tag:hover {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(212, 148, 58, 0.55);
  text-decoration: none;
  opacity: 1 !important;
  animation: tc-breathe 1.8s ease-in-out infinite;
}
@keyframes tc-breathe {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); }
  40%       { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.13); }
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  padding: 2px 4px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 120ms;
}
.copy-btn:hover { color: var(--accent); }

.headline .platform {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* Two-column lists */
.two-col {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 48px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

.col-head {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-weight: 400;
}

.list-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--bg-border);
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
}
.list-entry:last-child { border-bottom: none; }
.list-entry:hover .entry-name { color: var(--accent); }

.entry-name {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 100ms;
}

.entry-when {
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Facts row */
/* ----- docs page layout --------------------------------------------------- */

/* "docs" nav link is always amber on the docs page — not just on hover */
.page-docs .nav-links a[href="/docs"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.docs-layout {
  display: flex;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px 120px;
  gap: 56px;
  align-items: flex-start;
}

.docs-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-bottom: 20px;
}

.docs-sidebar-group {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 24px 0 6px;
}
.docs-sidebar-group:first-child { margin-top: 0; }

.docs-sidebar-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  text-decoration: none;
  line-height: 1.5;
  transition: color 100ms;
}
.docs-sidebar-item:hover { color: var(--text-primary); text-decoration: none; }
.docs-sidebar-item.active { color: var(--accent); }

.docs-sidebar-num {
  color: var(--text-muted);
  font-size: 10px;
  min-width: 18px;
  flex-shrink: 0;
}

.docs-content {
  flex: 1;
  min-width: 0;
}

.docs-header {
  margin: 0 0 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--bg-border);
}

.docs-header h1 {
  font-size: 44px;
  line-height: 1.15;
  margin: 0 0 10px;
}

.docs-header .tagline {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 20px;
  max-width: 60ch;
  line-height: 1.65;
}

.docs-version-strip {
  display: flex;
  gap: 16px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.docs-version-badge {
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  padding: 2px 8px;
  border-radius: 2px;
}

.docs-section {
  margin: 0 0 52px;
  scroll-margin-top: 24px;
}

.docs-section h2 {
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-border);
  line-height: 1.2;
}

.docs-section h3 {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 24px 0 8px;
}

.docs-section h4 {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  margin: 20px 0 8px;
}

.docs-section p {
  margin: 0 0 12px;
  max-width: 68ch;
  line-height: 1.7;
}

.docs-pre {
  background: #15130b;
  border: 1px solid var(--bg-border);
  border-radius: 2px;
  padding: 12px 16px;
  margin: 6px 0 16px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

.docs-pre.toml { color: #c8a96e; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 20px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
}

.docs-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 4px 16px 8px 0;
  border-bottom: 1px solid var(--bg-border);
  white-space: nowrap;
}

.docs-table td {
  padding: 6px 16px 6px 0;
  border-bottom: 1px solid var(--bg-border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table td:first-child { color: var(--accent); }
.docs-table tr:last-child td { border-bottom: none; }

.docs-section ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.docs-section li {
  margin: 4px 0;
  line-height: 1.65;
  max-width: 68ch;
}

@media (max-width: 900px) {
  .docs-layout { flex-direction: column; padding: 0 24px 80px; gap: 32px; }
  .docs-sidebar { position: static; width: 100%; max-height: none; }
}

/* Recently offered repos — compact inline list on landing */
.landing-recent-repos {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.landing-recent-repos a {
  color: var(--text-primary);
}
.landing-recent-repos a:hover { color: var(--accent); }

.landing-browse {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.landing-browse:hover { color: var(--accent); }

/* Op plaque */
.landing-plaque {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 48px;
  border: 1px solid var(--bg-border);
  border-radius: 2px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.landing-plaque p { margin: 0 0 8px; }
.landing-plaque p:last-child { margin-bottom: 0; }
.landing-plaque a { color: var(--accent); }
.landing-plaque a:hover { text-decoration: underline; }

/* Self-host link — sits quietly below the plaque, no divider above */
.landing-self-host {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 48px 56px;
  font-size: 12px;
  color: var(--text-secondary);
}

.landing-self-host a { color: var(--text-secondary); }
.landing-self-host a:hover { color: var(--text-primary); }

/* Landing — plaque greeting: plain text, centered under headline */
.landing-plaque {
  border: none;
  background: none;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 48px 32px;
}

/* Landing — featured (latest offered) repos */
.featured {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 48px 16px;
}
.featured-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1px;
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
}
.featured-card {
  display: block;
  padding: 20px 24px;
  margin: 0;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: background 120ms;
  min-height: 110px;
}
.featured-card:hover { background: rgba(212, 168, 64, 0.04); text-decoration: none; }
.featured-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.featured-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  line-height: 1.1;
  color: var(--accent);
}
.featured-saves {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.featured-desc {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-cats {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* @username mention links — amber, always a door to /~username */
.handle {
  color: #D4A840;
  text-decoration: none;
  transition: opacity 100ms;
}
.handle:hover { opacity: 0.8; }

/* ----- mobile responsive ------------------------------------------------- */

@media (max-width: 600px) {
  nav {
    padding: 16px 20px;
  }

  main {
    padding: 16px 20px 80px;
  }

  h1 { font-size: 36px; }

  .repo-name { font-size: 36px; }

  .save-message-head { font-size: 26px; }

  .cmd {
    font-size: 11px;
    padding: 7px 10px;
  }

  /* history grid: drop lane column on small screens */
  .history-row {
    grid-template-columns: 46px auto 1fr auto;
  }
  .history-lane { display: none; }

  /* diff file row: drop stat bar */
  .diff-file-row {
    grid-template-columns: 1fr auto;
  }
  .diff-bar { display: none; }

  /* save nav — stack vertically if both present */
  .save-nav { flex-wrap: wrap; gap: 12px; }
  .save-nav-next { margin-left: 0; }

  /* two-col landing lists */
  .two-col { grid-template-columns: 1fr; gap: 24px; }

  /* landing headline */
  .headline { padding: 32px 20px 28px; }

  /* landing sections */
  .landing-self-host { padding: 24px 20px; }
}

/* ── Handle profile ───────────────────────────────────────────────────── */

.handle-profile {
  max-width: 760px;
}

.handle-title {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 2rem;
}

.handle-repos {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.handle-empty {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 2rem 0;
}

/* ----- issues system ------------------------------------------------------- */

.repo-issues-count {
  color: var(--accent-dim);
  text-decoration: none;
  font-size: 11px;
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.repo-issues-count:hover { color: var(--accent); border-color: var(--accent); }

.repo-builds-link {
  color: #c0392b;
  text-decoration: none;
  font-size: 11px;
  border: 1px solid #c0392b;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.repo-builds-link:hover { color: #e74c3c; border-color: #e74c3c; }

/* ----- releases page ------------------------------------------------------ */

.page-releases main { max-width: 880px; }

.release-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  margin: 8px 0 20px;
}

.install-cmd { margin: 0 0 32px; }

.release-version { margin-bottom: 28px; }

.release-checksums-link {
  text-decoration: none;
  transition: color 80ms;
}
.release-checksums-link:hover { color: var(--accent); }

.release-artifacts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.artifact-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-border);
}
.artifact-row:last-child { border-bottom: none; }

.artifact-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 16px;
}

.artifact-platform {
  font-size: 14px;
  color: var(--text-primary);
}
.artifact-size { font-size: 12px; }

.artifact-download {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 80ms;
}
.artifact-download:hover { color: var(--accent); }

.artifact-sum {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  min-width: 0;
}
.artifact-sum-label {
  color: var(--accent-dim);
  flex-shrink: 0;
}
.artifact-sum-hash {
  color: var(--text-muted);
  word-break: break-all;
  font-size: 11px;
}

.release-empty {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
}

@media (max-width: 600px) {
  .artifact-main { grid-template-columns: 1fr auto; }
  .artifact-size { display: none; }
}

.view-issues {
  display: none;
  flex-direction: column;
  gap: 0;
  animation: fadeIn 200ms ease both;
}

.issues-loading {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  font-family: var(--mono);
}

.issues-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

.issues-card {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.issues-card:first-child { border-top: 1px solid var(--border); }

.issues-card-title {
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
}
.issues-card-title:hover { color: var(--accent); }

.issues-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.issues-sym {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 4px;
}
.issues-sym.open { color: #4caf50; }
.issues-sym.closed { color: var(--text-muted); }

.issues-sep {
  display: inline;
  color: var(--text-muted);
  margin: 0 4px;
}

.issues-show-more {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0 2px;
  cursor: pointer;
  font-family: var(--mono);
}
.issues-show-more:hover { color: var(--text-secondary); }

.issues-report-btn {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-family: var(--mono);
  border: none;
  background: none;
  padding: 0;
  text-align: left;
}
.issues-report-btn:hover { color: var(--accent); }

.issues-form-wrap {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  background: var(--bg-raised);
}

.issues-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.issues-report-active {
  font-size: 12px;
  color: var(--text-primary);
}

.issues-form-cancel {
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.issues-form-cancel:hover { color: var(--accent); }

.issues-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  pointer-events: none;
}

.issues-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issues-label {
  font-size: 11px;
  color: var(--text-primary);
  font-family: var(--mono);
  margin-top: 6px;
  display: block;
  opacity: 0.7;
}

.issues-input,
.issues-textarea {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--bg-border);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 8px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.issues-input:focus,
.issues-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.issues-submit {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  align-self: flex-start;
}
.issues-submit:hover { opacity: 0.85; }

.issues-invalid {
  font-size: 11px;
  color: #e05252;
  font-family: var(--mono);
}

/* ----- dedicated issues page ----------------------------------------------- */

.issues-breadcrumb {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.issues-breadcrumb a {
  color: #7A7060;
  text-decoration: none;
  transition: color 100ms;
}
.issues-breadcrumb a:hover { color: #D4A840; }
.issues-breadcrumb-sep { color: #2a2018; }
.issues-breadcrumb-current { color: #c8bfb0; }

.issues-page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  color: #E8E0D0;
  margin-bottom: 24px;
  line-height: 1.2;
}
.issues-page-title a {
  color: #7A7060;
  text-decoration: none;
}
.issues-page-title a:hover { color: #E8E0D0; }

.issues-filter-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #2a2018;
}
.issues-filter-tab {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #7A7060;
  cursor: pointer;
  text-decoration: none;
  transition: color 100ms;
}
.issues-filter-tab.active { color: #D4A840; }
.issues-filter-tab:hover  { color: #c8bfb0; }
.issues-filter-sep {
  color: #2a2018;
  margin: 0 10px;
  font-family: 'Courier New', monospace;
}
.issues-report-btn {
  margin-left: auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #D4A840;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 100ms;
}
.issues-report-btn:hover { opacity: 1; }

.issues-form-container {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease, padding 300ms ease;
  padding: 0;
}
.issues-form-container.open {
  max-height: 600px;
  padding: 24px 0;
  border-bottom: 1px solid #2a2018;
}

.issues-form-label {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7A7060;
  display: block;
  margin-bottom: 6px;
  margin-top: 18px;
}
.issues-form-label:first-child { margin-top: 0; }

.issues-form-input,
.issues-form-textarea {
  width: 100%;
  background: transparent;
  border: 1px solid #2a2018;
  color: #E8E0D0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 120ms;
  box-sizing: border-box;
}
.issues-form-input:focus,
.issues-form-textarea:focus {
  border-color: #D4A840;
}
.issues-form-textarea { min-height: 100px; }

.issues-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}
.issues-form-cancel {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 100ms;
}
.issues-form-cancel:hover { color: #c8bfb0; }

.issues-form-submit {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #D4A840;
  cursor: pointer;
  background: none;
  border: 1px solid #D4A840;
  padding: 6px 14px;
  transition: background 100ms, color 100ms;
  opacity: 0.85;
}
.issues-form-submit:hover {
  background: #D4A840;
  color: #0e0c09;
  opacity: 1;
}

.issues-empty {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #7A7060;
  padding: 40px 0;
  font-style: normal;
}

.issue-card {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 20px 0;
  border-bottom: 1px solid #1a1510;
  cursor: pointer;
  transition: background 80ms;
  text-decoration: none;
}
.issue-card:hover { background: #0f0d0b; }
.issue-card-body  { flex: 1; }

.issue-symbol {
  font-size: 14px;
  margin-right: 10px;
  flex-shrink: 0;
  margin-top: 4px;
}
.issue-symbol--open   { color: #D4A840; }
.issue-symbol--closed { color: #7A7060; }

.issue-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: #E8E0D0;
  line-height: 1.3;
  display: block;
  margin-bottom: 6px;
}
.issue-title:hover { color: #D4A840; }

.issue-meta {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.issue-meta-version { color: #c8bfb0; }
.issue-meta-sep     { color: #2a2018; }

.issue-resolved-note {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  margin-top: 4px;
}
.issue-resolved-face {
  color: #c8bfb0;
  text-decoration: none;
}
.issue-resolved-face:hover { color: #D4A840; }

/* ----- issue detail page --------------------------------------------------- */

.issue-detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 400;
  color: #E8E0D0;
  line-height: 1.35;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.issue-detail-symbol {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 4px;
}

.issue-detail-filed {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.issue-detail-version { color: #c8bfb0; }
.issue-detail-face-link {
  color: #c8bfb0;
  text-decoration: none;
}
.issue-detail-face-link:hover { color: #D4A840; }

.issue-detail-divider {
  border: none;
  border-top: 1px solid #1a1510;
  margin: 24px 0;
}

.issue-detail-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: #E8E0D0;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-bottom: 0;
}

.issue-note {
  margin-bottom: 0;
}
.issue-note-header {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.issue-note-author {
  color: #D4A840;
}
.issue-note-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: #c8bfb0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.issue-resolution {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #7A7060;
  display: flex;
  align-items: center;
  gap: 10px;
}
.issue-resolution-symbol { color: #7A7060; font-size: 14px; }
.issue-resolution-face {
  color: #c8bfb0;
  text-decoration: none;
}
.issue-resolution-face:hover { color: #D4A840; }

.issue-back-link {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #7A7060;
  text-decoration: none;
  display: inline-block;
  margin-top: 32px;
  transition: color 100ms;
}
.issue-back-link:hover { color: #D4A840; }

/* ── Timeline ──────────────────────────────────────────────────────────── */

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 0;
  font-family: var(--mono);
  position: relative;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.timeline-discipline {
  font-size: 11px;
}

.timeline-legend-toggle {
  font-size: 11px;
  cursor: pointer;
}
.timeline-legend-toggle:hover { color: var(--text-primary); }

.timeline-legend {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

.timeline-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.timeline-legend-swatch {
  width: 40px;
  height: 10px;
  border-radius: 1px;
  flex-shrink: 0;
}

.timeline-legend-rule-swatch {
  width: 40px;
  height: 1px;
  background: rgba(212, 168, 64, 0.6);
  flex-shrink: 0;
}

.timeline-legend-head-swatch {
  width: 40px;
  height: 10px;
  border-left: 3px solid #D4A840;
  background: #4a3a2a;
  border-radius: 1px;
  flex-shrink: 0;
}

.timeline-row {
  height: 16px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}

.timeline-row--checkpoint {
  opacity: 0.4;
}

.timeline-row--head .timeline-bar {
  border-left: 3px solid #D4A840;
}

@keyframes timeline-enter {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.timeline-row--entering {
  animation: timeline-enter 200ms ease-out both;
}

.timeline-id {
  color: var(--text-secondary);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.timeline-bar {
  height: 10px;
  border-radius: 1px;
  flex-shrink: 0;
}

.timeline-row:hover .timeline-bar {
  filter: brightness(1.5);
}

.timeline-tag-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 20px;
  margin: 4px 0;
}

.timeline-tag-line {
  flex: 1;
  height: 1px;
  background: rgba(212, 168, 64, 0.6);
}

.timeline-tag-name {
  color: #D4A840;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-tooltip {
  position: absolute;
  background: #1a1714;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 11px;
  z-index: 100;
  min-width: 260px;
  max-width: 420px;
  pointer-events: none;
}

.tip-id {
  color: var(--text-secondary);
  font-size: 10px;
  margin-bottom: 4px;
  font-family: var(--mono);
}

.tip-msg {
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-meta {
  color: var(--text-secondary);
  font-size: 10px;
  margin-bottom: 2px;
}

.tip-session,
.tip-agent {
  color: var(--text-secondary);
  font-size: 10px;
}

@media (max-width: 600px) {
  .timeline-row {
    grid-template-columns: 1fr auto;
  }
  .timeline-id { display: none; }
  .timeline-timestamp { display: none; }
  .timeline-tooltip { display: none !important; }
  .timeline-legend { display: none; }
}
