/* Known records by advice class (js/weeds.js): swatch, tooltip, key in the layers panel, record card.
   Tokens come from app.css. A swatch takes its colour inline from CONFIG.triage, the ramp the cluster urgency uses:
   one hue, brighter means more urgent. A swatch is round because it stands for a dot on the map. */
.wd-sw{flex:none;display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--wd,var(--ink));box-shadow:0 0 0 1.5px var(--ground)}

/* Tooltip: name, date, class, reason. 296px of text and 2 x 10px of tooltip padding stay under 320px. */
.wd-tip{max-width:296px;white-space:normal}
.wd-tip p{margin:0}
.wd-tip em{font-style:italic;color:var(--ink-2)}
.wd-tip-date{color:var(--ink-2)}
.wd-tip-class{display:flex;align-items:center;gap:6px;margin-top:6px!important;padding-top:6px;box-shadow:inset 0 1px 0 var(--ring)}
.wd-tip-why{text-wrap:pretty}

/* Key under the "Known records" row: one line per advice class, set in under the row label. */
.wd-key{list-style:none;display:grid;gap:5px;margin:0;padding:0 4px 8px 28px}
.wd-key[hidden]{display:none}
.wd-key li{display:grid;grid-template-columns:10px 1fr;gap:8px;font-size:.75rem;line-height:1.35;color:var(--ink-2);text-wrap:pretty}
.wd-key .wd-sw{margin-top:3px}
.wd-key b{margin-right:2px;font-weight:600;color:var(--ink)}
.wd-n{color:var(--ink);font-variant-numeric:tabular-nums}
.wd-key li.wd-key-cap{display:none}
/* The panel has a fixed height. Where the key would make it scroll, weeds.js sets it beside the row as its own small panel. */
.wd-key.is-aside{position:fixed;z-index:20;width:320px;padding:10px 12px 12px;border-radius:var(--r-card)}
.wd-key.is-aside li.wd-key-cap{display:block;margin-bottom:2px;font-size:.6875rem;line-height:1.3;color:var(--ink)}
@keyframes wd-in{from{opacity:0;translate:-6px 0}}
@media (prefers-reduced-motion:no-preference){
  .wd-key.is-aside{animation:wd-in var(--t-state) var(--ease) both}
}
/* The panel staggers its children on entry. The key also appears when the switch turns on, so it does not wait its turn. */
#layersPanel .wd-key{animation-delay:0s}

/* Record card: the same parts as the cluster card (head, meta row, advice block, key and value rows). */
.wd-taxon{font-size:.8125rem;line-height:1.3;font-style:italic;color:var(--ink-2)}
.wd-also{margin-top:10px;font-size:.8125rem;line-height:1.4;color:var(--ink-2);text-wrap:pretty}
.wd-link{position:relative;padding:0;border:0;background:none;color:var(--ink);font:inherit;font-weight:500;text-decoration:underline;text-underline-offset:2px;cursor:pointer;transition:color var(--t-state) var(--ease)}
.wd-link::after{content:"";position:absolute;inset:-12px -6px}
.wd-link:hover{color:var(--gorse-bright)}
.wd-advice{padding:12px;border-radius:var(--r-card);background:rgba(255,255,255,.04);box-shadow:var(--inner-ring)}
.wd-advice-head{display:flex;justify-content:space-between;align-items:center;gap:var(--s-2)}
.wd-why{margin-top:10px;font:500 .9375rem/1.3 var(--font-sans);color:var(--ink);text-wrap:pretty}
.wd-rule{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:10px 0 0}
.wd-rule dt{padding-top:2px;font:400 .6875rem/1.5 var(--font-mono);text-transform:uppercase;letter-spacing:.08em;color:var(--ink-2)}
.wd-rule dd{margin:0;font-size:.8125rem;line-height:1.4;color:var(--ink);text-wrap:pretty}
.wd-kvs{margin:var(--s-2) 0 0}
.wd-kvs>div{display:flex;justify-content:space-between;align-items:baseline;gap:var(--s-3);padding:7px 0;box-shadow:inset 0 -1px 0 var(--ring)}
.wd-kvs>div:last-child{box-shadow:none}
.wd-kvs dt,.wd-kvs dd{margin:0;font-size:.8125rem;line-height:1.3}
.wd-kvs dt{flex:none;color:var(--ink-2)}
.wd-kvs dd{color:var(--ink);font-weight:500;text-align:right;font-variant-numeric:tabular-nums;text-wrap:pretty}
.wd-src{margin-top:var(--s-1);padding:0 12px}

/* An open record card can reach the lower right corner, so the map controls move to its left edge,
   as they do for the cluster card. The move uses translate, which .fx transitions only when motion is allowed. */
@media (width > 720px){
  body[data-mode="explore"]:has(#weedCard.is-open) .mapctl{translate:-360px 0}
}

@media (forced-colors:active){
  .wd-sw{forced-color-adjust:none}
}
