* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
body.marketintel-locked #appRoot {
  visibility: hidden;
  pointer-events: none;
}
.lock-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: grid;
  place-items: center;
  z-index: 10000;
}
body:not(.marketintel-locked) .lock-screen {
  display: none;
}
.lock-card {
  width: min(92vw, 380px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 1.1rem;
  background: #050505;
  display: grid;
  gap: 0.75rem;
}
.lock-card h2 {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lock-card p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}
.lock-card input {
  background: #060606;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.6rem 0.7rem;
  font: inherit;
}
.lock-card button {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #121212;
  color: #fff;
  padding: 0.55rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  font: inherit;
}
.lock-error {
  min-height: 1.1rem;
  font-size: 0.78rem;
  color: #ff9f9f;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.topbar .title {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}
.topbar a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar a:hover {
  text-decoration: underline;
}
#map {
  height: calc(100vh - 56px);
  margin-top: 56px;
}
.status-pill {
  position: fixed;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  border-radius: 6px;
}
.leaflet-control-container {
  z-index: 900;
}

.map-tools-dock {
  position: fixed;
  left: 0.8rem;
  top: 4.2rem;
  z-index: 4000;
  width: min(980px, 96vw);
  min-width: min(280px, 94vw);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.dock-drag-handle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.dock-toggle-btn {
  margin: 0;
  padding: 0.15rem 0.35rem 0.15rem 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  border-radius: 4px;
}
.dock-toggle-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}
.map-tools-dock.collapsed .dock-drag-handle {
  border-bottom: none;
}
.map-tools-dock.collapsed #dockExpandable {
  display: none;
}
.dock-drag-icon {
  opacity: 0.65;
  font-size: 1rem;
  line-height: 1;
}
.layer-section {
  padding: 0.65rem 0.7rem 0.5rem;
}
.layer-section h2 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}
.layer-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.layer-search-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #fff;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
}
.layer-search-form button {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.layer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  width: 100%;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  align-items: start;
}
.layer-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: start;
  padding: 0.32rem 0;
  cursor: pointer;
}
.layer-item input {
  margin-top: 0.18rem;
  cursor: pointer;
}
.layer-name {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.94);
}
.layer-note {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 0.1rem;
  line-height: 1.35;
}
.state-gradient-legend {
  margin-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.45rem;
}
.state-gradient-legend__title {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.2rem;
}
.state-gradient-legend__subtitle {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}
.state-gradient-legend__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}
.state-gradient-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.82);
}
.state-gradient-legend__swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.state-gradient-legend__details {
  margin-top: 0.35rem;
}
.state-gradient-legend__details > summary {
  cursor: pointer;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
}
.state-gradient-legend__body {
  margin-top: 0.3rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.state-gradient-legend__line {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}
.state-gradient-legend__line + .state-gradient-legend__line {
  margin-top: 0.18rem;
}
.gemini-chat {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.65rem 0.7rem 0.7rem;
}
.gemini-chat h3 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.gemini-messages {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}
.gemini-msg {
  margin-bottom: 0.55rem;
}
.gemini-msg-label {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.12rem;
}
.gemini-msg-user {
  text-align: right;
  color: #9ecbff;
}
.gemini-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.gemini-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 2.5rem;
  max-height: 120px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #fff;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.82rem;
}
.gemini-form button {
  align-self: flex-end;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.gemini-error {
  font-size: 0.72rem;
  color: #ff9b9b;
  margin-top: 0.25rem;
}

/* ── Signals dashboard tab ─────────────────────────────────────────── */
