/* Top nav */
.topnav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
/* NOTE: .brand / .brand-mark / .brand-name live in chrome.css (canonical, SVG
   logo). They were duplicated here with a placeholder blue box that — because
   components.css loads AFTER chrome.css — overrode the real mark. Removed. */
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-link {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 12px;
  transition: color 0.2s;
}
.top-link:hover { color: var(--text); }

/* Buttons */
.btn {
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
  background: var(--panel-hi);
}
.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(107, 164, 248, 0.22);
}
.btn.primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(107, 164, 248, 0.3);
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
}

/* Eyebrow / status pill */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(14, 23, 35, 0.6);
  backdrop-filter: blur(8px);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

/* Footer */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border-soft);
  padding: 18px 36px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.footer .status { display: inline-flex; align-items: center; gap: 8px; }
.footer .status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

/* Mobile */
@media (max-width: 900px) {
  .topnav { padding: 18px 22px; }
  .footer { padding: 14px 22px; flex-direction: column; gap: 8px; text-align: center; }
}

/* Tile grid for app launcher */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px 24px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile:hover { border-color: var(--accent-line); background: var(--panel-hi); transform: translateY(-1px); }
.tile-name { font-size: 15px; font-weight: 500; color: var(--text); }
.tile-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.tile-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.tile-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.tile-status.warn .dot { background: var(--amber); }
.tile-status.crit .dot { background: #ff5b5b; }

/* Status banner */
.status-banner.ok #agg-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.status-banner.warn #agg-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.status-banner.crit #agg-dot { background: #ff5b5b; box-shadow: 0 0 10px #ff5b5b; }

/* Request-row used in admin queue */
.request-row {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.request-row .meta { font-size: 13px; color: var(--text); }
.request-row .meta .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.request-row .actions { display: flex; gap: 8px; }

/* Wiki layout */
.wiki-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 36px;
  flex: 1;
  position: relative;
  z-index: 1;
}
.wiki-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.wiki-toc-group { margin-bottom: 18px; }
.wiki-toc h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 8px; padding-left: 8px;
}
.wiki-toc ul { list-style: none; padding: 0; margin: 0; }
.wiki-toc li { margin: 2px 0; }
.wiki-toc a { color: var(--text-dim); text-decoration: none; padding: 5px 10px; border-radius: 6px; display: block; font-size: 14px; transition: all 0.15s; }
.wiki-toc a:hover { color: var(--text); background: var(--panel-hi); }
.wiki-toc a.active { color: var(--accent); background: var(--accent-dim); font-weight: 500; }

.wiki-body { padding: 32px 40px; max-width: 860px; }
.wiki-body article h1 { font-size: 32px; font-weight: 600; margin: 0 0 8px; color: var(--text); letter-spacing: -0.01em; }
.wiki-body article h1 + p { color: var(--text-muted); font-size: 16px; margin-top: 0; }
.wiki-body article h2 { font-size: 21px; font-weight: 500; margin: 36px 0 12px; color: var(--text); border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
.wiki-body article h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.wiki-body article p { margin: 12px 0; color: var(--text-dim); line-height: 1.7; }
.wiki-body article a { color: var(--accent); text-decoration: none; }
.wiki-body article a:hover { text-decoration: underline; }
.wiki-body article code { background: var(--panel-hi); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; color: var(--accent); font-family: var(--font-mono, ui-monospace, monospace); }
.wiki-body article pre { background: #0A1019; border: 1px solid var(--border-soft); padding: 16px 18px; border-radius: 10px; overflow-x: auto; margin: 18px 0; }
.wiki-body article pre code { background: transparent; padding: 0; color: var(--text); font-size: 12.5px; line-height: 1.6; }
.wiki-body article ul, .wiki-body article ol { padding-left: 22px; color: var(--text-dim); margin: 10px 0; line-height: 1.7; }
.wiki-body article li { margin: 5px 0; }
.wiki-body article blockquote { border-left: 3px solid var(--accent); padding: 4px 16px; margin: 16px 0; color: var(--text-muted); background: rgba(62,232,164,0.05); border-radius: 0 8px 8px 0; }
.wiki-body article blockquote p { color: var(--text-muted); }
.wiki-body article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.wiki-body article th, .wiki-body article td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); }
.wiki-body article th { color: var(--text); font-weight: 600; border-bottom-color: var(--border); }
.wiki-body article hr { border: none; border-top: 1px solid var(--border-soft); margin: 28px 0; }
/* Reference-architecture diagram + any wiki image */
.wiki-body article img { display: block; width: 100%; height: auto; margin: 24px 0; border: 1px solid var(--border-soft); border-radius: 12px; background: #0A0F17; }

@media (max-width: 820px) {
  .wiki-layout { grid-template-columns: 1fr; padding: 20px 22px; gap: 20px; }
  .wiki-toc { position: static; max-height: none; }
  .wiki-body { padding: 22px 20px; }
}

/* Access-view role badge */
.role-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
}
.role-badge.ok { color: var(--green); background: rgba(62, 232, 164, 0.10); border: 1px solid rgba(62, 232, 164, 0.28); }
.role-badge.none { color: var(--text-muted); background: var(--panel-hi); border: 1px solid var(--border-soft); }
.role-badge.managed { color: var(--amber); background: var(--panel-hi); border: 1px solid var(--border-soft); }

/* Surface URL shown on access-view / home tiles */
.tile-url {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile--locked .tile-url { color: var(--text-muted); }

/* Inaccessible (locked) access-view tile: dimmed, not interactive */
.tile--locked { opacity: 0.5; cursor: not-allowed; }
.tile--locked:hover { transform: none; border-color: var(--border-soft); }

/* Access page — request cards + status pills */
.req-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px; }
.req-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.req-card-title { font-weight: 500; font-size: 14px; }
.req-card-notes { color: var(--text-dim); font-size: 13px; margin-top: 8px; }
.status-pill { display: inline-block; padding: 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; }
.status-pill.approved { color: var(--green); background: rgba(62,232,164,0.12); border: 1px solid rgba(62,232,164,0.30); }
.status-pill.pending  { color: var(--amber); background: rgba(245,166,35,0.12); border: 1px solid rgba(245,166,35,0.30); }
.status-pill.denied   { color: var(--red);   background: rgba(247,113,113,0.12); border: 1px solid rgba(247,113,113,0.30); }
.status-pill.failed   { color: #FF9B5B; background: rgba(255,155,91,0.12); border: 1px solid rgba(255,155,91,0.30); }

/* MOTD / announcement banner (site-wide, dismissible) */
.kl-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 20px; font-size:14px; line-height:1.4; }
.kl-banner .kl-banner-msg { flex:1; }
.kl-banner .kl-banner-x { cursor:pointer; background:none; border:none; color:inherit; font-size:18px; line-height:1; opacity:.7; }
.kl-banner .kl-banner-x:hover { opacity:1; }
.kl-banner.info     { background:rgba(107,164,248,0.14); color:#cfe0ff; border-bottom:1px solid rgba(107,164,248,0.35); }
.kl-banner.warn     { background:rgba(245,166,35,0.14);  color:#ffe2b0; border-bottom:1px solid rgba(245,166,35,0.35); }
.kl-banner.critical { background:rgba(247,113,113,0.16); color:#ffd2d2; border-bottom:1px solid rgba(247,113,113,0.45); }
