/* ==========================================================================
   PHOTOBOTHNE™ — AIRY LIGHT EDITORIAL × 3D GLOSSY SVG STUDIO DESIGN SYSTEM
   Bản quyền độc quyền Nguyễn Thế Duy (© 2026) — 100% Pure SVG, Zero Emoji
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Baloo+2:wght@500;700;800&family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,700&family=Caveat:wght@500;700&family=Charm:wght@400;700&family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600;1,700&family=Dancing+Script:wght@500;700&family=JetBrains+Mono:wght@400;700&family=Lora:ital,wght@0,500;0,700;1,500;1,700&family=Mali:ital,wght@0,500;0,700;1,600&family=Merriweather:ital,wght@0,400;0,700;1,400&family=Montserrat:ital,wght@0,500;0,700;0,800;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,600;0,700;0,800;1,600&family=Oswald:wght@500;700&family=Pacifico&family=Patrick+Hand&family=Paytone+One&family=Phudu:wght@600;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Prata&family=Quicksand:wght@500;700&family=Space+Mono:wght@400;700&family=Sriracha&display=swap');

:root {
  --al-bg: #f4f6fb;
  --al-bg-pure: #ffffff;
  --al-bg-mist: radial-gradient(circle at 18% 8%, rgba(129, 140, 248, 0.15) 0%, transparent 44%),
                radial-gradient(circle at 84% 16%, rgba(192, 132, 252, 0.14) 0%, transparent 46%),
                radial-gradient(circle at 50% 85%, rgba(96, 165, 250, 0.12) 0%, transparent 50%),
                linear-gradient(180deg, #f7f9fe 0%, #eef2fb 100%);
  --al-card: rgba(255, 255, 255, 0.94);
  --al-card-solid: #ffffff;
  --al-border: rgba(15, 23, 42, 0.07);
  --al-border-strong: rgba(79, 70, 229, 0.22);

  --al-ink: #111827;
  --al-ink-soft: #334155;
  --al-muted: #64748b;
  --al-faint: #94a3b8;

  --al-indigo: #4f46e5;
  --al-indigo-dark: #3730a3;
  --al-navy: #13182b;

  --al-pill-blue-bg: #e8efff;  --al-pill-blue-fg: #3b5bfd;
  --al-pill-lilac-bg: #f1eaff; --al-pill-lilac-fg: #7c3aed;
  --al-pill-rose-bg: #ffe9f0;  --al-pill-rose-fg: #e11d62;
  --al-pill-peach-bg: #fff0e4; --al-pill-peach-fg: #ea580c;
  --al-pill-mint-bg: #e4faef;  --al-pill-mint-fg: #059669;

  --al-shadow-xs: 0 2px 10px rgba(15, 23, 42, 0.04);
  --al-shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --al-shadow-md: 0 22px 54px rgba(30, 41, 79, 0.09), 0 2px 8px rgba(15, 23, 42, 0.04);
  --al-shadow-lg: 0 32px 84px rgba(30, 41, 79, 0.14), 0 4px 16px rgba(15, 23, 42, 0.05);

  --al-font-sans: "Plus Jakarta Sans", "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  --al-font-body: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  --al-font-serif: "Cormorant Garamond", Georgia, serif;
  --al-font-mono: "Space Mono", monospace;
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  background: #f4f6fb;
  color-scheme: light;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #eef1f8; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

body.pb26-body {
  background: #f4f6fb;
  background-image: var(--al-bg-mist);
  background-attachment: fixed;
  color: var(--al-ink);
  font-family: var(--al-font-body);
  overflow-x: clip;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   3D GLOSSY TACTILE BUTTONS, ARROWS & TOGGLES (REDBY ART INSPIRED — PURE SVG)
   ========================================================================== */
.pb3d-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--al-font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, filter 0.14s ease;
  overflow: hidden;
}

.pb3d-btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 14px;
  right: 14px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54) 0%, rgba(255, 255, 255, 0.04) 100%);
  pointer-events: none;
}

.pb3d-btn::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 18px;
  width: 7px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transform: rotate(12deg);
  pointer-events: none;
}

.pb3d-btn svg, .pb3d-btn span { position: relative; z-index: 2; }
.pb3d-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.pb3d-emerald {
  background: linear-gradient(180deg, #64ee80 0%, #24c65e 58%, #169c49 100%);
  border-color: #137d3a;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(10, 82, 36, 0.45);
  box-shadow: 0 5px 0 #127838, 0 12px 24px rgba(22, 156, 73, 0.28), inset 0 2px 1px rgba(255, 255, 255, 0.55);
}
.pb3d-emerald:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 7px 0 #127838, 0 16px 30px rgba(22, 156, 73, 0.34), inset 0 2px 1px rgba(255, 255, 255, 0.6); }
.pb3d-emerald:active { transform: translateY(3px); box-shadow: 0 2px 0 #127838, 0 5px 12px rgba(22, 156, 73, 0.22); }

.pb3d-pink {
  background: linear-gradient(180deg, #ff8fd2 0%, #ee4ca8 56%, #c62782 100%);
  border-color: #9e1b66;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(120, 14, 74, 0.45);
  box-shadow: 0 5px 0 #9e1b66, 0 12px 26px rgba(238, 76, 168, 0.30), inset 0 2px 1px rgba(255, 255, 255, 0.55);
}
.pb3d-pink:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 7px 0 #9e1b66, 0 16px 32px rgba(238, 76, 168, 0.36), inset 0 2px 1px rgba(255, 255, 255, 0.6); }
.pb3d-pink:active { transform: translateY(3px); box-shadow: 0 2px 0 #9e1b66, 0 5px 12px rgba(238, 76, 168, 0.24); }

.pb3d-coral {
  background: linear-gradient(180deg, #ff9966 0%, #ef4f42 58%, #c72c24 100%);
  border-color: #9e1f19;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(120, 18, 14, 0.45);
  box-shadow: 0 5px 0 #9e1f19, 0 12px 24px rgba(239, 79, 66, 0.26), inset 0 2px 1px rgba(255, 255, 255, 0.55);
}
.pb3d-coral:hover { transform: translateY(-2px); filter: brightness(1.04); }
.pb3d-coral:active { transform: translateY(3px); box-shadow: 0 2px 0 #9e1f19; }

.pb3d-gold {
  background: linear-gradient(180deg, #ffe969 0%, #ffbe1a 58%, #e28d00 100%);
  border-color: #b86c00;
  color: #3d2200;
  box-shadow: 0 5px 0 #b86c00, 0 12px 24px rgba(255, 190, 26, 0.30), inset 0 2px 1px rgba(255, 255, 255, 0.72);
}
.pb3d-gold:hover { transform: translateY(-2px); filter: brightness(1.03); }
.pb3d-gold:active { transform: translateY(3px); box-shadow: 0 2px 0 #b86c00; }

.pb3d-indigo {
  background: linear-gradient(180deg, #7c83ff 0%, #5558f5 58%, #3c3dd1 100%);
  border-color: #2c2da8;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(28, 28, 120, 0.45);
  box-shadow: 0 5px 0 #2c2da8, 0 12px 26px rgba(85, 88, 245, 0.28), inset 0 2px 1px rgba(255, 255, 255, 0.5);
}
.pb3d-indigo:hover { transform: translateY(-2px); filter: brightness(1.04); }
.pb3d-indigo:active { transform: translateY(3px); box-shadow: 0 2px 0 #2c2da8; }

.pb3d-white {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5fb 100%);
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 4px 0 #cbd5e1, 0 10px 22px rgba(15, 23, 42, 0.06), inset 0 2px 1px #ffffff;
}
.pb3d-white:hover { transform: translateY(-2px); border-color: #94a3b8; }
.pb3d-white:active { transform: translateY(2px); box-shadow: 0 2px 0 #cbd5e1; }

.pb3d-btn:disabled { opacity: 0.46; cursor: not-allowed; transform: none !important; filter: grayscale(0.3); }

/* 3D Glossy Circular Icon Button */
.pb3d-circle {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
}
.pb3d-circle::before { top: 4px; left: 9px; right: 9px; height: 38%; }
.pb3d-circle::after { right: 11px; top: 7px; }

/* 3D Glossy Toggle Switch (Exact Image 2 Metallic Track + Green/Red Glossy Knob) */
.pb3d-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.pb3d-toggle-label { font-size: 0.82rem; font-weight: 600; color: var(--al-ink-soft); }
.pb3d-toggle {
  position: relative;
  width: 62px;
  height: 34px;
  border-radius: 999px;
  border: 2.5px solid #2d3e5e;
  background: linear-gradient(180deg, #324666 0%, #4d6488 100%);
  box-shadow: inset 0 3px 6px rgba(10, 18, 34, 0.55), 0 4px 0 #94a9c9, 0 7px 14px rgba(15, 23, 42, 0.14);
  padding: 0;
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
}
.pb3d-toggle::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  border: 1.5px solid rgba(191, 219, 254, 0.45);
  pointer-events: none;
}
.pb3d-toggle-knob {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff9966 0%, #ee4f42 58%, #c72c24 100%);
  border: 1.5px solid #9e1f19;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.65), 0 3px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}
.pb3d-toggle-knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  transform: rotate(-20deg);
}
.pb3d-toggle[aria-pressed="true"] .pb3d-toggle-knob,
.pb3d-toggle.on .pb3d-toggle-knob {
  transform: translateX(26px);
  background: linear-gradient(180deg, #6ef28a 0%, #24c65e 58%, #159444 100%);
  border-color: #117535;
}

/* ==========================================================================
   TOP AIRY NAVBAR (MINIMAL: CHỈ TRANG CHỦ + PHÒNG CHỤP + ALBUM DEMO)
   ========================================================================== */
.al-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(246, 248, 253, 0.84);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.al-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.al-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.al-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--al-shadow-xs);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.al-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.al-brand-title { display: flex; flex-direction: column; line-height: 1.12; }
.al-brand-name { font-family: var(--al-font-sans); font-size: 0.96rem; font-weight: 700; letter-spacing: -0.02em; color: var(--al-ink); }
.al-brand-name span { color: var(--al-indigo); }
.al-brand-sub { font-family: var(--al-font-mono); font-size: 0.60rem; font-weight: 700; color: var(--al-muted); letter-spacing: 0.04em; }

.al-nav-links { display: flex; align-items: center; gap: 6px; }
.al-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--al-ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.al-nav-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.al-nav-link:hover { background: rgba(79, 70, 229, 0.07); color: var(--al-indigo); }
.al-nav-link.active { background: #ffffff; color: var(--al-ink); font-weight: 700; box-shadow: var(--al-shadow-xs); }

.al-nav-dark-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--al-navy);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(19, 24, 43, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.al-nav-dark-pill:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(19, 24, 43, 0.24); }

/* ==========================================================================
   PASTEL TINTED PILLS (IMAGE 1 PANEL 4)
   ========================================================================== */
.al-pastel-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.al-pastel-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--al-font-body);
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.al-pastel-pill:hover { transform: translateY(-2px); }
.al-pastel-pill.blue  { background: var(--al-pill-blue-bg);  color: var(--al-pill-blue-fg); }
.al-pastel-pill.lilac { background: var(--al-pill-lilac-bg); color: var(--al-pill-lilac-fg); }
.al-pastel-pill.rose  { background: var(--al-pill-rose-bg);  color: var(--al-pill-rose-fg); }
.al-pastel-pill.peach { background: var(--al-pill-peach-bg); color: var(--al-pill-peach-fg); }
.al-pastel-pill.mint  { background: var(--al-pill-mint-bg);  color: var(--al-pill-mint-fg); }
.al-pastel-pill.active {
  border-color: currentColor;
  box-shadow: var(--al-shadow-sm);
  transform: translateY(-2px);
}

/* ==========================================================================
   3D PHOTO ALBUM FLIPBOOK COMPONENT (SHARED BY LANDING, STUDIO & ALBUM VIEWER)
   ========================================================================== */
.pb-book-stage {
  perspective: 1800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.pb-book-shell {
  position: relative;
  width: min(740px, 100%);
  aspect-ratio: 16 / 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.16), 0 6px 18px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transform-style: preserve-3d;
}

/* Center Book Spine Shadow */
.pb-book-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 34px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.12) 48%, rgba(15, 23, 42, 0.18) 50%, rgba(15, 23, 42, 0.08) 54%, rgba(15, 23, 42, 0) 100%);
  pointer-events: none;
  z-index: 6;
}

.pb-book-page {
  position: relative;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.pb-book-page.flipping-next {
  animation: bookFlipNext 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.pb-book-page.flipping-prev {
  animation: bookFlipPrev 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bookFlipNext {
  0%   { transform: rotateY(-18deg) scale(0.98); opacity: 0.7; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
@keyframes bookFlipPrev {
  0%   { transform: rotateY(18deg) scale(0.98); opacity: 0.7; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

/* Paper Textures */
.paper-cream  { background: #fdfaf3; }
.paper-grid   { background-color: #ffffff; background-image: linear-gradient(rgba(99,102,241,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.08) 1px, transparent 1px); background-size: 20px 20px; }
.paper-dots   { background-color: #fffafd; background-image: radial-gradient(rgba(225,29,98,0.16) 1.2px, transparent 1.2px); background-size: 16px 16px; }
.paper-studio { background: #ffffff; }

.pb-book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pb-book-counter {
  font-family: var(--al-font-mono);
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--al-ink-soft);
  background: #ffffff;
  border: 1px solid var(--al-border);
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: var(--al-shadow-xs);
}

/* ==========================================================================
   FREEFORM DRAG-DROP SCRAPBOOK CANVAS & CROP SHAPE MASKS (v2 BOOK ENGINE)
   ========================================================================== */
.sb-spread-canvas {
  position: relative;
  width: min(780px, 100%);
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  background: #fdfaf3;
  box-shadow: 0 28px 66px rgba(15, 23, 42, 0.14), 0 4px 14px rgba(15, 23, 42, 0.06);
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.sb-spread-canvas.drag-over {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 28px 66px rgba(15, 23, 42, 0.14);
}
.sb-spread-canvas::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 30px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.11) 48%, rgba(15, 23, 42, 0.16) 50%, rgba(15, 23, 42, 0.07) 54%, rgba(15, 23, 42, 0) 100%);
  pointer-events: none;
  z-index: 40;
}

.sb-item {
  position: absolute;
  transform-origin: center center;
  cursor: grab;
  touch-action: none;
}
.sb-item:active { cursor: grabbing; }
.sb-item.selected {
  outline: 2px solid #4f46e5;
  outline-offset: 4px;
  border-radius: 6px;
}

.sb-photo-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: block;
}
.sb-photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transform-origin: center center;
}

/* 6 Crop Shapes */
.sb-shape-rounded .sb-photo-inner {
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  border: 2px solid #ffffff;
}
.sb-shape-polaroid {
  background: #ffffff;
  padding: 7px 7px 26px 7px;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
}
.sb-shape-polaroid .sb-photo-inner { border-radius: 3px; flex: 1; min-height: 0; }
.sb-shape-circle .sb-photo-inner {
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}
.sb-shape-heart .sb-photo-inner {
  clip-path: url(#sb-heart-clip);
  -webkit-clip-path: url(#sb-heart-clip);
}
.sb-shape-heart { filter: drop-shadow(0 10px 18px rgba(225, 29, 98, 0.22)); }
.sb-shape-arch .sb-photo-inner {
  border-radius: 999px 999px 14px 14px;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}
.sb-shape-stamp {
  background: #ffffff;
  padding: 7px;
  border-radius: 4px;
  border: 2.5px dashed #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
}
.sb-shape-stamp .sb-photo-inner { border-radius: 2px; flex: 1; min-height: 0; }

/* 6 Additional Canva Photo Frames & Masks (12 Total) */
.sb-shape-polaroid-dark {
  background: #13182b;
  padding: 7px 7px 26px 7px;
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}
.sb-shape-polaroid-dark .sb-photo-inner { border-radius: 3px; flex: 1; min-height: 0; }

.sb-shape-polaroid-pink {
  background: linear-gradient(180deg, #fff1f5 0%, #ffe4ec 100%);
  padding: 7px 7px 26px 7px;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(225, 29, 98, 0.16);
  border: 1.5px solid #fbcfe8;
  display: flex;
  flex-direction: column;
}
.sb-shape-polaroid-pink .sb-photo-inner { border-radius: 4px; flex: 1; min-height: 0; }

.sb-shape-film35 {
  background: #11131a;
  padding: 14px 8px;
  border-radius: 5px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.26);
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,0.85) 8px 16px, transparent 16px 24px),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,0.85) 8px 16px, transparent 16px 24px);
  background-size: 100% 6px, 100% 6px;
  background-position: 0 4px, 0 calc(100% - 4px);
  background-repeat: no-repeat;
}
.sb-shape-film35 .sb-photo-inner { border-radius: 2px; flex: 1; min-height: 0; }

.sb-shape-star-mask .sb-photo-inner {
  clip-path: polygon(50% 2%, 63% 34%, 98% 36%, 70% 57%, 80% 94%, 50% 73%, 20% 94%, 30% 57%, 2% 36%, 37% 34%);
  -webkit-clip-path: polygon(50% 2%, 63% 34%, 98% 36%, 70% 57%, 80% 94%, 50% 73%, 20% 94%, 30% 57%, 2% 36%, 37% 34%);
}
.sb-shape-star-mask { filter: drop-shadow(0 10px 18px rgba(79, 70, 229, 0.22)); }

.sb-shape-flower-mask .sb-photo-inner {
  clip-path: url(#sb-flower-clip);
  -webkit-clip-path: url(#sb-flower-clip);
}
.sb-shape-flower-mask { filter: drop-shadow(0 10px 18px rgba(236, 72, 153, 0.22)); }

.sb-shape-ticket {
  background: #fffbeb;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2px dashed #f59e0b;
  box-shadow: 0 12px 24px rgba(180, 83, 9, 0.14);
  display: flex;
  flex-direction: column;
}
.sb-shape-ticket .sb-photo-inner { border-radius: 6px; flex: 1; min-height: 0; }

/* 4 Pro Additional Photo Frames (16 Total) */
.sb-shape-mac-window {
  background: #f8fafc;
  padding: 22px 6px 6px 6px;
  border-radius: 11px;
  border: 1.8px solid #1e293b;
  box-shadow: 4px 4px 0 rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
}
.sb-shape-mac-window::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 18px;
  background: linear-gradient(90deg, #e0e7ff 0%, #fce7f3 100%);
  border-bottom: 1.5px solid #1e293b;
  border-radius: 9px 9px 0 0;
  pointer-events: none;
}
.sb-shape-mac-window::after {
  content: "";
  position: absolute;
  top: 6px; left: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 10px 0 0 #f59e0b, 20px 0 0 #22c55e;
  pointer-events: none;
}
.sb-shape-mac-window .sb-photo-inner { border-radius: 4px; flex: 1; min-height: 0; border: 1px solid rgba(15,23,42,0.12); }

.sb-shape-torn-paper {
  background: #fffdf9;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  clip-path: polygon(0% 2%, 5% 0%, 11% 3%, 18% 0%, 25% 2%, 33% 0%, 40% 3%, 48% 0%, 56% 2%, 64% 0%, 72% 3%, 80% 0%, 88% 2%, 95% 0%, 100% 3%, 98% 12%, 100% 24%, 98% 38%, 100% 52%, 98% 66%, 100% 80%, 98% 92%, 100% 98%, 93% 100%, 86% 97%, 78% 100%, 70% 98%, 62% 100%, 54% 97%, 46% 100%, 38% 98%, 30% 100%, 22% 97%, 14% 100%, 6% 98%, 0% 100%, 2% 88%, 0% 74%, 2% 60%, 0% 44%, 2% 28%, 0% 14%);
  -webkit-clip-path: polygon(0% 2%, 5% 0%, 11% 3%, 18% 0%, 25% 2%, 33% 0%, 40% 3%, 48% 0%, 56% 2%, 64% 0%, 72% 3%, 80% 0%, 88% 2%, 95% 0%, 100% 3%, 98% 12%, 100% 24%, 98% 38%, 100% 52%, 98% 66%, 100% 80%, 98% 92%, 100% 98%, 93% 100%, 86% 97%, 78% 100%, 70% 98%, 62% 100%, 54% 97%, 46% 100%, 38% 98%, 30% 100%, 22% 97%, 14% 100%, 6% 98%, 0% 100%, 2% 88%, 0% 74%, 2% 60%, 0% 44%, 2% 28%, 0% 14%);
  display: flex;
  flex-direction: column;
}
.sb-shape-torn-paper .sb-photo-inner { flex: 1; min-height: 0; border-radius: 2px; }

.sb-shape-glass-card {
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.16), inset 0 1px 0 rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
}
.sb-shape-glass-card .sb-photo-inner { border-radius: 12px; flex: 1; min-height: 0; }

.sb-shape-vinyl-disc .sb-photo-inner {
  border-radius: 50%;
  border: 4px solid #13182b;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28), 0 0 0 2px rgba(255,255,255,0.8);
}
.sb-shape-vinyl-disc .sb-photo-inner::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22%; height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 34%, #13182b 35% 58%, rgba(255,255,255,0.85) 59% 100%);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
  pointer-events: none;
}

/* Handwritten Polaroid Caption Chin */
.sb-polaroid-cap {
  position: absolute;
  left: 6px; right: 6px; bottom: 3px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Caveat", "Dancing Script", cursive;
  font-size: clamp(0.68rem, 1.15vw, 0.94rem);
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  letter-spacing: 0.01em;
}
.sb-shape-polaroid-dark .sb-polaroid-cap { color: #f8fafc; }
.sb-shape-polaroid-pink .sb-polaroid-cap { color: #be185d; }

/* Swap photo drag target indicator */
.sb-item.swap-target {
  outline: 3px dashed #ec4899 !important;
  outline-offset: 4px;
  filter: brightness(1.06);
}
.sb-item.swap-target::before {
  content: "Thả để đổi ảnh";
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 70, 229, 0.65);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 8px;
  pointer-events: none;
}

/* 6 Multi-Format Canvas Modes (Book Spread, A4 Portrait/Landscape, Story 9:16, Square 1:1, Postcard 3:2) */
.sb-spread-canvas.fmt-book     { aspect-ratio: 16 / 10; max-width: 940px; }
.sb-spread-canvas.fmt-a4-v     { aspect-ratio: 210 / 297; max-width: 520px; border-radius: 10px; }
.sb-spread-canvas.fmt-a4-h     { aspect-ratio: 297 / 210; max-width: 880px; border-radius: 10px; }
.sb-spread-canvas.fmt-story    { aspect-ratio: 9 / 16; max-width: 390px; border-radius: 22px; }
.sb-spread-canvas.fmt-square   { aspect-ratio: 1 / 1; max-width: 620px; border-radius: 14px; }
.sb-spread-canvas.fmt-postcard { aspect-ratio: 3 / 2; max-width: 860px; border-radius: 12px; }

.sb-spread-canvas.fmt-a4-v::after,
.sb-spread-canvas.fmt-a4-h::after,
.sb-spread-canvas.fmt-story::after,
.sb-spread-canvas.fmt-square::after,
.sb-spread-canvas.fmt-postcard::after {
  display: none;
}

/* 8 Whole-Page Decorative Frame Overlays */
.sb-page-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 42;
}
.pf-editorial::before {
  content: ""; position: absolute; inset: 12px;
  border: 1.5px solid rgba(17, 24, 39, 0.35);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.4), inset 0 0 0 5.5px rgba(17, 24, 39, 0.22);
  border-radius: 6px;
}
.pf-gold::before {
  content: ""; position: absolute; inset: 12px;
  border: 2.5px solid #d97706;
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6.5px rgba(245, 158, 11, 0.55);
  border-radius: 8px;
}
.pf-dashed::before {
  content: ""; position: absolute; inset: 14px;
  border: 2.5px dashed rgba(79, 70, 229, 0.45);
  border-radius: 12px;
}
.pf-film::before {
  content: ""; position: absolute; inset: 0;
  border-top: 16px solid #13182b; border-bottom: 16px solid #13182b;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255,255,255,0.8) 14px 26px, transparent 26px 40px),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255,255,255,0.8) 14px 26px, transparent 26px 40px);
  background-size: 100% 8px, 100% 8px;
  background-position: 0 -12px, 0 calc(100% + 12px);
  background-repeat: no-repeat;
}
.pf-pastel::before {
  content: ""; position: absolute; inset: 10px;
  border: 5px solid rgba(244, 114, 182, 0.38);
  box-shadow: inset 0 0 0 2px #f472b6;
  border-radius: 14px;
}
.pf-gallery::before {
  content: ""; position: absolute; inset: 0;
  border: 18px solid rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
}
.pf-y2k::before {
  content: ""; position: absolute; inset: 11px;
  border: 3px solid #4f46e5;
  box-shadow: 4px 4px 0 rgba(236, 72, 153, 0.45);
  border-radius: 14px;
}
.pf-polaroid-corner::before,
.pf-polaroid-corner::after {
  content: ""; position: absolute; inset: 14px;
  background:
    linear-gradient(135deg, #d97706 0 18px, transparent 18px) top left / 30px 30px no-repeat,
    linear-gradient(-135deg, #d97706 0 18px, transparent 18px) top right / 30px 30px no-repeat,
    linear-gradient(45deg, #d97706 0 18px, transparent 18px) bottom left / 30px 30px no-repeat,
    linear-gradient(-45deg, #d97706 0 18px, transparent 18px) bottom right / 30px 30px no-repeat;
}
.pf-notebook::before {
  content: ""; position: absolute;
  top: 0; bottom: 0; left: 50%; width: 22px; transform: translateX(-50%);
  background-image: radial-gradient(circle at center, #334155 0 4.5px, #cbd5e1 5px 7px, transparent 7.5px);
  background-size: 22px 26px;
  background-repeat: repeat-y;
}
.sb-spread-canvas:not(.fmt-book) .pf-notebook::before {
  left: 16px; transform: none;
}

.sb-text-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--al-font-serif);
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 10px;
  word-break: break-word;
  pointer-events: none;
}
.sb-text-box.editing {
  pointer-events: auto;
  cursor: text;
  outline: 2px dashed #4f46e5;
  background: rgba(255, 255, 255, 0.92) !important;
  border-radius: 10px;
}
.sb-te-stroke {
  text-shadow:
    -2px -2px 0 #ffffff, 2px -2px 0 #ffffff, -2px 2px 0 #ffffff, 2px 2px 0 #ffffff,
    0 -2px 0 #ffffff, 0 2px 0 #ffffff, -2px 0 0 #ffffff, 2px 0 0 #ffffff,
    0 4px 10px rgba(15, 23, 42, 0.22);
}
.sb-te-shadow {
  text-shadow: 0 4px 12px rgba(15, 23, 42, 0.34);
}
.sb-te-neon {
  text-shadow: 0 0 8px rgba(255,255,255,0.9), 0 0 18px currentColor, 0 0 32px currentColor;
}
.sb-te-lift {
  text-shadow: 3px 3px 0 rgba(79, 70, 229, 0.35);
}
.sb-te-comic {
  text-shadow:
    -2px -2px 0 #111827, 2px -2px 0 #111827, -2px 2px 0 #111827, 2px 2px 0 #111827,
    3px 4px 0 #111827;
}
.sb-te-hollow {
  -webkit-text-stroke: 1.8px currentColor;
  color: transparent !important;
}

.sb-sticker-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.sb-sticker-box svg { width: 100%; height: 100%; }

/* Canva Pro 4-Corner Handles + Rotate + Floating Quick Action Pill */
.sb-handle {
  position: absolute;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #4f46e5;
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  transition: transform 0.12s ease, background 0.12s ease;
}
.sb-handle:hover { transform: scale(1.18); background: #4f46e5; color: #ffffff; }
.sb-item.selected .sb-handle { display: flex; }
.sb-handle-resize,
.sb-handle-se { width: 14px; height: 14px; right: -7px; bottom: -7px; cursor: nwse-resize; }
.sb-handle-nw { width: 14px; height: 14px; left: -7px; top: -7px; cursor: nwse-resize; }
.sb-handle-ne { width: 14px; height: 14px; right: -7px; top: -7px; cursor: nesw-resize; }
.sb-handle-sw { width: 14px; height: 14px; left: -7px; bottom: -7px; cursor: nesw-resize; }

.sb-handle-rotate {
  width: 26px;
  height: 26px;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  border: 1.8px solid rgba(79, 70, 229, 0.35);
  background: #ffffff;
  color: #4f46e5;
  cursor: grab;
}
.sb-handle-rotate:hover { transform: translateX(-50%) scale(1.12); background: #4f46e5; color: #ffffff; }

.sb-float-bar {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: none;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(19, 24, 43, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.26);
  white-space: nowrap;
}
.sb-item.selected .sb-float-bar { display: inline-flex; }
.sb-float-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.sb-float-btn:hover { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.sb-float-btn.danger:hover { background: #ef4444; color: #ffffff; }
.sb-float-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.3; }

.sb-item.locked .sb-handle { display: none !important; }
.cv-popover { width: 316px !important; max-height: 70vh; overflow-y: auto; scrollbar-width: thin; }

/* Canva-style Photo Adjust Popover Sections */
.cv-pop-section {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--al-border);
}
.cv-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.70rem;
  font-weight: 800;
  color: var(--al-indigo);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}

.sb-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 18px;
  background: #f8fafd;
  border: 1.5px dashed rgba(79, 70, 229, 0.24);
  margin-top: 14px;
}
.sb-dock-item {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  box-shadow: var(--al-shadow-xs);
  overflow: hidden;
  cursor: grab;
  position: relative;
  background: #ffffff;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.sb-dock-item:hover { transform: translateY(-3px) scale(1.04); border-color: #4f46e5; }
.sb-dock-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sb-dock-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
  padding: 1px 0;
}

.sb-inspector {
  background: #f7f9fd;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

/* Additional Paper Textures (10 Total) */
.paper-kraft    { background: linear-gradient(145deg, #f3e6d3 0%, #ead7bd 100%); }
.paper-sky      { background: linear-gradient(145deg, #eef6ff 0%, #f5f3ff 100%); }
.paper-blush    { background: linear-gradient(145deg, #fff1f5 0%, #ffe4ec 100%); }
.paper-matcha   { background: linear-gradient(145deg, #eefaf2 0%, #dcfce7 100%); }
.paper-lavender { background: linear-gradient(145deg, #f5f0ff 0%, #ede9fe 100%); }
.paper-noir     { background: linear-gradient(145deg, #13182b 0%, #1e2540 100%); color: #f8fafc; }
.paper-sunset   { background: linear-gradient(135deg, #fff1eb 0%, #ffd6e0 50%, #e0e7ff 100%); }
.paper-holo     { background: linear-gradient(125deg, #e0e7ff 0%, #fce7f3 48%, #dcfce7 100%); }
.paper-gingham  {
  background-color: #fff5f8;
  background-image:
    linear-gradient(90deg, rgba(244, 114, 182, 0.12) 50%, transparent 50%),
    linear-gradient(rgba(244, 114, 182, 0.12) 50%, transparent 50%);
  background-size: 26px 26px;
}
.paper-starry   {
  background-color: #0f172a;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 22%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.2px 1.2px at 42% 16%, rgba(253,224,71,0.8), transparent),
    radial-gradient(1.8px 1.8px at 78% 28%, rgba(199,210,254,0.9), transparent),
    radial-gradient(1.4px 1.4px at 26% 74%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.6px 1.6px at 66% 80%, rgba(244,114,182,0.8), transparent),
    radial-gradient(1.3px 1.3px at 88% 62%, rgba(255,255,255,0.75), transparent),
    linear-gradient(155deg, #0f172a 0%, #1e1b4b 58%, #312e81 100%);
  color: #f8fafc;
}

/* Vector Doodle Layer on Album Pages */
.sb-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 44;
  pointer-events: none;
  overflow: visible;
}
.sb-draw-svg.drawing-active {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

/* Floating Drag/Rotate/Resize HUD Pill */
.cv-drag-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 75;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-family: var(--al-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
  display: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}
.cv-drag-hud.on { display: inline-flex; align-items: center; gap: 6px; }

/* Magic Theme Packs Grid */
.cv-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.cv-theme-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 13px;
  border: 1.5px solid var(--al-border);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}
.cv-theme-card:hover {
  border-color: var(--al-indigo);
  transform: translateY(-1px);
  box-shadow: var(--al-shadow-xs);
}
.cv-theme-swatch {
  width: 100%;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.cv-theme-name { font-size: 0.72rem; font-weight: 800; color: var(--al-ink); line-height: 1.15; }
.cv-theme-desc { font-size: 0.63rem; color: var(--al-muted); line-height: 1.2; }

/* Export Dropdown Menu */
.cv-export-wrap { position: relative; display: inline-flex; }
.cv-export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 95;
  width: 248px;
  background: #ffffff;
  border: 1px solid var(--al-border);
  border-radius: 16px;
  padding: 7px;
  box-shadow: var(--al-shadow-lg);
  display: none;
  flex-direction: column;
  gap: 3px;
}
.cv-export-menu.open { display: flex; }
.cv-export-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--al-ink);
  font-family: var(--al-font-body);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.cv-export-item:hover { background: #eef2ff; color: var(--al-indigo); }
.cv-export-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.1; flex-shrink: 0; }
.cv-export-sub { display: block; font-size: 0.65rem; font-weight: 600; color: var(--al-muted); }

/* Color Picker Dot */
.cv-color-native {
  width: 24px; height: 24px;
  padding: 0; border: 2px solid rgba(15, 23, 42, 0.18);
  border-radius: 50%; cursor: pointer; background: none; overflow: hidden;
}
.cv-color-native::-webkit-color-swatch-wrapper { padding: 0; }
.cv-color-native::-webkit-color-swatch { border: none; border-radius: 50%; }

/* ==========================================================================
   REALISTIC 3D FLIPBOOK MODAL & VIEWER ANIMATIONS
   ========================================================================== */
.fb3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 96000;
  background: radial-gradient(circle at 50% 25%, #1e293b 0%, #0b1020 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 22px;
  color: #f8fafc;
}
.fb3d-overlay.open { display: flex; }
.fb3d-header {
  width: min(1080px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.fb3d-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2200px;
  padding: 12px 0;
}
.fb3d-book-wrap {
  position: relative;
  width: min(920px, 94vw);
  display: flex;
  justify-content: center;
  transform-style: preserve-3d;
}
.fb3d-book-wrap .sb-spread-canvas {
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 6px 0 rgba(255, 255, 255, 0.72),
    0 11px 0 rgba(226, 232, 240, 0.58),
    0 16px 0 rgba(203, 213, 225, 0.45);
  transition: transform 0.35s ease;
}
.sb-spread-canvas.fb3d-flip-next {
  animation: fb3dTurnNext 0.52s cubic-bezier(0.22, 0.85, 0.32, 1);
}
.sb-spread-canvas.fb3d-flip-prev {
  animation: fb3dTurnPrev 0.52s cubic-bezier(0.22, 0.85, 0.32, 1);
}
@keyframes fb3dTurnNext {
  0%   { transform: rotateY(14deg) scale(0.96); filter: brightness(0.92); }
  45%  { transform: rotateY(-5deg) scale(1.01); filter: brightness(1.03); }
  100% { transform: rotateY(0deg) scale(1); filter: brightness(1); }
}
@keyframes fb3dTurnPrev {
  0%   { transform: rotateY(-14deg) scale(0.96); filter: brightness(0.92); }
  45%  { transform: rotateY(5deg) scale(1.01); filter: brightness(1.03); }
  100% { transform: rotateY(0deg) scale(1); filter: brightness(1); }
}
.fb3d-nav-zone {
  position: absolute;
  top: 0; bottom: 0; width: 16%;
  z-index: 55;
  cursor: pointer;
}
.fb3d-nav-zone.left { left: 0; }
.fb3d-nav-zone.right { right: 0; }
.fb3d-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fb3d-pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.fb3d-pill:hover, .fb3d-pill.active {
  background: #4f46e5;
  border-color: #818cf8;
}
.fb3d-counter {
  font-family: var(--al-font-mono);
  font-size: 0.80rem;
  font-weight: 700;
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   FULL-WIDTH SPACIOUS CANVA-STYLE STUDIO WORKSPACE (STEP 3)
   ========================================================================== */
.cam-page.canva-expanded {
  max-width: 100% !important;
  padding: 78px 16px 24px !important;
}

.cv-shell {
  display: grid;
  grid-template-columns: 64px 276px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--al-border);
  border-radius: 26px;
  box-shadow: var(--al-shadow-lg);
  overflow: hidden;
  height: calc(100vh - 152px);
  min-height: 680px;
  max-height: 940px;
  transition: grid-template-columns 0.2s ease;
}
.cv-shell.drawer-collapsed {
  grid-template-columns: 64px 0px minmax(0, 1fr);
}
.cv-shell.drawer-collapsed .cv-drawer {
  padding: 0;
  border-right: none;
  overflow: hidden;
}
@media (max-width: 1360px) and (min-width: 1081px) {
  .cv-shell { grid-template-columns: 60px 248px minmax(0, 1fr); }
  .cv-shell.drawer-collapsed { grid-template-columns: 60px 0px minmax(0, 1fr); }
}

/* Left Icon Rail */
.cv-rail {
  grid-column: 1;
  grid-row: 1 / 4;
  background: #f8fafd;
  border-right: 1px solid var(--al-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 5px;
  gap: 5px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cv-rail-btn {
  width: 54px;
  padding: 7px 3px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--al-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.60rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}
.cv-rail-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.cv-rail-btn:hover { background: #eef2ff; color: var(--al-indigo); }
.cv-rail-btn.active {
  background: #ffffff;
  color: var(--al-indigo);
  border-color: rgba(79, 70, 229, 0.22);
  box-shadow: var(--al-shadow-xs);
}

/* Left Drawer */
.cv-drawer {
  grid-column: 2;
  grid-row: 1 / 4;
  min-height: 0;
  background: #ffffff;
  border-right: 1px solid var(--al-border);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cv-drawer-pane { display: none; flex-direction: column; gap: 12px; }
.cv-drawer-pane.active { display: flex; }

.cv-drawer-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--al-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cv-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cv-photo-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #f1f5f9;
  cursor: grab;
  background: #f8fafd;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.cv-photo-card:hover { transform: translateY(-2px); border-color: var(--al-indigo); }
.cv-photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cv-photo-card span {
  position: absolute; bottom: 4px; left: 4px; background: rgba(17,24,39,0.78);
  color: #fff; font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
}

.cv-tpl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cv-tpl-btn {
  padding: 10px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--al-border);
  background: #f8fafd;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--al-ink-soft);
  transition: all 0.16s ease;
}
.cv-tpl-btn:hover, .cv-tpl-btn.active { border-color: var(--al-indigo); background: #eef2ff; color: var(--al-indigo); }
.cv-tpl-mini {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  padding: 5px;
  display: grid;
  gap: 4px;
}
.cv-tpl-cell { background: linear-gradient(135deg, #dbeafe, #ede9fe); border-radius: 3px; }

/* Top Contextual Canva Toolbar */
.cv-topbar {
  grid-column: 3;
  grid-row: 1;
  background: #ffffff;
  border-bottom: 1px solid var(--al-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 58px;
}
.cv-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cv-sep { width: 1px; height: 22px; background: var(--al-border); margin: 0 4px; }

.cv-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--al-border);
  background: #f8fafd;
  color: var(--al-ink-soft);
  font-family: var(--al-font-body);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.cv-chip-btn:hover { border-color: var(--al-indigo); color: var(--al-indigo); background: #ffffff; }
.cv-chip-btn.active { background: var(--al-indigo); color: #ffffff; border-color: var(--al-indigo); }
.cv-chip-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.cv-chip-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.1; }

/* Giant Breathing Center Stage */
.cv-stage-area {
  grid-column: 3;
  grid-row: 2;
  min-height: 0;
  background-color: #edf1f9;
  background-image: radial-gradient(rgba(79, 70, 229, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 32px;
  overflow: auto;
  position: relative;
}

.cv-canvas-zoom-wrap {
  width: min(940px, 100%);
  margin: auto;
  transform-origin: top center;
  transition: transform 0.18s ease;
  display: flex;
  justify-content: center;
}
.cv-canvas-zoom-wrap .sb-spread-canvas {
  width: 100%;
  max-width: 940px;
}

/* Magnetic Snap Guidelines */
.cv-snap-v, .cv-snap-h {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  display: none;
}
.cv-snap-v { top: 0; bottom: 0; width: 1.5px; background: #ec4899; }
.cv-snap-h { left: 0; right: 0; height: 1.5px; background: #ec4899; }
.cv-snap-v.on, .cv-snap-h.on { display: block; }

/* Bottom Canva Page Filmstrip Bar */
.cv-bottombar {
  grid-column: 3;
  grid-row: 3;
  background: #ffffff;
  border-top: 1px solid var(--al-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cv-pages-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}
.cv-page-thumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--al-border);
  background: #f8fafd;
  color: var(--al-ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cv-page-thumb.active {
  border-color: var(--al-indigo);
  background: #eef2ff;
  color: var(--al-indigo);
  box-shadow: var(--al-shadow-xs);
}

/* Layer List Row */
.cv-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--al-border);
  background: #f8fafd;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--al-ink);
  cursor: pointer;
}
.cv-layer-row.active { border-color: var(--al-indigo); background: #eef2ff; color: var(--al-indigo); }

/* Share Link Modal */
.cv-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 95000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cv-modal-bg.open { display: flex; }
.cv-modal-card {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--al-shadow-lg);
  border: 1px solid var(--al-border);
}

@media (max-width: 1080px) {
  .cv-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    height: auto;
    min-height: auto;
    max-height: none;
  }
  .cv-rail {
    grid-column: 1; grid-row: 4;
    flex-direction: row; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-right: none; border-top: 1px solid var(--al-border);
    padding: 8px 10px;
    gap: 6px;
  }
  #cv-btn-collapse { display: none !important; }
  .cv-drawer {
    grid-column: 1; grid-row: 5;
    border-right: none; border-top: 1px solid var(--al-border);
    max-height: 340px;
  }
  .cv-topbar { grid-column: 1; grid-row: 1; }
  .cv-stage-area { grid-column: 1; grid-row: 2; padding: 16px 12px; min-height: 300px; }
  .cv-bottombar { grid-column: 1; grid-row: 3; }
}

/* ==========================================================================
   CLEAN BRIGHT FOOTER
   ========================================================================== */
footer.al-footer {
  margin-top: 76px;
  padding: 40px 24px 52px;
  background: #ffffff;
  border-top: 1px solid var(--al-border);
  color: var(--al-muted);
  text-align: center;
}
footer.al-footer .al-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
footer.al-footer .al-footer-brand { font-family: var(--al-font-sans); font-size: 1.05rem; font-weight: 700; color: var(--al-ink); }
footer.al-footer .al-footer-brand span { color: var(--al-indigo); }
footer.al-footer .al-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
footer.al-footer .al-footer-links a { color: var(--al-muted); text-decoration: none; font-size: 0.84rem; font-weight: 600; }
footer.al-footer .al-footer-links a:hover { color: var(--al-indigo); }

/* ==========================================================================
   RESPONSIVE SHARED
   ========================================================================== */
@media (max-width: 960px) {
  .al-nav-links { display: none; }
}
@media (max-width: 640px) {
  .al-nav-inner { height: 60px; padding: 0 14px; }
  .al-brand-name { font-size: 0.86rem; }
  .al-brand-sub { font-size: 0.56rem; }
  .al-nav-dark-pill { padding: 8px 13px; font-size: 0.76rem; }
  .pb-book-shell { aspect-ratio: auto; grid-template-columns: 1fr; }
  .pb-book-shell::after { display: none; }
  .pb-book-page { min-height: 290px; padding: 18px; }
}

/* ==========================================================================
   2026.5 STUDIO DELIGHT: SOFTBOX SÁNG MẶT, FAVORITE ❤️ FRAMES, CANVA 3x3 GRID
   ========================================================================== */
#cam-softbox-frame {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  box-shadow:
    inset 0 0 0 28px var(--softbox-col, rgba(255, 255, 255, 0.96)),
    inset 0 0 90px 26px var(--softbox-col, rgba(255, 255, 255, 0.92)),
    inset 0 0 180px 44px var(--softbox-col, rgba(255, 255, 255, 0.55));
}
#cam-softbox-frame.on {
  opacity: 1;
}
@media (max-width: 640px) {
  #cam-softbox-frame {
    box-shadow:
      inset 0 0 0 18px var(--softbox-col, rgba(255, 255, 255, 0.96)),
      inset 0 0 56px 18px var(--softbox-col, rgba(255, 255, 255, 0.9)),
      inset 0 0 110px 28px var(--softbox-col, rgba(255, 255, 255, 0.52));
  }
}

.export-frame-tile {
  position: relative;
}
.frame-fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.frame-fav-btn:hover {
  transform: scale(1.12);
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.35);
}
.frame-fav-btn.on {
  color: #e11d48;
  background: #fff1f2;
  border-color: #fda4af;
}

.sb-spread-canvas.cv-grid-on::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent calc(33.333% - 0.5px), rgba(79, 70, 229, 0.32) 33.333%, transparent calc(33.333% + 1px), transparent calc(50% - 0.5px), rgba(236, 72, 153, 0.28) 50%, transparent calc(50% + 1px), transparent calc(66.666% - 0.5px), rgba(79, 70, 229, 0.32) 66.666%, transparent calc(66.666% + 1px)),
    linear-gradient(to bottom, transparent calc(33.333% - 0.5px), rgba(79, 70, 229, 0.32) 33.333%, transparent calc(33.333% + 1px), transparent calc(50% - 0.5px), rgba(236, 72, 153, 0.28) 50%, transparent calc(50% + 1px), transparent calc(66.666% - 0.5px), rgba(79, 70, 229, 0.32) 66.666%, transparent calc(66.666% + 1px));
}
.cv-btn.on,
.cv-btn.active,
.cv-chip-btn.on,
.cv-chip-btn.active {
  background: #eef2ff;
  color: #4f46e5;
  border-color: rgba(79, 70, 229, 0.38);
}
