/* Life Shenzhen things-to-do dashboard ---------------------------------
   A page-scoped, progressively enhanced discovery surface for
   /things-to-do/. The underlying directory remains complete without JS. */

.td-page {
  --td-navy: #06162a;
  --td-deep: #020d1d;
  --td-ink: #071b38;
  --td-cream: #f2f0e8;
  --td-paper: #fbfaf6;
  --td-lime: #3ce0b5;
  --td-coral: #d94870;
  --td-coral-light: #f08aaa;
  --td-gold: #d9b37c;
  --td-blue: #2d6bff;
  --td-muted: rgba(242, 240, 232, 0.7);
  --td-line: rgba(242, 240, 232, 0.18);
  --td-soft-line: rgba(242, 240, 232, 0.1);
  --td-surface: rgba(255, 255, 255, 0.055);
  --td-surface-strong: rgba(255, 255, 255, 0.09);
  --td-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  min-width: 0;
  color: var(--td-cream);
  background: var(--td-navy);
}

.td-page .page-hero {
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--td-line);
  background:
    radial-gradient(circle at 82% 20%, rgba(45, 107, 255, 0.24), transparent 28rem),
    radial-gradient(circle at 15% 105%, rgba(60, 224, 181, 0.12), transparent 24rem),
    var(--td-ink);
  overflow: hidden;
}

.td-page .page-hero::after {
  content: "34";
  position: absolute;
  z-index: -1;
  right: 3vw;
  bottom: -0.32em;
  color: rgba(217, 179, 124, 0.075);
  letter-spacing: -0.08em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(150px, 22vw, 350px);
  line-height: 1;
  pointer-events: none;
}

.td-page .buy-page-content {
  color: var(--td-cream);
  background:
    radial-gradient(circle at 96% 7%, rgba(217, 72, 112, 0.09), transparent 24rem),
    radial-gradient(circle at 0 35%, rgba(60, 224, 181, 0.065), transparent 27rem),
    var(--td-navy);
}

.td-page [data-things-root],
.td-page .td-shell,
.td-page .td-catalogue,
.td-page .td-dashboard-head,
.td-page .td-toolbar,
.td-page .td-picker,
.td-page .dir-group,
.td-page .dir-list,
.td-page .td-card {
  min-width: 0;
}

.td-page [data-things-root].td-dashboard {
  position: relative;
  max-width: none;
  margin: 0;
  color: var(--td-cream);
  background:
    radial-gradient(circle at 87% 5%, rgba(45, 107, 255, 0.12), transparent 25rem),
    var(--td-navy);
  padding: clamp(44px, 5.5vw, 74px) 4vw clamp(36px, 4vw, 56px);
}

.td-shell {
  width: min(1480px, 100%);
  margin-inline: auto;
}

.td-sr-only,
.td-live:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Intro and at-a-glance numbers ---------------------------------------- */

.td-dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: end;
  gap: clamp(34px, 7vw, 100px);
  border-bottom: 1px solid var(--td-line);
  padding: 0 0 clamp(28px, 3vw, 42px);
}

.td-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 18px;
  color: var(--td-lime);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.td-kicker::before {
  content: "";
  flex: 0 0 38px;
  height: 1px;
  background: currentColor;
}

.td-dashboard-title {
  max-width: 830px;
  margin: 0;
  color: var(--td-cream);
  letter-spacing: -0.055em;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5.5vw, 78px);
  font-weight: 400;
  line-height: 0.94;
}

.td-dashboard-title em {
  color: var(--td-gold);
  font-style: normal;
}

.td-dashboard-copy {
  max-width: 680px;
  margin: 21px 0 0;
  color: rgba(242, 240, 232, 0.77);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.58;
}

.td-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--td-line);
  background: var(--td-surface);
  box-shadow: var(--td-shadow);
}

.td-metric {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 18px;
}

.td-metric + .td-metric {
  border-left: 1px solid var(--td-line);
}

.td-metric span,
.td-metric small {
  color: var(--td-muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.35;
}

.td-metric strong,
.td-metric output {
  color: var(--td-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3.5vw, 52px);
  font-weight: 400;
  line-height: 0.85;
}

.td-metric:nth-child(2) strong,
.td-metric:nth-child(2) output {
  color: var(--td-lime);
}

.td-metric:nth-child(3) strong,
.td-metric:nth-child(3) output {
  color: var(--td-gold);
}

/* Playful picker -------------------------------------------------------- */

.td-picker {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  min-height: 174px;
  margin-top: 22px;
  border: 1px solid rgba(217, 179, 124, 0.62);
  color: var(--td-ink);
  background:
    linear-gradient(118deg, rgba(251, 250, 246, 0.97), rgba(217, 179, 124, 0.94)),
    var(--td-gold);
  padding: clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.td-picker::before {
  content: "PICK";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -0.08em;
  color: rgba(7, 27, 56, 0.075);
  letter-spacing: -0.07em;
  font-size: clamp(100px, 14vw, 205px);
  font-weight: 900;
  line-height: 0.75;
  transform: translateY(-50%);
  pointer-events: none;
}

html[lang^="es"] .td-picker::before {
  content: "ELIGE";
}

.td-pick-copy {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.td-pick-copy > :first-child,
.td-pick-copy .td-kicker,
#td-pick-kicker {
  margin: 0 0 9px;
  color: var(--td-coral);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.35;
}

.td-pick-copy .td-kicker::before {
  display: none;
}

.td-pick-copy h2,
.td-pick-copy h3,
#td-pick-name {
  max-width: 720px;
  margin: 0;
  color: var(--td-ink);
  letter-spacing: -0.04em;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4.1vw, 58px);
  font-weight: 400;
  line-height: 0.98;
}

.td-pick-copy p,
#td-pick-reason {
  max-width: 670px;
  margin: 13px 0 0;
  color: rgba(7, 27, 56, 0.76);
  font-size: 14px;
  line-height: 1.55;
}

.td-pick-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.td-pick-actions :is(a, button),
.td-random,
.td-clear {
  min-height: 46px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.td-pick-actions :is(a, button) {
  color: var(--td-cream);
  background: var(--td-ink);
}

.td-pick-actions :is(a, button):hover {
  border-color: var(--td-coral);
  color: var(--td-cream);
  background: var(--td-coral);
  transform: translateY(-2px);
}

.td-picker[hidden] {
  display: none !important;
}

/* Search and filters ---------------------------------------------------- */

.td-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.35fr) minmax(0, 1.65fr);
  align-items: end;
  gap: 18px 22px;
  margin-top: 22px;
  border: 1px solid var(--td-line);
  border-top: 4px solid var(--td-lime);
  color: var(--td-ink);
  background: var(--td-cream);
  box-shadow: var(--td-shadow);
  padding: clamp(20px, 2.5vw, 32px);
}

.td-toolbar > fieldset {
  min-width: 0;
  border: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.td-toolbar > fieldset > legend {
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  color: rgba(7, 27, 56, 0.68);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.3;
}

.td-search-wrap {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.td-search-wrap > span,
.td-chip-row > :first-child:not(button),
.td-chip-row > legend,
.td-chip-row-label {
  color: rgba(7, 27, 56, 0.68);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.3;
}

.td-search {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(7, 27, 56, 0.34);
  border-radius: 0;
  color: var(--td-ink);
  background: var(--td-paper);
  padding: 12px 15px;
  font-size: 16px;
  line-height: 1.3;
  appearance: none;
}

.td-search::placeholder {
  color: rgba(7, 27, 56, 0.5);
  opacity: 1;
}

.td-search::-webkit-search-cancel-button {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.td-chip-row {
  min-width: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.td-chip-row > :first-child:not(button),
.td-chip-row > legend,
.td-chip-row-label {
  flex-basis: 100%;
  margin: 0 0 1px;
  padding: 0;
}

.td-chip {
  min-height: 44px;
  border: 1px solid rgba(7, 27, 56, 0.28);
  border-radius: 0;
  color: var(--td-ink);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.td-chip:hover {
  border-color: var(--td-coral);
  color: var(--td-coral);
  transform: translateY(-1px);
}

.td-chip[aria-pressed="true"],
.td-chip.is-active {
  border-color: var(--td-ink);
  color: var(--td-ink);
  background: var(--td-lime);
  box-shadow: inset 0 -3px 0 rgba(7, 27, 56, 0.22);
}

.td-toolbar-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(7, 27, 56, 0.18);
  padding-top: 16px;
}

.td-random {
  border-color: var(--td-coral);
  color: var(--td-cream);
  background: var(--td-coral);
}

.td-random:hover {
  border-color: var(--td-ink);
  background: var(--td-ink);
  transform: translateY(-2px);
}

.td-clear {
  border-color: rgba(7, 27, 56, 0.34);
  color: var(--td-ink);
  background: transparent;
}

.td-clear:hover {
  border-color: var(--td-ink);
  color: var(--td-cream);
  background: var(--td-ink);
}

.td-clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.td-results {
  margin: 0;
  color: rgba(7, 27, 56, 0.7);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.td-storage-note {
  grid-column: 1 / -1;
  margin: -5px 0 0;
  color: rgba(7, 27, 56, 0.72);
  font-size: 11px;
  line-height: 1.5;
}

/* Category index -------------------------------------------------------- */

.td-page .td-catalogue {
  margin-top: 0;
}

.td-page .td-catalogue .hub-links {
  margin: 0 0 clamp(54px, 7vw, 92px);
  border: 0;
  padding: 0;
}

.td-page .td-catalogue .hub-links h2 {
  margin: 0 0 15px;
  color: var(--td-gold);
  font-size: 9px;
}

.td-page .td-catalogue .hub-links ul {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--td-line);
  background: var(--td-line);
}

.td-page .td-catalogue .hub-links li {
  min-width: 0;
  border: 0;
  background: var(--td-navy);
}

.td-page .td-catalogue .hub-links a {
  min-height: 104px;
  color: var(--td-cream);
  background: var(--td-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 16px;
  font-size: 15px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.td-page .td-catalogue .hub-links a span {
  margin: 0;
  color: var(--td-lime);
}

.td-page .td-catalogue .hub-links a:hover,
.td-page .td-catalogue .hub-links a:focus-visible {
  color: var(--td-ink);
  background: var(--td-gold);
  transform: translateY(-3px);
}

.td-page .td-catalogue .hub-links a:hover span,
.td-page .td-catalogue .hub-links a:focus-visible span {
  color: var(--td-ink);
}

/* Directory groups and cards ------------------------------------------- */

.td-page .td-catalogue .dir-group {
  position: relative;
  scroll-margin-top: 110px;
  margin: 0 0 clamp(66px, 8vw, 112px);
}

.td-page .td-catalogue .dir-group::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 3px;
  background: var(--td-coral);
}

.td-page .td-catalogue .dir-group:nth-of-type(even)::before {
  background: var(--td-lime);
}

.td-page .td-catalogue .dir-group > h2 {
  max-width: 920px;
  margin: 0;
  border: 0;
  padding: 22px 0 0;
  color: var(--td-cream);
  letter-spacing: -0.035em;
  text-transform: none;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4.5vw, 62px);
  font-weight: 400;
  line-height: 1;
}

.td-page .td-catalogue .dir-group > p.dir-intro {
  max-width: 860px;
  margin: 17px 0 28px;
  color: rgba(242, 240, 232, 0.7);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.td-page #surfing > p:not(.dir-intro),
.td-page #car-wash > p:not(.dir-intro),
.td-page #families > p:not(.dir-intro) {
  max-width: 860px;
  margin: 22px 0;
  color: var(--td-cream);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

/* Desktop links must clear both the main nav and the sticky section strip. */
@media (min-width: 1001px) {
  .td-page .td-catalogue [id] {
    scroll-margin-top: 150px;
  }
}

@media (min-width: 1000px) {
  .td-page #surfing .dir-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.td-page .td-catalogue .dir-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.td-page .td-catalogue .dir-list > .td-card {
  position: relative;
  isolation: isolate;
  scroll-margin-top: 112px;
  min-height: 315px;
  height: 100%;
  border: 1px solid var(--td-line);
  border-top: 4px solid rgba(60, 224, 181, 0.48);
  grid-template-columns: 64px minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: start;
  align-items: start;
  gap: 15px 17px;
  color: var(--td-cream);
  background:
    linear-gradient(145deg, var(--td-surface-strong), rgba(255, 255, 255, 0.025)),
    var(--td-navy);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  padding: 20px;
  display: grid;
  overflow: hidden;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.td-page .td-catalogue .dir-list > .td-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -52px;
  bottom: -72px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(217, 179, 124, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.td-page .td-catalogue .dir-list > .td-card:hover,
.td-page .td-catalogue .dir-list > .td-card:focus-within {
  border-color: rgba(217, 179, 124, 0.68);
  border-top-color: var(--td-gold);
  background:
    linear-gradient(145deg, rgba(217, 179, 124, 0.115), rgba(255, 255, 255, 0.035)),
    var(--td-navy);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22);
  transform: translateY(-4px);
}

.td-page .td-card-head {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
  gap: 17px;
}

.td-page .td-card > .dir-thumb,
.td-page .td-card-head > .dir-thumb {
  grid-column: 1;
  width: 64px;
  height: 64px;
  border-color: rgba(242, 240, 232, 0.26);
  flex: none;
}

.td-page .td-card > .dir-body,
.td-page .td-card-head > .dir-body {
  grid-column: 2 / -1;
  min-width: 0;
  padding-right: 48px;
}

.td-page .td-card-head > .dir-body {
  grid-column: 2;
  padding-right: 0;
}

.td-page .td-card .dir-name {
  color: var(--td-cream);
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.08;
}

.td-page .td-card .dir-name span {
  display: block;
  margin: 6px 0 0;
  color: rgba(242, 240, 232, 0.53);
  letter-spacing: 0;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
}

.td-page .td-card .dir-meta {
  margin-top: 8px;
  color: var(--td-coral-light);
  letter-spacing: 0.075em;
  font-size: 8px;
  line-height: 1.55;
}

.td-page .td-card > p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(242, 240, 232, 0.74);
  font-size: 13.5px;
  line-height: 1.62;
}

.td-page .td-card > p a {
  color: var(--td-cream);
  text-decoration-color: var(--td-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.td-page .td-card > p a:hover {
  color: var(--td-lime);
}

.td-badges {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 1px;
}

.td-badge {
  min-height: 24px;
  border: 1px solid rgba(60, 224, 181, 0.32);
  color: var(--td-lime);
  background: rgba(60, 224, 181, 0.055);
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
}

.td-save {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(242, 240, 232, 0.3);
  border-radius: 0;
  color: var(--td-cream);
  background: rgba(2, 13, 29, 0.52);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.td-save:hover {
  border-color: var(--td-gold);
  color: var(--td-gold);
  transform: scale(1.04);
}

.td-save-icon {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.td-save-label {
  font-size: 9px;
}

.td-card.is-saved,
.td-page .td-catalogue .dir-list > .td-card.is-saved {
  border-top-color: var(--td-gold);
}

.td-save[aria-pressed="true"],
.td-save.is-saved {
  border-color: var(--td-gold);
  color: var(--td-ink);
  background: var(--td-gold);
}

.td-page .td-catalogue .dir-list > .td-card.is-picked {
  border-color: var(--td-lime);
  border-top-color: var(--td-lime);
  box-shadow: 0 0 0 3px var(--td-lime), 0 26px 64px rgba(0, 0, 0, 0.32);
  transform: translateY(-6px) rotate(-0.25deg);
  animation: td-pick-pulse 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.td-page .td-catalogue .dir-list > .td-card.is-picked::after {
  content: "YOUR PICK";
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--td-ink);
  background: var(--td-lime);
  padding: 7px 10px 6px;
  letter-spacing: 0.11em;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
}

html[lang^="es"] .td-page .td-catalogue .dir-list > .td-card.is-picked::after {
  content: "TU ELECCIÓN";
}

@keyframes td-pick-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 224, 181, 0.72), 0 0 0 rgba(0, 0, 0, 0);
    transform: translateY(0) rotate(0);
  }
  55% {
    box-shadow: 0 0 0 9px rgba(60, 224, 181, 0.12), 0 26px 64px rgba(0, 0, 0, 0.32);
  }
  100% {
    box-shadow: 0 0 0 3px var(--td-lime), 0 26px 64px rgba(0, 0, 0, 0.32);
    transform: translateY(-6px) rotate(-0.25deg);
  }
}

.td-card.is-hidden,
.td-card.is-filtered-out,
.td-card[hidden],
.td-page .td-card[hidden] {
  display: none !important;
}

.td-page .td-catalogue .dir-group.is-empty,
.td-page .td-catalogue .dir-group.is-filtered-out,
.td-page .td-catalogue .dir-group[hidden] {
  display: none !important;
}

/* Keyboard and control states ------------------------------------------ */

.td-page :is(.td-search, .td-chip, .td-random, .td-clear, .td-save, .td-pick-actions a, .td-pick-actions button):focus-visible,
.td-page .td-catalogue :is(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--td-gold);
  outline-offset: 3px;
}

.td-page .td-search:focus-visible {
  border-color: var(--td-ink);
  outline-color: var(--td-coral);
  outline-offset: 1px;
}

.td-page .td-save:focus-visible {
  outline-color: var(--td-lime);
}

/* If enhancement never starts, hide only the inert controls. The original
   category links and all directory entries remain visible and useful. */
html:not(.js):not(.has-things-dashboard) [data-things-root].td-dashboard:not(.is-enhanced) :is(
  .td-dashboard-head,
  .td-picker,
  .td-toolbar,
  .td-storage-note
) {
  display: none;
}

html:not(.js):not(.has-things-dashboard) [data-things-root].td-dashboard:not(.is-enhanced) {
  border: 0;
  padding-block: 0;
}

/* Compact desktop / tablet --------------------------------------------- */

@media (max-width: 1000px) {
  .td-dashboard-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .td-metrics {
    max-width: 680px;
  }

  .td-metric {
    min-height: 112px;
  }

  .td-toolbar {
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.5fr);
  }

  .td-toolbar-actions {
    justify-content: flex-start;
  }

  .td-page .td-catalogue .hub-links ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .td-page .td-catalogue .dir-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile --------------------------------------------------------------- */

@media (max-width: 700px) {
  .td-page .buy-page-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .td-dashboard-head {
    gap: 28px;
    padding-bottom: 30px;
  }

  .td-dashboard-title {
    font-size: clamp(43px, 14vw, 66px);
  }

  .td-dashboard-copy {
    font-size: 16px;
  }

  .td-metrics {
    width: 100%;
  }

  .td-metric {
    min-height: 102px;
    gap: 14px;
    padding: 17px 12px;
  }

  .td-metric strong,
  .td-metric output {
    font-size: 34px;
  }

  .td-picker {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 22px;
    min-height: 0;
    padding: 24px 20px;
  }

  .td-picker::before {
    top: auto;
    bottom: -0.08em;
    font-size: 112px;
    transform: none;
  }

  .td-pick-copy h2,
  .td-pick-copy h3,
  #td-pick-name {
    font-size: clamp(31px, 10vw, 45px);
  }

  .td-pick-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .td-pick-actions :is(a, button) {
    width: 100%;
  }

  .td-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 20px;
    margin-top: 12px;
    padding: 19px 16px;
  }

  .td-toolbar-actions {
    grid-column: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .td-random,
  .td-clear {
    width: 100%;
  }

  .td-search,
  .td-chip,
  .td-random,
  .td-clear {
    font-size: 16px;
  }

  .td-chip {
    flex: 1 1 calc(50% - 7px);
    padding-inline: 10px;
    font-size: 13px;
  }

  .td-page .td-catalogue {
    margin-top: 0;
  }

  .td-page .td-catalogue .hub-links {
    margin-bottom: 58px;
  }

  .td-page .td-catalogue .hub-links ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .td-page .td-catalogue .hub-links a {
    min-height: 94px;
    padding: 14px;
    font-size: 14px;
  }

  .td-page .td-catalogue .dir-group {
    scroll-margin-top: 20px;
    margin-bottom: 70px;
  }

  .td-page .td-catalogue .dir-group > h2 {
    padding-top: 18px;
    font-size: clamp(32px, 10vw, 46px);
  }

  .td-page .td-catalogue .dir-group > p.dir-intro {
    margin-bottom: 22px;
    font-size: 14px;
  }

  .td-page .td-catalogue .dir-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .td-page .td-catalogue .dir-list > .td-card {
    scroll-margin-top: 20px;
    min-height: 0;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding: 17px;
  }

  .td-page .td-card-head {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
  }

  .td-page .td-card > .dir-thumb,
  .td-page .td-card-head > .dir-thumb {
    width: 56px;
    height: 56px;
  }

  .td-page .td-card > .dir-body {
    padding-right: 42px;
  }

  .td-page .td-card .dir-name {
    font-size: 20px;
  }

  .td-page .td-card > p {
    font-size: 14px;
  }

  .td-save {
    top: 13px;
    right: 13px;
    width: 44px;
    padding-inline: 7px;
  }

  .td-save-label {
    position: absolute;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
  }

  .td-page .td-catalogue .dir-list > .td-card.is-picked {
    transform: translateY(-3px);
  }
}

@media (max-width: 390px) {
  .td-page .nav .brand-name {
    display: none;
  }

  .td-page .buy-page-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .td-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .td-metric + .td-metric {
    border-left: 0;
  }

  .td-metric:nth-child(even) {
    border-left: 1px solid var(--td-line);
  }

  .td-metric:nth-child(n + 3) {
    border-top: 1px solid var(--td-line);
  }

  .td-metric:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .td-toolbar-actions {
    grid-template-columns: 1fr;
  }

  .td-page .td-catalogue .hub-links ul {
    grid-template-columns: 1fr;
  }

  .td-page .td-catalogue .hub-links a {
    min-height: 78px;
  }

  .td-page .td-catalogue .dir-list > .td-card {
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 15px;
  }

  .td-page .td-card-head {
    grid-template-columns: 50px minmax(0, 1fr) auto;
  }

  .td-page .td-card > .dir-thumb,
  .td-page .td-card-head > .dir-thumb {
    width: 50px;
    height: 50px;
  }

  .td-page .td-card > .dir-body {
    padding-right: 39px;
  }
}

/* Motion preferences ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .td-page *,
  .td-page *::before,
  .td-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .td-page .td-catalogue .dir-list > .td-card.is-picked {
    animation: none;
    transform: none;
  }
}

/* Windows high contrast ------------------------------------------------ */

@media (forced-colors: active) {
  .td-page,
  .td-page .page-hero,
  .td-page .buy-page-content,
  .td-metrics,
  .td-picker,
  .td-toolbar,
  .td-page .td-catalogue .hub-links li,
  .td-page .td-catalogue .hub-links a,
  .td-page .td-catalogue .dir-list > .td-card,
  .td-save,
  .td-chip,
  .td-random,
  .td-clear {
    color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }

  .td-chip[aria-pressed="true"],
  .td-chip.is-active,
  .td-save[aria-pressed="true"],
  .td-save.is-saved {
    color: HighlightText;
    background: Highlight;
  }

  .td-page :is(.td-search, .td-chip, .td-random, .td-clear, .td-save, a, button):focus-visible {
    outline-color: Highlight;
  }

  .td-page .td-catalogue .dir-list > .td-card.is-picked {
    border-color: Highlight;
    box-shadow: 0 0 0 3px Highlight;
  }
}

/* Print ---------------------------------------------------------------- */

@media print {
  .td-page,
  .td-page .page-hero,
  .td-page .buy-page-content {
    color: #000;
    background: #fff !important;
  }

  .td-dashboard-head,
  .td-picker,
  .td-toolbar,
  .td-storage-note,
  .td-save,
  .td-badges {
    display: none !important;
  }

  .td-page .td-catalogue {
    margin-top: 0;
  }

  .td-page .td-catalogue .hub-links {
    display: none;
  }

  .td-page .td-catalogue .dir-group,
  .td-page .td-catalogue .dir-group.is-empty,
  .td-page .td-catalogue .dir-group.is-filtered-out,
  .td-page .td-catalogue .dir-group[hidden] {
    display: block !important;
    break-before: page;
    margin: 0;
  }

  .td-page .td-catalogue .dir-group:first-of-type {
    break-before: auto;
  }

  .td-page .td-catalogue .dir-group > h2,
  .td-page .td-catalogue .dir-group > p.dir-intro,
  .td-page .td-card .dir-name,
  .td-page .td-card .dir-name span,
  .td-page .td-card .dir-meta,
  .td-page .td-card > p,
  .td-page .td-card > p a {
    color: #000 !important;
  }

  .td-page .td-catalogue .dir-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3mm;
  }

  .td-page .td-catalogue .dir-list > .td-card,
  .td-page .td-catalogue .dir-list > .td-card.is-filtered-out,
  .td-page .td-catalogue .dir-list > .td-card[hidden] {
    min-height: 0;
    border-color: #777;
    color: #000;
    background: #fff !important;
    box-shadow: none;
    break-inside: avoid;
    display: grid !important;
    transform: none;
  }

  .td-page .td-card > .dir-thumb,
  .td-page .td-card-head > .dir-thumb {
    color: #000;
    background: #fff;
    border-color: #777;
  }
}
