/* The contact card (public/card-view.js): /k/:token and the live previews in the panel and on "Popraw swoje dane".
   Everything sits under .kc, which is a size container: the card lays itself out by its own width (one column on a
   phone or in a preview, two columns from 760 px), never by the window's. --acc is the company's colour, --ink the
   same colour darkened for text (readable() in card-view.js). Light theme only. Fades .2s, sizes .3s, the entrance
   rises in order (--i) like the signature's elements. Fonts: public/fonts.css. */
.kc { --ease: cubic-bezier(.2, 0, 0, 1); --hair: rgba(0, 0, 0, .08); --hair-2: rgba(0, 0, 0, .14); --muted: #6e6e73;
  --tint: color-mix(in srgb, var(--acc) 11%, #fff); --tint-2: color-mix(in srgb, var(--acc) 19%, #fff);
  container-type: inline-size; color: #1d1d1f; font: 16px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; text-align: left; -webkit-font-smoothing: antialiased; }
.kc *, .kc *::before, .kc *::after { box-sizing: border-box; }
.kc a { -webkit-tap-highlight-color: transparent; }
.kc :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.kc svg { display: block; }

/* ---------- who: the cover in the company's colour, the logo, the photo, the name ---------- */
.kc-card { position: relative; }
.kc-id { position: relative; display: grid; justify-items: center; text-align: center; padding: 0 20px 4px; isolation: isolate; }
.kc-cover { position: absolute; inset: 0 0 auto; z-index: -1; height: 168px;
  background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--acc) 30%, #fff) 0%, transparent 62%),
    radial-gradient(80% 110% at 100% 10%, color-mix(in srgb, var(--acc) 18%, #fff) 0%, transparent 70%), color-mix(in srgb, var(--acc) 7%, #fff);
  -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }
.kc-brand { margin-top: 20px; display: inline-flex; align-items: center; height: 40px; max-width: 100%; padding: 0 14px; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 .5px var(--hair-2), 0 6px 16px -10px rgba(0, 0, 0, .3); }
.kc-brand.kc-tile { background: var(--tile); } /* a white logo (card-view.js logoLight) on the brand colour or near-black */
.kc-logo { display: block; height: 24px; width: auto; max-width: 160px; object-fit: contain; }
.kc-firm { font-size: .875rem; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.kc-avatar { position: relative; width: 112px; height: 112px; margin-top: 24px; }
.kc-cover + .kc-avatar { margin-top: 44px; } /* no logo chip: the photo takes its place */
.kc-ring { position: absolute; inset: -7px; border-radius: 50%; background: conic-gradient(from 0deg, var(--acc), color-mix(in srgb, var(--acc) 22%, #fff), var(--acc) 55%, color-mix(in srgb, var(--acc) 40%, #fff), var(--acc));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.kc-photo { position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 14px 30px -12px color-mix(in srgb, var(--acc) 60%, transparent); }
.kc-initials { background: var(--ink); color: #fff; font-size: 2.5rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.kc-name { margin: 18px 0 0; max-width: 100%; font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; text-wrap: balance; }
.kc-sub { margin: 6px 0 0; display: grid; gap: 2px; max-width: 100%; overflow-wrap: anywhere; text-wrap: balance; }
.kc-role { color: var(--muted); }
.kc-company { color: var(--ink); font-size: .9375rem; font-weight: 500; }

/* ---------- one tap: call, write, website, map; then "Zapisz kontakt" (the shared gradient, public/cta.css) ---------- */
.kc-quick { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 80px)); justify-content: center; gap: 6px; width: 100%; margin-top: 22px; }
.kc-q { display: grid; justify-items: center; gap: 6px; padding: 4px 0; border-radius: 16px; color: inherit; text-decoration: none; font-size: .8125rem; font-weight: 500; line-height: 1.3; min-width: 0; }
.kc-q > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-qi { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--tint); color: var(--ink); transition: background-color .2s ease, transform .15s var(--ease); }
.kc-qi svg { width: 22px; height: 22px; }
.kc-q:hover .kc-qi { background: var(--tint-2); }
.kc-q:active .kc-qi { transform: scale(.92); }
.kc .btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 360px; height: 52px; margin-top: 20px; padding: 0 20px; border: 0; border-radius: 14px;
  background: var(--ink); color: #fff; font: 600 1rem/1 inherit; text-decoration: none; cursor: pointer; }
.kc .btn svg { width: 20px; height: 20px; flex: none; }
.kc .btn:active { transform: scale(.98); }

/* ---------- the details: a grouped list, then the social profiles ---------- */
.kc-more { display: grid; gap: 16px; padding: 24px 16px 0; }
.kc-list { list-style: none; margin: 0; padding: 4px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 .5px var(--hair-2); }
.kc-list li { position: relative; display: flex; align-items: center; }
.kc-list li + li::before { content: ""; position: absolute; left: 62px; right: 12px; top: 0; height: .5px; background: var(--hair-2); }
.kc-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border-radius: 14px; color: inherit; text-decoration: none; transition: background-color .2s ease; }
.kc-row:hover { background: #f6f6f7; }
.kc-ri { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--tint); color: var(--ink); }
.kc-ri svg { width: 18px; height: 18px; }
.kc-rt { display: grid; min-width: 0; line-height: 1.35; }
.kc-rt small { font-size: .8125rem; color: var(--muted); }
.kc-rt span { font-size: .96875rem; overflow-wrap: anywhere; }
.kc-go { margin-left: auto; flex: none; color: #a1a1a6; }
.kc-go svg { width: 16px; height: 16px; }
.kc-copy { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin-right: 4px; border: 0; border-radius: 12px; background: none; color: #8a8a8e; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.kc-copy svg { width: 18px; height: 18px; }
.kc-copy:hover { background: #f2f2f4; color: #1d1d1f; }
.kc-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.kc-social a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 8px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 .5px var(--hair-2);
  color: inherit; text-decoration: none; font-size: .875rem; font-weight: 500; transition: background-color .2s ease; }
.kc-social a:hover { background: #f6f6f7; }
.kc-social i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--ink); }
.kc-social i svg { width: 14px; height: 14px; }
.kc-social i[data-k="site"] { overflow: hidden; } .kc-social i[data-k="site"] img { width: 100%; height: 100%; display: block; }

/* ---------- wide: one card, the person on the left, the details on the right ---------- */
@container (min-width: 760px) {
  .kc-card { display: grid; grid-template-columns: 380px minmax(0, 1fr); max-width: 900px; margin: 0 auto; border-radius: 28px; background: #fff; overflow: hidden;
    box-shadow: 0 0 0 .5px var(--hair-2), 0 48px 96px -48px rgba(0, 0, 0, .35); }
  .kc-card:not(:has(.kc-more)) { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .kc-id { padding: 0 32px 36px; }
  .kc-cover { height: 188px; }
  .kc-more { align-content: center; padding: 36px 36px 36px 28px; border-left: .5px solid var(--hair); background: #fbfbfc; }
  .kc-social { justify-content: flex-start; }
}

/* ---------- the entrance: the cover, then the photo, then the rest rising in order ---------- */
@keyframes kcRise { from { opacity: 0; transform: translateY(8px); } }
@keyframes kcPop { from { opacity: 0; transform: scale(.88); } }
@keyframes kcFade { from { opacity: 0; } }
@keyframes kcSpin { to { transform: rotate(360deg); } }
.kc:not(.kc-still) .kc-cover { animation: kcFade .6s ease both; }
.kc:not(.kc-still) .kc-avatar { animation: kcPop .5s var(--ease) .08s both; }
.kc:not(.kc-still) .kc-in { animation: kcRise .45s var(--ease) calc(.14s + var(--i) * 60ms) both; }
.kc-ring { animation: kcSpin 9.6s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .kc:not(.kc-still) .kc-avatar, .kc:not(.kc-still) .kc-in { animation-name: kcFade; }
  .kc-ring { animation: none; }
}

/* ---------- a preview (cardFrame in card-view.js): the card at its own width (--w), zoomed to the box (--k); a new card
   fades in over the old one, which leaves the flow so the frame can take the new height ---------- */
.kc-frame { position: relative; display: grid; width: 100%; max-width: 390px; margin: 0 auto; border-radius: 28px; overflow: hidden; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14), 0 24px 48px -32px rgba(0, 0, 0, .35); }
.kc-frame > .kc-layer { grid-area: 1 / 1; min-width: 0; transition: opacity .2s ease; }
.kc-frame > .kc-layer.leaving { position: absolute; inset: 0 0 auto; opacity: 0; }
.kc-frame .kc { width: var(--w, 390px); padding-bottom: 24px; zoom: var(--k, 1); }

/* ---------- the page /k/:token ---------- */
.kc-page { margin: 0; background: #fff; }
.kc-page main { min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.kc-page .kc { flex: 1; }
/* An unpaid account's card (lib/ad.js): Footler's small line under the card, the page's only link to Footler */
.kc-strip { box-sizing: border-box; display: flex; align-items: center; gap: 10px; align-self: center; width: calc(100% - 32px); max-width: 440px; margin: 20px auto 0; padding: 12px 16px; border-radius: 14px; background: #f5f5f7;
  color: #1d1d1f; font: 500 .875rem/1.4 "Geist", system-ui, sans-serif; text-decoration: none; transition: background-color .2s ease; }
.kc-strip:hover { background: #ececf1; }
.kc-strip img { flex: none; display: block; border-radius: 4px; }
.kc-strip span { flex: 1; min-width: 0; }
.kc-strip svg { flex: none; color: #6e6e73; transition: transform .2s ease; }
.kc-strip:hover svg { transform: translateX(2px); }
.kc-foot { padding: 28px 16px max(24px, env(safe-area-inset-bottom)); text-align: center; font: 500 .8125rem/1.5 "Geist", system-ui, sans-serif; color: #6e6e73; }
.kc-foot > p { margin: 0; display: flex; justify-content: center; align-items: center; gap: 4px; }
.kc-foot a, .kc-own-open { display: inline-block; padding: 12px 6px; border: 0; background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer; transition: color .2s ease; }
.kc-foot a:hover, .kc-own-open:hover { color: #1d1d1f; }
.kc-foot [hidden] { display: none; } /* "Edytuj moje dane" only for the card's own people (lib/card.js) */
/* "Edytuj moje dane": a tiny inline form that opens under the line (height, then fade), then a sentence in its place */
.kc-own { display: grid; grid-template-rows: 0fr; opacity: 0; max-width: 360px; margin: 0 auto; transition: opacity .2s ease, grid-template-rows .3s ease .2s; }
.kc-own.open { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .3s ease, opacity .2s ease .25s; }
.kc-own > * { overflow: hidden; min-height: 0; }
.kc-own form { display: flex; gap: 8px; padding: 4px; }
.kc-own input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: #f2f2f4; color: #1d1d1f; font: 400 1rem "Geist", system-ui, sans-serif; }
.kc-own input:focus { outline: 2px solid #1d1d1f; outline-offset: 0; }
.kc-own .btn { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: #1d1d1f; color: #fff; font: 600 .875rem "Geist", system-ui, sans-serif; cursor: pointer; }
.kc-own .btn:disabled { opacity: .7; cursor: progress; }
.kc-own-in { transition: opacity .2s ease; }
.kc-own form.out { opacity: 0; }
.kc-own p.kc-own-in { margin: 0; padding: 8px 4px; color: #1d1d1f; animation: kcFade .25s ease both; }
.kc-toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 10; transform: translate(-50%, 12px); width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: #1d1d1f; color: #fff;
  font: 500 .875rem/1.4 "Geist", system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .25s cubic-bezier(.2, 0, 0, 1); }
.kc-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 760px) {
  .kc-page { background: radial-gradient(1100px 620px at 50% -12%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%), #f5f5f7; }
  .kc-page main { justify-content: center; padding: 48px 32px 0; }
  .kc-page .kc { flex: 0 0 auto; }
}
