/* ── Nagłówek modułu ────────────────────────────────────────────────── */
.mod-head { padding: 40px 0 24px; max-width: 760px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--muted-foreground); text-decoration: none; margin-bottom: 16px;
}
.back:hover { color: var(--foreground); }
.mod-head h1 { font-size: 30px; font-weight: 500; letter-spacing: -.015em; margin: 0 0 10px; }
.mod-head p  { margin: 0 0 16px; color: var(--muted-foreground); font-size: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card-glass); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px 6px 11px; font-size: 13px; box-shadow: var(--shadow-soft);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); position: relative; }
.dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--primary); opacity: .35; animation: ping 2.6s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(.6); opacity: .5 }
  70%  { transform: scale(1.5); opacity: 0 }
  100% { opacity: 0 }
}

/* ── Strefa upuszczania ─────────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 46px 24px; text-align: center; cursor: pointer;
  background: var(--card-glass); border: 1px dashed var(--border-soft); border-radius: var(--radius-card);
  transition: border-color .15s, background .15s;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.dropzone:hover,
.dropzone:focus-visible { border-color: var(--primary); outline: none; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); border-style: solid; }
.dz-icon  { font-size: 30px; color: var(--primary); }
.dz-title { margin: 4px 0 0; font-size: 17px; }
.dz-sub   { margin: 0; font-size: 14px; color: var(--muted-foreground); }

/* ── Obszar roboczy ─────────────────────────────────────────────────── */
.workspace { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── Informacja o pliku ─────────────────────────────────────────────── */
.file-info {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  background: var(--card-glass); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); font-size: 14px;
}
.file-info .ti { font-size: 20px; color: var(--primary); flex-shrink: 0; }
.file-info-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-info-size { font-size: 13px; color: var(--muted-foreground); flex-shrink: 0; }

/* ── Panel kontrolek ────────────────────────────────────────────────── */
.controls-panel {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px;
  background: var(--card-glass); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}

.ctrl-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }

.ctrl-group { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }
.ctrl-group-wide { flex: 3; min-width: 240px; }

.ctrl-label {
  font-size: 13px; font-weight: 500; color: var(--foreground);
  display: flex; justify-content: space-between; align-items: center;
}
.ctrl-val { font-weight: 400; color: var(--primary); }

.ctrl-input {
  font: inherit; font-size: 14px;
  padding: 9px 13px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--background); color: var(--foreground);
  transition: border-color .15s;
}
.ctrl-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }

.ctrl-slider {
  width: 100%; height: 4px; accent-color: var(--primary);
  cursor: pointer;
}

.ctrl-color {
  width: 48px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--background);
  cursor: pointer; padding: 3px;
}

/* ── Podgląd ────────────────────────────────────────────────────────── */
.preview-wrap {
  display: flex; flex-direction: column; gap: 10px;
}
.preview-wrap[hidden] { display: none; }
.preview-label { font-size: 13px; font-weight: 500; color: var(--muted-foreground); margin: 0; }
.preview-canvas {
  display: block; max-height: 320px; width: auto; margin: 0 auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-soft);
}

/* ── Wybór stron ────────────────────────────────────────────────────── */
.page-select-panel {
  padding: 18px 20px;
  background: var(--card-glass); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.page-radios { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.radio-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; color: var(--foreground);
}
.radio-label input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.page-num-input { width: 72px; padding: 5px 9px; font-size: 13px; margin-left: 4px; }

/* ── Presety ────────────────────────────────────────────────────────── */
.presets-panel {
  padding: 18px 20px;
  background: var(--card-glass); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.preset-save-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.preset-name-input { flex: 1; }
.preset-list { display: flex; flex-direction: column; gap: 6px; }
.presets-empty { font-size: 13px; color: var(--muted-foreground); margin: 0; }
.preset-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  background: var(--background); border: 1px solid var(--border);
}
.preset-name { font-size: 13.5px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-preview-text { font-size: 12px; color: var(--muted-foreground); flex-shrink: 0; }
.preset-load {
  font: inherit; font-size: 12px; padding: 4px 10px;
  border-radius: var(--radius); border: 1px solid var(--primary);
  background: var(--primary-soft); color: var(--primary);
  cursor: pointer; flex-shrink: 0;
}
.preset-load:hover { background: var(--primary); color: #fff; }
.preset-delete {
  background: none; border: 0; cursor: pointer;
  color: var(--muted-foreground); font-size: 15px; padding: 4px; flex-shrink: 0;
  display: flex; align-items: center;
}
.preset-delete:hover { color: var(--danger); }

/* ── Pasek akcji ────────────────────────────────────────────────────── */
.action-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px;
  background: var(--card-glass); border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.action-status { font-size: 13px; color: var(--muted-foreground); margin-left: 4px; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ── Sekcja wyjaśniająca ────────────────────────────────────────────── */
.explainer { margin-top: 46px; }
.explainer h2 { font-size: 19px; font-weight: 500; margin: 0 0 16px; }
.ex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ex-item {
  background: var(--card-glass); border: 1px solid var(--border-soft);
  border-radius: var(--radius-card); padding: 20px;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.ex-item .ti { font-size: 20px; color: var(--primary); }
.ex-item h3  { font-size: 15px; font-weight: 500; margin: 8px 0 5px; }
.ex-item p   { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted-foreground); }

/* ── Komunikaty błędów ──────────────────────────────────────────────── */
.file-error {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; margin-top: 10px;
  background: rgba(140,36,56,.06); border: 1px solid rgba(140,36,56,.2);
  border-radius: var(--radius); font-size: 14px; color: var(--danger);
}
.file-error .ti { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.file-error-body { min-width: 0; }
.file-error-name { font-weight: 500; margin-bottom: 2px; }
.file-error-msg  { color: var(--muted-foreground); font-size: 13px; }
.file-error-close {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--muted-foreground); font-size: 16px; padding: 0 0 0 8px; flex-shrink: 0;
}
.file-error-close:hover { color: var(--foreground); }
.errors-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

/* ── Responsywność ──────────────────────────────────────────────────── */
@media (max-width: 900px) { .ex-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .ex-grid { grid-template-columns: 1fr; }
  .mod-head h1 { font-size: 25px; }
  .ctrl-row { flex-direction: column; }
  .ctrl-group { min-width: unset; }
  .action-bar { flex-direction: column; align-items: flex-start; }
}
