:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --text: #17211c;
  --muted: #5d6962;
  --line: #d6ddd7;
  --accent: #197b5b;
  --accent-2: #b86b22;
  --danger: #b33636;
  --shadow: 0 10px 28px rgba(27, 37, 31, 0.12);
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --statusbar-height: 38px;
  --project-notes-height: clamp(180px, 34dvh, 340px);
  --field-route-bottom-reserve: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: var(--safe-top);
  background: #ffffff;
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 100dvh;
  min-width: 320px;
  overflow: visible;
  padding-bottom: calc(42px + var(--safe-bottom));
}

.topbar {
  display: grid;
  grid-template-areas:
    "brand project export status"
    "tabs tabs tabs tabs";
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 8px 12px;
  padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right)) 10px calc(12px + var(--safe-left));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 108px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
  border-right-color: var(--accent-2);
  transform: rotate(45deg);
}

.brand-name {
  font-weight: 750;
  letter-spacing: 0;
}

.toolbar,
.legacy-editor-tools,
.exportbar,
.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar {
  flex-wrap: wrap;
}

.legacy-editor-tools {
  grid-area: tabs;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.legacy-editor-tools::-webkit-scrollbar {
  display: none;
}

.legacy-editor-tools[hidden] {
  display: none !important;
}

.exportbar {
  grid-area: export;
  position: relative;
  justify-content: flex-end;
}

.project-summary-button,
.project-select,
.room-select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-weight: 650;
}

.project-summary-button {
  grid-area: project;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 9px 0 11px;
  text-align: left;
}

.project-summary-button:hover {
  background: var(--surface-2);
}

.project-summary-title,
.project-summary-room,
.project-summary-photo {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-summary-path {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.project-summary-title {
  font-size: 13px;
  font-weight: 850;
}

.project-summary-room {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-summary-photo {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.project-summary-separator {
  flex: 0 0 auto;
  color: #a6afa9;
  font-size: 12px;
  font-weight: 800;
}

.project-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.export-menu {
  position: relative;
}

.export-menu > summary {
  list-style: none;
}

.export-menu > summary::-webkit-details-marker {
  display: none;
}

.export-menu[open] .export-menu-button {
  border-color: rgba(25, 123, 91, 0.45);
  background: #edf7f1;
  color: var(--accent);
}

.export-options {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  display: grid;
  gap: 6px;
  min-width: 172px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.export-option {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
  font-weight: 750;
}

.export-option:hover {
  background: var(--surface-2);
}

.export-option:disabled {
  cursor: default;
  color: #9aa39d;
}

.status-icons {
  grid-area: status;
  justify-content: flex-end;
}

.top-measure-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(238, 242, 237, 0.74);
  overflow: hidden;
}

.top-measure-tab {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  text-align: left;
  overflow: hidden;
}

.top-measure-tab strong,
.top-measure-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-measure-tab strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.08;
}

.top-measure-tab span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.top-measure-tab:hover,
.top-measure-tab[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.42);
  background: rgba(25, 123, 91, 0.1);
}

.top-measure-tab[data-active="true"] strong,
.top-measure-tab[data-active="true"] span {
  color: var(--accent);
}

.kalka-request-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 76px;
  max-width: 146px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid rgba(184, 107, 34, 0.28);
  border-radius: 999px;
  background: #fffaf1;
  color: #7a531a;
  padding: 0 11px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.kalka-request-chip:hover,
.kalka-request-chip[aria-expanded="true"] {
  border-color: rgba(25, 123, 91, 0.36);
  background: #edf7f1;
  color: var(--accent);
}

.kalka-request-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(184, 107, 34, 0.13);
}

.about-button {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.ble-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 58px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  overflow: hidden;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.ble-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a3aba6;
}

.ble-status-mark {
  font-size: 12px;
}

.ble-status-chip.is-connected {
  border-color: rgba(25, 123, 91, 0.35);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(25, 123, 91, 0.08);
}

.ble-status-chip.is-connected .ble-status-dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(25, 123, 91, 0.75);
}

.ble-status-chip.is-connecting .ble-status-dot,
.ble-status-chip.is-reconnecting .ble-status-dot,
.ble-status-chip.is-scanning .ble-status-dot {
  background: var(--accent-2);
  animation: blePulse 1.1s ease-in-out infinite;
}

.ble-status-chip.is-measuring .ble-status-dot {
  background: #2d6f9f;
  box-shadow: 0 0 12px rgba(45, 111, 159, 0.85);
}

.ble-status-chip.is-error .ble-status-dot {
  background: var(--danger);
}

@keyframes blePulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.tool-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0 12px;
  font-weight: 650;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.tool-button:hover,
.icon-button:hover {
  background: var(--surface-2);
}

.tool-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.tool-button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
}

.tool-button.primary:hover {
  background: #136448;
}

.tool-button.danger {
  color: var(--danger);
}

.tool-button.active {
  border-color: rgba(25, 123, 91, 0.45);
  background: #edf7f1;
  color: var(--accent);
}

.tool-button.danger:disabled,
.tool-button:disabled,
.icon-button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

#photoInput,
#galleryPhotoInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}

body[data-metrio-service-route="monotask-order"] .app-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.service-order-route {
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: #f8fbf8;
  padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
}

.service-order-shell {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
}

.service-order-hero,
.service-order-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(27, 37, 31, 0.05);
}

.service-order-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
}

.service-order-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-order-hero h1,
.service-order-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.service-order-hero h1 {
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.2;
}

.service-order-hero p,
.service-order-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.service-order-state {
  display: grid;
  gap: 3px;
  min-height: 0;
  min-width: 148px;
  border: 1px solid rgba(25, 123, 91, 0.25);
  border-radius: 8px;
  background: #f0f7f3;
  padding: 8px 10px;
}

.service-order-state span,
.service-order-readiness-item span {
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
}

.service-order-state strong {
  align-self: end;
  font-size: 13px;
  line-height: 1.15;
}

.service-order-state.is-notConfigured,
.service-order-state.is-authRequired,
.service-order-readiness-item.is-notConfigured,
.service-order-readiness-item.is-authRequired {
  border-color: rgba(184, 107, 34, 0.34);
  background: #fff7ed;
}

.service-order-state.is-blocked,
.service-order-state.is-error,
.service-order-readiness-item.is-blocked,
.service-order-readiness-item.is-error {
  border-color: rgba(179, 54, 54, 0.32);
  background: #fff1f1;
}

.service-order-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.service-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid rgba(25, 123, 91, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.service-order-chip strong {
  max-width: min(42vw, 360px);
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-order-cloud {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.service-order-cloud-head,
.service-order-cloud-layout,
.service-order-cloud-card-head,
.service-order-cloud-project,
.service-order-card-actions,
.service-order-cloud-actions {
  display: grid;
  gap: 8px;
}

.service-order-cloud-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.service-order-cloud-actions,
.service-order-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.service-order-cloud-layout {
  grid-template-columns: minmax(220px, 0.9fr) repeat(2, minmax(240px, 1fr));
  align-items: stretch;
}

.service-order-cloud-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px;
}

.service-order-cloud-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.service-order-cloud-card-head span,
.service-order-cloud-project small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.service-order-cloud-card-head strong,
.service-order-cloud-project strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-order-cloud-kv {
  margin-top: 0;
}

.service-order-cloud-projects {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-order-cloud-project {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(214, 221, 215, 0.85);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.service-order-cloud-project[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.45);
  background: #f4fbf6;
}

.service-order-cloud-project-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.service-order-cloud-project-main span {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-order-cloud-state,
.service-order-action {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.service-order-cloud-state {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #f7f8f6;
  padding: 0 10px;
  color: var(--muted);
}

.service-order-cloud-state.is-ready {
  border-color: rgba(25, 123, 91, 0.35);
  background: #eef8f1;
  color: var(--accent);
}

.service-order-cloud-state.is-warning,
.service-order-cloud-state.is-active {
  border-color: rgba(184, 107, 34, 0.34);
  background: #fff7ed;
  color: #8d5218;
}

.service-order-cloud-state.is-blocked {
  border-color: rgba(179, 54, 54, 0.32);
  background: #fff1f1;
  color: #9a2e2e;
}

.service-order-action {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  color: var(--text);
  cursor: pointer;
}

.service-order-action.primary {
  border-color: rgba(25, 123, 91, 0.4);
  background: var(--accent);
  color: #fff;
}

.service-order-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.service-order-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.service-order-details summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.service-order-details[open] {
  padding-bottom: 10px;
}

.service-order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 10px;
  padding: 0 10px;
}

.service-order-panel {
  padding: 12px;
}

.service-order-panel h2 {
  font-size: 14px;
  line-height: 1.2;
}

.service-order-kv {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.service-order-kv div {
  display: grid;
  grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 30px;
  border-bottom: 1px solid #edf1ed;
  padding-bottom: 8px;
}

.service-order-kv div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.service-order-kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-order-kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
}

.service-order-permission {
  display: inline-grid;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid rgba(25, 123, 91, 0.22);
  border-radius: var(--radius);
  background: #f5faf7;
  padding: 10px 12px;
}

.service-order-permission span {
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 850;
}

.service-order-permission strong {
  font-size: 14px;
}

.service-order-readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.service-order-readiness-item {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid rgba(25, 123, 91, 0.22);
  border-radius: 8px;
  background: #f6fbf8;
  padding: 10px;
}

.service-order-readiness-item strong {
  font-size: 13px;
  line-height: 1.2;
}

.service-order-readiness-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.service-order-debug ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .service-order-route {
    padding: 6px calc(10px + var(--safe-right)) 6px calc(10px + var(--safe-left));
  }

  .service-order-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 8px 10px;
  }

  .service-order-grid {
    grid-template-columns: 1fr;
  }

  .service-order-hero h1 {
    font-size: 16px;
  }

  .service-order-hero p {
    font-size: 11px;
  }

  .service-order-state {
    min-width: 118px;
    padding: 6px 8px;
  }

  .service-order-state strong {
    font-size: 12px;
  }

  .service-order-chip strong {
    max-width: min(34vw, 260px);
  }

  .service-order-cloud-head,
  .service-order-cloud-layout,
  .service-order-cloud-project {
    grid-template-columns: 1fr;
  }

  .service-order-cloud-actions,
  .service-order-card-actions {
    justify-content: stretch;
  }

  .service-order-action,
  .service-order-cloud-state {
    width: 100%;
  }

  .service-order-readiness-grid {
    grid-template-columns: 1fr;
  }

  .service-order-kv div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.ble-panel {
  position: relative;
  z-index: 140;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  max-height: 42vh;
  min-height: 260px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #f7faf8;
}

.ble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ble-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.ble-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ble-debug-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(238, 242, 237, 0.74);
}

.ble-debug-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ble-debug-tab:hover,
.ble-debug-tab.is-active,
.ble-debug-tab[aria-expanded="true"] {
  border-color: rgba(25, 123, 91, 0.42);
  background: rgba(25, 123, 91, 0.1);
  color: var(--accent);
}

[data-debug-panel][hidden] {
  display: none !important;
}

.ble-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.app-shell.field-route-open .sync-outbox-panel,
.app-shell.field-route-open .measurement-package-panel,
.app-shell.field-route-open .side-panel {
  display: none;
}

.app-shell.field-route-open .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell:not(.field-route-open) .project-notes-field {
  display: none;
}

.app-shell:not(.field-route-open) .field-route-bottom-actions {
  display: none;
}

.app-shell.photo-editor-open .project-notes-field {
  display: grid;
}

.app-shell.photo-editor-open .field-route-bottom-actions {
  display: none;
}

.app-shell.photo-editor-open .editor-context-main,
.app-shell.photo-editor-open .editor-context-meta {
  display: none;
}

.app-shell.photo-editor-open .top-measure-tabs {
  display: none;
}

.top-measure-tabs[hidden] {
  display: none !important;
}

.app-shell.photo-editor-open .legacy-editor-tools {
  display: flex;
}

.app-shell.photo-editor-open .editor-panel {
  padding-bottom: 0;
}

.app-shell.photo-editor-open .statusbar {
  display: none;
}

.app-shell.photo-editor-open .editor-context {
  max-height: min(42dvh, 360px);
  overflow-y: auto;
}

.app-shell.photo-editor-open .project-notes-input {
  height: clamp(96px, 18dvh, 156px);
  min-height: 96px;
  max-height: 156px;
}

.ble-controls,
.ble-tx {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ble-tx input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.ble-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.ble-devices,
.ble-sync-wrap,
.ble-log-wrap,
.ble-measurements {
  min-height: 0;
}

.ble-measurements {
  grid-column: 1 / -1;
}

.ble-section-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.ble-device-list {
  display: grid;
  gap: 6px;
  height: calc(100% - 22px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.ble-sync-status {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.ble-sync-status[data-state="pending"] {
  color: #8a541d;
  background: rgba(184, 107, 34, 0.08);
}

.ble-sync-status[data-state="attention"] {
  color: var(--danger);
  background: rgba(179, 54, 54, 0.08);
}

.ble-sync-log {
  display: grid;
  gap: 6px;
  max-height: 170px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.ble-sync-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ble-sync-item[data-state="debouncing"],
.ble-sync-item[data-state="queued"],
.ble-sync-item[data-state="needsBackend"] {
  border-color: rgba(184, 107, 34, 0.24);
}

.ble-sync-item.is-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ble-sync-item-title,
.ble-sync-item-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ble-sync-item-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.ble-sync-item-meta {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.ble-latest-measurement {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.ble-measurement-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.ble-measurement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) minmax(82px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ble-measurement-main {
  min-width: 0;
}

.ble-measurement-value {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
}

.ble-measurement-meta,
.ble-measurement-diff {
  margin-top: 2px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.ble-reference input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 9px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.ble-device {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ble-device.selected {
  border-color: var(--accent);
  background: #edf7f1;
}

.ble-device-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ble-device-meta {
  margin-top: 2px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.ble-log {
  height: calc(100% - 22px);
  min-height: 150px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111815;
  color: #d9f2e6;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.editor-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.editor-context {
  position: relative;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 34%);
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(214, 221, 215, 0.72);
  background:
    linear-gradient(90deg, rgba(25, 123, 91, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(23, 33, 28, 0.06);
}

.project-notes-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.project-notes-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-notes-input {
  width: 100%;
  height: var(--project-notes-height);
  min-height: 180px;
  max-height: 340px;
  resize: none;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
  line-height: 1.36;
  overflow: auto;
}

.project-notes-input:focus {
  border-color: rgba(25, 123, 91, 0.48);
  outline: 3px solid rgba(25, 123, 91, 0.14);
}

.field-route-bottom-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.32fr);
  gap: 6px;
  min-width: 0;
}

.photo-editor-context-tools {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(45, 111, 159, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(45, 111, 159, 0.08), transparent 62%),
    rgba(255, 255, 255, 0.78);
}

.photo-editor-context-tools[hidden] {
  display: none !important;
}

.photo-editor-context-main {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
}

.photo-editor-context-kicker,
.photo-editor-context-main span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.photo-editor-context-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-editor-context-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 5px;
  align-items: stretch;
  min-width: 0;
}

.context-action-button {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(45, 111, 159, 0.2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-action-button.primary {
  border-color: rgba(25, 123, 91, 0.38);
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.context-action-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.48;
}

.editor-context-main,
.editor-context-meta {
  min-width: 0;
}

.editor-context-main {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 4px 9px;
  align-content: center;
}

.editor-context-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
  gap: 6px;
}

.context-title,
.context-subtitle,
.editor-context-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.context-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 260px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(23, 33, 28, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.context-return-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(25, 123, 91, 0.35);
  border-radius: 999px;
  background: rgba(25, 123, 91, 0.1);
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.context-return-button[hidden] {
  display: none;
}

.editor-context[data-storage="failed"] .context-title,
.editor-context[data-storage="failed"] #contextSaveState {
  color: var(--danger);
}

.project-gallery {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(58px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(23, 33, 28, 0.42);
  overscroll-behavior: contain;
  touch-action: none;
}

html.modal-scroll-locked,
body.about-panel-open,
body.kalka-panel-open,
body.project-gallery-open,
body.modal-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.modal-scroll-locked {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
}

.kalka-panel {
  position: fixed;
  inset: 0;
  z-index: 255;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(58px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(23, 33, 28, 0.36);
  overscroll-behavior: contain;
  touch-action: none;
}

.kalka-card {
  display: grid;
  gap: 12px;
  width: min(680px, 100%);
  max-height: min(620px, 100%);
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(23, 33, 28, 0.3);
  touch-action: pan-y;
}

.kalka-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(214, 221, 215, 0.78);
}

.kalka-head h2,
.kalka-head p,
.kalka-section h3,
.kalka-list,
.kalka-note {
  margin: 0;
}

.kalka-head h2 {
  font-size: 21px;
  line-height: 1.12;
}

.kalka-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kalka-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.kalka-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(214, 221, 215, 0.78);
  border-radius: var(--radius);
  background: #f8faf7;
}

.kalka-section h3 {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.kalka-list {
  display: grid;
  gap: 6px;
}

.kalka-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.34fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
}

.kalka-row dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kalka-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.kalka-token-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kalka-token-field input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
}

.kalka-actions,
.kalka-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.kalka-note,
.kalka-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.kalka-status {
  padding: 9px 10px;
  border: 1px solid rgba(214, 221, 215, 0.78);
  border-radius: var(--radius);
  background: #f8faf7;
}

.kalka-status[data-state="ready"] {
  border-color: rgba(25, 123, 91, 0.28);
  background: #edf7f1;
  color: var(--accent);
}

.kalka-status[data-state="loading"] {
  border-color: rgba(184, 107, 34, 0.32);
  background: #fffaf1;
  color: #7a531a;
}

.kalka-status[data-state="error"] {
  border-color: rgba(179, 54, 54, 0.24);
  background: #fff4f2;
  color: var(--danger);
}

.about-panel {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(58px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(23, 33, 28, 0.38);
  overscroll-behavior: contain;
  touch-action: none;
}

.about-card {
  display: grid;
  gap: 10px;
  width: min(560px, calc(100vw - 28px));
  max-height: min(560px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 42px));
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(23, 33, 28, 0.3);
  touch-action: pan-y;
}

.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(214, 221, 215, 0.78);
}

.about-head h2,
.about-head p,
.about-section h3,
.about-list {
  margin: 0;
}

.about-head h2 {
  font-size: 20px;
  line-height: 1.12;
}

.about-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.about-section {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(214, 221, 215, 0.78);
  border-radius: var(--radius);
  background: #f8faf7;
}

.about-section h3 {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.about-list {
  display: grid;
  gap: 5px;
}

.about-row {
  display: grid;
  grid-template-columns: minmax(74px, 0.32fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 7px;
  border-radius: 6px;
  background: var(--surface);
}

.about-row dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.about-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.project-gallery-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: min(900px, 100%);
  max-height: min(720px, 100%);
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(23, 33, 28, 0.32);
  touch-action: pan-y;
}

.project-gallery-head,
.gallery-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-gallery-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.project-gallery-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.project-gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.gallery-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.78);
  border-radius: var(--radius);
  background: #f8faf7;
}

.gallery-column:first-child {
  grid-template-rows: auto minmax(92px, 1fr) auto auto minmax(80px, 0.8fr);
}

.gallery-column-head span {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.gallery-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.gallery-cloud-head {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.gallery-cloud-state {
  min-height: 28px;
  border: 1px solid rgba(214, 221, 215, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.gallery-cloud-state[data-state="loaded"] {
  border-color: rgba(25, 123, 91, 0.28);
  background: #eef8f1;
  color: var(--accent);
}

.gallery-cloud-state[data-state="failed"] {
  border-color: rgba(179, 54, 54, 0.28);
  background: #fff1f1;
  color: #9a2e2e;
}

.gallery-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: start;
  min-height: 52px;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.72);
  border-radius: var(--radius);
  background: var(--surface);
}

.gallery-action {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  font-size: 17px;
}

.gallery-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 132px;
}

.gallery-action-danger {
  color: var(--danger);
}

.gallery-item.is-active {
  border-color: rgba(25, 123, 91, 0.55);
  background: #edf7f1;
}

.gallery-item-main {
  min-width: 0;
}

.gallery-item-title,
.gallery-item-title-text,
.gallery-item-folder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 850;
}

.gallery-item-title-text {
  flex: 1 1 auto;
}

.gallery-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 120px;
  padding: 2px 6px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: 999px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.gallery-sync-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8f9b92;
}

.gallery-sync-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-sync-badge[data-state="ready"] {
  color: var(--accent);
  border-color: rgba(25, 123, 91, 0.22);
  background: rgba(25, 123, 91, 0.08);
}

.gallery-sync-badge[data-state="ready"] .gallery-sync-dot,
.gallery-sync-badge[data-state="synced"] .gallery-sync-dot {
  background: var(--accent);
}

.gallery-sync-badge[data-state="pending"] {
  color: #8a541d;
  border-color: rgba(184, 107, 34, 0.22);
  background: rgba(184, 107, 34, 0.08);
}

.gallery-sync-badge[data-state="pending"] .gallery-sync-dot {
  background: #b86b22;
}

.gallery-sync-badge[data-state="attention"] {
  color: var(--danger);
  border-color: rgba(179, 54, 54, 0.18);
  background: rgba(179, 54, 54, 0.08);
}

.gallery-sync-badge[data-state="attention"] .gallery-sync-dot {
  background: var(--danger);
}

.gallery-item-folder {
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.gallery-item-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gallery-item-meta-part {
  display: none;
}

.gallery-empty {
  min-height: 58px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 33, 28, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 28, 0.05) 1px, transparent 1px),
    #e9ede8;
  background-size: 24px 24px;
  touch-action: none;
}

.field-route-screen {
  position: absolute;
  inset: 0;
  z-index: 85;
  overflow: auto;
  padding: 14px 14px var(--field-route-bottom-reserve);
  background:
    linear-gradient(90deg, rgba(25, 123, 91, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45, 111, 159, 0.05) 1px, transparent 1px),
    #f6f8f4;
  background-size: 28px 28px;
  touch-action: pan-y;
}

.field-route-layout {
  display: grid;
  grid-template-areas: "panel";
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  min-height: 100%;
}

.field-route-header,
.field-route-tabs,
.field-route-plan,
.field-route-projection,
.field-route-tools,
.field-route-evidence,
.field-route-issues {
  min-width: 0;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.field-route-header {
  grid-area: header;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background:
    linear-gradient(90deg, rgba(25, 123, 91, 0.12), rgba(45, 111, 159, 0.07)),
    rgba(255, 255, 255, 0.96);
}

.field-route-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.field-route-tab {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.field-route-tab strong,
.field-route-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-tab strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.08;
}

.field-route-tab span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.field-route-tab[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.42);
  background: rgba(25, 123, 91, 0.1);
}

.field-route-tab[data-active="true"] strong,
.field-route-tab[data-active="true"] span {
  color: var(--accent);
}

.field-route-tab-panel {
  grid-area: panel;
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
  scroll-margin-top: 12px;
}

.field-route-tab-panel > .field-route-plan,
.field-route-tab-panel > .field-route-projection,
.field-route-tab-panel > .field-route-tools,
.field-route-tab-panel > .field-route-evidence,
.field-route-tab-panel > .field-route-issues {
  grid-area: auto;
}

.field-route-title-wrap,
.field-route-active-target {
  min-width: 0;
}

.field-route-kicker,
.field-route-subtitle,
.field-route-active-label,
.field-route-active-target span,
.field-route-section-head span,
.field-route-tool-detail,
.field-route-tool-name,
.field-route-evidence-value,
.field-route-issue-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field-route-kicker,
.field-route-active-label,
.field-route-section-head span {
  text-transform: uppercase;
}

.field-route-title {
  margin: 1px 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.08;
}

.field-route-subtitle,
.field-route-active-target span,
.field-route-active-target strong,
.field-route-section-head span,
.field-route-tool-detail,
.field-route-issue-title,
.field-route-issue-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-active-target {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(25, 123, 91, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.field-route-active-target strong {
  color: var(--text);
  font-size: 13px;
}

.field-route-plan {
  grid-area: plan;
}

.field-route-projection {
  grid-area: projection;
}

.field-route-tools {
  grid-area: tools;
}

.field-route-evidence {
  grid-area: evidence;
}

.field-route-issues {
  grid-area: issues;
}

.field-route-plan,
.field-route-projection,
.field-route-tools,
.field-route-evidence,
.field-route-issues {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 11px;
  scroll-margin-top: 12px;
}

.field-route-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.field-route-section-head h3 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.16;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-plan-canvas,
.field-route-projection-canvas {
  min-width: 0;
}

.field-route-plan-canvas {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: clamp(300px, 56vh, 520px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(45, 111, 159, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 111, 159, 0.055) 1px, transparent 1px),
    #eef3ef;
  background-size: 26px 26px;
  touch-action: none;
}

.field-route-plan-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

.field-route-plan-canvas[data-drawing="true"] {
  border-color: rgba(45, 111, 159, 0.58);
  box-shadow: inset 0 0 0 2px rgba(45, 111, 159, 0.08);
  cursor: crosshair;
}

.field-route-plan-drawing,
.field-route-plan-empty-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.field-route-plan-drawing {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.field-route-plan-drawing-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.field-route-plan-drawing-copy strong,
.field-route-plan-empty-panel strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-plan-drawing-copy span,
.field-route-plan-empty-panel span,
.field-route-wall-empty {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.field-route-plan-empty {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  padding: 7px 9px;
  border: 1px solid rgba(45, 111, 159, 0.14);
  border-radius: var(--radius);
  background: rgba(248, 250, 247, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  pointer-events: none;
}

.field-route-plan-review {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.8fr);
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(25, 123, 91, 0.18);
  border-radius: var(--radius);
  background: #f7faf6;
}

.field-route-plan-review[data-state="accepted"] {
  border-color: rgba(25, 123, 91, 0.28);
  background: #f4f9f3;
}

.field-route-plan-review-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.field-route-plan-review-copy strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-plan-review-copy span,
.field-route-plan-review-warning {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.field-route-plan-review-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.field-route-plan-review-chip {
  display: grid;
  min-width: 0;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.field-route-plan-review-chip strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-plan-review-warning {
  grid-column: 1;
  padding: 7px 8px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
}

.field-route-plan-review-warning[data-state="warning"] {
  border-color: rgba(142, 97, 77, 0.24);
  color: #734a35;
}

.field-route-plan-review-warning[data-state="accepted"] {
  border-color: rgba(25, 123, 91, 0.22);
  color: #315b3f;
}

.field-route-plan-review-actions {
  grid-column: 2;
  align-self: stretch;
  align-content: center;
  justify-content: flex-end;
}

.field-route-sketch-live {
  fill: none;
  stroke: #2d6f9f;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(45, 111, 159, 0.18));
}

.contour-lab-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(45, 111, 159, 0.18);
  border-radius: var(--radius);
  background: #f7faf6;
}

.contour-lab-head,
.contour-lab-body,
.contour-lab-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.contour-lab-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.contour-lab-title strong,
.contour-lab-expected-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.contour-lab-title span,
.contour-lab-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contour-lab-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.contour-lab-stat {
  display: grid;
  min-width: 54px;
  padding: 5px 7px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.contour-lab-stat strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.contour-lab-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contour-lab-preview svg {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(45, 111, 159, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 111, 159, 0.05) 1px, transparent 1px),
    #eef3ef;
  background-size: 26px 26px;
}

.contour-lab-raw {
  fill: none;
  stroke: rgba(142, 97, 77, 0.45);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contour-lab-compact {
  fill: none;
  stroke: rgba(45, 111, 159, 0.48);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 6;
}

.contour-lab-model {
  fill: rgba(149, 180, 135, 0.18);
  stroke: #315b3f;
  stroke-width: 5;
  stroke-linejoin: round;
}

.contour-lab-corner circle {
  fill: #f8faf7;
  stroke: #315b3f;
  stroke-width: 2;
}

.contour-lab-corner text {
  fill: #315b3f;
  font-size: 12px;
  font-weight: 950;
}

.contour-lab-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.contour-lab-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.contour-lab-legend-item::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #315b3f;
}

.contour-lab-legend-item[data-state="raw"]::before {
  background: rgba(142, 97, 77, 0.55);
}

.contour-lab-legend-item[data-state="compact"]::before {
  background: rgba(45, 111, 159, 0.6);
}

.contour-lab-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 220px;
}

.contour-lab-detail,
.contour-lab-issues {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.contour-lab-detail span,
.contour-lab-issues span,
.contour-lab-field span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.contour-lab-detail strong,
.contour-lab-issues strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.contour-lab-issues {
  grid-column: 1 / -1;
}

.contour-lab-review {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contour-lab-field,
.contour-lab-expected {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contour-lab-field-wide,
.contour-lab-expected {
  grid-column: 1 / -1;
}

.contour-lab-control {
  width: 100%;
}

.contour-lab-expected {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.contour-lab-expected-title {
  grid-column: 1 / -1;
}

.contour-lab-history {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contour-lab-history-item {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.contour-lab-history-item[data-active="true"] {
  border-color: rgba(45, 111, 159, 0.38);
  background: rgba(45, 111, 159, 0.08);
}

.contour-lab-history-item strong,
.contour-lab-history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contour-lab-history-item strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.contour-lab-history-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field-route-layer-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.field-route-layer-map-title,
.field-route-layer-map-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-layer-map-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.field-route-layer-map-status {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field-route-layer-canvas {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  height: clamp(220px, 42vh, 360px);
  aspect-ratio: 4 / 2;
}

.field-route-evidence.is-angle-workspace .field-route-layer-canvas {
  height: clamp(150px, 24vh, 230px);
}

.field-route-angle-unfolding {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.field-route-angle-unfolding-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.field-route-angle-unfolding-head strong,
.field-route-angle-unfolding-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-angle-unfolding-head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.field-route-angle-unfolding-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field-route-angle-unfolding-canvas {
  position: relative;
  min-width: 0;
  min-height: clamp(286px, 44vh, 390px);
  overflow: hidden;
  border: 1px solid rgba(45, 111, 159, 0.18);
  border-radius: 7px;
  perspective: 720px;
  background:
    linear-gradient(90deg, rgba(23, 33, 28, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 28, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(25, 123, 91, 0.08), rgba(45, 111, 159, 0.06)),
    #fbfcf8;
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.field-route-angle-3d-plane {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(45, 111, 159, 0.16);
  background:
    linear-gradient(90deg, rgba(23, 33, 28, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 28, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.58);
  background-size: 24px 24px;
  box-shadow: inset 0 0 24px rgba(23, 33, 28, 0.035);
  transform-style: preserve-3d;
}

.field-route-angle-3d-plane.is-left-wall {
  top: 16%;
  bottom: 17%;
  left: 8%;
  width: 39%;
  transform: skewY(-7deg) rotateY(22deg);
  transform-origin: right center;
  background-color: rgba(230, 241, 246, 0.68);
}

.field-route-angle-3d-plane.is-right-wall {
  top: 16%;
  right: 9%;
  bottom: 17%;
  width: 44%;
  transform: skewY(6deg) rotateY(-18deg);
  transform-origin: left center;
  background-color: rgba(238, 247, 241, 0.72);
}

.field-route-angle-3d-plane.is-floor {
  right: 6%;
  bottom: 4%;
  left: 6%;
  height: 29%;
  transform: rotateX(64deg);
  transform-origin: center bottom;
  background-color: rgba(255, 246, 225, 0.58);
}

.field-route-angle-3d-plane.is-ceiling {
  top: 4%;
  right: 8%;
  left: 8%;
  height: 23%;
  transform: rotateX(-58deg);
  transform-origin: center top;
  background-color: rgba(245, 248, 250, 0.64);
}

.field-route-angle-plane-label {
  position: absolute;
  z-index: 2;
  top: 11px;
  max-width: 42%;
  min-width: 0;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid rgba(45, 111, 159, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-angle-plane-label.is-left {
  left: 10px;
}

.field-route-angle-plane-label.is-right {
  right: 10px;
}

.field-route-angle-boundary {
  position: absolute;
  z-index: 3;
  top: 18%;
  bottom: 16%;
  left: 47%;
  display: grid;
  place-items: center;
  width: 3px;
  color: rgba(23, 33, 28, 0.54);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  background: linear-gradient(180deg, rgba(45, 111, 159, 0.5), rgba(23, 33, 28, 0.45), rgba(25, 123, 91, 0.48));
  transform: translateX(-50%) rotate(180deg);
}

.field-route-angle-joint-line {
  position: absolute;
  z-index: 4;
  left: 47%;
  height: 3px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.58);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 18px rgba(23, 33, 28, 0.08);
  transform-origin: left center;
  pointer-events: none;
}

.field-route-angle-joint-line.is-vertical {
  top: 19%;
  bottom: 9%;
  width: 4px;
  height: auto;
  background: linear-gradient(180deg, rgba(45, 111, 159, 0.72), rgba(23, 33, 28, 0.56), rgba(25, 123, 91, 0.74));
  transform: translateX(-50%);
}

.field-route-angle-joint-line.is-middle-left {
  top: 54%;
  width: 26%;
  transform: rotate(176deg);
}

.field-route-angle-joint-line.is-middle-right {
  top: 54%;
  width: 29%;
  transform: rotate(4deg);
}

.field-route-angle-joint-line.is-floor-left {
  top: 84%;
  width: 30%;
  background: rgba(184, 107, 34, 0.72);
  transform: rotate(190deg);
}

.field-route-angle-joint-line.is-floor-right {
  top: 84%;
  width: 32%;
  background: rgba(184, 107, 34, 0.72);
  transform: rotate(10deg);
}

.field-route-angle-joint-line.is-ceiling-left {
  top: 24%;
  width: 29%;
  background: rgba(45, 111, 159, 0.62);
  transform: rotate(170deg);
}

.field-route-angle-joint-line.is-ceiling-right {
  top: 24%;
  width: 31%;
  background: rgba(45, 111, 159, 0.62);
  transform: rotate(-10deg);
}

.field-route-angle-hinge {
  position: absolute;
  z-index: 3;
  left: 47%;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(25, 123, 91, 0.48);
  border-radius: 999px;
  background: #fbfcf8;
  box-shadow: 0 5px 14px rgba(23, 33, 28, 0.1);
  transform: translate(-50%, -50%);
}

.field-route-angle-hinge.is-ceiling {
  top: 24%;
}

.field-route-angle-hinge.is-floor {
  top: 84%;
}

.field-route-angle-guide {
  position: absolute;
  z-index: 2;
  left: 47%;
  width: 38%;
  height: 2px;
  background: rgba(23, 33, 28, 0.26);
  transform-origin: left center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.field-route-angle-guide[data-active="true"] {
  height: 3px;
  background: rgba(25, 123, 91, 0.62);
}

.field-route-angle-guide[data-guide="ceiling-left"] {
  top: 24%;
  transform: rotate(170deg);
}

.field-route-angle-guide[data-guide="floor-left"] {
  top: 84%;
  transform: rotate(190deg);
}

.field-route-angle-guide[data-guide="ceiling-right"] {
  top: 24%;
  transform: rotate(-10deg);
  transform-origin: left center;
}

.field-route-angle-guide[data-guide="floor-right"] {
  top: 84%;
  transform: rotate(10deg);
  transform-origin: left center;
}

.field-route-angle-band-label {
  position: absolute;
  z-index: 2;
  left: 9px;
  display: inline-grid;
  min-width: 62px;
  padding: 4px 7px;
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.field-route-angle-band-label[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.4);
  background: rgba(25, 123, 91, 0.08);
  color: var(--accent);
}

.field-route-angle-band-label[data-band="ceiling"] {
  top: 24%;
}

.field-route-angle-band-label[data-band="middle"] {
  top: calc(50% - 11px);
}

.field-route-angle-band-label[data-band="floor"] {
  bottom: 19%;
}

.field-route-angle-marker {
  position: absolute;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  width: clamp(32px, 9vw, 40px);
  height: clamp(32px, 9vw, 40px);
  min-height: 0;
  padding: 0 3px;
  border: 1px solid rgba(23, 33, 28, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(23, 33, 28, 0.08);
  transform: translate(-50%, -50%);
}

.field-route-angle-marker[data-required="false"] {
  color: var(--muted);
  opacity: 0.76;
}

.field-route-angle-marker[data-state="missing"],
.field-route-angle-marker[data-state="active"] {
  border-color: rgba(184, 107, 34, 0.55);
  background: rgba(255, 246, 225, 0.96);
}

.field-route-angle-marker[data-state="confirmed"],
.field-route-angle-marker[data-state="recorded"],
.field-route-angle-marker[data-state="captured"] {
  border-color: rgba(25, 123, 91, 0.46);
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.field-route-angle-marker[data-state="problem"] {
  border-color: rgba(179, 54, 54, 0.42);
  background: rgba(179, 54, 54, 0.1);
  color: #873131;
}

.field-route-angle-marker[data-active="true"] {
  border-color: var(--accent);
  outline: 3px solid rgba(25, 123, 91, 0.18);
  color: var(--accent);
  opacity: 1;
}

.field-route-angle-marker[data-flash="true"] {
  animation: field-route-card-stroke-pulse 1s ease-in-out 1;
}

.field-route-angle-marker[data-check="ceiling-wall-wall"] {
  top: 19%;
  left: 47%;
}

.field-route-angle-marker[data-check="middle-wall-wall"] {
  top: 54%;
  left: 47%;
}

.field-route-angle-marker[data-check="floor-wall-wall"] {
  top: 90%;
  left: 47%;
}

.field-route-angle-marker[data-check="floor-wall-floor-a"] {
  top: 80%;
  left: 39%;
}

.field-route-angle-marker[data-check="floor-wall-floor-b"] {
  top: 80%;
  left: 55%;
}

.field-route-angle-marker[data-check="ceiling-wall-ceiling-a"] {
  top: 30%;
  left: 39%;
}

.field-route-angle-marker[data-check="ceiling-wall-ceiling-b"] {
  top: 30%;
  left: 55%;
}

.field-route-angle-active-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(25, 123, 91, 0.18);
  border-radius: 7px;
  background: rgba(25, 123, 91, 0.07);
}

.field-route-angle-active-line span,
.field-route-angle-active-line em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.field-route-angle-active-line strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-room-fill {
  fill: #fbfcf8;
  stroke: rgba(23, 33, 28, 0.22);
  stroke-width: 4;
}

.field-route-wall-shape {
  cursor: pointer;
  fill: rgba(45, 111, 159, 0.08);
  stroke: rgba(23, 33, 28, 0.42);
  stroke-width: 5;
  transition: fill 0.16s ease, stroke 0.16s ease;
}

.field-route-wall-shape[data-state="selected"] {
  fill: rgba(25, 123, 91, 0.18);
  stroke: var(--accent);
}

.field-route-wall-label,
.field-route-plan-note,
.field-route-plan-marker text {
  fill: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 4px;
}

.field-route-plan-note {
  fill: #8a541d;
  font-size: 10px;
}

.field-route-plan-marker {
  cursor: pointer;
}

.field-route-layer-map[data-mode="photos"] .field-route-plan-marker {
  cursor: grab;
}

.field-route-layer-map[data-mode="photos"] .field-route-plan-marker:active {
  cursor: grabbing;
}

.field-route-plan-marker circle {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(23, 33, 28, 0.26);
  stroke-width: 2;
}

.field-route-plan-marker text {
  font-size: 9px;
  stroke-width: 3px;
}

.field-route-plan-marker.is-corner[data-state="missing"] circle {
  fill: rgba(230, 185, 64, 0.16);
  stroke: rgba(184, 107, 34, 0.7);
}

.field-route-plan-marker.is-photo[data-state="missing"] circle {
  fill: rgba(179, 54, 54, 0.12);
  stroke: rgba(179, 54, 54, 0.42);
}

.field-route-plan-marker.is-photo[data-placed="false"] circle {
  fill: rgba(255, 246, 225, 0.92);
  stroke: rgba(184, 107, 34, 0.72);
  stroke-dasharray: 3 2;
}

.field-route-plan-marker[data-state="problem"] circle {
  fill: rgba(184, 107, 34, 0.16);
  stroke: rgba(184, 107, 34, 0.55);
}

.field-route-plan-marker[data-state="selected"] circle,
.field-route-plan-marker[data-state="ready"] circle,
.field-route-plan-marker[data-state="captured"] circle {
  fill: rgba(25, 123, 91, 0.15);
  stroke: rgba(25, 123, 91, 0.62);
}

.field-route-plan-marker.is-photo[data-placed="false"] circle {
  fill: rgba(255, 246, 225, 0.92);
  stroke: rgba(184, 107, 34, 0.72);
  stroke-dasharray: 3 2;
}

.field-route-plan-marker[data-state="notRequired"] circle {
  fill: rgba(255, 255, 255, 0.78);
  stroke: rgba(23, 33, 28, 0.24);
}

.field-route-plan-marker[data-flash="true"] circle {
  fill: rgba(255, 255, 255, 0.95);
  stroke: var(--accent);
  stroke-width: 3;
  animation: field-route-svg-stroke-pulse 1s ease-in-out 1;
}

.field-route-wall-list,
.field-route-readiness {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.field-route-wall-chip,
.field-route-slot-card {
  min-width: 0;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.field-route-wall-chip {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-wall-chip[data-state="selected"] {
  border-color: rgba(25, 123, 91, 0.48);
  background: rgba(25, 123, 91, 0.1);
  color: var(--accent);
}

.field-route-projection-canvas {
  display: grid;
  gap: 7px;
}

.field-route-projection-wall {
  position: relative;
  aspect-ratio: 1.24 / 1;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(23, 33, 28, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 28, 0.045) 1px, transparent 1px),
    #fbfcf8;
  background-size: 32px 32px;
}

.field-route-projection-wall::before {
  position: absolute;
  inset: 12% 11%;
  border: 2px solid rgba(23, 33, 28, 0.22);
  border-radius: 6px;
  content: "";
}

.field-route-projection-dimension {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field-route-projection-width {
  right: 14%;
  bottom: 5%;
  left: 14%;
}

.field-route-projection-height {
  top: 42%;
  right: 3%;
  transform: rotate(90deg);
}

.field-route-wall-object-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.field-route-wall-object-helper {
  position: absolute;
  border-color: rgba(184, 107, 34, 0.38);
  pointer-events: none;
}

.field-route-wall-object-helper.is-vertical {
  border-left: 1px dashed rgba(184, 107, 34, 0.42);
}

.field-route-wall-object-helper.is-horizontal {
  border-top: 1px dashed rgba(184, 107, 34, 0.42);
}

.field-route-wall-object {
  position: absolute;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  border: 1px solid rgba(184, 107, 34, 0.48);
  border-radius: 6px;
  background: rgba(255, 246, 225, 0.88);
  color: #8a541d;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: auto;
}

.field-route-wall-object-wrap[data-active="true"] .field-route-wall-object {
  border-color: rgba(25, 123, 91, 0.55);
  background: rgba(25, 123, 91, 0.14);
  color: var(--accent);
  outline: 3px solid rgba(25, 123, 91, 0.16);
}

.field-route-slot-line {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.field-route-slot-line.is-height {
  top: 15%;
  bottom: 18%;
  width: 24px;
  writing-mode: vertical-rl;
}

.field-route-slot-line.is-length {
  right: 14%;
  left: 14%;
  height: 18px;
}

.field-route-slot-line[data-slot="height-left"] {
  left: 15%;
}

.field-route-slot-line[data-slot="height-center"] {
  left: calc(50% - 12px);
}

.field-route-slot-line[data-slot="height-right"] {
  right: 15%;
}

.field-route-slot-line[data-slot="length-low"] {
  bottom: 18%;
}

.field-route-slot-line[data-slot="length-middle"] {
  top: calc(50% - 9px);
}

.field-route-slot-line[data-slot="length-high"] {
  top: 15%;
}

.field-route-slot-line[data-active="true"],
.field-route-slot-card[data-active="true"] {
  border-color: var(--accent);
  outline: 3px solid rgba(25, 123, 91, 0.18);
}

.field-route-slot-line[data-flash="true"],
.field-route-slot-card[data-flash="true"],
.field-route-projection[data-flash="true"],
.field-route-evidence[data-flash="true"] {
  animation: field-route-card-stroke-pulse 1s ease-in-out 1;
}

.field-route-slot-line[data-state="missing"],
.field-route-slot-card[data-state="missing"],
.field-route-evidence-item[data-state="missing"],
.field-route-task-card[data-state="missing"],
.field-route-readiness-chip[data-state="blocked"],
.field-route-issue[data-state="blocker"] {
  border-color: rgba(179, 54, 54, 0.28);
  background: rgba(179, 54, 54, 0.06);
}

.field-route-slot-line[data-state="queuedForBle"],
.field-route-slot-line[data-state="capturedBle"],
.field-route-slot-line[data-state="manualEntered"],
.field-route-slot-card[data-state="queuedForBle"],
.field-route-slot-card[data-state="capturedBle"],
.field-route-slot-card[data-state="manualEntered"],
.field-route-tool-step[data-state="active"],
.field-route-issue[data-state="active"],
.field-route-readiness-chip[data-state="active"] {
  border-color: rgba(45, 111, 159, 0.28);
  background: rgba(45, 111, 159, 0.08);
}

.field-route-slot-line[data-state="confirmed"],
.field-route-slot-card[data-state="confirmed"],
.field-route-evidence-item[data-state="confirmed"],
.field-route-evidence-item[data-state="recorded"],
.field-route-evidence-item[data-state="captured"],
.field-route-task-card[data-state="confirmed"],
.field-route-task-card[data-state="recorded"],
.field-route-task-card[data-state="captured"],
.field-route-task-card[data-state="notRequired"],
.field-route-readiness-chip[data-state="ready"] {
  border-color: rgba(25, 123, 91, 0.28);
  background: rgba(25, 123, 91, 0.08);
}

.field-route-slot-line[data-state="needsRemeasure"],
.field-route-slot-line[data-state="deferredWithReason"],
.field-route-slot-line[data-state="doLater"],
.field-route-slot-line[data-state="problem"],
.field-route-slot-card[data-state="needsRemeasure"],
.field-route-slot-card[data-state="deferredWithReason"],
.field-route-slot-card[data-state="doLater"],
.field-route-slot-card[data-state="problem"],
.field-route-evidence-item[data-state="recommended"],
.field-route-task-card[data-state="recommended"],
.field-route-task-card[data-state="problem"],
.field-route-readiness-chip[data-state="recommended"],
.field-route-readiness-chip[data-state="problem"],
.field-route-issue[data-state="problem"],
.field-route-issue[data-state="recommended"] {
  border-color: rgba(184, 107, 34, 0.3);
  background: rgba(184, 107, 34, 0.08);
}

.field-route-projection-wall .field-route-slot-line {
  --slot-line-color: rgba(45, 111, 159, 0.56);
  overflow: visible;
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92),
    1px 0 0 rgba(255, 255, 255, 0.92),
    0 -1px 0 rgba(255, 255, 255, 0.92),
    -1px 0 0 rgba(255, 255, 255, 0.92);
}

.field-route-projection-wall .field-route-slot-line::before {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  background: var(--slot-line-color);
}

.field-route-projection-wall .field-route-slot-line.is-height::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
}

.field-route-projection-wall .field-route-slot-line.is-length::before {
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
}

.field-route-projection-wall .field-route-slot-line[data-state="missing"] {
  --slot-line-color: rgba(179, 54, 54, 0.52);
}

.field-route-projection-wall .field-route-slot-line[data-state="queuedForBle"],
.field-route-projection-wall .field-route-slot-line[data-state="capturedBle"],
.field-route-projection-wall .field-route-slot-line[data-state="manualEntered"],
.field-route-projection-wall .field-route-slot-line[data-state="confirmed"] {
  --slot-line-color: rgba(25, 123, 91, 0.58);
}

.field-route-projection-wall .field-route-slot-line[data-state="needsRemeasure"],
.field-route-projection-wall .field-route-slot-line[data-state="deferredWithReason"],
.field-route-projection-wall .field-route-slot-line[data-state="doLater"],
.field-route-projection-wall .field-route-slot-line[data-state="problem"] {
  --slot-line-color: rgba(184, 107, 34, 0.58);
}

.field-route-projection-wall .field-route-slot-line[data-active="true"] {
  color: var(--accent);
  outline: 0;
}

.field-route-projection-wall .field-route-slot-line[data-active="true"]::before {
  background: rgba(25, 123, 91, 0.86);
  box-shadow: 0 0 0 1px rgba(25, 123, 91, 0.16);
}

.field-route-projection-warning {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(184, 107, 34, 0.22);
  border-radius: var(--radius);
  background: rgba(184, 107, 34, 0.07);
  color: #8a541d;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.field-route-measurement-families,
.field-route-tool-list,
.field-route-evidence-list,
.field-route-issue-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-route-family {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-route-family-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.field-route-family-title,
.field-route-evidence-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.field-route-plan-inputs,
.field-route-manual-form,
.field-route-reason-editor {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.field-route-plan-inputs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-route-input-title,
.field-route-input-hint {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.field-route-input-title {
  grid-column: 1 / -1;
  color: var(--text);
  text-transform: uppercase;
}

.field-route-input-hint {
  padding: 6px 7px;
  border-radius: var(--radius);
  background: rgba(45, 111, 159, 0.07);
}

.field-route-input-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.field-route-input-field span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.field-route-input {
  min-width: 0;
  min-height: 32px;
  width: 100%;
  padding: 0 8px;
  border: 1px solid rgba(45, 111, 159, 0.22);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.field-route-input-with-edge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
}

.field-route-input-with-edge .field-route-input {
  border-radius: var(--radius) 0 0 var(--radius);
}

.field-route-edge-toggle {
  display: grid;
  grid-template-columns: repeat(2, 25px);
  min-height: 32px;
}

.field-route-edge-toggle button {
  min-width: 0;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(45, 111, 159, 0.22);
  border-left: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 950;
}

.field-route-edge-toggle button:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.field-route-edge-toggle button[aria-pressed="true"] {
  background: rgba(25, 123, 91, 0.13);
  color: var(--brand);
}

textarea.field-route-input {
  min-height: 56px;
  padding-top: 7px;
  resize: vertical;
}

.field-route-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.field-route-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.field-route-slot-card {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 7px;
  text-align: left;
}

.field-route-slot-name,
.field-route-slot-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.field-route-slot-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-tool-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-route-tool-index {
  grid-row: 1 / 4;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field-route-tool-label,
.field-route-tool-name,
.field-route-tool-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-current-tool {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(45, 111, 159, 0.22);
  border-radius: var(--radius);
  background: rgba(45, 111, 159, 0.065);
}

.field-route-current-kicker {
  color: #2d6f9f;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.field-route-wall-objects-panel,
.field-route-wall-object-list,
.field-route-wall-object-card {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-route-wall-objects-panel {
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.field-route-wall-object-card,
.field-route-wall-object-empty {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-route-wall-object-card[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.42);
  background: rgba(25, 123, 91, 0.07);
}

.field-route-wall-object-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.field-route-wall-object-title strong,
.field-route-wall-object-title span,
.field-route-wall-object-empty {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-route-wall-object-title strong {
  color: var(--text);
  font-size: 13px;
}

.field-route-wall-object-title span,
.field-route-wall-object-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.field-route-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 5px;
  min-width: 0;
}

.field-route-action {
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid rgba(45, 111, 159, 0.2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-action[data-state="primary"] {
  border-color: rgba(25, 123, 91, 0.38);
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.field-route-action[data-state="warn"] {
  border-color: rgba(184, 107, 34, 0.32);
  background: rgba(184, 107, 34, 0.08);
  color: #8a541d;
}

.field-route-action[data-state="problem"] {
  border-color: rgba(179, 54, 54, 0.32);
  background: rgba(179, 54, 54, 0.07);
  color: #9a3434;
}

.field-route-action[data-state="danger"] {
  border-color: rgba(179, 54, 54, 0.34);
  background: rgba(179, 54, 54, 0.06);
  color: #873131;
}

.field-route-action:disabled {
  cursor: default;
  opacity: 0.46;
}

.field-route-evidence-grid,
.field-route-task-surfaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.field-route-evidence-group,
.field-route-task-group {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field-route-active-photo-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(25, 123, 91, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(25, 123, 91, 0.09), transparent 50%),
    rgba(255, 255, 255, 0.9);
}

.field-route-active-photo-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.field-route-active-photo-title span,
.field-route-active-photo-title strong,
.field-route-active-photo-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-active-photo-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-route-active-photo-title strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.field-route-active-photo-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field-route-active-photo-details {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.field-route-active-photo-pill {
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(25, 123, 91, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-task-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.field-route-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  min-width: 0;
}

.field-route-mini-actions .field-route-action {
  min-height: 28px;
  padding: 0 6px;
  font-size: 10px;
}

.field-route-evidence-item,
.field-route-task-card,
.field-route-issue,
.field-route-readiness-chip {
  min-width: 0;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-route-evidence-item {
  display: grid;
  gap: 2px;
  padding: 7px;
  cursor: pointer;
}

.field-route-task-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-route-task-card {
  display: grid;
  gap: 5px;
  padding: 7px;
  scroll-margin-bottom: 16px;
  scroll-margin-top: 12px;
}

.field-route-task-card[data-active="true"] {
  border-color: var(--accent);
  outline: 3px solid rgba(25, 123, 91, 0.18);
  outline-offset: 2px;
}

.field-route-task-card[data-flash="true"] {
  animation: field-route-card-stroke-pulse 1s ease-in-out 1;
}

.field-route-task-card:focus {
  outline: 3px solid rgba(25, 123, 91, 0.18);
  outline-offset: 2px;
}

.field-route-task-title,
.field-route-task-status,
.field-route-task-actions {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field-route-task-title {
  grid-template-columns: minmax(0, 1fr);
}

.field-route-task-title span,
.field-route-task-title strong,
.field-route-task-meta,
.field-route-task-status span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-task-title span,
.field-route-task-status span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.field-route-task-title strong {
  color: var(--text);
  font-size: 12px;
}

.field-route-task-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.field-route-task-status {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-route-task-actions {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}

.field-route-band-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.field-route-band-tab {
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(214, 221, 215, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-band-tab[data-active="true"] {
  border-color: rgba(25, 123, 91, 0.38);
  background: rgba(25, 123, 91, 0.1);
  color: var(--accent);
}

.field-route-vertical-line {
  position: absolute;
  z-index: 2;
  top: 14%;
  bottom: 17%;
  width: 24px;
  margin-left: -12px;
  border: 0;
  border-left: 2px dashed rgba(184, 107, 34, 0.72);
  background: transparent;
  color: transparent;
  overflow: hidden;
}

.field-route-vertical-line::after {
  position: absolute;
  top: 46%;
  left: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(184, 107, 34, 0.82);
  content: "";
}

.field-route-vertical-line[data-state="recorded"] {
  border-left-color: rgba(25, 123, 91, 0.72);
}

.field-route-vertical-line[data-state="recorded"]::after {
  background: rgba(25, 123, 91, 0.82);
}

.field-route-vertical-line[data-active="true"] {
  border-left-style: solid;
  border-left-width: 4px;
}

.field-route-vertical-line[data-flash="true"] {
  animation: field-route-vertical-stroke-pulse 1s ease-in-out 1;
}

@keyframes field-route-card-stroke-pulse {
  0%,
  100% {
    border-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(25, 123, 91, 0);
  }
  50% {
    border-color: #b86b22;
    box-shadow: 0 0 0 4px rgba(25, 123, 91, 0.16);
  }
}

@keyframes field-route-svg-stroke-pulse {
  0%,
  100% {
    stroke: var(--accent);
    stroke-width: 3;
  }
  50% {
    stroke: #b86b22;
    stroke-width: 5;
  }
}

@keyframes field-route-vertical-stroke-pulse {
  0%,
  100% {
    border-left-color: var(--accent);
    filter: drop-shadow(0 0 0 rgba(25, 123, 91, 0));
  }
  50% {
    border-left-color: #b86b22;
    filter: drop-shadow(0 0 5px rgba(25, 123, 91, 0.42));
  }
}

@media (prefers-reduced-motion: reduce) {
  .field-route-plan-marker[data-flash="true"] circle,
  .field-route-slot-line[data-flash="true"],
  .field-route-slot-card[data-flash="true"],
  .field-route-projection[data-flash="true"],
  .field-route-evidence[data-flash="true"],
  .field-route-task-card[data-flash="true"],
  .field-route-vertical-line[data-flash="true"] {
    animation: none;
  }
}

.field-route-evidence-item:focus-visible,
.field-route-action:focus-visible {
  outline: 3px solid rgba(25, 123, 91, 0.22);
  outline-offset: 2px;
}

.field-route-evidence-name,
.field-route-evidence-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-evidence-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.field-route-readiness-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
}

.field-route-readiness-chip span,
.field-route-readiness-chip strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-route-readiness-chip span {
  color: var(--muted);
  font-weight: 850;
}

.field-route-issue {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
}

.field-route-issue-title {
  color: var(--text);
  font-size: 12px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
  min-width: 0;
  padding: 24px;
}

.empty-title {
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
}

.empty-subtitle {
  max-width: 28rem;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.photo,
.overlay {
  position: absolute;
  inset: 0;
  display: block;
  user-select: none;
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.overlay {
  overflow: visible;
  touch-action: none;
}

.measurement-hit {
  cursor: pointer;
}

.measurement-line {
  stroke-linecap: round;
}

.measurement-handle {
  cursor: grab;
}

.measurement-handle:active {
  cursor: grabbing;
}

.measurement-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--text);
  font-weight: 750;
  pointer-events: none;
}

.line-action {
  cursor: pointer;
}

.line-action-move {
  cursor: move;
}

.line-action-halo {
  stroke: rgba(255, 255, 255, 0.86);
}

.line-action-stroke {
  stroke: rgba(23, 33, 28, 0.72);
}

.line-action-icon-danger .line-action-stroke {
  stroke: rgba(179, 54, 54, 0.82);
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  background: var(--surface);
}

.panel-head,
.line-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.floor-plan-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.floor-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.room-plan-preview {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcfa 0%, #f6faf7 100%);
}

.room-plan-preview[data-state="empty"] {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.room-plan-preview-svg {
  display: block;
  width: 100%;
  max-height: 172px;
  aspect-ratio: 384 / 260;
  border-radius: 6px;
  background: #eef4ef;
}

.room-plan-preview-boundary {
  fill: rgba(255, 255, 255, 0.82);
  stroke: #8ea09a;
  stroke-width: 4;
  stroke-linejoin: round;
}

.room-plan-preview-boundary[data-state="empty"] {
  fill: rgba(255, 255, 255, 0.45);
  stroke: rgba(142, 160, 154, 0.7);
  stroke-dasharray: 10 7;
}

.room-plan-preview-wall {
  fill: none;
  stroke: #197b5b;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-plan-preview-wall[data-state="blocked"] {
  stroke: #b86b22;
}

.room-plan-preview-label {
  fill: #274337;
  font-size: 16px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
}

.room-plan-preview-object circle {
  fill: #fff8dd;
  stroke: rgba(184, 107, 34, 0.55);
  stroke-width: 2;
}

.room-plan-preview-object text {
  fill: #6d491e;
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
}

.room-plan-preview-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.room-plan-preview-meta strong,
.room-plan-preview-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-plan-preview-meta strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.room-plan-preview-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.room-plan-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.room-plan-preview-chips span {
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid rgba(25, 123, 91, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #315345;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
}

.room-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.room-item.selected {
  border-color: var(--accent);
  background: #f5fbf7;
}

.room-name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  color: var(--muted);
  font-size: 12px;
}

.source-context-panel,
.field-checklist-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf7;
}

.source-context-panel {
  border-color: rgba(45, 111, 159, 0.18);
  background: #f7fafb;
}

.source-context-head,
.field-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-context-head span:last-child {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: #2d6f9f;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}

.source-context-state {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(45, 111, 159, 0.12);
  color: #2d6f9f;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
}

.source-context-title,
.source-context-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-context-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.source-context-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.source-context-rooms,
.source-context-tasks,
.source-context-notes {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-context-room,
.source-context-task,
.source-context-note {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: var(--surface);
}

.source-context-task {
  border-color: rgba(45, 111, 159, 0.16);
  background: rgba(45, 111, 159, 0.055);
}

.source-context-task[data-state="covered"] {
  border-color: rgba(25, 123, 91, 0.18);
  background: rgba(25, 123, 91, 0.06);
}

.source-context-task[data-state="partial"],
.source-context-task[data-state="declaredOnly"] {
  border-color: rgba(184, 107, 34, 0.2);
  background: rgba(184, 107, 34, 0.06);
}

.source-context-task[data-state="unmatched"] {
  border-color: rgba(179, 54, 54, 0.18);
  background: rgba(179, 54, 54, 0.055);
}

.source-context-task.is-more {
  padding-block: 5px;
  color: #2d6f9f;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.source-context-task-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.source-context-room-title,
.source-context-task-title,
.source-context-note-title,
.source-context-task-detail,
.source-context-note-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-context-room-title,
.source-context-task-title,
.source-context-note-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.source-context-task-status {
  min-width: 0;
  max-width: 78px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-context-task[data-state="covered"] .source-context-task-status {
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.source-context-task[data-state="partial"] .source-context-task-status,
.source-context-task[data-state="declaredOnly"] .source-context-task-status {
  background: rgba(184, 107, 34, 0.12);
  color: #8a541d;
}

.source-context-task[data-state="unmatched"] .source-context-task-status {
  background: rgba(179, 54, 54, 0.12);
  color: #b33636;
}

.source-context-task-detail,
.source-context-note-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field-checklist-head-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.field-checklist-head-meta span {
  min-width: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-transform: none;
  white-space: nowrap;
}

.field-checklist-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-checklist-item {
  min-width: 0;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-checklist-item.is-done {
  border-color: rgba(25, 123, 91, 0.35);
  background: #f5fbf7;
}

.field-checklist-control {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(54px, auto);
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 9px;
}

.field-checklist-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.field-checklist-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.field-checklist-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-checklist-detail,
.field-checklist-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field-checklist-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-checklist-status {
  justify-self: end;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  text-transform: uppercase;
  white-space: nowrap;
}

.field-checklist-item.is-done .field-checklist-status {
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.sync-outbox-panel,
.measurement-package-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: #fbfcf8;
}

.sync-outbox-head,
.measurement-package-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.sync-outbox-head span:last-child,
.measurement-package-head span:last-child {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}

.sync-outbox-state,
.measurement-package-state {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.sync-outbox-state[data-state="empty"] {
  background: var(--surface-2);
  color: var(--muted);
}

.sync-outbox-state[data-state="failed"] {
  background: rgba(179, 54, 54, 0.12);
  color: #b33636;
}

.sync-outbox-state[data-state="queued"] {
  background: rgba(45, 111, 159, 0.12);
  color: #2d6f9f;
}

.measurement-package-state[data-state="draft"] {
  background: rgba(184, 107, 34, 0.12);
  color: #8a541d;
}

.measurement-package-state[data-state="ready"] {
  background: rgba(25, 123, 91, 0.12);
  color: var(--accent);
}

.measurement-package-state[data-state="queued"] {
  background: rgba(45, 111, 159, 0.12);
  color: #2d6f9f;
}

.measurement-package-stats,
.measurement-package-evidence {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-package-evidence {
  color: #596737;
}

.measurement-package-action {
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(25, 123, 91, 0.22);
  border-radius: var(--radius);
  background: rgba(25, 123, 91, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.measurement-package-action:disabled {
  cursor: default;
  opacity: 1;
}

.sync-outbox-action {
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(45, 111, 159, 0.22);
  border-radius: var(--radius);
  background: rgba(45, 111, 159, 0.08);
  color: #2d6f9f;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.measurement-package-action[data-state="blocked"] {
  border-color: rgba(184, 107, 34, 0.24);
  background: rgba(184, 107, 34, 0.08);
  color: #8a541d;
}

.measurement-package-action[data-state="queued"] {
  border-color: rgba(45, 111, 159, 0.22);
  background: rgba(45, 111, 159, 0.08);
  color: #2d6f9f;
}

.measurement-package-readiness {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.measurement-package-readiness-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 6px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.measurement-package-readiness-item[data-state="ready"],
.measurement-package-readiness-item[data-state="present"],
.measurement-package-readiness-item[data-state="localOnly"],
.measurement-package-readiness-item[data-state="queuedLocal"] {
  border-color: rgba(25, 123, 91, 0.24);
}

.measurement-package-readiness-item[data-state="missing"] {
  border-color: rgba(184, 107, 34, 0.28);
  background: rgba(184, 107, 34, 0.06);
}

.measurement-package-readiness-label,
.measurement-package-readiness-value,
.measurement-package-readiness-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-package-readiness-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.measurement-package-readiness-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.measurement-package-readiness-detail {
  grid-column: 1 / -1;
  color: #596737;
  font-size: 10px;
  font-weight: 750;
}

.measurement-package-verification {
  min-width: 0;
  overflow: hidden;
  padding: 6px 7px;
  border-radius: var(--radius);
  background: rgba(184, 107, 34, 0.08);
  color: #8a541d;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-package-verification[data-state="ready"] {
  background: rgba(25, 123, 91, 0.08);
  color: var(--accent);
}

.measurement-package-issues {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.measurement-package-issue {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.measurement-package-issue.is-ready {
  background: rgba(25, 123, 91, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.measurement-package-issue.is-more {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding-block: 2px;
}

.measurement-package-issue-title,
.measurement-package-issue-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-package-issue-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.measurement-package-issue-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.measurement-cloud-sync,
.measurement-snapshot-preview,
.korpus-snapshot-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(214, 221, 215, 0.86);
  border-radius: var(--radius);
  background: var(--surface);
}

.measurement-cloud-sync[data-state="debouncing"],
.measurement-cloud-sync[data-state="offlineQueued"],
.measurement-snapshot-preview[data-state="attention"],
.korpus-snapshot-preview[data-state="attention"] {
  border-color: rgba(184, 107, 34, 0.28);
  background: rgba(184, 107, 34, 0.06);
}

.measurement-cloud-sync[data-state="preparedLocal"],
.measurement-cloud-sync[data-state="queuedLocal"],
.measurement-snapshot-preview[data-state="ready"],
.korpus-snapshot-preview[data-state="ready"] {
  border-color: rgba(25, 123, 91, 0.24);
  background: rgba(25, 123, 91, 0.07);
}

.korpus-snapshot-preview[data-state="blocked"] {
  border-color: rgba(179, 54, 54, 0.18);
  background: rgba(179, 54, 54, 0.06);
}

.measurement-info-card-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-info-card-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.measurement-info-card-row {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.measurement-info-card-row span,
.measurement-info-card-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measurement-info-card-row span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.measurement-info-card-row strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.measurement-info-card-note {
  min-width: 0;
  overflow: hidden;
  color: #596737;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-outbox-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sync-outbox-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sync-outbox-item.is-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-outbox-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-outbox-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.capture-mode {
  background: var(--surface);
}

body.capture-mode::before {
  display: none;
}

body.capture-frame-mobile {
  --capture-frame-width: 412px;
}

body.capture-frame-mobile .app-shell,
body.capture-frame-mobile .workspace {
  display: block;
  min-height: 100dvh;
}

body.capture-hide-app-chrome .topbar,
body.capture-hide-app-chrome .editor-panel,
body.capture-hide-app-chrome .ble-panel,
body.capture-hide-app-chrome .statusbar,
body.capture-hide-app-chrome .field-checklist-panel,
body.capture-hide-app-chrome .sync-outbox-panel,
body.capture-hide-app-chrome .measurement-package-panel,
body.capture-hide-app-chrome .selected-editor,
body.capture-hide-app-chrome .line-list-head,
body.capture-hide-app-chrome .line-list {
  display: none !important;
}

body.capture-focus-side-panel .side-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  width: min(var(--capture-frame-width, 412px), 100%);
  max-width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  padding: 16px;
  background: var(--surface);
}

body.capture-focus-side-panel .panel-head {
  min-height: 44px;
}

body.capture-focus-side-panel .panel-head .danger {
  display: none;
}

body.capture-focus-floor-plan .floor-plan-panel {
  align-content: start;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-height: calc(100dvh - 74px);
  overflow: hidden;
  padding: 14px;
}

body.capture-focus-floor-plan .floor-plan-head {
  font-size: 14px;
}

body.capture-focus-floor-plan .room-list {
  gap: 10px;
}

body.capture-focus-floor-plan .room-item {
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 6px;
  max-width: 100%;
  min-height: 58px;
  padding: 12px 10px 12px 14px;
}

body.capture-focus-floor-plan .room-item > .room-meta {
  justify-self: end;
  white-space: nowrap;
}

body.capture-focus-floor-plan .room-name {
  font-size: 16px;
  white-space: normal;
}

body.capture-focus-floor-plan .room-meta {
  font-size: 13px;
}

body.capture-focus-editor-context .topbar,
body.capture-focus-editor-context .side-panel,
body.capture-focus-editor-context .ble-panel,
body.capture-focus-editor-context .statusbar {
  display: none !important;
}

body.capture-focus-editor-context .workspace {
  display: block;
  width: min(var(--capture-frame-width, 412px), 100%);
  min-height: 100dvh;
  background: var(--surface);
}

body.capture-focus-editor-context .editor-panel {
  display: grid;
  grid-template-rows: 620px auto;
  width: min(var(--capture-frame-width, 412px), 100%);
  min-height: auto;
  border-right: 0;
  background: var(--surface);
}

body.capture-focus-editor-context .editor-context {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

body.capture-focus-editor-context .editor-context-main,
body.capture-focus-editor-context .editor-context-meta {
  flex-basis: 100%;
  justify-content: flex-start;
}

body.capture-focus-editor-context .editor-context-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

body.capture-focus-editor-context .editor-context-meta span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

body.capture-focus-editor-context .context-title {
  font-size: 18px;
}

body.capture-focus-editor-context .context-subtitle {
  font-size: 14px;
}

body.capture-focus-editor-context .viewport {
  min-height: 0;
  height: 620px;
  margin: 16px 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

body.capture-focus-project-gallery .topbar,
body.capture-focus-project-gallery .workspace,
body.capture-focus-project-gallery .ble-panel,
body.capture-focus-project-gallery .statusbar {
  display: none !important;
}

body.capture-focus-project-gallery .app-shell {
  display: block;
  min-height: 100dvh;
  padding-bottom: 0;
  background: var(--surface);
}

body.capture-focus-project-gallery .project-gallery {
  position: static;
  min-height: 100dvh;
  padding: 16px;
  background: var(--surface);
}

body.capture-focus-project-gallery .project-gallery-panel {
  width: min(calc(var(--capture-frame-width, 412px) - 32px), 100%);
  max-height: none;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

body.capture-focus-project-gallery .project-gallery-grid {
  grid-template-columns: 1fr;
}

.selected-editor {
  display: grid;
  gap: 6px;
}

.selected-editor label,
.line-list-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.selected-editor input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}

.selected-editor input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(25, 123, 91, 0.15);
}

.ble-fill-controls {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ble-auto-fill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ble-auto-fill input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.ble-fill-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.line-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.line-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.line-ble-button {
  min-width: 48px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
}

.line-ble-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.line-item.selected {
  border-color: var(--accent);
  background: #edf7f1;
}

.line-swatch {
  width: 14px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent);
}

.line-main {
  min-width: 0;
}

.line-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.statusbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(var(--statusbar-height) + var(--safe-bottom));
  padding: 7px calc(14px + var(--safe-right)) calc(7px + var(--safe-bottom)) calc(14px + var(--safe-left));
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 -10px 24px rgba(23, 33, 28, 0.16);
}

.statusbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusbar #photoMeta {
  color: var(--muted);
}

.metrio-toast {
  position: fixed;
  right: calc(14px + var(--safe-right));
  bottom: calc(var(--statusbar-height) + var(--safe-bottom) + 14px);
  left: calc(14px + var(--safe-left));
  z-index: 220;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: min(520px, calc(100% - 28px - var(--safe-left) - var(--safe-right)));
  min-height: 54px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(214, 221, 215, 0.88);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(25, 123, 91, 0.12), rgba(255, 255, 255, 0) 42%),
    rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 44px rgba(23, 33, 28, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.metrio-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.metrio-toast-mark {
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
  border-right-color: var(--accent-2);
  transform: rotate(45deg);
}

.metrio-toast-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.metrio-toast-copy strong,
.metrio-toast-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrio-toast-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.metrio-toast-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1200px), (pointer: coarse) {
  :root {
    --project-notes-height: clamp(158px, 30dvh, 260px);
    --field-route-bottom-reserve: 10px;
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto auto auto;
    min-height: 100dvh;
    overflow: visible;
    padding-bottom: calc(var(--statusbar-height) + var(--safe-bottom) + 12px);
  }

  body[data-metrio-service-route="monotask-order"] .app-shell {
    grid-template-rows: auto auto auto auto;
  }

  .topbar {
    grid-template-areas:
      "brand status export"
      "project project project"
      "tabs tabs tabs";
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    overflow: visible;
  }

  .brand {
    min-width: 0;
  }

  .status-icons {
    grid-area: status;
  }

  .project-summary-button {
    grid-area: project;
  }

  .project-summary-button {
    min-height: 40px;
  }

  .toolbar {
    grid-area: tabs;
  }

  .legacy-editor-tools {
    grid-area: tabs;
  }

  .exportbar {
    grid-area: export;
    justify-content: flex-end;
  }

  .top-measure-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    scrollbar-width: none;
    gap: 4px;
    padding: 5px 4px;
  }

  .top-measure-tabs::-webkit-scrollbar,
  .exportbar::-webkit-scrollbar {
    display: none;
  }

  .top-measure-tab {
    height: 38px;
    min-height: 38px;
    padding: 4px;
  }

  .top-measure-tab strong {
    font-size: 11px;
  }

  .top-measure-tab span {
    font-size: 9px;
  }

  .tool-button,
  .icon-button {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .tool-button {
    min-width: auto;
    padding: 0 10px;
    font-size: 14px;
  }

  .icon-button {
    width: 36px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .editor-panel {
    width: 100%;
    max-width: 100%;
    grid-template-rows: clamp(420px, calc(100svh - 292px - var(--safe-bottom)), 760px) auto;
  }

  .ble-panel {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .ble-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-context {
    position: relative;
    z-index: 70;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 30vw);
    gap: 6px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 8px calc(14px + var(--safe-right)) 8px calc(14px + var(--safe-left));
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 -10px 24px rgba(23, 33, 28, 0.08);
  }

  .editor-context-main {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 3px 8px;
  }

  .editor-context-meta {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
  }

  .editor-context-meta span {
    max-width: 100%;
  }

  .context-title {
    font-size: 13px;
  }

  .context-subtitle,
  .context-chip {
    font-size: 11px;
  }

  .context-chip {
    min-height: 24px;
    max-width: none;
    padding: 0 8px;
  }

  .photo-editor-context-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 7px calc(68px + var(--safe-right)) 7px 7px;
  }

  .photo-editor-context-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.photo-editor-open .context-action-button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }

  .project-notes-input {
    height: var(--project-notes-height);
    min-height: 158px;
    max-height: 260px;
    font-size: 13px;
  }

  .app-shell.photo-editor-open .project-notes-input {
    height: clamp(84px, 14dvh, 120px);
    min-height: 84px;
    max-height: 120px;
  }

  .context-return-button {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .context-kicker {
    min-height: 32px;
  }

  .project-gallery {
    align-items: stretch;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  .about-panel {
    align-items: stretch;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  .kalka-panel {
    align-items: stretch;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  .kalka-card {
    width: 100%;
    max-height: 100%;
  }

  .kalka-grid {
    grid-template-columns: 1fr;
  }

  .kalka-row {
    grid-template-columns: minmax(74px, 0.34fr) minmax(0, 1fr);
    padding: 7px;
  }

  .about-card {
    width: min(520px, calc(100vw - 24px));
    max-height: min(560px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px));
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-row {
    grid-template-columns: minmax(74px, 0.34fr) minmax(0, 1fr);
    padding: 7px;
  }

  .project-gallery-panel {
    width: 100%;
    max-height: 100%;
  }

  .project-gallery-grid {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .gallery-column {
    min-height: auto;
    grid-template-rows: auto;
    padding: 7px;
  }

  .gallery-column:first-child {
    grid-template-rows: auto;
  }

  .gallery-list {
    overflow: visible;
  }

  .gallery-item {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 7px;
    gap: 5px 7px;
  }

  .gallery-item-actions {
    max-width: 126px;
  }

  .gallery-item-title {
    font-size: 13px;
  }

  .gallery-item-folder {
    font-size: 10px;
  }

  .gallery-item-meta {
    font-size: 11px;
  }

  .gallery-item-meta {
    grid-column: 1 / -1;
  }

  .gallery-item-meta-part {
    display: none;
  }

  .side-panel {
    min-height: 0;
    overflow: visible;
    padding: 12px;
  }

  .measurement-package-panel {
    justify-self: start;
    width: calc(100% - 4px);
  }

  .field-checklist-control {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 7px;
  }

  .field-checklist-status {
    grid-column: 2;
    justify-self: start;
  }

  .field-checklist-title,
  .field-checklist-detail {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .line-list,
  .ble-device-list,
  .ble-measurement-list {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .ble-measurement {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ble-log {
    height: auto;
    min-height: 260px;
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .empty-title {
    font-size: 24px;
  }

  .empty-subtitle {
    max-width: calc(100vw - 48px);
  }

  .statusbar {
    min-height: calc(38px + var(--safe-bottom));
    font-size: 12px;
  }

  .app-shell.ble-open,
  .app-shell:has(.ble-panel:not([hidden])) {
    grid-template-rows: auto minmax(360px, 36svh) auto;
  }

  .app-shell.ble-open .exportbar,
  .app-shell.ble-open .side-panel,
  .app-shell:has(.ble-panel:not([hidden])) .exportbar,
  .app-shell:has(.ble-panel:not([hidden])) .side-panel {
    display: none;
  }

  .app-shell.ble-open .workspace,
  .app-shell:has(.ble-panel:not([hidden])) .workspace {
    grid-template-rows: minmax(360px, 36svh);
  }

  .app-shell.ble-open .ble-grid,
  .app-shell:has(.ble-panel:not([hidden])) .ble-grid {
    grid-template-rows: auto auto auto auto;
  }

  .app-shell.ble-open .ble-controls,
  .app-shell.ble-open .ble-tx,
  .app-shell:has(.ble-panel:not([hidden])) .ble-controls,
  .app-shell:has(.ble-panel:not([hidden])) .ble-tx {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .app-shell.ble-open .ble-tx input[type="text"],
  .app-shell:has(.ble-panel:not([hidden])) .ble-tx input[type="text"] {
    flex-basis: 100%;
    min-width: 100%;
  }
}

@media (max-width: 980px), (pointer: coarse) {
  .field-route-screen {
    padding: 10px 10px var(--field-route-bottom-reserve);
  }

  .field-route-layout {
    grid-template-areas: "panel";
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-tabs {
    grid-template-columns: repeat(6, minmax(76px, 1fr));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 7px;
  }

  .field-route-tab {
    min-height: 40px;
    padding: 5px 7px;
  }

  .field-route-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 8px;
  }

  .field-route-title {
    font-size: 17px;
  }

  .field-route-plan,
  .field-route-projection,
  .field-route-tools,
  .field-route-evidence,
  .field-route-issues {
    padding: 10px;
  }

  .field-route-plan-canvas {
    aspect-ratio: 1.32 / 1;
  }

  .field-route-projection-wall {
    min-height: 250px;
  }

  .field-route-section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .field-route-section-head h3,
  .field-route-section-head span,
  .field-route-subtitle,
  .field-route-active-target span,
  .field-route-tool-label,
  .field-route-tool-name,
  .field-route-tool-detail,
  .field-route-issue-title,
  .field-route-issue-meta {
    white-space: normal;
  }

  .field-route-wall-list,
  .field-route-readiness,
  .field-route-evidence-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-plan-inputs {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-plan-drawing {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-plan-drawing .field-route-mini-actions {
    justify-content: stretch;
  }

  .field-route-plan-review {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-plan-review-warning,
  .field-route-plan-review-actions {
    grid-column: 1 / -1;
  }

  .field-route-plan-review .field-route-mini-actions {
    justify-content: stretch;
  }

  .field-route-active-photo-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-route-active-photo-control .field-route-mini-actions {
    justify-content: stretch;
  }

  .contour-lab-head,
  .contour-lab-body,
  .contour-lab-review,
  .contour-lab-expected {
    grid-template-columns: minmax(0, 1fr);
  }

  .contour-lab-stats {
    justify-content: stretch;
  }

  .contour-lab-stat {
    min-width: 0;
    flex: 1 1 76px;
  }

  .contour-lab-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .contour-lab-history-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .field-route-slots {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .field-route-slot-card {
    min-width: 72px;
  }

  .field-route-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media print {
  body {
    overflow: visible;
    background: #ffffff;
  }
}
