/* ===================================================================
   Librus Synergia HA - Modern Dark Design System
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Kolorystyka Dark Mode */
  --bg-deep: #080c14;
  --bg-main: #0d121f;
  --bg-surface: #141c2e;
  --bg-surface-hover: #1a253c;
  --bg-card: rgba(20, 28, 46, 0.75);
  --bg-input: #0a0f1a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-hover: rgba(59, 130, 246, 0.4);

  /* Akcenty */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.25);
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Teksty */
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Cienie & Efekty */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.25);
  --shadow-glow-purple: 0 0 28px rgba(168, 85, 247, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 35%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* ===================================================================
   Nawigacja
   =================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 18, 31, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.4));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-normal);
}

.btn-github:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ===================================================================
   Hero Section
   =================================================================== */
.hero {
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
}

.hero-container {
  max-width: 860px;
  margin: 0 auto;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa 10%, #a855f7 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
  transition: all var(--transition-normal);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.55);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* ===================================================================
   Feature Cards (v3.0 Highlights)
   =================================================================== */
.features {
  padding: 2rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.feature-icon-wrapper.purple {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.feature-icon-wrapper.green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.feature-icon-wrapper.amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===================================================================
   Sekcje Wspólne
   =================================================================== */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-badge {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ===================================================================
   Generator Section & Live Preview Layout
   =================================================================== */
.generator-section {
  padding: 4rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(13, 18, 31, 0.6), transparent);
  position: relative;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.generator-dual-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .generator-dual-layout {
    grid-template-columns: 1fr;
  }
}

.generator-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-lg);
}

.step-card {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.step-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

/* Lista Uczniów */

.input-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.55rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

select.form-control {
  cursor: pointer;
}

.btn-icon-danger {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fb7185;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
  margin-top: 1.1rem;
}

.btn-icon-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

.btn-add-student {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-student:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
}

/* Opcje Modułów */

.option-info {
  display: flex;
  flex-direction: column;
}

.option-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-generate {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transition: all var(--transition-normal);
  margin-top: 1rem;
}

.btn-generate:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}

/* ===================================================================
   Kreator dashboardu: uczniowie, elementy, podgląd, wynik
   =================================================================== */
[hidden] {
  display: none !important;
}

.dash-help {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.dash-students {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.dash-student {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.dash-student::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
}

.dash-student:focus-within {
  border-color: var(--border-focus);
}

.dash-student-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.dash-avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.dash-student-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.6rem;
  min-width: 0;
}

.dash-student-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 0.9rem;
}

.dash-picker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dash-picker-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dash-emoji,
.dash-swatch {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dash-swatch {
  border-radius: 50%;
  width: 26px;
  height: 26px;
}

.dash-emoji:hover,
.dash-swatch:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}

.dash-emoji.active,
.dash-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent-blue);
}

.dash-entities {
  margin-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

.dash-entities summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.dash-entities summary::-webkit-details-marker {
  display: none;
}

.dash-entities summary::before {
  content: "▸";
  transition: transform var(--transition-fast);
}

.dash-entities[open] summary::before {
  transform: rotate(90deg);
}

.dash-entities-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.dash-entities .dash-help {
  margin: 0.75rem 0 0.6rem;
}

.dash-paste {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  resize: vertical;
}

.dash-entities-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0 0.9rem;
}

.dash-match-result {
  font-size: 0.8rem;
  color: var(--accent-green);
}

.dash-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.5rem 0.75rem;
}

.dash-entity span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.dash-entity .form-control {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
}

.dash-entity .form-control.changed {
  border-color: rgba(245, 158, 11, 0.55);
}

/* Elementy panelu */
.dash-counter {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.7rem;
}

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dash-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dash-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.dash-chip.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.dash-sections {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dash-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 26, 0.45);
  padding: 0.75rem;
  transition: opacity var(--transition-fast);
}

.dash-section.empty {
  opacity: 0.7;
}

.dash-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.6rem;
}

.dash-section-head input,
.dash-element input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  flex: none;
}

.dash-section-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.dash-section-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dash-element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.dash-element {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.dash-element:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.dash-element:has(input:checked) {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
}

.dash-element input {
  margin-top: 0.15rem;
}

.dash-element-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dash-element-name {
  font-weight: 600;
  font-size: 0.86rem;
}

.dash-element-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.dash-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.dash-badge {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  white-space: nowrap;
}

.dash-badge.soft {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-secondary);
}

/* Ustawienia */
.dash-settings {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr;
  gap: 0.75rem;
}

.dash-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.dash-scope-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dash-scope-option:has(input:checked) {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
}

.dash-scope-option input {
  margin-top: 0.2rem;
  accent-color: var(--accent-blue);
}

.dash-scope-option strong {
  display: block;
  font-size: 0.86rem;
}

.dash-scope-option small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Podgląd układu */
.dash-preview {
  position: sticky;
  top: 5.5rem;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.dash-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dash-preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.dash-preview-tab {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.dash-preview-tab.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.dash-mini-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

.dash-req {
  border-top: 1px solid var(--border-subtle);
  padding: 0.9rem 1rem 1rem;
}

.dash-req h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.dash-req ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.dash-req a {
  color: #93c5fd;
  text-decoration: none;
}

.dash-req a:hover {
  text-decoration: underline;
}

.dash-req small {
  color: var(--text-muted);
}

/* Wynik */
.dash-tabs {
  display: flex;
  gap: 0.3rem;
}

.dash-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.dash-tab.active {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.dash-hint {
  padding: 0.75rem 1.25rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dash-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.25rem;
  max-height: 620px;
  overflow-y: auto;
}

.dash-result {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.dash-result summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.dash-result summary::-webkit-details-marker {
  display: none;
}

.dash-result-title {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  min-width: 0;
}

.dash-result-title strong {
  font-size: 0.88rem;
}

.dash-result-title small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.dash-result pre {
  max-height: 360px;
  overflow: auto;
  padding: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

@media (max-width: 1024px) {
  .dash-preview {
    position: static;
  }
}

@media (max-width: 640px) {
  .dash-student-fields,
  .dash-settings,
  .dash-scope {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===================================================================
   Podgląd kart na danych przykładowych (motyw ciemny Home Assistant)
   =================================================================== */
.ha-podglad {
  --primary-text-color: #e1e1e1;
  --secondary-text-color: #9b9b9b;
  --divider-color: rgba(225, 225, 225, 0.12);
  --card-background-color: #1c1c1c;
  --demo-acc: #3f51b5;
  background: #111111;
  color: var(--primary-text-color);
  font-family: Roboto, var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

.ha-podglad .ha-sekcja {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ha-podglad .ha-card {
  background: var(--card-background-color);
  border: 1px solid var(--divider-color);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}

.ha-podglad .ha-card.wizytowka {
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  --primary-text-color: #fff;
}

.ha-podglad .ha-card.wizytowka h2 {
  margin: 0 0 6px;
  font-size: 1.7em;
}

.ha-podglad .ha-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 4px 2px;
}

.ha-podglad .ha-heading-tytul {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
}

.ha-podglad .ha-heading.subtitle .ha-heading-tytul {
  font-size: 14px;
  color: var(--secondary-text-color);
}

.ha-podglad .ha-heading ha-icon {
  font-size: 20px;
  color: var(--secondary-text-color);
}

.ha-podglad .ha-badges {
  display: flex;
  gap: 6px;
}

.ha-podglad .ha-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--divider-color);
}

.ha-podglad ha-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--mdc-icon-size, 24px);
  line-height: 1;
}

/* Markdown */
.ha-podglad .ha-md p,
.ha-podglad .ha-md ul {
  margin: 0 0 8px;
}

.ha-podglad .ha-md ul {
  padding-left: 20px;
}

.ha-podglad .ha-md > :last-child {
  margin-bottom: 0;
}

.ha-podglad .ha-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 13px;
}

.ha-podglad .ha-md th,
.ha-podglad .ha-md td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--divider-color);
  text-align: left;
  vertical-align: top;
}

.ha-podglad .ha-md th {
  font-weight: 600;
}

.ha-podglad .ha-md .c {
  text-align: center;
}

.ha-podglad .ha-md .nw {
  white-space: nowrap;
}

.ha-podglad .ha-md details {
  border-bottom: 1px solid var(--divider-color);
  padding: 6px 0;
}

.ha-podglad .ha-md summary {
  cursor: pointer;
}

.ha-podglad .ha-md details > p,
.ha-podglad .ha-md details > table {
  margin-top: 6px;
}

.ha-podglad .ha-md sup {
  font-size: 9px;
}

/* ha-alert */
.ha-podglad ha-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 6px;
  --alert-k: #039be5;
  background: color-mix(in srgb, var(--alert-k) 12%, transparent);
  font-size: 13px;
}

.ha-podglad ha-alert.warning { --alert-k: #ffa600; }
.ha-podglad ha-alert.error { --alert-k: #db4437; }
.ha-podglad ha-alert.success { --alert-k: #43a047; }

.ha-podglad .ha-alert-ikona {
  color: var(--alert-k);
  font-size: 22px;
  line-height: 1;
}

.ha-podglad .ha-alert-tytul {
  display: block;
}

/* Mushroom i siatki */
.ha-podglad .ha-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ha-podglad .ha-card.mushroom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
}

.ha-podglad .mush-ikona {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--k);
  background: color-mix(in srgb, var(--k) 20%, transparent);
  margin-bottom: 8px;
  font-size: 22px;
}

.ha-podglad .mush-odznaka {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f44336;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ha-podglad .mush-prim {
  font-weight: 700;
  font-size: 14px;
}

.ha-podglad .mush-sec {
  font-size: 12px;
  color: var(--secondary-text-color);
}

.ha-podglad .ha-card.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  text-align: center;
}

.ha-podglad .ha-card.tile ha-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  color: var(--demo-acc);
  background: color-mix(in srgb, var(--demo-acc) 20%, transparent);
}

.ha-podglad .tile-nazwa {
  font-weight: 600;
  font-size: 13px;
}

.ha-podglad .tile-stan {
  font-size: 11px;
  color: var(--secondary-text-color);
}

/* ApexCharts, to-do, kalendarz */
.ha-podglad .apex-tytul {
  font-size: 15px;
  font-weight: 500;
}

.ha-podglad .apex-stan {
  font-size: 22px;
  font-weight: 700;
  margin: 2px 0 4px;
}

.ha-podglad .apex-stan small {
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary-text-color);
}

.ha-podglad .apex-os {
  fill: var(--secondary-text-color);
  font-size: 9px;
}

.ha-podglad .todo-tytul {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.ha-podglad .todo-poz {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
}

.ha-podglad .todo-poz .mdi {
  font-size: 20px;
  color: var(--secondary-text-color);
}

.ha-podglad .todo-poz.gotowe span {
  text-decoration: line-through;
  color: var(--secondary-text-color);
}

.ha-podglad .todo-poz small {
  display: block;
  font-size: 11px;
  color: var(--secondary-text-color);
}

.ha-podglad .kal-naglowek {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.ha-podglad .kal-siatka {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--divider-color);
  border-left: 1px solid var(--divider-color);
}

.ha-podglad .kal-dn {
  font-size: 11px;
  text-align: center;
  padding: 3px 0;
  color: var(--secondary-text-color);
  border-right: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
}

.ha-podglad .kal-dzien {
  min-height: 54px;
  padding: 2px;
  font-size: 11px;
  border-right: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
  overflow: hidden;
}

.ha-podglad .kal-dzien.inny {
  opacity: 0.4;
}

.ha-podglad .kal-dzien.dzis > span {
  background: var(--demo-acc);
  color: #fff;
  border-radius: 50%;
  padding: 0 5px;
}

.ha-podglad .kal-ev {
  display: block;
  font-style: normal;
  font-size: 9px;
  border-radius: 3px;
  padding: 0 3px;
  margin-top: 2px;
  background: #e53935;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-podglad .kal-ev.plan {
  background: color-mix(in srgb, var(--demo-acc) 55%, transparent);
}

/* Kompaktowy podgląd w kolumnie i pełny widok */
.dash-preview-canvas.ha-podglad {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.dash-demo-note {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dash-full {
  width: min(1440px, 96vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: #111111;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

.dash-full::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.dash-full-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.2rem;
  background: #1c1c1c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-full-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-right: auto;
}

.dash-full-body.ha-podglad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.dash-full-body .ha-sekcja.szeroka {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .dash-full-body.ha-podglad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dash-full-body.ha-podglad {
    grid-template-columns: 1fr;
  }
}

/* Wynik Generatora & Kod */
.result-box {
  display: none;
  margin-top: 2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.result-box.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-tool.primary {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.btn-tool.primary:hover {
  background: rgba(59, 130, 246, 0.3);
}

.code-container {
  max-height: 480px;
  overflow-y: auto;
  padding: 1.25rem;
}

pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #e5e7eb;
  line-height: 1.5;
  white-space: pre;
}

/* ===================================================================
   Generator Automatyzacji Powiadomień
   =================================================================== */
.automations-section {
  padding: 4.5rem 1.5rem;
  background: var(--bg-main);
  position: relative;
}

.auto-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.auto-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.auto-checkbox-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.auto-checkbox-card input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ===================================================================
   Plac Zabaw Promptów AI (Prompt Playground)
   =================================================================== */
.prompts-section {
  padding: 4.5rem 1.5rem;
  position: relative;
}

.preset-chips-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.preset-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover, .preset-chip.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
  color: #c084fc;
}

.tags-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  align-items: center;
}

.tag-insert-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-insert-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
}

.prompt-textarea {
  width: 100%;
  min-height: 240px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.55;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.prompt-textarea:focus {
  border-color: var(--border-focus);
}

/* ===================================================================
   FAQ & Troubleshooting Accordion
   =================================================================== */
.faq-section {
  padding: 4.5rem 1.5rem;
  background: var(--bg-main);
}

.faq-accordion {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-toggle-icon {
  font-size: 1.25rem;
  color: #60a5fa;
  transition: transform 0.25s ease;
}

.faq-item.open .faq-toggle-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
  animation: fadeIn 0.2s ease;
}

.faq-answer code {
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* ===================================================================
   Instrukcja Krok po Kroku
   =================================================================== */
.instructions-section {
  padding: 4.5rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.steps-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.inst-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  position: relative;
}

.inst-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.inst-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.inst-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===================================================================
   Footer & Toast
   =================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-main);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ===================================================================
   Responsywność (Mobile / Tablet)
   =================================================================== */
@media (max-width: 768px) {
  .hero {
    padding: 3.5rem 1rem 2.5rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .btn-github span {
    display: none;
  }
}
