:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: rgba(18, 18, 30, .78);
  --line: rgba(255, 255, 255, .11);
  --text: #f6f8ff;
  --muted: #9da5b8;
  --cyan: #00d4ff;
  --orange: #ff6b35;
  --green: #00ff88;
  --purple: #a855f7;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 8%, rgba(0, 212, 255, .09), transparent 28rem),
    radial-gradient(circle at 5% 80%, rgba(168, 85, 247, .1), transparent 32rem),
    var(--bg);
  color: var(--text);
}

.ambient {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  pointer-events: none;
}
.ambient-a { background: var(--cyan); right: -8rem; top: 18rem; }
.ambient-b { background: var(--purple); left: -9rem; bottom: 4rem; }

main { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 42px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(25, 26, 43, .86), var(--panel));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 34px;
  border-top: 3px solid var(--cyan);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font: 700 12px/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(34px, 5vw, 68px); line-height: 1.05; }
h2 { margin: 0; font-size: clamp(21px, 2.3vw, 32px); }
.lead { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.8; }
.portal-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.portal-links a, .newsroom-actions a, .world-open {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 13px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.connection {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(4, 5, 10, .38);
}
.connection.public-deployment .key-row { display: none; }
.connection.public-deployment label { color: var(--green); font-weight: 800; }
label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.key-row, .campaign-actions { display: flex; gap: 9px; }
input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(2, 3, 8, .72);
  color: var(--text);
  outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 212, 255, .1); }
button {
  border: 0;
  border-radius: 12px;
  padding: 11px 17px;
  background: linear-gradient(120deg, var(--cyan), #0097e6);
  color: #00141c;
  font-weight: 800;
  cursor: pointer;
}
button:disabled { opacity: .38; cursor: not-allowed; }

.status {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.neutral { color: var(--muted); background: rgba(157, 165, 184, .1); }
.ok { color: var(--green); background: rgba(0, 255, 136, .1); }
.blocked { color: var(--orange); background: rgba(255, 107, 53, .13); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.metric { padding: 22px; text-align: center; }
.metric strong { display: block; color: var(--cyan); font-size: 38px; }
.metric span { color: var(--muted); }

.grid.two { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.grid.two.lower { grid-template-columns: 1.25fr .75fr; margin-top: 16px; }
.authority, .flow-card, .campaign, .newsroom-stage, .world-stage, .lower > .panel { padding: 26px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-title .status { margin: 0; }
dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
dl div { padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 5px 0 0; word-break: break-word; }
a { color: var(--cyan); }
.boundary { margin: 0; padding: 15px; border-right: 3px solid var(--orange); background: rgba(255, 107, 53, .07); color: #f1c2af; line-height: 1.7; }

.flow { display: grid; gap: 9px; margin: 20px 0 0; padding: 0; list-style: none; }
.flow li { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.flow b { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: var(--bg); background: var(--green); }

.campaign { margin-top: 16px; }
.campaign-actions input { width: 190px; }
.newspaper-ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; direction: ltr; }
.paper {
  direction: rtl;
  position: relative;
  min-height: 128px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 7, 14, .55);
}
.paper::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--progress, 0%);
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.paper small { color: var(--muted); }
.paper h3 { margin: 9px 0; font-size: 16px; }
.paper .paper-count { color: var(--cyan); font: 700 13px "JetBrains Mono", Consolas, monospace; }
.paper .paper-leads { display: block; margin-top: 7px; color: var(--green); font-size: 12px; }
.run-summary { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 18px; }
.run-summary span { padding: 9px 13px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); }
.run-summary strong { color: var(--text); }

.newsroom-stage, .world-stage { margin-top: 16px; }
.newsroom-actions { display: flex; align-items: center; gap: 9px; }
.newsroom-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin: 16px 0; }
.newsroom-standings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.news-standing, .news-rejection {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 14, .55);
}
.news-standing { display: grid; grid-template-columns: 31px 1fr; gap: 9px; padding: 11px; }
.news-standing > b {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: rgba(168,85,247,.2);
  color: #d8c3ff;
}
.news-standing strong, .news-standing small, .news-standing span,
.news-rejection strong, .news-rejection span { display: block; }
.news-standing small, .news-standing span, .news-rejection small, .news-rejection span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.newsroom-rejections { display: grid; gap: 8px; }
.news-rejection { padding: 12px; border-color: rgba(255,107,53,.3); }
.news-rejection span { color: #f1b49c; }
.world-frame {
  height: min(72vh, 760px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #07080d;
}
.world-frame iframe { width: 100%; height: 100%; border: 0; }

.table-wrap { max-height: 390px; overflow: auto; border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 13px; text-align: right; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 1; background: #151625; color: var(--muted); font-size: 12px; }
td { font-size: 13px; }
.empty { padding: 45px; text-align: center; color: var(--muted); }
.verified { color: var(--green); }
.rejected { color: var(--orange); }

.listings { display: grid; gap: 11px; }
.listing { padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.listing-head { display: flex; justify-content: space-between; gap: 10px; }
.listing.listed { border-color: rgba(0, 255, 136, .36); }
.listing.candidate { border-color: rgba(255, 107, 53, .35); }
.listing p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.market-message { margin-top: 14px; padding: 14px; border-radius: 13px; background: rgba(168, 85, 247, .1); color: #d8c3ff; line-height: 1.7; }
footer { padding: 24px 8px 0; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .hero, .grid.two, .grid.two.lower { grid-template-columns: 1fr; }
  .newspaper-ladder { grid-template-columns: repeat(3, 1fr); }
  .newsroom-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  main { width: min(100% - 18px, 1440px); padding-top: 9px; }
  .hero, .authority, .flow-card, .campaign, .newsroom-stage, .world-stage, .lower > .panel { padding: 19px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .newspaper-ladder { grid-template-columns: repeat(2, 1fr); }
  .section-title, .campaign-actions, .key-row { align-items: stretch; flex-direction: column; }
  .newsroom-actions { align-items: stretch; flex-direction: column; }
  .newsroom-standings { grid-template-columns: 1fr; }
  .world-frame { min-height: 640px; }
  dl { grid-template-columns: 1fr; }
}
