/* The night planner (/tonight/planner, ADR 0122): light theme on the site's
   variables. planner-dark.css overrides the twilight bands for the dark theme;
   night vision is the site-wide theme (ADR 0086). */

.np { display: grid; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 0 12px 24px; }
.np-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.np h1 { margin: 0 0 6px; font-size: 1.6rem; }
.np h2 { margin: 0 0 6px; font-size: 1.15rem; }
.np-intro p { margin: 0; max-width: 70ch; }

/* ---- Form ---- */
.np-row { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)); gap: 12px; }
.np-field { display: grid; gap: 4px; font-size: 0.92rem; }
.np-field > span { font-weight: 600; }
.np-field select, .np-field input, .np-field textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; width: 100%;
}
.np-targets { margin-top: 12px; }
.np-targets textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; resize: vertical; }
.np-custom { margin-top: 10px; }
.np-custom > summary { cursor: pointer; color: var(--accent-moon); font-weight: 600; }
.np-custom .np-field { max-width: 28rem; margin-top: 8px; }
.np-go { margin-top: 4px; font: inherit; font-weight: 650; color: #fff; background: var(--accent-moon); border: 0; border-radius: 999px; padding: 10px 22px; cursor: pointer; }
.np-go:hover { filter: brightness(1.1); }
.np-error { color: var(--warn-text); font-weight: 600; margin: 8px 0 0; }

/* ---- The night ---- */
.np-facts { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.np-chart { margin: 0; overflow-x: auto; }
.np-chart svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: inherit; }
.np-band { stroke: none; }
.np-day { fill: #f3efe2; }
.np-civil { fill: #e4dcef; }
.np-nautical { fill: #cfd5ea; }
.np-astronomical { fill: #b9c1df; }
.np-night { fill: #a9b2d6; }
.np-grid { stroke: rgb(255 255 255 / 0.55); stroke-width: 1; }
.np-tick { stroke: var(--muted); }
.np-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.np-sub { font-size: 10px; opacity: 0.85; }
.np-limit { stroke: var(--text); stroke-width: 1.2; stroke-dasharray: 2 4; }
.np-moon { fill: none; stroke: #6b6b6b; stroke-width: 2; stroke-dasharray: 6 5; }
.np-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.np-label { font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

/* ---- Weather strip ---- */
.np-weather { margin-top: 12px; overflow-x: auto; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.np-wx-row { display: flex; gap: 2px; min-width: max-content; }
.np-wx-row + .np-wx-row { margin-top: 2px; }
.np-wx-head { flex: 0 0 4.6rem; font-weight: 600; color: var(--muted); padding: 3px 4px; }
.np-wx-time, .np-wx-cell, .np-wx-plain { flex: 0 0 2.7rem; text-align: center; padding: 3px 0; border-radius: 4px; }
.np-wx-time { color: var(--muted); }
/* Cloud: clear is dark blue sky, overcast is grey; --c is the percent. */
/* Cloud cover in tenths (the page's CSP allows no style attributes). */
.np-wx-cell { background: #213a7a; color: #fff; }
.np-c1 { background: color-mix(in srgb, #9aa3b5 10%, #213a7a); }
.np-c2 { background: color-mix(in srgb, #9aa3b5 20%, #213a7a); }
.np-c3 { background: color-mix(in srgb, #9aa3b5 30%, #213a7a); }
.np-c4 { background: color-mix(in srgb, #9aa3b5 40%, #213a7a); }
.np-c5 { background: color-mix(in srgb, #9aa3b5 50%, #213a7a); }
.np-c6 { background: color-mix(in srgb, #9aa3b5 60%, #213a7a); }
.np-c7 { background: color-mix(in srgb, #9aa3b5 70%, #213a7a); }
.np-c8 { background: color-mix(in srgb, #9aa3b5 80%, #213a7a); }
.np-c9 { background: color-mix(in srgb, #9aa3b5 90%, #213a7a); }
.np-c10 { background: color-mix(in srgb, #9aa3b5 100%, #213a7a); }
.np-wx-layer .np-wx-cell { opacity: 0.85; }
.np-wx-time, .np-wx-cell, .np-wx-plain, .np-wx-seeing { flex: 0 0 2.7rem; text-align: center; padding: 3px 0; border-radius: 4px; }
/* Seeing: green under 0.5", amber near 1", red past 1.5" (free atmosphere). */
/* Seeing from 0.3" (green) to 1.5" and worse (red), in sixths. */
.np-wx-seeing { background: #2f8f5b; color: #fff; }
.np-s1 { background: color-mix(in srgb, #c0532a 17%, #2f8f5b); }
.np-s2 { background: color-mix(in srgb, #c0532a 33%, #2f8f5b); }
.np-s3 { background: color-mix(in srgb, #c0532a 50%, #2f8f5b); }
.np-s4 { background: color-mix(in srgb, #c0532a 67%, #2f8f5b); }
.np-s5 { background: color-mix(in srgb, #c0532a 83%, #2f8f5b); }
.np-s6 { background: color-mix(in srgb, #c0532a 100%, #2f8f5b); }
.np-wx-bad { color: var(--warn-text); font-weight: 700; }
.np-wx-note { margin: 6px 0 0; }

/* ---- Table ---- */
.np-table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.np-table-head p { margin: 0; }
.np-scroll { overflow-x: auto; }
.np-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.np-table th, .np-table td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.np-table thead th { border-top: 0; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.np-table tbody th { font-weight: 650; }
.np-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.np-swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: baseline; }
.np-src { display: block; font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.np-errors ul { margin: 0; padding-left: 1.2rem; }
.np-errors code { font-size: 0.85rem; }
.np-api code { word-break: break-all; }

/* ---- Phones: the chart scrolls sideways; the table becomes cards ---- */
@media (max-width: 720px) {
  .np { padding: 0 8px 16px; }
  .np-card { padding: 14px 12px; }
  .np-row { grid-template-columns: 1fr 1fr; }
  .np-obs { grid-column: 1 / -1; }
  .np-table thead { display: none; }
  .np-table, .np-table tbody, .np-table tr, .np-table td, .np-table th { display: block; width: auto; }
  .np-table tr { border-top: 1px solid var(--line); padding: 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
  .np-table td, .np-table th { border: 0; padding: 0; }
  .np-table td:nth-child(n+3) { grid-column: 2; }
  .np-table td:nth-child(3)::before { content: "RA, Dec "; color: var(--muted); }
  .np-table td:nth-child(4)::before { content: "Transit "; color: var(--muted); }
  .np-table td:nth-child(5)::before { content: "Highest "; color: var(--muted); }
  .np-table td:nth-child(6)::before { content: "Window "; color: var(--muted); }
  .np-table td:nth-child(7)::before { content: "Closest Moon "; color: var(--muted); }
  .np-table td br { display: none; }
}
