:root {
  --ink: #10243a;
  --muted: #5d7181;
  --line: #d5e4ed;
  --panel: rgba(255, 255, 255, 0.94);
  --soft: #f3f8fb;
  --teal: #0b8f8a;
  --teal-dark: #0b4f4a;
  --blue: #23a7e0;
  --cyan: #37c7f4;
  --deep: #10243a;
  --midnight: #081a2b;
  --amber: #b45309;
  --red: #b91c1c;
  --green: #15803d;
  --clay: #7f9181;
  --sand: #c2a76d;
  --app-width: 1230px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eef7fb;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

button:hover {
  border-color: rgba(35, 167, 224, 0.5);
  box-shadow: 0 8px 18px rgba(16, 36, 58, 0.08);
}

button.primary {
  background: var(--deep);
  border-color: rgba(35, 167, 224, 0.35);
  color: #fff;
  box-shadow: 0 10px 24px rgba(16, 36, 58, 0.2);
}

button.danger {
  border-color: #fecaca;
  color: var(--red);
  background: #fff5f5;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(35, 167, 224, 0.75);
  box-shadow: 0 0 0 3px rgba(35, 167, 224, 0.14);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--midnight);
}

.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(213, 228, 237, 0.88);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.login-panel h1,
.intro-band h2,
.project-strip h2 {
  margin: 0;
}

.login-panel p,
.intro-band p,
.project-strip p,
.panel-intro {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-tagline {
  margin: 0;
  font-weight: 700;
  color: #d7edf5 !important;
}

.project-strip p,
.panel-intro {
  max-width: 940px;
  font-size: 13px;
  line-height: 1.45;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px 0 0;
}

.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(150px, auto);
  align-items: center;
  gap: 16px;
  width: min(var(--app-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 18px;
  background: rgba(247, 252, 254, 0.86);
  border: 1px solid rgba(172, 215, 231, 0.72);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(16, 36, 58, 0.12);
  position: sticky;
  top: 12px;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  /* GEOBASE mark used in login, header, and footer. */
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  width: max-content;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  box-shadow: 0 10px 22px rgba(16, 36, 58, 0.18);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0;
  line-height: 1;
}

.brand-logo .brand-word {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.brand-logo .brand-geo {
  color: var(--blue);
}

.brand-logo sup {
  display: inline-block;
  margin-left: 2px;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  vertical-align: super;
  transform: translateY(-0.52em);
}

.login-brand {
  font-size: 34px;
  box-shadow: none;
}

.login-brand-field {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 18px 16px;
  border-radius: 8px;
  background: var(--deep);
  box-shadow: 0 18px 40px rgba(16, 36, 58, 0.16);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand h1 {
  font-size: 18px;
  margin: 0;
}

.brand small,
.userline {
  color: var(--muted);
  font-size: 13px;
}

.userline {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.userline strong {
  color: var(--ink);
}

.tabs {
  /* Top-level navigation; keep compact for tablet/mobile use. */
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: rgba(232, 245, 249, 0.92);
}

.tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 9px 14px;
  color: var(--muted);
}

.tabs button:hover {
  background: #fff;
  color: var(--ink);
}

.tabs button.active {
  color: #fff;
  background: var(--deep);
  box-shadow: 0 8px 18px rgba(16, 36, 58, 0.16);
}

.content {
  width: min(var(--app-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  gap: 16px;
}

.content-home {
  padding-bottom: 0;
}

.app-footer {
  width: min(var(--app-width), calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 auto;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(35, 167, 224, 0.24);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--deep);
  color: #d7edf5;
  font-size: 12px;
}

.footer-brand {
  font-size: 15px;
  padding: 7px 11px;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-footer > span:not(.brand-logo) {
  color: #d7edf5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  min-width: 0;
}

.workspace-page {
  /* Standard page width for non-map tabs such as Uploads, Review, and Admin. */
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
  align-content: start;
}

.workspace-page-wide {
  width: 100%;
}

.workspace-page > .panel {
  width: 100%;
}

.ai-page {
  grid-template-columns: 1fr;
}

.ai-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.ai-query-panel,
.ai-answer-panel,
.ai-sources-panel {
  min-width: 0;
}

.ai-query-panel,
.ai-answer-panel {
  height: 430px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #f8fcfe;
}

.ai-query-panel {
  align-self: start;
}

.ai-answer-panel {
  align-self: start;
}

.ai-query-panel::before,
.ai-answer-panel::before,
.ai-sources-panel::before {
  content: "";
  display: block;
  height: 3px;
  margin: -14px -14px 12px;
  background: #23a7e0;
}

.ai-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-panel-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--deep);
}

.ai-key-hint,
.ai-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(184, 217, 230, 0.95);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-status {
  color: #176d9d;
  background: #eef9fd;
}

.ai-query-form {
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto;
}

.ai-query-form textarea {
  min-height: 250px;
  height: 250px;
  resize: vertical;
  border-color: rgba(184, 217, 230, 0.95);
  background: #fff;
  line-height: 1.55;
}

.ai-query-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-query-actions small {
  color: var(--muted);
  font-size: 12px;
}

.ai-model {
  color: var(--muted);
  font-size: 13px;
}

.ai-answer {
  color: var(--ink);
  line-height: 1.6;
  white-space: normal;
  overflow: auto;
  flex: 1;
  padding: 12px;
  border: 1px solid rgba(184, 217, 230, 0.95);
  border-radius: 8px;
  background: #fff;
}

.ai-answer-panel > .empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(184, 217, 230, 0.95);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.upload-page {
  grid-template-columns: 1fr;
  align-items: start;
}

.upload-extract-panel {
  /* Upload instructions and file picker share one full-width field. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 16px;
  align-items: center;
}

.upload-inline-form {
  gap: 10px;
}

.upload-ingestion-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(180px, 1fr);
  gap: 10px;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-actions .panel-note {
  margin: 0;
  flex: 1 1 260px;
}

.review-page,
.admin-page,
.projects-page {
  grid-template-columns: 1fr;
}

.project-register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-register-panel,
.upload-project-group,
.project-register-item {
  min-width: 0;
}

.upload-project-group,
.project-register-item {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.upload-project-group summary,
.project-register-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.upload-project-group summary {
  position: relative;
}

.upload-project-group summary small,
.project-register-item summary small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.project-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  justify-content: center;
  white-space: nowrap;
  padding: 5px 8px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 6px;
  background: #fff;
  color: #10243a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.review-batch-title {
  align-items: flex-start;
  gap: 14px;
}

.review-batch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.review-batch-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.select-col {
  width: 64px;
  text-align: center;
}

.select-col input {
  width: auto;
  margin: 0 auto;
}

.batch-review-modal {
  width: min(820px, calc(100vw - 20px));
}

.batch-parameter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(35, 167, 224, 0.24);
  border-radius: 8px;
  background: #f6fbfd;
}

.batch-parameter-panel div {
  display: grid;
  gap: 2px;
}

.batch-parameter-panel strong {
  color: var(--ink);
}

.batch-parameter-panel span {
  color: var(--muted);
  font-size: 12px;
}

.batch-file-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfdfe;
}

.batch-file-list summary {
  cursor: pointer;
  font-weight: 800;
}

.batch-file-list summary span {
  color: var(--muted);
  margin-left: 6px;
}

.batch-file-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
}

.batch-file-list small {
  color: var(--muted);
}

.project-register-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.project-register-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.project-register-meta span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.project-register-meta strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.project-location-list {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.create-user-panel {
  width: min(980px, 100%);
  justify-self: center;
}

.panel,
.selector-panel,
.strat-panel,
.plot-panel,
.control-rail {
  background: var(--panel);
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 36, 58, 0.075);
  min-width: 0;
  backdrop-filter: blur(10px);
}

.panel,
.selector-panel,
.strat-panel,
.plot-panel,
.control-rail {
  padding: 14px;
}

.panel {
  overflow-x: auto;
}

.panel h2,
.selector-panel h3,
.strat-panel h3,
.plot-panel h3,
.control-rail h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--deep);
}

.span-4 { grid-column: span 4; min-width: 0; }
.span-8 { grid-column: span 8; min-width: 0; }
.span-12 { grid-column: span 12; min-width: 0; }

.row,
.summary-counters,
.legend,
.map-tools,
.mini-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stack {
  display: grid;
  gap: 12px;
}

.muted,
.empty {
  color: var(--muted);
}

.empty {
  margin: 0;
  font-size: 13px;
}

.notice {
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
}

.compact-notice {
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.25;
}

.error {
  color: var(--red);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: #176d9d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-heading {
  display: grid;
  gap: 4px;
}

.compact-heading {
  align-self: start;
  padding: 10px 12px;
}

.page-heading h2 {
  margin: 0;
  font-size: 22px;
}

.compact-heading h2 {
  font-size: 18px;
}

.page-heading p {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
}

.compact-heading p {
  max-width: 760px;
  font-size: 12px;
  line-height: 1.32;
}

.landing-layout {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 14px;
  align-content: start;
}

.intro-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  background: #f8fcfe;
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 36, 58, 0.075);
}

.summary-counters span,
.mini-stats span {
  min-width: 86px;
  padding: 8px 10px;
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  color: var(--muted);
  font-size: 13px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  color: var(--muted);
  box-shadow: 0 10px 24px rgba(16, 36, 58, 0.055);
}

.workflow-strip strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4f6fc;
  color: #176d9d;
  font-size: 12px;
}

.summary-counters strong,
.mini-stats strong {
  color: var(--ink);
}

.selector-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.home-map-grid {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, calc((100% - 14px) / 2)) minmax(0, calc((100% - 14px) / 2));
  gap: 14px;
  align-items: stretch;
  overflow: hidden;
}

.home-map-grid .map-stage,
.home-map-grid .world-map {
  aspect-ratio: 1 / 1;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
}

.home-map-grid > * {
  min-width: 0;
  max-width: 100%;
}

.home-project-stack {
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  aspect-ratio: 1 / 1;
  height: calc((min(var(--app-width), calc(100vw - 40px)) - 14px) / 2);
  max-height: calc((min(var(--app-width), calc(100vw - 40px)) - 14px) / 2);
  align-self: stretch;
}

.home-project-stack {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}

.home-project-stack .selector-panel {
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.project-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.panel-title-row,
.project-tile-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  margin-bottom: 4px;
  min-width: 0;
}

.panel-title-row h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title-row button,
.project-archive-action {
  white-space: nowrap;
}

.home-project-stack .panel-title-row button {
  max-width: 168px;
  padding-inline: 8px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-note,
.modal-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.project-tile-row {
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 6px;
  overflow: hidden;
}

.project-tile {
  min-width: 0;
  width: auto;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  text-align: left;
  background: #fbfcff;
}

.project-archive-action {
  width: 62px;
  min-width: 0;
  justify-self: end;
  padding-inline: 4px;
  font-size: 12px;
  border-color: rgba(153, 101, 57, 0.35);
  color: #7b4f2f;
  background: #fffaf4;
}

.project-tile.selected {
  border-color: rgba(35, 167, 224, 0.55);
  box-shadow: inset 3px 0 0 var(--blue);
}

.project-tile strong,
.project-tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-project-stack .project-tile strong {
  font-size: 14px;
}

.home-project-stack .project-tile small,
.home-project-stack .panel-note {
  font-size: 12px;
  line-height: 1.32;
}

.home-project-stack .project-tile .badge {
  padding: 4px 8px;
  font-size: 11px;
}

.project-tile > span {
  min-width: 0;
  max-width: 100%;
}

.project-tile .badge {
  flex: 0 0 auto;
}

.project-tile small {
  margin-top: 2px;
  color: var(--muted);
}








/* .map-stage {
  min-height: 420px;
}

.world-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f2;
  touch-action: none;
}

.leaflet-map {
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: absolute;
  z-index: 1;
  background: #ece8de;
}

.leaflet-container {
  font-family: Arial, Helvetica, sans-serif;
}

.leaflet-tile-pane {
  filter: grayscale(0.72) sepia(0.12) saturate(0.55) contrast(0.9);
}

.local-basemap {
  width: 100%;
  height: 100%;
}

.ocean-fill {
  fill: #d7edf3;
}

.graticule {
  stroke: rgba(11, 79, 74, 0.14);
  stroke-width: 0.22;
}

.land {
  fill: #d8dfd2;
  stroke: #98a99a;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}

.regional-land {
  fill: #d9ddcf;
}

.shelf {
  fill: rgba(8, 145, 178, 0.18);
  stroke: rgba(8, 145, 178, 0.55);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.bathymetry {
  fill: none;
  stroke: rgba(20, 83, 100, 0.42);
  stroke-width: 0.25;
  vector-effect: non-scaling-stroke;
}

.b500 {
  stroke-dasharray: 0.9 0.6;
}

.b1000 {
  stroke-dasharray: 1.6 0.8;
}

.coastline {
  fill: none;
  stroke: #506455;
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.map-label {
  fill: #0b4f4a;
  font-size: 0.045em;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.85);
  stroke-width: 0.01em;
}

.grid-label {
  fill: rgba(23, 32, 39, 0.56);
  font-size: 0.034em;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.7);
  stroke-width: 0.008em;
}

.leaflet-project-marker {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: transparent;
  box-shadow: 0 2px 10px rgba(23, 32, 39, 0.25);
  position: relative;
}

.leaflet-project-marker span {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
}

.leaflet-project-marker.active {
  background: #5f6f65;
}

.leaflet-project-marker.archived {
  background: #9b8563;
}

.leaflet-project-marker.selected {
  width: 22px;
  height: 22px;
  outline: 3px solid rgba(11, 79, 74, 0.24);
  background: var(--teal-dark);
}

.legend {
  position: absolute;
  right: 14px;
  top: 14px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  z-index: 3;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot.active {
  background: #5f6f65;
}

.dot.archived {
  background: #9b8563;
}

.dot.selected {
  background: var(--teal-dark);
  outline: 3px solid rgba(11, 79, 74, 0.22);
}

.area-symbol {
  display: inline-block;
  width: 13px;
  height: 10px;
  border: 1px solid #61bfe2;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.shelf-symbol {
  background: #b7e6f7;
}

.map-info {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(320px, calc(100% - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(23, 32, 39, 0.12);
  z-index: 3;
}

.map-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  background: #f8fafb;
  padding: 20px;
  text-align: center;
}

.map-info h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.map-info p {
  margin: 0 0 12px;
  color: var(--muted);
}

.map-info dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}

.map-info div {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
}

.map-info dt {
  color: var(--muted);
  font-size: 11px;
}

.map-info dd {
  margin: 2px 0 0;
  font-weight: 700;
  text-transform: capitalize;
} */





/* =========================
   MAP UI — ArcGIS STYLE
   ========================= */

.map-stage {
  min-height: 420px;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.055);
}

.world-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 231, 0.95);
  border-radius: 8px;
  background: #e5e5e5; /* neutral GIS background */
  touch-action: none;
}

/* Main map canvas */
.leaflet-map {
  inset: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1;
  background: #f2f2f2;
}

.engineering-coordinate-grid {
  position: absolute;
  inset: 0;
  z-index: 430;
  pointer-events: none;
}

.leaflet-container {
  font-family: Arial, Helvetica, sans-serif;
}

/* Subtle desaturation like ArcGIS Light Gray Canvas */
/* .leaflet-tile-pane {
  filter: grayscale(0.9) brightness(1.05) contrast(0.95);
} */
.leaflet-tile-pane {
  filter: grayscale(0.82) sepia(0.16) hue-rotate(158deg) saturate(0.76) brightness(1.08) contrast(0.9);
}

.leaflet-control-attribution {
  display: none !important;
}

.home-map-grid .map-stage,
.home-map-grid .world-map {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  height: auto;
}

.home-map-grid .leaflet-map {
  position: absolute;
}


/* =========================
   BASEMAP / VECTOR STYLING
   ========================= */

/* .ocean-fill {
  fill: #dde6ea;
} */

.ocean-fill {
  fill: #d6eef7; /* pale GIS blue */
}

.land {
  fill: #f3f3f3;
  stroke: #c7c7c7;
  stroke-width: 0.5;
}

.regional-land {
  fill: #ededed;
}

.coastline {
  fill: none;
  stroke: #a0a0a0;
  stroke-width: 0.4;
}

.graticule {
  stroke: rgba(0, 80, 115, 0.24);
  stroke-width: 0.42;
}

/* Continental shelf */
.shelf {
  fill: rgba(0, 120, 170, 0.08);
  stroke: rgba(0, 120, 170, 0.35);
  stroke-width: 0.3;
}

/* Bathymetry lines */
.bathymetry {
  fill: none;
  stroke: rgba(80, 80, 80, 0.25);
  stroke-width: 0.25;
}

.b500 {
  stroke-dasharray: 1 1;
}

.b1000 {
  stroke-dasharray: 2 1.5;
}

/* =========================
   LABELS (clean GIS style)
   ========================= */

.map-label {
  fill: #333;
  font-size: 0.045em;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.9);
  stroke-width: 0.01em;
}

.grid-label {
  fill: rgba(0, 42, 64, 0.82);
  font-size: 0.042em;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.92);
  stroke-width: 0.01em;
}

/* =========================
   PROJECT MARKERS
   ========================= */

.leaflet-project-marker {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
  position: relative;
}

.leaflet-project-marker::after {
  content: "";
  position: absolute;
  left: var(--leader-left, 50%);
  top: var(--leader-top, 50%);
  width: var(--leader-width, 1px);
  height: var(--leader-height, 18px);
  background: rgba(0, 42, 64, 0.34);
  transform: var(--leader-transform, translateX(-50%));
  transform-origin: 0 0;
  pointer-events: none;
  z-index: -1;
}

.leaflet-project-marker span {
  position: absolute;
  top: var(--label-top, 20px);
  left: var(--label-left, 50%);
  right: var(--label-right, auto);
  transform: var(--label-transform, translateX(-50%));
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  color: rgba(16, 36, 58, 0.82);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-shadow: 0 1px 2px rgba(255,255,255,0.95), 0 -1px 2px rgba(255,255,255,0.95);
  pointer-events: none;
}

.leaflet-project-marker.label-pos-0 {
  --label-top: 22px;
  --label-left: 50%;
  --label-transform: translateX(-50%);
  --leader-top: 16px;
  --leader-height: 9px;
}

.leaflet-project-marker.label-pos-1 {
  --label-top: -24px;
  --label-left: 50%;
  --label-transform: translateX(-50%);
  --leader-top: -10px;
  --leader-height: 12px;
}

.leaflet-project-marker.label-pos-2 {
  --label-top: 0;
  --label-left: 25px;
  --label-transform: translateY(-50%);
  --leader-left: 16px;
  --leader-top: 50%;
  --leader-width: 12px;
  --leader-height: 1px;
  --leader-transform: translateY(-50%);
}

.leaflet-project-marker.label-pos-3 {
  --label-top: 0;
  --label-left: auto;
  --label-right: 25px;
  --label-transform: translateY(-50%);
  --leader-left: -10px;
  --leader-top: 50%;
  --leader-width: 12px;
  --leader-height: 1px;
  --leader-transform: translateY(-50%);
}

.leaflet-project-marker.label-pos-4 {
  --label-top: 20px;
  --label-left: 24px;
  --label-transform: translate(0, 0);
  --leader-left: 16px;
  --leader-top: 16px;
  --leader-width: 15px;
  --leader-height: 1px;
  --leader-transform: rotate(45deg);
}

.leaflet-project-marker.label-pos-5 {
  --label-top: 20px;
  --label-left: auto;
  --label-right: 24px;
  --label-transform: translate(0, 0);
  --leader-left: 2px;
  --leader-top: 17px;
  --leader-width: 15px;
  --leader-height: 1px;
  --leader-transform: rotate(135deg);
}

.leaflet-project-marker.label-pos-6 {
  --label-top: -22px;
  --label-left: 24px;
  --label-transform: translate(0, 0);
  --leader-left: 16px;
  --leader-top: 2px;
  --leader-width: 15px;
  --leader-height: 1px;
  --leader-transform: rotate(-45deg);
}

.leaflet-project-marker.label-pos-7 {
  --label-top: -22px;
  --label-left: auto;
  --label-right: 24px;
  --label-transform: translate(0, 0);
  --leader-left: 2px;
  --leader-top: 2px;
  --leader-width: 15px;
  --leader-height: 1px;
  --leader-transform: rotate(-135deg);
}

/* Status colors (ArcGIS-like palette) */
.leaflet-project-marker.active {
  background: #4caf50;
}

.leaflet-project-marker.archived {
  background: #9e9e9e;
}

.leaflet-project-marker.selected {
  width: 20px;
  height: 20px;
  background: #0079c1;
  outline: 3px solid rgba(0,121,193,0.25);
}

/* =========================
   LEGEND (top-left ArcGIS style)
   ========================= */

.legend {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #d0d6db;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: #555;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);

  display: flex;
  align-items: center;
  gap: 12px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Legend symbols */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.active {
  background: #4caf50;
}

.dot.archived {
  background: #9e9e9e;
}

.dot.selected {
  background: #0079c1;
}

/* Shelf symbol */
.area-symbol {
  width: 13px;
  height: 10px;
  border: 1px solid #6baed6;
  background: rgba(0,120,170,0.1);
}

/* =========================
   INFO PANEL (ArcGIS card)
   ========================= */

.map-info {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: min(252px, calc(100% - 28px));
  padding: 10px;
  border: 1px solid #d0d6db;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 3;
  font-size: 12px;
}

.map-info h3 {
  margin: 3px 0 5px;
  font-size: 14px;
  font-weight: 600;
}

.map-info p {
  margin: 0 0 8px;
  color: #666;
}

.map-info dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.map-info div {
  padding: 5px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  background: #f7f7f7;
}

.map-info dt {
  font-size: 11px;
  color: #777;
}

.map-info dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.map-toolbar {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.expanded-map-stage .map-toolbar {
  left: 50%;
  bottom: 14px;
  right: auto;
  top: auto;
  transform: translateX(-50%);
}

.map-toolbar button {
  border: 1px solid rgba(184, 217, 230, 0.95);
  background: rgba(255, 255, 255, 0.96);
  color: var(--deep);
  box-shadow: 0 10px 24px rgba(8, 26, 43, 0.13);
}

.map-toolbar button.active {
  color: #fff;
  border-color: #003d5c;
  background: #003d5c;
}

.map-modal {
  width: min(1240px, calc(100vw - 28px));
  height: min(880px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(184, 217, 230, 0.92);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(184, 217, 230, 0.9);
  background: #ffffff;
}

.map-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.map-modal-header > button:last-child {
  justify-self: end;
}

.map-download-button {
  justify-self: center;
  border-color: rgba(35, 167, 224, 0.45);
  background: #eef8fc;
  color: var(--deep);
}

.map-modal .map-stage,
.map-modal .world-map,
.expanded-map-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 10px;
}

.map-modal .world-map {
  border: 0;
}

.measure-active {
  cursor: crosshair;
}

.measure-popup .leaflet-popup-content {
  margin: 8px 10px;
  color: #000;
  font-size: 12px;
}







.ground-layout {
  /* Engineering dashboard grid: selection rail, PCPT plots, and subsurface profile. */
  display: grid;
  grid-template-columns: 245px repeat(3, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: minmax(610px, auto);
  gap: 14px;
}

.project-strip {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 16px;
  background: #f8fcfe;
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 36, 58, 0.075);
  min-width: 0;
}

.project-strip span {
  color: var(--muted);
}

.project-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  align-content: start;
  gap: 8px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.project-actions .badge {
  justify-self: start;
}

.project-actions button {
  width: 100%;
  white-space: nowrap;
}

.control-rail {
  grid-column: 1;
  grid-row: 2 / span 3;
  display: grid;
  align-content: start;
  gap: 12px;
}

.control-rail label {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f9fc;
}

.filter-button {
  display: grid;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid rgba(184, 217, 230, 0.82);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
}

.filter-button:hover {
  border-color: rgba(35, 167, 224, 0.5);
  background: #fff;
}

.filter-button strong,
.filter-button small {
  display: block;
}

.filter-button small {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

.check-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding-right: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 39, 0.34);
  backdrop-filter: blur(5px);
}

.column-map-backdrop {
  z-index: 70;
}

.filter-modal {
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(213, 221, 226, 0.95);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(23, 32, 39, 0.24);
}

.filter-modal input,
.filter-modal select,
.filter-modal textarea,
.review-modal input,
.review-modal select,
.review-modal textarea {
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.filter-modal label,
.review-modal label {
  min-width: 0;
  font-size: 12px;
}

.archive-modal {
  grid-template-rows: auto auto auto 1fr;
  width: min(620px, 100%);
}

.filter-modal header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filter-modal h2 {
  margin: 0;
  font-size: 21px;
}

.column-map-modal {
  width: min(1180px, calc(100vw - 20px));
  height: min(900px, calc(100dvh - 20px));
  max-height: calc(100dvh - 20px);
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  font-size: 12px;
  overflow: hidden;
}

.review-modal {
  /* Review/confirmation form opens as a modal to keep the queue uncluttered. */
  width: min(1320px, calc(100vw - 20px));
  height: min(940px, calc(100dvh - 20px));
  max-height: calc(100dvh - 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(213, 221, 226, 0.95);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(23, 32, 39, 0.24);
  overflow: hidden;
  font-size: 12px;
}

.review-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-modal h2 {
  margin: 0;
  font-size: 21px;
}

.review-modal header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.review-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-modal form {
  min-height: 0;
  overflow: auto;
  padding: 0 8px 72px 0;
}

.review-alerts {
  padding: 7px 9px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
}

.review-alerts summary {
  cursor: pointer;
  font-weight: 800;
}

.review-alerts div {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.review-alerts p {
  margin: 0;
  line-height: 1.25;
}

.column-map-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.column-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.column-map-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.column-unit-select {
  max-width: none;
}

.column-map-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pcpt-assumption-panel {
  border: 1px solid rgba(35, 167, 224, 0.2);
  border-radius: 8px;
  background: #f6fbfd;
  padding: 8px 10px;
}

.pcpt-assumption-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.pcpt-assumption-panel summary span {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 600;
}

.pcpt-assumption-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.pcpt-assumption-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.column-preview {
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.column-preview-panel {
  min-height: 0;
}

.column-preview table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 0;
}

.column-preview td,
.column-preview th {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.column-preview th {
  width: 36px;
  position: sticky;
  left: 0;
  z-index: 1;
}

.review-section,
.depth-observation-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdfe;
  overflow: visible;
}

.review-section[open],
.depth-observation-editor[open] {
  display: grid;
  gap: 8px;
}

.project-review-section[open] {
  gap: 10px;
}

.review-section summary,
.depth-observation-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
}

.review-section summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.duplicate-review-section {
  border-color: rgba(180, 83, 9, 0.35);
  background: #fffaf2;
}

.duplicate-conflict-list {
  max-height: 220px;
}

.duplicate-choice span,
.duplicate-choice strong,
.duplicate-choice small {
  display: block;
}

.duplicate-choice small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.depth-observation-table {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 210px;
  max-height: min(46dvh, 460px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.depth-field-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(35, 167, 224, 0.2);
  border-radius: 8px;
  background: #f6fbfd;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.depth-field-guide strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

.depth-observation-head,
.depth-observation-row {
  display: grid;
  grid-template-columns: 34px minmax(76px, 0.7fr) minmax(126px, 1fr) repeat(3, minmax(60px, 0.55fr)) minmax(92px, 0.8fr) minmax(78px, 0.65fr) minmax(120px, 0.95fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 6px;
}

.depth-observation-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f1f7fa;
  border-bottom: 1px solid var(--line);
}

.depth-observation-row {
  border-top: 1px solid var(--line);
  padding: 8px;
  background: #fff;
  align-items: start;
}

.depth-observation-row textarea {
  min-height: 38px;
  resize: vertical;
}

.depth-observation-editor > button {
  justify-self: start;
}

.modal-actions {
  justify-content: flex-start;
}

.column-map-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  background: #fff;
}

.modal-check-list {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 4px;
}

.radius-control {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
  color: var(--muted);
}

.radius-control input {
  width: 100%;
  padding: 0;
  accent-color: var(--teal-dark);
}

.radius-control small {
  color: var(--muted);
  line-height: 1.35;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  padding: 7px 8px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--ink) !important;
  font-size: 13px;
}

.check-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--teal-dark);
}

.archive-check-row span,
.archive-check-row strong,
.archive-check-row small {
  display: block;
}

.archive-check-row small {
  margin-top: 2px;
  color: var(--muted);
}

.nearest-toggle {
  margin-top: 2px;
}

.mini-stats {
  display: grid;
  gap: 8px;
}

.mini-stats span {
  width: 100%;
}

.strat-panel {
  /* Subsurface Profile and Soil Unit Determination field. */
  grid-column: 2 / -1;
  min-height: 1040px;
}

.strat-panel h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.strat-panel-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.plot-panel {
  grid-column: auto;
}

.strat-panel canvas,
.plot-panel canvas,
.plotly-plot {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.strat-panel canvas {
  min-height: 640px;
  margin-top: 10px;
  background: #f8f1e8;
  border-color: rgba(120, 102, 82, 0.28);
}

.strat-pcpt-controls {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(240px, 1fr);
  align-items: end;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 224, 231, 0.95);
  border-radius: 8px;
  background: #f8faf9;
}

.strat-pcpt-labels {
  display: grid;
  gap: 8px;
  align-items: center;
}

.strat-pcpt-labels span {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--line);
}

.strat-pcpt-labels span sub {
  font-size: 0.72em;
  line-height: 0;
  transform: translateY(0.22em);
}

.strat-pcpt-labels .qt {
  color: #0f766e;
}

.strat-pcpt-labels .bq {
  color: #7c3aed;
}

.strat-pcpt-labels .rf {
  color: #be123c;
}

.strat-pcpt-labels small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.strat-pcpt-controls label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.strat-pcpt-controls label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.strat-unit-toolbar {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 217, 230, 0.95);
  border-radius: 8px;
  background: #f7fbfd;
}

.strat-unit-head,
.strat-unit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.strat-unit-head strong {
  color: var(--deep);
}

.strat-unit-head span,
.strat-unit-help {
  color: var(--muted);
  font-size: 12px;
}

.strat-boundary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
}

.strat-boundary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid rgba(216, 224, 231, 0.95);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.strat-boundary-chip i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.strat-boundary-chip input {
  width: 74px;
  padding: 5px 6px;
  font-size: 12px;
}

.strat-boundary-chip em {
  color: var(--muted);
  font-style: normal;
}

.strat-boundary-chip button,
.strat-unit-actions button {
  padding: 5px 8px;
  font-size: 12px;
}

.sbtn-top-legend {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(184, 217, 230, 0.95);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.sbtn-top-legend strong {
  color: var(--deep);
  margin-right: 4px;
}

.sbtn-top-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  white-space: nowrap;
}

.sbtn-top-legend-item i {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  flex: 0 0 auto;
}

.strat-summary {
  min-height: 250px;
  max-height: 320px;
  overflow: auto;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(216, 224, 231, 0.95);
  border-radius: 8px;
  background: #fffdf8;
}

.admin-users-table {
  min-width: 900px;
}

.admin-users-table input,
.admin-users-table select {
  min-width: 120px;
}

.admin-users-table select[multiple] {
  min-width: 220px;
  padding: 6px;
}

.access-field,
.access-summary {
  display: grid;
  gap: 6px;
}

.access-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.access-field span {
  grid-column: 1 / -1;
}

.access-field small {
  grid-column: 1;
}

.access-field button {
  grid-column: 2;
  grid-row: 2;
  padding: 7px 10px;
  white-space: nowrap;
}

.admin-access-cell {
  display: grid;
  grid-template-columns: auto auto minmax(88px, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 250px;
}

.access-field span,
.access-summary {
  color: var(--muted);
  font-size: 13px;
}

.access-field small,
.admin-users-table small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.admin-access-cell .compact-check {
  margin: 0 !important;
  white-space: nowrap;
}

.admin-access-cell button {
  padding: 6px 10px;
  white-space: nowrap;
}

.admin-access-cell .access-summary {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-check {
  display: flex !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.strat-summary h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.strat-summary div {
  display: grid;
  gap: 6px;
}

.strat-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.strat-summary strong {
  color: var(--ink);
  margin-right: 6px;
}

.plot-panel canvas {
  /* Legacy canvas plots remain supported; active PCPT plots are rendered by Plotly. */
  aspect-ratio: 0.72;
  height: auto;
  min-height: 380px;
  max-height: 520px;
  cursor: grab;
  image-rendering: auto;
  touch-action: none;
}

.plotly-plot {
  min-height: 430px;
  height: clamp(430px, 42vw, 500px);
  overflow: hidden;
}

.plotly-plot.expanded {
  min-height: 500px;
  height: min(64dvh, 620px);
}

.plotly-plot .xtick text,
.plotly-plot .ytick text,
.plotly-plot .g-xtitle text,
.plotly-plot .annotation-text {
  user-select: text;
  pointer-events: all;
}

.plotly-empty {
  height: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  color: #000;
}

.plot-expand {
  padding: 5px 9px;
  border-color: rgba(35, 167, 224, 0.32);
  color: #176d9d;
  background: #f2f9fc;
  font-size: 12px;
}

.su-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.su-controls label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f9fc;
  white-space: nowrap;
}

.su-controls input {
  padding: 7px 8px;
  width: min(92px, 45%);
  min-width: 68px;
}

.plot-legend {
  display: flex;
  align-items: center;
  gap: 7px 10px;
  flex-wrap: wrap;
  min-height: 52px;
  max-height: 78px;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  font-size: 12px;
}

.plot-legend:empty {
  display: none;
}

.plot-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  color: var(--ink);
  white-space: nowrap;
}

.plot-legend-item i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.plot-legend-item.lab i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  border-radius: 1px;
  transform: rotate(45deg);
}

.plot-note {
  min-height: 90px;
  margin: 8px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f2f8fb;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: visible;
}

.plot-panel h3,
.strat-panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plot-panel h3::after,
.strat-panel h3::after {
  content: "";
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.65;
}

.plot-panel h3:has(.plot-expand)::after {
  content: none;
}

.plot-modal {
  width: min(800px, calc(100vw - 32px));
  max-height: calc(100dvh - 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(184, 217, 230, 0.95);
  box-shadow: 0 24px 70px rgba(8, 26, 43, 0.28);
}

.plot-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) 210px;
  gap: 12px;
  align-items: stretch;
}

.sbtn-modal {
  width: min(1040px, calc(100vw - 32px));
}

.sbtn-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
  align-items: stretch;
}

.sbtn-profile-plot,
.sbtn-profile-main {
  min-height: 560px;
  height: min(68dvh, 720px);
}

.sbtn-profile-main {
  margin-top: 10px;
  border-color: rgba(184, 217, 230, 0.95);
  background: transparent !important;
}

.sbtn-profile-main .main-svg {
  background: transparent !important;
}

.sbtn-profile-main .bg {
  fill: transparent !important;
}

.sbtn-legend {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.plot-modal-side {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto) 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fcfe;
  overflow: auto;
}

.plot-modal-side h3 {
  margin: 0;
  font-size: 14px;
}

.borehole-log-modal {
  position: relative;
  width: min(1280px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(184, 217, 230, 0.95);
  box-shadow: 0 28px 80px rgba(8, 26, 43, 0.28);
}

.borehole-log-modal header,
.borehole-log-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.borehole-log-controls {
  align-items: stretch;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfd;
}

.borehole-log-controls label {
  min-width: min(620px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.borehole-log-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  max-width: 360px;
  align-self: center;
}

.borehole-pcpt-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 6px;
  background: #fff;
  color: #0f172a !important;
  font-weight: 800;
}

.borehole-inline-pcpt {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.borehole-column-popover {
  position: absolute;
  z-index: 20;
  right: 88px;
  top: 112px;
  width: min(470px, calc(100% - 28px));
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
}

.borehole-column-popover > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.borehole-column-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: min(420px, 100%);
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 8px;
  background: #fff;
}

.borehole-column-picker legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.borehole-column-picker label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  color: #10243a;
}

.borehole-svg-nkt {
  display: flex;
  gap: 10px;
  align-items: center;
  font: 700 10px Arial, Helvetica, sans-serif;
  color: #10243a;
}

.borehole-svg-nkt label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.borehole-svg-nkt input {
  width: 42px;
  height: 18px;
  padding: 0 2px;
  border: 1px solid rgba(15, 23, 42, 0.28);
  border-radius: 4px;
  font: 700 10px Arial, Helvetica, sans-serif;
}

.borehole-log-stage {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.borehole-log-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 980px;
  cursor: crosshair;
}

.plot-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plot-modal h2 {
  margin: 0;
  font-size: 20px;
}

.plot-modal canvas,
.plot-modal .plotly-plot {
  width: 100%;
  height: min(64dvh, 620px);
  min-height: min(500px, calc(100dvh - 190px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: grab;
  touch-action: none;
}

.plot-modal .plot-legend {
  max-height: none;
  overflow: visible;
}

.plot-modal .plot-note {
  min-height: 0;
  max-height: 24dvh;
  overflow: auto;
}

.dropzone {
  min-height: 160px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 2px dashed rgba(35, 167, 224, 0.42);
  border-radius: 8px;
  padding: 20px;
  background: #eef8fb;
  text-align: center;
}

.dropzone input {
  max-width: 100%;
  background: #fff;
}

.dropzone.drag {
  border-color: var(--teal);
  background: #e8f7f7;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #e8f5f9;
}

tbody tr:hover {
  background: #f3fbfd;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: max-content;
}

.table-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.table-link-button:hover {
  border-color: rgba(35, 167, 224, 0.5);
  box-shadow: 0 8px 18px rgba(16, 36, 58, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.badge.active,
.badge.confirmed {
  color: var(--green);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.badge.archived,
.badge.needs_review {
  color: var(--amber);
  border-color: #fde68a;
  background: #fffbeb;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.coordinate-editor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  min-width: 0;
  overflow: hidden;
}

.coordinate-editor h3 {
  margin: 0;
  font-size: 15px;
}

.coord-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) minmax(105px, 1fr) minmax(105px, 1fr) minmax(72px, 0.65fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.coord-row input {
  min-width: 0;
}

.coord-row button {
  white-space: nowrap;
}

/* Grouped workspace navigation */
.shell.grouped-shell { grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 16px; padding: 16px; }
.grouped-shell > .topbar { grid-column: 1 / -1; width: 100%; margin: 0; grid-template-columns: 1fr auto auto; top: 0; }
.workspace-sidebar { grid-column: 1; grid-row: 2; align-self: start; position: sticky; top: 110px; max-height: calc(100vh - 125px); overflow: auto; padding: 18px 20px; border: 0; border-right: 1px solid #d4d9dc; border-radius: 0; background: #fafbfc; box-shadow: none; }
.sidebar-project { display: grid; gap: 8px; font-weight: 600; font-size: 12px; color: #4c555c; }
.sidebar-project select { width: 100%; min-width: 0; font-size: 14px; font-weight: 400; border: 1px solid #cbd1d5; border-radius: 3px; background: #fff; padding: 8px; }
.nav-group { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #e0e4e7; }
.nav-group h2 { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #303b43; margin: 0 0 6px; line-height: 1.4; }
.nav-group button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; color: #505b63; box-shadow: none; margin: 0; padding: 5px 0 5px 10px; font-size: 14px; font-weight: 400; line-height: 1.5; transition: none; }
.nav-group button:hover { background: transparent; color: #19354b; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.nav-group button.active { background: transparent; color: #19354b; border: 0; font-weight: 700; }
.workspace-sidebar button:focus-visible, .sidebar-project select:focus-visible { outline: 2px solid #526678; outline-offset: 3px; }
.workspace-sidebar > #logout { margin-top: 20px; padding: 8px 0 0; width: 100%; border: 0; border-top: 1px solid #e0e4e7; border-radius: 0; background: transparent; box-shadow: none; text-align: left; color: #59636b; font-size: 12px; }
.grouped-shell > .content { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; margin: 0; padding: 0; align-content: start; }
.grouped-shell .workspace-page { margin-top: 0; }
.workspace-heading { padding: 4px 0 12px; }
.workspace-heading h2 { margin: 6px 0; font-size: 24px; }
.workspace-heading p { margin: 0; color: #617589; }
.grouped-shell > .app-footer { grid-column: 1 / -1; width: 100%; margin: 0; padding: 14px 18px; background: var(--deep); color: #d7edf5; border: 1px solid rgba(35, 167, 224, 0.28); border-radius: 8px; box-shadow: 0 12px 30px rgba(8, 26, 43, 0.15); }
.grouped-shell > .app-footer > span:not(.brand-logo) { color: #d7edf5; }
.grouped-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.sidebar-collapsed > .workspace-sidebar { display: none; }
.sidebar-collapsed > .content { grid-column: 1; }
.logger-workspace { display: grid; gap: 14px; }
.logger-frame { display: block; width: 100%; height: max(750px, calc(100vh - 240px)); border: 1px solid #d4dee5; border-radius: 8px; background: white; }
@media(max-width: 800px) {
  .shell.grouped-shell { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .grouped-shell > .topbar { grid-template-columns: 1fr auto; position: static; }
  .grouped-shell .userline { grid-column: 1 / -1; }
  .workspace-sidebar { position: static; grid-column: 1; grid-row: 2; max-height: none; }
  .workspace-sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nav-group { margin: 10px 0; }
  .grouped-shell > .content { grid-column: 1; grid-row: 3; }
}

/* GEOBASE enterprise theme layer */
.shell::before {
  content: none;
}

.topbar {
  /* Branded application header shared by all authenticated pages. */
  background: var(--deep);
  border-color: rgba(35, 167, 224, 0.28);
  box-shadow: 0 20px 54px rgba(8, 26, 43, 0.24);
}

.topbar .brand small,
.topbar .userline,
.topbar .userline strong {
  color: #d7edf5;
}

.topbar .brand-logo {
  padding: 13px 19px;
  font-size: 25px;
}

.topbar .brand-logo sup {
  font-size: 12px;
}

.topbar .tabs {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
}

.topbar .tabs button {
  color: #d7edf5;
}

.topbar .tabs button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.topbar .tabs button.active {
  background: var(--blue);
  color: #062033;
  box-shadow: 0 8px 20px rgba(35, 167, 224, 0.22);
}

.topbar #logout {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.brand-logo {
  border: 0;
}

.intro-band,
.project-strip,
.page-heading {
  position: relative;
  overflow: hidden;
}

.intro-band::before,
.project-strip::before,
.page-heading::before {
  content: none;
}

.intro-band > *,
.project-strip > *,
.page-heading > * {
  position: relative;
  z-index: 1;
}

.intro-band h2,
.project-strip h2,
.page-heading h2 {
  color: var(--deep);
  letter-spacing: 0;
}

.workflow-strip span {
  border-color: rgba(184, 217, 230, 0.86);
  background: #f8fcfe;
}

.workflow-strip span:hover,
.summary-counters span:hover,
.mini-stats span:hover {
  border-color: rgba(35, 167, 224, 0.45);
  box-shadow: 0 14px 30px rgba(16, 36, 58, 0.09);
}

.panel,
.selector-panel,
.strat-panel,
.plot-panel,
.control-rail {
  background: var(--panel);
}

.selector-panel,
.control-rail {
  border-top: 3px solid rgba(35, 167, 224, 0.45);
}

.plot-panel {
  border-top: 3px solid rgba(11, 143, 138, 0.38);
}

.strat-panel {
  border-top: 3px solid rgba(35, 167, 224, 0.55);
}

.map-stage,
.world-map {
  border-color: rgba(35, 167, 224, 0.24);
  box-shadow: 0 18px 42px rgba(8, 26, 43, 0.13);
}

.map-info {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(184, 217, 230, 0.9) !important;
  box-shadow: 0 18px 42px rgba(8, 26, 43, 0.16);
  backdrop-filter: blur(10px);
}

.project-tile {
  border-color: rgba(184, 217, 230, 0.86);
  background: #f8fcfe;
}

.project-tile:hover {
  border-color: rgba(35, 167, 224, 0.45);
}

.badge.active,
.badge.confirmed {
  color: #0b6f6b;
  border-color: rgba(11, 143, 138, 0.28);
  background: #e8f7f7;
}

.badge.archived,
.badge.needs_review {
  color: #176d9d;
  border-color: rgba(35, 167, 224, 0.28);
  background: #e8f6fc;
}

table {
  border-color: rgba(184, 217, 230, 0.82);
}

th {
  color: var(--deep);
  background: #e8f5f9;
}

.coord-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.coord-row input {
  padding: 8px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 230px;
  overflow: auto;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

@media (max-width: 900px) {
  .ground-layout {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .project-strip,
  .control-rail,
  .plot-panel,
  .strat-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .workflow-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selector-band,
  .project-register-grid,
  .topbar {
    grid-template-columns: 1fr;
    position: static;
  }

  .home-map-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .home-map-grid .map-stage,
  .home-map-grid .world-map {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .home-project-stack {
    min-height: 0;
    height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    aspect-ratio: auto;
    overflow: visible;
  }

  .tabs {
    justify-content: flex-start;
  }

  .grid > .page-heading {
    grid-column: 1 / -1;
  }

  .upload-page {
    grid-template-columns: 1fr;
  }

  .upload-extract-panel {
    grid-template-columns: 1fr;
  }

  .upload-ingestion-fields {
    grid-template-columns: 1fr;
  }

  .ai-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .plot-modal-body {
    grid-template-columns: 1fr;
  }

  .sbtn-modal-body {
    grid-template-columns: 1fr;
  }

  .plot-modal .plotly-plot {
    min-height: 360px;
    height: 50dvh;
  }

  .sbtn-profile-plot,
  .sbtn-profile-main {
    min-height: 420px;
    height: 54dvh;
  }

  .plot-modal {
    width: min(720px, calc(100vw - 20px));
    max-height: calc(100dvh - 12px);
    padding: 10px;
  }

  .plot-modal-side {
    max-height: 28dvh;
  }

  .coord-grid {
    grid-template-columns: 1fr;
  }

  .coord-head {
    display: none;
  }

  .span-4,
  .span-8 {
    grid-column: 1;
  }

  .intro-band,
  .project-strip {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .intro-band {
    flex-direction: column;
  }

  .project-actions {
    width: 100%;
    max-width: 360px;
  }

  .workflow-strip,
  .selector-band {
    grid-template-columns: 1fr;
  }

  .map-info {
    position: absolute;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 14px;
    width: auto;
  }

  .legend {
    left: 14px;
    right: 14px;
    top: 60px;
    transform: none;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-top: 10px;
  }

  .topbar,
  .content,
  .app-footer {
    width: min(100% - 20px, var(--app-width));
  }

  .topbar {
    gap: 10px;
    padding: 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-copy,
  .userline {
    font-size: 12px;
    justify-items: start;
  }

  .tabs {
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 5px;
    scrollbar-width: thin;
  }

  .tabs button {
    flex: 0 0 auto;
    padding: 8px 11px;
  }

  .strat-pcpt-controls {
    grid-template-columns: 1fr;
  }

  .summary-counters,
  .mini-stats {
    width: 100%;
  }

  .filter-modal,
  .column-map-modal,
  .review-modal {
    width: calc(100% - 12px);
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    padding: 12px;
  }

  .review-modal header {
    align-items: flex-start;
  }

  .borehole-log-modal header,
  .borehole-log-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .borehole-log-controls p {
    max-width: none;
  }

  .borehole-log-controls label {
    grid-template-columns: 1fr;
  }

  .borehole-column-popover {
    left: 12px;
    right: 12px;
    top: 150px;
    width: auto;
  }

  .depth-observation-table {
    max-height: 48dvh;
  }
}

/* Home overview: one shared height for the map and both project cards. */
.home-map-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: clamp(580px, 72vh, 780px);
  gap: 16px;
  align-items: stretch;
}
.home-map-grid > .map-stage,
.home-map-grid .world-map {
  height: 100%;
  aspect-ratio: auto;
  min-height: 0;
}
.home-map-grid > .home-project-stack {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.home-map-grid .selector-panel { padding: 16px; border-radius: 8px; }
@media (max-width: 1100px) {
  .home-map-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .home-map-grid > .map-stage { height: clamp(420px, 60vh, 620px); }
  .home-map-grid > .home-project-stack { height: auto; grid-template-rows: auto auto; }
}

/* Technical typography: compact headings and stable engineering numerals. */
body { font-variant-numeric: lining-nums tabular-nums; }
h1, h2, h3 { letter-spacing: .025em; font-weight: 600; }
.brand-logo { font-family: Arial, Helvetica, sans-serif; }
.eyebrow { letter-spacing: .09em; }
input, select, table, .axis-tick { font-variant-numeric: tabular-nums; }

/* Dedicated interpretation pages share the same filter rail. */
.borehole-log-page, .engineering-empty { grid-column: 2 / -1; min-width: 0; }
.borehole-log-page .borehole-log-inline { width: 100%; max-width: none; max-height: none; height: auto; box-shadow: none; border: 1px solid var(--line); }
.borehole-log-page .borehole-log-stage { max-height: none; }
@media (max-width: 1100px) {
  .borehole-log-page, .engineering-empty { grid-column: 1 / -1; }
}
.interpretation-layout { grid-template-columns: 220px minmax(0, 1fr); grid-auto-rows: auto; align-items: start; }
.interpretation-layout .control-rail { grid-row: 2; }
.interpretation-layout .strat-panel { min-height: 0; }
@media (max-width: 1100px) {
  .interpretation-layout { grid-template-columns: minmax(0, 1fr); }
  .interpretation-layout .control-rail { grid-row: auto; }
  .interpretation-layout .strat-panel { grid-column: 1; }
}
