/* Odin's Chamber shell extras (tabs, backlinks, registry) */

.shell-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-self: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin: 0;
}

.shell-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted, #888);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

.shell-tab:hover {
  color: var(--text, #ededed);
  background: rgba(255, 255, 255, 0.04);
}

.shell-tab.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
}

.shell-panel[hidden] {
  display: none !important;
}

/* Fill leftover viewport under topbar (restores CF grid scroll + Activity/Log) */
.shell-panel.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel-cf .grid {
  flex: 1;
  min-height: 0;
}

/* Backlinks / Registry / Yggdrasil / Index — panel fills leftover space and scrolls */
#panel-bl.active,
#panel-registry.active,
#panel-ygg.active,
#panel-index.active {
  overflow: hidden;
  min-height: 0;
}

#panel-bl.active > .grid,
#panel-registry.active > .grid,
#panel-ygg.active > .grid,
#panel-index.active > .grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 2.5rem;
  align-content: start;
}

/* Backlinks */
.hosted-banner {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(200, 160, 60, 0.45);
  background: rgba(200, 160, 60, 0.12);
  color: var(--text, #ededed);
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 6px;
}

.hosted-banner code {
  font-size: 0.85em;
}

.bl-grid {
  grid-template-columns: 1fr;
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

.input-row input[type="text"] {
  flex: 1;
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #262626);
  border-radius: 8px;
  color: inherit;
  font-family: "Geist Mono", monospace;
  padding: 0.6rem 1rem;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted, #888);
}

.options-row input[type="number"] {
  width: 64px;
  margin-left: 0.35rem;
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #262626);
  border-radius: 4px;
  color: inherit;
  padding: 0.2rem 0.4rem;
}

.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.source-block h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.source-block .hint {
  font-size: 0.8rem;
  color: var(--muted, #888);
  margin-bottom: 0.75rem;
}

.cred-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.cred-row input {
  flex: 1;
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #262626);
  border-radius: 6px;
  color: inherit;
  padding: 0.45rem 0.65rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
}

.cred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.source-status {
  font-size: 0.8rem;
  color: var(--muted, #888);
}

.source-status.ok {
  color: #22c55e;
}

.progress-bar-wrap {
  background: var(--bg, #0a0a0a);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  background: #3b82f6;
  height: 100%;
  transition: width 0.3s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stats-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 900px) {
  .stats-grid-6 {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Geist Mono", monospace;
  color: #3b82f6;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted, #888);
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #262626);
  margin-bottom: 1rem;
}

.tab {
  background: none;
  border: none;
  color: var(--muted, #888);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.85rem;
}

.tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.bl-results-scroll {
  max-height: min(45vh, 22rem);
  overflow: auto;
  margin-top: 0.5rem;
}

#resultsSection table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#resultsSection th,
#resultsSection td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border, #262626);
  word-break: break-word;
}

.log-area {
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #262626);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  max-height: 280px;
  overflow-y: auto;
  font-family: "Geist Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted, #888);
}

#csvUl,
#dfsUl,
#allowlistUl {
  list-style: none;
  columns: 2;
  font-family: "Geist Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted, #888);
  padding: 0;
}

/* Registry */
.registry-grid {
  grid-template-columns: minmax(240px, 320px) 1fr;
  align-items: start;
}

.registry-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  max-height: 55vh;
  overflow-y: auto;
}

.registry-list li {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.registry-list li:hover {
  background: rgba(255, 255, 255, 0.04);
}

.registry-list li.active {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.12);
}

.registry-list .reg-name {
  font-weight: 500;
  display: block;
}

.registry-list .reg-meta {
  font-size: 0.75rem;
  color: var(--muted, #888);
}

.registry-form {
  display: grid;
  gap: 0.75rem;
}

.registry-form > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted, #888);
}

.registry-form input,
.registry-form textarea {
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #262626);
  border-radius: 6px;
  color: inherit;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
}

.copy-field {
  display: grid;
  gap: 0.35rem;
}

.copy-field-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.copy-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #888);
}

.copy-feedback {
  margin-left: auto;
  font-size: 0.72rem;
  color: #22c55e;
}

.copy-field-value {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.copy-field-value .copy-value-input {
  flex: 1;
  min-width: 0;
  cursor: copy;
}

.copy-field-value .copy-value-input:focus {
  cursor: text;
  outline: none;
  border-color: #525252;
}

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--muted, #888);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.copy-btn .icon-copy,
.copy-btn .icon-check {
  display: block;
}

.copy-btn:hover:not(:disabled) {
  color: #86efac;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.copy-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.copy-btn-value {
  border: 1px solid var(--border, #262626);
  background: var(--surface, #141414);
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
}

.copy-btn-value:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.copy-btn.is-copied {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.copy-btn .icon-check {
  display: none !important;
}

.copy-btn.is-copied .icon-check {
  display: block !important;
}

.copy-btn.is-copied .icon-copy {
  display: none !important;
}

.copy-btn .icon-check[hidden],
.copy-btn .icon-copy[hidden] {
  display: none !important;
}

.registry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.registry-preview {
  margin: 0;
  min-height: 4.5rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border, #262626);
  border-radius: 6px;
  background: var(--bg, #0a0a0a);
  font-family: "Geist Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted, #888);
  white-space: pre-wrap;
  word-break: break-all;
}

.registry-preview-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.registry-preview-wrap .block-toolbar {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
}

/* Gate Kit docs */
.kit-grid {
  grid-template-columns: minmax(220px, 300px) 1fr;
  align-items: stretch;
  gap: 1rem;
  height: 100%;
}

.kit-sidebar-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-bottom: 2rem;
}

.kit-sidebar-desc {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
}

.kit-source-toggle {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--border, #262626);
  background: var(--bg, #0a0a0a);
}

.kit-source-btn {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted, #888);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.kit-source-btn:hover {
  color: #86efac;
}

.kit-source-btn.active {
  color: #ededed;
  background: var(--surface, #141414);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.kit-toc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.kit-toc-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #888);
  margin: 0 0 0.35rem;
}

.kit-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kit-toc-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text, #ededed);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.kit-toc-link:hover {
  background: rgba(255, 255, 255, 0.04);
}

.kit-toc-link.active {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
}

.kit-article-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-bottom: 3rem;
}

.kit-article-head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #262626);
  flex-shrink: 0;
}

.kit-article-group {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #888);
}

.kit-article-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.kit-article {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text, #ededed);
  padding-bottom: 2rem;
}

.kit-pager {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #262626);
}

.kit-pager-btn {
  flex: 1;
  max-width: 48%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface, #141414);
  border: 1px solid var(--border, #262626);
  border-radius: 8px;
  color: var(--text, #ededed);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kit-pager-next {
  text-align: right;
  margin-left: auto;
}

.kit-pager-dir {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #888);
}

.kit-pager-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.kit-pager-placeholder {
  flex: 1;
  max-width: 48%;
}

.kit-pager-btn:hover {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.kit-pager-btn:hover .kit-pager-dir {
  color: #fca5a5;
}

.kit-flash-block {
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin: 0.35rem 0;
  background: rgba(34, 197, 94, 0.12);
  box-shadow:
    0 0 28px 6px rgba(34, 197, 94, 0.4),
    inset 0 0 36px rgba(34, 197, 94, 0.1);
}

.modal-close,
.kit-flow-tip-close {
  transition: color 0.15s ease, box-shadow 0.15s ease, text-shadow 0.15s ease;
}

.modal-close:hover,
.kit-flow-tip-close:hover {
  color: #f87171;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.75);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.kit-article h1,
.kit-article h2,
.kit-article h3,
.kit-article h4 {
  margin: 1.35rem 0 0.55rem;
  line-height: 1.3;
}

.kit-article h1 { font-size: 1.35rem; }
.kit-article h2 { font-size: 1.15rem; }
.kit-article h3 { font-size: 1rem; }
.kit-article h4 { font-size: 0.92rem; color: var(--muted, #aaa); }

.kit-article p,
.kit-article ul,
.kit-article ol,
.kit-article blockquote {
  margin: 0.55rem 0;
}

.kit-article ul,
.kit-article ol {
  padding-left: 1.25rem;
}

.kit-article a {
  color: #60a5fa;
}

.kit-article code {
  font-family: "Geist Mono", monospace;
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.kit-article hr {
  border: none;
  border-top: 1px solid var(--border, #262626);
  margin: 1.25rem 0;
}

.kit-article blockquote {
  border-left: 3px solid rgba(59, 130, 246, 0.5);
  padding-left: 0.85rem;
  color: var(--muted, #aaa);
}

.kit-file-label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted, #888);
}

.kit-section-blurb {
  margin: 0 0 1.1rem;
  max-width: 52rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--fg, #e8e8e8);
  opacity: 0.92;
}

.kit-doc-links {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.25rem;
}

.kit-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--border, #262626);
  border-radius: 8px;
}

.kit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.kit-table th,
.kit-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border, #262626);
  vertical-align: top;
}

.kit-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted, #aaa);
  font-weight: 600;
  white-space: nowrap;
}

.kit-table tr:last-child td {
  border-bottom: none;
}

.kit-code-wrap {
  position: relative;
  margin: 0.85rem 0 1.25rem;
  border: 1px solid var(--border, #262626);
  border-radius: 10px;
  background: #0d1117;
  overflow: hidden;
}

.block-toolbar {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border, #262626);
}

.kit-code {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  tab-size: 2;
}

.kit-code code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  color: #e6edf3;
}

.kit-copy-code,
.kit-expand-code {
  background: var(--surface, #141414);
  border: 1px solid var(--border, #262626);
  color: var(--muted, #888);
  border-radius: 5px;
  font: inherit;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.kit-icon-copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--surface, #141414);
  border: 1px solid var(--border, #262626);
  color: var(--muted, #888);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.kit-icon-copy .icon-copy,
.kit-icon-copy .icon-check {
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
}

.kit-icon-copy .icon-check {
  display: none !important;
}

.kit-icon-copy.is-copied .icon-check {
  display: block !important;
}

.kit-icon-copy.is-copied .icon-copy {
  display: none !important;
}

.kit-icon-copy .icon-check[hidden],
.kit-icon-copy .icon-copy[hidden] {
  display: none !important;
}

.kit-icon-copy:hover {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.kit-icon-copy.is-copied {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.kit-copy-feedback {
  position: absolute;
  top: -1.35rem;
  right: 0;
  font-size: 0.65rem;
  color: #86efac;
  white-space: nowrap;
  pointer-events: none;
}

.kit-copy-code.kit-icon-copy {
  padding: 0;
  width: 28px;
  height: 28px;
}

.kit-expand-code {
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#flow-zoom-in,
#flow-zoom-out,
#flow-zoom-reset,
.kit-flow-zoom,
.kit-expand-code,
.kit-flow-tip-goto,
#expand-modal-goto,
#expand-modal-back {
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#flow-zoom-in:hover,
#flow-zoom-out:hover,
#flow-zoom-reset:hover,
.kit-flow-zoom:hover,
.kit-expand-code:hover,
.kit-flow-tip-goto:hover,
#expand-modal-goto:hover,
#expand-modal-back:hover {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.kit-copy-code:hover,
.kit-expand-code:hover {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.55);
}

.expand-modal-panel {
  width: min(960px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.expand-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
}

.expand-modal-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--border, #262626);
  background: #0d1117;
}

.expand-modal-body,
.expand-modal-pre {
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: #0d1117;
  font-family: "Geist Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre;
}

.expand-modal-body code,
.expand-modal-pre code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  color: #e6edf3;
  font-size: inherit;
}

.expand-modal-prose {
  padding: 0.85rem 1rem 1.1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text, #e5e5e5);
  white-space: normal;
}

.expand-modal-prose h1 { font-size: 1.05rem; margin: 0.6rem 0 0.4rem; }
.expand-modal-prose h2 { font-size: 0.95rem; margin: 0.55rem 0 0.35rem; }
.expand-modal-prose h3 { font-size: 0.88rem; margin: 0.5rem 0 0.3rem; }
.expand-modal-prose h4 { font-size: 0.82rem; margin: 0.45rem 0 0.25rem; color: #aaa; }
.expand-modal-prose p,
.expand-modal-prose li { font-size: 0.78rem; }
.expand-modal-prose code {
  font-size: 0.72rem;
  background: #161b22;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}
.expand-modal-prose pre.kit-code {
  font-size: 0.7rem;
  padding: 0.65rem 0.75rem;
  overflow: auto;
}

.expand-modal-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 200px;
}

.expand-modal-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  image-rendering: pixelated;
}

.kit-inline-img {
  display: inline-block;
  max-width: min(100%, 420px);
  height: auto;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px solid var(--border, #262626);
  cursor: zoom-in;
  margin: 0.35rem 0;
}

.kit-muted {
  color: var(--muted, #888);
}

.kit-error {
  color: #f87171;
}

.kit-file-link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #60a5fa;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kit-file-link code {
  color: inherit;
}

.kit-doc-nav {
  color: #60a5fa;
}

.kit-mermaid {
  position: relative;
  margin: 1rem 0 1.5rem;
  padding: 0.65rem 0.75rem 1rem;
  border: 1px solid var(--border, #262626);
  border-radius: 10px;
  background: #0d1117;
  overflow-x: auto;
}

.kit-mermaid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kit-mermaid-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #93c5fd;
}

.kit-flow-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border, #262626);
  background: var(--surface, #141414);
  color: var(--muted, #888);
  cursor: pointer;
}

.kit-flow-zoom:hover {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.kit-mermaid .mermaid {
  background: transparent;
}

.kit-flow-tip {
  position: fixed;
  z-index: 10000;
  width: 300px;
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border, #333);
  background: #161b22;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.kit-flow-tip-goto {
  display: inline-flex;
  margin-top: 0.15rem;
}

.kit-flow-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.kit-flow-tip-title {
  font-size: 0.8rem;
}

.kit-flow-tip-body {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #c9d1d9;
}

.kit-flow-tip-close {
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
}

.flow-zoom-panel {
  width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.flow-zoom-stage {
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  background: #0d1117;
  border-top: 1px solid var(--border, #262626);
  cursor: grab;
  position: relative;
}

.flow-zoom-stage:active {
  cursor: grabbing;
}

.flow-zoom-inner {
  transform-origin: 0 0;
  width: max-content;
  padding: 1.5rem;
}

.kit-sample {
  margin: 1rem 0 1.35rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.06);
  overflow: hidden;
}

.kit-sample-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.25);
}

.kit-sample-body {
  padding: 0.85rem 1rem 1rem;
}

.kit-mock-chrome {
  background: #202124;
  color: #e8eaed;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 420px;
}

.kit-mock-chrome h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.1rem;
  color: #e8eaed;
}

.kit-mock-error-icon {
  display: block;
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  margin-bottom: 0.35rem;
}

.kit-mock-chrome-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: #9aa0a6;
}

.kit-mock-linkish {
  color: #8abff8;
}

.kit-mock-chrome-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kit-mock-chrome-icon {
  font-size: 1.5rem;
}

.kit-mock-muted {
  color: #9aa0a6;
  font-size: 0.85rem;
}

.kit-mock-btn,
.kit-mock-btn-primary {
  margin-top: 0.75rem;
  border-radius: 999px;
  border: 1px solid #5f6368;
  background: #303134;
  color: #e8eaed;
  padding: 0.35rem 0.85rem;
  font: inherit;
}

.kit-mock-btn-primary {
  background: #8abff8;
  border-color: #8abff8;
  color: #202124;
}

.kit-mock-chrome-actions .kit-mock-btn,
.kit-mock-chrome-actions .kit-mock-btn-primary {
  margin-top: 0;
}

.kit-mock-app {
  border: 1px solid var(--border, #262626);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface, #141414);
}

.kit-mock-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-bottom: 0.5rem;
}

.kit-mock-form {
  display: grid;
  gap: 0.45rem;
  max-width: 280px;
  margin-top: 0.75rem;
}

.kit-mock-form input {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  color: #888;
}

.kit-mock-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.kit-mock-pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  background: #0a0a0a;
  border-radius: 6px;
  font-family: "Geist Mono", monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
}

.kit-mock-tg {
  max-width: 320px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e3a5f;
  background: #0e1621;
}

.kit-mock-tg-head {
  background: #17212b;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: #8ab4f8;
}

.kit-mock-tg-msg {
  padding: 0.75rem;
  font-size: 0.85rem;
}

.kit-mock-admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.kit-mock-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #444;
}

.kit-mock-pill.ok {
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
}

.kit-mock-pill.bad {
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

.kit-mock-brand {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
}

.kit-mock-favicon,
.kit-mock-og,
.kit-mock-json {
  height: 72px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border: 1px solid #333;
  margin: 0 auto 0.35rem;
}

.kit-mock-favicon {
  width: 48px;
  height: 48px;
}

.kit-mock-og {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1200 / 630;
  height: auto;
  min-height: 56px;
  background: #fff;
  color: #111;
  font-weight: 600;
}

@media (max-width: 700px) {
  .kit-mock-split,
  .kit-mock-brand {
    grid-template-columns: 1fr;
  }
}

.registry-detail-card {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-bottom: 2rem;
}

@media (max-width: 900px) {
  .sources-grid,
  .registry-grid,
  .kit-grid {
    grid-template-columns: 1fr;
  }

  .registry-detail-card,
  .kit-sidebar-card,
  .kit-article-card {
    max-height: none;
    position: static;
  }

  .shell-nav {
    flex-wrap: wrap;
    justify-self: start;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-meta-slot {
    min-width: 0;
    justify-self: stretch;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* —— Index (IndexNow) tab —— */
.index-grid {
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1rem;
  align-items: start;
}

.index-sidebar-card .card-header,
.index-form-card .card-header,
.index-log-wrap .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.index-sidebar-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.index-search-label {
  display: block;
  margin: 0.75rem 0;
}

.index-health-filters {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}

.index-health-filter {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.index-health-filter:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.index-health-filter.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0, 112, 243, 0.12);
}

.index-site-row .status-pill,
.index-queue-row .status-pill {
  flex-shrink: 0;
}

.index-site-list,
.index-queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-site-list {
  max-height: min(70vh, 640px);
  overflow: auto;
}

.index-queue-list {
  margin: 0.75rem 0 1rem;
  max-height: min(36vh, 320px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
}

.index-site-row,
.index-queue-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.4rem;
  border-radius: 6px;
}

.index-site-row:hover,
.index-queue-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.index-site-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.index-site-info strong {
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.index-site-meta {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.index-plus-btn,
.index-remove-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.index-plus-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-hover);
}

.index-plus-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.index-remove-btn {
  font-size: 1.25rem;
  opacity: 0.8;
}

.index-remove-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #c44 22%, transparent);
  border-color: color-mix(in srgb, #c44 40%, transparent);
}

.index-site-empty {
  padding: 0.75rem 0.5rem;
  opacity: 0.65;
  font-size: 0.875rem;
}

.index-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.index-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.index-manual {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.index-manual summary {
  cursor: pointer;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.index-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.index-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.index-form input[type="url"],
.index-form input[type="text"] {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.index-log-wrap {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.index-log-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.index-log {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  min-height: 12rem;
  max-height: min(40vh, 28rem);
  overflow: auto;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  border-radius: 6px;
  background: var(--surface-2, rgba(0, 0, 0, 0.35));
  color: var(--text, #ededed);
  border: 1px solid var(--border, #262626);
}

.index-log-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 0.15rem;
}

.index-log-time {
  color: var(--muted, #888);
  flex-shrink: 0;
}

.index-log-info {
  color: var(--text, #ededed);
}

.index-log-ok {
  color: #4ade80;
}

.index-log-error {
  color: #f87171;
}

.index-log-warn {
  color: #fbbf24;
}

.index-log-telegram {
  color: #22c55e;
  font-weight: 600;
}

@media (max-width: 900px) {
  .index-grid {
    grid-template-columns: 1fr;
  }
}

/* ── the Well of Urd ─────────────────────────────────────── */

.urd-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.urd-header {
  padding: 1rem 1.15rem;
  flex-shrink: 0;
}

.urd-search-label {
  display: block;
  margin-top: 0.75rem;
}

.urd-owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

.urd-owner-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.urd-owner-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.urd-owner-name {
  font-weight: 600;
  font-size: 1rem;
}

.urd-owner-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.urd-empty {
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-panel.modal-panel-wide.urd-modal-panel {
  width: min(960px, 100%);
  height: min(90vh, 52rem);
  max-height: min(90vh, 52rem);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
}

.urd-modal-panel .modal-header,
.urd-modal-panel .modal-search {
  flex-shrink: 0;
}

.urd-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  grid-auto-rows: 16.5rem;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.25rem 0.15rem 0.75rem;
  align-content: start;
  align-items: stretch;
}

.urd-project-card {
  display: flex;
  flex-direction: column;
  height: 16.5rem;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
}

.urd-card-media {
  flex: 0 0 8.5rem;
  width: 100%;
  height: 8.5rem;
  max-height: 8.5rem;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.urd-card-og {
  display: block;
  width: 100%;
  height: 8.5rem;
  max-height: 8.5rem;
  object-fit: cover;
  object-position: center;
}

.urd-card-og-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 8.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.urd-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0.7rem 0.8rem 0.85rem;
  background: var(--surface-2);
}

.urd-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.urd-card-host {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urd-card-body .status-pill {
  align-self: flex-start;
  margin-top: auto;
  flex-shrink: 0;
}
