/* HRTools: equestrian stationery, generous type, and a practical product tour. */
body.marketing,
body.legal-page {
  background: var(--paper);
}

html {
  scroll-padding-top: 24px;
}

/* Stud book pages change length as filters apply; a reserved scrollbar
   gutter keeps the layout from shifting sideways. */
html:has(body.stud-site) { scrollbar-gutter: stable; }

/* Smooth only for in-page links (see site.js); arriving from another page
   jumps straight to the section before late layout can shift it. */
html.smooth-scroll {
  scroll-behavior: smooth;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 10;
  padding: 12px 18px;
  background: var(--paper);
}

.skip-link:focus {
  top: 10px;
}

.site-header {
  max-width: 1240px;
  margin: 0 auto;
  padding: 25px 42px;
  background: transparent;
  border-top: 0;
  border-bottom: 4px double var(--green);
}

.site-header .brand {
  font-size: 32px;
  letter-spacing: .025em;
  text-transform: none;
}

.site-header .brand .brand-description {
  display: block;
  margin-top: 4px;
  font: 400 13px/1.4 var(--sans);
  letter-spacing: 0;
  color: var(--green);
}

.site-header nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.site-header nav a {
  font-size: 12px;
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.site-header .nav-action {
  padding: 9px 20px;
  border: 1px solid var(--green);
}

.site-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 42px;
}

.site-main h2 {
  font: 500 clamp(38px, 4.2vw, 55px)/1.04 var(--serif);
  letter-spacing: -.025em;
  margin: 0 0 24px;
}

.site-main h3 {
  font: 600 27px/1.15 var(--serif);
  margin: 0 0 16px;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 65px;
  padding: 62px 0 50px;
}

.hero-copy>p {
  max-width: 470px;
  font-size: 15px;
  line-height: 1.8;
  color: #4c5650;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 30px;
}

.site-main .button span,
.coffee-section .button span {
  margin-left: 20px;
}

.understated {
  text-decoration: none;
  border-bottom: 1px solid #839084;
  padding-bottom: 3px;
  font-size: 13px;
}

.understated:hover {
  border-color: var(--green);
}

.hero-copy .quiet-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.hero-art {
  position: relative;
  margin: 0 12px 0 0;
  padding: 14px;
  border: 1px solid #9eaa9c;
  transform: rotate(2deg);
}

.photo-mat {
  height: 480px;
  overflow: hidden;
  background: #294739;
}

.photo-mat img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: grayscale(1) contrast(.86);
  mix-blend-mode: luminosity;
}

.hero-seal {
  width: 118px;
  height: 118px;
  background: var(--paper);
  border: 1px solid #7f8c7d;
  outline: 6px solid var(--paper);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: -27px;
  right: -19px;
  transform: rotate(-10deg);
  color: var(--green);
}

.hero-seal span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .035em;
}

.hero-seal strong {
  font: 500 47px/1.1 var(--serif);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 23px;
  margin: 20px 0 38px;
}

.ornament span {
  width: 90px;
  height: 1px;
  background: #a7ad98;
}

.ornament img {
  width: 66px;
  height: auto;
  mix-blend-mode: multiply;
  opacity: .65;
}

.extension-section {
  padding-bottom: 60px;
}

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 38px;
  padding-bottom: 26px;
  border-bottom: 4px double var(--green);
}

.section-intro h2 {
  margin: 0;
  flex: 1;
}

.section-intro p {
  flex: 0 1 390px;
  margin: 0;
  color: #4c5650;
}

.product-showcase {
  position: relative;
  padding: 46px 135px 46px 38px;
  background-color: #dde3d9;
  background-image: repeating-linear-gradient(90deg, transparent 0 38px, #7e967515 38px 40px, transparent 40px 44px, #7e967518 44px 45px), repeating-linear-gradient(0deg, transparent 0 38px, #7e967515 38px 40px, transparent 40px 44px, #7e967518 44px 45px);
  border: 1px solid #c8d0c1;
}

.product-showcase figure {
  margin: 0;
}

.product-showcase img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #a6b19f;
  box-shadow: 0 12px 30px #18322313;
}

.database-shot {
  width: 100%;
}

.product-showcase figcaption {
  margin-top: 9px;
  font-size: 10px;
  color: #4c5650;
}

.product-showcase .popup-shot {
  position: absolute;
  width: 30%;
  right: 25px;
  top: 90px;
  transform: rotate(2deg);
}

.popup-shot figcaption {
  text-align: right;
}

.feature-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin-top: 45px;
}

.feature-columns article+article {
  border-left: 1px solid #cbd0c1;
  padding-left: 30px;
}

.feature-columns p {
  margin: 0;
  color: #4c5650;
  font-size: 13px;
}

.section-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 35px;
}

.section-action>span {
  font-size: 11px;
  color: var(--muted);
}

.bot-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 75px;
  padding: 55px 55px;
  margin-bottom: 53px;
  background-color: #565656;
  background-image:
    linear-gradient(90deg, rgba(5, 43, 27, .86), rgba(5, 43, 27, .73) 42%, rgba(5, 43, 27, .91)),
    url('/images/hrstats-running-horse.jpg');
  background-blend-mode: normal, multiply;
  background-size: cover;
  background-position: center 58%;
  color: #e8eade;
  border: 1px solid #173e2e;
  outline: 1px solid #173e2e;
  outline-offset: 5px;
}

.bot-section h2,
.bot-section h3,
.bot-section a {
  color: #f5f2e9;
}

.bot-copy>p {
  color: #d0d8cc;
  font-size: 13px;
  margin-bottom: 28px;
}

.bot-section .secondary {
  border-color: #99a894;
}

.bot-section .secondary:hover {
  background: #2c503e;
}

.command-card {
  border: 1px solid #899b806b;
  padding: 30px;
}

.command-card>p {
  font-size: 12px;
  margin: 0;
  color: #d0d8cc;
}

.command-card h3 {
  font-size: 32px;
}

.command-card dl {
  margin: 24px 0;
}

.command-card dl>div {
  padding: 11px 0;
  border-top: 1px solid #899b804a;
}

.command-card dt {
  font-size: 13px;
  font-weight: 500;
}

.command-card dd {
  margin: 3px 0 0;
  font-size: 11px;
  color: #c9d4c5;
}

.command-card>a {
  font-size: 11px;
}

.faq-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 0 52px;
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 35px;
}

.faq-section details {
  border-top-color: #c9cebd;
  margin: 0;
  padding: 18px 0 4px;
}

.faq-section summary {
  font-size: 14px;
}

.faq-section p {
  font-size: 13px;
  color: #4c5650;
}

.site-footer {
  max-width: 1156px;
  margin: 0 auto;
  padding: 35px 30px;
  gap: 16px;
  display: flex;
  align-items: center;
  flex-direction: column;
  border-top: 4px double var(--green);
  text-transform: none;
  letter-spacing: 0;
}

.site-footer .brand {
  font-size: 30px;
  color: var(--green);
}

.site-footer p {
  margin: 0;
  font: 500 20px var(--serif);
}

.site-footer div {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.site-footer small {
  font-size: 10px;
}

/* Supporting pages use the same shell, headings and photo treatment as home. */
.page-intro {
  padding: 44px 0 0;
}
.site-main .page-intro h1 {
  font-size: clamp(36px, 4vw, 50px);
  margin-bottom: 10px;
}
.page-kicker,
.hero-copy > .page-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font: 500 11px/1.6 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.page-intro > p:last-child {
  margin: 0;
  color: #4c5650;
  font-size: 15px;
}
.page-body { padding: 40px 0 62px; }

/* Long-form copy on supporting pages (privacy policy, user guide). */
.prose { max-width: 760px; font-size: 15px; }
.prose > :first-child { margin-top: 0; }
.site-main .prose h2 {
  font-size: 40px;
  margin: 8px 0 16px;
}
.site-main .prose h3 { margin: 32px 0 12px; }
.prose h4 {
  margin: 24px 0 8px;
  color: var(--green);
  font: 600 19px/1.25 var(--serif);
}
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 24px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose hr {
  margin: 44px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.prose code {
  padding: 1px 5px;
  background: var(--surface-alt);
  border-radius: 3px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lost-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
}
.lost-art figcaption {
  padding: 14px 4px 0;
  text-align: center;
  color: var(--green);
  font: italic 22px/1.3 var(--serif);
}
.lost-art .photo-mat img { object-position: center; }
@media (max-width: 650px) {
  .page-intro { padding-top: 30px; }
  .page-body { padding: 30px 0 45px; }
  .site-main .prose h2 { font-size: 32px; }
}

@media(max-width:900px) {
  .site-header {
    padding: 22px 26px;
  }

  .site-header nav {
    gap: 22px;
  }

  .site-main {
    padding: 0 28px;
  }

  .home-hero {
    gap: 30px;
    padding-top: 42px;
  }

  .photo-mat {
    height: 400px;
  }

  .hero-actions {
    gap: 16px;
  }

  .product-showcase {
    padding: 26px 100px 26px 24px;
  }

  .product-showcase .popup-shot {
    top: 62px;
    right: 15px;
    width: 32%;
  }

  .feature-columns {
    gap: 24px;
  }

  .feature-columns article+article {
    padding-left: 22px;
  }

  .bot-section {
    padding: 36px;
    gap: 35px;
  }
}

@media(max-width:650px) {
  .site-header {
    padding: 19px 20px;
    flex-wrap: wrap;
    gap: 17px;
  }

  .site-header .brand {
    font-size: 29px;
  }

  .site-header nav {
    width: 100%;
    gap: 18px;
    justify-content: space-between;
  }

  .site-header nav a {
    font-size: 11px;
  }

  .site-header .nav-action {
    padding: 6px 10px;
  }

  .site-main {
    padding: 0 23px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
    gap: 34px;
  }

  .site-main h1 {
    font-size: clamp(47px, 10.5vw, 66px);
  }

  .hero-copy>p {
    font-size: 14px;
  }

  .hero-art {
    margin: 0 15px 0 2px;
    padding: 10px;
  }

  .photo-mat {
    height: 340px;
  }

  .hero-seal {
    width: 96px;
    height: 96px;
    bottom: -18px;
  }

  .hero-seal strong {
    font-size: 37px;
  }

  .hero-seal span {
    font-size: 11px;
  }

  .ornament {
    margin-bottom: 35px;
  }

  .section-intro {
    display: block;
  }

  .section-intro p {
    margin-top: 22px;
    font-size: 13px;
  }

  .product-showcase {
    padding: 20px 20px 45px;
  }

  .product-showcase .popup-shot {
    position: relative;
    width: 64%;
    right: auto;
    top: auto;
    margin: -25px -6px -15px auto;
  }

  .product-showcase .database-shot figcaption {
    max-width: 30%;
  }

  .popup-shot figcaption {
    text-align: center;
  }

  .feature-columns {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
  }

  .feature-columns article+article {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid #cbd0c1;
    padding-top: 25px;
  }

  .section-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .bot-section {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 30px;
    background-position: 30% center;
  }

  .command-card {
    padding: 25px;
  }

  .faq-section {
    padding-bottom: 45px;
  }

  .faq-section h2 {
    text-align: left;
  }

  .site-footer {
    margin: 0 23px;
    padding: 30px 0;
  }

  .site-footer div {
    gap: 19px;
  }
}

@media(prefers-reduced-motion:reduce) {
  html.smooth-scroll {
    scroll-behavior: auto;
  }
}

/* The same double green rule used below the extension's primary navigation. */
.community-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 75px;
  align-items: center;
  padding: 46px 54px;
  margin-bottom: 52px;
  background: #e6e9e6;
}

.community-copy>p {
  color: #4c5650;
  font-size: 13px;
  margin: 0 0 25px;
}

.community-details {
  border-left: 1px solid #b9c3b7;
  padding-left: 45px;
}

.community-count {
  margin: 0;
  color: var(--green);
  font: 500 80px/1 var(--serif);
}

.community-count span {
  display: block;
  max-width: 230px;
  margin-top: 12px;
  color: #4c5650;
  font: 400 12px/1.7 var(--sans);
}

.community-details ul {
  list-style: none;
  margin: 25px 0 0;
  padding: 0;
}

.community-details li {
  border-top: 1px solid #c7d0c3;
  padding: 11px 0;
  font-size: 12px;
  color: var(--green);
}

.site-main .firefox-pending {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  color: #626d66;
  background: transparent;
  border-color: #b9c0b3;
  cursor: default;
}

.site-main .firefox-pending .coming-soon {
  margin: 0;
  font-size: 9px;
  line-height: 1.4;
  padding-left: 12px;
  border-left: 1px solid #b9c0b3;
}

.hero-actions {
  gap: 12px;
}

.section-action {
  flex-wrap: wrap;
  gap: 14px;
}

@media(max-width:900px) {
  .community-section {
    padding: 36px;
    gap: 35px;
  }

  .community-details {
    padding-left: 28px;
  }
}

@media(max-width:650px) {
  .community-section {
    grid-template-columns: 1fr;
    padding: 30px 24px;
    gap: 30px;
  }

  .community-details {
    border-left: 0;
    border-top: 1px solid #b9c3b7;
    padding: 27px 0 0;
  }

  .community-count {
    font-size: 64px;
  }

  .community-count span {
    max-width: none;
  }

  .community-copy .button {
    display: inline-flex;
    align-items: center;
    text-align: left;
  }

  .community-copy .button span {
    flex: none;
  }
}

.coffee-section {
  max-width: 760px;
  margin: 0 auto 48px;
  padding: 28px 16px;
  text-align: center;
}

.coffee-section p {
  max-width: 540px;
  margin: 20px auto 28px;
  color: #4c5650;
}

@media (max-width: 420px) {}

/* Review excerpts share the site's editorial typography and double green rules. */
.reviews-section {
  padding: 0 0 76px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.review {
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 24px;
  border-bottom: 1px solid #cbd0c1;
}

.review-rating {
  display: flex;
  gap: 5px;
  margin: 0 0 20px;
}

.review-rating img {
  display: block;
  width: 20px;
  height: 24px;
}

.review blockquote {
  margin: 0;
}

.review blockquote p {
  margin: 0;
  color: var(--green);
  font: 500 1.375rem/1.45 var(--serif);
}

.review figcaption strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.review-author>span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reviews-source {
  margin: 28px 0 0;
  font-size: 14px;
  text-align: right;
}

.site-main h1 {
  font: 500 clamp(48px, 6.2vw, 83px)/1.05 var(--serif);
  letter-spacing: -.035em;
  margin: 0 0 27px;
  text-transform: none;
}

/* Sized to the hero column so the headline holds three lines at any desktop width. */
@media (min-width: 651px) {
  .hero-copy {
    container-type: inline-size;
  }

  .site-main .home-hero h1 {
    font-size: 10.6cqi;
  }
}

.site-main em,
.coffee-section em {
  font-weight: 500;
}

.home-hero h1 em {
  white-space: nowrap;
}

.site-main .button,
.coffee-section .button {
  font-size: 14px;
  padding: 14px 23px;
}

.site-header nav {
  flex-wrap: wrap;
}

.site-header nav a {
  font-size: 14px;
}

@media (max-width: 650px) {
  .review-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .reviews-section {
    padding-bottom: 52px;
  }

  .review blockquote {
    margin-bottom: 0;
  }

  .reviews-source {
    text-align: left;
  }

  .site-header nav {
    justify-content: flex-start;
  }
}

.review figcaption {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.review-avatar {
  display: block;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--green);
  outline: 1px solid var(--green);
  outline-offset: 4px;
  background: #294739;
  isolation: isolate;
}

.review-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(.86);
  mix-blend-mode: luminosity;
}

.pony-left img {
  object-position: left center;
}

.pony-right img {
  object-position: right center;
}

.stable-horse img {
  object-position: center 22%;
}

.review-author {
  min-width: 0;
}

.review-rating {
  margin-bottom: 14px;
  gap: 4px;
}

.review-rating img {
  width: 16px;
  height: 20px;
  transform: rotate(-12deg);
}

.review-rating img:nth-child(2) {
  transform: rotate(8deg);
}

.review-rating img:nth-child(3) {
  transform: rotate(-6deg);
}

.review-rating img:nth-child(4) {
  transform: rotate(13deg);
}

.review-rating img:nth-child(5) {
  transform: rotate(-9deg);
}

@media (min-width: 651px) and (max-width: 950px) {
  .review-grid {
    gap: 24px;
  }

  .review figcaption {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Scrollable screenshot tour: only the navigation is interactive. */
.product-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 32px 32px 140px 70px;
}
.product-showcase .popup-shot {
  position: absolute;
  width: 240px;
  left: 18px;
  right: auto;
  top: auto;
  bottom: 25px;
  margin: 0;
  transform: rotate(-3deg);
  pointer-events: none;
}
.product-showcase .database-shot figcaption {
  margin-left: 220px;
}
.popup-shot figcaption {
  text-align: center;
}
.preview-tabs {
  display: flex;
  gap: 24px;
  padding: 0 22px;
  background: #f7f7f2;
  border: 1px solid #a6b19f;
  border-bottom: 4px double var(--green);
}
.preview-tab {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5650;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 15px 0 12px;
  cursor: pointer;
}
.preview-tab[aria-selected="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
}
.preview-tab:focus-visible, .preview-scroll:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.preview-scroll {
  height: 510px;
  overflow: auto;
  background: #f7f7f2;
  border: 1px solid #a6b19f;
  border-top: 0;
  scrollbar-color: #71866a #e3e8df;
  scrollbar-width: auto;
}
.product-showcase .preview-scroll img {
  width: 100%;
  min-width: 720px;
  max-width: none;
  border: 0;
  box-shadow: none;
}
@media (max-width: 1000px) {
  .product-showcase { padding: 24px 24px 130px 45px; }
  .product-showcase .popup-shot { width: 210px; left: 12px; }
  .product-showcase .database-shot figcaption { margin-left: 195px; }
  .popup-shot figcaption { text-align: center; }
}
@media (max-width: 600px) {
  .product-showcase { padding: 14px; gap: 24px; }
  .product-showcase .popup-shot {
    position: static;
    width: min(260px, 100%);
    margin: 0 auto;
    transform: none;
  }
  .product-showcase .preview-scroll img { min-width: 0; }
  .preview-scroll picture { display: block; }
  .preview-scroll { height: 440px; }
  .preview-tabs { gap: 18px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
  .preview-tab { flex: none; white-space: nowrap; }
  .product-showcase .database-shot figcaption { max-width: none; margin-left: 0; }
}

.hero-seal img { width: 48px; height: 50px; margin: 3px 0; }
.stable-board {
  margin: 48px 0 40px;
  padding: 28px 22px 20px;

}
.board-intro { text-align: center; max-width: 570px; margin: 0 auto 38px; }

.board-intro h2 { margin: 12px 0; }
.board-intro > p:last-child { font-size: 14px; color: #4c5650; }
.board-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; padding: 10px 0; }
.board-note {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 34px 25px 24px;
  background: #f4efdF;
  border: 1px solid #cdc8b6;
  box-shadow: 2px 5px 0 #1832230d;
  color: var(--green);
  text-decoration: none;
  transform: rotate(-2deg);
}
.board-note::before {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(50% - 29px);
  width: 58px;
  height: 22px;
  background: #b8c3a9a6;
  transform: rotate(4deg);
}
.board-note:nth-child(2) { transform: rotate(1.5deg); background: #e7eddf; }
.board-note:nth-child(3) { transform: rotate(-1deg); background: #f6f3eb; }
.board-note h3 { font-size: 29px; line-height: 1.1; margin: 0 0 12px; }
.board-note p { font-size: 13px; line-height: 1.7; color: #4c5650; margin: 0 0 24px; }
.note-link { font-size: 11px; font-weight: 600; margin-top: auto; text-decoration: underline; text-underline-offset: 4px; }
.board-note:hover { border-color: var(--green); box-shadow: 2px 6px 0 #1832231a; }
.board-note:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
.board-signoff { text-align: center; font: italic 22px/1.4 var(--serif); margin: 28px 0 0; }
@media (max-width: 650px) {
  .stable-board { padding: 28px 14px; }
  .board-notes { grid-template-columns: 1fr; gap: 32px; max-width: 370px; margin: auto; }
  .board-note { padding: 28px 24px 24px; }
  .hero-actions, .section-action { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
  .site-main .hero-actions .button, .site-main .section-action .button {
    min-width: 0; padding: 12px 7px; font-size: 11px; justify-content: center; text-align: center;
  }
  .site-main .hero-actions .button > span, .site-main .section-action .button > span { margin-left: 5px; }
  .site-main .hero-actions .firefox-pending, .site-main .section-action .firefox-pending { flex-direction: column; gap: 3px; }
  .site-main .firefox-pending .coming-soon { border: 0; padding: 0; margin: 0; font-size: 8px; }
}



.hero-seal { border: 0; }
.seal-stamp { width: 100%; height: 100%; overflow: visible; }
.seal-stamp text { fill: currentColor; font-family: Georgia, serif; font-size: 13px; font-weight: 700; letter-spacing: 2px; }

#extension .section-action { padding-block: 32px 20px; }


.coffee-section {
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px) auto;
  align-items: center;
  gap: 24px;
  padding: 32px;
  margin: 0 max(42px, calc((100% - 980px) / 2)) 48px;
  background: #eeeadd;
  text-align: left;
  border: 0;
  border-radius: 2px 18px 2px 18px;
}
.coffee-section h2 { font: 500 32px/1.12 var(--serif); letter-spacing: -.025em; margin: 0; }
.coffee-section p { max-width: 430px; font-size: 13px; line-height: 1.75; margin: 16px 0 0; }
.coffee-action { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.coffee-thanks { color: #66705c; font: italic 16px/1.4 var(--serif); }
@media (max-width: 650px) {
  .coffee-section { grid-template-columns: 1fr; gap: 24px; padding: 28px 24px; margin-inline: 23px; }
  .coffee-section h2 { font-size: 30px; }
  .coffee-action { align-items: flex-start; }
}

.coffee-pony { margin: 0 0 -32px; align-self: end; text-align: center; overflow: hidden; }
.coffee-pony figcaption { font: italic 17px/1.3 var(--serif); color: var(--green); transform: rotate(-6deg); margin: 0 0 10px; }
.coffee-pony img { display: block; width: 100%; height: auto; transform: translateY(7px); }
@media (min-width: 651px) and (max-width: 900px) {
  .coffee-section { grid-template-columns: minmax(0, 1fr) 140px auto; gap: 16px; padding-inline: 24px; margin-inline: 28px; }
  .coffee-section .button { padding-inline: 16px; }
  .coffee-thanks { font-size: 14px; }
}
@media (max-width: 650px) {
  .coffee-section { grid-template-columns: 1fr; }
  .coffee-pony { grid-row: 3; width: 100%; display: grid; grid-template-columns: 1fr 140px; align-items: center; justify-self: stretch; margin: -4px 0 -28px; }
  .coffee-pony figcaption { font-size: 16px; margin: 0; }
}

/* Analytics choice stays available without blocking the page. */
.analytics-consent[hidden], .analytics-settings[hidden] { display: none; }
.analytics-consent { position: fixed; z-index: 100; bottom: 1rem; left: 1rem; right: 1rem; max-width: 34rem; margin: auto; padding: .85rem; background: #faf9f5; color: #123f30; border: 1px solid #123f30; box-shadow: 0 4px 24px #0002; font-size: .8rem; line-height: 1.5; }
.analytics-consent p { margin: 0 0 .65rem; }
.analytics-consent div { display: flex; gap: .5rem; flex-wrap: wrap; }
.analytics-consent button { padding: .45rem .75rem; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.analytics-settings { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* User guide: synced from the Google Doc by scripts/sync-guide.cjs. */
.guide-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 760px);
  gap: 60px;
}
.guide-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: 13px;
}
.guide-toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font: 500 11px/1.6 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide-toc ol { margin: 0; padding: 0; list-style: none; }
.guide-toc li { margin: 0; line-height: 1.45; }
.guide-toc .toc-level-2 { margin-top: 12px; font-weight: 600; }
.guide-toc .toc-level-2:first-child { margin-top: 0; }
.guide-toc .toc-level-3 { margin-top: 5px; padding-left: 12px; }
.guide-toc a { text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }
.guide-figure { clear: both; margin: 18px 0 22px; }
.guide-figure-aside {
  clear: right;
  float: right;
  width: min(var(--figure-width), 44%);
  margin: 6px 0 18px 32px;
}
.prose h2, .prose h3, .prose hr, .guide-gallery { clear: both; }
.guide-center { text-align: center; }
.guide-figure.guide-center img { margin-inline: auto; }
.guide-tip, .guide-table { display: flow-root; }
.guide-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
.guide-figure figcaption,
.guide-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}
.guide-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: start;
  margin: 18px 0;
}
.guide-gallery .guide-figure { margin: 0; }
.guide-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
  margin: 32px 0 18px;
  clear: both;
}
.guide-columns .guide-figure { margin: 0; }
.prose .guide-column > :first-child { margin-top: 0; }
.prose .guide-column > :last-child { margin-bottom: 0; }
.guide-gallery + .guide-caption { margin-top: -6px; }
.guide-tip {
  margin: 22px 0;
  padding: 18px 22px;
  background: var(--surface-alt);
  border-left: 3px solid var(--brass);
}
.guide-tip > :last-child { margin-bottom: 0; }
.guide-tip-title {
  margin-bottom: 6px;
  color: var(--green);
  font: 600 19px/1.25 var(--serif);
}
.guide-table { overflow-x: auto; margin: 18px 0; }
.guide-table table { border-collapse: collapse; }
.guide-table td { padding: 8px 12px; border: 1px solid var(--line); vertical-align: top; }
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .guide-toc { position: static; max-height: none; overflow: visible; }
  .guide-toc .toc-level-3 { display: none; }
}
@media (max-width: 650px) {
  .guide-figure-aside { float: none; width: auto; margin: 18px 0 22px; }
}

/* Changelog: release sections grouped by month and year beside a jump list. */
.changelog-toc .toc-level-3 {
  font-variant-numeric: tabular-nums;
}
.changelog-month {
  scroll-margin-top: 24px;
}
.changelog-month + .changelog-month {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 4px double var(--green);
}
.site-main .prose .changelog-month-title {
  margin: 0 0 24px;
  font-size: 38px;
}
.version-card {
  scroll-margin-top: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.version-card + .version-card { margin-top: 32px; }
.version-card:last-child { padding-bottom: 0; border-bottom: 0; }
.version-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.site-main .version-meta h3 {
  margin: 0;
  font-size: 30px;
}
.release-date {
  color: var(--muted);
  font: 500 12px/1.4 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.version-card h4 {
  margin: 24px 0 8px;
  font-size: 21px;
}
.version-meta + h4 { margin-top: 0; }
.feature-badge {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 8px;
  border: 1px solid var(--brass);
  background: var(--surface-alt);
  color: var(--green);
  font: 600 10px/1.4 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.version-card li > .feature-badge {
  margin-right: 7px;
  vertical-align: 1px;
}

/* Stud book: a section header, the breed book, a filter rail beside a grid
   of stallion cards, and one stallion's profile. */
/* On stud book pages the header carries the book's own links, the current
   one underlined, and a way back to the main site set off at the end. */
.stud-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.stud-header .stud-header-home { padding-left: 30px; border-left: 1px solid var(--line); color: var(--muted); }
.stud-header .stud-header-home:hover { color: var(--green); }
/* The links stay on one line beside the brand, closing up as the header
   narrows. */
.stud-header nav { flex-wrap: nowrap; }
.stud-header nav a { white-space: nowrap; }
@media (max-width: 900px) {
  .stud-header nav { gap: 18px; }
  .stud-header .stud-header-home { padding-left: 18px; }
}

.stud-hero { padding: 56px 0 0; text-align: center; }
/* Whatever opens a stud book page sits close under the header. */
.stud-site .site-main > :is(.page-intro, .stud-hero):first-child { padding-top: 28px; }
.site-main .stud-hero h1 {
  margin: 0;
  font: 500 clamp(44px, 6vw, 76px)/1.02 var(--serif);
  letter-spacing: -.01em;
}
.stud-hero h1 em { font-style: italic; }
.stud-hero-lede { max-width: 560px; margin: 18px auto 0; color: #4c5650; font-size: 16px; line-height: 1.75; }
/* The divider under the hero: the leaf ornament above the count line, the
   ornament's rules either side of it. */
.stud-hero-divider { margin: 26px 0 34px; }
.stud-hero-divider img { display: block; width: 66px; height: auto; margin: 0 auto 6px; mix-blend-mode: multiply; opacity: .65; }
.stud-hero-rule { display: flex; gap: 20px; align-items: center; justify-content: center; }
.stud-hero-rule span { flex: 0 1 90px; min-width: 24px; height: 1px; background: #a7ad98; }
.stud-hero-rule .stud-status { margin: 0; text-wrap: balance; }
.stud-breed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stud-breed-grid { grid-auto-rows: 240px; }
.stud-breed-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
  transition: border-color .15s ease;
}
.stud-breed-link:hover { border-color: var(--brass); }
/* Tiles take the homepage's paper tints in turn, on its showcase check
   pattern; a horse without a background stands on the same. */
.tint-1 { --tile-bg: #dde3d9; }
.tint-2 { --tile-bg: #f4efdf; }
.tint-3 { --tile-bg: #e7eddf; }
.tint-4 { --tile-bg: #f6f3eb; }
.stud-breed:not(.has-picture) .stud-breed-link,
.stud-breed .stud-photo-tile:not(.has-background) {
  background-color: var(--tile-bg);
  background-image: repeating-linear-gradient(90deg, transparent 0 38px, #7e96750c 38px 40px, transparent 40px 44px, #7e96750e 44px 45px), repeating-linear-gradient(0deg, transparent 0 38px, #7e96750c 38px 40px, transparent 40px 44px, #7e96750e 44px 45px);
}
/* The homepage's round stamp, top right; held back so the name plate reads
   first, and fainter still behind a horse. */
.stud-seal {
  position: absolute;
  top: 18px;
  right: 30px;
  width: 92px;
  height: 92px;
  overflow: visible;
  color: var(--green);
  opacity: .5;
  transform: rotate(-10deg);
}
.stud-photo-tile > .stud-seal { opacity: .26; }
.stud-photo-tile.has-background > .stud-seal { --tile-bg: var(--paper); }
.stud-seal text { fill: currentColor; font-family: Georgia, serif; font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.stud-seal .stud-seal-word {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
  paint-order: stroke fill;
  stroke: var(--tile-bg, var(--paper));
  stroke-width: 5px;
  stroke-linejoin: round;
}
/* Faded into the top right corner of a card or profile frame, behind the
   horse or the name panel. */
.stud-photo > .stud-seal-faded {
  top: 5%;
  right: 4%;
  width: 40%;
  max-width: 170px;
  height: auto;
  aspect-ratio: 1;
  opacity: .2;
  --tile-bg: var(--surface-alt);
}
.stud-photo.has-background > .stud-seal-faded { --tile-bg: var(--paper); }
.stud-photo.stud-photo-tile { position: absolute; inset: 0; aspect-ratio: auto; }
.stud-photo-tile.is-empty { display: none; }
/* In a breed tile the horse stands on the right, clear of the name plate. */
.stud-photo.stud-photo-tile > .stud-photo-horse { padding: 7% 6% 4%; object-position: 100% 100%; }
/* Beside a horse the plate keeps to the left half, widening past it only
   as far as the breed's longest word, which never splits. */
.stud-photo-tile.has-horse ~ .stud-breed-plate { min-width: min-content; max-width: calc(50% - 20px); }
.stud-breed-plate {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  gap: 2px;
  max-width: calc(100% - 32px);
  padding: 12px 18px 13px;
  border-top: 4px double var(--green);
  background: var(--paper);
}
.stud-breed-name { color: var(--green); font: 600 26px/1.15 var(--serif); }
.stud-breed-count { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.stud-breed-link:hover .stud-breed-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.stud-recent { margin: 64px 0 62px; }
.stud-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.site-main .stud-section-head .stud-section-title { padding-bottom: 10px; border-bottom: 0; }
.stud-intro .stud-kicker { margin-bottom: 10px; }
.site-main .stud-intro h1 { margin-bottom: 0; font-size: clamp(30px, 3.2vw, 40px); }
.stud-kicker a { text-decoration: none; }
.stud-kicker a:hover { text-decoration: underline; }
.stud-market {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-top: 22px;
}
.stud-rail {
  --scrollbar-thumb: #b6ae9f;
  --scrollbar-track: transparent;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  /* Room inside the scroll box so focus outlines are not clipped. */
  margin: 0 -4px;
  padding: 0 4px 4px;
  overflow-x: hidden;
}
.stud-msd-pop {
  --scrollbar-thumb: #b6ae9f;
  --scrollbar-track: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
@supports not (scrollbar-color: auto) {
  .stud-rail::-webkit-scrollbar,
  .stud-msd-pop::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  .stud-rail::-webkit-scrollbar-thumb,
  .stud-msd-pop::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
  }
  .stud-rail::-webkit-scrollbar-track,
  .stud-msd-pop::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}
.stud-rail-toggle { display: none; }
.stud-market.is-quiet { grid-template-columns: minmax(0, 1fr); }
.site-main .is-quiet .stud-rail,
.is-quiet .stud-sort { display: none; }
.is-quiet .stud-toolbar { border-bottom: 0; }
.site-main .stud-rail-title {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font: 600 22px/1.15 var(--serif);
  letter-spacing: 0;
}
.stud-filters { margin: 0; }
.stud-block {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.stud-block-title,
.stud-group summary {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  color: #76603d;
  font: 600 10px/1.5 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
}
fieldset.stud-block > legend { float: left; }
fieldset.stud-block > legend + * { clear: left; }
/* Field labels in the card and profile label style. */
.stud-field {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
  color: var(--muted);
  font: 500 10px/1.4 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stud-field:last-child { margin-bottom: 0; }
.stud-filters select,
.stud-filters input[type=number],
.stud-filters input[type=search],
.stud-sort select {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
  font: 400 13px/1.4 var(--sans);
}
.stud-filters select:focus-visible,
.stud-filters input:focus-visible,
.stud-sort select:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.stud-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.stud-ranges { display: grid; gap: 8px; margin-top: 10px; }
.stud-ranges .stud-range { grid-template-columns: 30px minmax(0, 1fr) auto minmax(0, 1fr); }
.stud-range-label { display: flex; align-items: center; }
.stud-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 10px;
}
.stud-pairs .stud-field { margin: 0; }
.stud-check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.stud-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.stud-ranges + .stud-check { margin-top: 12px; }
.stud-group summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  list-style: none;
  cursor: pointer;
}
.stud-group summary::-webkit-details-marker { display: none; }
.stud-group summary span { margin-right: auto; }
.stud-group summary::after {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin: 3px 3px 0 0;
  border-right: 1px solid var(--green);
  border-bottom: 1px solid var(--green);
  transform: rotate(45deg);
}
.stud-group[open] summary::after { margin-top: 6px; transform: rotate(-135deg); }
.stud-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* Re-rendered results must not become the browser's scroll anchor, which
   would jump the page when the list grows or shrinks. */
.stud-market { overflow-anchor: none; }
.stud-results { min-width: 0; }
/* At least a screen tall, so fewer results never shorten the page under
   the reader and move the rail. */
@media (min-width: 901px) {
  .stud-results { min-height: calc(100vh - 24px); }
}
.stud-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  min-height: 34px;
}
.stud-status { margin: 0; color: var(--muted); font-size: 13px; }
.stud-sort {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.stud-sort select { width: auto; }
.stud-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.stud-chips:empty { display: none; }
.stud-chips + .stud-grid { margin-top: 14px; }
.site-main .stud-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--green);
  font: 500 12px/1.5 var(--sans);
  letter-spacing: 0;
}
.site-main .stud-chip:hover { border-color: var(--brass); background: var(--surface-alt); }
.stud-chip span { color: var(--muted); font-size: 14px; line-height: 1; }
.site-main .stud-chips-clear { padding: 4px 2px; font-size: 12px; }
.stud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 26px 22px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.stud-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  background: white;
  transition: border-color .15s ease;
}
.stud-card:hover { border-color: var(--brass); }
.stud-card-link { color: inherit; text-decoration: none; }
.stud-card-link::after { content: ''; position: absolute; inset: 0; }
.stud-card-link:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.stud-card-link:focus-visible { outline: none; }
.stud-card:has(.stud-card-link:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.stud-card-estate a { position: relative; z-index: 1; color: inherit; }
.stud-card-estate a:hover { color: var(--green); }
/* Every picture variant shares one frame ratio, so mixed grids stay even. */
.stud-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-alt);
}
.stud-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Zoomed in from the ground plane so the scenery matches the cropped horse's scale. */
.stud-photo-bg { object-fit: cover; transform: scale(1.22); transform-origin: 50% 80%; }
/* The ground shadow is sized and placed by studs.js from the horse's drawn
   box, and multiplied into the background like the extension does. */
.stud-photo > .stud-photo-shadow {
  inset: auto;
  width: auto;
  height: auto;
  visibility: hidden;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.stud-photo > .stud-photo-shadow.is-placed { visibility: visible; }
/* Game renders are portrait and run ears to hooves, so the horse gets
   headroom and stands on the bottom of the frame. */
.stud-photo > .stud-photo-horse { padding: 6% 0 3%; object-fit: contain; object-position: 50% 100%; }
/* A v1 breed's layered horse takes the flattened render's box, and studs.js
   fits its cropped canvas inside it the way object-fit would. */
.stud-photo > .stud-photo-layers { position: absolute; inset: 0; width: 100%; height: 100%; }
.stud-photo-canvas { position: absolute; visibility: hidden; }
.stud-photo-canvas.is-cropped { visibility: visible; }
.stud-photo-canvas > img { position: absolute; left: 0; bottom: 0; max-width: 100%; }
/* No picture: a flat stationery panel with an inset brass rule, the breed,
   a diamond and the confo high as the figure. */
.stud-photo.is-empty::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--brass);
  opacity: .45;
  pointer-events: none;
}
.stud-photo.has-background::before { display: none; }
.stud-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}
.stud-panel-name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--green);
  font: 600 28px/1.12 var(--serif);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.stud-coin { flex: none; width: 18px; height: 18px; vertical-align: middle; }
.stud-fee { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.stud-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 16px 16px;
}
.site-main .stud-card-name {
  margin: 0;
  color: var(--green);
  font: 600 22px/1.15 var(--serif);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-underline-offset: 4px;
}
.stud-card-meta,
.stud-card-estate { margin: 4px 0 0; color: #4c5650; font-size: 12.5px; line-height: 1.5; }
.stud-card-estate { margin-top: 1px; color: var(--muted); }
.stud-card-fees {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  min-height: 24px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stud-card-info { padding-bottom: 12px; }
/* Owners' own words, set as a quotation. */
.stud-quote { margin: 12px 0 0; color: #4c5650; font: italic 500 18px/1.4 var(--serif); }
.stud-quote p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.stud-quote p::before { content: '\201C'; }
.stud-quote p::after { content: '\201D'; }
.stud-card-notes { margin-top: 10px; font-size: 16px; }
.stud-card-notes p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
/* The owner's notes, a pull quote under the picture: a large brass
   opening mark hangs beside the text in place of the inline marks. */
.site-main .stud-profile-notes {
  position: relative;
  margin: 30px 0 0;
  padding: 0 0 0 40px;
  font-size: 20px;
  line-height: 1.45;
}
.stud-profile-notes::before {
  content: '\201C';
  position: absolute;
  top: -10px;
  left: 0;
  color: var(--brass);
  font: 600 66px/1 var(--serif);
}
.stud-profile-notes p::before,
.stud-profile-notes p::after { content: none; }
.stud-profile-notes:not(.is-expanded) p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.site-main .stud-notes-toggle { margin-top: 8px; padding: 0; font-size: 12.5px; }
.stud-estate { max-width: 680px; margin-top: 14px; }
.stud-estate-note { margin: 0; font-size: 21px; }
.stud-estate-links { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 12px 0 0; font-size: 14px; }
.stud-estate-link { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.stud-estate-label { color: var(--muted); font: 500 10px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.site-main .stud-discord-handle {
  padding: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: 400 14px/1.4 var(--sans);
  font-variant-ligatures: none;
  cursor: copy;
}
.site-main .stud-discord-handle:hover { border-bottom-color: var(--green); color: var(--green); }
.site-main .stud-discord-handle { display: inline-grid; justify-items: start; }
.stud-discord-name, .stud-copied { grid-area: 1 / 1; transition: opacity .3s ease; }
.stud-discord-name { user-select: text; }
.stud-copied { opacity: 0; }
.stud-discord-handle.is-copied .stud-discord-name { opacity: 0; }
.stud-discord-handle.is-copied .stud-copied { opacity: 1; }
.stud-copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The arrow on links that leave for Horse Reality. */
.stud-out { flex: none; margin-left: 6px; font-size: 12px; }
.stud-ped-link .stud-out { margin-left: 0; color: var(--muted); }
.stud-card-foot { margin-top: auto; }
.stud-card-lfg {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-left: auto;
  color: var(--green);
  font: 600 10.5px/1.6 var(--sans);
  letter-spacing: .12em;
  text-decoration: none;
}
/* A drawn tick: the short and long strokes of a rotated corner. */
.stud-card-lfg::before,
.stud-tick::before {
  content: '';
  width: 4px;
  height: 8px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.stud-card-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.stud-card-scores dt,
.stud-stats dt,
.stud-fees dt,
.stud-facts dt {
  color: var(--muted);
  font: 500 10px/1.4 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stud-card-scores abbr { text-decoration: none; }
.stud-card-scores dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stud-pages {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}

.stud-detail { padding-bottom: 62px; }
.stud-detail:has(.stud-lost) { padding-bottom: 0; }
.stud-crumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; color: var(--muted); font-size: 13px; }
.stud-crumbs a { text-decoration: none; }
.stud-crumbs a:hover { text-decoration: underline; }
.stud-profile-title .page-kicker a { text-decoration: none; }
.stud-profile-title .page-kicker a:hover { text-decoration: underline; }
.stud-detail > .stud-status { margin-top: 26px; }
.stud-profile-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 0 48px;
  align-items: start;
  margin-top: 22px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--green);
}
/* The headline scores in the summary between hairlines, the listing facts
   under them. */
.stud-profile-head .stud-stats {
  margin-top: 26px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* The listing facts: one quiet, centred line across the head, each label
   beside its value in small muted type, the report link at the end. */
.stud-profile-head > .stud-facts { grid-column: 1 / -1; justify-content: center; gap: 4px 28px; margin-top: 24px; }
.stud-profile-head .stud-facts > div { display: flex; gap: 8px; align-items: baseline; }
.stud-profile-head .stud-facts dd { margin: 0; color: var(--muted); font-size: 12.5px; }
/* Wide screens: the line sits in the summary column under the score bar. */
@media (min-width: 1101px) {
  .stud-profile-head { grid-template-rows: auto 1fr; }
  .stud-profile-main { grid-column: 1; grid-row: 1 / span 2; }
  .stud-profile-side { grid-column: 2; grid-row: 1; }
  .stud-profile-head > .stud-facts { grid-column: 2; grid-row: 2; justify-content: flex-start; margin-top: 18px; }
}
/* Mid widths: studs.js keeps the title, fees and button beside the picture,
   and the scores too when they fit its height; what does not fit moves, with
   the notes, into a full-width row below, so neither column is left short. */
.stud-profile-below:empty { display: none; }
@media (min-width: 651px) and (max-width: 1100px) {
  .stud-profile-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .stud-profile-below { display: flex; flex-direction: column; grid-column: 1 / -1; }
}
.stud-refreshed { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: baseline; }
.stud-profile-figure { margin: 0; }
/* The background is only drawn behind a horse, so its credit goes with it. */
.stud-profile-figure:has(.stud-photo.is-empty) .stud-credit { display: none; }
.stud-photo-profile { border: 1px solid var(--line); }
.stud-photo-profile.is-empty::before { inset: 16px; }
.stud-photo-profile > .stud-photo-horse { padding: 7% 0 4%; }
.stud-photo-profile .stud-panel { padding: 40px; }
.stud-photo-profile .stud-panel-name { margin-top: 14px; font-size: 54px; }
.stud-tick,
.stud-cross { display: flex; gap: 8px; align-items: center; }
/* A drawn cross, the tick's counterpart: two diagonal strokes. */
.stud-cross::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  background:
    linear-gradient(45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(-45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px));
}
.site-main .stud-subtitle {
  margin: 18px 0 6px;
  color: #76603d;
  font: 600 10px/1.5 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.site-main .stud-genes .stud-subtitle { margin: 16px 0 10px; }
/* A ? beside a heading; its note shows above it on hover or focus. */
.stud-help { position: relative; display: inline-flex; margin-left: 8px; vertical-align: 1px; letter-spacing: 0; text-transform: none; }
.site-main .stud-help-mark {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 600 9.5px/13px var(--sans);
  cursor: help;
}
.site-main .stud-help-mark:hover,
.site-main .stud-help-mark:focus-visible { color: var(--green); }
.stud-help-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: -10px;
  z-index: 6;
  width: 240px;
  padding: 10px 12px;
  background: var(--green);
  color: var(--paper);
  font: 400 12.5px/1.45 var(--sans);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, visibility .12s;
}
.stud-help:hover .stud-help-text,
.stud-help:focus-within .stud-help-text { opacity: 1; visibility: visible; }
/* In the rail the note spans the rail's width above its heading instead of
   hanging off the mark, so it adds no sideways scroll to the rail. */
.stud-rail .stud-subtitle { position: relative; }
.stud-rail .stud-help { position: static; }
.stud-rail .stud-help-text { left: 0; right: 0; width: auto; }
.stud-genes { margin-top: 10px; }
.stud-field > .stud-pairs { margin-top: 0; }
.stud-msd { position: relative; min-width: 0; letter-spacing: 0; text-transform: none; }
.stud-msd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
  font: 400 13px/1.4 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}
.stud-msd-btn::after {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  margin: -2px 1px 0 0;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
}
.stud-msd.is-open .stud-msd-btn::after {
  margin-top: 2px;
  transform: rotate(-135deg);
}
.stud-msd.is-open .stud-msd-btn,
.stud-msd-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.stud-msd-val {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.stud-msd-pop {
  z-index: 40;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  box-shadow: 0 6px 18px rgba(24, 34, 28, .1);
  overflow-y: auto;
}
.stud-msd-pop[hidden] { display: none; }
.stud-msd-pop-floating { position: fixed; }
.stud-msd-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 2px;
  color: var(--ink);
  font: 400 13px/1.4 var(--sans);
  cursor: pointer;
  user-select: none;
}
.stud-msd-opt:hover { background: var(--surface-alt); }
.stud-msd-opt input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
/* Profile: jump links pinned under the header while the sections scroll. */
.stud-section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 26px;
  margin-top: 12px;
  padding: 12px 0 0;
  overflow-x: auto;
  background: var(--paper);
  /* One green rule; the current link's underline lies over it. */
  box-shadow: inset 0 -1px 0 var(--green);
  scrollbar-width: none;
}
.stud-section-nav a {
  flex: none;
  padding-bottom: 9px;
  border-bottom: 2px solid transparent;
  font: 500 11px/1.5 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.stud-section-nav a:hover { border-bottom-color: var(--line); }
/* A row wider than the screen drags sideways with a mouse (studs.js). */
.stud-section-nav.can-drag { cursor: grab; user-select: none; }
.stud-section-nav.is-dragging,
.stud-section-nav.is-dragging a { cursor: grabbing; }
.stud-section-nav a[aria-current] { border-bottom-color: var(--green); }
.stud-profile, .stud-section, .stud-more { scroll-margin-top: 60px; }
.stud-report { flex: none; }
.site-main .stud-report-open { padding: 0; color: var(--muted); font-size: 11.5px; }
.site-main .stud-report-open:hover { color: var(--green); }
/* The report form, in a paper dialog over a dimmed page. */
.stud-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 26px 28px 28px;
  border: 1px solid var(--green);
  border-top: 4px double var(--green);
  background: var(--paper);
  color: var(--ink);
}
.stud-dialog::backdrop { background: rgb(11 60 42 / .35); }
.site-main .stud-dialog-title { margin: 0; font: 600 26px/1.2 var(--serif); letter-spacing: 0; }
.stud-dialog-subject { margin: 4px 0 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.stud-dialog-note { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.stud-dialog-note a { color: var(--green); }
.stud-report-form { display: grid; gap: 12px; }
.stud-report-form select,
.stud-report-form input,
.stud-report-form textarea {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
  font: 400 13px/1.5 var(--sans);
}
.stud-report-form textarea { resize: vertical; }
.stud-report-actions { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.site-main .stud-report-actions .text-button { padding: 0; font-size: 12px; }
.stud-report-status { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.stud-report-status:empty { display: none; }
.stud-group-body { margin-top: 12px; }
.stud-credit { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.stud-profile-title .page-kicker { margin: 0 0 12px; }
.site-main .stud-profile-name {
  margin: 0;
  font: 500 clamp(34px, 3.6vw, 48px)/1.08 var(--serif);
  letter-spacing: .01em;
  text-transform: none;
  overflow-wrap: anywhere;
}
.stud-tagline { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 10px 0 0; color: #76603d; font-size: 14px; letter-spacing: .02em; }
.stud-tagline > span + span::before { content: '·'; margin: 0 10px; color: var(--muted); }
.stud-tagline-estate a { color: var(--green); }
/* One click selects the whole id for copying. */
.stud-id { user-select: all; }
/* Fees and an offered guarantee share one ruled band. Fees stay on one
   line while it fits, else fall into two even columns (studs.js). */
.stud-terms { margin: 24px 0 0; border-top: 4px double var(--green); border-bottom: 1px solid var(--line); }
.stud-fees {
  display: grid;
  grid-auto-columns: max-content;
  grid-auto-flow: column;
  gap: 14px 30px;
  margin: 0;
  padding: 16px 0;
}
.stud-fees.is-stacked { grid-template-columns: repeat(2, max-content); grid-auto-flow: row; column-gap: 44px; }
.stud-lfg { padding: 13px 0 15px; }
.stud-fees + .stud-lfg { border-top: 1px solid var(--line); }
.stud-lfg-title { margin: 0; color: var(--green); font: 600 10.5px/1.6 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.stud-lfg-terms { margin: 4px 0 0 14px; color: #4c5650; font-size: 13.5px; line-height: 1.5; white-space: pre-line; }
.stud-fees div { display: flex; gap: 9px; align-items: center; }
.stud-fees .stud-coin { width: 26px; height: 26px; }
.stud-fees dd {
  margin: 0;
  color: var(--green);
  font: 600 28px/1.1 var(--serif);
  font-variant-numeric: tabular-nums;
}
.stud-profile-head .button { margin-top: 22px; }
.stud-profile-head .button span { margin-left: 14px; }
/* Photo mode: a quiet camera link at the end of the breed and id row, set
   like the row itself. */
.stud-kicker-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 0 12px; }
.stud-profile-title .stud-kicker-row .page-kicker { margin: 0; }
.site-main .stud-photo-open {
  display: inline-flex;
  flex: none;
  gap: 7px;
  align-items: center;
  padding: 0;
  color: var(--muted);
  font: 500 11px/1.6 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-main .stud-photo-open:hover { color: var(--green); text-decoration: none; }
.stud-camera { width: 15px; height: 15px; margin-top: -1px; }
.stud-photo-dialog { text-transform: none; letter-spacing: normal; }
/* Photo mode: the drawn stud card in a wide paper dialog, to save or copy. */
.stud-photo-dialog { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
/* The head row: the save and copy buttons once the card is drawn, and Close
   at the far end. */
.stud-photo-dialog-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.site-main .stud-photo-dialog-head .text-button { margin-left: auto; padding: 0; font-size: 12px; }
.stud-card-preview:empty { aspect-ratio: 2 / 1; background: var(--surface-alt); }
.stud-card-preview img { display: block; width: 100%; height: auto; }
/* The card's settings: what it shows on the left, the panel's colours on
   the right, each a table of labels beside their control cells, one or
   two label-and-cell pairs to a row. A colour cell is the picker itself, filled
   with its colour. */
.stud-card-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 40px; align-items: start; margin-top: 18px; }
.stud-card-table { font-size: 13px; }
.stud-card-table-head {
  padding: 8px 0;
  border-bottom: 1px solid var(--green);
  color: var(--muted);
  font: 500 10.5px/1.5 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stud-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 64px; }
.stud-card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr) 64px); }
.stud-card-label { display: block; margin: 0; padding: 5px 16px 5px 0; line-height: 20px; border-bottom: 1px solid var(--line); color: #4c5650; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The second pair's label stands off the swatch before it. */
.stud-card-grid-2 .stud-card-label:nth-child(4n + 3) { padding-left: 16px; }
.stud-card-cell { display: flex; align-items: stretch; justify-content: center; border-bottom: 1px solid var(--line); }
.stud-card-cell input { display: block; width: 100%; margin: 0; padding: 0; cursor: pointer; }
.stud-card-cell input[type=checkbox] { width: auto; align-self: center; accent-color: var(--green); }
.stud-card-cell input[type=color] {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}
.stud-card-cell input::-webkit-color-swatch-wrapper { padding: 0; }
.stud-card-cell input::-webkit-color-swatch { border: 0; }
.stud-card-cell input::-moz-color-swatch { border: 0; }
.site-main .stud-card-palette .text-button { margin-top: 10px; padding: 0; font-size: 12px; }
@media (max-width: 720px) {
  .stud-card-settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .stud-card-grid-2 { grid-template-columns: minmax(0, 1fr) 64px; }
  .stud-card-grid-2 .stud-card-label:nth-child(4n + 3) { padding-left: 0; }
}
.stud-photo-dialog .stud-report-actions { flex-wrap: wrap; gap: 12px; margin-top: 0; }
.stud-photo-dialog .stud-report-actions > * { white-space: nowrap; }
.site-main .stud-photo-dialog .stud-report-actions .button { margin: 0; padding: 12px 18px; font-size: 12px; }
.stud-photo-dialog .stud-report-actions:not(:has(> :not([hidden]))) { display: none; }
/* Facts sit on one row where they fit and wrap where they do not. */
.stud-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin: 26px 0 0;
}
.stud-facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
/* One section per row, each table as wide as its title. */
/* The head's divider sits as far above the first section as sections sit apart. */
.stud-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.site-main .stud-section-title {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font: 600 26px/1.2 var(--serif);
  letter-spacing: 0;
}
/* A table straight under a title takes the title's rule as its top rule,
   so its first row is spaced like every other. */
.site-main .stud-section-title:has(+ :is(table, .stud-table-wrap, .stud-summary)) { margin-bottom: 0; }
/* A summary line ruled like a table row. */
.stud-summary { margin: 0; padding: 5px 0; border-bottom: 1px solid var(--line); line-height: 20px; }
/* Figures sized to their content with equal space between them, the first
   at the left edge and the last at the right. */
.stud-stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 32px;
  margin: 0;
}
.stud-stats > div { flex: none; }
.stud-stats dd { white-space: nowrap; }
.stud-stats.is-stacked { display: grid; grid-template-columns: repeat(2, max-content); justify-content: start; align-items: end; column-gap: 48px; }
.stud-stats dd {
  margin: 4px 0 0;
  color: var(--green);
  font: 600 24px/1.1 var(--serif);
  font-variant-numeric: tabular-nums;
}
/* Profile tables: no fills and no vertical rules. Small capital headings
   over one green rule, a hairline under each row, numbers right-aligned in
   tabular figures, the footer set off by a second green rule. */
.stud-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.stud-table thead :is(th, td) {
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--green);
  color: var(--muted);
  font: 500 10.5px/1.5 var(--sans);
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.stud-table :is(tbody, tfoot) :is(th, td) { padding: 5px 14px 5px 0; line-height: 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.stud-table tbody th { color: #4c5650; font-weight: 400; }
.stud-table td { color: var(--green); font-weight: 600; }
.stud-table tfoot :is(th, td) { border-top: 1px solid var(--green); border-bottom: 0; }
.stud-table tfoot th { color: var(--muted); font: 500 10.5px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.stud-table .num { text-align: right; }
.stud-table :is(th, td):last-child { padding-right: 0; }
.stud-table abbr { text-decoration: none; cursor: help; }
/* The extension's pair table (page-shell.css .pair-table): three label |
   value groups read down, fixed value columns, one rule per row, grades as
   filled cells with a paper seam. */
.stud-pair-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.stud-pair-table td { padding: 5px 10px; line-height: 20px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stud-pair-table tr:last-child td { border-bottom: 0; }
.stud-pair-table td:nth-child(even) { width: 64px; }
.stud-pair-table td:first-child { padding-left: 0; }
.stud-pair-table td:nth-child(3),
.stud-pair-table td:nth-child(5) { padding-left: 28px; }
.stud-pair-table td.pair-label { color: #4c5650; }
.stud-pair-table td.pair-value { color: var(--green); font-weight: 600; text-align: right; }
.stud-pair-table td.grade-cell {
  color: var(--green);
  font-weight: 600;
  text-align: center;
  background: var(--grade);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 2px var(--paper);
}
.stud-pair-table td.grade-cell-empty { color: var(--muted); text-align: center; }
.stud-colour-table tbody th { width: 30%; }
.stud-colour-table td.stud-source { color: #4c5650; font-weight: 400; }
/* The ? sits beside its heading without making the heading row taller. */
.stud-colour-table thead .stud-help { margin: -4px 0 -4px 6px; }
/* In the table's last column the note opens leftward, inside the page. */
.stud-colour-table .stud-help-text { left: auto; right: -10px; text-transform: none; letter-spacing: 0; white-space: normal; }
.stud-matrix-tall { display: none; }
/* The extension's grade scale (popup.css), best to worst: five washes of
   near-equal lightness read with the forest green. */
:root {
  --grade-1: #a8d0b9;
  --grade-2: #dde8c4;
  --grade-3: #f1dca6;
  --grade-4: #f1c5a0;
  --grade-5: #eeb1aa;
}
.grade-1 { --grade: var(--grade-1); }
.grade-2 { --grade: var(--grade-2); }
.grade-3 { --grade: var(--grade-3); }
.grade-4 { --grade: var(--grade-4); }
.grade-5 { --grade: var(--grade-5); }
.stud-grade {
  display: inline-block;
  box-sizing: border-box;
  min-width: 30px;
  padding: 2px 5px;
  background: var(--grade, var(--surface-alt));
  color: var(--green);
  font: 600 11px/1.45 var(--sans);
  letter-spacing: .02em;
  text-align: center;
}

/* Counts line: a chip and count per grade step, empty steps faded. */
.stud-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.stud-count { display: inline-flex; gap: 7px; align-items: center; color: var(--ink); }
/* An empty step: the grade as an outline, its count in the muted grey. */
.stud-count.is-empty { color: var(--muted); }
.stud-count.is-empty .stud-grade { background: transparent; box-shadow: inset 0 0 0 1px var(--grade); color: var(--muted); }
.stud-counts-compact { flex-wrap: nowrap; gap: 12px; font-size: 13px; line-height: 20px; }
.stud-counts-compact .stud-count { gap: 5px; }
/* A section title with its summary (grade counts, total GP) on one ruled line. */
.stud-section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.site-main .stud-section-heading .stud-section-title { margin: 0; padding: 0; border: 0; }
.stud-heading-figure { display: flex; gap: 12px; align-items: baseline; margin: 0; color: #4c5650; font-size: 13.5px; }
.stud-heading-figure strong { color: var(--green); font: 600 24px/1 var(--serif); font-variant-numeric: tabular-nums; }
.stud-table-wrap { overflow-x: auto; }
.stud-disciplines :is(th, td) { white-space: nowrap; }
.stud-disciplines .stud-disc-traits { padding-left: 22px; }
/* Pedigree: parents, grandparents and great-grandparents in three columns. */
.stud-pedigree {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(30px, auto));
  gap: 4px;
}
.stud-ped-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: white;
  font-size: 13px;
  line-height: 1.3;
}
.stud-ped-node[data-generation="3"] { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; }
.stud-ped-role { flex: none; color: var(--muted); font: 500 10px/1.5 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
/* The name truncates; the arrow marking a Horse Reality link stays. */
.stud-ped-link { display: flex; gap: 6px; align-items: baseline; min-width: 0; color: var(--green); text-decoration: none; }
.stud-ped-name,
.stud-ped-unknown { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stud-ped-node[data-generation="1"] .stud-ped-name { font: 600 19px/1.25 var(--serif); }
.stud-ped-link:hover .stud-ped-name { text-decoration: underline; text-decoration-thickness: 1px; }
.stud-ped-unknown { color: var(--muted); }
.stud-tested { margin: 0; color: #76603d; font-size: 15px; letter-spacing: .02em; overflow-wrap: anywhere; }
.stud-colour-game { color: var(--green); }
.stud-colour-hidden { color: #76603d; }
.stud-more { margin-top: 40px; }
.stud-grid-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
.stud-more-all { font-size: 13px; }

@media (max-width: 1100px) {
  .stud-grid-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .stud-breed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stud-hero { padding-top: 40px; }
}
@media (max-width: 650px) {
  .stud-breed-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .stud-breed-grid { grid-auto-rows: 210px; }
  .stud-seal { width: 78px; height: 78px; }
  .stud-section-nav { gap: 20px; }
  .stud-header nav { gap: 8px 14px; }
  .stud-header nav a { font-size: 13px; }
  .stud-header .stud-header-home { margin-left: auto; padding-left: 12px; }
  .stud-hero-lede { font-size: 15px; }
}
@media (max-width: 900px) {
  .stud-market { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 18px; }
  .stud-rail { position: static; }
  /* The rail's title becomes its toggle: the same serif heading with a
     chevron at the end. */
  .site-main .stud-rail-toggle {
    display: flex;
    align-items: baseline;
    width: 100%;
    padding: 0 2px 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--green);
    font: 600 22px/1.15 var(--serif);
    text-align: left;
  }
  .stud-rail-toggle::after {
    content: '';
    align-self: center;
    width: 8px;
    height: 8px;
    margin: -4px 2px 0 auto;
    border-right: 1.5px solid var(--green);
    border-bottom: 1.5px solid var(--green);
    transform: rotate(45deg);
  }
  .stud-rail-toggle span { margin-left: 8px; font: 500 13px/1.4 var(--sans); }
  .stud-rail-toggle[aria-expanded="true"]::after { margin-top: 6px; transform: rotate(-135deg); }
  .site-main .stud-rail-title { display: none; }
  .stud-rail:not(.is-open) .stud-filters { display: none; }
  .stud-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    max-height: none;
    overflow: visible;
    margin: 0 0 8px;
    padding: 0;
  }
  .stud-results { margin-top: 18px; }
  .stud-profile-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .stud-sections { gap: 24px; margin-top: 24px; }
}
/* The profile head takes the phone's one column. */
@media (max-width: 650px) {
  /* One column: title, picture, the summary's pieces, the notes, then the
     listing facts last. */
  .stud-profile-head { display: flex; flex-direction: column; align-items: stretch; }
  .stud-profile-main, .stud-profile-side, .stud-profile-summary, .stud-profile-below { display: contents; }
  .stud-profile-title { order: 1; }
  .stud-profile-figure { order: 2; margin-top: 22px; }
  .stud-profile-summary > * { order: 3; }
  .site-main .stud-profile-notes { order: 4; margin-top: 28px; font-size: 19px; }
  .stud-profile-head > .stud-facts { order: 5; margin-top: 24px; }
  .stud-profile-summary > .button { text-align: center; }
}
@media (max-width: 650px) {
  .stud-filters { grid-template-columns: minmax(0, 1fr); }
  .stud-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .stud-card { display: grid; grid-template-columns: clamp(148px, 40%, 184px) minmax(0, 1fr); }
  .stud-photo-card { aspect-ratio: auto; height: 100%; min-height: 132px; }
  .stud-photo-card > .stud-photo-horse { padding: 5% 4% 3%; }
  .stud-photo-card.is-empty::before { inset: 6px; }
  .stud-photo-card .stud-panel { padding: 10px; }
  .stud-photo-card .stud-panel-name { font-size: 16px; }
  .stud-photo-profile .stud-panel-name { font-size: 40px; }
  .stud-card-body { padding: 10px 12px 10px; }
  .site-main .stud-card-name { font-size: 19px; }
  .stud-card-meta, .stud-card-estate { font-size: 12px; }
  .stud-card-notes { margin-top: 6px; font-size: 14px; }
  .stud-card-notes p { -webkit-line-clamp: 1; }
  .stud-card-fees { gap: 4px 10px; min-height: 20px; margin: 6px 0; font-size: 12.5px; }
  .stud-card-fees .stud-coin { width: 15px; height: 15px; }
  .stud-card-info { padding-bottom: 6px; }
  .stud-card-scores { padding-top: 6px; }
  .stud-card-scores dd { font-size: 13px; }
  .stud-grid-strip { grid-template-columns: minmax(0, 1fr); }
  .stud-stats { gap: 12px 16px; }
  .stud-stats.is-stacked { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; column-gap: 24px; }
  .stud-table :is(thead, tbody, tfoot) :is(th, td) { padding-right: 8px; }
  .stud-table thead :is(th, td) { white-space: normal; }
  .stud-matrix-wide { display: none; }
  .stud-matrix-tall { display: table; }
  .stud-fees dd { font-size: 24px; }
  /* Pair tables become one label | value list in read-down order: rows
     dissolve into a two-column grid sorted by each cell's --pair-order. */
  .stud-pair-table, .stud-pair-table tbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, auto); }
  .stud-pair-table { grid-template-columns: minmax(0, 1fr); }
  .stud-pair-table tr { display: contents; }
  .stud-pair-table td { order: var(--pair-order); width: auto; border-bottom: 0; border-top: 1px solid var(--line); }
  .stud-pair-table td.pair-label { padding-left: 0; }
  .stud-pair-table tr:first-child > td:nth-child(-n + 2) { border-top: 0; }
  .stud-pair-table td.pair-pad { display: none; }
  /* Disciplines keep one row each: the table scrolls sideways in its frame
     with the discipline names pinned at the left. */
  .stud-disciplines tbody th, .stud-disciplines thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--paper);
  }
  .stud-table.stud-disciplines :is(thead, tbody) :is(th, td):not(:first-child) { padding-left: 12px; }
  .stud-disciplines .stud-disc-traits { padding-left: 16px; }
  .stud-pedigree { gap: 3px; }
  .stud-ped-node { padding: 3px 6px; font-size: 12px; }
  .stud-ped-node[data-generation="1"] .stud-ped-name { font-size: 16px; }
  .stud-ped-node[data-generation="3"] { flex-direction: column; align-items: stretch; gap: 0; }
}
