:root {
  --bg-glass: rgba(12, 17, 27, 0.84);
  --bg-glass-2: rgba(9, 13, 21, 0.92);
  --stroke: rgba(255, 255, 255, 0.09);
  --text: #dfe7f3;
  --text-dim: #8d99ad;
  --cyan: #6ef3ff;
  --amber: #ffb347;
  --teal: #3fd9ff;
  --green: #2ecc71;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

#cesiumContainer {
  position: absolute;
  inset: 0;
}

.context-body-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
  color: rgba(223, 231, 243, 0.86);
  font: 11px "Segoe UI", sans-serif;
  line-height: 1;
  text-shadow:
    0 0 2px #000,
    0 0 5px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* ---------- control panel ---------- */

#panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 282px;
  max-height: calc(100vh - 32px);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px 16px 10px;
  z-index: 8;
  user-select: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease;
}

#panel.collapsed {
  transform: translateX(calc(-100% - 16px));
}

.side-collapse-toggle {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 78px;
  background: var(--bg-glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.side-collapse-toggle:hover,
.side-collapse-toggle:focus-visible {
  border-color: rgba(110, 243, 255, 0.45);
  color: var(--cyan);
  outline: none;
}
.panel-toggle {
  top: 12px;
  right: -39px;
  border-left: 0;
  border-radius: 0 10px 10px 0;
}
.panel-about-toggle {
  top: 96px;
  right: -39px;
  border-left: 0;
  border-radius: 0 10px 10px 0;
}
.panel-toggle[aria-expanded="true"],
.panel-about-toggle[aria-expanded="true"] {
  color: var(--cyan);
  border-color: rgba(110, 243, 255, 0.45);
}
.panel-pane[hidden] {
  display: none;
}
.panel-pane {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.panel-pane::-webkit-scrollbar {
  width: 7px;
}
.panel-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}
.panel-pane::-webkit-scrollbar-track {
  background: transparent;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.5px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.panel-title span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 2px;
}

.primary-features {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.primary-feature {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(110, 243, 255, 0.2);
  border-radius: 9px;
  color: var(--text);
}
.primary-feature-agent {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(110, 243, 255, 0.13), rgba(168, 85, 247, 0.1)),
    rgba(255, 255, 255, 0.035);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
.primary-feature-agent:hover {
  border-color: rgba(110, 243, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(110, 243, 255, 0.19), rgba(168, 85, 247, 0.14)),
    rgba(255, 255, 255, 0.05);
}
.primary-feature-agent:focus-visible {
  border-color: var(--cyan);
  outline: 1px solid rgba(110, 243, 255, 0.65);
  outline-offset: 2px;
}
.primary-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid rgba(110, 243, 255, 0.38);
  border-radius: 8px;
  background: rgba(110, 243, 255, 0.11);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(110, 243, 255, 0.1);
}
.primary-feature-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}
.primary-feature-copy strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.primary-feature-copy small {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 9.5px;
  line-height: 1.25;
}
.primary-feature-action {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.layer { margin-bottom: 8px; }
.layer-group { margin-bottom: 8px; }
.layer-group > summary {
  min-height: 25px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  list-style: none;
  padding: 3px 6px;
}
.layer-group > summary::-webkit-details-marker { display: none; }
.layer-group > summary::marker { content: ""; }
.layer-group > summary:focus-visible {
  outline: 1px solid #4aa3ff;
  outline-offset: 1px;
}
.layer-group-content { padding-top: 6px; }
.layer-group-chevron {
  margin-left: auto;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1;
  transition: transform 150ms ease;
}
.layer-group[open] .layer-group-chevron { transform: rotate(180deg); }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: pointer;
  font-size: 13px;
}
.row input[type="checkbox"] {
  accent-color: #4aa3ff;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}
.row.sub {
  margin-left: 24px;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 1px 0;
}
.row .name { white-space: nowrap; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dot-sat    { background: var(--cyan);  box-shadow: 0 0 6px var(--cyan); }
.dot-flight { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-ship   { background: var(--teal);  box-shadow: 0 0 6px var(--teal); }
.dot-layers { background: #8b9bb4; box-shadow: 0 0 6px #8b9bb4; }
.dot-heat {
  background: linear-gradient(135deg, #4fc3f7, #facc15, #ef4444);
  box-shadow: 0 0 6px #fb923c;
}

.heat-select {
  width: calc(100% - 24px);
  margin: 2px 0 4px 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 6px;
  font-size: 11.5px;
  font-family: inherit;
  padding: 3px 6px;
  cursor: pointer;
  color-scheme: dark;
}
.heat-select:focus { outline: 1px solid #4aa3ff; }
.heat-select.is-enhanced {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.heat-combo {
  position: relative;
  width: calc(100% - 24px);
  margin: 2px 0 4px 24px;
}
.heat-combo-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 25px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  padding: 3px 6px;
  cursor: pointer;
}
.heat-combo-button:focus-visible {
  outline: 1px solid #4aa3ff;
  outline-offset: 1px;
}
.heat-combo-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heat-combo-chevron {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1;
}
.heat-combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  background: var(--bg-glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.48);
}
.heat-combo-menu[hidden] { display: none; }
.heat-combo-search {
  width: calc(100% - 8px);
  margin: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: var(--text);
  color-scheme: dark;
  font-family: inherit;
  font-size: 11.5px;
  outline: none;
  padding: 5px 7px;
}
.heat-combo-search::placeholder { color: var(--text-dim); }
.heat-combo-search:focus { border-color: rgba(110, 243, 255, 0.5); }
.heat-combo-list {
  max-height: min(335px, calc(100vh - 150px));
  overflow: hidden auto;
  padding: 0 4px 4px;
}
.heat-combo-group {
  padding: 7px 8px 3px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.2;
  text-transform: uppercase;
}
.heat-combo-option {
  display: block;
  width: 100%;
  min-height: 27px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.25;
  padding: 5px 8px;
  text-align: left;
}
.heat-combo-option:hover,
.heat-combo-option.active {
  background: rgba(110, 243, 255, 0.12);
}
.heat-combo-option[aria-selected="true"] {
  color: var(--cyan);
}
.heat-combo-option::before {
  content: "";
  display: inline-block;
  width: 14px;
}
.heat-combo-option[aria-selected="true"]::before { content: "✓"; }
.heat-combo-empty {
  padding: 12px 8px;
  color: var(--text-dim);
  font-size: 11.5px;
}

/* baseline popup theming (any browser): dark navy rows instead of UA gray.
   Group headers are the optgroup's own text style; options reset what they
   would otherwise inherit from it. */
.heat-select option,
.heat-select optgroup {
  background: rgb(12, 17, 27);
  color: var(--text);
}
.heat-select optgroup {
  color: var(--text-dim);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.heat-select option {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

/* fully themed popup where the customizable <select> is supported (Chromium) */
@supports selector(::picker(select)) {
  .heat-select,
  .heat-select::picker(select) {
    appearance: base-select;
  }
  .heat-select::picker(select) {
    background: var(--bg-glass-2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 4px;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text);
  }
  .heat-select option {
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
  }
  .heat-select option:hover,
  .heat-select option:focus-visible {
    background: rgba(110, 243, 255, 0.12);
  }
  .heat-select option:checked {
    background: rgba(110, 243, 255, 0.16);
    color: var(--cyan);
  }
  .heat-select option::checkmark { color: var(--cyan); }
  .heat-select optgroup {
    padding: 4px 8px 2px;
  }
  .heat-select optgroup option {
    margin: 0 -8px; /* headers indent, options stay flush with the picker */
  }
}

.wb-controls { margin: 4px 0 2px 24px; }
.wb-controls[hidden] { display: none; }
.wb-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right,
    #4fc3f7 0%, #3fd98f 20%, #facc15 40%, #fb923c 60%, #ef4444 80%, #d946ef 100%);
}
.wb-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.wb-when {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-dim);
}
.wb-when span { color: var(--cyan); font-weight: 650; }
.wb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-dim);
}
.wb-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 12px;
  margin: 0;
  accent-color: #4aa3ff;
}
.wb-name { flex: 0 0 34px; }
.wb-val {
  flex: 0 0 58px;
  text-align: right;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 9.5px;
  color: var(--text);
}

.dot-quake { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.dot-event { background: #fb923c; box-shadow: 0 0 6px #fb923c; }
.dot-launch { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
.dot-cable { background: #64b4ff; box-shadow: 0 0 6px #64b4ff; }
.dot-plant { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.dot-timezone { background: #818cf8; box-shadow: 0 0 6px #818cf8; }
.dot-size { background: #ff5470; box-shadow: 0 0 6px #ff5470; }
.dot-moon { background: #cfd6e4; box-shadow: 0 0 6px #cfd6e4; }
.dot-mars { background: #c1583c; box-shadow: 0 0 6px #c1583c; }

.cat-filters {
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 10px;
  color: var(--text-dim);
}
.cat-filters label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.cat-filters input[type="checkbox"] {
  width: 11px;
  height: 11px;
  margin: 0;
}

/* focus scoping: app.js toggles [hidden] on data-scoped controls to match
   body[data-focus]. Rows without data-scope stay universal. */
[data-scope][hidden] { display: none; }

.primary-feature-truesize {
  margin: 0;
  padding: 5px 9px 6px;
  border-color: rgba(255, 84, 112, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 84, 112, 0.1), rgba(255, 179, 71, 0.05)),
    rgba(255, 255, 255, 0.025);
}
.primary-feature-truesize > .row {
  gap: 7px;
  padding: 3px 0;
}
.primary-feature-truesize:focus-within {
  border-color: rgba(255, 84, 112, 0.52);
}
.primary-feature-truesize .count {
  min-width: 20px;
}
.primary-feature-truesize .ts-help {
  margin: 5px 0 1px 43px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 84, 112, 0.16);
}

.ts-help {
  margin: 2px 0 4px 24px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.ts-help[hidden] { display: none; }
.ts-help a { color: #7da7d9; text-decoration: none; }
.ts-help a:hover { text-decoration: underline; }

.badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 7px;
  border-radius: 9px;
  margin-left: auto;
}
.badge.live    { background: rgba(46, 204, 113, 0.16); color: var(--green); }
.badge.demo    { background: rgba(255, 179, 71, 0.16); color: var(--amber); }
.badge.static  { background: rgba(110, 140, 190, 0.18); color: #9cb8e0; }
.badge.loading { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

.count {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  min-width: 38px;
  text-align: right;
}
.badge + .count { margin-left: 6px; }

/* ---------- onboarding instructions ---------- */

.howto {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}
.howto > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.3px;
  color: var(--text);
  padding: 2px 0;
}
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before {
  content: "?";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 84, 112, 0.18);
  color: #ff89a6;
  font-size: 11px;
  font-weight: 700;
}
.howto > summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--text-dim);
  font-size: 10px;
  transition: transform 0.18s ease;
}
.howto[open] > summary::after { transform: rotate(90deg); }
.howto ol {
  margin: 8px 0 2px;
  padding-left: 18px;
  font-size: 11.3px;
  line-height: 1.55;
  color: var(--text-dim);
}
.howto ol li { margin-bottom: 6px; }
.howto ol li b { color: #c7d3e6; font-weight: 650; }
.howto .howto-ring {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #ff7aa2;
  box-shadow: 0 0 5px rgba(255, 122, 162, 0.8);
  vertical-align: -1px;
}
.howto .howto-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff5470;
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  vertical-align: -2px;
}

.attrib {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.attrib a {
  color: #7da7d9;
  text-decoration: none;
}
.attrib a:hover { text-decoration: underline; }
.github-logo-link,
.linkedin-logo-link {
  display: inline-flex;
  align-items: center;
  color: #9ec2ff;
  line-height: 1;
  vertical-align: -2px;
}
.github-logo,
.linkedin-logo {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.linkedin-logo-mark {
  fill: #081019;
}
.github-logo-link:hover,
.github-logo-link:focus-visible,
.linkedin-logo-link:hover,
.linkedin-logo-link:focus-visible {
  color: var(--cyan);
  text-decoration: none;
  outline: none;
}
.github-logo-link:focus-visible,
.linkedin-logo-link:focus-visible {
  filter: drop-shadow(0 0 5px rgba(110, 243, 255, 0.5));
}

.panel-about {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
}
.panel-about p {
  margin: 0 0 12px;
}
.about-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}
.about-heading {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.panel-about ul {
  margin: 0;
  padding-left: 18px;
}
.panel-about li {
  margin-bottom: 6px;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}
.about-links a {
  color: #9ec2ff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
}
.about-text-link {
  padding: 3px 7px;
  border: 1px solid rgba(126, 167, 217, 0.35);
  border-radius: 6px;
}
.about-text-link:hover,
.about-text-link:focus-visible {
  border-color: rgba(110, 243, 255, 0.45);
  color: var(--cyan);
  outline: none;
  text-decoration: none;
}
.about-links .github-logo,
.about-links .linkedin-logo {
  width: 22px;
  height: 22px;
}
.about-links a:hover {
  text-decoration: underline;
}
.about-links .github-logo-link:hover,
.about-links .linkedin-logo-link:hover {
  text-decoration: none;
}

/* ---------- country search ---------- */

#search {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(420px, 38vw, 560px);
  max-width: calc(100vw - 32px);
  z-index: 7;
}
#search-input {
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  color-scheme: dark;
}
#search-input::placeholder { color: var(--text-dim); }
#search-input:focus { border-color: rgba(110, 243, 255, 0.45); }

/* body switcher: sits just right of the (centred) search bar and stays put
   when the search hides at the moon */
#sel-body {
  position: absolute;
  top: 16px;
  left: calc(50% + clamp(210px, 19vw, 280px) + 10px);
  z-index: 7;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}
#sel-body:focus { border-color: rgba(110, 243, 255, 0.45); }

#search-results {
  margin-top: 6px;
  background: var(--bg-glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden auto;
  max-height: 320px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
#search-results[hidden] { display: none; }
.sr-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
}
.sr-item:hover, .sr-item.active { background: rgba(255, 255, 255, 0.07); }
.sr-name {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sr-area {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 10px;
}
.sr-type {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #aebbd0;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  text-transform: uppercase;
}
.sr-type.region {
  border-color: rgba(255, 209, 102, 0.32);
  color: #ffd166;
}
.sr-add {
  flex: 0 0 auto;
  background: rgba(110, 243, 255, 0.1);
  border: 1px solid rgba(110, 243, 255, 0.35);
  border-radius: 9px;
  color: var(--cyan);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 650;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.sr-add:hover:not(:disabled) { background: rgba(110, 243, 255, 0.22); }
.sr-add:disabled { opacity: 0.7; cursor: default; }
.sr-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- tooltip ---------- */

#tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: var(--bg-glass-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 260px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
#tooltip .tt-title { font-weight: 700; font-size: 12.5px; }
#tooltip .tt-line  { color: #b9c4d6; }
#tooltip .tt-note  { color: var(--text-dim); font-size: 10.5px; margin-top: 2px; }
#tooltip .tt-guide {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  font-size: 10px;
  line-height: 2;
}
#tooltip .tt-key {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: #c7d3e6;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.3px;
  line-height: 1.6;
}
#tooltip .tt-plus { margin: 0 2px; color: var(--text-dim); }

/* ---------- Wikipedia panel ---------- */

#wiki-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(var(--right-panel-width, 392px), calc(100vw - 46px));
  background: var(--bg-glass-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--stroke);
  z-index: 8;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
#wiki-panel:not(.collapsed) {
  transform: translateX(0);
}
#wiki-panel.collapsed {
  transform: translateX(100%);
}

.wiki-toggle {
  top: 14px;
  left: 0;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  transform: translateX(-100%);
}

.wp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 4px;
}
.wp-title { font-size: 15px; font-weight: 700; letter-spacing: 0.4px; }
#wp-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
#wp-close:hover { color: #fff; }

.wp-coords {
  padding: 0 18px 10px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.wp-radius { padding: 0 18px 12px; border-bottom: 1px solid var(--stroke); }
.wp-radius label { font-size: 12px; color: var(--text); display: block; margin-bottom: 4px; }
.wp-radius label span { color: var(--cyan); font-weight: 700; }
.wp-radius input[type="range"] { width: 100%; accent-color: #4aa3ff; }
.wp-radius-ends {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

#wp-results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 18px;
}
#wp-results::-webkit-scrollbar { width: 8px; }
#wp-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.wp-status {
  padding: 22px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
}
.wp-status .spinner {
  width: 22px; height: 22px;
  margin: 0 auto 10px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wp-item {
  display: block;
  color: var(--text);
  padding: 10px 10px 11px;
  border-radius: 10px;
  margin-bottom: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.wp-item:hover { background: rgba(255, 255, 255, 0.06); }
.wp-item.selected {
  background: rgba(255, 84, 112, 0.13);
  border-color: rgba(255, 122, 162, 0.5);
}
.wp-item-title {
  font-size: 13.5px;
  font-weight: 650;
  color: #aecdff;
  display: flex;
  align-items: center;
  gap: 7px;
}
.wp-item-name { min-width: 0; }
.wp-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 7px;
  background: rgba(110, 140, 190, 0.2);
  color: #9cb8e0;
  flex: 0 0 auto;
}
.wp-item-loc {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #ff9bb4;
}
.wp-item-dist { font-size: 10.5px; color: var(--text-dim); margin: 2px 0 3px; font-family: Consolas, monospace; }
.wp-item-extract { font-size: 11.8px; line-height: 1.5; color: #b9c4d6; }
.wp-item-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #9ec2ff;
  text-decoration: none;
}
.wp-item-link:hover { text-decoration: underline; }

/* ---------- hint & error ---------- */

#hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 12px;
  color: rgba(223, 231, 243, 0.75);
  background: rgba(10, 14, 22, 0.6);
  padding: 6px 16px;
  border-radius: 16px;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
#hint.faded { opacity: 0; }

#moon-back[hidden] { display: none; }

#moon-back {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-glass);
  border: 1px solid var(--stroke);
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
#moon-back:hover { background: var(--bg-glass-2); border-color: rgba(255, 255, 255, 0.22); }

/* lunar article lists have no Earth geosearch radius to adjust */
#wiki-panel.moon .wp-radius { display: none; }

#error[hidden] { display: none; }

#error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070c;
  color: var(--text);
  font-size: 14px;
  padding: 40px;
  text-align: center;
}

.noscript-summary {
  position: relative;
  z-index: 30;
  max-width: 680px;
  margin: 40px auto;
  padding: 24px;
  color: var(--text);
  background: var(--bg-glass-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.6;
}

/* Cesium credit bar: keep attribution visible but unobtrusive */
.cesium-viewer-bottom {
  font-size: 10px !important;
  opacity: 0.65;
}

@media (max-width: 640px) {
  #panel {
    width: 232px;
    max-height: calc(100vh - 32px);
    padding: 10px 12px 8px;
  }
  .primary-feature-agent {
    gap: 7px;
    padding: 8px;
  }
  .primary-feature-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .primary-feature-copy strong { font-size: 11.5px; }
  .primary-feature-copy small { font-size: 9px; }
  .primary-feature-action { display: none; }
  .primary-feature-truesize {
    padding-right: 8px;
    padding-left: 8px;
  }
  .primary-feature-truesize .ts-help { margin-left: 38px; }
  .row { font-size: 12px; }
  #hint { display: none; }
  /* keep the search clear of the control panel on narrow screens */
  #search {
    left: auto;
    right: 16px;
    transform: none;
    width: calc(100vw - 272px);
    min-width: 130px;
  }
  /* switcher drops below the search bar on narrow screens */
  #sel-body {
    top: 54px;
    left: auto;
    right: 16px;
  }
}

/* ---------- LLM agent panel ---------- */

#agent-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(var(--right-panel-width, 392px), calc(100vw - 46px));
  background: var(--bg-glass-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--stroke);
  z-index: 9;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.28s ease;
}
#agent-panel.collapsed { transform: translateX(100%); }

#wiki-panel.right-panel-pane-active,
#agent-panel.right-panel-pane-active {
  z-index: 9;
}
#wiki-panel.right-panel-pane-inactive,
#agent-panel.right-panel-pane-inactive {
  z-index: 8;
  pointer-events: none;
}
.right-panel-pane-inactive > :not(.side-collapse-toggle) {
  visibility: hidden;
  pointer-events: none;
}
.right-panel-pane-inactive .side-collapse-toggle {
  pointer-events: auto;
}

.right-panel-resize-handle {
  position: absolute;
  top: 0;
  left: -5px;
  z-index: 1;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.right-panel-resize-handle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  width: 1px;
  height: 100%;
  background: transparent;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.right-panel-resize-handle:hover::before,
.right-panel-resize-handle:focus-visible::before,
body.right-panel-resizing .right-panel-resize-handle::before {
  background: rgba(110, 243, 255, 0.72);
  box-shadow: 0 0 12px rgba(110, 243, 255, 0.38);
}
.right-panel-resize-handle:focus-visible {
  outline: none;
}
#wiki-panel.collapsed .right-panel-resize-handle,
#agent-panel.collapsed .right-panel-resize-handle {
  display: none;
}
body.right-panel-resizing {
  cursor: col-resize;
  user-select: none;
}

.agent-toggle {
  top: 104px;
  left: 0;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  transform: translateX(-100%);
  z-index: 2;
}

.agent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--stroke);
  position: relative;
}
.agent-title { font-size: 15px; font-weight: 700; letter-spacing: 0.4px; }
.agent-subtitle { color: var(--text-dim); font-size: 10.5px; margin-top: 2px; }
.agent-head > div:first-child {
  flex: 1;
  min-width: 0;
}
.agent-icon-button,
#agent-close {
  margin-left: 0;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.agent-icon-button:hover,
.agent-icon-button[aria-expanded="true"],
#agent-close:hover {
  border-color: rgba(110, 243, 255, 0.35);
  color: #fff;
}
.agent-icon-button:disabled {
  cursor: default;
  opacity: 0.5;
}
#agent-close {
  font-size: 23px;
}
#agent-history-toggle {
  font-size: 17px;
  font-weight: 650;
}
#agent-new-session {
  font-size: 20px;
  font-weight: 650;
}

.agent-settings,
.agent-history {
  position: absolute;
  top: 58px;
  left: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  gap: 8px;
  max-height: min(560px, calc(100vh - 136px));
  overflow: auto;
  padding: 12px;
  background: rgba(9, 13, 21, 0.98);
  border: 1px solid rgba(110, 243, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52);
}
.agent-settings[hidden],
.agent-history[hidden] { display: none; }
.agent-form,
.agent-settings,
.agent-history {
  color-scheme: dark;
}
.agent-form label,
.agent-settings label {
  display: grid;
  gap: 4px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.agent-form label[hidden],
.agent-settings label[hidden] { display: none; }
.agent-form input,
.agent-form select,
.agent-form textarea,
.agent-settings input,
.agent-settings select {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  color: var(--text);
  color-scheme: dark;
  font: 12px "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  outline: none;
  padding: 7px 8px;
  text-transform: none;
}
.agent-form textarea {
  min-height: 70px;
  max-height: 150px;
  resize: vertical;
}
.agent-form input:focus,
.agent-form select:focus,
.agent-form textarea:focus,
.agent-settings input:focus,
.agent-settings select:focus { border-color: rgba(110, 243, 255, 0.45); }
.agent-form select,
.agent-settings select {
  cursor: pointer;
}
.agent-form select option,
.agent-form select optgroup,
.agent-settings select option,
.agent-settings select optgroup {
  background: rgb(12, 17, 27);
  color: var(--text);
}
.agent-form select optgroup,
.agent-settings select optgroup {
  color: var(--text-dim);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.agent-form select option,
.agent-settings select option {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
@supports selector(::picker(select)) {
  .agent-form select,
  .agent-form select::picker(select),
  .agent-settings select,
  .agent-settings select::picker(select) {
    appearance: base-select;
  }
  .agent-form select::picker(select),
  .agent-settings select::picker(select) {
    background: var(--bg-glass-2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 4px;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text);
  }
  .agent-form select option,
  .agent-settings select option {
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
  }
  .agent-form select option:hover,
  .agent-form select option:focus-visible,
  .agent-settings select option:hover,
  .agent-settings select option:focus-visible {
    background: rgba(110, 243, 255, 0.12);
  }
  .agent-form select option:checked,
  .agent-settings select option:checked {
    background: rgba(110, 243, 255, 0.16);
    color: var(--cyan);
  }
  .agent-form select option::checkmark,
  .agent-settings select option::checkmark { color: var(--cyan); }
  .agent-form select optgroup,
  .agent-settings select optgroup {
    padding: 4px 8px 2px;
  }
  .agent-form select optgroup option,
  .agent-settings select optgroup option {
    margin: 0 -8px;
  }
}
.agent-provider-note,
.agent-ollama-hint {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
}
.agent-settings-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 2px;
}
.agent-settings-actions .agent-submit {
  flex: 0 0 auto;
}
.agent-settings-save-msg {
  min-width: 0;
  color: var(--text-dim);
  font-size: 11px;
}
.agent-ollama-hint {
  background: rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 179, 71, 0.22);
  border-radius: 7px;
  color: #e7c086;
  padding: 7px 8px;
}
.agent-ollama-hint[hidden] { display: none; }

.agent-history-title {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.agent-history-list {
  display: grid;
  gap: 6px;
}
.agent-history-actions {
  display: flex;
  justify-content: flex-end;
}
.agent-history-clear {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  font: 700 10.5px "Segoe UI", system-ui, sans-serif;
  padding: 6px 8px;
}
.agent-history-clear:hover:not(:disabled),
.agent-history-clear:focus-visible:not(:disabled) {
  border-color: rgba(255, 179, 71, 0.36);
  color: #f0c98d;
  outline: none;
}
.agent-history-clear:disabled {
  cursor: default;
  opacity: 0.48;
}
.agent-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
  width: 100%;
}
.agent-history-open {
  display: grid;
  gap: 3px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  padding: 8px 9px;
  text-align: left;
}
.agent-history-open:hover:not(:disabled),
.agent-history-open:focus-visible:not(:disabled) {
  border-color: rgba(110, 243, 255, 0.30);
  outline: none;
}
.agent-history-open:disabled {
  cursor: default;
  opacity: 1;
}
.agent-history-delete {
  align-self: stretch;
  background: rgba(255, 84, 112, 0.08);
  border: 1px solid rgba(255, 84, 112, 0.18);
  border-radius: 8px;
  color: #ff9bb4;
  cursor: pointer;
  font: 700 10.5px "Segoe UI", system-ui, sans-serif;
  padding: 0 8px;
}
.agent-history-delete:hover:not(:disabled),
.agent-history-delete:focus-visible:not(:disabled) {
  background: rgba(255, 84, 112, 0.15);
  border-color: rgba(255, 122, 162, 0.42);
  color: #ffd0da;
  outline: none;
}
.agent-history-delete:disabled {
  cursor: default;
  opacity: 0.42;
}
.agent-history-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.agent-history-item-meta {
  color: var(--text-dim);
  font-size: 10.5px;
}

.agent-transcript {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden auto;
  padding: 14px;
}
.agent-transcript::-webkit-scrollbar,
.agent-settings::-webkit-scrollbar,
.agent-history::-webkit-scrollbar { width: 8px; }
.agent-transcript::-webkit-scrollbar-thumb,
.agent-settings::-webkit-scrollbar-thumb,
.agent-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.agent-empty {
  margin: auto 10px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}
.agent-empty[hidden] { display: none; }
.agent-empty p {
  margin: 0 0 12px;
}
.agent-setup-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(110, 243, 255, 0.055);
  border: 1px solid rgba(110, 243, 255, 0.18);
  border-radius: 8px;
  text-align: left;
}
.agent-setup-title {
  color: #eafcff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.agent-setup-steps {
  margin: 0;
  padding-left: 17px;
  color: #b7c4d8;
  font-size: 11.5px;
  line-height: 1.45;
}
.agent-setup-steps li {
  margin: 0 0 5px;
}
.agent-setup-steps li:last-child {
  margin-bottom: 0;
}
.agent-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.agent-example-label {
  margin-bottom: 7px;
  color: #b7c4d8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.agent-example-list {
  display: grid;
  gap: 7px;
  text-align: left;
}
.agent-example-prompt {
  width: 100%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #d8e2f1;
  cursor: pointer;
  font: 12px "Segoe UI", system-ui, sans-serif;
  line-height: 1.35;
  padding: 8px 9px;
  text-align: left;
}
.agent-example-prompt:hover,
.agent-example-prompt:focus-visible {
  background: rgba(110, 243, 255, 0.10);
  border-color: rgba(110, 243, 255, 0.34);
  color: #eefcff;
  outline: none;
}
.agent-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}
.agent-message.user {
  align-self: flex-end;
  align-items: flex-end;
}
.agent-message.assistant {
  align-self: flex-start;
  align-items: flex-start;
}
.agent-message-meta {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.agent-bubble {
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #d8e2f1;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 9px 10px;
}
.agent-bubble p {
  margin: 0 0 0.8em;
}
.agent-bubble h1,
.agent-bubble h2,
.agent-bubble h3,
.agent-bubble h4 {
  margin: 0 0 0.55em;
  color: #eef6ff;
  font-size: 1em;
  line-height: 1.35;
}
.agent-bubble p:last-child,
.agent-bubble ul:last-child,
.agent-bubble ol:last-child,
.agent-bubble blockquote:last-child,
.agent-bubble table:last-child,
.agent-bubble pre:last-child,
.agent-bubble h1:last-child,
.agent-bubble h2:last-child,
.agent-bubble h3:last-child,
.agent-bubble h4:last-child {
  margin-bottom: 0;
}
.agent-bubble ul,
.agent-bubble ol {
  margin: 0 0 0.85em;
  padding-left: 20px;
}
.agent-bubble li {
  margin: 0.2em 0;
}
.agent-bubble blockquote {
  margin: 0 0 0.9em;
  padding: 0 0 0 10px;
  border-left: 2px solid rgba(110, 243, 255, 0.38);
  color: #cbd5e1;
}
.agent-bubble table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 0.95em;
  border-collapse: collapse;
  white-space: nowrap;
}
.agent-bubble th,
.agent-bubble td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
}
.agent-bubble th {
  background: rgba(255, 255, 255, 0.06);
  color: #eef6ff;
  font-weight: 700;
}
.agent-bubble code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 5px;
  color: #d6f7ff;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.92em;
  padding: 0 4px;
}
.agent-bubble pre {
  overflow: auto;
  margin: 0 0 0.9em;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  padding: 9px 10px;
}
.agent-bubble pre code {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}
.agent-bubble a {
  color: #9edfff;
  text-decoration: none;
}
.agent-bubble a:hover {
  text-decoration: underline;
}
.agent-bubble hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0.9em 0;
}
.agent-message.user .agent-bubble {
  background: rgba(110, 243, 255, 0.13);
  border-color: rgba(110, 243, 255, 0.24);
  color: #eefcff;
}
.agent-message.assistant .agent-bubble {
  background: rgba(255, 255, 255, 0.055);
}
.agent-message.assistant[data-state="thinking"] .agent-bubble {
  color: var(--text-dim);
}
.agent-message.assistant[data-status="error"] .agent-bubble,
.agent-message.assistant[data-status="no_data"] .agent-bubble,
.agent-message.assistant[data-status="unverified"] .agent-bubble {
  border-color: rgba(255, 179, 71, 0.34);
}
.agent-notice {
  align-self: center;
  color: var(--text-dim);
  font-size: 10.5px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.agent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.agent-actions .agent-submit { order: 2; }
.agent-actions .agent-cancel { order: 1; }
.agent-submit,
.agent-cancel {
  background: rgba(110, 243, 255, 0.14);
  border: 1px solid rgba(110, 243, 255, 0.42);
  border-radius: 8px;
  color: var(--cyan);
  cursor: pointer;
  font: 700 12px "Segoe UI", system-ui, sans-serif;
  padding: 8px 10px;
}
.agent-submit:hover:not(:disabled) { background: rgba(110, 243, 255, 0.22); }
.agent-cancel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}
.agent-cancel:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.agent-submit:disabled,
.agent-cancel:disabled {
  cursor: default;
  opacity: 0.58;
}
.agent-cancel[hidden] { display: none; }

.agent-checkpoint {
  align-self: stretch;
  border: 1px solid rgba(255, 196, 84, 0.5);
  background: rgba(255, 196, 84, 0.08);
  border-radius: 8px;
  padding: 10px;
  margin: 2px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-checkpoint[hidden] { display: none; }
.agent-checkpoint-msg {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.agent-status {
  color: var(--text-dim);
  font-size: 11px;
}
.agent-output,
.agent-tool-log {
  display: none;
}
.agent-usage {
  color: var(--text-dim);
  font: 10.5px Consolas, "Cascadia Mono", monospace;
  padding: 6px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.agent-composer {
  display: grid;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--stroke);
}
.agent-tool {
  align-self: stretch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(110, 243, 255, 0.65);
  border-radius: 8px;
  color: #cbd5e1;
  font: 11px Consolas, "Cascadia Mono", monospace;
  padding: 7px 9px;
}
.agent-tool-group {
  align-self: stretch;
}
.agent-tool-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-left: 3px solid rgba(110, 243, 255, 0.65);
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  font: 11.5px "Segoe UI", system-ui, sans-serif;
  padding: 7px 9px;
}
.agent-tool-summary::-webkit-details-marker { display: none; }
.agent-tool-summary::before {
  content: "+";
  color: var(--cyan);
  font: 700 13px Consolas, "Cascadia Mono", monospace;
}
.agent-tool-group[open] .agent-tool-summary::before {
  content: "-";
}
.agent-tool-summary-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-tool-summary-meta {
  color: var(--text-dim);
  flex: 0 0 auto;
  font: 10.5px Consolas, "Cascadia Mono", monospace;
}
.agent-tool-list {
  display: grid;
  gap: 7px;
  padding-top: 7px;
}
.agent-tool.ok { color: var(--green); }
.agent-tool.no_data,
.agent-tool.error { color: var(--amber); }
.agent-tool.running { color: var(--cyan); }

@media (max-width: 640px) {
  .agent-toggle { top: 148px; }
}
