/* Customer editor only: existing record fields and handlers stay authoritative. */
#customerModal { --ce-bg:#fff; --ce-soft:#f6f8fa; --ce-text:#243b50; --ce-muted:#6f8191; --ce-line:#dce5eb; --ce-accent:#478b3c; --ce-accent-bg:#edf5e9; --ce-input:#fff; --ow-field-muted:#6f8191; padding:24px; background:#10223680; backdrop-filter:blur(3px); }
#customerModal[hidden],#customerModal [hidden] { display:none !important; }
#customerModal>.dialog { display:flex; flex-direction:column; width:min(1120px,100%); height:min(940px,94dvh); max-height:94dvh; min-height:0; overflow:hidden !important; border:1px solid var(--ce-line); border-radius:16px; background:var(--ce-bg); color:var(--ce-text); box-shadow:0 24px 90px #0b1d3340; }
#customerModal .dialog-head { flex-shrink:0; align-items:flex-start; gap:20px; padding:24px 28px 20px; background:var(--ce-bg); border-color:var(--ce-line); }
#customerModal .dialog-head h3 { color:var(--ce-text); margin:3px 0 6px; font-size:23px; line-height:1.3; font-weight:650; letter-spacing:-.035em; }
#customerModal .ow-ce-eyebrow { font-size:10px; font-weight:600; color:var(--ce-muted); text-transform:uppercase; letter-spacing:.08em; }
#customerModal .ow-ce-subtitle { margin:0; color:var(--ce-muted); font-size:12px; overflow-wrap:anywhere; }
#customerModal .ow-ce-close { width:34px; min-height:34px; padding:0; border-radius:8px; font-size:24px; line-height:1; flex-shrink:0; color:var(--ce-muted); }
#customerModal form { display:flex; flex:1; flex-direction:column; min-height:0; overflow:hidden; }
#customerModal .ow-ce-tabs { display:flex; flex-shrink:0; gap:6px; padding:12px 28px; border-bottom:1px solid var(--ce-line); background:var(--ce-bg); }
#customerModal .ow-ce-tabs>button { display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid transparent; border-radius:8px; padding:10px 14px; background:transparent; color:var(--ce-muted); font:500 12px/20px Inter,sans-serif; cursor:pointer; }
#customerModal .ow-ce-tabs>button[aria-selected="true"] { color:var(--ce-accent); background:var(--ce-accent-bg); border-color:color-mix(in srgb,var(--ce-accent) 24%,transparent); }
#customerModal .ow-ce-tabs svg { width:16px; height:16px; flex-shrink:0; }
#customerModal .dialog-body { flex:1; min-height:0; overflow:auto !important; overscroll-behavior:contain; scrollbar-gutter:stable; padding:24px 28px 28px; background:var(--ce-soft); }
#customerModal .ow-ce-pane { min-width:0; }
#customerModal .ow-ce-section { background:var(--ce-bg); border:1px solid var(--ce-line); border-radius:12px; padding:22px; margin:0 0 18px; min-width:0; }
#customerModal .ow-ce-section:last-child { margin-bottom:0; }
#customerModal .ow-ce-section-title { margin:0 0 18px; }
#customerModal .ow-ce-section-title h4 { font-size:14px; font-weight:600; color:var(--ce-text); margin:0 0 5px; }
#customerModal .ow-ce-section-title p,#customerModal .ow-ce-hint { font-size:11px; line-height:1.6; color:var(--ce-muted); margin:0; }
#customerModal .ow-ce-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:18px 20px; min-width:0; }
#customerModal .ow-ce-grid.ow-ce-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
#customerModal .form-group { display:flex; flex-direction:column; min-width:0; margin:0; }
#customerModal .form-group>label { display:block; min-height:var(--ow-label-height,18px); margin:0 0 7px; color:var(--ce-muted); font-size:12px; font-weight:500; line-height:18px; letter-spacing:0; text-transform:none; }
#customerModal .form-group :is(input:not([type="hidden"]),select,.ow-date-trigger,.ow-select-trigger) { width:100%; height:44px; min-height:44px; box-sizing:border-box; margin:0; padding:0 12px; border:1px solid var(--ce-line); border-radius:8px; background:var(--ce-input); color:var(--ce-text); font:400 13px/20px Inter,sans-serif; outline:0; box-shadow:none; }
#customerModal .form-group textarea { width:100%; min-height:100px; padding:11px 12px; border:1px solid var(--ce-line); border-radius:8px; background:var(--ce-input); color:var(--ce-text); font:400 13px/1.6 Inter,sans-serif; resize:none; outline:0; }
#customerModal .form-group :is(.ow-select-trigger,.ow-date-trigger) { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; text-align:left; }
#customerModal .ow-date-trigger svg { width:17px; height:17px; flex-shrink:0; color:var(--ce-muted); }
#customerModal .form-group :is(input,textarea,.ow-select-trigger,.ow-date-trigger):focus-visible { border-color:var(--ce-accent); outline:2px solid color-mix(in srgb,var(--ce-accent) 28%,transparent); outline-offset:2px; }
#customerModal :is(button,summary):focus-visible { outline:2px solid var(--ce-accent); outline-offset:3px; }
#customerModal .form-group :is(.ow-date-trigger,.ow-select-trigger):hover { border-color:var(--ce-accent); }
#customerModal :is(.ow-date-trigger.is-empty,.ow-select-trigger.is-placeholder) { color:var(--ce-muted); }
#customerModal .ow-date-source { display:none !important; }
#customerModal .interval-hint,#customerModal .v135-sim-annual { font-size:10px; margin-top:6px; line-height:1.5; color:var(--ce-muted); }
#customerModal .ow-ce-span { grid-column:1/-1; }
#customerModal .ow-ce-site-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; margin-bottom:18px; }
#customerModal .ow-ce-site-toolbar h4 { margin:0 0 5px; font-size:16px; font-weight:600; }
#customerModal .ow-ce-site-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
#customerModal .btn { min-height:38px; border-radius:8px; border-color:var(--ce-line); background:var(--ce-bg); color:var(--ce-text); font-size:12px; font-weight:500; }
#customerModal .btn.primary { background:#478b3c; border-color:#478b3c; color:#fff; font-weight:600; }
#customerModal .btn.danger { background:transparent; color:#b94752; border-color:transparent; padding:6px 9px; }
#customerModal .btn.danger:hover { background:#ba455b0b; border-color:#d478821f; }
#customerModal .ow-ce-link { border:0; background:none; color:var(--ce-muted); font:500 11px/20px Inter,sans-serif; padding:6px; cursor:pointer; }
#customerModal .site-box { margin:0 0 16px; padding:0; border:1px solid var(--ce-line); border-radius:12px; background:var(--ce-bg); overflow:clip; }
#customerModal .site-head { margin:0; padding:16px 18px; gap:10px; align-items:center; }
#customerModal .ow-ce-toggle { display:flex; align-items:center; gap:12px; width:100%; min-width:0; padding:0; border:0; background:transparent; color:var(--ce-text); font:inherit; text-align:left; cursor:pointer; }
#customerModal .ow-ce-toggle-copy { min-width:0; flex:1; }
#customerModal .ow-ce-toggle-copy>b { display:block; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
#customerModal .ow-ce-toggle-copy>small { display:block; margin-top:5px; color:var(--ce-muted); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
#customerModal .ow-ce-marker { display:grid; place-items:center; width:34px; height:34px; flex-shrink:0; border:1px solid var(--ce-line); background:var(--ce-soft); border-radius:9px; color:var(--ce-muted); font-size:11px; font-weight:600; }
#customerModal .ow-ce-chevron { width:16px; height:16px; flex-shrink:0; color:var(--ce-muted); transition:transform .15s; }
#customerModal .ow-ce-toggle[aria-expanded="true"] .ow-ce-chevron { transform:rotate(180deg); }
#customerModal .ow-ce-site-body { padding:20px; border-top:1px solid var(--ce-line); }
#customerModal .site-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 20px; margin-bottom:24px; }
#customerModal .ow-ce-systems-label { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:14px; font-size:12px; font-weight:600; }
#customerModal .ow-ce-systems-label>small { margin-right:auto; color:var(--ce-muted); font-weight:400; }
#customerModal .systems { display:grid; gap:14px; }
#customerModal .system-row { display:block; min-width:0; margin:0; padding:0; border:1px solid var(--ce-line); border-radius:10px; background:var(--ce-bg); }
#customerModal .ow-ce-system-head { display:flex; align-items:center; gap:10px; padding:14px 16px; background:var(--ce-soft); border-radius:10px; }
#customerModal .ow-ce-system-head .ow-ce-toggle-copy>b { font-size:13px; }
#customerModal .ow-ce-system-head .ow-ce-marker { background:var(--ce-bg); width:29px; height:29px; border-radius:7px; }
#customerModal .ow-ce-system-body { padding:20px; border-top:1px solid var(--ce-line); }
#customerModal .ow-ce-subsection+.ow-ce-subsection { border-top:1px solid var(--ce-line); margin-top:22px; padding-top:20px; }
#customerModal .ow-ce-subsection h5 { color:var(--ce-text); font-size:12px; font-weight:600; margin:0 0 16px; }
#customerModal .ow-ce-monitor-fields { margin-top:18px; }
#customerModal .ow-ce-monitor-note { margin-top:10px; }
#customerModal .ow-ce-assets { margin-top:22px; border-top:1px solid var(--ce-line); }
#customerModal .ow-ce-assets>summary,#customerModal .ow-ce-closure>summary { display:flex; align-items:center; gap:10px; list-style:none; padding:17px 0 0; font-size:12px; font-weight:600; cursor:pointer; color:var(--ce-text); }
#customerModal summary::-webkit-details-marker { display:none; }
#customerModal summary::after { content:'+'; margin-left:auto; font-size:17px; color:var(--ce-muted); }
#customerModal details[open]>summary::after { content:'−'; }
#customerModal summary>small { color:var(--ce-muted); font-weight:400; font-size:10px; }
#customerModal .ow-ce-assets>.ow-ce-grid { padding-top:18px; }
#customerModal .ow-ce-closure { background:var(--ce-bg); border:1px solid var(--ce-line); border-radius:12px; padding:0 22px 20px; }
#customerModal .ow-ce-closure .panel { border:0; box-shadow:none; padding:0; background:transparent; margin:0 !important; overflow:visible; }
#customerModal .ow-ce-closure .panel>b { display:none; }
#customerModal .ow-ce-closure .form-grid { margin-top:18px !important; }
#customerModal .ow-ce-empty { padding:30px; border:1px dashed var(--ce-line); border-radius:10px; color:var(--ce-muted); text-align:center; font-size:12px; }
#customerModal .ow-ce-site-add { margin:0 !important; }
#customerModal .ow-ce-site-remove { flex-shrink:0; }
#customerModal .dialog-foot { flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 28px; background:var(--ce-bg); border-color:var(--ce-line); }
#customerModal .ow-ce-save-note { font-size:11px; color:var(--ce-muted); }
#customerModal .ow-ce-footer-actions { display:flex; gap:8px; flex-shrink:0; }
#customerModal .dialog-foot .btn { min-height:42px; padding-inline:18px; }
@media screen {
  html[data-ow-theme="dark"] #customerModal { --ce-bg:#192431; --ce-soft:#131e2a; --ce-text:#e5ecf4; --ce-muted:#a5b4c5; --ce-line:#35475a; --ce-accent:#a5d496; --ce-accent-bg:#2c4034; --ce-input:#121c28; --ow-field-muted:#a5b4c5; }
  html[data-ow-theme="dark"] #customerModal .btn.danger { color:#f3a4af; }
}
@media(max-width:1000px) { #customerModal .ow-ce-grid.ow-ce-three { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) {
  #customerModal { padding:10px; }
  #customerModal>.dialog { height:calc(100dvh - 20px); max-height:calc(100dvh - 20px); border-radius:12px; }
  #customerModal .dialog-head { padding:18px; }
  #customerModal .dialog-head h3 { font-size:21px; }
  #customerModal .ow-ce-tabs { gap:4px; padding:10px 12px; }
  #customerModal .ow-ce-tabs>button { flex:1; padding:9px 5px; font-size:11px; gap:5px; }
  #customerModal .ow-ce-tabs svg { display:none; }
  #customerModal .dialog-body { padding:16px 12px 22px; }
  #customerModal .ow-ce-section { padding:17px; }
  #customerModal .ow-ce-grid,#customerModal .ow-ce-grid.ow-ce-three,#customerModal .site-fields { grid-template-columns:minmax(0,1fr); gap:16px; }
  #customerModal .form-group :is(input:not([type="hidden"]),select,.ow-date-trigger,.ow-select-trigger) { font-size:16px; height:46px; min-height:46px; }
  #customerModal .form-group textarea { font-size:16px; }
  #customerModal .ow-ce-site-body { padding:15px 12px; }
  #customerModal .site-head { padding:14px 12px; align-items:flex-start; }
  #customerModal .ow-ce-system-head { padding:13px 12px; align-items:flex-start; }
  #customerModal .ow-ce-system-body { padding:16px 12px; }
  #customerModal .ow-ce-marker { display:none; }
  #customerModal .ow-ce-toggle { gap:6px; }
  #customerModal .ow-ce-toggle-copy>small { font-size:10px; }
  #customerModal .btn.danger { min-height:34px; font-size:10px; padding-inline:5px; }
  #customerModal .dialog-foot { flex-wrap:wrap; padding:12px 16px; gap:10px; }
  #customerModal .ow-ce-footer-actions { width:100%; justify-content:flex-end; }
  #customerModal .ow-ce-closure { padding-inline:17px; }
}
@media(prefers-reduced-motion:reduce) { #customerModal .ow-ce-chevron { transition:none; } }
