/* Free KMZ, KML and DXF viewer (/tools/kmz-viewer, kml-viewer, dxf-viewer,
   marketing/office_tools/site_plan_viewer). Prefix .ot-spv-. Shared pieces
   (.ot-tool, .ot-dropzone, .ot-pill, .ot-btn) come from office_tools.css. */

.ot-spv { flex-direction: column; padding: 28px; gap: 20px; }
.ot-spv-open { display: flex; flex-direction: column; gap: 12px; }
.ot-spv-drop { cursor: pointer; }
.ot-spv-drop-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.ot-spv-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Once a file is open the drop zone steps aside; "Open another file" brings it back. */
.ot-spv.is-open .ot-spv-drop, .ot-spv.is-open .ot-spv-samples { display: none; }

.ot-spv-workspace { display: flex; flex-direction: column; gap: 12px; }
.ot-spv-workspace[hidden] { display: none; }
.ot-spv-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.ot-spv-hint { min-height: 1.4em; }

.ot-spv-stage {
  position: relative; height: min(68vh, 560px); min-height: 360px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; background-color: #fbfaf7;
  background-image: radial-gradient(circle, var(--gray-300, #d1d5db) 1px, transparent 1px); background-size: 22px 22px;
}
/* One finger scrolls the page past the map; two fingers move it (site_plan_view.js). */
.ot-spv-canvas { display: block; width: 100%; height: 100%; touch-action: pan-x pan-y; cursor: grab; }
.ot-spv-canvas:active { cursor: grabbing; }
.ot-spv-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.ot-spv-zoom .ot-btn { min-width: 44px; padding: 0 10px; justify-content: center; box-shadow: var(--shadow-sm); font-weight: 700; }
/* "Hold Ctrl and scroll to zoom" / "Use two fingers": shown for a moment, never blocks taps. */
.ot-spv-gesture {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 24px;
  background: rgba(17, 24, 39, 0.45); color: #fff; font-size: 18px; font-weight: 600; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
}
.ot-spv-gesture.is-visible { opacity: 1; }
.ot-spv-attribution {
  position: absolute; right: 0; bottom: 0; margin: 0; padding: 2px 8px; font-size: 12px;
  background: rgba(255, 255, 255, 0.85); color: var(--gray-700); border-top-left-radius: 6px;
}
.ot-spv-notice {
  position: absolute; left: 10px; right: 10px; bottom: 28px; margin: 0; padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--warning-light, #fef3c7); color: var(--warning-dark, #92400e); font-size: 13px; font-weight: 600; text-align: center;
}

.ot-spv-result {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-lg); background: var(--gray-900, #111827); color: #fff;
}
.ot-spv-result[hidden] { display: none; }
.ot-spv-result b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
.ot-spv-result span { display: block; margin-top: 4px; font-size: 14px; opacity: 0.8; }
.ot-spv-result .ot-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }

.ot-spv-info {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--primary); background: var(--primary-light);
}
.ot-spv-info[hidden] { display: none; }
.ot-spv-info b { font-size: 16px; color: var(--text); }
.ot-spv-info span { font-size: 15px; color: var(--gray-700); }

.ot-spv-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .ot-spv-details { grid-template-columns: 1fr; } }
.ot-spv-subhead { margin: 0 0 10px; font-size: 18px; color: var(--text); overflow-wrap: anywhere; }
.ot-spv-subhead small { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-left: 6px; }
.ot-spv-summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.ot-spv-summary dt { color: var(--text-secondary); font-weight: 600; }
.ot-spv-summary dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.ot-spv-units { max-width: 280px; margin-bottom: 14px; }
.ot-spv-units[hidden] { display: none; }
.ot-spv-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ot-spv-list li + li { border-top: 1px solid var(--border); }
.ot-spv-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 0; background: var(--surface); font: inherit; text-align: left; cursor: pointer;
}
.ot-spv-item:hover, .ot-spv-item:focus-visible { background: var(--bg-secondary); }
.ot-spv-item b { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.ot-spv-item span { font-size: 13px; color: var(--text-secondary); }

.ot-spv-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 760px) { .ot-spv-guide { grid-template-columns: 1fr; } }
.ot-spv-steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.5; color: var(--text); }
.ot-spv-formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.ot-spv-formats div { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.ot-spv-formats dt { font-weight: 700; color: var(--text); }
.ot-spv-formats dd { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); }

@media (max-width: 600px) {
  .ot-spv { padding: 20px 16px; }
  .ot-spv-stage { height: 62vh; }
  .ot-spv-result b { font-size: 22px; }
}
