:root {
  --bg: #f3f4f7;
  --paper: #ffffff;
  --line: #d8dce4;
  --line-strong: #bac1cc;
  --ink: #222;
  --muted: #5f636c;
  --subtle: #8a93a3;
  --link: #1a56b2;
  --link-hover: #123a78;
  /* Yahoo-ish red, slightly warmer (a touch toward orange) and less neon. */
  --brand: #ff1a0a;
  --topline: #2a66c9;
  --maxw: 1200px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  /* Yahoo-like: prioritize Helvetica/Arial, then Japanese gothics. */
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "MS PGothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.news-link {
  color: inherit;
  text-decoration: none;
}

.news-link:hover {
  text-decoration: underline;
}

.news-link:focus-visible {
  outline: 2px solid rgba(31, 98, 201, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.topline {
  height: 6px;
  background: linear-gradient(90deg, #2a66c9 0%, #3d7de0 100%);
}

.site-header {
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
}

.header-wrap {
  width: min(100% - 24px, var(--maxw));
  margin: 0 auto;
  padding: 10px 0 12px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  background: #fff;
}

.brand-main {
  font-size: 34px;
  line-height: 1;
  color: var(--brand);
  letter-spacing: 0.01em;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-sub {
  color: #30343a;
  font-size: 18px;
  font-weight: 700;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-chip {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #2c3139;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-chip:hover {
  text-decoration: none;
  color: #15181d;
  border-color: #9aa3b3;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.icon-chip:focus-visible {
  outline: 2px solid rgba(31, 98, 201, 0.55);
  outline-offset: 2px;
}

.search-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
}

.search-row input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.search-row button {
  height: 38px;
  border: 1px solid #1f4f9f;
  border-radius: 4px;
  background: #1f62c9;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.global-nav {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.global-nav a {
  color: #2f333a;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 3px;
}

.global-nav a[aria-current="page"] {
  background: #ebf2ff;
  color: #1f4f9f;
  font-weight: 700;
}

.page {
  width: min(100% - 24px, var(--maxw));
  margin: 10px auto 28px;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 12px;
}

.lead-section,
.right-rail {
  min-width: 0;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.section-title-row h1,
.section-title-row h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.generated {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.lead-grid {
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.lead-card {
  padding: 16px;
  border-right: 1px solid var(--line);
  min-height: 320px;
}

.lead-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.lead-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.lead-thumb .sigil {
  display: block;
  width: 100%;
  height: 100%;
}

.lead-head-body {
  min-width: 0;
}

.lead-card .category {
  margin: 0;
  font-size: 11px;
  color: #6f85a8;
  font-weight: 700;
}

.lead-title {
  margin-top: 6px;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff0f0;
  color: #b21b1b;
  border: 1px solid #f1b4b4;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.lead-card .summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #3d424c;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.lead-card .meta {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--subtle);
}

.top6-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.top6-list li {
  border-bottom: 1px solid var(--line);
}

.top6-list li:last-child {
  border-bottom: 0;
}

.top6-list article {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.top-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.top-thumb .sigil {
  display: block;
  width: 100%;
  height: 100%;
}

.major-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.top-meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--subtle);
}

.right-rail {
  display: grid;
  gap: 12px;
}

.rail-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.rail-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.rail-card ul {
  margin: 0;
  padding-left: 18px;
}

.rail-card li,
.rail-card p {
  margin: 0 0 8px;
  color: #3d424c;
  font-size: 13px;
  line-height: 1.6;
}

/* X insight pages: give the short intro more weight than the long body. */
.lab-card #introText {
  font-size: 16px;
  line-height: 1.85;
  margin: 14px 0 0;
  padding-bottom: 24px;
}

.lab-card #summaryText {
  font-size: 16px;
  line-height: 1.9;
  padding-top: 24px;
}

.lab-card hr {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.lab-card #summaryText p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.9;
}

.lab-card #summaryText p:last-child {
  margin-bottom: 0;
}

/* Compare page help list (keep consistent with rail-card typography). */
.compare-help {
  margin: 0;
  padding-left: 18px;
}

.stream-section {
  margin-top: 12px;
}

.stream-list {
  display: grid;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.stream-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.stream-item.has-thumb {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.stream-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.stream-thumb .sigil {
  display: block;
  width: 100%;
  height: 100%;
}

.stream-body {
  min-width: 0;
}

.stream-item:last-child {
  border-bottom: 0;
}

.stream-category {
  margin: 0 0 4px;
  font-size: 11px;
  color: #6f85a8;
  font-weight: 700;
}

.stream-item h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.stream-summary {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #3d424c;
}

.stream-meta {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--subtle);
}

.paper-subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.paper-links {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-links a {
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
}

.paper-links a:hover {
  text-decoration: underline;
}

/* Compare page */
.compare-kpis {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compare-combined {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.compare-combined .section-title-row {
  margin-bottom: 6px;
}

.compare-combined .section-title-row h2 {
  font-size: 18px;
  font-weight: 900;
}

.compare-summary {
  margin: 6px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
  white-space: pre-line;
}

.combo-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.combo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.combo-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: #1f2937;
}

.combo-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.combo-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.combo-legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.combo-chart {
  margin-top: 8px;
}

.combo-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}

.kpi-key {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.kpi-val {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 900;
  color: #1f2937;
}

.kpi-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--subtle);
}

.kpi-spark {
  margin-top: 6px;
  height: 86px;
}

.kpi-spark .spark {
  width: 100%;
  height: 86px;
  display: block;
}

.kpi-axis {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--subtle);
  font-weight: 700;
}

.compare-line {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.compare-details {
  margin-top: 10px;
}

.compare-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: #1f4f9f;
  user-select: none;
}

.compare-detail-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #3d424c;
  font-size: 12px;
  line-height: 1.6;
}

.site-footer {
  border-top: 1px solid var(--line-strong);
  background: #fff;
}

.footer-wrap {
  width: min(100% - 24px, var(--maxw));
  margin: 0 auto;
  padding: 14px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-wrap p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .content {
    grid-template-columns: 1fr;
  }

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

  .lead-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .header-wrap {
    width: min(100% - 16px, var(--maxw));
  }

  .page {
    width: min(100% - 16px, var(--maxw));
    margin-top: 8px;
  }

  .brand-main {
    font-size: 26px;
  }

  .brand-sub {
    font-size: 14px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 6px;
  }

  .lead-card {
    padding: 12px;
  }

  .lead-head {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .lead-thumb {
    width: 52px;
    height: 52px;
    border-radius: 11px;
  }

  .lead-title {
    margin-top: 6px;
  }

  .top6-list article {
    padding: 9px 10px;
  }

  .top6-list article {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .top-thumb {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .stream-item {
    padding: 10px 12px;
  }

  .stream-item.has-thumb {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .stream-thumb {
    width: 42px;
    height: 42px;
    border-radius: 9px;
  }

  .stream-item h3 {
    font-size: 17px;
  }

  .compare-kpis {
    grid-template-columns: 1fr;
    gap: 8px;
  }

}
