:root {
  --void: #04060b;
  --ink: #080b12;
  --ink-2: #0c111a;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #edf0f6;
  --dim: #8d95a8;
  --faint: #5c6577;
  --gold: #e0b46a;
  --gold-dim: rgba(224, 180, 106, 0.5);
  --cool: #7ab4ff;
  --rail-w: 420px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- barra superior ---------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  height: 58px;
  background: rgba(8, 11, 18, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.brand-mark { color: var(--gold); align-self: center; display: flex; }
.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.16em;
}
.brand-tagline {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 340px;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  border-color: var(--gold-dim);
  background: rgba(255, 255, 255, 0.05);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  z-index: 40;
}
.search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.is-active { background: rgba(224, 180, 106, 0.1); }
.search-item .count {
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.search-empty { padding: 12px; font-size: 12px; color: var(--faint); }

.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.live { display: flex; align-items: center; gap: 7px; color: var(--dim); }
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(224, 180, 106, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 180, 106, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(224, 180, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 180, 106, 0); }
}

/* ---------- estructura ---------- */

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 18% 12%, rgba(58, 84, 150, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 45% at 82% 78%, rgba(120, 70, 140, 0.13), transparent 70%),
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(10, 18, 38, 0.85), var(--void) 78%);
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#globe {
  position: absolute;
  inset: 0;
}

.stage-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 24px;
  background: linear-gradient(to top, rgba(4, 6, 11, 0.8), transparent);
  pointer-events: none;
}
.hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.03em;
}

.stage-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s;
}
.stage-loader.is-done { opacity: 0; }
.stage-loader p {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.loader-bar {
  width: 150px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--gold);
  animation: slide 1.3s ease-in-out infinite;
}
@keyframes slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ---------- panel lateral ---------- */

.rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border-left: 1px solid var(--line);
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-country { flex: 1 1 68%; min-height: 260px; border-bottom: 1px solid var(--line); }
.panel-world { flex: 1 1 32%; min-height: 190px; }

.panel-head {
  flex: 0 0 auto;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.panel-title.small {
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.panel-flag { font-size: 20px; line-height: 1; }
.panel-meta {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--dim); }
.tab.is-active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: rgba(224, 180, 106, 0.07);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ghost-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.ghost-btn[disabled] { opacity: 0.4; cursor: default; }

.panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 24px;
  min-height: 0;
}
.panel-body::-webkit-scrollbar { width: 9px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  border: 3px solid var(--ink);
}
.panel-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

.placeholder {
  font-size: 13px;
  line-height: 1.6;
  color: var(--faint);
  margin: 14px 0 0;
  max-width: 34ch;
}

/* ---------- grupos por medio ---------- */

.outlet { margin-top: 20px; }
.outlet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--ink) 62%, rgba(8, 11, 18, 0));
  padding: 8px 0 6px;
  z-index: 2;
}
.outlet-name {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.outlet-rule { flex: 1; height: 1px; background: var(--line); }
.outlet-count {
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.story {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 9px 10px 10px;
  margin: 0 -10px;
  border-radius: 3px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.story:last-child { border-bottom: none; }
.story:hover { background: rgba(255, 255, 255, 0.035); }
.story:hover .story-title { color: #fff; }

.story-title {
  display: block;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.34;
  font-weight: 400;
  color: var(--text);
  transition: color 0.12s;
}
.story-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
.story-source { color: var(--dim); font-weight: 500; }
.story-dot { width: 2px; height: 2px; border-radius: 50%; background: var(--faint); }
.story-time { font-variant-numeric: tabular-nums; }
.story.is-fresh .story-time { color: var(--gold); }

/* ---------- estados ---------- */

.skeleton-list { padding-top: 14px; }
.skeleton {
  height: 13px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton:nth-child(2) { width: 82%; }
.skeleton:nth-child(3) { width: 64%; }
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.notice {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-dim);
  background: rgba(224, 180, 106, 0.04);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dim);
}
.notice strong { color: var(--text); font-weight: 500; }

/* ---------- etiqueta del globo ---------- */

.globe-tip {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(8, 11, 18, 0.9);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 2px;
  white-space: nowrap;
}
.globe-tip .tip-sub {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  body { overflow: auto; }
  .layout { flex-direction: column; }
  .stage { flex: none; height: 52vh; min-height: 340px; }
  .rail {
    flex: none;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .panel-body { overflow: visible; max-height: none; }
  .panel-country, .panel-world { flex: none; }
  .brand-tagline { display: none; }
  .topbar { gap: 14px; }
}

@media (max-width: 620px) {
  .status .updated { display: none; }
  .panel-title { font-size: 21px; }
}
