[data-chart-builder-standalone] {
  min-height: 100vh;
  margin: 0;
  background: #f4f8ff;
  color: #14213d;
}
[data-chart-builder-standalone] .standalone-header {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #d8e5f5;
}
[data-chart-builder-standalone] .standalone-card { border-radius: 16px; }
[data-chart-builder-standalone] .standalone-frame {
  position: relative;
  width: min(100%, 1180px);
  height: 720px;
  min-width: 340px;
  min-height: 460px;
  max-width: 100%;
}
[data-chart-builder-standalone] .standalone-chart { width: 100%; height: 100%; min-height: 0; }
[data-chart-builder-standalone] #standalone-chart[data-surface-type="full"] { height: 100%; }
[data-chart-builder-standalone] .standalone-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  z-index: 20;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #a9c2e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15,31,75,.16);
  cursor: nwse-resize;
  touch-action: none;
}
[data-chart-builder-standalone] .standalone-resize-handle::before,
[data-chart-builder-standalone] .standalone-resize-handle::after {
  content: '';
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 11px;
  height: 1px;
  background: #5276a6;
  transform: rotate(-45deg);
  transform-origin: right center;
}
[data-chart-builder-standalone] .standalone-resize-handle::after { right: 5px; bottom: 11px; width: 7px; }
@media (max-width: 575.98px) {
  [data-chart-builder-standalone] .standalone-frame { width: 100%; height: 760px; min-width: 0; }
  [data-chart-builder-standalone] .standalone-resize-handle { width: 44px; height: 44px; right: -4px; bottom: -4px; }
}
/* A8-FIX01 branding polish — standalone only; Integrated Mode remains Host-owned. */
[data-chart-builder-standalone] .standalone-brand { display:flex; align-items:center; gap:12px; min-width:0; }
[data-chart-builder-standalone] .standalone-brand__logo { width:92px; height:58px; object-fit:contain; object-position:left center; filter:drop-shadow(0 3px 8px rgba(15,31,75,.08)); }
[data-chart-builder-standalone] .standalone-brand__copy { min-width:0; }
@media (max-width:575.98px){
  [data-chart-builder-standalone] .standalone-brand__logo { width:68px; height:46px; }
  [data-chart-builder-standalone] .standalone-header .container-fluid { gap:10px !important; }
}

/* V1 PATCH_12 — compact standalone shell: no redundant workspace strip; canvas uses reclaimed height. */
[data-chart-builder-standalone] {
  font-family: "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-chart-builder-standalone] .standalone-header .container-fluid { padding-top:10px !important; padding-bottom:10px !important; }
[data-chart-builder-standalone] main.container-fluid { padding-top:8px !important; padding-bottom:8px !important; }
[data-chart-builder-standalone] .standalone-card { border-radius:14px; }
[data-chart-builder-standalone] .standalone-card > .card-body { padding:10px !important; }
[data-chart-builder-standalone] .standalone-frame {
  width:100%;
  max-width:100%;
  height:clamp(680px, calc(100vh - 112px), 1120px);
}
[data-chart-builder-standalone] .standalone-resize-handle { right:4px; bottom:4px; opacity:.72; box-shadow:0 3px 12px rgba(15,31,75,.10); }
[data-chart-builder-standalone] .standalone-resize-handle:hover,
[data-chart-builder-standalone] .standalone-resize-handle:focus-visible { opacity:1; }
@media (max-width:767.98px) {
  [data-chart-builder-standalone] .standalone-frame { height:auto; min-height:820px; }
}
@media (max-width:575.98px) {
  [data-chart-builder-standalone] .standalone-card > .card-body { padding:6px !important; }
  [data-chart-builder-standalone] main.container-fluid { padding-left:6px !important; padding-right:6px !important; }
}

/* V1 PATCH_19 — compact normal-mode header matching the chart-first workspace target. */
[data-chart-builder-standalone] .standalone-title-line {
  display:flex;
  align-items:baseline;
  gap:14px;
  min-width:0;
}
[data-chart-builder-standalone] .standalone-title-line h1 {
  flex:0 0 auto;
  font-size:28px;
  line-height:1.1;
  font-weight:750;
  color:#0e2347;
}
[data-chart-builder-standalone] .standalone-chart-title {
  min-width:0;
  max-width:min(48vw,720px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#14213d;
  font-size:18px;
  font-weight:700;
}
@media (max-width:767.98px) {
  [data-chart-builder-standalone] .standalone-title-line { gap:8px; align-items:flex-start; flex-direction:column; }
  [data-chart-builder-standalone] .standalone-title-line h1 { font-size:22px; }
  [data-chart-builder-standalone] .standalone-chart-title { max-width:70vw; font-size:14px; }
}

/* B48 FIX01 — standalone uses the Tool-owned unified top bar; normal page is flat/auto-height. */
[data-chart-builder-standalone] .standalone-main {
  padding: 6px !important;
}
[data-chart-builder-standalone] .standalone-frame {
  width: 100%;
  max-width: none;
  height: auto;
  min-width: 0;
  min-height: 0;
}
[data-chart-builder-standalone] .standalone-chart,
[data-chart-builder-standalone] #standalone-chart[data-surface-type="full"] {
  width: 100%;
  height: auto;
  min-height: 0;
}
[data-chart-builder-standalone] .standalone-resize-handle { display:none !important; }
