/* SPCT — wspólny arkusz strony publicznej (bez Tailwind CDN, bez kroku budowania).
   Akcent miasta przychodzi z inline style: --accent-400/500/600 (palety Tailwind). */

@layer reset, tokens, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  ol, ul { padding: 0; list-style: none; }
  a { color: inherit; text-decoration: none; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    --accent-400: #a78bfa; --accent-500: #8b5cf6; --accent-600: #7c3aed;
    --bg: #070709;
    --fg: #f5f5f7;
    --fg-2: color-mix(in oklab, var(--fg) 72%, transparent);
    --fg-3: color-mix(in oklab, var(--fg) 45%, transparent);
    --fg-4: color-mix(in oklab, var(--fg) 25%, transparent);
    --line: color-mix(in oklab, var(--fg) 9%, transparent);
    --line-2: color-mix(in oklab, var(--fg) 16%, transparent);
    --surface: color-mix(in oklab, var(--fg) 3.5%, transparent);
    --surface-2: color-mix(in oklab, var(--fg) 6%, transparent);
    --field: rgb(0 0 0 / .38);
    --bar: rgb(0 0 0 / .32);
    --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 24px 60px -24px rgb(0 0 0 / .7);
    --ok: #4ade80; --err: #f87171; --warn: #facc15;
    --radius: 24px; --radius-sm: 14px;
    --wrap: 48rem;
    --gutter: clamp(16px, 4vw, 24px);
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color-scheme: dark;
  }
  :root[data-scheme="light"] {
    --bg: #f4f4f6;
    --fg: #121216;
    --surface: rgb(255 255 255 / .62);
    --surface-2: rgb(255 255 255 / .8);
    --field: rgb(255 255 255 / .75);
    --bar: rgb(255 255 255 / .55);
    --line: rgb(0 0 0 / .07);
    --line-2: rgb(0 0 0 / .13);
    --shadow: 0 20px 50px -24px rgb(20 20 40 / .25);
    color-scheme: light;
  }
}

@layer base {
  body {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    font-family: var(--font);
    font-size: 16px; line-height: 1.55;
    background: var(--bg); color: var(--fg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  ::selection { background: color-mix(in oklab, var(--accent-500) 40%, transparent); }
  :focus-visible { outline: 2px solid var(--accent-400); outline-offset: 2px; border-radius: 6px; }
  h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
  p { text-wrap: pretty; }
  input, textarea, select { font-size: 16px; } /* bez zoomu na iOS */
  .ico { width: 20px; height: 20px; flex: none; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
}

@layer components {
  .wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
  .main { flex: 1; padding-block: clamp(20px, 5vw, 40px) 48px; position: relative; z-index: 1; }

  /* Tło: "aurora" w kolorze miasta albo zdjęcie */
  .aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .aurora i { position: absolute; border-radius: 50%; filter: blur(clamp(70px, 12vw, 150px)); opacity: .55; }
  .aurora i:first-child { width: 65vmax; height: 65vmax; left: -18vmax; top: -22vmax; background: color-mix(in oklab, var(--accent-600) 40%, transparent); animation: drift 22s ease-in-out infinite alternate; }
  .aurora i:last-child { width: 55vmax; height: 55vmax; right: -16vmax; bottom: -20vmax; background: color-mix(in oklab, var(--accent-600) 26%, #000); animation: drift 26s ease-in-out infinite alternate-reverse; }
  [data-scheme="light"] .aurora i { opacity: .35; }
  @keyframes drift { to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }
  .bg-photo { position: fixed; inset: 0; z-index: 0; background: linear-gradient(to bottom, rgb(5 5 5 / .5), rgb(5 5 5 / .94)), var(--bg-image) center / cover no-repeat; }

  /* Nagłówek + zakładki */
  .chrome { position: sticky; top: 0; z-index: 20; }
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--bar); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
  .chrome .topbar { position: static; }
  .topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
  .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.125rem; letter-spacing: -.04em; }
  .brand-lg { font-size: 1.25rem; }
  .logo { width: 28px; height: 28px; fill: currentColor; flex: none; }
  .logo-xl { width: 56px; height: 56px; margin-inline: auto; }
  .eyebrow { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); text-align: right; }

  .tabs { background: color-mix(in oklab, var(--bar) 120%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
  .tabs-inner { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 10px; scroll-snap-type: x proximity; }
  .tabs-inner::-webkit-scrollbar { display: none; }
  .tabs a { display: block; white-space: nowrap; padding: 6px 16px; border-radius: 999px; font-size: .875rem; font-weight: 500; color: var(--fg-3); border: 1px solid transparent; transition: color .2s, background .2s; scroll-snap-align: start; }
  .tabs a:hover { color: var(--fg); }
  .tabs a[aria-current="page"] { color: var(--fg); background: var(--surface-2); border-color: var(--line-2); }

  /* Karty */
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .panel { padding: clamp(18px, 4.5vw, 32px); }

  /* Przyciski */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: .9375rem; line-height: 1; transition: transform .15s, filter .2s, background .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
  .btn:active { transform: scale(.97); }
  .btn:disabled { opacity: .45; pointer-events: none; }
  .btn .ico { width: 18px; height: 18px; }
  .btn-accent { color: #fff; background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); box-shadow: 0 10px 30px -10px color-mix(in oklab, var(--accent-500) 70%, transparent); }
  .btn-accent:hover { filter: brightness(1.08); }
  .btn-ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--fg); }
  .btn-ghost:hover { background: color-mix(in oklab, var(--fg) 10%, transparent); }
  .btn-danger { background: #dc2626; color: #fff; }
  .btn-danger:hover { background: #b91c1c; }
  .btn-danger-ghost { color: #fca5a5; border-color: rgb(239 68 68 / .45); background: transparent; }
  .btn-danger-ghost:hover { background: rgb(239 68 68 / .1); }
  .btn-ig { color: #fff; background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); box-shadow: 0 10px 28px -12px rgb(220 39 67 / .7); }
  .btn-sm { min-height: 34px; padding: 6px 12px; font-size: .8125rem; border-radius: 10px; }
  .btn-block { width: 100%; }
  .icon-only { padding: 0; width: 44px; }

  /* Profil IG */
  .profile { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: background .2s, border-color .2s; }
  .profile:hover { background: var(--surface-2); border-color: color-mix(in oklab, var(--accent-400) 35%, transparent); }
  .avatar { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line-2); background: var(--surface-2); }
  .profile-text { display: grid; min-width: 0; }
  .profile-text strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile-text span { color: var(--fg-3); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile .btn-ig { grid-column: 1 / -1; }
  @container (min-width: 0) {}
  @media (min-width: 560px) {
    .profile { grid-template-columns: auto 1fr auto; padding-right: 16px; }
    .profile .btn-ig { grid-column: auto; }
  }

  /* Formularz spota */
  .composer { margin-top: 28px; border-radius: 20px; background: var(--field); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
  .composer:focus-within { border-color: color-mix(in oklab, var(--accent-400) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-500) 16%, transparent); }
  .composer textarea { display: block; width: 100%; min-height: 128px; max-height: 50dvh; padding: 18px; background: transparent; border: 0; outline: 0; resize: none; field-sizing: content; line-height: 1.6; }
  .composer textarea::placeholder { color: var(--fg-4); }
  .composer .cf-turnstile { padding: 0 14px 12px; }
  .composer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-top: 1px solid var(--line); background: var(--surface); }
  .anon { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--fg-3); }
  .anon .ico { width: 14px; height: 14px; }
  .counter { margin-left: auto; font-size: .75rem; color: var(--fg-4); font-variant-numeric: tabular-nums; }
  .counter.warn { color: var(--warn); }
  .composer-bar .btn { flex: none; }
  .composer:has(textarea:placeholder-shown) #sendButton { opacity: .45; }
  .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

  .status { margin-top: 14px; padding: 12px 16px; border-radius: 14px; font-size: .9rem; font-weight: 600; text-align: center; }
  .status.ok { color: var(--accent-400); background: color-mix(in oklab, var(--accent-500) 12%, transparent); border: 1px solid color-mix(in oklab, var(--accent-500) 30%, transparent); }
  .status.err { color: var(--err); background: rgb(248 113 113 / .1); border: 1px solid rgb(248 113 113 / .3); }

  /* Jak to działa + ostatnie */
  .section-label { font-size: .6875rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); margin: 44px 0 16px 4px; }
  .steps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: s; }
  .steps li { display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: linear-gradient(to bottom, var(--surface-2), transparent); border: 1px solid var(--line); }
  .steps b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: .875rem; color: var(--accent-400); background: color-mix(in oklab, var(--accent-500) 12%, transparent); border: 1px solid color-mix(in oklab, var(--accent-500) 32%, transparent); }
  .steps h3 { font-size: .9375rem; margin-bottom: 4px; }
  .steps p { font-size: .8125rem; color: var(--fg-3); line-height: 1.55; }
  .steps strong { color: var(--fg-2); }

  .posts { display: grid; gap: 10px; }
  .post { padding: 18px; border-radius: 18px; background: linear-gradient(to bottom, var(--surface-2), transparent); border: 1px solid var(--line); }
  .post p { white-space: pre-line; overflow-wrap: anywhere; font-size: .9375rem; }
  .post time { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); }
  .post time .ico { width: 12px; height: 12px; }
  .muted-box { padding: 24px; text-align: center; color: var(--fg-4); border: 1px dashed var(--line-2); border-radius: 18px; font-size: .875rem; }

  /* Podstrona */
  .prose h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 20px; }
  .prose-body { color: var(--fg-2); line-height: 1.8; overflow-wrap: anywhere; }
  .prose-body > * + * { margin-top: 1em; }
  .prose-body h2, .prose-body h3 { color: var(--fg); margin-top: 1.6em; }
  .prose-body a { color: var(--accent-400); text-decoration: underline; text-underline-offset: 3px; }
  .prose-body ul { list-style: disc; padding-left: 1.4em; }
  .prose-body ol { list-style: decimal; padding-left: 1.4em; }
  .prose-body img { border-radius: 14px; height: auto; }

  /* Wybór miasta */
  .hero { text-align: center; margin: 12px 0 36px; }
  .hero h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); font-weight: 900; letter-spacing: -.045em; }
  .hero p { margin-top: 8px; color: var(--fg-3); }
  .search-card { padding: clamp(16px, 4vw, 24px); margin-bottom: 36px; }
  .search-field { position: relative; display: block; }
  .search-field .ico { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--fg-4); pointer-events: none; transition: color .2s; }
  .search-field:focus-within .ico { color: var(--accent-400); }
  .search-field input { width: 100%; padding: 15px 16px 15px 48px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); outline: 0; transition: border-color .2s; }
  .search-field input:focus { border-color: color-mix(in oklab, var(--accent-400) 55%, transparent); }
  .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
  .chip-btn { padding: 6px 14px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--fg-3); background: var(--surface-2); border: 1px solid var(--line); transition: all .2s; }
  .chip-btn:hover { color: var(--accent-400); border-color: color-mix(in oklab, var(--accent-500) 35%, transparent); background: color-mix(in oklab, var(--accent-500) 10%, transparent); }
  .directory { display: grid; gap: 28px; }
  .group-letter { display: flex; align-items: center; gap: 14px; margin: 0 0 12px 6px; font-size: 1.25rem; color: var(--accent-400); }
  .group-letter::after { content: ''; flex: 1; height: 1px; background: var(--line); }
  .city-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
  .city-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); font-size: .9rem; font-weight: 500; transition: all .2s; }
  .city-item .ico { width: 16px; height: 16px; color: var(--accent-500); opacity: 0; translate: -6px 0; transition: all .2s; }
  .city-item:hover { color: var(--fg); background: color-mix(in oklab, var(--accent-500) 6%, transparent); border-color: color-mix(in oklab, var(--accent-500) 25%, transparent); }
  .city-item:hover .ico { opacity: 1; translate: 0 0; }
  .empty { display: grid; justify-items: center; gap: 14px; padding: 72px 0; color: var(--fg-3); font-size: .9rem; }
  .empty-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
  .empty-ico .ico { width: 28px; height: 28px; color: var(--fg-4); }

  /* Stopka */
  .site-footer { position: relative; z-index: 1; margin-top: auto; border-top: 1px solid var(--line); background: var(--bar); backdrop-filter: blur(10px); padding-bottom: env(safe-area-inset-bottom); }
  .footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding-block: 40px; }
  .footer-brand { display: grid; gap: 8px; }
  .footer-brand p { font-size: .75rem; color: var(--fg-4); }
  .footer-nav { display: flex; flex-wrap: wrap; gap: 14px 28px; }
  .footer-nav a { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); transition: color .2s; }
  .footer-nav a:hover { color: var(--accent-400); }
  @media (max-width: 560px) { .footer-inner { justify-content: center; text-align: center; } .footer-brand { justify-items: center; } .footer-nav { justify-content: center; } }

  /* 404 */
  .center-screen { flex: 1; display: grid; place-items: center; padding: 48px var(--gutter); position: relative; z-index: 1; }
  .notfound { padding: 40px 28px; text-align: center; display: grid; gap: 12px; max-width: 420px; width: 100%; }
  .notfound h1 { font-size: 1.75rem; }
  .notfound .btn { margin-top: 12px; }

  /* Czat */
  body.is-chat .main { display: flex; flex-direction: column; }
  .chat { flex: 1; display: flex; flex-direction: column; min-height: min(640px, calc(100dvh - 180px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
  .chat-view { flex: 1; display: flex; flex-direction: column; }
  .chat-view[data-view="searching"], .chat-view[data-view="ended"] { align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 32px 20px; }
  .chat-stats { font-size: .75rem; color: var(--fg-4); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
  .radar { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 28px; }
  .radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px solid color-mix(in oklab, var(--accent-500) 45%, transparent); animation: radar 2s linear infinite; }
  .radar span { width: 48px; height: 48px; border-radius: 50%; background: color-mix(in oklab, var(--accent-500) 20%, transparent); border: 1px solid color-mix(in oklab, var(--accent-500) 45%, transparent); }
  .radar i { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-400); animation: ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }
  @keyframes radar { 0% { transform: scale(.8); opacity: .6; } 70% { transform: scale(1.45); opacity: 0; } 100% { opacity: 0; } }
  @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
  .chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .chat-head strong { flex: 1; font-size: .9375rem; }
  .chat-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgb(74 222 128 / .15); }
  .chat-log { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
  .bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; animation: pop .18s ease-out; }
  .bubble time { margin-left: 8px; font-size: .625rem; opacity: .45; float: right; margin-top: 6px; }
  .bubble.me { align-self: flex-end; background: var(--fg); color: var(--bg); border-bottom-right-radius: 6px; }
  .bubble.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
  .bubble.sys { align-self: center; background: none; font-size: .75rem; color: var(--fg-4); }
  @keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
  .chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .chat-form input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); outline: 0; }
  .chat-form input:focus { border-color: color-mix(in oklab, var(--accent-400) 55%, transparent); }
  .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
  @media (max-width: 767px) {
    body.is-chat .chrome, body.is-chat .site-footer { display: none; }
    body.is-chat .main { padding: 0; max-width: none; height: 100dvh; }
    body.is-chat .chat { border-radius: 0; border: 0; min-height: 0; padding-top: env(safe-area-inset-top); }
  }
}

@layer utilities {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .muted { color: var(--fg-3); }
  .small { font-size: .8125rem; }
}

@view-transition { navigation: auto; }

/* ===== v2: wybór miasta, strona miasta ===== */
@layer components {
  .hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 5px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--line); }
  .hero p:last-child { max-width: 34rem; margin-inline: auto; }
  .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgb(74 222 128 / .6); animation: live 2s infinite; flex: none; }
  @keyframes live { 70% { box-shadow: 0 0 0 7px rgb(74 222 128 / 0); } 100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); } }

  .city-item { padding: 12px 14px; gap: 12px; justify-content: flex-start; }
  .city-avatar { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-500) 55%, transparent); }
  .city-text { display: grid; min-width: 0; flex: 1; }
  .city-text strong { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .city-text small { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--fg-3); }
  .city-item:hover { border-color: color-mix(in oklab, var(--accent-500) 40%, transparent); background: color-mix(in oklab, var(--accent-500) 8%, transparent); }
  .city-item .ico { color: var(--accent-400); }

  .home { display: grid; gap: 0; }
  .profile-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .profile-mini { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
  .profile-mini .avatar { width: 44px; height: 44px; border-radius: 14px; box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-500) 55%, transparent); }
  .profile-mini .profile-text strong { font-size: 1.05rem; }
  .profile-mini:hover strong { color: var(--accent-400); }
  .home .composer { margin-top: 0; }
  .home .composer textarea { min-height: 150px; font-size: 1.0625rem; }
  @media (max-width: 420px) { .profile-bar .btn-ig span, #sendButton span { display: none; } .profile-bar .btn-ig, #sendButton { padding-inline: 14px; } }

  .next-drop { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: color-mix(in oklab, var(--accent-500) 9%, transparent); border: 1px solid color-mix(in oklab, var(--accent-500) 24%, transparent); }
  .nd-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--accent-400); background: color-mix(in oklab, var(--accent-500) 16%, transparent); flex: none; }
  .nd-text { display: grid; }
  .nd-text b { font-size: 1rem; font-variant-numeric: tabular-nums; }
  .nd-text small { font-size: .8rem; color: var(--fg-3); }

  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; }
  .section-head .section-label { margin: 0 0 0 4px; }
  .see-all { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; font-weight: 600; color: var(--accent-400); }
  .see-all .ico { width: 16px; height: 16px; }

  /* Miniatury w stylu grafik z Instagrama */
  .ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
  .ig-tile { display: grid; gap: 6px; }
  .ig-img { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--post-bg) center / cover no-repeat, #111; container-type: inline-size; box-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 0 12px 30px -16px rgb(0 0 0 / .7); }
  .ig-box { position: absolute; left: 4%; right: 4%; top: 50%; translate: 0 -50%; padding: 6cqi 7cqi; border-radius: 4cqi; background: #000; color: #fff; }
  .ig-box p { font-size: clamp(11px, 6.2cqi, 15px); font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .ig-tile time { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; color: var(--fg-4); text-align: center; }

  .how { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 6px; }
  .how summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; cursor: pointer; list-style: none; font-size: .875rem; font-weight: 600; color: var(--fg-2); }
  .how summary::-webkit-details-marker { display: none; }
  .how summary .ico { width: 18px; height: 18px; transition: rotate .2s; }
  .how[open] summary .ico { rotate: 90deg; }
  .how .steps { margin-top: 8px; }

  .sent-anim { position: relative; height: 0; }
  .sent-anim .env { position: absolute; right: 24px; top: -40px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); animation: fly 1.1s cubic-bezier(.5, 0, .3, 1) forwards; }
  @keyframes fly { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { transform: translate(0, -10px) scale(1); opacity: 1; } 100% { transform: translate(120px, -260px) rotate(-20deg) scale(.4); opacity: 0; } }
}
@layer components {
  @media (max-width: 560px) {
    .ig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .section-head .section-label { white-space: nowrap; letter-spacing: .14em; }
    .see-all { white-space: nowrap; }
  }
}
@layer components {
  .ig-photo { display: block; background: var(--surface-2); }
  .ig-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
  .ig-photo:hover img { transform: scale(1.04); }
  .ig-badge { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 3px rgb(0 0 0 / .6)); }
  .ig-badge svg { width: 100%; height: 100%; }
}
@layer components {
  .ig-embed { width: 100%; max-width: 540px; margin-inline: auto; container-type: inline-size; }
  /* Embed profilu IG nie zgłasza wysokości — liczymy ją: nagłówek (~150px) + 2 rzędy po 3 kwadraty */
  .ig-embed iframe { height: calc(66.7cqi + 160px) !important; }
  .ig-embed .instagram-media, .ig-embed iframe { width: 100% !important; max-width: 540px !important; min-width: 0 !important; margin: 0 auto !important; border-radius: 18px !important; border: 1px solid var(--line) !important; box-shadow: none !important; }
  .ig-embed blockquote.instagram-media { padding: 28px; text-align: center; background: var(--surface-2) !important; }
  .ig-embed blockquote a { color: var(--accent-400); font-weight: 600; }
}
