/* Isla Social: phone app layer.
   Everything here applies at phone width only (860px and under).
   Desktop is untouched: above that width these parts stay hidden. */
.tabbar, .stories, .seg, .m-events, .tiles, .m-search, .map-search, .sheet-grab, .sheet-map { display: none; }
.map-sheet { display: contents; }

@media (max-width: 860px) {
  @view-transition { navigation: auto; }
  html { -webkit-tap-highlight-color: transparent; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }

  /* ---------- top bar: logo left, socials right ---------- */
  .site-header .wrap { min-height: 56px; }
  .brand img { height: 40px; }
  .menu-btn, .site-header .nav, .site-header .nav.open { display: none; }
  .site-header .socials { display: flex; margin-left: auto; }
  .site-header .socials a { width: 44px; height: 44px; }
  .site-header .socials svg { width: 25px; height: 25px; }

  /* ---------- bottom tab bar ---------- */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: var(--paper); border-top: 2px solid var(--ink); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  /* Netlify's free-plan badge sits bottom-right by default: on phones it goes top centre, in the header's empty middle. */
  #nl-badge-frame { top: 2px !important; bottom: auto !important; left: 50% !important; right: auto !important; transform: translateX(calc(-50% + 5px)); }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 50px; font: 600 .68rem/1 var(--font-body); color: var(--ink); text-decoration: none; }
  .tabbar svg { box-sizing: content-box; width: 24px; height: 24px; padding: 3px 14px; border-radius: 999px; }
  .tabbar a[aria-current="page"] { color: var(--red); font-weight: 800; }
  .tabbar a[aria-current="page"] svg { background: var(--red); color: var(--paper); }

  /* ---------- shared rhythm ---------- */
  .band { padding: 2.2rem 0; }
  h2 { font-size: 1.9rem; }
  .band-head { margin-bottom: 1.1rem; gap: .3rem 1rem; align-items: baseline; }
  .band-head p { font-size: .95rem; margin-top: .35rem; }
  .band-head .btn { background: none; border: 0; box-shadow: none; padding: .3rem 0; color: var(--red); font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; }
  .band-head .btn:hover { transform: none; box-shadow: none; }
  .band.page-head { padding: .5rem 0 1rem; }
  .page-head h1 { font-size: 2.4rem; }
  .page-head .lede { font-size: 1rem; }
  .head-row { gap: .4rem; }
  .scallop { height: 20px; background-size: 100% 2px, 36px 40px; background-image: linear-gradient(var(--c, var(--red)), var(--c, var(--red))), radial-gradient(circle at 18px 2px, var(--c, var(--red)) 17px, transparent 18px); }

  /* ---------- side-swipe rows ---------- */
  .cols, #home-events, #home-notes, .ring-list { display: flex; gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1.25rem; padding: 0 1.25rem .8rem; scrollbar-width: none; }
  .cols::-webkit-scrollbar, #home-events::-webkit-scrollbar, #home-notes::-webkit-scrollbar, .ring-list::-webkit-scrollbar, .stories::-webkit-scrollbar, #filters::-webkit-scrollbar, #map-list::-webkit-scrollbar, .faq-nav::-webkit-scrollbar { display: none; }
  .cols > *, #home-events > *, #home-notes > *, .ring-list > * { flex: 0 0 84%; scroll-snap-align: center; }
  .cols > div, .ring-list > .person { background: #fbf9f4; border: 2px solid var(--ink); border-radius: 18px; padding: 1.1rem 1.2rem; }
  .ring-list { margin-top: 1.6rem; }
  .ring-list > .person { --av: 76px; }

  /* ---------- home ---------- */
  .stories { display: flex; gap: .8rem; overflow-x: auto; padding: .7rem 1.25rem .9rem; background: var(--red); scrollbar-width: none; }
  .story { flex: none; width: 70px; display: grid; justify-items: center; gap: .35rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--paper); font: 600 .72rem/1.1 var(--font-body); text-decoration: none; }
  .story:hover { color: var(--paper); }
  .story > span:last-child { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .story-ring { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; border: 2.5px solid var(--paper); }
  .story-ring .avatar { --av: 56px; border: 0; box-shadow: none; }
  .story-ring .avatar.soon { background: none; color: var(--paper); }
  .story-ring.logo { background: var(--paper); }
  .story-ring.logo img { width: 46px; }
  .hero { padding: .6rem 0 1.6rem; }
  .hero-grid { gap: 1.2rem; }
  .hero h1 { font-size: 2.7rem; max-width: none; }
  .hero .lede { font-size: 1.02rem; margin-top: .8rem; }
  .hero .btn-row { margin-top: 1.1rem; gap: .7rem; }
  .hero .btn-row .btn { flex: 1 1 100%; justify-content: center; }
  .hero-art { max-width: none; margin: 0; }
  .hero-art > img { display: none; }
  .hero-next { width: 100%; margin: 0; transform: none; animation: none; }
  .promise { gap: 1.4rem; }
  .follow { gap: 1rem; }
  .follow-card { padding: 1.1rem; }
  .form-inline .btn { flex: 1 1 100%; justify-content: center; }

  /* ---------- the circle ---------- */
  .ring { --r: 118px; --av: 66px; --cap: 0px; }
  .ring-five .cap, .ring-all .cap { display: none; }
  .ring .node { width: var(--av); cursor: pointer; }
  .ring-logo { width: 92px; }
  .ring-line { border-width: 9px; }
  .ring-all { --r: 132px; --av: 50px; }
  .ring-all .avatar { border-width: 2px; box-shadow: 0 0 0 3px var(--bandbg, var(--paper)); }
  .circle-tools { margin-bottom: 1.4rem; }
  .circle-tools p { font-size: .9rem; }
  #people { grid-template-columns: repeat(3, 1fr); gap: 1.3rem .5rem; }
  #people .person { --av: 86px; padding: 0; border: 0; cursor: pointer; }
  #people .person .hood, #people .person p, #people .person .soc { display: none; }
  #people .person h3 { font-size: .86rem; margin-top: .45rem; }
  #people .person:target { background: none; box-shadow: none; }

  /* ---------- events ---------- */
  .seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; position: sticky; top: 56px; z-index: 900; background: var(--paper); padding: .6rem 1.25rem; border-bottom: 2px solid rgba(46,42,32,.14); }
  .seg button { font: 800 .95rem var(--font-body); padding: .65rem; border-radius: 999px; border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
  .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
  body[data-seg="past"] #sec-upcoming, body:not([data-seg="past"]) #sec-past { display: none; }
  #sec-upcoming .band-head, #sec-past .band-head > div:first-child { display: none; }
  #sec-upcoming, #sec-past { padding-top: 1.3rem; }
  .ticket-buy .btn { padding: .8rem 1.3rem; }
  .ticket-body { padding: 1.1rem 1.2rem 1.2rem; }
  .ticket-body h3 { font-size: 1.55rem; }

  /* ---------- map: full screen, search on top, list sheet that swipes up ---------- */
  body[data-page="map"] { padding-bottom: 0; overflow: hidden; }
  body[data-page="map"] .site-footer { display: none; }
  .map-layout { display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); height: auto; min-height: 0; overflow: hidden; }
  .map-stage { height: 100%; }
  .map-panel { display: contents; }
  .map-panel > h1, .map-panel > p, .map-panel > [data-draft], .map-tools > strong, .map-tools > p { display: none; }
  .map-search { display: block; position: absolute; z-index: 970; top: 10px; left: 12px; right: 12px; width: auto; height: 46px; border-radius: 999px; padding: 0 1.1rem; background: #fbf9f4; box-shadow: 0 2px 8px rgba(46,42,32,.28); }
  #filters { position: absolute; z-index: 970; top: 64px; left: 0; right: 0; display: flex; flex-wrap: nowrap; gap: .45rem; overflow-x: auto; margin: 0; padding: 0 12px 8px; scrollbar-width: none; }
  .ico-btn { flex: none; width: 46px; height: 46px; font-size: 24px; box-shadow: 0 2px 6px rgba(46,42,32,.28); }
  .ico-btn[aria-pressed="true"] { box-shadow: 0 2px 6px rgba(46,42,32,.28); }
  .map-layout.list-open::before { content: ""; position: absolute; z-index: 955; left: 0; right: 0; top: 0; height: 140px; background: var(--paper); }
  .map-sheet { display: flex; flex-direction: column; position: absolute; z-index: 960; left: 0; right: 0; top: 120px; bottom: 0; background: var(--paper); border-top: 2px solid var(--ink); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 14px rgba(46,42,32,.2); transform: translateY(calc(100% - 196px)); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
  .map-sheet.open { transform: none; box-shadow: none; }
  .map-sheet.dragging { transition: none; }
  .sheet-grab { display: grid; justify-items: center; gap: .35rem; flex: none; width: 100%; background: none; border: 0; padding: .55rem 0 .5rem; font: 800 .92rem/1.2 var(--font-body); color: var(--ink); cursor: grab; touch-action: none; }
  .grab-bar { width: 44px; height: 5px; border-radius: 99px; background: rgba(46,42,32,.3); }
  #map-list { display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory; touch-action: pan-x; padding: 0 12px 10px; scrollbar-width: none; }
  #map-list .note { flex: 0 0 82%; scroll-snap-align: center; display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; align-content: start; height: 132px; overflow: hidden; padding: .8rem 1rem; }
  #map-list .note.active { box-shadow: none; border-color: var(--red); }
  #map-list .note .type-ico { grid-row: span 2; }
  #map-list .note h3 { margin: 0; font-size: 1.05rem; }
  #map-list .note p { grid-column: 1 / -1; margin: .35rem 0 0; font-size: .9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #map-list > p { flex: 1; margin: 0; padding: .8rem 1rem; }
  .map-sheet.open #map-list { flex: 1; flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: none; touch-action: pan-y; padding: .3rem 12px 90px; }
  .map-sheet.open #map-list .note { flex: none; height: auto; }
  .map-sheet.open #map-list .note p { display: block; }
  .map-sheet.open .sheet-map { display: block; position: absolute; left: 50%; bottom: 16px; translate: -50% 0; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: .8rem 1.5rem; font: 800 .95rem var(--font-body); box-shadow: 0 3px 10px rgba(46,42,32,.35); cursor: pointer; }
  .map-tools { position: absolute; z-index: 950; right: 12px; top: 124px; margin: 0; padding: 0; border: 0; }
  .map-tools .btn-row { margin: 0; flex-direction: column; align-items: flex-end; gap: .5rem; }
  .leaflet-control-zoom { display: none; }
  .leaflet-bottom { bottom: 200px; }
  .leaflet-control-attribution { font-size: .62rem; }
  .add-hint { top: 180px; white-space: nowrap; }

  /* ---------- FAQ: search, pinned chips, grouped cards ---------- */
  body[data-page="faq"] main > .band:not(.page-head):not(.band-beige) { padding-top: 0; }
  .faq-layout { gap: 0; }
  .m-search { display: block; width: 100%; height: 46px; border-radius: 999px; padding: 0 1.1rem; }
  #faq-search { position: sticky; top: 64px; z-index: 901; margin-top: .7rem; }
  .faq-layout::before { content: ""; position: sticky; top: 56px; z-index: 900; height: 0; box-shadow: 0 0 0 60px var(--paper); clip-path: inset(0 -100vw -64px -100vw); }
  .faq-nav { position: sticky; top: 116px; z-index: 900; display: flex; flex-wrap: nowrap; gap: .45rem; overflow-x: auto; background: var(--paper); margin: 0 -1.25rem; padding: .6rem 1.25rem; scrollbar-width: none; }
  .faq-nav a { flex: none; border: 2px solid var(--ink); border-radius: 999px; padding: .4rem .95rem; font-size: .9rem; }
  .faq-group { scroll-margin-top: 190px; margin: .6rem 0 1.1rem; background: #fbf9f4; border: 2px solid var(--ink); border-radius: 18px; padding: .9rem 1rem 0; }
  .faq-group h2 { font-size: 1.5rem; margin-bottom: .5rem; }
  .faq-group details:last-child { border-bottom: 0; }
  summary { font-size: 1rem; padding: .85rem 2.2rem .85rem 0; }
  summary::after { top: .5rem; }
  details p { font-size: .97rem; }
  .faq-none { padding: 1rem 0; }

  /* ---------- bottom sheets (tickets, add a pin, profiles) ---------- */
  dialog { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh; border-radius: 26px 26px 0 0; border-width: 2px 0 0; box-shadow: none; padding: .8rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom)); }
  dialog[open] { animation: sheet-up .28s cubic-bezier(.2,.8,.2,1); }
  dialog::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: rgba(46,42,32,.3); margin: 0 auto 1rem; }
  @keyframes sheet-up { from { translate: 0 100%; } }
  dialog .form { max-width: none; }
  dialog .btn { justify-content: center; }
  dialog .dialog-actions .btn { flex: 1 1 100%; }
  .profile { text-align: center; --av: 108px; }
  .profile h2 { margin-top: .8rem; font-size: 2.1rem; }
  .profile p { margin: .8rem auto 1.2rem; }
  .profile .btn { width: 100%; margin-top: .6rem; }
  .profile .btn svg { width: 22px; height: 22px; }
  .sheet-close { display: block; margin: .8rem auto 0; }

  /* ---------- footer ---------- */
  .site-footer { padding: 1.2rem 0 1.4rem; }
  .foot { gap: 1rem; }
  .foot > img { width: 120px; }
  .foot-hello h2 { font-size: 2.2rem; }
  .foot-links { margin-top: .8rem; }
  .foot-links a:not(.btn) { padding: .55rem .95rem; font-size: .95rem; }
}

/* ---------- app components: compact, tap to open ---------- */
@media (max-width: 860px) {
  /* title bars instead of text headers */
  .band.page-head { padding: .2rem 0 .7rem; }
  .page-head h1 { font-size: 2.2rem; }
  .page-head .lede { display: none; }
  [data-page="home"] .band-head p { display: none; }
  .band { padding: 1.7rem 0; }

  /* closing prompts become one tidy card */
  .band:not(.band-brown):not(.band-red) > .promise { background: #fbf9f4; border: 2px solid var(--ink); border-radius: 18px; padding: 1.1rem 1.2rem; gap: .5rem; }
  .band:not(.band-brown):not(.band-red) > .promise h2 { font-size: 1.5rem; }
  .band:not(.band-brown):not(.band-red) > .promise p { font-size: .97rem; margin-bottom: .6rem; }
  .band:not(.band-brown):not(.band-red) > .promise .btn-row { margin-top: .4rem; }
  .band-beige:has(> .promise) { background: var(--paper); }

  /* event rows */
  .m-events { display: grid; gap: .7rem; }
  #home-events, #upcoming, #past, #year-tabs { display: none; }
  .ev-row { display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: center; width: 100%; text-align: left; background: #fbf9f4; border: 2px solid var(--ink); border-radius: 18px; padding: .65rem .9rem .65rem .65rem; font: inherit; color: var(--ink); cursor: pointer; }
  .ev-date { display: grid; place-items: center; align-content: center; flex: none; width: 54px; height: 58px; border-radius: 13px; background: var(--red); color: var(--paper); font: 800 .72rem/1.15 var(--font-body); }
  .ev-date b { font: 400 1.35rem/1 var(--font-accent); }
  .ev-date.tbd b { font-size: .78rem; }
  .ev-row.past .ev-date { background: var(--beige); color: var(--ink); }
  .ev-main { display: grid; min-width: 0; }
  .ev-main strong { font-weight: 800; font-size: 1rem; line-height: 1.2; }
  .ev-main span { font-size: .85rem; color: var(--olive); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ev-main em { font-style: normal; font-size: .78rem; font-weight: 800; color: var(--red); }
  .ev-price { font: 400 1.05rem var(--font-accent); }
  .ev-year { font: 400 1rem var(--font-accent); color: var(--red); margin: .6rem 0 0; }
  .ev-feature { display: grid; gap: .3rem; width: 100%; text-align: left; background: var(--red); color: var(--paper); border: 2px solid var(--ink); border-radius: 22px; box-shadow: var(--sticker); padding: 1.1rem 1.2rem 1.2rem; margin-bottom: .5rem; font: inherit; cursor: pointer; }
  .ev-feature small { font-weight: 800; font-size: .8rem; }
  .ev-feature strong { font: 400 1.9rem/1.05 var(--font-title); }
  .ev-feature > span { font-size: .95rem; }
  .ev-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .7rem; }
  .ev-foot b { font: 400 1.5rem var(--font-accent); }
  .pill { background: var(--paper); color: var(--red); border: 2px solid var(--ink); border-radius: 999px; padding: .6rem 1.1rem; font-weight: 800; font-size: .92rem; }
  .ev-sheet .ev-date { width: 64px; height: 68px; }
  .ev-sheet h2 { margin: .8rem 0 .4rem; font-size: 2rem; }
  .ev-sheet p { margin: .8rem 0 1.2rem; }
  .ev-sheet .btn { width: 100%; }
  .ev-spots { text-align: center; margin-top: .6rem; }
  .read h2 { font-size: 2rem; }
  .read p { margin: .7rem 0 .4rem; font-size: 1.05rem; }

  /* home */
  .hero { padding: .4rem 0 1.4rem; }
  .hero .btn-row { display: none; }
  .hero-grid { gap: 1rem; }
  .cols > * { flex-basis: 74%; }
  .cols > div { padding: .95rem 1.05rem; }
  .cols p { font-size: .95rem; line-height: 1.45; }
  .band-brown .promise ul { display: none; }
  .band-brown .promise { gap: 1rem; }
  .band-brown .promise p { font-size: .98rem; margin-bottom: 0; }
  .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tile { min-height: 74px; text-align: left; background: rgba(255,255,255,.35); color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; padding: .7rem .85rem; font: 800 .98rem/1.2 var(--font-body); cursor: pointer; }
  #home-notes > * { flex-basis: 72%; }
  #home-notes .note { padding: .9rem 1rem; }
  #home-notes .note p { font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ring-list { display: none; }
  #home-circle.all-soon::after { content: "the first faces are coming soon" !important; }
  #home-circle::after { content: "tap a face to say hello"; display: block; text-align: center; font-weight: 600; font-size: .9rem; color: var(--olive); margin-top: .6rem; }
  .follow { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .follow-card { flex-direction: column; gap: .5rem; text-align: center; padding: 1rem .5rem; border-radius: 18px; }
  .follow-card .ico { width: 52px; height: 52px; }
  .follow-card > span:last-child { font-size: 0; }
  .follow-card strong { font-size: .8rem; }
  .band-red .promise { gap: 1.6rem; }
  .band-red .promise p:not(#join-done) { display: none; }
  .band-red .promise h2 { font-size: 1.7rem; margin-bottom: .8rem; }
  .form-inline { flex-wrap: nowrap; gap: .5rem; }
  .form-inline input { flex: 1 1 auto; min-width: 0; border-radius: 999px; }
  .form-inline .btn { flex: none; padding: .8rem 1.1rem; }
  .band-red .promise .btn-row { margin-top: 0; }

  /* creators */
  [data-page="creators"] main > .band:not(.page-head) { padding-top: 1.1rem; }
  [data-page="creators"] .band-head { display: none; }
  #circle-all.all-soon::after { content: "the first faces are coming soon" !important; }
  #circle-all::after { content: "tap a face to say hello"; display: block; text-align: center; font-weight: 600; font-size: .9rem; color: var(--olive); margin-top: .4rem; }
  .circle-tools { position: sticky; top: 56px; z-index: 900; display: block; background: var(--beige); margin: 0 -1.25rem 1.2rem; padding: .6rem 1.25rem; }
  .circle-tools p { display: none; }
  #kind-chips { display: grid; grid-template-columns: auto auto 1fr; gap: .4rem; }
  #kind-chips .chip { padding: .6rem .5rem; font-weight: 800; font-size: .88rem; }

  /* footer */
  .foot > img { display: none; }
  .foot-hello h2 { font-size: 1.9rem; }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  dialog[open] { animation: none; }
  .map-sheet { transition: none; }
}
