*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050816;
  color: #e4e8ff;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.brand-text h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #a3b8ff;
}

.brand-text p {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  color: #c3d3ff;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #c3d3ff;
}

.intro {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.panel {
  background: #0b1020;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.25rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

input[type="checkbox"] {
  width: auto;
}

input[type="number"],
input[type="date"],
input[type="time"] {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #273253;
  background: #050816;
  color: #e4e8ff;
  font-size: 0.9rem;
}

input:focus {
  outline: none;
  border-color: #5b8dff;
  box-shadow: 0 0 0 1px rgba(91, 141, 255, 0.6);
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

small {
  font-size: 0.75rem;
  opacity: 0.8;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

button {
  border-radius: 999px;
  border: none;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, #4e6bff, #8a4dff);
  color: white;
  font-weight: 500;
}

button[type="button"] {
  background: #222b48;
}

button:hover {
  filter: brightness(1.1);
}

.hint {
  font-size: 0.8rem;
  opacity: 0.85;
}

code {
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  background: #050816;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}

.results {
  font-size: 1rem;
  line-height: 1.5;
}

.results strong {
  color: #f0f3ff;
}

.results-main {
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #222b48;
  font-size: 0.75rem;
  margin-left: 0.4rem;
}

.badge.ok {
  background: #1f6f4a;
}

.badge.warn {
  background: #7a1e2a;
}

.details-box {
  background: #050816;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

#details-toggle summary {
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

#map-container {
  margin-top: 0.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #273253;
  min-height: 240px;
}

#map-frame {
  width: 100%;
  height: 260px;
  border: 0;
}

.map-links {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.map-links a {
  color: #a3c2ff;
  text-decoration: none;
  margin-right: 0.6rem;
}

.map-links a:hover {
  text-decoration: underline;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.week-table th,
.week-table td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #273253;
}

.week-table th {
  text-align: left;
  color: #c3d3ff;
}

/* Orientation layout with side-view diagram */
.orientation-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

.orientation-text {
  flex: 1 1 220px;
  min-width: 0;
}

.orientation-diagram {
  flex: 0 0 260px;
  max-width: 320px;
  margin-left: auto;
}

/* Side-view SVG styling */
.ground {
  stroke: #273253;
  stroke-width: 1.8;
}

.panel-mast {
  stroke: #394064;
  stroke-width: 2.1;
}

.panel-plate {
  fill: #1b2645;
  stroke: #4e6bff;
  stroke-width: 1.4;
}

.drone-body {
  fill: #f5f5ff;
  stroke: #a3b8ff;
  stroke-width: 1.2;
}

.camera-ray {
  stroke: #ff5f9a;
  stroke-width: 2;
  stroke-linecap: round;
}

.sun-disc {
  fill: #ffcd4e;
  stroke: #f6b73c;
  stroke-width: 1;
}

.dir-label {
  fill: #c3d3ff;
  font-size: 0.85rem;
  font-weight: 600;
}


.footer-note {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #8fa3d1;
  text-align: center;
  border-top: 1px solid #273253;
  opacity: 0.85;
}

.window-bar-container {
  margin-top: 0.75rem;
}

#windowBarContainer svg {
  width: 100% !important;
  max-width: 100% !important;
}
.window-bar-container {
  width: 100%;
  margin-top: 1rem;
}

.window-bar-container {
  width: 100%;
  margin-top: 1.5rem;
}

#windowBarContainer svg {
  width: 100% !important;
  max-width: 100% !important;
  height: 240px; /* roughly ~2x previous visual size */
}

/* Inputs collapsible panel */
#inputs-toggle > summary {
  cursor: pointer;
  user-select: none;
  color: #c3d3ff;
  font-weight: 600;
  padding: 0.25rem 0.15rem;
  list-style: none;
}
#inputs-toggle > summary::-webkit-details-marker { display: none; }
#inputs-toggle > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  color: #8fa3d1;
}
#inputs-toggle[open] > summary::before { content: "▾"; }

.bookmark-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #8fa3d1;
}

.subsection {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #273253;
}
.subsection-title {
  font-weight: 700;
  color: #c3d3ff;
  margin-bottom: 0.25rem;
}
.subsection-help {
  font-size: 0.85rem;
  color: #8fa3d1;
  margin-bottom: 0.75rem;
}

.week-table { table-layout: fixed; }
.week-table th, .week-table td { padding: 0.65rem 0.75rem; }
.week-table th:nth-child(1), .week-table td:nth-child(1) { width: 18%; }
.week-table th:nth-child(2), .week-table td:nth-child(2) { width: 52%; }
.week-table th:nth-child(3), .week-table td:nth-child(3) { width: 30%; }
.week-table td { vertical-align: top; }
.week-table td small { color: #8fa3d1; }

/* Collapsible subsection inside Inputs */
.subdetails > summary {
  cursor: pointer;
  user-select: none;
  color: #c3d3ff;
  font-weight: 700;
  padding: 0.35rem 0.15rem;
  list-style: none;
}
.subdetails > summary::-webkit-details-marker { display: none; }
.subdetails > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  color: #8fa3d1;
}
.subdetails[open] > summary::before { content: "▾"; }

.week-table-wrap { overflow-x: auto; }

.week-table th:nth-child(1), .week-table td:nth-child(1) { width: 14%; }
.week-table th:nth-child(2), .week-table td:nth-child(2) { width: 28%; }
.week-table th:nth-child(3), .week-table td:nth-child(3) { width: 16%; }
.week-table th:nth-child(4), .week-table td:nth-child(4) { width: 14%; }
.week-table th:nth-child(5), .week-table td:nth-child(5) { width: 14%; }
.week-table th:nth-child(6), .week-table td:nth-child(6) { width: 14%; }

.error-banner{
  background: rgba(180, 50, 50, 0.18);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffd7d7;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  margin: 0.75rem auto 1rem auto;
  max-width: 1100px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}


.week-updated{font-size:12px;opacity:.8;margin:0 0 8px 2px}
.muted{opacity:.75;font-size:12px;margin-top:6px}

/* v3.6.25 Irradiance */
#irradiance-panel .irr-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 14px 0;
  flex-wrap:wrap;
}
#irradiance-panel .irr-current{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  background:rgba(255,255,255,0.02);
}
#irradiance-panel .irr-current-value{
  font-size:28px;
  font-weight:700;
  letter-spacing:0.3px;
}
#irradiance-panel .unit{opacity:0.75;font-size:14px;font-weight:600;margin-left:4px;}
#irradiance-panel .chart-block{margin:14px 0;}
#irradiance-panel .chart-title{font-weight:700;margin:0 0 8px 0;opacity:0.95;}
#irradiance-panel canvas{
  width:100%;
  height:auto;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px;
  background:rgba(0,0,0,0.12);
}


/* Row axis compass */
.row-axis-grid{
  display:grid;
  grid-template-columns: 1fr 170px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 760px){
  .row-axis-grid{ grid-template-columns: 1fr; }
}
.compass-wrap{
  width: 170px;
  height: 170px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
  touch-action:none;
}
.compass-wrap svg{
  width: 155px;
  height: 155px;
}
.compass-label{
  font-size: 11px;
  opacity: 0.75;
}
.compass-note{
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

.btnrow{ display:flex; flex-wrap:wrap; }
.smallbtn{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  cursor: pointer;
}
.smallbtn:hover{ background: rgba(255,255,255,0.07); }
.smallbtn:active{ transform: translateY(1px); }
