:root {
  --bg: #edf2f4;
  --panel: #ffffff;
  --panel-soft: #f7f9fa;
  --ink: #17202a;
  --muted: #66717d;
  --line: #d9e1e6;
  --accent: #159a72;
  --accent-dark: #0b684f;
  --blue: #256fd8;
  --danger: #c8463a;
  --shadow: 0 18px 42px rgba(21, 32, 43, 0.12);
  --header: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 111, 216, 0.25);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: var(--header);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand span {
  font-weight: 800;
}

.app-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
  display: none;
}

.app-nav button,
.filter,
.ghost,
.icon-button {
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.app-nav button {
  flex: 0 0 auto;
  padding: 9px 12px;
}

.app-nav button.active {
  background: #e4f4ee;
  color: var(--accent-dark);
}

.primary-action,
.actions button,
.candidate-list button,
.route-presets button,
.route-floating button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-action {
  padding: 10px 14px;
  white-space: nowrap;
}

.app-main {
  height: calc(100vh - var(--header));
  overflow: auto;
}

.app-main.map-mode {
  overflow: hidden;
}

.map-shell {
  position: relative;
  height: 100%;
  min-height: 700px;
}

.map-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #dcebe5;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #dcebe5;
}

.map-canvas .leaflet-control-container {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.map-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-weight: 800;
}

.crm-marker-wrap {
  background: transparent;
  border: 0;
}

.crm-marker-hit {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.crm-marker-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid #fff;
  background: var(--color);
  box-shadow: 0 4px 10px rgba(15, 28, 38, 0.2);
}

.crm-marker-dot.selected {
  outline: 2px solid rgba(21, 154, 114, 0.38);
  outline-offset: 2px;
}

.marker-circle {
  border-radius: 50%;
}

.marker-square {
  border-radius: 2px;
}

.marker-diamond {
  border-radius: 2px;
  transform: rotate(45deg);
}

.marker-triangle {
  width: 0;
  height: 0;
  border-width: 0 5px 9px;
  border-style: solid;
  border-color: transparent transparent var(--color);
  background: transparent;
  box-shadow: none;
}

.marker-hex {
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.marker-pin {
  border-radius: 50% 50% 50% 8%;
  transform: rotate(-45deg);
}

.legend-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-width: 1px;
  border-style: solid;
  border-color: #fff;
  background: var(--color);
  box-shadow: none;
}

.legend-dot.marker-triangle {
  width: 0;
  height: 0;
  border-width: 0 4px 8px;
  border-color: transparent transparent var(--color);
  background: transparent;
}

.current-location-marker {
  filter: drop-shadow(0 4px 10px rgba(37, 111, 216, 0.35));
}

.map-title {
  position: absolute;
  left: 66px;
  top: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-title strong,
.map-title span {
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.12);
}

.map-title strong {
  background: var(--accent);
  color: #fff;
  padding: 10px 13px;
}

.map-title span {
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
}

.map-title .map-location-state {
  color: var(--blue);
}

.map-grid {
  position: absolute;
  inset: 98px 464px 52px 370px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  color: rgba(23, 32, 42, 0.28);
  font-weight: 800;
  pointer-events: none;
}

.route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-line line {
  stroke: rgba(23, 32, 42, 0.48);
  stroke-width: 0.55;
  stroke-dasharray: 1.6 1.1;
}

.map-point {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 44px;
  padding: 0 10px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: var(--color);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 28, 38, 0.2);
}

.map-point.selected {
  outline: 4px solid rgba(21, 154, 114, 0.25);
}

.map-point span {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.map-point em {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-style: normal;
}

.map-locator-card,
.map-search-card,
.map-detail,
.map-toolbar,
.route-floating,
.panel,
.stat,
.modal {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-toolbar {
  position: absolute;
  right: 24px;
  top: 18px;
  z-index: 7;
  display: flex;
  gap: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 6px;
  backdrop-filter: blur(10px);
}

.map-toolbar button {
  display: grid;
  gap: 2px;
  min-width: 70px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 7px 9px;
  text-align: left;
}

.map-toolbar button.active {
  background: var(--ink);
  color: #fff;
}

.map-toolbar strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
}

.map-toolbar span {
  max-width: 84px;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.72;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-zoom-actions {
  position: absolute;
  left: 24px;
  top: 78px;
  z-index: 7;
  display: grid;
  gap: 6px;
}

.map-zoom-actions button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 900;
}

.map-filter-bar {
  position: absolute;
  left: 66px;
  right: 264px;
  top: 78px;
  z-index: 6;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.map-filter-bar.collapsed {
  gap: 0;
  padding: 9px 12px;
}

.map-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.map-filter-head > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-filter-head strong {
  font-size: 13px;
}

.map-filter-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.map-filter-head .ghost {
  padding: 6px 10px;
}

.map-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
}

.map-filter-bar .quick-filters {
  padding: 0;
  border: 0;
}

.map-filter-bar .quick-filters.compact {
  gap: 7px;
}

.map-filter-bar .filter {
  padding: 7px 10px;
}

.map-brand-filter {
  display: grid;
  gap: 4px;
}

.map-brand-filter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-brand-filter select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.map-drawer {
  animation: mapDrawerIn 150ms ease-out;
}

@keyframes mapDrawerIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-search-card {
  position: absolute;
  left: 24px;
  top: 164px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 318px;
  max-height: calc(100vh - 178px);
  border-radius: 8px;
  overflow: hidden;
}

.map-filter-bar.collapsed ~ .map-search-card,
.map-filter-bar.collapsed ~ .map-locator-card,
.map-filter-bar.collapsed ~ .map-detail {
  top: 132px;
}

.map-locator-card {
  position: absolute;
  left: 24px;
  top: 164px;
  z-index: 6;
  width: 340px;
  border-radius: 8px;
  padding: 12px;
}

.locator-title {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.locator-title strong {
  font-size: 15px;
}

.locator-title span,
.locator-message,
.form-location-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.locator-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.locator-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
}

.locator-search button,
.locator-results article > button:last-child,
.location-tools button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 10px 12px;
}

.locator-search .secondary,
.location-tools .secondary {
  background: var(--blue);
}

.locator-search .ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.locator-message {
  margin-top: 8px;
}

.locator-results {
  display: grid;
  gap: 8px;
  max-height: 168px;
  overflow: auto;
  margin-top: 10px;
}

.locator-results article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #edf2f4;
  padding-top: 8px;
}

.locator-results article > button:first-child {
  min-width: 0;
  background: transparent;
  text-align: left;
}

.locator-results strong,
.locator-results span {
  display: block;
}

.locator-results strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
}

.locator-results span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.search-box input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.extracted input,
.extracted select,
.extracted textarea,
.input-panel textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.search-box input {
  padding: 10px 11px;
}

.search-box button {
  padding: 0 10px;
}

.quick-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.map-scope-note {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f5fbf8;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.filter {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.filter.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.site-list {
  overflow: auto;
}

.site-list.compact {
  max-height: calc(100vh - 300px);
}

.site-list-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border-bottom: 1px solid #edf2f4;
  background: #fff;
  text-align: left;
}

.site-list-item:hover,
.site-list-item.active {
  background: #eff8f4;
}

.site-list-item i {
  align-self: start;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--color);
}

.site-list-item strong,
.site-name-cell strong {
  display: block;
  color: var(--ink);
  line-height: 1.35;
}

.site-list-item strong {
  font-size: 14px;
}

.site-list-item em,
.site-name-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.map-detail {
  position: absolute;
  right: 24px;
  top: 78px;
  bottom: 24px;
  z-index: 5;
  width: 370px;
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
}

.route-floating {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(620px, calc(100% - 48px));
  border-radius: 8px;
  background: rgba(23, 32, 42, 0.92);
  color: #fff;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.map-legend {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(420px, calc(100% - 520px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 9px 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-floating div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.route-floating .route-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.route-floating strong {
  font-size: 14px;
}

.route-floating span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-floating button {
  flex: 0 0 auto;
  padding: 8px 11px;
}

.route-floating .secondary {
  background: var(--blue);
}

.site-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.site-head h2 {
  margin-top: 9px;
  font-size: 22px;
  line-height: 1.3;
}

.site-head p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color) 13%, white);
  color: var(--color);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.intent-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #eef4f7;
  color: var(--blue);
  font-size: 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.metrics div {
  min-width: 0;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.metrics strong {
  display: block;
  font-size: 25px;
  line-height: 1;
}

.metrics span,
.info-list dt,
.eyebrow,
.empty {
  color: var(--muted);
}

.metrics span,
.info-list dt {
  font-size: 12px;
}

.info-list {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.info-list dd {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.actions button {
  padding: 10px 13px;
}

.actions .secondary,
.secondary {
  background: var(--blue);
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
}

.danger {
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  padding: 10px 13px;
}

.visit-history {
  margin-top: 24px;
}

.visit-history h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.visit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.visit-item p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.visit-item span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.page-title,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  margin-bottom: 18px;
}

.page-title h1 {
  margin-top: 4px;
  font-size: 30px;
}

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

.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.section-tabs button {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
}

.section-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.section-tabs strong {
  color: inherit;
  font-size: 14px;
}

.section-tabs span {
  color: inherit;
  font-size: 12px;
  opacity: 0.72;
}

.eyebrow {
  font-size: 13px;
  font-weight: 800;
}

.summary-strip,
.dashboard-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-strip div,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 17px;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.07);
}

.summary-strip strong,
.stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.summary-strip span,
.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.two-column,
.assistant-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.panel-title {
  margin-bottom: 14px;
}

.panel-title h2,
.settings-panel h2 {
  font-size: 19px;
}

.panel-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.route-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.route-plan-panel,
.route-choice-panel {
  min-width: 0;
}

.route-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.route-panel-actions button {
  border-radius: 8px;
  font-weight: 800;
  padding: 8px 10px;
}

.route-panel-actions .secondary {
  color: #fff;
}

.route-plan-note {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid #cfe5dc;
  border-radius: 8px;
  background: #f3fbf7;
  padding: 10px 12px;
}

.route-plan-note.warn {
  border-color: rgba(217, 146, 18, 0.32);
  background: #fff8ed;
}

.route-plan-note strong {
  font-size: 13px;
}

.route-plan-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.route-guide {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(37, 111, 216, 0.22);
  border-radius: 8px;
  background: #f6f9ff;
  padding: 12px;
}

.route-guide-head,
.route-guide-main,
.route-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-guide-head strong,
.route-guide-main strong {
  display: block;
}

.route-guide-head span,
.route-guide-main span,
.route-guide-main em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.route-guide-main strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.35;
}

.route-guide-actions,
.route-guide-footer,
.route-guide-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-guide-actions .ghost,
.route-guide-footer button {
  border-radius: 8px;
  font-weight: 800;
  padding: 8px 10px;
}

.route-guide-actions .ghost:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.route-guide-metrics {
  flex: 0 0 auto;
}

.route-guide-metrics span {
  min-width: 86px;
  border: 1px solid rgba(37, 111, 216, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.route-guide-metrics b {
  display: block;
  color: var(--blue);
  font-size: 16px;
  line-height: 1.2;
}

.route-guide-roads {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.route-guide-roads span {
  border: 1px solid rgba(37, 111, 216, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #405364;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.route-guide-footer .secondary {
  color: #fff;
}

.route-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.route-list li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.route-list li > button:not(.icon-button) {
  min-width: 0;
  background: transparent;
  text-align: left;
}

.route-list strong,
.candidate-list strong {
  display: block;
}

.route-list em,
.candidate-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.route-list small {
  display: block;
  margin-top: 5px;
  color: #56616c;
  font-size: 12px;
  line-height: 1.45;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0;
  font-size: 20px;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.route-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.route-item-actions button:not(.icon-button) {
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  padding: 8px 10px;
}

.route-item-actions .ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.candidate-list {
  display: grid;
  gap: 10px;
}

.candidate-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf2f4;
  padding: 0 0 11px;
}

.candidate-list button {
  padding: 9px 12px;
}

.route-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.route-presets button {
  min-height: 40px;
  padding: 9px 10px;
}

.route-presets button:nth-child(2) {
  background: var(--blue);
}

.route-presets button:nth-child(3) {
  background: #d99212;
}

.route-presets button:nth-child(4) {
  background: var(--ink);
}

.route-candidate-groups {
  display: grid;
  gap: 14px;
}

.route-candidate-group {
  border-top: 1px solid #edf2f4;
  padding-top: 12px;
}

.route-candidate-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.route-candidate-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.route-candidate-title strong {
  display: block;
  font-size: 14px;
}

.route-candidate-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.route-candidate-title .ghost {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.compact-candidates {
  gap: 8px;
}

.compact-candidates article {
  gap: 10px;
  padding-bottom: 9px;
}

.candidate-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.candidate-actions .ghost {
  color: var(--ink);
}

.site-table {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.site-table-head,
.site-table article {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) 110px 96px 120px 72px;
  align-items: center;
  gap: 12px;
  min-width: 760px;
  padding: 12px 4px;
}

.site-table {
  overflow-x: auto;
}

.site-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-table article {
  border-top: 1px solid #edf2f4;
}

.site-table article.active {
  background: #f1f8f5;
}

.site-name-cell {
  min-width: 0;
  background: transparent;
  text-align: left;
}

.assistant-grid {
  align-items: start;
}

.input-panel textarea {
  min-height: 330px;
  resize: vertical;
  padding: 14px;
  line-height: 1.7;
}

.input-panel .actions {
  margin-top: 12px;
}

.extracted {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.extracted label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.extracted input,
.extracted select,
.extracted textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 10px 11px;
}

.extracted textarea,
.form-grid textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

.wide {
  grid-column: 1 / -1;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-page {
  width: min(1260px, calc(100% - 32px));
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-hero > div:first-child {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.dashboard-hero > div:first-child span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-hero > div:first-child strong {
  font-size: 28px;
  line-height: 1.25;
}

.dashboard-hero > div:first-child p {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.boss-metric {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.07);
  padding: 17px;
}

.boss-metric span,
.boss-metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.boss-metric strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.boss-metric.strong {
  border-color: rgba(21, 154, 114, 0.3);
}

.boss-metric.strong strong,
.boss-metric.blue strong {
  color: var(--blue);
}

.boss-metric.danger strong {
  color: var(--danger);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.boss-panel {
  min-width: 0;
}

.boss-action-list,
.opportunity-list,
.risk-list,
.funnel-list {
  display: grid;
  gap: 10px;
}

.boss-action-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 12px;
}

.boss-action-list article.danger {
  border-color: rgba(200, 70, 58, 0.26);
  background: #fff3f1;
}

.boss-action-list article.blue {
  border-color: rgba(37, 111, 216, 0.26);
  background: #f1f6ff;
}

.boss-action-list article.ok {
  border-color: rgba(21, 154, 114, 0.24);
  background: #f2fbf7;
}

.boss-action-list strong,
.opportunity-list strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-action-list span,
.opportunity-list em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.boss-action-list button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 8px 10px;
}

.opportunity-list article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf2f4;
  padding: 0 0 11px;
}

.opportunity-list article > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef4f7;
  color: var(--blue);
  font-weight: 900;
}

.opportunity-list button {
  min-width: 0;
  background: transparent;
  text-align: left;
}

.opportunity-list b {
  color: var(--accent-dark);
  white-space: nowrap;
}

.risk-list article {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 12px;
}

.risk-list article.danger {
  border-color: rgba(200, 70, 58, 0.26);
  background: #fff3f1;
}

.risk-list article.warn {
  border-color: rgba(217, 146, 18, 0.28);
  background: #fff8ed;
}

.risk-list article.ok {
  border-color: rgba(21, 154, 114, 0.22);
  background: #f2fbf7;
}

.risk-list strong,
.risk-list span {
  display: block;
}

.risk-list strong {
  font-size: 27px;
  line-height: 1;
}

.risk-list span,
.risk-list p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.funnel-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.funnel-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.funnel-list i {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: var(--color);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.08);
}

.funnel-list b {
  text-align: right;
}

.dashboard-bottom {
  align-items: start;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.5fr);
  gap: 16px;
  margin-bottom: 16px;
}

.command-brief {
  display: grid;
  gap: 12px;
  align-content: center;
  min-width: 0;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.command-brief > span,
.command-brief p {
  color: rgba(255, 255, 255, 0.72);
}

.command-brief > span {
  font-size: 13px;
  font-weight: 900;
}

.command-brief strong {
  font-size: 30px;
  line-height: 1.25;
}

.command-brief p {
  line-height: 1.6;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.command-actions button,
.owner-task-list button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 9px 12px;
}

.command-actions .secondary {
  background: var(--blue);
}

.command-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.command-metric {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.07);
  padding: 17px;
}

.command-metric span,
.command-metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.command-metric strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.command-metric.blue strong {
  color: var(--blue);
}

.command-metric.green strong {
  color: var(--accent-dark);
}

.command-metric.warn strong {
  color: #a26000;
}

.command-metric.danger strong {
  color: var(--danger);
}

.owner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
}

.owner-panel {
  min-width: 0;
}

.owner-task-list,
.forecast-rows,
.opportunity-board-list,
.bottleneck-grid,
.market-row-list {
  display: grid;
  gap: 10px;
}

.owner-task-list article {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.owner-task-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.owner-task-list strong,
.opportunity-board-list strong,
.market-row-list strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-task-list span,
.opportunity-board-list em,
.market-row-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.owner-task-list article.danger,
.bottleneck-grid article.danger {
  border-color: rgba(200, 70, 58, 0.26);
  background: #fff3f1;
}

.owner-task-list article.warn,
.bottleneck-grid article.warn {
  border-color: rgba(217, 146, 18, 0.28);
  background: #fff8ed;
}

.owner-task-list article.blue,
.bottleneck-grid article.normal {
  border-color: rgba(37, 111, 216, 0.25);
  background: #f1f6ff;
}

.owner-task-list article.green,
.bottleneck-grid article.green {
  border-color: rgba(21, 154, 114, 0.22);
  background: #f2fbf7;
}

.forecast-card {
  display: grid;
  align-content: start;
}

.forecast-total {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  border: 1px solid rgba(37, 111, 216, 0.18);
  border-radius: 8px;
  background: #f1f6ff;
  padding: 14px;
}

.forecast-total span,
.forecast-total p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.forecast-total strong {
  color: var(--blue);
  font-size: 42px;
  line-height: 1;
}

.forecast-total em {
  margin-left: 3px;
  font-size: 16px;
  font-style: normal;
}

.forecast-rows article {
  display: grid;
  grid-template-columns: minmax(132px, 0.9fr) minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
}

.forecast-rows i,
.market-row-list i {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: var(--color, var(--accent));
}

.forecast-rows b,
.market-row-list b {
  text-align: right;
  white-space: nowrap;
}

.opportunity-board {
  grid-row: span 2;
}

.opportunity-board-list article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf2f4;
  padding-bottom: 10px;
}

.opportunity-board-list article > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef4f7;
  color: var(--blue);
  font-weight: 900;
}

.opportunity-board-list button {
  min-width: 0;
  background: transparent;
  text-align: left;
}

.opportunity-board-list div:last-child {
  display: grid;
  justify-items: end;
}

.opportunity-board-list b {
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1;
}

.opportunity-board-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.bottleneck-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.bottleneck-grid article {
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.bottleneck-grid strong,
.bottleneck-grid span,
.bottleneck-grid p {
  display: block;
}

.bottleneck-grid strong {
  font-size: 28px;
  line-height: 1;
}

.bottleneck-grid span {
  margin-top: 7px;
  font-weight: 900;
}

.bottleneck-grid p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-market {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 16px;
}

.market-row-list article {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
}

.discipline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.discipline-grid article {
  position: relative;
  min-width: 0;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.discipline-grid strong,
.discipline-grid span,
.discipline-grid em {
  display: block;
}

.discipline-grid strong {
  font-size: 27px;
  line-height: 1;
}

.discipline-grid span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.discipline-grid em {
  position: absolute;
  right: 10px;
  top: 10px;
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
}

.bar-row span {
  color: var(--muted);
  font-size: 13px;
}

.bar-row i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.bar-row b {
  text-align: right;
}

.settings-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.settings-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(15, 24, 32, 0.36);
  padding: 20px;
}

.modal {
  width: min(760px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border-radius: 8px;
  padding: 20px;
}

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

.modal-head h2 {
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.location-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.location-tools strong,
.location-tools span {
  display: block;
}

.location-tools strong {
  color: var(--ink);
}

.form-location-message {
  min-height: 18px;
  padding: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.modal-actions div {
  display: flex;
  gap: 10px;
}

.empty {
  padding: 16px;
  line-height: 1.6;
}

.app-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 132px;
}

.app-user span {
  max-width: 86px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user .role-badge {
  max-width: none;
  border: 1px solid rgba(37, 111, 216, 0.18);
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  padding: 5px 9px;
  font-size: 12px;
}

.role-notice {
  border: 1px solid rgba(217, 146, 18, 0.28);
  border-radius: 8px;
  background: #fff8ed;
  color: #865d12;
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(21, 154, 114, 0.16), rgba(37, 111, 216, 0.12)),
    var(--bg);
  padding: 20px;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  min-width: 0;
}

.login-card h1 {
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.6;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.form-error {
  border: 1px solid rgba(200, 70, 58, 0.28);
  border-radius: 8px;
  background: rgba(200, 70, 58, 0.08);
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 800;
}

.followup-grid,
.asset-grid,
.discovery-list {
  display: grid;
  gap: 16px;
}

.followup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-grid {
  grid-template-columns: minmax(0, 1fr);
}

.discovery-panel {
  margin-bottom: 16px;
}

.discovery-form {
  display: grid;
  grid-template-columns: 120px 160px 180px minmax(180px, 1fr) 110px;
  gap: 10px;
}

.discovery-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.discovery-form input,
.discovery-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
}

.discovery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.discovery-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.discovery-actions div {
  display: flex;
  gap: 10px;
}

.discovery-actions button:disabled,
.page-title button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.discovery-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.07);
  padding: 14px;
}

.discovery-item.imported {
  background: #f6f8f9;
  opacity: 0.72;
}

.discovery-item label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discovery-item strong,
.discovery-item span,
.discovery-item p {
  display: block;
}

.discovery-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-item span,
.discovery-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.discovery-item b {
  color: var(--blue);
  font-size: 12px;
}

.followup-panel,
.asset-panel {
  min-width: 0;
}

.danger-list {
  border-color: rgba(200, 70, 58, 0.28);
}

.work-list,
.ops-table,
.backup-list {
  display: grid;
  gap: 10px;
}

.work-list article,
.ops-table article,
.backup-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8eef1;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.ops-table article {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.work-list strong,
.ops-table strong,
.backup-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-list span,
.ops-table span,
.backup-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button,
.ops-table button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 8px 10px;
}

.row-actions .secondary {
  background: var(--blue);
}

.row-actions .ghost,
.ops-table .ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.compact-form input,
.compact-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
}

.compact-form button {
  min-height: 40px;
}

.mini-badge {
  border-radius: 999px;
  background: #eef4f7;
  color: var(--blue);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.warn-row {
  border-color: rgba(217, 146, 18, 0.36) !important;
  background: #fff8ed !important;
}

.user-admin-panel {
  margin-top: 16px;
}

@media (max-width: 1060px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .app-header > .primary-action {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .app-user {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  :root {
    --header: 112px;
  }

  .map-grid {
    inset: 98px 24px 300px 350px;
  }

  .map-detail {
    left: auto;
    right: 24px;
    top: 78px;
    bottom: 78px;
    width: min(370px, calc(100% - 48px));
    max-height: none;
  }

  .route-floating {
    left: 24px;
    right: 24px;
    bottom: 20px;
    max-width: none;
  }

  .map-legend {
    right: 24px;
    bottom: 112px;
    max-width: min(420px, calc(100% - 48px));
  }

  .route-builder {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
    overflow-x: hidden;
    width: 100%;
  }

  .app-shell,
  .app-main,
  .map-shell,
  .map-panel {
    max-width: 100vw;
    width: 100%;
  }

  .app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    overflow-x: hidden;
  }

  .brand {
    flex: 1 1 auto;
  }

  .app-header > .primary-action {
    display: none;
  }

  .app-user {
    flex: 0 0 auto;
    min-width: 0;
  }

  .app-user span {
    display: none;
  }

  .app-nav {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
  }

  .app-main,
  .app-main.map-mode {
    height: auto;
    min-height: calc(100vh - var(--header));
    overflow: visible;
  }

  .app-header {
    position: sticky;
    padding: 10px 12px;
  }

  .brand span {
    display: none;
  }

  .primary-action {
    padding: 9px 11px;
  }

  .map-shell {
    height: auto;
    min-height: 920px;
  }

  .map-panel {
    position: relative;
    min-height: 920px;
  }

  .map-title {
    left: 58px;
    right: 14px;
    top: 14px;
  }

  .map-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-filter-bar {
    left: 14px;
    right: 14px;
    top: 112px;
    gap: 8px;
    padding: 9px 10px;
  }

  .map-filter-head {
    align-items: start;
  }

  .map-filter-actions {
    align-items: center;
  }

  .map-filter-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-filter-bar.collapsed ~ .map-zoom-actions {
    top: 166px;
  }

  .map-filter-bar.collapsed ~ .map-search-card,
  .map-filter-bar.collapsed ~ .map-locator-card,
  .map-filter-bar.collapsed ~ .map-detail {
    top: 214px;
  }

  .map-toolbar {
    left: 14px;
    right: auto;
    top: 62px;
    width: min(318px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    justify-content: stretch;
    overflow: hidden;
    gap: 4px;
    padding: 5px;
  }

  .map-toolbar button {
    flex: 1 1 0;
    min-width: 0;
    justify-items: center;
    padding: 9px 8px;
    text-align: center;
  }

  .map-toolbar span {
    display: none;
  }

  .map-zoom-actions {
    left: auto;
    right: 14px;
    top: 204px;
  }

  .map-zoom-actions button {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .map-search-card {
    left: 14px;
    right: auto;
    top: 252px;
    width: min(340px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    max-height: 330px;
  }

  .map-locator-card {
    left: 14px;
    right: auto;
    top: 252px;
    width: min(340px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  .locator-results {
    max-height: 120px;
  }

  .search-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-box button {
    display: none;
  }

  .site-list.compact {
    max-height: 190px;
  }

  .map-grid {
    inset: 500px 16px 286px;
  }

  .map-point {
    min-width: 60px;
    height: 38px;
    padding: 0 8px;
  }

  .map-point span {
    max-width: 64px;
    font-size: 12px;
  }

  .route-floating {
    left: 14px;
    right: auto;
    bottom: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(340px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  .route-floating .route-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .route-floating button {
    width: 100%;
  }

  .map-legend {
    left: 14px;
    right: auto;
    bottom: 176px;
    justify-content: flex-start;
    width: min(340px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    max-height: 68px;
    overflow: auto;
  }

  .map-detail {
    left: 14px;
    right: auto;
    top: 252px;
    bottom: auto;
    width: min(340px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    max-height: 430px;
    padding: 14px;
  }

  .map-detail .metrics,
  .map-detail .info-list,
  .map-detail .visit-history {
    display: none;
  }

  .site-head {
    padding-bottom: 12px;
  }

  .site-head h2 {
    font-size: 18px;
  }

  .page {
    width: calc(100% - 24px);
    padding: 18px 0 30px;
  }

  .page-title,
  .panel-title,
  .site-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .page-title h1 {
    font-size: 25px;
  }

  .summary-strip,
  .dashboard-grid,
  .dashboard-hero,
  .hero-metrics,
  .dashboard-layout,
  .command-strip,
  .command-metrics,
  .owner-grid,
  .dashboard-market,
  .route-builder,
  .two-column,
  .assistant-grid,
  .followup-grid,
  .discovery-form,
  .form-grid,
  .extracted {
    grid-template-columns: 1fr;
  }

  .dashboard-page {
    width: calc(100% - 24px);
  }

  .dashboard-hero > div:first-child {
    padding: 18px;
  }

  .dashboard-hero > div:first-child strong {
    font-size: 22px;
  }

  .command-brief {
    padding: 18px;
  }

  .command-brief strong {
    font-size: 22px;
  }

  .owner-task-list article,
  .forecast-rows article,
  .opportunity-board-list article,
  .market-row-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .owner-task-list button,
  .command-actions button {
    width: 100%;
  }

  .bottleneck-grid,
  .discipline-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-board-list div:last-child {
    justify-items: start;
  }

  .boss-action-list article,
  .risk-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .boss-action-list button {
    width: 100%;
  }

  .opportunity-list article {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .opportunity-list b {
    grid-column: 2;
  }

  .discovery-actions,
  .discovery-actions div {
    align-items: stretch;
    flex-direction: column;
  }

  .discovery-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .discovery-item b {
    grid-column: 2;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  .work-list article,
  .ops-table article,
  .backup-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button,
  .ops-table button {
    width: 100%;
  }

  .wide {
    grid-column: auto;
  }

  .panel {
    padding: 14px;
  }

  .route-list li {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .route-item-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .route-guide-head,
  .route-guide-main,
  .route-guide-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .route-guide-actions,
  .route-guide-footer,
  .route-guide-metrics {
    width: 100%;
  }

  .route-guide-actions button,
  .route-guide-footer button,
  .route-guide-metrics span {
    flex: 1 1 auto;
  }

  .route-item-actions button:not(.icon-button) {
    flex: 1 1 auto;
  }

  .candidate-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-panel-actions,
  .candidate-actions {
    justify-content: stretch;
    width: 100%;
  }

  .route-panel-actions button,
  .candidate-actions button {
    flex: 1 1 auto;
  }

  .input-panel textarea {
    min-height: 260px;
  }

  .modal-backdrop {
    align-items: start;
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .location-tools {
    grid-template-columns: 1fr;
  }
}
