/* Shared chrome for every Windrose 3D viewer page.
   Dark fullscreen canvas (#060f1e) and one bottom toolbar.
   Header height and bar height are measured onto --wr-header-h / --wr-bar-h. */
:root {
  --wr-header-h: 88px;
  --wr-bar-h: 52px;
  --wr-shell-bg: #060f1e;
  --wr-shell-ink: #f0f4ff;
  --wr-shell-muted: #9bb4d0;
  --wr-shell-line: rgba(74, 158, 255, 0.28);
  --wr-shell-btn: #0d1f38;
}

html.wr-shell,
body.wr-shell {
  background: var(--wr-shell-bg) !important;
  color: var(--wr-shell-ink);
}

body.wr-shell.wr-frame {
  margin: 0;
  overflow: hidden;
}

body.wr-shell.wr-frame #cv,
body.wr-shell.wr-frame canvas#c,
body.wr-shell.wr-frame canvas#c3d,
body.wr-shell.wr-frame canvas#scene,
body.wr-shell.wr-frame #stage,
body.wr-shell.wr-frame .sk-stage,
body.wr-shell.wr-frame #app {
  position: fixed;
  left: 0;
  right: auto;
  top: var(--wr-header-h, 88px);
  bottom: auto;
  width: 100vw !important;
  height: calc(100dvh - var(--wr-header-h, 88px) - var(--wr-bar-h, 52px)) !important;
  max-height: none !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--wr-shell-bg) !important;
  box-shadow: none;
}

/* Inner canvases fill their frame. The frame canvases above already have an explicit size.
   width:auto on a canvas keeps the 300×150 default, so these must be 100%. */
body.wr-shell.wr-frame .sk-stage canvas,
body.wr-shell.wr-frame #stage canvas,
body.wr-shell.wr-frame #app canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

/* Bottom toolbar — same order and styling on every viewer. */
body.wr-shell .wr-bar,
body.wr-shell #bar.wr-bar {
  position: fixed;
  left: 0 !important;
  right: 0 !important;
  bottom: 0;
  transform: none !important;
  z-index: 60;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(13, 31, 56, 0.94) !important;
  border: 0;
  border-top: 1px solid var(--wr-shell-line) !important;
  border-radius: 0 !important;
  box-shadow: none;
  backdrop-filter: blur(8px);
  font-family: var(--wr-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

body.wr-shell .wr-bar-main,
body.wr-shell #bar.wr-bar .wr-bar-main,
body.wr-shell #barRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

body.wr-shell .wr-page-extra {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

body.wr-shell .wr-bar .wr-grp,
body.wr-shell #bar.wr-bar .grp,
body.wr-shell #bar.wr-bar .segpair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

@media (max-width: 760px) {
  body.wr-shell .wr-page-extra:not(.is-open) { display: none; }
}

body.wr-shell .wr-bar .wr-ctl,
body.wr-shell #bar.wr-bar .wr-ctl,
body.wr-shell #bar.wr-bar button,
body.wr-shell #bar.wr-bar a.wr-ctl {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #1c3a5e;
  border-radius: 6px;
  background: var(--wr-shell-btn);
  color: var(--wr-shell-ink);
  font: 600 12px/1.2 var(--wr-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  letter-spacing: normal;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

body.wr-shell .wr-bar .wr-ctl:hover,
body.wr-shell #bar.wr-bar .wr-ctl:hover,
body.wr-shell #bar.wr-bar button:hover {
  border-color: #4a9eff;
  color: #fff;
}

body.wr-shell .wr-bar .wr-ctl.on,
body.wr-shell .wr-bar .wr-ctl[aria-pressed="true"],
body.wr-shell #bar.wr-bar .wr-ctl.on,
body.wr-shell #bar.wr-bar button.on {
  background: #1a6abf;
  border-color: #4a9eff;
  color: #fff;
}

body.wr-shell .wr-bar .wr-sep,
body.wr-shell #bar.wr-bar .bar-sep {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--wr-shell-line);
  flex: none;
}

body.wr-shell .wr-bar [hidden],
body.wr-shell #bar.wr-bar [hidden] {
  display: none !important;
}

body.wr-shell .wr-bar label.wr-ctl {
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

/* Title / note overlay */
#wr-banner {
  position: fixed;
  z-index: 22;
  left: 16px;
  right: 16px;
  top: calc(var(--wr-header-h, 88px) + 10px);
  max-width: 46rem;
  pointer-events: none;
}
#wr-banner h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  color: #f0f4ff;
}
#wr-banner .sub,
#wr-banner .note {
  margin-top: 4px;
  color: var(--wr-shell-muted);
  font-size: 12px;
  line-height: 1.45;
}
#wr-banner .note,
body.wr-shell #banner > .note,
#wr-cad-note {
  color: #f0c14b;
}
#wr-cad-note {
  position: fixed;
  z-index: 23;
  left: 16px;
  right: 16px;
  top: calc(var(--wr-header-h, 88px) + 54px);
  margin-top: 0;
  max-width: min(46rem, calc(100vw - var(--hd-panel, 0px) - 32px));
  pointer-events: none;
  font-size: 12px;
  line-height: 1.45;
}

body.wr-shell #wr-extra #sk-body,
body.wr-shell #wr-extra .sk-toggle {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  z-index: auto;
}

body.wr-shell #wr-extra #panel {
  position: static !important;
  right: auto;
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: auto;
  width: auto;
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  transform: none;
  opacity: 1;
}
body.wr-shell #wr-extra #panel .grp {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

/* Product pages: marketing copy sits in the overlay, canvas is fullscreen. */
body.wr-product {
  background: #060f1e !important;
  overflow: hidden;
}
body.wr-product #wr-copy {
  position: fixed;
  z-index: 24;
  top: calc(var(--wr-header-h, 88px) + 8px);
  left: 12px;
  width: min(400px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--wr-header-h, 88px) - var(--wr-bar-h, 52px) - 20px);
  overflow: auto;
  padding: 14px 16px 18px;
  border: 1px solid var(--wr-shell-line);
  border-radius: 10px;
  background: rgba(13, 31, 56, 0.9);
  color: #f0f4ff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
body.wr-product #wr-copy.is-closed {
  display: none;
}
body.wr-product #wr-copy .sk-title,
body.wr-product #wr-copy h1,
body.wr-product #wr-copy h2,
body.wr-product #wr-copy h3 {
  color: #f0f4ff;
}
body.wr-product #wr-copy .sk-title {
  font-size: clamp(26px, 3vw, 36px);
  margin: 0 0 8px;
}
body.wr-product #wr-copy .sk-sub,
body.wr-product #wr-copy .sk-lede,
body.wr-product #wr-copy .sk-note,
body.wr-product #wr-copy p,
body.wr-product #wr-copy li,
body.wr-product #wr-copy dt,
body.wr-product #wr-copy dd,
body.wr-product #wr-copy td,
body.wr-product #wr-copy th {
  color: #d5deea;
}
body.wr-product #wr-copy .sk-card,
body.wr-product #wr-copy .sk-fact,
body.wr-product #wr-copy .sk-fold,
body.wr-product #wr-copy .sk-table-wrap,
body.wr-product #wr-copy table {
  background: rgba(6, 15, 30, 0.45);
  border-color: rgba(74, 158, 255, 0.22);
  color: #f0f4ff;
}
body.wr-product #wr-copy .sk-legend {
  margin-top: 8px;
}
body.wr-product #wr-copy .sk-grid,
body.wr-product #wr-copy .sk-two,
body.wr-product #wr-copy .sk-facts,
body.wr-product #wr-copy .sk-gallery {
  grid-template-columns: 1fr !important;
}
body.wr-product .sk-hint { z-index: 6; }
body.wr-product #wr-copy img {
  max-width: 100%;
  height: auto;
}
body.wr-product .sk-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}
body.wr-product .sk-hint {
  color: #d5deea;
  background: rgba(7, 16, 32, 0.7);
}
body.wr-product .sk-detail {
  background: rgba(7, 16, 32, 0.92);
  color: #f0f4ff;
  border-color: rgba(255, 255, 255, 0.22);
}
body.wr-product .sk-load {
  color: #9bb4d0;
}

/* Embedded viewers (iframe or ?embed=1) keep the canvas and drop the site header. */
html.wr-embedded {
  --wr-header-h: 0px;
}
html.wr-embedded #topbar,
html.wr-embedded #topbar-mount,
html.wr-embedded #site-nav-mount,
html.wr-embedded #lang-row {
  display: none !important;
}

/* Hero / flow embeds of products-3d stay chrome-free. */
body.hero #wr-bar,
body.hero #site-nav-mount,
body.hero #topbar,
body.hero #topbar-mount,
body.flow-embed #wr-bar,
body.flow-embed #site-nav-mount,
body.flow-embed #topbar,
body.flow-embed #topbar-mount {
  display: none !important;
}
body.hero #app,
body.flow-embed #app {
  top: 0 !important;
  bottom: 0 !important;
}
body.solo:not(.hero) .panel.wr-bar { display: flex !important; }
body.solo:not(.hero) .wr-extra-products { display: none !important; }
body.solo:not(.hero) #ex-btn { position: static !important; display: inline-flex !important; top: auto; left: auto; }

@media (max-width: 760px) {
  body.wr-product #wr-copy {
    width: calc(100vw - 16px);
    left: 8px;
    max-height: min(46dvh, 360px);
  }
  body.wr-shell .wr-bar .wr-ctl,
  body.wr-shell #bar.wr-bar .wr-ctl {
    padding: 0 8px;
    min-height: 36px;
  }
}
