:root {
  --navy: #102c51;
  --blue: #2463eb;
  --ink: #1e3049;
  --muted: #6b7d94;
  --line: #dfe7f0;
  --bg: #f3f6fa;
  --green: #18a58a;
  --amber: #d49445;
  --red: #d34e60;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.5 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 10px 17px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: #e9eff8;
  color: var(--navy);
}
button.danger {
  background: #fae9ec;
  color: #aa273c;
}
button.small {
  padding: 6px 10px;
  font-size: 12px;
}
a {
  color: var(--blue);
}
h1 {
  font-size: 23px;
  margin: 0 0 6px;
}
h2 {
  font-size: 17px;
  margin: 0 0 15px;
}
h3 {
  font-size: 15px;
}
p {
  margin: 8px 0 16px;
}
.muted,
small {
  color: var(--muted);
}
.loading {
  padding: 60px;
  text-align: center;
}
.auth {
  max-width: 440px;
  margin: 6vh auto;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 16px #16355b04;
  margin-bottom: 18px;
}
.brandmark {
  font-size: 30px;
  color: #f4b84f;
}
.auth h1 {
  margin-top: 12px;
}
.tabs,
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.tabs button {
  flex: 1;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #53657c;
  margin: 0 0 14px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  background: white;
  border: 1px solid #ccd7e5;
  border-radius: 7px;
  color: var(--ink);
  padding: 10px;
  margin-top: 5px;
  min-height: 42px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #c5d9ff;
  border-color: var(--blue);
}
input[type="checkbox"] {
  display: inline;
  width: 17px;
  min-height: 17px;
  vertical-align: middle;
  margin: 0 7px 0 0;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.full {
  grid-column: 1/-1;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 225px;
  background: var(--navy);
  color: #fff;
  padding: 25px 15px;
  z-index: 30;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 27px;
}
.brand strong {
  font-size: 22px;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  color: #a7bbd3;
  font-size: 10px;
}
.nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #b9cce2;
  border-radius: 8px;
  margin: 3px 0;
  padding: 11px 14px;
}
.nav button.active {
  background: #ffffff19;
  color: white;
}
.portal-tag {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #85a3c5;
  padding: 14px 12px;
}
.workspace {
  margin-left: 225px;
}
.topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  gap: 12px;
}
.topbar small {
  display: block;
}
.menu-toggle {
  display: none;
}
.main {
  padding: 28px 32px;
  max-width: 1550px;
  margin: auto;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 23px;
  gap: 15px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  margin-bottom: 5px;
}
.chartgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metric {
  text-align: center;
  padding: 20px 12px;
  cursor: pointer;
}
.ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: conic-gradient(var(--color) calc(var(--pct) * 1%), #e5e9ee 0);
  display: grid;
  place-items: center;
  position: relative;
}
.ring:before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: white;
}
.ring span {
  z-index: 1;
  border: 6px solid white;
  border-radius: 50%;
  width: 76px;
  height: 76px;
  background: var(--color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 23px;
  font-weight: 600;
}
.ring span small {
  font-size: 9px;
  color: white;
  font-weight: 400;
}
.metric h3 {
  margin: 4px 0;
}
.tablewrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: #f6f8fb;
}
td,
th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td .actions {
  margin: 0;
  flex-wrap: nowrap;
}
.badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 20px;
  background: #eaf0fd;
  color: #3261a3;
  display: inline-block;
  white-space: nowrap;
}
.badge.closed,
.badge.live,
.badge.completed {
  background: #e4f6ef;
  color: #13865e;
}
.badge.blocked,
.badge.rejected {
  background: #ffeaee;
  color: #b23d4b;
}
.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  z-index: 200;
  background: var(--navy);
  color: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 30px #0002;
  display: none;
}
#toast.error {
  background: #a33343;
}
.error {
  color: #b22d42;
}
.photo {
  border: 1px dashed #cbd7e5;
  padding: 12px;
  border-radius: 8px;
  margin: 8px 0;
}
.photo label {
  margin: 0;
}
.photo input {
  font-size: 11px;
  padding: 7px;
}
.preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
}
.evidencegrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.evidencegrid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}
.stepper {
  display: flex;
  gap: 0;
  padding: 22px 0;
  overflow-x: auto;
}
.step {
  flex: 1;
  min-width: 95px;
  text-align: center;
  position: relative;
  background: none;
  color: var(--muted);
  font-size: 11px;
  padding: 0 5px;
  border-radius: 0;
}
.step:before {
  content: "";
  height: 3px;
  background: #dbe4f4;
  position: absolute;
  top: 17px;
  left: 0;
  right: 0;
}
.step:first-child:before {
  left: 50%;
}
.step:last-child:before {
  right: 50%;
}
.step i {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid #c1cfe5;
  background: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  font-style: normal;
}
.step.done:before,
.step.current:before {
  background: var(--blue);
}
.step.done i,
.step.current i {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.step.current i {
  animation: pulse 2s infinite;
}
.step small {
  display: block;
  font-size: 9px;
}
.milestone-details {
  padding: 15px;
  background: #f3f7fd;
  border-radius: 8px;
}
.layout-shell {
  display: grid;
  grid-template-columns: 1fr 125px;
  gap: 12px;
}
.layout-canvas {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  width: 100%;
  touch-action: none;
  min-height: 250px;
}
.layout-tools button {
  display: block;
  width: 100%;
  margin-bottom: 7px;
  font-size: 11px;
  padding: 8px;
}
.layout-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.layout-controls label {
  flex: 1;
  min-width: 100px;
}
.layout-controls input {
  padding: 0;
}
.layout-canvas text {
  user-select: none;
  pointer-events: none;
}
.modal {
  position: fixed;
  inset: 0;
  background: #102c5188;
  z-index: 70;
  overflow: auto;
  padding: 25px;
}
.modal > .card {
  max-width: 950px;
  margin: 0 auto;
}
.checkrow {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.checkrow select {
  max-width: 160px;
}
.report-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.report-options label {
  font-weight: 400;
}
.notice {
  padding: 12px 15px;
  background: #edf4ff;
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  margin: 10px 0 18px;
}
.mobile-only {
  display: none;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px #2463eb20;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
@media (max-width: 1100px) {
  .chartgrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main {
    padding: 22px;
  }
  .sidebar {
    width: 205px;
  }
  .workspace {
    margin-left: 205px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 240px;
    box-shadow: 8px 0 40px #0003;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    margin-left: 0;
  }
  .topbar {
    height: 62px;
    padding: 0 15px;
    font-size: 12px;
  }
  .menu-toggle {
    display: block;
    padding: 6px 10px;
  }
  .main {
    padding: 18px 12px;
  }
  .card {
    padding: 17px;
    border-radius: 11px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .chartgrid {
    gap: 10px;
  }
  .metric {
    padding: 16px 8px;
  }
  .metric h3 {
    font-size: 12px;
  }
  .ring {
    width: 100px;
    height: 100px;
  }
  .ring span {
    width: 67px;
    height: 67px;
    font-size: 20px;
  }
  .auth {
    margin: 25px 12px;
    max-width: none;
  }
  .pagehead {
    align-items: flex-start;
  }
  .pagehead h1 {
    font-size: 21px;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .evidencegrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stepper {
    display: block;
  }
  .step {
    display: flex;
    width: 100%;
    text-align: left;
    align-items: center;
    gap: 13px;
    min-height: 65px;
  }
  .step i {
    margin: 0 0 0 7px;
    flex-shrink: 0;
  }
  .step:before,
  .step:first-child:before,
  .step:last-child:before {
    left: 24px;
    top: 0;
    bottom: 0;
    width: 3px;
    height: auto;
    right: auto;
  }
  .step:first-child:before {
    top: 30px;
  }
  .step:last-child:before {
    bottom: 30px;
  }
  .step small {
    margin-left: auto;
  }
  .modal {
    padding: 8px;
  }
  .layout-shell {
    grid-template-columns: 1fr 85px;
  }
  .layout-tools button {
    font-size: 9px;
    padding: 7px 3px;
  }
  #toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .report-options {
    gap: 8px;
  }
  .actions button {
    font-size: 12px;
  }
}
@media (max-width: 340px) {
  .chartgrid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .sidebar,
  .topbar,
  .no-print,
  button,
  #toast,
  .modal {
    display: none !important;
  }
  .workspace {
    margin: 0;
  }
  .main {
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 0;
  }
  .tablewrap {
    overflow: visible;
  }
  body {
    background: white;
  }
  .evidencegrid img {
    height: auto;
    max-height: 350px;
    object-fit: contain;
  }
  tr,
  img,
  svg {
    break-inside: avoid;
  }
}
/* SMS 0.2: targeted overrides; existing module styles retained. */
.tablewrap {overflow:auto; max-height:580px; overscroll-behavior:contain; scrollbar-gutter:stable;}
.tablewrap thead, .tablewrap tr:first-child:has(th) {position:sticky;top:0;z-index:2;background:#edf3fb;}
.tablewrap td {overflow-wrap:anywhere;}
.new-tag{background:#d9f8e8;color:#126043;font-weight:700;}
.badge.draft,.badge.correction{background:#fff0cc;color:#805700;}
body[data-portal="rgo"] .auth {border-top:6px solid #128977;background:linear-gradient(160deg,#effbf8,#fff 55%);}
body[data-portal="power"] .auth {border-top:6px solid #2463eb;}
.auth .tabs button {font-size:13px;}
.power-overview {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(300px,1fr);gap:22px;align-items:start;}
.power-overview .chartgrid {grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.power-overview .metric {padding:18px 8px;min-width:0;}
.power-overview .ring{width:108px;height:108px;}
.site-map {width:100%;max-height:620px;display:block;background:#f5fbff;border-radius:16px;}
.map-land{fill:#238aa6;stroke:white;stroke-width:.8;}
.map-pin{stroke:#fff;stroke-width:1.5;cursor:pointer;animation:map-pulse 2.8s ease-in-out infinite;}
.map-pin.installed{fill:#28d46d}.map-pin.proposed{fill:#f6bd24}
@keyframes map-pulse{50%{opacity:.45;stroke-width:3}}
.map-toggle{display:flex;align-items:center;justify-content:center;gap:10px;margin:12px 0;}
.map-toggle input{width:auto;accent-color:#2463eb;}
.drawing-modal {padding:0;z-index:1200;align-items:stretch;}
.drawing-modal > .card {width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border-radius:0;display:flex;flex-direction:column;overflow:auto;padding:12px;}
.drawing-modal [data-editor]{flex:1;min-height:0;display:flex;flex-direction:column;}
.drawing-modal .layout-shell {display:flex;flex-direction:column-reverse;flex:1;min-height:160px;}
.drawing-modal .layout-tools {display:flex;flex-wrap:wrap;gap:5px;}
.drawing-modal .layout-tools button{padding:8px 12px;min-height:40px;}
.drawing-modal .layout-canvas {width:100%;height:100%;min-height:170px;max-height:none;flex:1;touch-action:none;}
.drawing-modal .layout-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;}
.drawing-modal .layout-controls label{min-width:120px;flex:1;}
.drawing-modal [data-final]{background:#059b56;align-self:flex-end;min-width:150px;}
.drawing-modal p.muted{margin:3px 0;font-size:11px;}
.step.done:after {background:linear-gradient(90deg,#2463eb,#8bb3ff,#2463eb);background-size:200% 100%;animation:progress-flow 3s linear infinite;}
@keyframes progress-flow {to{background-position:-200% 0}}
.notification-summary{margin-left:12px;}
.report-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;}
@media(max-width:1100px){.power-overview{grid-template-columns:1fr}.power-overview .chartgrid{grid-template-columns:repeat(3,minmax(0,1fr));}.map-card{max-width:600px;width:100%;margin:auto;}}
@media(max-width:680px){.regional-form-list{display:none}.power-overview .chartgrid{grid-template-columns:repeat(2,minmax(0,1fr))}.main{padding:14px}.topbar{gap:8px;flex-wrap:wrap}.workspace{min-width:0}.modal>.card{max-width:100%}input,select,textarea{max-width:100%;font-size:16px}.drawing-modal .layout-tools{flex-wrap:nowrap;overflow-x:auto;flex-shrink:0}.drawing-modal .layout-tools button{white-space:nowrap}.drawing-modal .pagehead{margin-bottom:4px}.drawing-modal .layout-controls{gap:5px}.drawing-modal .layout-controls button{padding:8px}.drawing-modal .layout-controls label{font-size:12px;min-width:80px}.drawing-modal h2{font-size:16px}.drawing-modal .layout-canvas{min-height:240px}.ring{max-width:100%}}
@media(prefers-reduced-motion:reduce){.map-pin,.step.done:after{animation:none}}
@media print {.tablewrap{max-height:none!important;overflow:visible!important}.no-print{display:none!important}.drawing-modal{position:static}.map-pin{animation:none}}
/* 0.2.1: landscape drawing only; existing forms and reports retain their styles. */
.landscape-workspace {position:fixed;inset:0;padding:0;overflow:hidden;background:#eaf0f8;overscroll-behavior:none;}
.landscape-workspace:fullscreen {width:100%;height:100%;background:#eaf0f8;}
.landscape-workspace > .card {position:absolute;left:50%;top:50%;width:var(--drawing-width,100vw);height:var(--drawing-height,100dvh);max-width:none;max-height:none;min-width:0;min-height:0;margin:0;padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left));box-sizing:border-box;overflow:hidden;transform:translate(-50%,-50%);display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:4px;border:0;border-radius:0;}
.landscape-workspace.portrait-landscape > .card {transform:translate(-50%,-50%) rotate(90deg);}
.landscape-workspace .pagehead {margin:0;min-height:32px;align-items:center;gap:8px;}
.landscape-workspace .pagehead h2 {margin:0;font-size:16px;}
.landscape-workspace .pagehead .actions {margin:0;gap:6px;flex-wrap:nowrap;}
.landscape-workspace button {min-height:32px;padding:5px 9px;font-size:12px;}
.landscape-workspace [data-editor] {min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 145px;grid-template-rows:minmax(0,1fr);gap:8px;}
.landscape-workspace [data-editor] > p {display:none;}
.landscape-workspace .layout-shell {display:grid;grid-template-rows:auto minmax(0,1fr);grid-template-columns:minmax(0,1fr);min-width:0;min-height:0;gap:4px;}
.landscape-workspace .layout-tools {grid-row:1;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:4px;min-width:0;padding-bottom:3px;scrollbar-width:thin;}
.landscape-workspace .layout-tools button {min-height:32px;padding:5px 9px;flex-shrink:0;white-space:nowrap;}
.landscape-workspace .layout-canvas {grid-row:2;display:block;width:100%;height:100%;min-height:0;max-height:none;border:0;touch-action:none;user-select:none;-webkit-user-select:none;}
.landscape-workspace .layout-controls {display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;min-width:0;min-height:0;overflow:auto;gap:5px;margin:0;}
.landscape-workspace .layout-controls label {flex:0;min-width:0;margin:0;font-size:12px;}
.landscape-workspace .layout-controls input[type=range] {margin:0;padding:0;min-height:28px;touch-action:pan-x;}
.landscape-workspace .drawing-footer {display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:30px;}
.landscape-workspace .drawing-footer small {font-size:11px;color:#526780;}
.landscape-workspace [data-final] {margin:0;align-self:auto;min-width:110px;background:#059b56;}
.landscape-workspace [data-editor]:not(:has(.layout-controls)) {grid-template-columns:minmax(0,1fr);}
.landscape-workspace .layout-shell:not(:has(.layout-tools)) {grid-template-rows:minmax(0,1fr);}
.landscape-workspace .layout-shell:not(:has(.layout-tools)) .layout-canvas {grid-row:1;}
@media(max-height:420px) and (orientation:landscape) {
 .landscape-workspace > .card {padding-top:4px;padding-bottom:4px;gap:2px;}
 .landscape-workspace [data-editor] {grid-template-columns:minmax(0,1fr) 125px;}
 .landscape-workspace .layout-controls {gap:2px;}
 .landscape-workspace .drawing-footer small {font-size:10px;}
}
/* 0.2.2: compact symbol strip and maximum usable landscape drawing area. */
.landscape-workspace .layout-tools button {
 width:auto; max-width:none; min-width:42px; flex:0 0 auto;
 display:inline-flex; align-items:center; justify-content:center;
 margin:0; padding:5px 7px; min-height:32px; font-size:11px; line-height:1.2;
 border-radius:5px; white-space:nowrap;
}
.landscape-workspace .layout-tools {gap:4px;padding:0 0 2px;align-items:center;}
.landscape-workspace .layout-tools [data-confirm] {order:-1;background:#00a9d7;color:#fff;}
.landscape-workspace [data-editor] {grid-template-columns:minmax(0,1fr) 108px;gap:5px;}
.landscape-workspace .layout-controls {gap:4px;}
.landscape-workspace .layout-controls button {width:auto;font-size:11px;padding:5px;}
.landscape-workspace .layout-controls label {font-size:11px;}
.landscape-workspace > .card {padding:4px 6px;gap:3px;}
.landscape-workspace .pagehead {min-height:28px;}
.landscape-workspace .pagehead h2 {font-size:14px;}
.landscape-workspace .pagehead button {min-height:28px;padding:4px 8px;font-size:11px;}
.landscape-workspace .drawing-footer {min-height:28px;}
.landscape-workspace .drawing-footer small {font-size:10px;}
.landscape-workspace [data-final] {min-height:28px;padding:4px 10px;font-size:11px;}
.landscape-workspace .layout-shell {gap:2px;}
.landscape-workspace .layout-canvas {border-radius:0;}
/* 0.2.3: editor-local feedback follows the same landscape transform as the canvas. */
.landscape-workspace .drawing-toast {position:absolute;left:50%;bottom:45px;transform:translateX(-50%);max-width:80%;width:max-content;padding:9px 14px;border-radius:8px;background:#143e61;color:#fff;z-index:5;font-size:12px;box-shadow:0 3px 12px #0003;pointer-events:none;}
.landscape-workspace .drawing-toast.error {background:#a63045;}
.landscape-workspace .drawing-save-confirm {position:absolute;inset:0;z-index:6;background:#102c5170;display:flex;align-items:center;justify-content:center;padding:14px;}
.landscape-workspace .drawing-save-confirm > div {background:#fff;border-radius:12px;padding:16px;max-width:460px;box-shadow:0 8px 30px #0003;}
.landscape-workspace .drawing-save-confirm p {font-size:13px;margin:0 0 12px;}
.landscape-workspace .drawing-save-confirm .actions {display:flex;gap:8px;flex-wrap:wrap;}
.landscape-workspace .drawing-toast[hidden],.landscape-workspace .drawing-save-confirm[hidden] {display:none;}
.landscape-workspace .layout-tools [data-symbol]:disabled {opacity:.4;cursor:not-allowed;filter:grayscale(.7);}
.landscape-workspace .layout-tools [data-confirm].needs-confirm {box-shadow:0 0 0 2px #ffbf47 inset;font-weight:700;}

/* Shared Regional/Power header notification dropdown. */
.notification-wrap{position:relative}
.notification-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px}
#notification-count{position:absolute;top:-4px;right:-6px;min-width:19px;padding:2px 5px;border-radius:20px;background:#dc3545;color:#fff;font-size:11px;font-weight:700}
#notification-panel{position:absolute;right:0;top:52px;width:min(380px,calc(100vw - 24px));max-height:min(70vh,560px);overflow:auto;background:#fff;border:1px solid #d9e3f1;border-radius:14px;box-shadow:0 12px 36px #102c512b;z-index:50;color:#102c51}
#notification-panel[hidden],#notification-count[hidden]{display:none}
.notification-heading{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;gap:12px}
.notification-help,.notification-empty{padding:0 14px 14px;margin:0;font-size:13px;color:#63758c}
.notification-item{display:flex;flex-direction:column;gap:5px;width:100%;padding:12px 14px;border:0;border-top:1px solid #e8eef6;border-radius:0;background:#fff;color:#102c51;text-align:left;white-space:normal}
.notification-item:hover,.notification-item:focus-visible{background:#edf4ff}
.notification-item small{overflow-wrap:anywhere}
@media(max-width:680px){#notification-panel{position:fixed;top:110px;right:12px;max-height:calc(100dvh - 130px)}}

/* Page identity belongs in the shared header, leaving content space for records/cards. */
.topbar{height:auto;min-height:64px;padding:9px 30px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
.header-page{min-width:0;flex-wrap:nowrap}
.header-copy{min-width:0}
.topbar #header-title{margin:0;font-size:18px;line-height:1.25}
.topbar #header-subtitle{margin:3px 0 0;font-size:12px;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
.header-account{flex-wrap:nowrap;gap:8px}
.main{padding-top:16px}
.page-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
@media(max-width:680px){
 .topbar{padding:8px 10px;gap:8px;min-height:60px}
 .topbar #header-title{font-size:15px}
 .topbar #header-subtitle{font-size:10px;line-height:1.3}
 .header-page{gap:8px}
 .header-user{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
 .header-account{gap:6px}
 .header-account #logout{padding:8px;font-size:11px}
 .header-account .notification-bell{width:36px;height:36px;padding:7px}
 .main{padding-top:12px}
}
@media(max-width:380px){.header-user{max-width:70px}.header-page{gap:5px}.header-account{gap:4px}}
/* Dedicated survey dashboard: four measures per owner. */
.survey-owner{margin-bottom:20px}
.survey-owner>h2{font-size:17px;margin:0 0 12px}
body[data-survey="1"] .chartgrid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:850px){body[data-survey="1"] .chartgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){body[data-survey="1"] .metric{padding:12px 8px}body[data-survey="1"] .ring{width:100px;height:100px}}

/* Boundary width is independent of symbol size and drawing height. */
.landscape-workspace .boundary-width-control output{font-size:10px;color:#526780;white-space:nowrap}

/* Direct pointer tracking for drawing sliders, including the rotated workspace. */
.layout-controls input[type=range] {
 -webkit-appearance:none;appearance:none;direction:ltr;
 width:100%;height:28px;min-height:28px;padding:0;margin:0;border:0;
 background:transparent;touch-action:none!important;user-select:none;-webkit-user-select:none;
}
.layout-controls input[type=range]::-webkit-slider-runnable-track {
 height:6px;border-radius:4px;background:linear-gradient(to right,#087cf0 0%,#087cf0 var(--range-fill,0%),#d6dee9 var(--range-fill,0%),#d6dee9 100%);
}
.layout-controls input[type=range]::-webkit-slider-thumb {
 -webkit-appearance:none;width:18px;height:18px;margin-top:-6px;border:0;border-radius:50%;background:#087cf0;
}
.layout-controls input[type=range]::-moz-range-track {height:6px;border-radius:4px;background:#d6dee9;}
.layout-controls input[type=range]::-moz-range-progress {height:6px;border-radius:4px;background:#087cf0;}
.layout-controls input[type=range]::-moz-range-thumb {width:18px;height:18px;border:0;border-radius:50%;background:#087cf0;}
.layout-controls input[type=range]:disabled {opacity:.45;}

/* OOP installation fields and Power approval documents. */
.oop-request-fields [hidden],.oop-site-fields[hidden]{display:none!important}
.oop-approval{margin-top:18px}.oop-approval .grid,.oop-site-fields{margin-bottom:14px}.oop-summary small{overflow-wrap:anywhere}.oop-approval [data-oop-progress]{overflow-wrap:anywhere}

/* Installation phase planning, scoped to the new controls and survey queue. */
.phase-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.phase-toolbar label{margin:0;min-width:220px;max-width:420px;flex:1}
.phase-toolbar button{margin-bottom:0}
.phase-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.phase-section-heading h2{margin:0;font-size:17px}
.phase-progress,.phase-worklist,.phase-import,.phase-summary{margin-bottom:18px}
.phase-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.phase-metrics>div{padding:10px;background:#f3f6fc;border-radius:8px;display:flex;flex-direction:column;gap:4px}
.phase-metrics strong{font-size:24px;color:#174e91;line-height:1.1}
.phase-metrics span{font-size:12px}
.phase-progress-label{display:block;margin:12px 0 0;font-size:12px}
.phase-progress progress{display:block;width:100%;height:10px;margin-top:6px;accent-color:#159c82}
.phase-progress p{font-size:12px;margin:8px 0 0}
.phase-badge{display:block;width:fit-content;max-width:100%;font-size:11px;padding:3px 7px;border-radius:5px;color:#185c87;background:#e9f4fa;margin-top:5px;overflow-wrap:anywhere}
.phase-form-note{margin:0 0 12px;font-size:12px}
.phase-show-all{display:flex;align-items:center;gap:6px;margin:0;font-size:12px}
.phase-show-all input{width:auto;min-height:0;margin:0}
.phase-worklist td,.phase-summary td,.phase-import td{overflow-wrap:anywhere}
.phase-worklist [hidden]{display:none!important}
.phase-import [data-phase-preview]:empty{display:none}
.phase-import [data-phase-apply]{margin-top:12px}
.phase-import [data-phase-import-status]{font-size:13px;margin-bottom:0}
@media(max-width:850px){.phase-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:420px){.phase-toolbar{gap:8px}.phase-toolbar label{min-width:180px}.phase-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.phase-metrics strong{font-size:21px}}

/* 0.2.14: installed specifications, accessible map zoom, and compact phase cards. */
.site-detail-link{border:0;background:none;color:#1757c2;padding:0;min-height:0;text-align:left;text-decoration:underline;font:inherit;font-weight:600}
.solar-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;margin:0 0 18px}
.solar-detail-grid>div{padding:10px 0;border-bottom:1px solid var(--line);min-width:0}
.solar-detail-grid dt{font-size:12px;color:var(--muted);margin-bottom:4px}
.solar-detail-grid dd{margin:0;font-size:14px;overflow-wrap:anywhere}
.solar-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.solar-stage-fields{padding:0 0 12px}.solar-stage-fields:empty{display:none}
.solar-record-details{margin:18px 0}.solar-record-details h2,.solar-site-modal h2{font-size:17px}
.solar-review-editor,.solar-legacy-editor{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:10px}
.solar-review-editor summary,.solar-legacy-editor summary{cursor:pointer;font-weight:600}
.map-zoom-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.map-zoom-controls button{min-width:44px;min-height:44px;padding:8px 12px}
.map-zoom-controls output{min-width:48px;text-align:center;font-size:13px}
.map-hint{font-size:12px;margin:8px 0}.site-map.map-zoomed{cursor:grab}.site-map.map-zoomed:active{cursor:grabbing}
.site-map .map-pin,.site-map .map-land{vector-effect:non-scaling-stroke}
.phase-summary-table table{min-width:620px}.phase-summary-table [data-phase-choice]{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.phase-summary-mobile{display:none}
@media(max-width:680px){
 .solar-fields,.solar-detail-grid{grid-template-columns:1fr}
 .phase-summary-table{display:none}
 .phase-summary-mobile{display:grid;gap:12px}
 .phase-mobile-card{border:1px solid var(--line);border-radius:10px;padding:12px;min-width:0}
 .phase-mobile-card h3{margin:0 0 10px}.phase-mobile-card [data-phase-choice]{white-space:normal;word-break:normal;overflow-wrap:break-word;max-width:100%;font-weight:600;font-size:14px}
 .phase-mobile-card dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;margin:0}
 .phase-mobile-card dt{font-size:11px;color:var(--muted);overflow-wrap:normal}.phase-mobile-card dd{font-size:20px;font-weight:600;margin:4px 0 0}
}
@media(max-width:350px){.phase-mobile-card dl{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.phase-summary-mobile{display:none}.phase-summary-table{display:block}}

/* 0.2.15: Power Survey's capture form follows the supplied mobile template. */
body[data-survey="1"] .survey-request-form{max-width:720px;margin:0 auto 18px;padding:18px 20px;border:1px solid #bac7d5;border-radius:20px;box-shadow:none}
.survey-request-form>h2{font-size:16px;margin:0 0 14px}
.survey-request-form .survey-form-help{border:0;background:none;padding:0;margin:0 0 14px;color:var(--muted);font-size:12px}
.survey-request-form>.oop-request-fields{margin-bottom:12px}
.survey-request-form .oop-request-fields p,.survey-request-form .phase-form-note{font-size:12px;line-height:1.4;margin:7px 0}
.survey-request-form .survey-photo{border:0;border-radius:0;padding:14px 0 12px;margin:0;background:transparent}
.survey-request-form .survey-photo>strong{display:block;font-size:14px;font-weight:500}
.survey-photo-actions{display:flex;justify-content:space-evenly;align-items:center;gap:20px;padding:20px 0 9px}
.survey-photo-actions .survey-photo-pick{position:relative;display:flex;align-items:center;justify-content:center;width:132px;max-width:45%;min-height:50px;margin:0;padding:10px 16px;border-radius:10px;font-size:19px;font-weight:600;line-height:1.2;cursor:pointer;overflow:hidden}
.survey-photo-pick.camera{background:#2e79b8;color:#fff}
.survey-photo-pick.gallery{background:#ffc400;color:#463500}
.survey-photo-pick input[type=file]{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;padding:0;cursor:pointer}
.survey-photo-pick:focus-within{outline:3px solid #102c51;outline-offset:3px}
.survey-photo [data-photo-name]{display:block;text-align:center;overflow-wrap:anywhere;font-size:11px;color:var(--muted);min-height:16px}
.survey-request-form .survey-notes{margin-top:16px;font-size:12px}
.survey-request-form .survey-notes textarea{min-height:110px;border:1px solid #bac7d5;border-radius:16px;resize:vertical}
.survey-request-form .survey-draw-layout{background:#567e36;color:white;border-radius:6px;font-size:12px;min-height:36px;padding:8px 12px}
.survey-request-form #layout-status{font-size:11px;flex:1;min-width:100px}
.survey-request-form .survey-form-actions{justify-content:space-between;margin-top:16px;gap:12px}
.survey-request-form .survey-form-actions button{min-width:90px;min-height:38px;border-radius:6px;font-size:12px;padding:8px 14px}
.survey-request-form .survey-form-actions button[type=submit]{background:#2e79b8}
.survey-request-form .survey-close-form{background:#d81320;color:#fff}
.survey-request-form #save-progress{font-size:12px;margin:10px 0 0}.survey-request-form #save-progress:empty{display:none}
body[data-survey="1"] #main:has(.survey-request-form)>.page-actions{display:none}
@media(max-width:680px){
 body[data-survey="1"] #main:has(.survey-request-form){padding:10px}
 body[data-survey="1"] .survey-request-form{padding:15px 16px;margin-bottom:0}
 .survey-request-form .survey-photo-actions{gap:16px;padding-top:18px}
 .survey-request-form .survey-photo-actions .survey-photo-pick{width:120px;font-size:18px}
}

/* Tower choices stay inside the rotated drawing workspace, including on phones. */
.layout-editor-host{position:relative}
.tower-picker{position:absolute;inset:0;z-index:8;display:flex;align-items:center;justify-content:center;background:#102c5170;padding:10px}
.tower-picker[hidden]{display:none}
.tower-picker-card{width:min(440px,100%);max-height:100%;overflow:auto;padding:14px;background:white;border-radius:12px;box-shadow:0 8px 30px #0003}
.tower-picker h3{font-size:15px;margin:0 0 10px}
.tower-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.tower-choices button{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0;width:100%;padding:7px!important}
.tower-choices svg{display:block;width:100%;height:82px;pointer-events:none}
.tower-choices [data-object-label]{display:none}.tower-choices strong{font-size:13px}
.tower-picker button:focus-visible{outline:3px solid #2463eb;outline-offset:2px}
@media(max-height:400px){.tower-choices svg{height:60px}.tower-picker-card{padding:10px}.tower-picker h3{margin-bottom:6px}}

/* 0.2.16: Survey account details on the left; Logout at the sidebar bottom. */
body[data-survey="1"] .sidebar{display:flex;flex-direction:column}
body[data-survey="1"] .sidebar>.brand,body[data-survey="1"] .sidebar>.portal-tag,body[data-survey="1"] .sidebar>.nav{flex-shrink:0}
body[data-survey="1"] .survey-sidebar-footer{margin-top:auto;padding-top:20px;padding-bottom:env(safe-area-inset-bottom)}
body[data-survey="1"] .survey-sidebar-footer #logout{width:100%;text-align:left;padding:11px 14px}
body[data-survey="1"] .header-page .survey-header-user{flex:0 1 150px;min-width:80px;max-width:150px;text-align:left;white-space:normal;overflow:visible;font-size:12px;line-height:1.35}
body[data-survey="1"] .survey-header-user>span{display:block;overflow-wrap:anywhere}
body[data-survey="1"] .survey-header-user>small{display:block;margin-top:2px;font-size:10px;text-align:left}
body[data-survey="1"] .header-copy{flex:1}
@media(max-width:680px){body[data-survey="1"] .header-page .survey-header-user{flex-basis:120px;max-width:120px;font-size:11px}body[data-survey="1"] .header-page{gap:8px}}
