/* Health Tools. Colours read the theme's RGB tokens (so dark mode follows the site) with light fallbacks. */
.ht {
  --ht-bg: rgb(var(--c-white, 255 255 255));
  --ht-soft: rgb(var(--c-ink-50, 247 248 252));
  --ht-line: rgb(var(--c-ink-200, 230 230 230));
  --ht-muted: rgb(var(--c-ink-600, 75 75 75));
  --ht-text: rgb(var(--c-ink-950, 11 16 32));
  --ht-tint: rgb(var(--c-brand-50, 245 243 255));
  --ht-accent: rgb(var(--c-brand-700, 109 40 217));
  --ht-primary: #7c3aed;
  --ht-radius: 16px;
  --ht-ease: cubic-bezier(0.2, 0, 0, 1);
  /* Result tones. */
  --ht-low: #0284c7;
  --ht-good: #16a34a;
  --ht-ok: #ca8a04;
  --ht-warn: #ea580c;
  --ht-bad: #dc2626;
  color: var(--ht-text);
  margin: 2rem 0;
  font-size: 1rem;
  line-height: 1.5;
}
.ht *, .ht *::before, .ht *::after { box-sizing: border-box; }
.ht [hidden] { display: none !important; }
.ht-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ---------------------------------------------------------------- Hub grid */
.ht-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.ht-tile {
  display: flex; align-items: flex-start; gap: 0.875rem; height: 100%;
  padding: 1rem; border: 1px solid var(--ht-line); border-radius: var(--ht-radius);
  background: var(--ht-bg); color: inherit; text-decoration: none;
  transition: border-color 0.2s var(--ht-ease), box-shadow 0.2s var(--ht-ease), transform 0.2s var(--ht-ease);
}
.ht-tile:hover { border-color: var(--ht-primary); box-shadow: 0 8px 24px -12px rgb(124 58 237 / 0.35); transform: translateY(-2px); }
.ht-tile:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 2px; }
/* Icon tile: white icon on the tool's colour (--ht-c). */
.ht-mark {
  --ht-c: #7c3aed;
  display: grid; place-items: center; flex-shrink: 0;
  width: 3rem; height: 3rem; border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--ht-c) 72%, #fff), var(--ht-c) 55%, color-mix(in srgb, var(--ht-c) 80%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 6px 14px -6px color-mix(in srgb, var(--ht-c) 70%, transparent);
  transition: transform 0.25s var(--ht-ease);
}
.ht-mark .ht-icon { width: 1.5rem; height: 1.5rem; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.18)); }
.ht-tile:hover .ht-mark { transform: rotate(-6deg) scale(1.06); }
.ht-head__icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; }
.ht-head__icon .ht-icon { width: 1.375rem; height: 1.375rem; }
.ht-tile__text { display: grid; gap: 0.2rem; flex: 1; min-width: 0; }
.ht-tile__title { font-weight: 600; }
.ht-tile__desc { font-size: 0.875rem; color: var(--ht-muted); }
.ht-tile__arrow { color: var(--ht-muted); opacity: 0; transform: translateX(-4px); transition: 0.2s var(--ht-ease); align-self: center; }
.ht-tile:hover .ht-tile__arrow { opacity: 1; transform: none; color: var(--ht-accent); }

/* ---------------------------------------------------------------- Tool card */
.ht-byline { margin: 0 0 0.75rem; font-size: 0.875rem; color: var(--ht-muted); }
.ht-card { display: grid; gap: 1.25rem; border: 1px solid var(--ht-line); border-radius: calc(var(--ht-radius) + 4px); background: var(--ht-bg); padding: 1rem; box-shadow: 0 1px 2px rgb(11 16 32 / 0.04); }
@media (min-width: 640px) { .ht-card { padding: 1.5rem; } }
.ht-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.ht-head__title { font-size: 1.125rem; font-weight: 600; }
.ht-head__private { display: inline-flex; align-items: center; gap: 0.375rem; margin-left: auto; font-size: 0.8125rem; color: var(--ht-muted); }
.ht-head__private .ht-icon { width: 1rem; height: 1rem; color: var(--ht-good); }

/* ---------------------------------------------------------------- Fields */
.ht-form { display: grid; gap: 1rem; margin: 0; }
.ht-fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); align-items: start; }
.ht-field { display: grid; gap: 0.375rem; font-size: 0.875rem; }
.ht-field__label { font-weight: 600; }
.ht-field[data-field='activity'] { grid-column: 1 / -1; }
.ht-field__hint { color: var(--ht-muted); font-size: 0.75rem; }
.ht-field__error { color: var(--ht-bad); font-size: 0.75rem; }
.ht-input { position: relative; display: block; flex: 1; }
.ht-suffix { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--ht-muted); font-size: 0.875rem; pointer-events: none; }
.ht-pair { display: flex; gap: 0.5rem; }
.ht .ht-field input:not([type='radio']), .ht .ht-field select {
  width: 100%; height: 2.75rem; margin: 0; padding: 0 0.75rem; border: 1px solid var(--ht-line); border-radius: 10px;
  background-color: var(--ht-bg); color: var(--ht-text); font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.ht .ht-num { padding-right: 3.25rem; -moz-appearance: textfield; }
.ht .ht-num::-webkit-inner-spin-button, .ht .ht-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ht .ht-field select { padding-right: 2.25rem; }
.ht .ht-field input:focus, .ht .ht-field select:focus { outline: none; border-color: var(--ht-primary); box-shadow: 0 0 0 3px rgb(124 58 237 / 0.2); }
.ht .ht-field input[aria-invalid] { border-color: var(--ht-bad); }

/* Segmented radios (sex, units). */
.ht-seg { display: inline-flex; width: 100%; padding: 0.1875rem; border-radius: 12px; background: var(--ht-soft); border: 1px solid var(--ht-line); }
.ht-seg label { flex: 1; position: relative; cursor: pointer; }
.ht-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ht-seg span { display: grid; place-items: center; min-height: 2.375rem; padding: 0 0.75rem; border-radius: 9px; font-weight: 600; font-size: 0.875rem; color: var(--ht-muted); text-align: center; white-space: nowrap; transition: background-color 0.15s var(--ht-ease), color 0.15s var(--ht-ease); }
.ht-seg input:checked + span { background: var(--ht-bg); color: var(--ht-text); box-shadow: 0 1px 3px rgb(11 16 32 / 0.12); }
.ht-seg input:focus-visible + span { outline: 2px solid var(--ht-primary); outline-offset: 1px; }
.ht-units { width: auto; justify-self: start; }

/* Date: Day · Month · Year in one box, plus a calendar popover. */
.ht-fields--dates { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
@media (max-width: 639px) { .ht-fields--dates { grid-template-columns: 1fr; } }
.ht-date { position: relative; display: flex; height: 2.75rem; border: 1px solid var(--ht-line); border-radius: 10px; background: var(--ht-bg); transition: border-color 0.15s var(--ht-ease), box-shadow 0.15s var(--ht-ease); }
.ht-date:focus-within { border-color: var(--ht-primary); box-shadow: 0 0 0 3px rgb(124 58 237 / 0.2); }
.ht .ht-field .ht-date .ht-date__part, .ht .ht-field .ht-date .ht-date__part:focus {
  height: 100%; min-width: 0; padding: 0 0.5rem; border: 0; border-radius: 0; background-color: transparent; box-shadow: none; text-align: center;
}
.ht .ht-field .ht-date .ht-date__part:focus { background-color: var(--ht-tint); }
.ht .ht-field .ht-date .ht-date__part[aria-invalid] { color: var(--ht-bad); }
.ht .ht-field .ht-date .ht-date__d { flex: 0 0 3.25rem; border-radius: 9px 0 0 9px; }
.ht .ht-field .ht-date .ht-date__m { flex: 1 1 auto; min-width: 5rem; border-left: 1px solid var(--ht-line); padding-right: 1.75rem; text-align: left; cursor: pointer; }
.ht .ht-field .ht-date .ht-date__y { flex: 0 0 4.5rem; border-left: 1px solid var(--ht-line); }
.ht-date__btn { display: grid; place-items: center; flex: 0 0 2.75rem; padding: 0; border: 0; border-left: 1px solid var(--ht-line); border-radius: 0 9px 9px 0; background: transparent; color: var(--ht-muted); cursor: pointer; }
.ht-date__btn:hover, .ht-date__btn[aria-expanded='true'] { background: var(--ht-tint); color: var(--ht-accent); }
.ht-date__btn:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: -2px; }
.ht-svg, .ht-svg svg { display: block; width: 1.125rem; height: 1.125rem; }

.ht-cal {
  position: absolute; z-index: 40; top: calc(100% + 0.5rem); left: -1px;
  width: min(19.5rem, calc(100vw - 2.5rem)); padding: 0.75rem;
  border: 1px solid var(--ht-line); border-radius: 16px; background: var(--ht-bg);
  box-shadow: 0 20px 48px -16px rgb(11 16 32 / 0.35);
  animation: ht-pop 0.16s var(--ht-ease);
}
@keyframes ht-pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.ht-cal__head { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.5rem; }
.ht .ht-field .ht-cal .ht-cal__sel { flex: 1; width: auto; height: 2.25rem; padding: 0 1.75rem 0 0.625rem; border-radius: 8px; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.ht-cal__nav { display: grid; place-items: center; flex: 0 0 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ht-text); cursor: pointer; }
.ht-cal__nav:hover:not(:disabled) { background: var(--ht-soft); }
.ht-cal__nav:disabled { opacity: 0.3; cursor: default; }
.ht-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ht-cal__wd { padding: 0.25rem 0; font-size: 0.6875rem; font-weight: 600; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ht-muted); }
.ht-cal__day {
  aspect-ratio: 1; padding: 0; border: 0; border-radius: 9px; background: transparent;
  color: var(--ht-text); font: inherit; font-size: 0.875rem; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 0.12s var(--ht-ease);
}
.ht-cal__day:hover:not(:disabled) { background: var(--ht-tint); color: var(--ht-accent); }
.ht-cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--ht-primary); font-weight: 600; }
.ht-cal__day[aria-pressed='true'] { background: var(--ht-primary); color: #fff; font-weight: 600; }
.ht-cal__day:disabled { opacity: 0.28; cursor: not-allowed; }
.ht-cal__day:focus-visible, .ht-cal__link:focus-visible, .ht-cal__nav:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 1px; }
.ht-cal__foot { display: flex; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--ht-line); }
.ht-cal__link { min-height: 2.25rem; padding: 0 0.625rem; border: 0; border-radius: 8px; background: transparent; color: var(--ht-accent); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.ht-cal__link:hover:not(:disabled) { background: var(--ht-tint); }
.ht-cal__link:disabled { opacity: 0.4; cursor: default; }

/* ---------------------------------------------------------------- Result */
.ht-result { display: grid; gap: 1rem; padding: 1.25rem; border-radius: var(--ht-radius); background: var(--ht-tint); }
.ht-empty { margin: 0; color: var(--ht-muted); font-size: 0.9375rem; }
.ht-score { display: grid; gap: 0.25rem; }
.ht-score__label { font-size: 0.875rem; font-weight: 600; color: var(--ht-muted); }
.ht-score__line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.ht-score__value { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ht-score__unit { color: var(--ht-muted); font-weight: 600; }
.ht-pill { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: #fff; background: var(--tone); }
.is-low { --tone: var(--ht-low); }
.is-good { --tone: var(--ht-good); }
.is-ok { --tone: var(--ht-ok); }
.is-warn { --tone: var(--ht-warn); }
.is-bad { --tone: var(--ht-bad); }

.ht-scale { position: relative; padding-top: 0.5rem; }
.ht-scale__bar { display: flex; height: 0.625rem; overflow: hidden; border-radius: 999px; }
.ht-scale__bar span { background: var(--tone); }
.ht-scale__marker { position: absolute; top: 0; width: 1.25rem; height: 1.625rem; margin-left: -0.625rem; border: 3px solid var(--ht-bg); border-radius: 999px; background: var(--ht-text); box-shadow: 0 2px 6px rgb(11 16 32 / 0.3); transition: left 0.3s var(--ht-ease); }

.ht-rows { display: grid; margin: 0; }
.ht-rows div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0; border-top: 1px solid var(--ht-line); font-size: 0.9375rem; }
.ht-rows dt { color: var(--ht-muted); }
.ht-rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.ht-table { overflow-x: auto; border: 1px solid var(--ht-line); border-radius: 12px; background: var(--ht-bg); }
.ht-table table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.875rem; }
.ht-table th, .ht-table td { padding: 0.625rem 0.875rem; text-align: left; border-top: 1px solid var(--ht-line); font-variant-numeric: tabular-nums; }
.ht-table thead th { border-top: 0; background: var(--ht-soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ht-muted); }
.ht-table tbody th { font-weight: 400; }
@media (min-width: 640px) { .ht-table td:last-child { white-space: nowrap; } }
.ht-table .is-strong th, .ht-table .is-strong td { font-weight: 700; }
.ht-table .is-done th, .ht-table .is-done td { color: var(--ht-muted); text-decoration: line-through; text-decoration-color: var(--ht-line); }
.ht-table .is-flag td { color: var(--ht-bad); }
.ht-flag { display: block; font-size: 0.75rem; font-weight: 600; }

.ht-note { margin: 0; padding: 0.75rem 0.875rem; border-radius: 10px; background: rgb(234 88 12 / 0.1); color: var(--ht-text); font-size: 0.875rem; }
.ht-note.is-error { background: rgb(220 38 38 / 0.1); }
.ht-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; white-space: nowrap; }
.ht-disclaimer { display: flex; gap: 0.5rem; margin: 0; font-size: 0.8125rem; color: var(--ht-muted); }
.ht-disclaimer .ht-icon { width: 1rem; height: 1rem; margin-top: 0.125rem; }

/* ---------------------------------------------------------------- Money + everyday tools */
.ht-field--wide, .ht-fields__title { grid-column: 1 / -1; }
.ht-fields__title { margin: 0.5rem 0 -0.25rem; padding-top: 1rem; border-top: 1px solid var(--ht-line); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ht-muted); }
.ht-prefix { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--ht-muted); pointer-events: none; }
.ht .ht-field .ht-input--prefix input { padding-left: 1.75rem; }
.ht-check { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; cursor: pointer; font-weight: 400; }
.ht .ht-field .ht-check input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--ht-primary); }
.ht-split { display: grid; gap: 0.625rem; }
.ht-split__bar { display: flex; height: 0.75rem; overflow: hidden; border-radius: 999px; gap: 2px; }
.ht-split__bar span { background: var(--tone); }
.ht-split__legend { display: flex; flex-wrap: wrap; gap: 0.375rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ht-muted); }
.ht-split__legend li { display: flex; align-items: center; gap: 0.375rem; }
.ht-split__legend i { width: 0.625rem; height: 0.625rem; border-radius: 3px; background: var(--tone); }
.ht-split__legend strong { color: var(--ht-text); font-variant-numeric: tabular-nums; }
.ht-details summary { padding: 0.5rem 0; color: var(--ht-accent); font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.ht-details[open] summary { margin-bottom: 0.5rem; }

/* Typing test: passage with live colouring, typing box, timer bar. */
.ht-type { display: grid; gap: 0.75rem; }
.ht-type__bar { display: flex; align-items: center; gap: 1rem; font-variant-numeric: tabular-nums; }
.ht-type__clock { font-size: 1.5rem; font-weight: 700; }
.ht-type__live { color: var(--ht-muted); font-weight: 600; }
.ht-type__restart { margin-left: auto; min-height: 2.5rem; padding: 0 1rem; border: 1px solid var(--ht-line); border-radius: 10px; background: var(--ht-bg); color: var(--ht-accent); font: inherit; font-weight: 600; cursor: pointer; }
.ht-type__restart:hover { border-color: var(--ht-primary); background: var(--ht-tint); }
.ht-type__text { position: relative; max-height: 9.5rem; overflow-y: auto; padding: 0.875rem 1rem; border-radius: 12px; background: var(--ht-soft); color: var(--ht-muted); font-size: 1.125rem; line-height: 1.75; user-select: none; }
.ht-type__text .is-ok { color: var(--ht-good); }
.ht-type__text .is-bad { color: var(--ht-bad); background: rgb(220 38 38 / 0.15); border-radius: 2px; }
.ht-type__text .is-next { color: var(--ht-text); box-shadow: inset 0 -2px 0 var(--ht-primary); }
.ht .ht-type__input { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--ht-line); border-radius: 12px; background: var(--ht-bg); color: var(--ht-text); font: inherit; font-size: 1.125rem; resize: vertical; }
.ht .ht-type__input:focus { outline: none; border-color: var(--ht-primary); box-shadow: 0 0 0 3px rgb(124 58 237 / 0.2); }
.ht .ht-type__input:disabled { opacity: 0.6; }

/* ---------------------------------------------------------------- Wide tool layout (templates/tool-page.php) */
/* Tool on the left at the hero's width, sticky "In short" + contents on the right; stacks on phones and tablets. */
.ht-layout { display: grid; gap: 1.5rem; }
.ht-layout .ht-layout__tool > * { margin-top: 0; margin-bottom: 0; }
.ht-layout__aside { display: grid; gap: 1rem; align-content: start; order: -1; }
@media (min-width: 1024px) {
  .ht-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.5rem; align-items: start; }
  .ht-layout__aside { order: 0; position: sticky; top: 6.5rem; }
}
.ht-aside-card { padding: 1.25rem; border: 1px solid rgb(var(--c-ink-200, 230 230 230)); border-radius: 18px; background: linear-gradient(160deg, rgb(var(--c-brand-50, 245 243 255)), rgb(var(--c-white, 255 255 255)) 70%); }
.ht-aside-card p:not(.ht-aside-card__label) { margin: 0; font-size: 0.9375rem; line-height: 1.65; color: rgb(var(--c-ink-800, 40 40 40)); }
.ht-aside-card__label { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.625rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgb(var(--c-brand-700, 109 40 217)); }
.ht-toc { display: none; padding: 1.25rem; border: 1px solid rgb(var(--c-ink-200, 230 230 230)); border-radius: 18px; }
@media (min-width: 1024px) { .ht-toc { display: block; } }
.ht-toc ol { display: grid; gap: 0.125rem; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.ht-toc a { display: flex; gap: 0.625rem; padding: 0.375rem 0.5rem; margin: 0 -0.5rem; border-radius: 8px; color: rgb(var(--c-ink-600, 75 75 75)); font-size: 0.875rem; line-height: 1.4; text-decoration: none; counter-increment: toc; transition: background-color 0.15s, color 0.15s; }
.ht-toc a::before { content: counter(toc, decimal-leading-zero); color: rgb(var(--c-brand-600, 124 58 237)); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 0.0625rem; }
.ht-toc a:hover { background: rgb(var(--c-brand-50, 245 243 255)); color: rgb(var(--c-ink-950, 11 16 32)); }
.dd-prose h2[id], #frequently-asked-questions { scroll-margin-top: 6.5rem; }

/* ---------------------------------------------------------------- All-tools directory */
/* Full container width for the grid; the page text around it keeps a reading width. */
.ht-wide .dd-prose > :not(.ht-dir) { max-width: 48rem; }

/* Hero controls (on the navy hero): big search, then category tabs. */
.ht-dir-bar { display: grid; gap: 1.25rem; margin: 2rem 0 0; color: #fff; }
.ht-dir__search { display: flex; align-items: center; gap: 0.75rem; max-width: 44rem; height: 3.75rem; padding: 0 1.25rem; border-radius: 16px; background: #fff; color: #0b1020; box-shadow: 0 20px 40px -20px rgb(0 0 0 / 0.6); cursor: text; transition: box-shadow 0.2s var(--ht-ease); }
.ht-dir__search:focus-within { box-shadow: 0 0 0 4px rgb(167 139 250 / 0.45), 0 20px 40px -20px rgb(0 0 0 / 0.6); }
.ht-dir__search .ht-icon { color: #7c3aed; }
.ht .ht-dir__search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; box-shadow: none; background: transparent; color: #0b1020; font: inherit; font-size: 1.0625rem; }
.ht .ht-dir__search input::placeholder { color: #6b7280; }
.ht-dir__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ht-dir__tab { --ht-c: #a78bfa; display: inline-flex; align-items: center; gap: 0.5rem; height: 2.5rem; padding: 0 0.5rem 0 0.75rem; border: 1px solid rgb(255 255 255 / 0.14); border-radius: 999px; background: rgb(255 255 255 / 0.06); color: rgb(255 255 255 / 0.85); font: inherit; font-size: 0.875rem; font-weight: 600; white-space: nowrap; cursor: pointer; backdrop-filter: blur(6px); transition: 0.2s var(--ht-ease); }
.ht-dir__tab .ht-icon { width: 1.125rem; height: 1.125rem; color: color-mix(in srgb, var(--ht-c) 60%, #fff); }
.ht-dir__tab .ht-dir__count { min-width: 0; padding: 0 0.4375rem; border-radius: 999px; background: rgb(255 255 255 / 0.12); color: inherit; font-size: 0.75rem; line-height: 1.375rem; font-variant-numeric: tabular-nums; }
.ht-dir__tab:hover { border-color: rgb(255 255 255 / 0.35); background: rgb(255 255 255 / 0.12); color: #fff; }
.ht-dir__tab:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.ht-dir__tab[aria-pressed='true'] { border-color: #fff; background: #fff; color: #0b1020; }
.ht-dir__tab[aria-pressed='true'] .ht-icon { color: var(--ht-c); }
.ht-dir__tab[aria-pressed='true'][data-cat=''] .ht-icon { color: #7c3aed; }
.ht-dir__tab[aria-pressed='true'] .ht-dir__count { background: #f1f0f7; color: #4b5563; }
/* Phones: tabs become one swipeable row. */
@media (max-width: 639px) {
  .ht-dir__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding: 0 1rem 0.25rem; }
  .ht-dir__tabs::-webkit-scrollbar { display: none; }
}

/* Tiles: popular first, then one section per category. */
.ht-dir { display: grid; gap: 2.5rem; margin: 0 0 3.5rem; }
.ht-dir__status { margin: 0 0 -1rem; color: var(--ht-muted); font-size: 0.9375rem; font-weight: 600; }
.ht-dir__status:empty { display: none; }
.ht-dir__popular, .ht-dir__group { display: grid; gap: 1rem; scroll-margin-top: 6rem; }
.ht-dir__head { display: flex; align-items: center; gap: 0.875rem; }
.ht-dir__icon { width: 2.75rem; height: 2.75rem; border-radius: 13px; }
.ht-dir__icon .ht-icon, .ht-dir__icon svg { width: 1.375rem; height: 1.375rem; }
.ht .ht-dir__title { display: flex; align-items: center; gap: 0.625rem; margin: 0; font-size: 1.375rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.ht-dir__count { min-width: 1.75rem; padding: 0.0625rem 0.5rem; border-radius: 999px; background: var(--ht-soft); color: var(--ht-muted); font-size: 0.8125rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.ht .ht-dir__blurb { margin: 0.125rem 0 0; color: var(--ht-muted); font-size: 0.9375rem; }
.ht-dir .ht-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.ht-dir__popular .ht-grid { padding: 1rem; border-radius: calc(var(--ht-radius) + 4px); background: linear-gradient(135deg, var(--ht-tint), var(--ht-soft)); }
.ht-dir .ht-tile__icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; }
.ht-mark svg { width: 1.5rem; height: 1.5rem; }
.ht-dir .ht-tile__icon svg { width: 1.375rem; height: 1.375rem; }
/* The hover arrow floats in the corner so descriptions get the full tile width. */
.ht-dir .ht-tile { position: relative; padding-right: 1.75rem; }
.ht-dir .ht-tile__arrow { position: absolute; top: 0.875rem; right: 0.75rem; }
.ht-dir .ht-tile__arrow .ht-icon { width: 1rem; height: 1rem; }

/* ---------------------------------------------------------------- Related links */
.ht-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: 0.875rem; }
.ht-more__all { display: inline-flex; align-items: center; gap: 0.375rem; margin-right: 0.5rem; color: var(--ht-accent); font-weight: 600; text-decoration: none; }
.ht-more__all .ht-icon { width: 1rem; height: 1rem; }
.ht-more__all:hover { text-decoration: underline; text-underline-offset: 3px; }
.ht-chip { padding: 0.375rem 0.75rem; border: 1px solid var(--ht-line); border-radius: 999px; color: var(--ht-muted); text-decoration: none; transition: 0.15s var(--ht-ease); }
.ht-chip:hover { border-color: var(--ht-primary); color: var(--ht-accent); background: var(--ht-tint); }

@media (prefers-reduced-motion: reduce) {
  .ht *, .ht *::before, .ht *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
