/* Cartledge Ministries Research Archive — Simply ICT "OpenClaw OS" standard.
   Ported from the standard template.html design system: dark #060608 base,
   rgba white hairlines, #FF6B00 orange accent, Inter type, pill badges,
   gradient stat bars, floating blur nav. */
:root {
  --bg: #060608;
  --nav-bg: rgba(10, 10, 10, 0.95);
  --surface: rgba(255, 255, 255, 0.02);
  --surface-solid: #141414;
  --surface-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #999999;
  --muted-2: #666666;
  --accent: #FF6B00;
  --accent-end: #FF9A50;
  --green: #10B981;
  --green-end: #34D399;
  --blue: #3B82F6;
  --blue-end: #60A5FA;
  --purple: #7C3AED;
  --red: #EF4444;
  --amber: #F59E0B;
  --cyan: #06B6D4;
  --mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 120ms ease; }
a:hover { color: var(--accent-end); }
h1, h2, h3 { line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: 1.9rem; margin: 28px 0 8px; }
h2 { font-size: 1.2rem; margin: 22px 0 10px; font-weight: 700; }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; color: var(--accent-end); }
::selection { background: rgba(255, 107, 0, 0.35); }

/* ── Floating nav pill (standard) ── */
.spacer { height: 12px; }
.site-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
}
.header-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 12px 20px; }
.brand { color: var(--text); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.brand span { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 18px; }
.nav a { color: #cccccc; font-size: .92rem; font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); border-bottom-color: var(--accent); }
.mini-search { margin-left: auto; display: flex; gap: 6px; }
input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 120ms ease, background-color 120ms ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 107, 0, 0.5); background: #181818; }
select option { background: var(--surface-solid); }
.mini-search input { min-width: 250px; }
.user-area { display: flex; align-items: center; gap: 10px; }
.head-link { font-size: .84rem; font-weight: 600; color: #c9c9c9; padding: 4px 10px; border: 1px solid var(--line); border-radius: 9999px; background: rgba(255,255,255,0.03); text-decoration: none; }
.head-link:hover { color: var(--text); border-color: var(--line-strong); }
.user-chip { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 12px; border-radius: 9999px; font-size: .82rem; color: #ccc; white-space: nowrap; }

/* main column: comfortable reading width (not stretched to 1800px) */
.wrap { width: 80%; max-width: 1200px; margin: 0 auto; padding: 0; }
main { width: 80%; max-width: 1200px; margin: 0 auto; padding: 34px 0 80px; }

/* ── Buttons ── */
button, .btn {
  font: inherit; font-weight: 600;
  background: linear-gradient(to bottom, #FF8540, var(--accent));
  color: #fff;
  border: 1px solid rgba(255, 107, 0, 0.4);
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: filter 120ms ease, transform 60ms ease;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button:active, .btn:active { transform: translateY(0.5px); }
a.btn { text-decoration: none; display: inline-block; }
.btn.ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255,255,255,0.08); filter: none; }

/* ── Stat cards (enhanced standard) ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 26px 0; }
.stat {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 20px;
  transition: transform .25s ease, border-color .25s ease;
  position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat::after {
  content: '';
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  top: -18px; right: -14px; background: var(--orb, var(--accent)); opacity: .18; pointer-events: none;
}
.stat strong { display: block; font-size: 2.1rem; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.stat.ready { --orb: var(--green); }
.stat.documents { --orb: var(--blue); }
.stat.audio { --orb: var(--green); }
.stat.video { --orb: var(--purple); }
.stat.total { --orb: var(--accent); }

/* progress bar under a stat (processing %) */
.stat-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.06); margin-top: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-end)); transition: width 1s cubic-bezier(0.22,1,0.36,1); }

/* ── Panels / cards ── */
.panel {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px 22px 16px;
  margin: 16px 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel-head h2 { border: none; margin: 18px 0 8px; }

/* ── Item lists ── */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.item-list li:last-child { border-bottom: 0; }
.item-list a { color: var(--text); font-weight: 600; }
.item-list a:hover { color: var(--accent-end); }
.item-list .meta { color: var(--muted); font-size: .84em; margin-left: auto; }
.subtle { color: var(--muted); font-size: .88em; text-decoration: none; }
.count { color: var(--muted); }

/* ── Hero ── */
.hero { text-align: center; padding: 30px 0 4px; }
.hero h1 { font-size: 2.4rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 6px auto 0; }
.hero-search { margin: 20px auto 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-search input { min-width: 340px; padding: 12px 16px; font-size: 1rem; }
.cta { display: flex; gap: 14px; margin: 24px 0 30px; }

/* ── Filters / tables ── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 18px; }
.filters .count { margin-left: auto; }
.items-table { width: 100%; border-collapse: collapse; background: transparent; overflow: hidden; }
.items-table th, .items-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.items-table th { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: rgba(255,255,255,0.02); }
.items-table tbody tr { transition: background .2s ease; }
.items-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.items-table a { color: var(--text); font-weight: 600; }
.items-table a:hover { color: var(--accent-end); }
.pager { display: flex; gap: 16px; align-items: center; margin: 16px 0; color: var(--muted); }
.year-head { border-bottom: 1px solid var(--line-strong); padding-bottom: 6px; margin-top: 28px; font-weight: 800; }

/* ── Search results ── */
.results { list-style: none; margin: 18px 0; padding: 0; }
.result {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color .2s ease, transform .2s ease;
}
.result:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.result h3 { margin: 0 0 4px; }
.result h3 a { color: var(--text); text-decoration: none; }
.result h3 a:hover { color: var(--accent-end); }
.result .meta { color: var(--muted); font-size: .85em; margin: 0 0 8px; }
.result .snip { margin: 0; color: #d5d5d5; }
mark { background: rgba(255, 107, 0, 0.3); color: #fff; padding: 0 3px; border-radius: 3px; }

/* ── Chips (status pills, standard badge) ── */
.chip {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-ready { background: rgba(16,185,129,0.15); color: #10B981; }
.chip-processing { background: rgba(59,130,246,0.15); color: #3B82F6; }
.chip-queued { background: rgba(245,158,11,0.15); color: #F59E0B; }
.chip-needs_tools { background: rgba(255,107,0,0.15); color: #FF6B00; }
.chip-error { background: rgba(239,68,68,0.15); color: #EF4444; }
.chip-new { background: rgba(255,255,255,0.06); color: #aaaaaa; }
.kind-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kind-document { color: #3B82F6; }
.kind-audio { color: #10B981; }
.kind-video { color: #7C3AED; }

/* ── Reader ── */
.reader-head .crumbs { color: var(--muted); font-size: .85em; margin-top: 16px; }
.reader-head .meta { color: var(--muted); }
.tools { margin: 4px 0 14px; font-size: .9em; }
.player-row { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 14px 0; }
.player audio, .player video { width: 100%; border-radius: 10px; }
.notice { background: rgba(255,107,0,0.08); border: 1px solid rgba(255,107,0,0.25); padding: 10px 16px; border-radius: 10px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.transcript {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 18px;
  max-height: 70vh; overflow-y: auto;
}
.segments { list-style: none; margin: 0; padding: 0; }
.segment { display: flex; gap: 12px; padding: 8px 6px; border-radius: 8px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s ease; }
.segment:hover { background: rgba(255,255,255,0.03); }
.segment.active { background: rgba(255,107,0,0.12); border-left: 3px solid var(--accent); }
.segment .time { background: transparent; color: var(--accent); border: 0; padding: 0; font-size: .85em; font-family: var(--mono); white-space: nowrap; cursor: pointer; box-shadow: none; }
.segment .time:hover { filter: brightness(1.3); }
.segment .text { flex: 1; color: #e3e3e3; }
.body { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 24px; margin: 14px 0; }
.body p { margin: 0 0 14px; color: #e8e8e8; }
.refs { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 22px 14px; margin: 18px 0; }
.refs li { margin: 4px 0; }
.study-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .study-row { grid-template-columns: 1fr; } }
.study-box textarea { width: 100%; resize: vertical; }
.highlights { list-style: none; padding: 0; }
.highlights li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; justify-content: space-between; }
.citation { background: var(--surface); border-left: 3px solid var(--accent); padding: 10px 16px; font-size: .92em; border-radius: 8px; }

/* ── Metadata form ── */
.meta-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 10px 0 8px; }
.meta-form label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--muted); }

/* ── Dropzone ── */
.dropzone { border: 2px dashed rgba(255,107,0,0.4); border-radius: 18px; background: var(--surface); text-align: center; padding: 44px 20px; margin: 16px 0; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone.dragover { border-color: var(--accent); background: rgba(255,107,0,0.06); }
.dropzone strong { font-size: 1.1rem; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; }
.how-card h3 { margin-top: 8px; font-size: 1rem; }
.how-card p { font-size: .9em; color: var(--muted); }

/* ── Auth cards ── */
.auth-card { max-width: 420px; margin: 50px auto; background: var(--surface); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: .88em; color: var(--muted); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 16px 0 26px; color: var(--muted); font-size: .84em; }

.err { color: var(--red); }
.empty { color: var(--muted); }
.docs-list { margin: 8px 0 12px; padding-left: 22px; color: #e3e3e3; }
.docs-list li { margin: 6px 0; }
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.docs-side {
  position: sticky; top: 84px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.docs-side-title { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.docs-side ol { list-style: none; margin: 0; padding: 0; }
.docs-side li { margin: 2px 0; }
.docs-side a {
  display: block; color: #b9b9b9; font-size: .86rem; font-weight: 500;
  padding: 5px 10px; border-radius: 8px; border-left: 2px solid transparent;
  text-decoration: none; transition: all .15s ease;
}
.docs-side a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.docs-side a.active { color: var(--accent-end); background: rgba(255,107,0,0.08); border-left-color: var(--accent); }
.doc-section { scroll-margin-top: 90px; }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .docs-side-title { width: 100%; }
  .docs-side ol { display: contents; }
  .docs-side li { display: inline; }
}
.docs-code {
  display: block; overflow-x: auto;
  background: #0d0d10; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-family: var(--mono); font-size: .82rem; line-height: 1.7;
  color: #c4c9d4;
}

/* ── Responsive (standard breakpoints) ── */
@media (max-width: 1023px) {
  .wrap, .site-header { width: 94%; }
}
@media (max-width: 640px) {
  .wrap, .site-header { width: 98%; }
  .hero h1 { font-size: 1.7rem; }
  .items-table { display: block; overflow-x: auto; }
}