/* Section layouts: welcome and first steps, shelf (bookcase, cards, diary), perfume page, catalog,
   taste (picks), profile and administration. The portrait dossier lives in portrait.css. */

/* Guest welcome */
.ap-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-3xl);
  align-items: center;
  min-height: min(640px, calc(100vh - 140px));
}
.ap-welcome h1 {
  font-size: clamp(48px, 6vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.ap-welcome-copy > p {
  max-width: 34ch;
  margin-top: var(--space-xl);
  color: var(--ap-ink-soft);
  font-size: 18px;
}
.ap-welcome-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-2xl);
}
.ap-welcome-copy .ap-welcome-note {
  margin-top: var(--space-lg);
  color: var(--ap-muted);
  font-size: var(--ap-text-sm);
}
.ap-welcome-points {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ap-welcome-points li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px var(--space-md);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--ap-line);
}
.ap-welcome-points li:last-child {
  border-bottom: 1px solid var(--ap-line);
}
.ap-welcome-points span {
  grid-row: span 2;
  color: var(--ap-accent);
  font: 12px var(--ap-mono);
  padding-top: 8px;
}
.ap-welcome-points h2 {
  font-size: 28px;
}
.ap-welcome-points p {
  color: var(--ap-muted);
}
.ap-guest-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding: 14px 18px;
  border-radius: var(--ap-radius);
  background: var(--ap-accent-soft);
  font-size: var(--ap-text-sm);
}

/* First steps on an empty shelf */
.ap-start {
  display: grid;
  gap: var(--space-lg);
  max-width: 820px;
}
.ap-start-intro h2 {
  font-size: 32px;
}
.ap-start-intro p {
  margin-top: 6px;
  color: var(--ap-muted);
  max-width: 60ch;
}
.ap-start-label {
  margin-top: var(--space-sm);
  color: var(--ap-muted);
  font: 11.5px var(--ap-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ap-quick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0 var(--space-xl);
}
.ap-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--ap-line);
}
.ap-quick-perfume {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ap-quick-perfume img {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-sunk);
  mix-blend-mode: multiply;
}
.ap-quick-perfume span {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.ap-quick-perfume small {
  color: var(--ap-muted);
  font: 10.5px var(--ap-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ap-quick-perfume strong {
  overflow: hidden;
  font: 600 18px var(--ap-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-quick-actions {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}
.ap-quick-actions .ap-chip {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}
.ap-quick-added {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ap-sage);
  font-size: var(--ap-text-sm);
  font-weight: 600;
}
.ap-quick-added svg {
  width: 16px;
  height: 16px;
}
.ap-start-done {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px 10px 10px 20px;
  border-radius: var(--ap-pill);
  background: var(--ap-ink);
  color: var(--ap-surface);
  box-shadow: var(--ap-shadow-lg);
  animation: ap-rise 0.25s var(--ap-ease);
}

/* Shelf controls */
.ap-shelf-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

/* Shelves: oak planks on a warm wall. Photos blend into the wall via multiply, so no ancestor of an image may
   create a stacking context (no transform/opacity/z-index on slots). Sections are packed into full-width rows
   (see layoutShelves); planks of neighbours join into one shelf, a thin post separates sections. */
.ap-shelves {
  --h: 150px;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 0;
  padding: 26px 22px 6px;
  border-radius: var(--ap-radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, oklch(0.975 0.012 82), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 3px, oklch(0.5 0.02 60 / 0.012) 3px 4px), oklch(0.948 0.014 76);
  box-shadow: inset 0 0 0 1px var(--ap-line);
}
.ap-shelf-row {
  position: relative;
  min-width: 0;
}
.ap-shelf-row:not([data-first])::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 1px;
  height: calc(28px + 16px + var(--h));
  background: linear-gradient(180deg, transparent, oklch(0.8 0.03 65) 30%, oklch(0.74 0.04 62));
}
.ap-shelf-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 0 0 4px;
  padding: 0 16px;
}
.ap-shelf-title h2 {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-shelf-title span {
  flex-shrink: 0;
  color: var(--ap-muted);
  font: 11px var(--ap-mono);
}
.ap-shelf-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.ap-shelf-track {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 16px;
  width: max-content;
  min-width: 100%;
  padding: 16px 16px 50px;
}
.ap-shelf-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(16px + var(--h));
  height: 16px;
  background: linear-gradient(180deg, oklch(0.82 0.045 70) 0 5px, oklch(0.7 0.06 60) 5px, oklch(0.64 0.06 55));
  box-shadow: 0 10px 14px -6px oklch(0.35 0.04 50 / 0.35);
}
.ap-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(var(--h) * 0.75);
}
.ap-bottle {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: var(--h);
}
.ap-bottle:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--ap-accent);
  outline-offset: 3px;
}
.ap-bottle img,
.ap-bottle svg {
  display: block;
  height: 100%;
  mix-blend-mode: multiply;
  transition: transform 0.35s var(--ap-ease);
}
.ap-bottle img {
  width: 100%;
  object-fit: contain;
  object-position: bottom;
}
.ap-bottle svg {
  width: 62%;
}
.ap-slot:hover .ap-bottle img,
.ap-slot:hover .ap-bottle svg,
.ap-bottle:focus-visible img,
.ap-bottle:focus-visible svg {
  transform: translateY(-6px);
}
/* Silhouettes for perfumes without a photo; wishlist = dashed outline, tried = faded. */
.ap-bottle-body {
  fill: oklch(0.9 0.02 70);
  stroke: oklch(0.78 0.02 65);
  stroke-width: 1.5;
}
.ap-bottle-cap {
  fill: oklch(0.42 0.03 55);
}
.ap-bottle-shape text {
  font: 600 11px var(--ap-display);
  fill: oklch(0.45 0.03 55);
}
.ap-bottle-shape.is-ghost .ap-bottle-body,
.ap-bottle-shape.is-ghost .ap-bottle-cap {
  fill: none;
  stroke: oklch(0.62 0.02 60);
  stroke-dasharray: 4 4;
}
.ap-slot[data-group='wishlist'] img {
  opacity: 0.32;
  filter: grayscale(1);
}
.ap-slot[data-group='none'] img,
.ap-slot[data-group='none'] svg {
  opacity: 0.55;
  filter: grayscale(0.35);
}
/* Brass plaque on the plank edge: the rating and the button that edits it. */
.ap-plaque {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 34px;
  height: 21px;
  margin-top: -2px;
  padding: 0 7px;
  border-radius: 3px;
  background: linear-gradient(180deg, oklch(0.86 0.06 85), oklch(0.72 0.075 75));
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.55),
    0 1px 2px oklch(0.3 0.04 50 / 0.35);
  color: oklch(0.27 0.04 60);
  font: 600 15px/1 var(--ap-display);
  font-variant-numeric: lining-nums tabular-nums;
  transition:
    filter 0.15s,
    transform 0.15s var(--ap-ease);
}
.ap-plaque:hover,
.ap-plaque[aria-expanded='true'] {
  filter: brightness(1.07);
}
.ap-plaque:active {
  transform: translateY(1px);
}
.ap-plaque svg {
  width: 10px;
  height: 10px;
  fill: oklch(0.45 0.1 40);
  color: oklch(0.45 0.1 40);
}
.ap-plaque-empty {
  font: 11px var(--ap-body);
  opacity: 0.75;
}
.ap-plaque.is-saved {
  animation: ap-plaque-saved 0.9s var(--ap-ease);
}
@keyframes ap-plaque-saved {
  30% {
    filter: brightness(1.25);
    transform: translateY(-1px);
  }
}
/* The name hangs below the plank on hover; the track reserves room so the scroll row does not clip it. */
.ap-slot-name {
  position: absolute;
  top: calc(var(--h) + 24px);
  left: 50%;
  width: max-content;
  max-width: 150px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--ap-ink);
  color: oklch(0.85 0.01 70);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  transform: translate(-50%, -4px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.2s var(--ap-ease);
}
.ap-slot-name b {
  display: block;
  color: var(--ap-surface);
  font-weight: 600;
}
.ap-slot:hover .ap-slot-name,
.ap-slot:focus-within .ap-slot-name {
  opacity: 1;
  transform: translate(-50%, 0);
}
.ap-rate-pop {
  position: fixed;
  z-index: 40;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow-lg);
  animation: ap-rise 0.2s var(--ap-ease);
}
.ap-rate-pop-row {
  display: grid;
  grid-template-columns: repeat(10, 32px);
  gap: 3px;
}
.ap-rate-pop-row button {
  height: 34px;
  border: 1px solid var(--ap-line-strong);
  border-radius: 6px;
  background: var(--ap-surface);
  color: var(--ap-ink-soft);
  font: 600 17px var(--ap-display);
}
.ap-rate-pop-row button:hover {
  border-color: var(--ap-muted);
  color: var(--ap-ink);
}
.ap-rate-pop-row button[aria-pressed='true'] {
  border-color: var(--ap-accent);
  background: var(--ap-accent);
  color: var(--ap-accent-ink);
}
.ap-rate-pop .ap-text-button {
  padding: 0 2px;
  font-size: 12px;
}
.ap-card-groups {
  display: grid;
  gap: var(--space-2xl);
}
.ap-card-group .ap-shelf-title {
  margin: 0 0 var(--space-md);
  padding: 0;
}
.ap-card-group .ap-shelf-title h2 {
  font-size: 26px;
}

/* Diary feed */
.ap-feed {
  display: grid;
  gap: var(--space-2xl);
  max-width: 860px;
}
.ap-perfume .ap-feed {
  gap: 0;
}
.ap-feed-month h2 {
  margin-bottom: var(--space-sm);
  font-size: 24px;
}
.ap-entry {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--ap-line);
}
.ap-entry-date b {
  display: block;
  font: 600 32px/1 var(--ap-display);
  font-variant-numeric: lining-nums;
}
.ap-entry-date small {
  color: var(--ap-faint);
  font: 10.5px var(--ap-mono);
}
.ap-entry-body {
  display: grid;
  gap: 6px;
  align-content: start;
}
.ap-entry-perfume {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}
.ap-entry-perfume img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--ap-sunk);
  mix-blend-mode: multiply;
}
.ap-entry-perfume span {
  display: grid;
  font: 600 19px/1.15 var(--ap-display);
}
.ap-entry-perfume small {
  color: var(--ap-muted);
  font: 10.5px var(--ap-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ap-entry-perfume:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ap-entry-context {
  color: var(--ap-accent);
  font-size: var(--ap-text-sm);
  font-weight: 600;
}
.ap-entry-note {
  color: var(--ap-ink-soft);
  max-width: 64ch;
  white-space: pre-line;
}
.ap-entry-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
}

/* Perfume page */
.ap-perfume {
  display: grid;
  gap: var(--space-3xl);
}
.ap-perfume-nav {
  margin: -16px 0 calc(var(--space-3xl) * -1 + 8px) -8px;
}
.ap-perfume-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-3xl);
  align-items: start;
}
/* Sticky makes the photo box a stacking context, so its own background is what the photo multiplies with. */
.ap-perfume-photo {
  position: sticky;
  top: 24px;
  padding: 9%;
  border-radius: var(--ap-radius-lg);
  background: radial-gradient(85% 70% at 50% 42%, var(--ap-surface), var(--ap-well));
}
.ap-perfume-photo img {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.ap-perfume-intro {
  display: grid;
  gap: var(--space-md);
  align-content: start;
}
.ap-perfume-brand {
  color: var(--ap-muted);
  font: 12px var(--ap-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ap-perfume-intro h1 {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.ap-perfume-meta {
  color: var(--ap-muted);
}
.ap-perfume-description {
  max-width: 62ch;
  margin-top: var(--space-sm);
  color: var(--ap-ink-soft);
  font-size: var(--ap-text-lg);
  line-height: 1.6;
}
.ap-perfume-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--ap-radius-lg);
  background: var(--ap-accent-soft);
}
.ap-perfume-section {
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--ap-line);
}
.ap-perfume-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl) var(--space-3xl);
}
.ap-perfume-block h2 {
  margin-bottom: var(--space-md);
  font-size: 26px;
}
.ap-perfume-links {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  grid-column: 1 / -1;
}
.ap-note-layers {
  display: grid;
  margin: 0;
}
.ap-note-layer,
.ap-when > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--ap-line);
}
.ap-note-layer dt,
.ap-when dt {
  color: var(--ap-muted);
  font: 11px/1.9 var(--ap-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ap-note-layer dd,
.ap-when dd {
  margin: 0;
}
.ap-when {
  display: grid;
  margin: 0;
}
.ap-when dd {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ap-when dd span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--ap-pill);
  font-size: 12.5px;
}
.ap-when-on {
  background: var(--ap-ink);
  color: var(--ap-surface);
}
.ap-when-off {
  color: var(--ap-faint);
  box-shadow: inset 0 0 0 1px var(--ap-line);
}

/* Impression form */
.ap-impression {
  gap: var(--space-xl);
  margin-top: var(--space-lg);
  padding: var(--space-xl);
  border-radius: var(--ap-radius-lg);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
}
.ap-impression-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.ap-fav {
  position: relative;
  cursor: pointer;
}
.ap-fav input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.ap-fav > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--ap-pill);
  color: var(--ap-muted);
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s;
}
.ap-fav svg {
  width: 17px;
  height: 17px;
}
.ap-fav:hover > span {
  background: var(--ap-sunk);
  color: var(--ap-ink);
}
.ap-fav input:focus-visible + span {
  outline: 2px solid var(--ap-accent);
  outline-offset: 2px;
}
.ap-fav input:checked + span {
  background: var(--ap-accent-soft);
  color: var(--ap-accent);
}
.ap-fav input:checked + span svg {
  fill: currentColor;
}
.ap-impression-more {
  border-top: 1px solid var(--ap-line);
  padding-top: var(--space-md);
}
.ap-impression-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ap-ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ap-impression-more > summary::-webkit-details-marker {
  display: none;
}
.ap-impression-more > summary::before {
  content: '+';
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ap-sunk);
  font-weight: 400;
}
.ap-impression-more[open] > summary::before {
  content: '−';
}
.ap-impression-more[open] {
  display: grid;
  gap: var(--space-lg);
}
.ap-impression-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--ap-line);
}
.ap-save-state {
  flex: 1;
  color: var(--ap-muted);
  font-size: 12.5px;
}

/* Catalog */
.ap-searchbar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.ap-brand-field {
  width: 200px;
  min-height: 48px;
  border-radius: var(--ap-pill);
}
.ap-searchbar .ap-button {
  min-height: 48px;
  padding: 0 22px;
}
.ap-catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}
.ap-catalog-tools .ap-chip-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ap-results-count {
  flex-shrink: 0;
  color: var(--ap-muted);
  font: 12px var(--ap-mono);
}
.ap-catalog-foot {
  margin-top: var(--space-2xl);
  color: var(--ap-muted);
  font-size: var(--ap-text-sm);
  text-align: center;
}

/* Taste: tabs over the portrait and the picks */
.ap-taste-tabs .ap-tabs {
  margin-bottom: var(--space-xl);
}
.ap-picks-form {
  margin-bottom: var(--space-xl);
  padding: var(--space-xl);
  border-radius: var(--ap-radius-lg);
  background: var(--ap-surface);
  box-shadow: inset 0 0 0 1px var(--ap-line);
}
.ap-occasion-custom {
  width: min(340px, 100%);
  min-height: 36px;
  margin-top: 8px;
  border-radius: var(--ap-pill);
}
.ap-picks-submit {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.ap-picks-submit .ap-help {
  max-width: 64ch;
}
.ap-rec-status {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
  color: var(--ap-ink-soft);
  font-size: var(--ap-text-sm);
}
.ap-rec-status small {
  color: var(--ap-faint);
  font: 11px var(--ap-mono);
}
.ap-rec-status[data-busy='true'] span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ap-accent);
  animation: ap-pulse 1.4s ease-in-out infinite;
}
@keyframes ap-pulse {
  50% {
    opacity: 0.3;
  }
}
.ap-rec-group + .ap-rec-group {
  margin-top: var(--space-3xl);
}
.ap-rec-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-size: var(--ap-text-sm);
}
.ap-rec-title {
  font: italic 500 19px/1.25 var(--ap-display);
  color: var(--ap-ink);
}
.ap-rec-occasion {
  color: var(--ap-muted);
}
.ap-rec-ai {
  display: grid;
  gap: 4px;
  justify-items: start;
  color: var(--ap-ink-soft);
}
.ap-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ap-rec-actions .ap-chip {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}
.ap-card-external .ap-card-visual {
  aspect-ratio: auto;
  min-height: 140px;
  border: 1px dashed var(--ap-line-strong);
  background: transparent;
}

/* Profile */
.ap-profile-body {
  display: grid;
  gap: var(--space-lg);
  max-width: 760px;
}
.ap-profile-body .ap-panel + .ap-panel {
  margin-top: 0;
}

/* Administration */
.ap-admin-tabs {
  margin-bottom: var(--space-xl);
}
.ap-doc-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}
.ap-doc-nav {
  position: sticky;
  top: 16px;
  gap: 2px;
}
.ap-doc-nav h2 {
  margin-bottom: 8px;
  font-size: 22px;
}
.ap-doc-link {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-ink-soft);
  font-size: 13px;
  text-align: left;
}
.ap-doc-link:hover {
  background: var(--ap-sunk);
}
.ap-doc-link[aria-current='page'] {
  background: var(--ap-accent-soft);
  color: var(--ap-ink);
  font-weight: 600;
}
.ap-doc-content {
  display: block;
  min-width: 0;
  max-width: 80ch;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.ap-doc-content h2,
.ap-doc-content h3,
.ap-doc-content h4 {
  margin: 28px 0 8px;
}
.ap-doc-content h2:first-child {
  margin-top: 0;
}
.ap-doc-content p,
.ap-doc-content ul {
  margin: 8px 0;
  line-height: 1.65;
}
.ap-doc-content ul {
  padding-left: 22px;
}
.ap-doc-content pre {
  overflow: auto;
  padding: 12px 14px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-sunk);
  font-size: 12px;
  white-space: pre;
}
.ap-doc-content code {
  font-family: var(--ap-mono);
  font-size: 0.9em;
}
.ap-doc-content table {
  margin: 12px 0;
}
.ap-import-row {
  padding: 10px 14px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-paper);
}
.ap-import-row summary {
  cursor: pointer;
  font-size: var(--ap-text-sm);
}
.ap-import-row[open] {
  display: grid;
  gap: 8px;
}

/* Responsive */
@media (max-width: 1100px) {
  .ap-welcome {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .ap-perfume-hero {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-2xl);
  }
}
@media (max-width: 800px) {
  .ap-doc-layout {
    grid-template-columns: 1fr;
  }
  .ap-doc-nav {
    position: static;
  }
}
@media (max-width: 740px) {
  .ap-page-head {
    margin-bottom: var(--space-xl);
  }
  .ap-page-aside {
    width: 100%;
    justify-content: space-between;
  }
  .ap-section-head h2 {
    font-size: 24px;
  }
  .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl) var(--space-md);
  }
  .ap-grid-wide {
    grid-template-columns: 1fr;
  }
  .ap-card h3 {
    font-size: 18px;
  }
  .ap-welcome h1 {
    font-size: 52px;
  }
  .ap-guest-note,
  .ap-perfume-guest {
    flex-direction: column;
    align-items: flex-start;
  }
  .ap-quick-list {
    grid-template-columns: 1fr;
  }
  .ap-quick-item {
    flex-direction: column;
    align-items: stretch;
  }
  .ap-quick-actions {
    padding-left: 64px;
  }
  .ap-shelf-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .ap-shelf-controls .ap-segmented {
    align-self: flex-start;
  }
  .ap-shelf-controls .ap-chip-row {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ap-controls-label {
    display: none;
  }
  .ap-shelves {
    --h: 112px;
    margin-inline: -4px;
    padding: 16px 8px 2px;
  }
  .ap-shelf-track {
    gap: 10px;
    padding: 12px 8px 46px;
  }
  .ap-shelf-title {
    padding: 0 10px;
  }
  .ap-shelf-title h2 {
    font-size: 17px;
  }
  .ap-shelf-row:not([data-first])::before {
    height: calc(26px + 12px + var(--h));
  }
  .ap-shelf-track::before {
    top: calc(12px + var(--h));
  }
  .ap-rate-pop-row {
    grid-template-columns: repeat(5, 44px);
  }
  .ap-rate-pop-row button {
    height: 42px;
  }
  .ap-entry {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .ap-entry-side {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
  }
  .ap-perfume {
    gap: var(--space-2xl);
  }
  .ap-perfume-nav {
    margin: -12px 0 calc(var(--space-2xl) * -1 + 4px) -8px;
  }
  .ap-perfume-hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .ap-perfume-photo {
    position: static;
  }
  .ap-perfume-photo {
    padding: 5%;
  }
  .ap-perfume-photo img {
    aspect-ratio: 4 / 3;
    max-height: 280px;
  }
  .ap-impression {
    margin-inline: -4px;
    padding: var(--space-lg);
  }
  .ap-choice-rating .ap-choice-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .ap-note-layer,
  .ap-when > div {
    grid-template-columns: 78px minmax(0, 1fr);
  }
  .ap-searchbar {
    flex-wrap: wrap;
  }
  .ap-searchbar .ap-search-field {
    flex-basis: 100%;
  }
  .ap-brand-field {
    flex: 1;
    width: auto;
  }
  .ap-catalog-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .ap-catalog-tools .ap-chip-row {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .ap-picks-form {
    padding: var(--space-lg);
  }
  .ap-picks-submit {
    flex-direction: column;
    align-items: flex-start;
  }
  .ap-panel {
    padding: var(--space-lg);
  }
  .ap-fav-text {
    display: none;
  }
  .ap-auth-links {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 740px) {
  /* The results line already carries the count on phones. */
  [data-view='catalog'] .ap-page-aside {
    display: none;
  }
}
