/*
 * Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
  --bg: #0f172a; --panel: #1e293b; --line: #334155; --ink: #f8fafc;
  --dim: #adbbcc; --accent: #5ccbfa; --accent-visited: #c4b5fd;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* No text below 13px, and running text 15px, 16px on a phone (tech.textSizeFloor). Secondary
   text -- codes, badges, tags, notes -- is 13px, not smaller; hierarchy comes
   from weight and color. */
h1 { font-size: 22px; margin: 0 0 4px; }
.sub, .count, footer { color: var(--dim); font-size: 13px; }
footer { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 12px; max-width: 80ch; }
/* Every link is colored here, not per-component. A link with no rule inherits
   the browser default -- #0000EE unvisited, #551A8B visited -- which against
   this background is 1.9:1 and 1.6:1, effectively invisible. That is exactly
   what happened to the iNaturalist link on the detail page (tech.textContrastFloor, app.noTextBelowContrastFloor). */
a { color: var(--accent); }
a:visited { color: var(--accent-visited); }
footer a { color: var(--accent); }
footer a:visited { color: var(--accent-visited); }
.credits { list-style: none; padding: 0; margin: 8px 0; }
.credits li { margin-bottom: 6px; }
.credits b { color: var(--ink); font-weight: 600; }
.caveat { margin-top: 10px; }

.lbl { color: var(--dim); font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  margin: 0 4px 0 14px; }
.btn, .chip { display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  background: #0b1220; border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 6px; font-size: 13px; }
/* Family chips get their background and text color inline, generated together
   so the pair clears 7:1. These defaults only reach chips without one, like
   a chip with no family. */
.btn, .chip, .btn:visited, .chip:visited { color: var(--ink); }
.btn.on, .btn.on:visited { background: var(--accent); color: #06283d; border-color: var(--accent); font-weight: 600; }
/* Here is a button, not a link, so it needs the link buttons' font. Inactive
   until the script enables it: dotted, and
   with the text at full contrast, because the floor holds for inactive
   controls too (product.hereSelectsLocalRegion). */
.here { font: inherit; font-size: 13px; cursor: pointer; }
/* Here and Now act rather than choose, so they are colored apart, as Reset is, in green
   (product.nextView). */
.btn.act, .btn.act:visited { background: #12321f; border-color: #2f8050; color: var(--ink); }
.here[aria-disabled="true"] { border-style: dotted; background: transparent; cursor: not-allowed; }
.herestatus { color: var(--ink); font-size: 13px; }
.welcome { margin: 6px 0 0; font-size: 15px; }
.welcomestatus { display: block; margin-top: 4px; color: var(--ink); }
.welcomestatus:empty { display: none; }
.herestatus:empty { display: none; }
.chip.on { font-weight: 600; outline: 2px solid var(--accent); outline-offset: 1px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.hint { color: var(--dim); font-size: 13px; font-style: italic; }

.btn b { font-weight: 600; margin-left: 6px; opacity: .8; }
/* Sub-text inside a colored chip inherits the chip's own text color. A fixed
   gray ignores whether the chip is light or dark and goes unreadable on both --
   it made the common name invisible on Anatidae, Columbidae, and a dozen others.
   Hierarchy comes from weight and size, not from dimming, so every character
   keeps the 7:1 ratio the background was chosen for (tech.badgeContrast). */
.chip:visited em, .chip em { font-style: normal; color: inherit; font-weight: 400; font-size: 13px; }
.chip b { color: inherit; font-weight: 700; font-size: 13px; }
.chip em::before { content: "\00b7"; margin: 0 5px; }
.chip b::before { content: ""; margin-left: 7px; }
.count { margin: 4px 0 0; }
/* [hidden] must beat every display rule. */
[hidden] { display: none !important; }
.search { margin: 8px 0 0; }
.search input { width: min(420px, 100%); box-sizing: border-box; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; }
.search input::placeholder { color: var(--dim); opacity: 1; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The pin is a sibling of the tile link, laid over the tile -- the tile itself
   still opens the detail view, so it cannot contain this. */
.tilewrap { position: relative; display: block; }

.pickaction { margin: 10px 0 0; }

h2 { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 8px; color: var(--accent); }
/* One bar per tier (product.tierHistogram). A tier of one bird keeps a sliver
   so it can still be seen and clicked. */
.hist { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 10px 0 4px;
  border-bottom: 1px solid var(--line); }
.hist a, .hist .gap { flex: 1 1 0; max-width: 22px; }
.hist a { min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.hist a:hover, .hist a:focus { background: var(--ink); }
/* Right after the range, in the count line's style (product.sectionHeadersStateRange). */

.tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.tile { width: 396px; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; text-decoration: none; color: inherit; display: block; }
.tile:visited { color: inherit; }
.tile:hover { border-color: var(--accent); }
.tile.big, .tilewrap.big { width: min(760px, 100%); }
/* The species page's tile names every segment and carries the full badge, so
   its first measurement line and its line under the rule may wrap
   (product.tileContents); no neighboring tile depends on its height. */
.tile.big .ft, .tile.big .idline { flex-wrap: wrap; row-gap: 4px; }
/* The header is ONE line (product.tileContents), and stays one line at any name length.

   It did not. "Greater Necklaced Laughingthrush (GNLA)" wrapped its banding
   code onto a second line, which made that tile taller than its neighbors --
   and because .tiles is a flex row, one tall tile leaves the rest of the row
   ragged, with the diagrams no longer at a common vertical offset. Comparing
   down a section is what the index is for, so a tile out of step costs more
   than a truncated word does. 8 of 841 names are long enough to do it.

   What gives way, in order: the scientific name first, then the common name.
   The banding code never does. It is six fixed characters, and it is the one
   part a reader cannot reconstruct from a truncation. */
.nameline { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; }
.cn { font-size: 15px; font-weight: 700; display: flex; align-items: baseline;
  gap: 5px; min-width: 0; flex: 0 1 auto; }
.cnname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn .code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim);
  font-weight: 500; flex: none; }
/* The find box's list writes the codes as the tiles do. */
.finds li .code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); }
/* Right-justified on the same line, and the first to give up room: it shrinks
   twenty times faster than the common name beside it. */
.sn { font-size: 13px; font-style: italic; color: var(--dim); margin-left: auto;
  text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 20 auto; min-width: 0; }
/* A tile's line under its rule (product.tileContents, decisions.tileMeasurementLines): the
   short family badge, then the scientific name, which gives way first. */
.idline { display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; }
.idline .sn { margin-left: 0; text-align: left; flex: 0 20 auto; }
.lo { border-top: 1px solid var(--line); padding-top: 7px; }
/* The short family badge leads the line and gives way after the scientific
   name. A rule closes the header above the drawing (product.tileContents). */
.idline .badge { margin: 0; flex: 0 1 auto; min-width: 0; }
.tile .hd { border-bottom: 1px solid var(--line); padding-bottom: 7px; }

/* The drawing and its one label, the mass beside its cube (product.tileContents). The label
   is page text laid over the drawing, placed in percent of it so it follows the
   cube as the drawing scales, and set in the measurement lines' font so it keeps
   their size at any width, which SVG text did not (tech.textSizeFloor). Its box is trimmed
   to the alphabetic baseline, so bottom: puts the baseline on the cube's foot. */
.dwrap { position: relative; margin: 8px 0; }
.ml { position: absolute; white-space: nowrap; text-box: trim-end cap alphabetic;
  font: 13px system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums;
  color: var(--dim); }
.ml.est::after { content: "~"; color: var(--accent); margin-left: 2px; }
/* A measurement's name in exactly its part's color (product.labeledDetailDiagram). */
.k-bill { color: #fbbf24; }
.k-tail { color: #ffffff; }
.k-wing { color: #34d399; }
.k-chord { color: #ffc7f7; }
.k-mass { color: #7dd3fc; }
/* The notes come last, so only the part under the drawing grows. */
.notes { min-width: 0; }

.badge { display: inline-block; font-size: 13px; font-weight: 600;
  border-radius: 4px; padding: 1px 6px; margin-top: 4px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: bottom; }
.badge em { font-style: normal; font-weight: 400; }
.badge em::before { content: "\00b7"; margin: 0 4px; }
/* The measurement lines: a proportional face with figures of even width, so
   numbers line up down a column and the lines fit a phone at 13px, which
   monospace did not (product.tileContents, decisions.textSizeFloor). */
.ft { display: flex; flex-wrap: nowrap; gap: 12px; font: 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--dim); margin-top: 4px; white-space: nowrap; }
.ft .est::after { content: "~"; color: var(--accent); margin-left: 2px; }
/* The share line (product.shareOfRecords): how much of what the regions in view record is
   this bird. Below the three measurements, because it is not one -- it is a
   fact about how often the bird is reported. Set like them,
   truncated rather than wrapped, since it sits above the drawing and a
   second line would push that tile's drawing out of step with its row. */
.share { font: 13px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; color: var(--dim);
  margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share b { font-weight: 600; color: var(--ink); }
.share .nodata { opacity: .6; }

.dia { display: block; width: 100%; height: auto; }
/* Strokes keep their width whatever the drawing's scale, so the species page's
   larger tile is not drawn in heavier lines than the home page's. */
.dia line, .dia path, .dia ellipse, .dia polygon, .dia rect { vector-effect: non-scaling-stroke; }
.tile.big .nameline { gap: 16px; }
.tile.big .cn { font-size: 20px; }
.tile.big .sn { font-size: 15px; }
/* The parts' colors (product.oneDiagramVocabulary, decisions.partColorsRevised): amber bill, white tail, emerald
   wing with an orchid chord, blue cube, gray for the modeled head, neck, and
   body. Each measured part's color is also its name's text color, so each
   clears 7:1, and every two parts differ by a ΔE00 of 10 or more for normal
   and color-blind vision (TestPartColorsHoldApart). */
.bill { stroke: #fbbf24; stroke-width: 2; }
.head { fill: #475569; stroke: #94a3b8; stroke-width: 1.2; }
.neck { stroke: #94a3b8; stroke-width: 2; fill: none; }
.body { stroke: #64748b; stroke-width: 5; stroke-linecap: butt; }
.tail { stroke: #ffffff; stroke-width: 2; stroke-dasharray: 5 3; }
.junction { stroke: #cbd5e1; stroke-width: 1.5; }
/* The crossbar is GREEN, not blue, and both halves of that matter.

   Blue belongs to the mass cube, where it reads as the water it depicts. The
   crossbar was #0ea5e9 and the cube #38bdf8 -- near-identical hue and
   luminance -- so the one mark that is NOT a length looked like a matched set
   with the mark whose entire point is that it IS a length to scale (product.crossbarAtVerticalScale).
   TestPartColorsHoldApart now holds it apart from every other part, for
   color-blind vision too.

   It is also TEXT: the name Wingspan takes it (.k-wing), and it clears the 7:1
   floor (tech.textContrastFloor). #0ea5e9 would not have. */
.wing { stroke: #34d399; stroke-width: 2.5; stroke-linecap: round; }
/* The chord: the crossbar's measured outer segments, orchid, ending at the ticks. */
.chord { stroke: #ffc7f7; stroke-width: 2.5; stroke-linecap: round; }

.back a, .back a:visited { color: var(--accent); text-decoration: none; }
.prov { border-collapse: collapse; margin-top: 8px; max-width: 100ch; }
.prov th { text-align: left; padding: 7px 14px 7px 0; font-weight: 600; white-space: nowrap;
  border-top: 1px solid var(--line); vertical-align: top; }
.prov td { padding: 7px 14px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.prov .v { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.prov .d { color: var(--dim); font-size: 13px; }
.tag { font-size: 13px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.t-measured { background: #86efac; color: #000; }
.t-near-match { background: #fde047; color: #000; }
.t-modeled { background: #cbd5e1; color: #000; }
/* Origins (product.categoryProvenance). Published is the same green as a measured number -- both
   mean "a source says so" -- while birdview is amber: not wrong, but this
   project's own call and worth the reader's eye. */
.t-published { background: #86efac; color: #000; }
.t-derived { background: #cbd5e1; color: #000; }
.t-birdview { background: #fdba74; color: #000; }
/* A continuation row carries a second value for the entry above it, so it
   drops the rule that would otherwise read as a new fact. */
.cats .cont th, .cats .cont td { border-top: none; padding-top: 0; }
.cats .v { white-space: normal; max-width: 52ch; }
.note { color: var(--dim); font-size: 13px; max-width: 70ch; margin-top: 18px; }
/* A served document (product.categoryProvenance), rendered from Markdown. Narrow measure because
   it is prose, not a control panel. */
.doc { max-width: 90ch; color: var(--ink); line-height: 1.65; }
.doc h1, .doc h2, .doc h3 { color: var(--ink); margin: 26px 0 8px; line-height: 1.3; }
.doc h1 { font-size: 22px; }
.doc h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.doc h3 { font-size: 16px; }
.doc p, .doc li { color: var(--dim); }
.doc strong, .doc b { color: var(--ink); font-weight: 600; }
.doc code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink);
  background: var(--panel); border-radius: 4px; padding: 1px 5px; }
.doc pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow-x: auto; }
.doc pre code { background: none; padding: 0; }
/* A diagram is drawn wider than the page; shrink it to fit, and it links to
   itself full size. */
.doc img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.doc table { border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left;
  vertical-align: top; color: var(--dim); }
.doc th { color: var(--ink); font-weight: 600; }
.doc blockquote { border-left: 3px solid var(--line); margin: 12px 0; padding: 0 0 0 14px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.empty { color: var(--dim); padding: 30px 0; }

.seealso { margin: 14px 0 0; }

/* The page for a bird BirdView classified and does not draw (product.undrawnSpeciesAnswer).

   The badge carries the verdict where a drawn bird's carries its family, and
   it declares its own background for the same reason the family badge does:
   the stylesheet contrast check skips a self-contained pair, and #f8fafc on
   #0b1220 is ~18:1, well clear of the 7:1 floor. Status is distinguished by
   the border, which is not text and carries no contrast duty -- the word
   itself is inside the badge. */
.badge.st-vagrant, .badge.st-historical, .badge.st-absent {
  background: #0b1220; color: #f8fafc; border: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .05em; }
.badge.st-vagrant { border-color: #f0b429; }
.badge.st-historical { border-color: #94a3b8; }
.badge.st-absent { border-color: #64748b; }
.tile.undrawn .verdict { margin: 12px 0 0; font-size: 16px; }
.tile.undrawn .verdict b { color: #f8fafc; }
.evidence { max-width: 70ch; margin: 0 0 10px; }

/* Stroke style carries provenance (product.measuredVersusModeled): solid measured, dashed modeled.

   Head, neck, and body are modeled for ALL 841 species, so that signal is
   CONSTANT. Only the wingspan varies, which is why the crossbar splits: its
   outer thirds are the measured chord and stay solid, and only the inner span
   -- which absorbs the whole model error -- is dashed.

   The body takes the crossbar's treatment: 2.5px, 6/3 dash, round caps, with
   color alone separating them (body #64748b, wing #34d399).

   The NECK keeps a finer 3/2 pattern on butt caps, and that is not an
   inconsistency to tidy away. Round caps extend every dash by half the stroke
   width at each end, so 6/3 at 2.5px paints 8.5 and leaves 0.5 -- fine on a
   body, which is tens of pixels long, and useless on a neck. A median bird's
   neck is about 8px at its own scale and a hummingbird's about 6, so a single
   8.5px lozenge covers the whole segment and the thing reads solid: the exact
   opposite of what it is meant to say. 3/2 on butt caps still shows a real gap
   at 6px.

   The tail is SOLID here: it is measured, and the dash it used to carry meant
   only "this is the tail", a job the junction mark already does. */

.dia .head     { fill: none; }
.dia .neck     { stroke-dasharray: 3 2; }
.dia .body     { stroke-width: 2.5; stroke-dasharray: 6 3; stroke-linecap: round; }
.dia .tail     { stroke-dasharray: none; }
.dia .wing.est { stroke-dasharray: 6 3; }
.chordtick          { stroke: #ffc7f7; stroke-width: 1.5; opacity: .85; }
.diagramkey { margin-top: 16px; max-width: 80ch; }

/* Mass as water (product.labeledDetailDiagram). Tinted rather than outlined only: it is a volume, not
   a length, and a bare outline in a figure made of lines reads as one more
   measurement. Dashed when the mass is not measured, like every other
   estimated stroke. */
.masscube polygon, .masscube rect { stroke: #7dd3fc; stroke-width: 1; }
.mcface { fill: #7dd3fc3d; }
.mctop  { fill: #7dd3fc66; }
.mcside { fill: #7dd3fc1f; }
.masscube.est polygon, .masscube.est rect { stroke-dasharray: 4 3; }

/* A caveat on a tile's figures: a count that covers two species, because
   a source does not separate them (product.namesRecordsFiledUnder), a bird the month filter
   declined to judge (decisions.monthPresence), or measurements borrowed from another bird. Marked on the tile, not only on the detail
   page: the index is where the misreading happens. Amber on the tile's own
   surface, checked against the 7:1 floor like every other text color. On a
   tile they are its notes, last (product.tileContents).

   5px above, so a caveat does not sit flush against the line before it. */
.seam { display: block; margin-top: 5px; color: #f0b429; font-size: 13px; font-style: italic; }

/* A phone held upright (product.fitsAPhone). Nothing may reach past the edge of
   the window or out of the box it sits in, down to 360px. A table too wide to
   fit scrolls inside itself rather than taking the page with it. */
/* Under 420px a home-page tile is narrower than its full 396px and stands alone in its row, so its
   measurement lines wrap, between measurements only, rather than run out of the tile in a wider font
   (decisions.measurementLinesWrapOnPhones). */
@media (max-width: 419px) { .tile .ft { flex-wrap: wrap; row-gap: 2px; } }
@media (max-width: 600px) {
  body { padding: 16px 12px; font-size: 16px; }
  .tilewrap { max-width: 100%; }
  code { overflow-wrap: anywhere; }
  .prov, .doc table { display: block; max-width: 100%; overflow-x: auto; }
}

/* The home page (product.nextView). Each setting on the count line is
   a <details>; its choices open beneath it, over the birds, so the page does
   not move when one is opened. */
.key { color: var(--dim); font-size: 13px; margin: 6px 0 0; }
.key b { color: var(--ink); font-weight: 600; }
.next > header { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.settitle { font-size: 18px; font-weight: 600; margin: 12px 0 6px; border-bottom: 0; padding-bottom: 0; }
.showrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.next .count { position: relative; margin-top: 10px; }
.next .countrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.next .countrow + .countrow { margin-top: 6px; }
.shownline { color: var(--dim); font-size: 13px; margin: 4px 0 8px; }
/* The First choice in Show: a button holding the count's box. */
.showfirst { margin: 0; cursor: pointer; }
.showfirst button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.showfirst .cap { width: 5.5ch; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; text-align: right;
  -moz-appearance: textfield; appearance: textfield; }
.showfirst .cap::-webkit-inner-spin-button, .showfirst .cap::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.showfirst .cap::placeholder { color: var(--dim); opacity: 1; }
.showfirst .cap:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Under its own setting. On a phone without the placing script, under the
   whole count line instead, since a setting at the right would open its
   choices off the screen. */
.ctl { position: relative; }
@media (max-width: 600px) { .count:not(.placed) .ctl { position: static; } }
.ctl > summary { list-style: none; cursor: pointer; background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--ink); }
.ctl > summary::-webkit-details-marker { display: none; }
.ctl > summary::after { content: " \25BE"; color: var(--dim); }
.ctl[open] > summary { border-color: var(--accent); }
.ctl > summary b { font-weight: 600; margin-right: 5px; }
.pop { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: max-content;
  max-width: min(720px, calc(100vw - 16px)); max-height: 60vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.pop p { margin: 0 0 8px; }
.popgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
.popgroup .lbl { flex-basis: 100%; margin: 4px 0 0; }
.popgroup.oneline { flex-wrap: nowrap; }
.popgroup.oneline .btn { padding-left: 7px; padding-right: 7px; }
.popgroup.oneline > * { flex: none; }
/* A setting that takes one choice: its choices as one joined row (product.chooseOneSettings). */
.seg { display: inline-flex; flex-wrap: wrap; margin-bottom: 8px; }
.seg > .btn { border-radius: 0; margin: 0 -1px 0 0; }
.seg > .btn:first-child { border-radius: 6px 0 0 6px; }
.seg > .btn:last-child { border-radius: 0 6px 6px 0; margin-right: 0; }
.seg > .btn.on { position: relative; }
.popgroup .sep { align-self: stretch; width: 1px; background: var(--dim); margin: 2px 4px; }
/* Habitat: the group names in a column, set against one rule that runs the column's height, then
   each group's habitats, wrapping under themselves. */
.leads { display: grid; grid-template-columns: max-content 1fr; gap: 0 8px; align-items: start; margin-bottom: 8px; }
.leads > .lead { justify-self: end; display: flex; gap: 4px; margin-bottom: 8px; }
.leads > .popgroup { border-left: 1px solid var(--dim); padding-left: 8px; align-self: stretch;
  align-items: flex-start; align-content: flex-start; margin-bottom: 0; padding-bottom: 8px; }
.leads > .popgroup.norule { border-left-color: transparent; }
/* Reset looks like a setting, set apart by its color. */
.reset, .reset:visited { background: #3f1d1d; border: 1px solid #8b3a3a; border-radius: 4px;
  padding: 1px 7px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.showrow .reset { padding: 3px 6px; border-radius: 6px; }
.reset:hover { border-color: #f87171; }
.finds ul { list-style: none; padding: 0; margin: 8px 0; }
.finds li { margin: 4px 0; }
.finds .found { margin: 6px 0 0; color: var(--dim); }
/* The list's ×: closes it, dropping the find box's text. */
.finds .findclose, .finds .findclose:visited { display: inline-block; margin-right: 8px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none; }
.finds .findclose:hover { border-color: var(--accent); }
/* The pin: a push pin in a box, filled when the bird is pinned. On a tile it
   sits in the top-right corner, on the name line (product.tileContents). The tile's four parts
   (header, drawing, the names under the rule, notes) are rows of the
   wrapper's grid, shared through subgrid, so a tile stretched to its row's
   tallest neighbor fills its box, giving the extra height to the notes' row,
   which is last. The pin sits at the start of the header's row, 11px in from
   the top and right: the tile's 1px border and 10px padding. The eBird link
   sits at the end of the third row, under the rule. */
.pin, .pin:visited { display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--dim); vertical-align: middle; }
.pin svg { fill: currentColor; }
.pin:hover { border-color: var(--accent); color: var(--ink); }
.pin.on, .pin.on:visited { background: var(--accent); border-color: var(--accent); color: #06283d; }
.tilewrap { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, auto) 1fr; }
.tilewrap > .tile { grid-area: 1 / 1 / 5 / 2; display: grid; grid-template-rows: subgrid;
  grid-template-columns: minmax(0, 1fr); }
/* A grid item is as wide as its content unless told otherwise, and the name
   line never wraps: without this, a long name widened its tile and pushed the
   drawing off center instead of truncating (#4). */
.tilewrap > .tile > * { min-width: 0; }
.tilewrap > .pin { grid-area: 1 / 1 / 2 / 2; justify-self: end;
  align-self: start; margin: 11px 11px 0 0; z-index: 1; }
/* The eBird link: the word, never a logo (product.ebirdLink). In the lower-right corner, at
   the end of the line under the rule, its foot on that line's and 22px tall,
   so it stays within the band under the rule and the tile does not grow for
   it. The line keeps room for it. */
.tilewrap > .ebird { grid-area: 3 / 1 / 4 / 2; justify-self: end; align-self: end;
  margin: 0 11px 0 0; z-index: 1; }
/* The line keeps room for the link by holding an invisible copy of it, set in the link's own
   type, so the room is the link's width in whatever font the reader has rather than a width
   assumed from one font (product.tileContents). */
.tile .idline::after { content: "eBird"; visibility: hidden; flex: none; margin-left: auto;
  padding: 0 6px; border: 1px solid transparent; font-size: 13px; font-weight: 600; }
.ebird, .ebird:visited { display: inline-flex; align-items: center; height: 22px; padding: 0 6px;
  box-sizing: border-box; border: 1px solid var(--line); border-radius: 5px; background: var(--bg);
  color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.ebird:hover { border-color: var(--accent); }
/* The name line keeps room for the pin and is as tall as it, so the name
   truncates short of it and the measurements start below it. */
.tile .nameline { min-height: 28px; align-items: center; padding-right: 38px; }
.finds li { display: block; }
.finds li .pin { vertical-align: middle; margin-right: 8px; }
/* The pinned birds, under the find box: one line that wraps. */
.pinned { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 0; }
.pinned .lbl { margin: 0; }
.pinned ul { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; list-style: none; }
.pinned li { display: inline-flex; align-items: center; gap: 6px; }
.pinned .pin { width: 24px; height: 24px; }
/* Where unpinned birds are left out past the first 100: a full-width break in
   the tile grid saying how many are hidden there, with Show all. */
.tiles > .gap { flex: 0 0 100%; margin: 2px 0; padding: 6px 0; border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line); color: var(--dim); font-size: 13px; }
/* A tier's heading breaks the grid like a gap row. */
/* A tier heading's parts (label, range, count, back to top) each stay whole;
   on a narrow screen the heading wraps between them, never inside one. */
.tiles > .tierhd { flex: 0 0 100%; margin: 10px 0 0; font-size: 15px; font-weight: 600;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; white-space: nowrap; }
.tiles > .tierhd:first-child { margin-top: 0; }
.tierhd .tier { font-size: 13px; }
.tierhd .n { color: var(--dim); font-weight: 400; font-size: 13px; }
.tierhd .totop { font-weight: 400; font-size: 13px; }
/* The species page's Pin: a button with the pin and a word, filled when the
   bird is pinned on the home page. */
.pinaction { margin: 10px 0; }
.pinbtn svg { fill: currentColor; }
.pinbtn.on { background: var(--accent); border-color: var(--accent); color: #06283d; }

