/* ───────────────────────────────────────────────────────────
   event-cloud — design tokens + components
   Warm white + écru, Hanken Grotesk, gallery-minimal
   ─────────────────────────────────────────────────────────── */

:root {
  --bg:        #FAF7F1;   /* warm white */
  --bg-2:      #F2ECE1;   /* écru surface */
  --card:      #FFFFFF;
  --card-2:    #FCFAF5;
  --ink:       #2A251E;   /* warm near-black */
  --ink-2:     #6B6356;   /* muted */
  --ink-3:     #9C9384;   /* faint */
  --line:      #E8E1D4;
  --line-2:    #F0EBE0;
  --accent:    #2A251E;   /* default = ink (set by tweaks) */
  --accent-ink:#FFFFFF;   /* text on accent */

  --r-card: 16px;
  --r-tile: 7px;
  --cols: 2;

  --font: 'Hanken Grotesk', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(42,37,30,.05), 0 2px 8px rgba(42,37,30,.04);
  --shadow-md: 0 6px 24px rgba(42,37,30,.10), 0 2px 6px rgba(42,37,30,.06);
  --shadow-lg: 0 18px 50px rgba(42,37,30,.18), 0 6px 16px rgba(42,37,30,.08);
}

/* ── stage / page ─────────────────────────────────────────── */
.ec-stage {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% -10%, #F3EDE2 0%, #EAE2D4 55%, #E2D8C7 100%);
  font-family: var(--font);
  overflow: hidden;
}
#scaler { transform-origin: center center; }

/* ── app root inside device ───────────────────────────────── */
.ec-app {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* obszar ekranu (nad przypiętą belką nawigacji) — tylko on się scrolluje */
.ec-app__body { flex: 1; min-height: 0; position: relative; }

.ec-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── top bar ──────────────────────────────────────────────── */
.ec-topbar {
  padding: 56px 20px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(var(--bg) 72%, rgba(250,247,241,0));
  position: relative;
  z-index: 6;
  flex-shrink: 0;
}
.ec-topbar__eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 5px;
}
.ec-topbar__title {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.05;
}
.ec-topbar__actions { display: flex; gap: 6px; align-items: center; }

/* ── scroll region ────────────────────────────────────────── */
.ec-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* scroll nie „przecieka" na stronę */
  padding: 4px 20px 24px;
}
.ec-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* ── icon button ──────────────────────────────────────────── */
.ec-iconbtn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: none; background: transparent;
  color: var(--ink); cursor: pointer;
  transition: background .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ec-iconbtn:hover { background: rgba(42,37,30,.05); }
.ec-iconbtn:active { transform: scale(.92); }
.ec-iconbtn--solid { background: var(--card); box-shadow: var(--shadow-sm); }
.ec-iconbtn--solid:hover { background: var(--card-2); }

/* ── buttons ──────────────────────────────────────────────── */
.ec-btn {
  font-family: var(--font);
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em;
  border: none; border-radius: 13px;
  padding: 13px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ec-btn:active { transform: scale(.975); }
.ec-btn--primary { background: var(--accent); color: var(--accent-ink); }
.ec-btn--primary:hover { filter: brightness(1.08); }
.ec-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ec-btn--ghost:hover { background: rgba(42,37,30,.04); }
.ec-btn--soft { background: var(--bg-2); color: var(--ink); }
.ec-btn--soft:hover { background: #EAE2D3; }
.ec-btn--block { width: 100%; }
.ec-btn--lg { padding: 15px 22px; font-size: 16px; border-radius: 15px; }
.ec-btn--danger { background: #C0533F; color: #fff; }
.ec-btn--danger:hover { filter: brightness(1.06); }

/* ── modal potwierdzenia ──────────────────────────────────── */
.ec-modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(28,22,16,.42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 26px;
  animation: fade .15s ease;
}
.ec-confirm {
  width: 100%; max-width: 320px; background: var(--card);
  border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg);
  animation: barUp .2s cubic-bezier(.2,.8,.2,1);
}
.ec-confirm h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.ec-confirm p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.45; }
.ec-confirm__btns { display: flex; gap: 8px; }
.ec-confirm__btns .ec-btn { flex: 1; }

/* ── chips ────────────────────────────────────────────────── */
.ec-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; letter-spacing: -0.01em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
}
.ec-chip--glass {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); box-shadow: var(--shadow-sm);
}
.ec-chip--dark {
  background: rgba(28,24,18,.62); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ── segmented control ────────────────────────────────────── */
.ec-segment {
  display: inline-flex; background: var(--bg-2);
  border-radius: 11px; padding: 3px; gap: 2px;
}
.ec-segment button {
  font-family: var(--font); font-size: 13px; font-weight: 500;
  border: none; background: transparent; color: var(--ink-2);
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.ec-segment button.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.ec-segment button:disabled { cursor: default; }
.ec-segment--full { display: flex; width: 100%; }
.ec-segment--full button { flex: 1; }

/* ── catalog grid (list screen) ───────────────────────────── */
.ec-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ec-cat-card { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ec-cat-cover {
  position: relative; width: 100%; aspect-ratio: 4/5;
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ec-cat-card:active .ec-cat-cover { transform: scale(.98); }
.ec-cat-card:hover .ec-cat-cover { box-shadow: var(--shadow-md); }
.ec-cat-cover__lock {
  position: absolute; top: 10px; left: 10px; z-index: 2;
}
.ec-cat-cover__sel {
  position: absolute; top: 10px; right: 10px; z-index: 3;
}
.ec-cat-meta { padding: 10px 2px 0; }
.ec-cat-title { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.ec-cat-sub {
  font-size: 12px; color: var(--ink-3); margin: 3px 0 0;
  display: flex; align-items: center; gap: 6px;
}
.ec-cat-card.is-selected .ec-cat-cover {
  outline: 2.5px solid var(--accent); outline-offset: 2px;
}

/* private catalog tint */
.ec-cat-card.is-private .ec-cat-cover { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

/* ── locked (password) catalog ────────────────────────────── */
.ec-cat-cover.is-locked .ec-ph { filter: blur(15px) saturate(.78) brightness(1.04); transform: scale(1.18); }
.ec-locked-veil {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  background: rgba(247,243,236,.5);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  text-align: center; padding: 0 14px;
}
.ec-locked-badge {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.ec-locked-veil span {
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
}

/* unlock sheet hero */
.ec-unlock-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 24px 8px;
}
.ec-unlock-ic {
  width: 64px; height: 64px; border-radius: 20px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink); margin-bottom: 16px;
}
.ec-unlock-hero h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.ec-unlock-hero p { font-size: 13.5px; color: var(--ink-2); margin: 7px 0 0; max-width: 28ch; line-height: 1.45; }
.ec-input.is-error { border-color: #C0533F; box-shadow: 0 0 0 3px rgba(192,83,63,.12); }
.shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); }
}
.ec-hint {
  font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 12px;
}
.ec-hint code { font-family: var(--mono); color: var(--ink-2); background: var(--bg-2); padding: 2px 6px; border-radius: 5px; }

/* permission note in catalog header */
.ec-perm {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2); background: var(--bg-2);
  padding: 7px 12px; border-radius: 999px; margin: 0 2px 14px;
}

/* ── placeholder photo ────────────────────────────────────── */
.ec-ph {
  position: relative; width: 100%; height: 100%;
  background: var(--ph-base, #D8CFC0);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ec-ph::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.05)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 9px, rgba(0,0,0,.025) 9px 18px);
}
.ec-ph__tag {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em;
  color: rgba(42,37,30,.34);
}
.ec-ph__play {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.85); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}

/* ── masonry gallery ──────────────────────────────────────── */
.ec-masonry { column-count: var(--cols); column-gap: 8px; }
.ec-tile {
  position: relative; break-inside: avoid; margin-bottom: 8px;
  border-radius: var(--r-tile); overflow: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease;
}
.ec-tile:active { transform: scale(.985); }
.ec-tile__media { position: relative; width: 100%; }
.ec-tile__vid {
  position: absolute; bottom: 7px; left: 7px; z-index: 2;
}
.ec-tile__check {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  opacity: 0; transform: scale(.7); transition: all .14s ease;
}
.ec-masonry.is-selecting .ec-tile__check { opacity: 1; transform: scale(1); }
.ec-tile.is-selected { }
.ec-tile.is-selected .ec-tile__media::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(42,37,30,.28); border-radius: var(--r-tile);
}
.ec-tile.is-selected { outline: 3px solid var(--accent); outline-offset: -3px; }

/* checkbox bubble */
.ec-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92);
  background: rgba(42,37,30,.18);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ec-check.is-on { background: var(--accent); border-color: var(--accent); }

/* ── bottom nav ───────────────────────────────────────────── */
.ec-bottomnav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 22px max(14px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line-2);
  position: relative; z-index: 8;
}
.ec-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-3); font-family: var(--font);
  font-size: 10px; font-weight: 500; letter-spacing: .01em;
  padding: 6px 10px; -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}
.ec-nav-item.is-active { color: var(--ink); }
.ec-nav-add {
  width: 52px; height: 52px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; box-shadow: var(--shadow-md);
  transition: transform .14s ease; margin-top: -6px;
}
.ec-nav-add:active { transform: scale(.92); }

/* ── bulk action bar ──────────────────────────────────────── */
.ec-actionbar {
  position: absolute; left: 14px; right: 14px; bottom: 26px; z-index: 30;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 10px 10px 12px;
  animation: barUp .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes barUp { from { transform: translateY(18px); } to { transform: none; } }
.ec-actionbar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px 9px;
}
.ec-actionbar__count { font-size: 13px; font-weight: 600; }
.ec-actionbar__row { display: flex; gap: 4px; }
.ec-act {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: none; background: transparent; cursor: pointer;
  color: var(--ink); font-family: var(--font); font-size: 11px; font-weight: 500;
  padding: 8px 2px; border-radius: 12px; transition: background .14s ease;
  -webkit-tap-highlight-color: transparent;
}
.ec-act:hover { background: rgba(42,37,30,.05); }
.ec-act--danger { color: #A23E33; }
.ec-act__ic {
  width: 38px; height: 38px; border-radius: 12px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
}
.ec-act--danger .ec-act__ic { background: #F6E7E3; }

/* ── lightbox ─────────────────────────────────────────────── */
.ec-lb {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(247,243,236,.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  animation: fade .2s ease;
}
@keyframes fade { from { transform: scale(1.015); } to { transform: none; } }
/* scena wypełnia CAŁY lightbox; górny pasek i dolny panel to nakładki na zdjęciu */
.ec-lb__stage { position: absolute; inset: 0; overflow: hidden; }
.ec-lb__track { display: flex; height: 100%; width: 100%; will-change: transform; }
.ec-lb__slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px; box-sizing: border-box;
}
/* zdjęcie zajmuje maksimum miejsca, zawsze zachowując proporcje */
.ec-lb__imgwrap { position: relative; width: 100%; height: 100%; }
.ec-lb__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.ec-lb__img--thumb { filter: blur(8px); transform: scale(1.03); }   /* placeholder z miniatury */
.ec-lb__img--full  { transition: opacity .35s ease; }               /* oryginał wjeżdża płynnie */
.ec-lb__slide video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.ec-lb__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  padding: max(10px, env(safe-area-inset-top)) 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(rgba(247,243,236,.94), rgba(247,243,236,0));
  transition: opacity .2s ease;
}
.ec-lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; z-index: 3;
}
.ec-lb__nav--prev { left: 6px; }
.ec-lb__nav--next { right: 6px; }
.ec-lb__info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 26px 16px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(247,243,236,0), rgba(247,243,236,.92) 42%);
  transition: opacity .2s ease;
}
.ec-lb.is-bare .ec-lb__info,
.ec-lb.is-bare .ec-lb__top,
.ec-lb.is-bare .ec-lb__nav { opacity: 0; pointer-events: none; }
.ec-lb__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ec-lb__by { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-lb__date { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.ec-lb__acts { display: flex; gap: 8px; margin-top: 10px; }
.ec-lb__act { flex: 1; padding: 10px 16px; font-size: 14px; }

/* ── login ────────────────────────────────────────────────── */
.ec-login { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.ec-login__hero { position: relative; flex-shrink: 0; }
.ec-login__hero image-slot { display: block; width: 100%; }
.ec-login__hero-cap {
  position: absolute; left: 22px; bottom: 20px; right: 22px; z-index: 2; color: #fff;
}
.ec-login__hero-grad {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(28,22,16,.32), transparent 26%, transparent 52%, rgba(28,22,16,.55));
}
.ec-login__body {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 26px 26px 30px; overflow-y: auto;
  overscroll-behavior: contain;   /* jedyny scroll na ekranie logowania */
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}
.ec-login__body.is-centered { justify-content: center; }
.ec-brand { display: flex; align-items: center; gap: 9px; }
.ec-brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.ec-brand__name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.ec-login h1 {
  font-size: 30px; font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.08; margin: 0 0 8px;
}
.ec-login p.lede { color: var(--ink-2); font-size: 15px; margin: 0 0 26px; max-width: 30ch; }

.ec-field { margin-bottom: 13px; }
.ec-field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin: 0 0 6px; letter-spacing: .005em;
}
.ec-input {
  width: 100%; box-sizing: border-box;
  /* 16px = klucz: iOS Safari NIE przybliża pola przy fokusie, gdy font ≥ 16px */
  font-family: var(--font); font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 14px 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ec-input::placeholder { color: var(--ink-3); }
.ec-input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(42,37,30,.06); }
.ec-textarea { resize: none; min-height: 130px; line-height: 1.5; display: block; }

/* ── generic sections / rows ──────────────────────────────── */
.ec-section-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 24px 2px 11px;
}
.ec-list { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden; }
.ec-row {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px; cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s ease;
}
.ec-row:hover { background: var(--card-2); }
.ec-row + .ec-row::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px;
  background: var(--line-2);
}
.ec-row__ic {
  width: 38px; height: 38px; border-radius: 11px; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink);
}
.ec-row__main { flex: 1; min-width: 0; }
.ec-row__t { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.ec-row__s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

/* ── profile ──────────────────────────────────────────────── */
.ec-prof-head { display: flex; align-items: center; gap: 15px; padding: 8px 2px 6px; }
.ec-avatar { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.ec-prof-name { font-size: 21px; font-weight: 600; letter-spacing: -0.025em; }
.ec-prof-role { font-size: 13px; color: var(--ink-2); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.ec-stats { display: flex; gap: 10px; margin: 18px 0 4px; }
.ec-stat { flex: 1; background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); }
.ec-stat__n { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.ec-stat__l { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ── upload ───────────────────────────────────────────────── */
.ec-sheet { position: absolute; inset: 0; z-index: 35; background: var(--bg); display: flex; flex-direction: column; animation: sheetUp .26s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(22px); } to { transform: none; } }
.ec-sheet__top {
  padding: 56px 18px 10px; display: flex; align-items: center; justify-content: space-between;
}
.ec-sheet__title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.ec-dropzone {
  border: 1.5px dashed var(--line); border-radius: 18px;
  background: var(--card-2); padding: 30px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.ec-dropzone:hover { border-color: var(--ink-3); background: var(--card); }
.ec-drop-ic { width: 50px; height: 50px; border-radius: 15px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; }
.ec-queue { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 14px; }
.ec-queue__item { aspect-ratio: 1; border-radius: 9px; overflow: hidden; position: relative; }

/* visibility toggle card */
.ec-vis { display: flex; gap: 9px; margin-top: 10px; }
.ec-vis__opt {
  flex: 1; border: 1px solid var(--line); border-radius: 14px; padding: 13px;
  cursor: pointer; background: var(--card); transition: all .15s ease;
}
.ec-vis__opt.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--card-2); }
.ec-vis__opt h4 { margin: 8px 0 3px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.ec-vis__opt p { margin: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }

/* ── toast ────────────────────────────────────────────────── */
.ec-toast {
  position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: #F6F1E8;
  font-size: 13px; font-weight: 500; padding: 11px 17px; border-radius: 999px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn .26s cubic-bezier(.2,.8,.2,1); white-space: nowrap;
}
@keyframes toastIn { from { transform: translate(-50%, 14px); } to { transform: translate(-50%, 0); } }

/* ── admin accents ────────────────────────────────────────── */
.ec-admin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--bg-2); padding: 4px 9px; border-radius: 999px;
}
.ec-quarantine .ec-row__ic { background: #F6E7E3; color: #A23E33; }

/* ── licznik / plakietka ──────────────────────────────────── */
.ec-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── wiadomości (skrzynka) — własny design ────────────────── */
.ec-msg {
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  padding: 14px 15px; margin-bottom: 12px;
}
.ec-msg.is-new { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--accent); }
.ec-msg__head { display: flex; align-items: center; gap: 11px; }
.ec-msg__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, #C9BBA6, #6E5B45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; letter-spacing: .02em;
}
.ec-msg__name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.ec-msg__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.ec-msg__tag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent); background: var(--bg-2); padding: 2px 8px; border-radius: 999px;
}
.ec-msg__tag.is-problem { color: #A23E33; background: #F6E7E3; }
.ec-msg__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.ec-msg__body { font-size: 14px; color: var(--ink); line-height: 1.5; margin: 11px 0 0; white-space: pre-wrap; word-break: break-word; }
.ec-msg__contact {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 11px;
  font-size: 13px; color: var(--ink); text-decoration: none;
  background: var(--bg-2); padding: 7px 12px; border-radius: 10px;
}
.ec-msg__contact:hover { background: #EAE2D3; }
.ec-msg__acts { display: flex; gap: 8px; margin-top: 12px; }

/* lista wiadomości (skrzynka, jak mail/messenger) */
.ec-msg-list { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden; }
.ec-msg-row {
  display: flex; gap: 12px; align-items: center; width: 100%;
  text-align: left; border: none; background: transparent; cursor: pointer;
  padding: 13px 15px; position: relative; font: inherit; color: var(--ink);
  -webkit-tap-highlight-color: transparent; transition: background .14s ease;
}
.ec-msg-row + .ec-msg-row::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--line-2); }
.ec-msg-row:hover { background: var(--card-2); }
.ec-msg-row.is-active { background: var(--bg-2); }
.ec-msg-row__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, #C9BBA6, #6E5B45); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.ec-msg-row__main { flex: 1; min-width: 0; }
.ec-msg-row__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ec-msg-row__name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-msg-row.is-new .ec-msg-row__name { font-weight: 700; }
.ec-msg-row__time { font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; }
.ec-msg-row__snip { display: flex; align-items: center; gap: 7px; margin-top: 3px; min-width: 0; }
.ec-msg-row__tag { flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--accent); background: var(--bg-2); padding: 1px 7px; border-radius: 999px; }
.ec-msg-row__tag.is-problem { color: #A23E33; background: #F6E7E3; }
.ec-msg-row__snip-text { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-msg-row.is-new .ec-msg-row__snip-text { color: var(--ink-2); }
.ec-msg-row__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* pełna treść wiadomości */
.ec-msg-detail { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 18px; }
.ec-msg-detail__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ec-msg-detail__body { font-size: 15px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

/* desktop: split lista | treść */
.ec-msg-split { display: flex; gap: 16px; align-items: flex-start; }
.ec-msg-split__list { width: 340px; flex-shrink: 0; max-height: 70vh; overflow-y: auto; }
.ec-msg-split__detail { flex: 1; min-width: 0; }

.ec-empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 13.5px; }

/* fade-in helper — transform only, so content is never stuck invisible */
.ec-fade { animation: scrIn .3s ease both; }
@keyframes scrIn { from { transform: translateY(7px); } to { transform: none; } }

/* cross-version switch (sits on the page background, outside the frame) */
.ec-versionswitch {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 200;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 12.5px; font-weight: 500; letter-spacing: -0.005em;
  color: #5C5446; text-decoration: none;
  background: rgba(255,255,255,.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6); border-radius: 999px; padding: 8px 15px;
  box-shadow: 0 4px 16px rgba(42,37,30,.1);
  transition: background .15s ease, transform .12s ease;
}
.ec-versionswitch:hover { background: rgba(255,255,255,.92); }
.ec-versionswitch:active { transform: translateX(-50%) scale(.96); }
