* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: rgb(248, 250, 252);
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.06) 0px, transparent 45%);
  color: rgb(15, 23, 42);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(226, 232, 240);
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
  z-index: 20;
}

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

.brand-mark {
  background: linear-gradient(135deg, rgb(79, 70, 229), rgb(14, 165, 233));
  color: rgb(255, 255, 255);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 8px 11px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.brand-copy h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgb(15, 23, 42);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgb(100, 116, 139);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: rgb(241, 245, 249);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid rgb(226, 232, 240);
}

.section-btn {
  border: none;
  background: transparent;
  color: rgb(71, 85, 105);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.16s ease;
}

.section-btn:hover {
  color: rgb(15, 23, 42);
}

.section-btn.active {
  background-color: rgb(255, 255, 255);
  color: rgb(79, 70, 229);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.count-pill {
  background-color: rgba(79, 70, 229, 0.1);
  color: rgb(79, 70, 229);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-lg {
  padding: 10px 18px;
  font-size: 13.5px;
}

.btn-primary {
  background: linear-gradient(135deg, rgb(79, 70, 229), rgb(67, 56, 202));
  color: rgb(255, 255, 255);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgb(67, 56, 202), rgb(55, 48, 163));
  transform: translateY(-1px);
}

.btn-outline {
  background-color: rgb(255, 255, 255);
  color: rgb(30, 41, 59);
  border-color: rgb(203, 213, 225);
}

.btn-outline:hover {
  background-color: rgb(248, 250, 252);
  border-color: rgb(148, 163, 184);
}

.btn-subtle {
  background-color: rgb(241, 245, 249);
  color: rgb(51, 65, 85);
}

.btn-subtle:hover {
  background-color: rgb(226, 232, 240);
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr 370px;
  flex: 1;
  min-height: 0;
}

.main-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.stage-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.subnav-bar {
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(226, 232, 240);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.subnav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subnav-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(100, 116, 139);
  margin-right: 4px;
}

.sub-btn {
  border: 1px solid rgb(226, 232, 240);
  background-color: rgb(255, 255, 255);
  color: rgb(51, 65, 85);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.16s ease;
}

.sub-btn:hover {
  border-color: rgb(99, 102, 241);
  color: rgb(79, 70, 229);
}

.sub-btn.active {
  background: linear-gradient(135deg, rgb(79, 70, 229), rgb(14, 165, 233));
  border-color: transparent;
  color: rgb(255, 255, 255);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.22);
}

.sub-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: rgb(241, 245, 249);
  color: rgb(71, 85, 105);
}

.sub-btn.active .sub-count {
  background-color: rgba(255, 255, 255, 0.22);
  color: rgb(255, 255, 255);
}

.subnav-hint {
  font-size: 12px;
  color: rgb(100, 116, 139);
}

.info-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background-color: rgb(255, 255, 255);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 14px;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card.highlight-pulse {
  border-color: rgb(79, 70, 229);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.eco-overview-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgb(79, 70, 229);
}

.card-head h3 {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgb(15, 23, 42);
}


.gif-showcase-box {
  width: 100%;
  background-color: rgb(15, 23, 42);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gif-showcase-box img {
  width: 100%;
  max-height: 540px;
  height: auto;
  object-fit: contain;
  display: block;
}

.canvas-box {
  position: relative;
  width: 100%;
  background-color: rgb(248, 250, 252);
  border: 1px solid rgb(241, 245, 249);
  border-radius: 10px;
  padding: 8px;
}

.canvas-box-sm {
  height: 225px;
}

.canvas-box-lg {
  height: 320px;
}

.canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: rgb(71, 85, 105);
  padding-top: 2px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.explorer-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 16px;
  align-items: start;
}

.dataset-sidebar {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 780px;
}

.sidebar-head {
  padding: 13px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(71, 85, 105);
  background-color: rgb(248, 250, 252);
  border-bottom: 1px solid rgb(226, 232, 240);
}

.dataset-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: rgb(51, 65, 85);
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all 0.14s ease;
}

.nav-item:hover {
  background-color: rgb(241, 245, 249);
  color: rgb(15, 23, 42);
}

.nav-item.active {
  background-color: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.28);
  color: rgb(67, 56, 202);
  font-weight: 600;
}

.nav-count {
  font-size: 11px;
  color: rgb(100, 116, 139);
  background-color: rgb(241, 245, 249);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.nav-item.active .nav-count {
  background-color: rgba(79, 70, 229, 0.14);
  color: rgb(67, 56, 202);
}

.dataset-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.active-chart-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chart-title-block h2 {
  margin: 2px 0 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgb(15, 23, 42);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ctrl-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgb(71, 85, 105);
}

.ctrl-field select,
.mobile-dataset-select {
  background-color: rgb(248, 250, 252);
  color: rgb(15, 23, 42);
  border: 1px solid rgb(203, 213, 225);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  max-width: 260px;
}

.chart-type-switch {
  display: inline-flex;
  background-color: rgb(241, 245, 249);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgb(226, 232, 240);
}

.type-btn {
  border: none;
  background: transparent;
  color: rgb(71, 85, 105);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
}

.type-btn.active {
  background-color: rgb(255, 255, 255);
  color: rgb(79, 70, 229);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background-color: rgba(15, 23, 42, 0.94);
  color: rgb(255, 255, 255);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
  z-index: 10;
  max-width: 290px;
}

.comment-mount {
  border-top: 1px solid rgb(241, 245, 249);
  padding-top: 8px;
  margin-top: 2px;
}

.comment-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.comment-toggle-btn {
  border: 1px solid rgb(226, 232, 240);
  background-color: rgb(248, 250, 252);
  color: rgb(71, 85, 105);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.14s ease;
}

.comment-toggle-btn:hover {
  border-color: rgb(99, 102, 241);
  color: rgb(79, 70, 229);
  background-color: rgba(79, 70, 229, 0.05);
}

.comment-drawer {
  margin-top: 8px;
  background-color: rgb(248, 250, 252);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.comment-row {
  background-color: rgb(255, 255, 255);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.4;
}

.comment-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 2px;
}

.comment-row-author {
  font-weight: 700;
  color: rgb(79, 70, 229);
}

.comment-row-time {
  color: rgb(148, 163, 184);
}

.comment-inline-form {
  display: flex;
  gap: 6px;
}

.comment-inline-form input {
  flex: 1;
  background-color: rgb(255, 255, 255);
  border: 1px solid rgb(203, 213, 225);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: rgb(15, 23, 42);
}

.comment-inline-form button {
  background-color: rgb(79, 70, 229);
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.table-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.mobile-dataset-select {
  display: none;
}

input[type="search"] {
  width: 100%;
  max-width: 420px;
  background-color: rgb(248, 250, 252);
  color: rgb(15, 23, 42);
  border: 1px solid rgb(203, 213, 225);
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13.5px;
}

input[type="search"]:focus {
  outline: none;
  border-color: rgb(79, 70, 229);
  background-color: rgb(255, 255, 255);
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-pill {
  font-size: 12px;
  font-weight: 600;
  color: rgb(71, 85, 105);
  background-color: rgb(241, 245, 249);
  padding: 6px 11px;
  border-radius: 999px;
}

.table-scroll {
  overflow: auto;
  max-height: 460px;
  border: 1px solid rgb(226, 232, 240);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background-color: rgb(255, 255, 255);
}

th,
td {
  padding: 9px 13px;
  border-bottom: 1px solid rgb(241, 245, 249);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background-color: rgb(248, 250, 252);
  color: rgb(30, 41, 59);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  z-index: 2;
  border-bottom: 1px solid rgb(226, 232, 240);
}

th:hover {
  background-color: rgb(241, 245, 249);
}

tbody tr:nth-child(even) td {
  background-color: rgb(252, 253, 255);
}

tbody tr:hover td {
  background-color: rgba(79, 70, 229, 0.04);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgb(67, 56, 202);
}

.news-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.news-header-bar {
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.news-header-bar h2 {
  margin: 3px 0 4px;
  font-size: 20px;
  color: rgb(15, 23, 42);
}

.news-lead {
  margin: 0;
  font-size: 13.5px;
  color: rgb(100, 116, 139);
}

.news-form-card {
  padding: 20px 24px;
  border-color: rgba(79, 70, 229, 0.35);
}

.form-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.form-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.news-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid-two {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgb(51, 65, 85);
}

.form-field input[type="text"],
.form-field textarea {
  background-color: rgb(248, 250, 252);
  color: rgb(15, 23, 42);
  border: 1px solid rgb(203, 213, 225);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
}

.form-field input[readonly] {
  background-color: rgb(241, 245, 249);
  color: rgb(100, 116, 139);
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background-color: rgba(79, 70, 229, 0.08);
  color: rgb(67, 56, 202);
  border: 1px dashed rgba(79, 70, 229, 0.45);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.upload-btn:hover {
  background-color: rgba(79, 70, 229, 0.14);
}

.photo-hint {
  font-size: 12px;
  font-weight: 400;
  color: rgb(100, 116, 139);
}

.photo-previews {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preview-item {
  position: relative;
  width: 140px;
  height: 100px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgb(203, 213, 225);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(15, 23, 42, 0.82);
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.news-author-badge {
  background-color: rgba(79, 70, 229, 0.1);
  color: rgb(67, 56, 202);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.news-date {
  color: rgb(100, 116, 139);
}

.news-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: rgb(15, 23, 42);
  line-height: 1.35;
}

.news-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgb(51, 65, 85);
  white-space: pre-line;
}

.news-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.news-photos img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgb(226, 232, 240);
  cursor: zoom-in;
}

.chat-sidebar {
  background-color: rgb(255, 255, 255);
  border-left: 1px solid rgb(226, 232, 240);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  padding: 14px 16px;
  background-color: rgb(248, 250, 252);
  border-bottom: 1px solid rgb(226, 232, 240);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chat-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: rgb(15, 23, 42);
}

.chat-subtitle {
  font-size: 11.5px;
  color: rgb(100, 116, 139);
}

.user-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(79, 70, 229, 0.1);
  color: rgb(67, 56, 202);
  border: 1px solid rgba(79, 70, 229, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgb(16, 185, 129);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: rgb(248, 250, 252);
}

.chat-msg {
  background-color: rgb(255, 255, 255);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.chat-msg.mine {
  background-color: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.25);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 4px;
}

.chat-author {
  font-weight: 700;
  color: rgb(79, 70, 229);
}

.chat-time {
  color: rgb(148, 163, 184);
}

.chat-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: rgba(14, 165, 233, 0.1);
  color: rgb(3, 105, 161);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 5px;
  cursor: pointer;
  text-align: left;
}

.chat-target-chip:hover {
  background-color: rgba(14, 165, 233, 0.18);
}

.chat-text {
  color: rgb(30, 41, 59);
}

.chat-form {
  padding: 12px;
  background-color: rgb(255, 255, 255);
  border-top: 1px solid rgb(226, 232, 240);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-name-wrap input,
.chat-input-row input {
  width: 100%;
  background-color: rgb(248, 250, 252);
  color: rgb(15, 23, 42);
  border: 1px solid rgb(203, 213, 225);
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 13px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 90;
}

.modal-dialog {
  max-width: 860px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.modal-head h3 {
  margin: 2px 0 0;
  font-size: 19px;
  color: rgb(15, 23, 42);
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.source-item {
  background-color: rgb(248, 250, 252);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-badge {
  align-self: flex-start;
  background-color: rgba(79, 70, 229, 0.1);
  color: rgb(79, 70, 229);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.source-item h4 {
  margin: 0;
  font-size: 14.5px;
  color: rgb(15, 23, 42);
}

.source-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgb(71, 85, 105);
}

.source-domain {
  font-size: 12px;
  font-weight: 700;
  color: rgb(14, 165, 233);
  margin-top: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (max-width: 1150px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
  .main-stage,
  .stage-section,
  .info-scroll,
  .news-scroll {
    height: auto;
    overflow: visible;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .explorer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .chart-card,
  .active-chart-card,
  .table-card,
  .news-card {
    min-width: 0;
    max-width: 100%;
  }
  .dataset-sidebar {
    display: none;
  }
  .mobile-dataset-select {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .form-grid-two {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    height: 460px;
    border-left: none;
    border-top: 1px solid rgb(226, 232, 240);
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .brand {
    width: 100%;
    gap: 10px;
  }
  .brand-copy h1 {
    font-size: 14.5px;
    line-height: 1.25;
  }
  .subtitle {
    font-size: 11px;
    line-height: 1.3;
  }
  .main-nav {
    flex: 1;
    justify-content: center;
  }
  .section-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
    font-size: 13px;
  }
  .top-actions {
    width: auto;
    gap: 6px;
  }
  .top-actions .btn {
    padding: 7px 10px;
    font-size: 12px;
  }
  .subnav-bar {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .subnav-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .subnav-label {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }
  .sub-btn {
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
    width: 100%;
  }
  .subnav-hint {
    font-size: 11px;
  }
  .info-scroll {
    padding: 12px 12px 24px;
    gap: 12px;
  }
  .news-scroll {
    padding: 12px;
    gap: 12px;
  }
  .chart-card,
  .active-chart-card,
  .table-card,
  .news-card,
  .news-header-bar,
  .news-form-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .card-head h3,
  .chart-title-block h2 {
    font-size: 14px;
    line-height: 1.3;
  }
  .canvas-box-sm {
    height: 210px;
    padding: 6px;
  }
  .canvas-box-lg {
    height: 250px;
    padding: 6px;
  }
  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .chart-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .ctrl-field {
    width: 100%;
    justify-content: space-between;
  }
  .ctrl-field select {
    flex: 1;
    max-width: 72%;
    font-size: 16px;
  }
  .chart-type-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .type-btn {
    text-align: center;
    padding: 6px 4px;
    font-size: 11.5px;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .table-toolbar-left {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    gap: 8px;
  }
  .table-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  input[type="search"],
  .mobile-dataset-select,
  .chat-name-wrap input,
  .chat-input-row input,
  .comment-inline-form input,
  .form-field input[type="text"],
  .form-field textarea {
    max-width: 100%;
    font-size: 16px;
  }
  .comment-inline-form {
    flex-wrap: wrap;
  }
  .comment-inline-form .comment-name-inp {
    max-width: 100% !important;
    width: 100%;
    flex: 1 1 100%;
  }
  .comment-inline-form .comment-text-inp {
    flex: 1 1 calc(100% - 115px);
    min-width: 0;
  }
  .comment-inline-form button {
    padding: 8px 12px;
  }
  .table-scroll {
    max-height: 380px;
    -webkit-overflow-scrolling: touch;
  }
  th,
  td {
    padding: 7px 10px;
    font-size: 12px;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-dialog {
    padding: 16px;
    max-height: 92vh;
  }
}
