/* ─── Variables ───────────────────────────────────────────────────────────── */
:root {
  --toolbar-h: 48px;
  --panel-w: 380px;
  --accent: #A1D0C3;
  --accent-dark: #5a9e8f;
  /* Panel — light theme */
  --panel-bg: #f4f6f9;
  --panel-border: #e2e8f0;
  --panel-text: #1e293b;
  --panel-text-muted: #64748b;
  --panel-text-faint: #94a3b8;
  --panel-item-border: #eaecf0;
  --panel-input-bg: #ffffff;
  --panel-hover: rgba(0,0,0,.03);
  --toolbar-bg: #f2f4f7;
  --toolbar-border: #dde2ea;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 8px;
  --radius-sm: 5px;
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: #dde3ec; }
button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
dialog { padding: 0; border: none; background: white; }
/* Reset uniwersalny (*{margin:0}) wyżej nadpisywał domyślny `margin:auto`
   przeglądarki dla dialog:modal, który normalnie centruje okno — stąd modale
   lądowały przyklejone do lewego górnego rogu zamiast na środku ekranu. */
dialog[open] { margin: auto; }
dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }

/* ─── App layout ──────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: var(--toolbar-h) 1fr var(--toolbar-h);
  height: 100dvh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--toolbar-border);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: relative;
  z-index: 100;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.topbar__logo {
  height: 26px;
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}
body.catalog-mode .device-tabs,
body.catalog-mode #btn-refresh,
body.catalog-mode #btn-open,
body.catalog-mode #btn-export,
body.catalog-mode .url-dot,
body.catalog-mode .topbar__right .topbar__sep:first-of-type {
  display: none !important;
}
/* Wideo/audio nie mają wersji mobile/desktop — ukryj przełącznik urządzeń */
body.media-mode .device-tabs {
  display: none !important;
}

.topbar__sep {
  width: 1px;
  height: 20px;
  background: var(--toolbar-border);
  flex-shrink: 0;
}

/* Project select */
.topbar__project {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar__select {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 4px 22px 4px 6px;
  border-radius: var(--radius-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color .12s;
}
.topbar__select:hover { background-color: #f8fafc; }
.topbar__select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Page nav */
.topbar__nav { position: relative; }

.topbar__nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--toolbar-border);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color .12s, color .12s, background .12s;
}
.topbar__nav-btn:hover { border-color: #cbd5e1; color: var(--text); background: #f8fafc; }

.topbar__nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: white;
  border: 1px solid var(--toolbar-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 200;
  padding: 4px;
}

.nav-dropdown__item {
  display: block;
  width: 100%;
  padding: 7px 12px;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background .1s, color .1s;
}
.nav-dropdown__item:hover { background: #f1f5f9; color: var(--text); }
.nav-dropdown__item--active { color: var(--accent-dark); font-weight: 600; }

/* Device tabs — inline w topbar__left */
.device-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 2px;
}

.device-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.device-tab--active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.device-tab svg { opacity: .65; }
.device-tab--active svg { opacity: 1; }

/* Right icons */
.topbar__right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.url-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
  margin-right: 4px;
  transition: background .4s;
}
.url-dot.preview__url-dot--live { background: #22c55e; }

.topbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.topbar__icon-btn:hover { background: #f1f5f9; color: var(--text); }

.topbar__icon-btn--add {
  background: var(--accent);
  color: #0f2a22;
}
.topbar__icon-btn--add:hover { background: var(--accent-dark); color: white; }

.topbar__admin-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--toolbar-border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color .12s, color .12s, background .12s;
}
.topbar__admin-btn:hover { border-color: var(--accent-dark); color: var(--accent-dark); }
.admin-mode .topbar__admin-btn {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.storage-badge {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 7px;
  background: #f1f5f9;
  border-radius: 10px;
}

/* ══════════════════════════════════════════════════════════════════════════
   WORKSPACE
   ══════════════════════════════════════════════════════════════════════════ */
.workspace {
  position: relative;
  overflow: hidden;
  display: flex;
}

/* ─── Sliding panel — przesuwa preview (flex flow) ───────────────────────── */
.panel {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  transition: width .25s cubic-bezier(.4, 0, .2, 1);
}
.panel--open { width: var(--panel-w); }

.panel__inner {
  width: var(--panel-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
  background: var(--toolbar-bg);
}

.panel__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #60a5fa;
}

.panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--panel-text);
}

.panel__count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: rgba(90,158,143,.1);
  border-radius: 10px;
  padding: 1px 7px;
}

.panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--panel-text-faint);
  transition: background .12s, color .12s;
}
.panel__close:hover { background: #e9ecef; color: var(--panel-text); }

/* ─── Overlay — zachowany w DOM dla JS (nigdy nie pokazywany) ─────────────── */
.panel-overlay { display: none; }

/* ─── Feedback form ───────────────────────────────────────────────────────── */
.feedback-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
  background: white;
}

.feedback-form__textarea {
  width: 100%;
  background: var(--panel-input-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13px;
  color: var(--panel-text);
  resize: vertical;
  min-height: 80px;
  transition: border-color .15s;
  line-height: 1.5;
}
.feedback-form__textarea::placeholder { color: var(--panel-text-faint); }
.feedback-form__textarea:focus { outline: none; border-color: var(--accent-dark); }

.screenshot-zone {
  margin-top: 8px;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  padding: 8px 11px;
  font-size: 12px;
  color: var(--panel-text-faint);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.screenshot-zone__preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 5px;
  object-fit: contain;
}

.screenshot-zone__clear {
  background: none;
  border: none;
  color: var(--panel-text-faint);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  transition: background .1s, color .1s;
}
.screenshot-zone__clear:hover { background: #e9ecef; color: var(--panel-text); }

.feedback-form__footer {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

/* ─── Feedback list ───────────────────────────────────────────────────────── */
.feedback-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.feedback-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--panel-text-faint);
  font-size: 13px;
  font-style: italic;
}

.feedback-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--panel-item-border);
  transition: background .1s;
}
.feedback-item:last-child { border-bottom: none; }
.feedback-item:hover { background: var(--panel-hover); }

.feedback-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.status-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
}
.status--new    { background: #dbeafe; color: #2563eb; }
.status--todo   { background: #fef3c7; color: #d97706; }
.status--review { background: #ede9fe; color: #7c3aed; }
.status--done   { background: #d1fae5; color: #059669; }
.status--cancel { background: #f1f5f9; color: #64748b; }

.feedback-item__date {
  font-size: 11px;
  color: var(--panel-text-faint);
  flex-shrink: 0;
}

.feedback-item__context {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.ctx-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e9ecef;
  color: #64748b;
}
.ctx-badge--mobile  { background: #dbeafe; color: #2563eb; }
.ctx-badge--desktop { background: #d1fae5; color: #059669; }
.ctx-badge--jump {
  background: #fce7f3; color: #be185d; border: none; cursor: pointer;
  font-family: inherit; transition: background .12s;
}
.ctx-badge--jump:hover { background: #fbcfe8; }

.feedback-item__text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--panel-text);
  margin-bottom: 7px;
  word-break: break-word;
}

.feedback-item__screenshot {
  max-width: 100%;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  margin-bottom: 7px;
  transition: opacity .12s;
  max-height: 160px;
  object-fit: contain;
  display: block;
  border: 1px solid var(--panel-border);
}
.feedback-item__screenshot:hover { opacity: .85; }

.feedback-item__meta { margin-bottom: 4px; }

.feedback-item__issue {
  font-size: 11px;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color .1s;
}
.feedback-item__issue:hover { color: #2d6a5e; text-decoration: underline; }

.feedback-item__admin-actions {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  flex-wrap: wrap;
}

/* Admin action buttons — light panel overrides */
.feedback-item .btn--ghost {
  background: #f1f5f9;
  color: #64748b;
}
.feedback-item .btn--ghost:hover { background: #e2e8f0; color: var(--text); }
.feedback-item .btn--danger { background: #fee2e2; color: #dc2626; }
.feedback-item .btn--danger:hover { background: #fecaca; color: #991b1b; }

/* ─── Preview area ────────────────────────────────────────────────────────── */
.preview-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #dde3ec;
  display: flex;
  align-items: stretch;
}

.preview__frame {
  flex: 1;
  border: none;
  display: block;
  background: white;
}

.preview-area--mobile {
  justify-content: center;
}
.preview-area--mobile .preview__frame {
  flex: 0 0 430px;
  width: 430px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 20px 60px rgba(0,0,0,.2);
  border-radius: 14px 14px 10px 10px;
  margin: 10px 0;
}

/* ─── Media preview (wideo/audio) ─────────────────────────────────────────── */
.media-preview {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #14161a;
}
.media-preview__video {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #000;
  object-fit: contain;
}
.media-preview__audio {
  width: 100%;
  margin: auto;
  padding: 0 20px;
}
.media-preview--audio-only {
  justify-content: center;
  align-items: stretch;
}
.media-preview--audio-only .media-preview__audio {
  max-width: 640px;
  margin: 40px auto 20px;
}

/* YouTube/Vimeo — patrz js/media-adapter.js */
.media-preview__embed {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.media-preview__embed iframe,
.media-preview__embed > div {
  width: 100%;
  height: 100%;
}

.media-timeline {
  display: block;
  width: 100%;
  height: 45px;
  cursor: pointer;
  flex-shrink: 0;
}

.media-bubble-layer {
  position: absolute;
  inset: 0 0 45px 0; /* nad paskiem osi czasu, nie na nim */
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 24px;
}

.media-bubble {
  max-width: min(760px, 90%);
  background: #FFE066;
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  padding: 20px 28px;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,.4), 0 2px 0 rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  gap: 20px;
  transform: rotate(-1.2deg);
  animation: media-bubble-in .18s ease-out;
}
.media-bubble__thumb {
  width: 104px;
  height: 104px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0,0,0,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.media-bubble__text {
  min-width: 0;
  overflow-wrap: break-word;
}
@keyframes media-bubble-in {
  from { opacity: 0; transform: rotate(-1.2deg) translateY(6px); }
  to   { opacity: 1; transform: rotate(-1.2deg) translateY(0); }
}

.preview__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  z-index: 1;
}
.preview__empty-content {
  text-align: center;
  color: #94a3b8;
}
.preview__empty-icon {
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .35;
}

/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM BAR
   ══════════════════════════════════════════════════════════════════════════ */
.bottombar {
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 2px;
  background: var(--toolbar-bg);
  border-top: 1px solid var(--toolbar-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
}

.bottombar__spacer { flex: 1; }
.bottombar__sep {
  width: 1px;
  height: 20px;
  background: var(--toolbar-border);
  flex-shrink: 0;
  margin: 0 4px;
}

.status-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 14px;
  height: 100%;
  letter-spacing: .01em;
  transition: color .15s, border-color .15s, background .15s;
}
.status-tab:hover { color: var(--text); background: #f8fafc; }
.status-tab--active {
  color: var(--text);
  border-top-color: var(--accent-dark);
  background: rgba(90,158,143,.05);
}

.status-tab__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: .6;
}
.status-tab--active .status-tab__dot { opacity: 1; }
.status-tab__dot--new    { background: #60a5fa; }
.status-tab__dot--todo   { background: #f59e0b; }
.status-tab__dot--done   { background: #34d399; }
.status-tab__dot--cancel { background: #94a3b8; }
.status-tab__dot--wcag   { background: #8b5cf6; }

.status-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dark);
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  line-height: 1;
}
.status-tab__badge:empty { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 14px;
  transition: background .12s, opacity .12s, color .12s;
  white-space: nowrap;
}
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--primary { background: var(--accent); color: #0f2a22; }
.btn--primary:hover { background: var(--accent-dark); color: white; }
.btn--ghost {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.55);
}
.btn--ghost:hover { background: rgba(255,255,255,.12); color: white; }

/* .btn--ghost domyślnie liczy na ciemne tło (topbar) — półprzezroczysty biały
   tekst na białych modalach (dodawanie/edycja projektu, PIN) był praktycznie
   niewidoczny. Realny powód, dla którego "Anuluj" wyglądało, jakby go nie było. */
.add-project-modal .btn--ghost,
.pin-modal .btn--ghost,
.topbar .btn--ghost,
/* Cały hub (#hub-shell w hub.html) jest jasny poza samym ekranem logowania
   (.login-overlay, który żyje POZA #hub-shell) — jeden szeroki override,
   zamiast dopisywać kolejne konteksty jeden po drugim za każdym razem, gdy
   .btn--ghost pojawi się w nowym miejscu (sidebar kampanii, panel assetu,
   formularz uwagi — to był dokładnie ten sam błąd co "Anuluj" wcześniej). */
#hub-shell .btn--ghost {
  background: #f1f5f9;
  color: #64748b;
}
.add-project-modal .btn--ghost:hover,
.pin-modal .btn--ghost:hover,
.topbar .btn--ghost:hover,
#hub-shell .btn--ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}
.btn--danger { background: rgba(239,68,68,.2); color: #fca5a5; }
.btn--danger:hover { background: rgba(239,68,68,.3); color: white; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN OVERLAY
   ══════════════════════════════════════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0d1b2a 0%, #142a3e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.login-box {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 40px 36px;
  width: 340px;
  text-align: center;
}
.login-box__logo img {
  height: 32px;
  width: auto;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
  opacity: .75;
}
.login-box__title {
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin-bottom: 6px;
}
.login-box__hint {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  margin-bottom: 20px;
}
.login-box__input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  color: white;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 8px;
  transition: border-color .15s;
}
.login-box__input::placeholder { letter-spacing: 0; color: rgba(255,255,255,.25); }
.login-box__input:focus { outline: none; border-color: var(--accent); }
.login-box__error { font-size: 12px; color: #f87171; margin-bottom: 10px; }
.login-box__btn { width: 100%; }

/* ══════════════════════════════════════════════════════════════════════════
   PIN MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.pin-modal {
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-width: 320px;
  width: 100%;
  position: relative;
}
.pin-modal > div { padding: 28px 28px 24px; text-align: center; }
.pin-modal__title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.pin-modal__hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.pin-modal__input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 20px;
  text-align: center;
  letter-spacing: 6px;
  color: var(--text);
  margin-bottom: 8px;
  transition: border-color .15s;
}
.pin-modal__input:focus { outline: none; border-color: var(--accent-dark); }
.pin-modal__error { font-size: 12px; color: #ef4444; margin-bottom: 8px; }
.pin-modal__footer { display: flex; gap: 8px; margin-top: 10px; }
.pin-modal__footer .btn { flex: 1; }
.pin-modal .btn--ghost { background: #f1f5f9; color: var(--text-muted); }
.pin-modal .btn--ghost:hover { background: #e2e8f0; color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════
   VIEW TOGGLE
   ══════════════════════════════════════════════════════════════════════════ */
.view-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 1px;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.view-toggle__btn:hover { color: var(--text); }
.view-toggle__btn--active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ══════════════════════════════════════════════════════════════════════════
   KANBAN BOARD — overlay nad preview
   ══════════════════════════════════════════════════════════════════════════ */
.kanban-board {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: fit-content;
  max-width: 100%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  overflow: hidden;
  box-shadow: 6px 0 24px rgba(0,0,0,.13);
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--toolbar-border);
  flex-shrink: 0;
}

.kanban-header__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.kanban-header__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
.kanban-header__close:hover { background: #e9ecef; color: var(--text); }

.kanban-columns {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 14px;
  overflow-x: auto;
  align-items: stretch;
}

.kanban-col {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: box-shadow .15s;
}

.kanban-col--dragover {
  box-shadow: 0 0 0 2px var(--accent-dark);
  background: #f0faf7;
}

.kanban-col__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.kanban-col__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-col__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
  text-transform: uppercase;
  flex: 1;
}

.kanban-col__count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: #e2e8f0;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

.kanban-col__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.kanban-col__empty {
  padding: 20px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

/* ─── Kanban card ─────────────────────────────────────────────────────────── */
.kanban-card {
  background: #f9fafb;
  border: 1px solid #e9ecef;
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: default;
  transition: box-shadow .12s, transform .12s, opacity .12s;
  position: relative;
}
.kanban-card:hover { background: white; box-shadow: 0 2px 8px rgba(0,0,0,.07); }

.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.kanban-card--dragging {
  opacity: .45;
  transform: rotate(1.5deg) scale(.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.kanban-card__text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

.kanban-card__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.kanban-card__date {
  font-size: 10px;
  color: var(--text-muted);
}

.kanban-card__issue {
  font-size: 10px;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color .1s;
}
.kanban-card__issue:hover { color: #3b7a6f; }

.kanban-card__actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Drag ghost — hide UA ghost */
.kanban-card__drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1;
}

/* ─── Panel header right ──────────────────────────────────────────────────── */
.panel__header-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.panel__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--panel-text-faint);
  transition: background .12s, color .12s;
}
.panel__icon-btn:hover { background: #e9ecef; color: var(--panel-text); }

/* ─── Panel add trigger ───────────────────────────────────────────────────── */
.panel__add-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: white;
  border: none;
  border-bottom: 1px solid var(--panel-border);
  color: var(--panel-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.panel__add-trigger:hover {
  background: #f0faf7;
  color: var(--accent-dark);
}
.panel__add-trigger svg { opacity: .5; flex-shrink: 0; }
.panel__add-trigger:hover svg { opacity: 1; }

/* ─── Form tools (screenshot capture) ────────────────────────────────────── */
.form-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
}

.form-tools__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--panel-text-muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.form-tools__btn:hover {
  background: #e8f5f1;
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.form-tools__hint {
  font-size: 11px;
  color: var(--panel-text-faint);
}

/* ══════════════════════════════════════════════════════════════════════════
   ANNOTATION MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.annotation-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.annotation-modal__inner {
  display: flex;
  flex-direction: column;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  gap: 12px;
}

.annotation-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.annotation-modal__hint {
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

.annotation-modal__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.annotation-modal__canvas-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#annotation-canvas {
  cursor: crosshair;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
}

/* Override ghost btns in annotation (dark bg) */
.annotation-modal .btn--ghost {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.annotation-modal .btn--ghost:hover {
  background: rgba(255,255,255,.18);
  color: white;
}

/* ══════════════════════════════════════════════════════════════════════════
   WCAG PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.wcag-panel { flex: 1; overflow-y: auto; padding: 0; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #d1d5db transparent; }

.wcag-token-prompt { padding: 20px 14px; }
.wcag-token-label  { font-size: 12px; font-weight: 600; color: var(--panel-text-muted); margin-bottom: 6px; display: block; }
.wcag-token-input  {
  width: 100%; border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  padding: 7px 10px; font-family: inherit; font-size: 12px; color: var(--panel-text);
  background: white; transition: border-color .15s;
}
.wcag-token-input:focus { outline: none; border-color: #8b5cf6; }
.wcag-token-hint { font-size: 11px; color: var(--panel-text-faint); margin-top: 5px; }

.wcag-scan-area { padding: 12px 14px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.wcag-url-label  { font-size: 11px; color: var(--panel-text-faint); margin-bottom: 4px; display: block; }
.wcag-url-display {
  font-size: 11px; color: var(--panel-text-muted); background: #f8fafc;
  border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  padding: 5px 9px; margin-bottom: 10px; word-break: break-all;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wcag-run-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #8b5cf6; color: white; border: none;
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.wcag-run-btn:hover { background: #7c3aed; }
.wcag-run-btn:disabled { background: #c4b5fd; cursor: not-allowed; }

.wcag-progress { padding: 16px 14px; }
.wcag-progress__label { font-size: 12px; color: var(--panel-text-muted); margin-bottom: 8px; }
.wcag-progress__bar { height: 4px; background: #e9ecef; border-radius: 2px; overflow: hidden; }
.wcag-progress__fill {
  height: 100%; background: #8b5cf6; border-radius: 2px;
  width: 60%; animation: wcag-pulse 1.4s ease-in-out infinite;
}
@keyframes wcag-pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }

.wcag-score-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.wcag-score-num { font-size: 28px; font-weight: 700; line-height: 1; min-width: 52px; }
.wcag-score-num--ok   { color: #059669; }
.wcag-score-num--warn { color: #d97706; }
.wcag-score-num--fail { color: #dc2626; }
.wcag-score-counts { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.wcag-count-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--panel-text-muted); }
.wcag-count-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.wcag-count-n   { font-weight: 700; color: var(--panel-text); min-width: 18px; }

.wcag-findings { flex: 1; overflow-y: auto; }
.wcag-group { border-bottom: 1px solid var(--panel-border); }
.wcag-group__header {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  cursor: pointer; user-select: none; background: #fafafa;
  transition: background .1s;
}
.wcag-group__header:hover { background: #f3f4f6; }
.wcag-group__impact { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wcag-group__count  { font-size: 11px; color: var(--panel-text-faint); margin-left: auto; }
.wcag-group__chevron { font-size: 10px; color: var(--panel-text-faint); transition: transform .2s; }
.wcag-group--open .wcag-group__chevron { transform: rotate(90deg); }
.wcag-group__body { display: none; }
.wcag-group--open .wcag-group__body { display: block; }

.wcag-finding {
  padding: 9px 14px; border-bottom: 1px dashed var(--panel-item-border);
  font-size: 12px;
}
.wcag-finding:last-child { border-bottom: none; }
.wcag-finding__help { color: var(--panel-text); font-weight: 500; line-height: 1.4; margin-bottom: 4px; }
.wcag-finding__src  { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.src-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.src-badge--axe   { background: #ede9fe; color: #6d28d9; }
.src-badge--pa11y { background: #fef3c7; color: #b45309; }
.wcag-node {
  font-size: 10px; font-family: monospace; background: #f1f5f9;
  border-radius: 3px; padding: 3px 6px; margin-top: 4px;
  color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

.wcag-error { padding: 14px; font-size: 12px; color: #dc2626; background: #fef2f2; border-radius: var(--radius-sm); margin: 12px 14px; }
.wcag-empty { padding: 28px 20px; text-align: center; color: var(--panel-text-faint); font-size: 13px; font-style: italic; }

/* ─── Historia ───────────────────────────────────────────────────────────── */
.status-tab__dot--history { background: #f97316; }

.history-panel { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.history-empty  { padding: 28px 20px; text-align: center; color: var(--panel-text-faint); font-size: 13px; font-style: italic; }

.history-version {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.history-version__header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--panel-border);
  font-size: 12px; font-weight: 600;
}
.history-version__date { flex: 1; color: var(--panel-text); }
.history-version__resolved {
  font-size: 11px; color: #34d399; font-weight: 500;
  background: rgba(52,211,153,.12); padding: 2px 7px; border-radius: 99px;
}
.history-version__chevron { color: var(--panel-text-faint); font-size: 10px; transition: transform .2s; }
.history-version--open .history-version__chevron { transform: rotate(90deg); }

.history-version__body { display: none; padding: 10px; }
.history-version--open .history-version__body { display: block; }

.history-device-toggle {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.history-device-btn {
  padding: 3px 10px; border-radius: 99px; border: 1px solid var(--panel-border);
  font-size: 11px; cursor: pointer; background: transparent; color: var(--panel-text);
}
.history-device-btn--active { background: var(--accent); color: #fff; border-color: var(--accent); }

.history-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.history-thumb {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--panel-border); cursor: pointer;
  transition: box-shadow .15s;
}
.history-thumb:hover { box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.history-thumb img { width: 100%; display: block; }
.history-thumb__label {
  font-size: 10px; padding: 3px 5px;
  background: var(--toolbar-bg); color: var(--panel-text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.history-actions {
  display: flex; gap: 6px; margin-bottom: 4px;
}
.history-action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--toolbar-bg);
  color: var(--panel-text); font-size: 12px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.history-action-btn:hover  { background: var(--panel-bg); border-color: var(--accent); }
.history-action-btn:disabled { opacity: .5; cursor: wait; }

.history-changelog {
  margin-bottom: 10px; padding: 8px 10px;
  background: rgba(52, 211, 153, .07);
  border-left: 3px solid #34d399; border-radius: 0 var(--radius) var(--radius) 0;
}
.history-changelog__title {
  font-size: 11px; font-weight: 600; color: #34d399;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.history-changelog__item {
  font-size: 12px; color: var(--panel-text); line-height: 1.4;
  padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.history-empty-screens {
  font-size: 12px; color: var(--panel-text-faint); font-style: italic;
  padding: 8px 0;
}

/* ─── Admin-only utility ──────────────────────────────────────────────────── */
.admin-mode-only { display: none !important; }
.admin-mode .admin-mode-only { display: flex !important; }

/* ─── Kanban — add button in New column ──────────────────────────────────── */
.kanban-add-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 12px;
  background: #f0faf7;
  border: 1px dashed var(--accent-dark);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.kanban-add-btn:hover { background: #e0f5ef; }

/* ─── Replies ─────────────────────────────────────────────────────────────── */
.feedback-item__replies {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--panel-item-border);
}

.reply-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid var(--panel-item-border);
}
.reply-item:last-child { border-bottom: none; }

.reply-item__header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.reply-item__author {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-dark);
}
.reply-item__date {
  font-size: 10px;
  color: var(--panel-text-faint);
}
.reply-item__text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--panel-text-muted);
  word-break: break-word;
}

.reply-trigger {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--panel-text-faint);
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .1s;
}
.reply-trigger:hover { color: var(--accent-dark); }

.reply-form {
  margin-top: 6px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}
.reply-form__textarea {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-family: inherit;
  font-size: 12px;
  color: var(--panel-text);
  resize: none;
  min-height: 52px;
  background: white;
  transition: border-color .15s;
}
.reply-form__textarea:focus { outline: none; border-color: var(--accent-dark); }
.reply-form__footer { display: flex; gap: 6px; margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   FAB — floating add button
   ══════════════════════════════════════════════════════════════════════════ */
.fab-add {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  z-index: 30;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.fab-add:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,.28);
  background: #3d8071;
}
.fab-add:active { transform: scale(.94); }

/* Nad paskiem osi czasu wideo/audio (45px), nie na nim */
body.media-mode .fab-add { bottom: 69px; }

/* Blokuj iframe podczas interakcji z FAB — zapobiega "przejęciu" kliknięcia przez iframe */
.preview-area:has(.fab-add:hover) .preview__frame { pointer-events: none; }

/* W trybie kanban FAB jest ukryty */
.kanban-mode .fab-add { display: none; }

/* Admin-only: project select widoczny tylko w admin-mode */
.topbar__select { display: none; }
.topbar__project-name { display: block; }
.admin-mode .topbar__select { display: block; }
.admin-mode .topbar__project-name { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   CATALOG HOME — ekran startowy z listą projektów (styl zainspirowany
   Games Catalog LQT: sidebar + zakładki kategorii + karuzela kart-telefonów).
   ═══════════════════════════════════════════════════════════════════════ */
.catalog-home {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: #eee;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.catalog-sidebar {
  width: 256px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 17px 32px 16px;
  background: #f9f9f9;
  border-right: 1px solid var(--toolbar-border);
  overflow-y: auto;
}
.catalog-sidebar__logo { height: 20px; width: auto; object-fit: contain; }
.catalog-divider { height: 2px; border-radius: 9999px; background: #eee; flex-shrink: 0; }
.catalog-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #e2e2e2; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; color: var(--text);
}
.catalog-search input { border: none; outline: none; background: transparent; font-size: 12px; width: 100%; font-family: inherit; }
.catalog-search svg { flex-shrink: 0; opacity: .5; }

.catalog-section-title {
  font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 2px;
}

.catalog-btn-primary,
.catalog-btn-secondary {
  height: 40px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.catalog-btn-primary { background: #1a1c1c; color: #f9f9f9; }
.catalog-btn-primary:hover { background: #333; }
.catalog-btn-secondary { background: #f9f9f9; border-color: #eee; color: #1a1c1c; font-weight: 500; }
.catalog-btn-secondary:hover { background: #f2f2f2; }

.catalog-web-review { display: flex; flex-direction: column; gap: 10px; }
.catalog-review-row { display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.catalog-review-name { font-size: 12px; color: #1a1c1c; font-weight: 500; }
.catalog-review-line { display: flex; gap: 8px; height: 32px; align-items: center; }
.catalog-review-todo {
  flex: 1; display: flex; align-items: center; gap: 6px; height: 32px; padding: 4px 10px;
  border-radius: 8px; background: #eee; font-size: 11px; font-weight: 600; text-transform: uppercase; color: #1a1c1c;
  overflow: hidden;
}
.catalog-review-dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--accent-dark); flex-shrink: 0; }
.catalog-review-count {
  margin-left: auto; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 30px;
  background: var(--accent-dark); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.catalog-review-count[hidden] { display: none; }
.catalog-review-arrow {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border: 1px solid #e2e2e2;
  background: #fff; display: flex; align-items: center; justify-content: center; color: #1a1c1c;
}
.catalog-review-arrow:hover { background: #f5f5f5; }
.catalog-sidebar-empty { font-size: 11px; color: var(--text-muted); }

.catalog-sidebar-spacer { flex: 1; min-height: 8px; }

.catalog-share { display: flex; flex-direction: column; gap: 8px; }
.catalog-disclaimer { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ─── Main ────────────────────────────────────────────────────────────── */
.catalog-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 32px 24px; overflow-y: auto; }
.catalog-header { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 1184px; text-align: center; }
.catalog-header h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.catalog-header p { font-size: 13px; color: var(--text-muted); max-width: 560px; }

.catalog-tabs { display: flex; gap: 12px; width: 100%; max-width: 884px; padding-top: 28px; flex-wrap: wrap; justify-content: center; }
.catalog-tab {
  flex: 0 1 auto; min-width: 96px; height: 38px; padding: 0 18px; border-radius: 12px;
  font-size: 13px; font-weight: 500; background: #f5f5f5; border: 1px solid #e2e2e2; color: #1a1c1c;
}
.catalog-tab:hover { background: #ececec; }
.catalog-tab--active { background: #1a1c1c; border-color: #1a1c1c; color: #f9f9f9; font-weight: 600; }

.catalog-carousel { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 1184px; padding: 32px 0; flex: 1; min-height: 0; }
.catalog-carousel-arrow {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; background: rgba(26,28,28,.35); color: #fff;
  font-size: 20px; display: flex; align-items: center; justify-content: center; border: none;
}
.catalog-carousel-arrow:hover { background: rgba(26,28,28,.55); }
.catalog-carousel-track {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 24px; min-height: 0; height: 100%;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 0 40px;
}
.catalog-carousel-track::-webkit-scrollbar { display: none; }

.catalog-card-wrap {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  scroll-snap-align: center;
}
.catalog-card {
  position: relative; width: 200px; height: 400px; border-radius: 20px;
  border: 5px solid #111827; background: #fff; overflow: hidden; box-shadow: 0 12px 25px rgba(0,0,0,.1);
  transition: width .25s ease, height .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
}
.catalog-card--active {
  width: 256px; height: 512px; border: 3px solid var(--accent-dark); border-radius: 26px;
  box-shadow: 0 0 32px rgba(90,158,143,.75), 0 16px 32px rgba(0,0,0,.1);
}
.catalog-card-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 15px;
  background: #111827; border-radius: 0 0 10px 10px; z-index: 2;
}
.catalog-card--active .catalog-card-notch { width: 102px; height: 19px; border-radius: 0 0 13px 13px; }
.catalog-card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #e5e5e5; }
.catalog-card-art--empty { display: flex; align-items: center; justify-content: center; font-size: 40px; color: #ccc; }
.catalog-card-scrim {
  position: absolute; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; gap: 2px;
  padding: 10px; background: linear-gradient(to top, rgba(0,0,0,.82) 0%, transparent 92%);
}
.catalog-card-name { font-size: 18px; font-weight: 700; color: #fff; line-height: 1.15; }
.catalog-card--active .catalog-card-name { font-size: 24px; }
.catalog-card-category { font-size: 9px; font-weight: 500; color: #fff; opacity: .9; letter-spacing: .04em; text-transform: uppercase; }
.catalog-card--active .catalog-card-category { font-size: 11px; }

.catalog-card-stats {
  display: flex; align-items: center; gap: 8px; height: 16px;
}
.catalog-card-stats .stat {
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.catalog-card-stats .stat--new  { color: #d14e4e; }
.catalog-card-stats .stat--todo { color: #b8860b; }
.catalog-card-stats .stat--done { color: var(--accent-dark); }

/* ─── Karta "Dodaj nowe" ──────────────────────────────────────────────── */
.catalog-card--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border-style: dashed; border-color: #c7c7c7; background: #fafafa; color: var(--text-muted);
}
.catalog-card--add:hover { border-color: var(--accent-dark); color: var(--accent-dark); background: #f5f9f8; }
.catalog-card--add .plus { font-size: 34px; font-weight: 300; line-height: 1; }
.catalog-card--add span.label { font-size: 12px; font-weight: 600; text-align: center; padding: 0 12px; }

/* ─── Modal "Dodaj nowy projekt" ──────────────────────────────────────── */
.add-project-modal { border-radius: 16px; padding: 28px; width: min(420px, 92vw); border: none; max-height: 88vh; overflow-y: auto; position: relative; }
.add-project-modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; padding-right: 26px; }
.add-project-modal p.hint { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.add-project-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.add-project-field label { font-size: 12px; font-weight: 600; color: var(--text); }
.add-project-field input,
.add-project-field select {
  height: 38px; border-radius: 8px; border: 1px solid var(--panel-border); padding: 0 10px;
  font-size: 13px; font-family: inherit; color: var(--text);
}
.add-project-field input:focus,
.add-project-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.add-project-footer {
  display: flex; flex-direction: row-reverse; gap: 10px; margin-top: 20px;
  position: sticky; bottom: 0;
  background: #fff; padding-top: 12px;
}

/* "X" w prawym górnym rogu modala — niezależne od przycisku "Anuluj"/"Zamknij"
   na dole, ten sam wzorzec dla wszystkich dialogów (add-project-modal i
   pin-modal mają już position:relative powyżej, żeby to się poprawnie kotwiczyło). */
.modal-close-x {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 28px; height: 28px; border-radius: 50%;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.modal-close-x:hover { background: #f1f5f9; color: var(--text); }
.add-project-error { font-size: 12px; color: #dc2626; margin-top: -6px; margin-bottom: 10px; }

/* ─── Wybór typu (ikonki) ────────────────────────────────────────────────── */
.type-picker { display: flex; gap: 4px; }
.type-picker__btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; min-width: 0; padding: 8px 2px; border-radius: 10px;
  border: 1.5px solid var(--panel-border); background: #fff; cursor: pointer;
  font-size: 10px; color: var(--text-muted); transition: border-color .12s, background .12s, color .12s;
}
.type-picker__icon { font-size: 18px; line-height: 1; }
.type-picker__btn:hover { border-color: var(--accent); background: #f5faf9; }
.type-picker__btn.is-active {
  border-color: var(--accent-dark); background: #eef8f5; color: var(--text); font-weight: 600;
}

/* ─── Materiał wideo/audio: link | plik obok siebie ─────────────────────── */
.media-source-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-source-split:has(.media-source-col--drop[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 480px) { .media-source-split { grid-template-columns: 1fr; } }
.media-source-col { display: flex; flex-direction: column; gap: 6px; }
.media-source-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.media-source-col--drop { position: relative; }
.dropzone-inner {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 76px; border: 1.5px dashed var(--panel-border); border-radius: 8px;
  padding: 10px; text-align: center; font-size: 11px; color: var(--text-muted); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dropzone-inner:hover { border-color: var(--accent); background: #f5faf9; }
.dropzone-inner.is-dragover { border-color: var(--accent-dark); background: #eef8f5; color: var(--text); }
.dropzone-icon { font-size: 20px; }

.edit-project-modal { width: min(560px, 92vw); max-height: 88vh; overflow-y: auto; }
.edit-pages-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.edit-page-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; border: 1px solid var(--panel-border); border-radius: 8px;
}
.edit-page-row__top {
  display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 6px; align-items: center;
}
.edit-page-row__bottom {
  display: flex; gap: 6px; align-items: center;
}
.edit-page-row__bottom .edit-page-url { flex: 1; min-width: 0; }
.edit-page-row input, .edit-page-row select {
  height: 34px; border-radius: 8px; border: 1px solid var(--panel-border); padding: 0 8px;
  font-size: 12px; font-family: inherit; color: var(--text); min-width: 0;
}
.edit-page-row input:focus, .edit-page-row select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.edit-page-type { flex-shrink: 0; width: 92px; }
.edit-page-row button {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--panel-border);
  background: #fff; cursor: pointer; font-size: 12px; line-height: 1; color: var(--text-muted);
}
.edit-page-row button:hover:not(:disabled) { background: #f5f5f5; color: var(--text); }
.edit-page-row button:disabled { opacity: .3; cursor: default; }

.edit-page-upload-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--panel-border);
  background: #fff; cursor: pointer; font-size: 14px; transition: background .12s;
}
.edit-page-upload-btn:hover { background: #f5f5f5; }
.edit-page-upload-status { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.catalog-card-edit {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.85); color: #1a1c1c; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s ease;
}
.catalog-card:hover .catalog-card-edit,
.catalog-card--active .catalog-card-edit { opacity: 1; }
.catalog-card-edit:hover { background: #fff; }

@media (max-width: 860px) {
  .catalog-sidebar { display: none; }
  .catalog-tabs { max-width: 100%; }
}
