/**
 * IPET Kreator v3.0 — Ciepły, przyjazny styl z minimalistycznymi animacjami
 * i oszczędnym tonerowo podglądem A4. Wszystkie style zamknięte w .ipet-app.
 */
.ipet-app {
  --ipet-primary: #2c5e4f;       /* ciepła zieleń tablicowo-szałwiowa */
  --ipet-primary-dark: #20463b;
  --ipet-primary-soft: #eef5f2;
  --ipet-honey: #c97b28;         /* ciepły akcent miodowo-bursztynowy */
  --ipet-honey-soft: #fef6eb;
  --ipet-canvas: #faf8f5;        /* ciepły papierowy odcień */
  --ipet-card: #ffffff;
  --ipet-text: #1f2937;
  --ipet-muted: #64748b;
  --ipet-border: #dcd6cb;
  --ipet-border-light: #ebe6dd;
  --ipet-danger: #c53030;
  --ipet-radius: 14px;
  --ipet-radius-sm: 9px;
  --ipet-shadow: 0 6px 24px rgba(44, 94, 79, 0.06);

  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ipet-text);
  background: var(--ipet-canvas);
  border: 1px solid var(--ipet-border-light);
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 24px 36px;
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
}

.ipet-app *,
.ipet-app *::before,
.ipet-app *::after {
  box-sizing: border-box;
}

.ipet-app h1, .ipet-app h2, .ipet-app h3, .ipet-app p {
  margin: 0;
  padding: 0;
  font-family: inherit;
}

/* Subtelne dekoracje organiczne w tle (nie przeszkadzają w klikaniu) */
.ipet-app .ipet-bg-deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.ipet-app .ipet-bg-deco-top {
  top: -30px;
  right: -30px;
  width: 240px;
  height: 240px;
}

.ipet-app .ipet-bg-deco-bottom {
  bottom: -40px;
  left: -40px;
  width: 220px;
  height: 220px;
}

.ipet-app .ipet-inner {
  position: relative;
  z-index: 1;
}

/* Animacje minimalistyczne */
@keyframes ipetStepEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ipetCardPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ipetFlash {
  0% { background-color: #fde68a; border-radius: 4px; }
  100% { background-color: transparent; }
}

@keyframes ipetCheckPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ipetToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ipet-app .ipet-animate-step {
  animation: ipetStepEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ipet-app .ipet-animate-card {
  animation: ipetCardPop 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ipet-app .ipet-flash-text {
  animation: ipetFlash 0.85s ease-out;
}

/* Nagłówek powitalny z ilustracją SVG */
.ipet-app .ipet-hero {
  background: linear-gradient(135deg, #2c5e4f 0%, #3a7765 100%);
  color: #ffffff;
  padding: 22px 26px;
  border-radius: var(--ipet-radius);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 8px 22px rgba(44, 94, 79, 0.16);
}

.ipet-app .ipet-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ipet-app .ipet-hero-art {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ipet-app .ipet-hero-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.ipet-app .ipet-hero-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 3px;
}

.ipet-app .ipet-hero-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ipet-app .ipet-rodo-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #ffffff;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.3px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ipet-app .ipet-rodo-pill:hover {
  background: rgba(255, 255, 255, 0.27);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.ipet-app .ipet-sound-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.ipet-app .ipet-sound-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.ipet-app .ipet-sound-btn.is-muted {
  opacity: 0.65;
}

/* 3-krokowy pasek postępu */
.ipet-app .ipet-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.ipet-app .ipet-step-tab {
  appearance: none;
  background: #ffffff;
  border: 1.5px solid var(--ipet-border-light);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: var(--ipet-muted);
  font-family: inherit;
  text-transform: none;
  transition: all 0.18s ease;
}

.ipet-app .ipet-step-tab:hover {
  border-color: var(--ipet-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 94, 79, 0.08);
}

.ipet-app .ipet-step-tab.is-active {
  background: var(--ipet-primary-soft);
  border-color: var(--ipet-primary);
  color: var(--ipet-primary-dark);
  box-shadow: 0 4px 14px rgba(44, 94, 79, 0.1);
}

.ipet-app .ipet-step-tab.is-done {
  border-color: #b7d8cc;
  color: var(--ipet-primary);
}

.ipet-app .ipet-step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1ede6;
  color: var(--ipet-muted);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ipet-app .ipet-step-tab.is-active .ipet-step-circle {
  background: var(--ipet-primary);
  color: #ffffff;
}

.ipet-app .ipet-step-tab.is-done .ipet-step-circle {
  background: #3d8b72;
  color: #ffffff;
}

.ipet-app .ipet-step-label {
  font-size: 13.8px;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.ipet-app .ipet-step-hint {
  font-size: 11.8px;
  color: var(--ipet-muted);
  display: block;
  margin-top: 2px;
}

/* Główna karta kroku */
.ipet-app .ipet-card {
  background: var(--ipet-card);
  border: 1px solid var(--ipet-border-light);
  border-radius: var(--ipet-radius);
  padding: 24px 26px;
  margin-bottom: 16px;
  box-shadow: var(--ipet-shadow);
}

.ipet-app .ipet-step-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ipet-app .ipet-h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 4px;
}

.ipet-app .ipet-lead {
  font-size: 14px;
  color: var(--ipet-muted);
}

/* Wstążka z cytatem ("Myśl dla Nauczyciela") — wysoka czytelność i wyraźny kontrast */
.ipet-app .ipet-quote-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #e7d7bf;
  border-left: 5px solid var(--ipet-honey);
  border-radius: 13px;
  padding: 18px 22px 18px 54px;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 3px 12px rgba(44, 94, 79, 0.05);
  overflow: hidden;
}

.ipet-app .ipet-quote-mark {
  position: absolute;
  left: 15px;
  top: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: 1;
  color: #e4bd87;
  pointer-events: none;
  user-select: none;
}

.ipet-app .ipet-quote-text {
  flex: 1;
  min-width: 240px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  font-size: 16.5px;
  font-weight: 400;
  color: #1f2937;
  line-height: 1.55;
}

.ipet-app .ipet-quote-author {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-style: normal;
  font-size: 13.5px;
  font-weight: 700;
  color: #8c4d10;
  margin-left: 0;
  margin-top: 6px;
}

.ipet-app .ipet-quote-next {
  appearance: none;
  background: #fff9f0;
  border: 1.5px solid #dfc198;
  color: #6e3d0e;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ipet-app .ipet-quote-next:hover {
  background: #fef0db;
  border-color: var(--ipet-honey);
  color: #542d08;
}

/* Pola formularza */
.ipet-app .ipet-grid-3 {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 0.85fr;
  gap: 14px;
  margin-bottom: 20px;
}

.ipet-app .ipet-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ipet-app .ipet-field label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.ipet-app input[type="text"],
.ipet-app select,
.ipet-app textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ipet-border);
  border-radius: var(--ipet-radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ipet-text);
  background: #ffffff;
  margin: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ipet-app input[type="text"]:focus,
.ipet-app select:focus,
.ipet-app textarea:focus {
  outline: none;
  border-color: var(--ipet-primary);
  box-shadow: 0 0 0 3px rgba(44, 94, 79, 0.14);
}

/* Pigułki przedmiotów i przypadłości */
.ipet-app .ipet-group-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ipet-app .ipet-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ipet-app .ipet-pill {
  appearance: none;
  background: #faf8f5;
  color: #374151;
  border: 1.5px solid var(--ipet-border);
  border-radius: 999px;
  padding: 6.5px 13px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  transition: all 0.16s ease;
}

.ipet-app .ipet-pill:hover {
  border-color: var(--ipet-primary);
  background: var(--ipet-primary-soft);
  color: var(--ipet-primary-dark);
  transform: translateY(-1px);
}

.ipet-app .ipet-pill:active {
  transform: scale(0.97);
}

.ipet-app .ipet-pill.is-on {
  background: var(--ipet-primary);
  border-color: var(--ipet-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(44, 94, 79, 0.22);
}

.ipet-app .ipet-pill.is-cond.is-on {
  background: #375a64;
  border-color: #375a64;
}

.ipet-app .ipet-pill.is-sm {
  padding: 5px 11px;
  font-size: 12.3px;
}

.ipet-app .ipet-pill-check {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  animation: ipetCheckPop 0.2s ease both;
}

.ipet-app .ipet-custom-subj {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  max-width: 380px;
}

/* Karty uczniów (Krok 2) */
.ipet-app .ipet-students-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ipet-app .ipet-student-card {
  border: 1.5px solid var(--ipet-border-light);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fdfcfa;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ipet-app .ipet-student-card:hover {
  border-color: #c8dfd7;
  box-shadow: 0 4px 14px rgba(44, 94, 79, 0.06);
}

.ipet-app .ipet-student-top {
  display: grid;
  grid-template-columns: 30px 1.6fr 0.75fr 1fr auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}

.ipet-app .ipet-student-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ipet-primary);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ipet-app .ipet-student-subrow {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ipet-border);
}

/* Ukryte domyślnie narzędzia pomocnicze (Excel / Zapisz) */
.ipet-app .ipet-helper-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ipet-border-light);
  font-size: 13px;
}

.ipet-app .ipet-link-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--ipet-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}

.ipet-app .ipet-link-btn:hover {
  color: var(--ipet-honey);
}

.ipet-app .ipet-import-drawer {
  background: var(--ipet-primary-soft);
  border: 1px solid #c4ddd4;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: ipetCardPop 0.22s ease both;
}

.ipet-app .ipet-import-drawer textarea {
  min-height: 92px;
  margin: 8px 0 10px;
  font-size: 13px;
}

/* Przyciski */
.ipet-app .ipet-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-transform: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.ipet-app .ipet-btn:hover {
  transform: translateY(-1px);
}

.ipet-app .ipet-btn:active {
  transform: translateY(0) scale(0.98);
}

.ipet-app .ipet-btn-primary {
  background: var(--ipet-primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(44, 94, 79, 0.2);
}

.ipet-app .ipet-btn-primary:hover {
  background: var(--ipet-primary-dark);
}

.ipet-app .ipet-btn-warm {
  background: var(--ipet-honey);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(201, 123, 40, 0.22);
}

.ipet-app .ipet-btn-warm:hover {
  background: #b0681e;
}

.ipet-app .ipet-btn-outline {
  background: #ffffff;
  color: var(--ipet-text);
  border-color: var(--ipet-border);
}

.ipet-app .ipet-btn-outline:hover {
  border-color: var(--ipet-primary);
  color: var(--ipet-primary-dark);
  background: var(--ipet-primary-soft);
}

.ipet-app .ipet-btn-sm {
  padding: 6.5px 12px;
  font-size: 12.8px;
  border-radius: 8px;
}

.ipet-app .ipet-btn-icon {
  appearance: none;
  padding: 6px 10px;
  font-size: 12.2px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--ipet-border);
  color: #475569;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.ipet-app .ipet-btn-icon:hover {
  border-color: var(--ipet-primary);
  color: var(--ipet-primary);
  background: var(--ipet-primary-soft);
}

.ipet-app .ipet-btn-icon.is-danger:hover {
  border-color: var(--ipet-danger);
  color: var(--ipet-danger);
  background: #fef2f2;
}

.ipet-app .ipet-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ipet-app .ipet-step-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--ipet-border-light);
}

/* Krok 3 — Baner gotowości */
.ipet-app .ipet-ready-banner {
  background: linear-gradient(135deg, #eef5f2 0%, #fef6eb 100%);
  border: 1.5px solid #cde0d8;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ipet-app .ipet-ready-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
}

.ipet-app .ipet-ready-sub {
  font-size: 13px;
  color: #4b5563;
  margin-top: 2px;
}

/* ==================== PODGLĄD A4 — OSZCZĘDNY TONEROWO (SZARY) ==================== */
.ipet-app .ipet-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.ipet-app .ipet-sheet-wrap {
  background: #edeae4;
  padding: 20px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ipet-app .ipet-sheet {
  width: 100%;
  max-width: 794px;
  background: #ffffff;
  color: #1f2937;
  padding: 34px 38px 26px;
  border-radius: 4px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 960px;
}

.ipet-app .ipet-sheet-header {
  border-bottom: 1.5px solid #94a3b8;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.ipet-app .ipet-sheet-title {
  font-size: 20.5px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.ipet-app .ipet-sheet-subtitle {
  font-size: 13px;
  color: #4b5563;
  margin-top: 3px;
}

.ipet-app .ipet-sheet-meta {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 12.8px;
}

.ipet-app .ipet-sheet-meta th,
.ipet-app .ipet-sheet-meta td {
  border: 1px solid #cbd5e1;
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}

.ipet-app .ipet-sheet-meta th {
  background: #f3f4f6;
  font-weight: 700;
  color: #1f2937;
  width: 16%;
  white-space: nowrap;
}

.ipet-app .ipet-sheet-meta td {
  width: 34%;
  color: #1f2937;
}

.ipet-app .ipet-sheet-h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: #1f2937;
  margin: 14px 0 8px;
}

.ipet-app .ipet-sheet-general {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 12.8px;
  line-height: 1.46;
}

.ipet-app .ipet-sheet-general li {
  margin-bottom: 6px;
}

/* Szary, oszczędny tonerowo nagłówek tabeli przedmiotowej */
.ipet-app .ipet-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.4px;
  line-height: 1.42;
}

.ipet-app .ipet-sheet-table thead th {
  background: #e5e7eb;
  color: #1f2937;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #94a3b8;
}

.ipet-app .ipet-sheet-table tbody td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  vertical-align: top;
}

.ipet-app .ipet-sheet-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.ipet-app .ipet-sheet-table .col-subj {
  width: 17%;
  font-weight: 700;
  color: #1f2937;
}

.ipet-app .ipet-sheet-table ul {
  margin: 0;
  padding-left: 15px;
}

.ipet-app .ipet-sheet-table li {
  margin-bottom: 5px;
}

.ipet-app .ipet-sheet-table li:last-child {
  margin-bottom: 0;
}

/* Przyciski korekty przy punktach podglądu */
.ipet-app .ipet-bullet-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

.ipet-app .ipet-mini-btn {
  appearance: none;
  background: #f5f3ef;
  color: #4b5563;
  border: 1px solid #d6d0c4;
  border-radius: 5px;
  padding: 1.5px 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  transition: all 0.14s ease;
}

.ipet-app .ipet-mini-btn:hover {
  background: var(--ipet-primary);
  color: #ffffff;
  border-color: var(--ipet-primary);
}

.ipet-app .ipet-inline-edit-box {
  margin-top: 5px;
}

.ipet-app .ipet-inline-edit-box textarea {
  font-size: 12.2px;
  min-height: 54px;
  margin-bottom: 5px;
}

/* Podpisy i stopka na kartce A4 */
.ipet-app .ipet-sheet-bottom {
  margin-top: 24px;
}

.ipet-app .ipet-sheet-sigs {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 14px;
}

.ipet-app .ipet-sheet-sig {
  flex: 1;
}

.ipet-app .ipet-sheet-sig-line {
  border-bottom: 1px dashed #64748b;
  height: 24px;
  margin-bottom: 4px;
}

.ipet-app .ipet-sheet-sig-label {
  font-size: 11.5px;
  color: #64748b;
}

.ipet-app .ipet-sheet-footer {
  border-top: 1px solid #cbd5e1;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

/* Toast */
.ipet-app .ipet-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--ipet-primary-dark);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(32, 70, 59, 0.28);
  z-index: 99999;
  animation: ipetToastIn 0.2s ease;
}

.ipet-app .ipet-toast-link {
  color: #fde68a !important;
  font-weight: 700;
  text-decoration: underline !important;
  margin-left: 8px;
  white-space: nowrap;
}

/* ==================== PRZYCISK „POSTAW KAWĘ” — WARIANT A (BEZ POPUPU) ==================== */
.ipet-app .ipet-coffee-card {
  position: relative;
  margin: 0 0 18px;
  padding: 18px 24px;
  border-radius: 15px;
  background: linear-gradient(135deg, #fffdf9 0%, #fef3e1 100%);
  border: 1px solid #ebd2b0;
  border-left: 5px solid #c97b28;
  box-shadow: 0 7px 22px rgba(201, 123, 40, 0.11);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.ipet-app .ipet-coffee-card:hover {
  box-shadow: 0 10px 28px rgba(201, 123, 40, 0.16);
}

.ipet-app .ipet-coffee-card:hover .ipet-coffee-medallion {
  transform: translateY(-2px) scale(1.03);
}

.ipet-app .ipet-coffee-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b2691d;
  background: rgba(201, 123, 40, 0.12);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.ipet-app .ipet-coffee-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 320px;
}

.ipet-app .ipet-coffee-medallion {
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #fcebd1 100%);
  border: 2px solid #ebd2b0;
  box-shadow: 0 6px 18px rgba(201, 123, 40, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ipet-app .ipet-coffee-art {
  width: 108px;
  height: 108px;
  display: block;
  overflow: visible;
  transform: translateY(-4px);
}

.ipet-app .ipet-coffee-art__steam {
  transform-box: fill-box;
  transform-origin: center bottom;
  opacity: 0;
  animation: kawa-art-steam-float 3.4s ease-in-out infinite;
}

.ipet-app .ipet-coffee-art__steam--2 {
  animation-delay: 1.05s;
}

.ipet-app .ipet-coffee-art__steam--3 {
  animation-delay: 2.05s;
}

@keyframes kawa-art-steam-float {
  0% {
    opacity: 0;
    transform: translate(0px, 3px) scaleY(0.82);
  }
  28% {
    opacity: 0.92;
  }
  65% {
    opacity: 0.62;
    transform: translate(1.8px, -4px) scaleY(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(-1px, -10px) scaleY(1.14);
  }
}

.ipet-app .ipet-coffee-copy {
  flex: 1 1 220px;
}

.ipet-app .ipet-coffee-title {
  font-size: 15.2px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 3px;
}

.ipet-app .ipet-coffee-desc {
  font-size: 13.2px;
  color: #5b4a37;
  line-height: 1.45;
}

.ipet-app .ipet-coffee-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100vw - 28px));
  background: #fffdf9;
  border: 1.5px solid #ebd2b0;
  border-left: 4px solid #c97b28;
  border-radius: 16px;
  padding: 14px 20px 14px 16px;
  box-shadow: 0 14px 36px rgba(44, 94, 79, 0.22);
  z-index: 99998;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: ipetToastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ipet-app .ipet-coffee-toast-close {
  position: absolute;
  top: 6px;
  right: 9px;
  appearance: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
}

.ipet-app .ipet-coffee-toast-close:hover {
  color: var(--ipet-primary-dark);
}

.ipet-app .kawa-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-family: inherit;
  box-sizing: border-box;
}

.ipet-app .kawa-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid #e3be8d;
  border-radius: 14px;
  background: linear-gradient(180deg, #d1822d 0%, #c17220 100%);
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(201, 123, 40, 0.28);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.2s ease,
    box-shadow 0.22s ease;
}

/* Bardzo subtelny, powolny połysk światła raz na 7.5s */
.ipet-app .kawa-btn::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -65%;
  width: 42%;
  height: 140%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: kawa-btn-sheen 7.5s ease-in-out infinite;
}

@keyframes kawa-btn-sheen {
  0%, 76% {
    left: -65%;
    opacity: 0;
  }
  82% {
    opacity: 1;
  }
  96% {
    left: 130%;
    opacity: 0.8;
  }
  100% {
    left: 130%;
    opacity: 0;
  }
}

.ipet-app .kawa-btn:hover {
  background: linear-gradient(180deg, #c17220 0%, #ab6116 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(201, 123, 40, 0.36);
}

.ipet-app .kawa-btn:active {
  transform: translateY(0);
}

.ipet-app .kawa-btn:focus-visible {
  outline: 2px solid #2c5e4f;
  outline-offset: 3px;
}

.ipet-app .kawa-btn.is-thanked {
  background: #2c5e4f;
  border-color: #2c5e4f;
  box-shadow: 0 5px 16px rgba(44, 94, 79, 0.24);
}

.ipet-app .kawa-btn.is-thanked::after {
  animation: none;
  opacity: 0;
}

.ipet-app .kawa-btn__svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: block;
  overflow: visible;
}

.ipet-app .kawa-btn__steam {
  transform-box: fill-box;
  transform-origin: center bottom;
  opacity: 0;
  animation: kawa-btn-steam-rise 3.2s ease-in-out infinite;
}

.ipet-app .kawa-btn__steam--2 {
  animation-delay: 0.9s;
}

.ipet-app .kawa-btn__steam--3 {
  animation-delay: 1.7s;
}

@keyframes kawa-btn-steam-rise {
  0% {
    opacity: 0;
    transform: translateY(2px) scaleY(0.85);
  }
  30% {
    opacity: 0.9;
  }
  70% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translateY(-5px) scaleY(1.08);
  }
}

.ipet-app .kawa-btn__thanks {
  margin: 0;
  padding: 5px 12px;
  border-radius: 10px;
  background: #fef6eb;
  border: 1px solid #ebd2b0;
  color: #2c5e4f;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  animation: ipetToastIn 0.28s ease forwards;
}

.ipet-app .kawa-btn__thanks[hidden] {
  display: none;
}

/* Stopka z linkiem do Polityki prywatności / RODO */
.ipet-app .ipet-app-footer {
  margin-top: 14px;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ipet-muted);
}

.ipet-app .ipet-privacy-link {
  appearance: none;
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-family: inherit;
  font-size: 12.2px;
  font-weight: 600;
  color: var(--ipet-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ipet-app .ipet-privacy-link:hover {
  color: var(--ipet-honey);
}

/* Modal Polityki prywatności */
.ipet-app .ipet-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100000;
  animation: ipetToastIn 0.2s ease;
}

.ipet-app .ipet-modal {
  width: min(680px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--ipet-border);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  position: relative;
}

.ipet-app .ipet-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  appearance: none;
  background: #f5f3ef;
  border: 1px solid var(--ipet-border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  color: var(--ipet-text);
  cursor: pointer;
}

.ipet-app .ipet-modal-close:hover {
  background: var(--ipet-primary-soft);
  border-color: var(--ipet-primary);
}

.ipet-app .ipet-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin: 0 36px 12px 0;
}

.ipet-app .ipet-modal h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ipet-primary);
  margin: 14px 0 4px;
}

.ipet-app .ipet-modal p,
.ipet-app .ipet-modal li {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.55;
}

.ipet-app .ipet-rodo-tip {
  background: #eef5f2;
  border: 1.5px solid #b8d8cb;
  border-left: 4px solid #2c5e4f;
  border-radius: 10px;
  padding: 12px 15px;
  margin: 12px 0;
  color: #1f3d33;
  font-size: 13.5px;
  line-height: 1.5;
}

.ipet-app .ipet-modal ul {
  margin: 6px 0 10px;
  padding-left: 18px;
}

/* ==================== TRYB SPRAWOZDANIA (v6.0) ==================== */
.ipet-app .ipet-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.ipet-app .ipet-mode-card {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  background: #ffffff;
  border: 1.5px solid var(--ipet-border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
}

.ipet-app .ipet-mode-card:hover {
  border-color: #9dc1b4;
  background: #f9fcfa;
  transform: translateY(-1px);
}

.ipet-app .ipet-mode-card.is-active {
  border-color: var(--ipet-primary);
  background: linear-gradient(135deg, #eef5f2 0%, #f9fbf9 100%);
  box-shadow: 0 4px 14px rgba(44, 94, 79, 0.12);
}

.ipet-app .ipet-mode-card.is-report.is-active {
  border-color: var(--ipet-honey);
  background: linear-gradient(135deg, #fef6eb 0%, #fffcf7 100%);
  box-shadow: 0 4px 14px rgba(201, 123, 40, 0.14);
}

.ipet-app .ipet-mode-icon {
  font-size: 22px;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.ipet-app .ipet-mode-title {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 3px;
}

.ipet-app .ipet-mode-card.is-report.is-active .ipet-mode-title {
  color: #8c4f13;
}

.ipet-app .ipet-mode-desc {
  display: block;
  font-size: 12.5px;
  color: #5b6472;
  line-height: 1.4;
}

.ipet-app .ipet-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fef8ee;
  border: 1px solid #f0d7b2;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 18px;
}

.ipet-app .ipet-period-label {
  font-size: 13px;
  font-weight: 700;
  color: #7a4714;
}

.ipet-app .ipet-period-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ipet-app .ipet-report-blocks {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d8d3c8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ipet-app .ipet-report-blocks-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ipet-app .ipet-report-blocks-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
}

.ipet-app .ipet-report-sec {
  background: #fbfaf7;
  border: 1px solid #e9e4da;
  border-radius: 10px;
  padding: 10px 12px;
}

.ipet-app .ipet-report-sec.is-strengths {
  background: #f5faf7;
  border-color: #cfe3d9;
}

.ipet-app .ipet-report-sec.is-weaknesses {
  background: #fffaf4;
  border-color: #f0dcc4;
}

.ipet-app .ipet-report-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.ipet-app .ipet-student-card.is-collapsed {
  padding: 11px 15px;
  background: #f9f7f2;
  cursor: pointer;
}

.ipet-app .ipet-student-card.is-collapsed:hover {
  background: #f2f7f4;
  border-color: #b7d5c9;
}

.ipet-app .ipet-student-collapsed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ipet-app .ipet-student-collapsed-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.ipet-app .ipet-student-collapsed-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ipet-text);
}

.ipet-app .ipet-student-collapsed-name.is-empty {
  color: var(--ipet-muted);
  font-weight: 500;
  font-style: italic;
}

.ipet-app .ipet-student-collapsed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.ipet-app .ipet-student-mini-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1.5px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #ddd6ca;
  color: #475569;
}

.ipet-app .ipet-student-mini-badge.is-sage {
  background: #eaf4f0;
  border-color: #c2dfd3;
  color: #20463b;
}

.ipet-app .ipet-report-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.ipet-app .ipet-report-sec-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.ipet-app .ipet-report-sec-hint {
  font-size: 11.5px;
  color: #64748b;
}

.ipet-app .ipet-pill.is-strength.is-on {
  background: #2c5e4f;
  border-color: #2c5e4f;
  color: #ffffff;
}

.ipet-app .ipet-pill.is-weakness.is-on {
  background: #b56522;
  border-color: #b56522;
  color: #ffffff;
}

.ipet-app .ipet-pill.is-prog.is-on {
  background: #2c5e4f;
  border-color: #2c5e4f;
  color: #ffffff;
}

.ipet-app .ipet-sheet-table.is-report th,
.ipet-app .ipet-sheet-table.is-report td {
  width: 50%;
}

/* ==================== TECZKA KLASY: ZAPISZ / WCZYTAJ (v6.1) ==================== */
.ipet-app .ipet-folder-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #dfd8cb;
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(44, 94, 79, 0.05);
}

.ipet-app .ipet-folder-bar-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.ipet-app .ipet-folder-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef5f2 0%, #fef4e4 100%);
  border: 1px solid #d4e3dc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ipet-app .ipet-folder-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ipet-app .ipet-folder-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #2c5e4f;
  background: #e8f3ee;
  border: 1px solid #c3ddd2;
  border-radius: 999px;
  padding: 1px 8px;
}

.ipet-app .ipet-folder-desc {
  font-size: 12.2px;
  color: #5b6472;
  line-height: 1.35;
  margin-top: 2px;
}

.ipet-app .ipet-folder-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ipet-app .ipet-dropzone {
  border: 2px dashed #b9cfc6;
  border-radius: 12px;
  background: #f6faf8;
  padding: 24px 18px;
  text-align: center;
  margin: 14px 0 12px;
  transition: all 0.16s ease;
}

.ipet-app .ipet-dropzone.is-dragover {
  border-color: var(--ipet-primary);
  background: #e6f2ed;
  transform: scale(1.01);
}

.ipet-app .ipet-dropzone-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.ipet-app .ipet-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 4px;
}

.ipet-app .ipet-dropzone-sub {
  font-size: 12.5px;
  color: #5b6472;
  margin-bottom: 14px;
}

.ipet-app .ipet-folder-note {
  background: #fef8ee;
  border: 1px solid #f0d7b2;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: #6b4316;
  line-height: 1.48;
  margin-top: 10px;
}

.ipet-app .ipet-folder-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  margin-top: 10px;
}

.ipet-app .ipet-folder-loaded {
  background: #eef6f2;
  border: 1.5px solid #bdd8cc;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

.ipet-app .ipet-folder-loaded-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ipet-primary-dark);
  margin-bottom: 6px;
}

.ipet-app .ipet-folder-meta {
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 12px;
}

.ipet-app .ipet-folder-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.ipet-app .ipet-folder-chip {
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #c7ddd3;
  color: #1f3d33;
  border-radius: 999px;
  padding: 3px 10px;
}

.ipet-app .ipet-folder-next-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ipet-app .ipet-semester-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #f3f8f5 0%, #fef9f0 100%);
  border: 1.5px solid #cde0d8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 18px;
}

.ipet-app .ipet-semester-tip-copy {
  flex: 1;
  min-width: 220px;
  font-size: 13px;
  color: #2d3e37;
  line-height: 1.45;
}

.ipet-app .ipet-semester-tip-copy strong {
  color: var(--ipet-primary-dark);
}

/* Responsywność */
@media (max-width: 780px) {
  .ipet-app .ipet-mode-cards,
  .ipet-app .ipet-report-grid-2,
  .ipet-app .ipet-folder-next-grid {
    grid-template-columns: 1fr;
  }
  .ipet-app {
    padding: 14px 12px 26px;
    border-radius: 12px;
  }
  .ipet-app .ipet-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }
  .ipet-app .ipet-progress,
  .ipet-app .ipet-grid-3 {
    grid-template-columns: 1fr;
  }
  .ipet-app .ipet-card {
    padding: 18px 16px;
  }
  .ipet-app .ipet-student-top {
    grid-template-columns: 28px 1fr;
  }
  .ipet-app .ipet-sheet {
    padding: 20px 16px;
    min-height: auto;
  }
  .ipet-app .ipet-sheet-sigs {
    gap: 18px;
  }
  .ipet-app .ipet-coffee-medallion {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
  }
  .ipet-app .ipet-coffee-art {
    width: 78px;
    height: 78px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ipet-app *,
  .ipet-app *::before,
  .ipet-app *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
