/* Nordic blue palette, compact graphite layout. Shared by all three views. */
:root {
  color-scheme: light;
  --om-background: #f5f7fa;
  --om-surface: #ffffff;
  --om-text: #172b42;
  --om-muted: #657487;
  --om-accent: #2563eb;
  --om-accent-hover: #1d4ed8;
  --om-tint: #ebf2ff;
  --om-border: #e1e7ee;
  --om-header-height: 68px;
  --om-rail-width: 88px;
  --om-shadow: 0 6px 24px rgb(23 43 66 / 8%);
}
body { background: var(--om-background); color: var(--om-text); font-family: "Segoe UI", Inter, Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--om-accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.ortomap-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--om-text); font-size: 23px; font-weight: 600; letter-spacing: -.8px; text-decoration: none; flex-shrink: 0; }
.ortomap-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: white; background: var(--om-accent); font-size: 28px; font-weight: 400; line-height: 1; }
.ortomap-app-header { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 25px; height: var(--om-header-height); padding: 0 26px; border-bottom: 1px solid var(--om-border); background: var(--om-surface); box-sizing: border-box; }
.ortomap-header-divider { color: #94a3b8; }
.ortomap-header-account { display: flex; align-items: center; gap: 18px; margin-left: auto; color: var(--om-muted); font-size: 13px; flex-shrink: 0; }
.ortomap-app-header .ortomap-current-project-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.ortomap-button { padding: 10px 15px; border-radius: 9px; background: var(--om-accent); color: white; font-size: 13px; font-weight: 600; box-shadow: none; line-height: 1.4; }
.ortomap-button:hover { background: var(--om-accent-hover); }
.ortomap-button-light { background: var(--om-surface); border: 1px solid var(--om-border); color: var(--om-text); }
.ortomap-button-light:hover { background: var(--om-tint); color: var(--om-accent); }
.ortomap-button-danger { background: #fff1f2; color: #b42335; border: 1px solid #fecdd3; }
.ortomap-button-danger:hover { background: #ffe4e6; color: #9f1239; }
.ortomap-panel, .ortomap-modal-card { background: var(--om-surface); border: 1px solid var(--om-border); border-radius: 12px; box-shadow: var(--om-shadow); }
.ortomap-modal-backdrop { background: rgb(23 43 66 / 38%); }
.ortomap-modal-card { color: var(--om-text); }
.ortomap-form input, .ortomap-form select, .ortomap-form textarea, .ortomap-access-form input, .ortomap-access-form select { border-color: var(--om-border); border-radius: 8px; background: var(--om-surface); color: var(--om-text); }
.ortomap-nav-rail { position: fixed; top: var(--om-header-height); left: 0; bottom: 0; z-index: 35; width: var(--om-rail-width); box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 20px 8px; margin: 0; background: var(--om-surface); border: 0; border-right: 1px solid var(--om-border); overflow-y: auto; }
.ortomap-rail-item, .ortomap-start-tab.ortomap-rail-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; min-width: 0; min-height: 62px; flex: 0 0 auto; padding: 10px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--om-muted); font: 500 11px/1.35 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.ortomap-rail-icon { font-size: 23px; line-height: 1; font-weight: 400; }
.ortomap-rail-item:hover { background: var(--om-background); color: var(--om-accent); }
.ortomap-rail-item.is-active, .ortomap-start-tab.is-active, .ortomap-rail-item[aria-expanded="true"] { background: var(--om-tint); color: var(--om-accent); }

/* Login and password recovery share the same split screen. */
body.ortomap-login-page { display: block; padding: 0; margin: 0; background: var(--om-background); }
.ortomap-login-layout { width: 100%; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1600px; margin: auto; }
.ortomap-login-intro { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; margin: 20px; padding: clamp(28px, 5vw, 70px); border-radius: 14px; background: var(--om-tint); }
.ortomap-login-intro::before, .ortomap-login-intro::after { content: ""; position: absolute; z-index: -1; width: 600px; height: 600px; border: 1px solid rgb(37 99 235 / 12%); border-radius: 50%; left: 12%; top: 20%; pointer-events: none; }
.ortomap-login-intro::after { width: 720px; height: 720px; left: 2%; top: 13%; }
.ortomap-login-intro-copy h1 { margin: 0 0 20px; font-size: clamp(36px, 4vw, 56px); line-height: 1.16; letter-spacing: -1.6px; font-weight: 600; }
.ortomap-login-intro-copy p { font-size: 16px; line-height: 1.8; color: var(--om-muted); }
.ortomap-login-intro-footer { color: var(--om-muted); font-size: 12px; }
.ortomap-login { align-self: center; justify-self: center; width: min(100%, 450px); padding: 48px 32px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.ortomap-login > .ortomap-brand { margin-bottom: 40px; }
.ortomap-login h1 { margin: 0 0 10px; font-size: 29px; letter-spacing: -.8px; line-height: 1.25; font-weight: 600; }
.ortomap-login p { margin: 0 0 26px; color: var(--om-muted); }
.ortomap-login form { gap: 20px; margin-top: 28px; }
.ortomap-login label { gap: 8px; font-size: 13px; font-weight: 500; }
.ortomap-login input[type="text"], .ortomap-login input[type="email"], .ortomap-login input[type="password"] { height: 46px; border: 1px solid var(--om-border); border-radius: 9px; padding: 11px 13px; background: white; color: var(--om-text); font-family: inherit; font-size: 16px; }
.ortomap-login .ortomap-remember { font-size: 13px; color: var(--om-muted); }
.ortomap-login button { border-radius: 9px; background: var(--om-accent); font-family: inherit; font-size: 14px; font-weight: 600; min-height: 46px; }
.ortomap-login button:hover { background: var(--om-accent-hover); }
.ortomap-login-links a { color: var(--om-accent); font-size: 13px; font-weight: 500; }
.ortomap-login .ortomap-error, .ortomap-login .ortomap-success { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-top: 12px; }
.ortomap-login .ortomap-error { background: #fff1f2; color: #b42335; }
.ortomap-login .ortomap-success { background: #ecfdf3; color: #166534; }

/* Project list and administration keep their existing forms and permissions. */
body.ortomap-projects-page { margin: 0; padding: var(--om-header-height) 0 0 var(--om-rail-width); background: var(--om-background); }
.ortomap-projects-page .ortomap-shell { width: min(1240px, 100%); margin: 0 auto; padding: 44px; box-sizing: border-box; }
.ortomap-projects-page .ortomap-start-shell { border: 0; border-radius: 0; background: transparent; padding: 0; box-shadow: none; min-width: 0; }
.ortomap-start-panel h1 { font-size: 30px; letter-spacing: -.8px; margin: 0 0 8px; font-weight: 600; }
.ortomap-start-panel > .ortomap-section-head { margin-bottom: 28px; }
#ortomap-projects-panel > .ortomap-list { display: block; background: var(--om-surface); border: 1px solid var(--om-border); border-radius: 12px; overflow: hidden; }
#ortomap-projects-panel .ortomap-project-row { padding: 24px; gap: 20px; background: transparent; border: 0; border-bottom: 1px solid var(--om-border); border-radius: 0; }
#ortomap-projects-panel .ortomap-project-row:last-child { border-bottom: 0; }
.ortomap-project-symbol { width: 54px; height: 54px; display: grid; place-items: center; flex-shrink: 0; background: var(--om-tint); color: var(--om-accent); border-radius: 9px; font-size: 29px; }
.ortomap-project-preview { position: relative; display: grid; place-items: center; flex: 0 0 180px; width: 180px; height: 120px; overflow: hidden; border-radius: 10px; background: var(--om-tint); color: var(--om-accent); text-decoration: none; }
.ortomap-project-preview-placeholder { font-size: 42px; }
.ortomap-project-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ortomap-project-preview-badge { position: absolute; z-index: 2; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(23, 43, 66, 0.84); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.ortomap-project-row .ortomap-project-summary { font-size: 12px; color: var(--om-muted); }
.ortomap-project-row .ortomap-card-copy { gap: 6px; }
.ortomap-project-row .ortomap-card-copy strong { font-size: 16px; font-weight: 600; }
.ortomap-project-row .ortomap-card-copy span { font-size: 13px; }
.ortomap-project-row .ortomap-card-actions { gap: 8px; }
.ortomap-project-row .ortomap-card-actions > a.ortomap-button { background: var(--om-tint); color: var(--om-accent); }
.ortomap-project-row .ortomap-card-actions > a.ortomap-button:hover { background: var(--om-accent); color: white; }
.ortomap-projects-page .ortomap-empty { padding: 16px 24px; }
.ortomap-access-section, .ortomap-access-toolbar, .ortomap-card { border-color: var(--om-border); border-radius: 10px; background: var(--om-surface); }

/* Map area is sized inside the header/rail, so 2D and 3D share the same bounds. */
#ortomap-root { --app-bg: var(--om-background); --panel: var(--om-surface); --muted: var(--om-muted); --accent: var(--om-accent); --border: var(--om-border); --shadow: var(--om-shadow); }
.ortomap-layout { --ortomap-floating-panel-left: 344px; }
.ortomap-layout.is-sidebar-collapsed { --ortomap-floating-panel-left: 18px; }
.ortomap-map-panel { top: var(--om-header-height); left: var(--om-rail-width); }
.ortomap-sidebar { top: calc(var(--om-header-height) + 18px); left: calc(var(--om-rail-width) + 18px); bottom: 112px; width: 304px; gap: 0; border-radius: 12px; }
.ortomap-sidebar .ortomap-panel { background: var(--om-surface); backdrop-filter: none; padding: 18px; }
.ortomap-sidebar .ortomap-files-panel { flex: 0 1 auto; }
.ortomap-files-panel .ortomap-section-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.ortomap-files-panel h3 { font-size: 15px; font-weight: 600; }
.ortomap-files-panel .ortomap-section-head .ortomap-button { font-size: 12px; padding: 8px 10px; }
.ortomap-map-tools { border-color: var(--om-border); border-radius: 12px; background: var(--om-surface); box-shadow: var(--om-shadow); bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100% - 36px); overflow-x: auto; overflow-y: hidden; }
.ortomap-map-tools .ortomap-button-light { color: var(--om-text); border-radius: 8px; }
.ortomap-map-tools .ortomap-button-light:hover { color: var(--om-accent); background: var(--om-tint); }
.ortomap-map-tools .ortomap-button-light.is-active { color: white; background: var(--om-accent); }
.ortomap-icon-button { padding: 0; }
.ortomap-icon-button > span { flex-shrink: 0; }
.ortomap-mode-button { padding: 0 10px; }
.ortomap-files-panel .ortomap-line-style-toggle { width: 28px; min-width: 28px; height: 32px; padding: 0; font-size: 20px; }
.ortomap-line-style-toggle[aria-expanded="true"] { background: var(--om-tint); color: var(--om-accent); }
.ortomap-line-style-panel { border-top: 1px solid var(--om-border); margin-top: 10px; padding: 12px 2px 4px; }
.ortomap-line-style-panel label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.ortomap-line-style-panel output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ortomap-line-style-panel input { width: 100%; margin: 12px 0 0; accent-color: var(--om-accent); }
.ortomap-workspace-page .ortomap-map-panel, .ortomap-workspace-page .ortomap-map-shell,
.ortomap-workspace-page .ortomap-map, .ortomap-map .ol-viewport,
.ortomap-map .ol-layers { background: #fff !important; background-color: #fff !important; }
.ortomap-map .ol-layer { background: transparent !important; background-color: transparent !important; }
.ortomap-3d-source-menu button:hover, .ortomap-3d-source-menu button.is-active { background: var(--om-accent); color: white; }
.ortomap-upload-progress-bar span, .ortomap-3d-loading-bar span { background: var(--om-accent); }
.ortomap-notification-toggle.has-notifications, .ortomap-notification-toggle:hover { color: var(--om-accent); background: var(--om-tint); border-color: var(--om-border); }
.ortomap-map-tools .ortomap-toolbar, .ortomap-map-tools .ortomap-asset-switcher { flex-shrink: 0; }
.ortomap-view-controls, .ortomap-notification-toggle, .ortomap-notification-panel, .ortomap-measure-panel, .ortomap-message-panel, .ortomap-3d-card, .ortomap-compare-panel { background: var(--om-surface); border-color: var(--om-border); border-radius: 10px; box-shadow: var(--om-shadow); }
.ortomap-3d-shell { background: var(--om-background); }
.ortomap-measure-panel { bottom: 112px; }
.ortomap-asset-chip.is-active { background: var(--om-tint); color: var(--om-accent); border-color: var(--om-accent); }

@media (max-width: 1100px) {
  .ortomap-projects-page .ortomap-shell { padding: 32px 24px; }
  .ortomap-project-row .ortomap-card-actions { max-width: 270px; }
}
@media (max-width: 760px) {
  :root { --om-rail-width: 70px; --om-header-height: 62px; }
  .ortomap-app-header { padding: 0 16px; gap: 12px; }
  .ortomap-brand { font-size: 20px; gap: 8px; }
  .ortomap-header-account { gap: 8px; }
  .ortomap-header-account > span { display: none; }
  .ortomap-header-account .ortomap-button { padding: 8px 10px; font-size: 12px; }
  .ortomap-nav-rail { padding: 14px 4px; gap: 6px; }
  .ortomap-rail-item, .ortomap-start-tab.ortomap-rail-item { font-size: 10px; min-height: 60px; }
  .ortomap-login-layout { grid-template-columns: 1fr; }
  .ortomap-login-intro { display: none; }
  .ortomap-login { padding: 40px 28px; }
  .ortomap-projects-page .ortomap-shell { padding: 28px 18px; }
  .ortomap-project-row .ortomap-card-actions { max-width: none; }
  .ortomap-project-preview { width: 100%; height: 160px; flex: 0 0 auto; }
  #ortomap-projects-panel .ortomap-project-row { padding: 20px; gap: 14px; }
  .ortomap-project-row .ortomap-card-actions { justify-content: flex-start; width: 100%; }
  .ortomap-start-panel h1 { font-size: 26px; }
  .ortomap-sidebar { top: calc(var(--om-header-height) + 12px); left: calc(var(--om-rail-width) + 12px); width: min(304px, calc(100vw - var(--om-rail-width) - 66px)); bottom: 116px; }
  .ortomap-sidebar .ortomap-panel { padding: 14px; }
  .ortomap-layout { --ortomap-floating-panel-left: 12px; }
  .ortomap-3d-card { top: auto; bottom: 110px; max-height: 35%; overflow: auto; padding: 14px; }
  .ortomap-map-tools { width: auto; max-width: calc(100% - 20px); bottom: max(12px, env(safe-area-inset-bottom)); }
  .ortomap-map-tools .ortomap-button { min-width: 44px; min-height: 44px; }
  .ortomap-measure-panel { width: calc(100% - 24px); right: 12px; bottom: 112px; }
}
@media (max-width: 420px) {
  .ortomap-workspace-page .ortomap-app-header .ortomap-brand { font-size: 0; gap: 0; }
  .ortomap-workspace-page .ortomap-header-divider { display: none; }
  .ortomap-projects-page .ortomap-shell { padding: 22px 12px; }
  #ortomap-projects-panel .ortomap-project-row { padding: 16px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ortomap-sidebar, .ortomap-measure-panel { bottom: 96px; }
  .ortomap-nav-rail { padding-top: 6px; gap: 2px; }
  .ortomap-rail-item { min-height: 50px; }
}
