/* Instagram-style feed: profile header, fixed 3-column square grid, tap a post for a product sheet. */
.instagram-page { max-width: 935px; padding-bottom: 48px; }
.ig-profile { display: grid; grid-template-columns: auto 1fr; gap: 14px 20px; align-items: center; padding: 28px 0 20px; }
.ig-avatar { width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: #fff; object-fit: contain; }
.ig-id h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2.4rem); line-height: 1.05; }
.ig-handle { margin: 2px 0 8px; color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.ig-stats { display: flex; gap: 18px; font-size: 0.9rem; }
.ig-stats b { font-family: var(--mono); font-weight: 500; }
.ig-bio { grid-column: 1 / -1; margin: 0; max-width: 52ch; }
.ig-follow { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--cobalt); color: #fff; font-weight: 600; }
.ig-follow:hover { background: #151ab0; }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line); padding-top: 4px; margin-bottom: 28px; }
.ig-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--line); }
.ig-tile img { transition: transform 200ms cubic-bezier(.2,.8,.2,1); }
.ig-tile-label { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(20,20,58,.75)); color: #fff; font-weight: 600; font-size: 0.85rem; line-height: 1.25; opacity: 0; transition: opacity 200ms; }
.ig-tile:hover img { transform: scale(1.03); }
.ig-tile:hover .ig-tile-label, .ig-tile:focus-visible .ig-tile-label { opacity: 1; }
.ig-tile:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.ig-tag { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-size: 0.72rem; font-weight: 700; }
.ig-broken img { display: none; }
.ig-broken .ig-tile-label { opacity: 1; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; background: var(--lilac); color: var(--ink); }
.ig-empty { padding: 48px 20px; border: 2px dashed var(--line); border-radius: 20px; text-align: center; }
.ig-empty a { color: var(--cobalt); text-decoration: underline; }

.ig-sheet { width: min(760px, 100% - 32px); max-height: calc(100% - 32px); padding: 0; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 3px 3px 0 var(--ink); background: var(--paper); color: var(--ink); overflow: auto; }
.ig-sheet::backdrop { background: rgba(20,20,58,.55); }
.ig-sheet-inner { display: grid; grid-template-columns: 1fr 1fr; }
.ig-sheet-photo { aspect-ratio: 1; height: auto; }
.ig-sheet-body { display: flex; flex-direction: column; gap: 12px; padding: 28px 24px 24px; }
.ig-sheet-body h2 { font-family: var(--display); margin: 0 32px 0 0; font-size: 1.5rem; line-height: 1.15; font-weight: 800; }
.ig-sheet-kicker { margin: 0; color: var(--muted); font-size: 0.85rem; }
.ig-product { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ig-product img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 10px; }
.ig-product p { margin: 0; }
.ig-product-name { font-weight: 600; line-height: 1.3; }
.ig-product-meta { color: var(--muted); font-size: 0.85rem; }
.ig-cta { margin-top: auto; display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--cobalt); color: #fff; font-weight: 600; }
.ig-cta:hover { background: #151ab0; }
.ig-cta:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.ig-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.ig-close:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }

@media (max-width: 599px) {
  .ig-profile { grid-template-columns: auto 1fr; gap: 12px 16px; padding-top: 20px; }
  .ig-avatar { width: 72px; height: 72px; }
  .ig-follow { justify-self: stretch; justify-content: center; }
  .ig-grid { gap: 2px; margin-inline: -16px; }
  .ig-tile-label { display: none; }
  .ig-broken .ig-tile-label { display: flex; font-size: 0.7rem; }
  .ig-tag { top: 5px; right: 5px; font-size: 0.62rem; padding: 1px 6px; }
  .ig-sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 20px 20px 0 0; border-bottom: 0; box-shadow: none; }
  .ig-sheet-inner { grid-template-columns: 1fr; }
  .ig-sheet-photo { max-height: 42dvh; object-fit: cover; }
  .ig-sheet-body { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .ig-tile img, .ig-tile-label { transition: none; } }
.ig-tile { width: 100%; padding: 0; border: 0; cursor: pointer; font: inherit; }
.ig-empty { display: grid; justify-items: center; gap: 10px; border-style: solid; background: #fff; }
.ig-empty img { width: 56px; height: 56px; }
.ig-empty h2 { margin: 0; font-size: 1.3rem; }
.ig-empty p { margin: 0; max-width: 40ch; }
.ig-empty .ig-cta { margin-top: 6px; text-decoration: none; color: #fff; }
