/* v8: content-sized Arabic controls, no fixed-height text boxes. */
:root {
  --ui-line: 1.55;
  --ui-panel: #101813ed;
  --ui-stroke: #dce7d51a;
}
body {
  line-height: var(--ui-line);
}
button {
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
button {
  white-space: normal;
}
button .icon {
  flex-shrink: 0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #e1bd7b;
  outline-offset: 3px;
}
.brand,
.brand svg,
.brand img {
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transform: none !important;
  background: transparent !important;
}
.brand {
  width: 242px;
  min-width: 242px;
  height: 58px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand .authority-lockup {
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  image-rendering: auto;
}
.dashboard {
  width: min(980px, calc(100vw - 176px));
  max-width: 980px;
}
.dash-head {
  min-height: 24px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3px 12px;
  line-height: 1.5;
  border-radius: 9px 9px 0 0;
  margin-inline: auto;
}
.dash-head > span,
.dash-head small {
  font-size: 10px;
  line-height: 1.5;
}
.dash-head small {
  white-space: normal;
}
#dashboardMetrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}
.metric {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 82px;
  height: auto;
  padding: 9px 8px !important;
  overflow: hidden;
  text-align: center !important;
  border-radius: 14px;
}
.metric .metric-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.metric .metric-label .icon {
  width: 14px;
  height: 14px;
  display: block;
}
.metric strong {
  display: block;
  width: 100%;
  font-size: 22px;
  line-height: 1.3;
  min-height: 29px;
  margin: 0 !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric small {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 10px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: center;
}
.sidebar,
.work-panel,
.detail {
  top: 190px;
  max-height: calc(100vh - 258px);
}
.analysis-board {
  top: 190px;
  max-height: calc(100vh - 258px);
}
.app-rail,
.map-tools {
  top: 190px;
}
.panel-head > div {
  min-width: 0;
}
.panel-head h2 {
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin: 0;
}
.panel-head small {
  display: block;
  line-height: 1.6;
}
.layer-family > summary {
  min-height: 44px;
}
.layer-family > summary b,
.layer-detail summary > div {
  min-width: 0;
  flex: 1;
}
.layer-detail summary b {
  line-height: 1.55;
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}
.layer-detail summary small {
  line-height: 1.5;
  display: block;
}
.layer-detail > summary {
  align-items: center;
  height: auto;
  min-height: 58px;
}
.layer-locate,
.layer-glyph,
.switch {
  flex-shrink: 0;
}
.btn {
  height: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  line-height: 1.55;
  padding: 7px 12px;
}
.stat-bar {
  line-height: 1.5;
}
.donut-wrap {
  flex-wrap: wrap;
  justify-content: center;
}
.donut-wrap ul {
  min-width: 130px;
}
.land-metrics strong {
  line-height: 1.45;
}
.land-metrics small {
  line-height: 1.6;
}
.source-badge {
  height: auto;
  line-height: 1.5;
  max-width: 100%;
  text-align: center;
}
.data-pairs dd,
.attribute dd {
  overflow-wrap: anywhere;
  min-width: 0;
}
.basemap-dock {
  display: flex !important;
  align-items: center;
  gap: 7px;
  width: auto !important;
  min-width: 0;
  max-width: 210px !important;
  padding: 7px !important;
  border-radius: 16px !important;
  left: 50%;
  right: auto;
  bottom: 58px;
  transform: translateX(-50%);
  background: #111a15dc;
}
.basemap-dock .base-btn {
  box-sizing: border-box;
  display: grid !important;
  grid-template-rows: 45px auto;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 6px !important;
  min-width: 0;
  width: 78px !important;
  min-height: 76px;
  height: auto;
  border-radius: 11px !important;
  background: #18251e;
  border: 1px solid #d6e1cf26;
  color: #dfe5d9;
  font-size: 10px;
  text-align: center;
  line-height: 1.5;
}
.base-btn .base-thumb {
  display: block;
  width: 62px !important;
  height: 45px !important;
  margin: 0 !important;
  border-radius: 6px;
  border: 1px solid #ffffff18;
  background-size: cover;
  background-position: center;
}
.base-btn.active {
  border-color: #dbb975 !important;
  box-shadow: 0 0 0 1px #dbb975;
  background: #243228 !important;
  color: #f0d29b !important;
}
.basemap-dock .drag-handle,
.basemap-dock > .drag-glyph {
  font-size: 0;
  width: 10px;
  min-width: 10px;
  cursor: move;
}
.basemap-dock .drag-handle .icon {
  width: 12px;
  height: 18px;
}
.base-btn > span {
  display: block;
  max-width: 100%;
  line-height: 1.5;
}
.imagery-health {
  position: fixed;
  bottom: 146px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 705;
  background: #111a15e8;
  border: 1px solid #d6e1cf26;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 11px;
  max-width: 360px;
  display: flex;
  gap: 9px;
  align-items: center;
  text-align: center;
  line-height: 1.7;
}
.imagery-health[hidden] {
  display: none;
}
.imagery-health button {
  background: #d9b36a;
  color: #172219;
  border-radius: 7px;
  padding: 3px 10px;
  flex: none;
}
/* Analytical workspace */
.analysis-board[data-kind="analytics"] {
  background: #101813ef;
  left: 88px;
  right: 88px;
  bottom: 65px;
}
.analytics-top {
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.analytics-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 4px 0;
}
.analytics-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #abb7a6;
  font-size: 12px;
}
.analytics-tabs button.active {
  color: #e5c486;
  background: #d9b36a16;
  border-color: #d9b36a40;
}
.analytics-tabs .icon {
  width: 16px;
  height: 16px;
}
.analytics-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.analytics-controls select {
  border: 1px solid #ffffff20;
  background: #1e2a22;
  color: #e8eee4;
  border-radius: 9px;
  padding: 7px 9px;
  max-width: 150px;
  font-size: 11px;
}
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px;
}
.analytic-kpi {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: 89px;
  padding: 10px;
  gap: 4px;
  background: linear-gradient(145deg, #1f3024, #17241c);
  border: 1px solid #c3d6b71a;
  border-radius: 13px;
  min-width: 0;
}
.analytic-kpi > span {
  font-size: 11px;
  color: #bdc9b6;
  line-height: 1.6;
}
.analytic-kpi strong {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
  color: #f0d4a1;
  white-space: nowrap;
}
.analytic-kpi small {
  font-size: 10px;
  line-height: 1.5;
  color: #8ea285;
}
.analytic-kpi .icon {
  width: 14px;
  height: 14px;
  margin-inline-end: 5px;
}
.analytics-content {
  padding: 0 20px 20px;
}
.analytic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  gap: 12px;
}
.analytic-card {
  padding: 17px;
  background: #121e17;
  border: 1px solid #d0dfc51a;
  border-radius: 16px;
  min-width: 0;
  overflow: hidden;
}
.analytic-card.wide {
  grid-column: 1/-1;
}
.analytic-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 600;
  color: #e7eadd;
}
.analytic-card > p {
  font-size: 10px;
  line-height: 1.7;
  color: #91a38a;
  margin: 0 0 15px;
}
.analytic-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.analytic-bars {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}
.analytic-bar {
  display: grid;
  grid-template-columns: 70px minmax(30px, 1fr) 65px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 25px;
  padding: 2px 0;
  text-align: right;
  background: transparent;
}
.analytic-bar span,
.analytic-bar b {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.analytic-bar i {
  height: 10px;
  background: #ffffff06;
  border-radius: 4px;
  overflow: hidden;
  display: block;
}
.analytic-bar i:before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--bar-color, #c4a875);
  border-radius: 4px;
}
.analytic-bar b {
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.analytic-bar:hover {
  color: #f1d6a2;
}
.analytic-toolbar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.analytic-toolbar button {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid #c5d2bc26;
}
.analytic-toolbar button.active {
  background: #d9b36a25;
  color: #e4c187;
}
.analytic-reading {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 13px;
  background: #d9b36a0c;
  border: 1px solid #d9b36a20;
  border-radius: 12px;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.9;
}
.analytic-reading .icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: #d7b881;
}
.analytic-reading p {
  margin: 0;
}
.matrix-scroll {
  overflow: auto;
}
.analytic-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-top: 10px;
  table-layout: fixed;
  min-width: 540px;
}
.analytic-matrix th {
  font-weight: 400;
  color: #9cad92;
  font-size: 9px;
}
.analytic-matrix th,
.analytic-matrix td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid #ffffff0a;
}
.analytic-matrix th:first-child {
  width: 76px;
  text-align: right;
}
.analytic-matrix td button {
  width: 100%;
  height: auto;
  min-height: 23px;
  border-radius: 5px;
  font-size: 10px;
  color: #d6e6cb;
  background: color-mix(in srgb, #6b9b62 var(--heat), transparent);
}
.analytic-matrix .missing {
  color: #6d7d67;
  background: #ffffff03;
}
.analysis-tool-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.analysis-tool-card {
  border: 1px solid #c6d7ba24;
  border-radius: 14px;
  padding: 16px;
  text-align: right;
  background: #17241c;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.7;
}
.analysis-tool-card > .icon {
  width: 24px;
  height: 24px;
  color: #dbbb82;
}
.analysis-tool-card strong {
  font-size: 13px;
}
.analysis-tool-card small {
  font-size: 11px;
  color: #9faf95;
}
.analytic-source-note {
  font-size: 10px;
  line-height: 1.8;
  color: #8fa187;
  padding: 12px 0 0;
  border-top: 1px solid #ffffff12;
  margin-top: 15px;
}
.analytic-empty {
  text-align: center;
  padding: 40px 20px;
  line-height: 1.9;
  color: #9cad92;
}
.analytic-empty strong {
  color: #d3dec9;
  display: block;
}
.query-summary {
  padding: 12px 14px;
  background: #1c2b21;
  border-bottom: 1px solid #ffffff12;
  line-height: 1.8;
  font-size: 12px;
}
.query-scope {
  font-size: 10px;
  color: #d8bc82;
  margin-bottom: 8px;
  display: block;
}
.query-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
}
.query-metric {
  border: 1px solid #d1ddc325;
  border-radius: 11px;
  background: #17261c;
  padding: 10px;
  text-align: center;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.query-metric span {
  font-size: 11px;
  line-height: 1.6;
}
.query-metric b {
  font-size: 22px;
  line-height: 1.4;
  color: #e8ca8c;
}
.query-metric small {
  font-size: 9px;
  line-height: 1.5;
  color: #91a486;
}
.query-group-label {
  font-size: 10px;
  color: #cbbd99;
  padding: 8px 13px;
  background: #e3cb8c05;
  border-top: 1px solid #ffffff0d;
}
.query-examples {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 10px;
}
.query-examples button {
  font-size: 10px;
  line-height: 1.7;
  padding: 5px 8px;
  border: 1px solid #ffffff1c;
  border-radius: 8px;
  color: #bccbb3;
}
.query-result-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 9px;
  color: #859a7b;
}
.assistant-panel .search-item {
  background: transparent;
  width: 100%;
  border-bottom: 1px solid #ffffff0d;
  white-space: normal;
}
.assistant-panel .search-item b {
  font-size: 12px;
  line-height: 1.7;
}
.assistant-panel .search-item small {
  line-height: 1.7;
}
.assistant-panel .response-message {
  padding: 0 !important;
  overflow: hidden;
}
.assistant-panel .response-message > p {
  padding: 10px;
}
.assistant-panel .query-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.search-item {
  height: auto !important;
  min-height: 46px;
  padding: 10px 13px !important;
  line-height: 1.7;
  text-align: right;
  display: block;
  min-width: 0;
}
.search-item b,
.search-item small {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.query-comparison {
  overflow: auto;
  padding: 10px;
}
.query-comparison table {
  width: 100%;
  font-size: 10px;
  border-collapse: collapse;
  min-width: 300px;
}
.query-comparison th,
.query-comparison td {
  padding: 7px;
  border-bottom: 1px solid #ffffff13;
  text-align: center;
}
.query-comparison th {
  font-weight: 500;
  color: #d4bb85;
}
.query-comparison button {
  color: #d6dfce;
}
.query-notice {
  font-size: 10px;
  line-height: 1.9;
  color: #99aa90;
  padding: 10px 13px;
  margin: 0;
}
.field-label {
  line-height: 1.7;
}
.executive-card p,
.chart-card p {
  line-height: 1.8;
}
.topic-chips button {
  line-height: 1.7;
  height: auto;
}
@media (max-width: 1200px) {
  .dashboard {
    width: calc(100vw - 176px);
  }
  .brand {
    width: 220px;
    min-width: 220px;
  }
  .metric .metric-label {
    font-size: 10px;
  }
  .metric small {
    font-size: 9px;
  }
  .metric strong {
    font-size: 21px;
  }
  .analytics-tabs button {
    font-size: 11px;
    padding: 7px;
  }
  .analytic-grid {
    grid-template-columns: 1fr 1fr;
  }
  .analytics-controls {
    margin-inline-start: auto;
  }
}
@media (max-width: 900px) {
  .metric {
    padding: 8px 5px !important;
  }
  .metric .metric-label .icon {
    display: none;
  }
  .metric strong {
    font-size: 19px;
  }
  .analysis-board[data-kind="analytics"] {
    left: 18px;
  }
  .analytics-top {
    padding: 10px 12px 0;
  }
  .analytics-summary,
  .analytics-content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .analytic-grid {
    grid-template-columns: 1fr;
  }
  .analytic-card.wide {
    grid-column: auto;
  }
  .analytics-summary {
    gap: 7px;
  }
  .analytic-kpi {
    padding: 8px;
    min-height: 82px;
  }
  .analytic-kpi strong {
    font-size: 20px;
  }
  .analytic-kpi small {
    font-size: 9px;
  }
  .analysis-tool-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .brand {
    width: 158px;
    min-width: 158px;
    height: 42px;
  }
  .brand .authority-lockup {
    max-height: 42px;
  }
  .dashboard {
    width: auto;
    right: 12px;
    left: 12px;
  }
  .dash-head > span {
    font-size: 9px;
  }
  .dash-head small {
    display: none;
  }
  #dashboardMetrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .metric {
    min-height: 76px;
    height: auto !important;
    padding: 7px 5px !important;
    gap: 2px;
  }
  .metric strong {
    font-size: 20px;
    min-height: 26px;
  }
  .metric .metric-label {
    font-size: 9px;
    line-height: 1.5;
  }
  .metric small {
    font-size: 8px;
    line-height: 1.5;
  }
  .sidebar,
  .work-panel,
  .detail,
  .analysis-board,
  .analysis-board[data-kind="analytics"],
  .assistant-panel {
    top: 108px;
    max-height: calc(100vh - 180px);
  }
  .app-rail {
    top: 110px;
  }
  .map-tools {
    top: auto;
  }
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px;
  }
  .analytics-tabs {
    width: 100%;
    order: 2;
  }
  .analytics-controls {
    width: 100%;
    justify-content: space-between;
  }
  .analytics-controls select {
    max-width: 170px;
  }
  .analytics-controls .btn {
    font-size: 10px;
    padding: 5px 8px;
  }
  .analysis-board[data-kind="analytics"] {
    right: 62px;
    left: 10px;
  }
  .analysis-tool-cards {
    grid-template-columns: 1fr;
  }
  .analytic-card {
    padding: 13px;
  }
  .analytic-bar {
    grid-template-columns: 57px minmax(30px, 1fr) 60px;
    gap: 6px;
  }
  .analytic-bar span,
  .analytic-bar b {
    font-size: 10px;
  }
  .basemap-dock {
    bottom: 58px;
    gap: 6px;
    padding: 6px !important;
  }
  .basemap-dock .base-btn {
    width: 64px !important;
    grid-template-rows: 35px auto;
    min-height: 64px;
    font-size: 9px;
  }
  .base-btn .base-thumb {
    width: 50px !important;
    height: 35px !important;
  }
  .imagery-health {
    bottom: 135px;
    width: 75%;
    font-size: 10px;
  }
  .dash-head {
    gap: 7px;
  }
  .query-metric b {
    font-size: 19px;
  }
}
.base-btn .base-thumb:not(.osm) {
  background-image: url("assets/basemap-preview.jpg") !important;
  background-size: cover !important;
}
.query-scope > .icon {
  width: 13px;
  height: 13px;
  vertical-align: middle;
}
.analytic-kpi strong {
  font-family: "Manrope Variable", "IBM Plex Sans Arabic", sans-serif;
}
.analytic-source-note a {
  color: #d5be8b;
}

.imagery-health.preview-active {
  border-color: #6b9a6a70;
  font-size: 10px;
  max-width: 390px;
}
.imagery-health button:disabled {
  opacity: 0.6;
  cursor: progress;
}
