:root {
  --bg: #f3f0e8;
  --bg-deep: #16313a;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #fffdfa;
  --line: rgba(22, 49, 58, 0.12);
  --text: #13272f;
  --muted: #607079;
  --accent: #0f766e;
  --accent-strong: #0b5e57;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 25px 60px rgba(13, 34, 41, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --structure-graph-height: calc(100vh - 130px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(196, 165, 108, 0.18), transparent 28%),
    linear-gradient(135deg, #efe7d8 0%, #eef4f2 55%, #dde9e6 100%);
  min-height: 100vh;
}

.shell-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

body.authenticated .app-shell {
  width: calc(100% - 32px);
  max-width: none;
}

body.structure-active .app-shell {
  padding-bottom: 0;
}

body.authenticated .hero-panel {
  max-width: 1380px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.hero-panel,
.panel,
.summary-card,
.topbar {
  backdrop-filter: blur(18px);
}

.hero-panel {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero-copy {
  background: linear-gradient(180deg, rgba(22, 49, 58, 0.92), rgba(22, 49, 58, 0.82));
  color: #f4efe3;
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow);
}

.hero-copy h1,
.topbar h2,
.panel h3,
.login-card h2 {
  font-family: "Manrope", sans-serif;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  line-height: 0.98;
  margin-top: 18px;
}

.hero-copy p {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 50rem;
  color: rgba(244, 239, 227, 0.84);
}

.eyebrow,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.hero-metrics article {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.hero-metrics strong,
.summary-card strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.hero-metrics span {
  color: rgba(244, 239, 227, 0.72);
}

.login-card,
.panel,
.summary-card,
.topbar {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.login-card {
  border-radius: var(--radius-xl);
  padding: 34px;
  display: grid;
  gap: 18px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.login-logo {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 25% 20%, rgba(20, 184, 166, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.18);
}

.login-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 16px;
}

.login-card .login-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.12;
}

.login-copy p {
  max-width: 24rem;
  margin: 10px auto 0;
  line-height: 1.5;
}

.login-field {
  position: relative;
}

.login-field-label {
  display: block;
}

.login-field-icon {
  position: absolute;
  left: 16px;
  bottom: 15px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent-strong);
  opacity: 0.75;
  pointer-events: none;
}

.login-field input {
  padding-left: 48px;
}

.login-card h2 {
  font-size: 2rem;
  margin-top: 10px;
}

.login-card p,
.form-note,
.form-error,
.summary-card span,
.user-badge small,
.data-sub {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: help;
}

.tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #16313a;
  color: #f5f3ed;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 16px 36px rgba(12, 28, 33, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10;
}

.tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 10px;
  width: 12px;
  height: 12px;
  background: #16313a;
  transform: rotate(45deg);
}

.info-tip:hover .tooltip,
.info-tip:focus .tooltip {
  opacity: 1;
  transform: translateY(0);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.96);
  border-radius: 14px;
  padding: 14px 15px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #13857c);
  color: white;
}

.btn-secondary {
  background: rgba(19, 39, 47, 0.08);
  color: var(--text);
}

.topbar {
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  animation: lift 0.5s ease;
  position: sticky;
  top: 12px;
  z-index: 30;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex: 1 1 420px;
  min-width: 300px;
  max-width: 520px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-deep);
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  min-height: 1.25em;
  white-space: normal;
  line-height: 1.18;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
  min-height: 1em;
  white-space: nowrap;
}

.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(19, 39, 47, 0.06);
}

.nav-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.nav-btn.is-active {
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: 0 5px 18px rgba(15, 67, 63, 0.09);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(19, 39, 47, 0.06);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-strong);
}

.data-title {
  display: block;
  font-weight: 700;
}

.workspace-page {
  display: none;
  margin-top: 22px;
  animation: lift 0.35s ease;
}

#structure-page.workspace-page {
  margin-top: 12px;
}

.workspace-page.is-active {
  display: block;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 6px 6px;
}

.page-intro h1 {
  margin: 8px 0 6px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.05;
}

.page-intro p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 158px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: min-height .28s ease, transform .24s ease, box-shadow .24s ease;
}

.metric-card.is-expanded {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(20, 43, 47, .12);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 16px 0 10px;
  font-family: "Manrope", sans-serif;
  font-size: 2.6rem;
}

.metric-loading span,
.metric-loading strong,
.metric-loading small,
.dashboard-loader {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 43, 47, .06), rgba(20, 43, 47, .13), rgba(20, 43, 47, .06));
  background-size: 220% 100%;
  color: transparent !important;
  animation: dashboard-skeleton 1.15s ease-in-out infinite;
}

.metric-loading span {
  width: 54%;
  height: 16px;
}

.metric-loading strong {
  width: 44%;
  height: 48px;
}

.metric-loading small {
  width: 68%;
  height: 14px;
}

.dashboard-loader {
  display: grid;
  min-height: 120px;
  place-items: center;
  border-radius: 22px;
}

.metric-dark {
  background: var(--bg-deep);
  color: white;
}

.metric-dark span,
.metric-dark small {
  color: rgba(255, 255, 255, 0.68);
}

.metric-alert {
  background: linear-gradient(145deg, #fff8eb, #fffdfa);
  border-color: rgba(180, 83, 9, 0.16);
}

.metric-expand-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  cursor: pointer;
  opacity: .72;
  box-shadow: 0 8px 18px rgba(20, 43, 47, .08);
  transition: transform .24s ease, opacity .24s ease, background .24s ease;
}

.metric-card:hover .metric-expand-btn,
.metric-card.is-expanded .metric-expand-btn {
  opacity: 1;
}

.metric-card.is-expanded .metric-expand-btn i {
  transform: rotate(180deg);
}

.metric-expand-btn i {
  transition: transform .24s ease;
}

.metric-dark .metric-expand-btn {
  background: rgba(255, 255, 255, .13);
  color: white;
}

.metric-expanded-row {
  grid-column: 1 / -1;
  display: grid;
  max-height: 0;
  margin-top: 0;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 20%, rgba(15, 118, 110, .08), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(247,244,236,.76));
  box-shadow: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height .34s ease, opacity .26s ease, transform .26s ease, margin-top .26s ease, padding .26s ease, border-color .26s ease;
}

.metric-expanded-row.is-open {
  max-height: 340px;
  margin-top: 2px;
  padding: 18px 22px;
  border-color: rgba(20, 43, 47, .08);
  box-shadow: 0 18px 42px rgba(20,43,47,.08);
  opacity: 1;
  transform: translateY(0);
  animation: metric-detail-pop .28s ease both;
}

.metric-expanded-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.metric-expanded-head strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.metric-expanded-head small {
  color: var(--muted);
  font-weight: 800;
}

@keyframes metric-detail-pop {
  from { filter: blur(3px); }
  to { filter: blur(0); }
}

@keyframes dashboard-skeleton {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

.metric-detail-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.metric-platform-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(20, 43, 47, .07);
  border-radius: 14px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 8px 18px rgba(20,43,47,.055);
}

.metric-platform-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(19, 39, 47, .055);
}

.metric-platform-icon .source-icon {
  width: 19px;
  height: 19px;
}

.metric-platform-card strong,
.metric-platform-card small {
  display: block;
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-platform-card strong {
  color: var(--ink);
  font-size: .82rem;
  font-weight: 900;
}

.metric-platform-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}

.metric-org-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  overflow: hidden;
}

.metric-org-card,
.metric-more-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 43, 47, .07);
  border-radius: 14px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(20,43,47,.055);
}

.metric-org-card strong {
  display: block;
  overflow: hidden;
  margin: 0;
  color: inherit;
  font-size: .78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-org-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
}

.metric-org-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: .64rem;
  font-weight: 900;
}

.organization-logo.metric-org-logo img {
  position: static;
  inset: auto;
  display: block;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  object-fit: contain;
  transform: none;
}

.metric-more-btn {
  grid-template-columns: 1fr;
  min-width: 0;
  border: 0;
  cursor: pointer;
  font-weight: 950;
  color: var(--accent-strong);
  text-align: center;
}

.metric-more-btn small {
  display: block;
  color: var(--muted);
  font-size: .64rem;
}

.metric-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 14px;
  background: rgba(19, 39, 47, .055);
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
  font-weight: 800;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-panel {
  min-height: 260px;
}

.dashboard-full-row {
  margin-top: 18px;
}

.sentiment-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-height: 246px;
  overflow: visible;
  padding: 12px 0;
}

.sentiment-donut-chart-shell,
.media-mini-donut-shell {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
}

.sentiment-donut-chart-shell {
  width: 252px;
  height: 252px;
  margin: -14px;
}

#sentiment-overview-donut {
  transform: scale(.9);
  transform-origin: center;
}

.sentiment-mini-chart-shell {
  width: 258px;
  height: 258px;
  min-width: 258px;
  min-height: 258px;
  margin: -14px;
}

.hc-donut-chart {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 1px;
  min-height: 1px;
  overflow: visible;
}

.hc-donut-chart .highcharts-container,
.hc-donut-chart svg {
  overflow: visible !important;
}

.hc-donut-center {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  padding-top: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(251, 250, 246, .96);
  color: var(--text);
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(20, 43, 47, .04);
}

.hc-donut-center-button {
  cursor: pointer;
}

.hc-donut-center strong,
.media-donut-center span {
  font-family: "Manrope", sans-serif;
  font-size: 1.62rem;
  line-height: 1;
}

.hc-donut-center span {
  margin-top: -28px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hc-donut-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(20, 43, 47, .12);
}

.hc-tooltip-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  margin-top: 8px;
}

.hc-tooltip-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hc-tooltip-row span {
  opacity: .82;
}

.sentiment-donut {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  flex: 0 0 190px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 22px 48px rgba(20, 43, 47, .13);
  cursor: pointer;
}

.sentiment-donut::after {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #fbfaf6;
  content: "";
}

.sentiment-donut strong {
  position: absolute;
  z-index: 1;
  font-family: "Manrope", sans-serif;
  font-size: 1.6rem;
}

.sentiment-donut span {
  position: absolute;
  z-index: 1;
  margin-top: 48px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sentiment-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.sentiment-platform-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 850;
}

.sentiment-platform-tabs button.is-active {
  background: var(--bg-deep);
  color: white;
}

.sentiment-platform-tabs .source-icon {
  width: 16px;
  height: 16px;
}

.panel-expand-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: var(--accent-strong);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 43, 47, .08);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.panel-expand-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: #fff;
  box-shadow: 0 18px 36px rgba(20, 43, 47, .12);
}

.donut-legend {
  display: grid;
  gap: 12px;
}

.donut-legend span,
.donut-legend button {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  padding: 11px 12px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 9px 22px rgba(20,43,47,.055);
}

.donut-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2e9c72;
}

.donut-legend .neutral i { background: #64748b; }
.donut-legend .negative i { background: #c2413b; }
.donut-legend em { color: var(--muted); font-style: normal; }

.donut-legend strong {
  font-family: "Manrope", sans-serif;
  color: var(--text);
}

.sentiment-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
}

.sentiment-modal.is-open {
  display: block;
}

.sentiment-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 22, .58);
  backdrop-filter: blur(10px);
}

.sentiment-dialog {
  position: absolute;
  inset: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 30px;
  background:
    radial-gradient(circle at 9% 15%, rgba(15, 118, 110, .13), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(100, 116, 139, .12), transparent 30%),
    linear-gradient(135deg, rgba(255, 253, 249, .98), rgba(238, 247, 244, .96));
  box-shadow: 0 40px 100px rgba(3, 12, 15, .34);
}

#sentiment-modal-content {
  height: 100%;
  overflow: auto;
  padding: 26px;
}

.sentiment-deep-loading {
  display: grid;
  min-height: 70vh;
  place-items: center;
  gap: 20px;
}

.sentiment-deep-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin: 0 54px 22px 0;
}

.sentiment-deep-head h2 {
  margin: 6px 0 6px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  letter-spacing: -.05em;
}

.sentiment-deep-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.sentiment-deep-head > strong {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--bg-deep);
  color: #fff;
  box-shadow: 0 16px 34px rgba(19, 39, 47, .16);
}

.sentiment-deep-grid {
  display: grid;
  grid-template-columns: minmax(300px, .92fr) minmax(360px, 1.2fr) minmax(320px, .9fr);
  gap: 16px;
}

.sentiment-deep-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 24px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 20px 45px rgba(20, 43, 47, .08);
}

.sentiment-deep-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.sentiment-deep-panel-head > span {
  font-family: "Manrope", sans-serif;
  font-size: 1.03rem;
  font-weight: 950;
}

.sentiment-current-panel {
  grid-row: span 2;
}

.sentiment-current-panel .sentiment-mini {
  display: grid;
  place-items: center;
  gap: 18px;
}

.sentiment-donut-static {
  cursor: default;
}

.sentiment-signals-panel {
  grid-column: span 2;
}

.sentiment-signal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sentiment-signal-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 108px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(19,39,47,.06), rgba(255,255,255,.78));
}

.sentiment-signal-grid i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(15, 118, 110, .09);
  color: var(--accent-strong);
}

.sentiment-signal-grid span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sentiment-signal-grid strong {
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-breakdown-panel {
  grid-column: span 2;
}

.platform-sentiment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.platform-sentiment-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border-radius: 19px;
  background: rgba(255, 255, 255, .74);
  box-shadow: inset 0 0 0 1px rgba(20, 43, 47, .06);
}

.platform-sentiment-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.platform-sentiment-head > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: rgba(19, 39, 47, .055);
}

.platform-sentiment-head .source-icon {
  width: 22px;
  height: 22px;
}

.platform-sentiment-head strong,
.platform-sentiment-head small {
  display: block;
}

.platform-sentiment-head small {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
}

.platform-sentiment-bars,
.risk-tone-stack {
  display: grid;
  gap: 8px;
}

.platform-sentiment-bars > div,
.risk-tone-stack > div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(19, 39, 47, .045);
  font-size: .78rem;
  font-weight: 900;
}

.platform-sentiment-bars > div::before,
.risk-tone-stack > div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar);
  border-radius: inherit;
  opacity: .16;
  content: "";
}

.platform-sentiment-bars .positive::before,
.risk-tone-stack .positive::before { background: #2e9c72; }
.platform-sentiment-bars .neutral::before,
.risk-tone-stack .neutral::before { background: #64748b; }
.platform-sentiment-bars .negative::before,
.risk-tone-stack .negative::before { background: #c2413b; }

.platform-sentiment-bars span,
.platform-sentiment-bars b,
.risk-tone-stack span,
.risk-tone-stack b {
  position: relative;
  z-index: 1;
}

.sentiment-timeline-panel {
  grid-column: span 2;
}

.sentiment-year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sentiment-year-tabs button {
  padding: 7px 11px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.sentiment-year-tabs button.is-active {
  background: var(--bg-deep);
  color: #fff;
}

.sentiment-line-chart {
  width: 100%;
  min-height: 310px;
}

.highcharts-line-chart {
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.18));
}

.sentiment-chart-grid line {
  stroke: rgba(20, 43, 47, .08);
}

.sentiment-chart-grid text,
.sentiment-month-labels text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sentiment-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(20, 43, 47, .12));
}

.sentiment-line-positive { stroke: #2e9c72; }
.sentiment-line-neutral { stroke: #64748b; }
.sentiment-line-negative { stroke: #c2413b; }
.sentiment-dot-positive { fill: #2e9c72; }
.sentiment-dot-neutral { fill: #64748b; }
.sentiment-dot-negative { fill: #c2413b; }

.sentiment-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.sentiment-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 900;
}

.sentiment-line-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.sentiment-line-legend .positive i { background: #2e9c72; }
.sentiment-line-legend .neutral i { background: #64748b; }
.sentiment-line-legend .negative i { background: #c2413b; }

.media-mini-donut-shell {
  width: 152px;
  height: 152px;
  min-width: 152px;
  min-height: 152px;
  max-width: 152px;
  max-height: 152px;
  margin: -10px;
}

.hc-media-donut-chart {
  width: 152px;
  height: 152px;
  min-width: 152px;
  min-height: 152px;
  max-width: 152px;
  max-height: 152px;
  transform: scale(.8);
  transform-origin: center;
}

.media-donut-center {
  display: none;
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 50%;
  background: rgba(251, 250, 246, .95);
  color: var(--text);
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(20, 43, 47, .04);
}

.media-donut-center span {
  font-size: .82rem;
  font-weight: 950;
}

.metric-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(19, 39, 47, .06);
}

.metric-tab {
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.metric-tab.is-active {
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: 0 5px 15px rgba(15, 67, 63, .09);
}

.analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.analysis-modal.is-open {
  display: block;
}

.analysis-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 29, .48);
  backdrop-filter: blur(8px);
}

.analysis-dialog {
  position: absolute;
  inset: 34px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 12%, rgba(15,118,110,.08), transparent 34%),
    linear-gradient(135deg, rgba(255,253,250,.96), rgba(241,247,245,.94));
  box-shadow: 0 40px 90px rgba(8, 22, 27, .28);
}

.analysis-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(19,39,47,.08);
  color: var(--text);
  cursor: pointer;
}

#analysis-modal-content {
  overflow: auto;
  padding: 28px;
}

.video-dialog {
  position: absolute;
  inset: 5vh 5vw;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: visible;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 0, 51, .16), transparent 36%),
    #0d1117;
  box-shadow: 0 42px 100px rgba(5, 10, 14, .42);
}

#video-modal-content {
  display: grid;
  gap: 16px;
  align-content: center;
  overflow: auto;
  min-height: 100%;
  padding: 28px;
}

.video-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 58px);
  color: #fff;
}

.video-modal-head span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
}

.video-modal-head .source-icon {
  width: 24px;
  height: 24px;
}

.video-modal-head strong {
  overflow: hidden;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-frame-shell {
  overflow: hidden;
  width: 100%;
  max-height: calc(90vh - 112px);
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
}

.video-frame-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal .analysis-close {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.analysis-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-right: 48px;
  margin-bottom: 20px;
}

.analysis-modal-head h3 {
  margin: 6px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}

.analysis-modal-head > strong {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: white;
}

.analysis-loading {
  display: grid;
  min-height: 320px;
  place-items: center;
  color: var(--accent-strong);
  font-size: 2rem;
}

.analysis-result-list {
  display: grid;
  gap: 16px;
}

.analysis-result-card {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.2fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(20,43,47,.08);
  border-radius: 24px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 18px 42px rgba(20,43,47,.08);
}

.analysis-post-side,
.analysis-detail-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.analysis-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(19,39,47,.06);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
}

.analysis-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 18px;
}

.analysis-post-side strong {
  font-family: "Manrope", sans-serif;
  font-size: 1.08rem;
}

.analysis-post-side small,
.analysis-post-side p,
.analysis-detail-side p {
  color: var(--muted);
  line-height: 1.55;
}

.analysis-post-side p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.analysis-metrics,
.analysis-score-row,
.analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-metrics span,
.analysis-score-row span,
.analysis-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(19,39,47,.06);
  color: var(--text);
  font-size: .78rem;
  font-weight: 850;
}

.analysis-score-row .positive { background: rgba(46,156,114,.12); color: #13724d; }
.analysis-score-row .neutral { background: rgba(100,116,139,.14); color: #475569; }
.analysis-score-row .negative { background: rgba(194,65,59,.12); color: #9d2f2a; }

.analysis-detail-side section {
  padding: 13px;
  border: 1px solid rgba(20,43,47,.07);
  border-radius: 18px;
  background: rgba(255,253,250,.62);
}

.analysis-detail-side h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.analysis-post-side a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.analysis-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.analysis-pagination button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-deep);
  color: white;
  cursor: pointer;
}

.analysis-pagination button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.media-donut-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.media-donut-card {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, .72);
  text-align: center;
}

.media-donut-card > strong,
.media-donut-card > small {
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-donut-card > small { color: var(--muted); font-size: .68rem; }

.media-mini-donut {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 50%;
}

.media-mini-donut::after {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fbfaf6;
  content: "";
}

.media-mini-donut span {
  position: absolute;
  z-index: 1;
  max-width: 58px;
  font-size: .72rem;
  font-weight: 800;
}

.media-donut-grid {
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 14px;
}

.media-donut-card {
  position: relative;
  overflow: hidden;
  justify-items: stretch;
  gap: 14px;
  padding: 16px;
  border-color: rgba(20, 43, 47, .1);
  background:
    radial-gradient(circle at 16% 8%, rgba(32, 158, 217, .08), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(247, 244, 236, .78));
  box-shadow: 0 16px 34px rgba(20, 43, 47, .07);
  text-align: left;
}

.media-donut-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #229ed9, #ff0033);
  content: "";
  opacity: .78;
}

.media-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.media-org-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 22px rgba(20, 43, 47, .11);
}

.media-card-head strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: .98rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.media-card-body {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.media-donut-card .media-mini-donut {
  width: 116px;
  height: 116px;
  min-width: 116px;
  min-height: 116px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .7),
    0 12px 26px rgba(20, 43, 47, .12);
}

.media-donut-card .media-mini-donut::after {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #fffdf8, #f2efe7);
  box-shadow: inset 0 0 0 1px rgba(20, 43, 47, .06);
}

.media-donut-card .media-mini-donut span {
  max-width: 68px;
  color: var(--ink);
  font-size: .75rem;
  line-height: 1.05;
  text-align: center;
}

.media-platform-list {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.media-platform-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(20, 43, 47, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .64);
}

.media-platform-row i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--platform-color) 12%, white);
}

.platforms-page {
  --platform-card-bg: rgba(255, 253, 250, .82);
}

.platforms-command {
  display: grid;
  grid-template-columns: minmax(320px, .72fr) minmax(520px, 1fr);
  align-items: stretch;
  gap: 24px;
  margin-top: 20px;
  padding: clamp(18px, 2vw, 26px);
  background:
    radial-gradient(circle at 12% 12%, rgba(20, 184, 166, .12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(15, 118, 110, .08), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(247,244,236,.82));
}

.platforms-command h3 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.platforms-command p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.platforms-command-copy {
  align-self: center;
}

.platform-filter-console {
  align-self: stretch;
  padding: 14px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 18px 34px rgba(20,43,47,.06);
  backdrop-filter: blur(16px);
}

.platform-filter-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.platform-filter-console-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font: 950 .82rem "Manrope", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.platform-filter-console-head i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
}

.platform-filter-console-head em {
  color: var(--muted);
  font: 850 .78rem "Manrope", sans-serif;
  font-style: normal;
}

.platform-filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.platform-periods,
.platform-date-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.platform-periods {
  padding: 6px;
  border-radius: 999px;
  background: rgba(19, 39, 47, .06);
  width: fit-content;
  max-width: 100%;
}

.platform-periods button,
.platform-date-controls select,
.platform-date-controls input {
  min-height: 38px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  font: 850 .82rem "Manrope", sans-serif;
}

.platform-periods button {
  padding: 0 14px;
  cursor: pointer;
}

.platform-periods button.is-active {
  background: var(--bg-deep);
  color: #fff;
  box-shadow: 0 10px 20px rgba(20, 43, 47, .16);
}

.platform-date-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  align-items: end;
}

.platform-date-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font: 900 .68rem "Manrope", sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.platform-date-controls select,
.platform-date-controls input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
}

.platform-date-controls .btn {
  min-height: 38px;
  border-radius: 16px;
  padding: 0 18px;
  white-space: nowrap;
}

.platforms-summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.platform-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--platform-color) 16%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,244,236,.76));
  box-shadow: 0 16px 34px rgba(20, 43, 47, .07);
}

.platform-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--platform-color), transparent);
  content: "";
}

.platform-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.platform-card-icon,
.platform-source-head .source-icon,
.platform-table-name .source-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,.76);
  box-shadow: inset 0 0 0 1px rgba(20,43,47,.06), 0 8px 18px rgba(20,43,47,.08);
}

.platform-card-icon .source-icon {
  width: 22px;
  height: 22px;
}

.platform-card-head strong,
.platform-card-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-card-head strong {
  color: var(--ink);
  font-weight: 950;
}

.platform-card-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 850;
}

.platform-score-ring {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 14px auto 12px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--platform-color) var(--score), rgba(19,39,47,.08) 0);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--platform-color) 18%, transparent);
}

.platform-score-ring::after {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fffdfa;
  content: "";
}

.platform-score-ring b {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.platform-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.platform-card-metrics span,
.platform-card-foot span {
  min-width: 0;
  padding: 8px;
  border-radius: 13px;
  background: rgba(255,255,255,.62);
}

.platform-card-metrics i {
  color: var(--platform-color);
  font-size: .78rem;
}

.platform-card-metrics b,
.platform-card-metrics em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-card-metrics b {
  margin-top: 2px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 950;
}

.platform-card-metrics em,
.platform-card-foot {
  color: var(--muted);
  font-size: .66rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.platform-card-foot {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  text-transform: none;
}

.platform-card-foot b {
  color: var(--ink);
}

.platform-card-loading {
  min-height: 250px;
  animation: dashboard-skeleton 1.15s ease-in-out infinite;
}

.platforms-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr);
  gap: 14px;
  margin-top: 14px;
}

.platforms-chart-card {
  min-width: 0;
}

.platform-chart {
  min-height: 300px;
}

.timeline-card {
  grid-column: 1 / -1;
}

.timeline-card .platform-chart {
  min-height: 390px;
  overflow: hidden;
}

.platform-reset-zoom {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(19,43,47,.08);
  color: #13272f;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(19,43,47,.1);
  transition: transform .18s ease, background .18s ease;
}

.platform-reset-zoom:hover {
  transform: translateY(-1px);
  background: rgba(19,43,47,.14);
}

.platforms-intel-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 14px;
  margin-top: 14px;
}

.platform-leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.platform-leader-card,
.platform-source-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(20,43,47,.07);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 4%, rgba(15,118,110,.09), transparent 32%),
    rgba(255,255,255,.72);
  box-shadow: 0 18px 34px rgba(20,43,47,.055);
}

.platform-leader-card.is-featured {
  background:
    radial-gradient(circle at 12% 0%, rgba(20,184,166,.16), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(247,244,236,.78));
}

.platform-leader-head,
.platform-source-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.platform-leader-head i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: rgba(15,118,110,.1);
  color: var(--accent-strong);
}

.platform-leader-head strong,
.platform-source-head strong {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 950;
}

.platform-leader-hero {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(20,43,47,.07);
  border-radius: 20px;
  background: rgba(255,255,255,.72);
}

.platform-leader-hero .source-icon {
  width: 46px;
  height: 46px;
}

.platform-leader-hero strong,
.platform-leader-hero span {
  display: block;
}

.platform-leader-hero strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.platform-leader-hero span {
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 950;
}

.platform-leader-row {
  display: grid;
  grid-template-columns: 28px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid rgba(20,43,47,.06);
}

.platform-leader-row .source-icon {
  width: 26px;
  height: 26px;
}

.platform-leader-row b,
.platform-leader-row em {
  overflow: hidden;
  color: var(--ink);
  font-size: .86rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-leader-row span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 9px;
  background: rgba(20,43,47,.055);
  color: var(--muted);
  font-size: .74rem;
  font-weight: 950;
}

.platform-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.platform-source-head .source-icon {
  width: 20px;
  height: 20px;
  box-shadow: none;
}

.platform-source-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(20,43,47,.06);
}

.platform-source-logo {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  justify-self: start;
  margin-right: 2px;
}

.platform-source-row strong,
.platform-source-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-source-row strong {
  color: var(--ink);
  font-size: .8rem;
}

.platform-source-row small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.platform-source-row span {
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 950;
}

.platforms-table-panel {
  margin-top: 14px;
}

.platform-comparison-table {
  overflow-x: auto;
}

.platform-comparison-table table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.platform-comparison-table th {
  padding: 0 12px 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.platform-comparison-table td {
  padding: 12px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 850;
}

.platform-comparison-table td:first-child {
  border-radius: 16px 0 0 16px;
}

.platform-comparison-table td:last-child {
  border-radius: 0 16px 16px 0;
}

.platform-table-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.platform-table-name .source-icon {
  width: 22px;
  height: 22px;
  box-shadow: none;
}

.media-platform-row .source-icon {
  width: 16px;
  height: 16px;
}

.media-platform-row b,
.media-platform-row em,
.media-platform-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-platform-row b {
  color: var(--ink);
  font-size: .78rem;
  font-weight: 850;
}

.media-platform-row em {
  color: var(--muted);
  font-size: .76rem;
  font-style: normal;
  font-weight: 800;
}

.media-platform-row strong {
  min-width: 38px;
  color: var(--platform-color);
  font-size: .76rem;
  font-weight: 950;
  text-align: right;
}

.media-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(20, 43, 47, .045);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.media-card-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.media-card-foot .source-icon {
  width: 16px;
  height: 16px;
}

.media-card-foot b {
  color: var(--ink);
  font-size: .9rem;
}

.search-hero {
  position: relative;
  overflow: hidden;
  padding: 18px 22px 14px;
  background:
    radial-gradient(circle at 12% 20%, rgba(20, 184, 166, .16), transparent 28%),
    radial-gradient(circle at 85% 6%, rgba(13, 110, 253, .12), transparent 30%),
    linear-gradient(135deg, rgba(255, 253, 248, .98), rgba(239, 247, 244, .9));
}

.search-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(20, 43, 47, .07);
  filter: blur(4px);
}

.search-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.search-hero-copy h2 { margin-bottom: 8px; }
.search-hero-copy p { margin: 0; color: var(--muted); font-weight: 700; }

.global-search-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 0;
}

.search-input-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 16px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 24px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 45px rgba(20, 43, 47, .08);
}

.search-input-shell > i {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(20, 184, 166, .12);
  color: var(--accent-strong);
}

.global-search-form input {
  padding-left: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}

.popular-searches {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  margin-bottom: 0;
}

.popular-searches span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.popular-searches button {
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.popular-searches button:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 14px 30px rgba(20, 43, 47, .1);
}

.search-platform-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 4px;
}

.search-platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(20, 43, 47, .06);
  cursor: pointer;
  text-align: left;
}

.search-platform-tab.is-active {
  border-color: rgba(20, 184, 166, .36);
  background: var(--bg-deep);
  color: white;
}

.search-tab-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(20, 184, 166, .1);
}

.search-platform-tab.is-active .search-tab-icon { background: rgba(255, 255, 255, .16); }
.search-tab-icon .source-icon { width: 20px; height: 20px; }
.search-platform-tab span:last-child { display: grid; gap: 2px; }
.search-platform-tab b { font-size: .84rem; }
.search-platform-tab small { color: var(--muted); font-size: .72rem; font-weight: 900; }
.search-platform-tab.is-active small { color: rgba(255, 255, 255, .72); }

.search-tab-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(20, 184, 166, .22);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: search-spin .75s linear infinite;
}

.platform-search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.platform-results {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.platform-results-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,255,255,.56));
  color: var(--text);
  cursor: pointer;
}

.platform-results-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-align: left;
}

.platform-results-title strong,
.platform-results-title small {
  display: block;
}

.platform-results-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.platform-results-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 15px;
  background: rgba(20, 184, 166, .1);
}

.platform-results-icon .source-icon {
  width: 23px;
  height: 23px;
}

.platform-results-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.platform-results-actions .fa-chevron-down {
  transition: transform .22s ease;
}

.platform-results.is-collapsed .platform-results-actions .fa-chevron-down {
  transform: rotate(-90deg);
}

.platform-results-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.platform-results.is-collapsed .platform-results-body {
  display: none;
}

.search-result-list { display: grid; gap: 10px; }
.search-result-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: #fffdfa; }
.search-result-card > img, .search-result-fallback { width: 112px; aspect-ratio: 16/9; border-radius: 11px; object-fit: cover; }
.search-result-fallback { display: grid; place-items: center; background: rgba(20, 184, 166, .1); }
.search-result-fallback .source-icon { width: 26px; height: 26px; }
.search-result-card strong, .search-result-card small { display: block; }
.search-result-card p { display: -webkit-box; overflow: hidden; margin: 5px 0; color: var(--muted); font-size: .78rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-result-card a { color: var(--accent-strong); font-size: .78rem; font-weight: 800; text-decoration: none; }
.search-result-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; color: var(--muted); font-size: .72rem; font-weight: 900; }
.search-result-meta span { display: inline-flex; align-items: center; gap: 5px; }
.social-search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.social-result-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 238px;
  padding: 15px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(34, 158, 217, .14), transparent 32%),
    #fffdfa;
  box-shadow: 0 16px 34px rgba(20, 43, 47, .08);
}

.twitter-result-card {
  background:
    radial-gradient(circle at top left, rgba(17, 24, 39, .12), transparent 32%),
    #fffdfa;
}

.social-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.social-result-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
}

.social-result-avatar img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-result-avatar .source-icon {
  width: 25px;
  height: 25px;
}

.social-result-head strong,
.social-result-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-result-head small {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
}

.social-result-card p {
  display: -webkit-box;
  flex: 1;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: .86rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.social-result-card a {
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 900;
  text-decoration: none;
}

.tweet-embed-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  min-width: 0;
  break-inside: avoid;
}

.tweet-wrapper {
  min-width: 0;
  overflow: visible;
}

.tweet-wrapper .twitter-tweet,
.tweet-wrapper iframe {
  width: 100% !important;
  max-width: 100% !important;
}

.twitter-embed-masonry {
  column-count: 4;
  column-gap: 14px;
}

.telegram-embed-card {
  display: inline-block;
  min-width: 0;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
}

.telegram-embed-masonry {
  column-count: 4;
  column-gap: 14px;
}

.telegram-embed-shell {
  min-width: 0;
  min-height: 238px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.telegram-embed-shell iframe {
  width: 100% !important;
  max-width: 100% !important;
}

.telegram-embed-loading {
  min-height: 238px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.telegram-embed-loading .source-icon {
  width: 34px;
  height: 34px;
}

.youtube-search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.youtube-search-card {
  min-width: 0;
  color: #f5f7f7;
}

.youtube-search-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #111;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(12, 18, 21, .14);
}

.youtube-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s ease;
}

.youtube-search-thumb:hover img {
  transform: scale(1.035);
}

.youtube-search-thumb span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #171717;
}

.youtube-search-thumb .source-icon {
  width: 34px;
  height: 34px;
}

.youtube-search-body {
  padding: 9px 2px 0;
  color: var(--text);
}

.youtube-search-body strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.7em;
  font-size: .88rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.youtube-search-body small,
.youtube-search-meta {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
}

.youtube-search-body small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.youtube-search-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.platform-coming { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.platform-coming i { font-size: 2rem; }
.search-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.search-pagination button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg-deep); color: white; }
.search-loading { grid-column: 1/-1; padding: 80px; text-align: center; font-size: 2rem; }
.search-empty-panel {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 34px;
  border: 1px dashed rgba(20, 43, 47, .18);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .62);
  color: var(--muted);
  text-align: center;
}
.search-empty-panel i { color: var(--accent-strong); font-size: 2.1rem; }
.search-empty-panel strong { color: var(--ink); font-size: 1.05rem; }
.search-skeleton { display: grid; gap: 12px; }
.search-skeleton span {
  height: 76px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(20, 43, 47, .05), rgba(20, 184, 166, .13), rgba(20, 43, 47, .05));
  background-size: 240% 100%;
  animation: skeleton-wave 1.2s ease-in-out infinite;
}

@keyframes search-spin { to { transform: rotate(360deg); } }
@keyframes search-caret { 50% { opacity: 0; } }
@keyframes skeleton-wave { to { background-position: -240% 0; } }

.system-graph { overflow: hidden; }
.three-system-graph {
  position: relative;
  height: var(--structure-graph-height);
  min-height: 520px;
  padding: 0;
  border: 1px solid rgba(20, 43, 47, .08);
  background:
    radial-gradient(circle at 48% 36%, rgba(20, 184, 166, .16), transparent 19%),
    radial-gradient(circle at 46% 70%, rgba(124, 58, 237, .14), transparent 21%),
    radial-gradient(circle at 78% 44%, rgba(29, 104, 255, .13), transparent 24%),
    radial-gradient(circle at 10% 14%, rgba(34, 158, 217, .16), transparent 21%),
    radial-gradient(circle at 94% 8%, rgba(255, 0, 51, .08), transparent 26%),
    linear-gradient(135deg, rgba(252, 250, 245, .96), rgba(238, 246, 243, .78));
}

.three-system-graph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 118, 110, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000 38%, transparent 78%);
  pointer-events: none;
}

.three-graph-toolbar {
  position: absolute;
  top: 28px;
  left: 30px;
  z-index: 4;
  display: grid;
  gap: 5px;
  max-width: 520px;
}

.three-system-graph .three-graph-toolbar {
  display: none;
}

.three-graph-toolbar strong {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.5vw, 2.35rem);
  font-weight: 950;
  letter-spacing: -.04em;
}

.three-graph-toolbar small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.three-graph-stage {
  position: relative;
  height: 100%;
  min-height: 520px;
}

.three-graph-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.three-graph-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.three-node-icon {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,.96), rgba(255,255,255,.58) 42%, rgba(255,255,255,.2)),
    rgba(255,255,255,.64);
  box-shadow:
    0 0 0 10px rgba(255,255,255,.48),
    0 0 0 16px rgba(255,255,255,.23),
    0 22px 42px rgba(20,43,47,.16);
  color: var(--ink);
  font-size: 1.65rem;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.three-node-icon.is-core {
  width: 68px;
  height: 68px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255,255,255,.58), transparent 14%),
    linear-gradient(145deg, rgba(0, 126, 133, .94), rgba(7, 58, 67, .96));
  color: white;
  box-shadow:
    0 0 0 12px rgba(20, 184, 166, .16),
    0 0 0 25px rgba(20, 184, 166, .08),
    0 26px 56px rgba(0, 126, 133, .28);
}

.three-node-icon[data-kind="dashboard"] {
  width: 74px;
  height: 74px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255,255,255,.64), transparent 14%),
    linear-gradient(145deg, #35a8ff, #173cc3);
  color: white;
  box-shadow:
    0 0 0 12px rgba(29, 104, 255, .16),
    0 0 0 26px rgba(29, 104, 255, .08),
    0 26px 60px rgba(29, 104, 255, .25);
}

.three-node-icon[data-kind="telegram"] { color: #229ed9; }
.three-node-icon[data-kind="youtube"] { color: #ff0033; }
.three-node-icon[data-kind="instagram"] { color: #d62976; }
.three-node-icon[data-kind="ai"] { color: #0f766e; }
.three-node-icon[data-kind="rss"] { color: #f59e0b; }
.three-node-icon[data-kind="website"] { color: #2563eb; }
.three-node-icon[data-kind="facebook"] { color: #1877f2; }
.three-node-icon[data-kind="x"] { color: #111827; }

.three-node-icon[data-kind="facebook"],
.three-node-icon[data-kind="telegram"],
.three-node-icon[data-kind="instagram"],
.three-node-icon[data-kind="x"],
.three-node-icon[data-kind="youtube"],
.three-node-icon[data-kind="website"],
.three-node-icon[data-kind="rss"] {
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
  box-shadow:
    0 0 0 8px rgba(255,255,255,.44),
    0 0 0 13px rgba(255,255,255,.2),
    0 16px 30px rgba(20,43,47,.13);
}

.three-label {
  position: absolute;
  z-index: 3;
  min-width: 168px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 18px;
  background: rgba(255, 253, 248, .78);
  box-shadow: 0 18px 42px rgba(20, 43, 47, .12);
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}

.three-label.is-hover-label {
  pointer-events: none;
  top: 26px !important;
  right: 26px;
  left: auto !important;
  width: min(270px, 26vw);
  opacity: 0;
  transform: translateY(-8px) scale(.96);
  transition: opacity .2s ease, transform .2s ease;
}

.three-label.is-hover-label.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.three-label.is-core {
  min-width: 190px;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(13, 45, 51, .86);
  color: white;
}

.three-label i {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  font-size: 1.12rem;
}

.three-label.is-core i {
  background: rgba(255,255,255,.15);
}

.three-label strong {
  display: block;
  font-size: .9rem;
  font-weight: 950;
}

.three-label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.three-label.is-core small {
  color: rgba(255,255,255,.68);
}

.three-platform-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.three-platform-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid rgba(20, 43, 47, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
}

.three-platform-stats b {
  overflow: hidden;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.three-platform-stats small {
  margin: 0;
  color: var(--muted);
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.three-platform-counter {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 7px;
  width: 320px;
  padding: 10px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 18px;
  background: rgba(255, 253, 248, .84);
  box-shadow: 0 16px 34px rgba(20,43,47,.1);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(15px);
}

.three-counter-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 950;
}

.three-counter-head .source-icon {
  width: 18px;
  height: 18px;
}

.three-counter-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.three-counter-grid {
  display: grid;
  grid-template-columns: minmax(58px, .75fr) minmax(96px, 1.25fr) minmax(96px, 1.25fr);
  gap: 7px;
}

.three-counter-grid span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 6px;
  border-radius: 11px;
  background: rgba(20, 43, 47, .055);
  text-align: center;
}

.three-counter-grid b {
  overflow: visible;
  color: var(--ink);
  font-size: clamp(.58rem, .62vw, .78rem);
  font-weight: 950;
  white-space: nowrap;
}

.three-counter-grid small {
  overflow: visible;
  color: var(--muted);
  font-size: clamp(.42rem, .42vw, .5rem);
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.three-label[data-kind="telegram"] i,
.three-label[data-kind="telegram"] strong { color: #229ed9; }
.three-label[data-kind="youtube"] i,
.three-label[data-kind="youtube"] strong { color: #ff0033; }
.three-label[data-kind="instagram"] i,
.three-label[data-kind="instagram"] strong { color: #d62976; }
.three-label[data-kind="ai"] i,
.three-label[data-kind="ai"] strong { color: #0f766e; }
.three-label[data-kind="rss"] i,
.three-label[data-kind="rss"] strong { color: #f59e0b; }
.three-label[data-kind="website"] i,
.three-label[data-kind="website"] strong { color: #2563eb; }
.three-label[data-kind="facebook"] i,
.three-label[data-kind="facebook"] strong { color: #1877f2; }
.three-label[data-kind="x"] i,
.three-label[data-kind="x"] strong { color: #111827; }

.three-child-label {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 126px;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 14px 30px rgba(20,43,47,.1);
  color: #0f2a35;
  font-size: .78rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.three-child-label.is-satellite {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .2s ease, transform .2s ease;
}

.three-child-label.is-satellite.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.three-child-label i {
  color: var(--accent-strong);
}

.three-child-label[data-kind="facebook"] i,
.three-child-label[data-kind="facebook"] { color: #1877f2; }
.three-child-label[data-kind="telegram"] i,
.three-child-label[data-kind="telegram"] { color: #229ed9; }
.three-child-label[data-kind="instagram"] i,
.three-child-label[data-kind="instagram"] { color: #d62976; }
.three-child-label[data-kind="youtube"] i,
.three-child-label[data-kind="youtube"] { color: #ff0033; }
.three-child-label[data-kind="website"] i,
.three-child-label[data-kind="website"] { color: #2563eb; }
.three-child-label[data-kind="rss"] i,
.three-child-label[data-kind="rss"] { color: #f59e0b; }
.three-child-label[data-kind="x"] i,
.three-child-label[data-kind="x"] { color: #111827; }

.three-insight-label {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 116px;
  min-height: 116px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 28%, rgba(255,255,255,.94), rgba(255,255,255,.78) 42%, rgba(255,255,255,.48)),
    rgba(255,255,255,.68);
  box-shadow:
    0 0 0 7px rgba(255,255,255,.32),
    0 20px 42px rgba(20,43,47,.12);
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
}

.three-insight-label.is-satellite {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.88);
  transition: opacity .2s ease, transform .2s ease;
}

.three-insight-label.is-satellite.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.three-insight-label i {
  color: #1d68ff;
  font-size: 1.35rem;
}

.three-insight-label small {
  color: #23445a;
  font-size: .58rem;
  font-weight: 950;
  line-height: 1.22;
}

.three-insight-label strong {
  color: #007c83;
  font-size: 1rem;
  font-weight: 950;
}

.three-insight-label[data-kind="ai"] i,
.three-insight-label[data-kind="ai"] strong {
  color: #7c3aed;
}

.matrix-sorters { display: inline-flex; gap: 3px; margin-left: 6px; }
.matrix-sorters button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 7px; background: rgba(19,39,47,.08); color: var(--muted); cursor: pointer; }
.matrix-sorters button.is-active { background: var(--accent); color: white; }
.matrix-sorters button.is-asc { transform: rotate(180deg); }
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.72);
}

.rank-item strong {
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  color: var(--accent-strong);
  font-weight: 800;
}

#dashboard-risks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.risk-date-filters {
  display: grid;
  justify-items: end;
  gap: 7px;
  max-width: min(620px, 60vw);
}

.risk-filter-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.risk-filter-row button {
  min-width: 46px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #627279;
  font-size: .72rem;
  font-weight: 950;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.risk-filter-row button:hover,
.risk-filter-row button:focus-visible,
.risk-filter-row button.is-active {
  border-color: rgba(194, 65, 59, .22);
  background: rgba(194, 65, 59, .1);
  color: #9f2f2b;
  outline: none;
  transform: translateY(-1px);
}

.risk-post-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 13px;
  width: 100%;
  min-height: 142px;
  padding: 16px;
  border: 1px solid rgba(194, 65, 59, .18);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(194, 65, 59, .12), transparent 38%),
    rgba(255, 253, 250, .86);
  box-shadow: 0 18px 38px rgba(20, 43, 47, .08);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.risk-post-card:hover,
.risk-post-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(194, 65, 59, .36);
  box-shadow: 0 22px 46px rgba(20, 43, 47, .12);
  outline: none;
}

.risk-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.risk-post-platform {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 9px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}

.risk-platform-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1px var(--line);
}

.risk-platform-icon .source-icon {
  width: 19px;
  height: 19px;
}

.risk-post-platform span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-post-date {
  flex: 0 0 auto;
  color: #7b8a8f;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .01em;
  white-space: nowrap;
}

.risk-post-card > strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: .94rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.risk-post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.risk-score-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.risk-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(194, 65, 59, .1);
  color: #a8322d;
  font-size: .84rem;
  font-weight: 950;
}

.risk-score-pill.is-critical {
  background: rgba(127, 29, 29, .12);
  color: #7f1d1d;
}

.risk-score-pill.is-high {
  background: rgba(194, 65, 59, .11);
  color: #a8322d;
}

.risk-score-pill.is-medium {
  background: rgba(194, 129, 41, .12);
  color: #9a5d12;
}

.topics-panel .topics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.topics-panel .topics-grid .rank-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 68px;
  padding: 12px;
  width: 100%;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.topics-panel .topics-grid .rank-item strong {
  max-width: 100%;
  font-size: .84rem;
  line-height: 1.2;
}

.topics-panel .topics-grid .rank-item:hover {
  border-color: rgba(15, 118, 110, .28);
  box-shadow: 0 16px 34px rgba(15, 118, 110, .1);
  transform: translateY(-2px);
}

.topic-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: rgba(15, 118, 110, .09);
  color: var(--accent-strong);
  font-size: .95rem;
}

.settings-stack {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.settings-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.form-actions .btn {
  min-width: 190px;
}

.is-hidden {
  display: none !important;
}

.source-type-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.source-type-fieldset legend {
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.source-type-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 10px;
}

.source-type-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 13px 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.source-type-btn img,
.source-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.source-type-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.38);
}

.source-type-btn.is-selected {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.source-type-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.field-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.data-card {
  position: relative;
}

.data-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.organization-logo {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #edf3f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.organization-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
  background: white;
}


.organization-logo.matrix-logo {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 12px;
}

.organization-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.organization-identity > div:last-child {
  min-width: 0;
}

.organization-identity small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.data-card-main {
  min-width: 0;
}

.data-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.action-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(19, 39, 47, 0.07);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.action-btn.danger {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.matrix-page {
  width: 100%;
}

.matrix-shell {
  width: 100%;
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-matrix {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

.source-matrix th,
.source-matrix td {
  padding: 13px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-matrix th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8efec;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.source-matrix th:first-child,
.source-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 240px;
  background: #f8f7f2;
}

.source-matrix th:first-child {
  z-index: 4;
  background: #dfeae6;
}

.source-matrix tr:last-child td {
  border-bottom: 0;
}

.source-cell {
  position: relative;
  min-width: 170px;
  margin: -13px -16px;
  padding: 13px 16px;
  min-height: calc(100% + 26px);
  overflow: hidden;
}

.source-cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 18px solid #16a06d;
  border-left: 18px solid transparent;
}

.source-disconnected::after {
  border-top-color: #d0443d;
}

.source-cell a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.source-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.source-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 7px;
}

.source-metrics span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 26px;
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  color: #284743;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.source-metric-placeholder {
  visibility: hidden;
}

.source-metrics i {
  width: 16px;
  color: #087f72;
  font-size: 0.9rem;
  text-align: center;
}

.source-empty {
  color: #9aa5a9;
  font-size: 0.88rem;
}


.summary-grid,
.content-grid,
.tables-grid {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: lift 0.55s ease;
}

.summary-card strong {
  font-size: 2rem;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tables-grid {
  grid-template-columns: 1.05fr 1fr;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
  animation: lift 0.6s ease;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font: 850 .78rem "Manrope", sans-serif;
}

.panel-help-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.92), rgba(255,255,255,.56)),
    rgba(15, 118, 110, .08);
  color: var(--accent-strong);
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(20,43,47,.08);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.panel-help-btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(15,118,110,.2);
}

.influence-help-card {
  display: grid;
  gap: 18px;
  padding: 4px;
}

.influence-help-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.65;
}

.influence-help-formula {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20,43,47,.08);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15,118,110,.1), rgba(255,255,255,.72));
}

.influence-help-formula span {
  color: var(--accent-strong);
  font: 950 .76rem "Manrope", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.influence-help-formula code {
  color: var(--ink);
  font: 950 1.05rem "Manrope", sans-serif;
}

.influence-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.influence-help-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(20,43,47,.055);
}

.influence-help-grid b {
  color: var(--accent-strong);
  font-size: 1.2rem;
}

.influence-help-grid span {
  color: var(--ink);
  font: 900 .78rem "Manrope", sans-serif;
}

.influence-help-note {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: rgba(15,118,110,.08);
}

.stack-form {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-error,
.form-note {
  min-height: 20px;
  margin: 0;
  font-size: 0.92rem;
}

.form-error {
  color: var(--danger);
}

.data-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.data-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}

.data-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.chip.warn {
  background: rgba(180, 83, 9, 0.1);
  color: var(--warn);
}

.empty-state {
  border: 1px dashed rgba(96, 112, 121, 0.45);
  border-radius: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .hero-panel,
  .content-grid,
  .tables-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platforms-command,
  .platforms-visual-grid,
  .platforms-intel-grid {
    grid-template-columns: 1fr;
  }

  .platform-date-controls {
    grid-template-columns: repeat(2, minmax(160px, 1fr)) auto;
  }

  .platforms-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-leaderboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topics-panel .topics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-result-card {
    grid-template-columns: 1fr;
  }

  .sentiment-deep-grid,
  .sentiment-signals-panel,
  .platform-breakdown-panel,
  .sentiment-timeline-panel {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .sentiment-signal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-org-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .source-type-buttons {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }

  .youtube-search-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .telegram-embed-masonry {
    column-count: 3;
  }

  .twitter-embed-masonry {
    column-count: 3;
  }

  .social-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-copy,
  .login-card {
    padding: 28px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 10px;
  }

  .topbar {
    padding: 20px;
    align-items: flex-start;
    flex-direction: column;
    position: static;
  }

  .main-nav,
  .topbar-actions {
    width: 100%;
    overflow-x: auto;
  }

  .dashboard-metrics,
  .dashboard-overview-grid,
  .settings-lists {
    grid-template-columns: 1fr;
  }

  .platforms-summary-grid,
  .platform-leaderboard-grid,
  .platform-source-grid {
    grid-template-columns: 1fr;
  }

  .platform-periods,
  .platform-date-controls {
    width: 100%;
  }

  .platform-periods button,
  .platform-date-controls .btn {
    flex: 1 1 130px;
  }

  .platform-date-controls {
    grid-template-columns: 1fr;
  }

  .platform-filter-console-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-donut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-search-grid { grid-template-columns: 1fr; }
  .global-search-form { grid-template-columns: 1fr; }
  .search-hero { padding: 16px; }
  .search-platform-tab { min-width: 0; }
  .search-platform-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .youtube-search-grid,
  .social-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telegram-embed-masonry { column-count: 2; }
  .twitter-embed-masonry { column-count: 2; }
  #dashboard-risks { grid-template-columns: 1fr; }
  .search-result-card { grid-template-columns: 1fr; }
  .search-result-card > img, .search-result-fallback { width: 100%; }
  .topics-grid { grid-template-columns: 1fr; }

  .sentiment-donut-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .sentiment-donut {
    margin: 0 auto;
  }

  .analysis-dialog {
    inset: 10px;
    border-radius: 22px;
  }

  .sentiment-dialog {
    inset: 8px;
    border-radius: 22px;
  }

  .video-dialog {
    inset: 10px;
    border-radius: 22px;
  }

  #video-modal-content {
    padding: 16px;
  }

  .video-frame-shell {
    max-height: calc(100vh - 112px);
    border-radius: 16px;
  }

  #sentiment-modal-content {
    padding: 18px;
  }

  .sentiment-deep-head {
    align-items: flex-start;
    flex-direction: column;
    margin-right: 48px;
  }

  .sentiment-signal-grid,
  .platform-sentiment-grid {
    grid-template-columns: 1fr;
  }

  #analysis-modal-content {
    padding: 18px;
  }

  .analysis-modal-head {
    align-items: flex-start;
    flex-direction: column;
    margin-right: 46px;
  }

  .metric-org-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .source-type-buttons {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .hero-copy h1 {
    font-size: 2.4rem;
  }
}
