/* Terra Studio 1.2 — simpler layout, neutral dark mode, north & rotation (B Architecture) */

/* ---------- remove clutter ---------- */
.study-panel>.panel-heading,.canvas-legend,.canvas-bottom,.viewport-caption .eyebrow,#viewLocation span,.site-stats,.solar-metrics,.status-brand,.weather-section,.study-panel .analysis-description,.project-heading .micro{display:none!important}
.viewport-caption{top:22px!important;left:24px!important}
.viewport-caption h1{font-size:24px!important;margin:0 0 4px!important}
.viewport-caption p{font-size:12px!important;opacity:.8}
.save-status{margin-right:2px!important}
.save-status i{width:7px;height:7px}
.objects-panel[data-panel=model] .objects-header,.objects-panel[data-panel=model] .object-filter{display:flex}
.panel-bottom{justify-content:flex-end;gap:8px}
.panel-bottom.analysis-active{justify-content:space-between}

/* ---------- tabs & section titles ---------- */
.sidebar-tabs{padding:10px 12px!important;gap:6px!important}
.sidebar-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;font-size:13px!important;padding:9px 4px!important;border-radius:9px!important}
.sidebar-tabs button svg{width:16px;height:16px}
.pane-title{font-size:13px;font-weight:700;margin:0 0 12px;color:var(--ink);letter-spacing:-.1px}
.settings-section{padding:16px 16px!important}
.guide-section{padding:12px 12px 6px!important;border-bottom:0!important}
.study-types{gap:4px!important}
.study-type{padding:8px 10px!important;min-height:46px}
.study-type>span{font-size:13.5px!important}
.study-type>svg{width:30px!important;height:30px!important;padding:6px!important}

/* ---------- city picker ---------- */
.city-picker{position:relative;display:flex;align-items:center}
.city-picker>svg{position:absolute;left:11px;width:16px;height:16px;color:var(--dim);pointer-events:none}
.city-picker input{padding-left:34px!important;height:40px!important;font-size:13px!important;border-radius:10px!important}
.city-results{position:absolute;left:0;right:0;top:44px;z-index:20;background:var(--chrome);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 30px #0000002a;max-height:300px;overflow:auto;padding:4px}
.city-results button{display:flex;width:100%;justify-content:space-between;align-items:baseline;gap:8px;padding:8px 10px;border-radius:7px;background:transparent;color:var(--ink);text-align:left;font-size:13px}
.city-results button small{color:var(--dim);font-size:11px}
.city-results button.active,.city-results button:hover{background:var(--card)}
#nearestCityBtn{display:block;margin:6px 0 10px;padding:0;font-size:11.5px}
.spinner.inline{display:inline-block;width:12px;height:12px;border-width:2px;vertical-align:-2px;margin-right:6px}
.city-card{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--card)}
.city-card.in-use{border-color:#3f8f6b66}
.city-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:10px}
.city-card-head strong{display:block;font-size:15px;color:var(--ink)}
.city-card-head small{display:block;font-size:11.5px;color:var(--dim);margin-top:2px}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;padding:3px 8px;border-radius:20px;white-space:nowrap}
.pill svg{width:12px;height:12px}
.pill.ok{background:#3f8f6b22;color:#3f8f6b}
.city-card .climate-kpis{grid-template-columns:repeat(4,1fr)!important;margin-bottom:10px!important}
.city-card .climate-kpis div{padding:6px!important;text-align:center;background:var(--chrome)}
.city-card .climate-kpis b{font-size:14px}
.city-use{width:100%}
.city-card .text-button{display:block;margin-top:8px;padding:0;font-size:11.5px}
.climate-empty{display:flex;gap:10px;align-items:center;padding:12px;border:1px dashed var(--border);border-radius:12px;color:var(--dim)}
.climate-empty svg{width:24px;height:24px}
.climate-empty p{margin:0;font-size:12px;line-height:1.5}
.site-more{margin-top:10px;border-top:1px solid var(--border);padding-top:10px}
.site-more summary{cursor:pointer;font-size:12.5px;font-weight:600;color:var(--label);list-style:none;display:flex;align-items:center;gap:6px}
.site-more summary::-webkit-details-marker{display:none}
.site-more summary:before{content:'›';display:inline-block;transition:transform .15s;font-size:16px;line-height:1}
.site-more[open] summary:before{transform:rotate(90deg)}
.site-more>*:not(summary){margin-top:10px}
.climate-more .climate-sub{margin-top:14px}

/* ---------- north ---------- */
.north-row{display:flex;align-items:center;gap:8px;margin:4px 0 8px}
.north-step{width:34px;height:34px;border-radius:9px;border:1px solid var(--border);background:var(--field);color:var(--ink);font-size:17px}
.north-step:hover{background:var(--card)}
.north-dial{position:relative;width:46px;height:46px;border-radius:50%;border:2px solid var(--border);background:var(--field);cursor:grab;touch-action:none;flex:none}
.north-dial i{position:absolute;inset:0;transition:transform .08s}
.north-dial i:before{content:'';position:absolute;left:50%;top:4px;margin-left:-5px;border:5px solid transparent;border-bottom:16px solid #d9472b;border-top:0}
.north-dial i:after{content:'';position:absolute;left:50%;bottom:4px;margin-left:-4px;border:4px solid transparent;border-top:13px solid var(--dim);border-bottom:0}
.north-dial b{display:none}
.north-row input{width:64px!important;flex:none}
.north-row .unit{color:var(--dim);font-size:12px}
.north-hud{position:absolute;right:22px;top:118px;width:58px;height:58px;padding:0;border-radius:50%;background:var(--chrome);border:1px solid var(--border);box-shadow:0 6px 18px #00000022;z-index:4;cursor:pointer}
.north-hud svg{width:58px;height:58px;stroke:none}
.north-hud .ring{fill:none;stroke:var(--border);stroke-width:2}
.north-hud .n{fill:#d9472b}
.north-hud .s{fill:var(--dim);opacity:.55}
.north-hud b{position:absolute;left:0;right:0;top:-18px;text-align:center;font-size:12px;font-weight:800;color:#d9472b;pointer-events:none}
.north-hud:hover{box-shadow:0 0 0 3px #d9472b33}

/* ---------- rotation ---------- */
.rotate-row{display:flex;align-items:center;gap:4px;margin-top:10px}
.rotate-row button{flex:none;height:30px;padding:0 7px;border-radius:7px;border:1px solid var(--border);background:var(--field);color:var(--ink);font-size:11px;font-weight:600}
.rotate-row button:hover{background:var(--card)}
.rotate-row input[type=range]{flex:1;min-width:40px;accent-color:#d9472b}

/* ---------- neutral, truly dark theme (no purple) ---------- */
html[data-theme=dark]{--chrome:#151618;--canvas:#1b1c1f;--ink:#ececee;--label:#b9bbc0;--dim:#868990;--border:#2c2e33;--field:#1f2023;--card:#232529;--accent:#e9e9eb;--accent-text:#151618;--soft:#232529;color-scheme:dark}
html[data-theme=dark] body{background:var(--chrome)}
html[data-theme=dark] .viewport-wrap{background:#17181b}
html[data-theme=dark] .brand{color:#f2f2f3}
html[data-theme=dark] .brand-mark,html[data-theme=dark] .brand-dot{color:#e0a46b}
html[data-theme=dark] .maker-badge img{filter:invert(1)}
html[data-theme=dark] .button.primary{background:#ececee;color:#151618;box-shadow:none}
html[data-theme=dark] .button.primary:hover{background:#ffffff}
html[data-theme=dark] .button.subtle{border-color:var(--border);color:var(--label)}
html[data-theme=dark] .button.subtle:hover,html[data-theme=dark] .icon-button:hover{background:#26282c;color:#fff}
html[data-theme=dark] .icon-button{color:var(--label)}
html[data-theme=dark] .version-tag{color:#b9bbc0;background:#232529;border-color:#33363b}
html[data-theme=dark] .study-type.active,html[data-theme=dark] .tool.active,html[data-theme=dark] .sidebar-tabs button.active{background:#26282c;border-color:#3a3d43;color:#fff;box-shadow:inset 3px 0 0 #e0a46b}
html[data-theme=dark] .sidebar-tabs button.active{box-shadow:none}
html[data-theme=dark] .study-type.active>svg{background:#e0a46b;color:#151618}
html[data-theme=dark] .study-type>svg{background:#232529}
html[data-theme=dark] .study-type:hover,html[data-theme=dark] .tool:hover{background:#202226;color:#fff}
html[data-theme=dark] .tool.import-tool{background:#232529;color:#fff}
html[data-theme=dark] .step-action{background:#1f2023;color:#ececee;border-color:#33363b}
html[data-theme=dark] .step-action:hover,html[data-theme=dark] .guide-step:not(.ok):first-of-type .step-action,html[data-theme=dark] .guide-step.ok+.guide-step:not(.ok) .step-action{background:#ececee;color:#151618;box-shadow:none}
html[data-theme=dark] .guide-step{background:#1b1c1f;border-color:#2c2e33}
html[data-theme=dark] .guide-step .step-badge{background:#2c2e33;color:#ececee}
html[data-theme=dark] .season-buttons button{background:#1f2023;color:var(--label)}
html[data-theme=dark] .season-buttons button.active{background:#2c2e33;color:#fff;border-color:#44474d}
html[data-theme=dark] .toggle-row i{background:#33363b}
html[data-theme=dark] .toggle-row input:checked+i{background:#e0a46b}
html[data-theme=dark] .style-card{background:#1f2023;border-color:var(--border);color:var(--label)}
html[data-theme=dark] .style-card.active{border-color:#e0a46b;color:#fff}
html[data-theme=dark] .result-value{color:#ffffff}
html[data-theme=dark] .result-heading,html[data-theme=dark] .result-tabs button.active,html[data-theme=dark] .text-button{color:#e0a46b}
html[data-theme=dark] .result-tabs button.active:after{background:#e0a46b}
html[data-theme=dark] .object-row{color:var(--label)}
html[data-theme=dark] .object-row.selected{background:#2c2e33;color:#fff}
html[data-theme=dark] .object-row:hover{background:#202226}
html[data-theme=dark] .objects-header h2{color:#ececee}
html[data-theme=dark] .objects-header h2 span{background:#2c2e33;color:#b9bbc0}
html[data-theme=dark] .time-readout strong{color:#ffffff}
html[data-theme=dark] .play-button{background:#232529;color:#ececee;border-color:#33363b}
html[data-theme=dark] .play-button.playing{background:#e0a46b;color:#151618}
html[data-theme=dark] .timeline input{background:linear-gradient(90deg,#2a2c31 0%,#5a4a36 30%,#e0a46b 50%,#5a4a36 70%,#2a2c31 100%)}
html[data-theme=dark] .timeline input::-webkit-slider-thumb{background:#e0a46b;border-color:#151618;box-shadow:none}
html[data-theme=dark] .daylight-info b{color:#ececee}
html[data-theme=dark] dialog{background:#18191c;border-color:#33363b;color:var(--ink)}
html[data-theme=dark] .modal-header h2{color:#fff}
html[data-theme=dark] .modal-body p{color:var(--label)}
html[data-theme=dark] .modal-note{background:#202226;border-color:#33363b;color:var(--label)}
html[data-theme=dark] .modal-note strong{color:#fff}
html[data-theme=dark] .export-choice,html[data-theme=dark] .template-card,html[data-theme=dark] .import-drop{background:#1f2023;border-color:#33363b;color:var(--label)}
html[data-theme=dark] .export-choice strong,html[data-theme=dark] .import-drop strong,html[data-theme=dark] .template-card strong{color:#fff}
html[data-theme=dark] .export-choice small,html[data-theme=dark] .import-drop small,html[data-theme=dark] .template-card small{color:var(--dim)}
html[data-theme=dark] .export-choice:hover,html[data-theme=dark] .template-card:hover{background:#26282c}
html[data-theme=dark] kbd{background:#232529;border-color:#3a3d43;color:#ececee}
html[data-theme=dark] .shortcut-grid,html[data-theme=dark] .empty-inspector p{color:var(--label)}
html[data-theme=dark] .empty-inspector h3{color:#fff}
html[data-theme=dark] .view-controls .segmented,html[data-theme=dark] .view-controls .floating,html[data-theme=dark] .zoom-controls,html[data-theme=dark] .import-float{background:#1f2023ee;border-color:#33363b;color:var(--label)}
html[data-theme=dark] .view-controls .segmented button{color:var(--label)}
html[data-theme=dark] .view-controls .segmented button.active{background:#33363b;color:#fff}
html[data-theme=dark] .zoom-controls button{color:var(--label)}
html[data-theme=dark] .zoom-controls button+button{border-color:#33363b}
html[data-theme=dark] .viewport-caption h1{color:#f2f2f3}
html[data-theme=dark] .viewport-caption p{color:var(--label)}
html[data-theme=dark] .analysis-legend{background:#1b1c1fef;border-color:#33363b}
html[data-theme=dark] .analysis-legend strong{color:#fff}
html[data-theme=dark] .analysis-legend>div,html[data-theme=dark] .analysis-legend .legend-values{color:var(--label)}
html[data-theme=dark] .operation-progress{background:#18191c;border-color:#33363b}
html[data-theme=dark] .operation-progress>div>span{color:#e0a46b}
html[data-theme=dark] .toast{background:#ececee;color:#151618}
html[data-theme=dark] .toast.error{background:#c0503f;color:#fff}
html[data-theme=dark] .modal-note.warn{background:#2a201a;color:#f0c8a8}
html[data-theme=dark] .climate-chart .rd{fill:#151618aa}
html[data-theme=dark] .month-picker button{background:#1f2023;border-color:#33363b;color:var(--label)}
html[data-theme=dark] .month-picker button.active{background:#e0a46b;color:#151618}
html[data-theme=dark] .loading{background:#151618;color:var(--label)}
html[data-theme=dark] .north-hud{background:#1b1c1f;border-color:#33363b}
html[data-theme=dark] .run-analysis{box-shadow:none}
html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{border-color:#e0a46b!important;box-shadow:0 0 0 2px #e0a46b22}
html[data-theme=dark] .operation-track i{background:linear-gradient(90deg,#a7764a,#e0a46b 55%,#f3cf9c)!important;background-size:200% 100%!important}

/* ---------- 1.3: site tab, saved views, gizmo switch ---------- */
.picker-hint{margin:6px 2px 10px!important;font-size:11.5px!important}
.city-results .loc-option{display:flex;gap:10px;align-items:center;justify-content:flex-start;padding:10px}
.city-results .loc-option svg{width:18px;height:18px;color:#d9472b;flex:none}
.city-results .loc-option span{display:flex;flex-direction:column;gap:2px}
.city-results .loc-option small{white-space:normal}
.site-advanced{padding-top:6px!important}
.site-advanced .site-more{margin-top:0;border-top:0;padding-top:0}
.adv-label{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--dim);margin:14px 0 6px!important}
.field-grid.three{grid-template-columns:repeat(3,1fr)!important}
.adv-buttons{display:flex;gap:6px}.adv-buttons .button{flex:1;justify-content:center;font-size:12px;padding:8px}
.north-row .unit{white-space:nowrap}
.views-bar{position:absolute;left:50%;transform:translateX(-50%);bottom:14px;display:flex;gap:6px;align-items:stretch;z-index:5;max-width:calc(100% - 420px);overflow-x:auto;padding:4px;border-radius:12px;background:var(--chrome);border:1px solid var(--border);box-shadow:0 8px 24px #0000002e}
.view-save{display:flex;align-items:center;gap:6px;padding:0 12px;height:40px;border-radius:9px;background:#d9472b;color:#fff;font-weight:700;font-size:12.5px;white-space:nowrap;border:0}
.view-save svg{width:16px;height:16px}
.view-save:hover{background:#e8623e}
.view-chip{position:relative;display:flex;align-items:center;gap:7px;padding:3px 26px 3px 3px;height:40px;border-radius:9px;border:1px solid var(--border);background:var(--field);cursor:pointer;flex:none}
.view-chip img,.view-chip>i{width:54px;height:34px;border-radius:6px;object-fit:cover;display:grid;place-items:center;background:var(--card)}
.view-chip>i svg{width:16px;height:16px;color:var(--dim)}
.view-chip .view-name{font-size:12px;font-weight:600;color:var(--ink);white-space:nowrap;outline:none;max-width:110px;overflow:hidden;text-overflow:ellipsis}
.view-chip .view-name[contenteditable=true]{background:var(--card);padding:1px 4px;border-radius:4px;text-overflow:clip}
.view-chip.active{border-color:#d9472b;box-shadow:0 0 0 1px #d9472b}
.view-del{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:18px;height:18px;border-radius:50%;border:0;background:transparent;color:var(--dim);font-size:15px;line-height:1;padding:0}
.view-del:hover{background:#d9472b22;color:#d9472b}
.import-float{top:92px!important;bottom:auto!important}
.export-views{margin:14px 0 6px}
.export-view-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.export-view{display:flex;flex-direction:column;align-items:center;gap:5px;width:96px;padding:6px;border-radius:10px;border:1px solid var(--border);background:var(--field);color:var(--label);font-size:11.5px;font-weight:600}
.export-view img,.export-view>i{width:84px;height:52px;border-radius:6px;object-fit:cover;display:grid;place-items:center;background:var(--card)}
.export-view>i svg{width:20px;height:20px}
.export-view span{max-width:84px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.export-view.active{border-color:#d9472b;box-shadow:0 0 0 1px #d9472b;color:var(--ink)}
.gizmo-switch button{font-size:12px!important;font-weight:600}
.gizmo-switch button.active{color:#fff!important;background:#d9472b!important}
html[data-theme=dark] .views-bar{background:#1b1c1fee;border-color:#33363b}
.plain-summary{margin:12px 0 14px;padding:12px;border-radius:12px;border:1px solid var(--border);background:var(--card)}
.plain-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.plain-title{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--dim)}
.plain-chip{font-size:11px;font-weight:700;padding:3px 8px;border-radius:20px}
.plain-summary.good .plain-chip{background:#3f8f6b26;color:#3f8f6b}
.plain-summary.mid .plain-chip{background:#d99a3b26;color:#c7862a}
.plain-summary.bad .plain-chip{background:#d9472b26;color:#d9472b}
.plain-verdict{font-size:13px!important;line-height:1.5!important;margin:0 0 8px!important;color:var(--ink)!important}
.plain-lines,.plain-tips ul{list-style:none;margin:0;padding:0}
.plain-lines li{display:flex;gap:7px;align-items:baseline;font-size:12px;line-height:1.5;color:var(--label);margin:3px 0}
.plain-lines .pk{width:10px;height:10px;border-radius:3px;flex:none;transform:translateY(1px)}
.plain-tips{margin-top:10px;padding-top:9px;border-top:1px solid var(--border)}
.plain-tips>b{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--dim)}
.plain-tips li{font-size:12px;line-height:1.5;color:var(--label);margin:5px 0 0;padding-left:14px;position:relative}
.plain-tips li:before{content:'→';position:absolute;left:0;color:#d9472b}
.viewport-wrap{overflow:clip!important}
.tool-group .gizmo-switch{margin-left:6px;padding:2px;border-radius:8px;border:1px solid var(--border);background:var(--field)}
.tool-group .gizmo-switch button{padding:5px 10px!important;border-radius:6px;color:var(--label);background:transparent;white-space:nowrap}
.plain-lines li{display:block!important}
.plain-lines .pk{display:inline-block;margin-right:6px;vertical-align:-1px}
.plain-head{flex-wrap:wrap}
.plain-chip{white-space:nowrap}
.nav-hint{position:absolute;left:50%;bottom:76px;top:auto;font-family:inherit;border:1px solid #33363b;transform:translate(-50%,-8px);display:flex;gap:14px;align-items:center;padding:8px 14px;border-radius:12px;background:#151618e6;color:#e6e6e8;font-size:12px;pointer-events:none;opacity:0;transition:opacity .18s,transform .18s;z-index:7;white-space:nowrap;box-shadow:0 10px 30px #0000004d}
.nav-hint.show{opacity:1;transform:translate(-50%,0)}
.nav-hint span{display:flex;align-items:center;gap:6px}
.nav-hint kbd{font-family:inherit;font-weight:700;background:#2c2e33;border:1px solid #44474d;border-bottom-width:2px;color:#fff;font-size:11px;padding:2px 6px;border-radius:5px}
html[data-theme=light] .nav-hint{background:#ffffffee;color:#3b3740;border:1px solid #e3dde5}
html[data-theme=light] .nav-hint kbd{background:#f3eff4;color:#4c3f52;border-color:#dcd3df}
