@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --navy-950: #4a1118;
  --navy-900: #651b25;
  --navy-700: #7a3037;
  --teal-700: #a8323f;
  --teal-600: #c44955;
  --teal-100: #f7e8ea;
  --ink-900: #182b3a;
  --ink-700: #435767;
  --ink-500: #718291;
  --line: #e2e8ed;
  --surface: #ffffff;
  --canvas: #f7f4f4;
  --shadow-card: 0 12px 32px rgb(22 46 65 / 7%);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(11 146 146 / 28%);
  outline-offset: 2px;
}

.app-shell {
  display: flex;
  height: 100vh;
  min-height: 640px;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  z-index: 500;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid #e8edf0;
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 68px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fff;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-copy strong span {
  color: var(--teal-700);
  font-weight: 600;
}

.brand-copy small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
}

.header-right,
.account {
  display: flex;
  align-items: center;
}

.header-right {
  gap: 22px;
}

.workspace-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 600;
}

.live-dot,
.status-indicator,
.source-state,
.caption-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #16a77a;
  box-shadow: 0 0 0 3px rgb(22 167 122 / 12%);
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.header-link:hover,
.toolbar-link:hover {
  color: var(--teal-700);
}

.header-link svg {
  width: 18px;
  height: 18px;
}

.account {
  gap: 9px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #e7f2f1;
  color: var(--teal-700);
  font-size: 14px;
  font-weight: 700;
}

.account-name {
  max-width: 140px;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name small {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 500;
}

.header-right form {
  margin: 0;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-button:hover {
  border-color: #c8d8dc;
  background: var(--teal-100);
  color: var(--teal-700);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.map-toolbar {
  display: flex;
  flex: 0 0 auto;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  background: var(--canvas);
}

.toolbar-heading .eyebrow,
.eyebrow {
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
}

.toolbar-heading h1 {
  margin: 4px 0 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

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

.button-secondary {
  border-color: #c9dcdf;
  background: #fff;
  color: var(--teal-700);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--teal-600);
  background: #f2fbfa;
}

.button-quiet {
  border-color: var(--line);
  background: #fff;
  color: var(--ink-700);
}

.button-quiet:hover:not(:disabled) {
  border-color: #c9dcdf;
  background: #f8fafb;
}

.button-full {
  width: 100%;
}

.map-workspace {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  padding: 0 20px 16px;
  overflow: hidden;
}

.map-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  padding: 21px 17px 15px;
  border: 1px solid #e7edf0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.sidebar-intro {
  padding: 1px 2px 17px;
}

.sidebar-intro h2 {
  margin: 7px 0 5px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.35px;
}

.sidebar-intro p,
.sidebar-hint {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-section {
  padding: 15px 0;
  border-top: 1px solid #edf1f3;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}

.section-title h3 {
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 700;
}

.section-count {
  color: #91a0ac;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.status-card {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e4efed;
  border-radius: 9px;
  background: #f6fbfa;
}

.status-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #e5f4f1;
  color: var(--teal-700);
}

.status-icon svg {
  width: 17px;
  height: 17px;
}

#status {
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.status-indicator {
  width: 7px;
  height: 7px;
}

.source-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e8edf0;
  border-radius: 9px;
  background: #fff;
}

.source-type {
  display: grid;
  width: 34px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: #e8f4f3;
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.source-card div {
  min-width: 0;
  flex: 1;
}

.source-card strong,
.source-card small {
  display: block;
}

.source-card strong {
  font-size: 11px;
}

.source-card small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.source-state {
  width: 6px;
  height: 6px;
}

.risk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin: -2px 0 9px;
  color: var(--ink-500);
  font-size: 9px;
}

.risk-refresh {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
}

.risk-refresh:hover:not(:disabled) {
  border-color: #b7d8d4;
  background: #f0f9f7;
  color: var(--teal-700);
}

.risk-refresh:disabled {
  cursor: wait;
  opacity: 0.55;
}

.risk-refresh svg {
  width: 15px;
  height: 15px;
}

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

.risk-filters label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 2px;
  border-radius: 5px;
  color: var(--ink-700);
  font-size: 9px;
  cursor: pointer;
}

.risk-filters label:hover {
  background: #f5f8f9;
}

.risk-filters input {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--teal-700);
}

.risk-filter-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.risk-dot-weather { background: #2583a8; }
.risk-dot-earthquake { background: #dc7045; }
.risk-dot-flood { background: #3283d1; }
.risk-dot-fire { background: #df563f; }
.risk-dot-volcano { background: #8251af; }
.risk-dot-public-safety { background: #aa5968; }
.risk-dot-roadblock { background: #bd8b28; }
.risk-dot-traffic-incident { background: #7d62b5; }
.risk-dot-insecurity { background: #b33f55; }

.risk-list {
  display: grid;
  max-height: 240px;
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
}

.map-search-section,
.route-search-section {
  display: grid;
  gap: 8px;
}

.map-search-section .section-title,
.route-search-section .section-title {
  margin-bottom: 0;
}

.map-search-form,
.address-search-form {
  display: grid;
  gap: 6px;
}

.search-input-row {
  display: flex;
  min-width: 0;
  gap: 5px;
}

.search-input-row .saved-map-input {
  width: 0;
  min-width: 0;
  flex: 1;
}

.search-input-row .button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 9px;
  font-size: 10px;
}

.map-search-results,
.address-results {
  display: grid;
  max-height: 190px;
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
}

.search-result-summary {
  margin: 0;
  color: var(--ink-500);
  font-size: 9px;
}

.map-search-result,
.address-result {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  max-width: 100%;
  padding: 8px;
  overflow: hidden;
  border: 1px solid #e2e8ed;
  border-radius: 7px;
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search-result:hover,
.address-result:hover {
  border-color: #9dcac7;
  background: #f3fbfa;
}

.route-search-section > .saved-map-status {
  overflow-wrap: anywhere;
}

.saved-maps-section,
.services-section,
.map-logbook-section {
  display: grid;
  gap: 7px;
}

.field-label {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.saved-map-save-row,
.saved-map-actions {
  display: flex;
  gap: 5px;
}

.saved-map-input,
.saved-map-select {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #dce5e8;
  border-radius: 7px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
  font-size: 10px;
}

.saved-map-input {
  flex: 1;
}

.service-input {
  width: 100%;
  flex: initial;
}

.service-add-actions {
  display: flex;
  gap: 6px;
}

.service-add-actions .button {
  min-height: 31px;
  flex: 1;
  padding: 0 7px;
  font-size: 9px;
}

.service-layers,
.map-note-list {
  display: grid;
  max-height: 190px;
  gap: 5px;
  overflow: auto;
}

.service-layer-item,
.map-note-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid #e1e9eb;
  border-radius: 7px;
  background: #fff;
}

.service-layer-name,
.map-note-summary {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 9px;
  text-overflow: ellipsis;
}

.service-layer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.service-layer-actions input[type="color"] {
  width: 25px;
  height: 20px;
  padding: 1px;
  border: 1px solid #dce5e8;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.service-layer-remove,
.map-note-action {
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: var(--teal-700);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
}

.service-layer-remove:hover,
.map-note-action:hover {
  color: #a33b3b;
}

.map-note-input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  padding: 8px;
  border: 1px solid #dce5e8;
  border-radius: 7px;
  color: var(--ink-700);
  font: inherit;
  font-size: 10px;
}

.map-note-input:focus {
  border-color: var(--teal-600);
  outline: 2px solid rgb(11 146 146 / 16%);
}

.map-note-item {
  align-items: flex-start;
}

.map-note-summary {
  display: grid;
  gap: 3px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.map-note-summary small {
  color: var(--ink-500);
  font-size: 8px;
}

.saved-map-input:focus,
.saved-map-select:focus {
  border-color: var(--teal-600);
  outline: 2px solid rgb(11 146 146 / 16%);
}

.saved-map-save-row .button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 10px;
}

.saved-map-select {
  width: 100%;
}

.saved-map-actions .button {
  min-height: 29px;
  flex: 1;
  padding: 0 5px;
  font-size: 9px;
}

.saved-map-status {
  min-height: 12px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}

.layer-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-700);
  font-size: 9px;
}

.layer-color-row input[type="color"],
.kml-layer-item input[type="color"] {
  width: 28px;
  height: 22px;
  flex: 0 0 auto;
  padding: 1px;
  border: 1px solid #dce5e8;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.risk-item {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 7px;
  border: 1px solid #e8edf0;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.risk-item:hover {
  border-color: #b8d7d4;
  background: #f7fbfa;
}

.risk-item-marker {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 6px;
  font-weight: 800;
}

.risk-item-content {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.risk-item-content strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.risk-item-content > span {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-item-time {
  flex: 0 0 auto;
  padding-top: 2px;
  color: #8a98a2;
  font-size: 8px;
  white-space: nowrap;
}

.risk-empty {
  margin: 3px 0;
  padding: 9px;
  border: 1px dashed #dce5e8;
  border-radius: 7px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.5;
}

.sidebar-hint {
  margin: 8px 1px 0;
  font-size: 10px;
}

.import-section {
  padding-bottom: 12px;
}

.upload-card {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px dashed #b9d1d1;
  border-radius: 10px;
  background: #f8fcfb;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.upload-card:hover,
.upload-card.is-dragging {
  transform: translateY(-1px);
  border-color: var(--teal-600);
  background: #eff9f7;
}

.upload-icon {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 2px;
  place-items: center;
  border-radius: 9px;
  background: #e2f2ef;
  color: var(--teal-700);
}

.upload-icon svg {
  width: 18px;
  height: 18px;
}

.upload-card strong {
  color: var(--ink-700);
  font-size: 10px;
}

.upload-card small {
  color: var(--ink-500);
  font-size: 9px;
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.upload-card:focus-within {
  outline: 3px solid rgb(11 146 146 / 28%);
  outline-offset: 2px;
}

.kml-layers:empty {
  display: none;
}

.kml-layers {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.kml-layer-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e1e9eb;
  border-radius: 7px;
  background: #fff;
}

.kml-layer-details {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kml-layer-item input[type="color"] {
  width: 25px;
  height: 20px;
}

.kml-layer-remove {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--teal-700);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
}

.kml-layer-remove:hover {
  color: #a33b3b;
}

.sidebar-section .button-full {
  min-height: 32px;
  margin-top: 8px;
  font-size: 10px;
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: auto;
  padding: 12px 2px 0;
  color: #84939f;
  font-size: 9px;
  line-height: 1.55;
}

.sidebar-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #779096;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dfe7ea;
  border-radius: 14px;
  background: #e8eff0;
  box-shadow: var(--shadow-card);
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-caption {
  position: absolute;
  z-index: 400;
  right: 12px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgb(226 232 237 / 85%);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 14px rgb(20 40 56 / 10%);
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
  pointer-events: none;
}

.risk-marker {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgb(16 42 67 / 35%);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.risk-marker-weather { background: #2583a8; }
.risk-marker-earthquake { background: #dc7045; }
.risk-marker-flood { background: #3283d1; }
.risk-marker-fire { background: #df563f; }
.risk-marker-volcano { background: #8251af; }
.risk-marker-public-safety { background: #aa5968; }
.risk-marker-roadblock { background: #bd8b28; }
.risk-marker-traffic-incident { background: #7d62b5; }
.risk-marker-insecurity { background: #b33f55; }

.drawn-point-marker {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgb(16 42 67 / 45%);
}

.map-note-marker {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #d5842f;
  box-shadow: 0 2px 6px rgb(16 42 67 / 40%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.placing-map-note {
  cursor: crosshair;
}

.risk-popup-category,
.risk-popup-title,
.risk-popup-location,
.risk-popup-summary,
.risk-popup-source {
  display: block;
}

.risk-popup-category {
  margin-bottom: 5px;
  color: var(--teal-700);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.risk-popup-title {
  margin-bottom: 6px;
  color: var(--ink-900);
  font-size: 12px;
  line-height: 1.4;
}

.risk-popup-location,
.risk-popup-summary,
.risk-popup-source {
  margin-top: 5px;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.risk-popup-summary {
  color: var(--ink-500);
}

.risk-popup-source {
  font-weight: 600;
}

.risk-popup-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--teal-700) !important;
  font-size: 10px;
  font-weight: 700;
}

.caption-dot {
  width: 6px;
  height: 6px;
}

.app-footer {
  display: flex;
  flex: 0 0 34px;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px 8px;
  color: #8795a0;
  font-size: 9px;
}

.footer-divider {
  padding: 0 4px;
  color: #bac4cb;
}

/* Leaflet control styling */
.leaflet-container {
  font: inherit;
}

.leaflet-bar,
.leaflet-control-layers {
  border: 1px solid rgb(222 231 234 / 95%) !important;
  border-radius: 9px !important;
  box-shadow: 0 5px 18px rgb(19 43 59 / 13%) !important;
}

.leaflet-bar a {
  color: var(--navy-900) !important;
}

.leaflet-bar a:hover {
  background-color: #edf7f6 !important;
  color: var(--teal-700) !important;
}

.leaflet-control-layers {
  padding: 5px;
  color: var(--ink-700);
}

.leaflet-control-layers-expanded {
  padding: 9px 12px;
}

.leaflet-control-layers label {
  margin: 4px 0;
  font-size: 11px;
}

.leaflet-control-scale-line {
  border-color: #637985;
  background: rgb(255 255 255 / 86%);
  color: var(--ink-700);
  font-size: 9px;
}

.leaflet-control-attribution {
  border-radius: 5px 0 0;
  background: rgb(255 255 255 / 82%) !important;
  font-size: 9px !important;
}

/* Authentication and user administration */
.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at 82% 18%, rgb(33 117 132 / 17%), transparent 29rem),
    linear-gradient(135deg, #edf3f5 0%, #f7f9fa 52%, #e8f1f1 100%);
}

.auth-layout {
  display: grid;
  width: min(100%, 930px);
  min-height: 560px;
  grid-template-columns: 1fr 0.88fr;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(16 42 67 / 15%);
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 35px;
  background:
    radial-gradient(ellipse at 76% 74%, rgb(196 73 85 / 28%), transparent 36%),
    linear-gradient(145deg, #4a1118 0%, #651b25 58%, #9b3040 100%);
  color: #fff;
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  right: -120px;
  bottom: 40px;
  width: 440px;
  height: 440px;
  border: 1px solid rgb(139 224 214 / 23%);
  border-radius: 50%;
  content: "";
}

.auth-visual::after {
  right: -65px;
  bottom: 95px;
  width: 330px;
  height: 330px;
  border-color: rgb(139 224 214 / 17%);
}

.auth-visual .brand {
  position: relative;
  z-index: 1;
  color: #fff;
}

.auth-visual .brand-copy small {
  color: #9db8c6;
}

.auth-visual .brand-copy strong span {
  color: #78d7cb;
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 390px;
  padding-bottom: 22px;
}

.auth-visual-copy .eyebrow {
  color: #84d8cf;
}

.auth-visual-copy h1 {
  margin: 14px 0 12px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: clamp(29px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.13;
}

.auth-visual-copy p {
  max-width: 340px;
  color: #c4d5dd;
  font-size: 13px;
  line-height: 1.8;
}

.auth-visual-footer {
  position: relative;
  z-index: 1;
  color: #a7bfca;
  font-size: 10px;
}

.auth-card {
  align-self: center;
  padding: 48px 45px;
}

.auth-card h2 {
  margin: 0 0 7px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 24px;
  letter-spacing: -0.7px;
}

.auth-description {
  margin: 0 0 27px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.6;
}

.auth-card form {
  display: grid;
  gap: 9px;
}

.auth-card label,
.create-user-form label {
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 700;
}

.auth-card input,
.create-user-form input,
.create-user-form select,
.inline-form input,
.inline-form select {
  min-width: 0;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #dbe3e7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-900);
  font: inherit;
  font-size: 12px;
}

.auth-card input {
  margin-bottom: 9px;
}

.auth-card input::placeholder,
.inline-form input::placeholder {
  color: #a3afb8;
}

.auth-card input:focus,
.create-user-form input:focus,
.create-user-form select:focus,
.inline-form input:focus,
.inline-form select:focus {
  border-color: #69bdb6;
}

.auth-submit,
.create-user-form button,
.inline-form button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: var(--navy-950);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-submit:hover,
.create-user-form button:hover,
.inline-form button:hover {
  transform: translateY(-1px);
  background: var(--teal-700);
}

.notice {
  margin: 0 0 15px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
}

.notice-error {
  border-color: #f1d0d0;
  background: #fff3f2;
  color: #a13e3e;
}

.notice-success {
  border-color: #cce8da;
  background: #eff9f3;
  color: #28714e;
}

.notice-warning {
  border-color: #f0dfb6;
  background: #fff9e9;
  color: #856420;
}

.users-page {
  min-height: 100vh;
  background: var(--canvas);
}

.users-page .app-header {
  min-height: 68px;
}

.users-content {
  display: block;
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  padding: 30px 0 45px;
}

.users-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.users-page-heading h1 {
  margin: 5px 0 4px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 25px;
  letter-spacing: -0.8px;
}

.users-page-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
}

.user-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 700;
}

.user-count strong {
  color: var(--teal-700);
}

.user-panel {
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid #e5ebee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 22px rgb(22 46 65 / 4%);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 17px;
}

.panel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--teal-100);
  color: var(--teal-700);
}

.panel-icon svg {
  width: 18px;
  height: 18px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.panel-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
}

.create-user-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.8fr auto;
  align-items: end;
  gap: 10px;
}

.form-field {
  display: grid;
  gap: 7px;
}

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

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.users-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #8795a0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}

.users-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1f3;
  color: var(--ink-700);
  font-size: 11px;
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: 0;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-900);
  font-weight: 700;
}

.user-row-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #eef3f6;
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 700;
}

.you-tag {
  margin-left: 4px;
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.inline-form select {
  min-height: 34px;
  padding: 0 8px;
  font-size: 10px;
}

.inline-form input {
  min-height: 34px;
  width: 150px;
  font-size: 10px;
}

.inline-form button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-navigation {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 10px;
  padding: 6px 0 4px;
}

.sidebar-nav-btn {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.sidebar-nav-btn::after {
  content: "+";
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf5f4;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.sidebar-nav-btn:hover {
  border-color: #bfd9d7;
  background: #f3fbfa;
  color: var(--teal-700);
}

.sidebar-nav-btn.active {
  border-color: #b7d9d5;
  background: linear-gradient(180deg, #effaf9 0%, #f7fbfb 100%);
  color: var(--teal-700);
  box-shadow: inset 0 0 0 1px rgb(8 126 131 / 8%);
}

.sidebar-nav-btn.active::after {
  content: "−";
}

.sidebar-accordion-panels {
  display: block;
  margin-top: 8px;
  border-top: 1px solid #edf1f3;
}

.sidebar-panel {
  display: block;
  padding: 8px 0 0;
}

.sidebar-panel[hidden] {
  display: none !important;
}

.sidebar-section[hidden] {
  display: none !important;
}

@media (min-width: 1500px) {
  .map-workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .map-workspace {
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 11px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .map-sidebar {
    padding-right: 13px;
    padding-left: 13px;
  }

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

@media (max-width: 700px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-header {
    min-height: 62px;
    padding: 0 15px;
  }

  .brand-mark {
    width: 60px;
    height: 37px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .header-right {
    gap: 10px;
  }

  .workspace-label,
  .account-name,
  .header-link {
    display: none;
  }

  .account {
    padding-left: 0;
    border-left: 0;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 15px 16px 13px;
  }

  .toolbar-heading h1 {
    font-size: 20px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button-secondary {
    flex: 1;
  }

  .map-workspace {
    min-height: 0;
    flex: initial;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 62vh);
    gap: 11px;
    padding: 0 10px 12px;
  }

  .map-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 13px;
    padding: 14px;
  }

  .sidebar-intro {
    grid-column: 1 / -1;
    padding-bottom: 12px;
  }

  .sidebar-intro h2 {
    font-size: 15px;
  }

  .sidebar-section {
    padding: 11px 0;
  }

  .sidebar-note {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .map-stage {
    min-height: 420px;
  }

  .app-footer {
    padding: 0 12px 9px;
    font-size: 8px;
  }

  .app-footer span:last-child {
    display: none;
  }

  .auth-page {
    padding: 14px;
  }

  .auth-layout {
    width: min(100%, 440px);
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 210px;
    padding: 23px;
  }

  .auth-visual::before {
    right: -200px;
    bottom: -180px;
  }

  .auth-visual::after {
    right: -160px;
    bottom: -130px;
  }

  .auth-visual-copy {
    padding: 28px 0 0;
  }

  .auth-visual-copy h1 {
    max-width: 340px;
    margin: 8px 0;
    font-size: 27px;
  }

  .auth-visual-copy p,
  .auth-visual-footer {
    display: none;
  }

  .auth-card {
    padding: 27px 24px 30px;
  }

  .users-content {
    width: calc(100% - 24px);
    padding-top: 21px;
  }

  .users-page-heading {
    align-items: flex-start;
  }

  .users-page-heading h1 {
    font-size: 21px;
  }

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

  .users-table {
    min-width: 700px;
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    font-size: 8px;
  }

  .map-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar-intro,
  .sidebar-note {
    grid-column: 1;
  }

  .toolbar-actions .button {
    padding: 0 9px;
    font-size: 10px;
  }

  .users-page-heading {
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
