/* Solar PV string sizing — on top of calc.css */
main.pv .tabs { grid-template-columns: repeat(3, 1fr); }
main.pv .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.pv .stage-bar .hist { margin-left: auto; }
main.pv .stage-bar .seg { flex: 0 0 auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .handle.hx { cursor: ew-resize; }
#view .handle.hy { cursor: ns-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* ground, water, shield */
.pv-surf { stroke: var(--soil-ink); stroke-width: 1.4; }
.pv-lay { stroke: var(--soil-line); stroke-width: .9; stroke-dasharray: 7 4; }
.pv-brk { fill: none; stroke: var(--steel-550); stroke-width: 1; }
.pv-river { fill: var(--x-dbe8f3, #dbe8f3); }
.pv-wt { stroke: var(--water-line); stroke-width: 1.2; }
.pv-wtri { fill: none; stroke: var(--water-line); stroke-width: 1.2; }
.pv-shield { fill: var(--steel-200); stroke: var(--steel-800); stroke-width: 1.2; }
.pv-bulk { stroke: var(--steel-800); stroke-width: 2.4; }
.pv-head { stroke: var(--steel-800); stroke-width: 3.2; stroke-dasharray: 10 3; }
.pv-axis { stroke: var(--steel-550); stroke-width: .7; stroke-dasharray: 9 3 1.5 3; fill: none; pointer-events: none; }
.pv-wedge { fill: color-mix(in srgb, var(--load) 12%, transparent); stroke: var(--load); stroke-width: 1.4; stroke-linejoin: round; }
.pv-prism { fill: none; stroke: var(--load); stroke-width: 1; stroke-dasharray: 5 3; }
.pv-arc { fill: none; stroke: var(--steel-550); stroke-width: 1; }
.pv-pop { fill: color-mix(in srgb, var(--load) 14%, transparent); stroke: var(--load); stroke-width: 1.5; stroke-linejoin: round; }
.pv-pmin { fill: none; stroke: var(--bad); stroke-width: 1.4; stroke-dasharray: 5 3; }
.pv-pmax { stroke: var(--steel-800); stroke-width: 2; }
.pv-pw { fill: none; stroke: var(--water-line); stroke-width: 1.4; stroke-dasharray: 2 2.5; }
.pv-qline { stroke: var(--load); stroke-width: 1; }
.pv-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.pv-dimh { fill: var(--steel-550); }
.pv-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.pv-load line { stroke: var(--load); stroke-width: 1.8; fill: none; }
.pv-load path.hd { fill: var(--load); stroke: none; }
.pv-load.pv-thin line { stroke-width: 1.3; }
.pv-load.pv-grey line { stroke: var(--steel-550); } .pv-load.pv-grey path.hd { fill: var(--steel-550); }
.pv-shear line { stroke: var(--x-b08b6c, #b08b6c); stroke-width: 1.1; } .pv-shear path.hd { fill: var(--x-b08b6c, #b08b6c); }
.pv-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.pv-role { font-size: 11px; fill: var(--text-3); }
.pv-nm { cursor: text; }
.pv-nm:hover .pv-name, .pv-nm:focus .pv-name { fill: var(--sel); }
.pv-nm:focus { outline: none; }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.dimv rect { stroke: var(--steel-200); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load-ink); font-weight: 600; }
#view .pill.minp rect { stroke: color-mix(in srgb, var(--bad) 40%, transparent); } #view .pill.minp text { fill: var(--bad-ink); font-weight: 600; }
#view .pill.maxp rect { stroke: color-mix(in srgb, var(--steel-800) 40%, transparent); } #view .pill.maxp text { fill: var(--steel-800); font-weight: 600; }
#view .pill.water rect { stroke: color-mix(in srgb, var(--water-line) 45%, transparent); } #view .pill.water text { fill: var(--water-ink); font-weight: 600; }
#view .pill.desig rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.desig text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.pv-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.pv-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.pv-edit-name input { width: 180px; text-align: center; }
.pv-edit span { font-size: 11.5px; color: var(--text-3); }
@media print { .pv-edit { display: none !important; } }

/* live strip and flags */
.pv-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 38px; align-items: center; }
.pv-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.pv-live i { font-style: normal; color: var(--text-3); }
.pv-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pv-flags span { font-size: 11.5px; color: var(--warn-ink); border: 1px solid var(--line); background: var(--warn-bg); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }

/* panel */
.pv-seg { margin-bottom: 6px; }
.pv-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 2px; cursor: pointer; }
.pv-check input { margin: 0; }
.pv-layer { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.pv-layer:last-of-type { border-bottom: 0; }
.pv-lh { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.pv-lname { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: text; text-align: left; }
.pv-lname:hover { color: var(--sel); }
.pv-lname-in { font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid var(--sel); border-radius: 6px; padding: 2px 6px; width: 180px; }
.pv-lsub { font-size: 11.5px; color: var(--text-3); }
.pv-del { margin-left: auto; font-size: 12px; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel .btn.small { font-size: 12.5px; padding: 5px 10px; }

/* summary */
.pv-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.pv-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }

/* charts */
.pv-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fb-chart .wdrag { cursor: ew-resize; }
.fb-chart { touch-action: none; user-select: none; }
@media (max-width: 1100px) { .pv-two { grid-template-columns: minmax(0, 1fr); } }

#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
/* phones: the margins as stacked cards (no sideways scroll) */
@media (max-width: 760px) {
  #checks thead { display: none; }
  #checks, #checks tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "required "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "provided "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
}

/* the array, the inverter, tilt and compass */
.pv-str { fill: none; stroke-width: 1.2; }
.pv-mod rect { fill: var(--x-dfe7f0, #dfe7f0); stroke: var(--x-9fb0c4, #9fb0c4); stroke-width: .6; }
.pv-cell { fill: none; stroke: var(--x-c3cfdc, #c3cfdc); stroke-width: .6; pointer-events: none; }
.pv-wire { fill: none; stroke-width: 1.2; stroke-linejoin: round; opacity: .85; }
.pv-port { stroke: var(--halo); stroke-width: 1; }
.pv-inv { fill: var(--steel-100); stroke: var(--steel-800); stroke-width: 1.2; }
.pv-sine { fill: none; stroke: var(--steel-800); stroke-width: 1.2; }
.pv-ac { fill: none; stroke: var(--steel-800); stroke-width: 1.4; }
.pv-iname { font-size: 12px; font-weight: 600; fill: var(--text); }
.pv-gl { font-size: 11px; font-weight: 600; }
.pv-ground { stroke: var(--soil-ink); stroke-width: 1.2; }
.pv-panel { stroke: var(--moment); stroke-width: 4; stroke-linecap: round; fill: none; }
.pv-rack { stroke: var(--steel-550); stroke-width: 1.4; fill: none; }
.pv-arc { fill: none; stroke: var(--steel-550); stroke-width: 1; }
.pv-comp { fill: var(--surface-2); stroke: var(--steel-400); stroke-width: 1; }
.pv-tick { stroke: var(--steel-550); stroke-width: 1; }
.pv-cl { font-size: 11px; font-weight: 600; fill: var(--text-3); }
.pv-needle { stroke: var(--moment); stroke-width: 2; }
#view .handle.hr { cursor: grab; }
#view .pill.volt rect { stroke: color-mix(in srgb, var(--steel-800) 40%, transparent); } #view .pill.volt text { fill: var(--steel-800); font-weight: 600; }
#view .pill.bad rect { stroke: color-mix(in srgb, var(--bad) 50%, transparent); } #view .pill.bad text { fill: var(--bad-ink); font-weight: 600; }
#view g[data-tab] { cursor: pointer; }
.pv-name { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--sel); cursor: text; text-align: right; margin-left: auto; }
.pv-name-in { font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid var(--sel); border-radius: 6px; padding: 2px 6px; width: 190px; margin-left: auto; }
.fb-chart .cdrag { cursor: ew-resize; }
.pv-two .fb-chart { touch-action: none; user-select: none; }
.pv-more { font-size: 11.5px; fill: var(--text-3); }

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-1e4fbf: #749ff5; --x-3d8a95: #79b5be; --x-6e7177: #85827f; --x-8a531c: #cb996f; --x-8a5a9e: #c39ad5;
    --x-9fb0c4: #495664; --x-a2475e: #df8d9e; --x-b0702a: #dea772; --x-b08b6c: #a98b72; --x-c3cfdc: #384049;
    --x-dbe8f3: #293138; --x-dfe7f0: #2b3036;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-3d8a95: #79b5be; --x-6e7177: #85827f; --x-8a531c: #cb996f; --x-8a5a9e: #c39ad5;
    --x-9fb0c4: #495664; --x-a2475e: #df8d9e; --x-b0702a: #dea772; --x-b08b6c: #a98b72; --x-c3cfdc: #384049;
    --x-dbe8f3: #293138; --x-dfe7f0: #2b3036;
  }
}
/* theme-auto:end */
