/* Illume — Illumination page (from the WindCircles Illumination tab) (house style: cards, fields, buttons from theme.css; content column like Settings) */
.page-illum { padding-top: 0.8rem; }
.illum-layout { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media screen and (max-width: 1000px) { .illum-layout { grid-template-columns: 1fr; } }
.illum-input { position: sticky; top: calc(var(--wc-topbar-h, 56px) + var(--wc-tabbar-h, 48px) + 0.5rem); }
@media screen and (max-width: 1000px) { .illum-input { position: static; } }
.illum-input > label:first-of-type { margin-top: 0.2rem; }
.illum-search { position: relative; }
.illum-results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; max-height: 18rem; overflow: auto;
  background: var(--t-panel); border: 1px solid var(--t-line); border-radius: var(--radius); box-shadow: var(--t-dialog-shadow); }
.illum-results li { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.88rem; border-bottom: 1px solid var(--t-row-line); line-height: 1.3; }
.illum-results li:last-child { border-bottom: 0; }
.illum-results li:hover, .illum-results li:focus { background: var(--t-accent-soft); }
.illum-results .tech { font-weight: 700; color: var(--t-accent-ink); margin-right: 0.3rem; }
.illum-results .illum-res-note { color: var(--t-muted); cursor: default; font-style: italic; }
.illum-row { display: flex; gap: 0.4rem; align-items: center; }
.illum-row input { flex: 1 1 auto; min-width: 0; }
.illum-row .btn { flex: 0 0 auto; white-space: nowrap; }
/* v4.15.1: every field stays inside its card (grid cells may shrink below the fields' intrinsic width) */
.illum-input, .illum-input * { min-width: 0; }
.illum-input input:not([type="checkbox"]), .illum-input select { width: 100%; max-width: 100%; }
.illum-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.15rem 0.6rem; }
.illum-grid > label { min-width: 0; display: flex; flex-direction: column; }
.illum-grid label input, .illum-grid label select { margin-top: 0.25rem; font-weight: 400; }
.illum-grid label:only-child, .illum-span2 { grid-column: 1 / -1; }
.illum-grid input[type="date"], .illum-grid input[type="datetime-local"],
.illum-grid input[type="text"], .illum-grid select {
  box-sizing: border-box; min-width: 0; width: 100%; max-width: 100%;
}
.illum-grid input[type="date"], .illum-grid input[type="datetime-local"] { padding-left: 0.35rem; padding-right: 0.2rem; }
.illum-grid select { text-overflow: ellipsis; }
#illum-tot { font-variant-numeric: tabular-nums; }
/* Keep TOT + timezone and From + To on one row at every width, including phone and tablet.
   Fields shrink instead of overflowing or stretching the box. */
@media screen and (max-width: 1100px) {
  .illum-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media screen and (max-width: 420px) {
  .illum-grid input[type="date"], .illum-grid input[type="datetime-local"] { font-size: 0.9rem; padding-left: 0.3rem; padding-right: 0.15rem; }
}
.illum-expand { margin: 0.6rem 0 0.35rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.illum-expand .btn { min-height: 44px; padding: 0.45rem 0.4rem; font-size: 0.85rem; width: 100%; box-sizing: border-box; }
.illum-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin-top: 0.35rem; }
.illum-actions .btn { min-height: 44px; width: 100%; box-sizing: border-box; }
@media screen and (max-width: 420px) {
  .illum-expand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#illum-loc-info { margin: 0.35rem 0 0.2rem; line-height: 1.4; }
.illum-report { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.illum-report .card { min-width: 0; }
.illum-notice { margin: 0.2rem 0 0.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--t-line); border-radius: var(--radius); background: var(--t-soft); font-size: 0.85rem; }
.illum-notice.warn { color: var(--t-amber-ink); background: var(--t-amber-bg); border-color: var(--t-amber-bar); font-weight: 600; }
.illum-summary { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.88rem; margin-bottom: 0.5rem; }
.illum-k { display: inline-block; min-width: 4.2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--t-muted); }
.illum-hover { min-height: 1.4em; }
.illum-chart { width: 100%; }
.illum-svg { width: 100%; height: auto; display: block; font-family: var(--cond); touch-action: pan-y; user-select: none; }
.illum-svg .grid { stroke: var(--t-line); stroke-width: 0.6; opacity: 0.6; }
.illum-svg .frame { fill: none; stroke: var(--t-strong); stroke-width: 1; }
.illum-svg .ylbl, .illum-svg .xlbl { font-family: var(--tech); font-size: 11px; fill: var(--t-muted); }
.illum-svg .xlbl.loc { fill: var(--t-ink); opacity: 0.75; }
.illum-svg .axis-title { font-family: var(--cond); font-size: 12px; }
.illum-svg .ref { stroke: var(--t-muted); stroke-width: 0.8; stroke-dasharray: 2 4; }
.illum-svg .reflbl { font-size: 10.5px; fill: var(--t-muted); }
.illum-svg .curve-clear { fill: none; stroke: var(--t-accent); stroke-width: 2.4; stroke-linejoin: round; }
.illum-svg .curve-fc { fill: none; stroke: var(--t-amber-bar); stroke-width: 2.2; stroke-dasharray: 7 4; stroke-linejoin: round; }
.illum-svg .tot { stroke: var(--t-danger); stroke-width: 1.8; }
.illum-svg .totlbl { font-family: var(--tech); font-size: 11px; font-weight: 700; fill: var(--t-danger); }
.illum-svg .cursor { stroke: var(--t-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.illum-svg .striplbl { font-size: 11.5px; font-weight: 700; pointer-events: none; }
.illum-svg .strip-bg { fill: var(--t-soft); stroke: var(--t-line); stroke-width: 0.6; }
/* twilight colours (same in both themes: they stand for the sky, not for the UI) */
.ph-day { fill: #fde68a; } .ph-civil { fill: #93c5fd; } .ph-nautical { fill: #3b6fc4; } .ph-astro { fill: #233d73; } .ph-night { fill: #0f172a; }
.illum-svg rect[class^="ph-"]:not(.strip) { opacity: 0.22; }
.ph-txt-day, .ph-txt-civil { fill: #1f2937; } .ph-txt-nautical, .ph-txt-astro, .ph-txt-night { fill: #e8eef7; }
.moon-up { fill: #cbd5e1; stroke: #64748b; stroke-width: 0.6; }
.moon-txt { fill: #1f2937; }
.muted-txt { fill: var(--t-muted); font-weight: 400 !important; }
.illum-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.4rem; font-size: 0.8rem; color: var(--t-muted); }
.illum-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.lg-line { display: inline-block; width: 1.4rem; height: 0; border-top: 3px solid var(--t-accent); }
.lg-line.fc { border-top: 3px dashed var(--t-amber-bar); }
.lg-line.tot { border-top: 2px solid var(--t-danger); }
.lg-box { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 2px; border: 1px solid var(--t-line); }
.lg-box.ph-day { background: #fde68a; } .lg-box.ph-civil { background: #93c5fd; } .lg-box.ph-nautical { background: #3b6fc4; } .lg-box.ph-astro { background: #233d73; } .lg-box.ph-night { background: #0f172a; } .lg-box.moon-up { background: #cbd5e1; }
.illum-table td, .illum-table th { white-space: nowrap; }
.illum-table tr.out-win td { color: var(--t-muted); }
.illum-table tr.in-win td:first-child { font-weight: 600; }
.illum-table tr.ev-tot td { color: var(--t-danger); font-weight: 700; }
.illum-samples summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.illum-samples .table-wrap { max-height: 28rem; overflow: auto; margin-top: 0.5rem; }
.illum-disclaimer-card { border-left: 3px solid var(--t-amber-bar); }
.illum-disclaimer-card ul { margin: 0.2rem 0 0.6rem; padding-left: 1.1rem; font-size: 0.86rem; }
.illum-disclaimer-card li { margin-bottom: 0.25rem; }
.illum-disc { font-weight: 600; font-size: 0.88rem; margin: 0.4rem 0 0; }
.illum-print-head { display: none; }

/* PDF / print: only the report, on white paper */
@media print {
  /* Always use the desktop report layout, whatever the screen width.
     The printed page is a fixed A4 sheet: ignore tablet/phone breakpoints. */
  @page { size: A4 portrait; margin: 12mm; }
  html, body.illum-printing {
    background: #fff !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.illum-printing .app, body.illum-printing .content, body.illum-printing #page-illum,
  body.illum-printing .illum-layout, body.illum-printing .illum-report {
    display: block !important;
    width: 186mm !important; /* 210mm minus 12mm + 12mm page margins */
    max-width: 186mm !important;
    min-width: 186mm !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
  }
  body.illum-printing .topbar, body.illum-printing .tabbar, body.illum-printing .illum-input,
  body.illum-printing .page:not(#page-illum), body.illum-printing .toast, body.illum-printing .modal-overlay,
  body.illum-printing .pick-card, body.illum-printing .illum-hover, body.illum-printing .local-env-banner,
  body.illum-printing .site-foot { display: none !important; }
  body.illum-printing #page-illum { padding: 0 !important; }
  body.illum-printing .illum-report { gap: 3mm; }
  body.illum-printing .card {
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 3mm 4mm;
    width: auto !important;
    max-width: none !important;
  }
  body.illum-printing .illum-print-head { display: block; margin-bottom: 3mm; }
  body.illum-printing .illum-print-head h1 { font-size: 15pt; margin: 0 0 1mm; letter-spacing: 0.05em; text-transform: uppercase; }
  body.illum-printing .illum-print-head p { margin: 0.5mm 0; font-size: 9.5pt; }
  body.illum-printing .illum-print-disc { border: 1px solid #b7791f; padding: 2mm 3mm; font-weight: 600; }
  body.illum-printing .illum-chart, body.illum-printing .illum-svg { width: 100% !important; max-width: 100% !important; height: auto !important; }
  body.illum-printing .illum-samples:not([open]) { display: none; }
  body.illum-printing .illum-samples .table-wrap { max-height: none !important; overflow: visible !important; }
  body.illum-printing .data-table { font-size: 8.5pt; width: 100% !important; }
  body.illum-printing .data-table td, body.illum-printing .data-table th { padding: 1mm 2mm; }
  body.illum-printing * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.illum-printing .illum-table td, body.illum-printing .illum-table th { white-space: nowrap; }
  body.illum-printing .table-wrap { overflow: visible !important; max-height: none !important; }
}
