:root{
  --bg:#0b1220;           /* page background (dark) */
  --panel:#d1d5db;        /* main panel background (slightly darker gray) */
  --card:#e5e7eb;         /* inner card background (light gray for contrast) */
  --text:#e2e8f0;         /* outside text (on dark bg) */
  --panelText:#0f172a;    /* text color within panel */
  --muted:#94a3b8;        /* secondary text (outside) */
  --panelMuted:#475569;   /* secondary text (inside panel) */
  --accent:#2563eb;       /* primary accent */
  --border:#cbd5e1;       /* borders on light */
}
*{ box-sizing:border-box; }
body{ margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:var(--text); background:var(--bg); }
.masthead{ padding: 8px 0 0; position: relative; z-index: 1; }
.container{
  max-width: 980px; margin: 18px auto; padding: 14px 18px;
  background: rgba(255,255,255,0.85); /* slightly more transparent */
  border:1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  color: var(--panelText);
  backdrop-filter: saturate(120%) blur(1px);
  -webkit-backdrop-filter: saturate(120%) blur(1px);
  background-clip: padding-box;
}
header{ padding:8px 0 12px; border-bottom:none; margin-bottom:12px; }
header h1{ margin:0 0 16px; font-size: 28px; }
/* Site title flair */
.site-title{ display:block; text-align:center; margin:0 0 4px; }
.site-title .site-logo{
  display: block;
  max-height: clamp(144px, 24vh, 320px); /* doubled height */
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: transparent;
}
.site-title .subtitle{ font-size: 14px; color: var(--muted); font-weight:500; }
nav{ display:flex; gap:10px; justify-content: space-evenly; align-items:center; flex-wrap: wrap; 
  background: transparent; /* inherit container background */
  border: none; border-radius: 0; padding: 8px 10px;
}
nav a{
  text-decoration:none; color:var(--panelText); font-weight:600;
  background: #ffffff; /* lighter pill than container */
  border:1px solid #eef2f7; border-radius: 999px; padding:6px 12px;
  transition: all .15s ease;
}
nav a:hover{ background: #ffffff; border-color:#e5e7eb; color:var(--panelText); }
nav a.active{ background: rgba(37,99,235,0.18); border-color: #2563eb; color: #0b1220; }
nav a.disabled{ opacity: .5; pointer-events: none; cursor: not-allowed; }
.card{ background:#ffffff; border:1px solid #eef2f7; border-radius:10px; padding:16px; margin-bottom:16px; color: var(--panelText); }
/* .news-card no longer needed since all cards are light; class kept for compatibility */
button{ background:var(--accent); color:#fff; border:none; border-radius:8px; padding:8px 12px; cursor:pointer; }
button[disabled]{ opacity:.6; cursor: default; }
input, textarea, select{
  width:100%; padding:10px; border:1px solid var(--border); border-radius:8px;
  background:#f8fafc; color:var(--panelText);
}
input::placeholder, textarea::placeholder{ color:#64748b; }
label{ display:block; font-weight:600; margin:10px 0 6px; }
.row{ display:flex; gap:16px; }
.row > *{ flex:1; }
.muted{ color:var(--muted); }
.pill{ display:inline-block; padding:4px 10px; border-radius:999px; border:1px solid var(--border); font-size:12px; }

/* Findings record layout in admin */
.finding-record{display:flex;gap:1rem;align-items:flex-start;border-bottom:1px solid var(--border);padding:.75rem 0}
.finding-record .col{flex:1}
.finding-record .col.meta{flex:0 0 220px;color:var(--panelMuted)}
.finding-link{color:var(--accent);text-decoration:none;font-weight:600;transition:color .18s ease, opacity .12s ease}
.finding-link:hover{text-decoration:underline}
/* Stronger scope-specific rule to ensure discovery links are not rendered with the browser default blue */
.container a.finding-link, .finding-link, a.finding-link { color: var(--accent) !important; text-decoration: none !important; }
.container a.finding-link:hover, .finding-link:hover, a.finding-link:hover { text-decoration: underline !important; }
.vote { display:inline-flex; gap:8px; align-items:center; }
.vote button{ padding:4px 8px; }

/* Subtle small unpublish button for admin on public discoveries page */
.unpublish-btn{background:transparent;border:1px solid rgba(0,0,0,0.06);color:var(--panelMuted);padding:.15rem .4rem;border-radius:6px;font-size:.8rem;margin-left:.5rem;cursor:pointer}
.unpublish-btn:hover{background:rgba(0,0,0,0.02);color:var(--accent)}
.para{ padding:12px; border-left:3px solid transparent; position:relative; cursor:pointer; }
.para:hover{ background: rgba(2,6,23,0.06); }
.para.pos{ border-left-color:#16a34a; background:#f0fdf4; }
.para.neg{ border-left-color:#dc2626; background:#fef2f2; }
.chart{ height:200px; border:1px solid var(--border); border-radius:8px; background:#f8fafc; width:100%; display:block; }
.full-bleed{ width:100%; margin-left:0; }
.story-wrap{ max-width:760px; margin:0 auto; }
/* News items behave like paragraphs: reveal actions on click */
.news-item{ cursor: pointer; }
.news-item:hover{ background: rgba(2,6,23,0.06); }
.news-item > .vote,
.news-item > .cform,
.news-item > div[id^="cl_"] { display: none; }
.news-item.open > .vote,
.news-item.open > .cform,
.news-item.open > div[id^="cl_"] { display: block; }

/* additonal app utilities */
.spinner{width:16px;height:16px;border:2px solid #9aa3b2;border-top-color:var(--accent);border-radius:50%;display:inline-block;animation:spin .7s linear infinite;vertical-align:middle}
@keyframes spin{to{transform:rotate(360deg)}}
.table{width:100%;border-collapse:collapse}
.table th,.table td{border-bottom:1px solid var(--border);padding:.5rem;text-align:left}
.highlight{background:#fde68a}
.ln{white-space:pre;display:block}
.ln.highlight{border-left:4px solid #f59e0b;padding-left:.5rem;font-weight:600}
.code{font-family:ui-monospace,Consolas,monospace;background:#f8fafc;border:1px solid var(--border);border-radius:6px;padding:.5rem;display:block;white-space:pre;overflow:auto}

/* Utility helper to hide elements (used for lazy snippet rows) */
.hidden{display:none}

/* Reduce vertical padding in discovery tables and ensure snippet iframe rows are flush */
.table th, .table td{padding:.45rem .5rem}
.table tr[id^="snippet_"] td{padding:0}

/* Decorative bottom-right figure */
.page-figure{
  position: fixed;
  right: 0; /* align to the right edge */
  bottom: 0; /* align to the bottom edge */
  height: 75vh;
  width: auto;
  opacity: 1; /* fully visible */
  pointer-events: none; /* non-interactive */
  user-select: none;
  z-index: 0; /* sit behind content panels */
  /* fade out to the left: fully visible on right 30%, then fade to 0 */
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
  transform: translateX(125px); /* shift 125px further to the right */
}
/* Keep main content above the figure */
.container, header, .masthead, main, nav, .card { position: relative; z-index: 1; }
