/* Factory map workspace. Drawings use their own coordinates; pins stay touch-sized. */
.map-workspace-page .main-content {
  padding: 24px 28px 16px;
  max-width: none;
}
.map-workspace-page .page-footer {
  display: none;
}
.factory-map-app {
  --pin-red: #ee4d46;
  --pin-yellow: #ffd33f;
  --pin-green: #36a460;
  color: #23364c;
}
.factory-map-app [hidden] {
  display: none !important;
}
.factory-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.factory-map-header .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  margin: 0 0 7px;
}
.factory-map-header h1 {
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0 0 7px;
}
.factory-map-header p:not(.eyebrow) {
  margin: 0;
  color: #6b7c91;
  font-size: 12px;
}
.map-live-label {
  font-size: 10px;
  letter-spacing: 0;
  font-weight: 500;
  color: #698478;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.map-live-label i,
.map-quick-add > div i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #49a982;
}
.map-list-link {
  font-size: 12px;
}
.map-project-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 11px;
}
.map-project-bar form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.map-project-bar form > .icon {
  color: #6c83a2;
  width: 21px;
  flex-shrink: 0;
}
.map-project-bar select {
  appearance: auto;
  background: #fff;
  border: 0;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: #2a3d54;
  width: 100%;
  min-width: 0;
}
.map-project-bar .text-link {
  white-space: nowrap;
  font-size: 11px;
}
.map-drawing-label {
  font-size: 10px;
  color: #8694a7;
  white-space: nowrap;
}
.map-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.map-status-filters {
  display: flex;
  gap: 8px;
}
.map-status-filters button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 15px;
  color: #66798f;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e1e7ef;
  border-radius: 9px;
  cursor: pointer;
}
.map-status-filters button strong {
  font-size: 15px;
  color: #2c4059;
  margin-left: 6px;
}
.map-status-filters button i {
  height: 8px;
  width: 8px;
  border-radius: 50%;
}
.map-status-filters .before_review i {
  background: var(--pin-red);
}
.map-status-filters .reviewed i {
  background: #e6b624;
}
.map-status-filters .improved i {
  background: var(--pin-green);
}
.map-status-filters button[aria-pressed="true"] {
  border-color: #96b2dc;
  background: #eef4ff;
  color: #2a5d9f;
  box-shadow: 0 0 0 1px #d5e3f8;
}
.map-status-filters .before_review[aria-pressed="true"] {
  background: #fff0ee;
  border-color: #e7a49d;
  box-shadow: none;
}
.map-status-filters .reviewed[aria-pressed="true"] {
  background: #fff9df;
  border-color: #dfc365;
  box-shadow: none;
}
.map-status-filters .improved[aria-pressed="true"] {
  background: #eaf7ef;
  border-color: #92caaa;
  box-shadow: none;
}
.map-mine-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.map-mine-filter .icon {
  width: 15px;
}
.map-mine-filter input {
  accent-color: #336bd6;
  width: 16px;
  height: 16px;
}
.factory-map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 18px;
  align-items: stretch;
}
.plant-map-panel {
  border: 1px solid #dbe3ed;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  height: clamp(510px, calc(100dvh - 290px), 880px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 14px #20365304;
}
.plant-map-topline,
.plant-map-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  min-height: 49px;
  flex-shrink: 0;
  background: #fff;
}
.plant-map-topline {
  border-bottom: 1px solid #e0e6ef;
}
.plant-map-topline > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6c7e94;
  font-size: 11px;
}
.plant-map-topline > span .icon {
  width: 16px;
  flex-shrink: 0;
}
.map-tool {
  border: none;
  background: transparent;
  color: #526a89;
  font-size: 11px;
  cursor: pointer;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  min-width: 36px;
  padding: 7px;
  white-space: nowrap;
}
.map-tool:hover {
  background: #edf2f9;
  color: #245bb8;
}
.map-tool .icon {
  width: 17px;
  height: 17px;
}
.plant-map-viewport {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 280px;
  background-color: #eaf0f6;
  background-image: radial-gradient(#b3c3d933 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  overscroll-behavior: contain;
  outline-offset: -3px;
}
.plant-map-viewport.is-panning {
  cursor: grabbing;
}
.plant-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  width: 100%;
  will-change: transform;
  background: white;
  box-shadow: 0 3px 20px #29436213;
}
.plant-drawing {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}
.factory-pin {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) scale(var(--pin-scale, 1));
  transform-origin: center;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  touch-action: none;
  outline-offset: 2px;
}
.factory-pin > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #223a46;
  border-radius: 50%;
  background: var(--pin-red);
  color: white;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  box-shadow:
    0 2px 4px #20364925,
    0 0 0 1px #ffffffcb;
}
.factory-pin.reviewed > span {
  background: var(--pin-yellow);
  color: #263542;
}
.factory-pin.improved > span {
  background: var(--pin-green);
}
.factory-pin:hover,
.factory-pin.is-selected {
  z-index: 6;
}
.factory-pin:hover > span,
.factory-pin.is-selected > span {
  box-shadow:
    0 0 0 4px #ffffffef,
    0 0 0 7px #3972d882;
}
.factory-pin.pending-pin {
  pointer-events: none;
  z-index: 8;
}
.factory-pin.pending-pin > span {
  border-style: dashed;
  box-shadow: 0 0 0 5px #ffffffbd;
  font-size: 19px;
}
.plant-map-bottomline {
  border-top: 1px solid #e0e6ef;
}
.map-gesture-help {
  font-size: 10px;
  color: #70839c;
}
.plant-zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}
.plant-zoom-controls output {
  min-width: 48px;
  text-align: center;
  font-size: 12px;
  color: #344e70;
  font-variant-numeric: tabular-nums;
}
.map-fit {
  border-left: 1px solid #e1e7ef;
  border-radius: 0;
  margin-left: 4px;
  padding-left: 12px;
}
.map-quick-add {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid #edf0f5;
  background: #f9fbfe;
}
.map-quick-add > div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #607991;
  font-size: 11px;
}
.map-quick-add .button {
  font-size: 12px;
  padding: 10px 16px;
  min-height: 42px;
}
.map-records-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #dfe6ef;
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
  max-height: clamp(510px, calc(100dvh - 290px), 880px);
}
.map-records-heading {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f5;
  flex-shrink: 0;
}
.map-records-heading h2 {
  margin: 0 0 5px;
  font-size: 14px;
}
.map-records-heading p {
  margin: 0;
  font-size: 11px;
  color: #8090a5;
}
.map-records-heading > .icon {
  color: #a2b0c2;
  width: 18px;
}
.map-records-list {
  overflow-y: auto;
  flex: 1;
}
.map-record-row {
  display: flex;
  gap: 11px;
  padding: 17px 15px;
  border-bottom: 1px solid #edf1f6;
  align-items: flex-start;
  text-decoration: none;
}
.map-record-row:hover,
.map-record-row.is-selected {
  background: #f2f6ff;
}
.record-state-dot {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ee4d46;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #e5eaf0;
}
.record-state-dot.reviewed {
  background: #ffd33f;
  color: #43505e;
}
.record-state-dot.improved {
  background: #36a460;
}
.map-record-copy {
  min-width: 0;
  flex: 1;
}
.map-record-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
  color: #8295ae;
  letter-spacing: 0.4px;
  margin-bottom: 7px;
}
.map-record-meta > span {
  font-size: 9px;
  letter-spacing: 0;
}
.map-record-copy strong {
  display: block;
  font-size: 12px;
  line-height: 1.7;
  color: #2c3f55;
  margin-bottom: 6px;
}
.map-record-copy small {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  color: #73869f;
  font-size: 10px;
  line-height: 1.9;
}
.map-record-row > .icon {
  width: 12px;
  height: 12px;
  margin-top: 29px;
  color: #a4b2c5;
  flex-shrink: 0;
}
.map-archived-link {
  padding: 14px;
  text-align: center;
  color: #7c8ba0;
  font-size: 11px;
  border-top: 1px solid #eef1f5;
  flex-shrink: 0;
}
.map-record-empty {
  text-align: center;
  padding: 42px 12px;
  color: #8394aa;
}
.map-record-empty > .icon {
  width: 32px;
  height: 32px;
}
.map-record-empty p {
  font-size: 13px;
}
.map-record-empty small {
  font-size: 11px;
  line-height: 1.9;
}
.plant-map-caption {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 10px;
  line-height: 1.8;
  color: #7d8ea4;
  margin: 13px 3px 0;
}
.plant-map-caption .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.plant-map-caption strong {
  color: #647b98;
  font-weight: 600;
  margin-right: 7px;
}
.map-empty-filter {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  background: #fffffff5;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  text-align: center;
  z-index: 10;
}
.map-empty-filter button {
  background: none;
  border: 0;
  color: #2865c5;
  text-decoration: underline;
  margin-left: 10px;
  cursor: pointer;
}
.map-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #203e59;
  color: white;
  border-radius: 10px;
  padding: 14px 20px;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  box-shadow: 0 7px 28px #112b5533;
}
.map-dialog-open,
.map-expanded-open {
  overflow: hidden;
}
.map-inspector-dialog {
  position: fixed;
  inset: 16px 16px 16px auto;
  margin: 0;
  padding: 0;
  border: 1px solid #dbe4f1;
  border-radius: 17px;
  width: min(468px, calc(100vw - 32px));
  max-width: none;
  height: calc(100dvh - 32px);
  max-height: none;
  background: #fff;
  color: #263b54;
  box-shadow: -10px 10px 60px #16305124;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.map-inspector-dialog::backdrop {
  background: #0f25492e;
}
.map-inspector-dialog turbo-frame {
  display: block;
}
.inspector-close {
  position: sticky;
  float: right;
  top: 12px;
  margin: 12px 14px -52px 0;
  height: 36px;
  width: 36px;
  background: #f2f5fa;
  border: 1px solid #e4eaf3;
  border-radius: 50%;
  color: #637b99;
  display: grid;
  place-items: center;
  z-index: 5;
  cursor: pointer;
}
.inspector-close .icon {
  width: 18px;
}
.map-panel-loading {
  padding: 70px 24px;
  min-height: 300px;
}
.map-panel-loading h2 {
  font-size: 20px;
}
.map-panel-loading p {
  font-size: 14px;
  line-height: 1.8;
}
.pin-panel-header {
  padding: 27px 55px 21px 24px;
  border-bottom: 1px solid #e9eef5;
  background: linear-gradient(120deg, #f4f8ff, #fff 85%);
}
.pin-panel-header .eyebrow {
  font-size: 10px;
  letter-spacing: 0.6px;
  line-height: 1.8;
  margin: 0 0 10px;
  color: #7289a7;
}
.pin-panel-header h2 {
  font-size: 21px;
  line-height: 1.6;
  color: #233b57;
  margin: 10px 0 0;
}
.pin-panel-header h2:focus {
  outline: none;
}
.pin-panel-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pin-panel-status .status-badge,
.pin-panel-status .risk-badge,
.pin-panel-status .neutral-badge {
  font-size: 10px;
}
.pin-panel-body {
  padding: 22px 24px;
}
.pin-panel-body > section {
  margin-bottom: 26px;
}
.pin-panel-body h3 {
  font-size: 14px;
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.pin-panel-body h3 .icon {
  width: 17px;
  color: #718aaa;
}
.pin-panel-body .prose {
  font-size: 14px;
  color: #536b86;
  line-height: 1.9;
}
.pin-panel-body .prose p {
  margin: 0 0 8px;
}
.pin-master-details {
  margin: 0;
  background: #f8fafd;
  border: 1px solid #eaf0f6;
  border-radius: 9px;
  padding: 1px 15px;
}
.pin-master-details > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e7edf5;
}
.pin-master-details > div:last-child {
  border-bottom: none;
}
.pin-master-details dt {
  color: #7b8da5;
  font-size: 12px;
  line-height: 1.8;
}
.pin-master-details dd {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: #354f70;
}
.pin-master-details dd small {
  display: block;
  color: #8295ae;
  font-size: 10px;
}
.pin-cost {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 17px 18px;
  background: #edf4ff;
  border: 1px solid #dbe7f8;
  border-radius: 10px;
  margin-bottom: 25px;
  gap: 10px;
}
.pin-cost span {
  font-size: 11px;
  color: #607fa5;
}
.pin-cost strong {
  display: block;
  color: #284a74;
  font-size: 27px;
  margin-top: 7px;
}
.pin-cost small {
  font-size: 11px;
  color: #7b92b0;
  padding-bottom: 3px;
}
.pin-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.pin-photo-grid a {
  display: block;
}
.pin-photo-grid img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #e2e9f2;
}
.pin-history {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.pin-history li {
  border-left: 2px solid #dfe8f4;
  padding: 0 0 20px 15px;
  position: relative;
}
.pin-history li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: absolute;
  left: -4.5px;
  top: 5px;
  background: #7598c8;
  box-shadow: 0 0 0 3px white;
}
.pin-history li > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.pin-history strong {
  font-size: 12px;
  color: #3d5676;
}
.pin-history time {
  font-size: 10px;
  color: #8b9ab0;
  white-space: nowrap;
}
.pin-history small {
  display: block;
  font-size: 10px;
  line-height: 1.8;
  color: #8193ac;
  margin: 5px 0;
}
.pin-history p {
  color: #536c89;
  font-size: 12px;
  line-height: 1.8;
  margin: 6px 0 0;
}
.pin-event-cost {
  color: #597698;
  font-size: 11px;
  display: block;
  margin-top: 6px;
}
.pin-panel-body .text-link {
  font-size: 12px;
}
.pin-panel-footer {
  position: sticky;
  bottom: 0;
  background: #fffffff5;
  backdrop-filter: blur(6px);
  border-top: 1px solid #e6edf6;
  padding: 15px 24px max(15px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  z-index: 3;
}
.pin-panel-footer .button {
  font-size: 14px;
  min-height: 46px;
  padding: 11px 12px;
  margin: 0;
}
.pin-notice {
  margin: 18px 24px 0;
  background: #eaf6f1;
  color: #326f5d;
  border: 1px solid #cfe8dc;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.8;
  border-radius: 9px;
}
.pin-notice .icon {
  width: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}
.pin-delete-confirm {
  border-top: 1px solid #e7edf5;
  padding-top: 15px;
}
.pin-delete-confirm summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b46664;
  cursor: pointer;
  min-height: 44px;
  font-size: 12px;
}
.pin-delete-confirm summary::-webkit-details-marker {
  display: none;
}
.pin-delete-confirm summary .icon {
  width: 16px;
}
.pin-delete-confirm p {
  font-size: 12px;
  line-height: 1.9;
  color: #806d73;
  margin: 9px 0 13px;
}
.pin-delete-confirm .button.danger {
  background: #bc4e4e;
  border-color: #bc4e4e;
  color: white;
  font-size: 13px;
  min-height: 46px;
}
.pin-restore-info {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 12px;
  line-height: 1.8;
  padding: 15px;
  background: #f5f7fa;
  border-radius: 10px;
  margin-bottom: 12px;
}
.pin-restore-info p {
  margin: 0;
}
.pin-restore-info .icon {
  width: 24px;
  flex-shrink: 0;
  color: #7d8fa7;
}
.pin-location-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 11px 0 0;
  color: #7990ac;
  font-size: 11px;
  line-height: 1.9;
}
.pin-location-note .icon {
  width: 14px;
}
.pin-location-note span {
  display: block;
  width: 100%;
  color: #8a99ad;
}
.pin-editor-form .field {
  margin: 0 0 18px;
  min-width: 0;
}
.pin-editor-form .field label {
  font-size: 12px;
  font-weight: 600;
  color: #4c6685;
  margin-bottom: 8px;
}
.pin-editor-form .field input,
.pin-editor-form .field select,
.pin-editor-form .field textarea {
  width: 100%;
  min-width: 0;
  background: #fff;
  font-size: 16px;
  min-height: 44px;
  padding: 11px;
  color: #314b6a;
  border-color: #dce5f0;
  border-radius: 8px;
}
.pin-editor-form .field textarea {
  line-height: 1.7;
}
.pin-editor-form .field small {
  display: block;
  color: #7a8ea7;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 6px;
}
.pin-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.pin-form-group {
  border-top: 1px solid #e8eef5;
  border-bottom: 1px solid #e8eef5;
  padding-top: 20px;
  margin-bottom: 20px;
}
.pin-color-fieldset {
  padding: 0;
  margin: 0 0 24px;
  border: 0;
  min-width: 0;
}
.pin-color-fieldset legend {
  font-size: 12px;
  color: #4c6685;
  font-weight: 600;
  margin-bottom: 11px;
}
.pin-color-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.pin-color-options label {
  position: relative;
  cursor: pointer;
}
.pin-color-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.pin-color-options label > span {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 4px 9px;
  padding: 13px 10px;
  border: 1px solid #dfe6f0;
  border-radius: 10px;
  background: #fff;
}
.pin-color-options i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ee4d46;
  border: 1.5px solid #283e50;
  grid-row: span 2;
  align-self: center;
}
.pin-color-options .reviewed i {
  background: #ffd33f;
}
.pin-color-options .improved i {
  background: #36a460;
}
.pin-color-options strong {
  font-size: 14px;
  color: #334e70;
}
.pin-color-options small {
  font-size: 10px;
  color: #7189a6;
  white-space: nowrap;
}
.pin-color-options input:checked + span {
  border-color: #6d9dde;
  box-shadow: 0 0 0 2px #d5e5fb;
  background: #f3f7fe;
}
.pin-color-options input:focus-visible + span {
  outline: 2px solid #366dcc;
  outline-offset: 2px;
}
.pin-photo-input {
  position: relative;
  border: 1px dashed #ccd9e9;
  border-radius: 9px;
  padding: 15px;
  background: #f9fbfe;
}
.pin-photo-input > .icon {
  position: absolute;
  right: 14px;
  top: 13px;
  width: 22px;
  color: #8ca2bf;
}
.pin-photo-input input[type="file"] {
  font-size: 12px;
  padding: 10px 0;
  border: 0;
  background: transparent;
}
.pin-notification-hint {
  display: flex;
  gap: 7px;
  font-size: 11px;
  line-height: 1.9;
  color: #6e88aa;
  margin: 4px 0;
}
.pin-notification-hint .icon {
  width: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}
.factory-map-app.map-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 16px;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
}
.map-fullscreen .factory-map-header,
.map-fullscreen .plant-map-caption {
  display: none;
}
.map-fullscreen .factory-map-workspace {
  flex: 1;
  min-height: 0;
}
.map-fullscreen .plant-map-panel {
  height: 100%;
  min-height: 0;
}
.map-fullscreen .map-records-panel {
  max-height: none;
  min-height: 0;
}
@media (max-width: 1220px) {
  .factory-map-workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 13px;
  }
  .map-drawing-label {
    display: none;
  }
  .map-gesture-help span {
    display: none;
  }
  .map-status-filters button {
    padding: 9px 11px;
    gap: 6px;
    font-size: 11px;
  }
  .map-mine-filter {
    font-size: 10px;
  }
  .map-records-heading {
    padding: 18px 14px;
  }
  .map-record-row {
    padding: 16px 12px;
    gap: 8px;
  }
  .map-record-row > .icon {
    display: none;
  }
}
@media (max-width: 1050px) {
  .factory-map-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-records-panel {
    max-height: 350px;
  }
  .map-records-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-record-row:nth-child(odd) {
    border-right: 1px solid #eaf0f5;
  }
  .map-fullscreen .map-records-panel {
    display: none;
  }
}
@media (max-width: 900px) {
  .map-workspace-page .main-content {
    padding: 18px 14px 86px;
  }
  .factory-map-header {
    margin-bottom: 14px;
    gap: 8px;
  }
  .factory-map-header h1 {
    font-size: 23px;
    gap: 10px;
  }
  .factory-map-header .eyebrow {
    font-size: 8px;
    margin-bottom: 5px;
  }
  .factory-map-header p:not(.eyebrow) {
    font-size: 11px;
  }
  .map-live-label {
    display: none;
  }
  .map-list-link {
    min-height: 42px;
    font-size: 10px;
    padding: 9px 11px;
  }
  .map-list-link .icon {
    width: 15px;
  }
  .map-project-bar {
    padding: 8px 11px;
    gap: 7px;
    margin-bottom: 12px;
  }
  .map-project-bar .text-link {
    display: none;
  }
  .map-project-bar select {
    font-size: 14px;
    min-height: 36px;
  }
  .map-filter-bar {
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
  }
  .map-status-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .map-status-filters button {
    flex-wrap: wrap;
    padding: 9px 5px;
    gap: 5px;
    font-size: 11px;
    min-height: 54px;
  }
  .map-status-filters button strong {
    margin-left: 0;
    font-size: 16px;
  }
  .map-status-filters button i {
    width: 6px;
    height: 6px;
  }
  .map-mine-filter {
    min-height: 32px;
    margin-left: auto;
    font-size: 11px;
  }
  .plant-map-panel {
    height: clamp(400px, calc(100dvh - 425px), 730px);
    border-radius: 12px;
  }
  .plant-map-topline {
    padding: 6px 9px;
    min-height: 48px;
    gap: 5px;
  }
  .plant-map-topline > span {
    font-size: 10px;
    gap: 5px;
  }
  .plant-map-topline > span .icon {
    width: 14px;
  }
  .plant-map-topline .map-tool {
    font-size: 10px;
    padding: 6px;
    min-height: 38px;
  }
  .plant-map-viewport {
    min-height: 230px;
  }
  .plant-map-bottomline {
    min-height: 49px;
    padding: 4px 9px;
    gap: 3px;
  }
  .plant-zoom-controls .map-tool {
    min-width: 40px;
    min-height: 42px;
  }
  .plant-zoom-controls output {
    min-width: 44px;
  }
  .map-gesture-help {
    font-size: 10px;
  }
  .map-fit {
    padding-left: 8px;
    margin-left: 0;
  }
  .map-quick-add {
    padding: 10px 12px;
  }
  .map-quick-add > div {
    font-size: 10px;
  }
  .map-quick-add .button {
    min-height: 44px;
    padding: 10px 14px;
  }
  .map-records-panel {
    border-radius: 12px;
  }
  .map-records-heading {
    padding: 16px;
  }
  .map-record-row {
    padding: 17px 15px;
  }
  .plant-map-caption {
    font-size: 10px;
  }
  .map-toast {
    bottom: 78px;
    width: calc(100% - 28px);
    padding: 12px 16px;
    font-size: 12px;
  }
  .map-inspector-dialog {
    inset: auto 0 0;
    width: 100%;
    height: min(88dvh, 900px);
    max-height: calc(100dvh - 25px);
    border: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 44px #15324a2b;
  }
  .map-inspector-dialog::backdrop {
    background: #15284060;
  }
  .pin-panel-header {
    padding: 23px 56px 18px 20px;
  }
  .pin-panel-header h2 {
    font-size: 20px;
  }
  .pin-panel-body {
    padding: 20px;
  }
  .pin-panel-footer {
    padding: 13px 20px max(15px, env(safe-area-inset-bottom));
  }
  .pin-notice {
    margin: 14px 20px 0;
  }
  .pin-panel-footer .button {
    font-size: 14px;
    min-height: 46px;
  }
  .map-fullscreen.factory-map-app {
    padding: max(12px, env(safe-area-inset-top)) 10px
      max(12px, env(safe-area-inset-bottom));
  }
  .map-fullscreen .map-filter-bar {
    margin-bottom: 8px;
  }
  .map-fullscreen .map-project-bar {
    margin-bottom: 8px;
  }
  .map-fullscreen .map-mine-filter {
    min-height: 26px;
  }
  .map-fullscreen .plant-map-panel {
    height: 100%;
  }
}
@media (max-width: 520px) {
  .map-records-list {
    display: block;
  }
  .map-record-row:nth-child(odd) {
    border-right: 0;
  }
  .pin-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pin-color-options {
    gap: 7px;
  }
  .pin-color-options label > span {
    padding: 12px 8px;
    gap: 4px 7px;
    grid-template-columns: 21px 1fr;
  }
  .pin-color-options i {
    width: 21px;
    height: 21px;
  }
}
@media (max-width: 380px) {
  .map-workspace-page .main-content {
    padding-left: 10px;
    padding-right: 10px;
  }
  .plant-map-topline > span {
    font-size: 9px;
  }
  .plant-map-topline .map-tool span {
    display: none;
  }
  .map-status-filters button {
    font-size: 10px;
    gap: 4px;
  }
  .pin-panel-body {
    padding-left: 17px;
    padding-right: 17px;
  }
  .pin-panel-header {
    padding-left: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .plant-map-canvas {
    will-change: auto;
  }
}
