/* The balcony write-up's figures and lists, ported from aptsounds.dill.fish
   (~/Sound tracker, web/public/styles.css) and recoloured for dill.fish: white
   paper, the bobber sketch's ink, the system font. The four chart colours keep
   apart for colour-blind readers by hue and lightness: red horns, ochre bells,
   ink music, light steel-blue motorcycles. */
:root {
  --paper: #fff;
  --paper-deep: #eee;
  --ink: #000;
  --ink-2: #555;
  --muted: #707070;
  --hairline: rgba(0, 0, 0, .15);
  --vermilion: #b23b2a;
  --ochre: #b07b37;
  --steel: #6b8db5;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.hint-tap { display: none; }
@media (hover: none) {
  .hint-click { display: none; }
  .hint-tap { display: inline; }
}

/* The reading column. */
.summary-page { display: flex; flex-direction: column; gap: 22px; }
.summary-page h1 { margin-bottom: 6px; }
.summary-page > p { font-size: 1.1rem; line-height: 1.6; }
.summary-page a { color: inherit; text-underline-offset: 3px; }
.summary-figure, .summary-songs { margin: 10px 0 6px; }
.summary-figure h2 { font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.kicker { margin: 0 0 5px; color: var(--muted); font: 10px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.summary-links ul { padding: 0 0 0 1.1em; font-size: 1rem; line-height: 1.7; }

/* The daily rhythm: room above the bars for the chosen bar's label. */
.rhythm { position: relative; padding-top: 40px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.rhythm:focus { outline: none; }
.rhythm:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 6px; }
.rhythm-plot { height: 110px; display: flex; align-items: stretch; gap: 3px; border-bottom: 1px solid var(--hairline); }
.rhythm-hours { --bar: var(--ink); }
.rhythm-bar { flex: 1; min-width: 0; display: flex; align-items: flex-end; cursor: pointer; }
.rhythm-bar i { display: block; width: 100%; height: var(--h); min-height: 1px; background: var(--bar); opacity: .35; transition: opacity 120ms ease; }
.rhythm-bar.is-hi i { opacity: 1; }
.rhythm-axis { position: relative; height: 22px; }
.rhythm-axis span { position: absolute; top: 6px; transform: translateX(-50%); color: var(--muted); font: 9px var(--mono); white-space: nowrap; }
.rhythm-label { position: absolute; left: 0; bottom: 0; z-index: 2; margin: 0; padding: 3px 8px; border: 1px solid var(--hairline); border-radius: 4px; background: var(--paper); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); color: var(--ink); font-size: 14px; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.rhythm-label:empty { display: none; }
.rhythm-label b { font-weight: 600; }

/* "When the weather turned": the lines, the rain wash, Labor Day dashed. */
.chart-readout { min-height: 17px; margin: 12px 0 4px; color: var(--ink-2); font: 11px/1.4 var(--mono); letter-spacing: .03em; }
.chart-readout strong { color: var(--ink); font: 600 14px system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
.deviations-readout { min-height: 19px; }
.deviations-readout .deviation-piece { white-space: nowrap; }
.deviations-readout b { color: var(--ink); font-weight: 600; }
.deviations-chart { position: relative; height: 260px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.deviations-chart svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.deviations-chart:focus { outline: none; }
.deviations-chart:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 6px; }
.chart-grid { stroke: var(--hairline); stroke-width: 1; }
.chart-axis { fill: var(--muted); font: 8px var(--mono); }
.stats-line { fill: none; stroke: var(--line, var(--ink-2)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: opacity 140ms ease, stroke-width 140ms ease; }
.has-hi .stats-line { opacity: .22; }
.has-hi .stats-line.is-hi { opacity: 1; stroke-width: 3.2; }
.stats-dot { fill: var(--paper); stroke: var(--line, var(--ink)); stroke-width: 2.4; pointer-events: none; }
.deviation-horn { --line: var(--vermilion); }
.deviation-bell { --line: var(--ochre); }
.deviation-music { --line: var(--ink); }
.deviation-motorcycle { --line: var(--steel); }
.deviation-rain { fill: var(--ink); opacity: .06; }
.deviation-holiday { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.deviation-holiday-label { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.deviation-cursor { stroke: var(--ink); opacity: .28; pointer-events: none; }
.deviations-caption { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* The pills: one shows its line alone (the others fade). */
.line-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 8px; margin-top: 12px; }
.line-pill { display: inline-flex; align-items: stretch; border: 1px solid var(--hairline); border-radius: 999px; background: var(--paper); }
.line-pill.is-locked { border-color: var(--line, var(--ink-2)); box-shadow: inset 0 0 0 1px var(--line, var(--ink-2)); }
.line-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 11px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font: 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.line-chip:focus { outline: none; }
.line-chip:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.chip-swatch { width: 16px; height: 0; border-top: 2.5px solid var(--line, var(--ink-2)); }

/* The four lists: one line per recording, the cover (album art, or the
   illustration of the bird or the sound) is the play button. */
.summary-songs .song-list { margin-top: 8px; }
.song-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--hairline); }
.song { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--hairline); }
.song.is-condensed { align-items: center; padding: 12px 0; }
.song-cover { display: block; width: 64px; height: 64px; object-fit: cover; background: var(--paper-deep); box-shadow: 0 2px 6px rgba(0, 0, 0, .14); }
.song-cover.is-illustration { object-fit: contain; background: var(--paper); }
.song-meta { min-width: 0; }
.song-title { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.song-artist { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.song-heard { margin: 5px 0 0; color: var(--muted); font: 10px/1.4 var(--mono); letter-spacing: .04em; }
.song-play { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; text-align: left; text-decoration: none; }
.song-play:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 3px; }
.song-play.is-cover { position: relative; display: block; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 0; background: none; }
.song-icon { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--ink); border-radius: 50%; }
.song-icon svg { width: 12px; height: 12px; fill: currentColor; pointer-events: none; }
.song-play.is-cover .song-icon { position: absolute; inset: 0; margin: auto; background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--ink); }
.song-play.is-cover:hover .song-icon { background: var(--paper); }
.song-play .icon-stop, .song-play[aria-pressed="true"] .icon-play { display: none; }
.song-play[aria-pressed="true"] .icon-stop { display: block; }
.song-play[aria-pressed="true"] .song-icon,
.song-play.is-cover[aria-pressed="true"]:hover .song-icon { border-color: var(--vermilion); background: var(--vermilion); color: var(--paper); }

@media (max-width: 760px) {
  .deviations-readout { min-height: 34px; }
}
@media (max-width: 620px) {
  .deviations-chart { height: 200px; }
  /* The heard line stays on one line beside the cover on a phone. */
  .song-heard { font-size: clamp(8.5px, calc((100vw - 92px) / 29.9), 10px); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .song { grid-template-columns: 52px minmax(0, 1fr); gap: 10px 12px; padding: 14px 0; }
  .song-cover, .song-play.is-cover { width: 52px; height: 52px; }
  .song-title { font-size: 1rem; }
  .song-icon { width: 28px; height: 28px; }
}
@media (max-width: 359px) {
  .deviations-readout { min-height: 50px; }
}
