/* Ülésrend V3, domi29 dark terminal UI */

:root {
  --bg: #060608;
  --surface: rgba(12, 12, 16, 0.97);
  --surface-2: rgba(18, 18, 24, 0.98);
  --surface-elevated: rgba(24, 24, 32, 0.98);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text-primary: #f0f0f4;
  --text-secondary: #8b8b9e;
  --text-muted: #52526a;
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.35);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #eab308;
  --dot-red: #ff5f57;
  --dot-yellow: #ffbd2e;
  --dot-green: #28c840;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --grid-size: 18px;
  --header-bg: rgba(6, 6, 8, 0.82);
  --canvas-bg: #0a0a0e;
  --canvas-grid-dot: rgba(255, 255, 255, 0.06);
  --canvas-hint-bg: rgba(12, 12, 16, 0.6);
  --tooltip-bg: #0e0c16;
  --grid-line: rgba(255, 255, 255, 0.025);
  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  --generate-label-bg: rgba(8, 10, 18, 0.82);
  --purple: #a855f7;
  --purple-text: #c4b5fd;
  --purple-dim: rgba(139, 92, 246, 0.14);
  --purple-border: rgba(139, 92, 246, 0.32);
  --inset-bg: rgba(0, 0, 0, 0.22);
  --inset-border: rgba(255, 255, 255, 0.08);
  --kbd-bg: rgba(0, 0, 0, 0.38);
  --kbd-fg: var(--text-secondary);
  --kbd-border: var(--border);
  --smart-banner-bg: rgba(139, 92, 246, 0.1);
  --smart-banner-fg: #c4b5fd;
  --smart-banner-border: rgba(139, 92, 246, 0.28);
  --ghost-hover-bg: rgba(255, 255, 255, 0.04);
  --tool-icon-bg: rgba(255, 255, 255, 0.05);
  --statusbar-bg: var(--surface);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--scrollbar-thumb) 100%, white 25%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 15%, transparent 72%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 50% 40% at 10% 15%,
      rgba(59, 130, 246, 0.14),
      transparent 65%
    ),
    radial-gradient(
      ellipse 45% 35% at 90% 80%,
      rgba(34, 197, 94, 0.06),
      transparent 65%
    );
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.app-header__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.beta-badge {
  position: relative;
  display: inline-flex;
  text-decoration: none;
  pointer-events: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 11px;
  border-radius: 999px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.38);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.18);
  cursor: pointer;
  user-select: none;
  animation: beta-badge-pulse 2.4s ease-in-out infinite;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.beta-badge:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

.beta-badge:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.55);
  outline-offset: 3px;
}

.beta-badge__tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: min(300px, 70vw);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(14, 10, 10, 0.96);
  color: #fecaca;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.45;
  text-transform: none;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0.2s;
  pointer-events: none;
}

.beta-badge__tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(239, 68, 68, 0.28);
}

.beta-badge:hover .beta-badge__tooltip,
.beta-badge:focus-visible .beta-badge__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.beta-badge__cta {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: #f87171;
}

@keyframes beta-badge-pulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.32);
  }
}

.app-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 20px;
}

.site-home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}

.site-home:hover .site-home__sub {
  color: var(--text-primary);
}

.site-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.site-home__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.site-home__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.site-home__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-home__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

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

.app-header__title h1 {
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.25);
  flex-shrink: 0;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.classroom-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-theme-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.header-theme-btn .theme-icon {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.header-theme-btn .theme-icon--to-light {
  opacity: 1;
}

.header-theme-btn .theme-icon--to-dark {
  opacity: 0;
  position: absolute;
}

html[data-theme="light"] .header-theme-btn .theme-icon--to-light {
  opacity: 0;
}

html[data-theme="light"] .header-theme-btn .theme-icon--to-dark {
  opacity: 1;
}

.header-theme-btn:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.header-theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.account-wrap {
  position: relative;
}

.account-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.account-btn svg {
  width: 18px;
  height: 18px;
}

.account-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.account-btn--logged-in {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
  z-index: 100;
  animation: menu-pop 0.22s var(--ease);
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-menu > .open-onboarding-btn {
  margin-bottom: 6px;
}

.account-menu__section + .account-menu__section,
.account-menu > .open-onboarding-btn + .account-menu__section {
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.account-menu__hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
  padding: 0 4px;
}

.account-menu__name {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px 2px;
}

.account-menu__email {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.account-menu__link,
.account-menu__item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.account-menu__link:hover,
.account-menu__item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.account-menu__link--accent {
  color: var(--accent);
  font-weight: 500;
}

.account-menu__item--danger {
  color: var(--red);
}

.account-menu__item--danger:hover {
  background: var(--red-dim);
  color: var(--red);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 2.4s ease infinite;
}

.app-header__path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* Layout */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.sidebar-stack {
  display: grid;
  grid-template: 1fr / 1fr;
  align-items: start;
}

.sidebar-pane {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition:
    opacity 0.62s var(--ease),
    transform 0.62s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.62s var(--ease),
    visibility 0.62s;
  will-change: opacity, transform;
}

.sidebar-pane--edit {
  z-index: 1;
}

.sidebar-pane--smart {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(36px) scale(0.94) rotate(0.8deg);
  filter: blur(4px);
  pointer-events: none;
}

body.is-smart-mode .sidebar-pane--edit {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-36px) scale(0.94) rotate(-0.8deg);
  filter: blur(4px);
  pointer-events: none;
}

body.is-smart-mode .sidebar-pane--smart {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  pointer-events: auto;
  overflow: visible;
}

.smart-mode-entry {
  animation: fade-up 0.5s var(--ease) 0.1s both;
}

.smart-mode-entry--smart-pane {
  animation: none;
  opacity: 0;
  transform: translateY(12px);
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease),
    max-height 0.5s var(--ease),
    margin 0.5s var(--ease),
    padding 0.5s var(--ease);
}

body.is-smart-mode .smart-mode-entry--smart-pane {
  opacity: 1;
  transform: none;
  max-height: 96px;
  margin-top: 8px;
  padding-top: 6px;
  overflow: visible;
}

.smart-mode-toggle--sidebar {
  width: 100%;
  justify-content: center;
  padding: 14px 16px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.smart-mode-toggle--sidebar .smart-mode-toggle__icon {
  width: 24px;
  height: 24px;
}

.smart-mode-toggle__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  pointer-events: none;
}

.smart-mode-toggle:hover .smart-mode-toggle__shimmer,
.smart-mode-toggle.is-active .smart-mode-toggle__shimmer {
  animation: smart-shimmer 2.8s ease infinite;
}

@keyframes smart-shimmer {
  0% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(120%);
  }
}

.smart-mode-toggle--exit {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface-2);
  color: var(--text-secondary);
}

.smart-mode-toggle--exit:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  animation: fade-up 0.45s var(--ease) both;
}

.panel--students {
  animation-delay: 0.06s;
}

.panel--smart {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow:
    var(--shadow),
    0 0 48px rgba(139, 92, 246, 0.1);
  overflow: visible;
  transition:
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    transform 0.55s var(--ease);
}

.smart-body {
  overflow: visible;
}

.panel--smart.panel--smart-enter {
  animation: smart-panel-pop 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes smart-panel-pop {
  0% {
    opacity: 0.6;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

body.is-smart-mode #smartPanelBody.is-replaying .smart-block--anim {
  animation: smart-block-in 0.58s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(0.05s + var(--smart-i, 0) * 0.08s);
}

@keyframes smart-block-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.panel__head--smart {
  align-items: flex-start;
}

.panel__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.smart-live-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
  flex-shrink: 0;
  animation: smart-pill-pulse 2.2s ease infinite;
}

@keyframes smart-pill-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
  }
}

/* Okos mód kapcsoló */
.smart-mode-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.16),
    rgba(59, 130, 246, 0.08)
  );
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.35s var(--ease),
    background 0.35s var(--ease),
    color 0.35s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.35s var(--ease);
}

.smart-mode-toggle__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 62%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.smart-mode-toggle__icon {
  display: flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.smart-mode-toggle__icon svg {
  width: 100%;
  height: 100%;
}

.smart-mode-toggle:hover {
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.2);
}

.smart-mode-toggle--sidebar:hover {
  transform: none;
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.22);
}

.smart-mode-toggle:hover .smart-mode-toggle__glow {
  opacity: 1;
}

.smart-mode-toggle.is-active {
  border-color: rgba(167, 139, 250, 0.65);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.32),
    rgba(59, 130, 246, 0.14)
  );
  color: #f5f3ff;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.25),
    0 12px 32px rgba(139, 92, 246, 0.28);
}

.smart-mode-toggle.is-active .smart-mode-toggle__glow {
  opacity: 1;
}

.smart-mode-toggle.is-active .smart-mode-toggle__icon svg {
  filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.8));
}

/* Globális okos mód */
body.is-smart-mode {
  --smart-accent: #8b5cf6;
  --smart-accent-dim: rgba(139, 92, 246, 0.14);
}

body.is-smart-mode .bg-glow {
  background:
    radial-gradient(ellipse 80% 55% at 12% -8%, rgba(139, 92, 246, 0.22), transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 12%, rgba(59, 130, 246, 0.14), transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(139, 92, 246, 0.08), transparent 65%);
}

body.is-smart-mode .app-header {
  border-bottom-color: rgba(139, 92, 246, 0.12);
}

body.is-smart-mode .workspace {
  position: relative;
}

body.is-smart-mode .smart-mode-banner {
  opacity: 1;
  transform: translateY(0);
  max-height: 40px;
}

.smart-mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--smart-banner-border);
  background: var(--smart-banner-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--smart-banner-fg);
  letter-spacing: 0.04em;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease),
    max-height 0.45s var(--ease),
    margin 0.45s var(--ease);
}

.smart-mode-banner__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.8);
  animation: pulse-dot 2s ease infinite;
}

body.is-smart-mode .toolbar-group--edit-only {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  max-width: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  pointer-events: none;
  visibility: hidden;
}

.toolbar-group--edit-only {
  transition:
    opacity 0.42s var(--ease),
    transform 0.42s var(--ease),
    max-width 0.42s var(--ease),
    visibility 0.42s;
}

body.is-smart-mode .primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.35),
    0 14px 36px rgba(124, 58, 237, 0.35);
}

body.is-smart-mode .canvas-panel {
  border-color: rgba(139, 92, 246, 0.32);
  box-shadow:
    var(--shadow),
    0 0 60px rgba(139, 92, 246, 0.12);
}

body.is-smart-mode .canvas-panel__chrome {
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.12),
    rgba(0, 0, 0, 0.25)
  );
}

body.is-smart-mode .chrome-title {
  color: #c4b5fd;
}

body.is-smart-mode .canvas.snap {
  background-color: rgba(8, 6, 14, 0.92);
}

body.is-smart-transition .app-layout::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(139, 92, 246, 0.12),
    transparent 65%
  );
  animation: smart-veil 0.52s var(--ease) forwards;
}

@keyframes smart-veil {
  0% {
    opacity: 0;
    transform: scale(1.02);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.01);
  }
}

body.is-smart-transition .sidebar-pane,
body.is-smart-transition .toolbar-group--edit-only,
body.is-smart-transition .smart-mode-banner,
body.is-smart-transition .smart-mode-entry,
body.is-smart-transition .canvas-panel {
  transition-duration: 0.62s;
}

body.is-smart-transition .smart-mode-toggle--sidebar {
  animation: smart-btn-glow 0.62s var(--ease);
}

@keyframes smart-btn-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
  }
  45% {
    box-shadow: 0 0 28px rgba(139, 92, 246, 0.35);
  }
}

body.is-smart-mode .smart-list {
  max-height: 200px;
}

.smart-block {
  overflow: visible;
}

.smart-block + .smart-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.smart-block__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Custom checkbox */
.ccheck {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.ccheck__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ccheck__box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.2s var(--ease);
}

.ccheck__tick {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.4) rotate(-12deg);
  transition:
    opacity 0.22s var(--ease),
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ccheck.is-checked .ccheck__box {
  border-color: rgba(139, 92, 246, 0.65);
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}

.ccheck.is-checked .ccheck__tick {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.ccheck:hover .ccheck__box {
  border-color: rgba(167, 139, 250, 0.5);
  transform: scale(1.06);
}

.ccheck.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ccheck__text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ccheck--smart.is-checked .ccheck__text {
  color: var(--text-primary);
}

/* Fix hely: vászon választás */
.smart-fix-add--pick {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: stretch;
}

.smart-fix-add--pick #fixStudentWrap {
  grid-column: 1;
}

.smart-fix-add--pick .fix-seat-pick-btn {
  grid-column: 2;
}

.smart-fix-add--pick #addFixSeatBtn {
  grid-column: 3;
  align-self: center;
}

.fix-seat-pick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
  color: #c4b5fd;
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.25s,
    background 0.25s,
    box-shadow 0.25s,
    color 0.25s;
}

.fix-seat-pick-btn__icon {
  display: flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  animation: fix-pick-icon-spin 4s linear infinite;
  opacity: 0.85;
}

.fix-seat-pick-btn.is-picking .fix-seat-pick-btn__icon {
  animation: fix-pick-icon-spin 1.2s linear infinite;
  color: #e9d5ff;
}

@keyframes fix-pick-icon-spin {
  to {
    transform: rotate(360deg);
  }
}

.fix-seat-pick-btn__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fix-seat-pick-btn:hover {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.12);
}

.fix-seat-pick-btn.is-picking,
.fix-seat-pick-btn.has-seat {
  border-style: solid;
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.14);
  color: #f5f3ff;
}

/* Fix hely: ülés választás infobar (külön a toast rendszertől) */
.fix-seat-pick-hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2800;
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(14, 12, 22, 0.96);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(16px);
  transition:
    opacity 0.28s var(--ease),
    transform 0.28s var(--ease),
    visibility 0.28s;
}

.fix-seat-pick-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.fix-seat-pick-hint__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 120% at 20% 50%,
    rgba(139, 92, 246, 0.18),
    transparent 70%
  );
  opacity: 0.8;
}

.fix-seat-pick-hint__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  box-sizing: border-box;
}

.fix-seat-pick-hint__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
}

.fix-seat-pick-hint__icon svg {
  width: 18px;
  height: 18px;
}

.fix-seat-pick-hint__body {
  flex: 1;
  min-width: 0;
}

.fix-seat-pick-hint__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 3px;
}

.fix-seat-pick-hint__msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
}

.fix-seat-pick-hint__cancel {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.fix-seat-pick-hint__cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

body.is-fix-seat-pick .canvas.canvas--pick-fix-seat {
  outline: 2px solid rgba(139, 92, 246, 0.35);
  outline-offset: 2px;
  cursor: crosshair;
}

.seat.seat--pick-target {
  cursor: pointer;
  animation: seat-pick-pulse 1.4s ease infinite;
}

.seat.seat--pick-target:hover {
  border-color: rgba(167, 139, 250, 0.7) !important;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
}

.seat.seat--pick-selected {
  border-color: rgba(34, 197, 94, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3), 0 0 18px rgba(34, 197, 94, 0.2);
}

@keyframes seat-pick-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
  }
  50% {
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
  }
}

.smart-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 8px;
}

.smart-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.smart-field {
  min-width: 0;
  width: 100%;
  display: block;
}

.smart-pair-add,
.smart-fix-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.smart-pair-add .accent-btn,
.smart-fix-add .accent-btn {
  align-self: center;
  flex-shrink: 0;
}

/* Custom dropdown */
.cselect {
  position: relative;
  width: 100%;
  min-width: 0;
  display: block;
}

.cselect__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.22s var(--ease),
    background 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.cselect__trigger:hover:not(:disabled) {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cselect__trigger.has-value {
  border-color: rgba(139, 92, 246, 0.25);
}

.cselect.is-open .cselect__trigger {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), 0 8px 24px rgba(139, 92, 246, 0.12);
}

.cselect__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect__label.is-placeholder {
  color: var(--text-muted);
}

.cselect__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.28s var(--ease), color 0.2s;
}

.cselect__chevron svg {
  width: 100%;
  height: 100%;
}

.cselect.is-open .cselect__chevron {
  transform: rotate(180deg);
  color: #c4b5fd;
}

.cselect__menu {
  position: fixed;
  z-index: 2500;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(14, 12, 22, 0.98);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(139, 92, 246, 0.15);
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  animation: cselect-menu-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  backdrop-filter: blur(12px);
}

.cselect__menu[hidden] {
  display: none !important;
}

@keyframes cselect-menu-in {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.cselect__option {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}

.cselect__option:hover,
.cselect__option:focus {
  background: rgba(139, 92, 246, 0.14);
  color: var(--text-primary);
  outline: none;
  transform: translateX(3px);
}

.cselect__option.is-selected {
  background: rgba(139, 92, 246, 0.22);
  color: #e9d5ff;
  font-weight: 500;
}

.cselect__option[data-value=""] {
  color: var(--text-muted);
  font-style: italic;
}

.cselect.is-disabled .cselect__trigger {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.smart-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.smart-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  color: var(--text-secondary);
  transition:
    border-color 0.2s,
    transform 0.2s var(--ease);
}

.smart-list__item--enter {
  animation: smart-list-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes smart-list-in {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.smart-list__item:hover {
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(2px);
}

.smart-list__item-text {
  min-width: 0;
  line-height: 1.35;
}

.smart-list__item-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.smart-list__remove {
  border: none;
  background: var(--red-dim);
  color: var(--red);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.smart-list__remove:hover {
  background: rgba(239, 68, 68, 0.25);
}

.student-item__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.student-action-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.student-action-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.student-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.student-action-btn.is-active {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.12);
  color: var(--yellow);
}

.student-action-btn svg {
  width: 14px;
  height: 14px;
}

.seat {
  position: relative;
}

.seat--locked {
  border-color: rgba(234, 179, 8, 0.45) !important;
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.15);
}

.seat-lock-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.seat:hover .seat-lock-btn,
.seat--locked .seat-lock-btn,
.seat-lock-btn:focus-visible {
  opacity: 1;
}

.seat-lock-btn.is-active {
  color: var(--yellow);
  background: rgba(234, 179, 8, 0.2);
}

.seat-lock-btn svg {
  width: 12px;
  height: 12px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.panel__head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
}

/* Tools */
.tool-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.tool:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateX(3px);
}

.tool.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.08));
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12), 0 8px 24px rgba(59, 130, 246, 0.12);
}

.tool__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tool-icon-bg);
  flex-shrink: 0;
}

.tool__icon svg {
  width: 18px;
  height: 18px;
}

.tool.active .tool__icon {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent);
}

.tool__icon--teacher {
  color: var(--orange);
}

.tool.active .tool__icon--teacher {
  background: var(--orange-dim);
  color: var(--orange);
}

.tool__label {
  line-height: 1.3;
}

/* Inputs & buttons */
.custom-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.custom-input::placeholder {
  color: var(--text-muted);
}

.custom-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.add-row .custom-input {
  flex: 1;
}

.accent-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s var(--ease),
    filter 0.2s;
}

.accent-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  padding: 0;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn-ghost,
.students-panel button.wide,
.file-actions .wide {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.btn-ghost:hover,
.students-panel button.wide:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--ghost-hover-bg);
}

.btn-ghost:disabled,
.control:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Student list */
.student-list {
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--inset-border);
  background: var(--inset-bg);
}

.student-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: grab;
  transition:
    border-color 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.student-item:last-child {
  margin-bottom: 0;
}

.student-item:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.student-item.assigned {
  opacity: 0.72;
  border-color: rgba(34, 197, 94, 0.2);
}

.student-item .left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-item .left > div:first-child {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-item .badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-dim);
  color: var(--green);
  flex-shrink: 0;
}

.student-item .student-action-btn--delete {
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
}

.student-item .student-action-btn--delete:hover:not(:disabled) {
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--red);
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 8px;
}

/* Workspace */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  animation: fade-up 0.5s var(--ease) 0.08s both;
}

.workspace-toolbar {
  display: block;
  min-width: 0;
  padding: 2px 0;
}

.toolbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.toolbar-cluster {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

.toolbar-cluster--main {
  flex: 1 1 auto;
  flex-wrap: wrap;
  row-gap: 10px;
}

.toolbar-cluster--end {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.toolbar-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.toolbar-block--primary {
  padding-top: 17px;
}

.toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.toolbar-label {
  display: block;
  height: 12px;
  line-height: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
  white-space: nowrap;
  user-select: none;
}

.toolbar-vrule {
  align-self: stretch;
  width: 1px;
  min-height: 38px;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.toolbar-vrule--before-end {
  display: none;
}

.toolbar-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.toolbar-actions .control,
.toolbar-actions .toggle-grid-btn,
.toolbar-block--primary .primary {
  min-height: 38px;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .toolbar-vrule--before-end {
    display: block;
  }

  .toolbar-cluster--main {
    flex-wrap: nowrap;
  }
}

.control--toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.control__ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.control--cloud-save {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
}

.control--cloud-save:hover {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
}

.control--cloud-save .control__ico {
  opacity: 1;
}

/* Portál tooltip (data-tip) */
.ui-tooltip {
  position: fixed;
  z-index: 3600;
  max-width: min(300px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: var(--tooltip-bg);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.18s var(--ease),
    transform 0.18s var(--ease),
    visibility 0.18s;
}

.ui-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ui-tooltip--above.is-visible {
  transform: translateY(0);
}

.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 28px var(--accent-glow);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s var(--ease),
    filter 0.2s;
}

.primary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

#generateBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.3);
  box-shadow: none;
}

.control,
.toggle-grid-btn {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.control:hover,
.toggle-grid-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--surface-elevated);
  transform: translateY(-1px);
}

.toggle-grid-btn[aria-pressed="true"],
.toggle-grid-btn.is-on {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Canvas panel */
.canvas-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.canvas-panel__chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.canvas-print-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.canvas-print-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.canvas-print-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--surface-elevated);
}

.chrome-dots {
  display: flex;
  gap: 6px;
}

.chrome-dots span:nth-child(1) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-red);
}

.chrome-dots span:nth-child(2) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-yellow);
}

.chrome-dots span:nth-child(3) {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-green);
}

.chrome-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

#canvasContainer,
.canvas {
  position: relative;
  background: var(--canvas-bg);
  outline: none;
  overflow: auto;
  min-height: 200px;
  width: 100%;
  max-width: 100%;
}

#canvasContainer {
  width: 900px;
  height: 520px;
  max-width: 100%;
}

#canvasContainer::before,
.canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    var(--canvas-grid-dot) 1px,
    transparent 1px
  );
  background-size: var(--grid-size) var(--grid-size);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

#canvasContainer.snap::before,
.canvas.snap::before {
  opacity: 0.75;
}

#canvasContainer.grid-anim::before {
  animation: grid-pulse 0.55s var(--ease);
}

@keyframes grid-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

.canvas-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 20px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--canvas-hint-bg);
  backdrop-filter: blur(8px);
}

.canvas-hint__icon {
  font-size: 22px;
  color: var(--accent);
  opacity: 0.7;
}

/* Ülésrend generálás animáció */
.generate-fx {
  --gen-accent: #3b82f6;
  --gen-accent-soft: rgba(59, 130, 246, 0.45);
  --gen-glow: rgba(59, 130, 246, 0.2);
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
  overflow: hidden;
}

.generate-fx--smart {
  --gen-accent: #a78bfa;
  --gen-accent-soft: rgba(167, 139, 250, 0.55);
  --gen-glow: rgba(139, 92, 246, 0.28);
}

.generate-fx.is-active {
  opacity: 1;
}

.generate-fx__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at 50% 45%,
    var(--gen-glow),
    transparent 72%
  );
  opacity: 0;
}

.generate-fx.is-active .generate-fx__veil {
  animation: gen-veil 1.15s ease-out forwards;
}

.generate-fx__ripple {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 2px solid var(--gen-accent-soft);
  opacity: 0;
  transform: scale(0.2);
}

.generate-fx__ripple--delay {
  animation-delay: 0.18s;
}

.generate-fx.is-active .generate-fx__ripple {
  animation: gen-ripple 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.generate-fx__burst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
}

.generate-fx__burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--gen-accent);
  box-shadow: 0 0 10px var(--gen-accent-soft);
  opacity: 0;
}

.generate-fx__burst span:nth-child(1) {
  --gen-a: 0deg;
  --gen-r: 52px;
}
.generate-fx__burst span:nth-child(2) {
  --gen-a: 45deg;
  --gen-r: 68px;
}
.generate-fx__burst span:nth-child(3) {
  --gen-a: 90deg;
  --gen-r: 44px;
}
.generate-fx__burst span:nth-child(4) {
  --gen-a: 135deg;
  --gen-r: 72px;
}
.generate-fx__burst span:nth-child(5) {
  --gen-a: 180deg;
  --gen-r: 56px;
}
.generate-fx__burst span:nth-child(6) {
  --gen-a: 225deg;
  --gen-r: 64px;
}
.generate-fx__burst span:nth-child(7) {
  --gen-a: 270deg;
  --gen-r: 48px;
}
.generate-fx__burst span:nth-child(8) {
  --gen-a: 315deg;
  --gen-r: 76px;
}

.generate-fx.is-active .generate-fx__burst span {
  animation: gen-spark 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.generate-fx__burst span:nth-child(odd) {
  animation-delay: 0.08s;
}

.generate-fx__label {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%) translateY(12px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gen-accent-soft);
  background: var(--generate-label-bg);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  opacity: 0;
  white-space: nowrap;
}

.generate-fx.is-active .generate-fx__label {
  animation: gen-label 1s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

.generate-fx__label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gen-accent);
  box-shadow: 0 0 12px var(--gen-accent);
  animation: gen-label-pulse 0.9s ease-in-out infinite;
}

.canvas--generating {
  animation: canvas-gen-breathe 1.15s ease-in-out;
}

.canvas--generating-smart {
  animation-name: canvas-gen-breathe-smart;
}

.seat.seat--generating {
  animation: seat-slot-pulse 0.9s ease-in-out calc(var(--gen-i, 0) * 35ms) 2;
}

.canvas--generating:not(.canvas--generating-smart) .seat.seat--generating.empty {
  border-color: rgba(59, 130, 246, 0.4) !important;
}

.canvas--generating-smart .seat.seat--generating.empty {
  border-color: rgba(167, 139, 250, 0.5) !important;
}

.desk.desk--deal {
  animation: desk-deal-lift 0.72s cubic-bezier(0.16, 1, 0.3, 1)
    calc(var(--gen-i, 0) * 45ms) both;
}

#generateBtn.is-generating {
  pointer-events: none;
  animation: gen-btn-pulse 0.8s ease-in-out infinite;
}

.student-chip--reveal {
  animation: chip-reveal 0.44s ease-out both;
}

.canvas--generating-smart .student-chip--reveal {
  animation-name: chip-reveal-smart;
}

@keyframes gen-veil {
  0% {
    opacity: 0;
  }
  25%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes gen-ripple {
  0% {
    opacity: 0.85;
    transform: scale(0.15);
  }
  100% {
    opacity: 0;
    transform: scale(14);
  }
}

@keyframes gen-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--gen-a)) translateX(0) scale(0.3);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--gen-a)) translateX(var(--gen-r)) scale(0);
  }
}

@keyframes gen-label {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gen-label-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

@keyframes canvas-gen-breathe {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08) saturate(1.1);
  }
}

@keyframes canvas-gen-breathe-smart {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1) saturate(1.15) hue-rotate(-8deg);
  }
}

@keyframes seat-slot-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
    background: transparent;
  }
  50% {
    box-shadow: inset 0 0 22px rgba(59, 130, 246, 0.22);
    background: rgba(255, 255, 255, 0.04);
  }
}

.canvas--generating-smart .seat.seat--generating {
  animation-name: seat-slot-pulse-smart;
}

@keyframes seat-slot-pulse-smart {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
    background: transparent;
  }
  50% {
    box-shadow: inset 0 0 22px rgba(139, 92, 246, 0.28);
    background: rgba(139, 92, 246, 0.06);
  }
}

@keyframes chip-reveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chip-reveal-smart {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    filter: brightness(1.2);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes desk-deal-lift {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  40% {
    transform: translateY(-5px) scale(1.02);
    filter: brightness(1.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes gen-btn-pulse {
  0%,
  100% {
    box-shadow: 0 8px 28px var(--accent-glow);
  }
  50% {
    box-shadow:
      0 8px 36px var(--accent-glow),
      0 0 24px rgba(59, 130, 246, 0.28);
  }
}

body.is-smart-mode #generateBtn.is-generating {
  animation-name: gen-btn-pulse-smart;
}

@keyframes gen-btn-pulse-smart {
  0%,
  100% {
    box-shadow: 0 14px 36px rgba(124, 58, 237, 0.35);
  }
  50% {
    box-shadow:
      0 14px 40px rgba(124, 58, 237, 0.5),
      0 0 28px rgba(139, 92, 246, 0.35);
  }
}

/* Desks */
.desk {
  position: absolute;
  min-width: 140px;
  max-width: 260px;
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  cursor: grab;
  user-select: none;
  padding: 0;
  overflow: hidden;
  transition:
    left 0.1s var(--ease),
    top 0.1s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.desk.pop {
  animation: desk-pop 0.35s var(--ease);
}

.desk--teacher {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.08);
}

.desk--single .desk-header strong::before {
  content: "1× ";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.desk--double .desk-header strong::before {
  content: "2× ";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.desk .desk-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.desk .desk-header strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk--teacher .desk-header strong {
  color: var(--orange);
}

.desk .desk-actions {
  margin-left: auto;
}

.desk .small-btn {
  border: none;
  background: var(--red-dim);
  color: var(--red);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.desk .small-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

.desk .seat-row {
  display: flex;
  gap: 6px;
  padding: 8px;
  flex-wrap: wrap;
}

.desk.selected {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.2),
    0 20px 48px rgba(59, 130, 246, 0.15);
  z-index: 50;
}

/* Seats */
.seat {
  min-width: 76px;
  flex: 1;
  min-height: 44px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    box-shadow 0.15s;
}

.seat.empty {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
}

.seat.flash {
  animation: seat-flash 0.4s var(--ease);
}

@keyframes seat-flash {
  0% {
    background: rgba(0, 0, 0, 0.35);
  }
  40% {
    background: var(--accent-dim);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 20px var(--accent-glow);
  }
  100% {
    background: rgba(0, 0, 0, 0.35);
  }
}

.student-chip {
  display: block;
  max-width: 100%;
  word-break: break-word;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  cursor: grab;
  transition:
    transform 0.12s var(--ease),
    box-shadow 0.12s;
}

.student-chip.dragging {
  transform: scale(0.96) rotate(-1deg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
  z-index: 20;
}

.student-chip--moving {
  z-index: 15;
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.35);
}

.student-chip--drop-in {
  animation: chip-drop-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chip-drop-in {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.seat[data-type="teacher"] {
  min-width: 120px;
  background: var(--orange-dim);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
}

/* Statusbar */
.statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--statusbar-bg);
}

.stat--accent {
  color: var(--green);
}

.stat-sep {
  opacity: 0.4;
}

.statusbar__tip {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.statusbar__tip kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--kbd-border);
  background: var(--kbd-bg);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: var(--kbd-fg);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[aria-hidden="false"] {
  display: flex;
}

#cloudSaveModal[aria-hidden="false"],
#classroomsModal[aria-hidden="false"] {
  z-index: 1250;
}

#confirmModal[aria-hidden="false"],
#duplicateClassroomModal[aria-hidden="false"] {
  z-index: 1300;
}

#viewportWarningModal[aria-hidden="false"] {
  z-index: 1400;
}

.modal-content--viewport-warning {
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(249, 115, 22, 0.12);
}

.modal-content--viewport-warning h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.modal-content--viewport-warning p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
}

.modal-content--viewport-warning p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.viewport-warning__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--orange-dim);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.viewport-warning__icon svg {
  width: 24px;
  height: 24px;
}

.modal-actions--single {
  justify-content: stretch;
}

.modal-actions--single .accent-btn {
  width: 100%;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-content--compact h3 {
  margin-bottom: 8px;
}

.modal-content--compact p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-animate {
  animation: modal-pop 0.3s var(--ease);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-sub--accent {
  color: #c4b5fd;
  margin-top: -10px;
  margin-bottom: 14px;
}

.modal-row-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-preview {
  margin-top: 16px;
}

.preview-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#previewDimensions {
  font-family: var(--font-mono);
  color: var(--accent);
}

.preview-frame {
  height: 140px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.canvas-preview {
  background: #0a0a0e;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  transition:
    width 0.2s var(--ease),
    height 0.2s var(--ease);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.secondary-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.secondary-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.modal-content--size {
  width: min(560px, 100%);
}

.size-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.size-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.size-preset:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.size-preset.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.size-preset__name {
  font-size: 13px;
  font-weight: 600;
}

.size-preset__dim {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.size-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.size-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.size-preview-room {
  position: relative;
  background: #0a0a0e;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition:
    width 0.25s var(--ease),
    height 0.25s var(--ease);
}

.size-preview-room__grid {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
  opacity: 0.7;
}

.size-preview-room__desk {
  position: absolute;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.size-preview-room__desk--teacher {
  top: 10%;
  left: 50%;
  width: 28%;
  height: 14%;
  transform: translateX(-50%);
  background: var(--orange-dim);
  border-color: rgba(249, 115, 22, 0.35);
}

.size-preview-room__desk--a {
  top: 38%;
  left: 18%;
  width: 22%;
  height: 16%;
}

.size-preview-room__desk--b {
  top: 38%;
  right: 18%;
  width: 22%;
  height: 16%;
}

.size-preview-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.size-preview-label--w {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.size-preview-label--h {
  right: -8px;
  top: 50%;
  transform: translate(100%, -50%) rotate(90deg);
  transform-origin: left center;
}

.size-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.size-control__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.size-control__head label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.size-control__value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.size-range {
  width: 100%;
  height: 6px;
  margin-bottom: 8px;
  appearance: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.size-range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0a0e;
  box-shadow: 0 0 12px var(--accent-glow);
  cursor: grab;
}

.size-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0a0e;
  box-shadow: 0 0 12px var(--accent-glow);
  cursor: grab;
}

.size-stepper {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.size-stepper .size-input-num {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.size-stepper .size-input-num::-webkit-outer-spin-button,
.size-stepper .size-input-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-stepper__btns {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  isolation: isolate;
}

.size-stepper__btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 23px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}

.size-stepper__btn + .size-stepper__btn {
  border-top: 1px solid var(--border);
}

.size-stepper__btn:first-child {
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
}

.size-stepper__btn:last-child {
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
}

.size-stepper__btn svg {
  width: 14px;
  height: 14px;
}

.size-stepper__btn:hover:not(:disabled) {
  background: var(--accent-dim);
  color: var(--accent);
}

.size-stepper__btn:active:not(:disabled) {
  background: rgba(59, 130, 246, 0.22);
}

.size-stepper__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.size-input-num {
  font-family: var(--font-mono);
  font-size: 13px;
}

.size-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.modal-content--wide {
  width: 480px;
}

.modal-content--save {
  width: 440px;
}

.modal-content--print {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.print-modal__layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-height: min(520px, 72vh);
}

.print-preview-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 20px;
}

.print-preview-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.print-preview {
  position: relative;
  flex: 1;
  min-height: 420px;
  height: min(560px, 68vh);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #e8e8ec;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.print-options {
  flex: 0 0 272px;
  width: 272px;
  display: flex;
  flex-direction: column;
  padding-left: 20px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  max-height: min(580px, 70vh);
}

.print-preview__page {
  position: relative;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #b8b8b8;
  border-radius: 4px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.print-preview__page--landscape::after {
  content: "Fekvő";
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #999;
  pointer-events: none;
}

.print-preview__page--portrait::after {
  content: "Álló";
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #999;
  pointer-events: none;
}

.print-preview__shell {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(var(--preview-scale, 0.5));
  transform-origin: center center;
}

.print-preview .print-preview__shell > * {
  pointer-events: none;
}

/* Előnézet – fehér nyomtatási kinézet */
.print-preview #canvasContainer,
.print-preview .canvas,
.print-preview .print-preview__shell > div {
  background: #fff !important;
}

.print-preview #canvasContainer::before,
.print-preview .canvas::before {
  display: block !important;
  opacity: 1 !important;
  background-image: radial-gradient(
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px
  ) !important;
  background-size: var(--grid-size) var(--grid-size) !important;
}

.print-preview .canvas.snap::before,
.print-preview #canvasContainer.snap::before {
  opacity: 1 !important;
}

.print-preview--no-grid #canvasContainer::before,
.print-preview--no-grid .canvas::before {
  display: none !important;
}

.print-preview--no-headers .desk-header {
  display: none !important;
}

.print-preview--no-empty .seat.empty {
  display: none !important;
}

.print-preview .desk,
.print-preview .desk--teacher {
  background: #fff !important;
  border: 1px solid #c4c4c4 !important;
  box-shadow: none !important;
}

.print-preview .desk--teacher {
  border-color: #e07a2f !important;
}

.print-preview .desk .desk-header {
  background: #fff !important;
  border-bottom: 1px solid #d8d8d8 !important;
}

.print-preview .desk .desk-header strong {
  color: #333 !important;
}

.print-preview .desk--teacher .desk-header strong {
  color: #c2410c !important;
}

.print-preview .seat,
.print-preview .seat.empty {
  background: #fff !important;
  border: 1px dashed #b0b0b0 !important;
  color: #888 !important;
}

.print-preview .seat[data-type="teacher"] {
  border: 1px solid #e07a2f !important;
  color: #c2410c !important;
}

.print-preview .student-chip {
  background: #fff !important;
  border: 1px solid #d0d0d0 !important;
  color: #111 !important;
  box-shadow: none !important;
}

.print-fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.print-fieldset__legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.print-orient {
  display: flex;
  gap: 10px;
}

.print-orient__opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.print-orient__opt:has(input:checked) {
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--accent-dim);
  color: var(--text-primary);
}

.print-orient__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.print-orient__box {
  display: block;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: 0.85;
}

.print-orient__box--landscape {
  width: 44px;
  height: 28px;
}

.print-orient__box--portrait {
  width: 28px;
  height: 44px;
}

.print-opt-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.print-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.print-opt:hover {
  background: rgba(255, 255, 255, 0.03);
}

.print-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.print-opt__switch {
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  margin-top: 2px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  position: relative;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.print-opt__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease);
}

.print-opt:has(input:checked) .print-opt__switch {
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, 0.4);
}

.print-opt:has(input:checked) .print-opt__switch::after {
  transform: translateX(16px);
  background: var(--accent);
}

.print-opt__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.print-opt__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.print-opt__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

#printModalRun {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#printModalRun svg {
  width: 18px;
  height: 18px;
}

.save-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.save-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease),
    background 0.2s var(--ease);
}

.save-choice-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.save-choice-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.save-choice-card__icon svg {
  width: 18px;
  height: 18px;
}

.save-choice-card__icon--json {
  background: var(--orange-dim);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.save-choice-card__icon--cloud {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.save-choice-card__title {
  font-size: 14px;
  font-weight: 600;
}

.save-choice-card__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.load-choice-cloud {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.save-choice-card--cloud-center {
  width: calc(50% - 5px);
  align-items: center;
  text-align: center;
}

.classrooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.classroom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.classroom-item__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.classroom-item__info strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-item__info span {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.classroom-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.classroom-item__duplicate {
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent);
}

.classroom-item__actions .control {
  padding: 6px 10px;
  font-size: 12px;
}

.classroom-item__delete {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Toasts */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  pointer-events: auto;
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(14, 14, 20, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateX(calc(100% + 28px)) scale(0.94);
  transition:
    opacity 0.38s var(--ease),
    transform 0.38s var(--ease);
  cursor: pointer;
}

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

.toast.is-exiting {
  opacity: 0;
  transform: translateX(calc(100% + 28px)) scale(0.92);
  transition-duration: 0.28s;
}

.toast__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.toast__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 16px;
}

.toast__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.toast__icon svg {
  width: 17px;
  height: 17px;
}

.toast__body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.toast__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.toast__msg {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
}

.toast__undo {
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.toast__undo:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
}

.toast__undo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toast__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -2px -2px 0 0;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}

.toast__close svg {
  width: 14px;
  height: 14px;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.toast__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  animation: toast-progress linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast--info {
  border-color: rgba(59, 130, 246, 0.22);
}

.toast--info .toast__glow {
  background: radial-gradient(
    ellipse 80% 120% at 0% 50%,
    rgba(59, 130, 246, 0.18),
    transparent 70%
  );
}

.toast--info .toast__icon {
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--accent);
}

.toast--info .toast__label {
  color: var(--accent);
}

.toast--info .toast__progress {
  background: linear-gradient(90deg, var(--accent), rgba(59, 130, 246, 0.4));
}

.toast--success {
  border-color: rgba(34, 197, 94, 0.22);
}

.toast--success .toast__glow {
  background: radial-gradient(
    ellipse 80% 120% at 0% 50%,
    rgba(34, 197, 94, 0.16),
    transparent 70%
  );
}

.toast--success .toast__icon {
  background: var(--green-dim);
  border-color: rgba(34, 197, 94, 0.28);
  color: var(--green);
}

.toast--success .toast__label {
  color: var(--green);
}

.toast--success .toast__progress {
  background: linear-gradient(90deg, var(--green), rgba(34, 197, 94, 0.4));
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.22);
}

.toast--error .toast__glow {
  background: radial-gradient(
    ellipse 80% 120% at 0% 50%,
    rgba(239, 68, 68, 0.16),
    transparent 70%
  );
}

.toast--error .toast__icon {
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.28);
  color: var(--red);
}

.toast--error .toast__label {
  color: var(--red);
}

.toast--error .toast__progress {
  background: linear-gradient(90deg, var(--red), rgba(239, 68, 68, 0.4));
}

@media (max-width: 480px) {
  .toast-container {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .toast {
    transform: translateY(calc(100% + 20px)) scale(0.96);
  }

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

  .toast.is-exiting {
    transform: translateY(calc(100% + 20px)) scale(0.94);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animations */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes desk-pop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modal-pop {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive */
@media (max-width: 720px) {
  .app-header__center {
    display: none;
  }
}

@media (max-width: 960px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .classroom-badge {
    display: none;
  }

  .save-choice-grid {
    grid-template-columns: 1fr;
  }

  .save-choice-card--cloud-center {
    width: 100%;
  }

  .size-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .size-editor {
    grid-template-columns: 1fr;
  }

  .modal-content--wide,
  .modal-content--print,
  .modal-content--save,
  .modal-content--size {
    width: 100%;
  }

  .print-modal__layout {
    flex-direction: column;
    min-height: 0;
  }

  .print-preview-wrap {
    padding-right: 0;
  }

  .print-preview {
    min-height: 260px;
    height: min(320px, 45vh);
  }

  .print-options {
    flex: none;
    width: 100%;
    max-height: none;
    padding-left: 0;
    padding-top: 16px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

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

  .toolbar-cluster--main,
  .toolbar-cluster--end {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar-cluster--end {
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .toolbar-vrule,
  .toolbar-vrule--before-end {
    display: none;
  }

  .toolbar-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .statusbar__tip {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  #canvasContainer {
    width: 100%;
    height: min(520px, 60vh);
  }
}

@media (max-width: 520px) {
  .app-header__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .app-header__title {
    order: 3;
    width: 100%;
  }

  .toolbar-block {
    width: 100%;
  }

  .toolbar-block--primary {
    padding-top: 0;
  }

  .primary,
  .control--toolbar,
  .toggle-grid-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beta-badge,
  .generate-fx,
  .generate-fx__ripple,
  .generate-fx__burst span,
  .generate-fx__label,
  .generate-fx__label-dot,
  .student-chip--drop-in,
  .student-chip--reveal,
  .student-chip--moving,
  .desk.desk--deal,
  .seat.seat--generating,
  .canvas--generating,
  .smart-live-pill {
    animation: none !important;
  }

  .beta-badge__tooltip,
  .sidebar-pane,
  .toolbar-group--edit-only,
  .smart-mode-banner,
  .canvas-panel,
  .smart-mode-toggle,
  .smart-block--anim,
  .smart-list__item--enter,
  .cselect__menu,
  .panel--smart-enter,
  .ccheck__tick,
  .fix-seat-pick-btn__icon,
  .seat--pick-target,
  .fix-seat-pick-hint,
  .ui-tooltip {
    transition: none !important;
    animation: none !important;
  }

  body.is-smart-mode .sidebar-pane--smart,
  body.is-smart-mode .sidebar-pane--edit {
    filter: none;
  }

  body.is-smart-transition .app-layout::after {
    animation: none !important;
    display: none;
  }
}

/* Nyomtatás – csak a fehér vászon */
@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .bg-grid,
  .bg-glow,
  .app-header,
  .sidebar,
  .workspace-toolbar,
  .statusbar,
  .toast-container,
  .canvas-panel__chrome,
  .canvas-hint,
  .generate-fx,
  .desk-actions {
    display: none !important;
  }

  main,
  .app-layout,
  .workspace {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    animation: none !important;
    background: #fff !important;
  }

  .canvas-panel {
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
    page-break-inside: avoid;
    transform: scale(var(--print-scale, 1));
    transform-origin: top center;
    max-width: 100%;
  }

  #canvasContainer {
    position: relative !important;
    overflow: visible !important;
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  #canvasContainer::before {
    opacity: 0.45 !important;
    background-image: radial-gradient(
      rgba(0, 0, 0, 0.14) 1px,
      transparent 1px
    ) !important;
    background-size: var(--grid-size) var(--grid-size) !important;
  }

  html.print-no-grid #canvasContainer::before {
    display: none !important;
  }

  html.print-no-headers .desk-header {
    display: none !important;
  }

  html.print-no-empty .seat.empty {
    display: none !important;
  }

  .desk,
  .desk .desk-header,
  .seat,
  .student-chip,
  .seat[data-type="teacher"] {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .desk,
  .desk.selected,
  .desk--teacher,
  .desk--teacher.selected {
    background: #fff !important;
    border: 1px solid #c4c4c4 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: default !important;
    z-index: auto !important;
  }

  .desk--teacher,
  .desk--teacher.selected {
    border-color: #e07a2f !important;
  }

  .desk .desk-header {
    background: #fff !important;
    border-bottom: 1px solid #d8d8d8 !important;
  }

  .desk .desk-header strong,
  .desk--teacher .desk-header strong {
    color: #333 !important;
  }

  .desk--single .desk-header strong::before,
  .desk--double .desk-header strong::before {
    color: #2563eb !important;
  }

  .desk--teacher .desk-header strong {
    color: #c2410c !important;
  }

  .seat,
  .seat.empty {
    background: #fff !important;
    border: 1px dashed #b0b0b0 !important;
    color: #888 !important;
  }

  .seat.empty {
    font-family: var(--font-mono) !important;
  }

  .seat[data-type="teacher"] {
    background: #fff !important;
    border: 1px solid #e07a2f !important;
    color: #c2410c !important;
  }

  .student-chip,
  .student-chip--moving,
  .student-chip--drop-in {
    background: #fff !important;
    border: 1px solid #d0d0d0 !important;
    color: #111 !important;
    box-shadow: none !important;
    cursor: default !important;
    animation: none !important;
    transform: none !important;
  }

  .desk.desk--deal,
  .canvas--generating {
    animation: none !important;
  }
}
