/* Refinements to the existing GeoCAD visual language. */
:root {
  color-scheme: dark;
}
button,
input,
select,
textarea {
  font: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #61dfb2;
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
.command-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-left: 1px solid #294047;
  max-width: 720px;
}
.command-grid .ribbon-command {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.ribbon-page {
  overflow-x: auto;
}
.ribbon-content {
  min-height: 110px;
}
.service-dialog {
  background: #102328;
  color: #e4eeed;
  border: 1px solid #385058;
  border-radius: 14px;
  width: min(620px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 26px;
  box-shadow: 0 24px 100px #0009;
}
.service-dialog::backdrop {
  background: #061013b8;
  backdrop-filter: blur(3px);
}
.service-dialog form {
  display: grid;
  gap: 14px;
}
.service-dialog h2 {
  font-size: 21px;
  margin: 0 0 8px;
}
.service-dialog p {
  font-size: 13px;
  line-height: 1.65;
  color: #abc1c3;
  white-space: pre-wrap;
}
.service-dialog label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: #c4d5d6;
}
.service-dialog input,
.service-dialog select,
.service-dialog textarea {
  box-sizing: border-box;
  width: 100%;
  background: #09191e;
  color: #eef7f6;
  border: 1px solid #385058;
  border-radius: 7px;
  min-height: 38px;
  padding: 8px 10px;
}
.service-dialog textarea {
  min-height: 120px;
  resize: vertical;
}
.service-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}
.service-dialog button {
  background: #203b43;
  border: 1px solid #38565b;
  border-radius: 7px;
  color: #e6f5f1;
  padding: 9px 16px;
}
.service-dialog button.primary {
  background: #49d4a0;
  color: #07261e;
  border-color: #49d4a0;
}
.service-dialog .form-error {
  color: #ffb7aa;
  margin: 0;
}
.report-dialog {
  width: min(1100px, calc(100vw - 32px));
}
.table-scroll {
  max-height: 65vh;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid #2b444a;
  padding: 10px;
  white-space: pre-wrap;
}
th {
  position: sticky;
  top: 0;
  background: #153139;
}
pre {
  overflow: auto;
  max-height: 45vh;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.vertex-handle {
  background: #fff;
  border: 2px solid #087c59;
  border-radius: 3px;
  box-shadow: 0 1px 4px #0008;
}
.layer-toolbar {
  flex-wrap: wrap;
}
.pm-note {
  margin-top: 30px !important;
  font-size: 12px !important;
  color: #81aaa6 !important;
}
.pm-primary-actions button:first-child {
  background: #49d4a0 !important;
  color: #07261e !important;
}
.pm-list button {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.pm-list small {
  color: #9ab5b6;
}
.pm-shell {
  max-width: 1080px;
}
.pm-welcome h2 {
  font-size: clamp(27px, 4vw, 42px);
}
.pm-primary-actions {
  gap: 10px;
}
.project-manager-screen {
  overflow: auto;
}
.service-dialog input[type='color'] {
  height: 45px;
}
.leaflet-tooltip {
  color: #112a27;
  direction: auto;
}
.status-message {
  min-width: 0;
}
.status-message strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crs-manager-modal .crs-window {
  max-height: 90dvh;
}
.crs-toolbar {
  flex-wrap: wrap;
}
.ribbon-tab {
  flex-shrink: 0;
}
.ribbon-tabs {
  overflow-x: auto;
}
.ribbon-command span {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .command-grid {
    min-width: 300px;
    padding: 6px;
  }
  .document-title {
    display: none;
  }
  .ribbon-content {
    min-height: 100px;
  }
  .service-dialog {
    padding: 18px;
  }
  .pm-shell main {
    display: block;
  }
  .pm-shell aside {
    margin-top: 24px;
  }
  .pm-shell {
    padding: 24px;
  }
  .crs-window main {
    display: block;
    overflow: auto;
  }
  .crs-window aside {
    display: none;
  }
  .crs-toolbar input {
    max-width: 100%;
    min-width: 100px;
  }
  .coordinate-readout {
    display: none;
  }
  .status-meta {
    font-size: 10px;
  }
  .report-dialog {
    width: calc(100vw - 28px);
  }
}
@media print {
  .app-header,
  .ribbon,
  .dock-panel,
  .statusbar,
  .map-overlay,
  .map-toolbar,
  .leaflet-control-zoom,
  .panel-scrim {
    display: none !important;
  }
  .workspace,
  .app-shell {
    display: block !important;
    height: 100vh !important;
  }
  .map-stage,
  #map {
    height: 100vh !important;
    width: 100vw !important;
  }
  .leaflet-control-attribution {
    display: block !important;
  }
}

.sketch-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid #39565e;
  background: #102328;
  border-radius: 10px;
  box-shadow: 0 8px 30px #0006;
}
.sketch-controls button {
  border: 1px solid #39565e;
  border-radius: 6px;
  background: #22434b;
  color: #fff;
  padding: 8px 16px;
}
.sketch-controls button:first-child {
  background: #49d4a0;
  color: #08291e;
}
.sketch-controls.hidden {
  display: none;
}

:root {
  --ribbon-h: 110px;
}
.app-shell {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}
.ribbon {
  min-width: 0;
}
.ribbon-content {
  min-height: 0;
  height: var(--ribbon-h);
}
.ribbon-page {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.command-grid {
  flex-shrink: 0;
  max-width: 760px;
}
.map-shell {
  isolation: isolate;
}
.layer-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ribbon.collapsed .ribbon-content {
  min-height: 0;
  height: 0;
}
@media (max-width: 840px) {
  :root {
    --ribbon-h: 100px;
  }
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
  }
  .brand {
    min-width: 0;
  }
  .workspace,
  .workspace.leftPanel-hidden,
  .workspace.rightPanel-hidden,
  .workspace.leftPanel-hidden.rightPanel-hidden {
    grid-template-columns: minmax(0, 1fr);
  }
  .ribbon-content {
    min-height: 0;
  }
  .command-grid {
    max-width: none;
    flex-wrap: nowrap;
  }
  .command-grid .ribbon-command {
    height: 55px;
  }
  .header-actions {
    min-width: 0;
  }
  .dock-panel {
    transition: transform 0.18s ease;
  }
  .pm-shell aside {
    display: block;
  }
  .pm-shell {
    min-height: 0;
    padding: 0;
  }
  .project-manager-screen {
    padding: 12px;
  }
  .pm-welcome {
    padding: 24px;
  }
  .pm-shell > header {
    padding: 20px;
  }
  .pm-primary-actions {
    grid-template-columns: 1fr 1fr;
  }
  .pm-shell aside {
    padding: 24px;
    border-left: 0;
    border-top: 1px solid #294047;
  }
}

/* CAD/GIS task ribbon and focused inspector */
.professional-group {
  align-items: center;
  gap: 5px;
  padding: 7px 14px 20px;
  flex-shrink: 0;
}
.professional-group .ribbon-command {
  min-width: 62px;
  max-width: 110px;
  height: 66px;
  padding: 6px 8px;
  font-size: 11px;
}
.professional-group .ribbon-command span {
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}
.professional-group .ribbon-command svg {
  width: 21px;
  height: 21px;
}
.professional-group label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  color: #aec5c8;
}
.professional-group select {
  height: 32px;
  min-width: 175px;
  background: #091e24;
  color: #e3f1f0;
  border: 1px solid #31535c;
  border-radius: 5px;
}
.professional-group .ribbon-group-label {
  font-size: 10px;
  bottom: 4px;
  color: #83a4ac;
}
.crs-group {
  align-self: center;
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 280px;
}
.crs-group > label {
  font-size: 11px;
}
.crs-summary {
  width: 220px;
}
.crs-summary strong {
  font-size: 12px;
}
.dock-header h2 {
  font-size: 14px;
}
.panel-tab {
  font-size: 11px;
  height: 28px;
}
.layer-row .layer-name {
  font-size: 12px;
}
.layer-toolbar button {
  font-size: 10px;
  height: 30px;
}
.inspector-table {
  font-size: 10px;
}
.inspector-table td,
.inspector-table th {
  padding: 7px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inspector-table tr:not(:first-child) {
  cursor: pointer;
}
.inspector-table tr:hover {
  background: #163a3e;
}
.status-meta [role='button'],
#projectTitle {
  cursor: pointer;
}
.status-meta [role='button'] {
  color: #68ddb0;
  border: 1px solid #2b6655;
  padding: 2px 7px;
  border-radius: 4px;
}
.hide-coordinate-readout .coordinate-readout {
  display: none;
}
body[data-density='compact'] .professional-group .ribbon-command {
  font-size: 10px;
  min-width: 55px;
}
#statusTool {
  font-size: 10px;
  color: #b5cbd0;
}
.leaflet-attribution-flag {
  width: 12px !important;
  height: 8px !important;
}
.table-scroll {
  max-width: 100%;
}
@media (max-width: 840px) {
  .professional-group {
    padding: 5px 10px;
  }
  .professional-group .ribbon-command {
    height: 68px;
  }
  .north-arrow {
    top: 64px;
  }
  .status-meta {
    display: flex !important;
    gap: 6px;
  }
  .statusbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .status-meta span:last-child,
  #statusTool {
    display: none;
  }
  .status-meta #statusCrs {
    display: block;
    font-size: 9px;
  }
  .professional-group .ribbon-group-label {
    display: none;
  }
}
