/* 冬至那天 — one stylesheet, compiled into the binary as a string literal.

   A surveyor's notebook at eight in the morning in June: the ground still
   blue, the sun just up and low and gold. Two colours carry the whole page —
   amber for the sun you get, slate for the sun something else is standing in
   front of. Everything else stays out of the way.

   The tones are `plenty`, `thin`, `gone`. They describe the sun. Nothing here
   has an opinion about whether the neighbour should have been allowed to
   build. */

:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel2: #1c232c;
  --line: #2b3440;
  --ink: #e6e9ee;
  --dim: #98a3b0;
  --faint: #6a7684;
  --sun: #f0b429;
  --lost: #64748b;
  --warm: #e07a5f;
  --cool: #6aa9c9;
  --plenty: #86bd88;
  --thin: #f0b429;
  --gone: #e07a5f;
  --radius: 11px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 14px calc(30px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.62 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", "Noto Sans SC", "PingFang SC", sans-serif;
  overflow-wrap: anywhere;
}
main { max-width: 800px; margin: 0 auto; }

.topbar {
  max-width: 800px; margin: 0 auto; padding: 22px 0 14px;
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; align-items: start;
}
.brand {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(160deg, var(--sun) 0%, #b47a12 100%);
  color: #1a1204; font-size: 23px; font-weight: 700; line-height: 1;
}
.titles h1 { margin: 0; font-size: 21px; letter-spacing: -0.01em; line-height: 1.25; }
.titles p { margin: 4px 0 0; color: var(--dim); font-size: 14px; }

.panel, .block, .findings {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 14px 0;
}
.panel h2 { margin: 0 0 9px; font-size: 15px; }
h3 { margin: 0 0 8px; font-size: 14.5px; }
.sub { margin: 0 0 10px; color: var(--dim); font-size: 14px; }
.sub:last-child { margin-bottom: 0; }
.quiet { background: transparent; }
code {
  font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

/* ------------------------------------------------------------------ form */

.egs { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 14px; }
.quickdates { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.eg {
  cursor: pointer; font: inherit; font-size: 13px;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
}
.eg.small { font-size: 12.5px; color: var(--dim); }
.eg.on { border-color: var(--sun); color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }
.eg:focus-visible, textarea:focus-visible, input:focus-visible, .go:focus-visible {
  outline: 2px solid var(--sun); outline-offset: 2px;
}
.go {
  display: block; width: 100%; margin-top: 14px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 650;
  background: var(--sun); color: #1a1204;
  border: 0; border-radius: 9px; padding: 11px;
}

.fields {
  display: grid; gap: 9px; margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.fl { display: grid; gap: 4px; min-width: 0; }
.fl span { color: var(--dim); font-size: 12.5px; }
.fl input, textarea {
  width: 100%; min-width: 0;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px;
  font: 13.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
textarea { resize: vertical; line-height: 1.7; font-size: 12.5px; padding: 10px; }
.lbl { display: block; margin: 4px 0 7px; color: var(--dim); font-size: 13.5px; line-height: 1.55; }

/* --------------------------------------------------------------- verdict */

.verdict {
  border: 1px solid var(--line); border-left: 4px solid var(--sun);
  border-radius: var(--radius); background: var(--panel2); padding: 15px 16px; margin: 14px 0;
}
.verdict > b { display: block; font-size: 21px; line-height: 1.28; }
.verdict .say { margin: 8px 0 0; color: var(--dim); font-size: 13.5px; }
.verdict.plenty { border-left-color: var(--plenty); }
.verdict.thin { border-left-color: var(--thin); }
.verdict.gone { border-left-color: var(--gone); }

.findings { padding: 4px 16px; }
.finding { border-top: 1px solid var(--line); padding: 13px 0; }
.finding:first-child { border-top: 0; }
.finding > b { display: block; font-size: 14.5px; }
.finding > p { margin: 5px 0 0; color: var(--dim); font-size: 13.5px; }
.finding.plenty > b { color: var(--plenty); }
.finding.thin > b { color: var(--thin); }
.finding.gone > b { color: var(--gone); }

/* ------------------------------------------------------------- the chart */

svg.path { display: block; width: 100%; max-width: 560px; height: auto; margin: 6px auto 2px; }
.grid { stroke: var(--line); stroke-width: 1; }
.grid.north { stroke: var(--faint); stroke-width: 1.4; stroke-dasharray: 3 3; }
.ax { fill: var(--faint); font-size: 10px; font-family: inherit; }

/* The noon label sits on the dashed north line, so it carries a halo in the
   panel colour rather than being nudged somewhere it means less. */
.note {
  fill: var(--dim); font-size: 10px; font-family: inherit;
  paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round;
}

.sky { fill: var(--lost); fill-opacity: 0.3; stroke: var(--lost); stroke-width: 1.2; }
.sunpath { fill: none; stroke: var(--sun); stroke-width: 2.6; stroke-linecap: round; }
.lostpath { fill: none; stroke: var(--warm); stroke-width: 2.6; stroke-linecap: round; }
.ref { fill: none; stroke-width: 1.2; stroke-dasharray: 4 4; }
.ref.jun { stroke: var(--cool); }
.ref.dec { stroke: var(--faint); }
.hr { fill: var(--sun); stroke: var(--panel); stroke-width: 1.2; }
.hr.lost { fill: var(--warm); }
.hrlab { fill: var(--dim); font-size: 9.5px; font-family: inherit; }

.legend { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 10px; }
.legend .li { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; }
i.k { width: 13px; height: 4px; border-radius: 2px; display: inline-block; flex: none; }
i.k.sun { background: var(--sun); }
i.k.lost { background: var(--warm); }
i.k.sky { background: var(--lost); height: 10px; opacity: 0.6; }
i.k.jun { background: var(--cool); }
i.k.dec { background: var(--faint); }

/* --------------------------------------------------------- the hours bar */

svg.hbar { display: block; width: 100%; height: 22px; border-radius: 6px; }
.htrack { fill: var(--warm); }
.hopen { fill: var(--sun); }
.hrow {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 7px; color: var(--dim); font-size: 13px;
}
.hrow b { color: var(--ink); }

/* -------------------------------------------------------------- the gaps */

.gaps { list-style: none; margin: 0; padding: 0; }
.gaps li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px;
  align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.gaps li:first-child { border-top: 0; }
.gaps b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gaps span { color: var(--dim); min-width: 0; }
.gaps i {
  color: var(--warm); font-style: normal; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- the table */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; }
table.ot { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
table.ot th, table.ot td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: right; }
table.ot thead th { color: var(--faint); font-weight: 600; font-size: 11.5px; }
table.ot th.ln { text-align: left; font-weight: 600; white-space: normal; min-width: 120px; }
table.ot td { font-variant-numeric: tabular-nums; color: var(--dim); }
table.ot td.amt { color: var(--ink); }

/* ------------------------------------------------------------------ lists */

.panel.bad { border-color: var(--warm); }
.badlist { margin: 0; padding-left: 18px; color: var(--dim); font-size: 13px; }
.badlist li { margin: 6px 0; }
.badlist b { color: var(--ink); }

.foot {
  max-width: 800px; margin: 22px auto 0; padding-top: 14px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px;
}
