/* ============================================================================
   DCFC Sitemap section — dedicated screen styles.
   Self-contained; mirrors the portal's dark + gold aesthetic.
   ============================================================================ */
:root { --dcfc-gold: #c5a55a; --dcfc-panel: #1b1f2a; --dcfc-panel2: #232838; --dcfc-border: #2f3545; --dcfc-text: #e8eaf0; --dcfc-text2: #9aa1b2; --dcfc-green: #34c759; --dcfc-red: #ff5a5f; }

#dcfcScreen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #11141c; color: var(--dcfc-text); }

/* layout: rail | map | cost panel */
.dcfc-layout { flex: 1; display: flex; min-height: 0; }
.dcfc-rail { width: 300px; flex-shrink: 0; background: var(--dcfc-panel); border-right: 1px solid var(--dcfc-border); overflow-y: auto; padding: 14px 14px 28px; }
.dcfc-map-wrap { flex: 1; position: relative; min-width: 0; overflow: hidden; }
#dcfcMap { position: absolute; inset: 0; width: 100%; height: 100%; }
.dcfc-map-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dcfc-text2); font-size: 14px; text-align: center; padding: 24px; }
.dcfc-panel { width: 320px; flex-shrink: 0; background: var(--dcfc-panel); border-left: 1px solid var(--dcfc-border); overflow-y: auto; padding: 16px 16px 28px; }

/* rail: wizard steps + inputs */
.dcfc-rail-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--dcfc-gold); margin: 14px 0 8px; }
.dcfc-rail-title:first-child { margin-top: 0; }
.dcfc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dcfc-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--dcfc-panel2); border: 1px solid var(--dcfc-border); border-radius: 8px; font-size: 13px; }
.dcfc-step-n { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: rgba(197,165,90,.16); color: var(--dcfc-gold); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.dcfc-rail-note { font-size: 11px; line-height: 1.5; color: var(--dcfc-text2); margin: 10px 0 4px; padding: 8px 10px; border-left: 2px solid var(--dcfc-gold); background: rgba(197,165,90,.06); border-radius: 0 6px 6px 0; }

.dcfc-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.dcfc-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dcfc-text2); }
.dcfc-field input { width: 92px; background: #161a24; border: 1px solid var(--dcfc-border); color: var(--dcfc-text); padding: 5px 8px; border-radius: 6px; font-size: 12px; text-align: right; }
.dcfc-field input:focus { outline: none; border-color: var(--dcfc-gold); }
.dcfc-select { width: 150px; background: #161a24; border: 1px solid var(--dcfc-border); color: var(--dcfc-text); padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.dcfc-select:focus { outline: none; border-color: var(--dcfc-gold); }
.dcfc-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dcfc-text); margin: 4px 0; cursor: pointer; }
.dcfc-check input { accent-color: var(--dcfc-gold); width: 15px; height: 15px; }
.dcfc-field-sub { margin: 2px 0 6px 23px; }
.dcfc-field-sub input:disabled { opacity: 0.4; }
.dcfc-hint { color: var(--dcfc-text2); font-size: 11px; }

/* cost panel */
.dcfc-panel-title { font-size: 13px; font-weight: 700; color: var(--dcfc-gold); margin-bottom: 12px; }
.dcfc-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.dcfc-metric { background: var(--dcfc-panel2); border: 1px solid var(--dcfc-border); border-radius: 8px; padding: 10px 12px; }
.dcfc-mlbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--dcfc-text2); margin-bottom: 4px; }
.dcfc-mval { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dcfc-mval.g { color: var(--dcfc-green); }

.dcfc-budget { margin-bottom: 14px; }
.dcfc-budget-bar { height: 10px; background: #161a24; border-radius: 999px; overflow: hidden; }
.dcfc-budget-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.dcfc-budget-fill.u { background: var(--dcfc-green); }
.dcfc-budget-fill.o { background: var(--dcfc-red); }
.dcfc-budget-note { margin-top: 6px; font-size: 12px; font-weight: 600; }
.dcfc-budget-note.u { color: var(--dcfc-green); }
.dcfc-budget-note.o { color: var(--dcfc-red); }

.dcfc-lines { border-top: 1px solid var(--dcfc-border); }
.dcfc-li { display: flex; justify-content: space-between; padding: 8px 2px; font-size: 13px; border-bottom: 1px solid var(--dcfc-border); }
.dcfc-li span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* topbar reuses .topbar; this just adds an address chip */
.dcfc-addr-chip { font-size: 13px; color: var(--dcfc-text2); padding: 4px 10px; background: var(--dcfc-panel2); border: 1px solid var(--dcfc-border); border-radius: 999px; }

.dcfc-field-text { align-items: flex-start; }
.dcfc-field-text input { width: 150px; text-align: left; }

/* ── build controls (wizard + palette + runs) ── */
.dcfc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 7px; border: 1px solid var(--dcfc-border); background: var(--dcfc-panel2); color: var(--dcfc-text); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.dcfc-btn:hover { border-color: var(--dcfc-gold); }
.dcfc-btn-gold { background: var(--dcfc-gold); color: #11141c; border-color: var(--dcfc-gold); }
.dcfc-btn-gold:hover { filter: brightness(1.08); }
.dcfc-btn-ghost { background: transparent; color: var(--dcfc-text2); }
.dcfc-btn-full { width: 100%; }

.dcfc-wiz-card { background: rgba(197,165,90,.08); border: 1px solid rgba(197,165,90,.35); border-radius: 8px; padding: 12px; margin-bottom: 6px; }
.dcfc-wiz-step { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--dcfc-gold); margin-bottom: 4px; }
.dcfc-wiz-instr { font-size: 13px; line-height: 1.5; color: var(--dcfc-text); margin-bottom: 10px; }
.dcfc-wiz-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* wizard step checklist */
.dcfc-wiz-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dcfc-wiz-li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dcfc-text2); padding: 2px 0; }
.dcfc-wiz-li.current { color: var(--dcfc-gold); font-weight: 600; }
.dcfc-wiz-num { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--dcfc-panel2); border: 1px solid var(--dcfc-border); color: var(--dcfc-text2); }
.dcfc-wiz-li.done .dcfc-wiz-num { background: var(--dcfc-green); color: #08120a; border-color: var(--dcfc-green); }
.dcfc-wiz-li.current .dcfc-wiz-num { background: rgba(197,165,90,.2); color: var(--dcfc-gold); border-color: var(--dcfc-gold); }

/* wizard inline picker (e.g. charger type) */
.dcfc-wiz-pick { display: flex; flex-direction: column; gap: 5px; margin: 0 0 10px; }
.dcfc-pick-btn { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 6px; border: 1px solid var(--dcfc-border); background: #161a24; color: var(--dcfc-text); font-size: 12px; cursor: pointer; text-align: left; transition: all .12s; }
.dcfc-pick-btn:hover { border-color: var(--dcfc-gold); }
.dcfc-pick-btn.active { border-color: var(--dcfc-gold); background: rgba(197,165,90,.18); color: var(--dcfc-gold); font-weight: 600; }
.dcfc-pick-btn img { width: 20px; height: 20px; flex-shrink: 0; object-fit: contain; }
/* L2 wizard group labels + trench-surface colour swatch */
.l2-wiz-sublabel { font-size: 11px; font-weight: 600; color: var(--dcfc-text2); margin: 6px 0 3px; }
.l2-wiz-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.25); }

/* publish & export panel (top-right dropdown, mirrors L2's publish panel) */
.dcfc-pub-panel { position: absolute; top: 56px; right: 16px; width: 322px; max-height: calc(100% - 76px); overflow-y: auto; background: var(--dcfc-panel); border: 1px solid var(--dcfc-border); border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.5); z-index: 40; }
.dcfc-pub-panel.hidden { display: none; }
.dcfc-pub-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 11px; border-bottom: 1px solid var(--dcfc-border); font-size: 13px; font-weight: 700; color: var(--dcfc-gold); }
.dcfc-pub-close { background: none; border: none; color: var(--dcfc-text2); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.dcfc-pub-close:hover { color: var(--dcfc-text); }
.dcfc-pub-section { padding: 12px 16px; border-bottom: 1px solid var(--dcfc-border); }
.dcfc-pub-section:last-child { border-bottom: none; }
.dcfc-pub-title { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--dcfc-text); margin-bottom: 6px; }
.dcfc-pub-desc { font-size: 11.5px; line-height: 1.45; color: var(--dcfc-text2); margin: 0 0 10px; }
.dcfc-pub-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--dcfc-text); margin-bottom: 10px; cursor: pointer; line-height: 1.4; }
.dcfc-pub-check input { accent-color: var(--dcfc-gold); margin-top: 1px; flex-shrink: 0; }

/* "under construction" toggle (e.g. super zoom) */
.dcfc-uc { opacity: .7; cursor: not-allowed; }
.dcfc-uc input { cursor: not-allowed; }
.dcfc-uc-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #f59e0b; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.4); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }

/* right-panel legend (under the cost estimate) */
.dcfc-legend { display: flex; flex-direction: column; gap: 3px; }
.dcfc-legend-empty { font-size: 12px; color: var(--dcfc-text2); line-height: 1.5; padding: 4px 0; }
.dcfc-legend-sub { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--dcfc-text2); margin: 8px 0 3px; }
.dcfc-legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--dcfc-border); }
.dcfc-legend-icon { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.dcfc-legend-swatch { width: 18px; height: 6px; border-radius: 2px; flex-shrink: 0; }
.dcfc-legend-name { flex: 1; color: var(--dcfc-text); }
.dcfc-legend-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--dcfc-gold); }
/* editable legend quantity (map-element counts) */
.dcfc-legend-qtywrap { display: inline-flex; align-items: center; gap: 2px; }
.dcfc-legend-qty { width: 44px; background: #161a24; border: 1px solid var(--dcfc-border); color: var(--dcfc-gold); border-radius: 5px; font-size: 12px; font-weight: 600; padding: 2px 5px; text-align: right; font-variant-numeric: tabular-nums; }
.dcfc-legend-qty:focus { outline: none; border-color: var(--dcfc-gold); }
.dcfc-legend-qty.ovr { border-color: var(--dcfc-gold); background: rgba(197,165,90,.1); }
.dcfc-legend-cnote { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.45; color: var(--dcfc-text2); padding: 4px 0; border-bottom: 1px solid var(--dcfc-border); }
.dcfc-legend-cnote strong { color: var(--dcfc-text); }
.dcfc-cnote-num { flex-shrink: 0; width: 17px; height: 17px; border-radius: 50%; background: #11141c; border: 1.5px solid var(--dcfc-gold); color: var(--dcfc-gold); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dcfc-legend-note { font-size: 10.5px; font-style: italic; color: #7fb8e6; margin: -1px 0 3px 24px; }

/* detailed cost estimate modal */
.dcfc-modal-backdrop { position: fixed; inset: 0; background: rgba(8,10,16,.62); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.dcfc-modal { width: 720px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column; background: var(--dcfc-panel); border: 1px solid var(--dcfc-border); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.6); overflow: hidden; }
.dcfc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--dcfc-border); font-size: 15px; font-weight: 700; color: var(--dcfc-gold); }
.dcfc-modal-x { background: none; border: none; color: var(--dcfc-text2); font-size: 24px; line-height: 1; cursor: pointer; }
.dcfc-modal-x:hover { color: var(--dcfc-text); }
.dcfc-modal-body { padding: 16px 20px 22px; overflow-y: auto; }
.dcfc-dc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dcfc-dc-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--dcfc-text2); padding: 6px 8px; border-bottom: 1px solid var(--dcfc-border); }
.dcfc-dc-table td { padding: 6px 8px; border-bottom: 1px solid var(--dcfc-border); color: var(--dcfc-text); }
.dcfc-dc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dcfc-dc-hint { font-size: 11.5px; color: var(--dcfc-text2); line-height: 1.45; margin: 0 0 12px; }
.dcfc-dc-editable td { padding: 4px 6px; }
.dcfc-dc-input { width: 92px; padding: 4px 6px; text-align: right; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--dcfc-text); background: rgba(255,255,255,.04); border: 1px solid var(--dcfc-border); border-radius: 6px; }
.dcfc-dc-input:focus { outline: none; border-color: var(--dcfc-gold); }
.dcfc-dc-input.ovr { color: var(--dcfc-gold); border-color: var(--dcfc-gold); background: rgba(212,175,55,.08); }
.dcfc-dc-input::-webkit-outer-spin-button, .dcfc-dc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dcfc-dc-input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.dcfc-dc-reset { visibility: hidden; margin-left: 6px; padding: 0 4px; background: none; border: none; color: var(--dcfc-gold); font-size: 13px; line-height: 1; cursor: pointer; vertical-align: middle; }
.dcfc-dc-table tr.edited .dcfc-dc-reset { visibility: visible; }
.dcfc-dc-reset:hover { color: var(--dcfc-text); }
.dcfc-dc-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.dcfc-dc-actions .dcfc-btn[disabled] { opacity: .45; cursor: default; }
.dcfc-dc-summary { margin-top: 16px; border-top: 2px solid var(--dcfc-border); padding-top: 10px; }
.dcfc-dc-sumrow { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 8px; color: var(--dcfc-text2); }
.dcfc-dc-sumrow span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--dcfc-text); }
.dcfc-dc-sumrow.g span:last-child { color: var(--dcfc-green); }
.dcfc-dc-sumrow.b { font-weight: 700; color: var(--dcfc-text); }
.dcfc-dc-sumrow.b span:last-child { color: var(--dcfc-gold); font-size: 15px; }

/* rail textareas (General Description, Notable Details, note editor) */
.dcfc-notes { width: 100%; min-height: 64px; background: #161a24; border: 1px solid var(--dcfc-border); color: var(--dcfc-text); border-radius: 6px; padding: 7px 9px; font-size: 12px; font-family: inherit; resize: vertical; margin-bottom: 8px; }
.dcfc-notes-lg { min-height: 96px; line-height: 1.45; }
.dcfc-notes:focus { outline: none; border-color: var(--dcfc-gold); }

/* selected-element transform panel */
#dcfcSelected:empty { display: none; }
.dcfc-sel-name { font-size: 13px; font-weight: 600; color: var(--dcfc-text); margin-bottom: 8px; }
.dcfc-slider { width: 100%; accent-color: var(--dcfc-gold); margin: 0 0 8px; }
.dcfc-sel-actions { display: flex; gap: 6px; margin-top: 4px; }

/* undo / redo row (top of the build controls) */
.dcfc-hist-row { display: flex; gap: 6px; margin-bottom: 10px; }
.dcfc-hist-btn { flex: 1; padding: 6px 8px; }
.dcfc-btn:disabled { opacity: .38; cursor: default; }
.dcfc-btn:disabled:hover { border-color: var(--dcfc-border); filter: none; }

.dcfc-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.dcfc-tool-btn { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--dcfc-border); background: var(--dcfc-panel2); color: var(--dcfc-text); font-size: 11.5px; cursor: pointer; text-align: left; transition: all .12s; }
.dcfc-tool-btn:hover { border-color: var(--dcfc-gold); }
.dcfc-tool-btn.active { border-color: var(--dcfc-gold); background: rgba(197,165,90,.15); color: var(--dcfc-gold); }
.dcfc-tool-btn img { width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; }
.dcfc-swatch { width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }

.dcfc-rail-hint { font-size: 11px; line-height: 1.45; color: var(--dcfc-text2); margin: 6px 0 10px; }

.dcfc-runs { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.dcfc-run-row { display: flex; align-items: center; gap: 6px; }
.dcfc-run-chip { font-size: 10px; font-weight: 700; color: #fff; padding: 2px 7px; border-radius: 999px; }
.dcfc-run-len { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--dcfc-text); min-width: 52px; }
.dcfc-run-surface { flex: 1; background: #161a24; border: 1px solid var(--dcfc-border); color: var(--dcfc-text); border-radius: 5px; font-size: 11px; padding: 3px 4px; }
.dcfc-run-del { background: none; border: none; color: var(--dcfc-red); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.dcfc-run-row[data-run-sel] { cursor: pointer; padding: 2px 3px; border-radius: 6px; }
.dcfc-run-row.sel { outline: 1px solid var(--dcfc-gold); background: rgba(197,165,90,.12); }

/* read-only "from the map" derived quantities */
.dcfc-derived .dcfc-li { font-size: 12px; padding: 6px 2px; color: var(--dcfc-text2); }
.dcfc-derived .dcfc-li span:last-child { color: var(--dcfc-gold); }

/* multi-site tab bar (inside #dcfcScreen, above the layout) */
.dcfc-site-bar { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--dcfc-panel); border-bottom: 1px solid var(--dcfc-border); overflow-x: auto; flex-shrink: 0; }
.dcfc-site-tab { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--dcfc-border); border-radius: 999px; background: var(--dcfc-panel2); color: var(--dcfc-text2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .12s; }
.dcfc-site-tab:hover { border-color: var(--dcfc-gold); color: var(--dcfc-text); }
.dcfc-site-tab.active { border-color: var(--dcfc-gold); background: rgba(197,165,90,.15); color: var(--dcfc-gold); }
.dcfc-site-x { color: var(--dcfc-text2); font-size: 14px; line-height: 1; padding: 0 1px; border-radius: 3px; }
.dcfc-site-x:hover { color: var(--dcfc-red); }
.dcfc-site-add { padding: 5px 12px; border: 1px dashed var(--dcfc-border); border-radius: 999px; background: transparent; color: var(--dcfc-text2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .12s; }
.dcfc-site-add:hover { border-color: var(--dcfc-gold); color: var(--dcfc-gold); }

/* sandbox banner (inside #dcfcScreen) */
.dcfc-sandbox-banner { display: none; align-items: center; gap: 12px; padding: 8px 16px; background: rgba(245,158,11,.14); border-bottom: 1px solid rgba(245,158,11,.4); color: #f3d28a; font-size: 13px; }
.dcfc-sb-tag { font-weight: 800; letter-spacing: 1px; color: #f59e0b; }
.dcfc-sb-addr { font-weight: 600; color: var(--dcfc-text); }
.dcfc-sb-desc { color: var(--dcfc-text2); }
.dcfc-sandbox-banner .dcfc-btn { padding: 5px 10px; font-size: 12px; }

/* My Projects tabs — theme-agnostic (reads on light or dark) */
.nav-tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid rgba(128,128,128,.25); }
.nav-tab { background: none; border: none; border-bottom: 2px solid transparent; color: #8a8f9a; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: -1px; transition: color .15s; }
.nav-tab:hover { color: var(--dcfc-gold); }
.nav-tab.active { color: var(--dcfc-gold); border-bottom-color: var(--dcfc-gold); }

@media (max-width: 900px) {
  .dcfc-layout { flex-direction: column; }
  .dcfc-rail, .dcfc-panel { width: 100%; max-height: 240px; }
  .dcfc-map-wrap { min-height: 320px; }
}
