/* ============ ULTRA PRO LAYER v=97 ============
 * Comprehensive design system - czytelność WCAG AAA.
 * Każda powierzchnia ma jednoznaczne kolory tekstu.
 */

/* ============ DESIGN TOKENS ============ */
:root {
  /* Surfaces - tła z gradacją od najjaśniejszego */
  --surface-paper: #FFFFFF;
  --surface-cream: #FAF8F2;
  --surface-sand: #F5EFE2;
  --surface-warm: #FFF8E8;
  --surface-glass: rgba(255, 252, 245, 0.92);
  /* Dark surfaces */
  --surface-espresso: #1F1208;
  --surface-charcoal: #1A1612;
  --surface-bronze: #6B4523;
  /* Text colors - na jasnym tle */
  --text-on-light-strong: #1A1612;
  --text-on-light: #2A1810;
  --text-on-light-muted: #4A3826;
  --text-on-light-faint: #6B5440;
  /* Text colors - na ciemnym tle */
  --text-on-dark-strong: #FFFFFF;
  --text-on-dark: #F5EFE2;
  --text-on-dark-muted: #C9A876;
  --text-on-dark-faint: rgba(232, 200, 150, 0.75);
  /* Accents - złoto/brąz */
  --accent-gold-light: #E8C896;
  --accent-gold: #C9A876;
  --accent-gold-dark: #9F7F4F;
  --accent-bronze: #6B4523;
  --accent-warm-light: #FFF8E8;
  --accent-warm: #FDF1D6;
  /* Semantyczne */
  --semantic-ok: #2D7A3F;
  --semantic-warn: #C84A4A;
  --semantic-info: #1F5FA0;
  /* Borders */
  --border-light: rgba(42, 24, 16, 0.10);
  --border-strong: rgba(42, 24, 16, 0.22);
  --border-gold: rgba(201, 168, 118, 0.45);
  --border-dark: rgba(255, 255, 255, 0.12);
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(42, 24, 16, 0.05);
  --shadow-soft: 0 2px 8px rgba(42, 24, 16, 0.07), 0 1px 2px rgba(42, 24, 16, 0.04);
  --shadow-md: 0 8px 24px rgba(42, 24, 16, 0.10), 0 2px 6px rgba(42, 24, 16, 0.06);
  --shadow-lg: 0 16px 48px rgba(42, 24, 16, 0.14);
  --shadow-xl: 0 24px 64px rgba(42, 24, 16, 0.18);
  --shadow-gold: 0 6px 20px rgba(159, 127, 79, 0.35);
  --shadow-glow-gold: 0 0 32px rgba(232, 200, 150, 0.35);
  /* Aliases (compat) */
  --gold-light: var(--accent-gold-light);
  --gold: var(--accent-gold);
  --gold-dark: var(--accent-gold-dark);
  --bronze: var(--accent-bronze);
  --espresso: var(--surface-espresso);
  --charcoal: var(--surface-charcoal);
  --text-primary: var(--text-on-light-strong);
  --text-secondary: var(--text-on-light);
  --text-muted: var(--text-on-light-faint);
  --cream: var(--surface-cream);
  --paper: var(--surface-paper);
  --surface: var(--surface-paper);
  --surface-elevated: var(--surface-paper);
  --border: var(--border-light);
}

/* ============ UI ICONS ============ */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  margin-right: 0.4em;
  color: inherit;
  line-height: 1;
}
.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
  overflow: visible;
}
/* Wszystkie przyciski - flex centered jako baza */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  line-height: 1;
}
/* Ikona jako JEDYNE dziecko przycisku (icon-only button) - bez margin */
button > .ui-icon:only-child,
button:empty + .ui-icon,
.icon-btn .ui-icon {
  margin: 0;
}
/* Ikona NA POCZĄTKU przycisku - usuń margin-right (gap robi to) */
button .ui-icon { margin-right: 0; }
.btn-primary .ui-icon,
.chip.active .ui-icon,
.dir-chip.active .ui-icon,
.tab.active .ui-icon { color: white; }
.fab .ui-icon { color: white; width: 1.4em; height: 1.4em; }
.fab { display: inline-flex; align-items: center; justify-content: center; }
h2 .ui-icon, h3 .ui-icon {
  color: var(--gold-dark);
  margin-right: 0.4em;
  vertical-align: -0.08em;
}
.empty-icon .ui-icon {
  width: 3rem;
  height: 3rem;
  color: var(--gold);
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.toolbar .ui-icon {
  color: var(--gold-dark);
  margin-right: 0.4em;
}
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
}
.icon-btn .ui-icon {
  width: 1.25em;
  height: 1.25em;
}
/* Inside text (nagłówki / paragrafy) - margin tylko jeśli jest tekst po */
p .ui-icon, span .ui-icon, label .ui-icon, strong .ui-icon {
  margin-right: 0.3em;
  vertical-align: -0.15em;
}

:root {
  --gold-light: #E8C896;
  --gold: #C9A876;
  --gold-dark: #9F7F4F;
  --bronze: #6B4523;
  --espresso: #1F1208;
  --charcoal: #1A1612;
  --text-primary: #1A1612;
  --text-secondary: #4A3826;
  --text-muted: #6B5440;
  --cream: #FAF8F2;
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --border: rgba(42, 24, 16, 0.12);
  --border-strong: rgba(42, 24, 16, 0.2);
  --shadow-soft: 0 2px 8px rgba(42, 24, 16, 0.06), 0 1px 2px rgba(42, 24, 16, 0.04);
  --shadow-md: 0 8px 24px rgba(42, 24, 16, 0.1), 0 2px 6px rgba(42, 24, 16, 0.06);
  --shadow-lg: 0 16px 48px rgba(42, 24, 16, 0.14);
  --shadow-gold: 0 6px 20px rgba(159, 127, 79, 0.3);
}

/* ============ TYPOGRAPHY MOCNA ============ */
body, html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
}
body { background: var(--cream); }

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--espresso);
  line-height: 1.2;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 2.25rem; font-weight: 800; }
h3 { font-size: 1.3rem; }
p { color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }

/* ============ HEADER ============ */
.app-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 2px 12px rgba(42,24,16,0.05);
}
.brand-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  border-radius: 12px;
  box-shadow: var(--shadow-gold), 0 1px 0 rgba(255,255,255,0.4) inset;
  position: relative;
  overflow: hidden;
}
.brand-icon::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 40%);
  pointer-events: none;
}
#header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--espresso);
  letter-spacing: -0.01em;
}
.header-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ HERO - mocny ============ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 2.25rem 2rem;
  background:
    linear-gradient(135deg, #FFFCF6 0%, #FAF1E2 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.hero::before {
  content: "";
  position: absolute;
  top: -40%; right: -15%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(201,168,118,0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-text h2 {
  font-size: 2.25rem;
  color: var(--espresso);
  margin-bottom: 0.6rem;
}
.hero-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
}

/* ============ CARDS - solid czytelne ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--espresso);
}
.info-card {
  background: linear-gradient(135deg, #FFF8E8 0%, #FDF1D6 100%);
  border-color: rgba(201, 168, 118, 0.35);
}
.info-card p { color: var(--bronze); }

/* ============ BUTTONS - kontrast ============ */
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(159, 127, 79, 0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  filter: brightness(1.05);
}
.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.btn-primary.big {
  padding: 1.05rem 1.8rem;
  font-size: 1rem;
  border-radius: 12px;
}

/* Secondary button */
button:not(.btn-primary):not(.icon-btn):not(.fab):not(.tab):not(.chip):not(.dir-chip):not(.wood-skin-chip) {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  padding: 0.6rem 1rem;
  border-radius: 9px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
button:not(.btn-primary):not(.icon-btn):not(.fab):not(.tab):not(.chip):not(.dir-chip):not(.wood-skin-chip):hover {
  border-color: var(--gold-dark);
  background: #FFFAF0;
}

/* ============ CHIPS - kontrast ============ */
.chip, .dir-chip {
  border-radius: 9px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  transition: all 0.18s ease;
  cursor: pointer;
}
.chip:hover, .dir-chip:hover {
  border-color: var(--gold);
  background: #FFF8EC;
  color: var(--espresso);
}
.chip.active, .dir-chip.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

/* ============ TABS - czytelne ============ */
.tabs {
  background: var(--surface);
  border-radius: 12px;
  padding: 0.3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 0.2rem;
}
.tab {
  border-radius: 9px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
  cursor: pointer;
}
.tab:hover {
  background: rgba(201,168,118,0.1);
  color: var(--espresso);
}
.tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(159,127,79,0.3);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

/* ============ INPUTS - czytelne ============ */
label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.18s ease;
  margin-top: 0.3rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 4px rgba(201, 168, 118, 0.2);
}
::placeholder { color: var(--text-muted); opacity: 1; }

/* ============ FAB ============ */
.fab {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-gold), inset 0 2px 4px rgba(255,255,255,0.25);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.fab:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(159, 127, 79, 0.45);
}

/* ============ HERO STATS ============ */
.hero-stats {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.hero-stats > div {
  flex: 1;
  min-width: 110px;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}
.hero-stats strong {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--bronze);
  margin-bottom: 0.15rem;
}
.hero-stats span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============ FP FEATS PILLS ============ */
.fp-feats { text-align: center; margin: 1rem 0; }
.fp-feats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  padding: 0.55rem 1.1rem;
  margin: 0.3rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bronze);
  transition: all 0.2s ease;
  line-height: 1.2;
}
.fp-feats span .ui-icon {
  margin: 0 !important;
  width: 1.4em;
  height: 1.4em;
  color: var(--bronze);
}
.fp-feats span .ui-icon svg {
  stroke-width: 2.4;
}
.fp-feats span:hover .ui-icon { color: white; }
.fp-feats span:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.empty-state h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--espresso);
}
.empty-state p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}
.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

/* ============ TOOLBAR ============ */
.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}
.toolbar input, .toolbar select {
  margin-top: 0;
}

/* ============ ICON BTN ============ */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.icon-btn:hover {
  background: #FFF8EC;
  border-color: var(--gold);
}

/* ============ SCROLLBAR PREMIUM ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 10px;
  border: 2px solid var(--cream);
}

/* ============ SMOOTH PAGE TRANSITIONS ============ */
.view {
  animation: viewFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ SPLASH PREMIUM v=84 ============ */
#splash {
  background: radial-gradient(ellipse at center, #2A1810 0%, #1A0F08 70%, #0A0503 100%) !important;
}
#splash::before {
  background: radial-gradient(circle at 50% 50%, rgba(232,200,150,0.2) 0%, transparent 50%) !important;
  animation: splashGlow 3s ease-in-out infinite !important;
}
.splash-logo {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 5rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.015em !important;
  background: linear-gradient(180deg, #FFF8EE 0%, #F0DCB0 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  position: relative !important;
  animation: splashLogoFadeUp 1.6s cubic-bezier(0.19, 1, 0.22, 1) both !important;
  filter: drop-shadow(0 6px 24px rgba(31, 18, 8, 0.4)) drop-shadow(0 0 40px rgba(232, 200, 150, 0.18)) !important;
}
/* Subtelny glow zamiast tandetnego shimmer */
.splash-logo::after {
  content: "";
  position: absolute;
  inset: -20px -40px;
  background: radial-gradient(ellipse at center, rgba(232, 200, 150, 0.22) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
  animation: splashLogoGlow 5s ease-in-out infinite 1.2s;
}
.splash-tagline {
  font-family: 'Inter', sans-serif !important;
  letter-spacing: 0.5em !important;
  font-weight: 300 !important;
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
  color: rgba(232, 200, 150, 0.7) !important;
  animation: splashTaglineIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards !important;
  margin-top: 0.5rem !important;
}
.splash-bar {
  width: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #C9A876, transparent) !important;
  margin-top: 2rem !important;
  animation: splashBarGrow 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards !important;
  box-shadow: 0 0 12px rgba(232,200,150,0.6) !important;
}
@keyframes splashLogoEntrance {
  0% { opacity: 0; transform: translateY(20px) scale(0.92); filter: blur(8px); }
  60% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
/* v=293: refined logo animation - cinematic, no gauche shimmer */
@keyframes splashLogoFadeUp {
  0% { opacity: 0; transform: translateY(28px); letter-spacing: -0.03em; filter: blur(14px) drop-shadow(0 0 0 transparent); }
  50% { filter: blur(0) drop-shadow(0 6px 24px rgba(31, 18, 8, 0.4)) drop-shadow(0 0 40px rgba(232, 200, 150, 0.18)); }
  100% { opacity: 1; transform: translateY(0); letter-spacing: 0.015em; filter: blur(0) drop-shadow(0 6px 24px rgba(31, 18, 8, 0.4)) drop-shadow(0 0 40px rgba(232, 200, 150, 0.18)); }
}
@keyframes splashLogoGlow {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes splashTaglineIn {
  0% { opacity: 0; letter-spacing: 0.2em; transform: translateY(8px); }
  100% { opacity: 1; letter-spacing: 0.5em; transform: translateY(0); }
}
@keyframes splashBarGrow {
  to { width: 240px; }
}
@keyframes splashGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes goldShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============ KATALOG PANELI v=90 ============ */
#cat-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem !important;
  margin-top: 1rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.pc-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--cream);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.pc-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: var(--cream);
}
.prod-preview-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.pc-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.pc-thumb-photos {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--espresso);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: all 0.2s ease;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}
.pc-thumb-photos:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.pc-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.pc-mfr {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.pc-body h4 {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--espresso);
  line-height: 1.2;
}
.pc-dims { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.pc-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background: #F5EFE2;
  color: var(--bronze);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.pc-tag-wear { background: linear-gradient(135deg, #EFE5D2, #DFD0B0); color: var(--espresso); }
.pc-tag-water { background: #DCEFFA; color: #1F5FA0; border-color: rgba(31,95,160,0.2); }
.pc-bottom {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pc-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}
.pc-price strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--espresso);
}
.pc-price span { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.pc-pack { font-size: 0.75rem; color: var(--text-muted); }

/* ============ PRODUCT PREVIEW MODAL ============ */
.prod-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(26, 22, 18, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: prevOverlayIn 0.25s ease;
}
@keyframes prevOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.prod-preview-modal {
  background: var(--paper);
  border-radius: 22px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: prevModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes prevModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.prod-preview-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid var(--border) !important;
  color: var(--espresso) !important;
  font-size: 1.2rem !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  padding: 0 !important;
}
.prod-preview-close:hover { background: white !important; }
.prod-preview-hero {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  background-color: var(--cream);
  position: relative;
}
.prod-preview-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}
.prod-preview-hero-note {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.prod-preview-realphotos {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: var(--espresso);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.7rem 1.3rem;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  z-index: 2;
  white-space: nowrap;
}
.prod-preview-realphotos:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

.prod-preview-quicklinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.ql-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem 0.5rem;
  background: linear-gradient(135deg, #FFF8E8 0%, #FDF1D6 100%);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  color: var(--espresso);
}
.ql-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.ql-btn .ql-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.ql-btn .ql-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--espresso);
}
.ql-btn .ql-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.prod-preview-body { padding: 1.75rem 2rem 2rem; }
.prod-preview-mfr {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.3rem;
}
.prod-preview-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--espresso);
  line-height: 1.1;
}
.prod-preview-model {
  font-size: 1.05rem;
  color: var(--bronze);
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}
.prod-preview-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.prod-preview-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.75rem;
}
.prod-spec {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.prod-spec span { color: var(--text-muted); }
.prod-spec strong { color: var(--espresso); font-weight: 700; }
.prod-preview-pick {
  width: 100% !important;
  font-size: 1.05rem !important;
}
@media (max-width: 640px) {
  .prod-preview-modal { border-radius: 16px; }
  .prod-preview-hero { height: 200px; }
  .prod-preview-body { padding: 1.25rem 1.25rem 1.5rem; }
  .prod-preview-body h2 { font-size: 1.5rem; }
  .prod-preview-specs { grid-template-columns: 1fr; gap: 0; }
}

/* ============ CAD-LIKE POLYGON EDITOR — PREMIUM v=102 ============ */
/* Top bar + vertical left sidebar + canvas (autocad-style) */
* { box-sizing: border-box; }
.cad-layout {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem !important;
  box-sizing: border-box;
  width: 100%;
  max-width: 100% !important;
  height: calc(100vh - 70px);
  overflow: hidden;
}
/* === FULL-SCREEN MODE (floating panels overlay) === */
.cad-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 50;
  background: #1A0F08;
}
body:has(.cad-fullscreen) .app-header { display: none !important; }
.cad-canvas-fullscreen {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}
.cad-canvas-fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
}
/* Floating top bar - centrum, sticky pod safe-area-inset-top */
.cad-floating {
  position: fixed;
  z-index: 100;
  background: linear-gradient(180deg, rgba(31, 18, 8, 0.92) 0%, rgba(20, 9, 10, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 118, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}
.cad-floating-top {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  max-width: calc(100vw - 24px);
}
.cad-floating-left {
  top: 80px;
  left: 12px;
  max-height: calc(100vh - 100px);
  display: flex;
  align-items: flex-start;
}
.cad-floating-right {
  top: 80px;
  right: 12px;
  max-height: calc(100vh - 100px);
  display: flex;
  align-items: flex-start;
}
.cad-floating-left.collapsed {
  transform: translateX(calc(-100% + 32px));
}
.cad-floating-right.collapsed {
  transform: translateX(calc(100% - 32px));
}
.cad-floating-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 56px;
  background: rgba(201, 168, 118, 0.18);
  border: 1px solid rgba(201, 168, 118, 0.35);
  color: #E8C896;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cad-floating-toggle:hover { background: rgba(232, 200, 150, 0.3); }
.cad-floating-left .cad-floating-toggle {
  right: -26px;
  border-radius: 0 12px 12px 0;
  border-left: none;
}
.cad-floating-right .cad-floating-toggle {
  left: -26px;
  border-radius: 12px 0 0 12px;
  border-right: none;
}
.cad-floating-left.collapsed .cad-floating-toggle::before { content: "›"; }
.cad-floating-left .cad-floating-toggle::before { content: "‹"; }
.cad-floating-right.collapsed .cad-floating-toggle::before { content: "‹"; }
.cad-floating-right .cad-floating-toggle::before { content: "›"; }
.cad-floating-left .cad-floating-toggle, .cad-floating-right .cad-floating-toggle { font-size: 0; }
.cad-floating-left .cad-floating-toggle::before, .cad-floating-right .cad-floating-toggle::before { font-size: 1.1rem; }
/* Sidebar/props gdy floating */
.cad-sidebar-floating {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  max-height: calc(100vh - 110px) !important;
  width: auto;
  min-width: 90px;
}
.cad-props-floating {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 290px;
  max-width: 320px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 0.5rem;
}
/* Floating Save button - bottom right */
.cad-floating-save {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 110;
  background: linear-gradient(180deg, #B97D43 0%, #8B5A2B 100%);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(139, 90, 43, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}
.cad-floating-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 90, 43, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.cad-floating-save svg { width: 20px; height: 20px; }
/* ============================================================
   ===== PRO MODAL DESIGN SYSTEM v=216 =====
   Premium glass morphism + smooth animations + design tokens
   ============================================================ */

/* === BACKDROP === */
[style*="position:fixed"][style*="inset:0"][style*="rgba(0,0,0"] {
  background: linear-gradient(135deg, rgba(15, 8, 4, 0.78) 0%, rgba(31, 18, 8, 0.85) 100%) !important;
  backdrop-filter: blur(16px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
  animation: fpModalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 1.5rem !important;
}
@keyframes fpModalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(16px); }
}

/* === MODAL CARD === */
[style*="position:fixed"][style*="inset:0"] > div:not([style*="z-index"]):first-child,
[style*="position:fixed"][style*="inset:0"] > div[style*="background:white"],
[style*="position:fixed"][style*="inset:0"] > div[style*="background: white"],
[style*="position:fixed"][style*="inset:0"] > div[style*="background:#fff"] {
  background: linear-gradient(180deg, #FFFCF6 0%, #FFF4DC 100%) !important;
  border: 1px solid rgba(201, 168, 118, 0.5) !important;
  box-shadow:
    0 32px 96px rgba(75, 50, 25, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(232, 200, 150, 0.15) !important;
  border-radius: 20px !important;
  animation: fpModalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden !important;
}
@keyframes fpModalSlideUp {
  from { transform: translateY(40px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* === HEADER (gold gradient bar) === */
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"],
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"],
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg, #C9A876"],
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg, #C9A876"] {
  background: linear-gradient(135deg, #D4AB75 0%, #B97D43 50%, #8B5A2B 100%) !important;
  padding: 1.3rem 1.8rem !important;
  position: relative !important;
  box-shadow: 0 2px 12px rgba(139, 90, 43, 0.25) !important;
}
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"]::before,
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"]::after,
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"]::after {
  content: "";
  position: absolute;
  bottom: 0; left: 1.5rem; right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"] h2,
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"] h3,
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"] h2,
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"] h3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18) !important;
  position: relative !important;
  z-index: 1 !important;
}
[style*="position:fixed"][style*="inset:0"] [style*="background:linear-gradient(135deg,#C9A876,#9F7F4F)"] p,
[style*="position:fixed"][style*="inset:0"] [style*="background: linear-gradient(135deg,#C9A876,#9F7F4F)"] p {
  opacity: 0.92 !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.01em !important;
  position: relative !important;
  z-index: 1 !important;
}

/* === MODAL BODY (content area) === */
[style*="position:fixed"][style*="inset:0"] > div > div:nth-child(2),
[style*="position:fixed"][style*="inset:0"] [style*="padding:1.2rem"],
[style*="position:fixed"][style*="inset:0"] [style*="padding: 1.2rem"],
[style*="position:fixed"][style*="inset:0"] [style*="padding:1.5rem"],
[style*="position:fixed"][style*="inset:0"] [style*="padding: 1.5rem"] {
  padding: 1.6rem 1.8rem !important;
  color: #4A3520 !important;
}

/* === LABELS === */
[style*="position:fixed"][style*="inset:0"] label {
  display: block !important;
  margin-bottom: 1.1rem !important;
  font-size: 0.92rem !important;
  color: #6B4523 !important;
}
[style*="position:fixed"][style*="inset:0"] label strong {
  display: block !important;
  font-weight: 600 !important;
  color: #5A3A1A !important;
  font-size: 0.82rem !important;
  margin-bottom: 0.4rem !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
}
[style*="position:fixed"][style*="inset:0"] label small {
  display: block !important;
  margin-top: 0.3rem !important;
  font-size: 0.75rem !important;
  color: #9F7F4F !important;
  opacity: 0.85 !important;
}

/* === INPUTS === */
[style*="position:fixed"][style*="inset:0"] input[type="text"],
[style*="position:fixed"][style*="inset:0"] input[type="email"],
[style*="position:fixed"][style*="inset:0"] input[type="password"],
[style*="position:fixed"][style*="inset:0"] input[type="number"],
[style*="position:fixed"][style*="inset:0"] input[type="search"],
[style*="position:fixed"][style*="inset:0"] input[type="tel"],
[style*="position:fixed"][style*="inset:0"] input[type="url"],
[style*="position:fixed"][style*="inset:0"] select,
[style*="position:fixed"][style*="inset:0"] textarea {
  background: rgba(255, 252, 246, 0.85) !important;
  border: 1.5px solid rgba(201, 168, 118, 0.4) !important;
  border-radius: 10px !important;
  padding: 0.75rem 0.9rem !important;
  font-size: 0.95rem !important;
  color: #4A3520 !important;
  font-family: 'Inter', sans-serif !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: inset 0 1px 2px rgba(75, 50, 25, 0.06) !important;
}
[style*="position:fixed"][style*="inset:0"] input:hover,
[style*="position:fixed"][style*="inset:0"] select:hover,
[style*="position:fixed"][style*="inset:0"] textarea:hover {
  border-color: rgba(185, 125, 67, 0.55) !important;
  background: rgba(255, 252, 246, 1) !important;
}
[style*="position:fixed"][style*="inset:0"] input:focus,
[style*="position:fixed"][style*="inset:0"] select:focus,
[style*="position:fixed"][style*="inset:0"] textarea:focus {
  background: white !important;
  border-color: #B97D43 !important;
  box-shadow:
    0 0 0 4px rgba(185, 125, 67, 0.15),
    inset 0 1px 2px rgba(75, 50, 25, 0.04) !important;
  outline: none !important;
}
[style*="position:fixed"][style*="inset:0"] input::placeholder,
[style*="position:fixed"][style*="inset:0"] textarea::placeholder {
  color: rgba(159, 127, 79, 0.55) !important;
}

/* === BUTTONS === */
[style*="position:fixed"][style*="inset:0"] .btn-primary,
[style*="position:fixed"][style*="inset:0"] button.btn-primary {
  background: linear-gradient(180deg, #D4AB75 0%, #B97D43 100%) !important;
  border: none !important;
  color: white !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  padding: 0.85rem 1.2rem !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.01em !important;
  cursor: pointer !important;
  box-shadow:
    0 4px 14px rgba(185, 125, 67, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18) !important;
}
[style*="position:fixed"][style*="inset:0"] .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 8px 20px rgba(185, 125, 67, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
[style*="position:fixed"][style*="inset:0"] .btn-primary:active {
  transform: translateY(0) !important;
}
[style*="position:fixed"][style*="inset:0"] .btn-secondary {
  background: rgba(232, 200, 150, 0.18) !important;
  border: 1px solid rgba(201, 168, 118, 0.4) !important;
  color: #6B4523 !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  padding: 0.7rem 1.1rem !important;
  font-size: 0.92rem !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}
[style*="position:fixed"][style*="inset:0"] .btn-secondary:hover {
  background: rgba(232, 200, 150, 0.32) !important;
  border-color: rgba(185, 125, 67, 0.55) !important;
  color: #5A3A1A !important;
}

/* === CLOSE BUTTON (×) === */
[style*="position:fixed"][style*="inset:0"] button[id*="close"],
[style*="position:fixed"][style*="inset:0"] button[id*="-close"] {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: white !important;
  border-radius: 10px !important;
  width: 34px !important;
  height: 34px !important;
  font-size: 1.3rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 2 !important;
  position: relative !important;
}
[style*="position:fixed"][style*="inset:0"] button[id*="close"]:hover,
[style*="position:fixed"][style*="inset:0"] button[id*="-close"]:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: rotate(90deg) scale(1.05) !important;
}

/* === LINKS w modali === */
[style*="position:fixed"][style*="inset:0"] a {
  color: #B97D43 !important;
  text-decoration: none !important;
  border-bottom: 1px dotted rgba(185, 125, 67, 0.5) !important;
  transition: all 0.15s ease !important;
}
[style*="position:fixed"][style*="inset:0"] a:hover {
  color: #8B5A2B !important;
  border-bottom-color: #8B5A2B !important;
  border-bottom-style: solid !important;
}

/* === LIST ITEMS / KEYS === */
[style*="position:fixed"][style*="inset:0"] kbd {
  background: rgba(75, 50, 25, 0.12) !important;
  border: 1px solid rgba(75, 50, 25, 0.18) !important;
  border-bottom-width: 2px !important;
  border-radius: 5px !important;
  padding: 0.15rem 0.5rem !important;
  font-family: 'SF Mono', Consolas, monospace !important;
  font-size: 0.8rem !important;
  color: #4A3520 !important;
  box-shadow: 0 1px 0 rgba(75, 50, 25, 0.08) !important;
}

/* === HEADINGS w body modal === */
[style*="position:fixed"][style*="inset:0"] [style*="padding:1.2rem"] h3,
[style*="position:fixed"][style*="inset:0"] [style*="padding: 1.2rem"] h3 {
  color: #6B4523 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  margin: 1.6rem 0 0.8rem 0 !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 1px solid rgba(201, 168, 118, 0.25) !important;
}

/* === COLOR INPUT === */
[style*="position:fixed"][style*="inset:0"] input[type="color"] {
  width: 60px !important;
  height: 44px !important;
  padding: 4px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  background: white !important;
}

/* === CHECKBOX === */
[style*="position:fixed"][style*="inset:0"] input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  accent-color: #B97D43 !important;
  cursor: pointer !important;
}

/* === FILE input === */
[style*="position:fixed"][style*="inset:0"] input[type="file"] {
  background: rgba(255, 248, 232, 0.6) !important;
  border: 2px dashed rgba(201, 168, 118, 0.5) !important;
  border-radius: 12px !important;
  padding: 1.4rem !important;
  font-size: 0.92rem !important;
  color: #6B4523 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
[style*="position:fixed"][style*="inset:0"] input[type="file"]:hover {
  background: rgba(255, 248, 232, 0.9) !important;
  border-color: #B97D43 !important;
}

/* === STATUS / hint elementy === */
[style*="position:fixed"][style*="inset:0"] [id*="status"],
[style*="position:fixed"][style*="inset:0"] [style*="font-style:italic"],
[style*="position:fixed"][style*="inset:0"] [style*="font-style: italic"] {
  font-style: normal !important;
  background: rgba(232, 200, 150, 0.18) !important;
  border-left: 3px solid #B97D43 !important;
  padding: 0.7rem 1rem !important;
  border-radius: 6px !important;
  margin-top: 1rem !important;
  font-size: 0.88rem !important;
}

/* === PRO USER DROPDOWN MENU === */
.fp-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  background: linear-gradient(180deg, #FFFCF6 0%, #FFF4DC 100%);
  color: #3A2515;
  border-radius: 16px;
  box-shadow:
    0 24px 64px rgba(75, 50, 25, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  min-width: 280px;
  overflow: hidden;
  z-index: 9999;
  border: 1px solid rgba(201, 168, 118, 0.4);
  animation: fpUserDropdownIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fpUserDropdownIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fp-user-dropdown-header {
  padding: 1.2rem 1.3rem 1rem;
  border-bottom: 1px solid rgba(201, 168, 118, 0.25);
  background: linear-gradient(135deg, rgba(232, 200, 150, 0.18), rgba(255, 248, 232, 0.5));
  position: relative;
}
.fp-user-dropdown-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 1.3rem; right: 1.3rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 118, 0.5), transparent);
}
.fp-user-dropdown-name {
  font-weight: 700;
  color: #5A3A1A;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.fp-user-dropdown-email {
  font-size: 0.78rem;
  color: #9F7F4F;
  margin-top: 0.25rem;
  word-break: break-all;
}
.fp-user-dropdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  background: linear-gradient(135deg, #FF8A65 0%, #E64A19 100%);
  color: white;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(230, 74, 25, 0.35);
}
.fp-user-dropdown-section {
  padding: 0.4rem 0;
}
.fp-user-dropdown-section + .fp-user-dropdown-section {
  border-top: 1px solid rgba(201, 168, 118, 0.25);
}
.user-menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
  padding: 0.75rem 1.3rem !important;
  color: #6B4523 !important;
  text-decoration: none !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: none !important;
  border: none !important;
  width: 100% !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  border-radius: 0 !important;
  border-left: 3px solid transparent !important;
}
.user-menu-item:hover {
  background: linear-gradient(90deg, rgba(232, 200, 150, 0.35), rgba(232, 200, 150, 0.1)) !important;
  border-left-color: #B97D43 !important;
  color: #5A3A1A !important;
}
.user-menu-item .ai-icon,
.user-menu-item svg,
.user-menu-item .dd-svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  vertical-align: middle;
}
.user-menu-item .ai-icon {
  object-fit: contain !important;
  mix-blend-mode: multiply !important;
  filter: brightness(0.85) drop-shadow(0 1px 1px rgba(0,0,0,0.1)) !important;
}
/* Global - inline SVG w buttonach nie ma right do rozciągnięcia */
.fp-user-dropdown svg, .fab svg, .btn-primary svg, .btn-secondary svg,
.cad-iconbtn svg, .cad-mode svg, .cad-tool svg {
  max-width: 24px !important;
  max-height: 24px !important;
}
.fp-user-dropdown-danger .user-menu-item {
  color: #C0392B !important;
}
.fp-user-dropdown-danger .user-menu-item:hover {
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.18), rgba(231, 76, 60, 0.04)) !important;
  border-left-color: #C0392B !important;
  color: #A03020 !important;
}

/* === AI ICONS - ikony PNG z transparent background (po remove-bg) === */
.cad-ai-icon, .ai-icon, img[src*="cad-icons/"] {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  /* mix-blend-mode usunięty - ikony są teraz prawdziwie transparent */
}
/* W modali (jasne tło) - bez blendu, ikona złota lub naturalna */
.modal .ai-icon, .modal img[src*="cad-icons/"],
[style*="position:fixed"][style*="inset:0"] img[src*="cad-icons/"],
.cad-summary-bar .ai-icon, .fp-user-dropdown img[src*="cad-icons/"] {
  filter: drop-shadow(0 1px 1px rgba(75,50,25,0.15));
}
/* Na ciemnym tle (toolbar CAD) - jaśniej */
.cad-floating img[src*="cad-icons/"], .cad-sidebar img[src*="cad-icons/"] {
  filter: brightness(1.1) drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* === HUD enhancement === */
.cad-hud {
  background: rgba(31, 18, 8, 0.85) !important;
  border: 1px solid rgba(201, 168, 118, 0.3) !important;
  color: #E8C896 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Inter', 'SF Mono', monospace !important;
  font-weight: 500 !important;
  padding: 0.45rem 0.75rem !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.02em;
}
.cad-coords::before { content: "📍 "; opacity: 0.7; }
.cad-zoom { font-variant-numeric: tabular-nums; }
.cad-status {
  background: linear-gradient(180deg, rgba(75, 50, 25, 0.85), rgba(40, 25, 12, 0.85)) !important;
  border-color: rgba(232, 200, 150, 0.4) !important;
}
/* === Podsumowanie po zapisaniu (toast modal w dolnym pasku) === */
.cad-summary-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 105;
  background: linear-gradient(180deg, #2A1810 0%, #1F1208 100%);
  border: 1px solid rgba(232, 200, 150, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1.4rem;
  display: flex;
  gap: 1.6rem;
  align-items: center;
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.cad-summary-bar .stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cad-summary-bar .stat span { color: rgba(232,200,150,0.6); font-size: 0.7rem; text-transform: uppercase; }
.cad-summary-bar .stat strong { color: #E8C896; font-size: 1.1rem; font-weight: 700; }
.cad-summary-bar button.close-sum {
  background: transparent;
  border: 1px solid rgba(232,200,150,0.3);
  color: rgba(232,200,150,0.7);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.cad-summary-bar button.close-sum:hover { background: rgba(232,200,150,0.15); }
/* MaxWidth override dla view-polygon - chcemy CAŁY ekran */
section.cad-layout { max-width: 100% !important; }
/* Polygon editor view - usuń marginesy parent main */
.view.polygon-editor { margin: 0 !important; }
main:has(.cad-layout) { max-width: 100% !important; padding: 0.4rem !important; }
.cad-room-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cad-room-name-input {
  background: rgba(232, 200, 150, 0.08);
  border: 1px solid rgba(201, 168, 118, 0.3);
  border-radius: 8px;
  color: #E8C896;
  padding: 0.4rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 180px;
  outline: none;
  transition: all 0.15s ease;
}
.cad-room-name-input:focus {
  background: rgba(232, 200, 150, 0.18);
  border-color: rgba(232, 200, 150, 0.6);
}
.cad-room-name-label {
  color: rgba(232, 200, 150, 0.65);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.4rem;
}
.cad-layout .cad-topbar,
.cad-layout .cad-workspace,
.cad-layout .polygon-footer {
  box-sizing: border-box;
  max-width: 100%;
}
.cad-topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(180deg, #1F1208 0%, #14090A 100%);
  border-radius: 12px;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(201, 168, 118, 0.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}
.cad-workspace {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;  /* allow children flex shrink */
  overflow: hidden;
}
.cad-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
}
.cad-canvas-wrap canvas {
  flex: 1;
  width: 100%;
  height: 100%;
}
.cad-props {
  overflow-y: auto;
  max-height: 100%;
}
.polygon-footer {
  flex-shrink: 0;
}
/* === Lista ścian per-wall thickness === */
.cad-walls-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}
.cad-wall-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(232, 200, 150, 0.06);
  border: 1px solid rgba(201, 168, 118, 0.18);
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: default;
}
.cad-wall-row:hover {
  background: rgba(232, 200, 150, 0.16);
  border-color: rgba(232, 200, 150, 0.45);
}
.cad-wall-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cad-wall-label strong {
  color: #E8C896;
  font-size: 0.85rem;
}
.cad-wall-label small {
  color: rgba(232, 200, 150, 0.55);
  font-size: 0.72rem;
}
.cad-wall-th {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(232, 200, 150, 0.7);
  font-size: 0.78rem;
}
.cad-wall-th input {
  width: 50px;
  padding: 0.25rem 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 168, 118, 0.25);
  border-radius: 6px;
  color: #E8C896;
  font-size: 0.85rem;
  text-align: center;
}
.cad-wall-th input:focus {
  outline: none;
  border-color: rgba(232, 200, 150, 0.6);
}
.cad-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: linear-gradient(180deg, #1F1208 0%, #2A1810 50%, #1F1208 100%);
  border-radius: 14px;
  padding: 0.65rem 0.45rem;
  border: 1px solid rgba(201, 168, 118, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: 100px;
  flex-shrink: 0;
  position: relative;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 118, 0.5) transparent;
}
.cad-sidebar::-webkit-scrollbar { width: 4px; }
.cad-sidebar::-webkit-scrollbar-thumb { background: rgba(201, 168, 118, 0.5); border-radius: 2px; }
.cad-sidebar::-webkit-scrollbar-track { background: transparent; }
.cad-sidebar::before {
  content: "";
  position: absolute;
  top: 0; left: 8px; right: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232, 200, 150, 0.4) 50%, transparent 100%);
}
.cad-sidebar .cad-context {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}
.cad-sidebar .cad-context[hidden] { display: none; }

/* v=298: CAD breadcrumb — orientacja w hierarchii projekt > pokój */
.cad-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem 0.25rem 0.5rem;
  background: rgba(255, 248, 230, 0.08);
  border: 1px solid rgba(232, 200, 150, 0.18);
  border-radius: 6px;
  color: rgba(232, 200, 150, 0.85);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cad-breadcrumb:hover {
  background: rgba(232, 200, 150, 0.18);
  border-color: rgba(232, 200, 150, 0.4);
  color: #FFEFD8;
}
.cad-breadcrumb::before {
  content: "‹";
  font-size: 1.1rem;
  font-weight: 700;
  color: #C9A876;
  line-height: 1;
}
.cad-breadcrumb:empty { display: none !important; }
@media (max-width: 768px) {
  .cad-breadcrumb { font-size: 0.7rem; padding: 0.2rem 0.45rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
}

/* v=297: Sidebar buttons - PERFECTLY CENTERED. Stała szerokość kontenera SVG,
   strict flex column, no asymmetric padding, jednakowy wygląd dla każdego button. */
.cad-sidebar .cad-context {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  padding: 0 !important;
  gap: 0.35rem !important;
}
.cad-sidebar .cad-tool,
.cad-sidebar .cad-iconbtn,
.cad-sidebar .cad-cta {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.3rem !important;
  padding: 0.6rem 0.35rem !important;
  width: 100% !important;
  font-size: 0.68rem !important;
  text-align: center !important;
  min-height: 62px;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 !important;
  border-radius: 10px !important;
}
.cad-sidebar .cad-tool svg,
.cad-sidebar .cad-iconbtn svg,
.cad-sidebar .cad-cta svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  margin: 0 auto !important;
  display: block !important;
  flex-shrink: 0 !important;
}
.cad-sidebar .cad-tool span,
.cad-sidebar .cad-iconbtn span,
.cad-sidebar .cad-cta span {
  font-size: 0.7rem !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  text-align: center !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cad-sidebar .cad-divider,
.cad-sidebar .cad-spacer {
  width: 100% !important;
  height: 1px !important;
  margin: 0.25rem 0 !important;
  background: rgba(201, 168, 118, 0.18);
}
.cad-sidebar .cad-spacer { flex: 1; background: transparent; min-height: 0.5rem; }

.cad-sidebar .cad-cta {
  flex-direction: column !important;
  gap: 0.2rem !important;
  padding: 0.65rem 0.3rem !important;
  width: 100% !important;
  font-size: 0.72rem !important;
  text-align: center;
  min-height: 60px;
}
.cad-sidebar .cad-cta span {
  font-size: 0.72rem;
  line-height: 1.15;
}

.cad-sidebar .cad-dropdown {
  width: 100%;
}
.cad-sidebar .cad-dropdown-trigger {
  width: 100% !important;
  flex-direction: column !important;
}
.cad-sidebar .cad-dropdown-trigger .cad-chev {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 0.8em !important;
  height: 0.8em !important;
}
.cad-sidebar .cad-dropdown-menu {
  top: 6px !important;
  left: calc(100% + 8px) !important;
  min-width: 220px;
}

/* Top bar elements compact */
.cad-topbar .cad-mode {
  padding: 0.45rem 0.75rem !important;
  font-size: 0.85rem !important;
}
.cad-topbar .cad-iconbtn {
  padding: 0.45rem 0.6rem !important;
  font-size: 0.82rem !important;
  min-height: 36px;
}
.cad-topbar .cad-snap-toggle {
  padding: 0.35rem 0.65rem !important;
}

/* Canvas wrapper */
.cad-workspace .cad-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 520px;
}

/* Mobile - sidebar staje się pas dolny (horizontal), labels obok ikon */
@media (max-width: 768px) {
  .cad-layout {
    padding: 0.5rem !important;
    gap: 0.4rem;
    min-height: calc(100vh - 60px);
  }
  .cad-workspace {
    flex-direction: column;
    min-height: 0;
    flex: 1;
  }
  .cad-workspace .cad-canvas-wrap {
    height: 62vh !important;
    min-height: 380px !important;
    width: 100% !important;
    flex: 0 0 62vh;
  }
  .cad-canvas-wrap canvas,
  #poly-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  /* Topbar - poziomy scroll jeśli nie mieści */
  .cad-topbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    width: 100% !important;
    box-sizing: border-box;
  }
  .cad-topbar::-webkit-scrollbar { display: none; }
  .cad-topbar > * {
    flex-shrink: 0 !important;
  }
  .cad-sidebar {
    flex-direction: row;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    scrollbar-width: thin;
    box-sizing: border-box;
    flex-shrink: 0;
  }
  .cad-sidebar .cad-context {
    flex-direction: row;
    gap: 0.4rem;
    width: auto;
  }
  .cad-sidebar .cad-tool,
  .cad-sidebar .cad-iconbtn,
  .cad-sidebar .cad-cta {
    flex-direction: row !important;
    padding: 0.5rem 0.7rem !important;
    width: auto !important;
    min-height: 40px;
    flex-shrink: 0;
  }
  .cad-sidebar .cad-tool span,
  .cad-sidebar .cad-iconbtn span,
  .cad-sidebar .cad-cta span {
    display: inline !important;
  }
  .cad-sidebar .cad-divider {
    width: 1px !important;
    height: 24px !important;
    margin: 0 !important;
  }
  .cad-sidebar .cad-spacer {
    width: 0.5rem;
    height: auto;
    flex: 0 0 auto;
  }
  .cad-sidebar .cad-dropdown-menu {
    left: 0 !important;
    top: calc(100% + 6px) !important;
  }
  .cad-topbar { padding: 0.45rem; }
  .cad-topbar .cad-mode span { display: none; }
  .cad-topbar .cad-divider { display: none; }
  .cad-topbar .cad-actions { margin-left: auto; }
}

/* Legacy toolbar - keeps old polygon-toolbar override jeśli używane */
.cad-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #1F1208 0%, #14090A 100%);
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(201, 168, 118, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}
.cad-toolbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(201,168,118,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.cad-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent 0%, rgba(201,168,118,0.3) 50%, transparent 100%);
  flex-shrink: 0;
  margin: 0 0.15rem;
}
.cad-spacer { flex: 1; min-width: 0.5rem; }

/* Mode switcher - segment control */
.cad-mode-switch {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 11px;
  padding: 3px;
  border: 1px solid rgba(201, 168, 118, 0.15);
  position: relative;
  z-index: 1;
}
.cad-mode-switch {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 168, 118, 0.22);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.cad-mode {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45em !important;
  padding: 0.55rem 1rem !important;
  border-radius: 9px !important;
  border: none !important;
  background: transparent !important;
  color: rgba(232, 200, 150, 0.7) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  position: relative;
}
.cad-mode svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.cad-mode:hover {
  background: rgba(232, 200, 150, 0.1) !important;
  color: #FFE6BB !important;
}
.cad-mode:hover svg { transform: scale(1.08); }
.cad-mode.active {
  background: linear-gradient(180deg, #D4AB75 0%, #B97D43 100%) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(185, 125, 67, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.18) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}
.cad-mode.active svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Global actions */
.cad-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}
.cad-iconbtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45em !important;
  background: linear-gradient(180deg, rgba(232, 200, 150, 0.08), rgba(232, 200, 150, 0.04)) !important;
  border: 1px solid rgba(201, 168, 118, 0.3) !important;
  color: #E8C896 !important;
  padding: 0.55rem 0.85rem !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  min-width: 40px;
  min-height: 40px;
  position: relative;
  overflow: hidden;
}
/* Subtle inner shine - premium touch */
.cad-iconbtn::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
.cad-iconbtn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; transition: transform 0.2s; }
.cad-iconbtn:hover {
  background: linear-gradient(180deg, rgba(232, 200, 150, 0.25), rgba(232, 200, 150, 0.12)) !important;
  border-color: rgba(255, 218, 165, 0.65) !important;
  color: #FFE6BB !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(232, 200, 150, 0.15);
}
.cad-iconbtn:hover svg { transform: scale(1.1); }
.cad-iconbtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) inset;
}
.cad-iconbtn.active {
  background: linear-gradient(180deg, rgba(255, 153, 0, 0.35), rgba(232, 120, 0, 0.18)) !important;
  border-color: rgba(255, 200, 120, 0.7) !important;
  color: white !important;
  box-shadow: 0 0 12px rgba(255, 153, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.cad-iconbtn.cad-iconbtn-warn {
  color: #FFAA80 !important;
  border-color: rgba(196, 74, 42, 0.32) !important;
  background: rgba(196, 74, 42, 0.1) !important;
}
.cad-iconbtn.cad-iconbtn-warn:hover {
  background: rgba(196, 74, 42, 0.25) !important;
  border-color: #FFAA80 !important;
  color: white !important;
}
.cad-iconbtn.cad-iconbtn-exit {
  color: #FFEAE0 !important;
  border-color: rgba(220, 80, 60, 0.7) !important;
  background: linear-gradient(135deg, rgba(220, 80, 60, 0.35), rgba(180, 50, 30, 0.55)) !important;
  font-weight: 700 !important;
  padding: 0.5rem 0.85rem !important;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(220, 80, 60, 0.3), inset 0 1px 0 rgba(255, 200, 180, 0.18);
}
.cad-iconbtn.cad-iconbtn-exit svg {
  width: 18px !important;
  height: 18px !important;
}
.cad-iconbtn.cad-iconbtn-exit:hover {
  background: linear-gradient(135deg, rgba(255, 100, 80, 0.7), rgba(220, 50, 30, 0.85)) !important;
  border-color: #FF8866 !important;
  color: white !important;
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(220, 80, 60, 0.55);
}
.cad-topbar .cad-iconbtn.cad-iconbtn-exit {
  padding: 0.5rem 0.85rem !important;
  font-size: 0.85rem !important;
}

/* ============ CAD v=261 ETAP 1 features ============ */
/* Warnings panel - floating bottom right */
.cad-warnings-panel {
  position: absolute;
  bottom: 92px; right: 16px;
  max-width: 320px; min-width: 200px;
  background: rgba(255, 250, 240, .96);
  border: 1px solid rgba(201, 168, 118, .4);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(107, 69, 35, .18);
  z-index: 30;
  font-size: .82rem;
  overflow: hidden;
  transition: max-height .25s ease;
}
.cad-warnings-panel.has-warnings { border-color: #d97557; box-shadow: 0 8px 24px rgba(217, 117, 87, .35); }
.cad-warnings-panel.collapsed .cad-warnings-body { display: none; }
.cad-warnings-panel.collapsed .cad-warnings-toggle::before { content: "+"; }
.cad-warnings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: rgba(201, 168, 118, .14);
  border-bottom: 1px solid rgba(201, 168, 118, .25);
  color: #6B4523;
  font-weight: 600;
}
.cad-warnings-panel.has-warnings .cad-warnings-head { background: rgba(217, 117, 87, .14); color: #a04a2f; }
.cad-warnings-toggle {
  background: transparent; border: 0; color: inherit;
  width: 22px; height: 22px; border-radius: 5px;
  cursor: pointer; font-weight: 700; font-size: 1rem;
}
.cad-warnings-toggle::before { content: "−"; }
.cad-warnings-toggle:hover { background: rgba(107, 69, 35, .14); }
.cad-warnings-body { padding: 8px 10px; max-height: 280px; overflow-y: auto; }
.cad-warn {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 5px 7px;
  margin-bottom: 4px;
  border-radius: 6px;
  line-height: 1.4;
  color: #3d2f1b;
}
.cad-warn-warn { background: rgba(217, 117, 87, .14); color: #8a3a1f; }
.cad-warn-info { background: rgba(201, 168, 118, .12); color: #6B4523; }
.cad-warn-icon { flex-shrink: 0; font-size: .95rem; }
.cad-warn-empty { color: #6a8a55; font-style: italic; display: block; padding: 6px 4px; }

/* Tryb FOCUS - przyciemnia floating UI poza canvas */
body.cad-focus .cad-floating-top,
body.cad-focus .cad-floating-left,
body.cad-focus .cad-floating-right,
body.cad-focus .cad-summary-bar {
  opacity: 0.25;
  transition: opacity .2s;
}
body.cad-focus .cad-floating-top:hover,
body.cad-focus .cad-floating-left:hover,
body.cad-focus .cad-floating-right:hover,
body.cad-focus .cad-summary-bar:hover {
  opacity: 1;
}

/* Hotkeys help grid */
.hotkeys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: .5rem 0;
}
.hotkeys-grid .hk-section h4 {
  margin: 0 0 .5rem 0;
  color: #6B4523;
  font-size: .92rem;
  font-family: 'Playfair Display', serif;
  border-bottom: 1px solid rgba(201, 168, 118, .3);
  padding-bottom: 3px;
}
.hotkeys-grid .hk-section div {
  font-size: .85rem;
  color: #3d2f1b;
  margin-bottom: 5px;
  line-height: 1.6;
}
.hotkeys-grid kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  background: linear-gradient(180deg, #fff, #f0e6d0);
  border: 1px solid #C9A876;
  border-radius: 4px;
  box-shadow: 0 1px 0 #8B5A2B, inset 0 -1px 0 rgba(0,0,0,.05);
  font-family: 'Inter', monospace;
  font-weight: 600;
  font-size: .77rem;
  color: #4A2F18;
  margin-right: 6px;
  text-align: center;
}
@media (max-width: 540px) {
  .hotkeys-grid { grid-template-columns: 1fr; }
}

/* === v=262 CZYSTY CAD FULLSCREEN (jedna spójna reguła) === */
section.view.polygon-editor.cad-layout.cad-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;  /* nie flex - flex zwęża canvas */
  overflow: hidden !important;
  background: #faf2dd !important;
}
.cad-canvas-wrap.cad-canvas-fullscreen {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 0 !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
#poly-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  z-index: 1 !important;
  flex: none !important;
  background: #faf2dd !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  image-rendering: auto !important;
  transform: none !important;
  opacity: 1 !important;
}
body.cad-focus #poly-canvas { opacity: 1 !important; filter: none !important; }
/* floating UI nad canvas */
.cad-floating, .cad-topbar, .cad-floating-left, .cad-floating-right { z-index: 100 !important; }

/* === v=265 NUKE wszystkich dekoracji wokół CAD canvas
   (user widzi "drewniane rogi/ramę" - to są CSS pseudo-elementy
   z innych skinów, .canvas-wrap::before/::after, box-shadow itp) === */
section.view.polygon-editor.cad-fullscreen .canvas-wrap,
section.view.polygon-editor.cad-fullscreen .cad-canvas-wrap,
section.view.polygon-editor.cad-fullscreen .cad-canvas-fullscreen {
  background: #faf2dd !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  filter: none !important;
  backdrop-filter: none !important;
}
section.view.polygon-editor.cad-fullscreen .canvas-wrap::before,
section.view.polygon-editor.cad-fullscreen .canvas-wrap::after,
section.view.polygon-editor.cad-fullscreen .cad-canvas-wrap::before,
section.view.polygon-editor.cad-fullscreen .cad-canvas-wrap::after,
section.view.polygon-editor.cad-fullscreen .cad-canvas-fullscreen::before,
section.view.polygon-editor.cad-fullscreen .cad-canvas-fullscreen::after,
section.view.polygon-editor.cad-fullscreen::before,
section.view.polygon-editor.cad-fullscreen::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* v=266 DIAGNOSTIC overlay: czerwone obramowanie na każdym elemencie INSIDE polygon-editor (poza canvas/tools/props) — żeby user mógł zobaczyć CO jest "ramą" */
body.cad-diag section.view.polygon-editor.cad-fullscreen > *:not(.canvas-wrap):not(.cad-floating):not(.cad-floating-top):not(.cad-floating-left):not(.cad-floating-right) {
  outline: 3px dashed magenta !important;
  outline-offset: -3px;
}
body.cad-diag section.view.polygon-editor.cad-fullscreen .canvas-wrap > *:not(canvas):not(.cad-hud):not(.canvas-hint) {
  outline: 3px dashed cyan !important;
  outline-offset: -3px;
}

/* v=266 — wyłącz wszystkie box-shadow na floating panelach w CAD
   (mogły rzucać brązową aurę widzianą jako "drewniana rama") */
section.view.polygon-editor.cad-fullscreen .cad-floating,
section.view.polygon-editor.cad-fullscreen .cad-floating-top,
section.view.polygon-editor.cad-fullscreen .cad-floating-left,
section.view.polygon-editor.cad-fullscreen .cad-floating-right,
section.view.polygon-editor.cad-fullscreen .cad-topbar {
  box-shadow: none !important;
}

/* === v=269 GLOBAL KILL film-grain + radial overlays (body::before/after) ===
   luxury.css ma 'subtle film grain' (radial-gradient kropki 3x3px @ 4% opacity, position:fixed),
   style.css ma warm-corner radials. Oba prześwitywały na canvas CAD jako "nakładka obrazu". */
body::before,
body::after,
html::before,
html::after {
  display: none !important;
  background: none !important;
  content: none !important;
  opacity: 0 !important;
}
body.in-cad,
body.in-cad * {
  /* dodatkowy bezpiecznik gdy in-cad class jest ustawiona */
}
body.in-cad::before,
body.in-cad::after {
  display: none !important;
}
.cad-floating-right {
  right: 12px !important;
  max-width: calc(100vw - 24px) !important;
}
.cad-floating-right .cad-props,
.cad-floating-right aside {
  max-width: 290px !important;
}
@media (max-width: 1280px) {
  .cad-floating-right .cad-props,
  .cad-floating-right aside { max-width: 230px !important; }
}
.cad-iconbtn.cad-iconbtn-exit {
  min-width: 92px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
.cad-iconbtn.cad-iconbtn-exit span {
  display: inline !important;
  white-space: nowrap !important;
}
.cad-snap-toggle, .cad-snap-step {
  white-space: nowrap !important;
}
/* WALL THICKNESS PREVIEW - DOMYŚLNIE WYŁĄCZONY (gdyby coś zapamiętało true) */
.cad-canvas-wrap { isolation: isolate; }

/* === v=261: Multi-select action widget === */
.cad-multisel-widget {
  position: absolute;
  bottom: 170px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .4rem;
  padding: 6px 12px;
  background: linear-gradient(135deg, #6B4523, #8B5A2B);
  color: #FFFAF0;
  border: 1.5px solid #FFD8A0;
  border-radius: 9px;
  box-shadow: 0 6px 20px rgba(107, 69, 35, .45);
  z-index: 30;
  font-size: .82rem;
}
.cad-multisel-widget[hidden] { display: none !important; }
.cad-multisel-label strong { color: #FFD8A0; font-size: 1.05rem; padding: 0 4px; }
.cad-multisel-btn {
  background: rgba(255, 250, 240, .15);
  color: #FFFAF0;
  border: 1px solid rgba(255, 216, 160, .4);
  padding: .35rem .75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
}
.cad-multisel-btn:hover { background: rgba(255, 216, 160, .3); }
.cad-multisel-btn-warn { background: rgba(220, 80, 60, .3); border-color: rgba(255, 130, 100, .5); }
.cad-multisel-btn-warn:hover { background: rgba(220, 80, 60, .55); }

/* === v=261: ETAP 3 features === */
.cad-prop-btn {
  width: 100%;
  background: linear-gradient(135deg, #C9A876, #9F7F4F);
  color: white; border: 0;
  padding: .55rem .9rem;
  border-radius: 8px;
  font-weight: 600; font-size: .87rem;
  cursor: pointer;
  margin-bottom: .4rem;
  transition: all .15s;
}
.cad-prop-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(159, 127, 79, .45); }
.cad-prop-btn-warn { background: linear-gradient(135deg, #c44a2a, #8a3a1f); }
.cad-prop-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: #6B4523;
  margin-bottom: .35rem;
}
.cad-prop-row input[type="range"] { flex: 1; }
#cad-3d-preview {
  width: 100%;
  background: #f6efe0;
  border: 1px solid rgba(201, 168, 118, .35);
  border-radius: 8px;
  display: block;
}

/* v=270: cad-minimap usunięta — user widział jako "nakładkę obrazu" */
.cad-minimap { display: none !important; }

/* === v=285: MOBILE CAD V2 — stały dock narzędzi na dole, brak slide-up === */
@media (max-width: 768px) {
  body:has(section.view.polygon-editor.cad-fullscreen) .app-header { display: none !important; }

  /* TOPBAR — kompaktowy slim na samej górze */
  .cad-floating-top.cad-topbar {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    padding: 0.3rem 0.5rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 200 !important;
    background: linear-gradient(180deg, #1F1208 0%, rgba(20, 9, 10, 0.97) 100%) !important;
    height: 44px;
    box-sizing: border-box;
  }
  .cad-floating-top.cad-topbar::-webkit-scrollbar { display: none; }
  .cad-floating-top .cad-room-name-input { min-width: 80px !important; max-width: 120px !important; font-size: 0.78rem !important; padding: 0.3rem 0.4rem !important; }
  .cad-floating-top .cad-mode { padding: 0.3rem 0.5rem !important; font-size: 0.72rem !important; }
  .cad-floating-top .cad-mode span { display: inline !important; font-size: 0.7rem !important; }
  .cad-floating-top .cad-mode svg { width: 14px !important; height: 14px !important; }
  .cad-floating-top .cad-divider { display: none !important; }
  .cad-floating-top .cad-snap-toggle { padding: 0.25rem 0.4rem !important; font-size: 0.7rem !important; }
  .cad-floating-top .cad-snap-step { font-size: 0.7rem !important; padding: 0.2rem !important; }
  .cad-floating-top .cad-vis-toggle span { display: none !important; }
  .cad-floating-top .cad-vis-toggle { padding: 0.3rem !important; min-width: 28px !important; min-height: 28px !important; }
  .cad-floating-top .cad-iconbtn-exit { min-width: auto !important; padding: 0.3rem 0.45rem !important; font-size: 0.7rem !important; }
  .cad-floating-top .cad-iconbtn-exit span { font-size: 0.7rem !important; }

  /* DOCK NARZĘDZI na dole — zawsze widoczny, horizontalny scroll */
  .cad-floating-left {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: none !important;
    border-radius: 0 !important;
    transform: none !important;
    transition: none !important;
    z-index: 220 !important;
    padding: 0.4rem 0.5rem !important;
    background: linear-gradient(180deg, rgba(31, 18, 8, 0.96), rgba(20, 9, 10, 0.99)) !important;
    backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(232, 200, 150, 0.25);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
  }
  .cad-floating-left .cad-sidebar {
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 0.3rem !important;
    padding: 0.2rem !important;
    scrollbar-width: none;
    width: 100% !important;
    max-height: 70px !important;
  }
  .cad-floating-left .cad-sidebar::-webkit-scrollbar { display: none; }
  .cad-floating-left .cad-context { display: flex !important; flex-direction: row !important; gap: 0.3rem !important; flex-wrap: nowrap !important; }
  .cad-floating-left .cad-tool, .cad-floating-left .cad-iconbtn {
    flex-direction: column !important;
    min-width: 56px !important;
    max-width: 70px !important;
    min-height: 56px !important;
    padding: 0.35rem 0.25rem !important;
    font-size: 0.65rem !important;
    flex-shrink: 0 !important;
  }
  .cad-floating-left .cad-tool span, .cad-floating-left .cad-iconbtn span {
    display: inline !important;
    font-size: 0.62rem !important;
    white-space: nowrap;
    line-height: 1;
    margin-top: 2px;
  }
  /* Toggle button - schowany na mobile (dock zawsze otwarty) */
  .cad-floating-left .cad-floating-toggle { display: none !important; }

  /* PROPERTIES PANEL — całkowicie ukryty na mobile (dostęp przez modal z dock'a) */
  .cad-floating-right { display: none !important; }

  /* STATUSBAR — całkowicie ukryty na mobile (XY przez canvas hover gdy potrzebne) */
  .cad-statusbar { display: none !important; }

  /* === v=286: READABILITY na mobile - większe fonty, mocniejszy kontrast === */
  /* Dock buttons - czytelny label */
  .cad-floating-left .cad-tool, .cad-floating-left .cad-iconbtn {
    color: #FFEFD8 !important;
    background: rgba(255, 255, 255, 0.04) !important;
  }
  .cad-floating-left .cad-tool span, .cad-floating-left .cad-iconbtn span {
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    color: #FFEFD8 !important;
    opacity: 0.95;
  }
  .cad-floating-left .cad-tool.active, .cad-floating-left .cad-iconbtn.active {
    background: linear-gradient(135deg, #C9A876, #8B5A2B) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(201, 168, 118, 0.4);
  }
  /* Topbar - tekst czytelny */
  .cad-floating-top .cad-mode {
    color: #FFEFD8 !important;
    font-weight: 500;
  }
  .cad-floating-top .cad-mode.active {
    background: linear-gradient(135deg, #C9A876, #8B5A2B) !important;
    color: white !important;
  }
  .cad-floating-top .cad-room-name-input {
    color: #2A1810 !important;
    background: #FFEFD8 !important;
    font-weight: 600 !important;
  }
  .cad-floating-top .cad-room-name-label {
    color: #C9A876 !important;
    font-weight: 600 !important;
    font-size: 0.65rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  /* Warnings panel - większy, czytelniejszy na mobile */
  .cad-warnings-panel {
    right: 8px !important;
    bottom: 90px !important;
    max-width: calc(100vw - 16px) !important;
    font-size: 0.85rem !important;
    background: linear-gradient(180deg, rgba(255, 245, 224, 0.97), rgba(255, 235, 200, 0.97)) !important;
    border: 1px solid rgba(201, 168, 118, 0.6) !important;
    color: #4A2F18 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  }
  .cad-warnings-panel * { color: #4A2F18 !important; }
  .cad-warnings-header { font-size: 0.9rem !important; font-weight: 700 !important; }
  .cad-warnings-body { font-size: 0.82rem !important; line-height: 1.45 !important; }
  .cad-warnings-toggle {
    background: #C9A876 !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    font-weight: 700 !important;
  }

  /* Snap toggle czytelniejszy */
  .cad-floating-top .cad-snap-toggle { color: #FFEFD8 !important; }
  .cad-floating-top .cad-snap-toggle.active { background: rgba(232, 200, 150, 0.25) !important; }
  /* Snap step select */
  .cad-floating-top .cad-snap-step {
    background: rgba(255, 239, 216, 0.15) !important;
    color: #FFEFD8 !important;
    border: 1px solid rgba(232, 200, 150, 0.4) !important;
    padding: 0.25rem 0.4rem !important;
    border-radius: 4px !important;
  }
  /* Zapisz button - czytelny */
  .cad-floating-save {
    background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
    color: white !important;
    font-weight: 700 !important;
    border: 0 !important;
  }
  /* Wyjdz button - bardziej czerwony */
  .cad-floating-top .cad-iconbtn-exit {
    background: rgba(232, 80, 60, 0.85) !important;
    color: white !important;
    border-color: rgba(255, 120, 100, 0.4) !important;
    font-weight: 600;
  }
}

/* === v=287: Mobile properties modal - full-width content === */
#mobile-props-modal {
  background: linear-gradient(180deg, #2A1810, #1F1208) !important;
}
#mobile-props-modal #mp-body { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; padding: 0.6rem 0.8rem !important; }
#mobile-props-modal aside,
#mobile-props-modal .cad-props,
#mobile-props-modal .cad-sidebar {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
#mobile-props-modal .cad-props-section {
  background: rgba(255, 248, 230, 0.06) !important;
  border: 1px solid rgba(232, 200, 150, 0.18) !important;
  border-radius: 10px !important;
  padding: 0.8rem 0.9rem !important;
  margin-bottom: 0.7rem !important;
  color: #FFEFD8 !important;
}
#mobile-props-modal .cad-props-section h4 {
  color: #E8C896 !important;
  margin: 0 0 0.5rem !important;
  font-size: 0.95rem !important;
}
#mobile-props-modal .cad-prop-row,
#mobile-props-modal label {
  color: #FFEFD8 !important;
  font-size: 0.88rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 0.6rem !important;
  margin: 0.4rem 0 !important;
  flex-wrap: wrap;
}
#mobile-props-modal input[type="number"],
#mobile-props-modal input[type="text"],
#mobile-props-modal select {
  background: rgba(255, 239, 216, 0.92) !important;
  color: #2A1810 !important;
  border: 1px solid rgba(232, 200, 150, 0.45) !important;
  border-radius: 6px !important;
  padding: 0.4rem 0.55rem !important;
  font-size: 0.9rem !important;
  min-width: 80px !important;
}
#mobile-props-modal input[type="color"] {
  width: 48px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 4px !important;
}
#mobile-props-modal .cad-walls-list {
  max-height: 50vh !important;
}
#mobile-props-modal .cad-wall-row {
  background: rgba(232, 200, 150, 0.08) !important;
  color: #FFEFD8 !important;
  padding: 0.55rem 0.7rem !important;
}
#mobile-props-modal .cad-wall-label strong { color: #FFEFD8 !important; }
#mobile-props-modal .cad-wall-label span { color: #C9A876 !important; }
/* v=288: force pełny width sekcji w modal (override .cad-props-section z innej części pliku) */
html body #mobile-props-modal .cad-props-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(255, 248, 230, 0.06) !important;
  border: 1px solid rgba(232, 200, 150, 0.18) !important;
  color: #FFEFD8 !important;
}
html body #mobile-props-modal aside,
html body #mobile-props-modal #cad-props {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
html body #mobile-props-modal .cad-props-stats {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.5rem !important;
  width: 100% !important;
}
html body #mobile-props-modal .cad-props-stats > div {
  background: rgba(232, 200, 150, 0.12) !important;
  color: #FFEFD8 !important;
}
html body #mobile-props-modal .cad-props-stats span { color: #C9A876 !important; }
html body #mobile-props-modal .cad-props-stats strong { color: #FFEFD8 !important; }
@media (max-width: 768px) {
  /* (closing brace of @media restored - patch ends below) */

  /* ZAPISZ — FAB centrum, NAD dockiem (powyżej 70px) */
  .cad-floating-save {
    bottom: 84px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    padding: 0.55rem 1.1rem !important;
    font-size: 0.85rem !important;
    box-shadow: 0 6px 18px rgba(107, 69, 35, 0.5) !important;
    z-index: 240 !important;
    border-radius: 999px !important;
  }
  .cad-warnings-panel { right: 8px !important; bottom: 140px !important; max-width: calc(100vw - 16px) !important; }
  .canvas-hint { display: none !important; }

  /* Canvas: zostaw miejsce na topbar (44px) i dock (74px) */
  section.view.polygon-editor.cad-fullscreen {
    padding-top: 44px !important;
    padding-bottom: 74px !important;
    box-sizing: border-box !important;
  }
  #poly-canvas {
    height: calc(100vh - 44px - 74px) !important;
    top: 44px !important;
  }
}

/* === v=282: ukryj stary cad-status (nachodzi na statusbar) === */
.cad-status { display: none !important; }
/* Plus cad-coords (lewy gorny HUD) tez ukrywamy bo statusbar pokazuje XY */
.cad-coords { display: none !important; }

/* === v=274: STATUSBAR (live cursor + selection info) === */
.cad-statusbar {
  position: absolute !important;
  bottom: 8px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(26, 22, 18, 0.88) !important;
  color: #E8C896 !important;
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace !important;
  font-size: 0.78rem !important;
  padding: 0.45rem 0.85rem !important;
  border-radius: 8px !important;
  border: 1px solid rgba(201, 168, 118, 0.3) !important;
  backdrop-filter: blur(10px) !important;
  z-index: 30 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em !important;
  max-width: 90vw !important;
  overflow-x: auto !important;
}
.cad-statusbar:empty { display: none; }
.cad-statusbar .sb-sep { color: rgba(201, 168, 118, 0.4); margin: 0 .5rem; }
.cad-statusbar .sb-key { color: rgba(201, 168, 118, 0.7); }
.cad-statusbar .sb-val { color: #FFEFD8; font-weight: 600; }

/* === v=280: MULTI-FLOOR TABS === */
.floor-tabs {
  display: flex !important;
  gap: 0.4rem;
  margin: 0.6rem 0 0.8rem;
  padding: 0.4rem;
  background: linear-gradient(180deg, rgba(232, 200, 150, 0.15), rgba(201, 168, 118, 0.08));
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 118, 0.25);
  align-items: center;
  flex-wrap: wrap;
}
.floor-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 248, 238, 0.6);
  border: 1px solid rgba(201, 168, 118, 0.25);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #6B4523;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.floor-tab:hover {
  background: rgba(255, 248, 238, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(107, 69, 35, 0.15);
}
.floor-tab.active {
  background: linear-gradient(135deg, #C9A876, #8B5A2B) !important;
  color: white !important;
  border-color: #6B4523 !important;
  box-shadow: 0 4px 10px rgba(107, 69, 35, 0.35);
  font-weight: 600;
}
.floor-tab .floor-count {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.74rem;
  font-weight: 600;
}
.floor-tab.active .floor-count { background: rgba(255, 255, 255, 0.3); }
.floor-tab-add {
  background: transparent !important;
  border: 1px dashed rgba(159, 127, 79, 0.5) !important;
  color: #9F7F4F !important;
  font-weight: 600;
}
.floor-tab-add:hover { background: rgba(255, 248, 238, 0.6) !important; }

/* ================================================================
/* === v=295: HARD SAFETY NET dla bottom-actions buttons (były gigantyczne) === */
.bottom-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  align-items: center !important;
}
.bottom-actions > button {
  flex: 0 1 auto !important;
  width: auto !important;
  height: auto !important;
  max-height: 48px !important;
  padding: 0.6rem 1rem !important;
  font-size: 0.92rem !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.4rem !important;
  box-sizing: border-box !important;
}
.bottom-actions > button > svg,
.bottom-actions > button > img,
.bottom-actions > button > span > svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
}

/* ================================================================
   v=294: LUXURY MINIMAL — restraint over flash. Białe tło, czysta
   typografia Playfair, jedna złota linia akcentu, hairline borders,
   brak gradientów-fajerwerków, dużo whitespace.
   ================================================================ */

body { background: #FAFAF7 !important; color: #1A1714 !important; }

/* === HERO — minimal, czysty, mocna typografia === */
.hero.hero-projects {
  position: relative !important;
  overflow: visible !important;
  padding: 5rem 0 3rem !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.08) !important;
  border-radius: 0 !important;
  margin-bottom: 2.5rem !important;
  box-shadow: none !important;
}
.hero.hero-projects::before,
.hero.hero-projects::after { display: none !important; content: none !important; }
.hero.hero-projects .hero-text h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(2.2rem, 5vw, 3.6rem) !important;
  font-weight: 500 !important;
  color: #1A1714 !important;
  margin: 0 0 1rem !important;
  letter-spacing: -0.025em !important;
  line-height: 1.05 !important;
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: #1A1714 !important;
  animation: luxFadeUp 1s cubic-bezier(0.19, 1, 0.22, 1) both;
}
.hero.hero-projects .hero-text h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: #B8965A;
  margin: 1.2rem 0 0;
  animation: luxLineGrow 1s 0.4s cubic-bezier(0.19, 1, 0.22, 1) backwards;
}
.hero.hero-projects .hero-text p {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 300 !important;
  color: rgba(26, 23, 20, 0.62) !important;
  max-width: 540px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  animation: luxFadeUp 1s 0.15s cubic-bezier(0.19, 1, 0.22, 1) backwards;
}
@keyframes luxFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes luxLineGrow {
  from { width: 0; opacity: 0; }
  to { width: 56px; opacity: 1; }
}

/* === HERO STATS — hairline grid, monumental numerals === */
.hero-stats {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0 !important;
  margin-top: 2.8rem !important;
  border-top: 1px solid rgba(31, 18, 8, 0.08) !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.08) !important;
  padding: 0 !important;
  background: transparent !important;
  animation: luxFadeUp 1s 0.3s cubic-bezier(0.19, 1, 0.22, 1) backwards;
}
.hero-stats > div {
  background: transparent !important;
  border: 0 !important;
  border-right: 1px solid rgba(31, 18, 8, 0.06) !important;
  border-radius: 0 !important;
  padding: 1.4rem 1.2rem !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.hero-stats > div:last-child { border-right: 0 !important; }
.hero-stats > div::before { content: none !important; display: none !important; }
.hero-stats > div:hover { transform: none !important; box-shadow: none !important; }
.hero-stats > div span {
  display: block !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.68rem !important;
  color: rgba(26, 23, 20, 0.5) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.18em !important;
  font-weight: 500 !important;
  margin-bottom: 0.5rem !important;
}
.hero-stats > div strong {
  display: block !important;
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 2.4rem !important;
  font-weight: 500 !important;
  color: #1A1714 !important;
  letter-spacing: -0.02em !important;
  line-height: 1 !important;
}

/* === TOOLBAR — hairline === */
.toolbar {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.08) !important;
  border-radius: 0 !important;
  padding: 1rem 0 !important;
  box-shadow: none !important;
  margin-bottom: 2rem !important;
}
.toolbar #proj-search {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.15) !important;
  border-radius: 0 !important;
  color: #1A1714 !important;
  padding: 0.6rem 0 0.6rem 1.8rem !important;
  font-size: 0.95rem !important;
  font-weight: 300 !important;
  transition: border-color 0.2s !important;
}
.toolbar #proj-search:focus {
  outline: none !important;
  border-bottom-color: #B8965A !important;
  box-shadow: none !important;
  background: transparent !important;
}
.toolbar #proj-search::placeholder { color: rgba(26, 23, 20, 0.4); font-weight: 300; }
.toolbar #proj-sort {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.15) !important;
  color: #1A1714 !important;
  padding: 0.6rem 1.5rem 0.6rem 0 !important;
  border-radius: 0 !important;
  font-weight: 400 !important;
  font-size: 0.88rem !important;
  cursor: pointer;
}

/* === PROJECT CARDS — białe, hairline, subtle hover === */
.project-card {
  animation: luxFadeUp 0.7s cubic-bezier(0.19, 1, 0.22, 1) both !important;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.4s, border-color 0.4s !important;
  background: white !important;
  border: 1px solid rgba(31, 18, 8, 0.08) !important;
  border-left: 1px solid rgba(31, 18, 8, 0.08) !important;
  box-shadow: 0 1px 2px rgba(31, 18, 8, 0.04) !important;
}
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }
.project-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 18px 40px -16px rgba(31, 18, 8, 0.14), 0 6px 14px -6px rgba(31, 18, 8, 0.08) !important;
  border-color: rgba(184, 150, 90, 0.4) !important;
}
.project-card h3, .project-body h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  color: #1A1714 !important;
}

/* === FAB — minimalistyczny czarny circle z gold ring hover === */
#fab-new {
  background: #1A1714 !important;
  color: #FAFAF7 !important;
  box-shadow: 0 12px 28px -8px rgba(31, 18, 8, 0.45), 0 4px 10px -4px rgba(31, 18, 8, 0.25) !important;
  width: 56px !important;
  height: 56px !important;
  border: 0 !important;
  position: relative;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
  animation: none !important;
}
#fab-new::before { display: none !important; content: none !important; }
#fab-new::after {
  content: "" !important;
  position: absolute !important;
  inset: -3px !important;
  border-radius: 50% !important;
  border: 1px solid #B8965A !important;
  opacity: 0 !important;
  background: none !important;
  filter: none !important;
  z-index: -1 !important;
  transition: opacity 0.4s, inset 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
}
#fab-new:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 18px 40px -8px rgba(31, 18, 8, 0.55), 0 8px 16px -4px rgba(31, 18, 8, 0.35) !important;
}
#fab-new:hover::after { opacity: 1 !important; inset: -6px !important; }

/* === HEADER — czysty monochromatyczny === */
.app-header {
  background: #FAFAF7 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.08) !important;
  box-shadow: none !important;
  padding: 1rem 1.5rem !important;
}
.app-header .brand-icon {
  background: #1A1714 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  padding: 7px !important;
  width: 40px !important;
  height: 40px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: background 0.45s cubic-bezier(0.19, 1, 0.22, 1), transform 0.45s cubic-bezier(0.19, 1, 0.22, 1) !important;
  transform: translateZ(0);
  cursor: pointer;
}
/* Subtelny "shine sweep" — błysk przesuwany przy hover, premium feel */
.app-header .brand-icon::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  background: linear-gradient(115deg, transparent 30%, rgba(232, 200, 150, 0.55) 50%, transparent 70%) !important;
  transform: translateX(-110%);
  transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
  z-index: 1;
}
.app-header .brand-icon::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 50%) !important;
  pointer-events: none;
}
.app-header .brand-icon:hover {
  background: #2A1810 !important;
  transform: scale(1.04) !important;
  box-shadow: none !important;
}
.app-header .brand-icon:hover::before {
  transform: translateX(110%);
}
.app-header .brand-icon svg {
  position: relative;
  z-index: 2;
}
.app-header .brand-icon svg path { stroke: #FAFAF7 !important; }
.app-header h1#header-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  color: #1A1714 !important;
  background: none !important;
  -webkit-text-fill-color: #1A1714 !important;
  font-size: 1.3rem !important;
}
.app-header .header-subtitle {
  color: rgba(26, 23, 20, 0.5) !important;
  font-weight: 400 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  font-size: 0.65rem !important;
}

/* === Empty state minimal === */
.empty-state, #empty-msg {
  text-align: center;
  padding: 5rem 2rem !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.empty-state strong, #empty-msg strong {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  color: #1A1714 !important;
}

/* === Mobile === */
@media (max-width: 768px) {
  .hero.hero-projects { padding: 2.8rem 0 2rem !important; }
  .hero.hero-projects .hero-text h2 { font-size: 2rem !important; }
  .hero.hero-projects .hero-text p { font-size: 0.92rem !important; }
  .hero-stats > div { padding: 1rem 0.6rem !important; }
  .hero-stats > div strong { font-size: 1.55rem !important; }
  .hero-stats > div span { font-size: 0.58rem !important; }
  #fab-new { width: 52px !important; height: 52px !important; }
}


/* === v=275: PROJECT CARD redesign (thumbnail header + body) === */
.project-card {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 14px !important;
}
.project-thumb-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #FFF8EE 0%, #F5E6CC 100%);
  border-bottom: 1px solid rgba(201, 168, 118, 0.25);
  overflow: hidden;
}
.project-card .project-thumb {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.project-thumb-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5rem;
  background: linear-gradient(180deg, rgba(255,248,238,0.0) 60%, rgba(107,69,35,0.08) 100%);
  pointer-events: none;
}
.project-card .actions {
  position: static !important;
  display: flex;
  gap: 0.3rem;
  pointer-events: auto;
}
.project-card .actions button {
  background: rgba(31, 18, 8, 0.78) !important;
  color: #E8C896 !important;
  border: 1px solid rgba(232, 200, 150, 0.3) !important;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card .actions button:hover {
  background: rgba(107, 69, 35, 0.95) !important;
  color: #FFEFD8 !important;
  transform: scale(1.1);
}
.project-card .actions .delete:hover {
  background: rgba(200, 74, 74, 0.95) !important;
  color: white !important;
}
.project-card .actions .share-link:hover {
  background: rgba(70, 130, 180, 0.95) !important;
  color: white !important;
}
.project-body {
  padding: 0.9rem 1.1rem 1rem;
}
.project-body h3 {
  margin: 0 0 0.2rem !important;
  padding: 0 !important;
  font-size: 1.05rem;
  color: var(--wood-dark);
}
.project-body p {
  margin: 0 0 0.4rem !important;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.project-body .stats {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.project-body .meta {
  margin-top: 0.55rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* === v=274: Visibility toggles (active vs inactive) === */
.cad-vis-toggle {
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
  /* v=288 kompaktowe wymiary żeby nie obcinało "Siatk Wymi Kąt Osi" w topbarze */
  padding: 0.4rem 0.55rem !important;
  min-width: auto !important;
  max-width: none !important;
  flex-shrink: 0;
}
.cad-vis-toggle.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(232, 200, 150, 0.25), rgba(232, 200, 150, 0.1)) !important;
  border-color: rgba(232, 200, 150, 0.55) !important;
}
.cad-vis-toggle:hover { opacity: 1; }
.cad-vis-toggle svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.cad-vis-toggle span { font-size: 0.72rem !important; white-space: nowrap !important; }

/* ============ MAILBOX MODAL (admin webmail) ============ */
.mailbox-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 18, 8, .72);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .18s ease;
}
.mailbox-frame {
  width: 100%; max-width: 1280px; height: 92vh; max-height: 880px;
  background: linear-gradient(180deg, #FFFAF0, #FBF4E2);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(201,168,118,.3);
}
.mailbox-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 14px 18px;
  background: linear-gradient(135deg, #6B4523, #8B5A2B);
  color: #FFFAF0;
}
.mailbox-title { font-size: 1.05rem; font-weight: 700; font-family: 'Playfair Display', serif; }
.mailbox-account-tabs { display: flex; gap: .35rem; margin-left: 1rem; }
.mailbox-acc-tab {
  padding: .42rem 1rem;
  background: rgba(255,255,255,.1);
  color: #FFD8A0;
  border: 1px solid rgba(255,216,160,.3);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600; font-size: .85rem;
  transition: all .15s;
}
.mailbox-acc-tab:hover { background: rgba(255,255,255,.2); }
.mailbox-acc-tab.active {
  background: linear-gradient(135deg, #FFE0B0 0%, #FFB874 100%);
  color: #3A2818;
  border: 2px solid #FFFAF0;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 200, 130, .65), inset 0 -3px 0 rgba(139, 90, 43, .4);
  transform: scale(1.05);
}
.mailbox-compose-info {
  background: linear-gradient(135deg, rgba(232, 200, 150, .25), rgba(255, 216, 160, .25));
  border: 1px solid rgba(201, 168, 118, .4);
  border-radius: 8px;
  padding: 10px 14px;
  color: #6B4523;
  font-size: .85rem;
  line-height: 1.5;
}
.mailbox-from-badge {
  display: inline-block;
  background: linear-gradient(135deg, #C9A876, #8B5A2B);
  color: #FFFAF0;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .9rem;
  margin-left: 4px;
  letter-spacing: .3px;
}
.mailbox-compose-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #C9A876, #9F7F4F);
  color: white;
  border: 0; padding: .5rem 1.1rem;
  border-radius: 8px;
  font-weight: 600; font-size: .88rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(159,127,79,.5);
}
.mailbox-compose-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(159,127,79,.65); }
.mailbox-close {
  background: rgba(255,80,80,.25);
  color: #FFE0D8; border: 1px solid rgba(255,128,100,.4);
  width: 32px; height: 32px; border-radius: 7px;
  cursor: pointer; font-size: 1rem; font-weight: 700;
}
.mailbox-close:hover { background: rgba(255,80,80,.5); }

.mailbox-folders {
  display: flex; gap: .35rem;
  padding: 10px 18px;
  background: #f6efe0;
  border-bottom: 1px solid rgba(201,168,118,.25);
}
.mailbox-folder {
  background: transparent;
  border: 1px solid transparent;
  color: #6B4523;
  padding: .4rem .9rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600; font-size: .87rem;
  transition: all .15s;
}
.mailbox-folder:hover { background: rgba(201,168,118,.15); }
.mailbox-folder.active {
  background: linear-gradient(135deg, #C9A876 0%, #8B5A2B 100%);
  color: #FFFAF0;
  border-color: #6B4523;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(139, 90, 43, .45), inset 0 -2px 0 rgba(0, 0, 0, .15);
  transform: translateY(-1px);
}
.mailbox-folder-count {
  margin-left: auto;
  color: #998871;
  font-size: .8rem;
  font-weight: 600;
  padding: 0 .6rem;
  white-space: nowrap;
}
.mailbox-empty small { display: block; margin-top: .8rem; font-size: .75rem; color: #998871; font-style: normal; line-height: 1.5; max-width: 280px; margin-left: auto; margin-right: auto; }
.mailbox-refresh { margin-left: .5rem; background: transparent; border: 1px solid rgba(201,168,118,.3); color: #8B5A2B; width: 32px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 1.05rem; }
.mailbox-refresh:hover { background: rgba(201,168,118,.15); }

.mailbox-body {
  flex: 1;
  display: grid; grid-template-columns: 360px 1fr;
  min-height: 0;
}
.mailbox-list {
  border-right: 1px solid rgba(201,168,118,.25);
  overflow-y: auto;
  background: #FBF4E2;
}
.mailbox-loading, .mailbox-empty {
  padding: 2rem 1.5rem;
  color: #8a7a5e;
  text-align: center;
  font-style: italic;
  font-size: .9rem;
}
.mailbox-empty.mailbox-error { color: #c44a2a; }
.mailbox-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(201,168,118,.18);
  cursor: pointer;
  transition: background .12s;
}
.mailbox-item:hover { background: rgba(232,200,150,.18); }
.mailbox-item.selected { background: rgba(232,200,150,.35); border-left: 3px solid #8B5A2B; padding-left: 13px; }
.mailbox-item.unseen { font-weight: 700; background: rgba(255,250,232,.7); }
.mailbox-item.unseen.selected { background: rgba(232,200,150,.5); }
.mailbox-item-from { color: #4A2F18; font-size: .92rem; margin-bottom: 3px; }
.mailbox-item-addr { color: #998871; font-size: .76rem; font-weight: 400; margin-left: 4px; }
.mailbox-item-subj { color: #6B4523; font-size: .88rem; line-height: 1.4; margin-bottom: 4px; }
.mailbox-item-date { color: #998871; font-size: .76rem; }

.mailbox-detail {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: white;
}
.mailbox-detail-head {
  padding: 18px 22px 12px 22px;
  border-bottom: 1px solid rgba(201,168,118,.2);
}
.mailbox-detail-subj { font-size: 1.2rem; font-weight: 700; color: #4A2F18; margin-bottom: 10px; font-family: 'Playfair Display', serif; }
.mailbox-detail-meta { font-size: .82rem; color: #7a6448; line-height: 1.65; }
.mailbox-detail-meta strong { color: #4A2F18; font-weight: 600; }
.mailbox-detail-actions { display: flex; gap: .5rem; margin-top: 10px; }
.mailbox-btn { background: rgba(201,168,118,.18); border: 1px solid rgba(201,168,118,.4); color: #6B4523; padding: .42rem .9rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .83rem; }
.mailbox-btn:hover { background: rgba(201,168,118,.32); }
.mailbox-btn-primary { background: linear-gradient(135deg, #C9A876, #9F7F4F); color: white; border-color: transparent; }
.mailbox-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(159,127,79,.5); }
.mailbox-btn-link { background: transparent; border: 0; color: #8B5A2B; cursor: pointer; text-decoration: underline; font-size: .85rem; }
.mailbox-detail-body { flex: 1; border: 0; width: 100%; background: white; }

.mailbox-compose { padding: 22px 26px; display: flex; flex-direction: column; gap: .85rem; overflow-y: auto; }
.mailbox-compose-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.mailbox-compose-head strong { color: #6B4523; font-size: 1rem; }
.mailbox-compose label { display: flex; flex-direction: column; gap: .25rem; color: #6B4523; font-size: .85rem; font-weight: 600; }
.mailbox-compose input, .mailbox-compose textarea {
  background: white;
  border: 1px solid rgba(201,168,118,.4);
  border-radius: 7px;
  padding: .55rem .75rem;
  font-size: .9rem;
  color: #3d2f1b;
  font-family: 'Inter', sans-serif;
}
.mailbox-compose input:focus, .mailbox-compose textarea:focus { outline: 0; border-color: #8B5A2B; box-shadow: 0 0 0 3px rgba(139,90,43,.15); }
.mailbox-compose textarea { resize: vertical; min-height: 200px; font-family: 'Inter', sans-serif; }
.mailbox-compose-actions { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.mailbox-compose-status { font-size: .85rem; }

@media (max-width: 900px) {
  .mailbox-frame { height: 100vh; max-height: 100vh; border-radius: 0; }
  .mailbox-body { grid-template-columns: 1fr; }
  .mailbox-list { max-height: 50vh; }
}

/* Footer z kontaktem - na landing/projects */
.fp-footer {
  margin: 4rem auto 1.5rem auto;
  padding: 1.2rem 1rem;
  text-align: center;
  border-top: 1px solid rgba(201, 168, 118, 0.18);
  color: rgba(74, 56, 33, 0.7);
  font-size: 0.92rem;
}
.fp-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.fp-footer-sep {
  opacity: 0.4;
}
.fp-footer-mail {
  color: #8B5A2B;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.fp-footer-mail:hover {
  color: #6B4523;
  text-decoration: underline;
}

/* Snap toggle (premium switch) */
.cad-snap-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  padding: 0.4rem 0.7rem !important;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 168, 118, 0.22);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
  color: #E8C896 !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
}
.cad-snap-toggle input { display: none; }
.cad-snap-knob {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(201, 168, 118, 0.18);
  color: #E8C896;
  transition: all 0.2s ease;
}
.cad-snap-knob svg { width: 14px; height: 14px; }
.cad-snap-toggle input:checked + .cad-snap-knob {
  background: linear-gradient(135deg, #C9A876, #9F7F4F);
  color: white;
  box-shadow: 0 0 8px rgba(232, 200, 150, 0.6);
}
.cad-snap-toggle:hover {
  background: rgba(201, 168, 118, 0.12);
  border-color: rgba(232, 200, 150, 0.4);
}
/* Snap step select (obok toggle) */
.cad-snap-step {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 168, 118, 0.22);
  border-radius: 10px;
  color: #E8C896;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: 4px;
}
.cad-snap-step:hover {
  background: rgba(201, 168, 118, 0.12);
  border-color: rgba(232, 200, 150, 0.4);
}
.cad-snap-step option {
  background: #2A1810;
  color: #E8C896;
}

/* Context bar - przyjmuje całą szerokość po dividerach */
.cad-context-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.cad-context {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
}
.cad-context[hidden] { display: none; }

/* Tools (Linia/Łuk/etc) - icon only z label */
.cad-tool {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4em !important;
  padding: 0.5rem 0.75rem !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(201, 168, 118, 0.18) !important;
  color: #E8C896 !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
  min-height: 36px;
}
.cad-tool svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.cad-tool:hover {
  background: rgba(201, 168, 118, 0.14) !important;
  border-color: rgba(232, 200, 150, 0.45) !important;
  color: #FFE6BB !important;
}
.cad-tool.active {
  background: linear-gradient(135deg, #C9A876 0%, #9F7F4F 100%) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(159, 127, 79, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* CTA "Zakończ rysunek" - emerald gradient */
.cad-cta {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4em !important;
  padding: 0.55rem 1rem !important;
  background: linear-gradient(135deg, #4A9E5F 0%, #2D7A3F 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(45, 122, 63, 0.5);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.cad-cta svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.cad-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 122, 63, 0.65);
  filter: brightness(1.08);
}

/* Dropdown menu (Szablony) */
.cad-dropdown { position: relative; display: inline-block; }
.cad-dropdown-trigger { padding-right: 0.55rem !important; }
.cad-dropdown-trigger .cad-chev {
  width: 0.85em !important;
  height: 0.85em !important;
  opacity: 0.7;
  transition: transform 0.2s ease;
  margin-left: -0.1em;
}
.cad-dropdown.open .cad-dropdown-trigger .cad-chev { transform: rotate(180deg); }
.cad-dropdown.open .cad-dropdown-trigger {
  background: rgba(201, 168, 118, 0.25) !important;
  color: white !important;
  border-color: rgba(232, 200, 150, 0.7) !important;
}
.cad-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, #2A1810 0%, #1F1208 100%);
  border: 1px solid rgba(201, 168, 118, 0.3);
  border-radius: 12px;
  padding: 0.4rem;
  min-width: 200px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: cadMenuIn 0.18s ease-out;
}
.cad-dropdown.open .cad-dropdown-menu { display: flex; }
@keyframes cadMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cad-dropdown-item {
  text-align: left;
  background: transparent !important;
  color: #E8C896 !important;
  border: none !important;
  padding: 0.55rem 0.75rem !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  display: block !important;
  width: 100%;
}
.cad-dropdown-item:hover {
  background: rgba(201, 168, 118, 0.2) !important;
  color: white !important;
}

/* Mobile - mode switcher labels chowamy żeby zmieścić */
@media (max-width: 720px) {
  .cad-toolbar { padding: 0.5rem; gap: 0.4rem; }
  .cad-mode span,
  .cad-tool span,
  .cad-iconbtn span,
  .cad-snap-text {
    display: none;
  }
  .cad-mode, .cad-tool, .cad-iconbtn {
    padding: 0.55rem !important;
  }
  .cad-cta { padding: 0.55rem 0.75rem !important; }
  .cad-cta span { display: inline; }
  .cad-divider { display: none; }
}


.cad-canvas-wrap {
  position: relative;
  background: #1A1612 !important;
  border-radius: 14px !important;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 118, 0.25);
  box-shadow: var(--shadow-md), inset 0 0 80px rgba(0,0,0,0.4);
}
.cad-canvas-wrap canvas {
  cursor: crosshair;
  display: block;
  width: 100%;
  height: 100%;
  /* Mobile: blokuj scroll/zoom przeglądarki na canvas żeby touch był dla rysowania */
  touch-action: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cad-canvas-wrap {
  touch-action: none !important;
  -webkit-tap-highlight-color: transparent;
}
/* Dla wszystkich canvas w wizualizacji - to samo */
.canvas-wrap canvas,
#viz-canvas,
#poly-canvas {
  touch-action: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cad-hud {
  position: absolute;
  z-index: 5;
  background: rgba(26, 22, 18, 0.85);
  color: #E8C896;
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 168, 118, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cad-coords {
  top: 12px;
  left: 12px;
}
.cad-zoom {
  top: 12px;
  right: 12px;
}
.cad-status {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(201, 168, 118, 0.18);
  color: #FFE6BB;
  border-color: rgba(201, 168, 118, 0.45);
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .cad-status { font-size: 0.7rem; padding: 0.35rem 0.6rem; }
  .cad-coords, .cad-zoom { font-size: 0.7rem; padding: 0.3rem 0.55rem; }
}

/* CAD-style polygon toolbar */
.polygon-toolbar {
  background: linear-gradient(180deg, rgba(26, 22, 18, 0.95) 0%, rgba(31, 18, 8, 0.92) 100%) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(201, 168, 118, 0.18);
  box-shadow: var(--shadow-md);
}
.polygon-toolbar .chip-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #E8C896 !important;
  border: 1px solid rgba(201, 168, 118, 0.25) !important;
  font-weight: 600 !important;
}
.polygon-toolbar .chip-btn:hover {
  background: rgba(201, 168, 118, 0.18) !important;
  border-color: #C9A876 !important;
  color: white !important;
}
.polygon-toolbar .chip-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(201, 168, 118, 0.4);
}
.polygon-toolbar .chip-btn.warn {
  background: rgba(196, 74, 42, 0.18) !important;
  color: #FFAA80 !important;
  border-color: rgba(196, 74, 42, 0.4) !important;
}
.polygon-toolbar .hint-label {
  color: rgba(232, 200, 150, 0.7) !important;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.polygon-toolbar .inline-check {
  color: #E8C896 !important;
  font-size: 0.85rem;
  font-weight: 500;
}

.polygon-footer .stats-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}
.polygon-footer .stats-row > div {
  flex: 1;
  background: linear-gradient(135deg, #FFF8E8 0%, #FDF1D6 100%);
  border: 1px solid rgba(201, 168, 118, 0.3);
  border-radius: 12px;
  padding: 0.7rem 0.5rem;
  text-align: center;
}
.polygon-footer .stats-row span {
  display: block;
  font-size: 0.7rem;
  color: var(--bronze);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.polygon-footer .stats-row strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--espresso);
  font-weight: 800;
  margin-top: 0.1rem;
}

/* ============ AUTO-CONTRAST: jasny tekst na ciemnym tle ============ */
/* Wszystko wewnątrz polygon-toolbar (espresso) musi mieć light text */
.polygon-toolbar,
.polygon-toolbar * {
  color: var(--text-on-dark) !important;
}
.polygon-toolbar input[type="text"],
.polygon-toolbar input[type="number"],
.polygon-toolbar input[type="checkbox"],
.polygon-toolbar select {
  color: var(--text-on-light-strong) !important;
}
.polygon-toolbar .chip-btn.active {
  color: white !important;
}
.polygon-toolbar label,
.polygon-toolbar span:not(.chip-btn) {
  color: var(--text-on-dark) !important;
}
.polygon-toolbar .hint-label {
  color: var(--text-on-dark-faint) !important;
}

/* CAD canvas wrapper - ciemne tło, wszystkie pochodne HUD jasne */
.cad-canvas-wrap .cad-hud {
  color: var(--text-on-dark-strong) !important;
}

/* Panel detail modal (jasny modal) - wymuś ciemny tekst */
.panel-detail-body,
.panel-detail-body * {
  color: var(--text-on-light) !important;
}
.panel-detail-body strong {
  color: var(--text-on-light-strong) !important;
}
.panel-detail-body .pd-row span {
  color: var(--text-on-light-faint) !important;
}
.panel-detail-header h3 {
  color: var(--text-on-light-strong) !important;
}

/* Splash screen (dark gradient bg) - light text */
#splash, #splash * {
  color: var(--text-on-dark) !important;
}
.splash-tagline {
  color: var(--text-on-dark-faint) !important;
}

/* Wszystkie karty produktów (light bg) - dark text */
.product-card,
.product-card * {
  color: var(--text-on-light) !important;
}
.product-card h4,
.product-card .pc-price strong {
  color: var(--text-on-light-strong) !important;
}
.product-card .pc-mfr {
  color: var(--accent-gold-dark) !important;
}
.product-card .pc-price span,
.product-card .pc-pack,
.product-card .pc-dims {
  color: var(--text-on-light-faint) !important;
}
.product-card .pc-tag {
  color: var(--accent-bronze) !important;
}
.product-card .pc-tag-water {
  color: #1F5FA0 !important;
}

/* Preview modal - ciemny tekst na białym tle */
.prod-preview-modal,
.prod-preview-modal * {
  color: var(--text-on-light) !important;
}
.prod-preview-body h2 {
  color: var(--text-on-light-strong) !important;
}
.prod-preview-body .prod-preview-mfr {
  color: var(--accent-gold-dark) !important;
}
.prod-preview-body .prod-preview-model {
  color: var(--accent-bronze) !important;
}
.prod-preview-body .prod-spec span {
  color: var(--text-on-light-faint) !important;
}
.prod-preview-body .prod-spec strong {
  color: var(--text-on-light-strong) !important;
}
.prod-preview-realphotos {
  color: var(--text-on-light-strong) !important;
  background: white !important;
}
.prod-preview-hero-note {
  color: white !important;
}

/* Modal host (custom modale) */
.modal-content,
.modal-content * {
  color: var(--text-on-light) !important;
}
.modal-content h3,
.modal-content h4,
.modal-content strong {
  color: var(--text-on-light-strong) !important;
}

/* Tabs - jasne tło więc ciemny tekst */
.tabs .tab:not(.active) {
  color: var(--text-on-light-faint) !important;
}
.tabs .tab.active {
  color: white !important;
}

/* Card on light bg - explicit colors */
.card { color: var(--text-on-light) !important; }
.card h2, .card h3, .card h4 { color: var(--text-on-light-strong) !important; }
.card label { color: var(--text-on-light-muted) !important; }
.card label input { color: var(--text-on-light-strong) !important; }
.card .switch-label { color: var(--text-on-light) !important; }
.card .hint { color: var(--text-on-light-faint) !important; }
.card p { color: var(--text-on-light) !important; }
.card p strong { color: var(--text-on-light-strong) !important; }

/* Info card - złotawe tło - ciemny brąz tekst */
.info-card { color: var(--accent-bronze) !important; }
.info-card p { color: var(--accent-bronze) !important; }
.info-card strong { color: var(--text-on-light-strong) !important; }

/* Hero card - jasne tło */
.hero, .hero * { color: var(--text-on-light) !important; }
.hero h2 {
  background: linear-gradient(135deg, var(--surface-espresso) 0%, var(--accent-bronze) 50%, var(--accent-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}
.hero p { color: var(--text-on-light) !important; }
.hero-stats > div { color: var(--text-on-light) !important; }
.hero-stats strong {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}
.hero-stats span { color: var(--text-on-light-faint) !important; }

/* Header - paper bg */
.app-header, .app-header * { color: var(--text-on-light) !important; }
#header-title { color: var(--text-on-light-strong) !important; }
.header-subtitle { color: var(--accent-gold-dark) !important; }
.brand-icon svg path { stroke: white !important; }

/* FP feats pills (light bg) */
.fp-feats span { color: var(--accent-bronze) !important; }
.fp-feats span:hover { color: white !important; }
.fp-feats span:hover .ui-icon { color: white !important; }

/* Empty state */
.empty-state, .empty-state * { color: var(--text-on-light) !important; }
.empty-state h3 { color: var(--text-on-light-strong) !important; }
.empty-state p { color: var(--text-on-light-muted) !important; }

/* Polygon footer - jasne */
.polygon-footer { color: var(--text-on-light) !important; }
.polygon-footer .stats-row > div { color: var(--accent-bronze) !important; }
.polygon-footer .stats-row span { color: var(--accent-bronze) !important; }
.polygon-footer .stats-row strong { color: var(--text-on-light-strong) !important; }
.polygon-footer .hint { color: var(--text-on-light-faint) !important; }

/* Toast (dark notification) */
.toast { color: var(--text-on-dark-strong) !important; }

/* Wszystkie inputs - zawsze ciemny tekst na białym tle */
input[type="text"], input[type="number"], input[type="search"], input[type="email"],
input[type="password"], input[type="tel"], select, textarea {
  color: var(--text-on-light-strong) !important;
  background: white !important;
}
input::placeholder { color: var(--text-on-light-faint) !important; opacity: 1; }

/* Buttons primary - zawsze biały tekst */
.btn-primary, .btn-primary * { color: white !important; }
.btn-primary .ui-icon { color: white !important; }

/* Buttons secondary - ciemny tekst na jasnym */
.btn-secondary, button.btn-secondary {
  color: var(--text-on-light-strong) !important;
  background: var(--surface-paper) !important;
  border: 1.5px solid var(--border-strong) !important;
}
.btn-secondary:hover {
  border-color: var(--accent-gold) !important;
  background: var(--accent-warm-light) !important;
}

/* Chips (light bg) - dark text */
.chip:not(.active) { color: var(--text-on-light-strong) !important; }
.chip.active, .chip.active * { color: white !important; }
.dir-chip:not(.active) { color: var(--text-on-light-strong) !important; }
.dir-chip.active { color: white !important; }

/* Linki - gold */
a:not(.btn-primary):not(.chip):not(.btn-secondary):not(.product-card):not(.pc-thumb-photos) {
  color: var(--accent-gold-dark) !important;
}
a:hover { color: var(--accent-bronze) !important; }

/* Result panel detail body - tekst na jasnym */
#viz-stats, #viz-stats * { color: var(--text-on-light) !important; }
#viz-stats h3, #viz-stats h4, #viz-stats strong { color: var(--text-on-light-strong) !important; }

/* Catalog filtry */
.catalog-filters, .catalog-filters * { color: var(--text-on-light) !important; }
.catalog-filters label { color: var(--text-on-light-muted) !important; }
.catalog-filters select, .catalog-filters input { color: var(--text-on-light-strong) !important; }

/* Progress overlay (dark backdrop) */
.progress-box, .progress-box * { color: var(--text-on-light-strong) !important; }
.progress-title { color: var(--accent-bronze) !important; }
.progress-label { color: var(--text-on-light-muted) !important; }

/* Wood skin chips */
.wood-skin-chip { color: var(--text-on-light) !important; }
.wood-skin-chip.active { color: white !important; }
.wood-skin-chip .wood-skin-label { color: inherit !important; }

/* Catalog body fix */
#view-catalog, #cat-list, .product-card { color: var(--text-on-light) !important; }

/* Quick-links w product preview */
.ql-btn, .ql-btn * { color: var(--text-on-light) !important; }
.ql-btn .ql-label { color: var(--text-on-light-strong) !important; }
.ql-btn .ql-sub { color: var(--text-on-light-faint) !important; }

/* ============ PREMIUM SHADOW LIFT FOR CARDS ============ */
.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ============ ROUNDED ELEGANCE BAR ============ */
.app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 248, 242, 0.92) 100%) !important;
  border-bottom: 1px solid var(--border-gold) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 16px rgba(42, 24, 16, 0.06), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

/* ============ MOBILE — ZERO CUT-OFF TEXT ============ */
@media (max-width: 768px) {
  /* Buttons - normal whitespace, allow wrap */
  button, .chip, .dir-chip, .btn-primary, .btn-secondary,
  .cad-mode, .cad-tool, .cad-iconbtn, .cad-cta,
  .pc-tag, .ql-btn, .product-card,
  .fab-stack button, .tab {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    text-overflow: clip !important;
    min-width: 0 !important;
  }
  /* Big CTA buttons - full width, comfortable padding */
  .btn-primary.big {
    width: 100% !important;
    padding: 0.95rem 0.9rem !important;
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
    text-align: center;
  }
  .btn-primary {
    padding: 0.7rem 0.85rem !important;
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
  }
  /* Tabs - allow wrapping, smaller */
  .tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem !important;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0 !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
  }
  /* Pattern chips - smaller */
  .pattern-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
  }
  .chip {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
    flex-shrink: 0;
  }
  /* Direction chips */
  .dir-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
  }
  .dir-chip {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
  }
  /* FP feats pills */
  .fp-feats {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.35rem !important;
  }
  .fp-feats span {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
  }
  /* Hero stats - kolumny zamiast row jeśli za wąsko */
  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .hero-stats > div {
    padding: 0.7rem 0.5rem !important;
    min-width: 0 !important;
  }
  .hero-stats strong { font-size: 1.3rem !important; line-height: 1.1 !important; }
  .hero-stats span { font-size: 0.65rem !important; letter-spacing: 0.03em !important; }
  /* Catalog filters - stack */
  .catalog-filters {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .catalog-filters select,
  .catalog-filters input {
    width: 100% !important;
    font-size: 16px !important;
  }
  /* Product card - 1 kolumna */
  #cat-list {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .product-card h4 { font-size: 1rem !important; line-height: 1.25 !important; }
  .product-card .pc-mfr { font-size: 0.65rem !important; }
  .product-card .pc-dims { font-size: 0.78rem !important; }
  .product-card .pc-price strong { font-size: 1.2rem !important; }
  /* Preview modal - full screen na mobile */
  .prod-preview-overlay { padding: 0.5rem !important; }
  .prod-preview-modal {
    max-height: 95vh !important;
    border-radius: 16px !important;
  }
  .prod-preview-hero { height: 180px !important; }
  .prod-preview-body { padding: 1rem 1rem 1.25rem !important; }
  .prod-preview-body h2 { font-size: 1.45rem !important; line-height: 1.2 !important; }
  .prod-preview-specs {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .prod-preview-quicklinks {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
  }
  .ql-btn {
    padding: 0.65rem 0.4rem !important;
    flex-direction: column !important;
  }
  .ql-btn .ql-label { font-size: 0.85rem !important; line-height: 1.2 !important; }
  .ql-btn .ql-sub { font-size: 0.65rem !important; line-height: 1.1 !important; }
  .ql-btn .ql-icon { font-size: 1.25rem !important; }
  /* Bottom-actions w editorze - stack jeśli nie mieści */
  .bottom-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    padding: 0.6rem !important;
  }
  .bottom-actions button {
    flex: 1 1 auto !important;
    min-width: 90px !important;
    font-size: 0.82rem !important;
    padding: 0.65rem 0.7rem !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }
  /* CAD topbar - mobile compact */
  .cad-topbar {
    padding: 0.4rem !important;
    gap: 0.3rem !important;
  }
  .cad-mode {
    padding: 0.45rem 0.55rem !important;
    font-size: 0.78rem !important;
  }
  .cad-mode span {
    display: none !important;
  }
  .cad-iconbtn span {
    display: none !important;
  }
  .cad-snap-text {
    display: none !important;
  }
  /* CAD sidebar bottom strip on mobile */
  .cad-sidebar .cad-tool span,
  .cad-sidebar .cad-iconbtn span,
  .cad-sidebar .cad-cta span {
    display: inline !important;
    font-size: 0.75rem !important;
  }
  .cad-sidebar .cad-cta { font-size: 0.78rem !important; padding: 0.5rem 0.75rem !important; }
  /* Polygon footer stats */
  .polygon-footer .stats-row {
    gap: 0.4rem !important;
  }
  .polygon-footer .stats-row > div {
    padding: 0.55rem 0.35rem !important;
    min-width: 0 !important;
  }
  .polygon-footer .stats-row span { font-size: 0.6rem !important; letter-spacing: 0.02em !important; }
  .polygon-footer .stats-row strong { font-size: 1.1rem !important; }
  /* Info-strip */
  .info-strip {
    flex-direction: column !important;
    gap: 0.4rem !important;
  }
  .info-strip > div { padding: 0.65rem !important; }
  .info-strip strong { font-size: 1.15rem !important; }
  /* Toolbar (home) */
  .toolbar { gap: 0.45rem !important; }
  .toolbar input, .toolbar select { font-size: 16px !important; }
  /* Hero text - mniejsze */
  .hero { padding: 1.25rem 1rem !important; }
  .hero-text h2 { font-size: 1.55rem !important; line-height: 1.15 !important; }
  .hero-text p { font-size: 0.9rem !important; }
  /* Empty-state */
  .empty-state { padding: 1.5rem 1rem !important; }
  .empty-state h3 { font-size: 1.2rem !important; line-height: 1.25 !important; }
  .empty-state p { font-size: 0.9rem !important; }
}
@media (max-width: 380px) {
  .btn-primary.big { padding: 0.85rem 0.7rem !important; font-size: 0.9rem !important; }
  .tab { padding: 0.5rem 0.6rem !important; font-size: 0.78rem !important; }
  .chip { padding: 0.35rem 0.55rem !important; font-size: 0.74rem !important; }
  .pc-tag { padding: 0.18rem 0.45rem !important; font-size: 0.65rem !important; }
  .cad-mode { padding: 0.4rem 0.5rem !important; font-size: 0.72rem !important; }
  .hero-text h2 { font-size: 1.4rem !important; }
  .fp-feats span { font-size: 0.72rem !important; padding: 0.35rem 0.6rem !important; }
}

/* ============ KILL DARK MODE ============ */
body.dark-mode, body.auto-dark {
  background: var(--cream) !important;
  color: var(--text-primary) !important;
}

/* ============ PANEL DETAIL - MODAL OVERLAY ============ */
.panel-detail {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: rgba(26, 22, 18, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2rem 1rem !important;
  animation: pdOverlayIn 0.25s ease !important;
}
.panel-detail[hidden] { display: none !important; }
@keyframes pdOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.panel-detail-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1.25rem 1.5rem !important;
  border-bottom: 1px solid var(--border) !important;
  background: linear-gradient(135deg, #FFF8E8 0%, #FDF1D6 100%) !important;
  border-radius: 20px 20px 0 0 !important;
}
.panel-detail-header h3 {
  margin: 0 !important;
  font-size: 1.35rem !important;
  color: var(--espresso) !important;
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 700 !important;
}
.panel-detail-header .icon-btn-light,
.panel-detail-header #pd-close {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,0.7) !important;
  border: 1px solid var(--border) !important;
  font-size: 1.4rem !important;
  cursor: pointer !important;
  color: var(--bronze) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.panel-detail-header #pd-close:hover {
  background: white !important;
  border-color: var(--gold) !important;
  color: var(--espresso) !important;
}
/* Wewnętrzny "modal" body wrapped przez fake DIV (animation slidein) */
.panel-detail::before {
  content: "";
  position: absolute;
  inset: 2rem 1rem;
  pointer-events: none;
}
.pd-canvas {
  display: block !important;
  width: 100% !important;
  max-width: 700px !important;
  height: 480px !important;
  background: linear-gradient(135deg, #FAF6EE 0%, #F0E8D8 100%) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.4) !important;
  margin: 1.25rem auto !important;
}
.panel-detail-body {
  width: 100% !important;
  max-width: 760px !important;
  padding: 0 1.5rem 1.5rem !important;
  font-size: 0.95rem !important;
  color: var(--text-primary) !important;
}
.panel-detail-body .pd-row {
  display: flex !important;
  justify-content: space-between !important;
  padding: 0.75rem 0 !important;
  border-bottom: 1px solid var(--border) !important;
}
.panel-detail-body .pd-row:last-child { border: 0 !important; }
.panel-detail-body .pd-row span { color: var(--text-muted) !important; opacity: 1 !important; }
.panel-detail-body .pd-row strong {
  font-weight: 700 !important;
  color: var(--espresso) !important;
  text-align: right !important;
}
.panel-detail-body .pd-instruction {
  margin-top: 1rem !important;
  padding: 1rem 1.25rem !important;
  background: linear-gradient(135deg, #FFF6E0 0%, #FDEEC5 100%) !important;
  border: 1px solid rgba(201,168,118,0.35) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}
.panel-detail-body .pd-instruction strong { color: var(--bronze) !important; }
/* Cały modal jako jeden bloczek na bg overlay */
.panel-detail > * {
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  border-radius: 20px;
  max-width: 760px;
  width: 100%;
  animation: pdModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel-detail-header { border-radius: 20px 20px 0 0 !important; }
@keyframes pdModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 768px) {
  .pd-canvas { height: 340px !important; }
  .panel-detail { padding: 1rem 0.5rem !important; }
  .panel-detail-body, .panel-detail-header { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ============ INFO STRIP ============ */
.info-strip {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}
.info-strip > div {
  flex: 1;
  padding: 1rem;
  background: linear-gradient(135deg, #FFF8E8 0%, #FDF1D6 100%);
  border: 1px solid rgba(201,168,118,0.25);
  border-radius: 12px;
  text-align: center;
}
.info-strip strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bronze);
}
.info-strip span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============ SWITCH ============ */
.switch {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-top: 0.75rem;
}
.switch input { display: none; }
.switch-slider {
  width: 44px;
  height: 24px;
  background: #DDD;
  border-radius: 100px;
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}
.switch input:checked + .switch-slider::after {
  transform: translateX(20px);
}
.switch-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============ GRID 2 ============ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) {
  body { font-size: 14px; }
  .view { padding: 0.75rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 0.75rem; }
  h2 { font-size: 1.6rem !important; }
  h3 { font-size: 1.1rem; }
  .hero { padding: 1.5rem 1.15rem !important; border-radius: 16px; margin-bottom: 1rem; }
  .hero-text h2 { font-size: 1.7rem; }
  .hero-text p { font-size: 0.92rem; }
  .hero::before { width: 220px; height: 220px; top: -30%; right: -25%; }
  .card { padding: 1.1rem; border-radius: 14px; margin-bottom: 0.75rem; }
  .toolbar { flex-direction: column; gap: 0.5rem; }
  .toolbar input, .toolbar select { width: 100%; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; padding: 0.55rem 0.85rem; font-size: 0.85rem; }
  .chip, .dir-chip { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
  .btn-primary { padding: 0.75rem 1.25rem; font-size: 0.92rem; min-height: 44px; }
  .btn-primary.big { padding: 0.9rem 1.5rem; font-size: 0.95rem; }
  input[type="text"], input[type="number"], input[type="search"], select, textarea {
    font-size: 16px; /* Prevents iOS auto-zoom */
    padding: 0.75rem 0.85rem;
    min-height: 44px;
  }
  label { font-size: 0.82rem; }
  .hero-stats { gap: 0.5rem; }
  .hero-stats > div { padding: 0.75rem; min-width: 0; }
  .hero-stats strong { font-size: 1.4rem; }
  .info-strip { flex-direction: column; gap: 0.5rem; }
  .fab-stack { bottom: 1rem; right: 1rem; gap: 0.6rem; }
  .fab { width: 52px; height: 52px; font-size: 1.4rem; }
  .fab-secondary { width: 42px; height: 42px; font-size: 1rem; }
  .icon-btn { width: 38px; height: 38px; min-height: 38px; }
  .empty-state { padding: 2rem 1rem; }
  .empty-icon { font-size: 2.5rem; }
  .empty-state h3 { font-size: 1.3rem; }
  .row-between { flex-wrap: wrap; gap: 0.5rem; }
  #header-title { font-size: 1.15rem; }
  .header-subtitle { font-size: 0.65rem; }
  .brand-icon { width: 36px; height: 36px; }
  .splash-logo { font-size: 2.8rem !important; }
  .splash-tagline { font-size: 0.65rem !important; }
  /* Safe area dla iPhone notch */
  .app-header { padding-top: env(safe-area-inset-top); }
  .fab-stack { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 380px) {
  h2 { font-size: 1.4rem !important; }
  .hero-text h2 { font-size: 1.5rem; }
  .tab { padding: 0.5rem 0.7rem; font-size: 0.8rem; }
  .chip, .dir-chip { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
}

/* ============ ROW BETWEEN ============ */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ============ HINT ============ */
.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ============ FAB STACK ============ */
.fab-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
}
.fab-secondary {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  background: var(--surface);
  color: var(--bronze);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}
.fab-secondary:hover {
  background: #FFF8EC;
  border-color: var(--gold);
  transform: scale(1.05);
}

/* ============= AI RENDER ============= */
.btn-airender {
  background: linear-gradient(135deg, #FFB347 0%, #FF6B6B 50%, #C77DFF 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3) !important;
  position: relative;
  overflow: hidden;
}
.btn-airender:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.5) !important;
}
.ai-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 0.6rem 0;
}
.ai-style-card {
  display: block;
  cursor: pointer;
  border: 2px solid var(--border-light, #D4BFA0);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--surface-cream, #FAF6EE);
  transition: all 0.18s;
}
.ai-style-card:hover {
  border-color: #C9A876;
  transform: translateY(-1px);
}
.ai-style-card input[type="radio"] {
  display: none;
}
.ai-style-card:has(input:checked) {
  border-color: #FF6B6B;
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.08), rgba(199, 125, 255, 0.08));
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}
.ai-style-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.ai-style-label { font-weight: 700; color: #3A2A1A; margin-bottom: 0.15rem; }
.ai-style-desc { font-size: 0.78rem; color: #6F5E4A; line-height: 1.3; }

.ai-loading {
  text-align: center;
  padding: 1.4rem;
  background: var(--surface-cream, #FAF6EE);
  border-radius: 10px;
}
.ai-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(201, 168, 118, 0.2);
  border-top-color: #FF6B6B;
  border-radius: 50%;
  animation: ai-spin 0.9s linear infinite;
  margin: 0 auto 0.8rem;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-result {
  text-align: center;
  margin-top: 0.8rem;
}
.ai-result img {
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(60, 40, 20, 0.25);
}

.ai-error {
  background: rgba(232, 74, 74, 0.08);
  border-left: 4px solid #E84A4A;
  padding: 0.8rem;
  border-radius: 8px;
}

.ai-gallery {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light, #D4BFA0);
}
.ai-gallery h4 { font-size: 0.85rem; opacity: 0.7; margin: 0 0 0.5rem 0; font-weight: 600; }
.ai-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.ai-gallery-item {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.ai-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.ai-gallery-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0.3rem 0.3rem;
  text-align: center;
}

@media (max-width: 768px) {
  .ai-style-grid { grid-template-columns: 1fr; }
  .ai-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============= AI LIGHTBOX ============= */
.ai-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(8px);
  animation: ai-lb-in 0.2s ease-out;
}
@keyframes ai-lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ai-lightbox-inner {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.ai-lightbox-inner img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}
.ai-lightbox-caption {
  color: #fff;
  font-weight: 600;
  text-align: center;
  font-size: 1rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.ai-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: 0;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ai-lightbox-close:hover { transform: scale(1.08); }
.ai-lightbox-dl {
  background: linear-gradient(135deg, #FFB347, #FF6B6B);
  color: #fff !important;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  display: inline-block;
}
.ai-lightbox-dl:hover { transform: translateY(-1px); }

.ai-result-img:hover { opacity: 0.92; }
.ai-gallery-item { transition: transform 0.15s; }
.ai-gallery-item:hover { transform: scale(1.04); }

@media (max-width: 768px) {
  .ai-lightbox { padding: 0.6rem; }
  .ai-lightbox-close { top: 5px; right: 5px; }
}

/* ============= 3D LAYOUT + FURNITURE SIDEBAR ============= */
.three-layout {
  display: flex;
  gap: 0.8rem;
  height: 65vh;
  min-height: 480px;
}
.three-canvas-wrap {
  flex: 1 1 auto;
  height: 100%;
  padding: 0;
}
.furniture-sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: var(--surface-cream, #FAF6EE);
  border-radius: 12px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border-light, #D4BFA0);
  overflow: hidden;
}
.furniture-sidebar h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.95rem;
  color: #3A2A1A;
}
#furniture-search {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.85rem;
}
.furniture-categories {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}
.furn-cat {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border-light);
  background: transparent;
  border-radius: 16px;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.furn-cat:hover {
  background: rgba(201, 168, 118, 0.12);
}
.furn-cat.active {
  background: linear-gradient(135deg, #C9A876, #B8966B);
  color: white;
  border-color: #B8966B;
}
.furniture-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-right: 0.3rem;
}
.furn-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0;
  color: #6F5E4A;
  font-size: 0.85rem;
}
.furn-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.4rem;
  cursor: grab;
  transition: all 0.15s;
}
.furn-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.15);
  border-color: #C9A876;
}
.furn-item:active { cursor: grabbing; }
.furn-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f0e8d8;
}
.furn-item-name {
  font-size: 0.7rem;
  margin-top: 0.3rem;
  color: #4A3A24;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .three-layout {
    flex-direction: column;
    height: auto;
  }
  .three-canvas-wrap {
    height: 50vh;
  }
  .furniture-sidebar {
    width: 100%;
    flex: 0 0 auto;
    max-height: 40vh;
  }
  .furniture-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* AI Texture button w pokoju */
.btn-ai-tex {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(135deg, #6F4530 0%, #8B5C3D 50%, #C9A876 100%);
  color: white;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(107, 69, 35, 0.25);
  transition: all 0.18s;
}
.btn-ai-tex:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(107, 69, 35, 0.4);
}
.btn-ai-tex:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
.btn-ai-tex .badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-left: 0.3rem;
}

/* === FP-FEATS chipy z ikon AI (Nano Banana) === */
.fp-feats {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem auto;
  max-width: 720px;
}
.fp-feats .feat-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem !important;
  margin: 0 !important;
  background: white !important;
  border: 1.5px solid var(--border-strong, #C9A876) !important;
  border-radius: 100px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #6B4523 !important;
  transition: all 0.2s ease;
  line-height: 1.2;
}
.fp-feats .feat-chip:hover {
  background: linear-gradient(135deg, #E8C896, #C9A876) !important;
  border-color: transparent !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 168, 118, 0.35);
  color: white !important;
}
.fp-feats .feat-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* === FIX: napisy w buttonach nie mieszczą się === */
button {
  white-space: nowrap;
  min-width: fit-content;
  text-overflow: clip;
}
/* Wyjątki - elementy gdzie wrap jest ok */
button.chip, button.dir-chip, button.tab,
.fp-feats .feat-chip, .pattern-chips .chip {
  white-space: nowrap;
}
/* room-actions buttony (Kształt, Wizualizacja, AI Render, Otwór) */
.room-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.room-actions button {
  flex: 0 1 auto;
  white-space: nowrap;
  min-width: fit-content;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}
/* Btn-primary big nie obcina napisów */
.btn-primary, .btn-secondary {
  white-space: nowrap;
  min-width: fit-content;
}
/* Mobile - bottom actions może 2 rzędy */
@media (max-width: 720px) {
  .bottom-actions {
    padding: 0.6rem 0;
    gap: 0.35rem;
  }
  .bottom-actions button {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.82rem !important;
  }
  .room-actions button {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.78rem !important;
  }
}

/* === TIER 2: TRYB PREZENTACJI (full-screen showroom) === */
.presentation-mode {
  background: linear-gradient(135deg, #1a1410, #2a201a) !important;
}
.presentation-mode .app-header,
.presentation-mode .tabs,
.presentation-mode .bottom-actions,
.presentation-mode .toolbar {
  display: none !important;
}
.presentation-mode .three-mount {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}
.presentation-mode .furniture-sidebar {
  position: fixed !important;
  right: 0; top: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85) !important;
  color: white !important;
}

/* ============ CAD Properties Panel ============ */
.cad-props {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFFEF9, #FFF8EE);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid var(--border-strong, #C9A876);
  box-shadow: 0 8px 24px rgba(107, 69, 35, 0.1);
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cad-props-section {
  background: white;
  border-radius: 10px;
  padding: 0.8rem;
  border: 1px solid #F0E0C0;
}
.cad-props-section h4 {
  margin: 0 0 0.6rem;
  color: #6B4523;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.cad-props-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.cad-props-stats > div {
  background: #FFF8EE;
  padding: 0.5rem 0.6rem;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
}
.cad-props-stats span {
  font-size: 0.7rem;
  color: #9F7F4F;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cad-props-stats strong {
  font-size: 1rem;
  color: #6B4523;
  margin-top: 0.15rem;
}
.cad-prop-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #6B4523;
}
.cad-prop-row span {
  flex: 1;
  font-weight: 600;
}
.cad-prop-row input {
  width: 70px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d0b890;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: right;
}
.cad-walls-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 250px;
  overflow-y: auto;
}
.cad-wall-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #FFF8EE;
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  border: 1px solid #F0E0C0;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.cad-wall-item:hover {
  background: linear-gradient(135deg, #FFF, #FFE8C0);
  border-color: var(--gold, #C9A876);
  transform: translateX(2px);
}
.cad-wall-item-num {
  background: var(--gold-dark, #9F7F4F);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.cad-wall-item-len {
  flex: 1;
  font-weight: 700;
  color: #6B4523;
}
.cad-wall-item-lock {
  color: #9F7F4F;
  cursor: pointer;
}
.cad-empty {
  color: #9F7F4F;
  font-style: italic;
  font-size: 0.85rem;
  margin: 0;
}
.cad-shortcuts {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
  color: #6B4523;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cad-shortcuts kbd {
  background: #F0E0C0;
  color: #6B4523;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  border: 1px solid #C9A876;
}

@media (max-width: 900px) {
  .cad-workspace { flex-direction: column; }
  .cad-props { width: 100%; max-height: 300px; }
}

/* ============ Onboarding overlay ============ */
.cad-onboarding {
  position: fixed;
  inset: 0;
  background: rgba(30,18,8,0.85);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}
.cad-onboarding-card {
  background: linear-gradient(180deg, white, #FFF8EE);
  border-radius: 18px;
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.cad-onboarding-card h2 {
  color: #6B4523;
  margin: 0 0 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
}
.cad-onboarding-card .tips {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0;
}
.cad-onboarding-card .tip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: white;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border-left: 4px solid var(--gold, #C9A876);
}
.cad-onboarding-card .tip-icon {
  font-size: 1.4rem;
}

/* === CAD - sidebar full scroll + mobile fix === */
@media (max-width: 1100px) {
  .cad-sidebar {
    width: 92px;
  }
  .cad-sidebar .cad-tool span,
  .cad-sidebar .cad-iconbtn span {
    font-size: 0.62rem !important;
  }
}
@media (max-width: 760px) {
  .cad-workspace {
    flex-direction: column;
  }
  .cad-sidebar {
    width: 100%;
    max-height: 110px;
    overflow-y: hidden;
    overflow-x: auto;
  }
  .cad-sidebar .cad-context {
    flex-direction: row !important;
    flex-wrap: nowrap;
    min-width: max-content;
  }
  .cad-sidebar .cad-tool,
  .cad-sidebar .cad-iconbtn {
    min-width: 75px;
    width: 75px !important;
  }
  .cad-props {
    width: 100%;
    max-height: 280px;
  }
}

/* ============================================================
   v=299 — TOPBAR FIX: nowrap + logical grouping + Exit-last
   Diagnoza: `.cad-topbar` (line 1708) miał `flex-wrap: wrap`
   nadpisując `.cad-floating-top { flex-wrap: nowrap }`. Plus za
   szerokie vis-toggles z labelami push'owały całość do wrap.
   ============================================================ */

/* Topbar: ZAWSZE nowrap; gdy nie mieści — przewija poziomo */
.cad-floating.cad-floating-top.cad-topbar {
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 118, 0.4) transparent;
}
.cad-floating.cad-floating-top.cad-topbar::-webkit-scrollbar {
  height: 4px;
}
.cad-floating.cad-floating-top.cad-topbar::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 118, 0.4);
  border-radius: 2px;
}

/* 3 grupy: LEFT (orientacja) | CENTER (mode) | RIGHT (akcje)
   UWAGA: NIE nadpisuję .cad-mode-switch (ma swój gap: 2px między modami).
   Stosuję flex-only do non-mode grup. */
.cad-floating-top > .cad-tb-group:not(.cad-mode-switch) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.cad-floating-top > .cad-mode-switch.cad-tb-center {
  flex-shrink: 0;
}
.cad-floating-top > .cad-tb-center {
  margin: 0 auto;
}
.cad-floating-top > .cad-tb-right {
  margin-left: auto;
}
.cad-floating-top > .cad-tb-center ~ .cad-tb-right {
  margin-left: 0;
}

/* Room name input — węższy w topbarze (było 180px min — za dużo) */
.cad-floating-top .cad-room-name-input {
  min-width: 130px !important;
  max-width: 200px !important;
  font-size: 0.85rem !important;
  padding: 0.4rem 0.6rem !important;
}

/* Icon-only buttons (undo/redo + vis-toggles) — KOMPAKT */
.cad-floating-top .cad-iconbtn-icon {
  padding: 0.4rem 0.5rem !important;
  min-width: 34px !important;
  min-height: 34px !important;
}
.cad-floating-top .cad-iconbtn-icon span {
  display: none !important; /* aria-label zostaje w atrybucie */
}
.cad-floating-top .cad-iconbtn-icon svg {
  width: 16px !important;
  height: 16px !important;
}

/* Snap-step select — kompakt */
.cad-floating-top .cad-snap-step {
  padding: 0.3rem 0.4rem !important;
  font-size: 0.78rem !important;
  min-width: auto !important;
  width: auto !important;
}

/* Vis-toggles active state — subtelny złoty highlight */
.cad-floating-top .cad-vis-toggle.active {
  background: linear-gradient(180deg, rgba(232, 200, 150, 0.22), rgba(232, 200, 150, 0.1)) !important;
  border-color: rgba(232, 200, 150, 0.55) !important;
  color: #FFE6BB !important;
}
.cad-floating-top .cad-vis-toggle:not(.active) {
  opacity: 0.55;
}
.cad-floating-top .cad-vis-toggle:not(.active):hover {
  opacity: 1;
}

/* Exit — rightmost + delikatnie czerwonawy hover */
.cad-floating-top .cad-iconbtn-exit {
  background: linear-gradient(180deg, rgba(180, 90, 90, 0.15), rgba(140, 60, 60, 0.1)) !important;
  border-color: rgba(200, 120, 120, 0.35) !important;
}
.cad-floating-top .cad-iconbtn-exit:hover {
  background: linear-gradient(180deg, rgba(200, 100, 100, 0.35), rgba(160, 70, 70, 0.25)) !important;
  border-color: rgba(220, 140, 140, 0.7) !important;
}

/* Dividers w topbarze — cieńsze */
.cad-floating-top .cad-divider {
  height: 22px;
  margin: 0 0.1rem;
  opacity: 0.5;
}

/* Mobile (≤768px) — wszystko jeszcze bardziej kompaktowe */
@media (max-width: 768px) {
  .cad-floating.cad-floating-top.cad-topbar {
    gap: 0.3rem !important;
    padding: 0.4rem 0.5rem !important;
  }
  .cad-tb-center { margin: 0 !important; }
  .cad-tb-right { margin-left: auto !important; }
  .cad-floating-top .cad-iconbtn-icon {
    padding: 0.35rem !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }
  .cad-floating-top .cad-iconbtn-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
  .cad-floating-top .cad-room-name-input {
    min-width: 90px !important;
    max-width: 130px !important;
    font-size: 0.78rem !important;
  }
  /* Na mobile drop 2 vis-toggle (kąty + osie) — zbyt cisno */
  .cad-floating-top #vis-angles,
  .cad-floating-top #vis-axes {
    display: none !important;
  }
}

/* Sidebar dividers — wyraźniejsze separatory grup */
.cad-sidebar .cad-context > .cad-divider {
  width: 80% !important;
  margin: 0.35rem auto !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 168, 118, 0.35) 50%, transparent 100%) !important;
}

/* End v=299 ===================================================== */


/* ============================================================
   v=302 — CAD button centering & alignment polish
   - Sidebar: labels wrap 2-line (no ellipsis), 108px width
   - Topbar: wszystkie items unified 36px height, ten sam baseline
   - Dividers: 26px, idealny vertical center
   ============================================================ */

/* === SIDEBAR === */
/* Lekko szersze (100 → 108px) by długie etykiety nie wymagały ellipsis */
.cad-sidebar {
  width: 108px !important;
}

/* Labels: wrap do 2 linii, idealnie wycentrowane */
.cad-sidebar .cad-tool span,
.cad-sidebar .cad-iconbtn span,
.cad-sidebar .cad-cta span {
  white-space: normal !important;
  text-overflow: clip !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  line-clamp: 2 !important;
  line-height: 1.1 !important;
  max-height: 2.2em !important;
  word-break: break-word !important;
  hyphens: auto !important;
}

/* Spójna wysokość niezależnie od 1/2 linii tekstu */
.cad-sidebar .cad-tool,
.cad-sidebar .cad-iconbtn,
.cad-sidebar .cad-cta {
  min-height: 66px !important;
  padding: 0.55rem 0.3rem !important;
  gap: 0.35rem !important;
}

/* Ikona zawsze na środku, niezależnie od wysokości tekstu poniżej */
.cad-sidebar .cad-tool > svg,
.cad-sidebar .cad-iconbtn > svg,
.cad-sidebar .cad-cta > svg {
  margin: 0 auto !important;
}

/* Dropdown trigger inside sidebar — taki sam look */
.cad-sidebar .cad-dropdown-trigger {
  min-height: 66px !important;
  padding: 0.55rem 0.3rem !important;
}

/* === TOPBAR === */
/* Unified 36px height na WSZYSTKIE items - common baseline */
.cad-floating-top .cad-iconbtn,
.cad-floating-top .cad-iconbtn-icon,
.cad-floating-top .cad-iconbtn-exit,
.cad-floating-top .cad-snap-toggle,
.cad-floating-top .cad-snap-step,
.cad-floating-top .cad-room-name-input,
.cad-floating-top .cad-mode {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* Mode-switch (segment control wrapper) - dopasuj zewnetrza wysokość */
.cad-floating-top > .cad-mode-switch {
  height: 36px !important;
  padding: 3px !important;
  align-items: stretch !important;
}
.cad-floating-top > .cad-mode-switch .cad-mode {
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 0.85rem !important;
  border-radius: 8px !important;
}

/* Breadcrumb - mniejszy chip, ale wycentrowany do common baseline */
.cad-floating-top .cad-breadcrumb {
  height: 28px !important;
  padding: 0 0.6rem 0 0.45rem !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

/* Dividers - 24px wysokie, perfekcyjnie wycentrowane */
.cad-floating-top .cad-divider {
  height: 24px !important;
  align-self: center !important;
  margin: 0 0.15rem !important;
}

/* Icon-only buttons - kwadratowe 36×36, ikona idealnie centruje */
.cad-floating-top .cad-iconbtn-icon {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
}

/* Snap-toggle - 1 linia, równa wysokość, gap między magnesem a tekstem */
.cad-floating-top .cad-snap-toggle {
  padding: 0 0.55rem !important;
  gap: 0.4rem !important;
  font-size: 0.78rem !important;
}
.cad-floating-top .cad-snap-toggle .cad-snap-knob {
  width: 20px !important;
  height: 20px !important;
}

/* Snap-step select - kompakt, ten sam baseline */
.cad-floating-top .cad-snap-step {
  padding: 0 0.4rem !important;
  font-size: 0.78rem !important;
  cursor: pointer;
}

/* Exit button - tylko ON ma label "Wyjdź", więc nieco szerszy */
.cad-floating-top .cad-iconbtn-exit {
  padding: 0 0.7rem !important;
  gap: 0.4rem !important;
}
.cad-floating-top .cad-iconbtn-exit span {
  display: inline !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

/* Room name input - text vertically centered (input default ok ale dla pewnosci) */
.cad-floating-top .cad-room-name-input {
  display: inline-block !important;
  vertical-align: middle !important;
  padding: 0 0.7rem !important;
  line-height: 36px !important;
}

/* Mobile - zmniejsz wysokosc topbar items do 30px */
@media (max-width: 768px) {
  .cad-floating-top .cad-iconbtn,
  .cad-floating-top .cad-iconbtn-icon,
  .cad-floating-top .cad-iconbtn-exit,
  .cad-floating-top .cad-snap-toggle,
  .cad-floating-top .cad-snap-step,
  .cad-floating-top .cad-room-name-input,
  .cad-floating-top .cad-mode {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
  }
  .cad-floating-top > .cad-mode-switch {
    height: 30px !important;
    padding: 2px !important;
  }
  .cad-floating-top > .cad-mode-switch .cad-mode {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 0.6rem !important;
  }
  .cad-floating-top .cad-iconbtn-icon {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
  }
  .cad-floating-top .cad-divider {
    height: 20px !important;
  }
  .cad-floating-top .cad-breadcrumb {
    height: 24px !important;
  }
}

/* End v=302 ==================================================== */


/* ============================================================
   v=308 — Mobile CAD sanity reset
   - Chevron toggles (left/right) całkowicie ukryte
   - Safe area dla iPhone notch
   - Solid topbar/dock background (canvas nie przeswituje)
   - 2-finger touch enabled (canvas.touch-action)
   ============================================================ */

@media (max-width: 768px) {
  /* Chevron z cad-floating-toggle (lewa stronka + prawa) - bezwzgledne ukrycie */
  .cad-floating-toggle { display: none !important; }
  
  /* Topbar - solid bg, safe area na iPhone notch */
  .cad-floating-top.cad-topbar {
    padding-top: max(0.3rem, env(safe-area-inset-top, 0.3rem)) !important;
    padding-left: max(0.5rem, env(safe-area-inset-left, 0.5rem)) !important;
    padding-right: max(0.5rem, env(safe-area-inset-right, 0.5rem)) !important;
    height: auto !important;
    min-height: 44px !important;
  }
  
  /* Dock dolna - safe area na iPhone home indicator */
  .cad-floating-left {
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom, 0.4rem)) !important;
    min-height: 74px !important;
  }
  
  /* Canvas - enable 2-finger gestures (touch-action: none disables browser pan/zoom
     przy 1 palcu, ale 2-palce zostaja dla naszego handlera) */
  #poly-canvas {
    touch-action: none !important;
    overscroll-behavior: contain !important;
  }
  
  /* Polygon-wrap + cad-fullscreen - sticky boundaries  */
  section.view.polygon-editor.cad-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    overflow: hidden !important;
  }
  
  /* Mode-switch container - wymiary fixed by nie zwijaly modes pod sobą */
  .cad-floating-top .cad-mode-switch {
    flex-shrink: 0 !important;
    display: inline-flex !important;
  }
  .cad-floating-top .cad-mode {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  
  /* Snap-toggle - nie wraps */
  .cad-floating-top .cad-snap-toggle {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  
  /* Breadcrumb - na mobile schowany (jest button "Wyjdz") */
  .cad-floating-top .cad-breadcrumb { display: none !important; }
  
  /* Snap-text label "Snap" - na mobile schowany (sama ikona magnesu wystarczy) */
  .cad-floating-top .cad-snap-toggle .cad-snap-text { display: none !important; }
  
  /* Exit "Wyjdz" - tylko ikona (bez tekstu) */
  .cad-floating-top .cad-iconbtn-exit span { display: none !important; }
  .cad-floating-top .cad-iconbtn-exit {
    min-width: 32px !important;
    width: 32px !important;
    padding: 0 !important;
  }
  
  /* Room name input - skip label */
  .cad-floating-top .cad-room-name-label { display: none !important; }
  
  /* Mode buttons - wszystkie 3 zostaja widoczne */
  .cad-floating-top .cad-mode span { display: none !important; }
  .cad-floating-top .cad-mode {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .cad-floating-top .cad-mode svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* iPad portrait (768-900px) - traktuj jak mobile */
@media (min-width: 769px) and (max-width: 900px) and (orientation: portrait) {
  .cad-floating-top.cad-topbar { padding: 0.3rem 0.5rem !important; }
  .cad-floating-top .cad-iconbtn-icon span,
  .cad-floating-top .cad-vis-toggle span { display: none !important; }
}

/* End v=308 ===================================================== */


/* ============================================================
   v=309 — Mobile CAD: hide avatar + fix CTA width in horizontal dock
   ============================================================ */

@media (max-width: 768px) {
  /* Bezwzgledne ukrycie WSZYSTKICH header elementow w trybie CAD - tez user-menu/avatar */
  body:has(section.view.polygon-editor.cad-fullscreen) .app-header,
  body:has(section.view.polygon-editor.cad-fullscreen) .header-actions,
  body:has(section.view.polygon-editor.cad-fullscreen) #user-menu-btn,
  body:has(section.view.polygon-editor.cad-fullscreen) #user-menu-dropdown,
  body:has(section.view.polygon-editor.cad-fullscreen) .user-menu-wrap,
  body:has(section.view.polygon-editor.cad-fullscreen) #btn-onboarding {
    display: none !important;
    visibility: hidden !important;
  }

  /* DOCK: CTA "Zakoncz rysunek" - NIE moze byc 100% width (z v=302 column-sidebar reset).
     W horizontal docku width: auto, fix wysokosc i pad jak inne narzedzia. */
  .cad-floating-left .cad-sidebar .cad-cta,
  .cad-floating-left .cad-cta {
    flex-direction: column !important;
    width: auto !important;
    min-width: 64px !important;
    max-width: 90px !important;
    min-height: 56px !important;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.65rem !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  .cad-floating-left .cad-cta span {
    font-size: 0.65rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  .cad-floating-left .cad-cta svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
  }

  /* Dropdown trigger ("Szablony") - tez fix szerokosci by nie zlewala sie z sasiadem */
  .cad-floating-left .cad-dropdown {
    flex-shrink: 0 !important;
    width: auto !important;
  }
  .cad-floating-left .cad-dropdown-trigger {
    flex-direction: column !important;
    width: auto !important;
    min-width: 64px !important;
    max-width: 90px !important;
    min-height: 56px !important;
    padding: 0.4rem 0.5rem !important;
    flex-shrink: 0 !important;
  }
  .cad-floating-left .cad-dropdown-trigger span {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
  }
  .cad-floating-left .cad-dropdown-trigger .cad-chev {
    display: none !important; /* za malo miejsca w docku */
  }

  /* v=302 sidebar reset min-height 66px - na mobile za duzy, dock ma byc 70px max */
  .cad-floating-left .cad-tool,
  .cad-floating-left .cad-iconbtn {
    min-height: 56px !important;
    max-height: 62px !important;
    padding: 0.35rem 0.3rem !important;
    width: auto !important;
    min-width: 60px !important;
    max-width: 80px !important;
  }
  .cad-floating-left .cad-tool span,
  .cad-floating-left .cad-iconbtn span {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
  }

  /* Separator linia (cad-divider) w sidebar - na dock pionowy 1px wysokosc, 24px high */
  .cad-floating-left .cad-divider {
    width: 1px !important;
    height: 32px !important;
    margin: 0 0.25rem !important;
    background: rgba(201, 168, 118, 0.25) !important;
    flex-shrink: 0 !important;
    align-self: center !important;
  }
  .cad-floating-left .cad-spacer {
    width: 12px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    background: transparent !important;
  }
}

/* End v=309 ===================================================== */


/* ============================================================
   v=310 — CAD comprehensive polish (PC + mobile)
   ============================================================ */

/* === MOBILE === */
@media (max-width: 768px) {
  /* Floating "Zapisz kształt" - SCHOWANY (Wyjdz w topbar auto-zapisuje) */
  .cad-floating-save { display: none !important; }

  /* "Uwagi" panel - zwija sie do badge w prawym dolnym, nie zaslania docka */
  .cad-warnings-panel {
    right: 10px !important;
    bottom: 88px !important;
    max-width: 240px !important;
    max-height: 200px !important;
    overflow: auto !important;
    font-size: 0.78rem !important;
    padding: 0.5rem 0.65rem !important;
    border-radius: 10px !important;
  }
  .cad-warnings-panel.collapsed,
  .cad-warnings-panel[data-collapsed="true"] {
    max-width: 44px !important;
    max-height: 44px !important;
    overflow: hidden !important;
    padding: 0 !important;
  }
  /* Header naszego warnings - mniej dominujacy */
  .cad-warnings-header {
    font-size: 0.78rem !important;
    padding: 0.2rem 0 !important;
  }

  /* Topbar: jeszcze ciasniej - kompaktowe tryby (sama ikona 32px) */
  .cad-floating-top.cad-topbar {
    gap: 0.25rem !important;
    padding: 0.3rem !important;
  }
  .cad-floating-top > .cad-mode-switch {
    padding: 2px !important;
    border-radius: 9px !important;
  }
  .cad-floating-top .cad-mode {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
  .cad-floating-top .cad-snap-step {
    max-width: 50px !important;
  }
  /* Topbar nie powinien pozwolic horizontal scroll - schowane vis-toggles + snap-text
     juz w v=308. Zostaje tryby + room name + undo/redo + snap + exit. */
  .cad-floating-top .cad-iconbtn-icon {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
  .cad-floating-top .cad-iconbtn-exit {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    width: 30px !important;
    min-width: 30px !important;
  }
  .cad-floating-top .cad-divider { height: 18px !important; }

  /* Dock - czarne tlo solid (nie blur) by canvas nie przeswiecal podczas scroll */
  .cad-floating-left {
    background: linear-gradient(180deg, #1F1208 0%, #150C07 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Properties panel (mobile-props-modal) - czysteszy wyglad */
  #mobile-props-modal header {
    border-bottom: 1px solid rgba(232,200,150,0.18);
    padding: 0.8rem 1rem !important;
  }
}

/* === DESKTOP / PC === */
@media (min-width: 769px) {
  /* Properties panel - subtelny polish */
  .cad-props-floating {
    width: 270px !important;
  }
  .cad-props-section {
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)) !important;
    border: 1px solid rgba(232, 200, 150, 0.14) !important;
    border-radius: 10px !important;
    padding: 0.7rem 0.85rem !important;
    margin-bottom: 0.7rem !important;
  }
  .cad-props-section h4 {
    color: #E8C896 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.55rem !important;
    font-weight: 600 !important;
    opacity: 0.85;
  }
  .cad-props-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.4rem !important;
  }
  .cad-props-stats > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
    background: rgba(232, 200, 150, 0.06) !important;
    border-radius: 8px !important;
    padding: 0.45rem 0.5rem !important;
    text-align: center !important;
  }
  .cad-props-stats span {
    font-size: 0.66rem !important;
    color: rgba(232, 200, 150, 0.6) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .cad-props-stats strong {
    font-size: 0.95rem !important;
    color: #FFEFD8 !important;
    font-weight: 700 !important;
  }

  /* Topbar - centruj 3 grupy pionowo + lekkie tweaks */
  .cad-floating-top.cad-topbar {
    align-items: center !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(232, 200, 150, 0.08) !important;
  }
  
  /* Mode-switch - dopelnij efekt premium pill */
  .cad-floating-top > .cad-mode-switch {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  }

  /* Sidebar - usuń border bo redundant z floating-toggle */
  .cad-floating-left {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4) !important;
  }
}

/* === BOTH PLATFORMS === */
/* Tooltip-friendly buttons - hover state */
.cad-iconbtn:hover,
.cad-tool:hover {
  filter: brightness(1.08);
}

/* "Uwagi" panel - polish design */
.cad-warnings-panel {
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

/* End v=310 ===================================================== */


/* ============================================================
   v=311 — PRODUKCYJNY POLISH (PC + mobile)
   Design tokens + clean components: header, search, tabs, FAB,
   info-card, splash, row-actions, empty-state, hero typography.
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
  --fp-bg: #FAFAF7;
  --fp-fg: #1A1714;
  --fp-fg-muted: #6B5F52;
  --fp-line: rgba(31, 18, 8, 0.08);
  --fp-line-strong: rgba(31, 18, 8, 0.14);
  --fp-accent: #B8965A;
  --fp-accent-dark: #8B5A2B;
  --fp-radius-sm: 6px;
  --fp-radius-md: 10px;
  --fp-radius-lg: 14px;
  --fp-shadow-sm: 0 1px 2px rgba(31, 18, 8, 0.04);
  --fp-shadow-md: 0 4px 16px -4px rgba(31, 18, 8, 0.1);
  --fp-shadow-lg: 0 18px 40px -16px rgba(31, 18, 8, 0.14), 0 6px 14px -6px rgba(31, 18, 8, 0.08);
  --fp-transition: 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

/* === HEADER ICON BUTTON === */
.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--fp-line);
  color: var(--fp-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--fp-transition), border-color var(--fp-transition), transform var(--fp-transition);
}
.header-icon-btn svg { width: 18px; height: 18px; }
.header-icon-btn:hover {
  background: var(--fp-fg);
  border-color: var(--fp-fg);
  color: var(--fp-bg);
  transform: translateY(-1px);
}
.icon-btn-back svg { width: 16px; height: 16px; }
.icon-btn-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--fp-line);
  color: var(--fp-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-back:hover {
  background: var(--fp-fg);
  color: var(--fp-bg);
}

/* === SEARCH WITH ICON === */
.search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-wrap .search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--fp-fg-muted);
  pointer-events: none;
}
.search-wrap input[type="search"] {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.4rem !important;
  font-size: 0.94rem !important;
  background: white !important;
  border: 1px solid var(--fp-line) !important;
  border-radius: var(--fp-radius-md) !important;
  color: var(--fp-fg) !important;
  transition: border-color var(--fp-transition), box-shadow var(--fp-transition);
}
.search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--fp-accent) !important;
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.12) !important;
}

/* === TABS — SVG ICONS, clean look === */
nav.tabs .tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.6rem 1rem !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-bottom: 2px solid transparent !important;
  color: var(--fp-fg-muted) !important;
  font-weight: 500 !important;
  font-size: 0.92rem !important;
  cursor: pointer;
  border-radius: 0 !important;
  transition: color var(--fp-transition), border-color var(--fp-transition);
}
nav.tabs .tab svg { width: 16px; height: 16px; flex-shrink: 0; }
nav.tabs .tab:hover { color: var(--fp-fg) !important; }
nav.tabs .tab.active {
  color: var(--fp-fg) !important;
  border-bottom-color: var(--fp-fg) !important;
  font-weight: 600 !important;
}

/* === INFO CARD — z ikoną zamiast emoji === */
.info-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 0.9rem !important;
  background: linear-gradient(180deg, #FFF8EA, #FDF3DB) !important;
  border: 1px solid rgba(184, 150, 90, 0.25) !important;
  border-radius: var(--fp-radius-md) !important;
  padding: 0.95rem 1.15rem !important;
}
.info-card .info-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--fp-accent-dark);
  margin-top: 1px;
}
.info-card p {
  margin: 0 !important;
  color: var(--fp-fg) !important;
  line-height: 1.5;
}

/* === ROW BETWEEN (replace inline style) === */
.row-between {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.6rem;
}
.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.btn-file-input {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* === FAB — SVG instead of emoji, square icon size === */
.fab svg, .fab-secondary svg {
  width: 20px;
  height: 20px;
}
#fab-new svg { width: 22px; height: 22px; color: white; }
.fab-secondary svg { color: var(--fp-fg); }
.fab-secondary {
  background: white !important;
  border: 1px solid var(--fp-line) !important;
  color: var(--fp-fg) !important;
  transition: all var(--fp-transition);
}
.fab-secondary:hover {
  background: var(--fp-fg) !important;
  border-color: var(--fp-fg) !important;
}
.fab-secondary:hover svg { color: var(--fp-bg); }

/* === HERO HEADLINE — modern typography === */
.hero-projects h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 600 !important;
  font-size: clamp(1.8rem, 4vw, 2.5rem) !important;
  letter-spacing: -0.02em !important;
  color: var(--fp-fg) !important;
  margin: 0 0 0.4rem !important;
  line-height: 1.1;
}
.hero-projects p {
  color: var(--fp-fg-muted) !important;
  font-size: 1rem !important;
  margin: 0 !important;
}

/* === EMPTY STATE — SVG illustration === */
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.12), rgba(184, 150, 90, 0.04));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fp-accent-dark);
}
.empty-state .empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

/* === SPLASH — no tagline, cleaner === */
#splash .splash-tagline { display: none !important; }
#splash .splash-logo {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* === TAB CONTENT CARDS — sharper typography === */
.tab-content .card h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 600 !important;
  font-size: 1.15rem !important;
  letter-spacing: -0.01em !important;
  color: var(--fp-fg) !important;
  margin: 0 0 0.8rem !important;
}

/* === FOOTER MAIL — drop emoji === */
.fp-footer-mail { color: var(--fp-accent-dark) !important; }
.fp-footer-mail:hover { color: var(--fp-fg) !important; }

/* === MOBILE === */
@media (max-width: 768px) {
  nav.tabs {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs .tab {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.84rem !important;
    flex-shrink: 0 !important;
  }
  nav.tabs .tab svg { width: 14px; height: 14px; }
  
  /* Hero typography */
  .hero-projects h2 { font-size: 1.6rem !important; }
  .hero-projects p { font-size: 0.9rem !important; }
  
  /* Touch targets: 44x44 minimum dla buttons */
  .header-icon-btn,
  .icon-btn-back { width: 40px; height: 40px; }
  .fab-secondary { width: 44px !important; height: 44px !important; }
  .row-actions .btn-primary,
  .row-actions .btn-secondary {
    min-height: 40px;
    padding: 0.5rem 0.9rem !important;
  }
  
  /* Info card mniej */
  .info-card { padding: 0.75rem 0.9rem !important; }
  .info-card p { font-size: 0.88rem !important; }
}

/* End v=311 ===================================================== */


/* ============================================================
   v=312 — ROOM CARD produkcyjny redesign
   Segmented button toolbar, clean typography, no emoji, no inline styles.
   ============================================================ */

.room-card {
  background: white !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  border-radius: var(--fp-radius-lg, 14px) !important;
  padding: 1.1rem 1.15rem !important;
  margin-bottom: 1rem !important;
  box-shadow: var(--fp-shadow-sm, 0 1px 2px rgba(31,18,8,0.04)) !important;
  transition: box-shadow var(--fp-transition, 0.25s), border-color var(--fp-transition, 0.25s);
}
.room-card:hover {
  border-color: rgba(184, 150, 90, 0.35) !important;
  box-shadow: var(--fp-shadow-md, 0 4px 16px -4px rgba(31,18,8,0.1)) !important;
}

/* HEADER: title left, action toolbar right */
.room-card .room-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  padding-bottom: 0.85rem !important;
  border-bottom: 1px solid rgba(31, 18, 8, 0.06) !important;
  margin-bottom: 0.9rem !important;
}
.room-card .room-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.room-card .room-title strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--fp-fg, #1A1714);
  line-height: 1.2;
}
.room-card .room-meta {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.82rem;
  font-weight: 400;
}

/* ACTIONS: segmented button toolbar */
.room-card .room-actions {
  display: inline-flex !important;
  gap: 0 !important;
  background: rgba(31, 18, 8, 0.03) !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  border-radius: 10px !important;
  padding: 3px !important;
  flex-wrap: nowrap !important;
}
.room-card .room-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  padding: 0.5rem 0.75rem !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: var(--fp-fg, #1A1714) !important;
  font-size: 0.83rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  min-height: 34px;
}
.room-card .room-btn svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
}
.room-card .room-btn:hover {
  background: white !important;
  box-shadow: 0 1px 3px rgba(31, 18, 8, 0.08);
}
.room-card .room-btn-primary {
  color: var(--fp-fg, #1A1714) !important;
  font-weight: 600 !important;
}
.room-card .room-btn-primary:hover {
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
}
.room-card .room-btn-accent {
  color: var(--fp-accent-dark, #8B5A2B) !important;
}
.room-card .room-btn-accent:hover {
  background: linear-gradient(135deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B)) !important;
  color: white !important;
}
.room-card .room-btn-icon {
  padding: 0.5rem !important;
  min-width: 34px;
  color: var(--fp-fg-muted, #6B5F52) !important;
}
.room-card .room-btn-icon:hover {
  background: white !important;
  color: var(--fp-fg, #1A1714) !important;
}
.room-card .room-btn-danger:hover {
  background: #E84A4A !important;
  color: white !important;
}

/* PREVIEWS grid */
.room-card .room-previews {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 0.9rem 0 !important;
}
.room-card .room-previews-two {
  grid-template-columns: 1fr 1fr !important;
}
.room-card .room-thumb {
  position: relative;
  border-radius: var(--fp-radius-md, 10px);
  overflow: hidden;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  cursor: zoom-in;
  aspect-ratio: 16 / 9;
  background: #F5F1EA;
}
.room-card .room-thumb-ai { border-color: rgba(184, 150, 90, 0.5); }
.room-card .room-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.room-card .room-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 1.2rem 0.7rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.room-card .room-thumb-caption svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* AI CAROUSEL (v=333) — galeria renderów w podglądzie pokoju */
.room-card .room-ai-carousel {
  cursor: default;
}
.room-card .ai-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.room-card .ai-carousel-slide {
  flex: 0 0 100%;
  position: relative;
  height: 100%;
}
.room-card .ai-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.room-card .ai-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 3;
  transition: background 0.15s, transform 0.15s;
  backdrop-filter: blur(4px);
}
.room-card .ai-carousel-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.08);
}
.room-card .ai-carousel-nav svg { width: 16px; height: 16px; }
.room-card .ai-carousel-prev { left: 8px; }
.room-card .ai-carousel-next { right: 8px; }
.room-card .ai-carousel-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.room-card .ai-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.room-card .ai-carousel-dot.active {
  background: white;
  transform: scale(1.25);
}
.room-card .ai-carousel-dot:hover { background: rgba(255, 255, 255, 0.8); }
.room-card .ai-carousel-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(178, 34, 34, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 3;
  transition: background 0.15s, transform 0.15s;
  opacity: 0;
  backdrop-filter: blur(4px);
}
.room-card .ai-carousel-slide:hover .ai-carousel-delete,
.room-card .room-ai-carousel:hover .ai-carousel-delete {
  opacity: 1;
}
.room-card .ai-carousel-delete:hover {
  background: #B22222;
  transform: scale(1.1);
}
.room-card .ai-carousel-delete svg { width: 14px; height: 14px; }
/* Touch — zawsze widoczny na urządzeniach dotykowych */
@media (hover: none) {
  .room-card .ai-carousel-delete { opacity: 0.9; }
}
/* Caption nad kropkami — nie zasłania */
.room-card .ai-carousel-slide .room-thumb-caption {
  padding-bottom: 1.4rem;
}

/* DYLATACJA strip - clean, no emoji */
.room-card .room-strip {
  background: rgba(184, 150, 90, 0.06) !important;
  border: 1px solid rgba(184, 150, 90, 0.16);
  border-radius: var(--fp-radius-md, 10px);
  padding: 0.55rem 0.85rem !important;
  margin: 0.9rem 0 !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}
.room-card .room-strip-field {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--fp-fg, #1A1714);
  font-weight: 500;
}
.room-card .room-strip-field > span:first-child {
  color: var(--fp-fg-muted, #6B5F52);
}
.room-card .room-strip-input {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: white;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}
.room-card .room-strip-input input {
  width: 44px;
  border: 0;
  outline: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fp-fg, #1A1714);
  background: transparent;
  padding: 0;
  text-align: right;
}
.room-card .room-strip-input em {
  font-style: normal;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.8rem;
  font-weight: 500;
}
.room-card .room-strip-note {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.75rem;
  font-style: italic;
}

/* HINTS + notes */
.room-card .room-hint {
  margin: 0.4rem 0 0 !important;
  font-size: 0.75rem !important;
  color: var(--fp-fg-muted, #6B5F52) !important;
  opacity: 0.85;
}
.room-card .room-openings-note {
  margin: 0.6rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--fp-fg-muted, #6B5F52);
}

/* PATTERN chips + dir chips + wood - subtelniejsze */
.room-card .pattern-chips,
.room-card .dir-chips,
.room-card .wood-skin-grid {
  margin-top: 0.55rem;
}
.room-card .chip {
  padding: 0.35rem 0.75rem !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.1)) !important;
  background: white !important;
  color: var(--fp-fg, #1A1714) !important;
  transition: all 0.15s ease;
  cursor: pointer;
}
.room-card .chip:hover {
  border-color: var(--fp-accent, #B8965A) !important;
}
.room-card .chip.active {
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
  border-color: var(--fp-fg, #1A1714) !important;
}

/* MOBILE — dock actions below title, icon-only variants */
@media (max-width: 768px) {
  .room-card { padding: 0.9rem !important; }
  .room-card .room-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }
  .room-card .room-actions {
    width: 100%;
    justify-content: space-between !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .room-card .room-actions::-webkit-scrollbar { display: none; }
  .room-card .room-btn {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.78rem !important;
    flex: 1 1 auto;
    min-height: 40px;
  }
  .room-card .room-btn span { display: inline; }
  .room-card .room-btn-icon { flex: 0 0 auto; min-width: 40px; }
  .room-card .room-previews-two {
    grid-template-columns: 1fr !important;
  }
  .room-card .room-title strong { font-size: 1.05rem; }
}

/* End v=312 ===================================================== */


/* ============================================================
   v=313 — bottom-actions produkcyjny redesign (grupy + dividers)
   Struktura HTML: .bottom-actions > .ba-group + .ba-divider
   ============================================================ */

.bottom-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.6rem !important;
  padding: 1rem 1.15rem !important;
  background: white !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  border-radius: var(--fp-radius-lg, 14px) !important;
  box-shadow: var(--fp-shadow-sm, 0 1px 2px rgba(31,18,8,0.04)) !important;
  margin-top: 1rem;
}

.bottom-actions .ba-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  flex-wrap: wrap !important;
}

.bottom-actions .ba-divider {
  width: 1px;
  height: 24px;
  background: var(--fp-line-strong, rgba(31,18,8,0.14));
  flex-shrink: 0;
  align-self: center;
  margin: 0 0.15rem;
}

.bottom-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  padding: 0.55rem 0.9rem !important;
  min-height: 38px !important;
  max-height: 38px !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  background: white !important;
  color: var(--fp-fg, #1A1714) !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  white-space: nowrap !important;
  line-height: 1;
  box-shadow: none !important;
}
.bottom-actions button > svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
}
.bottom-actions button:hover {
  border-color: var(--fp-fg, #1A1714) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(31, 18, 8, 0.08) !important;
}

/* PRIMARY = solid czarny (Zapisz) */
.bottom-actions .btn-primary {
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
  border-color: var(--fp-fg, #1A1714) !important;
  font-weight: 600 !important;
}
.bottom-actions .btn-primary * { color: white !important; }
.bottom-actions .btn-primary:hover {
  background: #000 !important;
  border-color: #000 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(31, 18, 8, 0.2) !important;
}

/* ACCENT = gold (Wyślij klientowi) */
.bottom-actions .btn-primary.btn-accent {
  background: linear-gradient(135deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B)) !important;
  border-color: var(--fp-accent-dark, #8B5A2B) !important;
  color: white !important;
}
.bottom-actions .btn-primary.btn-accent:hover {
  background: linear-gradient(135deg, #C6A26D, #9A6738) !important;
  box-shadow: 0 4px 12px rgba(184, 150, 90, 0.35) !important;
}

/* SECONDARY (default) - biały outline, hover invert */
.bottom-actions .btn-secondary {
  background: white !important;
  color: var(--fp-fg, #1A1714) !important;
  border-color: var(--fp-line, rgba(31,18,8,0.08)) !important;
  font-weight: 500 !important;
}
.bottom-actions .btn-secondary:hover {
  background: rgba(31, 18, 8, 0.04) !important;
  border-color: var(--fp-fg-muted, #6B5F52) !important;
  color: var(--fp-fg, #1A1714) !important;
}

/* Export group: label mniejszy, subtle divider między nimi */
.bottom-actions .ba-group-export button {
  font-size: 0.82rem !important;
  padding: 0.5rem 0.75rem !important;
}

/* Mobile: 2-row grid + full-width primary */
@media (max-width: 768px) {
  .bottom-actions {
    padding: 0.75rem !important;
    gap: 0.4rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .bottom-actions .ba-group {
    width: 100%;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
  .bottom-actions .ba-divider {
    width: 100%;
    height: 1px;
    margin: 0.25rem 0;
  }
  .bottom-actions button {
    flex: 1 1 auto;
    min-width: 44%;
    font-size: 0.82rem !important;
    padding: 0.55rem 0.65rem !important;
  }
  .bottom-actions .ba-group-primary button {
    flex: 1 1 30%;
  }
}

/* End v=313 ===================================================== */


/* ============================================================
   v=314 — bottom-actions z DROPDOWNS (Eksport, Więcej)
   Widoczne: [Zapisz] [Wyślij klientowi] [Eksport ▾] [⋯]
   ============================================================ */

.bottom-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.85rem 1rem !important;
  background: white !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  border-radius: var(--fp-radius-lg, 14px) !important;
  box-shadow: var(--fp-shadow-sm, 0 1px 2px rgba(31,18,8,0.04)) !important;
  margin-top: 1rem;
}

/* wspólny styl przyciskow paska */
.bottom-actions .ba-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.55rem 0.95rem !important;
  min-height: 40px !important;
  max-height: 40px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  border-radius: 9px !important;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08)) !important;
  background: white !important;
  color: var(--fp-fg, #1A1714) !important;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
  white-space: nowrap !important;
  line-height: 1;
  box-shadow: none !important;
}
.bottom-actions .ba-btn > svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}
.bottom-actions .ba-btn:hover {
  border-color: var(--fp-fg, #1A1714) !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(31, 18, 8, 0.1) !important;
}
.bottom-actions .ba-btn-icon {
  padding: 0.55rem !important;
  min-width: 40px !important;
  width: 40px !important;
}

/* PRIMARY = czarny (Zapisz) */
.bottom-actions .btn-primary.ba-btn {
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
  border-color: var(--fp-fg, #1A1714) !important;
}
.bottom-actions .btn-primary.ba-btn:hover {
  background: #000 !important;
  border-color: #000 !important;
  box-shadow: 0 5px 14px rgba(31, 18, 8, 0.25) !important;
}

/* ACCENT = gold gradient (Wyślij klientowi) */
.bottom-actions .btn-primary.btn-accent.ba-btn {
  background: linear-gradient(135deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B)) !important;
  border-color: transparent !important;
  color: white !important;
}
.bottom-actions .btn-primary.btn-accent.ba-btn:hover {
  background: linear-gradient(135deg, #C6A26D, #9A6738) !important;
  box-shadow: 0 5px 14px rgba(184, 150, 90, 0.4) !important;
}

/* DROPDOWN wrapper */
.bottom-actions .ba-dropdown {
  position: relative;
  display: inline-block;
}
.bottom-actions .ba-dd-chev {
  width: 12px !important;
  height: 12px !important;
  opacity: 0.7;
  transition: transform 0.2s ease;
  margin-left: 0.15rem;
}
.bottom-actions .ba-dropdown.open .ba-dd-chev {
  transform: rotate(180deg);
}

/* MENU panel */
.bottom-actions .ba-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: white;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 12px;
  box-shadow: 0 20px 40px -12px rgba(31, 18, 8, 0.22), 0 6px 16px -4px rgba(31, 18, 8, 0.08);
  padding: 0.4rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.bottom-actions .ba-dd-menu-right { left: auto; right: 0; }
.bottom-actions .ba-dropdown.open .ba-dd-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* MENU items */
.bottom-actions .ba-dd-item {
  display: grid !important;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.7rem !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: var(--fp-fg, #1A1714) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  text-align: left !important;
  cursor: pointer;
  transition: background 0.12s;
  min-height: auto !important;
  max-height: none !important;
  white-space: normal !important;
  box-shadow: none !important;
}
.bottom-actions .ba-dd-item > svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--fp-fg-muted, #6B5F52) !important;
}
.bottom-actions .ba-dd-item:hover {
  background: rgba(31, 18, 8, 0.05) !important;
  transform: none !important;
  box-shadow: none !important;
}
.bottom-actions .ba-dd-item:hover > svg {
  color: var(--fp-fg, #1A1714) !important;
}
.bottom-actions .ba-dd-label {
  color: var(--fp-fg, #1A1714);
  font-weight: 600;
  font-size: 0.88rem;
}
.bottom-actions .ba-dd-hint {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.75rem;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}
.bottom-actions .ba-dd-sep {
  height: 1px;
  background: var(--fp-line, rgba(31,18,8,0.08));
  margin: 0.35rem 0.15rem;
}

/* Ostatni element (⋯ Więcej) - dosuń do prawej */
.bottom-actions .ba-dropdown[data-dd="more"] {
  margin-left: auto;
}

/* MOBILE - dropdown przechodzi na bottom-sheet, buttons mniejsze */
@media (max-width: 768px) {
  .bottom-actions {
    padding: 0.65rem !important;
    gap: 0.35rem !important;
    flex-wrap: wrap !important;
  }
  .bottom-actions .ba-btn {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.82rem !important;
    min-height: 40px !important;
    max-height: 40px !important;
  }
  .bottom-actions .ba-btn > span { display: inline; }
  .bottom-actions .btn-primary.ba-btn,
  .bottom-actions .btn-primary.btn-accent.ba-btn {
    flex: 1 1 auto;
  }
  .bottom-actions .ba-dropdown[data-dd="export"] { flex: 1 1 auto; }
  .bottom-actions .ba-dropdown[data-dd="export"] .ba-btn { width: 100%; }
  .bottom-actions .ba-dropdown[data-dd="more"] { margin-left: 0; }
  .bottom-actions .ba-dd-menu {
    position: fixed;
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: auto !important;
    bottom: 0.75rem !important;
    min-width: 0;
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
  }
  .bottom-actions .ba-dd-menu-right { right: 0.75rem !important; left: 0.75rem !important; }
  .bottom-actions .ba-dd-item {
    padding: 0.75rem 0.7rem !important;
    grid-template-columns: 22px 1fr;
  }
  .bottom-actions .ba-dd-hint {
    grid-column: 2;
    text-align: left;
    display: block;
    margin-top: 0.15rem;
  }
  .bottom-actions .ba-dd-label {
    grid-column: 2;
    display: block;
  }
}

/* End v=314 ===================================================== */


/* ============================================================
   v=315 — CAD comprehensive polish (PC + mobile)
   Cel: wszystkie floating elements CAD w spójnym design system
   ============================================================ */

/* === FLOATING SAVE - refined dark pill (nie brązowy gradient!) === */
.cad-floating-save {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 110 !important;
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
  border: 1px solid var(--fp-fg, #1A1714) !important;
  border-radius: 30px !important;
  padding: 0.7rem 1.4rem !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 12px 32px -8px rgba(31, 18, 8, 0.5), 0 4px 12px -4px rgba(31, 18, 8, 0.3) !important;
  transition: transform 0.22s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.22s, background 0.22s, border-color 0.22s;
  position: relative;
  overflow: hidden;
}
.cad-floating-save::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 33px;
  border: 1px solid rgba(184, 150, 90, 0.5);
  opacity: 0;
  transition: opacity 0.3s, inset 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}
.cad-floating-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -8px rgba(31, 18, 8, 0.6), 0 8px 16px -4px rgba(31, 18, 8, 0.4) !important;
}
.cad-floating-save:hover::before {
  opacity: 1;
  inset: -6px;
}
.cad-floating-save svg { width: 17px !important; height: 17px !important; }

/* === ZOOM PILL — interactive: − / label / + === */
.cad-zoom.cad-zoom-pill {
  display: inline-flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 3px !important;
  background: rgba(31, 18, 8, 0.88) !important;
  border: 1px solid rgba(232, 200, 150, 0.2) !important;
  border-radius: 20px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: rgba(232, 200, 150, 0.95) !important;
  font-size: 0 !important;
  overflow: hidden;
}
.cad-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 0.5rem;
  background: transparent;
  border: 0;
  color: rgba(232, 200, 150, 0.85);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 14px;
  transition: background 0.15s, color 0.15s;
  font-variant-numeric: tabular-nums;
}
.cad-zoom-btn:hover {
  background: rgba(232, 200, 150, 0.18);
  color: #FFEFD8;
}
.cad-zoom-btn svg { width: 14px; height: 14px; }
.cad-zoom-label {
  min-width: 46px !important;
  border-left: 1px solid rgba(232, 200, 150, 0.15);
  border-right: 1px solid rgba(232, 200, 150, 0.15);
  border-radius: 0 !important;
}

/* === COORDS HUD — clean pill === */
.cad-hud.cad-coords {
  padding: 0.35rem 0.8rem !important;
  background: rgba(31, 18, 8, 0.88) !important;
  border: 1px solid rgba(232, 200, 150, 0.2) !important;
  border-radius: 16px !important;
  color: rgba(232, 200, 150, 0.9) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  font-variant-numeric: tabular-nums !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cad-hud.cad-coords::before { content: none !important; }

/* === WARNINGS PANEL - premium look === */
.cad-warnings-panel {
  background: white !important;
  border: 1px solid var(--fp-line, rgba(31, 18, 8, 0.08)) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgba(31, 18, 8, 0.2), 0 4px 12px -4px rgba(31, 18, 8, 0.1) !important;
  color: var(--fp-fg, #1A1714) !important;
}
.cad-warnings-panel.has-warnings {
  border-color: rgba(217, 117, 87, 0.35) !important;
  box-shadow: 0 12px 32px -8px rgba(217, 117, 87, 0.28), 0 4px 12px -4px rgba(217, 117, 87, 0.14) !important;
}
.cad-warnings-head {
  background: rgba(31, 18, 8, 0.04) !important;
  border-bottom: 1px solid var(--fp-line, rgba(31, 18, 8, 0.08));
  padding: 0.6rem 0.85rem !important;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fp-fg, #1A1714) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cad-warnings-panel.has-warnings .cad-warnings-head {
  background: linear-gradient(180deg, rgba(217, 117, 87, 0.1), rgba(217, 117, 87, 0.05)) !important;
  color: #a04a2f !important;
}
.cad-warnings-toggle {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: rgba(31, 18, 8, 0.08) !important;
  color: var(--fp-fg, #1A1714) !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cad-warnings-toggle:hover { background: rgba(31, 18, 8, 0.14) !important; }
.cad-warnings-body {
  padding: 0.7rem 0.85rem !important;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 260px;
  overflow-y: auto;
}

/* === PROGRESS OVERLAY - clean, no emoji === */
.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 8, 4, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-box {
  background: white;
  border-radius: 16px;
  padding: 2rem 2.4rem;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 24px 60px -16px rgba(31, 18, 8, 0.5), 0 8px 20px -6px rgba(31, 18, 8, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.progress-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(184, 150, 90, 0.18);
  border-top-color: var(--fp-accent-dark, #8B5A2B);
  border-radius: 50%;
  animation: fpSpin 0.9s linear infinite;
}
@keyframes fpSpin { to { transform: rotate(360deg); } }
.progress-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fp-fg, #1A1714);
  letter-spacing: -0.01em;
}
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(31, 18, 8, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 0.82rem;
  color: var(--fp-fg-muted, #6B5F52);
  font-weight: 500;
}

/* === MOBILE polish === */
@media (max-width: 768px) {
  /* Save floating - mniejszy, ale nadal viable na mobile pojedynczo */
  .cad-floating-save {
    bottom: 88px !important; /* nad dockiem */
    right: 12px !important;
    padding: 0.6rem 1.2rem !important;
    font-size: 0.85rem !important;
  }
  
  /* Zoom pill - kompakt */
  .cad-zoom.cad-zoom-pill {
    padding: 2px !important;
  }
  .cad-zoom-btn {
    min-width: 28px;
    height: 24px;
    font-size: 0.72rem;
  }
  .cad-zoom-label { min-width: 40px !important; }
  
  /* Coords HUD ukryty na mobile (dublowanie ze statusbar) - już było */
  
  /* Progress overlay - węższy */
  .progress-box {
    min-width: 280px;
    padding: 1.5rem 1.8rem;
  }
  
  /* Warnings panel - mniejszy header/body */
  .cad-warnings-head { padding: 0.5rem 0.75rem !important; font-size: 0.8rem; }
  .cad-warnings-body { padding: 0.6rem 0.75rem !important; font-size: 0.8rem !important; }
}

/* === DESKTOP polish === */
@media (min-width: 769px) {
  /* Sidebar - subtelniejszy background */
  .cad-sidebar {
    background: linear-gradient(180deg, rgba(31, 18, 8, 0.94) 0%, rgba(20, 9, 10, 0.94) 100%) !important;
    border-color: rgba(232, 200, 150, 0.18) !important;
  }
  
  /* Properties (right panel) - card design refinement */
  .cad-props-floating .cad-props-section {
    background: rgba(31, 18, 8, 0.85) !important;
    border-color: rgba(232, 200, 150, 0.14) !important;
    color: #E8C896;
  }
  .cad-props-floating .cad-props-section h4 {
    color: rgba(232, 200, 150, 0.7) !important;
    font-size: 0.72rem !important;
  }
  .cad-props-floating .cad-props-stats > div {
    background: rgba(232, 200, 150, 0.08) !important;
    border: 1px solid rgba(232, 200, 150, 0.12);
  }
  .cad-props-floating .cad-props-stats span {
    color: rgba(232, 200, 150, 0.55) !important;
  }
  .cad-props-floating .cad-props-stats strong {
    color: #FFEFD8 !important;
  }
}

/* End v=315 ===================================================== */


/* ============================================================
   v=316 — server-side features UI polish
   FTS server highlights + server-PDF hint
   ============================================================ */

/* Server FTS hits - subtle gold left border */
.project-card.fts-hit {
  border-left: 3px solid var(--fp-accent, #B8965A) !important;
  animation: ftsHit 0.4s ease;
}
.project-card.fts-miss {
  opacity: 0.4;
}
@keyframes ftsHit {
  from { transform: translateX(-4px); opacity: 0.5; }
  to { transform: translateX(0); opacity: 1; }
}

/* highlight <mark> tags w wynikach FTS */
mark {
  background: rgba(184, 150, 90, 0.28) !important;
  color: inherit !important;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* Toast dopracowany */
.toast {
  background: var(--fp-fg, #1A1714) !important;
  color: white !important;
  padding: 0.75rem 1.2rem !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  box-shadow: 0 12px 28px -8px rgba(31, 18, 8, 0.45) !important;
}

/* End v=316 ==================================================== */


/* ============================================================
   v=317 TURBO PACK — presentation mode, versions timeline, analytics,
   shortcuts overlay, bulk zip. Wszystko premium.
   ============================================================ */

/* === TURBO MODAL BASE === */
.turbo-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: turboFadeIn 0.2s ease;
}
.turbo-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 4, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.turbo-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 640px;
  width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -16px rgba(31, 18, 8, 0.5);
  animation: turboSlideUp 0.28s cubic-bezier(0.19, 1, 0.22, 1);
}
.turbo-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--fp-line, rgba(31,18,8,0.08));
}
.turbo-modal h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--fp-fg, #1A1714);
}
.turbo-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(31, 18, 8, 0.06);
  color: var(--fp-fg, #1A1714);
  font-size: 1.4rem;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}
.turbo-close:hover { background: rgba(31, 18, 8, 0.14); }
.turbo-sub {
  padding: 0.85rem 1.4rem 0;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.9rem;
  margin: 0;
}
@keyframes turboFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes turboSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* === VERSION HISTORY TIMELINE === */
.turbo-version-modal { max-width: 560px; }
.turbo-timeline {
  padding: 1rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}
.turbo-timeline::before {
  content: "";
  position: absolute;
  top: 1.3rem;
  bottom: 1.7rem;
  left: 1.75rem;
  width: 2px;
  background: var(--fp-line, rgba(31,18,8,0.08));
}
.turbo-version-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.7rem 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
}
.turbo-version-item:hover {
  background: rgba(31, 18, 8, 0.04);
  border-color: var(--fp-line, rgba(31,18,8,0.08));
}
.turbo-version-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--fp-accent, #B8965A);
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}
.turbo-version-item:hover .turbo-version-dot {
  background: var(--fp-accent, #B8965A);
}
.turbo-version-body { flex: 1; min-width: 0; }
.turbo-version-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.turbo-version-head strong {
  color: var(--fp-fg, #1A1714);
  font-size: 0.94rem;
}
.turbo-version-ago {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.78rem;
  white-space: nowrap;
}
.turbo-version-meta {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

/* === CLIENT PRESENTATION MODE === */
.turbo-present {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0a0705;
  display: flex;
  flex-direction: column;
  color: white;
  animation: turboFadeIn 0.25s ease;
}
.turbo-present-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.turbo-present-brand strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: block;
}
.turbo-present-brand span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}
.turbo-present-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.turbo-present-counter {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}
.turbo-present-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.15s;
}
.turbo-present-close:hover { background: rgba(255, 255, 255, 0.22); }
.turbo-present-slide {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 4rem;
  overflow: hidden;
}
.turbo-present-canvas {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  height: 100%;
}
.turbo-slide-render {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.6);
}
.turbo-slide-placeholder {
  width: 100%;
  height: 70vh;
  background: linear-gradient(135deg, #2A1810, #1A0F08);
  border: 2px dashed rgba(184, 150, 90, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(184, 150, 90, 0.7);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 500;
}
.turbo-slide-info { display: flex; flex-direction: column; gap: 2rem; }
.turbo-slide-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(184, 150, 90, 0.2);
  color: #E8C896;
  font-size: 0.72rem;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.turbo-slide-name h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  margin: 0;
  color: white;
}
.turbo-slide-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.turbo-slide-stats > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.turbo-slide-stats label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.turbo-slide-stats strong {
  color: white;
  font-size: 1.4rem;
  font-weight: 500;
}
.turbo-present-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.turbo-present-btn {
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s;
}
.turbo-present-btn:hover { background: rgba(255, 255, 255, 0.16); }
.turbo-present-dots {
  display: flex;
  gap: 0.4rem;
}
.turbo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.turbo-dot:hover { background: rgba(255, 255, 255, 0.4); transform: scale(1.2); }
.turbo-dot.active { background: var(--fp-accent, #B8965A); transform: scale(1.3); }

@media (max-width: 900px) {
  .turbo-present-canvas { grid-template-columns: 1fr; gap: 1.5rem; }
  .turbo-slide-render, .turbo-slide-placeholder { max-height: 40vh; }
  .turbo-present-slide { padding: 1rem; }
  .turbo-slide-name h1 { font-size: 1.7rem; }
  .turbo-present-header, .turbo-present-footer { padding: 0.8rem 1rem; }
  .turbo-slide-stats { gap: 0.5rem; }
  .turbo-slide-stats > div { padding: 0.6rem 0.75rem; }
  .turbo-slide-stats strong { font-size: 1.1rem; }
}

/* === COST ANALYTICS DASHBOARD === */
.turbo-analytics {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.turbo-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.turbo-kpi {
  padding: 0.85rem 1rem;
  background: var(--fp-bg, #FAFAF7);
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.turbo-kpi label {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.turbo-kpi strong {
  color: var(--fp-fg, #1A1714);
  font-size: 1.35rem;
  font-weight: 600;
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.turbo-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.turbo-chart-card {
  padding: 1rem 1.15rem;
  background: white;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 12px;
}
.turbo-chart-card h4 {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--fp-fg, #1A1714);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.turbo-chart-canvas {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.turbo-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}
.turbo-bar-label {
  color: var(--fp-fg, #1A1714);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.turbo-bar-track {
  height: 8px;
  background: rgba(31, 18, 8, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.turbo-bar-fill {
  height: 100%;
  background: var(--fp-fg, #1A1714);
  border-radius: 4px;
  animation: turboBarGrow 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  transform-origin: left;
}
.turbo-bar-fill-accent {
  background: linear-gradient(90deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B));
}
.turbo-bar-value {
  color: var(--fp-fg, #1A1714);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@keyframes turboBarGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 720px) {
  .turbo-charts { grid-template-columns: 1fr; }
  .turbo-bar-row { grid-template-columns: 80px 1fr 60px; font-size: 0.76rem; }
}

/* === KEYBOARD SHORTCUTS OVERLAY === */
.turbo-shortcuts {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: turboFadeIn 0.2s ease;
}
.turbo-shortcuts .turbo-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 4, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.turbo-shortcuts-panel {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 560px;
  width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -16px rgba(31, 18, 8, 0.5);
  animation: turboSlideUp 0.28s cubic-bezier(0.19, 1, 0.22, 1);
}
.turbo-shortcuts-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--fp-line, rgba(31,18,8,0.08));
}
.turbo-shortcuts-panel h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.turbo-shortcuts-list {
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.turbo-shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.3rem;
  border-bottom: 1px solid var(--fp-line, rgba(31,18,8,0.06));
}
.turbo-shortcut-row:last-child { border-bottom: 0; }
.turbo-shortcut-label {
  color: var(--fp-fg, #1A1714);
  font-size: 0.92rem;
}
.turbo-shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.turbo-shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 0.5rem;
  background: linear-gradient(180deg, #FFFFFF, #F5F1EA);
  border: 1px solid var(--fp-line-strong, rgba(31,18,8,0.14));
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--fp-fg, #1A1714);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  font-weight: 600;
}
.turbo-shortcut-keys span {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.75rem;
  margin: 0 0.15rem;
}
.turbo-shortcuts-panel footer {
  padding: 0.85rem 1.4rem;
  border-top: 1px solid var(--fp-line, rgba(31,18,8,0.06));
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.8rem;
  text-align: center;
}
.turbo-shortcuts-panel footer kbd {
  padding: 0 0.4rem;
  background: rgba(31, 18, 8, 0.06);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

/* End v=317 TURBO ================================================ */


/* ============================================================
   v=318 — Rich presentation mode (cover + room + summary slides)
   ============================================================ */

/* fade-in animacja przy zmianie slajdu */
.turbo-slide-anim { animation: turboSlideIn 0.35s cubic-bezier(0.19, 1, 0.22, 1); }
@keyframes turboSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* === COVER SLIDE === */
.turbo-cover {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2rem;
  color: white;
}
.turbo-cover-brand {
  color: rgba(232, 200, 150, 0.7);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 500;
}
.turbo-cover-title h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  color: white;
}
.turbo-cover-title p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.15rem;
  margin: 0;
}
.turbo-cover-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.4fr;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.turbo-cover-kpis > div {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.turbo-cover-kpis label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.turbo-cover-kpis strong {
  color: white;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.turbo-cover-gross {
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.25), rgba(139, 90, 43, 0.15)) !important;
  border-color: rgba(232, 200, 150, 0.4) !important;
}
.turbo-cover-gross strong { color: #F5D89E !important; font-size: 2.1rem !important; }
.turbo-cover-footer {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.2rem;
}

/* === ROOM SLIDE === */
.turbo-room-slide {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}
.turbo-room-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.turbo-room-visual .turbo-slide-render {
  width: 100%;
  height: auto;
  max-height: 65vh;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
}
.turbo-visual-mini {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 180px;
  border: 2px solid rgba(232, 200, 150, 0.4);
  border-radius: 10px;
  overflow: hidden;
  background: #1F1208;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.turbo-visual-mini svg { display: block; width: 100%; }

/* Info side */
.turbo-room-info { display: flex; flex-direction: column; gap: 1.6rem; }
.turbo-slide-dims {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.turbo-slide-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.turbo-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  position: relative;
}
.turbo-block label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.turbo-block strong {
  color: white;
  font-size: 1.15rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.turbo-block small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}
.turbo-block-panel {
  grid-column: 1 / -1;
}
.turbo-block-cost {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.2), rgba(139, 90, 43, 0.1));
  border-color: rgba(232, 200, 150, 0.3);
}
.turbo-block-cost strong {
  color: #F5D89E;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 1.9rem;
}
.turbo-swatch {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(232, 200, 150, 0.5);
  background-image: linear-gradient(135deg, #D4B896, #9F7F4F);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.turbo-swatch[data-skin*="dab"] { background-image: linear-gradient(135deg, #C9A876, #8B5A2B); }
.turbo-swatch[data-skin*="orzech"] { background-image: linear-gradient(135deg, #6B4423, #3E2A18); }
.turbo-swatch[data-skin*="jesion"] { background-image: linear-gradient(135deg, #E5D3AC, #B8A379); }
.turbo-swatch[data-skin*="klon"] { background-image: linear-gradient(135deg, #F0D7A5, #D0AA6F); }
.turbo-swatch[data-skin*="brzoza"] { background-image: linear-gradient(135deg, #F5E5C0, #C9B287); }

/* === SUMMARY SLIDE === */
.turbo-summary {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.turbo-summary-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0;
  color: white;
}
.turbo-summary-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}
.turbo-summary-table {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
}
.turbo-summary-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.turbo-summary-row:last-child { border-bottom: 0; }
.turbo-summary-head {
  background: rgba(0, 0, 0, 0.25);
  color: rgba(232, 200, 150, 0.7);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.turbo-summary-row span:first-child { color: white; font-weight: 500; }
.turbo-summary-row span:last-child { text-align: right; color: white; font-weight: 500; }
.turbo-summary-totals {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.turbo-totals-row {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.turbo-totals-row span:last-child { color: white; font-weight: 500; }
.turbo-totals-grand {
  border-top: 1px solid rgba(232, 200, 150, 0.3);
  padding-top: 0.9rem;
  margin-top: 0.4rem;
}
.turbo-totals-grand span {
  color: #F5D89E !important;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem !important;
}
.turbo-summary-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* === MOBILE === */
@media (max-width: 900px) {
  .turbo-cover, .turbo-summary { padding: 1rem; gap: 1.5rem; }
  .turbo-cover-kpis { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .turbo-cover-kpis > div { padding: 0.75rem 0.85rem; }
  .turbo-cover-kpis strong { font-size: 1.35rem; }
  .turbo-cover-gross strong { font-size: 1.7rem !important; }
  
  .turbo-room-slide { grid-template-columns: 1fr; gap: 1.2rem; padding: 1rem; }
  .turbo-room-visual .turbo-slide-render { max-height: 35vh; }
  .turbo-visual-mini { width: 110px; }
  .turbo-slide-blocks { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .turbo-block { padding: 0.6rem 0.75rem; }
  .turbo-block strong { font-size: 1rem; }
  .turbo-block-cost strong { font-size: 1.4rem; }
  .turbo-swatch { width: 32px; height: 32px; top: 8px; right: 8px; }
  
  .turbo-summary-content { grid-template-columns: 1fr; }
  .turbo-summary-row { grid-template-columns: 1.5fr 1fr 1fr; font-size: 0.82rem; padding: 0.6rem 0.75rem; }
  .turbo-summary-row span:nth-child(3) { display: none; }
  .turbo-totals-grand span { font-size: 1.25rem !important; }
}

/* End v=318 ==================================================== */


/* ============================================================
   v=319 — presentation fixes (real data fields, 3D snapshot priority)
   ============================================================ */

/* Etykieta co widzimy: 3D snapshot vs AI wizualizacja */
.turbo-visual-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 0.35rem 0.7rem;
  background: rgba(31, 18, 8, 0.85);
  border: 1px solid rgba(232, 200, 150, 0.35);
  color: #E8C896;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5;
}

/* Duzy 2D plan gdy brak renderu ani snapshotu */
.turbo-slide-planonly {
  width: 100%;
  max-height: 65vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
}
.turbo-slide-planonly svg {
  width: 100% !important;
  height: auto !important;
  max-height: 65vh !important;
  display: block;
}

/* Hint w summary gdy brak ceny */
.turbo-totals-hint {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(232, 200, 150, 0.2);
  color: rgba(232, 200, 150, 0.6) !important;
  font-style: italic;
  font-size: 0.88rem !important;
}
.turbo-totals-hint span { color: rgba(232, 200, 150, 0.7) !important; font-weight: 400 !important; }

/* End v=319 ==================================================== */


/* ============================================================
   v=320 — presentation: visual tabs (3D/2D/AI) + prep overlay
   ============================================================ */

/* PREP OVERLAY (batch snapshot generation) */
#turbo-present-prepare {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 8, 4, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: turboFadeIn 0.25s ease;
}
.turbo-prepare-box {
  background: white;
  border-radius: 18px;
  padding: 2.2rem 2.8rem;
  min-width: 360px;
  max-width: 92vw;
  box-shadow: 0 30px 70px -20px rgba(31, 18, 8, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
}
.turbo-prepare-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(184, 150, 90, 0.16);
  border-top-color: var(--fp-accent-dark, #8B5A2B);
  border-radius: 50%;
  animation: fpSpin 0.9s linear infinite;
}
.turbo-prepare-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--fp-fg, #1A1714);
}
.turbo-prepare-label {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.88rem;
  min-height: 1.2rem;
}
.turbo-prepare-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(31, 18, 8, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.turbo-prepare-bar {
  height: 100%;
  width: 4%;
  background: linear-gradient(90deg, var(--fp-accent, #B8965A), var(--fp-accent-dark, #8B5A2B));
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

/* VISUAL STAGE (nested layers - 3D / 2D / AI) */
.turbo-visual-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 62vh;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #1F1208, #0A0705);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
}
.turbo-visual-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.35s cubic-bezier(0.19, 1, 0.22, 1), transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}
.turbo-visual-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.turbo-visual-plan svg {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  display: block;
}
.turbo-visual-stage[data-active="3d"] [data-visual="3d"],
.turbo-visual-stage[data-active="plan"] [data-visual="plan"],
.turbo-visual-stage[data-active="ai"] [data-visual="ai"] {
  opacity: 1;
  transform: scale(1);
}

/* VISUAL TABS pod stage */
.turbo-visual-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.turbo-visual-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
}
.turbo-visual-tab strong {
  color: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.turbo-visual-tab small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.turbo-visual-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}
.turbo-visual-tab.active {
  background: linear-gradient(135deg, rgba(232, 200, 150, 0.18), rgba(184, 150, 90, 0.08));
  color: white;
  box-shadow: inset 0 1px 0 rgba(232, 200, 150, 0.15);
}
.turbo-visual-tab.active strong { color: #F5D89E; }
.turbo-visual-tab.active small { color: rgba(232, 200, 150, 0.75); }

@media (max-width: 900px) {
  .turbo-visual-stage { aspect-ratio: 4 / 3; max-height: 40vh; }
  .turbo-visual-tabs { flex-wrap: wrap; }
  .turbo-visual-tab { padding: 0.45rem 0.55rem; }
  .turbo-visual-tab strong { font-size: 0.78rem; }
  .turbo-visual-tab small { font-size: 0.62rem; }
  .turbo-prepare-box { min-width: 280px; padding: 1.6rem 1.4rem; }
}

/* End v=320 ==================================================== */


/* ============================================================
   v=321 — presentation visuals BIGGER (nie sensu bylo pol na pol)
   ============================================================ */

/* Stage - wieksza scena, higher aspect ratio, no cap na height */
.turbo-visual-stage {
  aspect-ratio: 3 / 2 !important;
  max-height: 72vh !important;
  min-height: 55vh !important;
  width: 100% !important;
}

/* Slajd pokoju - 2.2 : 1 zamiast 1.4 : 1 (wizualizacja dominuje) */
.turbo-room-slide {
  grid-template-columns: 2fr 1fr !important;
  gap: 2rem !important;
  max-width: 1600px !important;
  align-items: stretch !important;
  padding: 1rem 1.5rem !important;
}

/* Visual column - fill height, dol wyrownany z info */
.turbo-room-slide .turbo-room-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  min-width: 0;
}

/* Info column - kompakt bloki */
.turbo-room-slide .turbo-room-info {
  gap: 1rem !important;
  align-self: stretch;
}
.turbo-slide-blocks {
  grid-template-columns: 1fr 1fr !important;
  gap: 0.55rem !important;
}
.turbo-block {
  padding: 0.65rem 0.85rem !important;
}
.turbo-block strong {
  font-size: 1.05rem !important;
}
.turbo-block-cost strong {
  font-size: 1.6rem !important;
}

/* Slide container - wiecej miejsca po bokach */
.turbo-present-slide {
  padding: 1.2rem 2rem !important;
}

/* Wewnetrzny mini plan - moze byc wiekszy skoro scena wieksza */
.turbo-visual-mini {
  width: 220px;
  bottom: 16px;
  right: 16px;
}

/* MOBILE */
@media (max-width: 900px) {
  .turbo-room-slide {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0.75rem !important;
  }
  .turbo-visual-stage {
    aspect-ratio: 4 / 3 !important;
    max-height: 50vh !important;
    min-height: 38vh !important;
  }
  .turbo-visual-mini {
    width: 120px;
    bottom: 10px;
    right: 10px;
  }
  .turbo-present-slide {
    padding: 0.5rem !important;
  }
}

/* End v=321 ==================================================== */


/* ============================================================
   v=324 — AI Render modal enhancements + thumbnail refresh
   ============================================================ */

/* Sekcje w modalu */
.ai-modal-section {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--fp-line, rgba(31, 18, 8, 0.08));
}
.ai-modal-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.4rem; }
.ai-modal-label {
  display: block;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.ai-modal-hint {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.82rem;
  margin: 0.4rem 0 0.6rem;
}

/* Chipy z meblami/elementami */
.ai-furn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ai-furn-chip {
  cursor: pointer;
}
.ai-furn-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ai-furn-chip span {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  background: white;
  border: 1px solid var(--fp-line, rgba(31, 18, 8, 0.12));
  border-radius: 20px;
  color: var(--fp-fg, #1A1714);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}
.ai-furn-chip:hover span {
  border-color: var(--fp-accent, #B8965A);
  background: rgba(184, 150, 90, 0.08);
}
.ai-furn-chip input:checked + span {
  background: var(--fp-fg, #1A1714);
  color: white;
  border-color: var(--fp-fg, #1A1714);
  box-shadow: 0 2px 6px rgba(31, 18, 8, 0.2);
}
.ai-furn-chip input:checked + span::before {
  content: "✓";
  margin-right: 0.35rem;
  color: var(--fp-accent, #B8965A);
  font-weight: 700;
}

/* Textarea customowego opisu */
.ai-custom-prompt {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--fp-line, rgba(31, 18, 8, 0.12));
  border-radius: 10px;
  background: white;
  color: var(--fp-fg, #1A1714);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.ai-custom-prompt:focus {
  outline: none;
  border-color: var(--fp-accent, #B8965A);
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.15);
}
.ai-custom-prompt::placeholder {
  color: rgba(107, 95, 82, 0.55);
  font-style: italic;
}

/* End v=324 ==================================================== */


/* ============================================================
   v=327 — MOBILE POLISH PASS (bug fixes across many spots)
   ============================================================ */

/* === PROJECTS LIST na mobile === */
@media (max-width: 768px) {
  /* Karty w rzędach 1×, poprawny aspect thumbnail */
  #projects-list.cards {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
  }
  .project-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .project-thumb-wrap {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden;
    position: relative;
  }
  .project-thumb {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }
  /* Overlay z akcjami na mobile - kompaktowo */
  .project-thumb-overlay {
    padding: 0.4rem !important;
  }
  .project-thumb-overlay .actions {
    gap: 0.35rem !important;
  }
  .project-thumb-overlay .actions button {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    padding: 0 !important;
  }
  /* Body kart - mniej vertical space */
  .project-card .project-body {
    padding: 0.85rem 1rem !important;
  }
  .project-card h3 {
    font-size: 1.05rem !important;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }
  .project-card .stats {
    gap: 0.35rem 0.75rem !important;
    font-size: 0.78rem !important;
    margin: 0.5rem 0 !important;
  }
  .project-card .stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }
  .project-card .meta {
    font-size: 0.72rem !important;
    color: var(--fp-fg-muted, #6B5F52);
  }

  /* Hero section - kompakt */
  .hero-projects {
    padding: 1.2rem 1rem 0.85rem !important;
  }
  .hero-projects h2 {
    font-size: 1.55rem !important;
  }
  .hero-projects p {
    font-size: 0.88rem !important;
    line-height: 1.4;
  }
  .hero-stats {
    gap: 0.5rem !important;
    margin-top: 0.85rem;
  }
  .hero-stats > div {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.82rem !important;
  }

  /* Toolbar (search + sort) */
  .toolbar {
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
    padding: 0 0.75rem !important;
  }
  .search-wrap {
    flex: 1 1 100% !important;
    min-width: 0;
  }
  #proj-sort {
    flex: 1 1 100% !important;
    padding: 0.6rem 0.75rem !important;
    font-size: 0.9rem !important;
  }
}

/* === MODALE na mobile === */
@media (max-width: 768px) {
  #modal-host .modal-content {
    max-width: 96vw !important;
    max-height: 92vh !important;
    padding: 1rem 1rem !important;
    border-radius: 14px !important;
    overflow-y: auto;
  }
  .turbo-modal-content,
  .turbo-shortcuts-panel {
    max-width: 96vw !important;
    max-height: 92vh !important;
  }
  /* Modal buttons - stackuja sie na mobile */
  #modal-host .modal-actions,
  .modal-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    justify-content: stretch !important;
  }
  #modal-host .modal-actions button,
  .modal-actions button {
    flex: 1 1 auto !important;
    min-width: 42% !important;
    padding: 0.7rem 0.9rem !important;
    font-size: 0.9rem !important;
    min-height: 44px;
  }
}

/* === EDITOR TABS + zawartosc === */
@media (max-width: 768px) {
  .tab-content .card {
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  .tab-content .card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.75rem !important;
  }
  .tab-content .card label {
    display: block;
    margin-bottom: 0.7rem;
    font-size: 0.88rem;
  }
  .tab-content .card input[type="text"],
  .tab-content .card input[type="number"],
  .tab-content .card select {
    width: 100% !important;
    padding: 0.6rem 0.75rem !important;
    font-size: 0.95rem !important;
    box-sizing: border-box;
    min-height: 42px;
  }
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
  }
  /* row-between - stackowanie na mobile */
  .row-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .row-actions {
    justify-content: stretch !important;
  }
  .row-actions button,
  .row-actions .btn-secondary,
  .row-actions .btn-primary {
    flex: 1 1 auto !important;
    min-width: 42% !important;
    min-height: 40px;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* === ROOM CARD na mobile - v=312 miala fixy ale doszlifuj === */
@media (max-width: 768px) {
  .room-card {
    padding: 0.85rem !important;
  }
  .room-card .room-header {
    padding-bottom: 0.65rem !important;
    margin-bottom: 0.65rem !important;
  }
  .room-card .room-title strong {
    font-size: 1rem;
  }
  .room-card .room-actions {
    display: flex !important;
    gap: 2px !important;
    padding: 2px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .room-card .room-actions::-webkit-scrollbar { display: none; }
  .room-card .room-btn {
    padding: 0.5rem 0.55rem !important;
    font-size: 0.73rem !important;
    min-height: 40px !important;
    flex: 0 0 auto !important;
  }
  .room-card .room-btn span {
    display: inline;
  }
  .room-card .room-btn-icon {
    min-width: 40px !important;
    padding: 0.5rem !important;
  }
  .room-card .room-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  /* Pattern chips + dir chips scroll horizontal */
  .room-card .pattern-chips,
  .room-card .dir-chips,
  .room-card .wood-skin-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem !important;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }
  .room-card .pattern-chips::-webkit-scrollbar,
  .room-card .dir-chips::-webkit-scrollbar,
  .room-card .wood-skin-grid::-webkit-scrollbar { display: none; }
  .room-card .chip {
    flex: 0 0 auto !important;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }
  .room-card .dir-row {
    align-items: center;
    flex-wrap: wrap;
  }
  .room-card .dir-label {
    flex: 1 1 100% !important;
    font-size: 0.78rem;
  }
}

/* === BOTTOM-ACTIONS (dropdown toolbar) === */
@media (max-width: 768px) {
  .bottom-actions {
    padding: 0.55rem !important;
    gap: 0.35rem !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
  .bottom-actions .ba-btn {
    flex: 1 1 auto;
    padding: 0.55rem 0.7rem !important;
    font-size: 0.82rem !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }
  .bottom-actions .ba-btn > span { display: inline; }
  .bottom-actions .btn-primary.ba-btn { flex: 1 1 45%; }
  .bottom-actions .ba-dropdown { flex: 1 1 45%; }
  .bottom-actions .ba-dropdown .ba-btn { width: 100%; }
  .bottom-actions .ba-btn-icon {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
  }
  .bottom-actions .ba-dropdown[data-dd="more"] {
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }
  /* Bottom sheet dropdowns na mobile */
  .bottom-actions .ba-dd-menu {
    position: fixed !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: auto !important;
    bottom: 0.75rem !important;
    min-width: 0 !important;
    width: auto !important;
    max-height: 65vh !important;
  }
}

/* === HEADER na mobile === */
@media (max-width: 768px) {
  .app-header {
    padding: 0.65rem 0.85rem !important;
  }
  .app-header .brand-icon {
    width: 34px !important;
    height: 34px !important;
    padding: 5px !important;
  }
  .app-header h1 {
    font-size: 1rem !important;
  }
  .app-header .header-subtitle {
    font-size: 0.72rem !important;
  }
  .header-icon-btn {
    width: 34px !important;
    height: 34px !important;
  }
}

/* === FAB stack === */
@media (max-width: 768px) {
  .fab-stack {
    right: 12px !important;
    bottom: 12px !important;
    gap: 0.55rem !important;
  }
  #fab-new {
    width: 52px !important;
    height: 52px !important;
  }
  .fab-secondary {
    width: 42px !important;
    height: 42px !important;
  }
  .fab-secondary svg { width: 17px; height: 17px; }
}

/* === AI RENDER MODAL na mobile - chipy trzeba przemieścić === */
@media (max-width: 768px) {
  .ai-style-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }
  .ai-style-card {
    padding: 0.55rem !important;
  }
  .ai-style-content {
    gap: 0.3rem !important;
  }
  .ai-style-icon {
    font-size: 1.5rem !important;
  }
  .ai-style-label {
    font-size: 0.82rem !important;
  }
  .ai-style-desc {
    font-size: 0.7rem !important;
  }
  .ai-furn-chips {
    gap: 0.3rem !important;
  }
  .ai-furn-chip span {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.78rem !important;
  }
  .ai-custom-prompt {
    min-height: 54px !important;
    font-size: 0.85rem !important;
  }
  .ai-modal-section {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
  }
  .ai-modal-label {
    font-size: 0.68rem !important;
  }
  .ai-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }
  .ai-gallery-item img {
    height: 100px !important;
  }
}

/* === CAD topbar / mobile-props-modal / inne modale === */
@media (max-width: 480px) {
  .app-header { padding: 0.5rem 0.65rem !important; }
  .fab-secondary { width: 40px !important; height: 40px !important; }
  #fab-new { width: 48px !important; height: 48px !important; }
  .project-card .stats { font-size: 0.72rem !important; }
  .room-card .room-btn { padding: 0.45rem 0.5rem !important; font-size: 0.7rem !important; }
}

/* === TOUCH TARGETS - min 44×44 (WCAG) === */
@media (pointer: coarse) and (max-width: 768px) {
  button:not(.ba-btn-icon):not(.room-btn-icon):not(.turbo-close):not(.cad-zoom-btn),
  .btn-primary, .btn-secondary, .btn-tertiary,
  a.btn-primary, a.btn-secondary,
  input[type="button"], input[type="submit"] {
    min-height: 44px;
  }
}

/* Fix: iOS scrolling elastyczności */
html, body {
  overscroll-behavior-y: contain;
}

/* Fix: FloorPlanner CAD polygon-editor overflow bug na malutkich */
@media (max-width: 480px) {
  section.view.polygon-editor.cad-fullscreen {
    padding-top: 40px !important;
    padding-bottom: 70px !important;
  }
}

/* End v=327 ==================================================== */


/* ============================================================
   v=328 — Storage quota UI (pill w header + admin panel + modal)
   ============================================================ */

/* PILL W HEADER */
.fp-storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  background: white;
  border: 1px solid var(--fp-line, rgba(31, 18, 8, 0.1));
  border-radius: 20px;
  color: var(--fp-fg, #1A1714);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
  font-variant-numeric: tabular-nums;
}
.fp-storage-pill:hover {
  border-color: var(--fp-accent, #B8965A);
  background: rgba(184, 150, 90, 0.05);
}
.fp-storage-pill .sp-bar {
  display: inline-block;
  width: 40px;
  height: 6px;
  background: rgba(31, 18, 8, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.fp-storage-pill .sp-fill {
  display: block;
  height: 100%;
  background: var(--fp-accent-dark, #8B5A2B);
  transition: width 0.35s ease;
  border-radius: 3px;
}
.fp-storage-pill.ok .sp-fill { background: #6B4523; }
.fp-storage-pill.warning .sp-fill { background: #D4923B; }
.fp-storage-pill.warning { border-color: #E4B57C; background: rgba(212, 146, 59, 0.1); }
.fp-storage-pill.critical .sp-fill { background: #E84A4A; }
.fp-storage-pill.critical {
  border-color: #E84A4A;
  background: rgba(232, 74, 74, 0.08);
  animation: fpStoPulse 2s ease infinite;
}
.fp-storage-pill.unlimited {
  background: linear-gradient(135deg, rgba(232, 200, 150, 0.18), rgba(184, 150, 90, 0.12));
  border-color: rgba(184, 150, 90, 0.35);
}
.fp-storage-pill .sp-icon {
  font-size: 0.95rem;
  color: var(--fp-accent-dark, #8B5A2B);
  font-weight: 700;
}
@keyframes fpStoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 74, 74, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(232, 74, 74, 0); }
}

@media (max-width: 768px) {
  .fp-storage-pill .sp-value { display: none; }
  .fp-storage-pill { padding: 0.35rem 0.5rem; min-width: 32px; min-height: 32px; }
  .fp-storage-pill .sp-bar { width: 28px; }
}

/* STORAGE MODAL */
.storage-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: turboFadeIn 0.2s ease;
}
.storage-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 4, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.storage-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 520px;
  width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -16px rgba(31, 18, 8, 0.5);
  animation: turboSlideUp 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}
.storage-modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--fp-line, rgba(31,18,8,0.08));
}
.storage-modal-content header h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.storage-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(31, 18, 8, 0.06);
  color: var(--fp-fg, #1A1714);
  font-size: 1.4rem;
  cursor: pointer;
}
.storage-close:hover { background: rgba(31, 18, 8, 0.14); }

.storage-summary { padding: 1.2rem 1.4rem; }
.storage-big-bar {
  width: 100%;
  height: 12px;
  background: rgba(31, 18, 8, 0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.storage-big-fill {
  height: 100%;
  background: var(--fp-accent-dark, #8B5A2B);
  border-radius: 6px;
  transition: width 0.4s ease;
}
.storage-summary-text {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-variant-numeric: tabular-nums;
}
.storage-summary-text strong {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--fp-fg, #1A1714);
}
.storage-percent {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.9rem;
}
.storage-remaining {
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.storage-breakdown, .storage-tips {
  padding: 0.6rem 1.4rem;
}
.storage-breakdown h4, .storage-tips h4 {
  margin: 0.9rem 0 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fp-fg-muted, #6B5F52);
}
.storage-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(31, 18, 8, 0.05);
  font-size: 0.9rem;
}
.storage-row:last-child { border-bottom: 0; }
.storage-row strong { font-variant-numeric: tabular-nums; }
.storage-tips ul {
  margin: 0.4rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ADMIN STORAGE PANEL */
.admin-storage { padding: 0.5rem 0; }
.admin-server-status {
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.08), rgba(232, 200, 150, 0.04));
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}
.admin-server-status h3 {
  margin: 0 0 0.85rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
}
.admin-server-bar {
  width: 100%;
  height: 16px;
  background: rgba(31, 18, 8, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.7rem;
}
.admin-server-fill {
  height: 100%;
  background: linear-gradient(90deg, #6B4523, #B8965A);
  transition: width 0.5s ease;
}
.admin-server-nums {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.admin-server-nums strong { font-size: 1.15rem; }
.admin-server-nums .admin-free {
  margin-left: auto;
  color: #4a7d4a;
  font-weight: 500;
}
.admin-server-note {
  margin-top: 0.85rem;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.82rem;
}

.admin-users-table h3 {
  margin: 0 0 0.75rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
}
.admin-users-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.08));
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.88rem;
}
.admin-users-table thead {
  background: rgba(31, 18, 8, 0.04);
}
.admin-users-table th {
  text-align: left;
  padding: 0.75rem 0.9rem;
  color: var(--fp-fg-muted, #6B5F52);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.admin-users-table td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid rgba(31, 18, 8, 0.05);
  font-variant-numeric: tabular-nums;
}
.admin-sto-uid { color: var(--fp-fg-muted, #6B5F52); font-size: 0.78rem; }
.admin-sto-email { font-weight: 500; }
.admin-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: linear-gradient(135deg, #C9A876, #8B5A2B);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.4rem;
}
.admin-sto-bar {
  display: inline-block;
  width: 80px;
  height: 8px;
  background: rgba(31, 18, 8, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.admin-sto-fill {
  display: block;
  height: 100%;
  background: #6B4523;
  transition: width 0.35s ease;
}
.admin-sto-fill.warning { background: #D4923B; }
.admin-sto-fill.critical { background: #E84A4A; }
.admin-sto-nums small { color: var(--fp-fg-muted, #6B5F52); font-weight: 400; }
.admin-sto-set-quota {
  background: transparent;
  border: 1px solid var(--fp-line, rgba(31,18,8,0.15));
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  color: var(--fp-fg, #1A1714);
  font-size: 0.85rem;
}
.admin-sto-set-quota:hover { background: rgba(31, 18, 8, 0.05); }

@media (max-width: 768px) {
  .admin-users-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-users-table table { min-width: 640px; }
  .admin-server-nums { flex-direction: column; gap: 0.4rem; }
  .admin-server-nums .admin-free { margin-left: 0; }
}

/* End v=328 ==================================================== */
