.companion { margin: 0 0 3rem; color: var(--text); font: 1rem/1.5 var(--font); }
.companion *, .cp-lightbox * { box-sizing: border-box; }
.companion [hidden], .cp-lightbox [hidden] { display: none !important; }
.companion h1 { margin: 0 0 .55rem; font-size: clamp(26px,3.6vw,36px); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
.companion h2 { margin: 0 0 .55rem; font-size: 1.3rem; line-height: 1.25; }
.cp-head, .cp-results-head, .cp-actions, .cp-pages, .cp-person, .cp-tags, .cp-verified { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.cp-head, .cp-results-head { justify-content: space-between; margin: 1rem 0; }
.cp-head p, .cp-lead, .cp-empty p { margin: .35rem 0 .8rem; }
.cp-head p { margin-bottom: 0; }
.cp-guide { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-size: .92rem; color: var(--accent-text); text-underline-offset: .18em; }
.cp-guide .ic { width: 17px; height: 17px; }
.cp-meta, .cp-foot, .cp-field small, .cp-help, .cp-trip small, .cp-stack small { font-size: .9rem; color: #625f59; }
.cp-panel, .cp-card, .cp-empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-s); }
.cp-panel, .cp-empty { padding: clamp(1rem, 3vw, 1.65rem); margin: 1rem 0; }
.cp-empty { display: flex; gap: 1.2rem; align-items: flex-start; }
.cp-empty-icon, .cp-cover:has(svg) { display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.cp-empty-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; }
.cp-empty-icon svg { width: 26px; height: 26px; }
.cp-empty p { max-width: 60ch; }
.cp-search, .cp-grid, .cp-cards { display: grid; gap: 1rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.cp-search { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; }
.cp-stack { display: grid; gap: 1.15rem; }
.cp-stack p, .cp-trip p { margin: .55rem 0; }
.cp-stack fieldset, .cp-period-mode { min-width: 0; border: 0; padding: 0; margin: 0; }
.cp-stack > fieldset { padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.cp-stack legend { font-size: 1.25rem; font-weight: 650; margin-bottom: .65rem; }
.cp-stack :is(.cp-grid,.cp-period,.cp-thumbs) + .cp-field, .cp-consent { margin-top: .85rem; }
.cp-field { position: relative; min-width: 0; overflow-wrap: anywhere; }
.cp-field > label, label.cp-field { display: block; margin-bottom: .32rem; font-size: .94rem; font-weight: 600; }
.cp-field :is(input:not([type=checkbox]),select,textarea), .cp-month-trigger { width: 100%; min-width: 0; max-width: 100%; min-height: var(--control-l); border: 1px solid var(--line-strong); border-radius: var(--radius-m); padding: .65rem .8rem; font: inherit; color: var(--text); background: var(--surface); }
.cp-field textarea { resize: vertical; }
.cp-field small { display: block; margin-top: .25rem; }
.cp-check, .cp-stack #id_purpose label, .cp-consent > label { display: inline-flex; align-items: baseline; gap: .55rem; min-height: 38px; }
.cp-check { align-items: center; }
.cp-consent input[type=checkbox] { flex: none; width: 18px; height: 18px; align-self: flex-start; margin-top: 3px; }
.cp-stack #id_purpose { display: flex; gap: 1rem; flex-wrap: wrap; }
.cp-details { margin-top: .9rem; }
.cp-details summary, .cp-text-button { width: fit-content; color: var(--accent-text); cursor: pointer; font: inherit; font-weight: 600; }
.cp-text-button { border: 0; background: transparent; padding: .35rem 0; }
.cp-details[open] > summary { margin-bottom: .7rem; }
.cp-primary, .cp-secondary { display: inline-flex; justify-content: center; align-items: center; width: fit-content; min-height: var(--control-l); padding: .65rem 1rem; border-radius: var(--radius-m); border: 1px solid transparent; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
.companion .cp-primary { background: var(--action); color: var(--on-action); }
.companion .cp-primary:hover { background: var(--action-hover); }
.companion .cp-secondary { color: var(--accent-text); background: var(--surface-2); border-color: var(--line); }
.companion .cp-post { background: var(--accent); border-color: var(--accent); color: var(--on-accent); gap: .45rem; }
.cp-post span { font-size: 1.35rem; line-height: 1; }
.companion .cp-post:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cp-find { gap: .5rem; width: 100%; }
.cp-find .ic { width: 18px; height: 18px; }
.cp-period-mode legend { font-size: .94rem; font-weight: 600; margin-bottom: .2rem; }
.cp-period-mode { display: flex; gap: .75rem; margin-bottom: .45rem; }
.cp-period-mode label { cursor: pointer; font-size: .85rem; }
.cp-search .cp-period-mode legend, .cp-search [data-period-fields=month] > .cp-field > label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.cp-month-trigger { text-align: left; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.cp-month-trigger::after { content: '⌄'; margin-left: .5rem; color: var(--text-2); }
.cp-month-popup, .cp-options { position: absolute; top: 100%; left: 0; z-index: 12; width: max(100%, 245px); max-width: min(88vw, 360px); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow-l); }
.cp-month-popup { padding: .55rem; }
.cp-search .cp-month-popup { left: auto; right: 0; }
.cp-month-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .25rem; }
.cp-month-popup button, .cp-layout button { min-height: 40px; border: 0; border-radius: var(--radius-s); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.cp-month-grid button { text-transform: capitalize; }
.cp-month-popup button:disabled { opacity: .42; cursor: default; }
.cp-month-popup button[aria-pressed=true], .cp-layout button[aria-pressed=true] { background: var(--accent); color: white; }
.cp-month-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.cp-month-year button { min-width: 40px; font-size: 1.35rem; }
.cp-month-popup > .cp-text-button { width: 100%; margin-top: .4rem; }
.cp-options { max-height: 265px; overflow: auto; }
.cp-options .geo-suggest-item { display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%; min-height: 44px; text-align: left; }
.cp-options .geo-suggest-item[aria-selected=true] { background: var(--accent-soft); }
.cp-no-places { padding: .8rem; }
.cp-reset { display: inline-block; margin-top: .6rem; }
.cp-results-head h2 { margin: 0; }
.cp-results-head h2 small { color: var(--text-2); font-size: .9rem; }
.cp-layout { display: flex; gap: .2rem; padding: .2rem; border-radius: var(--radius-m); background: var(--fill); }
.cp-layout button { padding: .35rem .8rem; }
.cp-card h2, .cp-card p { margin: 0; }
.cp-card h2 a { color: inherit; text-decoration: none; }
.cp-cover { position: relative; display: block; }
.cp-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; }
.cp-cover svg { width: 44px; height: 44px; }
.cp-tags { gap: .4rem; }
.cp-tags span { border-radius: var(--radius-pill); padding: .18rem .6rem; background: var(--fill); font-size: .86rem; }
.cp-list { grid-template-columns: 1fr; }
.cp-narrow { max-width: 760px; margin: 1rem auto 0; }
.cp-verified { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .65rem .85rem; overflow-wrap: anywhere; }
.cp-required, .cp-error, .companion .errorlist { color: #a73025; }
.cp-invalid input, .cp-invalid select { border-color: #a73025; }
.companion :is(input, select, textarea, button, a, summary):focus-visible, .cp-lightbox button:focus-visible { outline: 3px solid #5986c9; outline-offset: 2px; }
.cp-thumbs { display: flex; flex-wrap: wrap; gap: .65rem; margin-block: .65rem; }
.cp-thumbs :is(label,div) { display: grid; gap: .2rem; }
.cp-thumbs img { display: block; object-fit: cover; border-radius: var(--radius-m); }
.cp-thumbs button { cursor: pointer; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.cp-thumbs img, .cp-snippet, .cp-trip, .cp-card, .cp-verified, .cp-consent { overflow-wrap: anywhere; }
.cp-lightbox { position: fixed; inset: 0; border: 0; width: min(100%, 1100px); height: min(90dvh, 850px); max-width: 100vw; max-height: 100dvh; margin: auto; padding: .6rem; background: #17191d; color: white; border-radius: 14px; }
.cp-lightbox[open] { display: flex; }
.cp-lightbox[open] { flex-direction: column; }
.cp-lightbox::backdrop { background: #0c1016d9; }
.cp-lightbar { display: flex; justify-content: space-between; align-items: center; padding-left: .6rem; }
.cp-lightbox button { min-width: 46px; height: 46px; border: 0; border-radius: 50%; background: #fff2; color: white; font-size: 1.5rem; cursor: pointer; }
.cp-stage { position: relative; min-height: 0; flex: 1; }
.cp-slides, .cp-cover-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.cp-slides::-webkit-scrollbar, .cp-cover-track::-webkit-scrollbar { display: none; }
.cp-slide, .cp-cover-track .cp-cover { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; }
.cp-slide { display: grid; place-items: center; grid-template: minmax(0,1fr) / minmax(0,1fr); }
.cp-slide img { width: auto; height: auto; max-width: 100%; max-height: 100%; user-select: none; }
.cp-stage button { position: absolute; top: 50%; transform: translateY(-50%); background: #17191dc9; }
.cp-stage [data-prev] { left: .25rem; }
.cp-stage [data-next] { right: .25rem; }
.cp-cover-gallery { position: relative; }
.cp-dialog-open { overflow: hidden; }
.cp-document p { margin: 0 0 1rem; }
@media (max-width: 760px) {
  .cp-search { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cp-search .cp-primary { width: 100%; }
  .cp-search .cp-month-popup { right: auto; left: 0; }
  .cp-search .cp-field:nth-child(2) .cp-options { right: 0; left: auto; }
}
@media (max-width: 550px) {
  .cp-cards, .cp-grid, .cp-search { grid-template-columns: 1fr; }
  .cp-head { align-items: flex-start; }
  .cp-empty { flex-direction: column; gap: .7rem; }
  .cp-head .cp-actions { gap: .5rem; }
  .cp-options, .cp-search .cp-field:nth-child(2) .cp-options { width: 100%; left: 0; }
  .cp-lightbox { height: 100dvh; border-radius: 0; }
}

.cp-photo-count { pointer-events: none; position: absolute; right: .2rem; bottom: .2rem; background: #17191dd9; color: white; font-size: .7rem; padding: .12rem .4rem; border-radius: var(--radius-s); }


.cp-person { gap: .3rem .7rem; }
.cp-person span, .cp-tags span, .cp-layout button { display: inline-flex; align-items: center; gap: .35rem; }
.cp-person span { color: #514f4a; font-size: .9rem; }
.cp-tags .ic, .cp-person .ic, .cp-meta .ic, .cp-layout .ic { width: 16px; height: 16px; flex: none; }
.cp-meta .ic { vertical-align: -.18em; color: var(--accent); }
.cp-person .cp-seeking { padding: .12rem .5rem; border-radius: var(--radius-pill); background: var(--fill); }
.cp-person :is(.cp-seeking-f, .cp-seeking-fg) { background: #fcebee; color: #a62943; }
.cp-person :is(.cp-seeking-m, .cp-seeking-mg) { background: #eaf2ff; color: #23589a; }
.cp-person .cp-seeking-mix { background: #f3edf8; color: #694486; }
.cp-tags .cp-lodging { color: #74531b; background: #fbf1d8; }
.cp-tags .cp-family { color: #654783; background: #f2edf8; }
.cp-tags .cp-booked { color: #276543; background: #e8f3ec; }
.cp-period-mode { gap: 0; }
.cp-period-mode label { display: inline-flex; align-items: center; min-height: 30px; position: relative; padding: 2px 10px; font-size: .85rem; font-weight: 550; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); }
.cp-period-mode label:first-of-type { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.cp-period-mode label:last-of-type { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.cp-period-mode label:has(:checked) { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.cp-period-mode label:has(:focus-visible) { outline: 2px solid var(--accent); z-index: 1; }
.cp-period-mode input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.cp-month-year select { width: auto; min-height: 38px; padding: .25rem .65rem; font-weight: 650; }
[data-month-part] { margin-top: .5rem; }

.cp-archive-tabs { display: inline-flex; padding: 4px; margin-top: 1rem; border-radius: var(--radius-m); background: var(--fill); }
.cp-archive-tabs a { padding: .5rem .9rem; color: var(--text); border-radius: var(--radius-s); text-decoration: none; }
.cp-archive-tabs [aria-current] { color: var(--accent-text); background: var(--surface); box-shadow: var(--shadow-s); }

.cp-consent-options { color: var(--text-2); font-size: .87rem; }
.cp-consent-options summary { cursor: pointer; width: fit-content; }
.cp-consent-options[open] summary { margin-bottom: .5rem; }

.cp-consent-line { display: flex; align-items: baseline; gap: .25rem .8rem; flex-wrap: wrap; }
.cp-consent-options[open] { flex-basis: 100%; }
.cp-publication .cp-identity { max-width: 28rem; margin: .35rem 0 .75rem; }
.cp-identity .cp-field + .cp-field { margin-top: .5rem; }

.cp-cards { gap: .8rem; }
.cp-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: clamp(76px, 7vw, 98px) minmax(0, 1fr);
  grid-template-areas: "photo route" "photo dates" "photo author"
                       "tags tags" "snippet snippet" "actions actions";
  align-content: start;
  align-items: start;
  gap: .35rem .85rem;
  padding: .9rem;
}
.cp-card-body { display: contents; }
.cp-card > :is(.cp-cover-gallery,.cp-cover) {
  grid-area: photo;
  height: auto;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-m);
  overflow: hidden;
}
.cp-card h2 { grid-area: route; font-size: 1.1rem; }
.cp-card .cp-meta { grid-area: dates; font-size: .85rem; }
.cp-card .cp-person { grid-area: author; gap: .17rem .5rem; }
.cp-card .cp-person .cp-seeking { width: fit-content; }
.cp-card .cp-tags { grid-area: tags; gap: .25rem; }
.cp-card .cp-snippet {
  grid-area: snippet;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: .92rem;
  line-height: 1.4;
}
.cp-card .cp-actions { grid-area: actions; padding-top: .2rem; gap: 1rem; font-size: .9rem; }
.cp-card .cp-actions .cp-secondary { min-height: 36px; padding: .3rem .75rem; }
.cp-card h2 a:hover { text-decoration: underline; }
.cp-list .cp-snippet { display: none; }

@media (min-width: 800px) {
  .cp-list .cp-card {
    grid-template-columns: 72px minmax(0,1.15fr) minmax(0,1fr) auto;
    grid-template-areas: "photo route author actions" "photo dates tags actions";
    align-content: center;
    row-gap: .15rem;
  }
  .cp-list .cp-card > :is(.cp-cover-gallery,.cp-cover) { width: 72px; min-height: 0; align-self: center; }
  .cp-list .cp-card .cp-actions { align-self: center; flex-direction: column; gap: .2rem; padding: 0; margin: 0; }
}

@media (max-width: 799px) {
  .cp-cards { grid-template-columns: minmax(0,1fr); gap: .65rem; }
  .cp-card {
    grid-template-columns: 76px minmax(0,1fr);
    grid-template-areas: "photo route" "photo dates" "author author"
                         "tags tags" "snippet snippet" "actions actions";
    gap: .35rem .7rem;
    padding: .75rem;
  }
  .cp-card h2 { font-size: 1.05rem; align-self: end; }
  .cp-card .cp-meta { line-height: 1.35; }
  .cp-card .cp-person { font-size: .95rem; }
  .cp-card .cp-person span, .cp-card .cp-tags span { font-size: .8rem; }
  .cp-card .cp-gender-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cp-card .cp-tags span { padding: .12rem .45rem; }
  .cp-card .cp-actions { padding: 0; gap: .9rem; }
  .cp-card .cp-actions a { display: inline-flex; align-items: center; }
  .cp-card .cp-actions :is(a,.cp-secondary) { min-height: 44px; }
  .cp-list {
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    overflow: hidden;
  }
  .cp-list .cp-card {
    position: relative;
    grid-template-columns: 52px minmax(0,1fr);
    grid-template-areas: "photo route" "photo dates" "photo author";
    gap: .15rem .65rem;
    padding: .65rem 1.65rem .65rem .65rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .cp-list .cp-card h2 { font-size: 1rem; }
  .cp-list .cp-card h2 a::after { content: ""; position: absolute; inset: 0; }
  .cp-list .cp-card h2 a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -3px; }
  .cp-list .cp-card::after {
    content: "";
    position: absolute;
    inset-inline-end: .7rem;
    top: 50%;
    width: .48rem;
    height: .48rem;
    border: solid var(--text-2);
    border-width: 1.5px 1.5px 0 0;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
  }
  .cp-list .cp-card > :is(.cp-cover-gallery,.cp-cover) { align-self: start; z-index: 1; }
  .cp-list .cp-card .cp-cover svg { width: 26px; height: 26px; }
  .cp-list .cp-card .cp-meta, .cp-list .cp-card .cp-person { font-size: .8rem; line-height: 1.35; }
  .cp-list .cp-card .cp-person { gap: .13rem .4rem; }
  .cp-list .cp-card :is(.cp-tags,.cp-actions) { display: none; }
  .cp-list .cp-card + .cp-card { border-top: 1px solid var(--line); }
}
@media (min-width: 700px) and (max-width: 799px) {
  .cp-cards:not(.cp-list) { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 360px) {
  .cp-card { grid-template-columns: 64px minmax(0,1fr); gap: .25rem .6rem; padding: .65rem; }
  .cp-list .cp-card { grid-template-areas: "photo route" "photo dates" "author author"; }
}
