* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: #1f2933;
  background: #e9edf1;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.login-overlay.hidden {
  display: none;
}

.login-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 14px;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 64px rgba(15, 23, 42, 0.28);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-title {
  font-size: 20px;
  font-weight: 650;
  color: #102a43;
}

.login-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #627d98;
}

.external-login {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #e6edf3;
}

.login-message {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.45;
  color: #52606d;
  overflow-wrap: anywhere;
}

.login-message.error {
  color: #b42318;
}

.login-message.success {
  color: #047857;
}

.link-button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  text-align: left;
  box-shadow: none;
}

.link-button:hover {
  text-decoration: underline;
}

.external-login[hidden] {
  display: none;
}

.external-login-title {
  font-size: 12px;
  color: #627d98;
}

.external-login-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.external-login-buttons button {
  min-height: 36px;
  background: #ffffff;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 300px;
  border-right: 1px solid #c9d1d9;
  background: #f7f9fb;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  transform: translateX(0);
  transition: transform 160ms ease;
}

.sidebar.dock-collapsed {
  transform: translateX(-300px);
  box-shadow: none;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 300px;
  height: 100%;
  padding: 18px;
  overflow: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 650;
  color: #102a43;
}

.dock-tab {
  position: fixed;
  top: 16px;
  left: 0;
  z-index: 12;
  width: 48px;
  min-height: 42px;
  padding: 0;
  border-radius: 0 6px 6px 0;
  border-left: 0;
  background: #ffffff;
  box-shadow: 4px 4px 16px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  font-weight: 650;
}

.dock-toggle {
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
}

.panel-title {
  font-size: 13px;
  font-weight: 650;
  color: #243b53;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #52606d;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  color: #102a43;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

details {
  display: grid;
  gap: 8px;
}

summary {
  cursor: pointer;
  font-size: 13px;
  color: #52606d;
}

summary + textarea {
  margin-top: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #486581;
  box-shadow: 0 0 0 2px rgba(72, 101, 129, 0.14);
}

.sample-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.field-caption {
  font-size: 12px;
  color: #52606d;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: center;
}

.account-status {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
  color: #486581;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row button.signed-in {
  border-color: #2f855a;
  background: #ecfdf3;
  color: #276749;
}

.share-view-button {
  width: 100%;
  min-height: 34px;
  font-size: 13px;
}

.share-view-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.fold-panel {
  gap: 10px;
}

.fold-panel details {
  gap: 0;
}

.fold-panel summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  color: #243b53;
  font-weight: 650;
  list-style-position: inside;
}

.summary-meta {
  justify-self: end;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #486581;
  font-size: 12px;
  text-align: center;
}

.fold-body {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.sample-gallery {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.sample-group {
  display: grid;
  gap: 6px;
}

.sample-group-title {
  color: #627d98;
  font-size: 12px;
  font-weight: 650;
}

.sample-list-item {
  min-height: 30px;
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-list-item.selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}

.layers-panel .layers,
.annotations-panel .annotation-list {
  max-height: 260px;
  overflow: auto;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel .button-row button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.annotation-panel > .button-row {
  display: none;
}

button {
  min-height: 36px;
  border: 1px solid #9fb3c8;
  border-radius: 6px;
  background: #ffffff;
  color: #243b53;
  cursor: pointer;
}

button:hover {
  background: #edf2f7;
}

button.active {
  border-color: #334e68;
  background: #334e68;
  color: #ffffff;
}

.status {
  min-height: 40px;
  padding: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.4;
  color: #486581;
}

.layers {
  display: grid;
  gap: 8px;
}

.layer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 86px 52px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
}

.layer-row input[type="range"] {
  padding: 0;
}

.layer-solo {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.viewer-surface {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  background: #d8dde3;
  overflow: hidden;
}

#viewerCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#viewerCanvas.dragging {
  cursor: grabbing;
}

#viewerCanvas.annotating {
  cursor: crosshair;
}

#viewerCanvas.selecting {
  cursor: default;
}

.annotation-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
}

.annotation-item {
  min-height: 30px;
  padding: 6px 8px;
  text-align: left;
  font-size: 13px;
}

.annotation-item.selected {
  border-color: #334e68;
  background: #d9e2ec;
}

.annotation-empty {
  padding: 8px;
  border: 1px dashed #bcccdc;
  border-radius: 6px;
  color: #829ab1;
  font-size: 13px;
}

.hud {
  display: none;
}

.map-command-bar {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(260px, 500px) 38px 38px 42px;
  gap: 5px;
  align-items: center;
  width: min(670px, calc(100vw - 120px));
  max-width: calc(100vw - 36px);
  padding: 6px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  transition: border-radius 140ms ease, width 140ms ease;
  transform: translateX(-50%);
}

.map-command-bar:hover,
.map-command-bar:focus-within,
.map-command-bar.expanded {
  width: min(720px, calc(100vw - 120px));
  border-radius: 8px;
}

.map-command-bar input,
.map-command-bar select {
  min-height: 38px;
  padding: 7px 34px 7px 12px;
  border-color: transparent;
  background: #f7f9fb;
}

.map-command-bar input[list] {
  background-image:
    linear-gradient(45deg, transparent 50%, #52606d 50%),
    linear-gradient(135deg, #52606d 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 12px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.map-command-bar button {
  min-height: 38px;
}

.quick-command {
  opacity: 1;
  pointer-events: auto;
}

.gps-follow-button {
  width: 42px;
  min-width: 42px;
  font-size: 11px;
  letter-spacing: 0;
}

.gps-follow-button.active {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.login-command {
  min-width: 58px;
  min-height: 38px;
  padding: 0 10px;
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 650;
}

.login-command:hover {
  background: #1d4ed8;
}

.login-command.signed-in {
  border-color: #2f855a;
  background: #ecfdf3;
  color: #276749;
}

.login-command.signed-in:hover {
  background: #d1fae5;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 8px;
  font-weight: 650;
}

.layer-switcher {
  position: absolute;
  left: 16px;
  bottom: 30px;
  z-index: 7;
  transition: left 160ms ease;
}

.sidebar:not(.dock-collapsed) + .viewer-surface .layer-switcher {
  left: 316px;
}

.layer-cycle-button {
  position: relative;
  display: block;
  width: 74px;
  min-width: 74px;
  height: 74px;
  min-height: 74px;
  padding: 8px;
  border-color: rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.layer-preview {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(54, 179, 126, 0.9), rgba(0, 184, 217, 0.74)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 6px, rgba(15, 23, 42, 0.18) 6px 12px);
}

.layer-cycle-button #layerCycleLabel {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  overflow: hidden;
  padding: 4px 5px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-popover {
  position: absolute;
  left: 0;
  bottom: 84px;
  width: min(280px, calc(100vw - 36px));
  max-height: min(420px, calc(100vh - 180px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}

.hidden {
  display: none !important;
}

.popover-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 650;
  color: #243b53;
}

.floating-layer-list {
  display: grid;
  gap: 8px;
}

.floating-layer-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid #d9e2ec;
  border-radius: 7px;
  background: #ffffff;
  text-align: left;
}

.floating-layer-name {
  min-width: 0;
  min-height: 28px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #243b53;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-layer-name:hover {
  background: transparent;
}

.floating-layer-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.floating-layer-item.current {
  box-shadow: inset 3px 0 0 #2563eb;
}

.floating-layer-item input[type="range"] {
  width: 48px;
  height: 18px;
  padding: 0;
}

.floating-toolbar {
  position: absolute;
  right: 16px;
  bottom: 86px;
  z-index: 7;
  display: grid;
  gap: 8px;
}

.floating-toolbar .icon-button {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.18);
}

.floating-toolbar .icon-button.active {
  border-color: #334e68;
  background: #334e68;
  color: #ffffff;
}

.annotation-toolbar {
  position: absolute;
  top: 76px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 36px);
  padding: 6px;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.tool-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1;
}

.tool-icon-button.active {
  border-color: #334e68;
  background: #334e68;
  color: #ffffff;
}

.tool-icon-button.danger {
  color: #b42318;
}

.annotation-symbol {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.text-symbol {
  font-size: 18px;
  font-weight: 650;
}

.annotation-tool-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  color: currentColor;
}

.point-icon::before {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.line-icon::before {
  position: absolute;
  top: 9px;
  left: 1px;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-36deg);
}

.polyline-icon {
  background:
    radial-gradient(circle at 2px 15px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 9px 6px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 17px 13px, currentColor 0 2px, transparent 2.5px);
}

.polyline-icon::before,
.polyline-icon::after {
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform-origin: left center;
}

.polyline-icon::before {
  top: 13px;
  left: 3px;
  transform: rotate(-52deg);
}

.polyline-icon::after {
  top: 7px;
  left: 10px;
  transform: rotate(40deg);
}

.rectangle-icon::before {
  position: absolute;
  inset: 3px 2px;
  border: 2px solid currentColor;
  content: "";
}

.polygon-icon::before {
  position: absolute;
  inset: 1px;
  background: currentColor;
  clip-path: polygon(50% 0, 95% 35%, 78% 92%, 22% 92%, 5% 35%);
  content: "";
}

.polygon-icon::after {
  position: absolute;
  inset: 4px;
  background: #ffffff;
  clip-path: polygon(50% 0, 95% 35%, 78% 92%, 22% 92%, 5% 35%);
  content: "";
}

.tool-icon-button.active .polygon-icon::after {
  background: #334e68;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 3px;
  background: #d9e2ec;
}

.bottom-drawer {
  position: absolute;
  right: 68px;
  bottom: 46px;
  left: 188px;
  z-index: 6;
  max-height: 230px;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid #d9e2ec;
}

.drawer-title {
  font-size: 14px;
  font-weight: 650;
  color: #102a43;
}

.drawer-content {
  display: flex;
  gap: 10px;
  min-height: 132px;
  padding: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.drawer-content.info-panel-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
}

.instance-row,
.analysis-point-row {
  flex: 0 0 260px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}

.instance-name,
.analysis-point-row {
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #243b53;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-point-row {
  grid-template-columns: minmax(0, 1fr);
  cursor: pointer;
}

.instance-row button {
  min-height: 26px;
  padding: 0 7px;
  font-size: 11px;
}

.instance-option-row {
  flex-basis: 170px;
  grid-template-columns: auto minmax(0, 1fr);
  color: #334e68;
}

.info-cell.section-title {
  flex: 1 0 100%;
  padding: 2px 0 4px;
  border: 0;
  background: transparent;
  font-weight: 650;
  color: #102a43;
}

.thumb-card {
  flex: 0 0 148px;
  display: grid;
  grid-template-rows: 84px auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.thumb-card:hover {
  border-color: #829ab1;
  background: #f7f9fb;
}

.thumb-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.thumb-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 84px;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 650;
  background:
    linear-gradient(145deg, rgba(16, 42, 67, 0.86), rgba(72, 101, 129, 0.52)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 8px, rgba(0, 0, 0, 0.08) 8px 16px);
  overflow: hidden;
}

.thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-image.loading::after {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  content: "";
  animation: thumbnail-spin 700ms linear infinite;
}

@keyframes thumbnail-spin {
  to { transform: rotate(360deg); }
}

.thumb-title {
  overflow: hidden;
  color: #243b53;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  width: 100%;
}

.info-cell {
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
  color: #486581;
}

.info-cell strong {
  display: block;
  margin-bottom: 3px;
  color: #102a43;
}

.compact-empty {
  padding: 6px 0;
}

.map-point-actions {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
}

.map-point-actions button {
  min-height: 32px;
  padding: 0 14px;
}

.map-point-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  width: 100%;
}

.map-point-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 58px;
  padding: 9px 10px;
  text-align: left;
}

.map-point-row strong {
  color: #102a43;
}

.map-point-row span {
  overflow: hidden;
  max-width: 100%;
  color: #486581;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-point-row.selected {
  border-color: #dc2626;
  background: #fff1f2;
}

.map-cluster-popup {
  position: absolute;
  z-index: 32;
  width: min(320px, calc(100vw - 24px));
  max-height: min(380px, calc(100vh - 96px));
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.map-cluster-popup-title {
  color: #102a43;
  font-size: 14px;
  font-weight: 700;
}

.map-cluster-popup-subtitle {
  margin-top: 2px;
  color: #627d98;
  font-size: 12px;
}

.map-cluster-popup-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  margin-top: 10px;
  overflow: auto;
}

.map-cluster-popup-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 46px;
  padding: 8px 9px;
  text-align: left;
}

.map-cluster-popup-row strong {
  color: #102a43;
}

.map-cluster-popup-row span {
  overflow: hidden;
  max-width: 100%;
  color: #486581;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-info-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(760px, calc(100vw - 112px));
  min-height: 18px;
  padding: 2px 12px;
  border-top: 1px solid rgba(31, 41, 51, 0.12);
  border-left: 1px solid rgba(31, 41, 51, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #243b53;
  font-size: 11px;
}

.viewer-context-menu {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 172px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
}

.viewer-context-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  padding: 0 10px;
}

.viewer-context-menu button:hover {
  background: #edf2f7;
}

.clean-view-exit {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 31;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #102a43;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2);
  font-size: 12px;
  font-weight: 650;
}

body.clean-view .map-command-bar,
body.clean-view .layer-switcher,
body.clean-view .floating-toolbar,
body.clean-view .annotation-toolbar,
body.clean-view .bottom-drawer,
body.clean-view .bottom-info-bar,
body.clean-view .dock-tab {
  display: none !important;
}

body.clean-view .sidebar {
  transform: translateX(-300px);
  box-shadow: none;
}

body.clean-view .clean-view-exit {
  display: inline-grid !important;
  place-items: center;
}

.sample-info {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-info {
  color: #52606d;
  white-space: nowrap;
}

.scale-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 98px;
  color: #102a43;
}

.scale-line {
  width: 72px;
  height: 7px;
  border-right: 2px solid #102a43;
  border-bottom: 2px solid #102a43;
  border-left: 2px solid #102a43;
}

.scale-label {
  font-size: 11px;
  white-space: nowrap;
}

.annotation-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2933;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.32);
}

.annotation-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.annotation-dialog form {
  display: grid;
  max-height: calc(100vh - 30px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.annotation-dialog-head,
.annotation-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.annotation-dialog-head {
  border-bottom: 1px solid #d9e2ec;
}

.annotation-dialog-title {
  color: #102a43;
  font-size: 16px;
  font-weight: 650;
}

.annotation-dialog-type {
  margin-top: 2px;
  color: #627d98;
  font-size: 12px;
}

.dialog-close-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  font-size: 22px;
}

.annotation-dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.annotation-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.annotation-form-grid input[type="color"] {
  min-height: 38px;
  padding: 4px;
}

.annotation-form-grid input[type="range"] {
  min-height: 38px;
  padding: 0;
}

.annotation-geometry-summary {
  padding: 9px 10px;
  border-left: 3px solid #829ab1;
  background: #f4f7fa;
  color: #52606d;
  font-size: 12px;
  line-height: 1.45;
}

.annotation-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid #d9e2ec;
}

.annotation-dialog-actions button {
  min-width: 88px;
  padding: 0 14px;
}

.primary-button {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.primary-button:hover {
  background: #1d4ed8;
}

@media (max-width: 760px) {
  .sidebar {
    width: min(300px, calc(100vw - 48px));
  }

  .sidebar.dock-collapsed {
    transform: translateX(calc(-1 * min(300px, calc(100vw - 48px))));
  }

  .sidebar-content {
    width: min(300px, calc(100vw - 48px));
  }

  .sidebar:not(.dock-collapsed) + .viewer-surface .layer-switcher {
    left: calc(min(300px, calc(100vw - 48px)) + 8px);
  }

  .map-command-bar {
    left: calc(50% + 18px);
    right: auto;
    width: calc(100vw - 76px);
    grid-template-columns: minmax(0, 1fr) 38px 38px 42px;
    max-width: calc(100vw - 76px);
  }

  .map-command-bar:hover,
  .map-command-bar:focus-within,
  .map-command-bar.expanded {
    width: auto;
  }

  .layer-switcher {
    left: 10px;
    bottom: 28px;
  }

  .layer-cycle-button {
    width: 64px;
    min-width: 64px;
    height: 64px;
    min-height: 64px;
  }

  .bottom-drawer {
    left: 10px;
    right: 58px;
  }

  .annotation-toolbar {
    top: 70px;
    overflow-x: auto;
  }

  .annotation-form-grid {
    grid-template-columns: 1fr;
  }

  .bottom-info-bar {
    max-width: calc(100vw - 86px);
    padding: 2px 8px;
  }

  .cursor-info {
    display: none;
  }
}
