:root{
  --ink: #0f172a;
  --muted: rgba(15, 23, 42, 0.62);
  --line: rgba(15, 23, 42, 0.10);
  --surface: rgba(255,255,255,0.66);
  --surface2: rgba(255,255,255,0.46);
}

body {
  font-family: system-ui, Arial, sans-serif;
  margin: 0;
  color: var(--ink);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

input, select, button {
  padding: 10px;
  font-size: 16px;
  line-height: 1.2;
}

/* Make dropdowns match input height */
select {
  min-height: 42px;
}


button { cursor: pointer; }

small { color: #666; }

a { color: inherit; }

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

/* Generic card style used across pages */
.card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  padding: 16px;
  margin-top: 16px;
}

/* Generic list utility */
.list {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
}

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

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

.list.compact li { padding: 9px 0; }

/* Badges / small muted chips */
.muted.small {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface2);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Footer */
.footer {
  padding: 18px 0 28px;
}

.footer-inner {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 900px) {
  .filters-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Stories page feed polish (scoped) */
.stories-page .story-item {
  padding: 10px 0 12px;
}

.stories-page .story-company {
  font-size: 15px;
}

.stories-page .story-date {
  font-size: 11px;
  color: rgba(0,0,0,0.55);
}

.stories-page .story-meta {
  margin-top: 3px;
}

.stories-page .story-meta .badge {
  padding: 2px 8px;
}

.stories-page .story-excerpt {
  margin-top: 6px;
  line-height: 1.4;
}

.stories-page .story-link {
  margin-top: 6px;
}

.stories-page .story-link a {
  font-weight: 600;
  text-decoration: none;
}

.stories-page .story-link a:hover {
  text-decoration: underline;
}

/* ===== Companies row: name on line 1, stats centered-ish on line 2, CTA far right ===== */

.company-row{
  padding: 16px 0;
  border-bottom: 1px solid rgba(15,23,42,0.10);
}

.company-name-line{
  margin-bottom: 10px;
}

.company-name{
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

/* Line 2 layout: left stats | middle stats | far-right CTA */
.company-stats-row{
  display: grid;
  grid-template-columns: 260px 360px 1fr; /* left stats, middle stats, flexible spacer for CTA */
  align-items: start;
  column-gap: 22px;
}

/* Keep ratings in the middle, not drifting right */
.company-stats-row .stats-left{ justify-self: start; }
.company-stats-row .stats-mid{ justify-self: start; }

/* CTA always far right */
.company-stats-row .stats-cta{
  justify-self: end;
  align-self: center;
}

/* tighter key/value spacing */
.stat-line{
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  column-gap: 10px;
  margin: 6px 0;
}

.stat-label{
  font-size: 13px;
  color: rgba(0,0,0,0.64);
}

.stat-value{
  font-size: 15px;
  font-weight: 800;
  color: rgba(0,0,0,0.84);
}

/* middle column has 2x2 */
.subratings{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 22px;
}

.subrating{
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  column-gap: 10px;
}

.subrating-label{
  font-size: 13px;
  color: rgba(0,0,0,0.64);
}

.subrating-value{
  font-size: 15px;
  font-weight: 800;
  color: rgba(0,0,0,0.84);
}

/* Details centered under BOTH rating columns */
.company-details-row{
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.btn-details{
  display: inline-block;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(0,0,0,0.16);
  color: var(--ink);
}

.btn-details:hover{
  background: rgba(255,255,255,0.32);
  border-color: rgba(0,0,0,0.22);
}

/* make View stories button-like */
.company-actions .btn-primary{
  padding: 10px 14px;
}

/* Responsive */
@media (max-width: 980px){
  .company-stats-row{
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .company-stats-row .stats-cta{
    justify-self: start;
  }
  .subratings{
    grid-template-columns: 1fr 1fr;
  }
}

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


/* =========================================
   Global atmosphere (all pages except Home)
   ========================================= */

body.atmo {
  background:
    radial-gradient(1200px 520px at 50% 0%, rgba(59, 130, 246, 0.18), rgba(255,255,255,0)),
    radial-gradient(900px 420px at 15% 40%, rgba(99, 102, 241, 0.14), rgba(255,255,255,0)),
    radial-gradient(900px 420px at 85% 55%, rgba(147, 51, 234, 0.10), rgba(255,255,255,0)),
    linear-gradient(180deg, rgba(245, 247, 255, 1) 0%, rgba(255,255,255,1) 60%, rgba(255,255,255,1) 100%);
}

/* Floating panels everywhere (non-home) */
body.atmo .card {
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: linear-gradient(
    180deg,
    rgba(248, 251, 255, 0.62),
    rgba(245, 248, 255, 0.38)
  );
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Softer dividers inside cards */
body.atmo .section-head {
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

/* Sticky nav: keep it “floating” without a hard divider */
body.atmo .topbar {
  border-bottom: 0;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}


