:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  --paper: #f5f6f7;
  --surface: #fff;
  --ink: #192432;
  --muted: #687586;
  --line: #dfe4e9;
  --blue: #3155f5;
}

* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
}

#app {
  display: grid;
  grid-template-columns: clamp(350px, 29vw, 406px) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
}
#app.map-focused {
  grid-template-columns: minmax(0, 1fr);
}
#app.map-focused #sidebar {
  display: none;
}
#app.map-focused #mapStage {
  grid-column: 1;
}

#sidebar {
  z-index: 2;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 23px 28px;
  background: var(--paper);
  border-right: 1px solid #ccd4dd;
  scrollbar-color: #bdc8d1 transparent;
}

.workspace-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 65px;
  border-bottom: 1px solid var(--line);
}
.crown-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crown-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #101521;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.crown-wordmark {
  color: #111b2c;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.11em;
  white-space: nowrap;
}
.crown-wordmark small {
  margin-left: 3px;
  color: #667386;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.home-link {
  color: #526074;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.home-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.planner-heading {
  margin: 23px 0 22px;
}
.eyebrow {
  color: #758293;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
#sidebar h1 {
  margin: 7px 0 4px;
  color: #121c2b;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.planner-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-label {
  margin: 21px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #263343;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.005em;
}
.planner-heading + .section-label {
  margin-top: 0;
  padding-top: 0;
  border: 0;
}
.route-section-label {
  margin-top: 24px;
}

#sidebar label,
dialog label {
  display: block;
  margin-bottom: 11px;
  color: #4e5b6b;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}
#sidebar input:not([type='checkbox']),
#sidebar select,
dialog input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 39px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #cbd3dc;
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: #1e2a39;
  font: inherit;
  font-size: 12px;
}
#sidebar input::placeholder {
  color: #8b97a4;
}
#sidebar input:hover,
#sidebar select:hover {
  border-color: #9baaba;
}
#sidebar input:focus-visible,
#sidebar select:focus-visible,
#sidebar button:focus-visible,
.map-toolbar button:focus-visible,
#navControls button:focus-visible,
dialog :focus-visible,
a:focus-visible {
  outline: 2px solid #3155f5;
  outline-offset: 2px;
}
#sidebar input[type='checkbox'] {
  margin: 2px 0 0;
  accent-color: var(--blue);
}

#sidebar button,
.map-toolbar button,
#navControls button,
dialog button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cad3dd;
  border-radius: 7px;
  background: #fff;
  color: #243244;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
#sidebar button:hover:not(:disabled),
.map-toolbar button:hover:not(:disabled),
#navControls button:hover:not(:disabled),
dialog button:hover:not(:disabled) {
  border-color: #8c9bac;
  background: #f0f3f7;
}
#sidebar button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}
#sidebar button.primary,
dialog button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
#sidebar button.primary:hover:not(:disabled),
dialog button.primary:hover:not(:disabled) {
  border-color: #233fc3;
  background: #233fc3;
}
#sidebar button.link {
  min-height: 0;
  margin-top: 12px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #4561b8;
  text-align: left;
}
#sidebar button.link:hover {
  border: 0;
  background: transparent;
  color: #233fc3;
  text-decoration: underline;
}
.full-width {
  width: 100%;
}

.search-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.search-row input {
  flex: 1;
  margin: 0 !important;
}
.search-row #searchBtn {
  min-width: 61px;
}
.search-row #locateBtn {
  min-width: 37px;
  padding: 5px;
  font-size: 20px;
  line-height: 1;
}
.suggestions {
  position: relative;
  z-index: 4;
  overflow: hidden;
  margin-top: 5px;
  border: 1px solid #cbd3dc;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 24px #18283d20;
}
.sug {
  padding: 8px 10px;
  border-top: 1px solid #e8ebef;
  cursor: pointer;
}
.sug:first-child {
  border-top: 0;
}
.sug:hover,
.sug.active {
  background: #edf1ff;
}
.sug-1 {
  color: #263343;
  font-size: 12px;
}
.sug-2 {
  margin-top: 2px;
  color: #788592;
  font-size: 10px;
}
.hidden {
  display: none !important;
}

.hint {
  margin: 7px 0 0;
  color: #738092;
  font-size: 10px;
  line-height: 1.5;
}
#modelNotice {
  margin-top: 8px;
}
.mode-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
#sidebar .mode-toggle button {
  min-height: 39px;
  padding: 5px 4px;
  font-size: 10px;
  white-space: nowrap;
}
#sidebar .mode-toggle button.active {
  border-color: #3155f5;
  background: #edf1ff;
  color: #2545c9;
  box-shadow: inset 0 0 0 1px #3155f5;
}
#modeHint {
  margin: 10px 0 11px;
}

#scanControls,
#orbitControls,
#surveyControls,
#defaults {
  padding: 14px;
  border: 1px solid #dbe2e8;
  border-radius: 10px;
  background: #fff;
}
#scanControls > .hint,
#orbitControls > .hint,
#surveyControls > .hint {
  margin: 6px 0 11px;
}
#scanControls > button,
#orbitControls > button {
  width: 100%;
}
#sidebar h3 {
  margin: 0 0 12px;
  color: #273649;
  font-size: 12px;
  font-weight: 750;
}
.wp-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.wp-fields label {
  min-width: 0;
}
.checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 7px;
  font-weight: 500 !important;
}
.readout {
  margin: 0 0 11px;
  padding: 9px 10px;
  border-left: 2px solid #3155f5;
  background: #eaf0ff;
  color: #324766;
  font-size: 11px;
  line-height: 1.45;
}
.readout:empty {
  display: none;
}
.point-estimate {
  margin: 4px 0 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #edf3ff;
  color: #29417d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}
.point-estimate.over-limit {
  background: #fff1ed;
  color: #9b3e2d;
}
.secondary-actions {
  display: flex;
  gap: 6px;
  margin: 7px 0 10px;
}
.secondary-actions button {
  flex: 1;
}

.mission-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #dae1e7;
  border-radius: 8px;
  background: #fff;
  color: #4b5a6c;
  font-size: 11px;
  line-height: 1.45;
}
.summary-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #a5b0bd;
}
.mission-summary.has-route .summary-dot {
  background: #3155f5;
}
.draft-status {
  margin: 7px 2px 10px;
  color: #8190a0;
  font-size: 10px;
  line-height: 1.4;
}
.bulk-edit {
  margin: 0 0 12px;
  padding: 11px;
  border: 1px solid #d9e1e8;
  border-radius: 9px;
  background: #fff;
}
.bulk-edit[open] {
  border-color: #a8b9ff;
  box-shadow: 0 4px 18px #2543a010;
}
.bulk-edit summary {
  color: #2b48b7;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.bulk-edit > .hint {
  margin-bottom: 10px;
}
.bulk-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.bulk-fields label {
  min-width: 0;
}
.bulk-fields input {
  min-height: 34px !important;
  padding-right: 4px !important;
  padding-left: 7px !important;
  font-size: 11px !important;
}
#sidebar #applyBulkBtn {
  width: 100%;
  margin-top: 1px;
  border-color: #3155f5;
  color: #294ac8;
}
#bulkStatus {
  margin: 8px 0 0;
  color: #536982;
  font-size: 10px;
  line-height: 1.4;
}
#bulkStatus:empty {
  display: none;
}
.site-observation-hint {
  margin: -3px 0 12px;
}
.hazard-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 8px;
}
.hazard-entry label {
  min-width: 0;
  margin-bottom: 7px !important;
}
#sidebar #markHazardBtn {
  width: 100%;
  border-color: #dbb69c;
  color: #88431e;
}
#sidebar #markHazardBtn[aria-pressed='true'] {
  border-color: #a64722;
  background: #fff0e8;
}
#hazardStatus {
  margin: 6px 0;
  color: #7b4b32;
  font-size: 10px;
  line-height: 1.4;
}
#hazardStatus:empty {
  display: none;
}
#hazardList {
  margin-top: 7px;
}
.hazard-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.65fr) 29px;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
#sidebar .hazard-row input {
  min-height: 34px;
  margin-top: 0;
  border-color: #e3c8b9;
  font-size: 11px;
}
#sidebar .hazard-row button {
  min-width: 29px;
  min-height: 32px;
  padding: 0;
  color: #994a29;
  font-size: 18px;
}
#waypointList {
  max-height: 340px;
  overflow-y: auto;
}
#waypointList > .hint {
  margin: 0;
}
.wp {
  margin-bottom: 5px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}
.wp.is-selected {
  border-color: #8da2fb;
  box-shadow: 0 0 0 1px #3155f521;
}
.wp.has-warning {
  border-color: #ecb5ab;
}
.wp-overview {
  display: flex;
  align-items: center;
  gap: 3px;
}
#sidebar .wp-select {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 9px;
  border: 0;
  background: transparent;
  text-align: left;
}
#sidebar .wp-select:hover:not(:disabled) {
  border: 0;
  background: #f4f6ff;
}
.wp-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #3155f5;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.wp.is-selected .wp-number {
  background: #e99b31;
  color: #17263b;
}
.wp.has-warning .wp-number {
  background: #d74e44;
  color: #fff;
}
.wp-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.wp-meta strong {
  color: #263343;
  font-size: 11px;
}
.wp-meta small {
  overflow: hidden;
  margin-top: 1px;
  color: #7b8997;
  font-size: 10px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-chevron {
  color: #7a8897;
  font-size: 18px;
  font-weight: 400;
}
#sidebar .wp-remove {
  flex: none;
  min-width: 25px;
  min-height: 28px;
  margin-right: 5px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #8a96a4;
  font-size: 17px;
}
.wp-edit-fields {
  padding: 1px 11px 10px;
  border-top: 1px solid #e8edf2;
}
.wp-edit-fields label {
  margin-top: 9px;
  margin-bottom: 0 !important;
}
.wp-heading-help {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #738092;
  font-size: 10px;
  line-height: 1.4;
}
.wp-fields input {
  min-height: 33px !important;
}

#clearanceWarn {
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #495a6c;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-line;
}
#clearanceWarn:empty {
  display: none;
}
#clearanceWarn.warn {
  border: 1px solid #edb7af;
  background: #fff3f1;
  color: #8b2e25;
}
#clearanceWarn.unknown {
  border: 1px solid #decda8;
  background: #fffaf0;
  color: #68552e;
}
.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.export-name {
  margin-top: 15px;
  padding: 13px 13px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.export-name label {
  margin-bottom: 0 !important;
  color: var(--ink) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}
.export-name p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.actions button {
  min-width: 0;
  padding-right: 5px !important;
  padding-left: 5px !important;
}
.actions #exportBtn {
  grid-column: 1 / -1;
  min-height: 42px;
}
.export-ready {
  margin-top: 8px;
  color: #456077;
  font-size: 11px;
  line-height: 1.4;
}
.export-ready a {
  color: #264ac8;
  font-weight: 700;
}
.export-ready.error {
  color: #8b2e25;
}

#mapStage {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #0c1b2c;
}
#cesiumContainer {
  position: absolute;
  inset: 0;
}
.map-toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 5;
  width: min(370px, calc(100% - 36px));
  padding: 10px;
  border: 1px solid #d8dfe6;
  border-radius: 9px;
  background: #fffffff2;
  color: #243244;
  box-shadow: 0 8px 27px #071c2a30;
  backdrop-filter: blur(12px);
}
.map-toolbar-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.map-toolbar-title {
  margin-left: 1px;
  color: #647284;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.map-toolbar .map-focus-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border-color: #d5dce5;
  border-radius: 5px;
  color: #2745bd;
  background: #f5f7ff;
  font-size: 10px;
  font-weight: 750;
}
.map-toolbar .map-focus-toggle:hover {
  border-color: #aabafa;
  background: #ebefff;
}
.map-layer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.map-layer-buttons button {
  min-height: 30px;
  padding: 4px;
  border-color: transparent;
  background: #edf0f3;
  color: #445265;
  font-size: 10px;
  white-space: nowrap;
}
.map-layer-buttons button[aria-pressed='true'] {
  border-color: #273b54;
  background: #273b54;
  color: #fff;
}
#mapStatus {
  margin: 7px 2px 0;
  color: #647285;
  font-size: 10px;
  line-height: 1.35;
}
.map-tip {
  position: absolute;
  left: 18px;
  bottom: 30px;
  z-index: 3;
  padding: 8px 10px;
  border-radius: 5px;
  background: #15283cdd;
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.camera-preview {
  position: absolute;
  left: 18px;
  bottom: 30px;
  z-index: 4;
  width: min(320px, calc(100% - 115px));
  padding: 10px 12px;
  border: 1px solid #ffffff42;
  border-radius: 9px;
  background: #14263beb;
  color: #fff;
  box-shadow: 0 7px 22px #08141c52;
  backdrop-filter: blur(10px);
}
.camera-preview-top,
.camera-preview-actions {
  display: flex;
  align-items: center;
}
.camera-preview-top {
  justify-content: space-between;
  gap: 8px;
  color: #c9d6e6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.camera-preview-actions {
  gap: 3px;
}
.camera-preview-actions button {
  min-width: 25px;
  min-height: 25px;
  padding: 2px 6px;
  border: 1px solid #ffffff4d;
  border-radius: 5px;
  background: #ffffff17;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0;
}
.camera-preview-actions button:disabled {
  opacity: 0.4;
}
.camera-preview-actions #cameraJump {
  color: #f8d16a;
  font-size: 10px;
}
.camera-preview strong,
.camera-preview > span {
  display: block;
}
.camera-preview strong {
  margin-top: 4px;
  color: #ffe08a;
  font-size: 13px;
  line-height: 1.3;
}
.camera-preview > span {
  margin-top: 2px;
  color: #d4dfec;
  font-size: 10px;
  line-height: 1.4;
}
.camera-preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #ffffff35;
  color: #d4dfec;
  font-size: 9px;
}
.camera-preview-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.camera-preview-legend i {
  width: 13px;
  height: 3px;
  flex: none;
  border-radius: 3px;
}
.camera-key-roof {
  background: #7593ff;
}
.camera-key-facade {
  background: #ed9a55;
}
.camera-key-aim {
  background: #ffd568;
}
#navControls {
  position: absolute;
  right: 13px;
  bottom: 70px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#navControls .nav-row {
  display: flex;
  gap: 4px;
}
#navControls button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: #cbd3dc;
  background: #fffffff2;
  color: #27384c;
  font-size: 14px;
  box-shadow: 0 2px 9px #10233826;
}

dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 20px;
  border: 1px solid #cbd4df;
  border-radius: 11px;
  background: #fff;
  color: #263343;
  box-shadow: 0 22px 70px #07121f60;
}
dialog::backdrop {
  background: #0916269c;
}
dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin: 15px 0 0;
  padding: 0;
}
dialog small {
  color: #788798;
  font-weight: 450;
}

@media (max-width: 850px) {
  #app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
  }
  #mapStage {
    order: 1;
    width: 100%;
    height: 45dvh;
    min-height: 270px;
    flex: none;
  }
  #app.map-focused #mapStage {
    height: 100dvh;
    min-height: 0;
    flex: 1;
  }
  #sidebar {
    order: 2;
    width: 100%;
    min-height: 0;
    flex: 1;
    padding-right: 19px;
    padding-left: 19px;
    border-top: 1px solid #cbd4dd;
    border-right: 0;
  }
  .map-toolbar {
    top: 11px;
    left: 11px;
    width: min(370px, calc(100% - 22px));
  }
  .map-tip {
    display: none;
  }
  .camera-preview {
    left: 10px;
    bottom: 10px;
    width: min(320px, calc(100% - 90px));
    padding: 8px 10px;
  }
  #navControls {
    right: 9px;
    bottom: 38px;
  }
}
@media (max-width: 390px) {
  .crown-wordmark small {
    display: none;
  }
  .map-layer-buttons button {
    font-size: 9px;
  }
  #navControls button {
    width: 31px;
    min-height: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #sidebar button,
  .map-toolbar button,
  #navControls button,
  dialog button {
    transition: none;
  }
}
