: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);
}

body[data-theme="dark"] {
  --bg: #081117;
  --bg-deep: #07131a;
  --panel: rgba(14, 26, 34, 0.78);
  --panel-strong: #111f29;
  --line: rgba(196, 217, 225, 0.16);
  --text: #edf7fb;
  --muted: #9cb1bd;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  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;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.18);
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.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;
  overflow: hidden;
  background: #fff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.nav-btn i {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
  font-size: .92rem;
}

.nav-btn span {
  white-space: nowrap;
}

.nav-btn.is-active {
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: 0 5px 18px rgba(15, 67, 63, 0.09);
}

.nav-btn:hover {
  transform: translateY(-1px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, .64);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 67, 63, .08);
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle i {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 118, 110, .18), rgba(255, 255, 255, .72));
  color: var(--accent-strong);
}

.theme-toggle.is-dark i {
  background: linear-gradient(135deg, rgba(251, 191, 36, .22), rgba(45, 212, 191, .12));
  color: #fbbf24;
}

.topbar-icon-btn {
  display: inline-grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .64);
  box-shadow: 0 10px 28px rgba(15, 67, 63, .08);
}

.topbar-icon-btn i {
  font-size: 1.05rem;
}

.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;
}

/* Monitoring command center */
.command-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 9px 0 13px;
  border: 1px solid rgba(15, 118, 110, .14);
  border-radius: 15px;
  background: rgba(15, 118, 110, .07);
  color: var(--accent-strong);
  font: 800 .72rem "Manrope", sans-serif;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.command-open:hover {
  transform: translateY(-1px);
  background: rgba(15, 118, 110, .12);
  box-shadow: 0 12px 26px rgba(15, 118, 110, .1);
}

.command-open > i {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #20cbb8, #087d75);
  color: white;
  box-shadow: 0 7px 16px rgba(15, 118, 110, .22);
}

.command-open kbd,
.command-palette kbd {
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 7px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, .68);
  color: var(--muted);
  font: 750 .62rem "Manrope", sans-serif;
  box-shadow: inset 0 -1px 0 rgba(20, 43, 47, .06);
}

.dashboard-command-deck {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(390px, .85fr);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 84% 32%, rgba(45, 212, 191, .22), transparent 30%),
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, .15), transparent 34%),
    linear-gradient(135deg, #0a222b 0%, #0d3038 53%, #09242e 100%);
  color: #ecfeff;
  box-shadow: 0 30px 80px rgba(6, 31, 38, .22);
}

.dashboard-command-deck::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(94, 234, 212, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, .055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, black, transparent 90%);
}

.command-deck-copy {
  align-self: center;
  width: 100%;
  max-width: none;
  padding: 42px 50px;
}

.command-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(94, 234, 212, .2);
  border-radius: 999px;
  background: rgba(45, 212, 191, .08);
  color: #99f6e4;
  font: 800 .7rem "Manrope", sans-serif;
}

.command-live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .5);
  animation: command-live-pulse 1.8s ease-out infinite;
}

.command-kicker {
  margin: 25px 0 7px;
  color: #5eead4;
  font: 850 .72rem "Manrope", sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.command-deck-copy h1 {
  max-width: 980px;
  margin: 0;
  font: 850 clamp(2.15rem, 3.45vw, 4.15rem)/.98 "Manrope", sans-serif;
  letter-spacing: -.055em;
}

.command-deck-copy > p:not(.command-kicker) {
  max-width: 820px;
  margin: 18px 0 0;
  color: rgba(224, 247, 250, .68);
  font-size: .94rem;
  line-height: 1.65;
}

.command-deck-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.command-primary,
.command-secondary {
  border: 1px solid rgba(255, 255, 255, .12);
  color: #ecfeff;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.command-primary:hover,
.command-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, .36);
}

.command-primary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  min-width: min(100%, 350px);
  padding: 11px 14px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(45, 212, 191, .23), rgba(14, 116, 144, .17));
  text-align: left;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
}

.command-primary > i:first-child,
.command-secondary > i {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
}

.command-primary > i:first-child {
  width: 38px;
  height: 38px;
  color: #5eead4;
}

.command-primary b,
.command-primary small {
  display: block;
}

.command-primary b {
  font: 850 .8rem "Manrope", sans-serif;
}

.command-primary small {
  margin-top: 3px;
  color: rgba(224, 247, 250, .55);
  font-size: .66rem;
}

.command-secondary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 15px;
  border-radius: 17px;
  background: rgba(255, 255, 255, .055);
  font: 800 .72rem "Manrope", sans-serif;
}

.command-secondary > i {
  width: 30px;
  height: 30px;
  color: #67e8f9;
}

.command-orbit {
  position: relative;
  display: grid;
  min-height: 390px;
  place-items: center;
}

.command-orbit::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(45, 212, 191, .15) 0 24%, transparent 25%),
    repeating-radial-gradient(circle, rgba(103, 232, 249, .08) 0 1px, transparent 1px 38px);
  opacity: .72;
  filter: drop-shadow(0 0 35px rgba(45, 212, 191, .08));
}

.command-orbit-core {
  position: relative;
  z-index: 4;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(165, 243, 252, .28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 23%, rgba(255, 255, 255, .28), transparent 18%),
    linear-gradient(145deg, rgba(34, 211, 238, .7), rgba(13, 148, 136, .32) 48%, rgba(2, 44, 54, .94));
  box-shadow:
    inset -18px -24px 44px rgba(0, 0, 0, .24),
    inset 10px 12px 30px rgba(255, 255, 255, .12),
    0 0 0 16px rgba(45, 212, 191, .055),
    0 30px 80px rgba(0, 0, 0, .28);
  text-align: center;
}

.command-orbit-core > i {
  margin-bottom: 9px;
  color: white;
  font-size: 1.4rem;
}

.command-orbit-core b {
  display: flex;
  width: 96%;
  max-width: none;
  justify-content: center;
  overflow: hidden;
  font: 850 var(--command-counter-font-compact, 1.6rem) "Manrope", sans-serif;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
}

.command-counter-value {
  display: inline-flex;
  height: 1.08em;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.08;
  white-space: nowrap;
}

.command-counter-digit {
  display: inline-block;
  width: .61em;
  height: 1.08em;
  overflow: hidden;
  perspective: 120px;
}

.command-counter-digit > span {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--digit) * -1.08em));
  animation: command-digit-arrive .72s cubic-bezier(.16, .84, .24, 1) var(--digit-delay) both;
}

.command-counter-digit i {
  display: block;
  height: 1.08em;
  flex: 0 0 1.08em;
  font: inherit;
  line-height: 1.08;
}

.command-counter-separator {
  display: inline-block;
  height: 1.08em;
  line-height: .88;
}

.command-counter-value.is-loading {
  opacity: .74;
}

.command-counter-value.is-loading .command-counter-digit {
  width: .46em;
  margin-inline: .02em;
  border-radius: 4px;
  background: rgba(224, 247, 250, .08);
}

.command-counter-value.is-loading .command-counter-digit > span {
  animation: command-digit-loading 1.15s steps(10) calc(var(--digit-delay) * -1) infinite;
}

.command-orbit-core small {
  margin-top: 3px;
  color: rgba(224, 247, 250, .64);
  font: 750 .58rem "Manrope", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.command-orbit-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(103, 232, 249, .4);
  border-radius: inherit;
  animation: command-orbit-pulse 2.8s ease-out infinite;
}

.command-orbit-ring {
  position: absolute;
  border: 1px solid rgba(94, 234, 212, .15);
  border-radius: 50%;
}

.ring-one {
  width: 250px;
  height: 250px;
  animation: command-spin 16s linear infinite;
}

.ring-two {
  width: 315px;
  height: 315px;
  border-style: dashed;
  opacity: .58;
  animation: command-spin 24s linear reverse infinite;
}

.orbit-node {
  position: absolute;
  z-index: 5;
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 15px;
  background: rgba(8, 28, 36, .85);
  color: #ecfeff;
  box-shadow: 0 15px 32px rgba(0, 0, 0, .22);
  backdrop-filter: blur(12px);
  animation: command-node-float 4.8s ease-in-out infinite;
}

.orbit-node-one { --node-transform: translate(-118px, -104px) rotate(-8deg); transform: var(--node-transform); color: #38bdf8; }
.orbit-node-two { --node-transform: translate(118px, -104px) rotate(7deg); transform: var(--node-transform); color: #f472b6; animation-delay: -.8s; }
.orbit-node-three { --node-transform: translate(-148px, 34px) rotate(5deg); transform: var(--node-transform); color: #fb7185; animation-delay: -1.6s; }
.orbit-node-four { --node-transform: translate(148px, 34px) rotate(-5deg); transform: var(--node-transform); color: #60a5fa; animation-delay: -2.4s; }
.orbit-node-five { --node-transform: translate(-82px, 132px) rotate(-6deg); transform: var(--node-transform); color: #f8fafc; animation-delay: -3.2s; }
.orbit-node-six { --node-transform: translate(82px, 132px) rotate(6deg); transform: var(--node-transform); color: #2dd4bf; animation-delay: -4s; }

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  visibility: hidden;
  place-items: start center;
  padding: min(16vh, 150px) 18px 18px;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}

.command-palette.is-open {
  visibility: visible;
  opacity: 1;
}

.command-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 14, 19, .64);
  backdrop-filter: blur(16px);
}

.command-palette-dialog {
  position: relative;
  z-index: 2;
  width: min(650px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 24px;
  background: rgba(250, 252, 250, .93);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .36);
  transform: translateY(-12px) scale(.98);
  transition: transform .22s ease;
}

.command-palette.is-open .command-palette-dialog {
  transform: none;
}

.command-palette-search {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.command-palette-search > i {
  color: var(--accent);
}

.command-palette-search input {
  padding: 7px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font: 750 1rem "Manrope", sans-serif;
}

.command-palette-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 7px;
  color: var(--muted);
  font: 800 .66rem "Manrope", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.command-palette-list {
  display: grid;
  gap: 6px;
  max-height: min(52vh, 480px);
  padding: 7px 10px 12px;
  overflow: auto;
}

.command-palette-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.command-palette-item.is-active,
.command-palette-item:hover {
  border-color: rgba(15, 118, 110, .12);
  background: rgba(15, 118, 110, .08);
}

.command-palette-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(45, 212, 191, .18), rgba(14, 116, 144, .08));
  color: var(--accent-strong);
}

.command-palette-item b,
.command-palette-item small {
  display: block;
}

.command-palette-item b { font: 850 .8rem "Manrope", sans-serif; }
.command-palette-item small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.command-palette-empty { padding: 30px; color: var(--muted); text-align: center; }
body.command-palette-open { overflow: hidden; }

@keyframes command-live-pulse {
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes command-orbit-pulse {
  0% { opacity: .6; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(1.35); }
}

@keyframes command-node-float {
  0%, 100% { transform: var(--node-transform) translateY(0); }
  50% { transform: var(--node-transform) translateY(-6px); }
}

@keyframes command-digit-arrive {
  from { filter: blur(4px); opacity: .25; transform: translateY(0); }
  to { filter: blur(0); opacity: 1; transform: translateY(calc(var(--digit) * -1.08em)); }
}

@keyframes command-digit-loading {
  from { transform: translateY(0); }
  to { transform: translateY(-10.8em); }
}

@keyframes command-spin { to { transform: rotate(360deg); } }

body[data-theme="dark"] .command-open {
  border-color: rgba(94, 234, 212, .2);
  background: rgba(45, 212, 191, .08);
  color: #99f6e4;
}

body[data-theme="dark"] .command-open kbd,
body[data-theme="dark"] .command-palette kbd {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
}

body[data-theme="dark"] .command-palette-dialog {
  border-color: rgba(148, 163, 184, .2);
  background: rgba(8, 22, 29, .94);
  box-shadow: 0 42px 120px rgba(0, 0, 0, .6);
}

@media (max-width: 1260px) {
  .command-open span,
  .command-open kbd {
    display: none;
  }

  .command-open {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

@media (min-width: 1320px) {
  .command-deck-copy {
    width: 100%;
    max-width: none;
    padding-inline: clamp(50px, 4vw, 78px) 34px;
  }

  .command-deck-actions {
    display: grid;
    grid-template-columns: minmax(330px, 1.5fr) minmax(210px, 1fr) minmax(190px, .9fr);
    align-items: stretch;
  }

  .command-primary,
  .command-secondary {
    width: auto;
    min-width: 0;
  }

  .command-secondary {
    justify-content: flex-start;
    white-space: nowrap;
  }

  .command-orbit-core {
    width: 218px;
    height: 218px;
  }

  .command-orbit-core > i {
    font-size: 1.7rem;
  }

  .command-orbit-core b {
    font-size: var(--command-counter-font-desktop, 2.65rem);
  }

  .command-orbit-core small {
    margin-top: 7px;
    font-size: .66rem;
  }

  .ring-one {
    width: 292px;
    height: 292px;
  }

  .ring-two {
    width: 365px;
    height: 365px;
  }

  .orbit-node-one { --node-transform: translate(-150px, -126px) rotate(-8deg); }
  .orbit-node-two { --node-transform: translate(150px, -126px) rotate(7deg); }
  .orbit-node-three { --node-transform: translate(-182px, 36px) rotate(5deg); }
  .orbit-node-four { --node-transform: translate(182px, 36px) rotate(-5deg); }
  .orbit-node-five { --node-transform: translate(-104px, 158px) rotate(-6deg); }
  .orbit-node-six { --node-transform: translate(104px, 158px) rotate(6deg); }
}

@media (max-width: 900px) {
  .dashboard-command-deck {
    grid-template-columns: 1fr;
  }

  .command-deck-copy {
    padding: 34px 30px 20px;
  }

  .command-orbit {
    min-height: 310px;
  }

  .ring-two {
    width: 260px;
    height: 260px;
  }
}

@media (max-width: 600px) {
  .dashboard-command-deck {
    min-height: 0;
    border-radius: 24px;
  }

  .command-deck-copy {
    padding: 26px 20px 20px;
  }

  .command-deck-copy h1 {
    font-size: clamp(1.85rem, 10vw, 2.7rem);
  }

  .command-primary,
  .command-secondary {
    width: 100%;
  }

  .command-orbit {
    min-height: 280px;
    transform: scale(.78);
    margin: -24px 0;
  }

  .command-palette {
    align-items: end;
    padding: 12px;
  }

  .command-palette-dialog {
    border-radius: 22px;
  }

  .command-palette-head small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-live-pill i,
  .command-orbit-pulse,
  .command-orbit-ring,
  .command-counter-digit > span {
    animation: none !important;
  }
}

.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-premium-icon {
  position: absolute;
  right: 18px;
  bottom: 16px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, .12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.86), rgba(255,255,255,.18) 42%, transparent 70%),
    linear-gradient(145deg, rgba(20,184,166,.14), rgba(15,118,110,.05));
  color: rgba(15, 118, 110, .62);
  font-size: 1.25rem;
  box-shadow: 0 18px 38px rgba(15, 118, 110, .1);
  pointer-events: none;
}

.metric-loading span,
.metric-loading strong,
.metric-loading small,
.dashboard-loader,
.dashboard-value-loading {
  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;
}

.dashboard-value-loading {
  display: inline-block;
  width: var(--loading-width, 54px);
  max-width: 100%;
  height: .9em;
  min-height: 10px;
  vertical-align: middle;
}

.metric-dark {
  background: var(--bg-deep);
  color: white;
}

.metric-dark span,
.metric-dark small {
  color: rgba(255, 255, 255, 0.68);
}

.metric-dark .metric-premium-icon {
  border-color: rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.24), rgba(255,255,255,.06) 42%, transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  color: rgba(255,255,255,.56);
  box-shadow: 0 18px 38px rgba(0,0,0,.18);
}

.metric-alert {
  background: linear-gradient(145deg, #fff8eb, #fffdfa);
  border-color: rgba(180, 83, 9, 0.16);
}

.metric-alert .metric-premium-icon {
  border-color: rgba(180, 83, 9, .14);
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.86), rgba(255,255,255,.24) 42%, transparent 70%),
    linear-gradient(145deg, rgba(245, 158, 11, .16), rgba(180, 83, 9, .06));
  color: rgba(180, 83, 9, .62);
}

.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(auto-fit, minmax(180px, 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: 16px;
  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-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.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;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
}

.metric-org-counter {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.metric-org-counter i {
  color: var(--muted);
  font-size: .78rem;
}

.metric-org-counter b {
  color: var(--accent-strong);
  font-size: .72rem;
  font-weight: 950;
}

.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;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
}

.media-chart-hover {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 116px;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  background: rgba(19, 39, 47, .94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -50%) scale(.92);
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: 0 14px 34px rgba(10, 25, 31, .26);
}

.media-chart-hover.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.media-chart-hover b {
  font-size: .76rem;
  font-weight: 900;
}

.media-chart-hover span {
  color: rgba(255, 255, 255, .76);
  font-size: .7rem;
  font-weight: 750;
}

.sentiment-donut-chart-shell {
  width: 252px;
  height: 252px;
  margin: -14px;
}

#sentiment-overview-donut {
  display: grid;
  place-items: center;
}

.sentiment-mini-chart-shell {
  width: 258px;
  height: 258px;
  min-width: 258px;
  min-height: 258px;
  margin: -14px;
}

.hc-donut-chart {
  position: relative;
  z-index: 2;
  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-label {
  position: relative;
  z-index: 8;
}

.hc-donut-center {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  display: grid;
  width: auto;
  height: auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: none;
}

.hc-donut-center-button {
  cursor: pointer;
}

.sentiment-donut-chart-shell.is-loading .hc-donut-center {
  pointer-events: none;
}

.sentiment-donut-chart-shell.is-loading .hc-donut-center strong {
  display: grid;
  min-height: 22px;
  place-items: center;
}

.sentiment-donut-chart-shell.is-loading .hc-donut-center span {
  display: grid;
  min-height: 11px;
  place-items: center;
}

.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;
}

.sentiment-donut-chart-shell.is-loading .dashboard-value-loading,
.sentiment-legend.is-loading .dashboard-value-loading {
  opacity: .92;
}

.sentiment-legend.is-loading {
  min-width: 0;
}

.sentiment-legend.is-loading button {
  grid-template-columns: 12px minmax(0, 1fr) 50px 44px;
  min-width: 0;
  overflow: hidden;
}

.sentiment-legend.is-loading button strong,
.sentiment-legend.is-loading button em {
  min-width: 0;
  overflow: hidden;
}

.sentiment-legend.is-loading button strong .dashboard-value-loading,
.sentiment-legend.is-loading button em .dashboard-value-loading {
  width: 100%;
}

.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;
}

.hc-media-donut-chart {
  width: 152px;
  height: 152px;
  min-width: 152px;
  min-height: 152px;
  max-width: 152px;
  max-height: 152px;
}

.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;
}

.search-period-modal.is-open {
  display: grid;
  place-items: center;
  padding: 22px;
}

.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: flex;
  align-items: center;
  justify-content: center;
  min-height: 142px;
}

.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);
}

/* Active media cards: readable without hover */
.active-media-description {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.5;
}

.active-media-panel .metric-tabs {
  margin-top: 2px;
}

.media-donut-grid {
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  align-items: stretch;
}

.media-donut-card {
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 16px;
}

.media-card-head {
  grid-template-columns: 30px 48px minmax(0, 1fr);
  gap: 10px;
}

.media-card-head .media-card-rank {
  display: grid;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  margin: 0;
  place-items: center;
  align-self: center;
  justify-self: center;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 10px;
  background: #edf3f1;
  color: #17313a;
  font-size: .7rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 7px 16px rgba(12, 35, 42, .08);
}

.media-card-identity {
  min-width: 0;
}

.media-card-total {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 10%, rgba(34, 158, 217, .12), transparent 38%),
    rgba(255, 255, 255, .66);
}

.media-card-total > i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: rgba(34, 158, 217, .12);
  color: #168ac0;
  font-size: 1rem;
}

.media-card-total span,
.media-card-total small,
.media-card-total strong {
  display: block;
  min-width: 0;
}

.media-card-total small {
  overflow: hidden;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.media-card-total strong {
  margin-top: 2px;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: -.035em;
}

.media-share-chart {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 999px;
  background: rgba(120, 144, 156, .12);
  box-shadow: inset 0 1px 3px rgba(20, 43, 47, .08);
}

.media-share-chart > span {
  width: calc(var(--share) * 1%);
  min-width: 2px;
  background: var(--platform-color);
  transition: filter .16s ease, transform .16s ease;
}

.media-share-chart > span:hover {
  z-index: 1;
  filter: brightness(1.08) saturate(1.15);
  transform: scaleY(1.35);
}

.media-platform-list {
  gap: 6px;
}

.media-platform-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 8px 9px;
}

.media-platform-row > i.media-platform-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--platform-color) 18%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--platform-color) 10%, white);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--platform-color) 12%, transparent);
}

.media-platform-icon .source-icon {
  width: 19px;
  height: 19px;
  object-fit: contain;
  box-shadow: none;
}

.media-platform-row > span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.media-platform-row b {
  overflow: hidden;
  color: var(--ink);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-platform-row small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 850;
}

.media-platform-row > strong {
  color: var(--ink);
  font-size: .78rem;
  font-weight: 950;
}

.media-card-empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.active-media-load-more {
  display: grid;
  width: min(420px, 100%);
  gap: 8px;
  margin: 22px auto 0;
}

.active-media-load-more[hidden] {
  display: none;
}

.active-media-load-button,
.active-media-load-complete {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid rgba(13, 108, 103, .16);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(231, 247, 244, .76));
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(20, 43, 47, .1), inset 0 1px 0 rgba(255, 255, 255, .92);
}

.active-media-load-button {
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.active-media-load-button:hover {
  border-color: rgba(13, 108, 103, .34);
  box-shadow: 0 18px 38px rgba(20, 43, 47, .14), inset 0 1px 0 rgba(255, 255, 255, .92);
  transform: translateY(-2px);
}

.active-media-load-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #20b7a9, #087c78);
  color: white;
  box-shadow: 0 9px 20px rgba(8, 124, 120, .25);
}

.active-media-load-copy,
.active-media-load-copy b,
.active-media-load-copy small,
.active-media-load-complete span,
.active-media-load-complete b,
.active-media-load-complete small {
  display: block;
  min-width: 0;
}

.active-media-load-copy b,
.active-media-load-complete b {
  font-size: .86rem;
  font-weight: 900;
}

.active-media-load-copy small,
.active-media-load-complete small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
}

.active-media-load-next {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 108, 103, .09);
  color: var(--accent-strong);
  font-size: .75rem;
  font-weight: 950;
}

.active-media-load-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 43, 47, .08);
}

.active-media-load-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ca7d9, #17aa9c);
  transition: width .25s ease;
}

.active-media-load-complete {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 54px;
  color: var(--accent-strong);
}

.active-media-load-complete > i {
  color: #18a987;
  font-size: 1.2rem;
}

.media-donut-card.is-newly-loaded {
  animation: active-media-card-arrive .35s ease both;
}

@keyframes active-media-card-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body[data-theme="dark"] .active-media-load-button,
body[data-theme="dark"] .active-media-load-complete {
  border-color: rgba(93, 230, 213, .15);
  background: linear-gradient(135deg, rgba(17, 42, 50, .94), rgba(11, 31, 41, .9));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
}

body[data-theme="dark"] .active-media-load-progress {
  background: rgba(255, 255, 255, .08);
}

@media (max-width: 1540px) {
  .media-donut-grid {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}

@media (max-width: 1220px) {
  .media-donut-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
  }
}

@media (max-width: 1050px) {
  .media-donut-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

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

  .media-donut-card {
    padding: 14px;
  }
}

body[data-theme="dark"] .media-card-total {
  border-color: rgba(148, 163, 184, .16);
  background:
    radial-gradient(circle at 8% 10%, rgba(45, 212, 191, .1), transparent 38%),
    linear-gradient(135deg, rgba(18, 35, 45, .76), rgba(10, 22, 30, .62));
}

body[data-theme="dark"] .media-card-total > i {
  background: rgba(45, 212, 191, .1);
  color: #5eead4;
}

body[data-theme="dark"] .media-card-total strong,
body[data-theme="dark"] .media-platform-row b,
body[data-theme="dark"] .media-platform-row > strong {
  color: var(--text);
}

body[data-theme="dark"] .media-share-chart {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(148, 163, 184, .12);
}

.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(6, 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;
}

.platform-value-loading {
  display: inline-block;
  width: var(--loading-width, 54px);
  max-width: 100%;
  height: .9em;
  min-height: 10px;
  border-radius: 999px;
  vertical-align: -.08em;
  background:
    linear-gradient(90deg, rgba(20,43,47,.08), rgba(255,255,255,.84), rgba(20,43,47,.08));
  background-size: 220% 100%;
  animation: dashboard-skeleton 1.15s ease-in-out infinite;
}

.platform-card-head small .platform-value-loading {
  min-height: 8px;
}

.platform-score-ring .platform-value-loading {
  height: 16px;
  min-height: 16px;
}

.platform-card-metrics b .platform-value-loading {
  height: 12px;
  min-height: 12px;
}

.platform-card-foot .platform-value-loading {
  height: 10px;
  min-height: 10px;
}

.platform-leader-hero .platform-value-loading {
  height: 20px;
  min-height: 20px;
}

.platform-leader-row em .platform-value-loading,
.platform-source-row span .platform-value-loading,
.platform-comparison-table .platform-value-loading {
  height: 12px;
  min-height: 12px;
}

.platform-source-logo i {
  color: var(--platform-color, var(--accent-strong));
  font-size: .9rem;
}

.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-timeline-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-org-filter {
  position: relative;
  z-index: 8;
}

.timeline-org-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, 42vw);
  min-height: 40px;
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 999px;
  padding: 9px 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.62));
  color: var(--ink);
  font: 900 .82rem "Manrope", sans-serif;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 14px 26px rgba(20,43,47,.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.timeline-org-toggle:hover,
.timeline-org-toggle.has-selection {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, .34);
  background:
    radial-gradient(circle at 18% 20%, rgba(20, 184, 166, .16), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.68));
}

.timeline-org-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-org-toggle i:first-child {
  color: var(--accent);
}

.timeline-org-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 86vw);
  padding: 10px;
  border: 1px solid rgba(20, 43, 47, .12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(20,184,166,.14), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(245,249,247,.88));
  box-shadow: 0 24px 54px rgba(20,43,47,.18);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.timeline-org-filter.is-open .timeline-org-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.timeline-org-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
}

.timeline-org-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 800 .86rem "Manrope", sans-serif;
}

.timeline-org-list {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.timeline-org-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
  font: 850 .86rem "Manrope", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.timeline-org-option:hover,
.timeline-org-option.is-active {
  transform: translateX(2px);
  background: rgba(20, 184, 166, .12);
}

.timeline-org-option > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-org-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(20, 184, 166, .12);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 950;
}

.timeline-org-option .organization-logo.timeline-org-avatar {
  margin: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  flex-basis: 34px;
  border-radius: 12px;
}

.timeline-org-empty {
  padding: 14px 10px;
  color: var(--muted);
  font: 850 .84rem "Manrope", sans-serif;
  text-align: center;
}

.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;
  gap: 14px;
  margin-top: 14px;
}

.platform-leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  width: 100%;
}

.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: flex-start;
  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-copy {
  display: grid;
  gap: 2px;
}

.platform-leader-head-copy small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.platform-leader-head strong,
.platform-source-head strong {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 950;
}

.platform-leader-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform-leader-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 14px 10px 12px;
  border: 1px solid rgba(20,43,47,.07);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  text-align: center;
}

.platform-leader-tile.is-loading-shuffle {
  will-change: transform, opacity;
}

.platform-leader-tile .source-icon {
  width: 42px;
  height: 42px;
}

.platform-leader-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  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-leader-tile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.platform-leader-tile b,
.platform-leader-tile em {
  overflow: hidden;
  color: var(--ink);
  font-size: .86rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-leader-row-value {
  text-align: center;
  max-width: 100%;
  color: var(--accent-strong);
}

.platform-source-grid {
  display: flex;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.platform-source-tabs {
  margin: -2px 0 16px;
}

@media (max-width: 680px) {
  .platform-source-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, calc(100vw - 50px));
    border-radius: 20px;
  }

  .platform-source-tabs .metric-tab {
    width: 100%;
    padding-inline: 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;
}

.platform-source-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 950;
  white-space: nowrap;
}

.platform-source-counter i {
  color: var(--muted);
  font-size: .82rem;
}

.platform-source-counter b {
  color: var(--accent-strong);
  font-size: .8rem;
  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 auto;
  align-items: center;
  gap: 14px;
  margin-top: 0;
}

.search-export-word {
  min-height: 46px;
  white-space: nowrap;
}

.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);
}

.popular-searches .search-period-open {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(20, 184, 166, .26);
  background: linear-gradient(135deg, rgba(20, 184, 166, .14), rgba(255, 255, 255, .88));
  color: var(--accent-strong);
}

.popular-searches .search-period-open i {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 184, 166, .14);
}

.search-period-dialog {
  position: relative;
  z-index: 2;
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 34px;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(20, 184, 166, .16), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(13, 110, 253, .12), transparent 28%),
    #fffdfa;
  box-shadow: 0 34px 90px rgba(20, 43, 47, .22);
}

.search-period-modal .analysis-close {
  top: 18px;
  right: 18px;
}

.search-period-head strong {
  background: linear-gradient(135deg, rgba(20, 184, 166, .2), rgba(13, 110, 253, .14));
  color: var(--accent-strong);
}

.search-period-head span {
  color: var(--muted);
  font-weight: 800;
}

.search-period-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
}

.search-period-current span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.search-period-current strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.search-period-presets,
.search-period-options,
.search-period-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.search-period-presets {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.search-period-presets button {
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 18px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.search-period-presets button:hover {
  color: var(--accent-strong);
  box-shadow: 0 16px 30px rgba(20, 43, 47, .08);
}

.search-period-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-period-options label {
  cursor: pointer;
}

.search-period-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.search-period-options span {
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .76);
  text-align: center;
  font-weight: 900;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-period-options i {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(20, 184, 166, .1);
  color: var(--accent-strong);
}

.search-period-options label.is-active span {
  border-color: rgba(20, 184, 166, .34);
  background: linear-gradient(135deg, rgba(20, 184, 166, .14), rgba(255, 255, 255, .9));
  box-shadow: 0 18px 38px rgba(20, 184, 166, .12);
}

.search-period-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-period-fields label {
  display: grid;
  gap: 7px;
}

.search-period-fields span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.search-period-fields select,
.search-period-fields input {
  min-height: 46px;
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 15px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-weight: 800;
}

.search-period-hint {
  display: flex;
  gap: 9px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

.search-period-hint i {
  color: var(--accent-strong);
}

.search-period-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.search-platform-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 4px;
}

.search-platform-tab-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(20, 43, 47, .06);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.search-platform-tab-wrap.is-active {
  border-color: rgba(20, 184, 166, .36);
  background: var(--bg-deep);
  color: white;
}

.search-platform-tab-wrap.is-unchecked {
  opacity: .72;
}

.search-platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 6px 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.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-wrap.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; min-width: 0; }
.search-platform-tab b { font-size: .84rem; }
.search-platform-tab small { color: var(--muted); font-size: .72rem; font-weight: 900; }
.search-platform-tab-wrap.is-active small { color: rgba(255, 255, 255, .72); }

.search-tab-check {
  display: grid;
  place-items: center;
  width: 46px;
  padding: 0 10px 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.search-tab-check-box {
  position: relative;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1.5px solid rgba(20, 43, 47, .18);
  background: rgba(255, 255, 255, .88);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.search-tab-check-box i {
  font-size: .72rem;
  color: white;
  transform: scale(.45);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.search-tab-check.is-checked .search-tab-check-box {
  border-color: rgba(20, 184, 166, .6);
  background: linear-gradient(135deg, rgba(20,184,166,.95), rgba(15,118,110,.95));
  box-shadow: 0 8px 18px rgba(20, 184, 166, .25);
}

.search-tab-check.is-checked .search-tab-check-box i {
  opacity: 1;
  transform: scale(1);
}

.search-platform-tab-wrap.is-active .search-tab-check-box {
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .12);
}

.search-platform-tab-wrap.is-active .search-tab-check.is-checked .search-tab-check-box {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .44);
}

.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;
}

.app-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: grid;
  gap: 10px;
}

.app-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(20, 43, 47, .94);
  color: white;
  box-shadow: 0 18px 40px rgba(20, 43, 47, .24);
  transform: translateY(-10px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}

.app-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.app-toast i {
  color: #fbbf24;
}

.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: var(--panel);
  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;
}

.website-search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.website-search-card {
  min-width: 0;
  color: var(--text);
}

.website-search-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #eef4f7;
  box-shadow: 0 16px 34px rgba(12, 18, 21, .08);
}

.website-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s ease;
}

.website-search-thumb:hover img {
  transform: scale(1.035);
}

.website-search-thumb span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.website-search-thumb .source-icon {
  width: 34px;
  height: 34px;
}

.website-search-body {
  padding: 9px 2px 0;
}

.website-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;
}

.website-search-body small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
}

.website-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 9px 0 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}

.website-search-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.website-search-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.youtube-search-card {
  min-width: 0;
  color: #f5f7f7;
}

.instagram-search-posts {
  columns: 6 180px;
  column-gap: 3px;
  line-height: 0;
}

.instagram-search-post-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 3px;
  min-width: 0;
  break-inside: avoid;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(23, 7, 34, .45);
  box-shadow: none;
  line-height: 0;
  vertical-align: top;
}

.instagram-search-post-card > a {
  display: block;
  color: inherit;
}

.instagram-search-post-card img,
.instagram-search-fallback {
  display: block;
  width: 100%;
  min-height: 170px;
}

.instagram-search-post-card img {
  max-height: none;
  object-fit: cover;
}

.instagram-search-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 0 0, rgba(246, 164, 0, .18), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(214, 41, 118, .24), transparent 30%),
    linear-gradient(135deg, rgba(34, 10, 44, .96), rgba(20, 5, 31, .82));
  color: #fff;
  font-size: 42px;
  line-height: 1;
}

.instagram-search-hover-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(7, 0, 12, 0) 8%, rgba(7, 0, 12, .48) 42%, rgba(7, 0, 12, .92) 100%),
    radial-gradient(circle at 10% 10%, rgba(214, 41, 118, .32), transparent 36%);
  color: #fff;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}

.instagram-search-post-card:hover .instagram-search-hover-meta {
  opacity: 1;
  transform: translateY(0);
}

.instagram-search-hover-meta strong {
  font-size: .92rem;
  line-height: 1.1;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}

.instagram-search-hover-meta p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 245, 250, .9);
  font-size: .78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.instagram-search-hover-meta small {
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.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(ellipse at 51% 34%, rgba(20, 184, 166, .11), transparent 19%),
    radial-gradient(ellipse at 50% 74%, rgba(124, 58, 237, .1), transparent 20%),
    radial-gradient(ellipse at 81% 49%, rgba(29, 104, 255, .1), transparent 23%),
    linear-gradient(145deg, rgba(252, 251, 247, .98), rgba(239, 247, 245, .86));
}

.three-system-graph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 118, 110, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 52% 50%, #000 32%, transparent 82%);
  pointer-events: none;
}

.three-system-graph::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(252, 251, 247, .42), transparent 15%, transparent 86%, rgba(239, 247, 245, .34)),
    radial-gradient(ellipse at 52% 104%, rgba(15, 67, 63, .07), transparent 52%);
  content: "";
  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-graph-hud {
  position: absolute;
  z-index: 6;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.three-graph-hud-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px;
  background: rgba(255, 253, 248, .72);
  box-shadow: 0 14px 34px rgba(20, 43, 47, .1);
  backdrop-filter: blur(18px);
}

.three-graph-hud-title > span:last-child,
.three-graph-hud-title strong,
.three-graph-hud-title small {
  display: block;
}

.three-graph-hud-title strong {
  color: var(--ink);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.three-graph-hud-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
}

.three-live-pulse {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #16a978;
  box-shadow: 0 0 0 5px rgba(22, 169, 120, .12), 0 0 18px rgba(22, 169, 120, .46);
}

.three-live-pulse::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(22, 169, 120, .48);
  border-radius: inherit;
  content: "";
  animation: topology-live 1.8s ease-out infinite;
}

.three-stage-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 253, 248, .72);
  box-shadow: 0 14px 34px rgba(20, 43, 47, .1);
  backdrop-filter: blur(18px);
}

.three-stage-rail span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 13px;
  color: var(--muted);
}

.three-stage-rail span + span::before {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 8px;
  height: 1px;
  background: rgba(15, 118, 110, .28);
  content: "";
}

.three-stage-rail b {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 9px;
  background: rgba(15, 118, 110, .1);
  color: var(--accent-strong);
  font-size: .6rem;
  font-weight: 950;
}

.three-stage-rail em {
  overflow: hidden;
  color: var(--ink);
  font-size: .66rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.three-node-icon {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.96), rgba(255,255,255,.42) 34%, transparent 58%),
    rgba(255,255,255,.24);
  box-shadow:
    inset 5px 6px 12px rgba(255,255,255,.34),
    inset -7px -9px 16px rgba(20,43,47,.12),
    0 10px 24px rgba(20,43,47,.15);
  color: var(--ink);
  font-size: 1.65rem;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
  transform-style: preserve-3d;
  animation: topology-node-float 4.8s ease-in-out infinite;
}

.three-node-icon.is-core {
  width: 54px;
  height: 54px;
  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:
    inset 6px 7px 12px rgba(255,255,255,.18),
    inset -8px -10px 18px rgba(0,35,40,.24),
    0 18px 34px rgba(0,126,133,.24);
}

.three-node-icon.is-major {
  border-radius: 24%;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
}

.three-node-icon[data-kind="dashboard"] {
  width: 58px;
  height: 58px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255,255,255,.64), transparent 14%),
    linear-gradient(145deg, #35a8ff, #173cc3);
  color: white;
  box-shadow:
    inset 6px 7px 12px rgba(255,255,255,.2),
    inset -9px -11px 18px rgba(7,30,99,.24),
    0 18px 38px rgba(29,104,255,.24);
}

.three-node-icon[data-kind="ai"] {
  width: 52px;
  height: 52px;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.76), transparent 18%),
    linear-gradient(145deg, rgba(250,245,255,.96), rgba(223,197,255,.76));
  color: #6d28d9;
  box-shadow:
    inset 5px 6px 12px rgba(255,255,255,.42),
    inset -8px -10px 17px rgba(88,28,135,.14),
    0 18px 36px rgba(124,58,237,.2);
}

.three-node-icon[data-kind="profiles-service"] {
  width: 52px;
  height: 52px;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.78), transparent 18%),
    linear-gradient(145deg, rgba(224,251,255,.98), rgba(103,232,249,.8));
  color: #0e7490;
  box-shadow:
    inset 5px 6px 12px rgba(255,255,255,.44),
    inset -8px -10px 17px rgba(14,116,144,.16),
    0 18px 36px rgba(8,145,178,.22);
}

.three-node-icon[data-kind="targets"] {
  width: 52px;
  height: 52px;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.78), transparent 18%),
    linear-gradient(145deg, rgba(255,249,225,.98), rgba(253,186,116,.84));
  color: #b45309;
  box-shadow:
    inset 5px 6px 12px rgba(255,255,255,.44),
    inset -8px -10px 17px rgba(180,83,9,.14),
    0 18px 36px rgba(217,119,6,.2);
}

.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: #6d28d9; }
.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"] {
  height: 40px;
  width: 40px;
  font-size: 1.08rem;
  box-shadow:
    inset 5px 6px 10px rgba(255,255,255,.58),
    inset -6px -8px 12px rgba(20,43,47,.11),
    0 12px 22px rgba(20,43,47,.14);
}

.three-node-caption {
  position: absolute;
  z-index: 4;
  display: grid;
  min-width: 138px;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 13px;
  background: rgba(255,253,248,.78);
  box-shadow: 0 13px 28px rgba(20,43,47,.12), inset 0 1px 0 rgba(255,255,255,.78);
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px) saturate(135%);
}

.three-node-caption strong {
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.three-node-caption small {
  color: var(--muted);
  font-size: .57rem;
  font-weight: 800;
}

.three-node-caption[data-kind="core"] { border-color: rgba(20,184,166,.24); }
.three-node-caption[data-kind="ai"] { border-color: rgba(124,58,237,.2); }
.three-node-caption[data-kind="dashboard"] { border-color: rgba(29,104,255,.2); }
.three-node-caption[data-kind="profiles-service"] { border-color: rgba(8,145,178,.22); }
.three-node-caption[data-kind="targets"] { border-color: rgba(217,119,6,.22); }

.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);
}

.platform-source-card {
  flex-basis: calc((100% - 70px) / 6);
  min-width: 230px;
}

.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: 246px;
  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);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.three-platform-counter::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #229ed9, #14b8a6);
  content: "";
}

.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-status {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 4px;
  color: #148260;
  font-size: .52rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.three-counter-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a978;
  box-shadow: 0 0 9px rgba(22, 169, 120, .5);
  animation: topology-status 1.7s ease-in-out infinite;
}

.three-counter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 7px;
}

.three-counter-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.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-counter-level {
  position: relative;
  height: 5px;
  margin-top: 1px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 43, 47, .08);
}

.three-counter-level > span {
  display: block;
  width: var(--level);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #229ed9, #14b8a6);
  box-shadow: 0 0 12px rgba(20, 184, 166, .28);
  animation: topology-level-in .8s cubic-bezier(.2, .8, .2, 1) both;
}

.three-counter-level small {
  display: none;
}

@keyframes topology-live {
  from { opacity: .9; transform: scale(.7); }
  to { opacity: 0; transform: scale(1.7); }
}

@keyframes topology-status {
  50% { opacity: .48; transform: scale(.72); }
}

@keyframes topology-level-in {
  from { width: 0; }
}

@keyframes topology-node-float {
  0%, 100% { margin-top: -1px; filter: saturate(1); }
  50% { margin-top: 2px; filter: saturate(1.12); }
}

@media (max-width: 1050px) {
  .three-graph-hud {
    align-items: flex-start;
  }

  .three-stage-rail {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .three-graph-hud {
    top: 10px;
    right: 10px;
    left: 10px;
    display: grid;
  }

  .three-graph-hud-title {
    width: max-content;
    max-width: 100%;
    padding: 8px 10px;
  }

  .three-stage-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .three-stage-rail span {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 5px 2px;
    text-align: center;
  }

  .three-stage-rail em {
    width: 100%;
    font-size: .52rem;
  }

  .three-platform-counter {
    display: none;
  }

  .three-node-caption {
    min-width: 118px;
    max-width: 132px;
    padding: 7px 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .three-live-pulse::after,
  .three-counter-status i,
  .three-counter-level > span,
  .three-node-icon {
    animation: none;
  }
}

body[data-theme="dark"] .three-graph-hud-title,
body[data-theme="dark"] .three-stage-rail {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(10, 22, 30, .74);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

body[data-theme="dark"] .three-graph-hud-title strong,
body[data-theme="dark"] .three-stage-rail em {
  color: var(--text);
}

body[data-theme="dark"] .three-stage-rail b {
  background: rgba(45, 212, 191, .1);
  color: #5eead4;
}

body[data-theme="dark"] .three-counter-status {
  color: #5eead4;
}

body[data-theme="dark"] .three-counter-level {
  background: rgba(148, 163, 184, .12);
}

body[data-theme="dark"] .three-system-graph {
  background:
    radial-gradient(ellipse at 51% 34%, rgba(20,184,166,.13), transparent 20%),
    radial-gradient(ellipse at 50% 74%, rgba(124,58,237,.12), transparent 21%),
    radial-gradient(ellipse at 81% 49%, rgba(29,104,255,.12), transparent 24%),
    linear-gradient(145deg, rgba(7,17,24,.98), rgba(10,25,32,.94));
}

body[data-theme="dark"] .three-system-graph::after {
  background:
    linear-gradient(90deg, rgba(7,17,24,.3), transparent 15%, transparent 86%, rgba(10,25,32,.3)),
    radial-gradient(ellipse at 52% 104%, rgba(45,212,191,.08), transparent 52%);
}

body[data-theme="dark"] .three-node-caption {
  border-color: rgba(148,163,184,.18);
  background: rgba(9,23,31,.78);
  box-shadow: 0 16px 32px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  color: var(--text);
}

body[data-theme="dark"] .three-node-caption small {
  color: rgba(203,220,229,.66);
}

.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(4, minmax(0, 1fr));
  gap: 16px;
}

.risk-date-filters {
  display: grid;
  justify-items: end;
  gap: 7px;
  max-width: min(620px, 60vw);
}

.topic-date-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-date-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
  height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(20, 43, 47, .1);
  border-radius: 13px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .96), transparent 46%),
    rgba(255, 255, 255, .74);
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(20, 43, 47, .06);
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.topic-date-control:focus-within {
  border-color: rgba(15, 118, 110, .34);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .08), 0 12px 26px rgba(20, 43, 47, .08);
}

.topic-date-control.is-disabled {
  opacity: .5;
}

.topic-date-control select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 800 .78rem "Manrope", sans-serif;
  cursor: pointer;
}

.topic-date-control select:disabled {
  cursor: not-allowed;
}

@media (max-width: 680px) {
  .topic-date-filters {
    width: 100%;
    justify-content: stretch;
  }

  .topic-date-control {
    flex: 1 1 140px;
  }
}

.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);
}

.topics-panel .topics-grid .topic-loading-card {
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(255,255,255,.72), rgba(238, 246, 244, .92), rgba(255,255,255,.72));
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
  cursor: default;
  pointer-events: none;
}

.topics-panel .topics-grid .topic-loading-card:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.topic-loading-card strong {
  display: flex;
  align-items: center;
}

.topic-loading-card .topic-icon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(15, 118, 110, .08), rgba(15, 118, 110, .18), rgba(15, 118, 110, .08));
  background-size: 220% 100%;
  color: rgba(15, 118, 110, .36);
  animation: shimmer 1.15s linear infinite;
}

.topic-loading-card .dashboard-value-loading {
  min-height: 12px;
  opacity: .95;
}

.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 {
  min-width: 0;
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

/* Compact navigation: only the active workspace exposes its text label. */
.main-nav .nav-btn { min-width: 44px; justify-content: center; }
.main-nav .nav-btn span { display: none; }
.main-nav .nav-btn.is-active { min-width: max-content; padding-inline: 18px; }
.main-nav .nav-btn.is-active span { display: inline; }

.settings-parser-credentials { min-width: 0; display: grid; gap: 18px; }
.settings-parser-credentials[hidden] { display: none; }
.source-proposals-panel { display: grid; gap: 12px; }
.source-proposals-panel[hidden] { display: none; }
.proposal-count { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--accent-strong); font-weight: 800; }
.source-proposals-list { display: grid; gap: 8px; }
.source-proposal-card { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.source-proposal-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.source-proposal-identity .source-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; }
.source-proposal-identity strong { font-size: .88rem; }
.source-proposal-identity strong, .source-proposal-identity a, .source-proposal-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-proposal-identity a, .source-proposal-identity small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.source-proposal-identity a:hover { color: var(--accent-strong); }
.source-proposal-controls { display: flex; align-items: center; justify-content: end; gap: 7px; }
.proposal-org-select { min-width: 220px; max-width: 300px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--card-bg); font: inherit; font-size: .78rem; font-weight: 750; text-align: left; cursor: pointer; }
.proposal-org-select:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(16, 59, 61, .08); }
.proposal-org-select > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proposal-org-select > .fa-building-circle-arrow-right { color: var(--accent-strong); }
.proposal-org-logo { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px; }
.proposal-org-picker[hidden] { display: none; }
.proposal-org-picker { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 20px; }
.proposal-org-picker-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 17, 23, .44); backdrop-filter: blur(5px); cursor: default; }
.proposal-org-picker-dialog { position: relative; width: min(560px, 100%); max-height: min(650px, calc(100vh - 40px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; padding: 18px; overflow: hidden; border: 1px solid rgba(19, 66, 69, .16); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(4, 21, 26, .3); }
body[data-theme="dark"] .proposal-org-picker-dialog { border-color: var(--line); background: rgba(11, 32, 42, .98); }
.proposal-org-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.proposal-org-picker-head h4 { margin: 4px 0 0; font-size: 1.15rem; }
.proposal-org-search { margin: 0; }
.proposal-org-list { max-height: 440px; overflow: auto; padding-right: 3px; }
.proposal-org-option { width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto; }
.proposal-org-option .timeline-org-logo { width: 30px; height: 30px; border-radius: 10px; }
.proposal-reject { color: var(--danger); }
.parser-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.parser-hero h2 { margin: 5px 0 8px; }
.parser-hero p, .parser-pool-head p { color: var(--muted); margin: 0; }
.parser-pool-summary { display: flex; gap: 10px; }
.parser-pool-summary > span { min-width: 118px; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 0 10px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.parser-pool-summary i { grid-row: 1 / 3; font-size: 1.35rem; }
.parser-pool-summary b { font-size: 1.25rem; }
.parser-pool-summary small { color: var(--muted); }
.parser-platform-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.parser-platform-tabs > button { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); font: inherit; font-weight: 850; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease; }
.parser-platform-tabs > button:hover { color: var(--ink); }
.parser-platform-tabs > button.is-active { border-color: var(--line); background: var(--card-bg); color: var(--ink); box-shadow: 0 8px 24px rgba(16, 59, 61, .08); }
.parser-platform-tabs > button b { min-width: 30px; height: 28px; display: grid; place-items: center; padding: 0 8px; border-radius: 10px; background: var(--surface-soft); color: var(--accent-strong); font-size: .75rem; }
.parser-platform-tabs .parser-platform-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 1.12rem; }
.parser-platform-panels { min-width: 0; max-width: 100%; }
.parser-platform-panels > [hidden] { display: none; }
.parser-pool-card { min-width: 0; }
.parser-pool-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.parser-pool-head h3 { margin: 0 0 5px; }
.parser-platform-mark { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 16px; font-size: 1.45rem; }
.parser-platform-mark.youtube { color: #ff0033; background: rgba(255,0,51,.1); }
.parser-platform-mark.telegram { color: #26a5e4; background: rgba(38,165,228,.12); }
.credential-form { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) auto; align-items: end; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface-soft); border: 1px solid var(--line); }
.telegram-credential-form { grid-template-columns: 1fr .55fr 1fr; }
.telegram-auth-method { grid-column: 1 / -1; display: inline-flex; width: fit-content; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); }
.telegram-auth-method button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.telegram-auth-method button.is-active { color: var(--accent-strong); background: var(--surface-soft); box-shadow: 0 5px 16px rgba(12, 73, 73, .08); }
.credential-form label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .78rem; font-weight: 750; }
.credential-form label small { line-height: 1.45; font-weight: 600; }
.credential-form input, .credential-form textarea { width: 100%; }
.credential-form input[readonly] { opacity: .68; cursor: not-allowed; }
.telegram-phone-field { grid-column: 1 / 2; }
.telegram-phone-field[hidden] { display: none; }
.telegram-qr-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 20px; padding: 16px; border: 1px solid rgba(38, 165, 228, .28); border-radius: 20px; background: linear-gradient(135deg, rgba(38,165,228,.10), var(--card-bg)); }
.telegram-qr-panel[hidden] { display: none; }
.telegram-qr-frame { width: 190px; height: 190px; display: grid; place-items: center; overflow: hidden; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 14px 35px rgba(5, 47, 67, .16); }
.telegram-qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.telegram-qr-copy { min-width: 0; }
.telegram-qr-copy h4 { margin: 10px 0 8px; font-size: 1.05rem; }
.telegram-qr-copy ol { margin: 0; padding-left: 20px; color: var(--ink); line-height: 1.65; font-size: .84rem; }
.telegram-qr-copy p { margin: 8px 0 0; color: var(--muted); font-size: .75rem; }
.telegram-qr-live { display: inline-flex; align-items: center; gap: 7px; color: #1688bd; font-size: .75rem; font-weight: 800; }
.telegram-auth-step { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); }
.telegram-auth-step[hidden] { display: none; }
.telegram-auth-actions { grid-column: 2 / -1; display: flex; gap: 8px; }
.telegram-auth-actions .btn-primary { flex: 1; }
.telegram-auth-status { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
.telegram-auth-status.is-error { color: var(--danger); }
.credential-list { min-width: 0; display: grid; gap: 10px; margin-top: 14px; }
.credential-process-help { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.credential-process-help i { color: var(--accent-strong); }
.credential-table-shell { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); }
.credential-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; }
.credential-table th, .credential-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.credential-table th { background: var(--surface-soft); color: var(--muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.credential-table tbody tr:last-child td { border-bottom: 0; }
.credential-table .credential-order-heading, .credential-table .credential-order-cell { width: 70px; }
.credential-table th:nth-child(2) { width: 210px; }
.credential-table th:nth-child(3) { width: 230px; }
.credential-table .credential-actions-heading, .credential-table th:last-child { width: 118px; text-align: right; }
.credential-table td:last-child { text-align: right; }
.credential-table-row { transition: opacity .16s ease, background .16s ease; }
.credential-table-row:hover { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); }
.credential-table-row.is-disabled { opacity: .58; }
.credential-table-row.is-dragging { opacity: .38; }
.credential-order-cell { white-space: nowrap; }
.credential-order-cell .credential-drag { margin-right: 8px; cursor: grab; }
.credential-order-cell .credential-index { display: inline-grid; vertical-align: middle; }
.credential-status-cell .credential-health { margin-top: 6px; }
.credential-state { width: fit-content; display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 8px; background: rgba(148, 163, 184, .12); color: var(--muted); font-size: .63rem; font-weight: 850; }
.credential-state.is-enabled { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-strong); }
.credential-process-heading { width: 150px; }
.credential-process-heading i { margin-right: 6px; color: var(--accent-strong); }
.credential-process-heading b { float: right; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--card-bg); color: var(--accent-strong); font-size: .62rem; }
.credential-process-cell { transition: background .16s ease, box-shadow .16s ease; }
.credential-process-cell.is-drag-over, .credential-process-heading.is-drag-over { background: color-mix(in srgb, var(--accent) 13%, var(--card-bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 48%, var(--line)); }
.credential-process-cell > button { width: 100%; min-height: 36px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 14px; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font: inherit; font-size: .68rem; font-weight: 750; text-align: left; cursor: pointer; }
.credential-process-cell > button:hover { border-color: color-mix(in srgb, var(--accent) 44%, var(--line)); color: var(--ink); }
.credential-process-cell.is-assigned > button { border-color: color-mix(in srgb, var(--accent) 44%, var(--line)); background: color-mix(in srgb, var(--accent) 11%, var(--card-bg)); color: var(--accent-strong); }
.credential-process-cell > button i:last-child { font-size: .58rem; }
.credential-process-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.credential-process-lane { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface-soft) 78%, transparent); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.credential-process-lane.is-drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card-bg)); transform: translateY(-2px); }
.credential-process-lane > header { min-height: 58px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 3px 10px; }
.credential-process-lane > header b, .credential-process-lane > header small { display: block; }
.credential-process-lane > header b { color: var(--ink); font-size: .79rem; }
.credential-process-lane > header small { margin-top: 3px; color: var(--muted); font-size: .64rem; line-height: 1.3; }
.credential-process-lane > header em { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; background: var(--card-bg); color: var(--accent-strong); font-size: .7rem; font-style: normal; font-weight: 850; }
.credential-process-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--accent-strong); background: var(--card-bg); box-shadow: 0 5px 14px rgba(10, 66, 68, .07); }
.credential-process-items { min-height: 92px; display: grid; align-content: start; gap: 8px; }
.credential-process-empty { min-height: 88px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; font-size: .68rem; }
.credential-process-empty i { color: var(--accent); }
.credential-item { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--line); background: var(--card-bg); border-radius: 14px; cursor: grab; box-shadow: 0 7px 18px rgba(12, 48, 55, .05); }
.credential-item:active { cursor: grabbing; }
.credential-item.is-dragging { opacity: .42; transform: scale(.98); }
.credential-item.is-disabled { opacity: .58; }
.credential-item-top { min-width: 0; display: grid; grid-template-columns: auto 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.credential-drag { color: var(--muted); font-size: .72rem; }
.credential-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--accent-strong); font-size: .7rem; font-weight: 800; }
.credential-copy { min-width: 0; }
.credential-copy b, .credential-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.credential-copy small { color: var(--muted); margin-top: 3px; }
.credential-health { min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; color: var(--muted); font-size: .64rem; white-space: nowrap; text-overflow: ellipsis; }
.credential-health > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.credential-cooldown-copy { display: grid; gap: 2px; }
.credential-cooldown-copy > span, .credential-cooldown-copy > b { overflow: hidden; text-overflow: ellipsis; }
.credential-health b { font-variant-numeric: tabular-nums; }
.credential-health.is-error { color: var(--danger); }
.credential-health.is-ready { color: var(--accent-strong); }
.credential-actions { display: flex; gap: 6px; }
.credential-actions button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); font-size: .68rem; cursor: pointer; }
.credential-actions button.danger { color: var(--danger); }
.credential-process-select { display: grid; gap: 5px; color: var(--muted); font-size: .61rem; font-weight: 750; }
.credential-process-select > div { display: flex; flex-wrap: wrap; gap: 5px; }
.credential-process-select button { min-width: 0; display: inline-flex; align-items: center; gap: 5px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--muted); font: inherit; font-size: .61rem; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.credential-process-select button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.credential-process-select button.is-assigned { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: color-mix(in srgb, var(--accent) 11%, var(--card-bg)); color: var(--accent-strong); }
.credential-process-select button > i:last-child { font-size: .52rem; }
.credential-empty { color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--line); border-radius: 15px; }

.settings-subtabs { display: flex; align-items: center; gap: 7px; width: fit-content; padding: 5px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.settings-subtabs button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 13px; padding: 10px 15px; background: transparent; color: var(--muted); font: inherit; font-weight: 750; cursor: pointer; }
.settings-subtabs button.is-active { color: var(--accent-strong); background: var(--card-bg); box-shadow: 0 8px 24px rgba(16, 59, 61, .08); }
body[data-theme="dark"] .parser-pool-summary > span,
body[data-theme="dark"] .credential-form,
body[data-theme="dark"] .credential-item,
body[data-theme="dark"] .credential-process-lane,
body[data-theme="dark"] .telegram-auth-step,
body[data-theme="dark"] .telegram-auth-method,
body[data-theme="dark"] .settings-subtabs,
body[data-theme="dark"] .parser-platform-tabs,
body[data-theme="dark"] .credential-table-shell { background: rgba(11, 32, 42, .82); }

@media (max-width: 1100px) {
  .parser-platform-panels { grid-template-columns: 1fr; }
}
@media (max-width: 1320px) {
  .credential-process-board { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .parser-hero { align-items: stretch; flex-direction: column; }
  .parser-pool-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .parser-platform-tabs { grid-template-columns: 1fr; }
  .credential-form, .telegram-credential-form { grid-template-columns: 1fr; }
  .telegram-phone-field, .telegram-auth-step, .telegram-auth-actions, .telegram-auth-status { grid-column: auto; }
  .telegram-auth-method, .telegram-qr-panel { grid-column: auto; width: 100%; }
  .telegram-qr-panel { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .telegram-auth-step { grid-template-columns: 1fr; }
  .credential-process-board { grid-template-columns: 1fr; }
  .settings-subtabs { width: 100%; min-width: 0; max-width: 100%; justify-content: flex-start; overflow-x: auto; }
  .settings-subtabs button { flex: 0 0 auto; justify-content: center; padding-inline: 8px; }
  .source-proposal-card { grid-template-columns: 1fr; }
  .source-proposal-controls { flex-wrap: wrap; }
  .proposal-org-select { min-width: min(100%, 260px); flex: 1 1 180px; }
}

.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: 1460px;
  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-list {
  display: grid;
  gap: 7px;
  min-width: 170px;
  margin: -13px -16px;
  padding: 13px 16px;
  min-height: calc(100% + 26px);
}

.source-cell-entry {
  position: relative;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .58);
}

.source-cell-entry::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-entry 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-entry 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;
}

.matrix-add-source {
  width: 100%;
  min-width: 170px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: -8px 0;
  border: 1px dashed rgba(12, 127, 114, .3);
  border-radius: 14px;
  background: rgba(18, 139, 127, .045);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.matrix-add-source.is-compact {
  min-height: 34px;
  margin: 0;
  border-radius: 10px;
}

.matrix-add-source.is-compact i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.matrix-add-source i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(18, 139, 127, .12);
  color: var(--accent-strong);
}

.matrix-add-source:hover {
  border-color: var(--accent);
  background: rgba(18, 139, 127, .09);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.matrix-actions-heading {
  width: 112px;
  min-width: 112px;
  text-align: center !important;
}

.matrix-actions-heading i { margin-right: 7px; }

.matrix-row-actions {
  width: 112px;
  min-width: 112px;
  padding: 8px !important;
  vertical-align: middle !important;
}

.matrix-row-actions button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: rgba(19, 39, 47, .07);
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

.matrix-row-actions button + button { margin-top: 6px; }
.matrix-row-actions button:hover { background: rgba(12, 127, 114, .12); color: var(--accent-strong); }
.matrix-row-actions button.danger { background: rgba(180, 35, 24, .07); color: var(--danger); }
.matrix-row-actions button.danger:hover { background: rgba(180, 35, 24, .13); }

.matrix-source-picker-dialog { width: min(650px, 100%); }
.matrix-source-picker-context { margin: 5px 0 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.matrix-source-picker-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(19, 39, 47, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.matrix-source-picker-close:hover {
  border-color: rgba(12, 127, 114, .28);
  background: rgba(12, 127, 114, .1);
  color: var(--accent-strong);
  transform: rotate(4deg);
}
.matrix-source-picker-close:focus-visible { outline: 3px solid rgba(12, 127, 114, .18); outline-offset: 2px; }
body[data-theme="dark"] .matrix-source-picker-close {
  border-color: var(--line);
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
body[data-theme="dark"] .matrix-source-picker-close:hover { background: rgba(80, 224, 204, .12); color: var(--accent); }
.matrix-source-search { margin: 0; }
.matrix-source-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.matrix-source-input {
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .52);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.matrix-source-input:focus-within {
  border-color: rgba(12, 127, 114, .38);
  box-shadow: 0 0 0 4px rgba(12, 127, 114, .08);
}
.matrix-source-prefix {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--accent-strong);
  font-size: .79rem;
  font-weight: 800;
  white-space: nowrap;
}
.matrix-source-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 13px 14px 13px 2px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
}
.matrix-source-create { min-width: 168px; justify-content: center; }
.matrix-source-picker-hint {
  min-height: 18px;
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: .71rem;
  font-weight: 650;
}
body[data-theme="dark"] .matrix-source-input {
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.matrix-source-picker-list { min-height: 140px; max-height: 460px; display: grid; align-content: start; gap: 8px; overflow-y: auto; padding-right: 3px; }
.matrix-source-option { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.matrix-source-option .source-icon { width: 40px; height: 40px; border-radius: 13px; }
.matrix-source-option-copy { min-width: 0; }
.matrix-source-option-copy strong, .matrix-source-option-copy a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix-source-option-copy strong { color: var(--text); font-size: .84rem; }
.matrix-source-option-copy a { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.matrix-source-option-copy small { display: flex; gap: 14px; margin-top: 6px; color: var(--muted); font-size: .7rem; font-weight: 750; }
.matrix-source-option-copy small span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-source-option-copy small i { color: var(--accent-strong); }
.matrix-source-option-copy small .matrix-source-origin {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(12, 127, 114, .08);
  color: var(--accent-strong);
}
.matrix-source-attach { min-width: 116px; justify-content: center; }
.matrix-source-empty { min-height: 140px; display: grid; place-items: center; align-content: center; gap: 10px; }
.matrix-source-empty i { color: var(--muted); font-size: 1.35rem; }

.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-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(20,43,47,.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 0 0, rgba(59,130,246,.14), transparent 30%),
    radial-gradient(circle at 100% 0, rgba(168,85,247,.18), transparent 36%),
    linear-gradient(135deg, rgba(15,118,110,.12), rgba(255,255,255,.86));
  isolation: isolate;
}

.influence-help-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.influence-help-hero-copy h4 {
  margin: 0;
  color: var(--ink);
  font: 950 1.35rem "Manrope", sans-serif;
  letter-spacing: -.02em;
}

.influence-help-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--accent-strong);
  font: 900 .78rem "Manrope", sans-serif;
  box-shadow: 0 14px 30px rgba(15,118,110,.12);
}

.influence-help-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .85;
  animation: influenceOrbFloat 4.4s ease-in-out infinite;
}

.influence-help-orb-a {
  top: -26px;
  right: 18px;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle, rgba(59,130,246,.42), rgba(59,130,246,0));
}

.influence-help-orb-b {
  right: 90px;
  bottom: -34px;
  width: 118px;
  height: 118px;
  background: radial-gradient(circle, rgba(168,85,247,.34), rgba(168,85,247,0));
  animation-delay: -1.8s;
}

.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-metric-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.influence-help-metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.3), transparent 58%);
  pointer-events: none;
}

.influence-help-metric-card i {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: var(--accent-strong);
  box-shadow: 0 12px 26px rgba(20,43,47,.08);
}

.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);
}

@keyframes influenceOrbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-10px, 8px, 0) scale(1.06); }
}

.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));
  }

  #dashboard-risks {
    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: 1fr;
  }

  .platform-leader-list {
    grid-template-columns: repeat(3, 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));
  }

  .instagram-search-posts {
    columns: 3 180px;
  }

  .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;
  }
}

/* Dashboard platform metrics: compact dimensional cards */
.metric-expanded-row:has(.metric-platform-grid) {
  padding: 16px 20px;
}

.metric-expanded-row.is-open:has(.metric-platform-grid) {
  max-height: 420px;
}

.metric-expanded-row:has(.metric-platform-grid) .metric-expanded-head {
  margin-bottom: 11px;
}

.metric-platform-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.metric-platform-card.is-dimensional {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 8px 13px 8px 9px;
  gap: 10px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--metric-platform-color) 18%, rgba(20, 43, 47, .08));
  border-radius: 18px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--metric-platform-color) 8%, transparent), transparent 38%),
    rgba(255, 255, 255, .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .82),
    0 12px 26px rgba(20, 43, 47, .07);
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}

.metric-platform-card.is-dimensional::before {
  position: absolute;
  z-index: -1;
  top: -22px;
  left: -16px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--metric-platform-color) 17%, transparent), transparent 68%);
  content: "";
  pointer-events: none;
}

.metric-platform-card.is-dimensional::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 38%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--metric-platform-color));
  content: "";
  opacity: .72;
  pointer-events: none;
}

.metric-platform-card.is-dimensional:hover {
  border-color: color-mix(in srgb, var(--metric-platform-color) 38%, rgba(20, 43, 47, .08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 17px 34px color-mix(in srgb, var(--metric-platform-color) 13%, rgba(20, 43, 47, .1));
  transform: translateY(-2px);
}

.metric-platform-emblem {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  perspective: 160px;
  transform: rotateX(7deg) rotateY(-10deg);
  transform-style: preserve-3d;
}

.metric-platform-emblem::before,
.metric-platform-emblem::after {
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  content: "";
}

.metric-platform-emblem::before {
  background: color-mix(in srgb, var(--metric-platform-color) 28%, #0b1520);
  box-shadow: 0 9px 13px color-mix(in srgb, var(--metric-platform-color) 24%, transparent);
  transform: translate3d(4px, 5px, -5px);
}

.metric-platform-emblem::after {
  border: 1px solid rgba(255, 255, 255, .82);
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.96), rgba(255,255,255,.6) 30%, transparent 56%),
    color-mix(in srgb, var(--metric-platform-color) 13%, white);
  box-shadow:
    inset -5px -7px 11px color-mix(in srgb, var(--metric-platform-color) 16%, transparent),
    inset 2px 2px 4px rgba(255,255,255,.92);
  transform: translateZ(5px);
}

.metric-platform-emblem-face {
  position: relative;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateZ(10px);
}

.metric-platform-emblem-face .source-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 4px 4px rgba(9, 18, 25, .18));
}

.metric-platform-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
}

.metric-platform-card.is-dimensional .metric-platform-copy strong,
.metric-platform-card.is-dimensional .metric-platform-copy small {
  margin: 0;
}

.metric-platform-card.is-dimensional .metric-platform-copy strong {
  font-size: .82rem;
  letter-spacing: -.01em;
}

.metric-platform-card.is-dimensional .metric-platform-copy small {
  color: var(--muted);
  font-size: .59rem;
  font-weight: 760;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.metric-platform-value {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: max-content;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: clamp(.93rem, 1vw, 1.16rem);
  font-weight: 850;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.metric-platform-value i {
  color: color-mix(in srgb, var(--metric-platform-color) 50%, var(--muted));
  font-size: .72em;
  font-style: normal;
  font-weight: 700;
}

body[data-theme="dark"] .metric-platform-card.is-dimensional {
  border-color: color-mix(in srgb, var(--metric-platform-color) 24%, rgba(148, 163, 184, .16));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--metric-platform-color) 11%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(18, 35, 45, .82), rgba(9, 20, 28, .72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 14px 30px rgba(0, 0, 0, .24);
}

body[data-theme="dark"] .metric-platform-card.is-dimensional:hover {
  border-color: color-mix(in srgb, var(--metric-platform-color) 52%, rgba(148, 163, 184, .16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 18px 38px color-mix(in srgb, var(--metric-platform-color) 13%, rgba(0, 0, 0, .34));
}

body[data-theme="dark"] .metric-platform-emblem::after {
  border-color: rgba(255, 255, 255, .2);
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.38), rgba(255,255,255,.1) 31%, transparent 57%),
    color-mix(in srgb, var(--metric-platform-color) 22%, #172632);
  box-shadow:
    inset -5px -7px 11px rgba(0, 0, 0, .24),
    inset 2px 2px 4px rgba(255,255,255,.14);
}

body[data-theme="dark"] .metric-platform-value {
  color: var(--text);
}

@media (max-width: 1500px) {
  .metric-platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .metric-expanded-row:has(.metric-platform-grid) {
    padding: 14px;
  }

  .metric-expanded-row.is-open:has(.metric-platform-grid) {
    max-height: 620px;
  }

  .metric-expanded-row:has(.metric-platform-grid) .metric-expanded-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .metric-platform-grid {
    grid-template-columns: 1fr;
  }

  .metric-platform-card.is-dimensional {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-platform-card.is-dimensional,
  .metric-platform-emblem {
    transition: none;
    transform: none;
  }
}

@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 {
    grid-template-columns: 1fr;
  }

  .platform-leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .platform-leader-list {
    grid-template-columns: repeat(2, minmax(0, 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)); }
  .instagram-search-posts { columns: 2 180px; }
  .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;
  }
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .16), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(59, 130, 246, .14), transparent 30%),
    linear-gradient(135deg, #071017 0%, #0d1820 52%, #0b141b 100%);
}

body[data-theme="dark"] .shell-bg {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, .08) 1px, transparent 1px),
    linear-gradient(rgba(45, 212, 191, .08) 1px, transparent 1px);
}

body[data-theme="dark"] .hero-copy {
  background: linear-gradient(180deg, rgba(7, 19, 26, .96), rgba(9, 30, 38, .9));
  color: #f3fbff;
}

body[data-theme="dark"] .hero-copy p {
  color: rgba(237, 247, 251, .78);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .summary-card,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .login-card,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .dashboard-panel,
body[data-theme="dark"] .platform-card,
body[data-theme="dark"] .platform-results,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .matrix-shell,
body[data-theme="dark"] .structure-card,
body[data-theme="dark"] .search-hero {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .platform-results {
  backdrop-filter: blur(22px) saturate(120%);
}

body[data-theme="dark"] .main-nav,
body[data-theme="dark"] .lang-switcher,
body[data-theme="dark"] .metric-tabs,
body[data-theme="dark"] .sentiment-platform-tabs,
body[data-theme="dark"] .search-platform-tabs {
  background: rgba(255, 255, 255, .06);
  border-color: var(--line);
}

body[data-theme="dark"] .nav-btn.is-active,
body[data-theme="dark"] .lang-btn.is-active,
body[data-theme="dark"] .metric-tab.is-active,
body[data-theme="dark"] .btn-secondary,
body[data-theme="dark"] .theme-toggle {
  background: rgba(45, 212, 191, .13);
  color: var(--accent-strong);
  border-color: rgba(45, 212, 191, .22);
}

body[data-theme="dark"] .brand-mark {
  background: #fff;
  box-shadow: 0 12px 34px rgba(45, 212, 191, .16);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .login-field,
body[data-theme="dark"] .search-input-shell,
body[data-theme="dark"] .global-search-form input,
body[data-theme="dark"] .search-period-fields select,
body[data-theme="dark"] .search-period-fields input {
  background: rgba(5, 13, 19, .72);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: rgba(156, 177, 189, .72);
}

body[data-theme="dark"] .metric-platform-card,
body[data-theme="dark"] .metric-org-card,
body[data-theme="dark"] .rank-item,
body[data-theme="dark"] .risk-post-card,
body[data-theme="dark"] .sentiment-deep-panel,
body[data-theme="dark"] .sentiment-current-panel,
body[data-theme="dark"] .platform-breakdown-row,
body[data-theme="dark"] .platform-summary-card,
body[data-theme="dark"] .platform-leader-card,
body[data-theme="dark"] .platform-source-card,
body[data-theme="dark"] .platforms-table-panel,
body[data-theme="dark"] .search-result-card,
body[data-theme="dark"] .website-search-card,
body[data-theme="dark"] .youtube-search-card,
body[data-theme="dark"] .search-empty-panel,
body[data-theme="dark"] .data-card,
body[data-theme="dark"] .data-list article,
body[data-theme="dark"] .source-type-btn,
body[data-theme="dark"] .three-label,
body[data-theme="dark"] .three-child-label {
  background: rgba(17, 31, 41, .78);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .metric-card.metric-dark {
  background:
    radial-gradient(circle at 18% 12%, rgba(45, 212, 191, .16), transparent 32%),
    linear-gradient(145deg, rgba(8, 22, 31, .98), rgba(12, 35, 43, .9));
}

body[data-theme="dark"] .metric-card.metric-alert {
  background:
    radial-gradient(circle at 12% 18%, rgba(251, 113, 133, .18), transparent 32%),
    linear-gradient(145deg, rgba(34, 15, 23, .88), rgba(17, 31, 41, .86));
}

body[data-theme="dark"] .popular-searches button,
body[data-theme="dark"] .popular-searches .search-period-open,
body[data-theme="dark"] .search-period-current,
body[data-theme="dark"] .search-period-presets button,
body[data-theme="dark"] .search-period-options span,
body[data-theme="dark"] .search-tab-check-box,
body[data-theme="dark"] .platform-card-mini,
body[data-theme="dark"] .comparison-cell,
body[data-theme="dark"] .organization-logo {
  background: rgba(255, 255, 255, .08);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .search-period-dialog,
body[data-theme="dark"] .analysis-dialog,
body[data-theme="dark"] .sentiment-dialog {
  background:
    radial-gradient(circle at 12% 8%, rgba(45, 212, 191, .13), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, .12), transparent 28%),
    #0f1d27;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] #analysis-modal-content,
body[data-theme="dark"] #sentiment-modal-content,
body[data-theme="dark"] .analysis-report,
body[data-theme="dark"] .analysis-block,
body[data-theme="dark"] .detail-card {
  color: var(--text);
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-color: var(--line);
}

body[data-theme="dark"] th {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

body[data-theme="dark"] a,
body[data-theme="dark"] .search-result-card a {
  color: var(--accent-strong);
}

body[data-theme="dark"] .source-icon {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .22));
}

body[data-theme="dark"] .highcharts-background {
  fill: transparent;
}

body[data-theme="dark"] .highcharts-title,
body[data-theme="dark"] .highcharts-axis-labels text,
body[data-theme="dark"] .highcharts-data-label text,
body[data-theme="dark"] .highcharts-legend-item text {
  fill: var(--text) !important;
  color: var(--text) !important;
}

/* Liquid glass surfaces and dark-mode hardening */
.panel,
.topbar,
.login-card,
.metric-card,
.metric-expanded-row,
.platform-card,
.platform-leader-card,
.platform-source-card,
.platforms-table-panel,
.media-donut-card,
.search-hero,
.search-platform-tab-wrap,
.platform-results,
.matrix-shell,
.sentiment-dialog,
.analysis-dialog,
.search-period-dialog {
  border-color: rgba(255, 255, 255, .45);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, .54), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .38));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .62),
    0 22px 54px rgba(13, 34, 41, .12);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.metric-platform-card,
.metric-org-card,
.platform-card-metrics span,
.platform-card-foot span,
.platform-leader-tile,
.media-platform-row,
.media-card-foot,
.sentiment-deep-panel,
.sentiment-current-panel,
.platform-breakdown-row,
.search-period-current,
.search-period-presets button,
.search-period-options span,
.source-type-btn,
.data-card,
.data-list article,
.three-label,
.three-platform-counter,
.three-platform-stats span {
  border-color: rgba(255, 255, 255, .42);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, .5), transparent 32%),
    rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .58),
    0 14px 30px rgba(13, 34, 41, .08);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

body:not([data-theme="dark"]) .metric-card.metric-dark {
  background:
    radial-gradient(circle at 12% 10%, rgba(20, 184, 166, .18), transparent 34%),
    linear-gradient(145deg, rgba(22, 49, 58, .96), rgba(8, 24, 31, .92));
  border-color: rgba(255, 255, 255, .18);
  color: #f8feff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, .16);
}

body:not([data-theme="dark"]) .metric-card.metric-dark span,
body:not([data-theme="dark"]) .metric-card.metric-dark small,
body:not([data-theme="dark"]) .metric-card.metric-dark strong {
  color: #f8feff;
}

body:not([data-theme="dark"]) .metric-card.metric-dark .metric-premium-icon {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.32), rgba(255,255,255,.08) 42%, transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.05));
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.72);
}

body:not([data-theme="dark"]) .metric-card.metric-alert {
  background:
    radial-gradient(circle at 14% 18%, rgba(251, 113, 133, .14), transparent 32%),
    linear-gradient(145deg, rgba(255, 248, 235, .92), rgba(255, 253, 250, .72));
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .login-card,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .metric-expanded-row,
body[data-theme="dark"] .platforms-command,
body[data-theme="dark"] .platform-card,
body[data-theme="dark"] .platform-leader-card,
body[data-theme="dark"] .platform-leader-card.is-featured,
body[data-theme="dark"] .platform-source-card,
body[data-theme="dark"] .platforms-table-panel,
body[data-theme="dark"] .media-donut-card,
body[data-theme="dark"] .search-hero,
body[data-theme="dark"] .search-platform-tab-wrap,
body[data-theme="dark"] .platform-results,
body[data-theme="dark"] .matrix-shell,
body[data-theme="dark"] .sentiment-dialog,
body[data-theme="dark"] .analysis-dialog,
body[data-theme="dark"] .search-period-dialog {
  border-color: rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .11), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .09), transparent 34%),
    linear-gradient(135deg, rgba(13, 27, 36, .78), rgba(8, 17, 24, .66));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(255, 255, 255, .03),
    0 26px 70px rgba(0, 0, 0, .34);
  color: var(--text);
}

body[data-theme="dark"] .metric-platform-card,
body[data-theme="dark"] .metric-org-card,
body[data-theme="dark"] .metric-more-btn,
body[data-theme="dark"] .metric-empty,
body[data-theme="dark"] .platform-card-metrics span,
body[data-theme="dark"] .platform-card-foot span,
body[data-theme="dark"] .platform-leader-tile,
body[data-theme="dark"] .platform-leader-rank,
body[data-theme="dark"] .media-platform-row,
body[data-theme="dark"] .media-card-foot,
body[data-theme="dark"] .sentiment-deep-panel,
body[data-theme="dark"] .sentiment-current-panel,
body[data-theme="dark"] .platform-breakdown-row,
body[data-theme="dark"] .platform-summary-card,
body[data-theme="dark"] .search-period-current,
body[data-theme="dark"] .search-period-presets button,
body[data-theme="dark"] .search-period-options span,
body[data-theme="dark"] .source-type-btn,
body[data-theme="dark"] .data-card,
body[data-theme="dark"] .data-list article,
body[data-theme="dark"] .three-label,
body[data-theme="dark"] .three-platform-counter,
body[data-theme="dark"] .three-platform-stats span,
body[data-theme="dark"] .comparison-cell {
  border-color: rgba(148, 163, 184, .16);
  background:
    radial-gradient(circle at 16% 0%, rgba(45, 212, 191, .1), transparent 34%),
    linear-gradient(135deg, rgba(18, 35, 45, .74), rgba(10, 22, 30, .62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 18px 42px rgba(0, 0, 0, .22);
  color: var(--text);
}

body[data-theme="dark"] .dashboard-loader,
body[data-theme="dark"] .dashboard-value-loading,
body[data-theme="dark"] .topics-panel .topics-grid .topic-loading-card,
body[data-theme="dark"] .topic-loading-card .topic-icon,
body[data-theme="dark"] .sentiment-legend.is-loading button {
  background:
    linear-gradient(110deg, rgba(13, 27, 36, .78), rgba(28, 48, 58, .9), rgba(13, 27, 36, .78)) !important;
  background-size: 220% 100% !important;
  border-color: rgba(148, 163, 184, .16);
  color: transparent !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 14px 32px rgba(0, 0, 0, .2);
}

body[data-theme="dark"] .dashboard-loader {
  color: var(--muted) !important;
}

body[data-theme="dark"] .sentiment-legend button,
body[data-theme="dark"] .sentiment-platform-tabs button,
body[data-theme="dark"] .platform-results-header {
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .1), transparent 32%),
    linear-gradient(135deg, rgba(18, 35, 45, .86), rgba(10, 22, 30, .78));
  border-color: rgba(148, 163, 184, .16);
  color: var(--text);
}

body[data-theme="dark"] .platform-results-header:hover {
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .15), transparent 34%),
    linear-gradient(135deg, rgba(21, 42, 53, .92), rgba(12, 25, 34, .84));
}

body[data-theme="dark"] .platform-results-icon {
  background: rgba(237, 247, 251, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

body[data-theme="dark"] .hc-donut-center,
body[data-theme="dark"] .hc-donut-label {
  background:
    radial-gradient(circle at 35% 18%, rgba(255, 255, 255, .14), transparent 30%),
    linear-gradient(135deg, rgba(14, 29, 39, .96), rgba(6, 15, 22, .92));
  border: 1px solid rgba(148, 163, 184, .16);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 14px 32px rgba(0, 0, 0, .28);
}

body[data-theme="dark"] .hc-donut-center span {
  color: var(--muted);
}

body[data-theme="dark"] .search-platform-tab-wrap.is-active {
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, .2), transparent 36%),
    linear-gradient(135deg, rgba(12, 55, 58, .92), rgba(8, 22, 30, .84));
  border-color: rgba(45, 212, 191, .34);
}

body[data-theme="dark"] .search-platform-tab-wrap.is-unchecked,
body[data-theme="dark"] .search-platform-tab-wrap:not(.is-active) {
  background:
    radial-gradient(circle at 14% 0%, rgba(148, 163, 184, .07), transparent 30%),
    linear-gradient(135deg, rgba(20, 34, 43, .72), rgba(12, 24, 32, .62));
}

body[data-theme="dark"] .search-tab-icon,
body[data-theme="dark"] .platform-card-icon,
body[data-theme="dark"] .platform-source-head .source-icon,
body[data-theme="dark"] .platform-table-name .source-icon,
body[data-theme="dark"] .media-platform-row i,
body[data-theme="dark"] .three-label i,
body[data-theme="dark"] .metric-platform-icon,
body[data-theme="dark"] .metric-org-logo,
body[data-theme="dark"] .media-org-logo {
  background: rgba(237, 247, 251, .1);
  border-color: rgba(148, 163, 184, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 12px 28px rgba(0, 0, 0, .22);
}

body[data-theme="dark"] .platform-score-ring::after,
body[data-theme="dark"] .media-mini-donut::after,
body[data-theme="dark"] .media-donut-card .media-mini-donut::after {
  background:
    radial-gradient(circle at 42% 25%, rgba(255, 255, 255, .16), transparent 26%),
    linear-gradient(135deg, #0b1821, #102633);
  box-shadow: inset 0 0 0 1px rgba(237, 247, 251, .1);
}

body[data-theme="dark"] .platform-card-head strong,
body[data-theme="dark"] .platform-card-metrics b,
body[data-theme="dark"] .platform-card-foot b,
body[data-theme="dark"] .platform-leader-head strong,
body[data-theme="dark"] .platform-source-head strong,
body[data-theme="dark"] .platform-leader-tile b,
body[data-theme="dark"] .platform-leader-tile em,
body[data-theme="dark"] .media-card-head strong,
body[data-theme="dark"] .media-card-foot b,
body[data-theme="dark"] .media-donut-card .media-mini-donut span,
body[data-theme="dark"] .metric-expanded-head strong,
body[data-theme="dark"] .metric-platform-card strong,
body[data-theme="dark"] .metric-org-card strong,
body[data-theme="dark"] .three-counter-head,
body[data-theme="dark"] .three-platform-stats b {
  color: var(--text);
}

body[data-theme="dark"] .platform-card-head small,
body[data-theme="dark"] .platform-card-metrics em,
body[data-theme="dark"] .platform-card-foot,
body[data-theme="dark"] .platform-leader-head-copy small,
body[data-theme="dark"] .media-card-head span,
body[data-theme="dark"] .media-card-foot,
body[data-theme="dark"] .metric-expanded-head small,
body[data-theme="dark"] .metric-platform-card small,
body[data-theme="dark"] .metric-org-card small,
body[data-theme="dark"] .three-label small,
body[data-theme="dark"] .three-platform-stats small {
  color: var(--muted);
}

body[data-theme="dark"] .media-card-head .media-card-rank {
  border-color: rgba(255,255,255,.16);
  background: #edf3f1;
  color: #17313a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(0,0,0,.2);
}

body[data-theme="dark"] .source-matrix th {
  background: rgba(18, 35, 45, .96);
  color: var(--text);
}

body[data-theme="dark"] .source-matrix td {
  background: rgba(9, 20, 28, .58);
}

body[data-theme="dark"] .source-matrix th:first-child {
  background: rgba(18, 35, 45, .96);
}

body[data-theme="dark"] .source-matrix td:first-child {
  background: rgba(9, 20, 28, .58);
}

body[data-theme="dark"] .source-cell-entry {
  border-color: rgba(148, 163, 184, .15);
  background: rgba(15, 30, 40, .52);
}

body[data-theme="dark"] .matrix-add-source,
body[data-theme="dark"] .matrix-row-actions button {
  border-color: rgba(94, 234, 212, .2);
  background: rgba(94, 234, 212, .07);
}

body[data-theme="dark"] .matrix-row-actions button.danger {
  background: rgba(248, 113, 113, .1);
}

body[data-theme="dark"] .platform-comparison-table th {
  color: var(--muted);
}

body[data-theme="dark"] .platform-comparison-table td {
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 212, 191, .12), transparent 36%),
    linear-gradient(135deg, rgba(18, 35, 45, .88), rgba(8, 18, 26, .78));
  color: var(--text);
  border-top: 1px solid rgba(148, 163, 184, .14);
  border-bottom: 1px solid rgba(148, 163, 184, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

body[data-theme="dark"] .platform-comparison-table td:first-child {
  border-left: 1px solid rgba(148, 163, 184, .14);
}

body[data-theme="dark"] .platform-comparison-table td:last-child {
  border-right: 1px solid rgba(148, 163, 184, .14);
}

body[data-theme="dark"] .highcharts-plot-background,
body[data-theme="dark"] .highcharts-pane,
body[data-theme="dark"] .highcharts-scrollable-plot-area {
  fill: transparent !important;
}

body[data-theme="dark"] .highcharts-grid-line,
body[data-theme="dark"] .highcharts-axis-line {
  stroke: rgba(196, 217, 225, .14) !important;
}

body[data-theme="dark"] .highcharts-point {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18));
}

/* Settings workspace */
.settings-stack {
  display: grid;
  gap: 18px;
}

.settings-workbench .panel-head {
  align-items: center;
  margin-bottom: 14px;
}

.settings-workbench {
  padding: 20px;
}

.settings-intro {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.4;
}

.settings-workbench-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 20px;
  background: rgba(19, 39, 47, .045);
}

.settings-create-action {
  display: inline-grid;
  grid-template-columns: 32px minmax(max-content, 1fr) 18px;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 8px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 8px 20px rgba(20,43,47,.06);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none !important;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.settings-create-action:hover {
  border-color: rgba(15, 118, 110, .26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 12px 26px rgba(15,118,110,.12);
  transform: translateY(-2px);
}

.settings-create-action:focus-visible {
  outline: 3px solid rgba(20, 184, 166, .2);
  outline-offset: 2px;
}

.settings-create-action.is-primary {
  border-color: rgba(15, 118, 110, .24);
  background: linear-gradient(135deg, #0f8f85, #0b746d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 28px rgba(15,118,110,.2);
  color: #fff;
}

.settings-action-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, .1);
  border-radius: 12px;
  background: rgba(15, 118, 110, .09);
  color: var(--accent-strong);
  font-size: .9rem;
}

.settings-create-action.is-primary .settings-action-icon {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.14);
  color: #fff;
}

.settings-action-arrow {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: .62rem;
  transition: transform .2s ease;
}

.settings-create-action.is-primary .settings-action-arrow {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.settings-create-action:hover .settings-action-arrow {
  transform: translateX(2px);
}

.settings-commandbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
}

.settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.settings-summary > span {
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  min-width: 170px;
  column-gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 13px;
  background: rgba(20, 184, 166, .08);
}

.settings-summary i { grid-row: 1 / 3; color: var(--accent-strong); font-size: 1rem; }
.settings-summary b { color: var(--ink); font-size: 1rem; font-weight: 950; }
.settings-summary small { color: var(--muted); font-size: .68rem; font-weight: 800; }

.settings-registry-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-strong);
  color: var(--muted);
}

.settings-registry-search input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.settings-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 18px;
  align-items: start;
}

.settings-form-panel {
  min-width: 0;
}

.organization-registry {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.organization-registry-card {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 9px;
  width: 100%;
  padding: 13px 14px;
  border-left: 3px solid rgba(15, 143, 133, .45);
  box-shadow: 0 10px 26px rgba(20, 43, 47, .055);
}

.organization-registry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.organization-registry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.data-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.data-card-main,
.data-title,
.data-sub {
  min-width: 0;
}

.data-title {
  overflow: hidden;
  color: var(--ink);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-registry-card .organization-logo {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 13px;
}

.organization-registry-card .data-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-registry-meta {
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.organization-registry-meta .chip {
  gap: 5px;
  max-width: 150px;
  padding: 5px 8px;
  overflow: hidden;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-registry-meta .chip i {
  flex: 0 0 auto;
  font-size: .62rem;
  opacity: .72;
}

.organization-source-heading {
  display: flex;
  align-items: center;
  min-height: 20px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.organization-source-heading span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.organization-source-heading i {
  color: var(--accent-strong);
}

.organization-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.organization-source-chip,
.organization-source-empty {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
}

.organization-source-chip {
  grid-template-columns: 30px minmax(0, 1fr) auto 29px;
  flex: 1 1 210px;
  max-width: 300px;
  gap: 7px;
  padding: 7px 8px;
}

.organization-source-empty {
  flex: 1 1 100%;
  place-items: start;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.organization-source-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 12px;
  background: rgba(20, 184, 166, .1);
}

.organization-source-icon .source-icon {
  width: 18px;
  height: 18px;
}

.organization-source-chip strong,
.organization-source-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-source-chip strong {
  color: var(--ink);
  font-size: .76rem;
  font-weight: 950;
}

.organization-source-chip small,
.organization-source-stats small {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 850;
}

.organization-source-stats {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.organization-source-stats b {
  color: var(--accent-strong);
  font-size: .76rem;
  font-weight: 950;
}

.action-icon-btn {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(20, 43, 47, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  color: var(--accent-strong);
  cursor: pointer;
}

.organization-registry-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
}

.organization-registry-actions .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(20, 43, 47, .07);
  background: rgba(19, 39, 47, .045);
  font-size: .7rem;
  text-decoration: none;
  white-space: nowrap;
}

.organization-registry-actions .organization-action-add {
  border-color: rgba(15, 118, 110, .14);
  background: rgba(15, 118, 110, .09);
  color: var(--accent-strong);
}

.organization-registry-actions .action-btn:hover,
.action-icon-btn:hover {
  border-color: rgba(15, 118, 110, .25);
  background: rgba(15, 118, 110, .12);
}

.source-reach { color: var(--accent-strong); }

body[data-theme="dark"] .settings-commandbar,
body[data-theme="dark"] .settings-registry-search {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(8, 20, 28, .62);
}

body[data-theme="dark"] .settings-workbench-actions {
  border-color: rgba(148,163,184,.14);
  background: rgba(255,255,255,.035);
}

body[data-theme="dark"] .settings-create-action {
  border-color: rgba(148,163,184,.16);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(0,0,0,.18);
  color: var(--text);
}

body[data-theme="dark"] .settings-create-action.is-primary {
  border-color: rgba(45,212,191,.24);
  background: linear-gradient(135deg, rgba(15,143,133,.95), rgba(8,103,98,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 30px rgba(0,0,0,.24);
  color: #fff;
}

body[data-theme="dark"] .settings-action-icon {
  border-color: rgba(45,212,191,.16);
  background: rgba(45,212,191,.1);
  color: #5eead4;
}

body[data-theme="dark"] .settings-create-action.is-primary .settings-action-icon {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.12);
  color: #fff;
}

body[data-theme="dark"] .settings-summary b { color: var(--text); }

.source-registry[hidden] {
  display: none;
}

/* Dark-mode targeted polish */
body[data-theme="dark"] .login-field {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html:has(body[data-theme="dark"]),
body[data-theme="dark"] {
  overflow-x: hidden;
}

body[data-theme="dark"] .sentiment-platform-tabs,
body[data-theme="dark"] .search-platform-tabs {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .hc-donut-chart {
  z-index: 4;
}

body[data-theme="dark"] .hc-donut-center {
  z-index: 3;
  width: 136px;
  height: 136px;
  padding-top: 8px;
  background:
    radial-gradient(circle at 42% 26%, rgba(255, 255, 255, .13), transparent 27%),
    linear-gradient(135deg, #0b1821, #071017);
}

body[data-theme="dark"] .sentiment-donut-chart-shell .hc-donut-center {
  left: 50%;
}

body[data-theme="dark"] .hc-donut-label {
  position: relative;
  z-index: 8;
}

body[data-theme="dark"] .hc-donut-center strong {
  font-size: 1.5rem;
}

body[data-theme="dark"] .hc-donut-center span {
  margin-top: -24px;
  font-size: .62rem;
}

body[data-theme="dark"] .sentiment-donut-chart-shell::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #071017;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body[data-theme="dark"] .panel-expand-btn,
body[data-theme="dark"] .panel-expand-btn:hover,
body[data-theme="dark"] .metric-expand-btn,
body[data-theme="dark"] .metric-card:hover .metric-expand-btn,
body[data-theme="dark"] .metric-card.is-expanded .metric-expand-btn {
  border-color: rgba(148, 163, 184, .2);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .18), transparent 34%),
    rgba(18, 35, 45, .74);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 12px 26px rgba(0, 0, 0, .24);
}

body[data-theme="dark"] .risk-date-filters button {
  border-color: rgba(237, 247, 251, .2);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .09), transparent 36%),
    rgba(237, 247, 251, .08);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 10px 22px rgba(0, 0, 0, .18);
}

body[data-theme="dark"] .topic-date-control {
  border-color: rgba(148, 163, 184, .2);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .08), transparent 44%),
    rgba(18, 35, 45, .76);
  color: #5eead4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 26px rgba(0, 0, 0, .18);
}

body[data-theme="dark"] .topic-date-control select,
body[data-theme="dark"] .topic-date-control option {
  background: #10212b;
  color: var(--text);
}

body[data-theme="dark"] .risk-date-filters button.is-active {
  border-color: rgba(239, 68, 68, .42);
  background:
    radial-gradient(circle at 24% 0%, rgba(248, 113, 113, .18), transparent 36%),
    rgba(127, 29, 29, .28);
  color: #fca5a5;
}

body[data-theme="dark"] .platform-results-header,
body[data-theme="dark"] .platform-results-header:hover {
  background: transparent;
}

body[data-theme="dark"] .youtube-search-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
}

body[data-theme="dark"] .search-result-card.youtube-search-card,
body[data-theme="dark"] .platform-results .youtube-search-card {
  background: transparent;
}

body[data-theme="dark"] .timeline-org-toggle {
  border-color: rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, .12), transparent 38%),
    rgba(237, 247, 251, .08);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 14px 28px rgba(0,0,0,.22);
}

body[data-theme="dark"] .timeline-org-toggle:hover,
body[data-theme="dark"] .timeline-org-toggle.has-selection {
  border-color: rgba(45, 212, 191, .42);
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, .18), transparent 38%),
    rgba(20, 184, 166, .12);
}

body[data-theme="dark"] .timeline-org-menu {
  border-color: rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at 18% 0%, rgba(45,212,191,.12), transparent 34%),
    linear-gradient(145deg, rgba(18,35,45,.96), rgba(10,22,30,.92));
  box-shadow: 0 28px 58px rgba(0,0,0,.42);
}

body[data-theme="dark"] .timeline-org-search {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(237, 247, 251, .08);
}

body[data-theme="dark"] .timeline-org-option {
  color: var(--text);
}

body[data-theme="dark"] .timeline-org-option:hover,
body[data-theme="dark"] .timeline-org-option.is-active {
  background: rgba(45, 212, 191, .13);
}

body[data-theme="dark"] .search-period-dialog {
  overflow-x: hidden;
  box-sizing: border-box;
}

body[data-theme="dark"] .three-system-graph::before {
  background-image:
    linear-gradient(transparent 1px, transparent 1px),
    linear-gradient(90deg, transparent 1px, transparent 1px);
}

body[data-theme="dark"] .organization-registry-card,
body[data-theme="dark"] .organization-source-chip,
body[data-theme="dark"] .organization-source-empty {
  border-color: rgba(148, 163, 184, .16);
  background:
    radial-gradient(circle at 16% 0%, rgba(45, 212, 191, .08), transparent 34%),
    linear-gradient(135deg, rgba(18, 35, 45, .64), rgba(10, 22, 30, .52));
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 18px 42px rgba(0, 0, 0, .2);
}

body[data-theme="dark"] .data-title,
body[data-theme="dark"] .organization-source-chip strong {
  color: var(--text);
}

body[data-theme="dark"] .action-icon-btn {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(237, 247, 251, .08);
  color: var(--accent-strong);
}

body[data-theme="dark"] .organization-registry-actions .action-btn {
  border-color: rgba(148, 163, 184, .13);
  background: rgba(255, 255, 255, .055);
  color: var(--text);
}

body[data-theme="dark"] .organization-registry-actions .organization-action-add {
  border-color: rgba(45, 212, 191, .2);
  background: rgba(45, 212, 191, .1);
  color: #5eead4;
}

body[data-theme="dark"] .organization-registry-actions .action-btn.danger {
  color: #fca5a5;
}

@media (max-width: 1100px) {
  .settings-create-grid,
  .organization-registry-card {
    grid-template-columns: 1fr;
  }

  .settings-workbench-actions,
  .organization-registry-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1500px) {
  .organization-registry-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .organization-registry-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .settings-commandbar,
  .organization-registry { grid-template-columns: 1fr; }
  .settings-summary > span { flex: 1; min-width: 140px; }

  .settings-workbench {
    padding: 14px;
  }

  .settings-workbench .panel-head {
    align-items: stretch;
  }

  .organization-registry-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .organization-registry-meta {
    flex-wrap: wrap;
  }

  .organization-source-chip {
    flex-basis: 100%;
    max-width: none;
  }
}

/* Responsive application shell: tablet and phone */
@media (max-width: 1180px) {
  body.authenticated .app-shell {
    width: calc(100% - 24px);
    padding-top: 12px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .brand {
    min-width: 0;
    max-width: none;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: center;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card:first-child {
    grid-column: span 2;
  }

  .platforms-summary-grid,
  .metric-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .organization-registry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root { --radius-xl: 22px; --radius-lg: 18px; }

  body.authenticated {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.authenticated .app-shell {
    width: calc(100% - 16px);
    padding-top: 8px;
  }

  .topbar {
    position: relative;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
  }

  .brand {
    grid-column: 1;
    width: auto;
    min-width: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .brand strong {
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small { display: none; }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    gap: 5px;
    overflow: visible;
  }

  .lang-switcher {
    gap: 2px;
    padding: 3px;
  }

  .lang-btn {
    min-width: 33px;
    min-height: 36px;
    padding: 7px 5px;
    font-size: .7rem;
  }

  .theme-toggle,
  .topbar-icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .theme-toggle i { width: 28px; height: 28px; }

  .main-nav {
    position: fixed;
    z-index: 100;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: auto;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
    box-shadow: 0 20px 48px rgba(9, 25, 32, .24);
    backdrop-filter: blur(22px);
  }

  .nav-btn {
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 15px;
  }

  .nav-btn i { font-size: 1rem; }

  .nav-btn span {
    width: 100%;
    overflow: hidden;
    font-size: .55rem;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
  }

  .workspace-page { margin-top: 10px; }
  .panel { padding: 16px; border-radius: 20px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-intro h2, .panel h3 { overflow-wrap: anywhere; }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .metric-card,
  .metric-card:first-child {
    grid-column: auto;
    min-height: 132px;
    padding: 16px;
  }

  .metric-card strong { margin: 12px 0 8px; font-size: clamp(1.65rem, 9vw, 2.2rem); }
  .metric-premium-icon { right: 12px; bottom: 12px; width: 38px; height: 38px; }

  .platforms-summary-grid,
  .metric-platform-grid,
  .media-donut-grid,
  .youtube-search-grid,
  .social-search-grid,
  .search-platform-tabs,
  .metric-org-strip {
    grid-template-columns: 1fr;
  }

  .metric-platform-card.is-dimensional {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .platform-chart,
  .platform-chart.wide {
    min-height: 280px;
  }

  .platforms-chart-card,
  .timeline-card { min-width: 0; overflow: hidden; }

  .platform-leader-list { grid-template-columns: 1fr; }
  .instagram-search-posts { columns: 1; }
  .telegram-embed-masonry, .twitter-embed-masonry { column-count: 1; }

  .matrix-shell {
    margin-inline: -8px;
    padding-bottom: 8px;
    overscroll-behavior-inline: contain;
  }

  .source-matrix { min-width: 1280px; }
  .source-matrix th:first-child, .source-matrix td:first-child { min-width: 190px; }

  .matrix-source-option { grid-template-columns: 36px minmax(0, 1fr); }
  .matrix-source-option .source-icon { width: 36px; height: 36px; }
  .matrix-source-attach { grid-column: 1 / -1; width: 100%; }
  .matrix-source-composer { grid-template-columns: 1fr; }
  .matrix-source-create { width: 100%; }
  .matrix-source-option-copy small { flex-wrap: wrap; }
  .matrix-source-option-copy small .matrix-source-origin { margin-left: 0; }

  .settings-workbench .panel-head,
  .settings-create-grid { gap: 12px; }

  .settings-workbench-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .settings-workbench-actions .btn,
  .organization-registry-actions .action-btn { text-align: center; }

  .settings-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-summary > span { min-width: 0; padding: 8px; }
  .settings-commandbar { padding: 8px; }
  .organization-registry-card { padding: 13px; }
  .organization-source-strip { grid-template-columns: 1fr; }
  .organization-source-chip { grid-template-columns: 32px minmax(0, 1fr) auto 32px; gap: 7px; }
  .organization-registry-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .organization-registry-actions .action-btn:first-child { grid-column: 1 / -1; }

  .analysis-dialog,
  .sentiment-dialog,
  .video-dialog,
  .search-period-dialog {
    inset: 6px;
    max-width: none;
    max-height: calc(100dvh - 12px);
    border-radius: 20px;
  }

  .hero-panel { min-height: auto; gap: 14px; }
  .hero-copy, .login-card { padding: 24px; }
  .hero-copy h1 { font-size: clamp(2.3rem, 13vw, 3.7rem); }
}

@media (max-width: 420px) {
  .topbar { grid-template-columns: 1fr; }
  .brand { grid-column: 1; }
  .topbar-actions { grid-column: 1; grid-row: 2; justify-content: space-between; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .settings-summary { grid-template-columns: 1fr; }
  .settings-workbench-actions, .organization-registry-actions { grid-template-columns: 1fr; }
  .organization-registry-actions .action-btn:first-child { grid-column: auto; }
}
