/* =========================================================
   Kartazine — Aesthetic Instagram Studio Styles
   Templates, Shape Masks, Cutout Studio, Cute GIFs & Clean Mobile UX
   ========================================================= */

:root {
  /* Kartazine Brand Tokens (Neo-Pulp Swiss × Tactile Riso) */
  --paper-pulp: #F4EFE6;
  --paper-sand: #EAE4D6;
  --ink-carbon: #16161A;
  --riso-coral: #FF4565;
  --riso-cobalt: #1E56D0;
  --riso-sun: #F6DA36;
  --riso-mint: #42C790;
  --riso-violet: #7839EE;

  --ink-blue: #6f8fd6;
  --ink-salmon: #f1907e;
  --ink-green: #4fbf91;
  --ink-yellow: #f2dc3a;
  --ink-black: #141414;
  --paper: #f1efe9;
  --studio-bg: #101113;
  --studio-line: #2a2b2f;
  --font-display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --bg-dark: var(--studio-bg);
  --bg-card: #17181b;
  --bg-card-hover: #1f2024;
  --bg-card-border: var(--studio-line);
  --accent-primary: var(--ink-yellow);
  --accent-primary-hover: #f6e56a;
  --accent-pink: #f43f5e;
  --accent-cyan: var(--ink-yellow);
  --accent-emerald: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --seam-guide: rgba(244, 63, 94, 0.85);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-dark);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* =========================================================
   MINIMALIST INSTAGRAM TOPBAR (Screenshot 2)
   ========================================================= */
.topbar {
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 50;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.format-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.format-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.format-pill .pill-dot {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.6rem;
}

.phone-format-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1efe9;
  font-family: 'Archivo', 'Arial Narrow', sans-serif;
  font-stretch: 70%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.phone-format-pill:hover,
.phone-format-pill:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

@media (min-width: 900px) {
  .phone-format-pill {
    display: none;
  }
}

/* Format Sheet Chooser */
.format-sheet-card {
  max-width: 440px;
  width: 90%;
}

.format-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0 8px;
}

.format-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.format-card:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.format-card.selected, .format-card.active {
  border-color: var(--ink-yellow);
  background: var(--ink-yellow);
  color: var(--ink-black);
}

.format-card.selected .format-card-ratio, .format-card.active .format-card-ratio {
  color: rgba(20, 20, 20, 0.7);
}

.format-card:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.format-card-preview {
  border: 1.5px dashed var(--border-medium);
  border-radius: 4px;
  margin-bottom: 10px;
}

.format-card.selected .format-card-preview, .format-card.active .format-card-preview {
  border-color: var(--ink-black);
}

.format-preview-carousel {
  width: 48px;
  height: 24px;
  background: linear-gradient(to right, transparent 31%, var(--border-medium) 31%, var(--border-medium) 35%, transparent 35%, transparent 65%, var(--border-medium) 65%, var(--border-medium) 69%, transparent 69%);
}

.format-preview-post {
  width: 24px;
  height: 30px;
}

.format-preview-story {
  width: 20px;
  height: 35px;
}

.format-card-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.format-card-ratio {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.anim-sheet-card {
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.anim-options {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 18px 0 8px;
}

.anim-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: center;
}

.anim-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.anim-card-preview {
  width: 96px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #2a2825;
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anim-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.anim-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-icon-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.topbar-icon-btn:not(:disabled):active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.92);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink-yellow);
  color: white;
  box-shadow: 0 3px 8px rgba(242, 220, 58, 0.35);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-secondary {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-secondary:active {
  background: #252d42;
  transform: scale(0.96);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 12px 18px;
  font-size: 0.92rem;
}

/* =========================================================
   WORKBENCH & PANORAMA STRIP
   ========================================================= */
.workbench {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  background: #05070a;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.canvas-scroll-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 20px 8px 20px;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Backdrop & Panorama Control Bar (Directly below canvas) */
.backdrop-control-bar {
  display: flex;
  align-items: center;
  background: rgba(13, 17, 26, 0.95);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 5px 10px;
  gap: 8px;
  z-index: 30;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
}

.bcb-section {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bcb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.bcb-btn.primary {
  background: rgba(242, 220, 58, 0.15);
  border: 1px solid rgba(242, 220, 58, 0.35);
  color: var(--ink-yellow);
}

.bcb-btn.primary:active {
  background: var(--ink-yellow);
  color: #000;
}

.bcb-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.bcb-btn.secondary:active {
  background: rgba(255, 255, 255, 0.2);
}

.bcb-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.bcb-divider {
  width: 1px;
  height: 18px;
  background: var(--border-light);
  flex-shrink: 0;
}

.bcb-colors-container {
  display: flex;
  align-items: center;
  overflow: hidden;
  flex: 1;
}

.bcb-colors-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}

.bcb-colors-scroll::-webkit-scrollbar {
  display: none;
}

.bcb-color-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bcb-color-circle:active,
.bcb-color-circle.active {
  transform: scale(1.15);
  border-color: #ffffff;
}

.panorama-strip {
  position: relative;
  display: flex;
  margin: auto;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  background: #0d111a;
  overflow: visible;
}

.panorama-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  border-radius: 12px;
  overflow: hidden;
}

.panorama-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.panorama-texture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  pointer-events: none;
  z-index: 15;
  mix-blend-mode: multiply;
  transition: opacity 0.25s ease;
}

.phone-texture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
  mix-blend-mode: multiply;
}

.color-wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.inline-color-wheel-input {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  z-index: 10;
  -webkit-appearance: none;
  appearance: none;
}


.slides-container {
  display: flex;
  position: relative;
  z-index: 10;
}

/* Slide Cards */
.slide-card {
  position: relative;
  width: 250px;
  height: 312.5px; /* 4:5 simulated scale */
  background: transparent;
  border-right: 2px dashed var(--seam-guide);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.slide-card:last-child {
  border-right: none;
}

.slide-card.active-slide {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

/* Slide Photo Inset Wrapper (Allows panorama to peek through around edges) */
.slide-photo-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: width 0.15s ease, height 0.15s ease, border-radius 0.15s ease;
}

.empty-slide-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.add-media-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(242, 220, 58, 0.2);
  border: 1.5px dashed var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-yellow);
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

/* An empty photo frame from a Look: a pale slot with its own Add Photo button. */
.floating-photo-card.empty-frame {
  background: #efe9dd;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.empty-frame-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  font: inherit;
}
.empty-frame-prompt .add-media-circle {
  background: rgba(20, 20, 20, 0.06);
  border-color: #8a7f6c;
  color: #3b352c;
}
.empty-frame-prompt .add-prompt-text {
  color: #3b352c;
  font-size: 0.8rem;
  font-weight: 700;
}
.empty-frame-prompt:hover .add-media-circle {
  transform: scale(1.06);
}

.slide-card:hover .add-media-circle,
.slide-card:active .add-media-circle {
  transform: scale(1.06);
  background: rgba(242, 220, 58, 0.35);
}

.add-prompt-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.slide-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.slide-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 15;
}

.seam-tag {
  position: absolute;
  top: 8px;
  right: -24px;
  transform: translateX(50%);
  background: var(--seam-guide);
  color: white;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 25;
}

/* =========================================================
   OVERLAYS LAYER (PHOTOS, SHAPE MASKS, STICKERS, CUTOUTS)
   ========================================================= */
.overlays-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

.overlay-element {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  touch-action: none;
  transition: box-shadow 0.15s ease;
}

.overlay-element img,
.floating-photo-img,
.cutout-sticker-img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

.overlay-element:active {
  cursor: grabbing;
}

.overlay-element.selected {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Resize Handle (Corner drag handle) */
.resize-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--ink-yellow);
  border: 2px solid #ffffff;
  border-radius: 50%;
  right: -10px;
  bottom: -10px;
  cursor: se-resize;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.resize-handle::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
}

/* Rotation Handle (Top-center drag handle) */
.rotate-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 2px solid var(--ink-yellow);
  border-radius: 50%;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.rotate-handle::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 16px;
  background: var(--ink-yellow);
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.rotate-handle::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--ink-yellow);
  border-radius: 50%;
}

.rotate-handle:active {
  cursor: grabbing;
}

/* Photocopy speckles overlay canvas */
.photocopy-speckles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Inline Editable Text Elements */
.overlay-element[data-type="text"] {
  cursor: text;
  outline-offset: 4px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.overlay-element[data-type="text"][contenteditable="true"],
.overlay-element[data-type="text"].is-editing-text {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text !important;
}

.overlay-element[data-type="text"].is-editing-text::selection,
.overlay-element[data-type="text"].is-editing-text *::selection {
  background: rgba(255, 69, 101, 0.26);
}

.overlay-element[data-type="text"]:focus,
.overlay-element[data-type="text"].is-editing-text {
  outline: 2.5px dashed var(--ink-yellow) !important;
  background: rgba(242, 220, 58, 0.08);
  border-radius: 4px;
}

.overlay-element[data-type="text"].is-editing-text::before {
  content: '✎ Typing — click outside when done';
  position: absolute;
  top: -26px;
  left: 0;
  background: #141414;
  color: var(--ink-yellow);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(242, 220, 58, 0.6);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  pointer-events: none;
  z-index: 40;
  text-transform: none;
}

/* Floating Photo Container */
.floating-photo-card {
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

.floating-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Shape Masks */
.shape-mask-arch {
  border-radius: 999px 999px 4px 4px;
}

.shape-mask-circle {
  border-radius: 50%;
}

.shape-mask-squircle {
  border-radius: 28%;
}

.shape-mask-polaroid {
  background: #ffffff;
  padding: 8px 8px 30px 8px;
  border-radius: 4px;
}
.shape-mask-polaroid .floating-photo-img {
  border-radius: 2px;
}

.shape-mask-photobooth {
  background: #ffffff;
  padding: 12px 12px 38px 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.shape-mask-photobooth .photobooth-frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 2px;
  position: relative;
  background: #1a1a1a;
}
.shape-mask-photobooth .photobooth-frame .floating-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shape-mask-postcard {
  background: #f4ede1;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgba(78, 62, 45, 0.2);
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
}
.shape-mask-postcard .floating-photo-img {
  border-radius: 2px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.word-strip {
  display: inline-block;
  background: #ffffff;
  color: #111111;
  padding: 4px 8px;
  margin: 3px 4px;
  border-radius: 2px;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.22);
  line-height: 1.2;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: transform 0.15s ease;
}

.shape-mask-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.shape-mask-heart {
  clip-path: polygon(50% 15%, 65% 0%, 85% 0%, 100% 20%, 100% 45%, 50% 95%, 0% 45%, 0% 20%, 15% 0%, 35% 0%);
}

/* Cutout Sticker Style */
.cutout-sticker-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Cute GIFs & Animated SVG Stickers */
.cute-gif-element {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cute-gif-element svg {
  width: 100%;
  height: 100%;
}

/* Floating Context Action Pill */
.floating-context-pill {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 22, 34, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 80;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  animation: fadeIn 0.15s ease-out;
  max-width: 95vw;
  overflow-x: auto;
  scrollbar-width: none;
}
.floating-context-pill::-webkit-scrollbar {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pill-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-yellow);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-actions {
  display: flex;
  gap: 4px;
}

.pill-btn-chip {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn-chip:active {
  background: var(--accent-primary);
}

.pill-btn-chip.danger {
  color: #ff6b81;
}

/* =========================================================
   HORIZONTAL TRAY SHELF (NON-BLOCKING)
   ========================================================= */
.horizontal-shelf {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 12px 16px max(var(--safe-bottom), 16px) 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.85);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.horizontal-shelf.open {
  display: flex;
}

.shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shelf-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.shelf-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 2px 6px;
  cursor: pointer;
}

.shelf-content {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.shelf-content::-webkit-scrollbar {
  display: none;
}

/* Shelf Item Cards */
.shelf-sticker-card {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 46px;
  box-sizing: border-box;
}

.shelf-sticker-card:active {
  border-color: var(--accent-primary);
  background: rgba(242, 220, 58, 0.15);
}

.shelf-sticker-icon {
  font-size: 1.3rem;
}

.shelf-sticker-card img.shelf-sticker-icon,
.shelf-sticker-card span.shelf-sticker-icon:has(svg) {
  background: #f4efe6;
  border-radius: 6px;
  padding: 4px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.shelf-sticker-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.shelf-color-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
}
.shelf-color-circle:active {
  border-color: white;
}

/* =========================================================
   INSTAGRAM BOTTOM CONTROLS (Screenshot 2)
   ========================================================= */
.ig-bottom-hud {
  background: #000000;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding-bottom: max(var(--safe-bottom), 12px);
  z-index: 70;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 1. Horizontal Scrollable Tool Cards Row */
.ig-tools-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 6px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ig-tools-row::-webkit-scrollbar {
  display: none;
}

.ig-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  min-width: 58px;
  height: 56px;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 4px;
}

.ig-tool-card:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.95);
}

.ig-tool-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f1f5f9;
}

.ig-tool-icon.highlight {
  color: var(--ink-yellow);
}

.ig-tool-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
  text-align: center;
  white-space: nowrap;
}

/* 2. Bottom Action Bar (Screenshot 2: Stepper + Preview + Blue Next Button) */
.ig-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 4px 14px;
}

.ig-stepper-pill {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 6px;
  gap: 2px;
}

.stepper-tap-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stepper-tap-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.stepper-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 48px;
  text-align: center;
  letter-spacing: 0.2px;
}

.ig-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ig-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 7px 13px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.15s ease;
}

.ig-preview-pill:active {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0.96);
}

/* Instagram Signature Next Button (Screenshot 2: Vibrant Blue Pill) */
.ig-next-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--ink-salmon);
  border: none;
  border-radius: 999px;
  padding: 7px 18px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 14px rgba(0, 149, 246, 0.4);
  transition: all 0.15s ease;
}

.ig-next-pill:active {
  background: #1877f2;
  transform: scale(0.96);
}

/* =========================================================
   INSTAGRAM SUBMENU DRAWER (Screenshot 3)
   ========================================================= */
.ig-submenu-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  display: flex;
  flex-direction: column;
  z-index: 85;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.85);
  transform: translateY(105%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: max(var(--safe-bottom), 12px);
  pointer-events: none;
  visibility: hidden;
}

.ig-submenu-drawer.open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.drawer-handle-bar {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 6px;
  cursor: pointer;
}

.drawer-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

.drawer-tools-scroll {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 20px 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.drawer-tools-scroll::-webkit-scrollbar {
  display: none;
}

.ig-circle-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #ffffff;
  flex-shrink: 0;
}

.ig-circle-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
  transition: all 0.15s ease;
}

.ig-circle-tool:active .ig-circle-icon {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.ig-circle-tool.active .ig-circle-icon {
  border-color: var(--ink-yellow);
  background: rgba(242, 220, 58, 0.15);
  color: var(--ink-yellow);
}

.ig-circle-dot {
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
}

.ig-circle-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.drawer-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px 4px 18px;
}

.drawer-footer-action {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.drawer-footer-action.primary {
  color: var(--ink-yellow);
  font-weight: 800;
}

.drawer-footer-action:active {
  opacity: 0.6;
}

.drawer-footer-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* =========================================================
   INSTAGRAM TEXT & FONT EDITOR (Screenshot 1)
   ========================================================= */
.ig-text-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(24px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: max(var(--safe-top), 10px);
  padding-bottom: max(var(--safe-bottom), 16px);
  box-sizing: border-box;
}

.ig-text-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}

.ig-text-top-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.ig-text-done-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.ig-text-done-btn:active {
  transform: scale(0.95);
}

.ig-text-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ig-text-live-input {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  outline: none;
  min-width: 120px;
  max-width: 90vw;
  line-height: 1.25;
  caret-color: var(--ink-yellow);
  word-break: break-word;
}

.ig-text-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 14px;
}

.ig-font-pills-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.ig-font-pills-carousel::-webkit-scrollbar {
  display: none;
}

.ig-font-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ig-font-pill.active {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
}

.ig-text-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ig-text-opt-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
}

.rainbow-circle-btn .rainbow-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.ig-text-colors-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ig-text-colors-scroll::-webkit-scrollbar {
  display: none;
}

.ig-text-color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.ig-text-color-dot.active {
  border-color: #ffffff;
  transform: scale(1.15);
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 800;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* =========================================================
   TEMPLATES GRID
   ========================================================= */
.templates-modal-card {
  max-width: 440px;
  max-height: 85vh;
  padding: 16px 14px 22px 14px;
}

.templates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.templates-grid::-webkit-scrollbar {
  display: none;
}

.template-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.template-card:active {
  border-color: var(--accent-primary);
  background: rgba(242, 220, 58, 0.1);
}

.template-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.template-info {
  flex: 1;
}

.template-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.template-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.template-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink-yellow);
  background: rgba(242, 220, 58, 0.15);
  padding: 2px 6px;
  border-radius: 999px;
  margin-top: 4px;
  display: inline-block;
}

/* =========================================================
   ANIMATED MOSAIC GRID & MOVING GIF STUDIO
   ========================================================= */
.mosaic-modal-card {
  max-width: 400px;
  max-height: 88vh;
  padding: 16px 14px 22px 14px;
}

.mosaic-preview-stage {
  position: relative;
  width: 100%;
  height: 220px;
  background: #0f1117;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.mosaic-animator-box {
  width: 180px;
  height: 180px;
  position: relative;
}

.mosaic-live-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--ink-yellow);
  background: rgba(242, 220, 58, 0.15);
  border: 1px solid rgba(242, 220, 58, 0.3);
  border-radius: 999px;
  padding: 3px 8px;
  letter-spacing: 0.3px;
}

.mosaic-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.mosaic-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mosaic-presets-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mosaic-presets-row::-webkit-scrollbar {
  display: none;
}

.mosaic-preset-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mosaic-preset-chip:active,
.mosaic-preset-chip.active {
  background: var(--ink-yellow);
  border-color: var(--ink-yellow);
  color: var(--ink-black);
}

/* Dynamic Live Animated Mosaic Grid Elements */
.mosaic-grid-container {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.mosaic-grid-tile {
  background-repeat: no-repeat;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Chiara Elle Templates Aesthetic */
.paper-texture-bg {
  background-color: #f7f4ed !important;
  background-image: 
    radial-gradient(#e5dfd3 1px, transparent 1px),
    radial-gradient(#ded7ca 1px, #f7f4ed 1px) !important;
  background-size: 20px 20px !important;
  background-position: 0 0, 10px 10px !important;
}

/* =========================================================
   CUTOUT STUDIO MODAL
   ========================================================= */
.cutout-modal-card {
  max-width: 380px;
}

.cutout-modal-card {
  max-width: 380px;
  max-height: 85vh;
  padding: 14px 14px 20px 14px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-toggle-btn {
  background: rgba(242, 220, 58, 0.15);
  border: 1px solid rgba(242, 220, 58, 0.3);
  color: var(--ink-yellow);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}

.ios-tip-box {
  background: rgba(242, 220, 58, 0.08);
  border: 1px solid rgba(242, 220, 58, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 8px;
}

.ios-tip-text {
  font-size: 0.68rem;
  color: #bae6fd;
  line-height: 1.35;
}

.cutout-preview-box {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px dashed var(--border-light);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.cutout-preview-box:hover,
.cutout-preview-box:active {
  border-color: var(--ink-yellow);
}

.cutout-checker-bg {
  width: 100%;
  height: 100%;
  background-color: #1a1a24;
  background-image: 
    linear-gradient(45deg, #12121c 25%, transparent 25%), 
    linear-gradient(-45deg, #12121c 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #12121c 75%), 
    linear-gradient(-45deg, transparent 75%, #12121c 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutout-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  padding: 8px;
}

.cutout-upload-icon {
  font-size: 1.8rem;
  margin-bottom: 2px;
}

.cutout-upload-title {
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 800;
}

.cutout-upload-sub {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.cutout-buttons-dual {
  display: flex;
  gap: 8px;
}

.cutout-buttons-dual .btn {
  flex: 1;
}

.cutout-preview-display {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.cutout-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #10b981;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.cutout-controls-row label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}

.pill-selector {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.pill-selector.full-width {
  width: 100%;
}
.pill-selector.full-width .pill-btn {
  flex: 1;
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn.active {
  background: var(--accent-primary);
  color: white;
}

.modal-actions-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
}

/* Backdrop Library Modal */
.backdrop-library-modal-card {
  max-width: 420px;
  max-height: 85vh;
}

.backdrop-library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.backdrop-lib-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.backdrop-lib-card:active {
  border-color: var(--ink-yellow);
  transform: scale(0.97);
}

.backdrop-lib-thumb {
  width: 100%;
  height: 70px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.backdrop-lib-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

/* =========================================================
   PHONE SIMULATOR MODAL
   ========================================================= */
.phone-modal {
  max-width: 330px;
  width: 95vw;
  padding: 12px 14px 16px 14px;
}

.phone-frame-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.phone-frame {
  width: 100%;
  max-width: 290px;
  background: #000;
  border-radius: 28px;
  border: 4px solid #2a2d3d;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.ig-post-header {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  gap: 6px;
}

.ig-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433 0%, #dc2743 100%);
}

.ig-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ig-username {
  font-size: 0.68rem;
  font-weight: 700;
}

.ig-audio {
  font-size: 0.58rem;
  color: var(--text-dim);
}

.ig-more {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.phone-screen-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #111;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.phone-screen-viewport[data-format="story"] {
  aspect-ratio: 9 / 16;
}

/* Instagram Slide Counter Pill (e.g., "1/3") */
.ig-counter-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 15;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.phone-slides-track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
}

.phone-slide-view {
  min-width: 100%;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.phone-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 10;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.dot.active {
  background: var(--ink-yellow);
  width: 12px;
  border-radius: 999px;
}

.ig-post-footer {
  padding: 8px 10px 8px 10px;
  background: #000;
}

.ig-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 5px;
  color: #ffffff;
}

.ig-action-icon {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ig-action-icon:active {
  transform: scale(0.85);
}

.ig-caption {
  font-size: 0.65rem;
  line-height: 1.3;
}

.phone-instruction {
  font-size: 0.7rem;
  color: var(--ink-yellow);
  text-align: center;
  margin-top: 8px;
  line-height: 1.35;
}

/* Modals & Inputs */
.styled-input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: white;
  padding: 10px 12px;
  font-size: 16px;
  margin-bottom: 12px;
}

.fonts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 45vh;
  overflow-y: auto;
}

.font-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.font-preview {
  font-size: 0.9rem;
  color: var(--text-main);
}

.copy-chip {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.copy-chip:active {
  background: var(--accent-primary);
  color: white;
}

/* Toast */
.toast-notify {
  position: fixed;
  bottom: calc(76px + max(var(--safe-bottom), 18px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 200;
}

.toast-notify.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.export-thumbs-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  align-items: center;
}

.export-thumb-wrapper {
  position: relative;
  width: 76px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  cursor: pointer;
  background: #0f172a;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.export-thumb-wrapper:hover {
  border-color: var(--ink-yellow);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(242, 220, 58, 0.25);
}

.export-thumb-wrapper:active {
  transform: scale(0.96);
}

.export-thumb-wrapper .export-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.export-thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--ink-yellow);
  border: 1px solid rgba(242, 220, 58, 0.3);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.export-thumb-badge.video-badge {
  background: rgba(225, 29, 72, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.export-thumb-num {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: #f8fafc;
  pointer-events: none;
}

.export-thumb-download-hint {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
}

.export-thumb-wrapper:hover .export-thumb-download-hint {
  opacity: 1;
}

/* =========================================================
   GLOBAL PLATFORM NAVBAR (Responsive Desktop & Mobile)
   ========================================================= */
.platform-navbar {
  height: 56px;
  background: rgba(7, 9, 14, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  user-select: none;
  cursor: pointer;
}

/* Desktop shows the whole wordmark; phones show only the mark (see the 768px rule). */
.nav-brand-wordmark {
  display: block;
  height: 36px;
  width: auto;
}

.nav-brand-logo {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: none;
}


.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
}

.nav-badge-pill {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-carousel-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-undo-redo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shuffle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #f1efe9;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  line-height: 1;
}

.shuffle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.shuffle-btn:active {
  transform: scale(0.95);
}

.desktop-only-btn {
  display: none;
}

#desktopFormatPill {
  display: none;
}

.tab-label-short {
  display: none;
}

/* =========================================================
   SPA MULTI-VIEW CONTAINERS
   ========================================================= */
.spa-views-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.spa-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.spa-view.active {
  display: flex;
  opacity: 1;
}

#carouselView {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

#homeView, #fontsView {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   HOMEPAGE VIEW STYLING (Hero, Tool Grid, Live Widget, Pillars)
   ========================================================= */
.home-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 100%;
}

.home-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px 10px 10px 10px;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(242, 220, 58, 0.12);
  border: 1px solid rgba(242, 220, 58, 0.3);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-yellow);
}

.home-badge-icon {
  color: var(--ink-yellow);
}

.home-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 820px;
}

.home-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.6;
  font-weight: 500;
}

.home-cta-group {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-trust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.76rem;
  color: #64748b;
  flex-wrap: wrap;
  justify-content: center;
}

.trust-item {
  color: #94a3b8;
  font-weight: 600;
}

.trust-dot {
  color: #475569;
}

.home-section-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.section-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-yellow);
}

.section-title {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.section-desc {
  font-size: 0.92rem;
  color: #94a3b8;
  max-width: 580px;
  line-height: 1.5;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 220, 58, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.tool-card.featured-card {
  background: linear-gradient(145deg, #131728 0%, #171d33 100%);
  border-color: rgba(242, 220, 58, 0.35);
}

.tool-card.featured-card:hover {
  border-color: var(--ink-yellow);
  box-shadow: 0 12px 34px rgba(242, 220, 58, 0.2);
}

.tool-card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-yellow);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-card.featured-card .tool-card-badge {
  background: var(--ink-yellow);
  color: #ffffff;
}

.tool-card-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.tool-card-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.55;
  flex-grow: 1;
}

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.tool-card-action {
  background: transparent;
  border: none;
  color: var(--ink-yellow);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  cursor: pointer;
  text-align: left;
}

/* Home Live Font Widget */
.home-widget-section {
  width: 100%;
}

.home-widget-card {
  background: #101422;
  border: 1px solid rgba(242, 220, 58, 0.2);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.home-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.widget-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
}

.widget-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 3px;
}

.widget-input-wrapper {
  width: 100%;
}

.widget-input {
  width: 100%;
  padding: 14px 18px;
  background: #080b12;
  border: 1.5px solid var(--border-medium);
  border-radius: 12px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.widget-input:focus {
  border-color: var(--ink-yellow);
  box-shadow: 0 0 0 3px rgba(242, 220, 58, 0.15);
}

.home-font-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.home-font-item {
  background: #090c14;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-font-text {
  font-size: 0.95rem;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-chip-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.copy-chip-btn:hover {
  background: var(--ink-yellow);
  border-color: var(--ink-yellow);
  color: #07090e;
}

.copy-chip-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* Home Pillars */
.home-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pillar-icon {
  font-size: 1.6rem;
}

.pillar-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
}

.pillar-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Home Footer */
.home-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.footer-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #ffffff;
}

.footer-bottom {
  font-size: 0.72rem;
  color: #475569;
  text-align: center;
}

/* =========================================================
   STANDALONE BIO & CAPTION FONTS STUDIO VIEW
   ========================================================= */
.fonts-studio-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 20px 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.fonts-studio-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fonts-studio-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.fonts-studio-desc {
  font-size: 0.92rem;
  color: #94a3b8;
  max-width: 620px;
  line-height: 1.5;
}

.fonts-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.fonts-input-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fonts-input-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ink-yellow);
}

.fonts-clear-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.fonts-clear-btn:hover {
  color: #f43f5e;
}

.fonts-studio-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}

.fonts-categories-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.fonts-categories-row::-webkit-scrollbar {
  display: none;
}

.font-cat-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.font-cat-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.font-cat-pill.active {
  background: var(--ink-yellow);
  border-color: var(--ink-yellow);
  color: #07090e;
  font-weight: 700;
}

.paper-categories-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 6px 8px 6px;
  scrollbar-width: none;
  width: 100%;
  flex-shrink: 0;
}
.paper-categories-row::-webkit-scrollbar {
  display: none;
}
.paper-cat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 72%;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.paper-cat-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.paper-cat-pill.active {
  background: var(--ink-yellow);
  border-color: var(--ink-yellow);
  color: var(--ink-black);
  box-shadow: 0 0 10px rgba(242, 220, 58, 0.25);
}

.shelf-paper-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  width: 100%;
}
@media (min-width: 1024px) {
  .shelf-paper-grid {
    flex-wrap: wrap;
    max-height: 480px;
    overflow-y: auto;
  }
}
.shelf-paper-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 88px;
}
.shelf-paper-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 220, 58, 0.4);
  transform: translateY(-2px);
}
.shelf-paper-card.active {
  border-color: var(--ink-yellow);
  background: rgba(242, 220, 58, 0.08);
}
.shelf-paper-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.shelf-paper-thumb.none-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
}
.shelf-paper-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink-yellow);
  color: var(--ink-black);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.shelf-paper-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
}

.fonts-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.font-studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 110px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.font-studio-card:hover {
  border-color: rgba(242, 220, 58, 0.4);
  transform: translateY(-2px);
}

.font-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.font-style-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.font-card-preview-text {
  font-size: 1.15rem;
  color: #f8fafc;
  word-break: break-word;
  line-height: 1.35;
}

/* =========================================================
   DESKTOP DOCK & RESPONSIVE STUDIO LAYOUT
   ========================================================= */
.studio-layout {
  display: flex;
  flex-direction: column; /* Default: mobile layout (canvas top, HUD bottom) */
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.desktop-studio-dock {
  display: none;
  width: 82px;
  height: 100%;
  background: #090c14;
  border-right: 1px solid var(--border-light);
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 8px;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 40;
}

.dock-header {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 4px;
}

.dock-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 66px;
  height: 60px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dock-tool-btn span {
  font-size: 0.65rem;
  font-weight: 600;
}

.dock-tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.dock-tool-btn.active {
  background: rgba(242, 220, 58, 0.12);
  border-color: rgba(242, 220, 58, 0.3);
  color: var(--ink-yellow);
}

.dock-tool-btn.highlight {
  color: #f43f5e;
}

.dock-tool-btn.highlight:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}

/* Responsive Desktop Enhancements (Screens >= 1024px) */
@media (min-width: 1024px) {
  .studio-layout {
    flex-direction: row; /* Desktop: dock on left, canvas in center */
  }

  .desktop-studio-dock {
    display: flex;
  }

  .desktop-only-btn {
    display: inline-flex;
  }

  /* Hide mobile-only bottom HUD on desktop */
  .ig-bottom-hud {
    display: none !important;
  }

  /* Position workbench with full workspace breathing room */
  .workbench {
    flex: 1;
    height: 100%;
    min-width: 0;
    background: radial-gradient(circle at 50% 50%, #0e121d 0%, #06080e 100%);
  }

  #desktopFormatPill {
    display: flex;
  }

  /* Drawer docks neatly on desktop without obscuring canvas */
  .ig-submenu-drawer {
    left: 82px;
    width: calc(100% - 82px);
    max-width: 900px;
    margin: 0 auto;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border: 1px solid var(--border-medium);
    border-bottom: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  }

  /* Horizontal tray shelf on desktop docks cleanly like the submenu drawer */
  .horizontal-shelf {
    left: 82px;
    width: calc(100% - 82px);
    max-width: 900px;
    margin: 0 auto;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border: 1px solid var(--border-medium);
    border-bottom: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  }

  .shelf-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  .shelf-content::-webkit-scrollbar {
    width: 6px;
    display: block;
  }
  .shelf-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
  }

  .drawer-tools-scroll {
    flex-wrap: wrap;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 16px 14px;
    padding: 14px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  .drawer-tools-scroll::-webkit-scrollbar {
    width: 6px;
    display: block;
  }
  .drawer-tools-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
  }

  .nav-tabs {
    display: flex;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .platform-navbar {
    padding: 0 8px;
    height: 50px;
    gap: 4px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .platform-navbar::-webkit-scrollbar {
    display: none;
  }

  .nav-brand {
    gap: 0;
    flex-shrink: 0;
  }

  .nav-brand-logo {
    display: flex;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }

  .nav-brand-wordmark {
    display: none;
  }

  .nav-tabs {
    gap: 2px;
    padding: 2px 4px;
    flex-shrink: 0;
    min-width: 0;
  }

  .nav-tab {
    padding: 4px 6px;
    font-size: 0.68rem;
    gap: 3px;
    white-space: nowrap;
  }

  .tab-label-full {
    display: none;
  }

  .tab-label-short {
    display: inline;
  }

  .nav-badge-pill {
    display: none;
  }

  .nav-actions {
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
  }

  .nav-carousel-controls {
    gap: 4px;
    min-width: 0;
  }

  .canvas-tabs-bar,
  .add-canvas-btn,
  .overview-btn {
    display: none !important;
  }

  #desktopFormatPill {
    display: none !important;
  }

  .look-switcher-btn {
    padding: 4px 7px !important;
    font-size: 0.66rem !important;
    gap: 3px !important;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .look-switcher-btn .look-current-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shuffle-btn {
    padding: 4px 6px;
    font-size: 0.66rem;
  }
  .shuffle-btn span {
    display: none;
  }

  .topbar-icon-btn {
    width: 26px;
    height: 26px;
  }

  #navLaunchStudioBtn {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .home-container {
    padding: 24px 14px 60px 14px;
    gap: 40px;
  }
}

/* Extra-narrow phones (e.g. iPhone SE / 360-375px) */
@media (max-width: 400px) {
  .platform-navbar {
    padding: 0 6px;
    gap: 4px;
  }

  .nav-tab {
    padding: 4px 6px;
  }
}



/* Export progress (motion) */
.export-progress { margin: 10px 0 14px; display: grid; gap: 8px; }
.export-progress[hidden], .export-error[hidden] { display: none; }
.export-progress-label { font-size: 0.8rem; font-weight: 700; color: #475569; }
.export-progress-track { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.export-progress-bar { height: 100%; width: 0%; background: #0f172a; transition: width 0.15s linear; }
.export-error { margin: 8px 0; font-size: 0.82rem; color: #b91c1c; font-weight: 600; }

/* Video layers (motion) */
.floating-photo-card video.floating-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.printed-texture { position: absolute; inset: 0; pointer-events: none; }

/* Physical Printmaking Depth System: Ink Substrate vs Ephemera Collage */
.printed-media {
  mix-blend-mode: normal !important;
  filter: contrast(1.04) brightness(1.02);
}

.printed-media img,
.printed-media canvas:not(.printed-texture) {
  mix-blend-mode: normal !important;
  filter: url(#microToothFilter) contrast(1.04) brightness(1.02);
}

.printed-media video {
  mix-blend-mode: normal !important;
  filter: contrast(1.04) brightness(1.02);
}

.pasted-media {
  mix-blend-mode: normal !important;
}

.has-contact-shadow {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22), 0 10px 24px rgba(0, 0, 0, 0.16) !important;
}

.pasted-media.cutout-sticker-img,
.pasted-media.sticker-element img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.16)) !important;
}

.cutout-sticker-img.no-drop-shadow,
.pasted-media.cutout-sticker-img.no-drop-shadow {
  filter: none !important;
}

/* Top Crease & Relief Overlay (Physical fold lines running through ink and pressing onto stickers) */
.top-crease-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.22;
  z-index: 95;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: none;
}

/* Loop control and clip-part picker (motion) */
.loop-control { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.12); flex-shrink: 0; }
.loop-control-label { font-size: 0.72rem; font-weight: 700; color: #94a3b8; padding: 0 6px; }
.loop-control button { border: 0; background: transparent; font: inherit; font-size: 0.75rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; color: #cbd5e1; cursor: pointer; }
.loop-control button.active { background: #ffffff; color: #0f172a; }
/* The header copy is for desktop, where the bottom bar is hidden. */
.loop-control-desktop { display: none; }
@media (min-width: 1024px) { .loop-control-desktop { display: inline-flex; } }

/* Zoom control and canvas scaling (desktop) */
.zoom-control { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.12); flex-shrink: 0; }
.zoom-control-label { font-size: 0.72rem; font-weight: 700; color: #94a3b8; padding: 0 6px; }
.zoom-control button { border: 0; background: transparent; font: inherit; font-size: 0.75rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; color: #cbd5e1; cursor: pointer; }
.zoom-control button.active { background: var(--ink-yellow); color: var(--ink-black); }
.zoom-control-desktop { display: none; }
@media (min-width: 1024px) {
  .zoom-control-desktop { display: inline-flex; }

  /* Desktop Studio Dock ergonomics */
  .desktop-studio-dock {
    width: 90px;
    padding: 16px 10px;
    gap: 8px;
  }
  .dock-header {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
  }
  .dock-tool-btn {
    padding: 10px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 6px;
  }
  .dock-tool-btn svg {
    width: 22px;
    height: 22px;
  }

  /* Desktop Submenu Drawer sizing */
  .ig-circle-tool .ig-circle-icon {
    width: 52px;
    height: 52px;
  }
  .ig-circle-tool .ig-circle-icon svg {
    width: 24px;
    height: 24px;
  }
  .ig-circle-tool .ig-circle-label {
    font-size: 0.76rem;
    font-weight: 700;
  }
  .drawer-footer-title {
    font-size: 0.95rem;
    font-weight: 800;
  }
  .drawer-footer-action {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 7px 18px;
  }
}
/* Phones: drop the label and tighten, so the Preview and Next pills still fit. */
/* Phones: one button showing the current loop; tapping it moves to the next length. */
@media (max-width: 480px) {
  .loop-control .loop-control-label { display: none; }
  .loop-control button:not(.active) { display: none; }
  .loop-control button { padding: 4px 8px; font-size: 0.72rem; }
}
.trim-body { display: grid; gap: 10px; }
.trim-body video { width: 100%; max-height: 46vh; background: #000; border-radius: 10px; object-fit: contain; }
.trim-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; border-radius: 6px; overflow: hidden; }
.trim-strip img { width: 100%; height: 44px; object-fit: cover; display: block; }
.trim-readout { font-size: 0.8rem; font-weight: 700; color: #475569; text-align: center; }
#trimStart { width: 100%; }

/* Empty canvas: first step and the example (replaces templates, 2026-10-14) */
.empty-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
  max-width: min(calc(100% - 24px), calc(100vw - 24px));
}
.empty-hint[hidden] { display: none !important; }
.empty-hint-text { line-height: 1.3; }
.empty-hint-link {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.empty-hint-link:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}
.empty-hint-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  opacity: .75;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-hint-close:hover { opacity: 1; }

@media (max-width: 600px) {
  .empty-hint {
    top: 12px;
    width: calc(100% - 24px);
    max-width: calc(100vw - 24px);
    border-radius: 18px;
    padding: 10px 32px 10px 14px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
  }
  .empty-hint-text {
    width: 100%;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 2px;
  }
  .empty-hint-link {
    font-size: 0.76rem;
    padding: 5px 10px;
  }
  .empty-hint-close {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 18px;
    padding: 4px;
  }
}

/* Tap-to-cut panel (2026-10-15) */
.cutout-preview-box.has-photo { height: auto; min-height: 160px; cursor: crosshair; }
.cutout-stage { display: block; max-width: 100%; max-height: min(52vh, 460px); margin: 0 auto; touch-action: manipulation; }
.cutout-stage[hidden] { display: none; }
.cutout-error { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: #fca5a5; font-size: 0.82rem; font-weight: 600; }
.cutout-error[hidden] { display: none; }
#applyCutoutBtn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Phone fit, brushes (iPhone feedback, 2026-10-15) */
/* iOS counts the browser toolbar inside 100vh; dvh is the height she can actually see. */
.modal-overlay { height: 100vh; height: 100dvh; }
.modal-card { max-height: 88vh; max-height: calc(100dvh - 24px); }
.cutout-stage { max-height: min(40vh, 460px); max-height: min(40dvh, 460px); }
@media (max-width: 480px) { .cutout-stage { max-height: 34dvh; } }
.cutout-modal-card .modal-actions-row { position: sticky; bottom: -16px; margin-bottom: -16px; padding: 10px 0 16px; background: var(--bg-card); z-index: 2; }
.cutout-brush-pill { margin-top: 6px; }
.cutout-brush-pill[hidden] { display: none; }
.cutout-stage.brushing { touch-action: none; cursor: cell; }
#cutoutModePill .pill-btn { padding-left: 4px; padding-right: 4px; }

/* ===== Riso accents on the dark studio (2026-10-16) =====
   Yellow = primary CTA & selected, green = settings state.
   Anything filled with an ink carries black text: white on yellow cannot be read. */
.btn-primary, .pill-btn.active, .nav-tab.active { background: var(--ink-yellow); color: var(--ink-black); box-shadow: none; }
.btn-primary:hover { background: var(--accent-primary-hover); }
#exportBtn, #desktopExportBtn, .ig-next-pill { background: var(--ink-yellow); color: var(--ink-black); box-shadow: none; }
#exportBtn:hover, #desktopExportBtn:hover, .ig-next-pill:hover { filter: brightness(1.06); }
.ig-circle-tool.active .ig-circle-icon { background: var(--ink-yellow); border-color: var(--ink-yellow); color: var(--ink-black); }
.ig-circle-tool.active .ig-circle-label { color: var(--ink-yellow); }
/* Settings (paper wear, edge) light up green, not yellow: green = settings state. */
.ig-circle-tool--setting.active .ig-circle-icon { background: var(--ink-green); border-color: var(--ink-green); color: var(--ink-black); }
.ig-circle-tool--setting.active .ig-circle-label { color: var(--ink-green); }
.loop-control button.active { background: var(--ink-green); color: var(--ink-black); }
.platform-navbar { border-bottom: 1.5px solid #e8e6e1; }
.nav-tab, .dock-tool-btn span, .ig-tool-label, .ig-circle-label, .pill-btn, .modal-title, .drawer-title, .export-thumb-badge, .loop-control button {
  /* Condensed, as the design asks: at full width these labels outgrew their buttons. */
  font-family: var(--font-display); font-weight: 800; font-stretch: 72%; text-transform: uppercase; letter-spacing: .06em;
}
/* Pills are the tightest rows (Grid GIF patterns overflowed even before): tighter still. */
.pill-btn { font-stretch: 62%; letter-spacing: .03em; }
/* The logo sits on yellow now, so its icon is black (white on yellow is ~1.4:1). */
.nav-brand-logo { color: var(--ink-black); box-shadow: none; }

/* Start new: riso, like the app's other buttons. */
.start-new-btn { margin-top: 14px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--ink-salmon); background: var(--ink-salmon); color: var(--ink-black);
  font-family: 'Archivo', 'Arial Narrow', sans-serif; font-stretch: 70%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; cursor: pointer; }
.start-new-btn:hover { filter: brightness(1.05); }
/* The current size stays bright even while the others are locked. */
.format-card.selected:disabled, .format-card.active:disabled { opacity: 1; cursor: default; }

/* On a carousel the slide counter is the size button; the pill only shows for a post or story. */
.phone-format-pill[data-format="carousel"] { display: none; }
#slideCountDisplay { cursor: pointer; }

/* Mobile Action Bar Decluttering (Stage 4) */
.ig-stepper-pill[data-format="post"],
.ig-stepper-pill[data-format="story"] {
  display: none !important;
}

@media (max-width: 600px) {
  .loop-control:not(.motion-active) {
    display: none !important;
  }
}

/* =========================================================
   STAGE E: LOOK SWITCHER & THE 3 LAUNCH LOOKS
   ========================================================= */

.look-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.look-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.look-switcher-btn .look-icon {
  color: #fbbf24;
  font-size: 0.9rem;
}

.shelf-looks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 4px 16px 4px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .shelf-looks-grid {
    grid-template-columns: repeat(3, 260px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
  }
}

.shelf-look-card {
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  scroll-snap-align: start;
}

.shelf-look-card:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.shelf-look-card.active {
  border-color: #fbbf24;
  background: #1e2433;
  box-shadow: 0 0 0 1px #fbbf24, 0 8px 20px rgba(251, 191, 36, 0.15);
}

.look-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.look-card-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.shelf-look-card.active .look-card-badge {
  background: #fbbf24;
  color: #0f172a;
}

.look-card-icon {
  font-size: 1.6rem;
}

.look-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.look-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.look-card-sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}

.look-card-vibe {
  margin: 4px 0 0 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #94a3b8;
}

.look-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.look-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.look-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.look-action-btn.primary {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #0f172a;
  font-weight: 800;
}

.look-action-btn.primary:hover {
  background: #f59e0b;
  border-color: #f59e0b;
}


/* Mid-width desktops (1024–1279 px): the full top bar needs ~1225 px, which pushed Export off screen.
   Drop the group labels, show Preview as an icon, and keep only Fit and 150% zoom. (2026-10-30 audit) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .loop-control-desktop .loop-control-label,
  .zoom-control-desktop .zoom-control-label,
  .zoom-control-desktop button[data-zoom="75%"],
  .zoom-control-desktop button[data-zoom="100%"],
  #desktopPreviewBtn span {
    display: none;
  }
}

/* ============================================================
   STUDIO UX BATCH 1: Hierarchy, Pickers, Canvas Slide Controls
   ============================================================ */

/* 1. Prioritized Arrange + Role Hierarchy in Left Dock & Mobile Bar */
.dock-role-label {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.42);
  text-align: center;
  width: 100%;
  margin: 2px 0 1px 0;
  pointer-events: none;
  user-select: none;
}

.dock-role-divider {
  width: 36px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 4px auto 2px auto;
  flex-shrink: 0;
}

.dock-tool-btn.dock-tool-primary {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 2px solid var(--ink-black);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  font-weight: 800;
}

.dock-tool-btn.dock-tool-primary:hover {
  background: #f7e452;
  color: var(--ink-black);
  transform: translateY(-1px);
}

.dock-tool-btn.dock-tool-primary span {
  color: var(--ink-black);
  font-weight: 800;
}

.ig-tool-card.ig-tool-primary {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 1.5px solid var(--ink-black);
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.ig-tool-card.ig-tool-primary .ig-tool-icon,
.ig-tool-card.ig-tool-primary .ig-tool-label {
  color: var(--ink-black);
  font-weight: 800;
}

.ig-tool-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}

/* Simplify Empty-Canvas Starter into Unmistakable 2-Step Start */
.empty-hint {
  flex-wrap: wrap;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}

.empty-hint-primary-cta {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border: 2px solid var(--ink-black);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink-black);
  transition: transform 0.12s ease, background-color 0.12s ease;
  white-space: nowrap;
}

.empty-hint-primary-cta:hover {
  background: #f7e452;
  transform: translateY(-1px);
}

/* 2. Look Replacement Cues on Empty & Filled Frames and Text */
.empty-frame-prompt .add-prompt-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-black);
  opacity: 0.78;
  margin-top: 2px;
}

.look-replace-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 8;
  background: rgba(20, 20, 20, 0.82);
  color: var(--ink-paper);
  border: 1.5px solid rgba(247, 243, 234, 0.65);
  border-radius: 999px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.look-replace-badge:hover {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border-color: var(--ink-black);
  transform: scale(1.04);
}

.look-customizable-text::after {
  content: attr(data-look-hint);
  position: absolute;
  top: -20px;
  left: 0;
  background: rgba(20, 20, 20, 0.85);
  color: var(--ink-yellow);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.look-customizable-text:hover::after,
.overlay-item.selected.look-customizable-text::after {
  opacity: 0.92;
}

/* 3. Expandable Category Pickers Above Submenu Drawer */
.drawer-category-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 12px 6px 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.drawer-picker-header {
  flex-shrink: 0;
}

.drawer-picker-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-yellow);
  white-space: nowrap;
}

.drawer-picker-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.drawer-opt-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  margin-right: 5px;
  vertical-align: -1px;
}

.drawer-category-picker[data-category="paper-stock"] {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.drawer-paper-cats {
  margin-bottom: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-paper-swatches .drawer-opt-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: -3px;
}

.drawer-postmark-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.drawer-postmark-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.72);
}

.drawer-postmark-input {
  width: 120px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.drawer-postmark-input:focus {
  outline: none;
  border-color: var(--ink-yellow);
}

.curator-summary-pill {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(14px);
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 680px);
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  background: rgba(16, 17, 19, 0.94);
  border: 1px solid rgba(242, 220, 58, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: #f1efe9;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.curator-summary-pill.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.curator-pill-badge {
  background: var(--ink-yellow, #f2dc3a);
  color: var(--ink-black, #141414);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.curator-pill-text {
  color: #f1efe9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.curator-pill-close {
  background: none;
  border: none;
  color: rgba(241, 239, 233, 0.65);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.curator-pill-close:hover {
  color: #ffffff;
}

.drawer-category-picker[hidden] {
  display: none !important;
}

@media (min-width: 1024px) {
  .ig-submenu-drawer {
    max-width: 980px;
  }
  .drawer-tools-scroll {
    gap: 12px 10px;
    padding: 12px 18px;
    justify-content: center;
  }
}

.drawer-option-btn {
  appearance: none;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-paper);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.drawer-option-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.drawer-option-btn.active {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border-color: var(--ink-black);
  font-weight: 800;
}

.drawer-tool-btn.active-category {
  background: rgba(242, 220, 58, 0.18);
  border-color: var(--ink-yellow);
  color: var(--ink-yellow);
}

/* 5. Unified & Enlarged Submenu Done / Close Button */
.submenu-done-btn {
  appearance: none;
  background: var(--ink-yellow) !important;
  color: var(--ink-black) !important;
  border: 2px solid var(--ink-black) !important;
  border-radius: 999px !important;
  padding: 6px 16px !important;
  min-height: 34px;
  font-family: var(--font-display) !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.submenu-done-btn:hover {
  background: #f7e452 !important;
}

/* 6. Corner Workbench Zoom & Animate Sheet Clip Length */
.workbench-corner-zoom {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 40;
  background: rgba(20, 20, 20, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

@media (max-width: 1023px) {
  .workbench-corner-zoom {
    display: none !important;
  }

  .drawer-category-picker {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 10px;
    max-height: 155px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ig-submenu-drawer.has-active-picker .drawer-tools-scroll {
    display: none;
  }

  .ig-submenu-drawer.has-active-picker .drawer-category-picker {
    max-height: 200px;
  }

  .drawer-category-picker .drawer-picker-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .drawer-category-picker .drawer-picker-options::-webkit-scrollbar {
    display: none;
  }

  .drawer-category-picker .drawer-option-btn {
    flex-shrink: 0;
  }
}

.anim-clip-length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 20, 20, 0.12);
}

.anim-clip-length-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-black);
}

#animSheet #loopControl {
  display: inline-flex !important;
}

/* 7. On-Canvas Visual + / - Slide Controls */
.canvas-slide-controls {
  position: absolute;
  bottom: -44px;
  left: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 45;
}

.canvas-slide-btn {
  appearance: none;
  border: 2px solid var(--ink-black);
  background: var(--ink-paper);
  color: var(--ink-black);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  box-shadow: 2px 2px 0 var(--ink-black);
  transition: transform 0.12s ease, background-color 0.12s ease;
  white-space: nowrap;
}

.canvas-slide-btn.canvas-slide-remove {
  background: #f7f3ea !important;
  color: #141414 !important;
  border-color: #141414 !important;
}

.canvas-slide-btn.canvas-slide-add {
  background: #f2dc3a !important;
  color: #141414 !important;
  border-color: #141414 !important;
}

.canvas-slide-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.canvas-slide-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.slide-remove-btn {
  position: absolute;
  bottom: 9px;
  left: 66px;
  z-index: 25;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(247, 243, 234, 0.65);
  background: rgba(20, 20, 20, 0.78);
  color: var(--ink-paper);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.slide-remove-btn:hover {
  opacity: 1;
  background: var(--ink-red);
  border-color: var(--ink-black);
  transform: scale(1.08);
}

/* 8. Export Post Final Step Styling & Plain-English Guidance */
.export-how-it-works {
  background: rgba(247, 243, 234, 0.08);
  border: 1px solid rgba(247, 243, 234, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
}

.export-how-it-works strong,
.export-how-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-yellow);
  margin-bottom: 4px;
}

.export-how-it-works p strong {
  display: inline;
  color: #ffffff;
  font-size: inherit;
  margin-bottom: 0;
}

.export-how-it-works p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-paper);
  opacity: 0.92;
}

@media (max-width: 480px) {
  .ig-action-bar {
    padding: 6px 8px;
    gap: 4px;
  }
  .ig-next-pill {
    padding: 7px 10px;
    font-size: 0.74rem;
    gap: 4px;
  }
}

/* Multi-Canvas Topbar Tabs */
.canvas-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 200px;
  scrollbar-width: none;
  flex-shrink: 1;
}
.canvas-tabs-bar::-webkit-scrollbar {
  display: none;
}
.canvas-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}
.canvas-tab-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.canvas-tab-pill.active {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}
.add-canvas-btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
}

/* Multi-Canvas Pannable Workbench Track & Units */
.canvas-scroll-container.space-panning {
  cursor: grab !important;
}
.canvas-scroll-container.space-panning:active {
  cursor: grabbing !important;
}

.canvas-scroll-container { cursor: grab; }
/* A drag here looks around, so it must not also select the artboard titles. The live editor frame
   opts back in: text on the page is still selectable and editable. */
.canvas-scroll-container,
.workbench-canvases-track { -webkit-user-select: none; user-select: none; }
.canvas-artboard-unit.active .artboard-frame { -webkit-user-select: auto; user-select: auto; }
.canvas-scroll-container.is-panning,
.canvas-scroll-container.is-panning * { cursor: grabbing !important; }
.canvas-artboard-unit.active .artboard-frame { cursor: auto; }
.canvas-artboard-unit:not(.active) { cursor: pointer; }

.workbench-canvases-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  min-height: 100%;
  margin: auto 0;
  padding: 10px 24px;
  flex-shrink: 0;
}

.canvas-artboard-unit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.canvas-artboard-unit:not(.active) {
  opacity: 0.65;
  cursor: pointer;
}

.canvas-artboard-unit:not(.active):hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.artboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 8px 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.canvas-artboard-unit.active .artboard-header {
  color: #f8fafc;
}

.artboard-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.artboard-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.artboard-action-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.artboard-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.artboard-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-artboard-unit:not(.active) .artboard-preview-box {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-artboard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 24px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  text-align: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.add-artboard-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.add-artboard-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.add-artboard-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 16px;
  max-width: 160px;
  line-height: 1.3;
}

.add-artboard-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.add-artboard-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.add-artboard-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.add-artboard-icon {
  font-size: 0.95rem;
  color: #f59e0b;
}

.add-artboard-name {
  font-weight: 700;
  flex: 1;
}

.add-artboard-ratio {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Export Scope Row */
.export-scope-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.export-scope-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
}

.export-scope-tabs {
  display: flex;
  gap: 6px;
}

.export-scope-tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.export-scope-tab.active {
  background: var(--ink-yellow);
  color: var(--ink-black);
  border-color: var(--ink-yellow);
}



/* =========================================================
   Studio review fixes (2026-11-12)
   ========================================================= */
/* .topbar-btn never had a base style, so Preview and "+ Size" showed as white system buttons.
   :where() keeps this at zero weight: the look switcher, shuffle and add-size rules above still win. */
:where(.topbar-btn) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
:where(.topbar-btn):hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); }
.add-canvas-btn { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); color: #f8fafc; cursor: pointer; }

/* Three sizes did not fit in 200px: the third tab was cut in half. */
@media (min-width: 1024px) {
  .canvas-tabs-bar { max-width: min(360px, 30vw); }
}

/* The badges do not scale with the zoom. renderOverlays sets .zoom-small under 30%. */
.panorama-strip.zoom-small .look-replace-badge { display: none; }

/* Pictures of the sizes that are not open (captureActiveCanvasThumb in app.js). A picture, not an editor. */
.artboard-preview-box.has-thumb { overflow: hidden; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.canvas-artboard-unit:not(.active):hover .artboard-preview-box.has-thumb { box-shadow: 0 0 0 2px #f2dc3a, 0 10px 28px rgba(0, 0, 0, 0.45); transform: translateY(-2px); }
.artboard-thumb-strip, .artboard-thumb-strip * { pointer-events: none !important; animation-play-state: paused !important; transition: none !important; }
.artboard-thumb-strip .slide-label, .artboard-thumb-strip .seam-guide, .artboard-thumb-strip .add-media-prompt { display: none !important; }

/* Overview: see every post size at once. Desktop only, like the corner zoom it stands in for. */
.overview-btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  cursor: pointer;
}
.overview-btn.active {
  background: var(--ink-yellow, #f2dc3a);
  border-color: var(--ink-yellow, #f2dc3a);
  color: var(--ink-black, #141414);
}
@media (max-width: 1023px) {
  .overview-btn { display: none !important; }
}
/* Narrow desktops keep Export on screen: the glyph alone stands in for the word. */
.overview-glyph { display: none; }
@media (min-width: 1024px) and (max-width: 1199px) {
  .overview-glyph { display: inline; }
  .overview-word { display: none; }
}
.canvas-scroll-container.is-overview .add-artboard-card { display: none; }

/* ===== Studio tidy 2026-11-20: the empty page card (replaces the pill hint and Arrange's
   permanent yellow). A real paper sheet taped over the empty page. ===== */
.empty-hint.empty-card {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-1.2deg);
  width: min(340px, calc(100% - 32px));
  max-width: min(340px, calc(100vw - 32px));
  flex-direction: column;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 30px 24px 18px;
  border-radius: 3px;
  border: 0;
  white-space: normal;
  text-align: center;
  color: var(--ink-black);
  background-color: #f4efe4;
  background-image: url('textures/paper-clean.jpg');
  background-size: 420px auto;
  background-blend-mode: multiply;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 14px 34px rgba(0,0,0,.45);
}
.empty-card-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 120px;
  height: 34px;
  transform: translateX(-50%) rotate(2.5deg);
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat;
  pointer-events: none;
}
.empty-card-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-black);
}
.empty-card-sub {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #3b3b3b;
}
.empty-card-main {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--ink-salmon);
  color: var(--ink-black);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .12s ease, filter .12s ease;
}
.empty-card-main:hover { transform: translateY(-1px); filter: brightness(1.05); }
.empty-card-link {
  border: 0;
  background: transparent;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-black);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.empty-card-quiet { font-weight: 500; color: #4a4a4a; text-decoration: none; }
.empty-card-quiet:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .empty-hint.empty-card { top: 45%; padding: 26px 18px 14px; border-radius: 3px; }
  .empty-hint.empty-card .empty-hint-close,
  .empty-hint.empty-card #emptyHintClose { position: static; font-size: 0.85rem; }
}
.empty-hint.empty-card .empty-hint-close { position: static; display: inline-block; font-size: 0.85rem; line-height: 1.3; opacity: 1; padding: 6px 8px; color: #4a4a4a; }

/* ===== Studio tidy 2026-11-20: element menus in labelled groups. Same type as the dock's
   PAPER / ADD labels. Groups wrap whole, never mid-group; on a phone the row scrolls. ===== */
.drawer-tools-scroll { align-items: flex-start; }
.tool-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.tool-group:first-child { border-left: 0; padding-left: 0; }
.tool-group:last-child { padding-right: 0; }
.tool-group-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding-left: 2px;
}
.tool-group-items {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.drawer-tools-scroll { gap: 0 !important; row-gap: 14px !important; }
@media (min-width: 768px) {
  .tool-group-items { flex-wrap: wrap; max-width: 520px; }
}
/* A value tool whose picker is open: outlined, never filled. Yellow stays for "on". */
.ig-circle-tool.open .ig-circle-icon { border: 2px solid #ffffff; background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.ig-circle-tool.open .ig-circle-label { color: #ffffff; }

/* Studio tidy: sticker shelf headings */
.shelf-group-label {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 4px 0 10px;
  white-space: nowrap;
}
.shelf-group-label:first-child { padding-left: 0; }
@media (min-width: 1024px) {
  .shelf-group-label { flex-basis: 100%; padding: 6px 0 0; }
}

/* Studio tidy: lighter top bar. The format pill and Overview stay in the DOM, hidden;
   the open size tab opens the size sheet and "All" in the zoom bar is the overview. */
#desktopFormatPill[hidden], #overviewBtn[hidden] { display: none !important; }
.canvas-tab-pill.active::after { content: ' ▾'; font-size: 0.7em; opacity: 0.7; }
.add-canvas-btn { min-width: 30px; padding-left: 0; padding-right: 0; justify-content: center; font-size: 1rem; font-weight: 800; }
@media (max-width: 768px) { .canvas-tab-pill.active::after { content: none; } }

/* Paper edge details (binding, hole punch): above the multiplied grain, never blended. */
.paper-edge-layer { position: absolute; inset: 0; pointer-events: none; z-index: 15; mix-blend-mode: normal; }

/* Paper dye: the color wheel is the last choice in the dye picker. The whole chip opens it. */
.dye-wheel-option { position: relative; display: inline-flex; align-items: center; }
.dye-wheel-swatch { position: static; width: 13px; height: 13px; border: 0; overflow: visible; }
.dye-wheel-swatch .color-wheel-disc { display: block; width: 13px; height: 13px; border-width: 1px; box-shadow: none; }
.dye-wheel-option .inline-color-wheel-input { inset: 0; width: 100%; height: 100%; border-radius: 999px; }

/* Field Notes link in top navbar: keep compact widths (<=1140px) unobstructed in Studio */
@media (max-width: 1140px) { .nav-tab-notes { display: none !important; } }

/* Preview mode switcher: Clean Reader hides Instagram chrome while preserving exact viewport width */
.phone-frame.clean-reader-mode .ig-post-header,
.phone-frame.clean-reader-mode .ig-post-footer {
  display: none !important;
}
.phone-frame.clean-reader-mode {
  border-color: transparent;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}
