/* Stitch B inspired working layout. All data still comes from Plot Climate. */
:root { --pc-line:#dce3ea; --pc-cyan:#006b9c; }
/* A restrained architectural instrument: one icon family and quiet surfaces. */
.icon-library { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
.pc-icon { display:inline-block; width:16px; height:16px; flex:0 0 16px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; vertical-align:-3px; }
.btn .pc-icon { margin-right:3px; }
body { -webkit-font-smoothing:antialiased; font-feature-settings:"tnum"; }
button, input, select { font:inherit; }
.btn { letter-spacing:0; font-weight:600; box-shadow:none; }
.btn:focus-visible, .insights-nav button:focus-visible, summary:focus-visible { outline:2px solid #006b9c; outline-offset:3px; }
body { background:#fff; }
.app-header { height:66px; box-sizing:border-box; padding:8px 18px; background:#fff; border-bottom:1px solid var(--pc-line); }
.header-container { height:100%; max-width:none; }
.brand-mark, .brand-title { color:#102d61; }
.brand-mark { font-size:1.35rem; }
.brand-copy { border-left-color:#bfd1df; }
.brand-subtitle { color:#6b7b88; }
.header-actions .btn { color:#102d61; border-color:#bfccd6; background:#fff; min-height:38px; text-decoration:none; }
.header-actions .btn:hover { background:#eef7fb; }
.header-actions .btn-discuss { background:#006b9c; color:#fff; border-color:#006b9c; font-weight:750; }
.header-actions .btn-discuss:hover { background:#005780; color:#fff; }
.app-container { max-width:none; padding:0; gap:0; }
.product-intro { display:none; }
.workspace-nav { height:42px; box-sizing:border-box; padding:0 18px; margin:0; background:#f7fafc; align-items:stretch; }
.workspace-nav a { padding:10px 13px; font-size:.78rem; }
.workspace-layout { display:grid; grid-template-columns:clamp(260px,24vw,328px) minmax(0,1fr); gap:0; height:calc(100dvh - 108px); min-height:600px; border-bottom:1px solid var(--pc-line); }
.workspace-intake { display:flex; flex-direction:column; grid-column:auto; grid-row:auto; height:100%; min-height:0; overflow-y:auto; overscroll-behavior:contain; gap:11px; padding:14px; box-sizing:border-box; background:#fff; border-right:1px solid var(--pc-line); scrollbar-width:thin; }
.workspace-guide { background:linear-gradient(135deg,#f6f8fb,#edf3f7); border:1px solid var(--pc-line); border-radius:10px; padding:15px; }
.workspace-guide span { color:var(--pc-cyan); font-size:.69rem; font-weight:800; letter-spacing:.06em; }
.workspace-guide h2 { font-size:1rem; margin:6px 0; color:#142b43; }
.workspace-guide p { margin:0; font-size:.77rem; line-height:1.45; color:#526477; }
.workspace-intake .control-panel, .workspace-intake .control-box, .workspace-intake .margins-card { flex:none; }
.workspace-intake .control-panel .form-grid { display:block; }
.workspace-intake .control-panel .form-group { margin:0; }
.workspace-intake .control-panel .panel-header { display:block; }
.workspace-intake .control-panel .panel-header h2 { margin-bottom:6px; }
.workspace-intake .control-panel .form-row { display:flex; gap:6px; }
.workspace-intake .control-panel .form-row input { flex:1; min-width:0; }
.source-details { margin-top:12px; border-top:1px solid var(--pc-line); }
.source-details summary, .climate-more summary { cursor:pointer; color:#006b9c; font-weight:750; font-size:.78rem; padding:10px 1px; }
.source-details-body { display:grid; gap:8px; padding-top:4px; }
.source-details-body .form-grid { display:grid!important; gap:10px; }
.source-details-body .form-group.form-row { display:flex; flex-wrap:wrap; gap:8px; }
.source-details-body .form-group.form-row > div { flex:1 1 105px; }
.source-details-body .provenance-bar { box-shadow:none; margin-top:5px; }
.workspace-intake .control-box { background:#fff; }
.workspace-intake .control-box h3 { font-size:.95rem; }
.workspace-intake .control-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
.workspace-intake .control-row label { font-size:.73rem; }
.workspace-intake .control-row input, .workspace-intake .control-row select { min-height:36px; }
.workspace-intake .margins-card { background:#f7fafc; }
.placement-panel { grid-column:auto; grid-row:auto; border:0; box-shadow:none; border-radius:0; min-height:0; height:100%; }
.placement-panel > .panel-header { display:none; }
.placement-panel > .panel-body { height:100%; padding:0; box-sizing:border-box; }
.placement-layout { display:grid; grid-template-columns:minmax(0,1fr) clamp(310px,27vw,370px); gap:0; align-items:stretch; height:100%; min-height:0; }
.map-and-plan-wrapper { position:relative; display:flex; flex-direction:column; min-width:0; min-height:0; height:100%; background:#f8fbfd; overflow:hidden; }
.view-switch-bar { flex:none; min-height:47px; margin:0; padding:6px 10px; box-sizing:border-box; border-bottom:1px solid var(--pc-line); background:#fff; gap:6px; align-items:center; }
.view-switch-bar .button-group { display:flex; flex-wrap:wrap; gap:5px; }
.view-switch-bar .btn { min-height:32px; font-size:.69rem; border-radius:6px; border-color:#dce3ea; background:#fff; color:#46576b; }
.view-switch-bar .btn.active { background:#102d61; border-color:#102d61; color:#fff; }
.view-switch-bar .btn:hover { background:#edf3f7; color:#102d61; }
.view-switch-bar .btn.active:hover { background:#193d75; color:#fff; }
.view-switch-bar .select-small { max-width:135px; }
.map-advanced { position:relative; flex:none; font-size:.69rem; color:#34516a; }
.map-advanced summary { cursor:pointer; border:1px solid var(--pc-line); background:#f6f9fb; border-radius:5px; padding:7px 8px; white-space:nowrap; }
.map-advanced .map-controls-inline { display:flex!important; position:absolute; right:0; top:calc(100% + 4px); z-index:20; min-width:245px; padding:10px; border:1px solid var(--pc-line); border-radius:8px; background:#fff; box-shadow:0 8px 24px rgba(16,45,97,.15); }
.map-advanced:not([open]) .map-controls-inline { display:none!important; }
#map-mode-badge { display:none; }
#setback-status-badge { display:block; margin-top:3px; white-space:normal; font-size:.62rem; }
.map-view-box, .canvas-wrapper { flex:1 1 auto; height:auto; min-height:0; width:100%; border:0; border-radius:0; background-color:#f9fbfd; background-image:linear-gradient(#e5ebf0 1px,transparent 1px),linear-gradient(90deg,#e5ebf0 1px,transparent 1px); background-size:24px 24px; }
.canvas-wrapper { display:flex; justify-content:center; align-items:center; overflow:hidden; padding:56px 18px 10px; box-sizing:border-box; }
#plan-canvas { width:min(100%,690px); height:auto; max-height:100%; border:0; box-shadow:none; padding:0; background:transparent; cursor:grab; }
.canvas-legend { position:absolute; left:12px; bottom:72px; z-index:4; max-width:calc(100% - 24px); background:rgba(255,255,255,.95); border:1px solid var(--pc-line); border-radius:9px; padding:7px 9px; }
.map-view-box .canvas-legend { bottom:72px; }
.plot-overlay-card { position:absolute; z-index:5; top:calc(var(--pc-toolbar-height, 47px) + 12px); left:15px; width:min(280px,calc(100% - 115px)); display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid #bacbd8; border-radius:10px; background:rgba(255,255,255,.97); box-shadow:0 3px 12px rgba(16,45,97,.08); pointer-events:none; }
.plot-overlay-card strong { font-size:.82rem; color:#1b2c3d; }
.plot-overlay-card span { font-size:.75rem; color:#526374; }
.plot-overlay-card small { font-size:.68rem; color:#006b9c; line-height:1.3; }
.plot-compass { position:absolute; z-index:5; top:calc(var(--pc-toolbar-height, 47px) + 12px); right:14px; width:72px; height:72px; border:1px solid #bacbd8; border-radius:10px; background:rgba(255,255,255,.97); box-shadow:0 3px 12px rgba(16,45,97,.08); pointer-events:none; }
.plot-compass span { position:absolute; font-size:.65rem; font-weight:800; color:#677a8b; }
.plot-compass .north { top:2px; left:32px; color:#006b9c; }
.plot-compass .south { bottom:2px; left:32px; }
.plot-compass .west { left:6px; top:28px; }
.plot-compass .east { right:6px; top:28px; }
.plot-compass .compass-needle { position:absolute; left:27px; top:17px; width:18px; height:37px; }
.plot-wind-card { position:absolute; z-index:5; top:calc(var(--pc-toolbar-height, 47px) + 128px); left:15px; width:120px; min-height:75px; border:1px solid #bacbd8; border-radius:9px; background:rgba(255,255,255,.96); padding:6px; box-sizing:border-box; pointer-events:none; text-align:center; }
.plot-wind-card > span { color:#006b9c; font-size:.59rem; font-weight:800; letter-spacing:.04em; }
#plot-wind-rose { font-size:.59rem; color:#657787; }
#plot-wind-rose svg { display:block; width:84px; height:84px; margin:0 auto; }
.terrain-inspector-bar { flex:none; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; padding:7px 11px; border:0; border-top:1px solid var(--pc-line); border-radius:0; background:#fff; }
.terrain-inspector-bar .inspector-item:first-child { grid-column:1/-1; }
.terrain-inspector-bar .inspector-item { min-width:0; }
.terrain-inspector-bar .value { overflow-wrap:anywhere; }
.placement-controls { display:flex; flex-direction:column; align-items:stretch; gap:10px; height:100%; min-height:0; max-height:none; overflow-y:auto; overscroll-behavior:contain; padding:10px; box-sizing:border-box; border-left:1px solid var(--pc-line); background:#fff; scrollbar-width:thin; }
.insights-nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; position:sticky; top:-10px; z-index:6; padding:0 0 7px; background:#fff; }
.insights-nav button { border:0; border-radius:6px; padding:7px 2px; min-height:32px; color:#344e63; background:#edf2f6; font-weight:700; font-size:.69rem; cursor:pointer; }
.insights-nav button:hover, .insights-nav button:focus-visible { background:#d2e9f5; color:#006b9c; }
.placement-controls .analysis-grid { display:block; }
.placement-controls .climate-panel, .placement-controls .solar-panel { box-shadow:none; border-radius:12px; }
.placement-controls .panel-header { padding:9px 10px; display:block; }
.placement-controls .panel-header h2 { font-size:.92rem; margin-bottom:5px; }
.placement-controls .panel-body { padding:9px; }
.placement-controls .tabs { overflow-x:auto; gap:2px; }
.placement-controls .tab-btn { white-space:nowrap; font-size:.66rem; padding:4px 5px; }
.placement-controls .wind-rose-container { display:grid; grid-template-columns:120px minmax(0,1fr); align-items:center; gap:8px; }
.placement-controls #wind-rose-svg-wrapper { width:120px; height:120px; min-width:0; }
.placement-controls .wind-legend { align-items:start; font-size:.65rem; }
.placement-controls .legend-items { display:flex; flex-wrap:wrap; gap:2px 5px; }
.placement-controls .legend-chip { font-size:.61rem; }
.placement-controls .calm-indicator { font-size:.63rem; }
.placement-controls .metrics-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:8px; }
.placement-controls .metric-card { padding:6px 3px; text-align:left; }
.placement-controls .metric-label { font-size:.62rem; }
.placement-controls .metric-value { font-size:.88rem; margin:2px 0; overflow-wrap:anywhere; }
.placement-controls .metric-sub { font-size:.6rem; line-height:1.25; }
.climate-more { border-top:1px solid var(--pc-line); margin-top:8px; }
.climate-more .climate-extra-sections { margin-top:0!important; }
.placement-controls .evaluation-card { margin:0; }
.placement-controls .variant-card { margin-bottom:5px; }
.placement-controls .solar-chart-container { height:165px; }
.placement-controls .solar-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.placement-controls .cta-panel { border-radius:12px; box-shadow:none; padding:13px; }
.placement-controls .cta-content h3 { font-size:.93rem; }
.placement-controls .cta-content p { font-size:.75rem; }
.placement-controls .cta-actions .btn { font-size:.75rem; min-height:37px; }
.placement-controls .disclaimer-text { font-size:.66rem; }
.workspace-intake .panel, .workspace-intake .control-box, .workspace-intake .margins-card { box-shadow:none; border-color:var(--pc-line); border-radius:10px; }
.workspace-intake .panel-header, .placement-controls .panel-header { background:#fff; border-bottom-color:#e8edf2; }
.workspace-intake input:not([type="range"]):not([type="checkbox"]), .workspace-intake select { border-color:#d7dfe8; border-radius:6px; background:#fafbfd; color:#26374b; }
.workspace-intake input:focus, .workspace-intake select:focus { border-color:#006b9c; box-shadow:0 0 0 3px rgba(0,107,156,.08); }
.placement-controls .metric-card { background:#f5f7fa; border:0; border-radius:6px; padding:8px 6px; }
.placement-controls .metric-value { color:#102d61; font-size:1rem; font-weight:700; letter-spacing:-.025em; }
.placement-controls .evaluation-card { background:#f5f8fb; border-color:#dbe5ee; border-radius:10px; }
.placement-controls .variant-card, .placement-controls .saved-variant-card { background:#fff; border:1px solid var(--pc-line); border-radius:8px; box-shadow:none; padding:12px; }
.placement-controls .variant-card.active { background:#f3f8fc; border-color:#006b9c; border-left:3px solid #006b9c; }
.placement-controls .variant-card-title { font-weight:650; line-height:1.4; letter-spacing:-.01em; }
.placement-controls .variant-card-desc, .placement-controls .variant-card-tradeoff { color:#5a6b7b; line-height:1.45; }
.placement-controls .cta-panel { background:#102d61; border-color:#102d61; color:#fff; }
.placement-controls .cta-content h3 { color:#fff; }
.placement-controls .cta-content p, .placement-controls .disclaimer-text { color:#bfcde0; }
.placement-controls .cta-actions .btn { background:#fff; border-color:#fff; color:#102d61; }
.mobile-controls-toggle .pc-icon { margin-left:auto; transition:transform .18s ease; }
.mobile-controls-toggle[aria-expanded="true"] .pc-icon { transform:rotate(180deg); }
.canvas-legend .dot-house { background:#50565d; }
.canvas-legend .dot-terrace { background:#c5a47b; }
.canvas-legend .dot-entrance { background:#008164; }
.map-view-box .dot-house { background:#334155; }
.map-view-box .dot-terrace { background:#9a7049; }
.map-view-box .dot-entrance { background:#0f766e; }
.map-view-box .dot-parcel { background:#1d4ed8; }
.canvas-wrapper, .map-view-box { position:relative; }
.canvas-wrapper .canvas-legend, .map-view-box .canvas-legend { bottom:12px; font-size:.65rem; }
.canvas-legend .dot-zone { background:#b9deed; border:1px solid #70b5d1; }
/* Keep the decision layer visible; methods and secondary metrics expand in place. */
.workspace-intake .control-panel .panel-header h2 { margin:0; }
.placement-controls { gap:8px; }
.placement-controls > * { flex-shrink:0; }
.placement-controls .wind-rose-container { grid-template-columns:88px minmax(0,1fr); }
.placement-controls #wind-rose-svg-wrapper { width:88px; height:88px; }
.placement-controls .panel-header { padding:8px 10px; }
.placement-controls .panel-body { padding:8px 10px; }
.placement-controls .panel-header h2 { font-size:.87rem; margin:0 0 4px; }
.climate-more summary { font-size:.69rem; padding:7px 0; }
.sunlight-months-chart svg { display:block; width:100%; height:84px; }
.sunlight-chart-note { font-size:.63rem; line-height:1.4; color:#617183; margin:3px 0 0; }
.solar-panel .climate-more { margin-top:5px; }
.placement-controls .variant-card { padding:9px 10px; }
.placement-controls .variant-card-title { display:block; font-size:.77rem; }
.placement-controls .variant-card-title .badge { display:block; width:fit-content; margin-top:4px; font-size:.61rem; background:#f0f4f8; font-weight:500; }
.placement-controls .variant-card-desc { margin:6px 0; font-size:.69rem; }
.variant-explanation { color:#607185; font-size:.65rem; }
.variant-explanation summary { cursor:pointer; }
.placement-controls .variant-card .btn { min-height:28px; padding:4px 10px; font-size:.67rem; }
.placement-controls .variant-card { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:6px; align-items:center; }
.placement-controls .variant-card-title, .placement-controls .variant-card-desc { grid-column:1/-1; }
.placement-controls .variant-card > .no-print { margin-top:0!important; }
.sunlight-months-chart svg { height:66px; }
.placement-controls .solar-panel .panel-header { padding-bottom:3px; }
.placement-controls .insights-nav { gap:4px; padding-bottom:4px; }
.placement-controls .insights-nav button { min-height:27px; padding:5px 2px; }
.placement-controls .variant-card-desc { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.35; }
.placement-controls .variant-card-title .badge { padding:2px 6px; line-height:1.3; }
.placement-controls .variant-card-title { line-height:1.3; }
.placement-controls .solar-panel .panel-header h2 { margin:0; }
.placement-controls .solar-panel .climate-more summary { padding:5px 0; }
.placement-controls .solar-panel .panel-body { padding-top:4px; padding-bottom:5px; }
.placement-controls .solar-panel .sunlight-chart-note { font-size:.6rem; line-height:1.3; }
.placement-controls .climate-panel .panel-header { padding-top:6px; padding-bottom:5px; }
.scenario-letter { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; background:#e6eef5; color:#34526e; font-size:.59rem; margin-right:3px; }
.variant-card.active .scenario-letter { background:#006b9c; color:#fff; }
.variant-card .btn:disabled { opacity:1; background:#e2f0f7; color:#006b9c; border-color:#c9e2ef; cursor:default; }
.placement-controls .variants-section h3 { font-size:.86rem; margin:2px 0 8px; }
.placement-controls .variant-card.active { background:#f3f8fc; }
.source-details #cadastral-status-hint { display:block; }
@media (prefers-reduced-motion:reduce) { .mobile-controls-toggle .pc-icon { transition:none; } }
#site-summary { width:100%; margin:0!important; flex-shrink:0; }
.app-footer { margin:0; }
.mobile-controls-toggle { display:none; }
.pc-plan-expanded .map-and-plan-wrapper { position:fixed; z-index:1000; inset:12px; width:auto; height:auto; border:1px solid var(--pc-line); border-radius:12px; box-shadow:0 15px 70px rgba(0,0,0,.3); }
.pc-plan-expanded::before { content:""; position:fixed; z-index:999; inset:0; background:rgba(10,27,47,.72); }
@media (max-width:1100px) {
  .workspace-layout { grid-template-columns:220px minmax(0,1fr); }
  .placement-layout { grid-template-columns:minmax(0,1fr) 300px; }
  .workspace-intake { padding:9px; }
  .view-switch-bar .map-controls-inline { display:none!important; }
  .view-switch-bar .map-advanced[open] .map-controls-inline { display:flex!important; }
}
@media (max-width:900px) {
  .workspace-layout { height:auto; min-height:0; display:block; }
  .workspace-intake { height:auto; overflow:visible; border:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; }
  .workspace-guide { grid-column:1/-1; }
  .placement-panel { height:auto; }
  .placement-layout { height:auto; grid-template-columns:minmax(0,1fr); }
  .map-and-plan-wrapper { height:580px; }
  .placement-controls { height:auto; max-height:none; overflow:visible; display:flex; border-left:0; border-top:1px solid var(--pc-line); }
  .insights-nav { position:static; }
  #site-summary { margin:0!important; }
}
@media (max-width:700px) {
  .app-header { height:auto; min-height:64px; padding:9px 12px; }
  .header-actions { display:flex; flex-wrap:wrap; }
  .header-actions .btn { font-size:.67rem; min-height:34px; }
  .workspace-nav { margin:0; padding:0 7px; }
  .workspace-layout { display:flex; flex-direction:column; }
  .placement-panel { order:1; width:100%; }
  .workspace-intake { order:2; display:flex; flex-direction:column; width:100%; padding:12px; }
  .map-and-plan-wrapper { height:580px; }
  .map-view-box, .canvas-wrapper { min-height:0; }
  .view-switch-bar { min-height:70px; }
  .view-switch-bar .button-group { display:flex; }
  .view-switch-bar .btn { min-height:34px; }
  .plot-overlay-card { top:calc(var(--pc-toolbar-height, 70px) + 10px); width:min(220px,calc(100% - 106px)); }
  .plot-overlay-card { padding:6px 8px; gap:0; }
  .plot-overlay-card strong, .plot-overlay-card span { font-size:.67rem; }
  .plot-overlay-card small { font-size:.62rem; margin-top:3px; }
  .plot-overlay-card #setback-status-badge { display:none; }
  .plot-compass { top:calc(var(--pc-toolbar-height, 70px) + 10px); }
  .plot-wind-card { display:none; }
  .mobile-controls-toggle { display:flex; margin:0; border-radius:0; }
  .pc-js .mobile-controls-toggle[aria-expanded="false"] + .placement-controls { display:none; }
  .placement-controls { padding:12px; }
  .workspace-intake .control-panel, .workspace-intake .control-box, .workspace-intake .margins-card { width:100%; box-sizing:border-box; }
  .canvas-legend { bottom:108px; }
  #plan-canvas { transform:scale(1.22); }
}
@media (max-width:380px) {
  .map-and-plan-wrapper { height:550px; }
  .plot-overlay-card { left:8px; width:188px; padding:7px; }
  .plot-compass { right:8px; width:60px; height:60px; }
  .plot-compass .north,.plot-compass .south { left:26px; }
  .plot-compass .west,.plot-compass .east { top:22px; }
  .plot-compass .compass-needle { left:22px; top:14px; width:16px; height:31px; }
}
@media print {
  .app-header { height:auto; }
  .workspace-layout { display:block; height:auto; }
  .workspace-intake, .placement-controls { display:block; height:auto; max-height:none; overflow:visible; border:0; }
  .placement-panel { height:auto; }
  .placement-layout { display:block; height:auto; }
  .map-and-plan-wrapper { height:auto; }
  .map-view-box, .canvas-wrapper { height:500px; }
  .source-details, .climate-more { display:block; }
  .source-details > *, .climate-more > * { display:block; }
  .plot-overlay-card, .plot-compass, .insights-nav { display:none; }
}

/* Embedded page keeps the host site's header; only tool actions remain here. */
.embedded-title { display:none; color:#102d61; font-size:1rem; font-weight:650; }
.pc-embedded .brand-mark, .pc-embedded .brand-copy { display:none; }
.pc-embedded .embedded-title { display:block; }
.pc-embedded .app-header { height:52px; }
.pc-embedded .workspace-layout { height:calc(100dvh - 94px); }
.panel-toggle, .panel-resizer { display:none; }
.plan-editbar { flex:none; display:flex; flex-wrap:wrap; align-items:end; gap:6px 10px; padding:8px 12px; background:#fff; border-top:1px solid var(--pc-line); }
.plan-dimensions { display:flex; gap:6px; }
.plan-dimensions label { display:grid; gap:3px; font-size:.61rem; color:#607185; }
.plan-dimensions input { width:65px; box-sizing:border-box; min-height:31px; border:1px solid var(--pc-line); border-radius:5px; padding:4px 6px; color:#102d61; font-size:.76rem; }
.plan-nudge { display:flex; gap:3px; flex-wrap:wrap; }
.plan-nudge button { min-width:30px; min-height:31px; padding:4px; background:#f4f7fa; border:1px solid var(--pc-line); color:#102d61; border-radius:5px; font-size:.73rem; cursor:pointer; }
.plan-editbar small { width:100%; color:#718194; font-size:.59rem; }
#plan-canvas { touch-action:none; }
#plan-canvas:focus-visible { outline:2px solid #006b9c; outline-offset:-2px; }
.placement-result { flex:none; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 12px; background:#f4f8fb; border-top:1px solid #dce7ef; }
.placement-result strong { display:block; font-size:.76rem; color:#102d61; }
.placement-result span { display:block; font-size:.63rem; line-height:1.5; color:#607185; }
#placement-result-status[data-fits="false"] { color:#b42318; }
#placement-result-status[data-fits="true"] { color:#2d6c54; }
.result-actions { display:flex; gap:5px; flex-wrap:wrap; justify-content:end; }
.result-actions .btn { font-size:.65rem; min-height:29px; padding:5px 8px; }
.plot-inspector-details { flex:none; background:#fff; border-top:1px solid var(--pc-line); }
.plot-inspector-details > summary { font-size:.65rem; font-weight:600; color:#607185; padding:8px 12px; cursor:pointer; }
.overview-chart-tabs { display:flex; gap:4px; margin-top:7px; }
.overview-chart-tabs button { flex:1; min-height:27px; font-size:.64rem; border:0; border-radius:5px; background:#f1f5f8; color:#607185; cursor:pointer; }
.overview-chart-tabs button[aria-pressed="true"] { color:#fff; background:#006b9c; }
.monthly-overview-chart { color:#526477; font-size:.7rem; min-height:66px; }
.monthly-overview-chart svg { display:block; width:100%; height:120px; font:16px sans-serif; }
.monthly-overview-chart .pc-climate-axis { stroke:#dce3ea; }
.monthly-overview-chart .pc-climate-temp { fill:none; stroke:#006b9c; stroke-width:3; }
.monthly-overview-chart .pc-climate-dot, .monthly-overview-chart .pc-climate-rain { fill:#009ee3; }
.monthly-overview-chart p { padding:10px 0; margin:0; }
.monthly-overview-chart[hidden], .sunlight-months-chart[hidden] { display:none!important; }
@media(max-width:700px) {
  .plan-editbar { padding:8px; }
  .placement-result { flex-wrap:wrap; padding:8px; }
  .result-actions { justify-content:start; }
  .map-and-plan-wrapper { height:720px; }
  .pc-plan-expanded .map-and-plan-wrapper { height:100dvh; }
}
@media print { .plot-inspector-details { display:block; } }
@media (max-width:900px) {
  .pc-embedded .workspace-layout { height:auto; }
}
@media (max-width:700px) {
  .pc-embedded .app-header { height:auto; }
}
@media (min-width:1101px) {
  .workspace-layout { position:relative; grid-template-columns:var(--pc-left-width,300px) minmax(0,1fr); }
  .placement-panel { position:relative; }
  .placement-layout { grid-template-columns:minmax(0,1fr) var(--pc-right-width,340px); }
  .panel-toggle { display:inline-flex; }
  .workspace-nav .panel-toggle { margin:5px 0 5px 6px; min-height:30px; font-size:.7rem; padding:4px 10px; }
  .workspace-nav .panel-toggle:first-of-type { margin-left:auto; }
  .panel-toggle[aria-expanded="true"] { color:#006b9c; background:#edf6fb; }
  .panel-resizer { display:block; position:absolute; top:0; bottom:0; width:8px; z-index:9; cursor:col-resize; touch-action:none; }
  .panel-resizer::after { content:""; position:absolute; top:45%; left:3px; width:2px; height:36px; border-radius:2px; background:#b3c3d0; }
  .panel-resizer:hover, .panel-resizer:focus-visible { background:rgba(0,158,227,.15); outline:none; }
  .panel-resizer-left { left:calc(var(--pc-left-width,300px) - 4px); }
  .panel-resizer-right { right:calc(var(--pc-right-width,340px) - 4px); }
  .pc-left-closed .workspace-intake, .pc-left-closed .panel-resizer-left,
  .pc-right-closed .placement-controls, .pc-right-closed .panel-resizer-right { visibility:hidden; padding:0; border:0; overflow:hidden; }
  .pc-panel-resizing { cursor:col-resize; user-select:none; }
}
@media print {
  .panel-resizer, .panel-toggle { display:none!important; }
  .pc-left-closed .workspace-intake, .pc-right-closed .placement-controls { visibility:visible; }
}

/* Direct house manipulation uses the same canvas projection as its footprint. */
.house-edit-surface { position:relative; }
.canvas-wrapper { container-type:size; }
#plan-canvas { width:min(100cqw,120cqh,690px); height:auto; max-height:none; aspect-ratio:6/5; }
@media (max-width:600px) { #plan-canvas { transform:none; } }
.house-handle { position:absolute; z-index:6; width:22px; height:22px; padding:0; border:1.5px solid #006b9c; border-radius:5px; background:#fff; transform:translate(-50%,-50%); box-shadow:0 2px 7px #102d6120; cursor:nwse-resize; touch-action:none; }
.house-handle[data-kind="rotate"] { width:28px; height:28px; border-radius:50%; cursor:grab; }
.house-handle svg { width:18px; height:18px; color:#006b9c; }
.house-handle:hover,.house-handle:focus-visible { background:#e6f5fb; outline:2px solid #006b9c; outline-offset:2px; }
.house-history { display:flex; flex-wrap:wrap; gap:4px; }
.house-history button { font:inherit; font-size:.65rem; padding:5px 7px; border:1px solid #dce3ea; border-radius:5px; background:#fff; color:#34516a; cursor:pointer; }
.house-history button:disabled { opacity:.45; cursor:default; }
.placement-result .result-status { display:block; border:0; background:transparent; padding:0; font:inherit; font-size:.66rem; color:#287352; cursor:pointer; text-align:left; }
.placement-result .result-status[data-fits="false"] { color:#a32b2b; }
.result-coordinates { font-size:.62rem; color:#738292; margin-top:3px; }
.result-coordinates summary { cursor:pointer; }
.result-coordinates span { margin-top:4px; }
@media (max-width:600px) { .house-handle { width:28px; height:28px; } .house-handle[data-kind="rotate"] { width:32px; height:32px; } }
@media print { .result-coordinates { display:none; } .house-history { display:none; } }

/* Small visible grips with comfortable invisible pointer targets. */
.house-handle { width:24px; height:24px; border:0; background:transparent; box-shadow:none; border-radius:0; }
.house-handle::after { content:""; position:absolute; width:7px; height:7px; left:50%; top:50%; transform:translate(-50%,-50%); background:#fff; border:1px solid #64879a; border-radius:2px; box-shadow:0 1px 3px #102d6118; }
.house-handle[data-kind="rotate"] { width:30px; height:30px; border:0; background:transparent; }
.house-handle[data-kind="rotate"]::after { width:18px; height:18px; border-radius:50%; }
.house-handle svg { position:relative; z-index:1; width:12px; height:12px; color:#51768b; }
.house-handle:hover,.house-handle:focus-visible { background:transparent; outline:0; }
.house-handle:hover::after,.house-handle:focus-visible::after { border-color:#006b9c; box-shadow:0 0 0 2px #009ee324; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { margin:0 12px 42px 0; }
.plan-sun-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:7px 12px; background:#fffcf5; border-top:1px solid #e7ddc9; font-size:.65rem; color:#795b2f; }
.plan-sun-controls[hidden] { display:none; }
.plan-sun-controls label { display:flex; align-items:center; gap:5px; }
.plan-sun-controls input[type="date"] { font:inherit; border:1px solid #e0d8c8; border-radius:4px; padding:4px; background:#fff; }
.plan-sun-controls .sun-time { flex:1; min-width:140px; }
.plan-sun-controls input[type="range"] { width:100%; accent-color:#ba8737; }
.plan-sun-controls small { width:100%; font-size:.59rem; color:#8a806e; }
.placement-result .plan-terrain-readout { font-size:.61rem; color:#798894; max-width:220px; }
@media(max-width:600px) { .house-handle {width:32px;height:32px;} .house-handle::after {width:9px;height:9px;} .house-handle[data-kind="rotate"] {width:34px;height:34px;} .plan-terrain-readout {width:100%;max-width:none!important;} }
@media (max-width:600px) {
  .map-and-plan-wrapper { height:auto; min-height:720px; }
  .canvas-wrapper,.map-view-box { flex:none; height:360px; min-height:360px; }
  .pc-plan-expanded .map-and-plan-wrapper { min-height:0; overflow-y:auto; }
}

/* Integrated source panels retain their data and are styled only within this workspace. */
.workspace-guide { background:#f3f7fa; }
.workspace-intake { grid-column:1; grid-row:1; }
.placement-panel { grid-column:2; grid-row:1; }
.mobile-intake-toggle { display:none; }
.climate-loading-status { flex:none; z-index:7; }
.climate-loading-status .spinner { padding:8px 12px; font-size:.75rem; color:#102d61; background:#eef7fc; }
.climate-loading-status:empty { display:none; }
#terrain-inspector > div:not(.inspector-item), #terrain-attribution-details { grid-column:1/-1; }
.context-details { flex:none; padding:0 12px; border-top:1px solid var(--pc-line); background:#fff; }
.workspace-layout #context-panel { border:0; border-radius:0; box-shadow:none; margin:0; padding:0 0 10px; }
.workspace-layout #context-panel > h2 { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.workspace-layout #context-panel p { font-size:.75rem; line-height:1.45; }
.workspace-layout #context-panel .pc-context-controls { display:flex; flex-wrap:wrap; gap:6px; }
.workspace-layout #context-panel button { font:inherit; font-size:.75rem; min-height:36px; }
@media(max-width:900px) {
  .workspace-layout { display:flex; flex-direction:column; }
  .placement-panel { order:1; }
  .mobile-intake-toggle { order:2; }
  .workspace-intake { order:3; }
  .mobile-intake-toggle, .mobile-controls-toggle { display:flex; align-items:center; gap:8px; width:100%; min-height:44px; padding:10px 12px; border:0; border-top:1px solid var(--pc-line); background:#f1f6fa; color:#102d61; font:inherit; font-size:.8rem; text-align:left; }
  .mobile-intake-toggle .pc-icon { margin-left:auto; }
  .pc-js .mobile-intake-toggle[aria-expanded="false"] + .workspace-intake, .pc-js .mobile-controls-toggle[aria-expanded="false"] + .placement-controls { display:none; }
  .view-switch-bar .btn, .view-switch-bar summary, .workspace-nav a, .workspace-nav button, .insights-nav button, .overview-chart-tabs button, .plan-nudge button, .house-history button, .plan-dimensions input, .result-actions .btn, .placement-controls .variant-card .btn { min-height:42px; }
  .workspace-layout #context-panel button { min-height:42px; flex:1 1 calc(50% - 6px); }
  .plan-dimensions { flex-wrap:wrap; }
  .map-view-box .canvas-legend { bottom:72px; max-width:calc(100% - 76px); }
}
@media print { .mobile-intake-toggle { display:none; } .pc-js .mobile-intake-toggle[aria-expanded="false"] + .workspace-intake, .pc-js .mobile-controls-toggle[aria-expanded="false"] + .placement-controls { display:block; } }

/* Local satellite connection is contained within the existing map settings. */
.view-switch-bar { position:relative; z-index:8; }
.map-advanced { position:static; }
.map-advanced .map-controls-inline { left:10px; right:auto; width:min(310px,calc(100% - 20px)); min-width:0; max-width:calc(100% - 20px); box-sizing:border-box; }
.maptiler-key-controls { width:100%; display:grid; gap:7px; color:#34516a; }
.maptiler-key-controls label { font-size:.72rem; font-weight:600; }
.maptiler-key-controls input { width:100%; min-height:38px; padding:7px 8px; border:1px solid var(--pc-line); border-radius:5px; box-sizing:border-box; }
.maptiler-key-controls small, #maptiler-status { margin:0; font-size:.67rem; line-height:1.45; overflow-wrap:anywhere; }
.maptiler-key-actions { display:flex; flex-wrap:wrap; gap:5px; }
.maptiler-key-actions .btn { flex:1 1 100px; }
.pc-maptiler-logo { margin:0 0 44px 12px!important; padding:4px 6px; background:#fff; border-radius:4px; }
.pc-maptiler-logo[hidden] { display:none!important; }
.pc-maptiler-logo img { display:block; width:100px; height:auto; }
.pc-satellite-active .map-view-box .canvas-legend { bottom:100px; }
/* Reserve the same legend area before and after an automatic basemap change. */
.map-view-box .canvas-legend { bottom:100px; }

/* One house editor and one pair of panel headings across both view modes. */
.workspace-layout { height:calc(100dvh - 66px); }
#plan-map-overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:3; }
.house-edit-surface { position:relative; }
.house-handle { z-index:6; }
.house-handle:focus-visible { outline:2px solid #006b9c; outline-offset:1px; }
.plan-viewport-controls { position:absolute; right:12px; top:calc(var(--pc-toolbar-height,48px) + 100px); z-index:9; display:grid; border:1px solid #c3d2dd; border-radius:8px; overflow:hidden; box-shadow:0 2px 10px #102d6115; }
.plan-viewport-controls button { border:0; border-bottom:1px solid #dce3ea; width:42px; height:42px; padding:0; background:#fff; color:#102d61; font-size:23px; cursor:pointer; }
.plan-viewport-controls button:last-child { border:0; }
.plan-viewport-controls button:hover { background:#eaf4f9; }
.plan-viewport-controls button:focus-visible { outline:2px solid #006b9c; outline-offset:-3px; }
.plan-wind-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:10px 12px; background:#eef5fb; border-top:1px solid #dae5ef; }
.plan-wind-controls[hidden], .plan-sun-controls[hidden] { display:none; }
.plan-wind-controls label { display:flex; align-items:center; gap:8px; font-size:.75rem; font-weight:600; color:#102d61; }
.plan-wind-controls select { min-height:36px; max-width:145px; border:1px solid #c3d2dd; border-radius:5px; background:white; }
.plan-wind-controls small { font-size:.7rem; line-height:1.45; color:#526477; flex:1 1 170px; }
.house-quick-actions { display:flex; gap:6px; flex-wrap:wrap; }
.house-quick-actions button { border:1px solid #c3d2dd; border-radius:5px; padding:7px 9px; background:#fff; color:#34516a; font-size:.7rem; min-height:34px; cursor:pointer; }
.column-header { position:sticky; top:-14px; z-index:8; margin:-14px -14px 2px; background:#f7fafc; border-bottom:1px solid #dce3ea; flex:none; }
.column-toggle { display:flex; justify-content:space-between; align-items:center; gap:8px; width:100%; min-height:46px; border:0; padding:0 14px; background:transparent; font-size:.8rem; font-weight:750; color:#102d61; cursor:pointer; }
.column-toggle:hover { background:#eaf4f9; }
.column-toggle:focus-visible { outline:2px solid #006b9c; outline-offset:-3px; }
.column-chevron { font-size:24px; line-height:1; }
.placement-controls .column-chevron { transform:rotate(180deg); }
.pc-left-closed .workspace-intake, .pc-right-closed .placement-controls { visibility:visible; padding:0; overflow:hidden; }
.pc-left-closed .workspace-intake > :not(.column-header), .pc-right-closed .placement-controls > :not(.column-header) { display:none!important; }
.pc-left-closed .workspace-intake .column-header, .pc-right-closed .placement-controls .column-header { margin:0; top:0; }
.pc-left-closed .workspace-intake .column-header .column-toggle, .pc-right-closed .placement-controls .column-header .column-toggle { padding:14px 0; flex-direction:column; }
.pc-left-closed .workspace-intake .column-header .column-toggle > span:first-child, .pc-right-closed .placement-controls .column-header .column-toggle > span:first-child { writing-mode:vertical-rl; }
.column-chevron[data-closed="true"] { transform:rotate(180deg); }
.placement-controls .column-chevron[data-closed="true"] { transform:none; }
.placement-controls .insights-nav { top:32px; }
.map-connection-details { width:100%; border-top:1px solid #dce3ea; }
.map-connection-details > summary { border:0; background:transparent; padding:10px 0; }
.map-connection-details:not([open]) #maptiler-key-controls { display:none; }
@media (max-width:1100px) {
  .workspace-layout { height:auto; min-height:0; display:flex; flex-direction:column; }
  .placement-panel, .placement-panel > .panel-body, .placement-layout { display:contents; }
  .map-and-plan-wrapper { order:1; height:auto; min-height:0; overflow:visible; }
  .workspace-intake { order:2; }
  .placement-controls { order:3; }
  .workspace-intake, .placement-controls { width:100%; height:auto; max-height:none; overflow:visible; padding:14px; border-top:1px solid #dce3ea; }
  .column-header { position:relative; top:0; }
  .pc-left-closed .workspace-intake, .pc-right-closed .placement-controls { padding:0; }
  .pc-left-closed .workspace-intake .column-header .column-toggle, .pc-right-closed .placement-controls .column-header .column-toggle { padding:0 14px; flex-direction:row; }
  .pc-left-closed .workspace-intake .column-header .column-toggle > span:first-child, .pc-right-closed .placement-controls .column-header .column-toggle > span:first-child { writing-mode:horizontal-tb; }
  .placement-controls .insights-nav { position:static; }
  .map-view-box,.canvas-wrapper { flex:none; height:450px; min-height:450px; }
  .house-handle { width:44px; height:44px; }
  .house-handle[data-kind="rotate"] { width:44px; height:44px; }
  .plan-viewport-controls button { width:44px; height:44px; }
  .house-quick-actions button { min-height:44px; }
}
@media (max-width:600px) {
  .map-view-box,.canvas-wrapper { height:360px; min-height:360px; }
  .plan-viewport-controls { right:8px; top:calc(var(--pc-toolbar-height,48px) + 92px); }
  .map-advanced .map-controls-inline { position:absolute; }
  .plot-overlay-card { max-width:calc(100% - 94px); }
}
@media print {
  .pc-left-closed .workspace-intake > :not(.column-header), .pc-right-closed .placement-controls > :not(.column-header) { display:block!important; }
  #plan-map-overlay { display:none; }
}
/* Loading and inspector rows must not compress the editable map to a strip. */
@media screen and (min-width:601px) {
  .map-view-box, .canvas-wrapper { min-height:360px; }
  .map-and-plan-wrapper { overflow-y:auto; }
}
.satellite-print-notice { display:none!important; }
@media(max-width:900px) { .maptiler-key-controls input, .maptiler-key-actions .btn { min-height:42px; } }
@media(max-width:700px) { .plot-overlay-card #plot-overlay-note { display:block; font-size:.61rem; } }
@media print {
  .pc-satellite-active #map-view-container { display:none!important; }
  .pc-satellite-active .satellite-print-notice { display:block!important; margin:12px; font-size:.85rem; }
}
#directional-margins[hidden], #polygon-clearance[hidden] { display:none!important; }
#polygon-clearance { margin:7px 0 0; font-size:12px; line-height:1.5; color:#34516a; }
@media(max-width:700px) {
  .placement-controls .insights-nav button { min-height:44px; }
  .placement-controls .season-tabs .tab-btn { min-height:36px; }
  .pc-site-summary-compact summary { min-height:36px; }
}

@media(max-width:1100px) { .workspace-intake { align-items:stretch; } }
@media(max-width:600px) {
  .view-switch-bar .button-group { gap:4px; width:100%; }
  .view-switch-bar .button-group .btn { padding:7px 8px; font-size:.7rem; }
  .wind-toggle-label { display:none; }
  #btn-plan-wind::after { content:'Ветер'; }
  .view-switch-bar #btn-expand-plan { width:auto; margin-left:auto; min-width:44px; }
  .view-switch-bar #btn-expand-plan .button-label { display:none; }
  .view-switch-bar .map-advanced { flex:1 1 auto; }
}

@media(max-width:600px) {
  .view-switch-bar .button-group { order:1; flex-basis:100%; }
  .view-switch-bar .map-advanced { order:2; width:auto; flex:1 1 calc(100% - 60px); }
  .view-switch-bar #btn-expand-plan { order:3; flex:0 0 44px; }
}
@media(max-width:1100px) { .column-header { grid-column:1 / -1; } }
