:root {
  --bg: #fafaf8;
  --bg-hover: #f3f3f1;
  --bg-raised: #f7f7f5;
  --panel: #ffffff;
  --panel-soft: #f9f9f9;
  --surface: #ffffff;
  --surface-hover: #f6f6f4;
  --surface-disabled: #ececeb;
  --ink: #1d1d1f;
  --ink-hover: #101012;
  --ink-secondary: #6b6b6b;
  --muted: #8a8a8e;
  --line: #e5e5e5;
  --line-soft: #efefef;
  --border: #e5e5e5;
  --border-hover: #d7d7d3;
  --primary: #0d7c5f;
  --primary-soft: rgba(13, 124, 95, 0.08);
  --primary-hover: #0a6a51;
  --nav-bg: #f4f4f2;
  --placeholder: #9a9aa0;
  --text-dim: #445468;
  --yes-bg: #e6f4ea;
  --yes-ink: #1e7e3e;
  --maybe-bg: #fef3cd;
  --maybe-ink: #7c5a20;
  --no-bg: #fde8e8;
  --no-ink: #8b3e3e;
  --neutral-bg: #f0f0ee;
  --neutral-ink: #6b6b6b;
  --accent: #3b6bc4;
  --radius: 6px;
  --radius-lg: 8px;
  --speed: 120ms;
  --bg-top: var(--bg);
  --bg-bottom: var(--bg);
  --primary-dark: var(--primary-hover);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  letter-spacing: -0.011em;
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* ── Compact Header (Dark) ── */
.hero-compact {
  background: #1a1a2e;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-compact h1 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.auth-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.auth-btn:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn-primary {
  border-color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.2);
}

.auth-btn-ghost {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}

.auth-user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 0.22rem 0.46rem;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
}

.idea-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: #f7f7fb;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.idea-cart-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.idea-cart-btn:active {
  transform: translateY(0);
}

.idea-cart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.idea-cart-wordmark {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.idea-cart-count {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.08rem 0.32rem;
  font-size: 0.62rem;
  min-width: 1.45rem;
  text-align: center;
}

.lang-select {
  font-size: 0.76rem;
  padding: 0.18rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.hero-date {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* ── Filter Bar ── */
.filter-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex: 0 0 auto;
}

.filter-item select {
  width: auto;
  min-width: 78px;
  padding: 0.32rem 0.4rem;
  font-size: 0.84rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.filter-search {
  flex: 1;
  min-width: 100px;
}

.filter-search input {
  width: 100%;
  padding: 0.32rem 0.5rem;
  font-size: 0.84rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.filter-search input:focus,
.filter-item select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.filter-gear {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.32rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  transition: background var(--speed) ease;
}

.filter-gear:hover {
  background: var(--bg-hover);
}

.content-tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.5rem 1rem 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}

.content-tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.content-tab.active {
  color: var(--ink);
  border-color: #c8d2cf;
  background: #f2f7f5;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  margin-left: 0.22rem;
  padding: 0 0.24rem;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  font-size: 0.66rem;
}

/* ── Advanced Section ── */
.advanced-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem 1rem 0.6rem;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.advanced-section.hidden {
  display: none;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.76rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

select,
input[type="text"] {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 0.45rem;
  font-size: 0.84rem;
  background: var(--panel);
  color: var(--ink);
}

.toggle-row {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--speed) ease;
}

.toggle-pill:hover {
  background: var(--bg-hover);
}

.toggle-pill input {
  margin: 0;
}

.action-button {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  padding: 0.38rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.45rem;
}

.action-button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

.action-button.primary:hover {
  filter: brightness(1.06);
}

.action-button.secondary {
  color: var(--ink-secondary);
  background: var(--neutral-bg);
}

.action-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.llm-copy-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--primary);
  background: var(--panel);
  margin-top: 0;
  transition: background var(--speed) ease;
}

.llm-copy-btn:hover {
  background: var(--primary-soft);
}

/* ── View Toggle Group ── */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-left: 0.15rem;
}

.view-toggle-group .view-btn {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--line);
}

.view-toggle-group .view-btn:last-child {
  border-right: none;
}

.view-btn--graph {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem 0.22rem 0.38rem;
}

.vbg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.vbg-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.vbg-count {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 0 0.3rem;
  line-height: 1.45;
  min-width: 1.1rem;
  text-align: center;
}

.view-btn--graph.active .vbg-dot {
  background: #fff;
}

.view-btn--graph.active .vbg-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@keyframes graph-btn-pulse {

  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(13, 124, 95, 0.15);
  }

  50% {
    box-shadow: inset 0 0 0 20px rgba(13, 124, 95, 0.06);
  }
}

.view-btn--graph.pulse {
  animation: graph-btn-pulse 1.5s ease-in-out 3;
}

/* ── Result Bar ── */
.result-bar {
  max-width: 1180px;
  margin: 0.45rem auto 0.25rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.result-summary {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.result-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.view-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0.22rem 0.42rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.view-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.view-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: #ececec;
}

.sort-inline select {
  padding: 0.22rem 0.35rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* ── List Wrapper ── */
.list-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
}

.list-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

/* ── List View Items ── */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  transition: background var(--speed) ease, border-color var(--speed) ease;
  opacity: 0;
  transform: translateY(4px);
  animation: fadeInUp 250ms ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--bg-hover);
  border-left-color: var(--primary);
}

.list-item.selected {
  background: var(--bg-hover);
  border-left: 2px solid var(--primary);
}

.news-item {
  border-left: 2px solid #d7e8e2;
}

.news-feed-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-feed-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.news-feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  background: #fafcfc;
}

.news-feed-head h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1f2a36;
}

.news-feed-head p {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: #64707b;
}

.news-feed-body {
  display: flex;
  flex-direction: column;
}

.news-feed-body .list-item:last-child {
  border-bottom: none;
}

.news-quick-grid {
  margin-top: 0.24rem;
  border: 1px solid #ebefed;
  border-radius: 8px;
  background: #fcfdfc;
  overflow: hidden;
}

.news-quick-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: start;
  gap: 0.35rem;
  padding: 0.26rem 0.45rem;
  border-top: 1px solid #f0f2f1;
}

.news-quick-row:first-child {
  border-top: none;
}

.news-quick-row span {
  font-size: 0.66rem;
  color: #64707b;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.news-quick-row p {
  margin: 0;
  font-size: 0.72rem;
  color: #2f3f4e;
  line-height: 1.34;
}

.news-summary-dynamic {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  white-space: normal;
  text-wrap: pretty;
  max-height: none;
}

.paper-checkbox {
  margin-top: 0.35rem;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.list-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  min-width: 0;
}

.list-spacer {
  flex: 1;
}

.list-meta-row {
  margin-top: 0.22rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  overflow: visible;
}

.list-dots {
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 1px;
}

.badge-cat {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--neutral-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-inline {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.08rem 0.32rem;
  border-radius: 3px;
}

.meta-label {
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-inline.code-yes {
  background: var(--yes-bg);
  color: var(--yes-ink);
}

.badge-inline.code-no {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

.list-orig-title {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: #7a8da0;
  line-height: 1.25;
  font-style: italic;
}

.list-summary {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
}

.abstract-preview {
  color: #2f4a63;
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-1 {
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  -webkit-line-clamp: 3;
}

.line-clamp-4 {
  -webkit-line-clamp: 4;
}


.list-expand {
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.3rem;
  flex-shrink: 0;
  align-self: center;
  transition: color var(--speed) ease, transform 200ms ease;
  border-radius: var(--radius);
}

.list-expand:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.list-expand.expanded {
  transform: rotate(180deg);
}

/* ── List Detail (expanded) ── */
.list-detail-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 200ms ease;
}

.list-detail-wrap.open {
  grid-template-rows: 1fr;
}

.list-detail-wrap>.list-detail {
  overflow: hidden;
}

.list-detail {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
}


.detail-section {
  margin-bottom: 0.55rem;
}

.detail-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #7a8da0;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-text {
  margin: 0;
  font-size: 0.82rem;
  color: #2f4a63;
  line-height: 1.55;
}

.detail-list {
  margin: 0;
  padding-left: 1rem;
  color: #2f4a63;
  font-size: 0.8rem;
  line-height: 1.52;
}

.detail-list li {
  margin-bottom: 0.22rem;
}

.detail-list-compact {
  margin-top: 0.55rem;
}

.metric-fact-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.metric-fact-head {
  font-size: 0.79rem;
  font-weight: 600;
  color: #1f3248;
  line-height: 1.35;
}

.metric-fact-meta {
  font-size: 0.72rem;
  color: #5f7389;
  line-height: 1.35;
}

.detail-text-muted {
  color: var(--muted);
}

.detail-grid {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 0.55rem;
}

.detail-meta-stack {
  display: grid;
  gap: 0.5rem;
}

.detail-section-evidence,
.detail-section-meta {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fcfcfb;
  padding: 0.52rem 0.58rem;
  margin-bottom: 0;
}

.detail-section-metric {
  margin-top: 0.35rem;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  padding: 0.32rem 0.4rem;
}

.detail-label-inline {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.evidence-quote-list {
  margin-top: 0.28rem;
  display: grid;
  gap: 0.38rem;
}

.evidence-quote-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0.42rem 0.5rem;
}

.evidence-quote-head {
  display: flex;
  align-items: center;
  gap: 0.26rem;
}

.evidence-claim {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4c6a86;
}

.evidence-section {
  font-size: 0.65rem;
  color: var(--muted);
  background: #f3f3f1;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.06rem 0.33rem;
}

.evidence-conf {
  margin-left: auto;
  font-size: 0.64rem;
  color: #2f664d;
  background: #eaf5ee;
  border: 1px solid #d8ebdf;
  border-radius: 999px;
  padding: 0.06rem 0.34rem;
  font-variant-numeric: tabular-nums;
}

.evidence-quote-text {
  margin: 0.25rem 0 0;
  font-size: 0.79rem;
  line-height: 1.5;
  color: #28445f;
}

.evidence-quote-meta {
  margin-top: 0.28rem;
  font-size: 0.66rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.35rem 0;
}

.detail-info-bar {
  margin-top: 0.46rem;
  padding-top: 0.42rem;
  border-top: 1px solid var(--line-soft);
}

.detail-chip {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  border: none;
  color: var(--ink-secondary);
  white-space: nowrap;
  word-break: keep-all;
}

.detail-chip-yes {
  background: var(--yes-bg);
  color: var(--yes-ink);
}

.kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.kw-tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--ink-secondary);
  border: none;
}

.detail-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

/* ── Card View ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.55rem;
}

.paper-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 0.6rem 0.65rem;
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  opacity: 0;
  animation: fadeInUp 250ms ease forwards;
}

.paper-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-soft), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.news-card {
  border-top: 2px solid #e2ece8;
}

.card-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  z-index: 2;
  background: var(--panel);
  border-radius: 3px;
}

.paper-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--line-soft);
}

.paper-card-head {
  min-height: 56px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.paper-title {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: #173754;
}

.card-orig-title {
  margin: 0.1rem 0 0;
  font-size: 0.7rem;
  color: #7a8da0;
  line-height: 1.25;
  font-style: italic;
}

.paper-core {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.45;
}

.card-keywords {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.meta-row {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  overflow: visible;
}

.meta-row > *,
.list-meta-row > * {
  flex: 0 0 auto;
}

.meta-row-inline,
.list-meta-row.meta-row-inline {
  margin-top: 0.28rem;
  flex-wrap: nowrap !important;
}

.info-line {
  margin: 0.35rem 0 0;
  color: #334d66;
  font-size: 0.82rem;
  line-height: 1.5;
}

.card-meta-line {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
}

.signal-grid {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.22rem;
}

.signal-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.42rem;
  align-items: start;
}

.signal-label {
  font-size: 0.66rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}

.signal-value {
  font-size: 0.79rem;
  line-height: 1.46;
  color: #2f4a63;
}

.card-signal-grid {
  margin-top: 0.32rem;
  padding: 0.34rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.detail-signal-grid {
  margin-top: 0.2rem;
}

.risk-strip {
  margin-top: 0.38rem;
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.26rem 0.34rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfbfa;
}

.risk-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.risk-text {
  font-size: 0.77rem;
  color: #3b536b;
  min-width: 0;
  flex: 1;
}

.usecase-strip {
  margin-top: 0.32rem;
  display: flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.24rem 0.34rem;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
  background: #fcfcfb;
}

.usecase-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.usecase-text {
  font-size: 0.77rem;
  color: #35506b;
  min-width: 0;
  flex: 1;
}

.card-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.card-actions-compact {
  margin-top: 0.34rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--panel);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  transition: background var(--speed) ease;
}

.card-link:hover {
  background: var(--bg-hover);
}

.card-link.active {
  border-color: #c7dfd5;
  background: #eff8f3;
  color: #1d5e4a;
}

/* ── Score Ring ── */
.score-ring {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.score-ring svg {
  display: block;
}

.score-ring-num {
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-ring-num.yes {
  color: var(--yes-ink);
}

.score-ring-num.maybe {
  color: var(--maybe-ink);
}

.score-ring-num.neutral {
  color: var(--muted);
}

/* ── Difficulty Indicator ── */
.diff-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 0.15rem 0;
}

.diff-bar {
  width: 3px;
  height: 10px;
  border-radius: 1px;
  background: var(--line);
}

.diff-bar.filled.yes {
  background: var(--yes-ink);
}

.diff-bar.filled.maybe {
  background: var(--maybe-ink);
}

.diff-bar.filled.no {
  background: var(--no-ink);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 500;
  border: none;
  white-space: nowrap;
  word-break: keep-all;
}

.badge.yes {
  background: var(--yes-bg);
  color: var(--yes-ink);
}

.badge.maybe {
  background: var(--maybe-bg);
  color: var(--maybe-ink);
}

.badge.no {
  background: var(--no-bg);
  color: var(--no-ink);
}

.badge.neutral {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

/* ── Similar Papers View ── */
.sim-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0.5rem 0.7rem;
}

.sim-header-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sim-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  padding: 0;
  border-radius: 0;
  flex-shrink: 0;
}

.sim-chip {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--neutral-bg);
  border: none;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-arrow {
  font-size: 0.82rem;
  color: var(--muted);
  flex-shrink: 0;
}

.sim-count {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.sim-close {
  appearance: none;
  border: none;
  background: none;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.12s;
}

.sim-close:hover {
  background: var(--no-bg);
  color: var(--no-ink);
}

.sim-badge {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.08rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.sim-badge.high {
  background: var(--yes-bg);
  color: var(--yes-ink);
}

.sim-badge.mid {
  background: var(--maybe-bg);
  color: var(--maybe-ink);
}

.sim-badge.low {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

/* ── Effect Tags Section ── */
.effect-tags-section {
  max-width: 1180px;
  margin: 0.3rem auto 0;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.effect-tags-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.effect-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.effect-tag-chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-secondary);
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--speed) ease, color var(--speed) ease;
}

.effect-tag-chip:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.effect-tag-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Effect tag display chips on papers */
.effect-tag {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--ink-secondary);
  border: none;
}

/* ── Pager ── */
.pager-bar {
  max-width: 1180px;
  margin: 0.5rem auto 0.8rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#page-info {
  min-width: 52px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── Empty ── */
.empty-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
  margin: 0.5rem;
}

/* ── Footer ── */
footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.8rem 1rem 1.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  border-top: 1px solid var(--line);
}

footer a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 500;
}

/* ── Table (category pages) ── */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: 72vh;
  background: var(--panel);
}

.dense-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 0.83rem;
}

.dense-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  padding: 0.44rem 0.48rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.dense-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 0.45rem 0.48rem;
  vertical-align: top;
}

.title-cell a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.tldr-cell {
  max-width: 380px;
  color: var(--ink-secondary);
}

.link-cell a {
  color: var(--primary);
  text-decoration: none;
}

/* ── Legacy panel/hero support (category pages) ── */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.hero.compact {
  display: block;
  padding: 1rem;
  background: #1a1a2e;
  color: #fff;
}

.hero-main h1,
.hero.compact h1 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-main p,
.hero.compact p {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.hero-meta span,
.meta {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 0.18rem 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
}

.back-link {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  margin-bottom: 0.7rem;
}

.panel h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 1rem;
}

/* ── Search Focus ── */
.filter-search input {
  transition: box-shadow var(--speed) ease;
}

/* ── Content Transition ── */
.list-scroll {
  transition: opacity 120ms ease;
}

.list-scroll.refreshing {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ── Tooltip ── */
.has-tooltip {
  position: relative;
  z-index: 1;
}

.tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.34rem 0.62rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 80;
  will-change: opacity, transform;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(15, 23, 42, 0.96);
}

.has-tooltip:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.has-tooltip:hover,
.has-tooltip:focus-within {
  z-index: 81;
}

/* ── Global Interaction States ── */
select:focus,
input:focus,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}

::selection {
  background: var(--primary-soft);
  color: var(--ink);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-compact {
    padding: 0.55rem 0.7rem;
  }

  .hero-compact h1 {
    font-size: 0.85rem;
  }

  .hero-right {
    gap: 0.34rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .auth-user-chip {
    max-width: 92px;
  }

  .filter-bar {
    padding: 0.35rem 0.6rem;
    gap: 0.35rem;
  }

  .filter-item select {
    min-width: 65px;
    font-size: 0.8rem;
  }

  .list-wrapper,
  .result-bar,
  .pager-bar {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .list-head {
    gap: 0.2rem;
  }

  .signal-row {
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }

  .signal-label {
    font-size: 0.62rem;
  }

  .risk-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.24rem;
  }

  .usecase-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.24rem;
  }

  .risk-strip .badge {
    margin-left: auto;
  }

  .card-actions {
    gap: 0.24rem;
  }

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

  .evidence-quote-head {
    flex-wrap: wrap;
  }

  .evidence-conf {
    margin-left: 0;
  }



  footer {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .reading-panel {
    width: 100%;
    max-width: 100vw;
  }
}

/* ── Analysis Panel (Bottom Sheet) ── */
.analysis-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.analysis-backdrop.open {
  opacity: 1;
}

.analysis-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--panel);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  z-index: 201;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.analysis-panel.open {
  transform: translateY(0);
}

.analysis-drag-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  cursor: grab;
}

.analysis-drag-handle span {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.analysis-panel-inner {
  padding: 0.5rem 1.5rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.analysis-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.analysis-close {
  appearance: none;
  border: none;
  background: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius);
  transition: background var(--speed) ease;
}

.analysis-close:hover {
  background: var(--bg-hover);
}

/* Paper Chips */
.analysis-papers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.analysis-paper-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--ink-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-papers-more {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  background: none;
  color: var(--primary);
  cursor: pointer;
  border: none;
}

/* Cross Analysis */
.analysis-cross {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink);
}

.analysis-cross-item {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.analysis-cross-label {
  font-weight: 600;
  color: var(--muted);
  min-width: 5.5rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Section Labels */
.analysis-section-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

/* Analysis Type Cards (single column) */
.analysis-types {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.2rem;
}

.analysis-type-card {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  text-align: left;
  cursor: pointer;
  transition: all 150ms ease;
}

.analysis-type-card:hover {
  border-left-color: var(--primary);
  background: var(--bg-hover);
}

.analysis-type-card.active {
  border-left-color: var(--primary);
  border-left-width: 2px;
  background: var(--primary-soft);
}

.analysis-type-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 1.4rem;
  letter-spacing: -0.02em;
  margin-top: 0.15rem;
}

.analysis-type-card.active .analysis-type-num {
  color: var(--primary);
}

.analysis-type-content {
  flex: 1;
  min-width: 0;
}

.analysis-type-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.analysis-type-desc {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* LLM Destination Segment Control */
.analysis-segment {
  display: flex;
  position: relative;
  background: var(--neutral-bg);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 0.8rem;
}

.segment-option {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.3rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-secondary);
  transition: color var(--speed) ease;
  position: relative;
  z-index: 1;
}

.segment-option:has(input:checked) {
  color: var(--ink);
  font-weight: 600;
}

.segment-option input {
  display: none;
}

.segment-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: calc(33.333% - 2px);
  background: var(--panel);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 200ms ease;
  z-index: 0;
}

/* New Tab Checkbox */
.analysis-newtab-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1rem;
  cursor: pointer;
  flex-direction: row;
}

.analysis-newtab-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

/* Go Button */
.analysis-go-btn {
  width: 100%;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter var(--speed) ease;
}

.analysis-go-btn:hover {
  filter: brightness(1.06);
}

.analysis-go-btn:active {
  transform: scale(0.98);
}

.analysis-go-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.analysis-go-hint {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.75;
}

.analysis-go-btn.copied {
  background: var(--yes-ink);
}

/* AI Analysis Open Button */
.analysis-open-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter var(--speed) ease;
}

.analysis-open-btn:hover {
  filter: brightness(1.08);
}

/* Success State */
.analysis-success {
  padding: 1.5rem 0 0.5rem;
  text-align: center;
}

.analysis-success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 auto 0.75rem;
}

.analysis-success-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.analysis-success-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.analysis-success-link {
  margin-bottom: 0.75rem;
}

.analysis-llm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  transition: background var(--speed) ease;
}

.analysis-llm-btn:hover {
  background: var(--primary-soft);
}

.analysis-success-guide {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1rem;
}

.analysis-close-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.4rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--speed) ease;
}

.analysis-close-btn:hover {
  border-color: var(--ink-secondary);
  color: var(--ink);
}

/* Analysis Panel Responsive */
@media (max-width: 640px) {
  .analysis-panel-inner {
    padding: 0.5rem 1rem 1rem;
  }

  .analysis-types {
    gap: 0.3rem;
  }
}

/* ── Reading List ── */
.bookmark-btn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 3px;
  transition: transform 120ms ease;
  opacity: 0.35;
}

.bookmark-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.bookmark-btn.interested {
  opacity: 1;
  color: #d4a017;
}

.bookmark-btn.read {
  opacity: 1;
  color: #2563eb;
}

.bookmark-btn.applied {
  opacity: 1;
  color: #16a34a;
}

.reading-list-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-secondary);
  transition: background var(--speed) ease;
}

.reading-list-btn:hover {
  background: var(--bg-hover);
}

.reading-list-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.rl-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 0.5rem 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.rl-note-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--panel);
  margin-top: 0.2rem;
}

.rl-note-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.rl-change-badge {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.06rem 0.3rem;
  border-radius: 3px;
  background: #fef3cd;
  color: #7c5a20;
  animation: fadeInUp 250ms ease forwards;
}

/* ── Reading List Side Panel ── */
.reading-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}

.reading-panel.open {
  transform: translateX(0);
}

.reading-panel-header {
  position: sticky;
  top: 0;
  background: var(--panel);
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}

.reading-panel-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.history-subtitle {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.reading-panel-close {
  appearance: none;
  border: none;
  background: none;
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius);
}

.reading-panel-close:hover {
  background: var(--bg-hover);
}

.reading-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.rl-stat {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.rl-stat.interested strong {
  color: #d4a017;
}

.rl-stat.read strong {
  color: #2563eb;
}

.rl-stat.applied strong {
  color: #16a34a;
}

/* Progress bar */
.rl-progress {
  margin: 0 0.8rem;
  padding: 0.5rem 0;
}

.rl-progress-bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line-soft);
}

.rl-progress-fill {
  transition: width 300ms ease;
}

.rl-progress-fill.applied {
  background: #16a34a;
}

.rl-progress-fill.read {
  background: #2563eb;
}

.rl-progress-fill.interested {
  background: #d4a017;
}

.reading-panel-body {
  padding: 0;
}

.history-panel-body {
  padding: 0.65rem 0.75rem 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.history-section {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.history-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
}

.history-section-head strong {
  font-size: 0.76rem;
  color: var(--ink);
}

.history-count {
  font-size: 0.68rem;
  color: var(--muted);
}

.history-list {
  display: grid;
  gap: 0.36rem;
  padding: 0.5rem 0.6rem;
}

.history-empty {
  padding: 0.55rem 0.2rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.history-item {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  padding: 0.42rem 0.48rem;
}

.history-item-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
}

.history-item-meta {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.67rem;
  color: var(--muted);
}

.history-item-meta .chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.06rem 0.34rem;
  background: var(--bg);
}

/* Reading list items in panel */
.rl-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--speed) ease;
}

.rl-item:hover {
  background: var(--bg-hover);
}

.rl-item-status {
  width: 3px;
  min-height: 32px;
  border-radius: 1.5px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.rl-item-status.interested {
  background: #d4a017;
}

.rl-item-status.read {
  background: #2563eb;
}

.rl-item-status.applied {
  background: #16a34a;
}

.rl-item-content {
  flex: 1;
  min-width: 0;
}

.rl-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-item-cat {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.05rem;
}

.rl-item-cycle {
  appearance: none;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.15rem;
  flex-shrink: 0;
  border-radius: 3px;
  transition: transform 120ms ease;
}

.rl-item-cycle:hover {
  transform: scale(1.15);
}

/* Reading panel backdrop */
.reading-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.reading-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Empty state */
.rl-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.rl-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.4;
}

/* ── Full-text Search ── */
.search-snippet {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--ink-secondary);
  line-height: 1.4;
  padding: 0.2rem 0.4rem;
  background: #fffbe6;
  border-radius: 3px;
  border-left: 2px solid #d4a017;
}

.search-snippet mark {
  background: #ffe066;
  color: var(--ink);
  padding: 0 1px;
  border-radius: 1px;
}

.search-loading {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Search Autocomplete ── */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.ac-item {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  transition: background var(--speed);
}

.ac-item:hover {
  background: var(--bg-hover);
}

.ac-term {
  color: var(--ink);
  font-weight: 500;
}

.ac-count {
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--neutral-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

/* ── Relationship Graph ── */
.graph-container {
  position: relative;
  width: 100%;
  height: 500px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

.graph-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.webgl-label-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: #1a1a2e;
  color: #fff;
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 80ms ease;
  z-index: 10;
  max-width: 280px;
}

.graph-tooltip.visible {
  opacity: 1;
}

.graph-legend {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.62rem;
  color: var(--muted);
}

.graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.graph-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Graph Topbar Search ── */
.gtb-search {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  flex: 1 1 220px;
  max-width: 320px;
  min-width: 130px;
}

.gtb-search-icon {
  color: var(--muted);
  pointer-events: none;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.gtb-search-input {
  width: 100%;
  min-width: 0;
  padding: 0.24rem 0.42rem;
  font-size: 0.74rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--bg);
  color: var(--ink);
  flex: 1 1 auto;
  transition: box-shadow var(--speed) ease, border-color var(--speed) ease, background var(--speed) ease;
}

.gtb-search-input::placeholder {
  color: var(--muted);
  font-size: 0.72rem;
}

.gtb-search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-soft);
  border-color: var(--primary-soft);
  background: var(--panel);
}

.gtb-search-count {
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  min-width: 2.1rem;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .graph-topbar {
    gap: 0.35rem;
  }

  .gtb-stats {
    display: none;
  }

  .gtb-search {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .graph-topbar {
    gap: 0.3rem;
    padding-right: 0.5rem;
  }

  .gtb-sep,
  .gtb-title {
    display: none;
  }

  .gtb-search {
    margin-left: 0;
    min-width: 0;
    flex: 1 1 auto;
  }

  .gtb-search-input {
    font-size: 0.72rem;
  }

  .gtb-search-count {
    min-width: 1.8rem;
  }
}

.graph-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.graph-ctrl-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-ctrl-btn:hover {
  background: var(--bg-hover);
}

.graph-ctrl-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Graph Immersive Mode ── */
.graph-container.immersive {
  height: calc(100vh - 120px);
  min-height: 500px;
  border-color: var(--line-soft);
}

.graph-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  font-size: 0.76rem;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
}

.gtb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: var(--radius);
  transition: color var(--speed), background var(--speed);
}

.gtb-back:hover {
  color: var(--ink);
  background: var(--bg-hover);
}

.gtb-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.gtb-title {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.gtb-stats {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.minimized {
  display: none !important;
}

/* ── Graph Skeleton Loading ── */
.graph-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 5;
  background: var(--panel);
}

.graph-skeleton-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.graph-skeleton-circle:nth-child(2) {
  animation-delay: 0.2s;
}

.graph-skeleton-circle:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes skeletonPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

.graph-skeleton-text {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.3rem;
}

/* ── Ego Info Panel ── */
.ego-info-panel {
  position: absolute;
  top: 46px;
  left: 8px;
  width: min(360px, calc(100% - 16px));
  max-height: calc(100% - 54px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  z-index: 15;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 200ms ease;
}

.ego-info-header {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.ego-info-title {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: block;
}

.ego-info-close {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.12rem 0.33rem;
}

.ego-info-close:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.ego-info-body {
  padding: 0.5rem 0.65rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ego-info-field {
  margin-bottom: 0.4rem;
}

.ego-badge-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.ego-badge-row > * {
  flex: 0 0 auto;
}

.ego-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.1rem;
}

.ego-info-field p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink);
  line-height: 1.5;
}

.ego-info-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.ego-exit-btn {
  cursor: pointer;
}

/* ── Graph Hint Bar ── */
.graph-hint-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.15rem;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.graph-hint-bar.faded {
  opacity: 0;
  pointer-events: none;
}

.graph-hint-bar:hover {
  opacity: 1 !important;
  pointer-events: auto;
}

.gh-chip {
  font-size: 0.62rem;
  color: var(--muted);
  background: var(--panel);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.gh-chip kbd {
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.6rem;
  margin-right: 0.15rem;
}

/* Legacy graph-hint hidden */
.graph-hint {
  display: none;
}

/* ── Graph Preview Card (hover) ── */
.graph-preview {
  position: absolute;
  width: 260px;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 0.55rem 0.65rem;
  z-index: 18;
  opacity: 0;
  transition: opacity 150ms ease;
  overflow: hidden;
}

.graph-preview.visible {
  opacity: 1;
}

.gp-cat {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.06rem 0.35rem;
  border-radius: 3px;
  margin-bottom: 0.2rem;
}

.gp-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.gp-badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}

.gp-badges > * {
  flex: 0 0 auto;
}

.gp-summary {
  font-size: 0.76rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* ── Graph Node Card (click) ── */
.graph-node-card {
  position: absolute;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
  animation: fadeInUp 200ms ease;
}

.graph-card-header {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.gnc-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  appearance: none;
  border: none;
  background: none;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.gnc-close:hover {
  background: var(--no-bg);
  color: var(--no-ink);
}

.gnc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: block;
  margin-top: 0.15rem;
}

.gnc-orig {
  font-size: 0.72rem;
  color: #7a8da0;
  font-style: italic;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.graph-card-body {
  padding: 0.5rem 0.65rem;
}

.gnc-badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.gnc-badges > * {
  flex: 0 0 auto;
}

.gnc-field {
  margin-bottom: 0.3rem;
}

.gnc-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.08rem;
}

.gnc-field p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink);
  line-height: 1.5;
}

.gnc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.3rem 0;
}

.gnc-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--line-soft);
}

.gnc-neighbors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.gnc-neighbor-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--ink-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--speed) ease;
}

.gnc-neighbor-chip:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.gnc-nb-pct {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 400;
}

/* ── Graph Breadcrumb ── */
.graph-breadcrumb {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  z-index: 16;
  font-size: 0.7rem;
}

.graph-breadcrumb .bc-chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink-secondary);
  padding: 0.15rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed) ease;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-breadcrumb .bc-chip:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.graph-breadcrumb .bc-sep {
  color: var(--muted);
  font-size: 0.6rem;
}

/* ── Graph Category Stats ── */
.graph-cat-stats {
  position: absolute;
  top: 44px;
  right: 8px;
  width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 0.5rem 0.65rem;
  z-index: 16;
  font-size: 0.76rem;
  animation: fadeInUp 200ms ease;
}

.gcs-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.gcs-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--ink-secondary);
  margin-bottom: 0.15rem;
}

.gcs-row strong {
  color: var(--ink);
}

.gcs-kws {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .ego-info-panel {
    top: auto;
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(58%, 360px);
  }
}

/* =========================================================================
   13. Web-Native AI: FAB & Sliding Panel
   ========================================================================= */

/* FAB Button */
.ai-fab-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  border: 1px solid #2d2d31;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ai-fab-btn:hover {
  transform: translateY(-1px);
  background: var(--ink-hover);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.ai-fab-btn:active {
  transform: translateY(0);
}

.ai-fab-icon {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Panel Backdrop */
.ai-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 1000;
  opacity: 1;
  transition: opacity 180ms ease;
}

.ai-panel-backdrop[hidden] {
  opacity: 0;
  pointer-events: none;
}

/* The Panel */
.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 220ms ease;
}

.ai-panel[hidden] {
  transform: translateX(100%);
  display: flex !important;
  visibility: hidden;
  transition: transform 220ms ease, visibility 0s 220ms;
}

/* Header */
.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.ai-panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.ai-panel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.ai-panel-close:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

/* Segmented Control */
.ai-segment-wrapper {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.ai-segment {
  display: flex;
  position: relative;
  background: var(--nav-bg);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border);
}

.ai-segment-option {
  flex: 1;
  position: relative;
  z-index: 2;
  text-align: center;
  cursor: pointer;
}

.ai-segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-segment-option span {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.ai-segment-option input:checked+span {
  color: var(--ink);
}

.ai-segment-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  z-index: 1;
  transition: transform 160ms ease;
}

.ai-segment-option:nth-child(2) input:checked~.ai-segment-indicator {
  transform: translateX(100%);
}

/* Body */
.ai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.ai-mode-content {
  display: none;
  flex-direction: column;
  height: 100%;
}

.ai-mode-content.active {
  display: flex;
}

/* Input Group */
.ai-input-group {
  margin-bottom: 1.5rem;
}

.ai-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  transition: all 0.2s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
  .ai-textarea {
    background: #0a0a0b;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  }
}

.ai-textarea:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 1px #64748b inset, 0 0 0 3px rgba(100, 116, 139, 0.1);
}

.ai-textarea::placeholder {
  color: var(--placeholder);
}

.ai-submit-btn {
  width: 100%;
  margin-top: 0.75rem;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid transparent;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .ai-submit-btn {
    border-color: rgba(255, 255, 255, 0.1);
  }
}

.ai-submit-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.ai-submit-btn:disabled {
  background: var(--surface-disabled);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
  box-shadow: none;
}

.ai-brainstorm-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ai-brainstorm-controls .ai-submit-btn {
  margin-top: 0;
  flex: 2;
}

.ai-action-btn.secondary {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-action-btn.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* Results Area */
.ai-results-area {
  flex: 1;
  position: relative;
}

.ai-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.ai-skeleton-shimmer {
  height: 16px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite linear;
}

.ai-skeleton-shimmer.short {
  width: 70%;
}

.ai-skeleton-shimmer.half {
  width: 40%;
}

.ai-loading-text {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  animation: pulse 1.5s infinite alternate;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Base Result Card (reusing Linear-style concepts) */
.ai-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ai-result-card-emphasis {
  border-color: #cdd5df;
  background: #fafcff;
}

.ai-results-title {
  margin: 0 0 0.7rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ai-card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.ai-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.ai-card-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.ai-card-metrics {
  background: rgba(100, 116, 139, 0.1);
  border: 1px inset rgba(100, 116, 139, 0.2);
  color: var(--ink);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Result Card Sub-Sections */
.ai-card-section {
  margin-bottom: 0.75rem;
}

.ai-card-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.ai-card-value {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.5;
}

.ai-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.ai-chip:hover {
  background: #ececea;
  color: var(--ink);
  border-color: #d4d4d0;
}

/* Status Bar */
.ai-model-status {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--panel);
}

.ai-engine-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffaa00;
  /* loading */
  box-shadow: 0 0 5px rgba(255, 170, 0, 0.3);
}

.ai-engine-indicator.online {
  background: #16a34a;
  box-shadow: 0 0 5px rgba(22, 163, 74, 0.3);
}

.ai-engine-indicator.offline {
  background: #dc2626;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.3);
}

/* Typewriter Effect Utility */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  background: var(--ink);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ── IDEA Cart (Premium) ── */
.idea-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.34);
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 440;
}

.idea-cart-backdrop.open {
  opacity: 1;
}

.idea-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 94vw);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #e7ebe8;
  box-shadow: -14px 0 32px rgba(15, 20, 26, 0.18);
  z-index: 441;
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform 240ms cubic-bezier(0.2, 0.82, 0.24, 1);
}

.idea-cart-drawer.open {
  transform: translateX(0);
}

.idea-cart-drawer-head {
  padding: 0.9rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.idea-cart-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.idea-cart-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
}

.idea-cart-kicker {
  display: inline-flex;
  width: fit-content;
  font-size: 0.62rem;
  font-weight: 700;
  color: #245647;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e9f4ef;
  border: 1px solid #d3e6dc;
  border-radius: 999px;
  padding: 0.08rem 0.36rem;
}

.idea-cart-drawer-count {
  font-size: 0.73rem;
  color: var(--muted);
}

.idea-cart-close {
  border: 1px solid var(--line);
  background: #fff;
  color: #6d7680;
  border-radius: 8px;
  width: 1.9rem;
  height: 1.9rem;
  cursor: pointer;
}

.idea-cart-items {
  flex: 1;
  overflow: auto;
  padding: 0.72rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.idea-cart-empty {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  background: #fafbf9;
}

.idea-cart-item {
  border: 1px solid #e7ebe8;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 0.52rem 0.58rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  justify-content: space-between;
}

.idea-cart-item-main {
  min-width: 0;
}

.idea-cart-item-main strong {
  display: block;
  font-size: 0.8rem;
  color: #202229;
  line-height: 1.3;
}

.idea-cart-item-main p {
  margin: 0.22rem 0 0;
  font-size: 0.72rem;
  color: #66707a;
  line-height: 1.34;
}

.idea-cart-item-type {
  display: inline-flex;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7d8994;
  margin-bottom: 0.16rem;
}

.idea-cart-item-remove {
  border: 1px solid var(--line);
  background: #fff;
  color: #54616f;
  border-radius: 6px;
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
  cursor: pointer;
}

.idea-cart-controls {
  padding: 0.72rem 0.9rem 0.2rem;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 0.55rem;
}

.idea-cart-controls label {
  gap: 0.2rem;
}

.idea-cart-controls label span {
  font-size: 0.72rem;
  color: #66707a;
  font-weight: 600;
}

.idea-cart-controls input {
  font-size: 0.82rem;
  padding: 0.45rem 0.5rem;
}

.idea-cart-premium {
  margin: 0.6rem 0.9rem 0.35rem;
  border: 1px solid #d9e7df;
  border-radius: 10px;
  background: linear-gradient(140deg, #f7fbf9, #f3f8f6);
  padding: 0.58rem;
}

.idea-cart-premium-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.42rem;
}

.idea-premium-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #184c3b;
  background: #e4f2ec;
  border: 1px solid #cce0d7;
  border-radius: 999px;
  padding: 0.08rem 0.32rem;
}

.idea-premium-copy {
  font-size: 0.73rem;
  color: #4c606f;
}

.idea-cart-generate {
  width: 100%;
  border: 1px solid #b8d3c7;
  border-radius: 9px;
  background: linear-gradient(135deg, #173f31, #1f5d46);
  color: #eef8f4;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.54rem 0.72rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  position: relative;
  overflow: hidden;
}

.idea-cart-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(27, 79, 60, 0.24);
}

.idea-cart-generate.is-running::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: ideaCtaSweep 1.15s linear infinite;
}

@keyframes ideaCtaSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.idea-cart-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.idea-cart-status {
  min-height: 1.35rem;
  padding: 0 1rem;
  font-size: 0.73rem;
  color: #5f6d7c;
}

.idea-cart-status[data-level="ok"] {
  color: #206345;
}

.idea-cart-status[data-level="warn"] {
  color: #8a5f1c;
}

.idea-cart-results {
  padding: 0 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.idea-result-card {
  border: 1px solid #e4ebe7;
  border-radius: 9px;
  background: #fff;
  padding: 0.58rem 0.62rem;
}

.idea-result-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.idea-result-head strong {
  font-size: 0.82rem;
  line-height: 1.3;
}

.idea-result-target {
  font-size: 0.67rem;
  color: #7a8793;
}

.idea-result-card p {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: #3e4d5a;
  line-height: 1.36;
}

.idea-result-card p span {
  display: inline-block;
  min-width: 2.2rem;
  font-weight: 600;
  color: #6a7684;
  margin-right: 0.22rem;
}

.idea-result-evidence {
  margin-top: 0.38rem;
  display: grid;
  gap: 0.22rem;
}

.idea-ev-item {
  font-size: 0.67rem;
  color: #6e7b87;
}

.idea-ev-item a {
  color: #2f6d56;
  text-decoration: none;
  margin-left: 0.2rem;
}
