/* Issue openings, reading cards, and interview pages use the same paper stock
   as the front page, with quieter controls for searching and comparing. */
:is(.listing-page:has(> .article-grid), .companies-page) > .page-intro {
  padding: clamp(21px, 2.8vw, 40px) clamp(16px, 4.8vw, 69px);
  margin: clamp(12px, 2vw, 28px) 0 22px;
  border: 1px solid #e1d8c6;
  border-radius: 27px 38px 30px 23px / 31px 25px 37px 26px;
  background: var(--paper-fibres), linear-gradient(114deg, #fffbf3, #f2e7d3);
  color: var(--paper-ink);
}

.companies-page > .page-intro {
  border-color: #d9e2d5;
  background: var(--paper-fibres), linear-gradient(114deg, #faf9ef, #e6ede0);
}

:is(.listing-page:has(> .article-grid), .companies-page) > .page-intro .section-kicker {
  color: var(--paper-moss);
}

:is(.listing-page:has(> .article-grid), .companies-page) > .page-intro h1 {
  max-width: 19em;
  margin: 0 0 13px;
  font-size: clamp(25px, 3.9vw, 48px);
  line-height: 1.42;
}

:is(.listing-page:has(> .article-grid), .companies-page) > .page-intro h1::after {
  content: "";
  display: block;
  width: clamp(83px, 12vw, 180px);
  height: 11px;
  margin-top: 6px;
  background: var(--paper-underline) center / 100% 100% no-repeat;
}

:is(.listing-page:has(> .article-grid), .companies-page) > .page-intro p {
  max-width: 56ch;
  margin-bottom: 0;
  color: #40584e;
  font-size: clamp(13px, 1.25vw, 16px);
  line-height: 1.85;
  text-wrap: pretty;
}

.listing-page:has(> .article-grid) > .page-intro p {
  font-size: clamp(14px, 1.25vw, 16px);
}

.listing-page > :is(.intl-next-banner, .weather-reading-entry, .insider-reading-entry) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  margin: 0 0 10px;
  padding: clamp(15px, 2.2vw, 29px);
  border: 1px solid #dce4d8;
  border-radius: 18px 23px 21px 16px;
  background: #f0f4eb;
  color: #273f34;
}

.listing-page > .intl-next-banner {
  background: #e4ece1;
  border-color: #ceddce;
}

.listing-page > .insider-reading-entry {
  background: #f8f0e3;
  border-color: #e6d9c3;
}

.listing-page > :is(.intl-next-banner, .weather-reading-entry, .insider-reading-entry) > span {
  color: #47624f;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
  margin: 0;
}

.listing-page > .insider-reading-entry > span {
  color: #74522d;
}

.listing-page > :is(.intl-next-banner, .weather-reading-entry, .insider-reading-entry) > b {
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.listing-page > .intl-next-banner > b {
  font-size: clamp(17px, 2vw, 28px);
  max-width: 25em;
}

html[lang="ja"] .listing-page > .intl-next-banner > b {
  font-family: var(--paper-hand);
  font-weight: 600;
}

@media (min-width: 850px) {
  .listing-page:has(> .article-grid) {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    column-gap: 14px;
  }

  .listing-page:has(> .article-grid) > * {
    grid-column: 1 / -1;
  }

  .listing-page:has(> .article-grid) > .intl-next-banner {
    grid-column: 1;
    grid-row-end: span 2;
  }

  .listing-page:has(> .article-grid) > :is(.weather-reading-entry, .insider-reading-entry) {
    grid-column: 2;
  }
}

:is(.listing-page:has(> .article-grid), .companies-page) .filter-row {
  gap: 8px;
  margin: 16px 0 13px;
  padding-block: 11px;
  border-block: 1px solid #e0e7dd;
}

:is(.listing-page:has(> .article-grid), .companies-page) .filter-row .chip {
  min-height: 44px;
  padding: 9px 14px;
  border-color: #d5e0d4;
  border-radius: 14px 17px 13px 16px;
  background: #fcfdf9;
  color: #284538;
  font-size: 13px;
}

:is(.listing-page:has(> .article-grid), .companies-page) .filter-row .chip:is(.active, :hover) {
  border-color: var(--paper-moss);
  background: var(--paper-moss);
  color: #fff;
}

.listing-page:has(> .article-grid) > .filter-row {
  padding: 10px;
  border: 1px solid #dbe5d9;
  border-radius: 15px;
  background: #f3f7ef;
}

.listing-page:has(> .article-grid) > .filter-row .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.45;
}

.listing-page:has(> .article-grid) > .filter-row .chip:not(.active):hover {
  border-color: #88a795;
  background: #e4eee2;
  color: #224936;
}

.listing-page:has(> .article-grid) > .filter-row .chip.active {
  font-weight: 700;
  box-shadow: 0 2px 0 #1f4235;
}

.listing-page > .result-count,
.companies-page > .listing-note {
  margin: 5px 0 15px;
  color: #4c6257;
  font-size: 13px;
}

.listing-page:has(> .article-grid) > .result-count {
  margin: 19px 0 12px;
  font-weight: 700;
}

.listing-page > .article-grid {
  row-gap: clamp(26px, 4vw, 44px);
}

/* Compact the fifteen preference notes on the company index. Explicit cells
   keep each icon, title and PV label from crossing into another card's text. */
.companies-page .company-preferences {
  margin: clamp(36px, 6vw, 78px) 0 20px;
  padding: clamp(15px, 2.6vw, 32px);
  border: 1px solid #e6ddcc;
  border-radius: 23px 29px 25px 21px;
  background: var(--paper-fibres), #fbf7ed;
  scroll-margin-top: 20px;
}

.companies-page .company-preferences .section-head {
  margin-bottom: 13px;
}

.companies-page .company-preferences .section-head h2 {
  color: var(--paper-ink);
  line-height: 1.5;
}

.companies-page .company-preferences .desire-play-toolbar {
  margin: 22px 0 12px;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.companies-page .company-preferences .desire-play-toolbar > span {
  color: #4b6558;
  max-width: none;
  font-size: 12px;
}

.companies-page .desire-play-toolbar > .desire-draw {
  min-height: 44px;
  border-color: var(--paper-moss);
  background: var(--paper-moss);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 2px 0 #153e2f;
}

.companies-page .company-preferences > .playful-desire-grid {
  gap: 12px !important;
}

.companies-page .company-preferences > .playful-desire-grid > .need-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px 8px;
  min-height: 0 !important;
  padding: 12px 13px !important;
  border-color: #dce5d9 !important;
  border-radius: 17px 23px 20px 14px !important;
  box-shadow: 0 2px 0 #e1e8de;
  color: var(--paper-ink);
}

.companies-page .company-preferences > .playful-desire-grid > .need-card.selected {
  border-color: var(--paper-moss) !important;
  box-shadow: inset 0 0 0 1px var(--paper-moss);
}

.companies-page .company-preferences > .playful-desire-grid .need-card:hover {
  transform: none;
}

.companies-page .company-preferences > .playful-desire-grid .need-card::before {
  display: none;
}

.companies-page .playful-desire-grid .desire-card-top {
  grid-column: 1 / -1;
  margin: 0;
}

.companies-page .playful-desire-grid .desire-card-top i {
  transform: none;
  padding: 3px 7px;
  background: #fffdf4;
  color: #4b6257;
  font-size: 10px;
}

.companies-page .playful-desire-grid .need-copy {
  grid-column: 1;
  grid-row: 2;
  max-width: none;
}

.companies-page .playful-desire-grid .need-copy strong {
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.5;
}

.companies-page .playful-desire-grid .need-copy small {
  margin-top: 4px;
  color: #4d6259;
}

.companies-page .playful-desire-grid .desire-emoji {
  position: static;
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  font-size: 29px;
  line-height: 1.1;
  transform: none;
}

.companies-page .playful-desire-grid .desire-person {
  width: 46px;
  height: 52px;
}

.companies-page .playful-desire-grid .need-action {
  grid-column: 1;
  grid-row: 3;
  max-width: none;
  min-width: 0;
  padding-top: 3px;
  line-height: 1.5;
  white-space: normal;
}

.companies-page .playful-desire-grid .need-card > .card-pv {
  position: static;
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  text-align: end;
  color: #516c5d;
  overflow-wrap: anywhere;
}

.companies-page .company-search-panel {
  margin: 0 0 20px;
  padding: clamp(12px, 2.1vw, 24px);
  border: 1px solid #d8e4d8;
  border-radius: 15px 20px 17px 20px;
  background: #f2f6ef;
}

.companies-page .company-search-panel .advanced-search:not(.game-method) {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
}

.companies-page .company-search-panel .advanced-search summary {
  color: var(--paper-moss);
}

.companies-page .company-search-panel .company-search {
  max-width: none;
  margin: 0;
  background: #fff;
}

.companies-page .company-search-panel .company-search:focus-within {
  outline: 2px solid var(--paper-moss);
  outline-offset: 2px;
}

.companies-page .company-search input {
  font-size: 16px;
}

.companies-page .company-search-panel .company-search .small-btn {
  min-height: 44px;
  background: var(--paper-moss);
  color: #fff;
}

.companies-page .company-preferences-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper-moss);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.companies-page .listing-note {
  flex-wrap: wrap;
}

.companies-page .listing-note > a {
  color: var(--paper-moss);
  text-underline-offset: 3px;
}

:is(.listing-page, .reading-page, .company-detail) :is(.article-grid > .article-card, .company-grid > .company-card) {
  animation: none;
}

:is(.listing-page, .reading-page) .article-card {
  border-bottom: 1px solid #dce4da;
  padding-bottom: 10px;
}

:is(.listing-page, .reading-page) .article-card .narrative-cover {
  background-color: #ebece0;
}

:is(.listing-page, .reading-page) .article-card .narrative-cover > .cover-label,
:is(.listing-page, .reading-page) .article-card .narrative-read,
:is(.listing-page, .reading-page, .company-detail) .company-photo > .company-place {
  border-radius: 9px 7px 8px 6px;
  background: #fffbf1;
  color: #284538;
  font-size: 11px;
}

:is(.listing-page, .reading-page) .article-card :is(.article-meta, .card-bottom > span) {
  color: #53685d;
  font-size: 12px;
}

:is(.listing-page, .reading-page) .article-meta {
  flex-wrap: wrap;
  gap: 4px 13px;
}

:is(.listing-page, .reading-page, .company-detail) :is(.article-meta > span:first-child, .company-card-meta > span) {
  color: var(--paper-moss);
}

:is(.listing-page, .reading-page, .company-detail) :is(.article-card h3, .company-card h3) {
  color: var(--paper-ink);
  font-size: clamp(17px, 1.65vw, 22px);
  line-height: 1.5;
  line-break: strict;
  text-wrap: pretty;
}

:is(.listing-page, .reading-page) .article-card > p {
  color: #4c6358;
  font-size: 14px;
  line-height: 1.75;
  -webkit-line-clamp: 3;
}

:is(.listing-page, .reading-page) .article-card h3 {
  overflow-wrap: anywhere;
}

:is(.listing-page, .reading-page):lang(ja) :is(.article-card h3, .article-heading h1, .article-body h2) {
  word-break: auto-phrase;
}

:is(.listing-page, .reading-page) .article-card > .card-pv {
  margin-inline: 0;
}

:is(.listing-page, .reading-page, .company-detail) :is(.article-card, .company-card, .article-byline, .company-heading-name) .save-button {
  min-width: 44px;
  min-height: 44px;
}

:is(.listing-page, .reading-page, .company-detail) .company-card {
  border-color: #dae3d9;
  border-radius: 20px 24px 23px 17px;
  background: #fffefa;
  box-shadow: 0 2px 0 #e9eee6;
}

:is(.listing-page, .reading-page, .company-detail) .company-card .compact-tags span {
  border-radius: 6px 8px 6px 8px;
  background: #edf2e9;
  color: #3b5948;
}

:is(.listing-page, .company-detail) .company-card-bottom .text-button {
  padding-inline: 10px;
  border-radius: 10px 13px 10px 12px;
  background: #edf3ea;
  color: #294e3d;
  font-size: 12px;
}

:is(.listing-page, .company-detail) .company-card-bottom .text-button[aria-pressed="true"] {
  background: #d5e6d6;
  color: #183f2b;
}

:is(.listing-page, .company-detail) .company-card-bottom small {
  font-size: 11px;
}

/* Set off the facts, source material, and next action in long reads. */
:is(.reading-page:has(.article-end), .company-detail) > .breadcrumbs {
  padding-block: 16px 20px;
  color: #506458;
  font-size: 12px;
}

.reading-page:has(.article-end) .article-heading,
.company-detail > .company-heading {
  padding: clamp(18px, 3.25vw, 45px);
  border: 1px solid #e3dac9;
  border-radius: 23px 29px 26px 21px;
  background: var(--paper-fibres), #fcf8ee;
  color: var(--paper-ink);
}

.company-detail > .company-heading {
  margin-bottom: 12px;
  border-color: #dbe5d9;
  background: var(--paper-fibres), #f2f5ed;
}

.reading-page:has(.article-end) .article-heading h1,
.company-detail .company-heading h1 {
  margin: 14px 0 19px;
  font-size: clamp(24px, 3.1vw, 44px);
  line-height: 1.46;
  line-break: strict;
}

.company-detail .company-heading h1 {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.reading-page .article-heading h1 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.reading-page:has(.article-end) .article-lead {
  color: #40564a;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.9;
}

.reading-page .article-body > section[id^="section-"] {
  margin-block-start: clamp(30px, 4.4vw, 50px);
  padding-block-start: clamp(16px, 2.4vw, 25px);
  border-top: 1px solid #dce6db;
}

.reading-page .article-body > section[id^="section-"] h2 {
  margin-block-end: 13px;
  color: #233f34;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.52;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.reading-page .article-body > section[id^="section-"] > :is(p, ul, ol),
.reading-page .article-body > section[id^="section-"] > :is(ul, ol) > li {
  color: #30473e;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.reading-page .article-body > section[id^="section-"] > :is(ul, ol) {
  padding-inline-start: 1.5em;
}

.reading-page .article-body > section[id^="section-"] > :is(ul, ol) > li::marker {
  color: #3c674f;
  font-weight: 700;
}

.reading-page:has(.article-end) .article-answer {
  border: 1px solid #d3e3d4;
  border-left: 4px solid #739580;
  border-radius: 12px 17px 18px 10px;
  background: #f0f5eb;
}

.reading-page:has(.article-end) .article-answer > strong {
  color: #315944;
  font-size: 14px;
}

.reading-page .article-body > .toc {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid #e4d9c4;
  border-radius: 16px 20px 15px 18px;
  background: #fbf5e9;
  color: #294639;
}

.reading-page .article-body > .toc > strong {
  margin-block-end: 7px;
  color: #263f35;
  font-size: clamp(16px, 1.4vw, 18px);
}

.reading-page .article-body > .toc ol {
  padding-inline-start: 1.6em;
}

.reading-page .article-body > .toc li {
  margin: 0;
  padding-block: 0;
  border-bottom: 1px solid #e3dacb;
  line-height: 1.55;
}

.reading-page .article-body > .toc li::marker {
  color: #4b6957;
  font-weight: 700;
}

.reading-page .article-body > .toc a {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding-block: 7px;
  color: #294f3e;
  font-size: 14px;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: #8b9c86;
  text-underline-offset: 3px;
}

.reading-page .article-body > .toc a:hover {
  text-decoration-color: currentColor;
}

.reading-page :is(.article-guide-entry, .action-box, .article-end) :is(.text-button, .btn, a) {
  max-inline-size: 100%;
  min-block-size: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reading-page .article-body > .article-sources :is(p, li, small) {
  color: #415b50;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.reading-page .article-body > .article-sources a {
  color: #285743;
  text-underline-offset: 3px;
}

.listing-page:has(> .article-grid) > .filter-row .chip:focus-visible,
.listing-page > :is(.intl-next-banner, .weather-reading-entry, .insider-reading-entry):focus-visible,
:is(.listing-page, .reading-page) .article-card :is(a, .save-button):focus-visible,
.reading-page :is(.toc, .article-guide-entry, .article-sources, .action-box, .article-end) a:focus-visible {
  outline: 2px solid #34654d;
  outline-offset: 3px;
}

.reading-page:has(.article-end) .article-scene-figure {
  border-radius: var(--paper-photo);
  background: #f6f2e9;
}

.reading-page:has(.article-end) .article-scene-figure figcaption {
  color: #4c6255;
  font-size: 12px;
}

.company-detail :is(.company-resume-entry, .editor-note, .apply-panel, .before-apply) {
  border-color: #d9e4d7;
  border-radius: 18px 24px 20px 16px;
  background: #f3f7ee;
}

.company-detail .editor-note {
  color: #344e40;
  font-size: 13px;
}

.company-detail .company-check-cta {
  border-radius: 17px 21px 16px 22px;
  background: #f7efdf;
  color: #3a483b;
}

.company-detail .company-reality .reality-columns > div {
  border-radius: 17px 21px 18px 14px;
  background: #eff4ec;
}

.company-detail .company-reality .reality-columns > div + div {
  background: #f8f1e6;
}

@media (max-width: 680px) {
  .listing-page:has(> .article-grid) > .page-intro {
    margin-block-end: 14px;
  }

  .listing-page:has(> .article-grid) > .page-intro p br {
    display: none;
  }

  .listing-page > :is(.intl-next-banner, .weather-reading-entry, .insider-reading-entry) {
    margin-block-end: 8px;
    padding: 11px 14px;
  }

  .listing-page:has(> .article-grid) > .filter-row {
    gap: 6px;
    margin-block: 12px;
  }

  .listing-page:has(> .article-grid) > .filter-row .chip {
    padding: 7px 10px;
  }

  .reading-page:has(.article-end) .article-heading {
    padding: 17px clamp(13px, 4vw, 23px);
  }

  .reading-page .article-body > .article-end {
    padding: clamp(16px, 4vw, 24px);
  }

  .reading-page .article-body > .article-end p {
    margin-block-end: 12px;
  }

  .reading-page .article-body > .article-end .btn {
    font-size: 13px;
  }

  .companies-page .company-preferences > .playful-desire-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .company-detail > .company-heading {
    gap: 17px;
  }
}

@media (max-width: 390px) {
  html[lang="ja"] .companies-page > .page-intro h1 {
    font-size: clamp(21px, 6.5vw, 25px);
  }

  .companies-page .company-search .small-btn {
    padding-inline: 12px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.listing-page, .reading-page, .company-detail) :is(.narrative-cover, .company-photo > img, .need-card, .desire-emoji) {
    transition: none;
    transform: none;
  }
}
