.leaflet-default-icon-path { /* marker assets via same CDN */ }

:root {
  --violet: #7657e8;
  --ink: #1c1630;
  --soft: #f7f4ff;
  --line: #e8e1f4;
  --panel-bg: rgba(255,255,255,.95);
  --label: #3a2f55;
  --muted: #5c5470;
  --input-bg: #ffffff;
  --input-text: #1c1630;
}
html[data-theme="dark"] {
  --violet: #a78bfa;
  --ink: #f3eeff;
  --soft: #1a1524;
  --line: #3d3554;
  --panel-bg: #1c1828;
  --label: #f0eaff;
  --muted: #c4bbd8;
  --input-bg: #2a2438;
  --input-text: #f5f0ff;
}
body {
  background: linear-gradient(135deg, #f8f6ff, #fff8f4);
  color: var(--ink);
  margin: 0;
  font-family: Vazirmatn, Tahoma, sans-serif;
}

/* FORCE light studio chrome (costbar/top) */
html[data-theme="light"] .studio-costbar,
html:not([data-theme="dark"]) .studio-costbar {
  background: linear-gradient(120deg, #ffffff, #f3ecff 55%, #efe7ff) !important;
  color: #1c1630 !important;
  border: 1px solid #e8e1f4 !important;
  box-shadow: 0 10px 28px rgba(74,52,134,.08) !important;
}
html[data-theme="light"] .studio-costbar *,
html:not([data-theme="dark"]) .studio-costbar * {
  color: inherit;
}
html[data-theme="light"] .studio-top,
html:not([data-theme="dark"]) .studio-top {
  color: #1c1630 !important;
}
html[data-theme="dark"] .studio-costbar {
  background: linear-gradient(120deg, #38286b, #7657e8 52%, #9b6cf6) !important;
  color: #fff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] body,
body.dark,
body.theme-dark {
  background: #121018 !important;
  color: var(--ink) !important;
}
.premium-feature-notice { min-height: 1.45rem; color: #756c87; font-size: .77rem; line-height: 1.75; }
.premium-feature-notice.is-active { color: #6a3ab4; font-weight: 700; }
.studio {
  max-width: 1500px;
  margin: auto;
  padding: 20px 16px 40px;
}
.studio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #21183d;
  color: #fff;
  border-radius: 20px;
  padding: 16px 22px;
  box-shadow: 0 14px 40px #21183d22;
  margin-bottom: 14px;
}
.studio-top h1 { font-size: 1.15rem; margin: 4px 0 0; }
.studio-costbar {
  max-width: 1500px;
  margin: 0 auto 10px;
  background: linear-gradient(120deg, #ffffff, #f3ecff 55%, #efe7ff);
  color: #1c1630;
  border: 1px solid #e8e1f4;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: 0 8px 20px rgba(74,52,134,.08);
  position: sticky;
  top: 6px;
  z-index: 30;
  min-height: 0;
  text-align: center;
}
/* Simple / Advanced studio modes */
.studio-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 2px;
  margin-inline-end: 4px;
}
.studio-mode-switch button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  line-height: 1.2;
  cursor: pointer;
  opacity: .85;
}
.studio-mode-switch button.active {
  background: #fff;
  color: #4b2fb8;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(20,10,50,.18);
}
html.studio-mode-simple .studio-advanced-only { display: none !important; }
html.studio-mode-simple .mobile-studio-nav button[data-mobile-tool="layout"],
html.studio-mode-simple .mobile-studio-nav button[data-mobile-tool="advanced"] {
  display: none !important;
}
html.studio-mode-simple .mobile-studio-nav {
  grid-template-columns: repeat(4, 1fr) !important;
}
.studio-mode-hint {
  font-size: .72rem;
  opacity: .9;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(118, 87, 232, .08);
  border: 1px dashed rgba(118, 87, 232, .28);
  color: var(--ink, #1b1630);
}
html.studio-mode-advanced .studio-simple-only-hint { display: none !important; }
.studio-costbar .studio-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.25;
  min-width: 0;
}
.studio-costbar .studio-brand small,
.studio-costbar .studio-brand .small { display: none; }
.studio-costbar .studio-brand strong {
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.costbar-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-size: .78rem;
}
.costbar-item strong {
  font-size: .95rem;
  color: #ffe493;
}
.costbar-label { font-size: .68rem; opacity: .85; }
.costbar-divider {
  width: 1px;
  height: 22px;
  background: #ffffff44;
}
.costbar-hint {
  flex: 1;
  font-size: .75rem;
  opacity: .92;
  display: flex;
  align-items: center;
  gap: 6px;
}
.costbar-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0;
  align-items: center;
  justify-content: center;
}
.costbar-actions .btn {
  padding: 4px 10px !important;
  font-size: .75rem !important;
  line-height: 1.3 !important;
  border-radius: 999px !important;
}
.costbar-actions .btn i { font-size: .9rem; }
.costbar-actions label.btn {
  margin-bottom: 0 !important;
  gap: 4px !important;
}
.costbar-actions #topSubmitCard,
.costbar-actions a[data-studio-login] {
  font-weight: 800 !important;
}
@media (max-width: 640px) {
  .studio-costbar {
    padding: 5px 8px;
    gap: 6px;
    border-radius: 12px;
    justify-content: center;
  }
  .studio-costbar .studio-brand strong { font-size: .75rem; }
  .costbar-actions .btn span.costbar-btn-text { display: none; }
  .costbar-actions .btn { padding: 5px 8px !important; min-width: 34px; justify-content: center; }
  /* keep submit / login / mode labels visible */
  .costbar-actions a[data-studio-login] span.costbar-btn-text,
  .costbar-actions #topSubmitCard span.costbar-btn-text,
  .costbar-actions #topDashboardLink span.costbar-btn-text,
  .studio-mode-switch button {
    display: inline !important;
  }
  .studio-mode-switch button { font-size: .68rem; padding: 5px 8px; }
}
.studio-grid {
  display: grid;
  grid-template-areas: "tools canvas extras";
  grid-template-columns: 290px minmax(420px, 1fr) 270px;
  gap: 16px;
  align-items: start;
}
.tool-panel {
  grid-area: tools;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 14px 40px #4a348612;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  border-top: 4px solid var(--violet);
  color: var(--ink);
}
.summary-panel {
  grid-area: extras;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.tool-panel::-webkit-scrollbar,
.summary-panel::-webkit-scrollbar { width: 5px; }
.tool-panel::-webkit-scrollbar-thumb,
.summary-panel::-webkit-scrollbar-thumb {
  background: #d8ccef;
  border-radius: 99px;
}
.tool-title {
  font-weight: 800;
  margin: 0 0 12px;
  font-size: .95rem;
  color: var(--ink);
}
.tool-section {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.tool-section:last-child { border-bottom: 0; }
.tool-section summary {
  cursor: default;
  font-weight: 800;
  list-style: none;
  font-size: .9rem;
  color: var(--ink);
  pointer-events: none;
}
.tool-section summary::-webkit-details-marker { display: none; }
.tool-section summary:after { display: none !important; content: none !important; }
.tool-section .inside { padding-top: 12px; display: block !important; }
/* Always expanded — no collapse / no + button */
.tool-section { open: open; }
details.tool-section > .inside { display: block !important; }
.form-label {
  font-weight: 700;
  color: var(--label) !important;
  font-size: .82rem;
  margin-bottom: 4px;
}
.tool-panel .form-control,
.tool-panel .form-select,
.summary-panel .form-control,
.summary-panel .form-select,
.right-tools-panel .form-control,
.right-tools-panel .form-select {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--line) !important;
}
.tool-panel .text-secondary,
.summary-panel .text-secondary,
.right-tools-panel .text-secondary,
.tool-panel .small,
.summary-panel .small {
  color: var(--muted) !important;
}
.tool-panel .text-primary,
.summary-panel .text-primary,
.studio-back-panel .text-primary {
  color: var(--violet) !important;
}
.right-tools-panel,
.summary-panel .right-tools-panel,
.studio-back-panel,
.border.rounded-3.p-2 {
  background: var(--panel-bg) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
.studio {
  overflow-x: hidden;
  max-width: 100%;
}
.canvas-zone {
  grid-area: canvas;
  min-height: 0;
  background: radial-gradient(circle at 50% 10%, #eee5ff, #ffffff 55%);
  border: 1px dashed #cfc2ef;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  max-width: 100%;
}
.studio-submit-bar {
  width: 100%;
  max-width: 430px;
  margin: 14px auto 0;
  display: flex;
  justify-content: center;
}
.studio-submit-main {
  width: 100%;
  min-height: 52px;
  font-size: 1rem !important;
  padding: 12px 18px !important;
  box-shadow: 0 10px 28px rgba(109, 79, 228, .28);
}
html[data-theme="dark"] .canvas-zone {
  background: radial-gradient(circle at 50% 10%, #2a2140, #16121f 55%);
  border-color: #4a3f66;
}
/* Frame wraps the card so border follows the exact shape */
.card-frame {
  display: inline-block;
  position: relative;
  padding: 0;
  line-height: 0;
  transition: rotate .25s ease;
  rotate: var(--card-rotation, 0deg);
  filter: drop-shadow(0 16px 28px rgba(82, 54, 157, 0.25));
}
.card-frame .card-canvas {
  rotate: 0deg; /* rotation only on frame */
  box-shadow: none;
  filter: none;
}
.card-canvas {
  /* Fixed studio card size — stable proportion with comfortable inner margin */
  width: 390px;
  max-width: calc(100vw - 48px);
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  border-radius: 28px;
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff0f3, #f5d6ec);
  transition: background .25s ease;
  box-sizing: border-box;
  margin: 0 auto;
}
.card-canvas.orientation-landscape {
  width: 560px;
  max-width: calc(100vw - 48px);
  height: 360px;
  min-height: 360px;
  max-height: 360px;
  padding: 32px 40px;
}
.card-canvas.orientation-portrait {
  width: 390px;
  max-width: calc(100vw - 48px);
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  padding: 48px 28px;
}
.card-frame {
  margin: 8px auto;
}
.card-canvas h1,
.card-canvas p,
.card-canvas .studio-event-meta,
.card-canvas .studio-event-address,
.card-canvas .studio-back-preview {
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 420px) {
  .card-canvas.orientation-portrait {
    width: min(100%, 340px);
    height: 460px;
    min-height: 460px;
    max-height: 460px;
    padding: 36px 20px;
  }
  .card-canvas.orientation-landscape {
    width: min(100%, 340px);
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    padding: 24px 18px;
  }
}

/* Shape clip-paths – applied to BOTH frame and canvas */
/* Soft full heart – curved lobes, no sharp corners */
.shape-heart {
  clip-path: path('M 50 92 C 45 88, 8 62, 8 38 C 8 22, 20 10, 34 10 C 42 10, 48 15, 50 22 C 52 15, 58 10, 66 10 C 80 10, 92 22, 92 38 C 92 62, 55 88, 50 92 Z');
  border-radius: 0 !important;
}
@supports not (clip-path: path('M0 0Z')) {
  .shape-heart {
    clip-path: polygon(50% 92%, 45% 86%, 12% 58%, 6% 40%, 8% 24%, 18% 12%, 32% 10%, 44% 18%, 50% 28%, 56% 18%, 68% 10%, 82% 12%, 92% 24%, 94% 40%, 88% 58%, 55% 86%);
  }
}
.shape-diamond {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border-radius: 0 !important;
}
.shape-diamond .card-canvas { padding: 90px 60px; }
.shape-hexagon {
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  border-radius: 0 !important;
}
.shape-hexagon .card-canvas { padding: 70px 50px; }
.shape-arch, .shape-arch .card-canvas { border-radius: 220px 220px 30px 30px; }
.shape-pill, .shape-pill .card-canvas { border-radius: 220px; }
.shape-ticket {
  clip-path: polygon(0 0, 100% 0, 100% 42%, 96% 44%, 100% 46%, 100% 100%, 0 100%, 0 46%, 4% 44%, 0 42%);
  border-radius: 30px;
}
.shape-rounded, .shape-rounded .card-canvas { border-radius: 28px; }

/* Border = colored padding on the frame (follows clip-path perfectly) */
.card-frame.border-gold {
  padding: 5px;
  background: linear-gradient(135deg, #c89c42, #f0d78c, #c89c42);
}
.card-frame.border-white {
  padding: 5px;
  background: #fff;
}
.card-frame.border-double {
  padding: 7px;
  background: linear-gradient(135deg, #7657e8, #fff 40%, #7657e8);
}
.card-frame.border-ornate {
  padding: 6px;
  background: linear-gradient(45deg, #c89c42, #f9e3a8, #9b6bd6, #c89c42);
}
.card-frame.border-dashed {
  padding: 4px;
  background: repeating-linear-gradient(45deg, #7657e8 0 6px, transparent 6px 12px);
}
.card-frame.border-neon {
  padding: 4px;
  background: #ff65d8;
  filter: drop-shadow(0 0 8px #ff65d8) drop-shadow(0 0 16px #7657e8) drop-shadow(0 16px 28px rgba(82, 54, 157, 0.25));
}
.card-frame.border-lace {
  padding: 13px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,250,239,.92), rgba(191,141,87,.78)),
    url('/assets/media/premium-textures/premium-lace-floral-frame.jpg') center / cover;
  box-shadow: 0 12px 28px rgba(113,72,69,.28), inset 0 0 0 1px rgba(255,255,255,.92);
}
.card-frame.border-lace .card-canvas { box-shadow: inset 0 0 0 1px rgba(152,105,121,.18); }
.card-frame.border-corner {
  padding: 5px 0;
  background: currentColor;
}
.card-frame.border-none {
  padding: 0;
  background: transparent;
}

.card-canvas > * { position: relative; z-index: 1; }
.studio-back-indicator{font-size:.7rem;opacity:.72;margin-top:8px}
html[data-theme="dark"] .studio-event-meta,
html[data-theme="dark"] .studio-event-address{color:var(--ink)!important}
.card-canvas h1 {
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  font-weight: 900;
  max-width: 94%;
  word-break: break-word;
  margin: 0 0 10px;
}
.card-canvas p {
  line-height: 2;
  white-space: pre-wrap;
  max-width: 94%;
  margin: 0;
}
.card-deco {
  font-size: 3.4rem;
  margin-bottom: 14px;
  line-height: 1;
}
.card-deco.deco-corner-heart {
  position: absolute !important;
  inset-inline-end: 22px;
  inset-block-start: 20px;
  z-index: 4 !important;
  margin: 0;
  font-size: 1.28rem;
  line-height: 1;
  color: #d67b9a;
  filter: drop-shadow(0 3px 5px rgba(110,53,75,.18));
}
.diari-watermark {
  position: absolute !important;
  left: 12px;
  bottom: 8px !important;
  z-index: 20 !important;
  font-size: .55rem !important;
  opacity: .35 !important;
  letter-spacing: .03em;
  white-space: nowrap;
  pointer-events: none;
}
.canvas-media-image {
  max-width: 86%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 24px #452e7918;
  margin: 6px 0 12px;
  position: relative;
  z-index: 2;
}
.canvas-bg-image {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}
.card-canvas > *:not(.canvas-bg-image) { position: relative; z-index: 1; }

/* Stronger + longer Animations (+ ~2s) */
.anim-float { animation: floatCard 4.4s ease-in-out infinite; }
.anim-zoom { animation: zoomCard 4.2s ease-in-out infinite; }
.anim-slide { animation: slideCard 2.7s cubic-bezier(.2,.8,.2,1) both; }
.anim-rise { animation: riseCard 2.85s cubic-bezier(.2,.8,.2,1) both; }
.anim-pulse { animation: pulseCard 3.6s ease-in-out infinite; }
.anim-rotate { animation: rotateCard 2.9s cubic-bezier(.2,.8,.2,1) both; }
.anim-sway { animation: swayCard 3.8s ease-in-out infinite; }
.anim-blur { animation: blurCard 2.9s ease both; }
.anim-bounce { animation: bounceCard 2.9s cubic-bezier(.2,.8,.2,1) both; }
.anim-shimmer { position: relative; overflow: hidden; }
.anim-shimmer:after {
  content: '';
  position: absolute;
  inset: -100%;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.75) 50%, transparent 60%);
  animation: shine 4.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}
.anim-letter_open { animation: letterOpen 4.8s cubic-bezier(.2,.8,.2,1) both; transform-origin: top center; }
.anim-envelope { animation: envelopeOpen 4.6s cubic-bezier(.2,.8,.2,1) both; transform-origin: top center; }
.anim-curtain { animation: curtainOpen 4.4s cubic-bezier(.2,.8,.2,1) both; }
.anim-typewriter { animation: typewriter 5.2s steps(28) both; }
.anim-origami { animation: origami 4.8s cubic-bezier(.2,.8,.2,1) both; }
.anim-petals, .anim-confetti_rain, .anim-snow {
  position: relative;
  overflow: hidden;
}
.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
  border-radius: inherit;
}
  .particle {
  position: absolute;
  top: -12%;
  font-size: 1.1rem;
  opacity: 0;
  animation: particleFall linear infinite;
  will-change: transform, opacity;
}
.particle.particle-confetti { font-size: 0 !important; display: block; width: var(--piece-w, 8px); height: var(--piece-h, 14px); border-radius: var(--piece-radius, 2px); box-shadow: 0 2px 5px rgba(32,20,64,.16); }
.particle.particle-snow { filter: drop-shadow(0 0 4px rgba(255,255,255,.7)); }
.particle.particle-petals { filter: drop-shadow(0 2px 3px rgba(124,39,75,.13)); }
@keyframes particleFall {
  0%   { transform: translate3d(0,-24px,0) rotate(0deg); opacity: 0; }
  7%   { opacity: 0.94; }
  88%  { opacity: 0.78; }
  100% { transform: translate3d(var(--drift, 20px), var(--fall, 680px), 0) rotate(var(--spin, 360deg)); opacity: 0; }
}
/* Better fold / letter animations */
.anim-letter_open {
  animation: letterOpen 4.8s cubic-bezier(.22,1,.36,1) both;
  transform-origin: top center;
  transform-style: preserve-3d;
}
.anim-envelope {
  animation: envelopeOpen 4.6s cubic-bezier(.22,1,.36,1) both;
  transform-origin: top center;
}
.anim-origami {
  animation: origami 4.8s cubic-bezier(.22,1,.36,1) both;
  transform-style: preserve-3d;
}
.anim-spotlight { animation: spotlight 3.4s ease both; }
.anim-ink { animation: ink 3.3s ease both; }
.anim-memory { animation: memory 3.5s cubic-bezier(.2,.8,.2,1) both; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes zoomCard {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
@keyframes slideCard {
  from { transform: translateX(55px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes riseCard {
  from { transform: translateY(45px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes pulseCard {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes rotateCard {
  from { transform: rotate(-12deg) scale(.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes swayCard {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg); }
}
@keyframes blurCard {
  from { filter: blur(14px); opacity: 0; transform: scale(1.05); }
  to { filter: none; opacity: 1; transform: none; }
}
@keyframes bounceCard {
  from { transform: translateY(-40px); opacity: 0; }
  55% { transform: translateY(10px); }
  75% { transform: translateY(-5px); }
  to { transform: none; opacity: 1; }
}
@keyframes letterOpen {
  from { transform: perspective(800px) rotateX(-85deg); opacity: .15; }
  60% { transform: perspective(800px) rotateX(8deg); opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes envelopeOpen {
  from { transform: scaleY(.08); opacity: .1; }
  55% { transform: scaleY(1.06); opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes curtainOpen {
  from { clip-path: inset(0 48%); opacity: .2; filter: brightness(1.4); }
  to { clip-path: inset(0); opacity: 1; filter: none; }
}
@keyframes typewriter {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes origami {
  from { transform: perspective(900px) rotateY(-95deg) scale(.7); opacity: 0; }
  60% { transform: perspective(900px) rotateY(8deg) scale(1.03); opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes rain {
  from { transform: translateY(-60px); opacity: 0; }
  20% { opacity: 1; }
  to { transform: translateY(110%); opacity: .3; }
}
@keyframes spotlight {
  from { filter: brightness(3) contrast(1.2); transform: scale(1.08); }
  to { filter: brightness(1); transform: none; }
}
@keyframes ink {
  from { filter: blur(18px) contrast(2.5) saturate(1.5); opacity: 0; transform: scale(1.1); }
  to { filter: none; opacity: 1; transform: none; }
}
@keyframes memory {
  from { transform: perspective(900px) rotateY(85deg) scale(.85); opacity: 0; filter: sepia(.4); }
  to { transform: none; opacity: 1; filter: none; }
}
@keyframes shine {
  0% { transform: translateX(-30%) rotate(10deg); }
  100% { transform: translateX(30%) rotate(10deg); }
}

.drag-target {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.drag-target.is-dragging {
  cursor: grabbing;
  z-index: 10;
  filter: drop-shadow(0 10px 16px #7657e844);
}

.right-tools-panel,
.quick-tools-panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  color: var(--ink);
}
.right-tools-panel h2,
.quick-tools-panel h2 {
  font-size: .9rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink) !important;
}
.quick-tool-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 11px;
  margin: 6px 0;
  text-align: right;
  font-size: .85rem;
  transition: .15s;
}
.quick-tool-btn:hover,
.quick-tool-btn:focus-visible {
  border-color: var(--violet);
  color: var(--violet);
  transform: translateY(-1px);
}
.right-tools-note {
  font-size: .72rem;
  line-height: 1.7;
  color: #77718b;
  background: #f4effd;
  border-radius: 10px;
  padding: 9px;
  margin-top: 10px;
}
.music-preview-box {
  background: linear-gradient(135deg, #f6f3ff, #fff8ef);
  border: 1px solid #e7ddfa;
  border-radius: 14px;
  padding: 11px;
  margin: 8px 0 12px;
}
.music-track-meta {
  background: #f7f2ff;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: .75rem;
  color: #4b3d69;
  line-height: 1.7;
}
.music-track-meta a { color: var(--violet); text-decoration: none; }
.rotate-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.rotate-control output {
  min-width: 38px;
  text-align: center;
  font-weight: 800;
  color: var(--violet);
  font-size: .85rem;
}
.btn-preview {
  background: linear-gradient(135deg, #7657e8, #b277f2);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 800;
}
.premium-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #f0d58a;
  background: #fff9e8;
  border-radius: 12px;
  padding: 9px;
  margin-bottom: 7px;
  font-size: .8rem;
}
.coin-badge {
  background: #6d4fe4;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  font-size: .75rem;
}

.studio-guest .auth-only { display: none !important; }
.studio-guest .studio-costbar { justify-content: center; }

/* Only bottom bar menus — old side menus hidden on all viewports */
.studio { padding-bottom: 100px; }
.studio-grid {
  grid-template-areas: "canvas" !important;
  grid-template-columns: 1fr !important;
}
.tool-panel,
.summary-panel {
  /* keep in DOM for bottom-sheet tool mounting, but never show as side menus */
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  max-height: none !important;
}
.studio-costbar { position: static; }
.costbar-divider, .costbar-hint { display: none; }
.canvas-zone { min-height: auto; padding: 18px 10px 23px; }

.mobile-studio-nav {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  position: fixed;
  z-index: 1040;
  right: 12px;
  left: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #e4dbf1;
  border-radius: 20px;
  background: #fffffff5;
  box-shadow: 0 14px 38px #20103f32;
  backdrop-filter: blur(14px);
}
html[data-theme="dark"] .mobile-studio-nav {
  background: #1c1828f2;
  border-color: #3d3554;
  box-shadow: 0 14px 38px #00000055;
}
.mobile-studio-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #61577a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s;
}
html[data-theme="dark"] .mobile-studio-nav button { color: #c4bbd8; }
.mobile-studio-nav button i { font-size: 1.2rem; color: #7657e8; }
html[data-theme="dark"] .mobile-studio-nav button i { color: #a78bfa; }
.mobile-studio-nav button:hover,
.mobile-studio-nav button:focus-visible {
  background: #eee8ff;
  color: #4d30b2;
}
html[data-theme="dark"] .mobile-studio-nav button:hover,
html[data-theme="dark"] .mobile-studio-nav button:focus-visible {
  background: #2a2438;
  color: #e0d4ff;
}
.mobile-studio-nav button.active {
  background: #eee8ff;
  color: #4d30b2;
}
html[data-theme="dark"] .mobile-studio-nav button.active {
  background: #2f2744;
  color: #e0d4ff;
}
.mobile-studio-sheet {
  display: none;
  position: fixed;
  z-index: 1050;
  right: 12px;
  left: 12px;
  bottom: 88px;
  max-width: 720px;
  margin: 0 auto;
  max-height: min(69dvh, 610px);
  overflow: auto;
  border: 1px solid #ded3ee;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 24px 65px #1d103e47;
}
html[data-theme="dark"] .mobile-studio-sheet {
  background: #1c1828;
  border-color: #3d3554;
  color: var(--ink);
}
.mobile-studio-sheet.open { display: block; }
.mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  border-bottom: 1px solid #ece5f4;
  background: #fff;
}
html[data-theme="dark"] .mobile-sheet-head {
  background: #1c1828;
  border-bottom-color: #3d3554;
}
.mobile-sheet-head h2 { margin: 0; font-size: .95rem; font-weight: 900; }
.mobile-sheet-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: #f2edfb;
  color: #5f45bd;
}
html[data-theme="dark"] .mobile-sheet-close {
  background: #2a2438;
  color: #a78bfa;
}
#mobileToolMount { padding: 0 14px 18px; }
#mobileToolMount .tool-section { padding: 12px 0; }
#mobileToolMount .right-tools-panel { margin: 12px 0 0; }
#mobileToolMount .tool-panel,
#mobileToolMount .summary-panel,
#mobileToolMount .tool-section,
#mobileToolMount .right-tools-panel,
#mobileToolMount .studio-event-panel,
#mobileToolMount .studio-back-panel {
  position: static !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  max-height: none !important;
}
.studio-guest .studio-costbar { min-height: 0; padding: 5px 8px; }
.studio-guest .costbar-actions { margin: 0; justify-content: center; flex: 0 1 auto; }
.studio-guest #topSaveNow, .studio-guest #topResetStudio { display: none; }
.studio-guest .costbar-item.auth-only { display: none !important; }


/* Location actions outside 3D card so buttons always work */
.studio-location-bar {
  width: min(100%, 430px);
  margin: 12px auto 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line, #e4dcf4);
  background: var(--panel-bg, #fff);
  color: var(--ink, #1c1630);
  text-align: center;
}
.studio-location-bar[hidden] { display: none !important; }
.studio-location-bar .loc-address {
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.6;
}
.studio-location-bar .back-map-box {
  width: 100%;
  height: 150px;
  margin: 8px auto;
}
.studio-location-bar .back-map-actions {
  margin-top: 10px;
}
html[data-theme="dark"] .studio-location-bar {
  background: #1c1828;
  border-color: #3d3554;
  color: #f2ecff;
}
#eventMap { touch-action: none; }
.modal-open { overflow: hidden !important; padding-right: 0 !important; }

/* Card front/back flip — fixed box so back face never grows the page */
.card-flip-wrap {
  perspective: 1200px;
  display: block;
  position: relative;
  width: 390px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: 520px;
  margin: 0 auto;
  flex: 0 0 auto;
  overflow: hidden;
}
.card-flip-wrap.is-landscape {
  width: 560px;
  max-width: calc(100vw - 48px);
  height: 360px;
  max-height: 360px;
}
.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.card-flip-wrap.is-back .card-flip-inner {
  transform: rotateY(180deg);
}
.card-flip-wrap .card-frame,
.card-flip-wrap .card-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-face-front { pointer-events: auto; }
.card-flip-wrap.is-back .card-face-front { pointer-events: none; }
.card-face-back { pointer-events: none; }
.card-flip-wrap.is-back .card-face-back { pointer-events: auto; }
.mobile-studio-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1045;
  background: rgba(20, 12, 40, .35);
  backdrop-filter: blur(2px);
}
.mobile-studio-backdrop.open { display: block; }
/* Equal-size menu cards + color/size on one row */
.style-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.style-row.style-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.style-row .style-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 78px;
  background: rgba(118, 87, 232, .05);
  border: 1px solid var(--line, #e8e1f4);
  border-radius: 12px;
  padding: 8px 9px;
  box-sizing: border-box;
}
.style-row .style-cell-hint {
  justify-content: center;
}
html[data-theme="dark"] .style-row .style-cell {
  background: rgba(167, 139, 250, .07);
  border-color: #3d3554;
}
.style-row .style-cell .form-label {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
}
.style-row .style-cell .form-select,
.style-row .style-cell .form-control,
.style-row .style-cell .form-range {
  width: 100%;
  margin: 0;
  min-width: 0;
}
.style-row .style-cell input.form-control-color {
  width: 100%;
  height: 34px;
  padding: 2px;
}
.style-row .style-cell .small {
  font-size: .68rem;
  margin: 0;
  opacity: .85;
}
.text-style-block {
  grid-column: 1 / -1;
  border: 1px solid var(--line, #e8e1f4);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.55);
}
html[data-theme="dark"] .text-style-block {
  background: rgba(28, 24, 40, .6);
  border-color: #3d3554;
}
.event-date-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.event-date-col .form-control {
  width: 100%;
}
.event-date-pick-btn {
  width: 100%;
  min-height: 48px;
  font-weight: 800;
  font-size: .95rem;
  border-radius: 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px !important;
}
.event-date-pick-btn i { font-size: 1.25rem; }

.media-control-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.media-control-row .media-control-main {
  flex: 1 1 160px;
  min-width: 0;
}
.media-control-row .media-clear-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 34px;
  align-self: flex-end;
}
@media (max-width: 420px) {
  .style-row.style-row-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .style-row.style-row-3 .style-cell:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* Multi-column tool fields: equal card cells */
#mobileToolMount.tool-two-col-mode .tool-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: stretch;
}
@media (min-width: 520px) {
  #mobileToolMount.tool-two-col-mode .tool-fields-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
#mobileToolMount.tool-two-col-mode .tool-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 78px;
  height: 100%;
  background: rgba(118, 87, 232, .05);
  border: 1px solid var(--line, #e8e1f4);
  border-radius: 12px;
  padding: 8px 9px;
  box-sizing: border-box;
}
html[data-theme="dark"] #mobileToolMount.tool-two-col-mode .tool-field {
  background: rgba(167, 139, 250, .07);
  border-color: #3d3554;
}
#mobileToolMount.tool-two-col-mode .tool-field .form-label {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
}
#mobileToolMount.tool-two-col-mode .tool-field .form-select,
#mobileToolMount.tool-two-col-mode .tool-field .form-control,
#mobileToolMount.tool-two-col-mode .tool-field .form-range {
  width: 100%;
  min-width: 0;
  margin: 0;
}
#mobileToolMount.tool-two-col-mode .tool-field input.form-control-color {
  width: 100%;
  height: 34px;
  padding: 2px;
}
#mobileToolMount.tool-two-col-mode .tool-field .small,
#mobileToolMount.tool-two-col-mode .tool-field [id$="Label"] {
  font-size: .68rem;
  margin: 0;
  opacity: .85;
}
#mobileToolMount.tool-two-col-mode .tool-field-wide {
  grid-column: 1 / -1;
  min-height: 0;
}
#mobileToolMount.tool-two-col-mode .tool-field-wide textarea {
  min-height: 72px;
}
/* style-row / media row / text block span full width inside tool grid */
#mobileToolMount.tool-two-col-mode .style-row,
#mobileToolMount.tool-two-col-mode .media-control-row,
#mobileToolMount.tool-two-col-mode .text-style-block {
  grid-column: 1 / -1;
}
#mobileToolMount.tool-two-col-mode .border.rounded-3 {
  grid-column: 1 / -1;
  margin-top: 4px;
}
#mobileToolMount.tool-two-col-mode .right-tools-panel > h2,
#mobileToolMount.tool-two-col-mode .tool-title,
#mobileToolMount.tool-two-col-mode .small.fw-bold.text-primary {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  min-height: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
#mobileToolMount.tool-two-col-mode .music-preview-box,
#mobileToolMount.tool-two-col-mode .right-tools-note,
#mobileToolMount.tool-two-col-mode .premium-feature-notice,
#mobileToolMount.tool-two-col-mode .form-check,
#mobileToolMount.tool-two-col-mode .d-flex.flex-wrap,
#mobileToolMount.tool-two-col-mode .rotate-control {
  grid-column: 1 / -1;
  min-height: 0;
}
#mobileToolMount .studio-event-panel .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
@media (max-width: 360px) {
  #mobileToolMount.tool-two-col-mode .tool-fields-grid,
  .style-row {
    grid-template-columns: 1fr;
  }
}
.card-side-badge { display: none !important; }
.back-map-actions {
  position: relative;
  z-index: 12;
  pointer-events: auto;
}
.nav-chooser {
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.card-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: inherit;
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
}

/* override app.css dashed box on card back */
.card-face-back .studio-back-preview,
#canvasBackPreview,
#modalBackPreview {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.card-face-back .studio-back-preview {
  display: block;
  margin: 6px auto 8px;
  padding: 0;
  border: 0;
  background: transparent !important;
  max-width: 94%;
  width: 100%;
  box-sizing: border-box;
  box-shadow: none;
}
.card-face-back .studio-back-preview h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
  font-weight: 800;
  background: transparent;
}
.card-face-back .studio-back-preview p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.85;
  white-space: pre-wrap;
  background: transparent;
}
.back-map-box {
  width: min(90%, 280px);
  height: 120px;
  max-height: 120px;
  min-height: 120px;
  margin: 6px auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  background: #e8eef5;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}
.back-map-box[hidden] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}
.back-map-box .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  max-height: 120px;
  font: inherit;
}
.back-map-actions[hidden],
.nav-chooser[hidden],
.studio-event-address[hidden],
.studio-event-meta[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
}
.studio-location-bar {
  max-width: min(100%, 430px);
}
.studio-location-bar[hidden] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.card-flip-wrap,
.card-flip-inner,
.card-frame {
  max-width: 100%;
}
.back-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 10px auto 4px;
  max-width: 94%;
}
.back-map-actions a,
.back-map-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.back-map-actions a:hover,
.back-map-actions button:hover {
  filter: brightness(1.08);
}
.nav-chooser {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  max-width: 94%;
}
.nav-chooser.open { display: flex; }
.nav-chooser a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
}
.flip-card-btn {
  margin-top: 12px;
}
.card-side-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 8;
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(33,24,61,.72);
  color: #fff;
  pointer-events: none;
}
.studio-event-address a.address-main {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Event date/time layout */
.studio-event-meta {
  display: flex;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin: 12px auto 6px;
  padding: 8px 14px;
  border: 1px solid currentColor;
  border-radius: 14px;
  font-size: .82rem;
  flex-wrap: wrap;
  max-width: 94%;
  line-height: 1.55;
  box-sizing: border-box;
}
.studio-event-meta.event-horizontal { flex-direction: row; flex-wrap: wrap; }
.studio-event-meta.event-vertical { flex-direction: column; gap: 4px; align-items: center; }
.studio-event-meta.event-stacked { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.studio-event-meta .event-date-line,
.studio-event-meta .event-time-line { display: inline-block; white-space: nowrap; }
.studio-event-meta small { opacity: .75; width: 100%; text-align: center; font-size: .7rem; }
.studio-event-meta.event-horizontal small { width: auto; flex-basis: 100%; }
.studio-event-address {
  max-width: 94%;
  margin: 5px auto;
  text-align: center;
  font-size: .75rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .studio { padding: 10px 8px 100px; }
  .studio-top { padding: 12px 14px; border-radius: 16px; }
  .card-canvas.orientation-portrait {
    width: min(100%, 340px);
    height: 460px;
    min-height: 460px;
    max-height: 460px;
    padding: 36px 20px;
  }
  .card-canvas.orientation-landscape {
    width: min(100%, 340px);
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    padding: 24px 18px;
  }
}
.texture-paper{background-image:linear-gradient(135deg,#ffffff30 25%,transparent 25%),linear-gradient(45deg,#00000008 25%,transparent 25%);background-size:9px 9px}.texture-linen{background-image:repeating-linear-gradient(0deg,#ffffff12 0 1px,transparent 1px 5px),repeating-linear-gradient(90deg,#0000000c 0 1px,transparent 1px 5px)}.texture-aurora{background-image:radial-gradient(circle at 18% 20%,#ffffff70,transparent 28%),linear-gradient(135deg,#caa9ff55,#87e7d955 50%,#ffb7d855)}.texture-bokeh{background-image:radial-gradient(circle at 18% 20%,#fff9 0 4px,transparent 5px),radial-gradient(circle at 78% 25%,#fff7 0 8px,transparent 9px),radial-gradient(circle at 45% 80%,#fff6 0 12px,transparent 13px);background-size:70px 70px,110px 110px,140px 140px}.texture-marble{background-image:linear-gradient(115deg,transparent 35%,#ffffff45 37%,transparent 39%),linear-gradient(25deg,transparent 60%,#0000000b 62%,transparent 64%)}.texture-sunset{background-image:linear-gradient(145deg,#ffb38c55,#ff86b055 45%,#8b70ee55)}.texture-watercolor{background-image:radial-gradient(ellipse at 20% 30%,#ff9fbd55,transparent 42%),radial-gradient(ellipse at 80% 70%,#8fdcff55,transparent 45%),radial-gradient(ellipse at 55% 45%,#ffe59a55,transparent 44%)}
/* Studio ads — keep aspect ratio, caption over image */
.studio-ads:empty,.studio-ad:empty{display:none!important}
.studio-ad{display:flex;flex-direction:column;gap:8px}
.studio-ad-item{position:relative;display:block;overflow:hidden;border-radius:14px;border:1px solid var(--line,#e8e2f1);background:#0f0a1a;text-decoration:none;color:#fff}
.studio-ad-media{display:block;width:100%;aspect-ratio:16/9;background:#1a1228}
.studio-ad-left .studio-ad-media,.studio-ad-right .studio-ad-media{aspect-ratio:3/4}
.studio-ad-media img{width:100%;height:100%;object-fit:cover;display:block}
.studio-ad-caption{position:absolute;inset:auto 0 0 0;padding:10px 12px;background:linear-gradient(transparent,rgba(10,6,20,.88));}
.studio-ad-caption strong{display:block;font-size:.85rem;font-weight:800}
.studio-ad-caption small{display:block;font-size:.72rem;opacity:.9;margin-top:2px;line-height:1.4}
.studio-ads-top,.studio-ads-bottom{max-width:720px;margin:0 auto 10px}
.studio-ads-left,.studio-ads-right{max-width:140px}.studio-ads-left .studio-ad-item,.studio-ads-right .studio-ad-item{max-height:280px}.studio-ad-media img{max-width:100%;max-height:100%}
@media(max-width:991px){.studio-ads-left,.studio-ads-right{max-width:100%}}

/* Diari SweetAlert — readable light theme */
.diari-swal-popup,
.swal2-popup {
  background: #ffffff !important;
  color: #1c1630 !important;
  border: 1px solid #e8e1f4 !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 50px rgba(74, 52, 134, .18) !important;
  font-family: Vazirmatn, Tahoma, sans-serif !important;
}
.diari-swal-title,
.swal2-title {
  color: #1c1630 !important;
  font-weight: 800 !important;
}
.diari-swal-html,
.swal2-html-container {
  color: #3a2f55 !important;
}
.swal2-icon.swal2-info { border-color: #7657e8 !important; color: #7657e8 !important; }
.swal2-icon.swal2-info .swal2-icon-content { color: #7657e8 !important; }
.diari-swal-confirm,
.swal2-confirm {
  background: #7657e8 !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(118,87,232,.28) !important;
}
.diari-swal-deny,
.swal2-deny {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}
.diari-swal-cancel,
.swal2-cancel {
  background: #fff !important;
  color: #4b3d69 !important;
  border: 1px solid #e8e1f4 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}
html[data-theme="dark"] .diari-swal-popup,
html[data-theme="dark"] .swal2-popup {
  background: #1c1828 !important;
  color: #f3eeff !important;
  border-color: #3d3554 !important;
}
html[data-theme="dark"] .diari-swal-title,
html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container {
  color: #f3eeff !important;
}


/* Jalali calendar modal grid */
.jalali-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
  direction: rtl;
}
.jalali-picker .dow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted, #6b6280);
  padding: 4px 0;
}
.jalali-picker .day {
  border: 1px solid var(--line, #e4dcf5);
  background: var(--surface, #fff);
  color: var(--ink, #1c1630);
  border-radius: 12px;
  min-height: 40px;
  font-weight: 700;
  cursor: pointer;
}
.jalali-picker .day:hover:not(.muted) {
  border-color: var(--primary, #7657e8);
  background: color-mix(in srgb, var(--primary, #7657e8) 12%, white);
}
.jalali-picker .day.active {
  background: var(--primary, #7657e8);
  color: #fff;
  border-color: transparent;
}
.jalali-picker .day.muted {
  opacity: 0.35;
  pointer-events: none;
}

/* Event map modal */
#eventMap, .event-map-box, #eventMapModal .modal-body #eventMap {
  width: 100%;
  height: 320px;
  min-height: 280px;
  border-radius: 16px;
  background: #e8e4ef;
  z-index: 1;
}
.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: Vazirmatn, Tahoma, sans-serif;
  z-index: 1;
}

/* Manager reports charts */
.chart-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  font-size: 0.84rem;
}
.chart-row .bar {
  height: 12px;
  background: var(--surface-2, #f3ecff);
  border-radius: 999px;
  overflow: hidden;
}
.chart-row .bar i,
.chart-row .bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #7657e8), var(--primary-2, #9b7cff));
  border-radius: 999px;
  min-width: 2px;
}
.manager-card .panel, section.panel {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e4dcf5);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow, 0 8px 24px rgba(90,60,180,.08));
}

/* Auth login cards readable in both themes */
.auth-card {
  background: var(--surface, #fff);
  color: var(--ink, #1c1630);
  border: 1px solid var(--line, #e4dcf5);
  border-radius: 24px;
  box-shadow: var(--shadow, 0 14px 40px rgba(90,60,180,.12));
}
.auth-layout .form-control {
  background: var(--input-bg, #fff);
  color: var(--ink, #1c1630);
}

/* Manager form pages */
.manager-shell .form-control,
.manager-shell .form-select,
.admin-shell .form-control,
.admin-shell .form-select {
  background: var(--input-bg, #fff) !important;
  color: var(--ink, #1c1630) !important;
  border-color: var(--line, #e4dcf5) !important;
}
.manager-shell .manager-card,
.manager-shell .admin-panel {
  background: var(--surface, #fff) !important;
  color: var(--ink, #1c1630) !important;
}

/* Ads preview thumbs */
.ad-preview-thumb {
  width: 72px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line, #e4dcf5);
  background: var(--surface-2, #f3ecff);
}

/* Map layer control Persian-friendly */
.leaflet-control-layers {
  font-family: Vazirmatn, Tahoma, sans-serif !important;
  border-radius: 12px !important;
  border: 1px solid var(--line, #e4dcf5) !important;
  box-shadow: var(--shadow-sm) !important;
}
.leaflet-control-layers-toggle { width: 36px !important; height: 36px !important; }
.leaflet-bar a {
  border-radius: 8px !important;
}
