/* tree-key.css: /tools/tree-key/ only (loaded via pageCss).
   Tokens only, per the contract at the top of tokens.css. Every class is
   prefixed tk- and scoped under .tk, so the sheet is safe next to
   guild-page.css and homepage.css.

   The look is a field notebook: the key sits on a kraft "specimen tray" band,
   the answer tiles are cream cards with a walnut hairline, and the one loud
   element is the live count of trees still matching. Phones get one question
   per screen with a sticky footer; from 900px the tiles sit left and a
   shrinking grid of the trees still in play sits right. */

.tk {
  --tk-pad: clamp(16px, 5vw, 56px);
  --tk-measure: 720px;
  --tk-wide: var(--container-width);
  --tk-line: rgba(42, 33, 27, 0.22);
  --tk-tile-min: 120px;
  background: var(--color-bg-alt);
  padding: 40px var(--tk-pad) 56px;
  font-family: var(--font-sans);
  color: var(--color-text);
}
.tk__inner { max-width: var(--tk-wide); margin: 0 auto; }

.tk [hidden] { display: none !important; }

.tk-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.tk-btn {
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-sans-emphasis);
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  background: var(--cream);
  color: var(--color-accent);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tk-btn:hover { background: var(--color-accent); color: var(--cream); }
.tk-btn--primary { background: var(--color-accent); color: var(--cream); }
.tk-btn--primary:hover { background: var(--walnut); border-color: var(--walnut); }
.tk-btn--quiet { border-color: var(--tk-line); color: var(--color-text); }
.tk-btn--quiet:hover { background: var(--walnut); border-color: var(--walnut); color: var(--cream); }
.tk-btn:disabled { opacity: 0.45; cursor: default; }
.tk-btn:disabled:hover { background: var(--cream); color: var(--color-text); border-color: var(--tk-line); }
.tk-btn:focus-visible { outline: 3px solid var(--color-accent-warm); outline-offset: 2px; }

/* -------------------------------------------------------------------------
   Start screen: begin + lookup, side by side on wide screens
   ------------------------------------------------------------------------- */
.tk-start {
  display: grid;
  gap: var(--space-5);
  max-width: var(--tk-wide);
}
@media (min-width: 900px) {
  .tk-start { grid-template-columns: 1.15fr 1fr; align-items: start; }
}
.tk-start__main,
.tk-lookup {
  background: var(--cream);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 4vw, 36px);
}
.tk-start__title,
.tk-lookup__title {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: var(--font-size-xl);
  line-height: 1.25;
  margin: 0 0 var(--space-3);
}
.tk-start__lede,
.tk-lookup__lede {
  font-size: var(--font-size-base);
  line-height: var(--line-height-default);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
  max-width: 52ch;
}
.tk-start__go { width: 100%; max-width: 320px; font-size: var(--font-size-base); min-height: 56px; }
.tk-scope {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-5);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  cursor: pointer;
}
.tk-scope input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--color-accent); }
.tk-start__count {
  font-family: var(--font-serif);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: var(--space-3) 0 0;
}
.tk-start__count:empty { display: none; }

.tk-lookup__field input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--cream);
  border: 1px solid var(--tk-line);
  border-radius: var(--radius-md);
}
.tk-lookup__field input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.tk-lookup__results {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tk-lookup__results li { border-top: 1px solid var(--color-rule); }
.tk-lookup__results li:first-child { border-top: 0; }
.tk-lookup__results button {
  display: flex;
  width: 100%;
  gap: var(--space-3);
  align-items: baseline;
  text-align: left;
  padding: 12px 14px;
  min-height: 48px;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text);
}
.tk-lookup__results button:hover,
.tk-lookup__results button:focus-visible { background: var(--color-bg-alt); outline: none; }
.tk-lookup__results button:focus-visible { box-shadow: inset 3px 0 0 var(--color-accent-warm); }
.tk-lookup__results em { font-family: var(--font-serif); color: var(--color-text-muted); font-size: var(--font-size-sm); }
.tk-lookup__none { padding: 12px 14px; font-size: var(--font-size-sm); color: var(--color-text-muted); }

/* -------------------------------------------------------------------------
   Progress strip: one pill per trait, in the order asked so far
   ------------------------------------------------------------------------- */
.tk-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 2px 2px var(--space-3);
  margin-bottom: var(--space-4);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tk-strip__item {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 44px;
  padding: 6px 12px;
  font: inherit;
  font-size: var(--font-size-xs);
  line-height: 1.3;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--tk-line);
  border-radius: 100px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.tk-strip__item strong { font-weight: var(--font-weight-sans-emphasis); color: var(--color-text); }
.tk-strip__item.is-answered { background: var(--cream); border-color: var(--color-accent); }
.tk-strip__item.is-skipped { border-style: dashed; }
.tk-strip__item.is-current { border-color: var(--color-accent-warm); border-width: 2px; color: var(--color-text); }
.tk-strip__item.is-current strong { color: var(--color-accent-warm); }
.tk-strip__item:hover { background: var(--cream); }
.tk-strip__item:focus-visible { outline: 3px solid var(--color-accent-warm); outline-offset: 2px; }

/* -------------------------------------------------------------------------
   Stage: question left, live grid right (desktop)
   ------------------------------------------------------------------------- */
.tk-stage__cols { display: grid; gap: var(--space-6); }
@media (min-width: 900px) {
  .tk-stage__cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

.tk-question__kicker {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-sans-emphasis);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-warm);
  margin: 0 0 var(--space-2);
}
.tk-question__title:focus { outline: none; }
.tk-question__title {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}
.tk-question__help {
  font-size: var(--font-size-base);
  line-height: var(--line-height-default);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
  max-width: 52ch;
}
.tk-question__note {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: var(--space-3) 0 0;
}

/* Tiles */
.tk-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 420px) { .tk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tk-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-height: var(--tk-tile-min);
  padding: 0;
  font: inherit;
  text-align: left;
  color: var(--color-text);
  background: var(--cream);
  border: 1px solid var(--tk-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.tk-tile:hover { border-color: var(--color-accent); box-shadow: var(--shadow-card); }
.tk-tile:active { transform: scale(0.985); }
.tk-tile:focus-visible { outline: 3px solid var(--color-accent-warm); outline-offset: 2px; }
.tk-tile[aria-pressed="true"] {
  border: 2px solid var(--color-accent);
  box-shadow: inset 0 0 0 2px var(--cream), var(--shadow-card);
}

/* Picture block. With a photo: the photo is the tile and the botanical
   diagram sits as a small inset in the lower-left corner, the idealized
   shape next to the real leaf. Without a photo (is-nophoto): the diagram
   or hand-drawn icon fills the block on its own. */
.tk-tile__art {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
  overflow: hidden;
}
.tk-tile__photo-slot { position: absolute; inset: 0; }
.tk-tile__photo { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity var(--transition-default); }
.tk-tile__photo.is-loaded { opacity: 1; }
.tk-tile__diagram-slot { z-index: 1; }
.tk-tile__diagram-slot {
  position: absolute;
  left: 8px; bottom: 8px;
  width: 34%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 6%;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.tk-tile.is-nophoto .tk-tile__diagram-slot {
  position: absolute; inset: 0; left: 0; bottom: 0;
  width: 100%; aspect-ratio: auto;
  padding: 6% 22%;
  background: var(--color-bg);
  border: 0; border-radius: 0; box-shadow: none;
}
.tk-tile__diagram-slot svg { width: 100%; height: 100%; display: block; }
.tk-tile__diagram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  background: inherit;
  /* Invisible until it has loaded, so the inline icon shows beneath it
     in the meantime (a hidden img never lazy-loads, so no `hidden`). */
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.tk-tile__diagram.is-loaded { opacity: 1; }
/* Values with neither diagram nor photo keep the hand-drawn icon; nothing
   to inset, so no corner box. */
.tk-tile.is-nophoto.is-nodiagram .tk-tile__diagram-slot { padding: 10% 30%; }

.tk-tile__text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.tk-tile__label {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: var(--font-size-lg);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.tk-tile__check {
  display: none;
  width: 18px; height: 18px;
  flex: 0 0 auto;
  color: var(--color-accent);
}
.tk-tile[aria-pressed="true"] .tk-tile__check { display: inline-block; }
.tk-tile__hint {
  font-size: var(--font-size-xs);
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* Live grid of trees still in play (desktop only) */
.tk-live { display: none; }
@media (min-width: 900px) {
  .tk-live {
    display: block;
    position: sticky;
    top: 72px;
    background: var(--cream);
    border: 1px solid var(--color-rule);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    max-height: calc(100vh - 160px);
    overflow: auto;
  }
}
.tk-live__count {
  font-family: var(--font-serif);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}
.tk-live__count strong {
  display: block;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-serif-heading);
  line-height: 1;
  color: var(--color-text);
}
.tk-live__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-2);
}
.tk-live__item { font-size: 10px; line-height: 1.2; color: var(--color-text-muted); text-align: center; }
.tk-live__item figure { margin: 0; }
.tk-live__thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--color-accent);
  margin-bottom: 3px;
}
.tk-live__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tk-live__thumb svg { width: 60%; height: 60%; }
.tk-live__item figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-live__more { font-size: var(--font-size-xs); color: var(--color-text-muted); margin: var(--space-3) 0 0; }

/* -------------------------------------------------------------------------
   Sticky footer (phones and desktop)
   ------------------------------------------------------------------------- */
.tk-foot {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: var(--space-6) calc(-1 * var(--tk-pad)) calc(-56px);
  background: rgba(244, 238, 222, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-rule);
  padding: var(--space-3) var(--tk-pad);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
}
.tk-foot__inner {
  max-width: var(--tk-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.tk-foot__count {
  font-family: var(--font-serif);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.tk-foot__count strong {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-serif-heading);
  color: var(--color-text);
  line-height: 1;
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tk-foot__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tk-foot__actions .tk-btn { min-height: 44px; padding: 8px 14px; }
@media (max-width: 520px) {
  .tk-foot__inner { flex-wrap: nowrap; }
  .tk-foot__count { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.1; font-size: var(--font-size-xs); white-space: nowrap; }
  .tk-foot__count strong { text-align: left; min-width: 0; }
  .tk-foot__actions { gap: 6px; flex-wrap: nowrap; }
  .tk-foot__actions .tk-btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .tk-foot__actions .tk-btn--primary { padding: 8px 12px; }
}
.tk-foot__short { display: none; }
@media (max-width: 420px) {
  .tk-foot__long { display: none; }
  .tk-foot__short { display: inline; }
}
/* From 900px the live panel already carries the count during the key, so the
   footer keeps only the buttons there. */
@media (min-width: 900px) {
  .tk.is-key .tk-foot__count { display: none; }
  .tk.is-key .tk-foot__inner { justify-content: flex-end; }
}

/* -------------------------------------------------------------------------
   Results
   ------------------------------------------------------------------------- */
.tk-results__head { max-width: var(--tk-measure); margin-bottom: var(--space-5); }
.tk-results__title {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}
.tk-results__sub { font-size: var(--font-size-base); line-height: var(--line-height-default); color: var(--color-text-muted); margin: 0 0 var(--space-4); }
.tk-results__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tk-results__group {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: var(--font-size-lg);
  margin: var(--space-6) 0 var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--tk-line);
}
.tk-results__group:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.tk-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.tk-card {
  background: var(--cream);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tk-card--best { border-color: var(--color-accent); border-width: 2px; }
.tk-photo { margin: 0; position: relative; }
.tk-photo__frame {
  aspect-ratio: 3 / 2;
  background: var(--color-bg-alt);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--color-accent);
  position: relative;
}
.tk-photo__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tk-photo__frame svg { width: 36%; height: 36%; opacity: 0.7; }
@media (max-width: 899px) {
  .tk-photo__frame.is-empty { aspect-ratio: 3 / 1; }
  .tk-photo__frame.is-empty svg { width: 22%; height: 60%; }
}
.tk-photo__frame .tk-photo__none {
  position: absolute; bottom: 8px; left: 0; right: 0;
  text-align: center; font-size: var(--font-size-xs); color: var(--color-text-muted);
}
.tk-credit {
  font-size: var(--font-size-xs);
  line-height: 1.4;
  color: var(--color-text-muted);
  padding: 4px 12px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
}
.tk-credit a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
.tk-credit a:hover { color: var(--color-accent); }
.tk-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: var(--space-2); flex: 1 1 auto; }
.tk-card__name {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: var(--font-size-xl);
  line-height: 1.2;
  margin: 0;
}
.tk-card__latin { font-family: var(--font-serif); font-style: italic; color: var(--color-text-muted); font-size: var(--font-size-base); margin: 0; }
.tk-card__family { font-size: var(--font-size-xs); color: var(--color-text-muted); margin: 0; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  line-height: 1.2;
  padding: 4px 9px;
  border-radius: 100px;
  border: 1px solid var(--tk-line);
  color: var(--color-text-muted);
  background: var(--color-bg);
}
.tk-chip svg { width: 14px; height: 14px; color: var(--color-accent); }
.tk-chip--native { border-color: var(--color-accent); color: var(--color-accent); font-weight: var(--font-weight-sans-emphasis); }
.tk-chip--agree { border-color: var(--color-accent); color: var(--color-accent); }
.tk-chip--disagree { border-style: dashed; text-decoration: line-through; }
.tk-why {
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-rule);
}
.tk-why strong { color: var(--color-text); font-weight: var(--font-weight-sans-emphasis); }
.tk-card__notes { font-size: var(--font-size-sm); line-height: 1.5; color: var(--color-text-muted); margin: 0; }
.tk-card__foot { margin-top: auto; padding-top: var(--space-3); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tk-card__foot .tk-btn { min-height: 44px; padding: 8px 14px; font-size: 13px; }

.tk-empty {
  background: var(--cream);
  border-left: 3px solid var(--color-accent-warm);
  padding: var(--space-4) var(--space-5);
  max-width: var(--tk-measure);
  font-size: var(--font-size-base);
  line-height: var(--line-height-default);
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------
   Species detail
   ------------------------------------------------------------------------- */
.tk-detail__nav { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.tk-detail__head { max-width: var(--tk-measure); margin-bottom: var(--space-5); }
.tk-detail__name:focus { outline: none; }
.tk-detail__name {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 var(--space-1);
}
.tk-detail__latin { font-family: var(--font-serif); font-style: italic; font-size: var(--font-size-lg); color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.tk-detail__photos {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.tk-detail__photos .tk-photo { border: 1px solid var(--color-rule); border-radius: var(--radius-md); overflow: hidden; background: var(--cream); }
.tk-photo__label {
  font-family: var(--font-serif);
  font-size: var(--font-size-sm);
  padding: 6px 12px;
  background: var(--cream);
}
.tk-detail__cols { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .tk-detail__cols { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.tk-detail__panel {
  background: var(--cream);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
}
.tk-detail__panel h3 {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-serif-heading);
  font-size: var(--font-size-xl);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}
.tk-detail__panel p { font-size: var(--font-size-base); line-height: var(--line-height-default); color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.tk-traitlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.tk-traitlist li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--color-rule);
}
.tk-traitlist li:first-child { border-top: 0; }
.tk-traitlist__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  color: var(--color-accent);
  padding: 6px;
}
.tk-traitlist__icon svg { width: 100%; height: 100%; }
/* Doubled selectors: .tk-detail__panel p above would otherwise win. */
.tk-detail__panel .tk-traitlist p { margin: 0; line-height: 1.35; }
.tk-detail__panel .tk-traitlist__trait { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.tk-detail__panel .tk-traitlist__value { font-family: var(--font-serif); font-weight: var(--font-weight-serif-heading); font-size: var(--font-size-base); color: var(--color-text); }
.tk-detail__panel .tk-traitlist__hint { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.tk-detail__links { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.tk-detail__links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 8px 14px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-sans-emphasis);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.tk-detail__links a:hover { background: var(--color-accent); color: var(--cream); }

/* -------------------------------------------------------------------------
   Credits block in the about section
   ------------------------------------------------------------------------- */
.tk-about .tk-credits p { font-size: var(--font-size-sm); line-height: 1.65; }
.tk-about .tk-credits__list { padding-left: 1.2em; }
.tk-about .tk-credits__list li { font-size: var(--font-size-sm); }
.tk-nojs { font-size: var(--font-size-sm); color: var(--color-text-muted); max-width: 52ch; margin: var(--space-4) 0 0; }
.tk.is-ready .tk-nojs { display: none; }

/* -------------------------------------------------------------------------
   Motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tk *, .tk *::before, .tk *::after { transition: none !important; animation: none !important; }
  .tk-tile:active { transform: none; }
}

.tk-detail__sources { font-size: var(--font-size-sm); color: var(--color-text-muted); margin: var(--space-3) 0 0; line-height: 1.5; }
.tk-detail__sources a { color: inherit; }
