/*
 * RAVA P02.3 — Roasteries, Collections and public mobile harmonization.
 * Prototype 3 patterns translated to real public authorities.
 */

.p23-roasteries,
.p23-roastery,
.p23-collections,
.p23-collection {
  --p23-paper: var(--rava-color-canvas, #f8f6f1);
  --p23-surface: var(--rava-color-surface, #fffdfa);
  --p23-stone: var(--rava-color-surface-muted, #eeebe4);
  --p23-ink: var(--rava-color-text, #1a1d1a);
  --p23-ink-2: var(--rava-color-text-secondary, #39403a);
  --p23-muted: var(--rava-color-text-muted, #646b64);
  --p23-line: var(--rava-color-border, #d4d0c7);
  --p23-line-soft: var(--rava-color-border-soft, #e7e3db);
  --p23-forest: var(--rava-color-accent, #2e5b46);
  --p23-forest-pale: var(--rava-color-accent-muted, #e4eee7);
  --p23-copper: var(--rava-color-highlight, #9a5941);
  --p23-display: var(--rava-font-display, Estedad, Vazirmatn, sans-serif);
  --p23-ui: var(--rava-font-ui, Vazirmatn, sans-serif);
  --p23-mono: var(--rava-font-mono, ui-monospace, monospace);
  background: var(--p23-paper);
  color: var(--p23-ink);
}

.p23-roasteries :where(a, button, input, select),
.p23-roastery :where(a, button, input, select),
.p23-collections :where(a, button, input, select),
.p23-collection :where(a, button, input, select) {
  transition:
    color var(--rava-motion-fast, 140ms),
    background var(--rava-motion-fast, 140ms),
    border-color var(--rava-motion-fast, 140ms),
    transform var(--rava-motion-fast, 140ms);
}

/* Roastery directory */
.p23-directory-hero {
  border-block-end: 1px solid var(--p23-line);
  background:
    radial-gradient(circle at 15% 20%, rgb(46 91 70 / 9%), transparent 28rem),
    var(--p23-paper);
}

.p23-directory-hero__grid {
  min-height: 31rem;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.p23-directory-hero h1,
.p23-collections-hero h1 {
  max-width: 12ch;
  margin: .75rem 0 1.2rem;
  font-family: var(--p23-display);
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -.055em;
}

.p23-directory-hero p,
.p23-collections-hero p {
  max-width: 48rem;
  margin: 0;
  color: var(--p23-ink-2);
  font-size: clamp(.95rem, 1.2vw, 1.08rem);
  line-height: 2;
}

.p23-directory-index,
.p23-collections-hero dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: stretch;
  border: 1px solid var(--p23-line);
  background: color-mix(in srgb, var(--p23-surface) 88%, transparent);
}

.p23-directory-index > div,
.p23-collections-hero dl > div {
  display: grid;
  align-content: end;
  gap: .35rem;
  min-height: 9rem;
  padding: 1.25rem;
  border-inline-start: 1px solid var(--p23-line);
}

.p23-directory-index > div:first-child,
.p23-collections-hero dl > div:first-child {
  border-inline-start: 0;
}

.p23-directory-index span,
.p23-collections-hero dt {
  color: var(--p23-muted);
  font-size: .68rem;
}

.p23-directory-index strong,
.p23-collections-hero dd {
  margin: 0;
  font: 600 clamp(1.8rem, 3vw, 3rem)/1 var(--p23-display);
}

.p23-directory-tools {
  position: sticky;
  z-index: 30;
  inset-block-start: var(--rava-header-offset, 78px);
  border-block-end: 1px solid var(--p23-line);
  background: rgb(248 246 241 / 94%);
  backdrop-filter: blur(18px);
}

.p23-directory-tools .rava-container {
  min-height: 5.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}

.p23-directory-tools form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(17rem, 31rem) minmax(11rem, 14rem) auto;
  gap: .65rem;
  align-items: end;
}

.p23-directory-search,
.p23-directory-sort {
  min-width: 0;
  display: grid;
}

.p23-directory-search {
  position: relative;
}

.p23-directory-search svg {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 50%;
  width: 1.15rem;
  height: 1.15rem;
  translate: 0 -50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.p23-directory-search input,
.p23-directory-sort select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--p23-line);
  border-radius: 5px;
  background: var(--p23-surface);
  color: var(--p23-ink);
  font: inherit;
}

.p23-directory-search input {
  padding-inline: 2.8rem 1rem;
}

.p23-directory-sort span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.p23-directory-sort select {
  padding-inline: .9rem;
}

.p23-directory-tools p {
  margin: 0;
  color: var(--p23-muted);
  font-size: .72rem;
  white-space: nowrap;
}

.p23-directory-results {
  padding-block: clamp(2rem, 5vw, 5rem) 7rem;
}

.p23-roastery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.p23-roastery-card {
  min-width: 0;
  border: 1px solid var(--p23-line);
  border-radius: 12px;
  background: var(--p23-surface);
  overflow: hidden;
}

.p23-roastery-card:is(:hover, :focus-within) {
  transform: translateY(-3px);
  box-shadow: 0 22px 55px rgb(26 29 26 / 9%);
}

.p23-roastery-card__main {
  min-height: 13rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.35rem;
  color: inherit;
  text-decoration: none;
}

.p23-profile-avatar {
  width: 4rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--p23-line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgb(255 255 255 / 70%), transparent 35%),
    var(--p23-stone);
  font: 600 1.5rem/1 var(--p23-display);
}

.p23-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p23-roastery-card__copy {
  min-width: 0;
  display: grid;
  gap: .45rem;
}

.p23-roastery-card__copy > strong {
  font: 650 1.3rem/1.35 var(--p23-display);
  overflow-wrap: anywhere;
}

.p23-roastery-card__copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--p23-muted);
  font-size: .74rem;
  line-height: 1.85;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.p23-trust-label {
  width: fit-content;
  padding: .25rem .45rem;
  border: 1px solid var(--p23-line);
  color: var(--p23-muted);
  font: 700 .58rem/1.3 var(--p23-ui);
}

.p23-trust-label.is-verified {
  border-color: rgb(46 91 70 / 30%);
  background: var(--p23-forest-pale);
  color: var(--p23-forest);
}

.p23-card-arrow {
  color: var(--p23-muted);
  font-size: 1.1rem;
}

.p23-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-block-start: 1px solid var(--p23-line-soft);
}

.p23-profile-stats div {
  display: grid;
  gap: .18rem;
  padding: .85rem 1rem;
  border-inline-start: 1px solid var(--p23-line-soft);
}

.p23-profile-stats div:first-child {
  border-inline-start: 0;
}

.p23-profile-stats dt {
  color: var(--p23-muted);
  font-size: .58rem;
}

.p23-profile-stats dd {
  margin: 0;
  font-size: .9rem;
  font-weight: 750;
}

/* Roastery profile */
.p23-profile-hero {
  border-block-end: 1px solid var(--p23-line);
  background:
    linear-gradient(90deg, rgb(46 91 70 / 7%), transparent 45%),
    var(--p23-paper);
}

.p23-profile-hero__grid {
  min-height: 35rem;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.p23-profile-identity__head {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}

.p23-profile-avatar--large {
  width: clamp(5rem, 9vw, 8rem);
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.p23-profile-identity h1 {
  margin: .45rem 0 .25rem;
  font-family: var(--p23-display);
  font-size: clamp(3.5rem, 7vw, 7.2rem);
  font-weight: 560;
  line-height: .98;
  letter-spacing: -.055em;
}

.p23-profile-location {
  margin: 0;
  color: var(--p23-muted);
  font-size: .8rem;
}

.p23-profile-lead {
  max-width: 52rem;
  margin: 2rem 0 0;
  color: var(--p23-ink-2);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 2;
}

.p23-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-block-start: 2rem;
}

.p23-trust-panel {
  border: 1px solid var(--p23-line);
  background: var(--p23-surface);
}

.p23-trust-panel header {
  display: grid;
  gap: .4rem;
  padding: 1.4rem;
  border-block-end: 1px solid var(--p23-line);
}

.p23-trust-panel header span {
  color: var(--p23-forest);
  font: 750 .64rem/1.5 var(--p23-mono);
  letter-spacing: .08em;
}

.p23-trust-panel header strong {
  font-family: var(--p23-display);
  font-size: 1.35rem;
}

.p23-proof-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .8rem;
  padding: 1.2rem 1.4rem;
  border-block-end: 1px solid var(--p23-line-soft);
}

.p23-proof-row:last-child {
  border-block-end: 0;
}

.p23-proof-row > span {
  color: var(--p23-copper);
  font: 750 .68rem/1.6 var(--p23-mono);
}

.p23-proof-row div {
  display: grid;
  gap: .3rem;
}

.p23-proof-row small {
  color: var(--p23-muted);
  line-height: 1.75;
}

.p23-local-nav {
  position: sticky;
  z-index: 25;
  inset-block-start: var(--rava-header-offset, 78px);
  border-block-end: 1px solid var(--p23-line);
  background: rgb(255 253 250 / 94%);
  backdrop-filter: blur(18px);
}

.p23-local-nav .rava-container {
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.p23-local-nav a {
  min-height: 3.8rem;
  display: grid;
  place-items: center;
  flex: none;
  border-block-end: 2px solid transparent;
  color: var(--p23-muted);
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
}

.p23-local-nav a:is(:hover, :focus-visible) {
  border-color: var(--p23-forest);
  color: var(--p23-forest);
}

.p23-profile-about,
.p23-activity {
  padding-block: clamp(4rem, 8vw, 8rem);
}

.p23-profile-about__grid,
.p23-activity__grid {
  display: grid;
  grid-template-columns: minmax(16rem, .7fr) minmax(0, 1.3fr);
  gap: clamp(3rem, 8vw, 8rem);
}

.p23-profile-about h2,
.p23-section-head h2,
.p23-activity h2,
.p23-ranked-section h2 {
  max-width: 14ch;
  margin: .65rem 0 0;
  font-family: var(--p23-display);
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -.04em;
}

.p23-profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-block-start: 1px solid var(--p23-line);
}

.p23-profile-facts div {
  min-height: 8rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  border-block-end: 1px solid var(--p23-line);
}

.p23-profile-facts div:nth-child(odd) {
  padding-inline-end: 1.4rem;
}

.p23-profile-facts div:nth-child(even) {
  padding-inline-start: 1.4rem;
  border-inline-start: 1px solid var(--p23-line);
}

.p23-profile-facts span {
  color: var(--p23-muted);
  font-size: .66rem;
}

.p23-profile-facts strong {
  font-family: var(--p23-display);
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.p23-profile-records {
  padding-block: clamp(4rem, 7vw, 7rem);
  border-block: 1px solid var(--p23-line);
  background: var(--p23-stone);
}

.p23-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-block-end: 2.4rem;
}

.p23-section-head p,
.p23-activity header p {
  max-width: 46rem;
  color: var(--p23-muted);
  line-height: 1.9;
}

.p23-section-head > a {
  flex: none;
  color: var(--p23-forest);
  font-size: .75rem;
  font-weight: 750;
  text-decoration: none;
}

.p23-activity {
  background: var(--p23-paper);
}

.p23-activity-list {
  border-block-start: 1px solid var(--p23-line);
}

.p23-activity-list > a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 6.4rem;
  padding-block: 1rem;
  border-block-end: 1px solid var(--p23-line);
  color: inherit;
  text-decoration: none;
}

.p23-activity-list > a:is(:hover, :focus-visible) strong {
  color: var(--p23-forest);
}

.p23-activity-list > a > span:first-child {
  color: var(--p23-copper);
  font-size: .68rem;
}

.p23-activity-list > a > span:nth-child(2) {
  display: grid;
  gap: .35rem;
}

.p23-activity-list small,
.p23-activity-list time {
  color: var(--p23-muted);
  font-size: .66rem;
}

.p23-profile-contact {
  padding-block: 2rem;
  border-block-start: 1px solid var(--p23-line);
  background: var(--p23-surface);
}

.p23-profile-contact .rava-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.p23-profile-contact div div {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.p23-profile-contact a {
  color: var(--p23-ink);
  font-size: .76rem;
  font-weight: 750;
}

/* Collections */
.p23-collections-hero {
  border-block-end: 1px solid var(--p23-line);
  background:
    radial-gradient(circle at 78% 22%, rgb(154 89 65 / 9%), transparent 25rem),
    var(--p23-paper);
}

.p23-collections-hero__grid {
  min-height: 34rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(19rem, .8fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.p23-collection-index {
  padding-block: clamp(2rem, 5vw, 5rem) 7rem;
}

.p23-collection-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.p23-collection-card {
  position: relative;
  min-height: 22rem;
  display: grid;
  grid-template-rows: 1fr auto auto;
  grid-column: span 6;
  overflow: hidden;
  border: 1px solid var(--p23-line);
  background: var(--p23-surface);
  color: inherit;
  text-decoration: none;
}

.p23-collection-card:nth-child(4n + 1),
.p23-collection-card:nth-child(4n) {
  grid-column: span 7;
}

.p23-collection-card:nth-child(4n + 2),
.p23-collection-card:nth-child(4n + 3) {
  grid-column: span 5;
}

.p23-collection-card:is(:hover, :focus-visible) {
  transform: translateY(-3px);
  box-shadow: 0 24px 65px rgb(26 29 26 / 10%);
}

.p23-collection-card__visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgb(255 255 255 / 55%), transparent 17rem),
    linear-gradient(145deg, #e7ede7, #b9ccbe 55%, #7b9a87);
  opacity: .92;
}

.p23-collection-card--copper .p23-collection-card__visual {
  background:
    radial-gradient(circle at 75% 18%, rgb(255 255 255 / 50%), transparent 16rem),
    linear-gradient(145deg, #f0e8e1, #d9b9a5 55%, #9a5941);
}

.p23-collection-card--stone .p23-collection-card__visual {
  background: linear-gradient(145deg, #f0ede6, #cbc5ba 58%, #8d8a82);
}

.p23-collection-card--ink .p23-collection-card__visual {
  background: linear-gradient(145deg, #2a302c, #47564c 58%, #8d987f);
}

.p23-collection-card__visual::before {
  content: "";
  position: absolute;
  width: 17rem;
  aspect-ratio: 1;
  inset-inline-start: -4rem;
  inset-block-end: -6rem;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem rgb(255 255 255 / 8%),
    0 0 0 4rem rgb(255 255 255 / 5%);
}

.p23-collection-card__visual i {
  position: absolute;
  width: 9rem;
  height: 17rem;
  inset-inline-end: 12%;
  inset-block-end: -3rem;
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: 48% 48% 8px 8px;
  rotate: -10deg;
}

.p23-collection-card__visual b {
  position: absolute;
  inset-inline-start: 1.4rem;
  inset-block-start: 1.2rem;
  color: rgb(26 29 26 / 62%);
  font: 650 1.6rem/1 var(--p23-mono);
}

.p23-collection-card__copy,
.p23-collection-card__meta {
  position: relative;
  z-index: 1;
}

.p23-collection-card__copy {
  align-self: end;
  display: grid;
  gap: .7rem;
  padding: 6rem 1.5rem 1.4rem;
  background: linear-gradient(transparent, rgb(255 253 250 / 92%) 38%);
}

.p23-collection-card__eyebrow {
  color: var(--p23-forest);
  font: 750 .62rem/1.5 var(--p23-mono);
  letter-spacing: .07em;
}

.p23-collection-card__copy > strong {
  max-width: 15ch;
  font: 560 clamp(2rem, 4vw, 3.6rem)/1.15 var(--p23-display);
  letter-spacing: -.035em;
}

.p23-collection-card__copy small {
  max-width: 42rem;
  color: var(--p23-muted);
  font-size: .74rem;
  line-height: 1.8;
}

.p23-collection-card__meta {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  padding: .9rem 1.5rem;
  border-block-start: 1px solid rgb(26 29 26 / 12%);
  background: rgb(255 253 250 / 92%);
  color: var(--p23-muted);
  font-size: .62rem;
}

/* Collection detail */
.p23-collection-hero {
  min-height: 38rem;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  border-block-end: 1px solid var(--p23-line);
}

.p23-collection-hero__visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 24%, rgb(255 255 255 / 20%), transparent 16rem),
    linear-gradient(145deg, #17271f, #4e735f 55%, #b99966);
}

.p23-collection--copper .p23-collection-hero__visual {
  background: linear-gradient(145deg, #2f211b, #8d563e 55%, #d3ad79);
}

.p23-collection-hero__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 55% 54%, transparent 0 2rem, rgb(255 255 255 / 11%) 2.05rem 2.1rem);
}

.p23-collection-hero__visual i {
  position: absolute;
  width: 17rem;
  height: 29rem;
  inset-inline-end: 25%;
  inset-block-end: -7rem;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 48% 48% 8px 8px;
  rotate: -11deg;
  box-shadow: 0 0 0 2.5rem rgb(255 255 255 / 5%);
}

.p23-collection-hero__visual b {
  position: absolute;
  inset-inline-start: 1.6rem;
  inset-block-start: 1.6rem;
  color: rgb(255 255 255 / 70%);
  font-size: .68rem;
}

.p23-collection-hero__visual > strong {
  position: absolute;
  inset-inline-start: 1.6rem;
  inset-block-end: 1.3rem;
  color: rgb(255 255 255 / 85%);
  font: 550 clamp(4rem, 10vw, 9rem)/1 var(--p23-display);
}

.p23-collection-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 7vw, 7rem);
  background: var(--p23-surface);
}

.p23-collection-hero__copy h1 {
  max-width: 12ch;
  margin: .75rem 0 1.2rem;
  font: 560 clamp(3.2rem, 6vw, 6rem)/1.08 var(--p23-display);
  letter-spacing: -.05em;
}

.p23-collection-hero__copy > p {
  max-width: 46rem;
  color: var(--p23-ink-2);
  line-height: 1.95;
}

.p23-method-box {
  display: grid;
  gap: .5rem;
  margin-block: 1.8rem;
  padding: 1rem 1.1rem;
  border-inline-start: 3px solid var(--p23-forest);
  background: var(--p23-stone);
}

.p23-method-box span {
  color: var(--p23-muted);
  font-size: .62rem;
}

.p23-method-box strong {
  font-size: .76rem;
  line-height: 1.9;
}

.p23-collection-hero__copy dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-block-start: 1px solid var(--p23-line);
}

.p23-collection-hero__copy dl div {
  display: grid;
  gap: .2rem;
  padding-block-start: 1rem;
}

.p23-collection-hero__copy dt {
  color: var(--p23-muted);
  font-size: .6rem;
}

.p23-collection-hero__copy dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.p23-ranked-section {
  padding-block: clamp(4rem, 8vw, 8rem);
}

.p23-ranked-list {
  border-block-start: 1px solid var(--p23-line);
}

.p23-ranked-record {
  display: grid;
  grid-template-columns: 3rem 9rem minmax(0, 1fr) minmax(14rem, .8fr) auto;
  gap: 1.4rem;
  align-items: center;
  min-height: 12rem;
  padding-block: 1.2rem;
  border-block-end: 1px solid var(--p23-line);
}

.p23-ranked-record__rank {
  color: var(--p23-copper);
  font-size: .72rem;
}

.p23-ranked-record__media {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--p23-stone);
}

.p23-ranked-record__media img,
.p23-ranked-record__media .p21-archive-plate {
  width: 100%;
  height: 100%;
}

.p23-ranked-record__identity {
  min-width: 0;
}

.p23-ranked-record__identity > span,
.p23-ranked-record__reason > span {
  color: var(--p23-muted);
  font-size: .62rem;
}

.p23-ranked-record__identity h3 {
  margin: .35rem 0;
  font: 600 1.4rem/1.35 var(--p23-display);
}

.p23-ranked-record__identity h3 a {
  color: inherit;
  text-decoration: none;
}

.p23-ranked-record__identity p,
.p23-ranked-record__reason p {
  margin: 0;
  color: var(--p23-muted);
  font-size: .7rem;
  line-height: 1.8;
}

.p23-ranked-record__reason {
  padding-inline-start: 1.2rem;
  border-inline-start: 1px solid var(--p23-line-soft);
}

.p23-ranked-record__actions {
  display: grid;
  gap: .45rem;
}

.p23-ranked-record__actions :is(a, button) {
  min-height: 2.4rem;
  display: grid;
  place-items: center;
  padding-inline: .9rem;
  border: 1px solid var(--p23-line);
  background: transparent;
  color: var(--p23-ink);
  font: 700 .65rem/1 var(--p23-ui);
  text-decoration: none;
  cursor: pointer;
}

.p23-ranked-record__actions a {
  border-color: var(--p23-ink);
  background: var(--p23-ink);
  color: var(--p23-surface);
}

/* Shared mobile corrections carried from P02.2 */
.p23-mobile-compare {
  display: none;
}

@media (max-width: 980px) {
  .p23-directory-hero__grid,
  .p23-collections-hero__grid,
  .p23-profile-hero__grid,
  .p23-profile-about__grid,
  .p23-activity__grid {
    grid-template-columns: 1fr;
  }

  .p23-directory-index,
  .p23-collections-hero dl {
    max-width: 42rem;
  }

  .p23-roastery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p23-directory-tools .rava-container {
    align-items: stretch;
    flex-direction: column;
    padding-block: .8rem;
  }

  .p23-directory-tools form {
    grid-template-columns: minmax(0, 1fr) 12rem auto;
  }

  .p23-collection-card,
  .p23-collection-card:nth-child(n) {
    grid-column: span 6;
  }

  .p23-ranked-record {
    grid-template-columns: 2.5rem 7rem minmax(0, 1fr) auto;
  }

  .p23-ranked-record__reason {
    grid-column: 3 / -1;
    padding: .85rem 0 0;
    border-inline-start: 0;
    border-block-start: 1px solid var(--p23-line-soft);
  }
}

@media (max-width: 700px) {
  .p23-directory-hero__grid,
  .p23-collections-hero__grid {
    min-height: auto;
    gap: 2rem;
    padding-block: 3rem 2rem;
  }

  .p23-directory-hero h1,
  .p23-collections-hero h1 {
    max-width: 11ch;
    font-size: clamp(2.7rem, 12vw, 4.2rem);
    line-height: 1.06;
  }

  .p23-directory-index,
  .p23-collections-hero dl {
    grid-template-columns: repeat(3, 1fr);
  }

  .p23-directory-index > div,
  .p23-collections-hero dl > div {
    min-height: 6.5rem;
    padding: .8rem;
  }

  .p23-directory-index strong,
  .p23-collections-hero dd {
    font-size: 1.55rem;
  }

  .p23-directory-tools {
    position: static;
  }

  .p23-directory-tools form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .p23-directory-sort {
    display: none;
  }

  .p23-directory-tools p {
    display: none;
  }

  .p23-roastery-grid {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .p23-roastery-card__main {
    min-height: 10rem;
    padding: 1rem;
  }

  .p23-profile-hero__grid {
    min-height: auto;
    gap: 2rem;
    padding-block: 3rem;
  }

  .p23-profile-identity__head {
    align-items: flex-start;
    gap: 1rem;
  }

  .p23-profile-avatar--large {
    width: 4.6rem;
  }

  .p23-profile-identity h1 {
    font-size: clamp(2.8rem, 13vw, 4.5rem);
  }

  .p23-profile-lead {
    margin-block-start: 1.4rem;
    font-size: .9rem;
  }

  .p23-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .p23-local-nav {
    inset-block-start: var(--rava-header-offset, 64px);
  }

  .p23-local-nav .rava-container {
    gap: 1rem;
  }

  .p23-local-nav a {
    min-height: 3.2rem;
  }

  .p23-profile-about,
  .p23-activity,
  .p23-profile-records,
  .p23-ranked-section {
    padding-block: 3.4rem;
  }

  .p23-profile-about h2,
  .p23-section-head h2,
  .p23-activity h2,
  .p23-ranked-section h2 {
    font-size: clamp(2.2rem, 10vw, 3.3rem);
  }

  .p23-profile-facts {
    grid-template-columns: 1fr;
  }

  .p23-profile-facts div:nth-child(n) {
    min-height: 5.8rem;
    padding-inline: 0;
    border-inline-start: 0;
  }

  .p23-section-head {
    align-items: flex-start;
    flex-direction: column;
    margin-block-end: 1.6rem;
  }

  .p23-activity-list > a {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .p23-activity-list time {
    grid-column: 2;
  }

  .p23-profile-contact .rava-container {
    align-items: flex-start;
    flex-direction: column;
  }

  .p23-collection-grid {
    display: flex;
    flex-direction: column;
  }

  .p23-collection-card {
    min-height: 18rem;
  }

  .p23-collection-card__copy > strong {
    font-size: 2rem;
  }

  .p23-collection-card__meta {
    flex-wrap: wrap;
  }

  .p23-collection-hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .p23-collection-hero__visual {
    min-height: 19rem;
  }

  .p23-collection-hero__copy {
    padding: 2.4rem 1.1rem 3rem;
  }

  .p23-collection-hero__copy h1 {
    font-size: clamp(2.8rem, 12vw, 4.3rem);
  }

  .p23-ranked-record {
    grid-template-columns: 2rem 5.5rem minmax(0, 1fr);
    gap: .8rem;
    min-height: 0;
    padding-block: 1rem;
  }

  .p23-ranked-record__reason,
  .p23-ranked-record__actions {
    grid-column: 2 / -1;
  }

  .p23-ranked-record__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Record: identity first, short artifact second, buy bar above global nav. */
  .p22-record-hero__grid {
    padding-block: .8rem 2.5rem;
  }

  .p22-record-identity {
    order: 1 !important;
  }

  .p22-record-gallery {
    order: 2 !important;
    width: 100%;
  }

  .p22-record-gallery__main {
    aspect-ratio: 4 / 2.7 !important;
  }

  .p22-record-gallery__main .p21-archive-plate {
    min-height: 0;
  }

  .p22-record-identity h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 11vw, 4rem);
    overflow-wrap: anywhere;
  }

  .p22-mobile-buy-bar {
    z-index: 990 !important;
    inset-block-end: calc(var(--rava-mobile-nav-height, 68px) + env(safe-area-inset-bottom)) !important;
    padding-block-end: .7rem !important;
  }

  .rava-native-public-coffee .p22-record {
    padding-block-end: 5rem;
  }

  /* Compare: real phone pattern, no compressed desktop matrix. */
  .p22-selected-records {
    scroll-padding-inline: 1rem;
    padding-inline: 0;
  }

  .p22-selected-record {
    flex-basis: min(82vw, 19rem) !important;
  }

  .p22-compare-matrix {
    display: none;
  }

  .p23-mobile-compare {
    display: grid;
    gap: 1rem;
  }

  .p23-mobile-compare > header {
    position: sticky;
    z-index: 10;
    inset-block-start: calc(var(--rava-header-offset, 64px) + 2.9rem);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--p23-line, #d4d0c7);
    background: rgb(255 253 250 / 96%);
    backdrop-filter: blur(14px);
  }

  .p23-mobile-compare > header a {
    min-width: 0;
    display: grid;
    gap: .25rem;
    padding: .75rem;
    color: inherit;
    text-decoration: none;
  }

  .p23-mobile-compare > header a + a {
    border-inline-start: 1px solid var(--p23-line, #d4d0c7);
  }

  .p23-mobile-compare > header span,
  .p23-mobile-compare article > p span {
    color: var(--p23-muted, #646b64);
    font-size: .56rem;
  }

  .p23-mobile-compare > header strong {
    overflow: hidden;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .p23-mobile-compare > div {
    display: grid;
    gap: .7rem;
  }

  .p23-mobile-compare article {
    display: grid;
    grid-template-columns: 4.5rem repeat(2, minmax(0, 1fr));
    border: 1px solid var(--p23-line, #d4d0c7);
    background: var(--p23-surface, #fffdfa);
  }

  .p23-mobile-compare article h3 {
    display: grid;
    align-content: center;
    margin: 0;
    padding: .7rem;
    border-inline-end: 1px solid var(--p23-line-soft, #e7e3db);
    color: var(--p23-muted, #646b64);
    font-size: .62rem;
  }

  .p23-mobile-compare article p {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: .25rem;
    margin: 0;
    padding: .7rem;
  }

  .p23-mobile-compare article p + p {
    border-inline-start: 1px solid var(--p23-line-soft, #e7e3db);
  }

  .p23-mobile-compare article p strong {
    font-size: .68rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  /* Footer presentation is owned by the global P01 shell contract. */

}

@media (max-width: 360px) {
  .p23-directory-index > div,
  .p23-collections-hero dl > div {
    padding-inline: .55rem;
  }

  .p23-directory-index span,
  .p23-collections-hero dt {
    font-size: .55rem;
  }

  .p23-roastery-card__main {
    grid-template-columns: 3.4rem minmax(0, 1fr);
  }

  .p23-card-arrow {
    display: none;
  }

  .p23-profile-stats div {
    padding-inline: .6rem;
  }

  .p23-mobile-compare article {
    grid-template-columns: 3.8rem repeat(2, minmax(0, 1fr));
  }
}
