:root {
  --ink: #1f2d3d;
  --paper: #fffaf0;
  --muted: #5b6b7b;
  --line: #e3e0d6;
  --sky-top: #cdeefc;
  --sky-bottom: #fdf3df;
  --quiet: #5ad1b3;
  --moderate: #ffc857;
  --busy: #ff7a6b;
  --closed: #dfe5ea;
  --accent: #4aa8d8;
}

* { box-sizing: border-box; }
html { background: var(--sky-bottom); }
body {
  margin: 0; min-height: 100vh; font-family: Fredoka, system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 480px);
}
.page { max-width: 1240px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink);
  animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }

/* header */
.head { padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.1; }
h2 { margin: 0; font-size: 20px; font-weight: 700; }
.controls { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }
.seg button {
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); background: none; border: 0;
  padding: 4px 16px; border-radius: 999px; cursor: pointer; transition: transform .15s, background .2s;
}
.seg button:hover { background: #eef7fb; }
.seg button.on { background: var(--accent); color: #fff; }
.seg[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loc-picker {
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231f2d3d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center / 12px 8px;
  appearance: none; -webkit-appearance: none; border: 2px solid var(--ink); border-radius: 999px;
  padding: 6px 34px 6px 14px; cursor: pointer; max-width: 100%;
}
.loc-picker:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
body.loading .now-card, body.loading .heat-card { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* now card */
.now-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); overflow: hidden; }
.pool-wrap { position: relative; min-width: 0; border-right: 2.5px solid var(--ink); background: linear-gradient(180deg, #e3f5fc, #f6fbf8); }
.pool-scene { height: 440px; overflow: hidden; }
.pool-scene canvas { display: block; }
.pool-closed {
  position: absolute; top: 14px; left: 14px; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 14px;
}
.pool-hint {
  position: absolute; left: 14px; bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: rgba(255, 250, 240, .85); padding: 3px 10px; border-radius: 999px; pointer-events: none;
  transition: opacity .3s;
}
.pool-hint.gone { opacity: 0; }
.follow-bar {
  position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  pointer-events: none; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1) both;
}
.follow-info {
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; padding: 4px 12px; border-radius: 999px;
}
.zoom-out {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 12px; box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s;
}
.zoom-out:hover { transform: translateY(-1px); background: #fff; }
.zoom-out:active { transform: translateY(1px); box-shadow: 1px 1px 0 var(--ink); }
.summary { min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slot-when { font-weight: 600; color: var(--muted); }
.back {
  font: inherit; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.back:hover { background: #eef7fb; }
.big { display: flex; align-items: center; gap: 14px; }
.big-num {
  width: 76px; height: 76px; flex: none; border-radius: 20px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  display: grid; place-items: center; font-size: 40px; font-weight: 700; background: var(--closed); transition: background .3s;
}
.big-of { font-size: 18px; font-weight: 600; }
.big-status { font-size: 14px; color: var(--muted); }
.weather[hidden] { display: none; }
.weather {
  display: grid; grid-template-columns: 48px 1fr; gap: 4px 12px; align-items: center;
  padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: #f3fbff;
}
.weather svg { display: block; }
.w-icon { grid-row: span 2; }
.w-main { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.w-temp { font-size: 22px; font-weight: 700; }
.w-tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1.5px solid currentColor; border-radius: 999px; padding: 0 6px; }
.w-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.w-sub span { display: inline-flex; align-items: center; gap: 4px; }
.w-sub b { color: var(--ink); font-weight: 600; }
.w-gusty { color: #c2410c; font-weight: 600; }
.w-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.tips { list-style: none; margin: 0; padding: 12px 0 0; border-top: 2px dashed var(--line); display: flex; flex-direction: column; gap: 10px; }
.tips li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 15px; line-height: 1.35; }
.tips .ico { display: flex; padding-top: 1px; }
.tips .ico svg { display: block; }
.tips small { display: block; color: var(--muted); font-size: 13px; }

/* heatmap */
.heat-card { padding: 16px; }
.heat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heat-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.updated { font-size: 13px; color: var(--muted); }
.hint { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); display: inline-block; }
.sw.quiet { background: var(--quiet); }
.sw.moderate { background: var(--moderate); }
.sw.busy { background: var(--busy); }
.sw.closed { background: repeating-linear-gradient(45deg, var(--closed) 0 3px, #fff 3px 6px); }

.heat-scroll { overflow-x: auto; padding: 6px; margin: -6px; }   /* room for the selected cell's outline */
.heatmap { display: grid; gap: 3px; min-width: 0; }
.hm-corner, .hm-col, .hm-row { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; }
.hm-col { justify-content: flex-start; white-space: nowrap; }
.hm-row { justify-content: flex-end; padding-right: 8px; white-space: nowrap; gap: 5px; }
.hm-row.today { color: var(--ink); }
.hm-row.today b { background: var(--ink); color: var(--paper); padding: 0 7px; border-radius: 999px; }
.hm-row small { font-weight: 500; }

.cell {
  position: relative; height: 34px; border-radius: 6px; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--c, var(--closed));
  transition: transform .12s, box-shadow .12s, opacity .3s;
  animation: cellIn .35s ease-out both; animation-delay: var(--d, 0s);
}
.cell:hover, .cell:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--ink); z-index: 1; outline: none; }
.cell.closed { background: repeating-linear-gradient(45deg, var(--closed) 0 4px, #f4f6f8 4px 8px); color: transparent; }
.cell.past { opacity: .28; color: transparent; }
.cell.hour { margin-left: 3px; }
.cell.now { box-shadow: 0 0 0 2.5px var(--ink); z-index: 2; }
.cell.now::after {
  content: 'NOW'; position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
  font-size: 9px; letter-spacing: .06em; color: var(--paper); background: var(--ink); padding: 1px 5px; border-radius: 999px;
  animation: bob 1.6s ease-in-out infinite;
}
.cell.selected { box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--ink); z-index: 3; }

.tooltip {
  position: fixed; z-index: 10; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
  padding: 6px 10px; font-size: 13px; white-space: nowrap;
}
.tooltip b { font-size: 16px; }
.tooltip .muted { color: var(--muted); }

@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cellIn { from { opacity: 0; transform: scale(.6); } to { transform: none; } }
@keyframes bob { 50% { transform: translate(-50%, -3px); } }

@media (max-width: 860px) {
  .now-card { grid-template-columns: minmax(0, 1fr); }   /* minmax: let the canvas column shrink below the canvas width */
  .pool-wrap { border-right: 0; border-bottom: 2.5px solid var(--ink); }
  .pool-scene { height: 260px; }
}
@media (max-width: 720px) {
  .page { padding: 12px; gap: 12px; }
  h1 { font-size: 21px; }
  .cell { height: 26px; font-size: 12px; }
  .cell.hour { margin-left: 0; margin-top: 3px; }
  .hm-col { display: block; text-align: center; line-height: 1.15; padding-bottom: 2px; }   /* block so the <br> between day and date works */
  .hm-col small { font-weight: 500; font-size: 10px; }
  .hm-row { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .cell, .cell.now::after { animation: none; }
}
.heatmap.static .cell { animation: none; }
.follow-bar[hidden] { display: none; }

/* server-rendered summary, 7-day plan and directory (#seo) */
.info { padding: 18px 20px; font-size: 15px; line-height: 1.45; }
.info:empty { display: none; }
.info h2 { margin: 4px 0 8px; }
.info h2 + p, .info p { margin: 6px 0; }
.info .asof { color: var(--muted); font-size: 14px; }
.info .now-list { margin: 6px 0 12px; padding-left: 18px; }
.info .now-list li { margin: 4px 0; }
.info details { border: 2px solid var(--ink); border-radius: 12px; background: #fff; margin: 8px 0; overflow: hidden; }
.info summary { cursor: pointer; font-weight: 600; padding: 8px 12px; }
.info details[open] summary { border-bottom: 2px dashed var(--line); }
.info a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.plan { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan th, .plan td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.plan thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan tbody tr:last-child th, .plan tbody tr:last-child td { border-bottom: 0; }
.plan small { color: var(--muted); font-weight: 500; }
.info .table-wrap { border: 2px solid var(--ink); border-radius: 12px; background: #fff; overflow-x: auto; margin: 8px 0; }
.info details { overflow-x: auto; }
.info .addr { color: var(--muted); font-size: 14px; margin-top: 12px; }
.dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 16px; }
.dir h3 { margin: 6px 0 2px; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.dir ul { list-style: none; margin: 0; padding: 0; }
.dir li { padding: 2px 0; }
.info .disclaimer { margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--line); color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .info { padding: 16px 14px; }
  .plan { font-size: 13px; }
  .plan th, .plan td { padding: 6px 7px; }
}
