/* Shared phone scale. Unit detail pages keep their own typography and booking bar. */
@media (max-width: 767px) {
  :root {
    --phone-font: system-ui,-apple-system,system-ui, -apple-system, sans-serif;
    --phone-ink: #1d2731;
    --phone-muted: #5d6b75;
    --phone-sand: #f6f4f0;
    --phone-line: #ececec;
    --phone-red: #d1414b;
  }
  body:has(main[data-mobile-page]) { margin: 0; }
  body:has(.mobile-site-top:not([data-condo]), .mobile-static-top),
  #__next:has(.mobile-site-top:not([data-condo])) main {
    font: 400 16px/1.6 var(--phone-font);
    color: var(--phone-ink);
  }
  :is(#__next:has(.mobile-site-top:not([data-condo])), body:has(.mobile-static-top))
    :is(h1,h2,h3,h4,h5,h6,p,li,td,th,small,strong,summary,button,label,input,textarea,select,a) {
    font-family: var(--phone-font) !important;
  }
  :is(#__next:has(.mobile-site-top:not([data-condo])), body:has(.mobile-static-top)) h1 {
    font-size: 28px !important; line-height: 1.15 !important; font-weight: 750 !important;
  }
  :is(#__next:has(.mobile-site-top:not([data-condo])), body:has(.mobile-static-top)) h2 {
    font-size: 24px !important; line-height: 1.2 !important; font-weight: 730 !important;
  }
  :is(#__next:has(.mobile-site-top:not([data-condo])), body:has(.mobile-static-top)) h3 {
    font-size: 19px !important; line-height: 1.3 !important; font-weight: 700 !important;
  }
  #__next main[data-mobile-page] { background: white; color: var(--phone-ink); }
  #__next main[data-mobile-page] :is(h1,h2,h3,h4) { color: var(--phone-ink); }
  /* Older article exports identify their button links with an inline background. */
  #__next [data-mobile-page] :is(button, summary, .mobile-booking-action, .mobile-outline-action, .mobile-choice-tile, :where(article a[style*="background" i])) { min-height: 44px; box-sizing: border-box; }
  #__next [data-mobile-page] :is(.mobile-booking-action, [data-search-tabs] button[type="submit"]) { min-height: 48px; }
  /* Sentence links use the surrounding line box. Only explicit actions get tap-target sizing. */
  #__next [data-mobile-page] :where(p,li,td,th) a:where(:not(.mobile-booking-action,.mobile-outline-action,.mobile-choice-tile)) {
    text-decoration-line: underline; text-underline-offset: .18em;
  }
  #__next [data-mobile-page] :is(button, .mobile-outline-action, .mobile-booking-action) { text-decoration: none; }
  /* Match the home card's 24px screen inset even on edge-to-edge tool pages. */
  #__next [data-mobile-page] [data-search-tabs] { width: min(100%, calc(100vw - 48px)); margin: 0 auto; left: auto; transform: none; box-sizing: border-box; }
  .mobile-opening { margin: 0 auto; max-width: 680px; padding: 0 16px; box-sizing: border-box; }
  .mobile-opening--tool, .mobile-opening--article { max-width: none; }
  .mobile-opening-copy { padding: 22px 0 18px; }
  .mobile-opening-copy h1 { margin: 0 0 8px; letter-spacing: -.035em; }
  #__next .mobile-opening-copy p { margin: 0; color: var(--phone-muted); font: 400 16px/1.6 var(--phone-font); }
  #__next .mobile-opening-copy .mobile-opening-label {
    font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 7px;
  }
  #__next .mobile-opening-copy .mobile-opening-byline { font-size: 13px; margin-top: 14px; }
  .mobile-opening-media { position: relative; margin: 0 -16px; }
  .mobile-opening-media > img { display: block; width: 100%; height: 172px; object-fit: cover; }
  .mobile-opening-photos {
    position: absolute; bottom: 7px; right: 12px; padding: 0 11px; border: 1px solid #fff;
    border-radius: 10px; color: var(--phone-ink); background: #fffffff2; font-weight: 650;
  }
  .mobile-opening--selling { position: relative; padding: 0; }
  .mobile-opening--selling .mobile-opening-media { margin: 0; }
  .mobile-opening--selling .mobile-opening-media > img { height: 320px; }
  .mobile-opening--selling .mobile-opening-copy {
    position: absolute; top: 0; left: 0; right: 0; height: 320px; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: end; pointer-events: none; padding: 20px 16px 54px;
    background: linear-gradient(transparent 20%, #0009);
  }
  #__next .mobile-opening--selling .mobile-opening-copy :is(h1,p) { color: white; }
  .mobile-opening--selling .mobile-opening-photos { z-index: 1; }
  .mobile-opening--people .mobile-opening-media > img { height: 225px; }
  .mobile-booking-action, .mobile-outline-action {
    display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: center;
    padding: 9px 14px; border-radius: 10px; font-weight: 750; text-align: center; text-decoration: none;
  }
  .mobile-booking-action { border: 0; min-height: 48px; background: var(--phone-red); color: white; }
  .mobile-outline-action { min-height: 44px; border: 1.5px solid var(--phone-ink); background: white; color: var(--phone-ink); }
  .mobile-choice-tile { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--phone-line); border-radius: 14px; background: white; color: var(--phone-ink); text-decoration: none; }
  .mobile-fold { margin: 16px; padding-inline: 14px; border: 1px solid var(--phone-line); border-radius: 14px; background: white; }
  #__next [data-mobile-page] .mobile-fold > summary { min-height: 52px; font-size: 16px; line-height: 1.35; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; list-style: none; cursor: pointer; }
  .mobile-fold > summary::-webkit-details-marker { display: none; }
  .mobile-fold > summary::after { content: '+'; }
  .mobile-fold[open] > summary::after { content: '−'; }
  .mobile-fold[open] { padding-bottom: 14px; }
  /* The row is a disclosure label and keeps its semantic heading. */
  #__next [data-mobile-page] .mobile-fold > summary > h2 {
    margin: 0; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;
  }
  #__next [data-mobile-page] .deal-reserve {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
    color: white; background: var(--phone-red); border-radius: 10px;
  }
  .mobile-video-dialog { box-sizing: border-box; width: min(96vw, 640px); max-height: 90dvh; padding: 16px; border: 0; border-radius: 16px; background: white; color: var(--phone-ink); }
  .mobile-video-dialog::backdrop { background: #000b; }
  .mobile-video-dialog video { display: block; width: 100%; max-height: 65dvh; margin: 12px 0; background: #111; }
  .mobile-weather-range { display: grid; gap: 12px; padding: 16px; background: white; border: 1px solid var(--phone-line); border-radius: 16px; }
  .mobile-weather-range .mobile-outline-action:disabled { opacity: .55; }
}

@media (max-width: 767px) {
  main[data-mobile-page="article"] [data-article-byline] { display: none; }
  main[data-mobile-page="article"] .mobile-opening { padding: 0 16px; }
  main[data-mobile-page="article"] .mobile-opening-media { width: 100vw; margin-left: calc(50% - 50vw); }
  main[data-mobile-page="article"] .mobile-opening-media > img { border-radius: 0; }
  main[data-mobile-page="article"] :is(.mobile-article-end,.mobile-article-video) { margin: 28px 16px 16px; }
  main[data-mobile-page="article"] .mobile-article-end { padding: 18px; border-radius: 16px; background: var(--phone-sand); }
  main[data-mobile-page="article"] .mobile-article-end :is(p,h2) { color: var(--phone-ink); }
  main[data-mobile-page="article"] .mobile-article-end .mobile-booking-action { width: 100%; }
  .mobile-article-search > summary { cursor: pointer; list-style: none; }
  .mobile-article-search > summary::-webkit-details-marker { display: none; }
  .mobile-article-search[open] > summary { margin-bottom: 16px; }
  .mobile-article-video iframe { display: block; margin-top: 12px; border: 0; width: 100%; aspect-ratio: 16 / 9; }
  #__next main[data-mobile-page="article"] :is([class*="WhyDirect_human"],[class*="WhyDirect_tableHead"],[class*="BestTimeGuide_closingCard"],[class*="CrabIslandGuide_plannerHero"],.hub-banner,.holiday-day-flow) {
    background: var(--phone-sand) !important; color: var(--phone-ink) !important;
  }
  #__next main[data-mobile-page="article"] :is([class*="WhyDirect_human"],[class*="WhyDirect_tableHead"],[class*="BestTimeGuide_closingCard"],[class*="CrabIslandGuide_plannerHero"],.hub-banner,.holiday-day-flow) :is(p,span,strong,a,li) { color: var(--phone-ink); }
  #__next main[data-mobile-page="article"] :is(.restaurantChatTalk,[class*="BestTimeGuide_plannerButton"]) { background: white; border: 1.5px solid var(--phone-ink); color: var(--phone-ink); }
  #__next main[data-mobile-page="article"] :is(nav,aside,header,footer) a:not(p a,li a,nav[aria-label*="readcrumb" i] a,[rel=author]),
  #__next main[data-mobile-page="article"] :is(article,section,div) > a:not(p a,li a,td a,figcaption a,.mobile-booking-action) {
    min-height: 44px; display: inline-flex; align-items: center;
  }
  main[data-mobile-page="article"] .mobile-guide-links { padding-inline-start: 1.1em; }
  main[data-mobile-page="article"] .mobile-fold p > a { text-decoration: underline; }
  main[data-mobile-page="article"] img { max-width: 100%; }
}

@media (max-width: 767px) {
  #__next main[data-mobile-page="article"] :is(.fw-tab,#fw-reset,#fw-stay-form label,#fw-stay-form button,[style*="color:#fff" i],[style*="color: #fff" i]) { color: var(--phone-ink) !important; }
  #__next main[data-mobile-page="article"] :is(tr[style*="background" i],nav a[aria-current="page"]) { background: var(--phone-sand) !important; color: var(--phone-ink) !important; }
  #__next main[data-mobile-page="article"] nav a[aria-current="page"] { border: 2px solid var(--phone-ink); }
  #__next main[data-mobile-page="article"] :is([class*="GuideListingCard_links"] a,[class*="GuideListingCard_stay"],[class*="ChatgptAppButton_button"]) { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; }
  #__next main[data-mobile-page="article"] [class*="BestTimeGuide_closingPrimary"] { background: var(--phone-red); color: white !important; justify-content: center; min-height: 48px; }
  #fw-phone-date { flex: 1 1 175px; }
  #fw-phone-date > div > div:first-child { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  /* Keep the actual camera thumbnails and Crab Island photograph visible. */
  #__next main[data-mobile-page="article"] [class*="CrabIslandGuide_cameraThumb"] { background-color: var(--phone-sand); }
  #__next main[data-mobile-page="article"] [class*="CrabIslandGuide_plannerPhoto"] { background: url('/crab-island-aerial.jpg') center/cover no-repeat !important; }
  #__next main[data-mobile-page="article"] [class*="CrabIslandGuide_plannerPhoto"] span { background: white; color: var(--phone-ink); padding: 4px 8px; border-radius: 6px; text-shadow: none; }
}

@media (max-width: 767px) {
  /* The phone article opening ends with the byline. Keep the first tool below it. */
  #__next main[data-mobile-page="article"] :is(.holiday-jump-wrap, [class*="WeatherFirstSearch_box"]) { margin-top: 0; }
  #__next main[data-mobile-page="article"] [hidden] { display: none !important; }
  #__next main[data-mobile-page="article"] .mobile-flight-link,
  #__next main[data-mobile-page="article"] a.mobile-guide-dates { display: flex; width: 100%; margin: 14px 0; justify-content: center; }
  .mobile-preserved-guides a { text-decoration: underline; text-underline-offset: .18em; }
  #__next main[data-mobile-page="article"] :is(#cd-d,#cd-h,#cd-m,#cd-s,#next-label,[id^="cd-"] + div) { color: var(--phone-ink) !important; }
  #__next main[data-mobile-page="article"] #mobile-weather-tool > button,
  #__next main[data-mobile-page="article"] #fw-stay-form button[type="submit"],
  #__next main[data-mobile-page="article"] [class*="CrabIslandGuide_plannerButton"] {
    background: white !important; color: var(--phone-ink) !important; border: 1.5px solid var(--phone-ink) !important;
    min-height: 44px; border-radius: 10px;
  }
  #__next main[data-mobile-page="article"] [class*="BestTimeGuide_monthCard"] { background: var(--phone-sand); }
  #__next main[data-mobile-page="article"] a[class*="WhyDirect_textLink"] {
    display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px;
    border: 1.5px solid var(--phone-ink); border-radius: 10px; text-decoration: none !important;
  }
  #__next main[data-mobile-page="article"] nav[aria-label="On this page"] > div,
  #__next main[data-mobile-page="article"] :is([class*="GuestGuide_guide"],[class*="GalleryMapFaq_faqLayout"]) > aside,
  #__next main[data-mobile-page="article"] [class*="CrabIslandGuide_cameraGrid"] {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px;
  }
  #__next main[data-mobile-page="article"] details.mobile-fold [class*="relatedGrid"] {
    display: block; background: transparent;
  }
  #__next main[data-mobile-page="article"] details.mobile-fold [class*="relatedGrid"] > a {
    display: block; background: transparent; box-shadow: none; border: 0; padding: 8px 0; text-decoration: underline;
  }
  #__next main[data-mobile-page="article"] details.mobile-fold [class*="relatedGrid"] > a span { margin-right: .4em; }
  #__next main[data-mobile-page="article"] #departures:has(> .mobile-flight-link) {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px;
  }
  #__next main[data-mobile-page="article"] #departures > :is(h2,p) { grid-column: 1 / -1; }
  #__next main[data-mobile-page="article"] #departures > p:has(+ [data-phone-legacy="flight-hint"]) { display: none; }
  #__next main[data-mobile-page="article"] #departures > .mobile-flight-link { margin: 0; text-align: center; }
  #__next main[data-mobile-page="article"] aside > p { grid-column: 1 / -1; }
}
