:root {
  --ink: #172024;
  --muted: #66727a;
  --line: #d9e0df;
  --panel: #ffffff;
  --page: #eef2ef;
  --sidebar: #0f2327;
  --sidebar-soft: #183236;
  --accent: #2f8f83;
  --amber: #c77c25;
  --red: #b84d49;
  --blue: #3576a8;
  --good: #23a878;
  --danger: #e05267;
  --card-radius: 12px;
  --control-radius: 8px;
  --soft-shadow: 0 12px 30px rgba(23, 32, 36, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: var(--page);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  color: #f4fbf8;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #0b191c;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 44px;
  object-fit: contain;
  background: transparent;
  border: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand h1 {
  font-size: 16px;
  white-space: nowrap;
}

.brand p {
  color: #b8c7c4;
  font-size: 12px;
  margin-top: 3px;
}

.control-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--card-radius);
}

.control-group h2 {
  color: #f0c35a;
  font-size: 12px;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 7px;
  color: #d8e6e3;
  font-size: 13px;
}

select,
input,
button {
  width: 100%;
  border: 1px solid #456066;
  background: var(--sidebar-soft);
  color: #f4fbf8;
  min-height: 34px;
  padding: 0 11px;
  font: inherit;
  border-radius: var(--control-radius);
}

input[type="range"] {
  padding: 0;
  accent-color: #f0c35a;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#searchResults {
  min-height: 54px;
  max-height: 58px;
}

output {
  color: #f0c35a;
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #091618;
  color: #b8c7c4;
  padding: 12px;
  min-height: 110px;
  max-height: 190px;
  overflow: auto;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace {
  min-width: 0;
  padding: 16px 22px 22px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 4px 0 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.topbar p,
small,
.panel span,
.metric-panel span {
  color: var(--muted);
}

.topbar h2 {
  font-size: 24px;
}

.topnav {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  width: max-content;
  max-width: calc(100vw - 48px);
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  box-shadow:
    0 18px 44px rgba(15, 35, 39, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(47, 143, 131, 0.1);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(23, 32, 36, 0.76);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  border-radius: 999px;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 5px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(47, 143, 131, 0.72), transparent);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.topnav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.58);
  transform: translateY(-1px);
}

.topnav a.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(47, 143, 131, 0.88), rgba(53, 118, 168, 0.72)),
    rgba(47, 143, 131, 0.86);
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow:
    0 10px 24px rgba(47, 143, 131, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.topnav a.active::after {
  opacity: 1;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: auto;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.language-switch button {
  position: relative;
  width: auto;
  min-height: 34px;
  padding: 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-switch button::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition:
    left 0.18s ease,
    right 0.18s ease;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: transparent;
  color: var(--accent);
}

.language-switch button.active::after {
  left: 0;
  right: 0;
}

.site-auth {
  position: relative;
  min-width: 0;
}

.auth-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  padding: 0 0 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.site-auth.authenticated .auth-trigger {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

.auth-trigger::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition:
    left 0.18s ease,
    right 0.18s ease;
}

.auth-trigger:hover::after,
.site-auth.authenticated .auth-trigger::after {
  left: 0;
  right: 0;
}

.auth-trigger span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.site-auth.authenticated .auth-trigger span {
  color: var(--accent);
}

.auth-trigger strong {
  max-width: 140px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  box-shadow: 0 20px 48px rgba(15, 35, 39, 0.18);
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-form strong {
  color: var(--ink);
  font-size: 13px;
}

.auth-form input {
  width: 100%;
  min-height: 36px;
  color: var(--ink);
  background: #f8faf9;
  border-color: var(--line);
}

.auth-form button,
.auth-wide-button {
  min-height: 36px;
}

.auth-status-line {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-oauth {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.auth-oauth a {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 8px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.auth-user-card {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.auth-user-card strong {
  color: var(--ink);
}

.auth-user-card span {
  color: var(--muted);
  font-size: 12px;
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
}

.auth-modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 36px 40px 30px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(15, 35, 39, 0.08);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 35, 39, 0.18);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
}

.auth-close:hover {
  background: #f4f7f6;
  border-color: var(--line);
}

.auth-brand-mark {
  width: 52px;
  height: 52px;
  display: block;
  margin: 0 auto 16px;
  object-fit: contain;
  background: transparent;
  border: 0;
}

.auth-modal h2 {
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.2;
  text-align: center;
}

.auth-subtitle {
  max-width: 320px;
  margin: 10px auto 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.auth-oauth-list {
  display: grid;
  gap: 12px;
}

.auth-oauth-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 50px;
  padding: 0 24px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.auth-oauth-button:hover {
  background: #f7fbfa;
  border-color: rgba(47, 143, 131, 0.35);
  transform: translateY(-1px);
}

.auth-provider-mark {
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--ink);
}

.auth-provider-mark svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-oauth-button.google .auth-provider-mark,
.auth-oauth-button.github .auth-provider-mark,
.auth-oauth-button.microsoft .auth-provider-mark {
  background: transparent;
  border-radius: 0;
}

.auth-oauth-button.github .auth-provider-mark {
  color: #181717;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 28px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-email-form {
  display: grid;
  gap: 14px;
}

.auth-email-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.auth-email-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  font-size: 15px;
}

.auth-email-form input:focus {
  border-color: #2f81f7;
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.28);
}

.auth-primary-button {
  min-height: 52px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
}

.auth-primary-button:hover {
  filter: brightness(1.04);
}

.auth-primary-button.danger {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.auth-text-button {
  width: auto;
  min-height: 28px;
  justify-self: center;
  padding: 0 6px;
  color: #58a6ff;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 800;
}

.auth-step-hint,
.auth-status-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.auth-status-line {
  margin-top: 12px;
}

.auth-status-line.ok {
  color: var(--good);
}

.auth-status-line.error {
  color: #ff8c8c;
}

.auth-legal {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-modal .auth-user-card {
  margin: 22px 0;
  padding: 16px;
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.auth-modal .auth-user-card strong {
  color: var(--ink);
}

.auth-modal .auth-user-card span {
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--soft-shadow);
}

.metric-panel {
  min-height: 86px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-areas:
    "label label"
    "value meta";
  gap: 6px 8px;
  align-items: baseline;
}

.metric-panel span {
  grid-area: label;
  font-size: 11px;
  font-weight: 800;
}

.metric-panel strong,
.metric-value {
  grid-area: value;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.metric-meta,
.metric-badge {
  grid-area: meta;
  justify-self: start;
  align-self: center;
  font-weight: 700;
  white-space: nowrap;
}

.metric-meta {
  color: var(--muted);
}

.metric-meta.mode {
  color: #438f9f;
}

.metric-badge {
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  background: #f2f5f4;
  color: var(--muted);
}

.metric-value.change-down {
  color: var(--good);
}

.metric-value.change-up {
  color: var(--danger);
}

.metric-value.change-neutral {
  color: var(--ink);
}

.metric-badge.change-down {
  color: var(--good);
  background: rgba(35, 168, 120, 0.12);
}

.metric-badge.change-up {
  color: var(--danger);
  background: rgba(224, 82, 103, 0.12);
}

.metric-badge.change-neutral {
  color: var(--muted);
  background: #f2f5f4;
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.visual-stack {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 16px;
}

.panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
}

.panel header span {
  font-size: 12px;
}

canvas {
  width: 100%;
  display: block;
}

#trendCanvas,
#mapCanvas,
#hotspotMapCanvas {
  border: 1px solid var(--line);
  background: #f8faf9;
  border-radius: 10px;
}

#trendCanvas {
  aspect-ratio: 980 / 320;
}

#mapCanvas {
  aspect-ratio: 720 / 360;
  cursor: grab;
  touch-action: none;
}

#hotspotMapCanvas {
  aspect-ratio: 720 / 360;
  cursor: grab;
  touch-action: none;
}

#mapCanvas.dragging,
#hotspotMapCanvas.dragging {
  cursor: grabbing;
}

#pointCanvas {
  aspect-ratio: 720 / 210;
  border: 1px solid var(--line);
  background: #f8faf9;
  border-radius: 10px;
}

.map-toolbar {
  display: grid;
  grid-template-columns: 40px 40px 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.map-toolbar button {
  min-height: 32px;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.map-toolbar span {
  justify-self: end;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.point-panel {
  margin-top: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.point-panel header {
  margin-bottom: 8px;
}

.hotspot-map-panel {
  margin-top: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.hotspot-map-panel header {
  margin-bottom: 8px;
}

.map-stage {
  position: relative;
}

.map-legend {
  margin-top: 10px;
  color: var(--ink);
}

.legend-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.legend-swatches {
  display: grid;
  gap: 1px;
}

.legend-bin {
  min-height: 12px;
  border: 1px solid rgba(23, 32, 36, 0.08);
}

.legend-gradient {
  min-height: 13px;
  border: 1px solid rgba(23, 32, 36, 0.12);
}

.legend-labels {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 9px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: right;
}

tbody tr {
  cursor: pointer;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

tbody tr:hover {
  background: #f5faf8;
}

#hotspotTable tr.active {
  background: rgba(47, 143, 131, 0.13);
  box-shadow: inset 4px 0 0 var(--accent);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th:first-child,
td:first-child {
  text-align: left;
}

@media (min-width: 761px) and (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .sidebar {
    gap: 12px;
    padding: 16px;
  }

  .brand {
    gap: 10px;
    padding-bottom: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand h1 {
    font-size: 14px;
  }

  .control-group {
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
  }

  label {
    gap: 5px;
    font-size: 12px;
  }

  select,
  input,
  button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  #searchResults {
    min-height: 46px;
    max-height: 50px;
  }

  #apiPreview {
    min-height: 78px;
    max-height: 120px;
    padding: 10px;
    font-size: 11px;
  }

  .workspace {
    gap: 12px;
    padding: 14px 18px 18px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .topbar p {
    font-size: 13px;
  }

  .topnav {
    top: 12px;
    right: 16px;
    padding: 4px;
  }

  .topnav a,
  .language-switch,
  .site-auth .auth-trigger {
    min-height: 34px;
    padding-left: 11px;
    padding-right: 11px;
    font-size: 12px;
  }

  .metrics-grid,
  .visual-grid,
  .visual-stack {
    gap: 12px;
  }

  .metric-panel {
    min-height: 76px;
    padding: 12px;
  }

  .metric-panel strong,
  .metric-value {
    font-size: 21px;
  }

  .panel {
    padding: 12px;
    border-radius: 10px;
  }

  .panel header {
    gap: 10px;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 15px;
  }

  .map-toolbar {
    grid-template-columns: 34px 34px 48px minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }

  .map-toolbar button {
    min-height: 29px;
    font-size: 12px;
  }

  .point-panel,
  .hotspot-map-panel {
    margin-top: 10px;
  }

  .table-wrap {
    max-height: 300px;
  }

  th,
  td {
    padding: 8px 7px;
    font-size: 12px;
  }

  .content-body .content-page {
    max-width: 1080px;
    padding: 22px 24px 40px;
  }

  .content-body .content-hero {
    padding: 28px;
  }

  .content-body .content-hero h1 {
    font-size: 44px;
  }

  .content-body .method-layout,
  .content-body .dataset-layout,
  .content-body .about-layout {
    gap: 16px;
  }

  .content-body .page-nav {
    top: 10px;
    margin-bottom: 18px;
    padding: 4px;
  }

  .content-body .page-nav a {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .content-body .content-hero {
    margin-bottom: 16px;
  }

  .content-body .content-hero h1 {
    font-size: 38px;
  }

  .content-body .content-hero span {
    font-size: 15px;
    line-height: 1.55;
  }

  .content-body .method-summary,
  .content-body .dataset-summary,
  .content-body .about-hero,
  .content-body .method-band,
  .content-body .dataset-band,
  .content-body .dataset-downloads,
  .content-body .dataset-usage,
  .content-body .dataset-grid article,
  .content-body .about-profile,
  .content-body .about-note {
    padding: 20px;
  }

  .content-body .method-summary h2,
  .content-body .dataset-summary h2,
  .content-body .about-hero h2 {
    font-size: 27px;
    line-height: 1.22;
  }

  .method-brief,
  .content-body .dataset-brief {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
    gap: 14px;
  }

  .content-body .method-facts article,
  .content-body .dataset-access article {
    padding: 16px;
  }

  .content-body .section-heading {
    margin-bottom: 14px;
  }

  .content-body .section-heading h2 {
    font-size: 22px;
  }

  .content-body .method-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .content-body .method-steps li {
    min-height: 128px;
    padding: 14px;
  }

  .content-body .method-steps strong {
    width: 36px;
    height: 36px;
  }

  .content-body .method-bot {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
    gap: 16px;
    padding: 20px 22px;
  }

  .method-bot-copy h2,
  .content-body .method-bot-copy h2 {
    font-size: 24px;
  }

  .method-bot-art img {
    width: min(100%, 290px);
    max-height: 170px;
  }

  .content-body .method-tools li {
    min-height: 96px;
    padding: 12px 14px;
  }

  .content-body .dataset-stats,
  .content-body .dataset-access {
    gap: 10px;
  }

  .content-body .dataset-stats article {
    min-height: 118px;
    padding: 14px;
  }

  .content-body .dataset-stats strong,
  .content-body .usage-grid strong {
    font-size: 21px;
  }

  .content-body .dataset-access article {
    min-height: 126px;
  }

  .content-body .dataset-downloads {
    grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
    gap: 14px;
  }

  .content-body .download-card {
    min-height: 82px;
    padding: 14px;
  }

  .content-body .usage-grid div {
    padding: 14px;
  }

  .content-body .dataset-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
    gap: 14px;
  }

  .content-body .code-block {
    max-height: 260px;
  }

  .content-body .about-hero {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 16px;
  }

  .content-body .about-mark {
    width: 108px;
    height: 108px;
  }

  .content-body .about-credits {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 12px;
  }

  .content-body .about-card-manuscript,
  .content-body .about-profile,
  .content-body .about-card-engineering,
  .content-body .about-card-data {
    grid-column: auto;
    grid-row: auto;
  }

  .content-body .about-profile {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-body .about-card,
  .content-body .about-profile {
    padding: 16px;
  }

  .content-body .about-card h2,
  .content-body .about-profile-heading h2,
  .content-body .about-note h2 {
    font-size: 20px;
  }

  .content-body .about-profile-lead {
    flex-wrap: wrap;
    white-space: normal;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  .sidebar {
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .control-group {
    gap: 7px;
    padding: 9px 10px;
  }

  .control-group h2 {
    font-size: 11px;
  }

  #apiPreview {
    min-height: 64px;
    max-height: 96px;
  }

  .workspace {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .topbar {
    padding-bottom: 4px;
  }

  .metrics-grid {
    gap: 10px;
  }

  .metric-panel {
    min-height: 70px;
    padding: 10px 12px;
  }

  .visual-grid,
  .visual-stack {
    gap: 10px;
  }

  .panel {
    padding: 10px;
  }

  .panel header {
    margin-bottom: 8px;
  }

  #trendCanvas {
    max-height: 210px;
  }

  #mapCanvas,
  #hotspotMapCanvas {
    max-height: 220px;
  }

  #pointCanvas {
    max-height: 150px;
  }

  .map-legend {
    margin-top: 8px;
  }

  .content-body .content-page {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .content-body .page-nav {
    margin-bottom: 14px;
  }

  .content-body .content-hero {
    padding: 24px 28px;
    margin-bottom: 14px;
  }

  .content-body .content-hero h1 {
    font-size: 34px;
    margin-bottom: 8px;
  }

  .content-body .content-hero span {
    font-size: 14px;
  }

  .content-body .method-layout,
  .content-body .dataset-layout,
  .content-body .about-layout {
    gap: 14px;
  }

  .content-body .method-summary,
  .content-body .dataset-summary,
  .content-body .about-hero,
  .content-body .method-band,
  .content-body .dataset-band,
  .content-body .dataset-downloads,
  .content-body .dataset-usage,
  .content-body .dataset-grid article,
  .content-body .about-profile,
  .content-body .about-note {
    padding: 18px;
  }

  .content-body .method-steps li,
  .content-body .dataset-stats article,
  .content-body .dataset-access article,
  .content-body .method-tools li {
    min-height: 0;
  }

  .content-body .about-card {
    padding: 15px;
  }

  .content-body .about-avatar-frame {
    width: 68px;
    height: 68px;
  }

  .copilot-panel {
    top: 68px;
    max-height: calc(100vh - 86px);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .visual-grid {
    grid-template-columns: 1fr;
  }

  .content-body .method-brief,
  .content-body .dataset-brief,
  .content-body .dataset-downloads,
  .content-body .dataset-grid,
  .content-body .about-hero,
  .content-body .about-credits,
  .content-body .about-note {
    grid-template-columns: 1fr;
  }

  .content-body .about-mark {
    justify-self: start;
  }

  .content-body .method-bot {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    padding: 12px;
    gap: 10px;
    border-right: 0;
    box-shadow: 0 12px 30px rgba(9, 22, 24, 0.18);
  }

  .brand {
    padding-bottom: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 11px;
  }

  .control-group {
    gap: 8px;
    padding: 10px;
  }

  .sidebar > section.control-group:nth-of-type(1) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar > section.control-group:nth-of-type(1) h2,
  .sidebar > section.control-group:nth-of-type(1) label:nth-of-type(4),
  .sidebar > section.control-group:nth-of-type(1) #searchResults {
    grid-column: 1 / -1;
  }

  .sidebar > section.control-group:nth-of-type(2),
  .sidebar > section.control-group:nth-of-type(3),
  .sidebar > section.control-group:nth-of-type(4) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .sidebar > section.control-group:nth-of-type(2) h2,
  .sidebar > section.control-group:nth-of-type(2) label,
  .sidebar > section.control-group:nth-of-type(3) h2,
  .sidebar > section.control-group:nth-of-type(4) h2 {
    grid-column: 1 / -1;
  }

  .control-group h2 {
    font-size: 11px;
  }

  label {
    gap: 5px;
    font-size: 12px;
  }

  select,
  input,
  button {
    min-height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  #searchResults {
    min-height: 42px;
    max-height: 44px;
  }

  #apiPreview {
    display: none;
  }

  .workspace {
  min-width: 0;
  padding: 16px 22px 22px;
  display: grid;
  gap: 14px;
  align-content: start;
}

  .workspace > *,
  .visual-grid,
  .visual-stack,
  .panel,
  .topbar,
  .metrics-grid {
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 13px;
  }

  .topbar h2 {
  font-size: 24px;
}

  .topbar p {
    font-size: 12px;
    line-height: 1.5;
  }

  .topnav {
    top: 10px;
    right: 10px;
    max-width: calc(100vw - 20px);
  }

  .topnav a {
    flex: none;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-panel {
    min-height: 92px;
    padding: 13px 12px 12px 14px;
  }

  .metric-panel strong {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .panel {
    padding: 10px;
    box-shadow: 0 10px 26px rgba(23, 32, 36, 0.055);
  }

  .panel header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel header span {
    max-width: 100%;
    justify-content: flex-start;
  }

  .map-toolbar {
    grid-template-columns: 36px 36px 48px minmax(0, 1fr);
    gap: 6px;
    padding: 0;
  }

  .map-toolbar button {
    min-height: 30px;
    font-size: 12px;
  }

  .map-toolbar span {
    font-size: 11px;
  }

  #trendCanvas {
    min-height: 190px;
  }

  #mapCanvas,
  #hotspotMapCanvas {
    min-height: 210px;
  }

  #pointCanvas {
    min-height: 150px;
  }

  .point-panel,
  .hotspot-map-panel,
  .map-legend {
    padding: 9px;
    margin-top: 10px;
  }

  .table-wrap {
    max-height: 280px;
  }

  th,
  td {
    padding: 8px 7px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .sidebar > section.control-group:nth-of-type(1),
  .sidebar > section.control-group:nth-of-type(2),
  .sidebar > section.control-group:nth-of-type(3),
  .sidebar > section.control-group:nth-of-type(4) {
    grid-template-columns: 1fr;
  }

  .sidebar > section.control-group:nth-of-type(1) h2,
  .sidebar > section.control-group:nth-of-type(1) label:nth-of-type(4),
  .sidebar > section.control-group:nth-of-type(1) #searchResults,
  .sidebar > section.control-group:nth-of-type(2) h2,
  .sidebar > section.control-group:nth-of-type(2) label,
  .sidebar > section.control-group:nth-of-type(3) h2,
  .sidebar > section.control-group:nth-of-type(4) h2 {
    grid-column: auto;
  }

  .metric-panel {
    min-height: 84px;
  }

  #mapCanvas,
  #hotspotMapCanvas {
    min-height: 190px;
  }
}

.content-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-nav a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 8px 0 10px;
  font-weight: 700;
}

.page-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition:
    left 0.18s ease,
    right 0.18s ease;
}

.page-nav a:hover,
.page-nav a.active {
  color: var(--ink);
}

.page-nav a.active::after {
  left: 0;
  right: 0;
}

.content-hero {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 18px;
}

.content-hero p {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.content-hero h1 {
  color: var(--ink);
  font-size: 34px;
  margin-bottom: 8px;
}

.content-hero span {
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.content-card {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 18px;
}

.wide-card {
  grid-column: 1 / -1;
}

.content-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.content-card p,
.content-card li {
  color: #4d5a61;
  line-height: 1.65;
}

.content-card ol {
  margin: 0;
  padding-left: 20px;
}

.method-layout {
  display: grid;
  gap: 18px;
}

.method-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.method-summary,
.method-facts article,
.method-band {
  background: #ffffff;
  border: 1px solid var(--line);
}

.method-summary {
  padding: 26px 28px;
  border-left: 5px solid var(--accent);
}

.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.method-summary h2,
.section-heading h2,
.method-bot-copy h2 {
  color: var(--ink);
  line-height: 1.25;
}

.method-summary h2 {
  max-width: 640px;
  font-size: 30px;
  margin-bottom: 14px;
}

.method-summary p:last-child,
.method-bot-copy p:last-child {
  color: #4d5a61;
  line-height: 1.7;
}

.method-facts {
  display: grid;
  gap: 12px;
}

.method-facts article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  border-left: 5px solid var(--blue);
}

.method-facts article:nth-child(2) {
  border-left-color: var(--amber);
}

.method-facts strong,
.method-tools strong {
  color: var(--ink);
  font-size: 15px;
}

.method-facts span,
.method-tools span {
  color: #4d5a61;
  line-height: 1.6;
}

.method-band {
  padding: 22px;
  border-top: 5px solid var(--blue);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 24px;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #f8faf9;
}

.method-steps li {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 132px;
  padding: 16px;
  border-left: 1px solid var(--line);
}

.method-steps li:first-child {
  border-left: 0;
}

.method-steps strong {
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.method-steps span {
  color: #405058;
  line-height: 1.55;
}

.method-bot {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  padding: 24px;
  color: #f4fbf8;
  background: var(--sidebar);
  border: 1px solid #0b191c;
}

.method-bot .section-kicker {
  color: #8ad4ca;
}

.method-bot-copy h2 {
  color: #ffffff;
  font-size: 28px;
  margin-bottom: 12px;
}

.method-bot-copy p:last-child {
  color: #c8d8d5;
}

.method-bot-intro {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.method-bot-art {
  display: flex;
  justify-content: center;
  margin: 0;
  padding-top: 14px;
}

.method-bot-art img {
  display: block;
  width: min(100%, 350px);
  max-height: 205px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.2));
}

.method-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.method-tools li {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.method-tools strong {
  color: #ffffff;
}

.method-tools span {
  color: #c8d8d5;
}

.code-block {
  background: #091618;
  color: #d8e6e3;
  max-height: none;
  min-height: 0;
  margin: 0;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.download-card {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  padding: 14px;
}

.download-card:hover {
  border-color: var(--accent);
}

.download-card strong {
  font-size: 18px;
}

.download-card span,
.usage-grid span {
  color: var(--muted);
  font-size: 12px;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.usage-grid div {
  display: grid;
  gap: 6px;
  background: #f8faf9;
  border: 1px solid var(--line);
  padding: 14px;
}

.usage-grid strong {
  font-size: 22px;
}

.dataset-layout,
.about-layout {
  display: grid;
  gap: 18px;
}

.dataset-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 16px;
}

.dataset-summary,
.dataset-band,
.dataset-downloads,
.dataset-usage,
.dataset-grid article,
.about-hero,
.author-grid article,
.about-profile,
.about-note {
  background: #ffffff;
  border: 1px solid var(--line);
}

.dataset-summary {
  padding: 26px 28px;
  border-left: 5px solid var(--blue);
}

.dataset-summary h2,
.dataset-downloads h2,
.dataset-usage h2,
.dataset-grid h2,
.about-hero h2,
.author-grid h2,
.about-note h2 {
  color: var(--ink);
  line-height: 1.25;
}

.dataset-summary h2,
.about-hero h2 {
  font-size: 30px;
  margin-bottom: 14px;
}

.dataset-summary p:last-child,
.dataset-downloads p,
.dataset-grid p:last-child,
.about-hero p:last-child,
.author-grid p,
.about-profile p,
.about-note p {
  color: #4d5a61;
  line-height: 1.7;
}

.dataset-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dataset-stats article {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  align-content: start;
  min-height: 122px;
  padding: 16px;
  color: #f4fbf8;
  background: var(--sidebar);
  border: 1px solid #0b191c;
}

.dataset-stats span {
  color: #a9c9c4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dataset-stats strong {
  color: #ffffff;
  font-size: 22px;
  line-height: 1.15;
}

.dataset-stats small {
  color: #c8d8d5;
  line-height: 1.5;
}

.dataset-band {
  padding: 22px;
  border-top: 5px solid var(--accent);
}

.dataset-access {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dataset-access article {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 136px;
  padding: 16px;
  background: #f8faf9;
  border: 1px solid var(--line);
}

.dataset-access strong,
.author-grid dt {
  color: var(--ink);
}

.dataset-access span,
.author-grid dd {
  color: #4d5a61;
  line-height: 1.6;
}

.dataset-downloads,
.dataset-usage {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dataset-downloads {
  border-top: 5px solid var(--amber);
}

.dataset-usage {
  grid-template-columns: 1fr;
  align-items: start;
  border-top: 5px solid var(--blue);
}

.dataset-downloads .download-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-top: 0;
}

.dataset-downloads .download-card {
  min-height: 86px;
  align-content: center;
}

.dataset-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.dataset-grid article {
  padding: 22px;
  border-top: 5px solid var(--accent);
}

.dataset-grid article:nth-child(2) {
  border-top-color: var(--amber);
}

.dataset-grid h2,
.dataset-downloads h2,
.about-profile h2,
.author-grid h2,
.about-note h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.dataset-grid .code-block {
  padding: 16px;
  overflow-x: auto;
  line-height: 1.7;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border-left: 5px solid var(--accent);
}

.about-mark {
  width: 128px;
  height: 128px;
  display: block;
  justify-self: end;
  object-fit: contain;
  background: transparent;
  border: 0;
}

.author-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) minmax(0, 0.9fr);
  gap: 16px;
}

.author-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-top: 5px solid var(--blue);
}

.author-grid article:nth-child(2) {
  border-top-color: var(--accent);
}

.author-grid article:nth-child(3) {
  border-top-color: var(--amber);
}

.author-grid dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.author-grid dl div {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.author-grid dt {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.author-grid dd {
  margin: 0;
}

.author-grid dd a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-profile {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 22px;
  padding: 22px 24px;
  border-top: 5px solid var(--accent);
}

.about-profile-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.about-profile-detail {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.about-note {
  display: grid;
  grid-template-columns: minmax(240px, 0.52fr) minmax(0, 1fr);
  gap: 18px;
  padding: 22px 24px;
  border-top: 5px solid var(--sidebar);
}

@media (max-width: 760px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .method-brief,
  .method-bot,
  .method-tools,
  .dataset-brief,
  .dataset-stats,
  .dataset-access,
  .dataset-usage,
  .dataset-grid,
  .about-hero,
  .author-grid,
  .about-profile,
  .about-note {
    grid-template-columns: 1fr;
  }

  .method-summary h2,
  .method-bot-copy h2,
  .dataset-summary h2,
  .about-hero h2 {
    font-size: 24px;
  }

  .method-bot-art {
    margin-top: 0;
    padding-top: 10px;
  }

  .method-bot-art img {
    width: min(100%, 300px);
    max-height: 190px;
  }

  .section-heading {
    display: grid;
  }

  .about-mark {
    justify-self: start;
    width: 96px;
    height: 96px;
  }

  .download-grid,
  .usage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dataset-brief,
  .dataset-access,
  .dataset-usage,
  .dataset-grid,
  .author-grid,
  .about-profile,
  .about-note {
    grid-template-columns: 1fr;
  }

  .about-profile-detail {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
}

@media (max-width: 1040px) {
  .method-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-steps li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .method-steps li:nth-child(-n + 2) {
    border-top: 0;
  }

  .method-steps li:nth-child(even) {
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .content-page {
    padding: 18px;
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .method-steps li,
  .method-steps li:nth-child(even) {
    border-left: 0;
  }

  .method-steps li:nth-child(2) {
    border-top: 1px solid var(--line);
  }
}

/* Polished narrative pages: Method, Datasets, About */
.content-body {
  background:
    linear-gradient(180deg, rgba(47, 143, 131, 0.14), rgba(53, 118, 168, 0.08) 330px, rgba(238, 242, 239, 0) 620px),
    #eef2ef;
}

.content-body .content-page {
  max-width: 1180px;
  padding: 30px 28px 44px;
}

.content-body .page-nav {
  position: sticky;
  top: 14px;
  z-index: 50;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  margin: 0 0 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  box-shadow:
    0 20px 48px rgba(15, 35, 39, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(47, 143, 131, 0.1);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.content-body .page-nav a {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(23, 32, 36, 0.74);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 15px;
  font-size: 15px;
  font-weight: 800;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.content-body .page-nav a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 5px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(47, 143, 131, 0.72), transparent);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.content-body .page-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
  border-color: rgba(255, 255, 255, 0.58);
  transform: translateY(-1px);
}

.content-body .page-nav a.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(47, 143, 131, 0.88), rgba(53, 118, 168, 0.72)),
    rgba(47, 143, 131, 0.86);
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow:
    0 10px 24px rgba(47, 143, 131, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.content-body .page-nav a.active::after {
  opacity: 1;
}

.content-body .content-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 36px;
  margin-bottom: 22px;
  color: #f4fbf8;
  background:
    linear-gradient(135deg, rgba(47, 143, 131, 0.94), rgba(15, 35, 39, 0.98) 58%, rgba(53, 118, 168, 0.92)),
    var(--sidebar);
  border: 1px solid rgba(15, 35, 39, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 35, 39, 0.16);
}

.content-body .content-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 22px;
  width: min(42%, 420px);
  height: 118px;
  pointer-events: none;
  background:
    linear-gradient(rgba(244, 251, 248, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 251, 248, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 38%);
}

.content-body .content-hero p {
  position: relative;
  z-index: 1;
  color: #f0c35a;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-body .content-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: #ffffff;
  font-size: 42px;
  line-height: 1.05;
  margin: 0 0 12px;
}

.content-body .content-hero span {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 760px;
  color: #d8e6e3;
  font-size: 16px;
  line-height: 1.65;
}

.content-body .method-layout,
.content-body .dataset-layout,
.content-body .about-layout {
  gap: 20px;
}

.content-body .method-summary,
.content-body .method-facts article,
.content-body .method-band,
.content-body .dataset-summary,
.content-body .dataset-band,
.content-body .dataset-downloads,
.content-body .dataset-usage,
.content-body .dataset-grid article,
.content-body .about-hero,
.content-body .author-grid article,
.content-body .about-profile,
.content-body .about-note {
  border: 1px solid rgba(217, 224, 223, 0.86);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 35, 39, 0.07);
}

.content-body .method-summary,
.content-body .dataset-summary,
.content-body .about-hero {
  padding: 30px;
  border-left: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 249, 0.98)),
    #ffffff;
}

.content-body .section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 9px;
  margin-bottom: 12px;
  color: #14665c;
  background: rgba(47, 143, 131, 0.1);
  border: 1px solid rgba(47, 143, 131, 0.18);
  border-radius: 999px;
  font-size: 11px;
}

.content-body .method-summary h2,
.content-body .dataset-summary h2,
.content-body .about-hero h2 {
  max-width: 760px;
  font-size: 31px;
  letter-spacing: 0;
}

.content-body .method-summary p:last-child,
.content-body .dataset-summary p:last-child,
.content-body .dataset-downloads p,
.content-body .dataset-grid p:last-child,
.content-body .about-hero p:last-child,
.content-body .author-grid p,
.content-body .about-profile p,
.content-body .about-note p {
  color: #405058;
}

.content-body .method-facts {
  gap: 14px;
}

.content-body .method-facts article,
.content-body .dataset-access article,
.content-body .usage-grid div,
.content-body .download-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.content-body .method-facts article {
  min-height: 0;
  padding: 20px;
  border-left: 0;
}

.content-body .method-facts article::before,
.content-body .dataset-access article::before,
.content-body .download-card::before {
  content: "";
  width: 36px;
  height: 3px;
  display: block;
  margin-bottom: 6px;
  background: var(--blue);
}

.content-body .method-facts article:nth-child(2)::before,
.content-body .download-card:nth-child(3n + 2)::before {
  background: var(--amber);
}

.content-body .method-facts article:nth-child(1)::before,
.content-body .dataset-access article:nth-child(1)::before,
.content-body .download-card:nth-child(3n + 1)::before {
  background: var(--accent);
}

.content-body .method-band,
.content-body .dataset-band,
.content-body .dataset-downloads,
.content-body .dataset-usage,
.content-body .dataset-grid article,
.content-body .about-profile,
.content-body .about-note {
  padding: 24px;
  border-top: 0;
  background: #ffffff;
}

.content-body .section-heading {
  display: grid;
  align-items: start;
  justify-content: start;
  gap: 6px;
  margin-bottom: 20px;
}

.content-body .section-heading h2 {
  max-width: 760px;
  font-size: 25px;
}

.content-body .method-steps {
  gap: 10px;
  border: 0;
  background: transparent;
}

.content-body .method-steps li {
  min-height: 154px;
  padding: 18px;
  background: #f7faf8;
  border: 1px solid rgba(217, 224, 223, 0.9);
  border-radius: 8px;
}

.content-body .method-steps li:first-child {
  border-left: 1px solid rgba(217, 224, 223, 0.9);
}

.content-body .method-steps strong {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 8px;
  font-size: 15px;
}

.content-body .method-steps li:nth-child(2) strong,
.content-body .method-steps li:nth-child(5) strong {
  background: var(--accent);
}

.content-body .method-steps li:nth-child(3) strong {
  background: var(--amber);
}

.content-body .method-bot {
  overflow: hidden;
  padding: 24px 30px;
  background:
    linear-gradient(135deg, #10272b, #0f2327 52%, #1e4f5f),
    var(--sidebar);
  border: 1px solid #0b191c;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 35, 39, 0.16);
}

.content-body .method-bot .section-kicker {
  color: #b7eee7;
  background: rgba(138, 212, 202, 0.1);
  border-color: rgba(138, 212, 202, 0.2);
}

.content-body .method-tools {
  gap: 10px;
}

.content-body .method-tools li {
  min-height: 104px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.content-body .dataset-brief {
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
}

.content-body .dataset-stats {
  gap: 12px;
}

.content-body .dataset-stats article {
  min-height: 148px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(15, 35, 39, 0.98), rgba(24, 50, 54, 0.98)),
    var(--sidebar);
  border: 1px solid rgba(11, 25, 28, 0.88);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 35, 39, 0.11);
}

.content-body .dataset-stats article:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(53, 118, 168, 0.97), rgba(26, 74, 111, 0.98)),
    var(--blue);
}

.content-body .dataset-stats article:nth-child(3) {
  background:
    linear-gradient(180deg, rgba(47, 143, 131, 0.98), rgba(26, 105, 96, 0.98)),
    var(--accent);
}

.content-body .dataset-stats strong {
  font-size: 24px;
}

.content-body .dataset-access {
  gap: 12px;
}

.content-body .dataset-access article {
  min-height: 154px;
  padding: 18px;
  border-radius: 8px;
}

.content-body .dataset-access article:nth-child(2)::before {
  background: var(--blue);
}

.content-body .dataset-access article:nth-child(3)::before {
  background: var(--amber);
}

.content-body .dataset-downloads {
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.content-body .dataset-downloads .download-grid {
  gap: 10px;
}

.content-body .download-card {
  min-height: 94px;
  padding: 16px;
  border-radius: 8px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.content-body .download-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 35, 39, 0.1);
}

.content-body .dataset-usage {
  gap: 16px;
  padding: 18px 20px 20px;
}

.content-body .usage-grid {
  margin-top: 0;
}

.content-body .usage-grid div {
  padding: 16px;
  border-radius: 8px;
}

.content-body .usage-grid strong {
  color: var(--ink);
  font-size: 24px;
}

.content-body .dataset-grid article {
  border-top: 0;
}

.content-body .code-block {
  border-radius: 8px;
  border: 1px solid rgba(9, 22, 24, 0.18);
  background: #0b1d21;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.content-body .about-hero {
  grid-template-columns: minmax(0, 1fr) 170px;
}

.content-body .about-mark {
  width: 142px;
  height: 142px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.content-body .author-grid {
  gap: 16px;
  align-items: start;
}

.content-body .author-grid article {
  padding: 22px;
  border-top: 0;
}

.content-body .role-card-heading,
.content-body .about-profile-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: start;
}

.content-body .role-card-heading h2,
.content-body .about-profile-heading h2 {
  margin-bottom: 0;
}

.content-body .about-avatar-frame {
  width: 78px;
  height: 78px;
  justify-self: start;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #f7faf8;
  border: 1px solid rgba(102, 114, 122, 0.22);
  box-shadow:
    0 12px 28px rgba(15, 35, 39, 0.1),
    inset 0 0 0 6px rgba(255, 255, 255, 0.75);
}

.content-body .about-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--avatar-x, 50%) var(--avatar-y, 50%);
  transform: scale(var(--avatar-scale, 1));
  transform-origin: var(--avatar-x, 50%) var(--avatar-y, 50%);
}

.content-body .author-grid article::before {
  content: "";
  width: 42px;
  height: 4px;
  background: var(--blue);
}

.content-body .author-grid article:nth-child(2)::before {
  background: var(--accent);
}

.content-body .author-grid article:nth-child(3)::before {
  background: var(--amber);
}

.content-body .author-grid dl div {
  gap: 5px;
  padding: 11px 0 0;
}

.content-body .author-grid dt {
  color: #66727a;
}

.content-body .about-profile {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}

.content-body .about-profile-detail {
  padding: 0 0 0 22px;
}

.content-body .about-note {
  grid-template-columns: minmax(250px, 0.4fr) minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(15, 35, 39, 0.04), rgba(255, 255, 255, 0) 48%),
    #ffffff;
}

.content-body .about-credits {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(0, 0.82fr) minmax(0, 0.82fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.content-body .about-card,
.content-body .about-profile {
  min-width: 0;
  background: #ffffff;
  border: 1px solid rgba(217, 224, 223, 0.86);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 35, 39, 0.07);
}

.content-body .about-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.content-body .about-card-manuscript {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.content-body .about-profile {
  grid-column: 2 / span 2;
  grid-row: 1;
}

.content-body .about-card-engineering {
  grid-column: 2;
  grid-row: 2;
}

.content-body .about-card-data {
  grid-column: 3;
  grid-row: 2;
}

.content-body .about-card::before {
  content: "";
  width: 42px;
  height: 4px;
  background: var(--blue);
}

.content-body .about-card-engineering::before {
  background: var(--accent);
}

.content-body .about-card-data::before {
  background: var(--amber);
}

.content-body .about-card h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.content-body .about-card p {
  color: #405058;
  line-height: 1.7;
}

.content-body .about-profile-lead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.content-body .about-profile-lead a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content-body .about-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.content-body .about-card dl div {
  display: grid;
  gap: 4px;
  padding: 9px 0 0;
  border-top: 1px solid var(--line);
}

.content-body .about-card dt {
  color: #66727a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.content-body .about-card dd {
  margin: 0;
  color: #4d5a61;
  line-height: 1.6;
}

.content-body .about-card dd a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content-body .about-profile::before {
  background: var(--accent);
}

.content-body .about-avatar-corresponding {
  --avatar-scale: 0.96;
  --avatar-x: 96%;
  --avatar-y: 50%;
}

.content-body .about-avatar-engineering {
  --avatar-scale: 1.26;
  --avatar-x: 6%;
  --avatar-y: 56%;
}

@media (max-width: 980px) {
  .content-body .dataset-brief,
  .content-body .dataset-downloads,
  .content-body .about-credits,
  .content-body .about-profile,
  .content-body .about-note {
    grid-template-columns: 1fr;
  }

  .content-body .about-credits {
    grid-template-rows: auto;
  }

  .content-body .about-card-manuscript,
  .content-body .about-profile,
  .content-body .about-card-engineering,
  .content-body .about-card-data {
    grid-column: auto;
    grid-row: auto;
  }

  .content-body .about-profile-detail {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .content-body .content-page {
    padding: 18px 16px 32px;
  }

  .content-body .page-nav {
    position: sticky;
    top: 8px;
    width: 100%;
  }

  .content-body .page-nav a {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 10px;
  }

  .content-body .content-hero {
    padding: 28px 24px;
  }

  .content-body .content-hero::after {
    display: none;
  }

  .content-body .content-hero h1 {
    font-size: 34px;
  }

  .content-body .method-summary h2,
  .content-body .method-bot-copy h2,
  .content-body .dataset-summary h2,
  .content-body .about-hero h2 {
    font-size: 25px;
  }

  .content-body .about-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 20px 22px;
  }

  .content-body .about-hero h2 {
    max-width: none;
    font-size: 27px;
    line-height: 1.22;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .content-body .about-hero p:last-child {
    max-width: none;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .content-body .about-mark {
    width: 118px;
    height: 118px;
    justify-self: center;
    margin-top: 2px;
  }

  .content-body .about-credits {
    gap: 14px;
  }

  .content-body .about-card,
  .content-body .about-profile,
  .content-body .about-note {
    padding: 18px;
  }

  .content-body .about-card h2,
  .content-body .about-profile-heading h2,
  .content-body .about-note h2 {
    font-size: 22px;
    line-height: 1.25;
  }

  .content-body .about-profile-lead {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    white-space: normal;
  }

  .content-body .about-note {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-body .method-steps,
  .content-body .method-steps li:nth-child(even) {
    border-left: 0;
  }

  .content-body .role-card-heading,
  .content-body .about-profile-heading {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 14px;
  }

  .content-body .about-avatar-frame {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 420px) {
  .content-body .content-page {
    padding: 14px 12px 28px;
  }

  .content-body .content-hero {
    padding: 24px 20px;
  }

  .content-body .content-hero h1 {
    font-size: 30px;
  }

  .content-body .about-hero {
    padding: 22px 18px 20px;
  }

  .content-body .about-hero h2 {
    font-size: 24px;
  }

  .content-body .about-mark {
    width: 104px;
    height: 104px;
  }

  .content-body .role-card-heading,
  .content-body .about-profile-heading {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .content-body .about-avatar-frame {
    width: 64px;
    height: 64px;
  }
}

.copilot-widget {
  position: fixed;
  left: auto;
  top: auto;
  z-index: 80;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  touch-action: none;
}

.copilot-launcher {
  width: 68px;
  height: 68px;
  min-height: 68px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: visible;
  cursor: grab;
}

.copilot-widget.dragging .copilot-launcher,
.copilot-widget.dragging .copilot-header {
  cursor: grabbing;
}

.copilot-launcher img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 16px rgba(15, 35, 39, 0.22));
}

.copilot-panel {
  position: absolute;
  left: 0;
  top: 76px;
  width: min(640px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 110px));
  min-width: min(420px, calc(100vw - 28px));
  min-height: min(500px, calc(100vh - 110px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 110px);
  display: none;
  grid-template-rows: auto auto auto minmax(160px, 1fr) auto auto auto;
  overflow: hidden;
  resize: both;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 35, 39, 0.26);
}

.copilot-widget.open .copilot-panel {
  display: grid;
}

.copilot-panel::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 50%, rgba(47, 143, 131, 0.42) 50%) right bottom / 8px 8px no-repeat,
    linear-gradient(135deg, transparent 50%, rgba(47, 143, 131, 0.24) 50%) right 5px bottom 5px / 8px 8px no-repeat;
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
  cursor: grab;
}

.copilot-header div {
  display: grid;
  gap: 2px;
}

.copilot-header strong {
  font-size: 15px;
}

.copilot-header span {
  color: var(--muted);
  font-size: 12px;
}

.copilot-header button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
  font-size: 20px;
}

.copilot-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.copilot-suggestions button {
  min-height: 34px;
  padding: 0 8px;
  background: #f8faf9;
  color: var(--ink);
  border-color: var(--line);
  font-size: 12px;
}

.copilot-auth {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.copilot-login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.copilot-login-form > div {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.copilot-login-form strong {
  color: var(--ink);
  font-size: 13px;
}

.copilot-login-form span,
.copilot-quota {
  color: var(--muted);
  font-size: 11px;
}

.copilot-login-form input {
  min-height: 32px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: #f8faf9;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.copilot-login-form button,
.copilot-auth-status button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.copilot-login-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

.copilot-auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.copilot-auth-status strong {
  color: var(--ink);
}

.copilot-quota {
  margin-top: 4px;
}

.copilot-messages {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.copilot-message {
  max-width: 94%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f8faf9;
  font-size: 13px;
  line-height: 1.55;
}

.copilot-message.user {
  justify-self: end;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.copilot-message.assistant {
  justify-self: start;
}

.copilot-message p {
  margin: 0;
}

.copilot-markdown {
  display: grid;
  gap: 8px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.copilot-markdown h3,
.copilot-markdown h4,
.copilot-markdown h5,
.copilot-markdown h6 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.copilot-message.user .copilot-markdown h3,
.copilot-message.user .copilot-markdown h4,
.copilot-message.user .copilot-markdown h5,
.copilot-message.user .copilot-markdown h6 {
  color: #ffffff;
}

.copilot-markdown p {
  margin: 0;
}

.copilot-markdown ul,
.copilot-markdown ol {
  margin: 0;
  padding-left: 20px;
}

.copilot-markdown li + li {
  margin-top: 4px;
}

.copilot-markdown strong {
  color: var(--ink);
  font-weight: 800;
}

.copilot-markdown a,
.copilot-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.copilot-link.download,
.copilot-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(47, 143, 131, 0.32);
  background: rgba(47, 143, 131, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}

.copilot-message.user .copilot-markdown strong {
  color: #ffffff;
}

.copilot-markdown code {
  padding: 1px 4px;
  background: rgba(53, 118, 168, 0.12);
  border: 1px solid rgba(53, 118, 168, 0.16);
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 12px;
}

.copilot-markdown pre {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  background: #091618;
  color: #d8e6e3;
  border: 1px solid rgba(9, 22, 24, 0.18);
}

.copilot-markdown pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.copilot-markdown blockquote {
  margin: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: rgba(47, 143, 131, 0.08);
  color: #405058;
}

.copilot-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #ffffff;
}

.copilot-markdown table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
}

.copilot-markdown th,
.copilot-markdown td {
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  vertical-align: top;
}

.copilot-markdown th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--ink);
  background: #eef4f2;
  font-weight: 800;
}

.copilot-markdown th:first-child,
.copilot-markdown td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 92px;
  max-width: 150px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  font-weight: 800;
  white-space: normal;
}

.copilot-markdown th:first-child {
  z-index: 3;
  background: #eef4f2;
}

.copilot-markdown th:last-child,
.copilot-markdown td:last-child {
  border-right: 0;
}

.copilot-markdown tr:last-child td {
  border-bottom: 0;
}

.copilot-cite {
  display: inline-block;
  color: #ffffff;
  background: var(--blue);
  padding: 0 4px;
  margin: 0 1px;
  font-size: 11px;
}

.copilot-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.copilot-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.copilot-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 6px;
  color: #405058;
  background: #eef4f2;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.4;
}

.copilot-chip.ok {
  color: #14665c;
  background: rgba(47, 143, 131, 0.12);
  border-color: rgba(47, 143, 131, 0.28);
}

.copilot-chip.warn {
  color: #8a5a15;
  background: rgba(199, 124, 37, 0.12);
  border-color: rgba(199, 124, 37, 0.28);
}

.copilot-chip.model {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copilot-error {
  margin-bottom: 6px;
  color: var(--red);
}

.copilot-meta summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.copilot-source {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(23, 32, 36, 0.08);
}

.copilot-reasoning {
  margin: 6px 0;
  padding: 6px 8px;
  background: rgba(53, 118, 168, 0.08);
  border: 1px solid rgba(53, 118, 168, 0.16);
}

.copilot-reasoning-body {
  margin-top: 6px;
  color: #405058;
  line-height: 1.55;
}

.copilot-options {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.copilot-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.copilot-options input[type="number"] {
  width: 54px;
  min-height: 28px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
  padding: 0 6px;
}

.copilot-options input[type="checkbox"] {
  width: 15px;
  min-height: 15px;
  accent-color: var(--accent);
}

.copilot-llm-settings {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.copilot-llm-settings summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.copilot-llm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.copilot-llm-grid input {
  width: 100%;
  min-height: 32px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.copilot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.copilot-form textarea {
  width: 100%;
  resize: none;
  min-height: 46px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.copilot-form button {
  min-height: 46px;
}

@media (max-width: 760px) {
  .copilot-widget {
    left: auto !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px);
  }

  .copilot-launcher,
  .copilot-launcher img {
    width: 58px;
    height: 58px;
    min-height: 58px;
  }

  .copilot-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 76px;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    max-height: min(78vh, 680px);
    resize: none;
    grid-template-rows: auto auto auto minmax(160px, 1fr) auto auto auto;
  }

  .copilot-panel::after {
    display: none;
  }

  .copilot-header,
  .copilot-suggestions,
  .copilot-auth,
  .copilot-options,
  .copilot-llm-settings,
  .copilot-form {
    padding-left: 12px;
    padding-right: 12px;
  }

  .copilot-suggestions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .copilot-suggestions button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 11px;
  }

  .copilot-login-form {
    grid-template-columns: 1fr;
  }

  .copilot-login-form > div,
  .copilot-auth-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .copilot-messages {
    padding: 12px;
  }

  .copilot-message {
    max-width: 100%;
    font-size: 12px;
  }

  .copilot-options {
    flex-wrap: wrap;
    gap: 8px;
  }

  .copilot-form {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .copilot-panel {
    left: 8px;
    right: 8px;
    bottom: 72px;
    max-height: 80vh;
  }

  .copilot-suggestions {
    grid-template-columns: 1fr;
  }

  .copilot-form {
    grid-template-columns: 1fr;
  }

  .copilot-form button {
    min-height: 38px;
  }
}
