/* ============================================================
   Smol Wiki — Search / Retrieve / View Article (MVP1)
   (see spec/DESIGN_STYLE_GUIDE.md, approved 2026-10-10)
   ============================================================ */

html, body{ margin:0; padding:0; }

#research-app{
  --rw-ground:#F4F6F3;
  --rw-surface:#FFFFFF;
  --rw-surface-2:#EEF2EC;
  --rw-ink:#16211C;
  --rw-muted:#5C6B60;
  --rw-muted-2:#8A978E;
  --rw-accent:#27594A;
  --rw-accent-ink:#163A30;
  --rw-accent-soft:#DCE8E1;
  --rw-line:#DCE3DD;
  --rw-line-strong:#C7D1C8;
  --rw-focus:#2E7D64;
  --rw-shadow:rgba(22,33,28,0.10);
  --rw-type-concept:#2E7D64;
  --rw-type-entity:#9C6B3F;
  --rw-type-project:#4E6E8C;
  --rw-type-full-article:#8B5A8C;

  --rw-font-display:"Space Grotesk",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --rw-font-body:"Source Sans Pro","Source Sans 3",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --rw-font-mono:ui-monospace,"SF Mono","Cascadia Code","Roboto Mono",Menlo,Consolas,monospace;

  display:block; min-height:100vh; background:var(--rw-ground); color:var(--rw-ink);
  font-family:var(--rw-font-body);
  -webkit-font-smoothing:antialiased;
}

@media (prefers-color-scheme: dark){
  #research-app{
    --rw-ground:#10160F; --rw-surface:#171F19; --rw-surface-2:#1D2821;
    --rw-ink:#E8EDE9; --rw-muted:#A9B6AC; --rw-muted-2:#79897F;
    --rw-accent:#74C2A2; --rw-accent-ink:#E2F0EA; --rw-accent-soft:#213A31;
    --rw-line:#283530; --rw-line-strong:#374A41; --rw-focus:#74C2A2;
    --rw-shadow:rgba(0,0,0,0.45);
    --rw-type-concept:#74C2A2; --rw-type-entity:#D1A26E; --rw-type-project:#8FB2D6; --rw-type-full-article:#C295C3;
  }
}

#research-app *{ box-sizing:border-box; }
#research-app h1, #research-app h2, #research-app h3, #research-app h4{
  margin:0; font-family:var(--rw-font-display); font-weight:700; text-wrap:balance;
}
#research-app p{ margin:0; }
#research-app button{ font-family:inherit; }
#research-app :focus-visible{ outline:2px solid var(--rw-focus); outline-offset:2px; border-radius:4px; }

@media (prefers-reduced-motion: reduce){
  #research-app *{ transition:none !important; animation:none !important; }
}

.rw-shell{ max-width:960px; margin:0 auto; min-height:100%; display:flex; flex-direction:column; }

/* ---------- top bar ---------- */
.rw-topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 20px; border-bottom:1px solid var(--rw-line);
}
.rw-topbar-left{ display:flex; align-items:center; gap:10px; position:relative; }
.rw-topbar-right{ display:flex; align-items:center; gap:16px; }
.rw-wordmark{ font-family:var(--rw-font-display); font-weight:700; font-size:0.95rem; }
.rw-doc-count{ font-size:0.78rem; color:var(--rw-muted-2); font-variant-numeric:tabular-nums; }

.rw-icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%; border:none;
  background:transparent; color:var(--rw-ink); cursor:pointer;
}
.rw-icon-btn:hover{ background:var(--rw-surface-2); }

.rw-menu-dropdown{
  display:none; position:absolute; top:calc(100% + 8px); left:0; min-width:180px;
  background:var(--rw-surface); border:1px solid var(--rw-line); border-radius:12px;
  box-shadow:0 8px 24px var(--rw-shadow); padding:6px; z-index:20;
}
.rw-menu-dropdown.open{ display:block; }
.rw-menu-item{
  display:block; width:100%; text-align:left; padding:10px 12px; border:none;
  background:none; border-radius:8px; font-size:0.88rem; color:var(--rw-ink); cursor:pointer;
}
.rw-menu-item:hover{ background:var(--rw-surface-2); }
.rw-menu-divider{ border-top:1px solid var(--rw-line); margin:6px 0; }

.rw-topbar-link{
  border:none; background:none; padding:0; font:inherit; cursor:pointer;
  font-size:0.78rem; color:var(--rw-muted-2); text-decoration:none;
}
.rw-topbar-link:hover{ color:var(--rw-muted); text-decoration:underline; text-decoration-color:var(--rw-line-strong); }

.rw-avatar{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:50%; cursor:default;
  background:transparent; border:1.5px dashed var(--rw-line-strong); color:var(--rw-muted-2);
}
.rw-avatar:hover{ color:var(--rw-muted); border-color:var(--rw-muted-2); }

@media (max-width:480px){
  .rw-doc-count, .rw-topbar-link{ display:none; }
}

/* ---------- footer ---------- */
.rw-footer{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 20px; border-top:1px solid var(--rw-line);
  font-size:0.74rem; color:var(--rw-muted-2);
}
.rw-footer-link{ color:inherit; text-decoration:none; }
.rw-footer-link:hover{ color:var(--rw-muted); text-decoration:underline; text-decoration-color:var(--rw-line-strong); }
.rw-footer-version{ font-family:var(--rw-font-mono); font-variant-numeric:tabular-nums; }

.rw-screen{ display:none; }
#research-app[data-screen="topics"] .rw-screen-topics{ display:block; }
#research-app[data-screen="ingest-log"] .rw-screen-ingest-log{ display:block; }
#research-app[data-screen="search"] .rw-screen-search{ display:block; }
#research-app[data-screen="ask"] .rw-screen-ask{ display:block; }
#research-app[data-screen="related"] .rw-screen-results{ display:block; }
#research-app[data-screen="article"] .rw-screen-article{ display:block; }
#research-app[data-screen="graph"] .rw-screen-graph{ display:flex; }

/* ---------- topics (browse by tag) screen ---------- */
.rw-screen-topics{ padding:8px 20px 0; }
.rw-topics-col{ max-width:960px; margin:0 auto; width:100%; padding-bottom:48px; }

.rw-topics-search{
  display:flex; align-items:center; gap:10px;
  background:var(--rw-surface-2); border:1.5px solid transparent; border-radius:999px;
  padding:12px 18px; margin-bottom:20px; transition:border-color 120ms ease;
}
.rw-topics-search:focus-within{ border-color:var(--rw-focus); background:var(--rw-surface); }
.rw-topics-search svg{ flex:none; color:var(--rw-muted-2); }
.rw-topics-search input{
  flex:1; border:none; background:transparent; outline:none; color:var(--rw-ink);
  font-size:0.92rem; font-family:var(--rw-font-body);
}
.rw-topics-search input::placeholder{ color:var(--rw-muted-2); }

.rw-topic-pills{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:28px; }
.rw-topic-pill{
  padding:9px 16px; border-radius:999px; border:1px solid var(--rw-line);
  background:var(--rw-surface); color:var(--rw-muted); font-size:0.82rem; cursor:pointer;
}
.rw-topic-pill:hover{ border-color:var(--rw-line-strong); color:var(--rw-ink); }
.rw-topic-pill.active{ background:var(--rw-accent); border-color:var(--rw-accent); color:var(--rw-surface); }

.rw-topic-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.rw-topic-grid .rw-result-card{ margin-bottom:0; height:100%; }
@media (max-width:860px){ .rw-topic-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .rw-topic-grid{ grid-template-columns:1fr; } }
.rw-topic-grid .rw-empty{ grid-column:1 / -1; }

/* ---------- ingest log screen ---------- */
.rw-screen-ingest-log{ padding:20px 20px 48px; }
.rw-log-col{ max-width:680px; margin:0 auto; width:100%; }
.rw-log-title{ font-size:1.4rem; margin-bottom:6px; }
.rw-log-summary{ font-size:0.85rem; color:var(--rw-muted); margin-bottom:24px; }
.rw-log-list{ display:flex; flex-direction:column; gap:10px; }

.rw-log-entry{ background:var(--rw-surface); border:1px solid var(--rw-line); border-radius:12px; overflow:hidden; }
.rw-log-entry-head{
  display:flex; align-items:center; gap:10px; width:100%; padding:14px 18px;
  background:none; border:none; cursor:pointer; text-align:left; font:inherit; color:inherit;
}
.rw-log-entry-head:hover{ background:var(--rw-surface-2); }
.rw-log-date{ font-family:var(--rw-font-mono); font-size:0.85rem; font-weight:600; }
.rw-log-count{ font-size:0.8rem; color:var(--rw-muted); flex:1; }
.rw-log-chevron{ flex:none; color:var(--rw-muted-2); transition:transform 150ms ease; }
.rw-log-entry.open .rw-log-chevron{ transform:rotate(90deg); }

.rw-log-entry-body{ display:none; padding:0 18px 14px; }
.rw-log-entry.open .rw-log-entry-body{ display:block; }
.rw-log-article{ font-size:0.86rem; color:var(--rw-ink); padding:8px 0; border-top:1px solid var(--rw-line); }
.rw-log-article:first-child{ border-top:none; }

/* ---------- search screen ---------- */
.rw-screen-search{ padding:64px 20px 48px; }
.rw-hero{ display:flex; flex-direction:column; align-items:center; gap:14px; text-align:center; }
.rw-hero-icon{ color:var(--rw-accent); }
.rw-hero h1{ font-size:2.1rem; line-height:1.15; max-width:16ch; }
.rw-hero p{ color:var(--rw-muted); font-size:0.95rem; max-width:42ch; }

.rw-search-wrap{ position:relative; margin:32px auto 0; max-width:680px; }
.rw-search-pill{
  display:flex; align-items:center; gap:10px;
  background:var(--rw-surface-2); border:1.5px solid transparent; border-radius:999px;
  padding:6px 8px 6px 22px; transition:border-color 120ms ease;
}
.rw-search-pill:focus-within{ border-color:var(--rw-focus); background:var(--rw-surface); }
.rw-search-pill input{
  flex:1; border:none; background:transparent; outline:none; color:var(--rw-ink);
  font-size:1rem; font-family:var(--rw-font-body); padding:12px 0;
}
.rw-search-pill input::placeholder{ color:var(--rw-muted-2); }
.rw-clear-input{
  width:28px; height:28px; flex:none; border-radius:50%; border:none;
  background:transparent; color:var(--rw-muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.rw-clear-input:hover{ color:var(--rw-ink); }
.rw-send{
  width:38px; height:38px; flex:none; border-radius:50%; border:none;
  background:var(--rw-accent); color:var(--rw-surface); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.rw-send:hover{ background:var(--rw-accent-ink); }

.rw-autocomplete{
  position:absolute; top:calc(100% + 6px); left:0; right:0;
  background:var(--rw-surface); border:1px solid var(--rw-line); border-radius:16px;
  box-shadow:0 8px 24px var(--rw-shadow); overflow:hidden; z-index:20;
}
.rw-autocomplete-item{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  padding:10px 16px; border:none; background:none; cursor:pointer;
  font-size:0.9rem; color:var(--rw-ink); font-family:var(--rw-font-body);
}
.rw-autocomplete-item:hover, .rw-autocomplete-item.active{ background:var(--rw-surface-2); }

.rw-hint{ max-width:680px; margin:10px auto 0; font-size:0.8rem; color:var(--rw-muted-2); text-align:center; }

.rw-section{ max-width:680px; margin:40px auto 0; }
.rw-section-label{ font-weight:700; font-size:0.9rem; margin-bottom:12px; color:var(--rw-muted); }
.rw-chip-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width:560px){ .rw-chip-grid{ grid-template-columns:1fr; } }
.rw-chip{
  display:flex; align-items:center; gap:10px; width:100%; padding:13px 14px;
  border-radius:11px; font-size:0.86rem; text-align:left; cursor:pointer;
  color:var(--rw-ink); background:var(--rw-surface-2); border:1px solid transparent;
}
.rw-chip:hover{ background:var(--rw-accent-soft); }

.rw-type-dot{ width:8px; height:8px; border-radius:50%; flex:none; }
.rw-type-dot.concept{ background:var(--rw-type-concept); }
.rw-type-dot.entity{ background:var(--rw-type-entity); }
.rw-type-dot.project{ background:var(--rw-type-project); }
.rw-type-dot.full-article{ background:var(--rw-type-full-article); }

.rw-chip.recent{ background:var(--rw-surface); border-color:var(--rw-line); }
.rw-chip.recent:hover{ background:var(--rw-surface-2); border-color:var(--rw-line-strong); }
.rw-chip.recent .rw-chip-icon{ flex:none; color:var(--rw-muted-2); }
.rw-chip-text{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rw-chip-dismiss{
  flex:none; display:flex; color:var(--rw-muted-2); border-radius:50%; padding:3px; margin:-3px -3px -3px 0;
}
.rw-chip-dismiss:hover{ color:var(--rw-ink); background:var(--rw-accent-soft); }

/* ---------- results screen ---------- */
.rw-screen-results{ padding:20px 20px 48px; }
.rw-results-col{ max-width:680px; margin:0 auto; }
.rw-results-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; gap:12px; flex-wrap:wrap; }
.rw-results-head h2{ font-size:1.3rem; }
.rw-new-search{
  border:none; background:none; color:var(--rw-accent-ink); font-size:0.82rem;
  cursor:pointer; text-decoration:underline; text-decoration-color:var(--rw-line-strong);
}
.rw-new-search:hover{ text-decoration-color:var(--rw-accent); }
.rw-results-count{ font-size:0.82rem; color:var(--rw-muted); }

.rw-result-card{
  display:block; width:100%; text-align:left; background:var(--rw-surface);
  border:1px solid var(--rw-line); border-radius:12px; padding:16px 18px;
  cursor:pointer; margin-bottom:10px;
}
.rw-result-card:hover{ border-color:var(--rw-line-strong); }
.rw-result-top{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.rw-result-type{
  font-family:var(--rw-font-mono); font-size:0.7rem; color:var(--rw-muted-2); text-transform:lowercase;
}
.rw-result-title{ font-family:var(--rw-font-display); font-size:1.05rem; font-weight:700; margin-bottom:4px; }
.rw-result-snippet{ font-size:0.86rem; color:var(--rw-muted); line-height:1.5; margin-bottom:8px; }
.rw-result-tags{ display:flex; flex-wrap:wrap; gap:6px; }
.rw-tag{ font-size:0.72rem; background:var(--rw-surface-2); color:var(--rw-accent-ink); border-radius:999px; padding:3px 9px; }

.rw-empty{ text-align:center; padding:60px 20px; color:var(--rw-muted); }
.rw-empty strong{ display:block; color:var(--rw-ink); font-family:var(--rw-font-display); font-size:1.1rem; margin-bottom:6px; }
.rw-empty-inline{ font-size:0.92rem; line-height:1.6; color:var(--rw-muted); }

/* ---------- article screen ---------- */
.rw-screen-article{ padding:8px 20px 0; }
.rw-article-subbar{ display:flex; align-items:center; gap:8px; padding:10px 0; }
.rw-back{
  display:inline-flex; align-items:center; gap:6px; border:none; background:none;
  color:var(--rw-muted); font-size:0.85rem; cursor:pointer; padding:6px 4px;
}
.rw-back:hover{ color:var(--rw-ink); }

.rw-article-layout{ display:grid; grid-template-columns:1fr; gap:0; align-items:start; }
.rw-article-col{ max-width:680px; margin:0 auto; width:100%; padding-bottom:80px; }

.rw-article-meta-row{
  font-family:var(--rw-font-mono); font-size:0.74rem; color:var(--rw-muted-2);
  display:flex; flex-wrap:wrap; gap:4px 12px; margin:14px 0 6px;
}
.rw-article-type{ color:var(--rw-accent-ink); text-transform:lowercase; }
#research-app .rw-article-col h3{ font-size:1.7rem; line-height:1.2; margin-bottom:14px; }
.rw-article-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:24px; }

.rw-article-source{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:12px 16px; margin-bottom:24px; border-radius:10px;
  background:var(--rw-surface-2); font-size:0.86rem;
}
.rw-article-source-link{ color:var(--rw-accent-ink); font-weight:600; text-decoration:none; }
.rw-article-source-link:hover{ text-decoration:underline; }
.rw-article-source-author{ color:var(--rw-muted); }

#research-app .rw-body h2, #research-app .rw-body h3, #research-app .rw-body h4{ font-family:var(--rw-font-body); font-weight:700; }
#research-app .rw-body h2{ font-size:1.15rem; margin:1.7em 0 0.5em; }
#research-app .rw-body h3{ font-size:1.08rem; margin:1.5em 0 0.5em; }
#research-app .rw-body h4{ font-size:1rem; margin:1.3em 0 0.4em; }
#research-app .rw-body h2:first-child, #research-app .rw-body h3:first-child, #research-app .rw-body h4:first-child{ margin-top:0; }
#research-app .rw-body p{ font-size:0.95rem; line-height:1.65; margin-bottom:1.65em; }
.rw-body ul, .rw-body ol{ margin:0 0 1.65em; padding-left:22px; display:flex; flex-direction:column; gap:0.5em; }
.rw-body li{ font-size:0.95rem; line-height:1.6; }

.rw-related-cta-row{ margin-top:8px; padding-bottom:48px; }
.rw-related-cta{
  padding:11px 20px; border-radius:10px; border:1px solid var(--rw-line-strong);
  background:var(--rw-surface); color:var(--rw-ink); font-size:0.85rem; font-weight:600;
  cursor:pointer;
}
.rw-related-cta:hover{ border-color:var(--rw-accent); color:var(--rw-accent-ink); }

.wikilink{
  appearance:none; background:none; border:none; padding:1px 3px; margin:0 -3px;
  color:var(--rw-accent-ink); text-decoration:underline; text-decoration-color:var(--rw-line-strong);
  text-underline-offset:2px; cursor:pointer; font:inherit; border-radius:4px;
}
.wikilink:hover{ text-decoration-color:var(--rw-accent); background:var(--rw-accent-soft); }
.wikilink-unresolved{
  color:var(--rw-muted); text-decoration:underline; text-decoration-style:dashed;
  text-decoration-color:var(--rw-line-strong); text-underline-offset:2px;
}

/* ---------- preview split-pane ---------- */
.rw-pane-backdrop{ display:none; }
.rw-preview-wrap{ display:none; }

@media (min-width:860px){
  .rw-split-layout.pane-open{ grid-template-columns:minmax(0,1fr) 320px; gap:28px; }
  .rw-split-layout.pane-open .rw-article-col,
  .rw-split-layout.pane-open .rw-ask-col{ margin:0; }
  .rw-split-layout.pane-open .rw-preview-wrap{ display:block; position:sticky; top:16px; }
}
@media (max-width:859px){
  .rw-split-layout.pane-open .rw-pane-backdrop{
    display:block; position:fixed; inset:0; background:rgba(16,22,15,0.35); z-index:10;
  }
  .rw-split-layout.pane-open .rw-preview-wrap{
    display:block; position:fixed; top:0; right:0; bottom:0; width:min(86vw,360px);
    z-index:11; overflow-y:auto; box-shadow:-12px 0 32px var(--rw-shadow);
  }
}

/* ---------- ask (conversational) screen ---------- */
.rw-screen-ask{ padding:8px 20px 0; }
.rw-ask-layout{ display:grid; grid-template-columns:1fr; gap:0; align-items:start; }
.rw-ask-col{ max-width:680px; margin:0 auto; width:100%; padding-bottom:32px; }

.rw-new-question{
  margin-left:auto; border:none; background:none; color:var(--rw-muted); font-size:0.85rem;
  cursor:pointer; padding:6px 4px;
}
.rw-new-question:hover{ color:var(--rw-ink); }

.rw-q-bubble-row{ display:flex; justify-content:flex-end; margin:10px 0 16px; }
.rw-q-bubble{
  background:var(--rw-surface-2); color:var(--rw-ink); border-radius:16px;
  padding:10px 16px; font-size:0.92rem; line-height:1.45; max-width:80%;
}

.rw-sources-chip{
  display:flex; align-items:center; gap:10px; width:100%; margin-bottom:22px;
  padding:10px 14px; border-radius:11px; font-size:0.82rem; text-align:left; cursor:pointer;
  color:var(--rw-muted); background:var(--rw-surface-2); border:1px solid transparent;
}
.rw-sources-chip:hover{ background:var(--rw-accent-soft); color:var(--rw-ink); }
.rw-sources-chip .rw-dot-stack{ display:flex; flex:none; }
.rw-sources-chip .rw-dot-stack .rw-type-dot{
  width:10px; height:10px; margin-left:-4px; border:1.5px solid var(--rw-surface-2);
}
.rw-sources-chip .rw-dot-stack .rw-type-dot:first-child{ margin-left:0; }
.rw-sources-chip-chevron{ margin-left:auto; flex:none; color:var(--rw-muted-2); }

.rw-continue-reading{
  display:inline-block; margin:2px 0 22px; padding:0; border:none; background:none;
  color:var(--rw-accent-ink); font-size:0.88rem; font-weight:600; cursor:pointer;
  text-decoration:underline; text-decoration-color:var(--rw-line-strong); text-underline-offset:3px;
}
.rw-continue-reading:hover{ text-decoration-color:var(--rw-accent); }
.rw-continue-reading:empty{ display:none; }

.rw-suggestion-row{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 26px; }
.rw-suggestion-row:empty{ display:none; }
.rw-suggestion-chip{
  padding:9px 15px; border-radius:999px; border:1px solid var(--rw-line);
  background:var(--rw-surface); color:var(--rw-accent-ink); font-size:0.82rem;
  cursor:pointer;
}
.rw-suggestion-chip:hover{ background:var(--rw-accent-soft); border-color:var(--rw-accent-soft); }

.rw-followup{
  margin:28px auto 0; max-width:680px; display:flex; align-items:center; gap:10px;
  background:var(--rw-surface-2); border:1.5px solid transparent; border-radius:999px;
  padding:4px 6px 4px 18px; transition:border-color 120ms ease;
}
.rw-followup:focus-within{ border-color:var(--rw-focus); background:var(--rw-surface); }
.rw-followup input{
  flex:1; border:none; background:transparent; outline:none; color:var(--rw-ink);
  font-size:0.92rem; font-family:var(--rw-font-body); padding:10px 0;
}
.rw-followup input::placeholder{ color:var(--rw-muted-2); }

.rw-preview{ background:var(--rw-surface); border:1px solid var(--rw-line); border-radius:14px; padding:20px; }
.rw-preview-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.rw-preview-tag{ font-family:var(--rw-font-mono); font-size:0.7rem; color:var(--rw-muted); }
.rw-preview-close{ background:none; border:none; color:var(--rw-muted); cursor:pointer; padding:4px; display:flex; }
.rw-preview-close:hover{ color:var(--rw-ink); }
.rw-preview h4{ font-size:1.2rem; margin-bottom:8px; }
.rw-preview-meta{
  font-family:var(--rw-font-mono); font-size:0.7rem; color:var(--rw-muted-2);
  margin-bottom:14px; line-height:1.6;
}
.rw-preview-snippet{ font-size:0.85rem; line-height:1.6; color:var(--rw-ink); margin-bottom:18px; }
.rw-preview-open{
  width:100%; padding:11px; border-radius:10px; border:1px solid var(--rw-line-strong);
  background:var(--rw-surface); color:var(--rw-ink); font-size:0.85rem; font-weight:600;
  cursor:pointer; text-align:center;
}
.rw-preview-open:hover{ border-color:var(--rw-accent); color:var(--rw-accent-ink); }

/* Thinking/Loading Animation */
.rw-thinking{
  display:flex; align-items:center; gap:4px; color:var(--rw-muted);
  font-size:1rem; line-height:1.5;
}

.rw-dot{
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background-color:var(--rw-muted);
  animation:rw-dot-blink 1.4s infinite;
}
.rw-dot:nth-child(2){ animation-delay:0.2s; }
.rw-dot:nth-child(3){ animation-delay:0.4s; }

@keyframes rw-dot-blink{
  0%, 60%, 100%{ opacity:0.4; }
  30%{ opacity:1; }
}

/* ---------- graph view screen ---------- */
.rw-screen-graph{
  flex-direction:column; padding:0; height:100vh;
}

.rw-screen-graph .rw-article-subbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; border-bottom:1px solid var(--rw-line);
  flex:none;
}

#rw-graph-canvas{
  align-self:center; margin-top:24px; background:var(--rw-ground);
  cursor:grab; display:block;
}

#rw-graph-canvas.panning{ cursor:grabbing; }

.rw-graph-legend{
  display:flex; gap:12px; align-items:center; flex-wrap:wrap; padding:0;
}

.rw-graph-legend-item{
  display:flex; gap:6px; align-items:center; font-size:0.85rem; color:var(--rw-muted);
}

.rw-graph-legend-dot{
  width:8px; height:8px; border-radius:50%; flex:none; background:#58544e;
}

.rw-graph-controls{
  display:flex; gap:8px; align-items:center;
}

.rw-zoom-btn{
  background:var(--rw-surface); border:1px solid var(--rw-line); color:var(--rw-muted);
  cursor:pointer; padding:6px 12px; border-radius:4px; font-size:0.85rem;
  transition:all 140ms ease;
}

.rw-zoom-btn:hover{ background:var(--rw-ground); color:var(--rw-ink); }

.rw-zoom-level{
  font-size:0.85rem; color:var(--rw-muted); min-width:50px; text-align:center;
}
