/* ==========================================================================
   eullrich.com Brand Design System — OKF Hub (okf.eullrich.com)
   ========================================================================== */

:root {
  /* --- Editorial "paper" design system (eugen-ullrich) --- */
  --paper: #fff; --ink: #000; --link: #0060a0; --link-press: #004a80;
  --line: #e5e5e5; --ink-2: #555; --ink-3: #6b6b6b; --soft: #f4f4f2; --code-bg: #f4f4f2;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --display: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 2rem); --maxw: 42rem; --maxw-wide: 68rem;
  --fs-h1: clamp(2.4rem, 7vw, 4.25rem); --fs-h2: clamp(1.6rem, 4.5vw, 2.4rem);
  --fs-lede: clamp(1.2rem, 2.2vw, 1.4rem);
  --lh-display: 1.04; --lh-heading: 1.08; --ls-h1: -0.03em; --ls-h2: -0.02em;

  /* --- App token remap → editorial light --- */
  --bg-main: var(--paper);
  --bg-surface: var(--paper);
  --bg-surface-hover: var(--soft);
  --bg-card: var(--paper);

  --border-color: var(--line);
  --border-hover: var(--ink);

  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);

  --accent-primary: var(--link);
  --accent-green: var(--link);   /* live dot → link blue */

  --font-heading: var(--display);
  --font-body: var(--display);
  --font-mono: var(--mono);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
/* App uses a fixed full-viewport layout; landing scrolls normally. */
body:has(#app[style*="flex"]) { overflow: hidden; height: 100vh; }

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Site Header eullrich.com style */
.site-header {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  z-index: 50;
}

.wrap-header {
  width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand Link with Dot Indicator */
.brand {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.brand-sep { color: var(--text-muted); font-weight: 400; }
.brand-sub { color: var(--text-secondary); font-weight: 500; font-size: 14px; }

/* Header Search */
.header-center { flex: 1; max-width: 440px; margin: 0 32px; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-ico {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  height: 38px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 40px 0 36px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--text-primary);
}

.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-hover);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Header Right */
.header-right { display: flex; align-items: center; gap: 16px; }

.nav-links { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.nav-links a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links .sep { color: var(--text-muted); }

.cta-solid {
  background-color: var(--text-primary);
  color: var(--bg-main);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.15s ease;
}

.cta-solid:hover { opacity: 0.9; }

.cta-solid--sm { padding: 6px 12px; font-size: 12px; }
.cta-solid--inv { background-color: var(--bg-surface-hover); color: var(--text-primary); border: 1px solid var(--border-color); }

.btn-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.avatar-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Workspace */
.workspace { display: flex; flex: 1; overflow: hidden; position: relative; }

.sidebar {
  width: 260px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.block-title { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 8px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.nav-btn:hover { background-color: var(--bg-surface-hover); color: var(--text-primary); }
.nav-btn.active { background-color: var(--bg-surface-hover); color: var(--text-primary); font-weight: 600; border-left: 2px solid var(--text-primary); }

.sidebar-sep { height: 1px; background-color: var(--border-color); }

.filter-list { display: flex; flex-direction: column; gap: 3px; }

.f-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.f-item:hover { background-color: var(--bg-surface-hover); color: var(--text-primary); }
.f-item.active { background-color: var(--bg-surface-hover); border-color: var(--border-hover); color: var(--text-primary); font-weight: 600; }

.badge-num { font-size: 11px; color: var(--text-muted); }

.tag-cloud-wrapper { display: flex; flex-wrap: wrap; gap: 6px; }

.t-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
}

.t-tag:hover, .t-tag.active { background: var(--text-primary); color: var(--bg-main); }

.feedback-block { margin-top: auto; }
.trust-info-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.trust-heading { font-size: 10px; font-weight: 700; color: var(--accent-green); letter-spacing: 0.8px; margin-bottom: 4px; }
.trust-info-card p { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Main Panel */
.main-panel { flex: 1; overflow-y: auto; padding: 24px; }

.panel-view { display: none; }
.panel-view.active { display: block; }

.panel-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.toolbar-title { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.select-styled {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.okf-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-height: 172px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.okf-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
html.light .okf-card:hover { box-shadow: 0 12px 30px rgba(15,23,42,0.1); }

.okf-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.okf-type-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent-primary); background: rgba(99,102,241,0.12);
  padding: 3px 9px; border-radius: 999px;
}
.okf-domain-tag { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.okf-card-title {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.okf-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.okf-card-foot {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.okf-card-foot span:first-child { color: var(--accent-primary); font-weight: 600; }

.arrow-link-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}

.arr { transition: transform 0.15s; }
.arrow-link-btn:hover .arr { transform: translateX(3px); }

/* Graph Box */
.graph-banner h2 { font-family: var(--font-heading); font-size: 22px; margin-bottom: 4px; }
.graph-banner p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.graph-box {
  width: 100%;
  height: 580px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

#d3GraphSvg { width: 100%; height: 100%; }

.graph-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(10,11,13,0.85);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.dot-lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* AI Assistant */
.ai-box-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ai-title-block h2 { font-family: var(--font-heading); font-size: 20px; }
.ai-title-block p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.chat-frame {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  height: min(640px, calc(100vh - 250px));
  min-height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-logs { flex: 1; padding: 26px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }

/* message rows */
.msg { font-size: 14.5px; line-height: 1.7; }
.bot-msg { align-self: stretch; display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.bot-msg .msg-author { grid-column: 1; grid-row: 1 / span 3; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6); color: #fff; display: grid; place-items: center;
  font-size: 0; margin: 0; }
.bot-msg .msg-author::before { content: '🤖'; font-size: 16px; }
.bot-msg .msg-txt, .bot-msg .suggest-row { grid-column: 2; }
.bot-msg .msg-txt { background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 4px 14px 14px 14px; padding: 14px 18px; max-width: 68ch; }
.user-msg { align-self: flex-end; max-width: 80%; background: linear-gradient(135deg, var(--accent-primary), #7c6cf0); color: #fff; padding: 12px 16px; border-radius: 14px 14px 4px 14px; font-weight: 500; }

/* readable RAG answers */
.msg-txt { line-height: 1.7; }
.msg-txt p { margin: 0 0 0.8em; }
.msg-txt p:last-child { margin-bottom: 0; }
.msg-txt ul, .msg-txt ol { margin: 0.3em 0 0.9em; padding-left: 1.4em; }
.msg-txt li { margin-bottom: 0.4em; }
.msg-txt a { color: #8ea2ff; text-decoration: none; border-bottom: 1px solid rgba(142,162,255,0.4); font-weight: 600; cursor: pointer; }
.msg-txt a:hover { border-bottom-color: currentColor; }
.msg-txt strong { color: var(--text-primary); }
.msg-txt hr { border: none; border-top: 1px solid var(--border-color); margin: 1em 0 0.7em; }
.msg-txt code { font-family: var(--font-mono); font-size: 0.86em; background: var(--bg-surface-hover); border-radius: 4px; padding: 0.1em 0.35em; }

.suggest-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.suggest-tag { background: var(--bg-surface-hover); border: 1px solid var(--border-color); font-size: 12.5px; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.15s; }
.suggest-tag:hover { border-color: var(--accent-primary); color: var(--text-primary); background: rgba(99,102,241,0.1); }

.chat-bar { padding: 14px 16px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; background: var(--bg-surface); }
.chat-bar input { flex: 1; height: 46px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 12px; padding: 0 16px; color: var(--text-primary); font-size: 14.5px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.chat-bar input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.chat-bar .cta-solid { height: 46px; padding: 0 20px; }

/* Drawer Slide-over */
.drawer {
  position: fixed;
  top: 64px; right: 0;
  width: min(720px, 94vw); height: calc(100vh - 64px);
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px rgba(0,0,0,0.35);
}

.drawer.open { transform: none; }

.drawer-top { padding: 14px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.close-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.drawer-body { flex: 1; overflow-y: auto; padding: 32px 40px 80px; }

.arrow-link { color: var(--text-primary); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* ==================== OKF READER (expanding card content) ==================== */
.okf-reader { max-width: 68ch; margin: 0 auto; }
.okf-reader-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 14px; }
.okf-reader-type { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--accent-primary); }
.okf-reader-chip { color: var(--text-muted); background: var(--bg-main); border: 1px solid var(--border-color); padding: 2px 9px; border-radius: 999px; }
.okf-reader-verified { color: var(--accent-green); font-weight: 600; margin-left: auto; }
.okf-reader-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border-color); }
.okf-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-secondary); }

/* Long-form reading typography: 16px / 1.75, high contrast, ~68ch measure */
.markdown-body { font-size: 16px; line-height: 1.75; color: #d5d8de; }
html.light .markdown-body { color: #1f2430; }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--font-heading); color: var(--text-primary); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em;
  margin: 1.8em 0 0.6em; }
.markdown-body h1 { font-size: 1.7em; }
.markdown-body h2 { font-size: 1.35em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border-color); }
.markdown-body h3 { font-size: 1.15em; }
.markdown-body h4 { font-size: 1em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.markdown-body p { margin: 0 0 1.15em; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.markdown-body li { margin-bottom: 0.5em; }
.markdown-body li::marker { color: var(--text-muted); }
.markdown-body a { color: #8ea2ff; text-decoration: none; border-bottom: 1px solid rgba(142,162,255,0.35); }
html.light .markdown-body a { color: var(--accent-primary); }
.markdown-body a:hover { border-bottom-color: currentColor; }
.markdown-body strong { color: var(--text-primary); font-weight: 700; }
.markdown-body em { color: var(--text-secondary); }
.markdown-body code { font-family: var(--font-mono); font-size: 0.86em; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 5px; padding: 0.12em 0.4em; color: #e6b673; }
.markdown-body pre { background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px 18px; overflow-x: auto; margin: 0 0 1.3em; }
.markdown-body pre code { background: none; border: none; padding: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.markdown-body blockquote { margin: 0 0 1.3em; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent-primary); color: var(--text-secondary); font-style: italic; }
.markdown-body blockquote p { margin-bottom: 0.5em; }
.markdown-body hr { border: none; border-top: 1px solid var(--border-color); margin: 2em 0; }
.markdown-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 0.5em 0 1.3em; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: 14px; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--bg-main); color: var(--text-primary); font-weight: 600; }

/* Modals */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  z-index: 200; display: none; align-items: center; justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 480px; padding: 28px; position: relative;
}

.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.modal-card h2 { font-family: var(--font-heading); font-size: 20px; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.4; }

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 16px; text-align: center;
  color: var(--text-secondary); margin-bottom: 16px; cursor: pointer;
}

.drop-zone:hover { border-color: var(--text-primary); }
.file-info { font-size: 11px; color: var(--text-muted); display: block; margin-top: 6px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.input-styled { width: 100%; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px 12px; color: var(--text-primary); font-size: 13px; outline: none; }

.modal-footer { text-align: right; }

.user-card-preview { display: flex; align-items: center; gap: 14px; background: var(--bg-main); padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 20px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.badge-status { font-size: 11px; color: var(--accent-green); display: block; margin-top: 4px; }

/* ===== Security banner / encryption explainer ===== */
.security-banner { background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px 16px; margin: 4px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.sb-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.sb-row span:first-child { font-size: 15px; }
.sb-row strong { color: var(--text-primary); }

.upload-status { margin-top: 12px; font-size: 13px; min-height: 18px; }
.drop-zone.drag { border-color: var(--accent-green); background: rgba(16,185,129,0.06); }

.gsi-note { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; text-align: center; }
#gsiButton { display: flex; justify-content: center; margin: 10px 0; }

.dash-bundles { margin-top: 18px; }
.bundle-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.bundle-row { display: flex; align-items: center; gap: 10px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px 12px; }
.bundle-row .lock { font-size: 15px; }
.bundle-meta { display: flex; flex-direction: column; }
.bundle-meta strong { font-size: 13px; color: var(--text-primary); }
.bundle-meta span { font-size: 11px; color: var(--text-muted); }
.muted-note { font-size: 12px; color: var(--text-muted); }

.graph-banner { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* ==================== LANDING PAGE — editorial "paper" (scoped to .landing) ==================== */
.okf-dot { width:7px; height:7px; border-radius:50%; background:var(--link); animation:okfpulse 2.4s infinite; }
@keyframes okfpulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.landing a:hover { color:var(--link-press); }
.okf-cap-row { display:grid; grid-template-columns:3.2rem 1fr; gap:1.4rem; padding:2rem 0; border-bottom:1px solid var(--line); }
.okf-cap-num { font-family:var(--mono); font-size:1.1rem; font-weight:500; color:var(--ink-3); padding-top:0.2rem; }
.okf-cap-tag { font-family:var(--mono); font-size:0.7rem; letter-spacing:0.1em; text-transform:uppercase; color:var(--link); }
.okf-cap-title { margin:0.5rem 0 0; font-weight:600; font-size:1.315rem; letter-spacing:-0.01em; color:var(--ink); }
.okf-cap-body { max-width:46rem; margin:0.7rem 0 0; font-size:1.02rem; line-height:1.6; color:var(--ink-2); }
/* hero product frame — auto-rotating real-interface screenshots */
.okf-shots { position:relative; aspect-ratio:1.9/1; background:var(--paper); overflow:hidden; }
.okf-shot { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; object-position:center; opacity:0; animation:okfshots 15s infinite; }
.okf-shot:nth-child(2){ animation-delay:5s; }
.okf-shot:nth-child(3){ animation-delay:10s; }
@keyframes okfshots { 0%{opacity:0} 2%{opacity:1} 30%{opacity:1} 35%{opacity:0} 100%{opacity:0} }
@media (prefers-reduced-motion: reduce) { .okf-shot{ animation:none; } .okf-shot:first-child{ opacity:1; } }
/* engine logo row (icons from eullrich.com) */
.okf-engines { display:inline-flex; align-items:center; gap:14px; }
.okf-eng { display:inline-flex; color:var(--ink); }
.okf-eng svg { width:22px; height:22px; display:block; }
@media (max-width:640px){ .okf-cap-row{ grid-template-columns:2.2rem 1fr; gap:1rem; } }


/* ============================ RECENT CHATS ============================ */
.recent-chats { margin-top: 22px; border-top: 1px solid var(--border-color); padding-top: 18px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mini-link { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 6px; }
.mini-link:hover { color: var(--accent-primary); }
.recent-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 11px 14px; cursor: pointer; color: var(--text-primary); }
.recent-item:hover { border-color: var(--border-hover); background: var(--bg-surface-hover); }
.recent-q { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ============================ KNOWLEDGE GRAPH ============================ */
.kg-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 4px 14px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.kg-ctrl { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.kg-search-wrap { flex: 1; min-width: 200px; max-width: 320px; }
.kg-search-wrap .input-styled { width: 100%; }
.kg-ctrl input[type=range] { accent-color: var(--accent-primary); }
.kg-toggles { gap: 14px; }
.kg-check { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.kg-check input { accent-color: var(--accent-primary); }

.kg-stage { position: relative; height: calc(100vh - 260px); min-height: 440px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; background:
  radial-gradient(circle at 50% 40%, rgba(99,102,241,0.06), transparent 60%), var(--bg-main); }
#kgSvg { width: 100%; height: 100%; display: block; cursor: grab; }
#kgSvg:active { cursor: grabbing; }

.kg-edge { stroke: var(--text-muted); }
.kg-sim { stroke-dasharray: 3 3; }
.kg-node .kg-gap { stroke: #f87171; stroke-width: 1.5; stroke-dasharray: 2 2; }
.kg-node.kg-match circle, .kg-node.kg-match rect { stroke: #fff; stroke-width: 2; }
.kg-cat-label { fill: var(--text-primary); font-size: 10px; font-weight: 600; font-family: var(--font-heading); pointer-events: none; paint-order: stroke; stroke: var(--bg-main); stroke-width: 3px; }

.kg-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 60%; }
.kg-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 3px 9px; border-radius: var(--radius-full);
  background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; }
.kg-leg.off { opacity: 0.4; text-decoration: line-through; }
.kg-leg-dot { width: 9px; height: 9px; border-radius: 50%; }
.kg-count { font-size: 11px; color: var(--text-muted); align-self: center; margin-left: 4px; }
.kg-hint { position: absolute; right: 12px; top: 10px; font-size: 11px; color: var(--text-muted); background: var(--bg-surface); padding: 5px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-color); max-width: 46%; }

.kg-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; background: var(--bg-surface); border-left: 1px solid var(--border-color); padding: 20px; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,0.3); }
.kg-panel-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--text-muted); font-size: 15px; cursor: pointer; }
.kg-card-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
#kgPanelBody h3 { font-family: var(--font-heading); font-size: 17px; margin: 6px 0 10px; line-height: 1.3; }
.kg-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 12px; }
.kg-gap-note { font-size: 12px; color: #f87171; margin-bottom: 10px; }
.kg-card-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.kg-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.kg-tag { font-size: 10px; padding: 2px 7px; border-radius: var(--radius-full); background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-secondary); }
.kg-card-link { display: inline-block; font-size: 13px; color: var(--accent-primary); text-decoration: none; margin-bottom: 16px; font-weight: 600; }
.kg-neigh-title { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.kg-neighbors { display: flex; flex-direction: column; gap: 4px; }
.kg-neigh { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text-secondary); font-size: 12px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.kg-neigh:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.kg-neigh-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

@media (max-width: 720px) { .kg-panel { width: 100%; } .kg-legend { max-width: 100%; } }

/* ============================ APP RESPONSIVE (mobile) ============================ */
.nav-hamburger { display: none; }
.sidebar-backdrop { display: none; position: fixed; inset: 64px 0 0 0; background: rgba(0,0,0,0.5); z-index: 89; }

@media (max-width: 768px) {
  .nav-hamburger { display: inline-flex; margin-right: 4px; }
  .header-center { display: none; }
  .header-right { gap: 8px; }
  .header-right .cta-solid span { display: none; }   /* upload: icon only */
  .brand-sep, .brand-sub { display: none; }
  .wrap-header { padding: 0 14px; }

  .sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0;
    width: 82vw; max-width: 320px; z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open { transform: none; box-shadow: 24px 0 60px rgba(0,0,0,0.4); }
  .sidebar-backdrop.show { display: block; }

  .cards-grid { grid-template-columns: 1fr; }
  .main-panel { padding-left: 16px; padding-right: 16px; }
  .okf-edit-row { grid-template-columns: 1fr; }
}

/* ============================ SIDEBAR DOC LINKS ============================ */
.doc-links { display: flex; flex-direction: column; gap: 4px; }
.doc-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 500; }
.doc-link:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.doc-link svg { color: var(--text-muted); flex-shrink: 0; }
.doc-link:hover svg { color: var(--accent-primary); }

/* delete button in bundle list */
.bundle-row .bundle-meta { flex: 1; }
.bundle-del { background: none; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: var(--radius-sm); width: 30px; height: 30px; cursor: pointer; flex-shrink: 0; font-size: 14px; }
.bundle-del:hover { border-color: #f87171; color: #f87171; background: rgba(248,113,113,0.08); }

/* ============================ EMPTY STATE (no OKF) ============================ */
.main-panel.empty .panel-view { display: none !important; }
.main-panel.empty #emptyState { display: flex !important; }
.empty-state { flex-direction: column; align-items: center; justify-content: center; text-align: center;
  height: 100%; min-height: 60vh; gap: 6px; padding: 40px 24px; }
.empty-ico { font-size: 52px; margin-bottom: 10px; opacity: 0.9; }
.empty-state h2 { font-family: var(--font-heading); font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 15px; max-width: 440px; line-height: 1.6; margin-bottom: 22px; }
.empty-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.empty-actions .cta-solid { padding: 11px 20px; font-size: 14px; }
.empty-status { margin-top: 16px; font-size: 13px; color: var(--text-muted); min-height: 18px; }

/* landing graphs use the shared renderer (dark strokes) — lighten for the light bg */
.bf-graph line, .ld-uc-visual--graph line { stroke: #CBD5E1; stroke-opacity: 0.9; }
.ld-uc-visual--graph svg { width: 100%; height: 300px; }

/* landing hero video demo */
.bf-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: none; }

/* sidebar feedback form */
.feedback-input { width: 100%; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 9px 11px; color: var(--text-primary); font-family: var(--font-body); font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 62px; outline: none; transition: border-color .15s, box-shadow .15s; }
.feedback-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.14); }
.feedback-send { width: 100%; justify-content: center; margin-top: 8px; }
.feedback-status { font-size: 11px; color: var(--accent-green); margin-top: 6px; min-height: 14px; }

/* landing entity-graph labels */
.eg-label { fill: #0f172a; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 13px; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.ld-uc-visual--graph { min-height: 340px; }
.ld-uc-visual--graph svg { height: 340px; }

/* ==================== OKF EDITOR (reader drawer) ==================== */
.okf-reader-toolbar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }
.okf-tool-btn { background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-secondary); font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: var(--radius-md); cursor: pointer; }
.okf-tool-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.okf-edit { max-width: 68ch; margin: 0 auto; }
.okf-edit-h { font-family: var(--font-heading); font-size: 20px; margin-bottom: 16px; }
.okf-edit label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 5px; }
.okf-input { width: 100%; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 9px 12px; color: var(--text-primary); font-family: var(--font-body); font-size: 14px; line-height: 1.5; outline: none; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.okf-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.okf-body { font-family: var(--font-mono); font-size: 13px; min-height: 220px; }
.okf-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.okf-verify-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px 16px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.okf-verify-state { font-size: 13px; font-weight: 600; color: var(--accent-green); }
.okf-edit-actions { display: flex; gap: 10px; align-items: center; margin: 22px 0 40px; flex-wrap: wrap; }

/* delete-material button (reader toolbar) */
.okf-tool-del:hover { border-color: #f87171; color: #f87171; background: rgba(248,113,113,0.08); }

/* ==================== EDITORIAL "PAPER" RE-SKIN — app component overrides ==================== */
/* landing h1 accent (data-i18n-html strips inline span color) */
.landing h1 span { color: var(--link); }

/* brand dot → blue pulse, no glow */
.brand .dot { box-shadow: none; animation: okfpulse 2.4s infinite; }

/* sidebar section labels → mono */
.block-title { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.14em; color: var(--ink-3); }
.nav-btn.active { border-left: 2px solid var(--link); background: var(--soft); }
.nav-btn { font-size: 0.9rem; }

/* library: hairline card grid, flat cards */
.cards-grid { gap: 1px; background: var(--line); border: 1px solid var(--line); }
.okf-card { background: var(--paper); border: none; border-radius: 0; min-height: 168px; transition: background 0.15s; }
.okf-card:hover { transform: none; background: var(--soft); box-shadow: none; border-color: transparent; }
.okf-type-tag { font-family: var(--mono); background: none; padding: 0; color: var(--link); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.1em; }
.okf-domain-tag { font-family: var(--mono); font-size: 0.7rem; }
.okf-card-title { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.okf-card-foot { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }
.okf-card-foot span:first-child { color: var(--ink-3); font-weight: 400; }

/* search kbd → mono */
.search-kbd { font-family: var(--mono); background: var(--paper); }

/* tag pills → mono */
.t-tag { font-family: var(--mono); font-size: 0.68rem; }

/* chat: mono AI avatar, hairline bubbles, no gradient */
.bot-msg .msg-author { background: var(--ink); font-family: var(--mono); }
.bot-msg .msg-author::before { content: 'AI'; font-size: 0.62rem; color: var(--paper); }
.bot-msg .msg-txt { background: var(--paper); border-radius: 2px 10px 10px 10px; }
.user-msg { background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 10px 10px 2px 10px; font-weight: 400; }
.chat-bar input:focus { box-shadow: none; border-color: var(--ink); }
.chat-bar input, .chat-bar .cta-solid { border-radius: 6px; }

/* reader body ink */
.markdown-body { color: var(--ink); }

/* focus rings → ink hairline, not indigo glow */
.search-box input:focus { border-color: var(--ink); }

/* ==================== IMPORT WIZARD (upload modal) ==================== */
.imp-mode { display:flex; gap:4px; padding:4px; background:var(--soft); border-radius:6px; margin-bottom:16px; }
.imp-tab { flex:1; border:none; background:transparent; padding:9px 12px; border-radius:4px; font-family:var(--font-body); font-size:0.85rem; font-weight:500; color:var(--ink-2); cursor:pointer; }
.imp-tab.active { background:var(--paper); color:var(--ink); font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.imp-sources { margin-bottom:16px; }
.imp-chips { display:flex; flex-wrap:wrap; gap:6px; }
.imp-chip { border:1px solid var(--line); background:var(--paper); color:var(--ink-2); padding:6px 13px; border-radius:999px; font-family:var(--mono); font-size:0.72rem; cursor:pointer; }
.imp-chip:hover { border-color:var(--ink-3); }
.imp-chip.active { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.imp-hint { margin:11px 2px 0; font-size:0.82rem; line-height:1.5; color:var(--ink-2); }

/* ==================== LANDING documentation sitemap ==================== */
.ld-sitemap { max-width:var(--maxw-wide); margin:0 auto; padding:clamp(2.5rem,6vw,4rem) var(--gutter) 0; display:grid; grid-template-columns:repeat(4,1fr); gap:24px 20px; }
.ld-sitemap .sm-col { display:flex; flex-direction:column; gap:8px; }
.ld-sitemap .sm-head { font-family:var(--mono); font-size:0.66rem; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-3); margin-bottom:4px; }
.ld-sitemap a { color:var(--ink-2); font-size:0.9rem; }
.ld-sitemap a:hover { color:var(--ink); }
.ld-sitemap .sm-soon { color:var(--ink-3); font-size:0.9rem; opacity:.55; cursor:default; }
@media (max-width:720px) { .ld-sitemap { grid-template-columns:1fr 1fr; } }
