/* ===== App bar ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--primary);
}

.back-link .icon {
  transform: scaleX(-1);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s ease;
}

.icon-btn:hover {
  color: var(--primary);
  border-color: #bfdbfe;
  background: var(--primary-soft);
}

.header-admin {
  color: var(--text-muted);
  border: 1px solid transparent;
}

.header-admin:hover {
  color: var(--text-secondary);
  background: #F8FAFC;
}

/* ===== Research masthead ===== */
.research-masthead {
  position: relative;
  padding: 28px 32px 30px;
  background: linear-gradient(135deg, #0F2F63 0%, #123A78 42%, #1D4ED8 100%);
  color: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.research-masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    radial-gradient(ellipse 50% 80% at 100% 0%, rgba(255, 255, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.research-masthead .container {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

/* Insight tabs under masthead */
.insight-band {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: var(--radius-soft-lg, 20px);
  padding: 28px 32px 32px;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.insight-band .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.insight-mast-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  align-items: center;
}

@media (max-width: 900px) {
  .insight-band {
    padding: 18px 16px 22px;
  }
  .insight-mast-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .insight-mast-tab {
    flex: 0 0 auto;
  }
}

.insight-mast-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.insight-mast-tab:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.insight-mast-tab.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(15, 47, 99, 0.14);
}

.insight-mast-tab.green.active { background: linear-gradient(135deg, #059669, #10b981); }
.insight-mast-tab.blue.active { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.insight-mast-tab.purple.active { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.insight-mast-tab.orange.active { background: linear-gradient(135deg, #c2410c, #fb923c); }
.insight-mast-tab.teal.active { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.insight-mast-tab.pink.active { background: linear-gradient(135deg, #be185d, #f472b6); }
.insight-mast-tab.overview.active {
  background: linear-gradient(135deg, #0f2f63, #1d4ed8);
}

.insight-mast-tab-score {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.insight-mast-tab.active .insight-mast-tab-score {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.insight-mast-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.insight-mast-tab.active .insight-mast-tab-dot {
  background: #fff;
}

.insight-tab-panels {
  position: relative;
}

.insight-tab-panel {
  display: none;
}

.insight-tab-panel.is-active {
  display: grid;
}

.insight-tab-panel.overview-panel.is-active {
  display: block;
}

.insight-tab-panel[hidden] {
  display: none !important;
}

.overview-layout {
  margin-top: 2px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 32px;
  align-items: start;
}

.overview-layout .main-col,
.overview-layout .side-col {
  gap: 28px;
  min-width: 0;
}

.overview-side .score-overview-grid {
  grid-template-columns: 1fr;
}

.overview-side .score-overview-card {
  position: static;
}

.overview-side .score-overview-card .panel-head h2,
.overview-side .keywords-card .panel-head h2 {
  font-size: 15px;
}

.overview-side .score-overview-card .panel-head p,
.overview-side .keywords-card .panel-head p {
  font-size: 12px;
}

.score-overview-card,
.keywords-card {
  padding: 22px 22px 20px;
}

.keywords-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.keyword-chip.is-primary {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
}

.keyword-chip:hover {
  border-color: #cbd5e1;
  background: #fff;
  color: #0f172a;
}

.keyword-chip.is-primary:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.keywords-empty {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
}

.score-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.score-overview-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: right;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e8edf5;
  background: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.score-overview-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 47, 99, 0.08);
}

.score-overview-item.blue {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-color: #dbeafe;
}

.score-overview-item.purple {
  background: linear-gradient(180deg, #f5f3ff 0%, #f8fafc 100%);
  border-color: #ede9fe;
}

.score-overview-item.blue:hover { border-color: #93c5fd; }
.score-overview-item.purple:hover { border-color: #c4b5fd; }

.score-overview-item.is-empty {
  opacity: 0.85;
}

.score-overview-dial {
  position: relative;
  width: 76px;
  height: 76px;
}

.score-overview-dial svg {
  width: 100%;
  height: 100%;
  display: block;
}

.score-overview-dial .insight-score-dial-num {
  font-size: 18px;
}

.score-overview-dial.tone-low .insight-score-ring-fg { stroke: #dc2626; }
.score-overview-dial.tone-mid .insight-score-ring-fg { stroke: #d97706; }
.score-overview-dial.tone-high .insight-score-ring-fg { stroke: #059669; }
.score-overview-item.blue .score-overview-dial.tone-high .insight-score-ring-fg { stroke: #2563eb; }
.score-overview-item.purple .score-overview-dial.tone-high .insight-score-ring-fg { stroke: #7c3aed; }
.score-overview-item.blue .score-overview-dial.tone-high .insight-score-dial-num { color: #1d4ed8; }
.score-overview-item.purple .score-overview-dial.tone-high .insight-score-dial-num { color: #6d28d9; }
.score-overview-dial.tone-low .insight-score-dial-num { color: #b91c1c; }
.score-overview-dial.tone-mid .insight-score-dial-num { color: #b45309; }

.score-overview-dial.is-placeholder {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  background: #fff;
}

.score-overview-placeholder {
  font-size: 22px;
  font-weight: 700;
  color: #94a3b8;
}

.score-overview-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-overview-copy strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.score-overview-copy span {
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
}

.score-overview-status {
  margin-top: 4px;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  color: #475569;
}

.score-overview-status.is-high {
  color: #047857;
}

.score-overview-item.blue .score-overview-status.is-high {
  color: #1d4ed8;
}

.score-overview-item.purple .score-overview-status.is-high {
  color: #6d28d9;
}

.score-overview-status.is-mid {
  color: #b45309;
}

.score-overview-status.is-low {
  color: #b91c1c;
}

.score-overview-status.is-empty {
  color: #94a3b8;
  font-weight: 600;
}

@media (max-width: 720px) {
  .score-overview-grid {
    grid-template-columns: 1fr;
  }
}

.insight-band .overview-layout .summary-main,
.insight-band .overview-layout .side-widget {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

@media (max-width: 1024px) {
  .overview-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .overview-side .score-overview-card {
    position: static;
  }
}

.insight-band .insight-row {
  background: #fff;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  min-width: 0;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.78);
}

.breadcrumb a:hover {
  color: #fff;
}

.breadcrumb .sep {
  opacity: 0.45;
}

.doc-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.doc-label-mark {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(1.15);
}

.masthead-top-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.mast-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 40px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    padding 0.22s ease,
    gap 0.22s ease,
    box-shadow 0.18s ease;
}

.mast-action .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.9;
}

.mast-action-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
  transition:
    max-width 0.24s ease,
    opacity 0.18s ease,
    margin 0.24s ease;
}

.mast-action:hover,
.mast-action:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  gap: 8px;
  padding-inline: 12px 14px;
  box-shadow: 0 8px 20px rgba(8, 28, 68, 0.2);
  outline: none;
}

.mast-action:hover .mast-action-label,
.mast-action:focus-visible .mast-action-label {
  max-width: 9rem;
  opacity: 1;
  margin-inline-start: 0;
}

.mast-action.save-toggle-btn.is-saved {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.35);
}

.mast-action.save-toggle-btn.is-saved .mast-ico-bookmark {
  fill: currentColor;
  stroke: currentColor;
}

.mast-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.research-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 28px 32px;
  align-items: start;
}

.masthead-main {
  min-width: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.masthead-meta-footer {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  justify-content: flex-end; /* physical left in RTL */
}

.mast-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11.5px;
  font-weight: 500;
}

.mast-chip-ok {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.35);
}

.research-title {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.1vw, 24px);
  font-weight: 700;
  line-height: 1.55;
  color: #fff;
  max-width: 42rem;
}

.research-lead {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  max-width: 38rem;
  line-height: 1.8;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meta-strip-item {
  padding: 14px 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 0;
}

.meta-strip-item:last-child {
  border-left: 0;
}

.meta-strip-item dt {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.meta-strip-item dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.score-panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.score-panel::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  top: -36px;
  left: -24px;
}

.score-panel-label {
  position: relative;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.score-value {
  position: relative;
  font-family: var(--font-en);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.score-value span {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.7;
}

.score-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.score-bars {
  position: relative;
  display: grid;
  gap: 10px;
}

.score-bar-item {
  display: grid;
  gap: 4px;
}

.score-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.9;
}

.score-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
}

/* ===== Sticky jump nav ===== */
.jump-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 110;
  height: auto;
  min-height: var(--jump-nav-h);
  margin: 0 0 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(30, 41, 59, 0.02);
}

.jump-nav-inner {
  height: 100%;
  min-height: var(--jump-nav-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.jump-nav-inner::-webkit-scrollbar {
  display: none;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.jump-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.jump-link.active {
  color: var(--primary-deep, #123a78);
  background: var(--primary-soft);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.jump-download {
  margin-inline-start: auto;
  gap: 8px;
  color: var(--primary-deep, #123a78);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}

.jump-download .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.jump-download:hover,
.jump-download.active {
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}

#section-eval,
#section-insights,
#section-action,
#section-stakeholder {
  scroll-margin-top: 24px;
}

/* ===== Text research drawer ===== */
.text-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.text-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.text-drawer {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.text-drawer.open {
  pointer-events: auto;
}

.text-drawer-panel {
  width: min(920px, 100%);
  height: min(88vh, 900px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 48px rgba(30, 41, 59, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.text-drawer.open .text-drawer-panel {
  transform: translateY(0);
}

.text-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.text-drawer-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.text-drawer-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.text-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
}

body.text-drawer-open {
  overflow: hidden;
}

/* ===== Layout ===== */
.page-body {
  padding: 24px 0 120px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.main-col,
.side-col {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.panel-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Evaluation indicators ===== */
.eval-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.eval-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  transition: 0.2s ease;
}

.eval-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow);
}

.eval-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.eval-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.eval-score {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.eval-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.eval-desc-wrap {
  margin-top: 2px;
}

.eval-desc-wrap.is-collapsed .eval-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eval-desc-wrap.is-expanded .eval-desc {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.eval-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary, #2563eb);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.eval-more-btn:hover {
  text-decoration: underline;
}

.eval-more-btn[hidden] {
  display: none !important;
}

.eval-meter {
  margin-top: 10px;
  height: 6px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
}

.eval-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60A5FA);
}

/* ===== Insight cards (stack layout) ===== */
.insights-panel {
  overflow: hidden;
}

.insight-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 16px 16px 18px;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.insight-row:hover {
  border-color: #d7e3f4;
  box-shadow: 0 10px 28px rgba(15, 47, 99, 0.07);
  transform: translateY(-1px);
}

.insight-row.is-empty {
  background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}

.insight-row-accent {
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: #cbd5e1;
}

.insight-row.green .insight-row-accent { background: linear-gradient(180deg, #34d399, #059669); }
.insight-row.blue .insight-row-accent { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.insight-row.purple .insight-row-accent { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.insight-row.orange .insight-row-accent { background: linear-gradient(180deg, #fb923c, #ea580c); }
.insight-row.teal .insight-row-accent { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.insight-row.pink .insight-row-accent { background: linear-gradient(180deg, #f472b6, #db2777); }

.insight-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #475569;
}

.insight-row-icon .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.insight-row.green .insight-row-icon { background: #ecfdf5; color: #047857; }
.insight-row.blue .insight-row-icon { background: #eff6ff; color: #1d4ed8; }
.insight-row.purple .insight-row-icon { background: #f5f3ff; color: #6d28d9; }
.insight-row.orange .insight-row-icon { background: #fff7ed; color: #c2410c; }
.insight-row.teal .insight-row-icon { background: #f0fdfa; color: #0f766e; }
.insight-row.pink .insight-row-icon { background: #fdf2f8; color: #be185d; }

.insight-row-body {
  min-width: 0;
}

.insight-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.insight-row-top h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.insight-row-top .badge {
  flex-shrink: 0;
  height: 26px;
  font-size: 11.5px;
}

.insight-row-summary {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #475569;
}

.insight-row.has-score.is-score-open {
  padding: 22px 22px 20px 24px;
  box-shadow: none;
}

.insight-row.has-score.is-score-open:hover {
  transform: none;
  box-shadow: none;
  border-color: #e8edf5;
}

.insight-score-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px 24px;
  align-items: center;
  margin: 4px 0 20px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #eef2f7;
}

.insight-row.blue .insight-score-hero {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  border-color: #dbeafe;
}

.insight-row.purple .insight-score-hero {
  background: linear-gradient(180deg, #f5f3ff 0%, #fff 100%);
  border-color: #ede9fe;
}

.insight-score-dial {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.insight-detail-block {
  margin: 0 0 18px;
}

.insight-detail-label {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.insight-score-details {
  margin-top: 0;
  padding-top: 4px;
}

.insight-score-note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: #475569;
}

.insight-score-note.muted {
  color: #94a3b8;
}

.insight-row.has-score.is-score-open .insight-row-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: #334155;
}

.insight-row.has-score .insight-row-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.insight-score-dial svg {
  width: 100%;
  height: 100%;
  display: block;
}

.insight-score-ring-bg {
  stroke: #e2e8f0;
}

.insight-score-ring-fg {
  stroke: #64748b;
  transition: stroke-dashoffset 0.6s ease;
}

.insight-score-dial.tone-low .insight-score-ring-fg { stroke: #dc2626; }
.insight-score-dial.tone-mid .insight-score-ring-fg { stroke: #d97706; }
.insight-score-dial.tone-high .insight-score-ring-fg { stroke: #059669; }

.insight-row.blue .insight-score-dial.tone-high .insight-score-ring-fg { stroke: #2563eb; }
.insight-row.purple .insight-score-dial.tone-high .insight-score-ring-fg { stroke: #7c3aed; }
.insight-row.blue .insight-score-dial.tone-mid .insight-score-ring-fg { stroke: #3b82f6; }
.insight-row.purple .insight-score-dial.tone-mid .insight-score-ring-fg { stroke: #8b5cf6; }

.insight-score-dial-core {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
}

.insight-score-dial-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.insight-score-dial.tone-low .insight-score-dial-num { color: #b91c1c; }
.insight-score-dial.tone-mid .insight-score-dial-num { color: #b45309; }
.insight-score-dial.tone-high .insight-score-dial-num { color: #047857; }
.insight-row.blue .insight-score-dial.tone-high .insight-score-dial-num { color: #1d4ed8; }
.insight-row.purple .insight-score-dial.tone-high .insight-score-dial-num { color: #6d28d9; }

.insight-score-dial-max {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
  font-weight: 600;
}

.insight-score-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.insight-score-question {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  font-weight: 500;
}

.insight-score-band {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.insight-row.blue .insight-score-band {
  color: #1e40af;
  background: #eff6ff;
  border-color: #dbeafe;
}

.insight-row.purple .insight-score-band {
  color: #5b21b6;
  background: #f5f3ff;
  border-color: #ede9fe;
}

.conflict-peers {
  margin: 0 0 12px;
}

.conflict-peers-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.conflict-peers-hint {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #94a3b8;
}

.conflict-peers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conflict-peer-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ede9fe;
  background: #faf8ff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.conflict-peer-link:hover {
  border-color: #c4b5fd;
  background: #f5f3ff;
  transform: translateY(-1px);
}

.conflict-peer-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conflict-peer-title {
  font-size: 13px;
  font-weight: 700;
  color: #4c1d95;
  line-height: 1.45;
}

.conflict-peer-note {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.conflict-peer-score {
  flex-shrink: 0;
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.conflict-peer-score-label {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 2px;
}

.conflict-peer-score strong {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.conflict-peer-score.is-high {
  border-color: #fecaca;
  background: #fef2f2;
}
.conflict-peer-score.is-high strong { color: #b91c1c; }

.conflict-peer-score.is-mid {
  border-color: #fde68a;
  background: #fffbeb;
}
.conflict-peer-score.is-mid strong { color: #b45309; }

.conflict-peer-score.is-low {
  border-color: #ddd6fe;
  background: #f5f3ff;
}
.conflict-peer-score.is-low strong { color: #6d28d9; }

.insight-row-points {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.insight-row-points li {
  position: relative;
  padding: 8px 10px 8px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #1e293b;
  font-size: 12.5px;
  line-height: 1.7;
}

.insight-row-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
}

.insight-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.insight-row.is-processing,
.side-widget.is-processing,
.score-panel.is-processing {
  pointer-events: none;
}

.insight-processing {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}

.insight-processing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  max-width: 240px;
}

.insight-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary, #3b82f6);
  animation: insightSpin 0.8s linear infinite;
}

@keyframes insightSpin {
  to { transform: rotate(360deg); }
}

.insight-processing-title {
  font-size: 13.5px;
  color: #0f172a;
}

.insight-processing-sub {
  font-size: 12px;
  color: #64748b;
}

#jobToast.job-toast {
  position: fixed !important;
  top: auto !important;
  bottom: 24px !important;
  /* Physical left = opposite the RTL sidebar (sidebar sits on the right) */
  left: 24px !important;
  right: auto !important;
  margin: 0 !important;
  z-index: 160;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  width: min(400px, calc(100vw - var(--sidebar-w, 220px) - 48px));
  max-width: min(400px, calc(100vw - var(--sidebar-w, 220px) - 48px));
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#jobToast.job-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#jobToast.job-toast[hidden] {
  display: none !important;
}

.job-toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
}

.job-toast.is-running .job-toast-icon {
  color: transparent;
  background: transparent;
  border: 2px solid rgba(147, 197, 253, 0.3);
  border-top-color: #93c5fd;
  animation: insightSpin 0.8s linear infinite;
}

.job-toast.is-done .job-toast-icon {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.job-toast.is-failed .job-toast-icon {
  background: rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

.job-toast-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-toast-title {
  font-size: 13px;
  font-weight: 700;
}

.job-toast-msg {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.78);
}

.job-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(248, 250, 252, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.job-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

@media (max-width: 640px) {
  .insight-row.has-score.is-score-open {
    padding: 16px;
  }
  .insight-score-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 14px;
    padding: 16px;
  }
  .insight-score-hero-copy {
    align-items: center;
  }
  .insight-score-dial {
    width: 96px;
    height: 96px;
  }
  .insight-score-dial-num {
    font-size: 24px;
  }
  #jobToast.job-toast {
    left: 16px !important;
    right: auto !important;
    bottom: 16px !important;
    min-width: 0;
    width: calc(100vw - 32px);
    max-width: none;
  }
}

.score-panel .insight-processing {
  background: rgba(8, 28, 64, 0.78);
}

.score-panel .insight-processing-title,
.score-panel .insight-processing-sub {
  color: #f8fafc;
}

.score-panel .insight-spinner {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}

/* legacy insight-grid kept for older pages */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ===== Text content ===== */
.summary-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--primary);
}

.summary-panel {
  display: none;
  padding: 16px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text);
}

.summary-panel.active {
  display: block;
}

.article-body {
  margin-top: 24px;
}

.article-body h3 {
  margin: 28px 0 12px;
  font-size: 17px;
  font-weight: 700;
}

.article-body p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--text);
  text-align: justify;
}

.article-body ul {
  margin: 0 0 16px;
  padding-right: 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
}

.quote-box {
  margin: 20px 0;
  padding: 16px 18px;
  border-right: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 14px 14px 0;
  color: var(--primary-deep);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ===== Side widgets ===== */
.side-widget {
  padding: 18px;
  position: relative;
}

.side-widget h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-widget-sub {
  margin: -8px 0 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.eval-grid-side {
  grid-template-columns: 1fr;
  gap: 10px;
}

.eval-main-panel {
  padding: 22px;
}

.eval-main-panel .panel-head {
  margin-bottom: 14px;
}

.eval-main-panel .panel-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.eval-main-panel .side-widget-sub {
  margin: 0;
}

.eval-grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.eval-grid-main .eval-card {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

@media (max-width: 720px) {
  .eval-grid-main {
    grid-template-columns: 1fr;
  }
}

.eval-side-widget .eval-card {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.eval-side-widget .eval-desc {
  font-size: 12px;
  line-height: 1.65;
}

.eval-side-widget .eval-card-title {
  font-size: 12.5px;
}

.stakeholder-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.stakeholder-main .stakeholder-tabs {
  max-width: 420px;
  margin-bottom: 16px;
}

.stake-btn {
  height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.stake-btn.active {
  background: var(--purple-soft);
  border-color: #ddd6fe;
  color: #6d28d9;
}

.stake-panel {
  display: none;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.stake-panel.active {
  display: block;
}

.stakeholder-main .stake-panel {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.summary-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.summary-main .summary-side-tabs,
.summary-tabs-3 {
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.summary-side-btn {
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s ease;
}

.summary-side-btn:hover {
  border-color: #bfdbfe;
  color: var(--primary);
}

.summary-side-btn.active {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--primary-deep, #123a78);
  font-weight: 600;
}

.summary-side-panel {
  display: none;
}

.summary-side-panel.active {
  display: block;
}

.summary-main .summary-side-panel {
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.summary-prose-wrap {
  position: relative;
}

.summary-prose-wrap.is-collapsed .summary-prose {
  max-height: 220px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
}

.summary-prose-wrap.is-expanded .summary-prose {
  max-height: none;
  mask-image: none;
  -webkit-mask-image: none;
}

.summary-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dbe7f8;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-deep, #123a78);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.summary-more-btn .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.summary-more-btn:hover {
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.summary-prose-wrap.is-expanded .summary-more-btn .icon {
  transform: rotate(180deg);
}

.summary-prose {
  padding: 18px 20px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
  border: 1px solid #e7eef8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.summary-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-deep, #123a78);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary-lead {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.9;
}

.summary-body {
  margin: 0 0 14px;
  color: #334155;
  font-size: 14px;
  line-height: 2;
}

.summary-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.summary-points li {
  position: relative;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #1e293b;
  font-size: 13.5px;
  line-height: 1.85;
}

.summary-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82f6, #123a78);
}

.summary-empty {
  margin: 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #dbe3ef;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.chain-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.chain-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}

.chain-dot.prev { background: var(--text-muted); }
.chain-dot.current { background: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
.chain-dot.next { background: var(--orange); }

.chain-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.chain-item span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.kpi-list {
  display: grid;
  gap: 10px;
}

.kpi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #F8FAFC;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.kpi-item strong {
  font-size: 12.5px;
}

.kpi-item span {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-en);
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: 0.2s ease;
}

.related-item:hover {
  border-color: #bfdbfe;
  background: var(--primary-soft);
}

.related-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.55;
}

.related-item span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Floating AI Chat (Cursor-like) ===== */
:root {
  --chat-dock-w: min(400px, 92vw);
}

.chat-fab {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--chat-z);
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e4fa3 0%, #123A78 58%, #0d2b5c 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(18, 58, 120, 0.38), 0 0 0 4px rgba(37, 99, 235, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.22s ease;
  padding: 13px;
}

.chat-fab img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.chat-fab:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px rgba(18, 58, 120, 0.46), 0 0 0 5px rgba(37, 99, 235, 0.16);
}

.chat-fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.8);
}

.chat-panel {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--chat-z);
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 48px));
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 22px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 44px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.22s ease,
    box-shadow 0.22s ease,
    left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-panel.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

/* Cursor-like left sidebar dock */
.chat-panel.docked {
  left: 0;
  right: auto;
  top: 0;
  bottom: 0;
  width: var(--chat-dock-w);
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  border: 0;
  border-inline-end: 1px solid #e5e7eb;
  box-shadow: 12px 0 40px rgba(15, 23, 42, 0.12);
  opacity: 1;
  transform: translateX(-105%);
  pointer-events: none;
}

.chat-panel.docked.open {
  transform: translateX(0);
  pointer-events: auto;
}

body.chat-sidebar-open .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
  margin-left: var(--chat-dock-w);
  width: calc(100% - var(--chat-dock-w));
  transition:
    margin-left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.chat-sidebar-open .app-sidebar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  border-inline-end: 0;
  padding: 0;
}

body.chat-sidebar-open:not(.has-app-shell) {
  padding-left: var(--chat-dock-w);
}

#chatDock .chat-float-ico[hidden],
#chatDock .chat-dock-ico[hidden] {
  display: none;
}

#chatDock[aria-pressed="true"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary-deep, #123a78);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid #ececf1;
  color: #0d0d0d;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background-color: #123a78;
  -webkit-mask: url("/static/assets/razmind-mark.png") center / contain no-repeat;
  mask: url("/static/assets/razmind-mark.png") center / contain no-repeat;
}

.chat-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0d0d0d;
  line-height: 1.25;
}

.chat-header p {
  margin: 0;
  font-size: 12px;
  color: #8e8ea0;
  line-height: 1.35;
}

.chat-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.chat-header-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.15s ease;
}

.chat-header-actions button:hover {
  background: #eef2f7;
  border-color: #e2e8f0;
  color: #0f172a;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background:
    radial-gradient(800px 280px at 50% 0%, rgba(239, 246, 255, 0.55), transparent 60%),
    #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-row {
  display: flex;
  animation: msgIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.msg-row.user {
  justify-content: flex-start;
}

.msg-row.bot {
  align-items: flex-start;
  gap: 12px;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1e4fa3 0%, #123a78 60%, #0d2b5c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 6px 14px rgba(18, 58, 120, 0.22);
  display: grid;
  place-items: center;
}

.msg-avatar::after {
  content: "";
  width: 18px;
  height: 18px;
  background-color: #fff;
  -webkit-mask: url("/static/assets/razmind-mark.png") center / contain no-repeat;
  mask: url("/static/assets/razmind-mark.png") center / contain no-repeat;
}

.msg-body {
  min-width: 0;
  flex: 1;
}

.msg-bubble {
  max-width: 100%;
  word-break: break-word;
}

.msg-row.user .msg-bubble {
  max-width: 88%;
  margin-inline-start: 0;
  margin-inline-end: auto;
  padding: 10px 14px;
  background: #f4f4f5;
  border: 1px solid #ececf1;
  color: #0d0d0d;
  border-radius: 18px 18px 18px 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.msg-row.bot .bot-bubble {
  padding: 4px 0;
  color: #1e293b;
  font-size: 13.75px;
  line-height: 1.85;
  letter-spacing: -0.01em;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.msg-row.bot:first-child .bot-bubble {
  padding: 4px 0;
}

.msg-row.bot:first-child .bot-bubble p {
  color: #1e3a5f;
  font-weight: 500;
}

.bot-bubble > *:first-child {
  margin-top: 0;
}

.bot-bubble > *:last-child {
  margin-bottom: 0;
}

.bot-bubble p {
  margin: 0 0 10px;
}

.bot-bubble h1,
.bot-bubble h2,
.bot-bubble h3 {
  margin: 14px 0 8px;
  color: #0f172a;
  line-height: 1.4;
  font-weight: 700;
}

.bot-bubble h1 { font-size: 1.15em; }
.bot-bubble h2 { font-size: 1.08em; }
.bot-bubble h3 { font-size: 1.02em; }

.bot-bubble ul,
.bot-bubble ol {
  margin: 0 0 10px;
  padding-inline-start: 1.35em;
}

.bot-bubble li {
  margin: 0 0 4px;
}

.bot-bubble li::marker {
  color: #64748b;
}

.bot-bubble strong {
  color: #0f172a;
  font-weight: 700;
}

.bot-bubble em {
  font-style: italic;
}

.bot-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 5px;
}

.bot-bubble pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

.bot-bubble pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
}

.msg-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  min-height: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e8edf5;
  border-radius: 14px 14px 14px 6px;
  box-shadow: 0 8px 20px rgba(15, 47, 99, 0.05);
}

.msg-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatDot 1.2s infinite ease-in-out;
}

.msg-typing span:nth-child(1) { animation-delay: 0s; }
.msg-typing span:nth-child(2) { animation-delay: 0.18s; }
.msg-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes chatDot {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
    background: #123a78;
  }
}

.chat-input-bar {
  display: block;
  padding: 10px 14px 14px;
  border-top: 1px solid #f1f1f3;
  background: #fff;
}

.chat-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 22px;
  padding: 8px 8px 8px 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02), 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-composer-box:focus-within {
  border-color: #93c5fd;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.14),
    0 8px 24px rgba(30, 64, 175, 0.08);
}

.chat-input-bar textarea {
  flex: 1;
  resize: none;
  min-height: 28px;
  max-height: 120px;
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 8px 4px;
  font: inherit;
  font-size: 14px;
  outline: none;
  line-height: 1.5;
  background: transparent;
  color: #0d0d0d;
}

.chat-input-bar textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}

.chat-send:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.chat-send .icon {
  width: 18px;
  height: 18px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.footer-logo {
  height: 48px;
  width: auto;
  display: block;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .research-head,
  .layout {
    grid-template-columns: 1fr;
  }

  .meta-strip {
    grid-template-columns: 1fr 1fr;
  }

  .meta-strip-item:nth-child(2) {
    border-left: 0;
  }

  .meta-strip-item:nth-child(1),
  .meta-strip-item:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .eval-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .jump-agent {
    margin-right: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .back-link span,
  .back-link {
    font-size: 12px;
  }

  .header-admin {
    display: none;
  }

  .research-title {
    font-size: 20px;
  }

  .research-masthead {
    padding: 20px 18px 22px;
  }

  .insight-band {
    padding: 20px 18px 22px;
  }

  .research-head {
    gap: 20px;
  }

  .meta-strip {
    grid-template-columns: 1fr;
  }

  .meta-strip-item {
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .meta-strip-item:last-child {
    border-bottom: 0;
  }

  .eval-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .chat-fab,
  .chat-panel:not(.docked) {
    left: 50%;
    bottom: 12px;
  }

  .chat-panel.docked {
    width: min(100vw, 420px);
  }

  body.chat-sidebar-open .app-shell {
    margin-left: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  body.chat-sidebar-open .app-sidebar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.chat-sidebar-open:not(.has-app-shell) {
    padding-left: 0;
  }

  body.chat-sidebar-open {
    overflow: hidden;
  }
}
