:root {
  color-scheme: dark;
  --page: #0a1419;
  --surface: #1a2d42;
  --accent: #38c793;
  --text: #e8eff6;
  --gold: #ffd700;
  --dashboard-ink: #17324d;
  --dashboard-muted: #62758a;
  --dashboard-blue: #2874a6;
  --dashboard-pale: #eff7fc;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  box-sizing: border-box;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

.app-shell {
  width: 100%;
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(56, 199, 147, 0.1), transparent 34rem),
    linear-gradient(145deg, #0a1419 0%, #0f1923 52%, #0d2a2a 100%) !important;
}

header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(120deg, #0f3a3a 0%, #1a5a4a 55%, #218b69 100%) !important;
}

header::before,
header::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

header::before {
  z-index: 0;
  background: url("./header-background.jpe") center 42% / cover no-repeat;
  filter: blur(2px);
  transform: scale(1.04);
}

header::after {
  z-index: 1;
  background: linear-gradient(120deg, rgba(10, 39, 43, 0.76), rgba(20, 86, 71, 0.64));
}

header > .absolute {
  z-index: 2;
}

header > div.relative {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  padding: clamp(2rem, 5vw, 4.5rem) 1.25rem !important;
}

.header-logo {
  max-width: min(28vw, 140px);
  object-fit: contain;
  animation: none !important;
}

#el-title {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(2rem, 5vw, 3.65rem) !important;
  line-height: 1.08;
}

#el-subtitle {
  max-width: 650px;
  margin-inline: auto;
  line-height: 1.6;
}

nav {
  display: flex;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 0.45rem !important;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.75rem max(1rem, calc((100vw - 1200px) / 2)) !important;
  background: rgba(15, 25, 35, 0.96) !important;
  border-bottom: 1px solid rgba(56, 199, 147, 0.25) !important;
  scrollbar-width: thin;
  scrollbar-color: #38c793 #142331;
  backdrop-filter: blur(14px);
}

.nav-link {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid transparent;
  color: var(--text) !important;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent) !important;
  background: rgba(56, 199, 147, 0.11) !important;
  border-color: rgba(56, 199, 147, 0.26);
}

.nav-link::after {
  display: none;
}

section[id] {
  width: min(100% - 2rem, 1200px);
  min-height: 58vh !important;
  padding: clamp(2rem, 5vw, 4rem) 0 !important;
  scroll-margin-top: 5rem;
  animation: section-in 0.35s ease both;
}

section[id] > div:first-child {
  margin-bottom: 0 !important;
}

.section-title {
  margin-top: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem) !important;
  line-height: 1.15;
  text-wrap: balance;
}

section h3 {
  text-wrap: balance;
}

.rounded-xl {
  border: 1px solid rgba(210, 230, 242, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.rounded-xl > img,
img.rounded-lg {
  display: block;
}

.grid > .rounded-xl,
.grid > div.rounded-xl {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.grid > .rounded-xl:hover,
.grid > div.rounded-xl:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 199, 147, 0.35);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

#carousel-container {
  touch-action: pan-y;
}

#carousel-container img {
  background: #142331;
}

.carousel-control {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: white;
  background: rgba(10, 20, 25, 0.72);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-control:hover {
  background: #1a5a4a;
  transform: translateY(-50%) scale(1.06);
}

.carousel-control.previous {
  left: 1rem;
}

.carousel-control.next {
  right: 1rem;
}

.cadsuas-card {
  max-width: 760px;
}

.cadsuas-button:disabled {
  opacity: 0.78;
}

#cadunico {
  width: min(100% - 2rem, 1280px);
}

#cadunico-dashboard {
  color: var(--dashboard-ink);
}

.social-dashboard {
  --dashboard-ink: #17324d;
  --dashboard-muted: #4b6176;
  --dashboard-blue: #2874a6;
  --dashboard-border: #c9dbe8;
  padding: clamp(0.9rem, 3vw, 1.5rem);
  border: 1px solid #d2e1ec;
  border-radius: 1.25rem;
  color: var(--dashboard-ink);
  background: #f2f7fb;
  font-size: 1rem;
  line-height: 1.6;
}

.social-dashboard,
.social-dashboard * {
  box-sizing: border-box;
}

.dashboard-hero {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid #cbdde9;
  border-radius: 1.25rem;
  color: var(--dashboard-ink);
  background: linear-gradient(135deg, #f8fcff, #eaf5fb);
  box-shadow: 0 14px 36px rgba(8, 41, 67, 0.12);
}

.dashboard-eyebrow {
  margin: 0 0 0.5rem;
  color: #2874a6;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-title {
  margin: 0;
  color: #123553;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.15;
  text-wrap: balance;
}

.dashboard-lede {
  max-width: 760px;
  margin: 0.75rem 0 0;
  color: #3e566c;
}

.dashboard-alert {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e6c982;
  border-left: 4px solid #d99620;
  border-radius: 0.8rem;
  color: #533a0f;
  background: #fff6df;
}

.dashboard-alert p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid #c9dbe8;
  border-radius: 1rem;
  background: #fff;
}

.dashboard-field {
  display: grid;
  gap: 0.35rem;
  color: #29475f;
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-field select,
.dashboard-field input {
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bed2e0;
  border-radius: 0.65rem;
  color: #17324d;
  background: #fff;
  font: inherit;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-left: auto;
}

.dashboard-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #216792;
  border-radius: 0.65rem;
  color: #fff;
  background: #216792;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dashboard-button:hover {
  background: #154d71;
  transform: translateY(-1px);
}

.dashboard-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.dashboard-button.secondary {
  border-color: #bed2e0;
  color: #17324d;
  background: #fff;
}

.dashboard-button.secondary:hover {
  background: #eff7fc;
}

.dashboard-button input[type="file"] {
  display: none;
}

.dashboard-status {
  min-height: 1.5rem;
  margin: 0 0 0.75rem;
  color: #37546d;
  font-size: 0.9rem;
}

.dashboard-status[data-type="error"] {
  color: #a52828;
}

.dashboard-status[data-type="success"] {
  color: #176444;
}

.dashboard-group {
  margin-top: 1.7rem;
}

.dashboard-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.8rem;
  color: #17324d;
  font-size: 1.35rem;
}

.dashboard-group-title small {
  color: #4b6176;
  font-size: 0.78rem;
  font-weight: 500;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0.8rem;
}

.dashboard-card,
.dashboard-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #c9dbe8;
  border-radius: 0.9rem;
  color: #17324d;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 54, 82, 0.06);
}

.dashboard-card {
  border-top: 3px solid #4d94bd;
  background: #fff;
}

.dashboard-card-label {
  margin: 0;
  color: #43586b;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.dashboard-card-value {
  display: block;
  margin-top: 0.35rem;
  color: #173f61;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-card-note {
  margin: 0.35rem 0 0;
  color: #4b6074;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.dashboard-panel h4 {
  margin: 0;
  color: #17324d;
  font-size: 1rem;
}

.dashboard-chart-subtitle {
  margin: 0.2rem 0 0.75rem;
  color: #718195;
  font-size: 0.78rem;
}

.dashboard-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dashboard-svg text {
  fill: #4b6176;
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
}

.dashboard-svg .chart-grid {
  stroke: #e3edf4;
  stroke-width: 1;
}

.dashboard-svg .chart-line {
  fill: none;
  stroke: #2874a6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.dashboard-svg .chart-point {
  fill: #fff;
  stroke: #2874a6;
  stroke-width: 2.5;
}

.dashboard-svg .chart-bar {
  fill: #4b96c2;
  rx: 4;
}

.dashboard-no-chart {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 1rem;
  color: #6a7f92;
  text-align: center;
  font-size: 0.85rem;
}

.dashboard-table-wrap {
  overflow-x: auto;
  border: 1px solid #c9dbe8;
  border-radius: 0.9rem;
  background: #fff;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  color: #203d55;
  font-size: 0.9rem;
  text-align: left;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid #d7e4ed;
  vertical-align: top;
}

.dashboard-table th {
  color: #233f57;
  background: #eaf3f9;
  font-size: 0.82rem;
  white-space: nowrap;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-source-list a {
  color: #15577e;
  font-weight: 650;
  text-underline-offset: 3px;
}

.dashboard-source-list a:hover {
  color: #0c3e5e;
}

.dashboard-source-list a:focus-visible {
  outline-color: #15577e;
}

.dashboard-details {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #c9dbe8;
  border-radius: 0.85rem;
  color: #344f66;
  background: #fff;
  font-size: 0.92rem;
}

.dashboard-details summary {
  cursor: pointer;
  font-weight: 700;
}

.dashboard-log {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
}

.dashboard-help {
  margin: 1rem 0 0;
  color: #435a6f;
  font-size: 0.88rem;
  line-height: 1.55;
}

.dashboard-empty {
  padding: 1.25rem;
  border: 1px dashed #9bb9cd;
  border-radius: 0.85rem;
  color: #3d566d;
  background: #f7fbfe;
}

.dashboard-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.welcome-screen {
  background: linear-gradient(135deg, #071b35 0%, #0b5b69 48%, #b83280 100%);
}

.welcome-card {
  width: min(90%, 760px);
  padding: clamp(2rem, 6vw, 3.5rem);
}

.welcome-text {
  color: #e9f8ff;
}

video {
  max-height: 75vh;
  object-fit: contain;
}

footer {
  margin-top: 2rem;
  padding-bottom: env(safe-area-inset-bottom);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  #home > div:first-child > div:first-child > div:first-child {
    height: min(48vw, 500px) !important;
  }
}

@media (max-width: 640px) {
  section[id] {
    width: min(100% - 1.25rem, 1200px);
    padding-block: 1.75rem !important;
  }

  nav {
    gap: 0.25rem !important;
    padding-block: 0.6rem !important;
  }

  .nav-link {
    padding-inline: 0.8rem !important;
    font-size: 0.8rem !important;
  }

  .dashboard-actions {
    width: 100%;
    margin-left: 0;
  }

  .dashboard-button {
    flex: 1 1 auto;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .dashboard-group-title {
    align-items: start;
    flex-direction: column;
    gap: 0.2rem;
  }

  #home > div:first-child > div:first-child > div:first-child {
    height: 58vw !important;
    min-height: 220px;
    max-height: 360px;
  }

  .carousel-control {
    width: 36px;
    height: 36px;
  }

  .welcome-logos img {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
